@contember/react-client-tenant 2.0.0-alpha.32 → 2.0.0-alpha.36
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/development/src/components/IdentityProvider.cjs.map +1 -1
- package/dist/development/src/components/IdentityProvider.js.map +1 -1
- package/dist/development/src/components/IdentityState.cjs.map +1 -1
- package/dist/development/src/components/IdentityState.js.map +1 -1
- package/dist/development/src/components/forms/ChangeMyPasswordForm.cjs.map +1 -1
- package/dist/development/src/components/forms/ChangeMyPasswordForm.js.map +1 -1
- package/dist/development/src/components/forms/CreateApiKeyForm.cjs.map +1 -1
- package/dist/development/src/components/forms/CreateApiKeyForm.js.map +1 -1
- package/dist/development/src/components/forms/CreateSessionTokenForm.cjs.map +1 -1
- package/dist/development/src/components/forms/CreateSessionTokenForm.js.map +1 -1
- package/dist/development/src/components/forms/InviteForm.cjs.map +1 -1
- package/dist/development/src/components/forms/InviteForm.js.map +1 -1
- package/dist/development/src/components/forms/LoginForm.cjs.map +1 -1
- package/dist/development/src/components/forms/LoginForm.js.map +1 -1
- package/dist/development/src/components/forms/OtpConfirmForm.cjs.map +1 -1
- package/dist/development/src/components/forms/OtpConfirmForm.js.map +1 -1
- package/dist/development/src/components/forms/OtpPrepareForm.cjs.map +1 -1
- package/dist/development/src/components/forms/OtpPrepareForm.js.map +1 -1
- package/dist/development/src/components/forms/PasswordResetForm.cjs.map +1 -1
- package/dist/development/src/components/forms/PasswordResetForm.js.map +1 -1
- package/dist/development/src/components/forms/PasswordResetRequestForm.cjs.map +1 -1
- package/dist/development/src/components/forms/PasswordResetRequestForm.js.map +1 -1
- package/dist/development/src/components/forms/PasswordlessSignInForm.cjs.map +1 -1
- package/dist/development/src/components/forms/PasswordlessSignInForm.js.map +1 -1
- package/dist/development/src/components/forms/PasswordlessSignInInitForm.cjs.map +1 -1
- package/dist/development/src/components/forms/PasswordlessSignInInitForm.js.map +1 -1
- package/dist/development/src/components/forms/TenantForm.cjs.map +1 -1
- package/dist/development/src/components/forms/TenantForm.js.map +1 -1
- package/dist/development/src/components/forms/UpdateProjectMemberForm.cjs.map +1 -1
- package/dist/development/src/components/forms/UpdateProjectMemberForm.js.map +1 -1
- package/dist/development/src/components/idp/IDP.cjs.map +1 -1
- package/dist/development/src/components/idp/IDP.js.map +1 -1
- package/dist/development/src/components/idp/IDPInitTrigger.cjs.map +1 -1
- package/dist/development/src/components/idp/IDPInitTrigger.js.map +1 -1
- package/dist/development/src/components/idp/IDPState.cjs.map +1 -1
- package/dist/development/src/components/idp/IDPState.js.map +1 -1
- package/dist/development/src/components/triggers/DisableOtpTrigger.cjs.map +1 -1
- package/dist/development/src/components/triggers/DisableOtpTrigger.js.map +1 -1
- package/dist/development/src/components/triggers/LogoutTrigger.cjs.map +1 -1
- package/dist/development/src/components/triggers/LogoutTrigger.js.map +1 -1
- package/dist/development/src/components/triggers/RemoveProjectMemberTrigger.cjs.map +1 -1
- package/dist/development/src/components/triggers/RemoveProjectMemberTrigger.js.map +1 -1
- package/dist/development/src/components/triggers/TenantActionTrigger.cjs.map +1 -1
- package/dist/development/src/components/triggers/TenantActionTrigger.js.map +1 -1
- package/dist/development/src/contexts.cjs.map +1 -1
- package/dist/development/src/hooks/mutations/auth/useSignInMutation.cjs.map +1 -1
- package/dist/development/src/hooks/mutations/idp/useInitSignInIDPMutation.cjs.map +1 -1
- package/dist/development/src/hooks/mutations/idp/useSignInIdpMutation.cjs.map +1 -1
- package/dist/development/src/hooks/mutations/passwordReset/useCreateResetPasswordRequestMutation.cjs.map +1 -1
- package/dist/development/src/hooks/mutations/passwordReset/useResetPasswordMutation.cjs.map +1 -1
- package/dist/development/src/hooks/mutations/passwordless/useActivatePasswordlessOtpMutation.cjs.map +1 -1
- package/dist/development/src/hooks/mutations/passwordless/useInitSignInPasswordlessMutation.cjs.map +1 -1
- package/dist/development/src/hooks/mutations/passwordless/useSignInPasswordlessMutation.cjs.map +1 -1
- package/dist/development/src/hooks/queries/useProjectMembersQuery.cjs.map +1 -1
- package/dist/development/src/hooks/queries/useProjectMembersQuery.js.map +1 -1
- package/dist/development/src/hooks/queries/useProjectMembershipsQuery.cjs.map +1 -1
- package/dist/development/src/hooks/queries/useProjectMembershipsQuery.js.map +1 -1
- package/dist/development/src/hooks/queries/useProjectRolesDefinitionQuery.cjs.map +1 -1
- package/dist/development/src/hooks/queries/useProjectRolesDefinitionQuery.js.map +1 -1
- package/dist/development/src/hooks/useFetchIdentity.cjs.map +1 -1
- package/dist/development/src/hooks/useFetchIdentity.js.map +1 -1
- package/dist/development/src/hooks/useLogout.cjs.map +1 -1
- package/dist/development/src/hooks/useLogout.js.map +1 -1
- package/dist/development/src/hooks/usePasswordlessOtpActivator.cjs.map +1 -1
- package/dist/development/src/hooks/usePasswordlessOtpActivator.js.map +1 -1
- package/dist/development/src/hooks/useTenantApi.cjs.map +1 -1
- package/dist/development/src/hooks/useTenantApi.js.map +1 -1
- package/dist/development/src/hooks/useTenantMutation.cjs.map +1 -1
- package/dist/development/src/hooks/useTenantMutation.js.map +1 -1
- package/dist/development/src/hooks/useTenantQueryLoader.cjs.map +1 -1
- package/dist/development/src/hooks/useTenantQueryLoader.js.map +1 -1
- package/dist/development/src/internal/hooks/useHandleIDPResponse.cjs.map +1 -1
- package/dist/development/src/internal/hooks/useHandleIDPResponse.js.map +1 -1
- package/dist/development/src/internal/hooks/useIDPAutoInit.cjs.map +1 -1
- package/dist/development/src/internal/hooks/useIDPAutoInit.js.map +1 -1
- package/dist/development/src/internal/hooks/useIDPStateStore.cjs.map +1 -1
- package/dist/development/src/internal/hooks/useIDPStateStore.js.map +1 -1
- package/dist/development/src/internal/hooks/useInitIDPRedirect.cjs.map +1 -1
- package/dist/development/src/internal/hooks/useInitIDPRedirect.js.map +1 -1
- package/dist/development/src/internal/hooks/useLogoutInternal.cjs.map +1 -1
- package/dist/development/src/internal/hooks/useLogoutInternal.js.map +1 -1
- package/dist/development/src/internal/hooks/useRedirectToBacklink.cjs.map +1 -1
- package/dist/development/src/internal/hooks/useRedirectToBacklink.js.map +1 -1
- package/dist/development/src/internal/utils/randomInt.cjs.map +1 -1
- package/dist/development/src/internal/utils/randomInt.js.map +1 -1
- package/dist/production/src/components/IdentityProvider.cjs.map +1 -1
- package/dist/production/src/components/IdentityProvider.js.map +1 -1
- package/dist/production/src/components/IdentityState.cjs.map +1 -1
- package/dist/production/src/components/IdentityState.js.map +1 -1
- package/dist/production/src/components/forms/ChangeMyPasswordForm.cjs.map +1 -1
- package/dist/production/src/components/forms/ChangeMyPasswordForm.js.map +1 -1
- package/dist/production/src/components/forms/CreateApiKeyForm.cjs.map +1 -1
- package/dist/production/src/components/forms/CreateApiKeyForm.js.map +1 -1
- package/dist/production/src/components/forms/CreateSessionTokenForm.cjs.map +1 -1
- package/dist/production/src/components/forms/CreateSessionTokenForm.js.map +1 -1
- package/dist/production/src/components/forms/InviteForm.cjs.map +1 -1
- package/dist/production/src/components/forms/InviteForm.js.map +1 -1
- package/dist/production/src/components/forms/LoginForm.cjs.map +1 -1
- package/dist/production/src/components/forms/LoginForm.js.map +1 -1
- package/dist/production/src/components/forms/OtpConfirmForm.cjs.map +1 -1
- package/dist/production/src/components/forms/OtpConfirmForm.js.map +1 -1
- package/dist/production/src/components/forms/OtpPrepareForm.cjs.map +1 -1
- package/dist/production/src/components/forms/OtpPrepareForm.js.map +1 -1
- package/dist/production/src/components/forms/PasswordResetForm.cjs.map +1 -1
- package/dist/production/src/components/forms/PasswordResetForm.js.map +1 -1
- package/dist/production/src/components/forms/PasswordResetRequestForm.cjs.map +1 -1
- package/dist/production/src/components/forms/PasswordResetRequestForm.js.map +1 -1
- package/dist/production/src/components/forms/PasswordlessSignInForm.cjs.map +1 -1
- package/dist/production/src/components/forms/PasswordlessSignInForm.js.map +1 -1
- package/dist/production/src/components/forms/PasswordlessSignInInitForm.cjs.map +1 -1
- package/dist/production/src/components/forms/PasswordlessSignInInitForm.js.map +1 -1
- package/dist/production/src/components/forms/TenantForm.cjs.map +1 -1
- package/dist/production/src/components/forms/TenantForm.js.map +1 -1
- package/dist/production/src/components/forms/UpdateProjectMemberForm.cjs.map +1 -1
- package/dist/production/src/components/forms/UpdateProjectMemberForm.js.map +1 -1
- package/dist/production/src/components/idp/IDP.cjs.map +1 -1
- package/dist/production/src/components/idp/IDP.js.map +1 -1
- package/dist/production/src/components/idp/IDPInitTrigger.cjs.map +1 -1
- package/dist/production/src/components/idp/IDPInitTrigger.js.map +1 -1
- package/dist/production/src/components/idp/IDPState.cjs.map +1 -1
- package/dist/production/src/components/idp/IDPState.js.map +1 -1
- package/dist/production/src/components/triggers/DisableOtpTrigger.cjs.map +1 -1
- package/dist/production/src/components/triggers/DisableOtpTrigger.js.map +1 -1
- package/dist/production/src/components/triggers/LogoutTrigger.cjs.map +1 -1
- package/dist/production/src/components/triggers/LogoutTrigger.js.map +1 -1
- package/dist/production/src/components/triggers/RemoveProjectMemberTrigger.cjs.map +1 -1
- package/dist/production/src/components/triggers/RemoveProjectMemberTrigger.js.map +1 -1
- package/dist/production/src/components/triggers/TenantActionTrigger.cjs.map +1 -1
- package/dist/production/src/components/triggers/TenantActionTrigger.js.map +1 -1
- package/dist/production/src/contexts.cjs.map +1 -1
- package/dist/production/src/hooks/mutations/auth/useSignInMutation.cjs.map +1 -1
- package/dist/production/src/hooks/mutations/idp/useInitSignInIDPMutation.cjs.map +1 -1
- package/dist/production/src/hooks/mutations/idp/useSignInIdpMutation.cjs.map +1 -1
- package/dist/production/src/hooks/mutations/passwordReset/useCreateResetPasswordRequestMutation.cjs.map +1 -1
- package/dist/production/src/hooks/mutations/passwordReset/useResetPasswordMutation.cjs.map +1 -1
- package/dist/production/src/hooks/mutations/passwordless/useActivatePasswordlessOtpMutation.cjs.map +1 -1
- package/dist/production/src/hooks/mutations/passwordless/useInitSignInPasswordlessMutation.cjs.map +1 -1
- package/dist/production/src/hooks/mutations/passwordless/useSignInPasswordlessMutation.cjs.map +1 -1
- package/dist/production/src/hooks/queries/useProjectMembersQuery.cjs.map +1 -1
- package/dist/production/src/hooks/queries/useProjectMembersQuery.js.map +1 -1
- package/dist/production/src/hooks/queries/useProjectMembershipsQuery.cjs.map +1 -1
- package/dist/production/src/hooks/queries/useProjectMembershipsQuery.js.map +1 -1
- package/dist/production/src/hooks/queries/useProjectRolesDefinitionQuery.cjs.map +1 -1
- package/dist/production/src/hooks/queries/useProjectRolesDefinitionQuery.js.map +1 -1
- package/dist/production/src/hooks/useFetchIdentity.cjs.map +1 -1
- package/dist/production/src/hooks/useFetchIdentity.js.map +1 -1
- package/dist/production/src/hooks/useLogout.cjs.map +1 -1
- package/dist/production/src/hooks/useLogout.js.map +1 -1
- package/dist/production/src/hooks/usePasswordlessOtpActivator.cjs.map +1 -1
- package/dist/production/src/hooks/usePasswordlessOtpActivator.js.map +1 -1
- package/dist/production/src/hooks/useTenantApi.cjs.map +1 -1
- package/dist/production/src/hooks/useTenantApi.js.map +1 -1
- package/dist/production/src/hooks/useTenantMutation.cjs.map +1 -1
- package/dist/production/src/hooks/useTenantMutation.js.map +1 -1
- package/dist/production/src/hooks/useTenantQueryLoader.cjs.map +1 -1
- package/dist/production/src/hooks/useTenantQueryLoader.js.map +1 -1
- package/dist/production/src/internal/hooks/useHandleIDPResponse.cjs.map +1 -1
- package/dist/production/src/internal/hooks/useHandleIDPResponse.js.map +1 -1
- package/dist/production/src/internal/hooks/useIDPAutoInit.cjs.map +1 -1
- package/dist/production/src/internal/hooks/useIDPAutoInit.js.map +1 -1
- package/dist/production/src/internal/hooks/useIDPStateStore.cjs.map +1 -1
- package/dist/production/src/internal/hooks/useIDPStateStore.js.map +1 -1
- package/dist/production/src/internal/hooks/useInitIDPRedirect.cjs.map +1 -1
- package/dist/production/src/internal/hooks/useInitIDPRedirect.js.map +1 -1
- package/dist/production/src/internal/hooks/useLogoutInternal.cjs.map +1 -1
- package/dist/production/src/internal/hooks/useLogoutInternal.js.map +1 -1
- package/dist/production/src/internal/hooks/useRedirectToBacklink.cjs.map +1 -1
- package/dist/production/src/internal/hooks/useRedirectToBacklink.js.map +1 -1
- package/dist/production/src/internal/utils/randomInt.cjs.map +1 -1
- package/dist/production/src/internal/utils/randomInt.js.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useInitIDPRedirect.cjs","sources":["../../../../../../packages/react-client-tenant/src/internal/hooks/useInitIDPRedirect.ts"],"sourcesContent":["import { SetStateAction, useCallback } from 'react'\nimport { useIDPStateStore } from './useIDPStateStore'\nimport { getBaseHref } from '../utils/getBaseHref'\nimport { IDPInitError, IDPStateValue } from '../../types/idp'\nimport { useInitSignInIDPMutation } from '../../hooks'\nimport { useSaveBacklink } from './useRedirectToBacklink'\n\nexport interface UseInitIDPRedirectProps {\n\tonRedirect?: (url: string) => void\n\tsetState: (state: SetStateAction<IDPStateValue>) => void\n}\n\nexport const useInitIDPRedirect = ({ onRedirect, setState }: UseInitIDPRedirectProps) => {\n\tconst initRequest = useInitSignInIDPMutation()\n\tconst saveBacklink = useSaveBacklink()\n\tconst { set: saveIdpState } = useIDPStateStore()\n\n\treturn useCallback(async ({ provider }: { provider: string }): Promise<{ ok: true } | { ok: false; error: IDPInitError }> => {\n\t\tconst fail = (error: IDPInitError) => {\n\t\t\tsetState({ type: 'init_failed', error })\n\t\t\treturn { ok: false, error }\n\t\t}\n\t\ttry {\n\t\t\tsetState({ type: 'processing_init' })\n\t\t\tconst response = await initRequest({\n\t\t\t\tdata: {\n\t\t\t\t\tredirectUrl: getBaseHref(),\n\t\t\t\t},\n\t\t\t\tidentityProvider: provider,\n\t\t\t})\n\t\t\tif (!response.ok) {\n\t\t\t\treturn fail(response.error || 'UNKNOWN_ERROR')\n\t\t\t} else {\n\t\t\t\tsaveIdpState({ provider, sessionData: response.result.sessionData as string })\n\t\t\t\tsaveBacklink()\n\t\t\t\tif (onRedirect) {\n\t\t\t\t\tonRedirect(response.result.authUrl as string)\n\t\t\t\t} else {\n\t\t\t\t\twindow.location.href = response.result.authUrl as string\n\t\t\t\t}\n\t\t\t\treturn { ok: true }\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t\treturn fail('UNKNOWN_ERROR')\n\t\t}\n\t}, [initRequest, onRedirect, saveBacklink, saveIdpState, setState])\n}\n"],"names":["useInitSignInIDPMutation","useSaveBacklink","useIDPStateStore","useCallback","getBaseHref"],"mappings":";;;;;;;AAYO,MAAM,qBAAqB,CAAC,EAAE,YAAY,eAAwC;AACxF,QAAM,cAAcA,yBAAAA;
|
|
1
|
+
{"version":3,"file":"useInitIDPRedirect.cjs","sources":["../../../../../../packages/react-client-tenant/src/internal/hooks/useInitIDPRedirect.ts"],"sourcesContent":["import { SetStateAction, useCallback } from 'react'\nimport { useIDPStateStore } from './useIDPStateStore'\nimport { getBaseHref } from '../utils/getBaseHref'\nimport { IDPInitError, IDPStateValue } from '../../types/idp'\nimport { useInitSignInIDPMutation } from '../../hooks'\nimport { useSaveBacklink } from './useRedirectToBacklink'\n\nexport interface UseInitIDPRedirectProps {\n\tonRedirect?: (url: string) => void\n\tsetState: (state: SetStateAction<IDPStateValue>) => void\n}\n\nexport const useInitIDPRedirect = ({ onRedirect, setState }: UseInitIDPRedirectProps) => {\n\tconst initRequest = useInitSignInIDPMutation()\n\tconst saveBacklink = useSaveBacklink()\n\tconst { set: saveIdpState } = useIDPStateStore()\n\n\treturn useCallback(async ({ provider }: { provider: string }): Promise<{ ok: true } | { ok: false; error: IDPInitError }> => {\n\t\tconst fail = (error: IDPInitError) => {\n\t\t\tsetState({ type: 'init_failed', error })\n\t\t\treturn { ok: false, error }\n\t\t}\n\t\ttry {\n\t\t\tsetState({ type: 'processing_init' })\n\t\t\tconst response = await initRequest({\n\t\t\t\tdata: {\n\t\t\t\t\tredirectUrl: getBaseHref(),\n\t\t\t\t},\n\t\t\t\tidentityProvider: provider,\n\t\t\t})\n\t\t\tif (!response.ok) {\n\t\t\t\treturn fail(response.error || 'UNKNOWN_ERROR')\n\t\t\t} else {\n\t\t\t\tsaveIdpState({ provider, sessionData: response.result.sessionData as string })\n\t\t\t\tsaveBacklink()\n\t\t\t\tif (onRedirect) {\n\t\t\t\t\tonRedirect(response.result.authUrl as string)\n\t\t\t\t} else {\n\t\t\t\t\twindow.location.href = response.result.authUrl as string\n\t\t\t\t}\n\t\t\t\treturn { ok: true }\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t\treturn fail('UNKNOWN_ERROR')\n\t\t}\n\t}, [initRequest, onRedirect, saveBacklink, saveIdpState, setState])\n}\n"],"names":["useInitSignInIDPMutation","useSaveBacklink","useIDPStateStore","useCallback","getBaseHref"],"mappings":";;;;;;;AAYO,MAAM,qBAAqB,CAAC,EAAE,YAAY,eAAwC;AACxF,QAAM,cAAcA,yBAAAA,yBAAyB;AAC7C,QAAM,eAAeC,sBAAAA,gBAAgB;AACrC,QAAM,EAAE,KAAK,aAAa,IAAIC,kCAAiB;AAE/C,SAAOC,MAAY,YAAA,OAAO,EAAE,eAAiG;AACtH,UAAA,OAAO,CAAC,UAAwB;AACrC,eAAS,EAAE,MAAM,eAAe,MAAA,CAAO;AAChC,aAAA,EAAE,IAAI,OAAO,MAAM;AAAA,IAC3B;AACI,QAAA;AACM,eAAA,EAAE,MAAM,mBAAmB;AAC9B,YAAA,WAAW,MAAM,YAAY;AAAA,QAClC,MAAM;AAAA,UACL,aAAaC,YAAY,YAAA;AAAA,QAC1B;AAAA,QACA,kBAAkB;AAAA,MAAA,CAClB;AACG,UAAA,CAAC,SAAS,IAAI;AACV,eAAA,KAAK,SAAS,SAAS,eAAe;AAAA,MAAA,OACvC;AACN,qBAAa,EAAE,UAAU,aAAa,SAAS,OAAO,aAAuB;AAChE,qBAAA;AACb,YAAI,YAAY;AACJ,qBAAA,SAAS,OAAO,OAAiB;AAAA,QAAA,OACtC;AACC,iBAAA,SAAS,OAAO,SAAS,OAAO;AAAA,QAAA;AAEjC,eAAA,EAAE,IAAI,KAAK;AAAA,MAAA;AAAA,aAEX,GAAG;AACX,cAAQ,MAAM,CAAC;AACf,aAAO,KAAK,eAAe;AAAA,IAAA;AAAA,EAC5B,GACE,CAAC,aAAa,YAAY,cAAc,cAAc,QAAQ,CAAC;AACnE;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useInitIDPRedirect.js","sources":["../../../../../../packages/react-client-tenant/src/internal/hooks/useInitIDPRedirect.ts"],"sourcesContent":["import { SetStateAction, useCallback } from 'react'\nimport { useIDPStateStore } from './useIDPStateStore'\nimport { getBaseHref } from '../utils/getBaseHref'\nimport { IDPInitError, IDPStateValue } from '../../types/idp'\nimport { useInitSignInIDPMutation } from '../../hooks'\nimport { useSaveBacklink } from './useRedirectToBacklink'\n\nexport interface UseInitIDPRedirectProps {\n\tonRedirect?: (url: string) => void\n\tsetState: (state: SetStateAction<IDPStateValue>) => void\n}\n\nexport const useInitIDPRedirect = ({ onRedirect, setState }: UseInitIDPRedirectProps) => {\n\tconst initRequest = useInitSignInIDPMutation()\n\tconst saveBacklink = useSaveBacklink()\n\tconst { set: saveIdpState } = useIDPStateStore()\n\n\treturn useCallback(async ({ provider }: { provider: string }): Promise<{ ok: true } | { ok: false; error: IDPInitError }> => {\n\t\tconst fail = (error: IDPInitError) => {\n\t\t\tsetState({ type: 'init_failed', error })\n\t\t\treturn { ok: false, error }\n\t\t}\n\t\ttry {\n\t\t\tsetState({ type: 'processing_init' })\n\t\t\tconst response = await initRequest({\n\t\t\t\tdata: {\n\t\t\t\t\tredirectUrl: getBaseHref(),\n\t\t\t\t},\n\t\t\t\tidentityProvider: provider,\n\t\t\t})\n\t\t\tif (!response.ok) {\n\t\t\t\treturn fail(response.error || 'UNKNOWN_ERROR')\n\t\t\t} else {\n\t\t\t\tsaveIdpState({ provider, sessionData: response.result.sessionData as string })\n\t\t\t\tsaveBacklink()\n\t\t\t\tif (onRedirect) {\n\t\t\t\t\tonRedirect(response.result.authUrl as string)\n\t\t\t\t} else {\n\t\t\t\t\twindow.location.href = response.result.authUrl as string\n\t\t\t\t}\n\t\t\t\treturn { ok: true }\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t\treturn fail('UNKNOWN_ERROR')\n\t\t}\n\t}, [initRequest, onRedirect, saveBacklink, saveIdpState, setState])\n}\n"],"names":[],"mappings":";;;;;AAYO,MAAM,qBAAqB,CAAC,EAAE,YAAY,eAAwC;AACxF,QAAM,cAAc;
|
|
1
|
+
{"version":3,"file":"useInitIDPRedirect.js","sources":["../../../../../../packages/react-client-tenant/src/internal/hooks/useInitIDPRedirect.ts"],"sourcesContent":["import { SetStateAction, useCallback } from 'react'\nimport { useIDPStateStore } from './useIDPStateStore'\nimport { getBaseHref } from '../utils/getBaseHref'\nimport { IDPInitError, IDPStateValue } from '../../types/idp'\nimport { useInitSignInIDPMutation } from '../../hooks'\nimport { useSaveBacklink } from './useRedirectToBacklink'\n\nexport interface UseInitIDPRedirectProps {\n\tonRedirect?: (url: string) => void\n\tsetState: (state: SetStateAction<IDPStateValue>) => void\n}\n\nexport const useInitIDPRedirect = ({ onRedirect, setState }: UseInitIDPRedirectProps) => {\n\tconst initRequest = useInitSignInIDPMutation()\n\tconst saveBacklink = useSaveBacklink()\n\tconst { set: saveIdpState } = useIDPStateStore()\n\n\treturn useCallback(async ({ provider }: { provider: string }): Promise<{ ok: true } | { ok: false; error: IDPInitError }> => {\n\t\tconst fail = (error: IDPInitError) => {\n\t\t\tsetState({ type: 'init_failed', error })\n\t\t\treturn { ok: false, error }\n\t\t}\n\t\ttry {\n\t\t\tsetState({ type: 'processing_init' })\n\t\t\tconst response = await initRequest({\n\t\t\t\tdata: {\n\t\t\t\t\tredirectUrl: getBaseHref(),\n\t\t\t\t},\n\t\t\t\tidentityProvider: provider,\n\t\t\t})\n\t\t\tif (!response.ok) {\n\t\t\t\treturn fail(response.error || 'UNKNOWN_ERROR')\n\t\t\t} else {\n\t\t\t\tsaveIdpState({ provider, sessionData: response.result.sessionData as string })\n\t\t\t\tsaveBacklink()\n\t\t\t\tif (onRedirect) {\n\t\t\t\t\tonRedirect(response.result.authUrl as string)\n\t\t\t\t} else {\n\t\t\t\t\twindow.location.href = response.result.authUrl as string\n\t\t\t\t}\n\t\t\t\treturn { ok: true }\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t\treturn fail('UNKNOWN_ERROR')\n\t\t}\n\t}, [initRequest, onRedirect, saveBacklink, saveIdpState, setState])\n}\n"],"names":[],"mappings":";;;;;AAYO,MAAM,qBAAqB,CAAC,EAAE,YAAY,eAAwC;AACxF,QAAM,cAAc,yBAAyB;AAC7C,QAAM,eAAe,gBAAgB;AACrC,QAAM,EAAE,KAAK,aAAa,IAAI,iBAAiB;AAE/C,SAAO,YAAY,OAAO,EAAE,eAAiG;AACtH,UAAA,OAAO,CAAC,UAAwB;AACrC,eAAS,EAAE,MAAM,eAAe,MAAA,CAAO;AAChC,aAAA,EAAE,IAAI,OAAO,MAAM;AAAA,IAC3B;AACI,QAAA;AACM,eAAA,EAAE,MAAM,mBAAmB;AAC9B,YAAA,WAAW,MAAM,YAAY;AAAA,QAClC,MAAM;AAAA,UACL,aAAa,YAAY;AAAA,QAC1B;AAAA,QACA,kBAAkB;AAAA,MAAA,CAClB;AACG,UAAA,CAAC,SAAS,IAAI;AACV,eAAA,KAAK,SAAS,SAAS,eAAe;AAAA,MAAA,OACvC;AACN,qBAAa,EAAE,UAAU,aAAa,SAAS,OAAO,aAAuB;AAChE,qBAAA;AACb,YAAI,YAAY;AACJ,qBAAA,SAAS,OAAO,OAAiB;AAAA,QAAA,OACtC;AACC,iBAAA,SAAS,OAAO,SAAS,OAAO;AAAA,QAAA;AAEjC,eAAA,EAAE,IAAI,KAAK;AAAA,MAAA;AAAA,aAEX,GAAG;AACX,cAAQ,MAAM,CAAC;AACf,aAAO,KAAK,eAAe;AAAA,IAAA;AAAA,EAC5B,GACE,CAAC,aAAa,YAAY,cAAc,cAAc,QAAQ,CAAC;AACnE;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLogoutInternal.cjs","sources":["../../../../../../packages/react-client-tenant/src/internal/hooks/useLogoutInternal.ts"],"sourcesContent":["import { useSetSessionToken } from '@contember/react-client'\nimport { useCallback } from 'react'\nimport { useSignOutMutation } from '../../hooks'\n\nexport const useLogoutInternal = (clearIdentity?: () => void) => {\n\tconst tenantLogout = useSignOutMutation()\n\tconst setSessionToken = useSetSessionToken()\n\n\treturn useCallback(\n\t\tasync ({ noRedirect = false }: { noRedirect?: boolean } = {}) => {\n\t\t\tif (navigator.credentials && navigator.credentials.preventSilentAccess) {\n\t\t\t\ttry {\n\t\t\t\t\tawait navigator.credentials.preventSilentAccess()\n\t\t\t\t} catch {\n\t\t\t\t\t// actually, not implemented in safari:\n\t\t\t\t\t// https://github.com/WebKit/WebKit/blob/414f4e45b0e82bbfcee783d08a9642be1afa8f72/Source/WebCore/Modules/credentialmanagement/CredentialsContainer.cpp#L132\n\t\t\t\t}\n\t\t\t}\n\t\t\tclearIdentity?.()\n\t\t\tsetSessionToken(undefined)\n\t\t\ttry {\n\t\t\t\tconst response = await tenantLogout({})\n\t\t\t\tif (!response?.ok) {\n\t\t\t\t\tconsole.warn(response?.error)\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\tconsole.warn(e)\n\t\t\t}\n\t\t\tif (!noRedirect) {\n\t\t\t\twindow.location.href = '/' // todo better redirect?\n\t\t\t}\n\t\t},\n\t\t[clearIdentity, setSessionToken, tenantLogout],\n\t)\n}\n"],"names":["useSignOutMutation","useSetSessionToken","useCallback"],"mappings":";;;;;AAIa,MAAA,oBAAoB,CAAC,kBAA+B;AAChE,QAAM,eAAeA,mBAAAA;
|
|
1
|
+
{"version":3,"file":"useLogoutInternal.cjs","sources":["../../../../../../packages/react-client-tenant/src/internal/hooks/useLogoutInternal.ts"],"sourcesContent":["import { useSetSessionToken } from '@contember/react-client'\nimport { useCallback } from 'react'\nimport { useSignOutMutation } from '../../hooks'\n\nexport const useLogoutInternal = (clearIdentity?: () => void) => {\n\tconst tenantLogout = useSignOutMutation()\n\tconst setSessionToken = useSetSessionToken()\n\n\treturn useCallback(\n\t\tasync ({ noRedirect = false }: { noRedirect?: boolean } = {}) => {\n\t\t\tif (navigator.credentials && navigator.credentials.preventSilentAccess) {\n\t\t\t\ttry {\n\t\t\t\t\tawait navigator.credentials.preventSilentAccess()\n\t\t\t\t} catch {\n\t\t\t\t\t// actually, not implemented in safari:\n\t\t\t\t\t// https://github.com/WebKit/WebKit/blob/414f4e45b0e82bbfcee783d08a9642be1afa8f72/Source/WebCore/Modules/credentialmanagement/CredentialsContainer.cpp#L132\n\t\t\t\t}\n\t\t\t}\n\t\t\tclearIdentity?.()\n\t\t\tsetSessionToken(undefined)\n\t\t\ttry {\n\t\t\t\tconst response = await tenantLogout({})\n\t\t\t\tif (!response?.ok) {\n\t\t\t\t\tconsole.warn(response?.error)\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\tconsole.warn(e)\n\t\t\t}\n\t\t\tif (!noRedirect) {\n\t\t\t\twindow.location.href = '/' // todo better redirect?\n\t\t\t}\n\t\t},\n\t\t[clearIdentity, setSessionToken, tenantLogout],\n\t)\n}\n"],"names":["useSignOutMutation","useSetSessionToken","useCallback"],"mappings":";;;;;AAIa,MAAA,oBAAoB,CAAC,kBAA+B;AAChE,QAAM,eAAeA,mBAAAA,mBAAmB;AACxC,QAAM,kBAAkBC,YAAAA,mBAAmB;AAEpC,SAAAC,MAAA;AAAA,IACN,OAAO,EAAE,aAAa,MAAM,IAA8B,OAAO;AAChE,UAAI,UAAU,eAAe,UAAU,YAAY,qBAAqB;AACnE,YAAA;AACG,gBAAA,UAAU,YAAY,oBAAoB;AAAA,QAAA,QACzC;AAAA,QAAA;AAAA,MAGR;AAEe,sBAAA;AAChB,sBAAgB,MAAS;AACrB,UAAA;AACH,cAAM,WAAW,MAAM,aAAa,EAAE;AAClC,YAAA,CAAC,UAAU,IAAI;AACV,kBAAA,KAAK,UAAU,KAAK;AAAA,QAAA;AAAA,eAErB,GAAG;AACX,gBAAQ,KAAK,CAAC;AAAA,MAAA;AAEf,UAAI,CAAC,YAAY;AAChB,eAAO,SAAS,OAAO;AAAA,MAAA;AAAA,IAEzB;AAAA,IACA,CAAC,eAAe,iBAAiB,YAAY;AAAA,EAC9C;AACD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLogoutInternal.js","sources":["../../../../../../packages/react-client-tenant/src/internal/hooks/useLogoutInternal.ts"],"sourcesContent":["import { useSetSessionToken } from '@contember/react-client'\nimport { useCallback } from 'react'\nimport { useSignOutMutation } from '../../hooks'\n\nexport const useLogoutInternal = (clearIdentity?: () => void) => {\n\tconst tenantLogout = useSignOutMutation()\n\tconst setSessionToken = useSetSessionToken()\n\n\treturn useCallback(\n\t\tasync ({ noRedirect = false }: { noRedirect?: boolean } = {}) => {\n\t\t\tif (navigator.credentials && navigator.credentials.preventSilentAccess) {\n\t\t\t\ttry {\n\t\t\t\t\tawait navigator.credentials.preventSilentAccess()\n\t\t\t\t} catch {\n\t\t\t\t\t// actually, not implemented in safari:\n\t\t\t\t\t// https://github.com/WebKit/WebKit/blob/414f4e45b0e82bbfcee783d08a9642be1afa8f72/Source/WebCore/Modules/credentialmanagement/CredentialsContainer.cpp#L132\n\t\t\t\t}\n\t\t\t}\n\t\t\tclearIdentity?.()\n\t\t\tsetSessionToken(undefined)\n\t\t\ttry {\n\t\t\t\tconst response = await tenantLogout({})\n\t\t\t\tif (!response?.ok) {\n\t\t\t\t\tconsole.warn(response?.error)\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\tconsole.warn(e)\n\t\t\t}\n\t\t\tif (!noRedirect) {\n\t\t\t\twindow.location.href = '/' // todo better redirect?\n\t\t\t}\n\t\t},\n\t\t[clearIdentity, setSessionToken, tenantLogout],\n\t)\n}\n"],"names":[],"mappings":";;;AAIa,MAAA,oBAAoB,CAAC,kBAA+B;AAChE,QAAM,eAAe;
|
|
1
|
+
{"version":3,"file":"useLogoutInternal.js","sources":["../../../../../../packages/react-client-tenant/src/internal/hooks/useLogoutInternal.ts"],"sourcesContent":["import { useSetSessionToken } from '@contember/react-client'\nimport { useCallback } from 'react'\nimport { useSignOutMutation } from '../../hooks'\n\nexport const useLogoutInternal = (clearIdentity?: () => void) => {\n\tconst tenantLogout = useSignOutMutation()\n\tconst setSessionToken = useSetSessionToken()\n\n\treturn useCallback(\n\t\tasync ({ noRedirect = false }: { noRedirect?: boolean } = {}) => {\n\t\t\tif (navigator.credentials && navigator.credentials.preventSilentAccess) {\n\t\t\t\ttry {\n\t\t\t\t\tawait navigator.credentials.preventSilentAccess()\n\t\t\t\t} catch {\n\t\t\t\t\t// actually, not implemented in safari:\n\t\t\t\t\t// https://github.com/WebKit/WebKit/blob/414f4e45b0e82bbfcee783d08a9642be1afa8f72/Source/WebCore/Modules/credentialmanagement/CredentialsContainer.cpp#L132\n\t\t\t\t}\n\t\t\t}\n\t\t\tclearIdentity?.()\n\t\t\tsetSessionToken(undefined)\n\t\t\ttry {\n\t\t\t\tconst response = await tenantLogout({})\n\t\t\t\tif (!response?.ok) {\n\t\t\t\t\tconsole.warn(response?.error)\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\tconsole.warn(e)\n\t\t\t}\n\t\t\tif (!noRedirect) {\n\t\t\t\twindow.location.href = '/' // todo better redirect?\n\t\t\t}\n\t\t},\n\t\t[clearIdentity, setSessionToken, tenantLogout],\n\t)\n}\n"],"names":[],"mappings":";;;AAIa,MAAA,oBAAoB,CAAC,kBAA+B;AAChE,QAAM,eAAe,mBAAmB;AACxC,QAAM,kBAAkB,mBAAmB;AAEpC,SAAA;AAAA,IACN,OAAO,EAAE,aAAa,MAAM,IAA8B,OAAO;AAChE,UAAI,UAAU,eAAe,UAAU,YAAY,qBAAqB;AACnE,YAAA;AACG,gBAAA,UAAU,YAAY,oBAAoB;AAAA,QAAA,QACzC;AAAA,QAAA;AAAA,MAGR;AAEe,sBAAA;AAChB,sBAAgB,MAAS;AACrB,UAAA;AACH,cAAM,WAAW,MAAM,aAAa,EAAE;AAClC,YAAA,CAAC,UAAU,IAAI;AACV,kBAAA,KAAK,UAAU,KAAK;AAAA,QAAA;AAAA,eAErB,GAAG;AACX,gBAAQ,KAAK,CAAC;AAAA,MAAA;AAEf,UAAI,CAAC,YAAY;AAChB,eAAO,SAAS,OAAO;AAAA,MAAA;AAAA,IAEzB;AAAA,IACA,CAAC,eAAe,iBAAiB,YAAY;AAAA,EAC9C;AACD;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRedirectToBacklink.cjs","sources":["../../../../../../packages/react-client-tenant/src/internal/hooks/useRedirectToBacklink.ts"],"sourcesContent":["import { useCallback, useEffect } from 'react'\nimport { useIdentity } from '../../contexts'\n\nconst getBacklinkFromUrl = () => {\n\treturn new URLSearchParams(window.location.search).get('backlink')\n}\n\nexport const useSaveBacklink = () => {\n\treturn useCallback(() => {\n\t\tconst backlink = getBacklinkFromUrl()\n\t\tif (!backlink) {\n\t\t\treturn\n\t\t}\n\t\tsessionStorage.setItem('backlink', backlink)\n\t}, [])\n}\n\nexport const useRedirectToBacklinkCallback = () => {\n\treturn useCallback(() => {\n\t\tconst backlink = getBacklinkFromUrl() ?? sessionStorage.getItem('backlink')\n\t\tif (!backlink) {\n\t\t\treturn\n\t\t}\n\t\tsessionStorage.removeItem('backlink')\n\t\tconst resolvedBacklink = new URL(backlink, window.location.href)\n\t\tif (resolvedBacklink.origin === window.location.origin) {\n\t\t\twindow.location.href = resolvedBacklink.toString()\n\t\t}\n\t}, [])\n}\n\nexport const useRedirectToBacklink = () => {\n\tconst identity = useIdentity()\n\tconst redirect = useRedirectToBacklinkCallback()\n\tuseEffect(() => {\n\t\tif (!identity) {\n\t\t\treturn\n\t\t}\n\t\tredirect()\n\t}, [identity, redirect])\n\n}\n"],"names":["useCallback"],"mappings":";;;AAGA,MAAM,qBAAqB,MAAM;AAChC,SAAO,IAAI,gBAAgB,OAAO,SAAS,MAAM,EAAE,IAAI,UAAU;AAClE;AAEO,MAAM,kBAAkB,MAAM;AACpC,SAAOA,kBAAY,MAAM;AACxB,UAAM,WAAW;
|
|
1
|
+
{"version":3,"file":"useRedirectToBacklink.cjs","sources":["../../../../../../packages/react-client-tenant/src/internal/hooks/useRedirectToBacklink.ts"],"sourcesContent":["import { useCallback, useEffect } from 'react'\nimport { useIdentity } from '../../contexts'\n\nconst getBacklinkFromUrl = () => {\n\treturn new URLSearchParams(window.location.search).get('backlink')\n}\n\nexport const useSaveBacklink = () => {\n\treturn useCallback(() => {\n\t\tconst backlink = getBacklinkFromUrl()\n\t\tif (!backlink) {\n\t\t\treturn\n\t\t}\n\t\tsessionStorage.setItem('backlink', backlink)\n\t}, [])\n}\n\nexport const useRedirectToBacklinkCallback = () => {\n\treturn useCallback(() => {\n\t\tconst backlink = getBacklinkFromUrl() ?? sessionStorage.getItem('backlink')\n\t\tif (!backlink) {\n\t\t\treturn\n\t\t}\n\t\tsessionStorage.removeItem('backlink')\n\t\tconst resolvedBacklink = new URL(backlink, window.location.href)\n\t\tif (resolvedBacklink.origin === window.location.origin) {\n\t\t\twindow.location.href = resolvedBacklink.toString()\n\t\t}\n\t}, [])\n}\n\nexport const useRedirectToBacklink = () => {\n\tconst identity = useIdentity()\n\tconst redirect = useRedirectToBacklinkCallback()\n\tuseEffect(() => {\n\t\tif (!identity) {\n\t\t\treturn\n\t\t}\n\t\tredirect()\n\t}, [identity, redirect])\n\n}\n"],"names":["useCallback"],"mappings":";;;AAGA,MAAM,qBAAqB,MAAM;AAChC,SAAO,IAAI,gBAAgB,OAAO,SAAS,MAAM,EAAE,IAAI,UAAU;AAClE;AAEO,MAAM,kBAAkB,MAAM;AACpC,SAAOA,kBAAY,MAAM;AACxB,UAAM,WAAW,mBAAmB;AACpC,QAAI,CAAC,UAAU;AACd;AAAA,IAAA;AAEc,mBAAA,QAAQ,YAAY,QAAQ;AAAA,EAC5C,GAAG,EAAE;AACN;AAEO,MAAM,gCAAgC,MAAM;AAClD,SAAOA,kBAAY,MAAM;AACxB,UAAM,WAAW,mBAAA,KAAwB,eAAe,QAAQ,UAAU;AAC1E,QAAI,CAAC,UAAU;AACd;AAAA,IAAA;AAED,mBAAe,WAAW,UAAU;AACpC,UAAM,mBAAmB,IAAI,IAAI,UAAU,OAAO,SAAS,IAAI;AAC/D,QAAI,iBAAiB,WAAW,OAAO,SAAS,QAAQ;AAChD,aAAA,SAAS,OAAO,iBAAiB,SAAS;AAAA,IAAA;AAAA,EAEnD,GAAG,EAAE;AACN;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRedirectToBacklink.js","sources":["../../../../../../packages/react-client-tenant/src/internal/hooks/useRedirectToBacklink.ts"],"sourcesContent":["import { useCallback, useEffect } from 'react'\nimport { useIdentity } from '../../contexts'\n\nconst getBacklinkFromUrl = () => {\n\treturn new URLSearchParams(window.location.search).get('backlink')\n}\n\nexport const useSaveBacklink = () => {\n\treturn useCallback(() => {\n\t\tconst backlink = getBacklinkFromUrl()\n\t\tif (!backlink) {\n\t\t\treturn\n\t\t}\n\t\tsessionStorage.setItem('backlink', backlink)\n\t}, [])\n}\n\nexport const useRedirectToBacklinkCallback = () => {\n\treturn useCallback(() => {\n\t\tconst backlink = getBacklinkFromUrl() ?? sessionStorage.getItem('backlink')\n\t\tif (!backlink) {\n\t\t\treturn\n\t\t}\n\t\tsessionStorage.removeItem('backlink')\n\t\tconst resolvedBacklink = new URL(backlink, window.location.href)\n\t\tif (resolvedBacklink.origin === window.location.origin) {\n\t\t\twindow.location.href = resolvedBacklink.toString()\n\t\t}\n\t}, [])\n}\n\nexport const useRedirectToBacklink = () => {\n\tconst identity = useIdentity()\n\tconst redirect = useRedirectToBacklinkCallback()\n\tuseEffect(() => {\n\t\tif (!identity) {\n\t\t\treturn\n\t\t}\n\t\tredirect()\n\t}, [identity, redirect])\n\n}\n"],"names":[],"mappings":";AAGA,MAAM,qBAAqB,MAAM;AAChC,SAAO,IAAI,gBAAgB,OAAO,SAAS,MAAM,EAAE,IAAI,UAAU;AAClE;AAEO,MAAM,kBAAkB,MAAM;AACpC,SAAO,YAAY,MAAM;AACxB,UAAM,WAAW;
|
|
1
|
+
{"version":3,"file":"useRedirectToBacklink.js","sources":["../../../../../../packages/react-client-tenant/src/internal/hooks/useRedirectToBacklink.ts"],"sourcesContent":["import { useCallback, useEffect } from 'react'\nimport { useIdentity } from '../../contexts'\n\nconst getBacklinkFromUrl = () => {\n\treturn new URLSearchParams(window.location.search).get('backlink')\n}\n\nexport const useSaveBacklink = () => {\n\treturn useCallback(() => {\n\t\tconst backlink = getBacklinkFromUrl()\n\t\tif (!backlink) {\n\t\t\treturn\n\t\t}\n\t\tsessionStorage.setItem('backlink', backlink)\n\t}, [])\n}\n\nexport const useRedirectToBacklinkCallback = () => {\n\treturn useCallback(() => {\n\t\tconst backlink = getBacklinkFromUrl() ?? sessionStorage.getItem('backlink')\n\t\tif (!backlink) {\n\t\t\treturn\n\t\t}\n\t\tsessionStorage.removeItem('backlink')\n\t\tconst resolvedBacklink = new URL(backlink, window.location.href)\n\t\tif (resolvedBacklink.origin === window.location.origin) {\n\t\t\twindow.location.href = resolvedBacklink.toString()\n\t\t}\n\t}, [])\n}\n\nexport const useRedirectToBacklink = () => {\n\tconst identity = useIdentity()\n\tconst redirect = useRedirectToBacklinkCallback()\n\tuseEffect(() => {\n\t\tif (!identity) {\n\t\t\treturn\n\t\t}\n\t\tredirect()\n\t}, [identity, redirect])\n\n}\n"],"names":[],"mappings":";AAGA,MAAM,qBAAqB,MAAM;AAChC,SAAO,IAAI,gBAAgB,OAAO,SAAS,MAAM,EAAE,IAAI,UAAU;AAClE;AAEO,MAAM,kBAAkB,MAAM;AACpC,SAAO,YAAY,MAAM;AACxB,UAAM,WAAW,mBAAmB;AACpC,QAAI,CAAC,UAAU;AACd;AAAA,IAAA;AAEc,mBAAA,QAAQ,YAAY,QAAQ;AAAA,EAC5C,GAAG,EAAE;AACN;AAEO,MAAM,gCAAgC,MAAM;AAClD,SAAO,YAAY,MAAM;AACxB,UAAM,WAAW,mBAAA,KAAwB,eAAe,QAAQ,UAAU;AAC1E,QAAI,CAAC,UAAU;AACd;AAAA,IAAA;AAED,mBAAe,WAAW,UAAU;AACpC,UAAM,mBAAmB,IAAI,IAAI,UAAU,OAAO,SAAS,IAAI;AAC/D,QAAI,iBAAiB,WAAW,OAAO,SAAS,QAAQ;AAChD,aAAA,SAAS,OAAO,iBAAiB,SAAS;AAAA,IAAA;AAAA,EAEnD,GAAG,EAAE;AACN;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"randomInt.cjs","sources":["../../../../../../packages/react-client-tenant/src/internal/utils/randomInt.ts"],"sourcesContent":["export const randomInt = (min: number, max: number) => {\n\tif (min >= max) {\n\t\tthrow new Error('The min value must be less than the max value.')\n\t}\n\n\tif (max > 0xFFFFFFFF) {\n\t\tthrow new Error('The max value exceeds the limit for this implementation.')\n\t}\n\n\tconst range = max - min + 1\n\tconst maxValidValue = Math.floor(0xFFFFFFFF / range) * range\n\tlet randomInt\n\n\tdo {\n\t\tconst array = new Uint32Array(1)\n\t\twindow.crypto.getRandomValues(array)\n\t\trandomInt = array[0]\n\t} while (randomInt >= maxValidValue)\n\n\treturn min + (randomInt % range)\n}\n\n\nexport const randomString = (length: number, charset: string): string => {\n\tlet result = ''\n\tfor (let i = 0; i < length; i++) {\n\t\tresult += charset[randomInt(0, charset.length - 1)]\n\t}\n\treturn result\n}\n"],"names":["randomInt"],"mappings":";;AAAa,MAAA,YAAY,CAAC,KAAa,QAAgB;AACtD,MAAI,OAAO,KAAK;AACT,UAAA,IAAI,MAAM,gDAAgD;AAAA,
|
|
1
|
+
{"version":3,"file":"randomInt.cjs","sources":["../../../../../../packages/react-client-tenant/src/internal/utils/randomInt.ts"],"sourcesContent":["export const randomInt = (min: number, max: number) => {\n\tif (min >= max) {\n\t\tthrow new Error('The min value must be less than the max value.')\n\t}\n\n\tif (max > 0xFFFFFFFF) {\n\t\tthrow new Error('The max value exceeds the limit for this implementation.')\n\t}\n\n\tconst range = max - min + 1\n\tconst maxValidValue = Math.floor(0xFFFFFFFF / range) * range\n\tlet randomInt\n\n\tdo {\n\t\tconst array = new Uint32Array(1)\n\t\twindow.crypto.getRandomValues(array)\n\t\trandomInt = array[0]\n\t} while (randomInt >= maxValidValue)\n\n\treturn min + (randomInt % range)\n}\n\n\nexport const randomString = (length: number, charset: string): string => {\n\tlet result = ''\n\tfor (let i = 0; i < length; i++) {\n\t\tresult += charset[randomInt(0, charset.length - 1)]\n\t}\n\treturn result\n}\n"],"names":["randomInt"],"mappings":";;AAAa,MAAA,YAAY,CAAC,KAAa,QAAgB;AACtD,MAAI,OAAO,KAAK;AACT,UAAA,IAAI,MAAM,gDAAgD;AAAA,EAAA;AAGjE,MAAI,MAAM,YAAY;AACf,UAAA,IAAI,MAAM,0DAA0D;AAAA,EAAA;AAGrE,QAAA,QAAQ,MAAM,MAAM;AAC1B,QAAM,gBAAgB,KAAK,MAAM,aAAa,KAAK,IAAI;AACnDA,MAAAA;AAED,KAAA;AACI,UAAA,QAAQ,IAAI,YAAY,CAAC;AACxB,WAAA,OAAO,gBAAgB,KAAK;AACnCA,iBAAY,MAAM,CAAC;AAAA,WACXA,cAAa;AAEtB,SAAO,MAAOA,aAAY;AAC3B;AAGa,MAAA,eAAe,CAAC,QAAgB,YAA4B;AACxE,MAAI,SAAS;AACb,WAAS,IAAI,GAAG,IAAI,QAAQ,KAAK;AAChC,cAAU,QAAQ,UAAU,GAAG,QAAQ,SAAS,CAAC,CAAC;AAAA,EAAA;AAE5C,SAAA;AACR;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"randomInt.js","sources":["../../../../../../packages/react-client-tenant/src/internal/utils/randomInt.ts"],"sourcesContent":["export const randomInt = (min: number, max: number) => {\n\tif (min >= max) {\n\t\tthrow new Error('The min value must be less than the max value.')\n\t}\n\n\tif (max > 0xFFFFFFFF) {\n\t\tthrow new Error('The max value exceeds the limit for this implementation.')\n\t}\n\n\tconst range = max - min + 1\n\tconst maxValidValue = Math.floor(0xFFFFFFFF / range) * range\n\tlet randomInt\n\n\tdo {\n\t\tconst array = new Uint32Array(1)\n\t\twindow.crypto.getRandomValues(array)\n\t\trandomInt = array[0]\n\t} while (randomInt >= maxValidValue)\n\n\treturn min + (randomInt % range)\n}\n\n\nexport const randomString = (length: number, charset: string): string => {\n\tlet result = ''\n\tfor (let i = 0; i < length; i++) {\n\t\tresult += charset[randomInt(0, charset.length - 1)]\n\t}\n\treturn result\n}\n"],"names":["randomInt"],"mappings":"AAAa,MAAA,YAAY,CAAC,KAAa,QAAgB;AACtD,MAAI,OAAO,KAAK;AACT,UAAA,IAAI,MAAM,gDAAgD;AAAA,
|
|
1
|
+
{"version":3,"file":"randomInt.js","sources":["../../../../../../packages/react-client-tenant/src/internal/utils/randomInt.ts"],"sourcesContent":["export const randomInt = (min: number, max: number) => {\n\tif (min >= max) {\n\t\tthrow new Error('The min value must be less than the max value.')\n\t}\n\n\tif (max > 0xFFFFFFFF) {\n\t\tthrow new Error('The max value exceeds the limit for this implementation.')\n\t}\n\n\tconst range = max - min + 1\n\tconst maxValidValue = Math.floor(0xFFFFFFFF / range) * range\n\tlet randomInt\n\n\tdo {\n\t\tconst array = new Uint32Array(1)\n\t\twindow.crypto.getRandomValues(array)\n\t\trandomInt = array[0]\n\t} while (randomInt >= maxValidValue)\n\n\treturn min + (randomInt % range)\n}\n\n\nexport const randomString = (length: number, charset: string): string => {\n\tlet result = ''\n\tfor (let i = 0; i < length; i++) {\n\t\tresult += charset[randomInt(0, charset.length - 1)]\n\t}\n\treturn result\n}\n"],"names":["randomInt"],"mappings":"AAAa,MAAA,YAAY,CAAC,KAAa,QAAgB;AACtD,MAAI,OAAO,KAAK;AACT,UAAA,IAAI,MAAM,gDAAgD;AAAA,EAAA;AAGjE,MAAI,MAAM,YAAY;AACf,UAAA,IAAI,MAAM,0DAA0D;AAAA,EAAA;AAGrE,QAAA,QAAQ,MAAM,MAAM;AAC1B,QAAM,gBAAgB,KAAK,MAAM,aAAa,KAAK,IAAI;AACnDA,MAAAA;AAED,KAAA;AACI,UAAA,QAAQ,IAAI,YAAY,CAAC;AACxB,WAAA,OAAO,gBAAgB,KAAK;AACnCA,iBAAY,MAAM,CAAC;AAAA,WACXA,cAAa;AAEtB,SAAO,MAAOA,aAAY;AAC3B;AAGa,MAAA,eAAe,CAAC,QAAgB,YAA4B;AACxE,MAAI,SAAS;AACb,WAAS,IAAI,GAAG,IAAI,QAAQ,KAAK;AAChC,cAAU,QAAQ,UAAU,GAAG,QAAQ,SAAS,CAAC,CAAC;AAAA,EAAA;AAE5C,SAAA;AACR;"}
|