@intlayer/design-system 5.7.3 → 5.7.4
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/Form-CriPBaZk.js.map +1 -1
- package/dist/Form-DJrUK3mm.cjs.map +1 -1
- package/dist/components/CopyToClipboard/index.cjs +32 -23
- package/dist/components/CopyToClipboard/index.cjs.map +1 -1
- package/dist/components/CopyToClipboard/index.d.ts.map +1 -1
- package/dist/components/CopyToClipboard/index.mjs +32 -23
- package/dist/components/CopyToClipboard/index.mjs.map +1 -1
- package/dist/components/Form/elements/CheckboxElement.d.ts +2 -2
- package/dist/components/Form/elements/CheckboxElement.d.ts.map +1 -1
- package/dist/components/Input/Checkbox.cjs +29 -22
- package/dist/components/Input/Checkbox.cjs.map +1 -1
- package/dist/components/Input/Checkbox.d.ts +3 -2
- package/dist/components/Input/Checkbox.d.ts.map +1 -1
- package/dist/components/Input/Checkbox.mjs +30 -23
- package/dist/components/Input/Checkbox.mjs.map +1 -1
- package/dist/hooks/index.cjs +2 -1
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.mjs +3 -2
- package/dist/hooks/intlayerAPIHooks.cjs +8 -6
- package/dist/hooks/intlayerAPIHooks.cjs.map +1 -1
- package/dist/hooks/intlayerAPIHooks.d.ts +222 -17
- package/dist/hooks/intlayerAPIHooks.d.ts.map +1 -1
- package/dist/hooks/intlayerAPIHooks.mjs +8 -6
- package/dist/hooks/intlayerAPIHooks.mjs.map +1 -1
- package/dist/hooks/useAuth/useAuth.cjs.map +1 -1
- package/dist/hooks/useAuth/useAuth.d.ts +6 -6
- package/dist/hooks/useAuth/useAuth.d.ts.map +1 -1
- package/dist/hooks/useAuth/useAuth.mjs.map +1 -1
- package/dist/hooks/useAuth/useSession.cjs.map +1 -1
- package/dist/hooks/useAuth/useSession.d.ts +354 -6
- package/dist/hooks/useAuth/useSession.d.ts.map +1 -1
- package/dist/hooks/useAuth/useSession.mjs.map +1 -1
- package/dist/hooks/useUser/index.d.ts +18 -2
- package/dist/hooks/useUser/index.d.ts.map +1 -1
- package/package.json +17 -17
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { jsxs,
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { cva } from "class-variance-authority";
|
|
3
|
-
import { useId } from "react";
|
|
4
3
|
const checkboxVariants = cva("", {
|
|
5
4
|
variants: {
|
|
6
5
|
variant: {
|
|
@@ -40,34 +39,42 @@ const checkboxVariants = cva("", {
|
|
|
40
39
|
size: "md"
|
|
41
40
|
}
|
|
42
41
|
});
|
|
43
|
-
const
|
|
42
|
+
const Input = ({
|
|
44
43
|
validationStyleEnabled = false,
|
|
45
44
|
label,
|
|
46
45
|
size,
|
|
47
46
|
color,
|
|
47
|
+
name,
|
|
48
48
|
variant,
|
|
49
49
|
className,
|
|
50
50
|
...props
|
|
51
|
-
}) =>
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
51
|
+
}) => /* @__PURE__ */ jsx(
|
|
52
|
+
"input",
|
|
53
|
+
{
|
|
54
|
+
type: "checkbox",
|
|
55
|
+
className: checkboxVariants({
|
|
56
|
+
variant,
|
|
57
|
+
size,
|
|
58
|
+
color,
|
|
59
|
+
validationStyleEnabled: validationStyleEnabled ? "enabled" : "disabled",
|
|
60
|
+
className
|
|
61
|
+
}),
|
|
62
|
+
...props
|
|
63
|
+
}
|
|
64
|
+
);
|
|
65
|
+
const Checkbox = (props) => {
|
|
66
|
+
const { label, name, id } = props;
|
|
67
|
+
return label ? /* @__PURE__ */ jsxs(
|
|
68
|
+
"label",
|
|
69
|
+
{
|
|
70
|
+
htmlFor: id ?? name,
|
|
71
|
+
className: "flex items-center gap-x-4 font-medium text-sm cursor-pointer",
|
|
72
|
+
children: [
|
|
73
|
+
/* @__PURE__ */ jsx(Input, { id: id ?? name, ...props }),
|
|
74
|
+
label
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
) : /* @__PURE__ */ jsx(Input, { id: id ?? name, ...props });
|
|
71
78
|
};
|
|
72
79
|
export {
|
|
73
80
|
Checkbox,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.mjs","sources":["../../../src/components/Input/Checkbox.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport {\n
|
|
1
|
+
{"version":3,"file":"Checkbox.mjs","sources":["../../../src/components/Input/Checkbox.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport {\n ReactNode,\n type DetailedHTMLProps,\n type FC,\n type InputHTMLAttributes,\n} from 'react';\n\nexport const checkboxVariants = cva('', {\n variants: {\n variant: {\n default: [\n 'pointer rounded border-2 bg-input-background text-input-text shadow-none outline-0 transition-all',\n 'border-input-border hover:border-input-border-hover focus:border-input-border-focus focus:outline-0 focus:[box-shadow:none]',\n 'checked:bg-checkbox-checked checked:border-checkbox-checked-border',\n 'disabled:opacity-50',\n ],\n },\n size: {\n sm: 'size-4',\n md: 'size-5',\n lg: 'size-6',\n },\n color: {\n primary: 'accent-primary',\n secondary: 'accent-secondary',\n destructive: 'accent-destructive',\n neutral: 'accent-neutral',\n light: 'accent-light',\n text: 'accent-text',\n dark: 'accent-dark',\n error: 'accent-error',\n success: 'accent-success',\n custom: 'accent-custom',\n },\n validationStyleEnabled: {\n disabled: '',\n enabled: 'valid:border-success invalid:border-error',\n },\n },\n defaultVariants: {\n variant: 'default',\n color: 'primary',\n validationStyleEnabled: 'disabled',\n size: 'md',\n },\n});\n\nexport type CheckboxProps = Omit<\n DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>,\n 'size'\n> & {\n name: string;\n validationStyleEnabled?: boolean;\n label?: ReactNode;\n} & Omit<VariantProps<typeof checkboxVariants>, 'validationStyleEnabled'>;\n\nconst Input: FC<CheckboxProps> = ({\n validationStyleEnabled = false,\n label,\n size,\n color,\n name,\n variant,\n className,\n ...props\n}) => (\n <input\n type=\"checkbox\"\n className={checkboxVariants({\n variant,\n size,\n color,\n validationStyleEnabled: validationStyleEnabled ? 'enabled' : 'disabled',\n className,\n })}\n {...props}\n />\n);\n\nexport const Checkbox: FC<CheckboxProps> = (props) => {\n const { label, name, id } = props;\n\n return label ? (\n <label\n htmlFor={id ?? name}\n className=\"flex items-center gap-x-4 font-medium text-sm cursor-pointer\"\n >\n <Input id={id ?? name} {...props} />\n {label}\n </label>\n ) : (\n <Input id={id ?? name} {...props} />\n );\n};\n"],"names":[],"mappings":";;AAQa,MAAA,mBAAmB,IAAI,IAAI;AAAA,EACtC,UAAU;AAAA,IACR,SAAS;AAAA,MACP,SAAS;AAAA,QACP;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MAAA;AAAA,IAEJ;AAAA,IACA,MAAM;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IACN;AAAA,IACA,OAAO;AAAA,MACL,SAAS;AAAA,MACT,WAAW;AAAA,MACX,aAAa;AAAA,MACb,SAAS;AAAA,MACT,OAAO;AAAA,MACP,MAAM;AAAA,MACN,MAAM;AAAA,MACN,OAAO;AAAA,MACP,SAAS;AAAA,MACT,QAAQ;AAAA,IACV;AAAA,IACA,wBAAwB;AAAA,MACtB,UAAU;AAAA,MACV,SAAS;AAAA,IAAA;AAAA,EAEb;AAAA,EACA,iBAAiB;AAAA,IACf,SAAS;AAAA,IACT,OAAO;AAAA,IACP,wBAAwB;AAAA,IACxB,MAAM;AAAA,EAAA;AAEV,CAAC;AAWD,MAAM,QAA2B,CAAC;AAAA,EAChC,yBAAyB;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MACE;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,MAAK;AAAA,IACL,WAAW,iBAAiB;AAAA,MAC1B;AAAA,MACA;AAAA,MACA;AAAA,MACA,wBAAwB,yBAAyB,YAAY;AAAA,MAC7D;AAAA,IAAA,CACD;AAAA,IACA,GAAG;AAAA,EAAA;AACN;AAGW,MAAA,WAA8B,CAAC,UAAU;AACpD,QAAM,EAAE,OAAO,MAAM,GAAO,IAAA;AAE5B,SAAO,QACL;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,SAAS,MAAM;AAAA,MACf,WAAU;AAAA,MAEV,UAAA;AAAA,QAAA,oBAAC,OAAM,EAAA,IAAI,MAAM,MAAO,GAAG,OAAO;AAAA,QACjC;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,IAGF,oBAAA,OAAA,EAAM,IAAI,MAAM,MAAO,GAAG,OAAO;AAEtC;"}
|
package/dist/hooks/index.cjs
CHANGED
|
@@ -36,7 +36,6 @@ exports.useAutocomplete = hooks_intlayerAPIHooks.useAutocomplete;
|
|
|
36
36
|
exports.useCancelSubscription = hooks_intlayerAPIHooks.useCancelSubscription;
|
|
37
37
|
exports.useChangePassword = hooks_intlayerAPIHooks.useChangePassword;
|
|
38
38
|
exports.useCreateUser = hooks_intlayerAPIHooks.useCreateUser;
|
|
39
|
-
exports.useDefineNewPassword = hooks_intlayerAPIHooks.useDefineNewPassword;
|
|
40
39
|
exports.useDeleteAccessKey = hooks_intlayerAPIHooks.useDeleteAccessKey;
|
|
41
40
|
exports.useDeleteDictionary = hooks_intlayerAPIHooks.useDeleteDictionary;
|
|
42
41
|
exports.useDeleteOrganization = hooks_intlayerAPIHooks.useDeleteOrganization;
|
|
@@ -55,11 +54,13 @@ exports.useGetSubscription = hooks_intlayerAPIHooks.useGetSubscription;
|
|
|
55
54
|
exports.useGetTags = hooks_intlayerAPIHooks.useGetTags;
|
|
56
55
|
exports.useGetUserByAccount = hooks_intlayerAPIHooks.useGetUserByAccount;
|
|
57
56
|
exports.useGetUsers = hooks_intlayerAPIHooks.useGetUsers;
|
|
57
|
+
exports.useGetVerifyEmailStatus = hooks_intlayerAPIHooks.useGetVerifyEmailStatus;
|
|
58
58
|
exports.useLogin = hooks_intlayerAPIHooks.useLogin;
|
|
59
59
|
exports.useLogout = hooks_intlayerAPIHooks.useLogout;
|
|
60
60
|
exports.usePushDictionaries = hooks_intlayerAPIHooks.usePushDictionaries;
|
|
61
61
|
exports.useRefreshAccessKey = hooks_intlayerAPIHooks.useRefreshAccessKey;
|
|
62
62
|
exports.useRegister = hooks_intlayerAPIHooks.useRegister;
|
|
63
|
+
exports.useResetPassword = hooks_intlayerAPIHooks.useResetPassword;
|
|
63
64
|
exports.useSearchDoc = hooks_intlayerAPIHooks.useSearchDoc;
|
|
64
65
|
exports.useSelectOrganization = hooks_intlayerAPIHooks.useSelectOrganization;
|
|
65
66
|
exports.useSelectProject = hooks_intlayerAPIHooks.useSelectProject;
|
package/dist/hooks/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/hooks/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getAuthAPI } from "./auth.mjs";
|
|
2
|
-
import { useAddDictionary, useAddNewAccessKey, useAddOrganization, useAddOrganizationMember, useAddProject, useAddTag, useAskDocQuestion, useAskResetPassword, useAuditContentDeclaration, useAuditContentDeclarationField, useAuditContentDeclarationMetadata, useAuditTag, useAutocomplete, useCancelSubscription, useChangePassword, useCreateUser,
|
|
2
|
+
import { useAddDictionary, useAddNewAccessKey, useAddOrganization, useAddOrganizationMember, useAddProject, useAddTag, useAskDocQuestion, useAskResetPassword, useAuditContentDeclaration, useAuditContentDeclarationField, useAuditContentDeclarationMetadata, useAuditTag, useAutocomplete, useCancelSubscription, useChangePassword, useCreateUser, useDeleteAccessKey, useDeleteDictionary, useDeleteOrganization, useDeleteProject, useDeleteTag, useDeleteUser, useGetDictionaries, useGetDictionariesKeys, useGetDictionary, useGetEditorDictionaries, useGetNewsletterStatus, useGetOrganizations, useGetPricing, useGetProjects, useGetSubscription, useGetTags, useGetUserByAccount, useGetUsers, useGetVerifyEmailStatus, useLogin, useLogout, usePushDictionaries, useRefreshAccessKey, useRegister, useResetPassword, useSearchDoc, useSelectOrganization, useSelectProject, useSubscribeToNewsletter, useTranslateJSONDeclaration, useUnselectOrganization, useUnselectProject, useUnsubscribeFromNewsletter, useUpdateDictionary, useUpdateOrganization, useUpdateOrganizationMembers, useUpdateProject, useUpdateProjectMembers, useUpdateTag, useUpdateUser, useVerifyEmail, useWriteDictionary } from "./intlayerAPIHooks.mjs";
|
|
3
3
|
import { useAsync } from "./useAsync/useAsync.mjs";
|
|
4
4
|
import { AsyncStateProvider, useAsyncState } from "./useAsync/useAsyncStateStore.mjs";
|
|
5
5
|
import { useAuth } from "./useAuth/useAuth.mjs";
|
|
@@ -44,7 +44,6 @@ export {
|
|
|
44
44
|
useCancelSubscription,
|
|
45
45
|
useChangePassword,
|
|
46
46
|
useCreateUser,
|
|
47
|
-
useDefineNewPassword,
|
|
48
47
|
useDeleteAccessKey,
|
|
49
48
|
useDeleteDictionary,
|
|
50
49
|
useDeleteOrganization,
|
|
@@ -66,6 +65,7 @@ export {
|
|
|
66
65
|
useGetTags,
|
|
67
66
|
useGetUserByAccount,
|
|
68
67
|
useGetUsers,
|
|
68
|
+
useGetVerifyEmailStatus,
|
|
69
69
|
useIsDarkMode,
|
|
70
70
|
useIsMounted,
|
|
71
71
|
useItemSelector,
|
|
@@ -77,6 +77,7 @@ export {
|
|
|
77
77
|
usePushDictionaries,
|
|
78
78
|
useRefreshAccessKey,
|
|
79
79
|
useRegister,
|
|
80
|
+
useResetPassword,
|
|
80
81
|
useScreenWidth,
|
|
81
82
|
u as useScrollBlockage,
|
|
82
83
|
useScrollDetection,
|
|
@@ -88,6 +88,11 @@ const useLogin = (args) => useAppAsync("login", hooks_useIntlayerAPI.useIntlayer
|
|
|
88
88
|
invalidateQueries: ["getSession"],
|
|
89
89
|
...args
|
|
90
90
|
});
|
|
91
|
+
const useGetVerifyEmailStatus = (args) => useAppAsync(
|
|
92
|
+
"getVerifyEmailStatus",
|
|
93
|
+
hooks_useIntlayerAPI.useIntlayerAuth().verifyEmailSession,
|
|
94
|
+
args
|
|
95
|
+
);
|
|
91
96
|
const useRegister = (args) => useAppAsync("register", hooks_useIntlayerAPI.useIntlayerAuth().signUpEmail, {
|
|
92
97
|
invalidateQueries: ["getSession"],
|
|
93
98
|
...args
|
|
@@ -101,11 +106,7 @@ const useAskResetPassword = (args) => useAppAsync(
|
|
|
101
106
|
hooks_useIntlayerAPI.useIntlayerAuth().requestPasswordResetSession,
|
|
102
107
|
args
|
|
103
108
|
);
|
|
104
|
-
const
|
|
105
|
-
"defineNewPassword",
|
|
106
|
-
hooks_useIntlayerAPI.useIntlayerAuth().changePasswordSession,
|
|
107
|
-
args
|
|
108
|
-
);
|
|
109
|
+
const useResetPassword = (args) => useAppAsync("resetPassword", hooks_useIntlayerAPI.useIntlayerAuth().resetPassword, args);
|
|
109
110
|
const useVerifyEmail = (args) => useAppAsync("verifyEmail", hooks_useIntlayerAPI.useIntlayerAuth().verifyEmailSession, args);
|
|
110
111
|
const useGetUserByAccount = (args) => useAppAsync("getUserByAccount", hooks_useIntlayerAPI.useIntlayerAuth().accountInfo, args);
|
|
111
112
|
const useGetUsers = (args) => useAppAsync(
|
|
@@ -496,7 +497,6 @@ exports.useAutocomplete = useAutocomplete;
|
|
|
496
497
|
exports.useCancelSubscription = useCancelSubscription;
|
|
497
498
|
exports.useChangePassword = useChangePassword;
|
|
498
499
|
exports.useCreateUser = useCreateUser;
|
|
499
|
-
exports.useDefineNewPassword = useDefineNewPassword;
|
|
500
500
|
exports.useDeleteAccessKey = useDeleteAccessKey;
|
|
501
501
|
exports.useDeleteDictionary = useDeleteDictionary;
|
|
502
502
|
exports.useDeleteOrganization = useDeleteOrganization;
|
|
@@ -515,11 +515,13 @@ exports.useGetSubscription = useGetSubscription;
|
|
|
515
515
|
exports.useGetTags = useGetTags;
|
|
516
516
|
exports.useGetUserByAccount = useGetUserByAccount;
|
|
517
517
|
exports.useGetUsers = useGetUsers;
|
|
518
|
+
exports.useGetVerifyEmailStatus = useGetVerifyEmailStatus;
|
|
518
519
|
exports.useLogin = useLogin;
|
|
519
520
|
exports.useLogout = useLogout;
|
|
520
521
|
exports.usePushDictionaries = usePushDictionaries;
|
|
521
522
|
exports.useRefreshAccessKey = useRefreshAccessKey;
|
|
522
523
|
exports.useRegister = useRegister;
|
|
524
|
+
exports.useResetPassword = useResetPassword;
|
|
523
525
|
exports.useSearchDoc = useSearchDoc;
|
|
524
526
|
exports.useSelectOrganization = useSelectOrganization;
|
|
525
527
|
exports.useSelectProject = useSelectProject;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intlayerAPIHooks.cjs","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":["useToast","error","useConfiguration","useAuth","useAsync","useIntlayerAuth","useIntlayerOAuth"],"mappings":";;;;;;;;;;;;;;;AAUA,MAAM,kBAAkB,CAAC,cAAsB,UAAU,MAAM,GAAG,EAAE,KAAK,GAAG;AAK5E,MAAM,mBAAmB,CAAiC,YAAkB;AACpE,QAAA,EAAE,MAAM,IAAIA,qCAAS;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,CAACC,WAAUA,MAAK,EACxB;AAAA,QAAQ,CAACA,WACR,MAAM;AAAA,UACJ,OAAO;AAAA,aACJ,2BAAY,aAAa,eACtBA,OAAM,QACNA,OAAM,SAAS;AAAA,UACrB;AAAA,UACA,aAAaA,OAAM,WAAW,gBAAgB;AAAA,UAC9C,SAAS;AAAA,QACV,CAAA;AAAA,MACH;AACF,cAAQ,UAAU,YAAY;AAAA,IAChC;AAAA,IACA,WAAW,CAAC,SAAS;AACnB,UAAI,MAAM,OAAO;AACT,cAAA;AAAA,UACJ,OAAO;AAAA,YACL,KAAK,MAAM,SAAS,KAAK,MAAM,QAAQ;AAAA,UACzC;AAAA,UACA,aACE,KAAK,MAAM,WAAW,KAAK,MAAM,QAAQ;AAAA,UAC3C,SAAS;AAAA,QAAA,CACV;AAAA,MAAA;AAGH,UAAI,MAAM;AACF,cAAA;AAAA,UACJ,OAAO,KAAK;AAAA,UACZ,aAAa,KAAK;AAAA,UAClB,SAAS;AAAA,QAAA,CACV;AACH,cAAQ,YAAY,IAAI;AAAA,IAAA;AAAA,EAE5B;AACF;AAWA,MAAM,gBAAgB,C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F;AAEW,MAAA,2BAA2B,CACtC,SAEA,eAAe,mBAAmBA,sCAAiB,EAAE,OAAO,iBAAiB;AAAA,EAC3E,OAAO;AAAA,EACP,OAAO;AAAA,EACP,GAAG;AACL,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"intlayerAPIHooks.cjs","sources":["../../src/hooks/intlayerAPIHooks.ts"],"sourcesContent":["'use client';\n\nimport type { IntlayerAPI } from '@intlayer/api';\nimport { useConfiguration } from '@intlayer/editor-react';\nimport { useToast } from '../components/Toaster';\nimport { getAuthAPI } from './auth';\nimport { type UseAsyncOptions, useAsync } from './useAsync/useAsync';\nimport { useAuth } from './useAuth';\nimport { useIntlayerAuth, useIntlayerOAuth } from './useIntlayerAPI';\n\nconst formatErrorCode = (errorCode: string) => errorCode.split('_').join(' ');\n\n/**\n * Hook to handle error logging and toast notifications\n */\nconst useErrorHandling = <T extends UseAsyncOptions<any>>(options: T): T => {\n const { toast } = useToast();\n\n return {\n ...options,\n onError: (errorMessage) => {\n let error;\n\n // If json is valid, parse it\n try {\n if (typeof errorMessage === 'undefined') return;\n\n error = JSON.parse(errorMessage);\n } catch (e) {\n // If json is not valid, set error to the original errorMessage\n\n error = errorMessage;\n }\n\n // render toast for each error if there is more than one\n // otherwise render the toast with the error message\n [error]\n .flatMap((error) => error)\n .forEach((error) =>\n toast({\n title: formatErrorCode(\n (process.env.NODE_ENV === 'production'\n ? error.title\n : error.code) ?? 'Error'\n ),\n description: error.message ?? errorMessage ?? 'An error occurred',\n variant: 'error',\n })\n );\n options.onError?.(errorMessage);\n },\n onSuccess: (data) => {\n if (data?.error) {\n toast({\n title: formatErrorCode(\n data.error.title ?? data.error.code ?? 'Error'\n ),\n description:\n data.error.message ?? data.error.code ?? 'An error occurred',\n variant: 'error',\n });\n }\n\n if (data?.message)\n toast({\n title: data.message,\n description: data.description,\n variant: 'success',\n });\n options.onSuccess?.(data);\n },\n };\n};\n\ntype AuthEnableOptions = {\n requireUser?: boolean;\n requireProject?: boolean;\n requireOrganization?: boolean;\n};\n\n/**\n * Hook to enable authentication\n */\nconst useAuthEnable = <T extends UseAsyncOptions<any>>(\n options: T,\n { requireUser, requireProject, requireOrganization }: AuthEnableOptions = {}\n): T => {\n const configuration = useConfiguration();\n const { oAuth2AccessToken, session } = useAuth({\n intlayerConfiguration: configuration,\n });\n\n const isEnabledOption = options?.enable ?? true;\n const user = session ? session.user : oAuth2AccessToken?.user;\n\n const organization = session\n ? session.organization\n : oAuth2AccessToken?.organization;\n\n const project = session ? session.project : oAuth2AccessToken?.project;\n\n const isUserEnabled = requireUser ? Boolean(user) : true;\n\n const isProjectEnabled = requireProject ? Boolean(project) : true;\n\n const isOrganizationEnabled = requireOrganization\n ? Boolean(organization)\n : true;\n\n const isEnabled =\n isEnabledOption &&\n isUserEnabled &&\n isProjectEnabled &&\n isOrganizationEnabled;\n\n return {\n ...options,\n enable: isEnabled,\n };\n};\n\nconst useAppAsync = <\n U extends string,\n T extends (...args: any[]) => Promise<any>,\n>(\n key: U,\n asyncFunction: T,\n options?: UseAsyncOptions<T>,\n authOptions?: AuthEnableOptions\n) => {\n // Enhance options using custom hooks\n const optionsWithAuth = useAuthEnable(options ?? {}, authOptions);\n\n const optionsWithErrorHandling = useErrorHandling(optionsWithAuth);\n\n // Call the main useAsync hook with enhanced options\n return useAsync(key, asyncFunction, optionsWithErrorHandling);\n};\n\nconst useEditorAsync = <\n U extends string,\n T extends (...args: any[]) => Promise<any>,\n>(\n key: U,\n asyncFunction: T,\n options?: UseAsyncOptions<T>\n) => {\n const optionsWithErrorHandling = useErrorHandling(options ?? {});\n\n // Call the main useAsync hook with enhanced options\n return useAsync(key, asyncFunction, optionsWithErrorHandling);\n};\n\n/**\n * Auth\n */\n\nexport const useLogin = (\n args?: UseAsyncOptions<ReturnType<typeof getAuthAPI>['signInEmail']>\n) =>\n useAppAsync('login', useIntlayerAuth().signInEmail, {\n invalidateQueries: ['getSession'],\n ...args,\n });\n\nexport const useGetVerifyEmailStatus = (\n args?: UseAsyncOptions<ReturnType<typeof getAuthAPI>['verifyEmailSession']>\n) =>\n useAppAsync(\n 'getVerifyEmailStatus',\n useIntlayerAuth().verifyEmailSession,\n args\n );\n\nexport const useRegister = (\n args?: UseAsyncOptions<ReturnType<typeof getAuthAPI>['signUpEmail']>\n) =>\n useAppAsync('register', useIntlayerAuth().signUpEmail, {\n invalidateQueries: ['getSession'],\n ...args,\n });\n\nexport const useLogout = (\n args?: UseAsyncOptions<ReturnType<typeof getAuthAPI>['signOut']>\n) =>\n useAppAsync('logout', useIntlayerAuth().signOut, {\n ...args,\n });\n\nexport const useChangePassword = (\n args?: UseAsyncOptions<ReturnType<typeof getAuthAPI>['changePasswordSession']>\n) =>\n useAppAsync('changePassword', useIntlayerAuth().changePasswordSession, args);\n\nexport const useAskResetPassword = (\n args?: UseAsyncOptions<\n ReturnType<typeof getAuthAPI>['requestPasswordResetSession']\n >\n) =>\n useAppAsync(\n 'askResetPassword',\n useIntlayerAuth().requestPasswordResetSession,\n args\n );\n\nexport const useResetPassword = (\n args?: UseAsyncOptions<ReturnType<typeof getAuthAPI>['resetPassword']>\n) => useAppAsync('resetPassword', useIntlayerAuth().resetPassword, args);\n\nexport const useVerifyEmail = (\n args?: UseAsyncOptions<ReturnType<typeof getAuthAPI>['verifyEmailSession']>\n) => useAppAsync('verifyEmail', useIntlayerAuth().verifyEmailSession, args);\n\nexport const useGetUserByAccount = (\n args?: UseAsyncOptions<ReturnType<typeof getAuthAPI>['accountInfo']>\n) => useAppAsync('getUserByAccount', useIntlayerAuth().accountInfo, args);\n\n/**\n * User\n */\n\nexport const useGetUsers = (\n args?: UseAsyncOptions<IntlayerAPI['user']['getUsers']>\n) =>\n useAppAsync(\n 'getUsers',\n useIntlayerOAuth().user.getUsers,\n {\n cache: true,\n store: true,\n retryLimit: 3,\n autoFetch: true,\n revalidateTime: 5 * 60 * 1000, // 5 minutes\n ...args,\n },\n {\n requireUser: true,\n }\n );\n\nexport const useCreateUser = (\n args?: UseAsyncOptions<ReturnType<typeof getAuthAPI>['updateUser']>\n) =>\n useAppAsync('createUser', useIntlayerAuth().updateUser, {\n invalidateQueries: ['getUsers'],\n ...args,\n });\n\nexport const useUpdateUser = (\n args?: UseAsyncOptions<IntlayerAPI['user']['updateUser']>\n) =>\n useAppAsync('updateUser', useIntlayerOAuth().user.updateUser, {\n invalidateQueries: ['getSession'],\n ...args,\n });\n\nexport const useDeleteUser = (\n args?: UseAsyncOptions<IntlayerAPI['user']['deleteUser']>\n) =>\n useAppAsync('deleteUser', useIntlayerOAuth().user.deleteUser, {\n invalidateQueries: ['getUsers'],\n ...args,\n });\n\n/**\n * Organization\n */\n\nexport const useGetOrganizations = (\n args?: UseAsyncOptions<IntlayerAPI['organization']['getOrganizations']>\n) =>\n useAppAsync(\n 'getOrganizations',\n useIntlayerOAuth().organization.getOrganizations,\n {\n cache: true,\n store: true,\n retryLimit: 3,\n autoFetch: true,\n revalidation: true,\n revalidateTime: 5 * 60 * 1000, // 5 minutes\n ...args,\n },\n {\n requireUser: true,\n }\n );\n\nexport const useAddOrganization = (\n args?: UseAsyncOptions<IntlayerAPI['organization']['addOrganization']>\n) =>\n useAppAsync(\n 'addOrganization',\n useIntlayerOAuth().organization.addOrganization,\n {\n invalidateQueries: ['getOrganizations'],\n ...args,\n }\n );\n\nexport const useUpdateOrganization = (\n args?: UseAsyncOptions<IntlayerAPI['organization']['updateOrganization']>\n) =>\n useAppAsync(\n 'updateOrganization',\n useIntlayerOAuth().organization.updateOrganization,\n {\n invalidateQueries: ['getSession'],\n ...args,\n }\n );\n\nexport const useUpdateOrganizationMembers = (\n args?: UseAsyncOptions<\n IntlayerAPI['organization']['updateOrganizationMembers']\n >\n) =>\n useAppAsync(\n 'updateOrganizationMembers',\n useIntlayerOAuth().organization.updateOrganizationMembers,\n {\n invalidateQueries: ['getOrganizations', 'getSession'],\n ...args,\n }\n );\n\nexport const useAddOrganizationMember = (\n args?: UseAsyncOptions<IntlayerAPI['organization']['addOrganizationMember']>\n) =>\n useAppAsync(\n 'addOrganizationMember',\n useIntlayerOAuth().organization.addOrganizationMember,\n {\n invalidateQueries: ['getOrganizations', 'getSession'],\n ...args,\n }\n );\n\nexport const useDeleteOrganization = (\n args?: UseAsyncOptions<IntlayerAPI['organization']['deleteOrganization']>\n) =>\n useAppAsync(\n 'deleteOrganization',\n useIntlayerOAuth().organization.deleteOrganization,\n {\n invalidateQueries: ['getOrganizations', 'getSession'],\n ...args,\n }\n );\n\nexport const useSelectOrganization = (\n args?: UseAsyncOptions<IntlayerAPI['organization']['selectOrganization']>\n) =>\n useAppAsync(\n 'selectOrganization',\n useIntlayerOAuth().organization.selectOrganization,\n {\n invalidateQueries: ['getSession'],\n ...args,\n }\n );\n\nexport const useUnselectOrganization = (\n args?: UseAsyncOptions<IntlayerAPI['organization']['unselectOrganization']>\n) =>\n useAppAsync(\n 'unselectOrganization',\n useIntlayerOAuth().organization.unselectOrganization,\n {\n invalidateQueries: ['getSession'],\n ...args,\n }\n );\n\n/**\n * Project\n */\n\nexport const useGetProjects = (\n args?: UseAsyncOptions<IntlayerAPI['project']['getProjects']>\n) =>\n useAppAsync(\n 'getProjects',\n useIntlayerOAuth().project.getProjects,\n {\n cache: true,\n store: true,\n retryLimit: 3,\n autoFetch: true,\n revalidation: true,\n revalidateTime: 5 * 60 * 1000, // 5 minutes\n ...args,\n },\n {\n requireUser: true,\n requireOrganization: true,\n }\n );\n\nexport const useAddProject = (\n args?: UseAsyncOptions<IntlayerAPI['project']['addProject']>\n) =>\n useAppAsync('addProject', useIntlayerOAuth().project.addProject, {\n invalidateQueries: ['getProjects'],\n ...args,\n });\n\nexport const useUpdateProject = (\n args?: UseAsyncOptions<IntlayerAPI['project']['updateProject']>\n) =>\n useAppAsync('updateProject', useIntlayerOAuth().project.updateProject, {\n invalidateQueries: ['getSession'],\n ...args,\n });\n\nexport const useUpdateProjectMembers = (\n args?: UseAsyncOptions<IntlayerAPI['project']['updateProjectMembers']>\n) =>\n useAppAsync(\n 'updateProjectMembers',\n useIntlayerOAuth().project.updateProjectMembers,\n {\n invalidateQueries: ['getSession'],\n ...args,\n }\n );\n\nexport const useDeleteProject = (\n args?: UseAsyncOptions<IntlayerAPI['project']['deleteProject']>\n) =>\n useAppAsync('deleteProject', useIntlayerOAuth().project.deleteProject, {\n invalidateQueries: ['getProjects', 'getSession'],\n ...args,\n });\n\nexport const useSelectProject = (\n args?: UseAsyncOptions<IntlayerAPI['project']['selectProject']>\n) =>\n useAppAsync('selectProject', useIntlayerOAuth().project.selectProject, {\n invalidateQueries: ['getSession'],\n ...args,\n });\n\nexport const useUnselectProject = (\n args?: UseAsyncOptions<IntlayerAPI['project']['unselectProject']>\n) =>\n useAppAsync('unselectProject', useIntlayerOAuth().project.unselectProject, {\n invalidateQueries: ['getSession'],\n ...args,\n });\n\nexport const useAddNewAccessKey = (\n args?: UseAsyncOptions<IntlayerAPI['project']['addNewAccessKey']>\n) =>\n useAppAsync('addNewAccessKey', useIntlayerOAuth().project.addNewAccessKey, {\n invalidateQueries: ['getSession'],\n ...args,\n });\n\nexport const useDeleteAccessKey = (\n args?: UseAsyncOptions<IntlayerAPI['project']['deleteAccessKey']>\n) =>\n useAppAsync('deleteAccessKey', useIntlayerOAuth().project.deleteAccessKey, {\n invalidateQueries: ['getSession'],\n ...args,\n });\n\nexport const useRefreshAccessKey = (\n args?: UseAsyncOptions<IntlayerAPI['project']['refreshAccessKey']>\n) =>\n useAppAsync('refreshAccessKey', useIntlayerOAuth().project.refreshAccessKey, {\n invalidateQueries: ['getSession'],\n ...args,\n });\n\n/**\n * Dictionary\n */\n\nexport const useGetDictionaries = (\n args?: UseAsyncOptions<IntlayerAPI['dictionary']['getDictionaries']>\n) =>\n useAppAsync(\n 'getDictionaries',\n useIntlayerOAuth().dictionary.getDictionaries,\n {\n cache: true,\n store: true,\n retryLimit: 3,\n autoFetch: true,\n revalidation: true,\n revalidateTime: 5 * 60 * 1000, // 5 minutes\n ...args,\n },\n {\n requireUser: true,\n requireOrganization: true,\n requireProject: true,\n }\n );\n\nexport const useGetDictionariesKeys = (\n args?: UseAsyncOptions<IntlayerAPI['dictionary']['getDictionariesKeys']>\n) =>\n useAppAsync(\n 'getDictionariesKeys',\n useIntlayerOAuth().dictionary.getDictionariesKeys,\n {\n cache: true,\n store: true,\n retryLimit: 3,\n autoFetch: true,\n revalidation: true,\n revalidateTime: 5 * 60 * 1000, // 5 minutes\n ...args,\n },\n {\n requireUser: true,\n requireOrganization: true,\n requireProject: true,\n }\n );\n\nexport const useGetDictionary = (\n args?: UseAsyncOptions<IntlayerAPI['dictionary']['getDictionary']>\n) =>\n useAppAsync(\n 'getDictionary',\n useIntlayerOAuth().dictionary.getDictionary,\n {\n cache: true,\n store: true,\n retryLimit: 3,\n revalidation: true,\n revalidateTime: 5 * 60 * 1000, // 5 minutes\n ...args,\n },\n {\n requireUser: true,\n requireOrganization: true,\n requireProject: true,\n }\n );\n\nexport const useAddDictionary = (\n args?: UseAsyncOptions<IntlayerAPI['dictionary']['addDictionary']>\n) =>\n useAppAsync('addDictionary', useIntlayerOAuth().dictionary.addDictionary, {\n invalidateQueries: ['getDictionaries', 'getDictionariesKeys'],\n ...args,\n });\n\nexport const usePushDictionaries = (\n args?: UseAsyncOptions<IntlayerAPI['dictionary']['pushDictionaries']>\n) =>\n useAppAsync(\n 'pushDictionaries',\n useIntlayerOAuth().dictionary.pushDictionaries,\n {\n invalidateQueries: [\n 'getDictionaries',\n 'getDictionary',\n 'getDictionariesKeys',\n ],\n ...args,\n }\n );\n\nexport const useUpdateDictionary = (\n args?: UseAsyncOptions<IntlayerAPI['dictionary']['updateDictionary']>\n) =>\n useAppAsync(\n 'updateDictionary',\n useIntlayerOAuth().dictionary.updateDictionary,\n {\n invalidateQueries: ['getDictionaries', 'getDictionary'],\n ...args,\n }\n );\n\nexport const useDeleteDictionary = (\n args?: UseAsyncOptions<IntlayerAPI['dictionary']['deleteDictionary']>\n) =>\n useAppAsync(\n 'deleteDictionary',\n useIntlayerOAuth().dictionary.deleteDictionary,\n {\n invalidateQueries: [\n 'getDictionaries',\n 'getDictionary',\n 'getDictionariesKeys',\n ],\n ...args,\n }\n );\n\n/**\n * Tag\n */\n\nexport const useGetTags = (\n args?: UseAsyncOptions<IntlayerAPI['tag']['getTags']>\n) =>\n useAppAsync(\n 'getTags',\n useIntlayerOAuth().tag.getTags,\n {\n cache: true,\n store: true,\n retryLimit: 3,\n autoFetch: true,\n revalidation: true,\n revalidateTime: 5 * 60 * 1000, // 5 minutes\n ...args,\n },\n {\n requireUser: true,\n requireOrganization: true,\n }\n );\n\nexport const useAddTag = (\n args?: UseAsyncOptions<IntlayerAPI['tag']['addTag']>\n) =>\n useAppAsync('addTag', useIntlayerOAuth().tag.addTag, {\n invalidateQueries: ['getTags'],\n ...args,\n });\n\nexport const useUpdateTag = (\n args?: UseAsyncOptions<IntlayerAPI['tag']['updateTag']>\n) =>\n useAppAsync('updateTag', useIntlayerOAuth().tag.updateTag, {\n invalidateQueries: ['getTags'],\n ...args,\n });\n\nexport const useDeleteTag = (\n args?: UseAsyncOptions<IntlayerAPI['tag']['deleteTag']>\n) =>\n useAppAsync('deleteTag', useIntlayerOAuth().tag.deleteTag, {\n invalidateQueries: ['getTags'],\n ...args,\n });\n\n/**\n * Stripe\n */\n\nexport const useGetPricing = (\n args?: UseAsyncOptions<IntlayerAPI['stripe']['getPricing']>\n) =>\n useAppAsync('getPricing', useIntlayerOAuth().stripe.getPricing, {\n store: true,\n cache: true,\n ...args,\n });\n\nexport const useGetSubscription = (\n args?: UseAsyncOptions<IntlayerAPI['stripe']['getSubscription']>\n) =>\n useAppAsync(\n 'getSubscription',\n useIntlayerOAuth().stripe.getSubscription,\n args,\n {\n requireUser: true,\n requireOrganization: true,\n }\n );\n\nexport const useCancelSubscription = (\n args?: UseAsyncOptions<IntlayerAPI['stripe']['cancelSubscription']>\n) =>\n useAppAsync(\n 'cancelSubscription',\n useIntlayerOAuth().stripe.cancelSubscription,\n { invalidateQueries: ['getSession'], ...args },\n {\n requireUser: true,\n requireOrganization: true,\n }\n );\n\n/**\n * AI\n */\n\nexport const useTranslateJSONDeclaration = (\n args?: UseAsyncOptions<IntlayerAPI['ai']['translateJSON']>\n) =>\n useAppAsync('translateJSON', useIntlayerOAuth().ai.translateJSON, args, {\n requireUser: true,\n requireOrganization: true,\n requireProject: true,\n });\n\nexport const useAuditContentDeclaration = (\n args?: UseAsyncOptions<IntlayerAPI['ai']['auditContentDeclaration']>\n) =>\n useAppAsync(\n 'auditContentDeclaration',\n useIntlayerOAuth().ai.auditContentDeclaration,\n args,\n {\n requireUser: true,\n requireOrganization: true,\n requireProject: true,\n }\n );\n\nexport const useAuditContentDeclarationMetadata = (\n args?: UseAsyncOptions<IntlayerAPI['ai']['auditContentDeclarationMetadata']>\n) =>\n useAppAsync(\n 'auditContentDeclaration',\n useIntlayerOAuth().ai.auditContentDeclarationMetadata,\n args,\n {\n requireUser: true,\n requireOrganization: true,\n requireProject: true,\n }\n );\n\nexport const useAuditContentDeclarationField = (\n args?: UseAsyncOptions<IntlayerAPI['ai']['auditContentDeclarationField']>\n) =>\n useAppAsync(\n 'auditContentDeclarationField',\n useIntlayerOAuth().ai.auditContentDeclarationField,\n args,\n {\n requireUser: true,\n requireOrganization: true,\n requireProject: true,\n }\n );\n\nexport const useAuditTag = (\n args?: UseAsyncOptions<IntlayerAPI['ai']['auditTag']>\n) =>\n useAppAsync('auditTag', useIntlayerOAuth().ai.auditTag, args, {\n requireUser: true,\n requireOrganization: true,\n requireProject: true,\n });\n\nexport const useAskDocQuestion = (\n args?: UseAsyncOptions<IntlayerAPI['ai']['askDocQuestion']>\n) => useAppAsync('askDocQuestion', useIntlayerOAuth().ai.askDocQuestion, args);\n\nexport const useAutocomplete = (\n args?: UseAsyncOptions<IntlayerAPI['ai']['autocomplete']>\n) => useAppAsync('autocomplete', useIntlayerOAuth().ai.autocomplete, args);\n\n/**\n * Search\n */\n\nexport const useSearchDoc = (\n args?: UseAsyncOptions<IntlayerAPI['search']['searchDoc']>\n) => useAppAsync('searchDoc', useIntlayerOAuth().search.searchDoc, args);\n\n/**\n * Newsletter\n */\n\nexport const useSubscribeToNewsletter = (\n args?: UseAsyncOptions<IntlayerAPI['newsletter']['subscribeToNewsletter']>\n) =>\n useAppAsync(\n 'subscribeToNewsletter',\n useIntlayerOAuth().newsletter.subscribeToNewsletter,\n args\n );\n\nexport const useUnsubscribeFromNewsletter = (\n args?: UseAsyncOptions<IntlayerAPI['newsletter']['unsubscribeFromNewsletter']>\n) =>\n useAppAsync(\n 'unsubscribeFromNewsletter',\n useIntlayerOAuth().newsletter.unsubscribeFromNewsletter,\n args\n );\n\nexport const useGetNewsletterStatus = (\n args?: UseAsyncOptions<IntlayerAPI['newsletter']['getNewsletterStatus']>\n) =>\n useAppAsync(\n 'getNewsletterStatus',\n useIntlayerOAuth().newsletter.getNewsletterStatus,\n args\n );\n\n/**\n * Editor\n */\n\nexport const useWriteDictionary = (\n args?: UseAsyncOptions<IntlayerAPI['editor']['writeDictionary']>\n) =>\n useEditorAsync(\n 'writeDictionary',\n useIntlayerOAuth().editor.writeDictionary,\n args\n );\n\nexport const useGetEditorDictionaries = (\n args?: UseAsyncOptions<IntlayerAPI['editor']['getDictionaries']>\n) =>\n useEditorAsync('getDictionaries', useIntlayerOAuth().editor.getDictionaries, {\n store: true,\n cache: true,\n ...args,\n });\n"],"names":["useToast","error","useConfiguration","useAuth","useAsync","useIntlayerAuth","useIntlayerOAuth"],"mappings":";;;;;;;;;;;;;;;AAUA,MAAM,kBAAkB,CAAC,cAAsB,UAAU,MAAM,GAAG,EAAE,KAAK,GAAG;AAK5E,MAAM,mBAAmB,CAAiC,YAAkB;AACpE,QAAA,EAAE,MAAM,IAAIA,qCAAS;AAEpB,SAAA;AAAA,IACL,GAAG;AAAA,IACH,SAAS,CAAC,iBAAiB;AACrB,UAAA;AAGA,UAAA;AACE,YAAA,OAAO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AA,EACtB;AAAA,EACA;AAAA,IACE,aAAa;AAAA,IACb,qBAAqB;AAAA,IACrB,gBAAgB;AAAA,EAAA;AAEpB;AAEW,MAAA,cAAc,CACzB,SAEA,YAAY,YAAYA,qBAAAA,mBAAmB,GAAG,UAAU,MAAM;AAAA,EAC5D,aAAa;AAAA,EACb,qBAAqB;AAAA,EACrB,gBAAgB;AAClB,CAAC;AAEU,MAAA,oBAAoB,CAC/B,SACG,YAAY,kBAAkBA,qBAAAA,mBAAmB,GAAG,gBAAgB,IAAI;AAEhE,MAAA,kBAAkB,CAC7B,SACG,YAAY,gBAAgBA,qBAAAA,mBAAmB,GAAG,cAAc,IAAI;AAM5D,MAAA,eAAe,CAC1B,SACG,YAAY,aAAaA,qBAAAA,mBAAmB,OAAO,WAAW,IAAI;AAM1D,MAAA,2BAA2B,CACtC,SAEA;AAAA,EACE;AAAA,EACAA,qBAAA,iBAAA,EAAmB,WAAW;AAAA,EAC9B;AACF;AAEW,MAAA,+BAA+B,CAC1C,SAEA;AAAA,EACE;AAAA,EACAA,qBAAA,iBAAA,EAAmB,WAAW;AAAA,EAC9B;AACF;AAEW,MAAA,yBAAyB,CACpC,SAEA;AAAA,EACE;AAAA,EACAA,qBAAA,iBAAA,EAAmB,WAAW;AAAA,EAC9B;AACF;AAMW,MAAA,qBAAqB,CAChC,SAEA;AAAA,EACE;AAAA,EACAA,qBAAA,iBAAA,EAAmB,OAAO;AAAA,EAC1B;AACF;AAEW,MAAA,2BAA2B,CACtC,SAEA,eAAe,mBAAmBA,sCAAiB,EAAE,OAAO,iBAAiB;AAAA,EAC3E,OAAO;AAAA,EACP,OAAO;AAAA,EACP,GAAG;AACL,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -86,6 +86,86 @@ export declare const useLogin: (args?: UseAsyncOptions<ReturnType<typeof getAuth
|
|
|
86
86
|
code?: string;
|
|
87
87
|
message?: string;
|
|
88
88
|
}, FetchOptions["throw"] extends true ? true : false>>>;
|
|
89
|
+
export declare const useGetVerifyEmailStatus: (args?: UseAsyncOptions<ReturnType<typeof getAuthAPI>["verifyEmailSession"]>) => import('./useAsync').UseAsyncResult<"getVerifyEmailStatus", <FetchOptions extends {
|
|
90
|
+
method?: string | undefined;
|
|
91
|
+
mode?: RequestMode | undefined;
|
|
92
|
+
referrerPolicy?: ReferrerPolicy | undefined;
|
|
93
|
+
headers?: (HeadersInit & (HeadersInit | {
|
|
94
|
+
accept: "application/json" | "text/plain" | "application/octet-stream";
|
|
95
|
+
"content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
|
|
96
|
+
authorization: "Bearer" | "Basic";
|
|
97
|
+
})) | undefined;
|
|
98
|
+
cache?: RequestCache | undefined;
|
|
99
|
+
credentials?: RequestCredentials | undefined;
|
|
100
|
+
integrity?: string | undefined;
|
|
101
|
+
keepalive?: boolean | undefined;
|
|
102
|
+
priority?: RequestPriority | undefined;
|
|
103
|
+
redirect?: RequestRedirect | undefined;
|
|
104
|
+
referrer?: string | undefined;
|
|
105
|
+
signal?: (AbortSignal | null) | undefined;
|
|
106
|
+
window?: null | undefined;
|
|
107
|
+
onRequest?: (<T extends Record<string, any>>(context: import('better-auth/client').RequestContext<T>) => Promise<import('better-auth/client').RequestContext | void> | import('better-auth/client').RequestContext | void) | undefined;
|
|
108
|
+
onResponse?: ((context: import('better-auth/client').ResponseContext) => Promise<Response | void | import('better-auth/client').ResponseContext> | Response | import('better-auth/client').ResponseContext | void) | undefined;
|
|
109
|
+
onSuccess?: ((context: import('better-auth/client').SuccessContext<any>) => Promise<void> | void) | undefined;
|
|
110
|
+
onError?: ((context: import('better-auth/client').ErrorContext) => Promise<void> | void) | undefined;
|
|
111
|
+
onRetry?: ((response: import('better-auth/client').ResponseContext) => Promise<void> | void) | undefined;
|
|
112
|
+
hookOptions?: {
|
|
113
|
+
cloneResponse?: boolean;
|
|
114
|
+
} | undefined;
|
|
115
|
+
timeout?: number | undefined;
|
|
116
|
+
customFetchImpl?: import('better-auth/client').FetchEsque | undefined;
|
|
117
|
+
plugins?: import('better-auth/client').BetterFetchPlugin[] | undefined;
|
|
118
|
+
baseURL?: string | undefined;
|
|
119
|
+
throw?: boolean | undefined;
|
|
120
|
+
auth?: ({
|
|
121
|
+
type: "Bearer";
|
|
122
|
+
token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
|
|
123
|
+
} | {
|
|
124
|
+
type: "Basic";
|
|
125
|
+
username: string | (() => string | undefined) | undefined;
|
|
126
|
+
password: string | (() => string | undefined) | undefined;
|
|
127
|
+
} | {
|
|
128
|
+
type: "Custom";
|
|
129
|
+
prefix: string | (() => string | undefined) | undefined;
|
|
130
|
+
value: string | (() => string | undefined) | undefined;
|
|
131
|
+
}) | undefined;
|
|
132
|
+
body?: undefined;
|
|
133
|
+
query?: (Partial<{
|
|
134
|
+
token: string;
|
|
135
|
+
callbackURL?: string | undefined;
|
|
136
|
+
}> & Record<string, any>) | undefined;
|
|
137
|
+
params?: Record<string, any> | undefined;
|
|
138
|
+
duplex?: "full" | "half" | undefined;
|
|
139
|
+
jsonParser?: ((text: string) => Promise<any> | any) | undefined;
|
|
140
|
+
retry?: import('better-auth/client').RetryOptions | undefined;
|
|
141
|
+
retryAttempt?: number | undefined;
|
|
142
|
+
output?: (import('better-auth/client').StandardSchemaV1 | typeof Blob | typeof File) | undefined;
|
|
143
|
+
errorSchema?: import('better-auth/client').StandardSchemaV1 | undefined;
|
|
144
|
+
disableValidation?: boolean | undefined;
|
|
145
|
+
}>(data_0: import('better-auth').Prettify<{
|
|
146
|
+
query: {
|
|
147
|
+
token: string;
|
|
148
|
+
callbackURL?: string | undefined;
|
|
149
|
+
};
|
|
150
|
+
fetchOptions?: FetchOptions | undefined;
|
|
151
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import('better-auth/client').BetterFetchResponse<NonNullable<void | {
|
|
152
|
+
status: boolean;
|
|
153
|
+
user: {
|
|
154
|
+
id: any;
|
|
155
|
+
email: any;
|
|
156
|
+
name: any;
|
|
157
|
+
image: any;
|
|
158
|
+
emailVerified: any;
|
|
159
|
+
createdAt: any;
|
|
160
|
+
updatedAt: any;
|
|
161
|
+
};
|
|
162
|
+
} | {
|
|
163
|
+
status: boolean;
|
|
164
|
+
user: null;
|
|
165
|
+
}>, {
|
|
166
|
+
code?: string;
|
|
167
|
+
message?: string;
|
|
168
|
+
}, FetchOptions["throw"] extends true ? true : false>>>;
|
|
89
169
|
export declare const useRegister: (args?: UseAsyncOptions<ReturnType<typeof getAuthAPI>["signUpEmail"]>) => import('./useAsync').UseAsyncResult<"register", <FetchOptions extends {
|
|
90
170
|
method?: string | undefined;
|
|
91
171
|
mode?: RequestMode | undefined;
|
|
@@ -386,7 +466,7 @@ export declare const useAskResetPassword: (args?: UseAsyncOptions<ReturnType<typ
|
|
|
386
466
|
code?: string;
|
|
387
467
|
message?: string;
|
|
388
468
|
}, FetchOptions["throw"] extends true ? true : false>>>;
|
|
389
|
-
export declare const
|
|
469
|
+
export declare const useResetPassword: (args?: UseAsyncOptions<ReturnType<typeof getAuthAPI>["resetPassword"]>) => import('./useAsync').UseAsyncResult<"resetPassword", (<FetchOptions extends {
|
|
390
470
|
method?: string | undefined;
|
|
391
471
|
mode?: RequestMode | undefined;
|
|
392
472
|
referrerPolicy?: ReferrerPolicy | undefined;
|
|
@@ -431,10 +511,11 @@ export declare const useDefineNewPassword: (args?: UseAsyncOptions<ReturnType<ty
|
|
|
431
511
|
}) | undefined;
|
|
432
512
|
body?: (Partial<{
|
|
433
513
|
newPassword: string;
|
|
434
|
-
|
|
435
|
-
|
|
514
|
+
token?: string | undefined;
|
|
515
|
+
}> & Record<string, any>) | undefined;
|
|
516
|
+
query?: (Partial<{
|
|
517
|
+
token?: string | undefined;
|
|
436
518
|
}> & Record<string, any>) | undefined;
|
|
437
|
-
query?: (Partial<Record<string, any>> & Record<string, any>) | undefined;
|
|
438
519
|
params?: Record<string, any> | undefined;
|
|
439
520
|
duplex?: "full" | "half" | undefined;
|
|
440
521
|
jsonParser?: ((text: string) => Promise<any> | any) | undefined;
|
|
@@ -445,25 +526,149 @@ export declare const useDefineNewPassword: (args?: UseAsyncOptions<ReturnType<ty
|
|
|
445
526
|
disableValidation?: boolean | undefined;
|
|
446
527
|
}>(data_0: import('better-auth').Prettify<{
|
|
447
528
|
newPassword: string;
|
|
448
|
-
|
|
449
|
-
revokeOtherSessions?: boolean | undefined;
|
|
529
|
+
token?: string | undefined;
|
|
450
530
|
} & {
|
|
451
531
|
fetchOptions?: FetchOptions | undefined;
|
|
452
532
|
}>, data_1?: FetchOptions | undefined) => Promise<import('better-auth/client').BetterFetchResponse<{
|
|
453
|
-
|
|
454
|
-
user: {
|
|
455
|
-
id: string;
|
|
456
|
-
email: string;
|
|
457
|
-
name: string;
|
|
458
|
-
image: string | null | undefined;
|
|
459
|
-
emailVerified: boolean;
|
|
460
|
-
createdAt: Date;
|
|
461
|
-
updatedAt: Date;
|
|
462
|
-
};
|
|
533
|
+
status: boolean;
|
|
463
534
|
}, {
|
|
464
535
|
code?: string;
|
|
465
536
|
message?: string;
|
|
466
|
-
}, FetchOptions["throw"] extends true ? true : false
|
|
537
|
+
}, FetchOptions["throw"] extends true ? true : false>>) & {
|
|
538
|
+
":token": <FetchOptions extends {
|
|
539
|
+
method?: string | undefined;
|
|
540
|
+
mode?: RequestMode | undefined;
|
|
541
|
+
referrerPolicy?: ReferrerPolicy | undefined;
|
|
542
|
+
headers?: (HeadersInit & (HeadersInit | {
|
|
543
|
+
accept: "application/json" | "text/plain" | "application/octet-stream";
|
|
544
|
+
"content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
|
|
545
|
+
authorization: "Bearer" | "Basic";
|
|
546
|
+
})) | undefined;
|
|
547
|
+
cache?: RequestCache | undefined;
|
|
548
|
+
credentials?: RequestCredentials | undefined;
|
|
549
|
+
integrity?: string | undefined;
|
|
550
|
+
keepalive?: boolean | undefined;
|
|
551
|
+
priority?: RequestPriority | undefined;
|
|
552
|
+
redirect?: RequestRedirect | undefined;
|
|
553
|
+
referrer?: string | undefined;
|
|
554
|
+
signal?: (AbortSignal | null) | undefined;
|
|
555
|
+
window?: null | undefined;
|
|
556
|
+
onRequest?: (<T extends Record<string, any>>(context: import('better-auth/client').RequestContext<T>) => Promise<import('better-auth/client').RequestContext | void> | import('better-auth/client').RequestContext | void) | undefined;
|
|
557
|
+
onResponse?: ((context: import('better-auth/client').ResponseContext) => Promise<Response | void | import('better-auth/client').ResponseContext> | Response | import('better-auth/client').ResponseContext | void) | undefined;
|
|
558
|
+
onSuccess?: ((context: import('better-auth/client').SuccessContext<any>) => Promise<void> | void) | undefined;
|
|
559
|
+
onError?: ((context: import('better-auth/client').ErrorContext) => Promise<void> | void) | undefined;
|
|
560
|
+
onRetry?: ((response: import('better-auth/client').ResponseContext) => Promise<void> | void) | undefined;
|
|
561
|
+
hookOptions?: {
|
|
562
|
+
cloneResponse?: boolean;
|
|
563
|
+
} | undefined;
|
|
564
|
+
timeout?: number | undefined;
|
|
565
|
+
customFetchImpl?: import('better-auth/client').FetchEsque | undefined;
|
|
566
|
+
plugins?: import('better-auth/client').BetterFetchPlugin[] | undefined;
|
|
567
|
+
baseURL?: string | undefined;
|
|
568
|
+
throw?: boolean | undefined;
|
|
569
|
+
auth?: ({
|
|
570
|
+
type: "Bearer";
|
|
571
|
+
token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
|
|
572
|
+
} | {
|
|
573
|
+
type: "Basic";
|
|
574
|
+
username: string | (() => string | undefined) | undefined;
|
|
575
|
+
password: string | (() => string | undefined) | undefined;
|
|
576
|
+
} | {
|
|
577
|
+
type: "Custom";
|
|
578
|
+
prefix: string | (() => string | undefined) | undefined;
|
|
579
|
+
value: string | (() => string | undefined) | undefined;
|
|
580
|
+
}) | undefined;
|
|
581
|
+
body?: undefined;
|
|
582
|
+
query?: (Partial<{
|
|
583
|
+
callbackURL: string;
|
|
584
|
+
}> & Record<string, any>) | undefined;
|
|
585
|
+
params?: {
|
|
586
|
+
token: string;
|
|
587
|
+
} | undefined;
|
|
588
|
+
duplex?: "full" | "half" | undefined;
|
|
589
|
+
jsonParser?: ((text: string) => Promise<any> | any) | undefined;
|
|
590
|
+
retry?: import('better-auth/client').RetryOptions | undefined;
|
|
591
|
+
retryAttempt?: number | undefined;
|
|
592
|
+
output?: (import('better-auth/client').StandardSchemaV1 | typeof Blob | typeof File) | undefined;
|
|
593
|
+
errorSchema?: import('better-auth/client').StandardSchemaV1 | undefined;
|
|
594
|
+
disableValidation?: boolean | undefined;
|
|
595
|
+
}>(data_0: import('better-auth').Prettify<{
|
|
596
|
+
query: {
|
|
597
|
+
callbackURL: string;
|
|
598
|
+
};
|
|
599
|
+
fetchOptions?: FetchOptions | undefined;
|
|
600
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import('better-auth/client').BetterFetchResponse<never, {
|
|
601
|
+
code?: string;
|
|
602
|
+
message?: string;
|
|
603
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
604
|
+
} & {
|
|
605
|
+
":token": <FetchOptions extends {
|
|
606
|
+
method?: string | undefined;
|
|
607
|
+
mode?: RequestMode | undefined;
|
|
608
|
+
referrerPolicy?: ReferrerPolicy | undefined;
|
|
609
|
+
headers?: (HeadersInit & (HeadersInit | {
|
|
610
|
+
accept: "application/json" | "text/plain" | "application/octet-stream";
|
|
611
|
+
"content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
|
|
612
|
+
authorization: "Bearer" | "Basic";
|
|
613
|
+
})) | undefined;
|
|
614
|
+
cache?: RequestCache | undefined;
|
|
615
|
+
credentials?: RequestCredentials | undefined;
|
|
616
|
+
integrity?: string | undefined;
|
|
617
|
+
keepalive?: boolean | undefined;
|
|
618
|
+
priority?: RequestPriority | undefined;
|
|
619
|
+
redirect?: RequestRedirect | undefined;
|
|
620
|
+
referrer?: string | undefined;
|
|
621
|
+
signal?: (AbortSignal | null) | undefined;
|
|
622
|
+
window?: null | undefined;
|
|
623
|
+
onRequest?: (<T extends Record<string, any>>(context: import('better-auth/client').RequestContext<T>) => Promise<import('better-auth/client').RequestContext | void> | import('better-auth/client').RequestContext | void) | undefined;
|
|
624
|
+
onResponse?: ((context: import('better-auth/client').ResponseContext) => Promise<Response | void | import('better-auth/client').ResponseContext> | Response | import('better-auth/client').ResponseContext | void) | undefined;
|
|
625
|
+
onSuccess?: ((context: import('better-auth/client').SuccessContext<any>) => Promise<void> | void) | undefined;
|
|
626
|
+
onError?: ((context: import('better-auth/client').ErrorContext) => Promise<void> | void) | undefined;
|
|
627
|
+
onRetry?: ((response: import('better-auth/client').ResponseContext) => Promise<void> | void) | undefined;
|
|
628
|
+
hookOptions?: {
|
|
629
|
+
cloneResponse?: boolean;
|
|
630
|
+
} | undefined;
|
|
631
|
+
timeout?: number | undefined;
|
|
632
|
+
customFetchImpl?: import('better-auth/client').FetchEsque | undefined;
|
|
633
|
+
plugins?: import('better-auth/client').BetterFetchPlugin[] | undefined;
|
|
634
|
+
baseURL?: string | undefined;
|
|
635
|
+
throw?: boolean | undefined;
|
|
636
|
+
auth?: ({
|
|
637
|
+
type: "Bearer";
|
|
638
|
+
token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
|
|
639
|
+
} | {
|
|
640
|
+
type: "Basic";
|
|
641
|
+
username: string | (() => string | undefined) | undefined;
|
|
642
|
+
password: string | (() => string | undefined) | undefined;
|
|
643
|
+
} | {
|
|
644
|
+
type: "Custom";
|
|
645
|
+
prefix: string | (() => string | undefined) | undefined;
|
|
646
|
+
value: string | (() => string | undefined) | undefined;
|
|
647
|
+
}) | undefined;
|
|
648
|
+
body?: undefined;
|
|
649
|
+
query?: (Partial<{
|
|
650
|
+
callbackURL: string;
|
|
651
|
+
}> & Record<string, any>) | undefined;
|
|
652
|
+
params?: {
|
|
653
|
+
token: string;
|
|
654
|
+
} | undefined;
|
|
655
|
+
duplex?: "full" | "half" | undefined;
|
|
656
|
+
jsonParser?: ((text: string) => Promise<any> | any) | undefined;
|
|
657
|
+
retry?: import('better-auth/client').RetryOptions | undefined;
|
|
658
|
+
retryAttempt?: number | undefined;
|
|
659
|
+
output?: (import('better-auth/client').StandardSchemaV1 | typeof Blob | typeof File) | undefined;
|
|
660
|
+
errorSchema?: import('better-auth/client').StandardSchemaV1 | undefined;
|
|
661
|
+
disableValidation?: boolean | undefined;
|
|
662
|
+
}>(data_0: import('better-auth').Prettify<{
|
|
663
|
+
query: {
|
|
664
|
+
callbackURL: string;
|
|
665
|
+
};
|
|
666
|
+
fetchOptions?: FetchOptions | undefined;
|
|
667
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import('better-auth/client').BetterFetchResponse<never, {
|
|
668
|
+
code?: string;
|
|
669
|
+
message?: string;
|
|
670
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
671
|
+
}>;
|
|
467
672
|
export declare const useVerifyEmail: (args?: UseAsyncOptions<ReturnType<typeof getAuthAPI>["verifyEmailSession"]>) => import('./useAsync').UseAsyncResult<"verifyEmail", <FetchOptions extends {
|
|
468
673
|
method?: string | undefined;
|
|
469
674
|
mode?: RequestMode | undefined;
|