@intlayer/design-system 5.7.2 → 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/.vite/manifest.json +39 -0
- package/dist/Form-CriPBaZk.js.map +1 -1
- package/dist/Form-DJrUK3mm.cjs.map +1 -1
- 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/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/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/Form/elements/CheckboxElement.d.ts +2 -2
- package/dist/components/Form/elements/CheckboxElement.d.ts.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/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/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 +4 -1
- 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 +5 -2
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/hooks/intlayerAPIHooks.cjs +65 -66
- package/dist/hooks/intlayerAPIHooks.cjs.map +1 -1
- package/dist/hooks/intlayerAPIHooks.d.ts +884 -9
- package/dist/hooks/intlayerAPIHooks.d.ts.map +1 -1
- package/dist/hooks/intlayerAPIHooks.mjs +66 -67
- 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 -7
- 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 +354 -6
- 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 +18 -2
- package/dist/hooks/useUser/index.d.ts.map +1 -1
- package/dist/hooks/useUser/index.mjs +2 -1
- package/dist/hooks/useUser/index.mjs.map +1 -1
- package/package.json +20 -19
- package/dist/tailwind.css +0 -2
|
@@ -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,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAI9D,KAAK,mBAAmB,GAAG;IACzB,OAAO,EAAE,UAAU,GAAG,IAAI,GAAG,SAAS,CAAC;IACvC,UAAU,EAAE,CAAC,OAAO,EAAE,UAAU,GAAG,IAAI,KAAK,IAAI,CAAC;IACjD,YAAY,EAAE,MAAM,OAAO,CAAC,UAAU,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;IAC3D,iBAAiB,EAAE,MAAM,OAAO,CAAC,UAAU,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;IAChE,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,UAAU,GAAG,IAAI,CAAC;IAC5B,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, SessionAPI } from '@intlayer/backend';\nimport type { IntlayerConfig } from '@intlayer/config/client';\nimport { useOAuth2 } from './useOAuth2';\nimport { useSession } from './useSession';\n\ntype SessionContextProps = {\n session: SessionAPI | null | undefined;\n setSession: (session: SessionAPI | null) => void;\n fetchSession: () => Promise<SessionAPI | null | undefined>;\n revalidateSession: () => Promise<SessionAPI | null | undefined>;\n isAuthenticated: boolean;\n oAuth2AccessToken: OAuth2Token | null | undefined;\n};\n\nexport const useAuth = ({\n session: sessionProp,\n intlayerConfiguration,\n}: {\n session?: SessionAPI | 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",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useOAuth2.cjs","sources":["../../../src/hooks/useAuth/useOAuth2.ts"],"sourcesContent":["'use client';\n\nimport { getOAuthAPI } from '@intlayer/api';\nimport defaultConfiguration from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/config/client';\nimport { useConfiguration } from '@intlayer/editor-react';\nimport { useAsync } from '../useAsync/useAsync';\n\nexport const useOAuth2 = (intlayerConfiguration?: IntlayerConfig) => {\n const configuration = useConfiguration();\n const config = intlayerConfiguration ?? configuration ?? defaultConfiguration;\n const intlayerAPI = getOAuthAPI(config);\n\n const { data } = useAsync(\n 'getOAuth2AccessToken',\n intlayerAPI.getOAuth2AccessToken,\n {\n cache: true,\n autoFetch: true,\n enable: !!(config.editor.clientId && config.editor.clientSecret),\n }\n );\n\n const oAuth2AccessToken = data?.data;\n\n return {\n oAuth2AccessToken,\n };\n};\n"],"names":["useConfiguration","getOAuthAPI","useAsync"],"mappings":";;;;;;;AAQa,MAAA,YAAY,CAAC,0BAA2C;AACnE,
|
|
1
|
+
{"version":3,"file":"useOAuth2.cjs","sources":["../../../src/hooks/useAuth/useOAuth2.ts"],"sourcesContent":["'use client';\n\nimport { getOAuthAPI } from '@intlayer/api';\nimport defaultConfiguration from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/config/client';\nimport { useConfiguration } from '@intlayer/editor-react';\nimport { useAsync } from '../useAsync/useAsync';\n\nexport const useOAuth2 = (intlayerConfiguration?: IntlayerConfig) => {\n const configuration = useConfiguration();\n const config = intlayerConfiguration ?? configuration ?? defaultConfiguration;\n const intlayerAPI = getOAuthAPI(config);\n\n const { data } = useAsync(\n 'getOAuth2AccessToken',\n intlayerAPI.getOAuth2AccessToken,\n {\n cache: true,\n autoFetch: true,\n enable: !!(config.editor.clientId && config.editor.clientSecret),\n }\n );\n\n const oAuth2AccessToken = data?.data;\n\n return {\n oAuth2AccessToken,\n };\n};\n"],"names":["configuration","useConfiguration","defaultConfiguration","getOAuthAPI","useAsync"],"mappings":";;;;;;;AAQa,MAAA,YAAY,CAAC,0BAA2C;AACnE,QAAMA,kBAAgBC,YAAAA,iBAAiB;AACjC,QAAA,SAAS,yBAAyBD,mBAAiBE;AACnD,QAAA,cAAcC,gBAAY,MAAM;AAEhC,QAAA,EAAE,SAASC,wBAAA;AAAA,IACf;AAAA,IACA,YAAY;AAAA,IACZ;AAAA,MACE,OAAO;AAAA,MACP,WAAW;AAAA,MACX,QAAQ,CAAC,EAAE,OAAO,OAAO,YAAY,OAAO,OAAO;AAAA,IAAA;AAAA,EAEvD;AAEA,QAAM,oBAAoB,MAAM;AAEzB,SAAA;AAAA,IACL;AAAA,EACF;AACF;;"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { getOAuthAPI } from "@intlayer/api";
|
|
3
|
-
import
|
|
3
|
+
import configuration from "@intlayer/config/built";
|
|
4
4
|
import { useConfiguration } from "@intlayer/editor-react";
|
|
5
5
|
import { useAsync } from "../useAsync/useAsync.mjs";
|
|
6
6
|
const useOAuth2 = (intlayerConfiguration) => {
|
|
7
|
-
const configuration = useConfiguration();
|
|
8
|
-
const config = intlayerConfiguration ?? configuration ??
|
|
7
|
+
const configuration$1 = useConfiguration();
|
|
8
|
+
const config = intlayerConfiguration ?? configuration$1 ?? configuration;
|
|
9
9
|
const intlayerAPI = getOAuthAPI(config);
|
|
10
10
|
const { data } = useAsync(
|
|
11
11
|
"getOAuth2AccessToken",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useOAuth2.mjs","sources":["../../../src/hooks/useAuth/useOAuth2.ts"],"sourcesContent":["'use client';\n\nimport { getOAuthAPI } from '@intlayer/api';\nimport defaultConfiguration from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/config/client';\nimport { useConfiguration } from '@intlayer/editor-react';\nimport { useAsync } from '../useAsync/useAsync';\n\nexport const useOAuth2 = (intlayerConfiguration?: IntlayerConfig) => {\n const configuration = useConfiguration();\n const config = intlayerConfiguration ?? configuration ?? defaultConfiguration;\n const intlayerAPI = getOAuthAPI(config);\n\n const { data } = useAsync(\n 'getOAuth2AccessToken',\n intlayerAPI.getOAuth2AccessToken,\n {\n cache: true,\n autoFetch: true,\n enable: !!(config.editor.clientId && config.editor.clientSecret),\n }\n );\n\n const oAuth2AccessToken = data?.data;\n\n return {\n oAuth2AccessToken,\n };\n};\n"],"names":[],"mappings":";;;;;AAQa,MAAA,YAAY,CAAC,0BAA2C;AACnE,
|
|
1
|
+
{"version":3,"file":"useOAuth2.mjs","sources":["../../../src/hooks/useAuth/useOAuth2.ts"],"sourcesContent":["'use client';\n\nimport { getOAuthAPI } from '@intlayer/api';\nimport defaultConfiguration from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/config/client';\nimport { useConfiguration } from '@intlayer/editor-react';\nimport { useAsync } from '../useAsync/useAsync';\n\nexport const useOAuth2 = (intlayerConfiguration?: IntlayerConfig) => {\n const configuration = useConfiguration();\n const config = intlayerConfiguration ?? configuration ?? defaultConfiguration;\n const intlayerAPI = getOAuthAPI(config);\n\n const { data } = useAsync(\n 'getOAuth2AccessToken',\n intlayerAPI.getOAuth2AccessToken,\n {\n cache: true,\n autoFetch: true,\n enable: !!(config.editor.clientId && config.editor.clientSecret),\n }\n );\n\n const oAuth2AccessToken = data?.data;\n\n return {\n oAuth2AccessToken,\n };\n};\n"],"names":["configuration","defaultConfiguration"],"mappings":";;;;;AAQa,MAAA,YAAY,CAAC,0BAA2C;AACnE,QAAMA,kBAAgB,iBAAiB;AACjC,QAAA,SAAS,yBAAyBA,mBAAiBC;AACnD,QAAA,cAAc,YAAY,MAAM;AAEhC,QAAA,EAAE,SAAS;AAAA,IACf;AAAA,IACA,YAAY;AAAA,IACZ;AAAA,MACE,OAAO;AAAA,MACP,WAAW;AAAA,MACX,QAAQ,CAAC,EAAE,OAAO,OAAO,YAAY,OAAO,OAAO;AAAA,IAAA;AAAA,EAEvD;AAEA,QAAM,oBAAoB,MAAM;AAEzB,SAAA;AAAA,IACL;AAAA,EACF;AACF;"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use strict";
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
-
const
|
|
5
|
-
const defaultConfiguration = require("@intlayer/config/built");
|
|
4
|
+
const configuration = require("@intlayer/config/built");
|
|
6
5
|
const editorReact = require("@intlayer/editor-react");
|
|
6
|
+
const hooks_auth = require("../auth.cjs");
|
|
7
7
|
const hooks_useAsync_useAsync = require("../useAsync/useAsync.cjs");
|
|
8
8
|
require("../useAsync/useAsyncStateStore.cjs");
|
|
9
9
|
const useSession = (sessionProp, intlayerConfiguration) => {
|
|
10
|
-
const configuration = editorReact.useConfiguration();
|
|
11
|
-
const config = intlayerConfiguration ?? configuration ??
|
|
10
|
+
const configuration$1 = editorReact.useConfiguration();
|
|
11
|
+
const config = intlayerConfiguration ?? configuration$1 ?? configuration;
|
|
12
12
|
const {
|
|
13
13
|
getSession,
|
|
14
14
|
revalidate,
|
|
@@ -18,7 +18,7 @@ const useSession = (sessionProp, intlayerConfiguration) => {
|
|
|
18
18
|
} = hooks_useAsync_useAsync.useAsync(
|
|
19
19
|
"getSession",
|
|
20
20
|
async () => {
|
|
21
|
-
const intlayerAPI =
|
|
21
|
+
const intlayerAPI = hooks_auth.getAuthAPI(config);
|
|
22
22
|
const result = await intlayerAPI.getSession();
|
|
23
23
|
return result.data;
|
|
24
24
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSession.cjs","sources":["../../../src/hooks/useAuth/useSession.ts"],"sourcesContent":["'use client';\n\nimport
|
|
1
|
+
{"version":3,"file":"useSession.cjs","sources":["../../../src/hooks/useAuth/useSession.ts"],"sourcesContent":["'use client';\n\nimport type { SessionAPI } from '@intlayer/backend';\nimport defaultConfiguration from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/config/client';\nimport { useConfiguration } from '@intlayer/editor-react';\nimport { getAuthAPI } from '../auth';\nimport { useAsync } from '../useAsync';\n\nexport const useSession = (\n sessionProp?: SessionAPI | null,\n intlayerConfiguration?: IntlayerConfig\n) => {\n const configuration = useConfiguration();\n const config = intlayerConfiguration ?? configuration ?? defaultConfiguration;\n\n const {\n getSession,\n revalidate,\n data,\n setData: setSession,\n isFetched,\n } = useAsync(\n 'getSession',\n async () => {\n const intlayerAPI = getAuthAPI(config);\n const result = await intlayerAPI.getSession();\n return result.data as unknown as SessionAPI;\n },\n {\n cache: true,\n store: true,\n autoFetch: true,\n enable: !sessionProp,\n invalidateQueries: [\n 'getOrganizations',\n 'getProjects',\n 'getUsers',\n 'getDictionaries',\n ],\n }\n );\n\n const session = data ?? (isFetched ? null : undefined);\n\n return {\n session,\n fetchSession: getSession,\n revalidateSession: revalidate,\n setSession,\n };\n};\n"],"names":["configuration","useConfiguration","defaultConfiguration","useAsync","getAuthAPI"],"mappings":";;;;;;;;AASa,MAAA,aAAa,CACxB,aACA,0BACG;AACH,QAAMA,kBAAgBC,YAAAA,iBAAiB;AACjC,QAAA,SAAS,yBAAyBD,mBAAiBE;AAEnD,QAAA;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT;AAAA,EAAA,IACEC,wBAAA;AAAA,IACF;AAAA,IACA,YAAY;AACJ,YAAA,cAAcC,sBAAW,MAAM;AAC/B,YAAA,SAAS,MAAM,YAAY,WAAW;AAC5C,aAAO,OAAO;AAAA,IAChB;AAAA,IACA;AAAA,MACE,OAAO;AAAA,MACP,OAAO;AAAA,MACP,WAAW;AAAA,MACX,QAAQ,CAAC;AAAA,MACT,mBAAmB;AAAA,QACjB;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MAAA;AAAA,IACF;AAAA,EAEJ;AAEM,QAAA,UAAU,SAAS,YAAY,OAAO;AAErC,SAAA;AAAA,IACL;AAAA,IACA,cAAc;AAAA,IACd,mBAAmB;AAAA,IACnB;AAAA,EACF;AACF;;"}
|
|
@@ -1,9 +1,357 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SessionAPI } from '@intlayer/backend';
|
|
2
2
|
import { IntlayerConfig } from '@intlayer/config/client';
|
|
3
|
-
export declare const useSession: (sessionProp?:
|
|
4
|
-
session:
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
export declare const useSession: (sessionProp?: SessionAPI | null, intlayerConfiguration?: IntlayerConfig) => {
|
|
4
|
+
session: {
|
|
5
|
+
session: {
|
|
6
|
+
userId: string;
|
|
7
|
+
expiresAt: Date;
|
|
8
|
+
createdAt: Date;
|
|
9
|
+
updatedAt: Date;
|
|
10
|
+
token: string;
|
|
11
|
+
ipAddress?: string | null | undefined;
|
|
12
|
+
userAgent?: string | null | undefined;
|
|
13
|
+
id: string;
|
|
14
|
+
activeOrganizationId?: string | undefined;
|
|
15
|
+
activeProjectId?: string | undefined;
|
|
16
|
+
};
|
|
17
|
+
user: {
|
|
18
|
+
email: string;
|
|
19
|
+
name: string;
|
|
20
|
+
image?: string | null | undefined;
|
|
21
|
+
createdAt: Date;
|
|
22
|
+
updatedAt: Date;
|
|
23
|
+
emailVerified: boolean;
|
|
24
|
+
phone?: string | undefined;
|
|
25
|
+
dateOfBirth?: Date | undefined;
|
|
26
|
+
id: string;
|
|
27
|
+
emailsList?: {
|
|
28
|
+
newsLetter: boolean;
|
|
29
|
+
} | undefined;
|
|
30
|
+
customerId?: string | undefined;
|
|
31
|
+
role?: string | undefined;
|
|
32
|
+
lang?: string | undefined;
|
|
33
|
+
};
|
|
34
|
+
organization?: {
|
|
35
|
+
name: string;
|
|
36
|
+
membersIds: string[];
|
|
37
|
+
adminsIds: string[];
|
|
38
|
+
id: string;
|
|
39
|
+
creatorId: string;
|
|
40
|
+
plan?: {
|
|
41
|
+
type: import('@intlayer/backend').PlanType;
|
|
42
|
+
creatorId?: string | undefined;
|
|
43
|
+
subscriptionId?: string | undefined;
|
|
44
|
+
customerId?: string | undefined;
|
|
45
|
+
priceId?: string | undefined;
|
|
46
|
+
status?: "active" | "canceled" | "past_due" | "unpaid" | "incomplete" | "incomplete_expired" | "paused" | "trialing" | undefined;
|
|
47
|
+
period?: "MONTHLY" | "YEARLY" | undefined;
|
|
48
|
+
id: string;
|
|
49
|
+
createdAt: number;
|
|
50
|
+
updatedAt: number;
|
|
51
|
+
} | undefined;
|
|
52
|
+
createdAt: number;
|
|
53
|
+
updatedAt: number;
|
|
54
|
+
} | null | undefined;
|
|
55
|
+
project?: {
|
|
56
|
+
organizationId: string;
|
|
57
|
+
name: string;
|
|
58
|
+
membersIds: string[];
|
|
59
|
+
adminsIds: string[];
|
|
60
|
+
creatorId: string;
|
|
61
|
+
configuration?: {
|
|
62
|
+
internationalization: {
|
|
63
|
+
locales: import('intlayer').Locales[];
|
|
64
|
+
defaultLocale: import('intlayer').Locales;
|
|
65
|
+
};
|
|
66
|
+
editor: {
|
|
67
|
+
applicationURL: string;
|
|
68
|
+
cmsURL: string;
|
|
69
|
+
};
|
|
70
|
+
} | undefined;
|
|
71
|
+
id: string;
|
|
72
|
+
createdAt: number;
|
|
73
|
+
updatedAt: number;
|
|
74
|
+
oAuth2Access: {
|
|
75
|
+
name: string;
|
|
76
|
+
grants: string[];
|
|
77
|
+
expiresAt?: Date | undefined;
|
|
78
|
+
clientId: string;
|
|
79
|
+
clientSecret: string;
|
|
80
|
+
accessToken: string[];
|
|
81
|
+
userId: string;
|
|
82
|
+
id: string;
|
|
83
|
+
createdAt: number;
|
|
84
|
+
updatedAt: number;
|
|
85
|
+
}[];
|
|
86
|
+
} | null | undefined;
|
|
87
|
+
id: string;
|
|
88
|
+
permissions: import('node_modules/@intlayer/backend/dist/types/utils/permissions').Permission[];
|
|
89
|
+
roles: import('node_modules/@intlayer/backend/dist/types/utils/permissions').Roles[];
|
|
90
|
+
authType: "session" | "oauth2" | null;
|
|
91
|
+
} | null | undefined;
|
|
92
|
+
fetchSession: () => Promise<{
|
|
93
|
+
session: {
|
|
94
|
+
userId: string;
|
|
95
|
+
expiresAt: Date;
|
|
96
|
+
createdAt: Date;
|
|
97
|
+
updatedAt: Date;
|
|
98
|
+
token: string;
|
|
99
|
+
ipAddress?: string | null | undefined;
|
|
100
|
+
userAgent?: string | null | undefined;
|
|
101
|
+
id: string;
|
|
102
|
+
activeOrganizationId?: string | undefined;
|
|
103
|
+
activeProjectId?: string | undefined;
|
|
104
|
+
};
|
|
105
|
+
user: {
|
|
106
|
+
email: string;
|
|
107
|
+
name: string;
|
|
108
|
+
image?: string | null | undefined;
|
|
109
|
+
createdAt: Date;
|
|
110
|
+
updatedAt: Date;
|
|
111
|
+
emailVerified: boolean;
|
|
112
|
+
phone?: string | undefined;
|
|
113
|
+
dateOfBirth?: Date | undefined;
|
|
114
|
+
id: string;
|
|
115
|
+
emailsList?: {
|
|
116
|
+
newsLetter: boolean;
|
|
117
|
+
} | undefined;
|
|
118
|
+
customerId?: string | undefined;
|
|
119
|
+
role?: string | undefined;
|
|
120
|
+
lang?: string | undefined;
|
|
121
|
+
};
|
|
122
|
+
organization?: {
|
|
123
|
+
name: string;
|
|
124
|
+
membersIds: string[];
|
|
125
|
+
adminsIds: string[];
|
|
126
|
+
id: string;
|
|
127
|
+
creatorId: string;
|
|
128
|
+
plan?: {
|
|
129
|
+
type: import('@intlayer/backend').PlanType;
|
|
130
|
+
creatorId?: string | undefined;
|
|
131
|
+
subscriptionId?: string | undefined;
|
|
132
|
+
customerId?: string | undefined;
|
|
133
|
+
priceId?: string | undefined;
|
|
134
|
+
status?: "active" | "canceled" | "past_due" | "unpaid" | "incomplete" | "incomplete_expired" | "paused" | "trialing" | undefined;
|
|
135
|
+
period?: "MONTHLY" | "YEARLY" | undefined;
|
|
136
|
+
id: string;
|
|
137
|
+
createdAt: number;
|
|
138
|
+
updatedAt: number;
|
|
139
|
+
} | undefined;
|
|
140
|
+
createdAt: number;
|
|
141
|
+
updatedAt: number;
|
|
142
|
+
} | null | undefined;
|
|
143
|
+
project?: {
|
|
144
|
+
organizationId: string;
|
|
145
|
+
name: string;
|
|
146
|
+
membersIds: string[];
|
|
147
|
+
adminsIds: string[];
|
|
148
|
+
creatorId: string;
|
|
149
|
+
configuration?: {
|
|
150
|
+
internationalization: {
|
|
151
|
+
locales: import('intlayer').Locales[];
|
|
152
|
+
defaultLocale: import('intlayer').Locales;
|
|
153
|
+
};
|
|
154
|
+
editor: {
|
|
155
|
+
applicationURL: string;
|
|
156
|
+
cmsURL: string;
|
|
157
|
+
};
|
|
158
|
+
} | undefined;
|
|
159
|
+
id: string;
|
|
160
|
+
createdAt: number;
|
|
161
|
+
updatedAt: number;
|
|
162
|
+
oAuth2Access: {
|
|
163
|
+
name: string;
|
|
164
|
+
grants: string[];
|
|
165
|
+
expiresAt?: Date | undefined;
|
|
166
|
+
clientId: string;
|
|
167
|
+
clientSecret: string;
|
|
168
|
+
accessToken: string[];
|
|
169
|
+
userId: string;
|
|
170
|
+
id: string;
|
|
171
|
+
createdAt: number;
|
|
172
|
+
updatedAt: number;
|
|
173
|
+
}[];
|
|
174
|
+
} | null | undefined;
|
|
175
|
+
id: string;
|
|
176
|
+
permissions: import('node_modules/@intlayer/backend/dist/types/utils/permissions').Permission[];
|
|
177
|
+
roles: import('node_modules/@intlayer/backend/dist/types/utils/permissions').Roles[];
|
|
178
|
+
authType: "session" | "oauth2" | null;
|
|
179
|
+
}>;
|
|
180
|
+
revalidateSession: () => Promise<{
|
|
181
|
+
session: {
|
|
182
|
+
userId: string;
|
|
183
|
+
expiresAt: Date;
|
|
184
|
+
createdAt: Date;
|
|
185
|
+
updatedAt: Date;
|
|
186
|
+
token: string;
|
|
187
|
+
ipAddress?: string | null | undefined;
|
|
188
|
+
userAgent?: string | null | undefined;
|
|
189
|
+
id: string;
|
|
190
|
+
activeOrganizationId?: string | undefined;
|
|
191
|
+
activeProjectId?: string | undefined;
|
|
192
|
+
};
|
|
193
|
+
user: {
|
|
194
|
+
email: string;
|
|
195
|
+
name: string;
|
|
196
|
+
image?: string | null | undefined;
|
|
197
|
+
createdAt: Date;
|
|
198
|
+
updatedAt: Date;
|
|
199
|
+
emailVerified: boolean;
|
|
200
|
+
phone?: string | undefined;
|
|
201
|
+
dateOfBirth?: Date | undefined;
|
|
202
|
+
id: string;
|
|
203
|
+
emailsList?: {
|
|
204
|
+
newsLetter: boolean;
|
|
205
|
+
} | undefined;
|
|
206
|
+
customerId?: string | undefined;
|
|
207
|
+
role?: string | undefined;
|
|
208
|
+
lang?: string | undefined;
|
|
209
|
+
};
|
|
210
|
+
organization?: {
|
|
211
|
+
name: string;
|
|
212
|
+
membersIds: string[];
|
|
213
|
+
adminsIds: string[];
|
|
214
|
+
id: string;
|
|
215
|
+
creatorId: string;
|
|
216
|
+
plan?: {
|
|
217
|
+
type: import('@intlayer/backend').PlanType;
|
|
218
|
+
creatorId?: string | undefined;
|
|
219
|
+
subscriptionId?: string | undefined;
|
|
220
|
+
customerId?: string | undefined;
|
|
221
|
+
priceId?: string | undefined;
|
|
222
|
+
status?: "active" | "canceled" | "past_due" | "unpaid" | "incomplete" | "incomplete_expired" | "paused" | "trialing" | undefined;
|
|
223
|
+
period?: "MONTHLY" | "YEARLY" | undefined;
|
|
224
|
+
id: string;
|
|
225
|
+
createdAt: number;
|
|
226
|
+
updatedAt: number;
|
|
227
|
+
} | undefined;
|
|
228
|
+
createdAt: number;
|
|
229
|
+
updatedAt: number;
|
|
230
|
+
} | null | undefined;
|
|
231
|
+
project?: {
|
|
232
|
+
organizationId: string;
|
|
233
|
+
name: string;
|
|
234
|
+
membersIds: string[];
|
|
235
|
+
adminsIds: string[];
|
|
236
|
+
creatorId: string;
|
|
237
|
+
configuration?: {
|
|
238
|
+
internationalization: {
|
|
239
|
+
locales: import('intlayer').Locales[];
|
|
240
|
+
defaultLocale: import('intlayer').Locales;
|
|
241
|
+
};
|
|
242
|
+
editor: {
|
|
243
|
+
applicationURL: string;
|
|
244
|
+
cmsURL: string;
|
|
245
|
+
};
|
|
246
|
+
} | undefined;
|
|
247
|
+
id: string;
|
|
248
|
+
createdAt: number;
|
|
249
|
+
updatedAt: number;
|
|
250
|
+
oAuth2Access: {
|
|
251
|
+
name: string;
|
|
252
|
+
grants: string[];
|
|
253
|
+
expiresAt?: Date | undefined;
|
|
254
|
+
clientId: string;
|
|
255
|
+
clientSecret: string;
|
|
256
|
+
accessToken: string[];
|
|
257
|
+
userId: string;
|
|
258
|
+
id: string;
|
|
259
|
+
createdAt: number;
|
|
260
|
+
updatedAt: number;
|
|
261
|
+
}[];
|
|
262
|
+
} | null | undefined;
|
|
263
|
+
id: string;
|
|
264
|
+
permissions: import('node_modules/@intlayer/backend/dist/types/utils/permissions').Permission[];
|
|
265
|
+
roles: import('node_modules/@intlayer/backend/dist/types/utils/permissions').Roles[];
|
|
266
|
+
authType: "session" | "oauth2" | null;
|
|
267
|
+
}>;
|
|
268
|
+
setSession: (data: {
|
|
269
|
+
session: {
|
|
270
|
+
userId: string;
|
|
271
|
+
expiresAt: Date;
|
|
272
|
+
createdAt: Date;
|
|
273
|
+
updatedAt: Date;
|
|
274
|
+
token: string;
|
|
275
|
+
ipAddress?: string | null | undefined;
|
|
276
|
+
userAgent?: string | null | undefined;
|
|
277
|
+
id: string;
|
|
278
|
+
activeOrganizationId?: string | undefined;
|
|
279
|
+
activeProjectId?: string | undefined;
|
|
280
|
+
};
|
|
281
|
+
user: {
|
|
282
|
+
email: string;
|
|
283
|
+
name: string;
|
|
284
|
+
image?: string | null | undefined;
|
|
285
|
+
createdAt: Date;
|
|
286
|
+
updatedAt: Date;
|
|
287
|
+
emailVerified: boolean;
|
|
288
|
+
phone?: string | undefined;
|
|
289
|
+
dateOfBirth?: Date | undefined;
|
|
290
|
+
id: string;
|
|
291
|
+
emailsList?: {
|
|
292
|
+
newsLetter: boolean;
|
|
293
|
+
} | undefined;
|
|
294
|
+
customerId?: string | undefined;
|
|
295
|
+
role?: string | undefined;
|
|
296
|
+
lang?: string | undefined;
|
|
297
|
+
};
|
|
298
|
+
organization?: {
|
|
299
|
+
name: string;
|
|
300
|
+
membersIds: string[];
|
|
301
|
+
adminsIds: string[];
|
|
302
|
+
id: string;
|
|
303
|
+
creatorId: string;
|
|
304
|
+
plan?: {
|
|
305
|
+
type: import('@intlayer/backend').PlanType;
|
|
306
|
+
creatorId?: string | undefined;
|
|
307
|
+
subscriptionId?: string | undefined;
|
|
308
|
+
customerId?: string | undefined;
|
|
309
|
+
priceId?: string | undefined;
|
|
310
|
+
status?: "active" | "canceled" | "past_due" | "unpaid" | "incomplete" | "incomplete_expired" | "paused" | "trialing" | undefined;
|
|
311
|
+
period?: "MONTHLY" | "YEARLY" | undefined;
|
|
312
|
+
id: string;
|
|
313
|
+
createdAt: number;
|
|
314
|
+
updatedAt: number;
|
|
315
|
+
} | undefined;
|
|
316
|
+
createdAt: number;
|
|
317
|
+
updatedAt: number;
|
|
318
|
+
} | null | undefined;
|
|
319
|
+
project?: {
|
|
320
|
+
organizationId: string;
|
|
321
|
+
name: string;
|
|
322
|
+
membersIds: string[];
|
|
323
|
+
adminsIds: string[];
|
|
324
|
+
creatorId: string;
|
|
325
|
+
configuration?: {
|
|
326
|
+
internationalization: {
|
|
327
|
+
locales: import('intlayer').Locales[];
|
|
328
|
+
defaultLocale: import('intlayer').Locales;
|
|
329
|
+
};
|
|
330
|
+
editor: {
|
|
331
|
+
applicationURL: string;
|
|
332
|
+
cmsURL: string;
|
|
333
|
+
};
|
|
334
|
+
} | undefined;
|
|
335
|
+
id: string;
|
|
336
|
+
createdAt: number;
|
|
337
|
+
updatedAt: number;
|
|
338
|
+
oAuth2Access: {
|
|
339
|
+
name: string;
|
|
340
|
+
grants: string[];
|
|
341
|
+
expiresAt?: Date | undefined;
|
|
342
|
+
clientId: string;
|
|
343
|
+
clientSecret: string;
|
|
344
|
+
accessToken: string[];
|
|
345
|
+
userId: string;
|
|
346
|
+
id: string;
|
|
347
|
+
createdAt: number;
|
|
348
|
+
updatedAt: number;
|
|
349
|
+
}[];
|
|
350
|
+
} | null | undefined;
|
|
351
|
+
id: string;
|
|
352
|
+
permissions: import('node_modules/@intlayer/backend/dist/types/utils/permissions').Permission[];
|
|
353
|
+
roles: import('node_modules/@intlayer/backend/dist/types/utils/permissions').Roles[];
|
|
354
|
+
authType: "session" | "oauth2" | null;
|
|
355
|
+
} | null) => void;
|
|
8
356
|
};
|
|
9
357
|
//# sourceMappingURL=useSession.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSession.d.ts","sourceRoot":"","sources":["../../../src/hooks/useAuth/useSession.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useSession.d.ts","sourceRoot":"","sources":["../../../src/hooks/useAuth/useSession.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAK9D,eAAO,MAAM,UAAU,GACrB,cAAc,UAAU,GAAG,IAAI,EAC/B,wBAAwB,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwCvC,CAAC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
3
|
-
import defaultConfiguration from "@intlayer/config/built";
|
|
2
|
+
import configuration from "@intlayer/config/built";
|
|
4
3
|
import { useConfiguration } from "@intlayer/editor-react";
|
|
4
|
+
import { getAuthAPI } from "../auth.mjs";
|
|
5
5
|
import { useAsync } from "../useAsync/useAsync.mjs";
|
|
6
6
|
import "../useAsync/useAsyncStateStore.mjs";
|
|
7
7
|
const useSession = (sessionProp, intlayerConfiguration) => {
|
|
8
|
-
const configuration = useConfiguration();
|
|
9
|
-
const config = intlayerConfiguration ?? configuration ??
|
|
8
|
+
const configuration$1 = useConfiguration();
|
|
9
|
+
const config = intlayerConfiguration ?? configuration$1 ?? configuration;
|
|
10
10
|
const {
|
|
11
11
|
getSession,
|
|
12
12
|
revalidate,
|
|
@@ -16,7 +16,7 @@ const useSession = (sessionProp, intlayerConfiguration) => {
|
|
|
16
16
|
} = useAsync(
|
|
17
17
|
"getSession",
|
|
18
18
|
async () => {
|
|
19
|
-
const intlayerAPI =
|
|
19
|
+
const intlayerAPI = getAuthAPI(config);
|
|
20
20
|
const result = await intlayerAPI.getSession();
|
|
21
21
|
return result.data;
|
|
22
22
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSession.mjs","sources":["../../../src/hooks/useAuth/useSession.ts"],"sourcesContent":["'use client';\n\nimport
|
|
1
|
+
{"version":3,"file":"useSession.mjs","sources":["../../../src/hooks/useAuth/useSession.ts"],"sourcesContent":["'use client';\n\nimport type { SessionAPI } from '@intlayer/backend';\nimport defaultConfiguration from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/config/client';\nimport { useConfiguration } from '@intlayer/editor-react';\nimport { getAuthAPI } from '../auth';\nimport { useAsync } from '../useAsync';\n\nexport const useSession = (\n sessionProp?: SessionAPI | null,\n intlayerConfiguration?: IntlayerConfig\n) => {\n const configuration = useConfiguration();\n const config = intlayerConfiguration ?? configuration ?? defaultConfiguration;\n\n const {\n getSession,\n revalidate,\n data,\n setData: setSession,\n isFetched,\n } = useAsync(\n 'getSession',\n async () => {\n const intlayerAPI = getAuthAPI(config);\n const result = await intlayerAPI.getSession();\n return result.data as unknown as SessionAPI;\n },\n {\n cache: true,\n store: true,\n autoFetch: true,\n enable: !sessionProp,\n invalidateQueries: [\n 'getOrganizations',\n 'getProjects',\n 'getUsers',\n 'getDictionaries',\n ],\n }\n );\n\n const session = data ?? (isFetched ? null : undefined);\n\n return {\n session,\n fetchSession: getSession,\n revalidateSession: revalidate,\n setSession,\n };\n};\n"],"names":["configuration","defaultConfiguration"],"mappings":";;;;;;AASa,MAAA,aAAa,CACxB,aACA,0BACG;AACH,QAAMA,kBAAgB,iBAAiB;AACjC,QAAA,SAAS,yBAAyBA,mBAAiBC;AAEnD,QAAA;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT;AAAA,EAAA,IACE;AAAA,IACF;AAAA,IACA,YAAY;AACJ,YAAA,cAAc,WAAW,MAAM;AAC/B,YAAA,SAAS,MAAM,YAAY,WAAW;AAC5C,aAAO,OAAO;AAAA,IAChB;AAAA,IACA;AAAA,MACE,OAAO;AAAA,MACP,OAAO;AAAA,MACP,WAAW;AAAA,MACX,QAAQ,CAAC;AAAA,MACT,mBAAmB;AAAA,QACjB;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MAAA;AAAA,IACF;AAAA,EAEJ;AAEM,QAAA,UAAU,SAAS,YAAY,OAAO;AAErC,SAAA;AAAA,IACL;AAAA,IACA,cAAc;AAAA,IACd,mBAAmB;AAAA,IACnB;AAAA,EACF;AACF;"}
|
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const api = require("@intlayer/api");
|
|
4
4
|
const editorReact = require("@intlayer/editor-react");
|
|
5
|
+
const hooks_auth = require("./auth.cjs");
|
|
5
6
|
const hooks_useAuth_useAuth = require("./useAuth/useAuth.cjs");
|
|
6
7
|
require("@intlayer/config/built");
|
|
7
8
|
require("react");
|
|
8
9
|
require("./useAsync/useAsyncStateStore.cjs");
|
|
9
|
-
const
|
|
10
|
+
const useIntlayerOAuth = (props) => {
|
|
10
11
|
const configuration = editorReact.useConfiguration();
|
|
11
12
|
const { oAuth2AccessToken } = hooks_useAuth_useAuth.useAuth();
|
|
12
13
|
return api.getIntlayerAPI(
|
|
@@ -21,5 +22,10 @@ const useIntlayerAuth = (props) => {
|
|
|
21
22
|
props?.intlayerConfiguration ?? configuration
|
|
22
23
|
);
|
|
23
24
|
};
|
|
25
|
+
const useIntlayerAuth = (props) => {
|
|
26
|
+
const configuration = editorReact.useConfiguration();
|
|
27
|
+
return hooks_auth.getAuthAPI(props?.intlayerConfiguration ?? configuration);
|
|
28
|
+
};
|
|
24
29
|
exports.useIntlayerAuth = useIntlayerAuth;
|
|
30
|
+
exports.useIntlayerOAuth = useIntlayerOAuth;
|
|
25
31
|
//# sourceMappingURL=useIntlayerAPI.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useIntlayerAPI.cjs","sources":["../../src/hooks/useIntlayerAPI.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"useIntlayerAPI.cjs","sources":["../../src/hooks/useIntlayerAPI.ts"],"sourcesContent":["import {\n getIntlayerAPI,\n type FetcherOptions,\n type IntlayerAPI,\n} from '@intlayer/api';\nimport { type IntlayerConfig } from '@intlayer/config/client';\nimport { useConfiguration } from '@intlayer/editor-react';\nimport { getAuthAPI, type AuthAPI } from './auth';\nimport { useAuth } from './useAuth';\n\ntype UseIntlayerAuthProps = {\n options?: FetcherOptions;\n intlayerConfiguration?: IntlayerConfig;\n};\n\nexport const useIntlayerOAuth = (props?: UseIntlayerAuthProps): IntlayerAPI => {\n const configuration = useConfiguration();\n const { oAuth2AccessToken } = useAuth();\n\n return getIntlayerAPI(\n {\n ...(oAuth2AccessToken && {\n headers: {\n Authorization: `Bearer ${oAuth2AccessToken}`,\n },\n }),\n ...(props?.options ?? {}),\n },\n props?.intlayerConfiguration ?? configuration\n );\n};\n\nexport const useIntlayerAuth = (props?: UseIntlayerAuthProps): AuthAPI => {\n const configuration = useConfiguration();\n\n return getAuthAPI(props?.intlayerConfiguration ?? configuration);\n};\n"],"names":["useConfiguration","useAuth","getIntlayerAPI","getAuthAPI"],"mappings":";;;;;;;;;AAea,MAAA,mBAAmB,CAAC,UAA8C;AAC7E,QAAM,gBAAgBA,YAAAA,iBAAiB;AACjC,QAAA,EAAE,kBAAkB,IAAIC,8BAAQ;AAE/B,SAAAC,IAAA;AAAA,IACL;AAAA,MACE,GAAI,qBAAqB;AAAA,QACvB,SAAS;AAAA,UACP,eAAe,UAAU,iBAAiB;AAAA,QAAA;AAAA,MAE9C;AAAA,MACA,GAAI,OAAO,WAAW,CAAA;AAAA,IACxB;AAAA,IACA,OAAO,yBAAyB;AAAA,EAClC;AACF;AAEa,MAAA,kBAAkB,CAAC,UAA0C;AACxE,QAAM,gBAAgBF,YAAAA,iBAAiB;AAEhC,SAAAG,sBAAW,OAAO,yBAAyB,aAAa;AACjE;;;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FetcherOptions, IntlayerAPI } from '@intlayer/api';
|
|
2
|
+
import { IntlayerConfig } from '@intlayer/config/client';
|
|
3
|
+
import { AuthAPI } from './auth';
|
|
4
|
+
type UseIntlayerAuthProps = {
|
|
5
|
+
options?: FetcherOptions;
|
|
6
|
+
intlayerConfiguration?: IntlayerConfig;
|
|
7
|
+
};
|
|
8
|
+
export declare const useIntlayerOAuth: (props?: UseIntlayerAuthProps) => IntlayerAPI;
|
|
9
|
+
export declare const useIntlayerAuth: (props?: UseIntlayerAuthProps) => AuthAPI;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=useIntlayerAPI.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useIntlayerAPI.d.ts","sourceRoot":"","sources":["../../src/hooks/useIntlayerAPI.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,WAAW,EACjB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAE9D,OAAO,EAAc,KAAK,OAAO,EAAE,MAAM,QAAQ,CAAC;AAGlD,KAAK,oBAAoB,GAAG;IAC1B,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,qBAAqB,CAAC,EAAE,cAAc,CAAC;CACxC,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,QAAQ,oBAAoB,KAAG,WAe/D,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,QAAQ,oBAAoB,KAAG,OAI9D,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { getIntlayerAPI } from "@intlayer/api";
|
|
2
2
|
import { useConfiguration } from "@intlayer/editor-react";
|
|
3
|
+
import { getAuthAPI } from "./auth.mjs";
|
|
3
4
|
import { useAuth } from "./useAuth/useAuth.mjs";
|
|
4
5
|
import "@intlayer/config/built";
|
|
5
6
|
import "react";
|
|
6
7
|
import "./useAsync/useAsyncStateStore.mjs";
|
|
7
|
-
const
|
|
8
|
+
const useIntlayerOAuth = (props) => {
|
|
8
9
|
const configuration = useConfiguration();
|
|
9
10
|
const { oAuth2AccessToken } = useAuth();
|
|
10
11
|
return getIntlayerAPI(
|
|
@@ -19,7 +20,12 @@ const useIntlayerAuth = (props) => {
|
|
|
19
20
|
props?.intlayerConfiguration ?? configuration
|
|
20
21
|
);
|
|
21
22
|
};
|
|
23
|
+
const useIntlayerAuth = (props) => {
|
|
24
|
+
const configuration = useConfiguration();
|
|
25
|
+
return getAuthAPI(props?.intlayerConfiguration ?? configuration);
|
|
26
|
+
};
|
|
22
27
|
export {
|
|
23
|
-
useIntlayerAuth
|
|
28
|
+
useIntlayerAuth,
|
|
29
|
+
useIntlayerOAuth
|
|
24
30
|
};
|
|
25
31
|
//# sourceMappingURL=useIntlayerAPI.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useIntlayerAPI.mjs","sources":["../../src/hooks/useIntlayerAPI.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"useIntlayerAPI.mjs","sources":["../../src/hooks/useIntlayerAPI.ts"],"sourcesContent":["import {\n getIntlayerAPI,\n type FetcherOptions,\n type IntlayerAPI,\n} from '@intlayer/api';\nimport { type IntlayerConfig } from '@intlayer/config/client';\nimport { useConfiguration } from '@intlayer/editor-react';\nimport { getAuthAPI, type AuthAPI } from './auth';\nimport { useAuth } from './useAuth';\n\ntype UseIntlayerAuthProps = {\n options?: FetcherOptions;\n intlayerConfiguration?: IntlayerConfig;\n};\n\nexport const useIntlayerOAuth = (props?: UseIntlayerAuthProps): IntlayerAPI => {\n const configuration = useConfiguration();\n const { oAuth2AccessToken } = useAuth();\n\n return getIntlayerAPI(\n {\n ...(oAuth2AccessToken && {\n headers: {\n Authorization: `Bearer ${oAuth2AccessToken}`,\n },\n }),\n ...(props?.options ?? {}),\n },\n props?.intlayerConfiguration ?? configuration\n );\n};\n\nexport const useIntlayerAuth = (props?: UseIntlayerAuthProps): AuthAPI => {\n const configuration = useConfiguration();\n\n return getAuthAPI(props?.intlayerConfiguration ?? configuration);\n};\n"],"names":[],"mappings":";;;;;;;AAea,MAAA,mBAAmB,CAAC,UAA8C;AAC7E,QAAM,gBAAgB,iBAAiB;AACjC,QAAA,EAAE,kBAAkB,IAAI,QAAQ;AAE/B,SAAA;AAAA,IACL;AAAA,MACE,GAAI,qBAAqB;AAAA,QACvB,SAAS;AAAA,UACP,eAAe,UAAU,iBAAiB;AAAA,QAAA;AAAA,MAE9C;AAAA,MACA,GAAI,OAAO,WAAW,CAAA;AAAA,IACxB;AAAA,IACA,OAAO,yBAAyB;AAAA,EAClC;AACF;AAEa,MAAA,kBAAkB,CAAC,UAA0C;AACxE,QAAM,gBAAgB,iBAAiB;AAEhC,SAAA,WAAW,OAAO,yBAAyB,aAAa;AACjE;"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use strict";
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
require("@intlayer/config/built");
|
|
5
|
+
require("../../better-auth.8zoxzg-F-BEBqzpjz.cjs");
|
|
4
6
|
const hooks_intlayerAPIHooks = require("../intlayerAPIHooks.cjs");
|
|
5
7
|
require("react");
|
|
6
8
|
require("../useAsync/useAsyncStateStore.cjs");
|
|
7
9
|
const hooks_useAuth_useAuth = require("../useAuth/useAuth.cjs");
|
|
8
10
|
require("@intlayer/api");
|
|
9
|
-
require("@intlayer/config/built");
|
|
10
11
|
require("@intlayer/editor-react");
|
|
11
12
|
require("deepmerge");
|
|
12
13
|
require("../useScrollBlockage/useScrollBlockageStore.cjs");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../src/hooks/useUser/index.ts"],"sourcesContent":["'use client';\n\nimport { useLogout } from '..';\nimport { useAuth } from '../useAuth';\n\nexport const useUser = () => {\n const { session, revalidateSession, setSession } = useAuth();\n const { logout } = useLogout();\n\n const status = session?.user ? 'authenticated' : 'unauthenticated';\n\n const isAuthenticated = status === 'authenticated';\n const isUnauthenticated = status === 'unauthenticated';\n\n const user = session?.user;\n\n const logoutHandle = async () => {\n setSession(null);\n await logout();\n };\n\n return {\n isAuthenticated,\n isUnauthenticated,\n user,\n revalidateSession,\n logout: logoutHandle,\n };\n};\n"],"names":["useAuth","useLogout"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../src/hooks/useUser/index.ts"],"sourcesContent":["'use client';\n\nimport { useLogout } from '..';\nimport { useAuth } from '../useAuth';\n\nexport const useUser = () => {\n const { session, revalidateSession, setSession } = useAuth();\n const { logout } = useLogout();\n\n const status = session?.user ? 'authenticated' : 'unauthenticated';\n\n const isAuthenticated = status === 'authenticated';\n const isUnauthenticated = status === 'unauthenticated';\n\n const user = session?.user;\n\n const logoutHandle = async () => {\n setSession(null);\n await logout();\n };\n\n return {\n isAuthenticated,\n isUnauthenticated,\n user,\n revalidateSession,\n logout: logoutHandle,\n };\n};\n"],"names":["useAuth","useLogout"],"mappings":";;;;;;;;;;;;;AAKO,MAAM,UAAU,MAAM;AAC3B,QAAM,EAAE,SAAS,mBAAmB,WAAA,IAAeA,sBAAAA,QAAQ;AACrD,QAAA,EAAE,OAAO,IAAIC,iCAAU;AAEvB,QAAA,SAAS,SAAS,OAAO,kBAAkB;AAEjD,QAAM,kBAAkB,WAAW;AACnC,QAAM,oBAAoB,WAAW;AAErC,QAAM,OAAO,SAAS;AAEtB,QAAM,eAAe,YAAY;AAC/B,eAAW,IAAI;AACf,UAAM,OAAO;AAAA,EACf;AAEO,SAAA;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,QAAQ;AAAA,EACV;AACF;;"}
|