import * as _nuxt_schema from '@nuxt/schema'; import { SDKOptions, IdTokenClaims, LoginFlowMessage, LoginFlowState } from '@strivacity/sdk-core'; export * from '@strivacity/sdk-core'; import { PopupFlow } from '@strivacity/sdk-core/flows/PopupFlow'; export { PopupFlow } from '@strivacity/sdk-core/flows/PopupFlow'; import { RedirectFlow } from '@strivacity/sdk-core/flows/RedirectFlow'; export { RedirectFlow } from '@strivacity/sdk-core/flows/RedirectFlow'; import { NativeFlow } from '@strivacity/sdk-core/flows/NativeFlow'; export { NativeFlow } from '@strivacity/sdk-core/flows/NativeFlow'; export { HttpClient } from '@strivacity/sdk-core/utils/HttpClient'; export { DefaultLogging } from '@strivacity/sdk-core/utils/Logging'; export { LocalStorage } from '@strivacity/sdk-core/storages/LocalStorage'; export { SessionStorage } from '@strivacity/sdk-core/storages/SessionStorage'; export { createCredential, getCredential } from '@strivacity/sdk-core/utils/credentials'; import { Ref } from 'vue'; /** * Represents the session state, including authentication details and token information. */ type Session = { /** * Reactive reference to the loading state of the session. * `true` when the session is initializing, otherwise `false`. */ loading: Ref; /** * The SDK options used to configure the session. */ options: Ref; /** * Reactive reference to the user's authentication status. * `true` if the user is authenticated, otherwise `false`. */ isAuthenticated: Ref; /** * Reactive reference to the claims contained in the ID token. * Contains user identity and other information, or `null` if not authenticated. */ idTokenClaims: Ref; /** * Reactive reference to the current access token for API authorization. * `null` if the user is not authenticated or the token is unavailable. */ accessToken: Ref; /** * Reactive reference to the refresh token, used to refresh the access token. * `null` if the user is not authenticated or the refresh token is unavailable. */ refreshToken: Ref; /** * Reactive reference indicating if the access token has expired. * `true` if expired, otherwise `false`. */ accessTokenExpired: Ref; /** * Reactive reference to the expiration date of the access token in Unix time (milliseconds). * `null` if no token is available or the session is not authenticated. */ accessTokenExpirationDate: Ref; }; /** * Represents the available authentication flows and operations for Popup-based interactions. */ type PopupSDK = { sdk: InstanceType; /** * Initiates the login process. */ login: InstanceType['login']; /** * Registers a new user. */ register: InstanceType['register']; /** * Initiates the entry process. */ entry: InstanceType['entry']; /** * Refreshes the user's session. */ refresh: InstanceType['refresh']; /** * Revokes the current session tokens. */ revoke: InstanceType['revoke']; /** * Logs out the user. */ logout: InstanceType['logout']; /** * Handles the callback after authentication or token exchange. */ handleCallback: InstanceType['handleCallback']; }; /** * Represents the available authentication flows and operations for Redirect-based interactions. */ type RedirectSDK = { sdk: InstanceType; /** * Initiates the login process. */ login: InstanceType['login']; /** * Registers a new user. */ register: InstanceType['register']; /** * Initiates the entry process. */ entry: InstanceType['entry']; /** * Refreshes the user's session. */ refresh: InstanceType['refresh']; /** * Revokes the current session tokens. */ revoke: InstanceType['revoke']; /** * Logs out the user. */ logout: InstanceType['logout']; /** * Handles the callback after authentication or token exchange. */ handleCallback: InstanceType['handleCallback']; }; /** * Represents the available authentication flows and operations for Native-based interactions. */ type NativeSDK = { sdk: InstanceType; /** * Initiates the login process. */ login: InstanceType['login']; /** * Registers a new user. */ register: InstanceType['register']; /** * Initiates the entry process. */ entry: InstanceType['entry']; /** * Refreshes the user's session. */ refresh: InstanceType['refresh']; /** * Revokes the current session tokens. */ revoke: InstanceType['revoke']; /** * Logs out the user. */ logout: InstanceType['logout']; /** * Handles the callback after authentication or token exchange. */ handleCallback: InstanceType['handleCallback']; }; /** * Represents a combined context for Popup-based flows, containing both the Popup SDK and the session state. */ type PopupContext = PopupSDK & Session; /** * Represents a combined context for Redirect-based flows, containing both the Redirect SDK and the session state. */ type RedirectContext = RedirectSDK & Session; /** * Represents a combined context for Redirect-based flows, containing both the Redirect SDK and the session state. */ type NativeContext = NativeSDK & Session; type NativeFlowContextValue = { loading: Ref; forms: Ref>>; messages: Ref>>; state: Ref>; submitForm: (formId: string) => Promise; triggerFallback: (hostedUrl?: string) => void; triggerClose: () => void; setFormValue: (formId: string, widgetId: string, value: unknown) => void; setMessage: (formId: string, widgetId: string, value: LoginFlowMessage) => void; }; declare module '@nuxt/schema' { interface PublicRuntimeConfig { strivacity: SDKOptions; } } type ModuleOptions = SDKOptions; declare const _default: _nuxt_schema.NuxtModule; export { _default as default }; export type { ModuleOptions, NativeContext, NativeFlowContextValue, NativeSDK, PopupContext, PopupSDK, RedirectContext, RedirectSDK, Session };