import { N as MonoCloudUser, _ as IdTokenClaims, c as CallbackParams, i as AuthState, j as MonoCloudSession } from "../types-DQyiPtSD.mjs"; //#region src/utils/index.d.ts /** * Parses callback parameters from a URL, a URLSearchParams object, or a query string. */ declare const parseCallbackParams: (queryOrUrl: string | URL | URLSearchParams) => CallbackParams; /** * Encrypts a given string using a secret with AES-GCM. * * @param data - The plaintext data to encrypt. * @param secret - The secret used to derive the encryption key. * @returns Base64-encoded ciphertext. */ declare const encrypt: (data: string, secret: string) => Promise; /** * Decrypts an encrypted string using a secret with AES-GCM. * * @param encrypted - The ciphertext to decrypt. * @param secret - The secret used to derive the decryption key. * * @returns Decrypted plaintext string or undefined if decryption fails. */ declare const decrypt: (encrypted: string, secret: string) => Promise; /** * Encrypts a MonoCloud session object with a secret and optional time-to-live (TTL). * * @param session - The session object to encrypt. * @param secret - The secret used for encryption. * @param ttl - Optional time-to-live in seconds, after which the session expires. * @returns Encrypted session string. */ declare const encryptSession: (session: MonoCloudSession, secret: string, ttl?: number) => Promise; /** * Decrypts an encrypted MonoCloud session. * * @param encryptedSession - The encrypted session string to decrypt. * @param secret - The secret used for decryption. * * @returns Session object on success. * * @throws If decryption fails or the session has expired. */ declare const decryptSession: (encryptedSession: string, secret: string) => Promise; /** * Encrypts an AuthState object with a secret and optional time-to-live (TTL). * * @param authState - A type that extends the AuthState interface. * @param secret - The secret used for encryption. * @param ttl - Optional time-to-live in seconds, after which the auth state expires. * * @returns Encrypted auth state string. */ declare const encryptAuthState: (authState: T, secret: string, ttl?: number) => Promise; /** * Decrypts an encrypted AuthState. * * @param encryptedAuthState - The encrypted auth state string to decrypt. * @param secret - The secret used for decryption. * * @returns State object on success. * * @throws If decryption fails or the auth state has expired. * */ declare const decryptAuthState: (encryptedAuthState: string, secret: string) => Promise; /** * Checks if a user is a member of a specified group or groups. * * @param user - The user. * @param groups - An array of group names or IDs to check membership against. * @param groupsClaim - The claim in the user object that contains groups. * @param matchAll - If `true`, requires the user to be in all specified groups; if `false`, checks if the user is in at least one of the groups. * * @returns `true` if the user is in the specified groups, `false` otherwise. */ declare const isUserInGroup: (user: MonoCloudUser | IdTokenClaims, groups: string[], groupsClaim?: string, matchAll?: boolean) => boolean; /** * Generates a random state string. */ declare const generateState: () => string; /** * Generates a PKCE (Proof Key for Code Exchange) code verifier and code challenge. */ declare const generatePKCE: () => Promise<{ codeVerifier: string; codeChallenge: string; }>; /** * Generates a random nonce string. */ declare const generateNonce: () => string; /** * @ignore * Merges multiple arrays of strings, removing duplicates. * * @param args - List of arrays to merge. * * @returns A new array containing unique strings from both input arrays, or `undefined` if both inputs are `undefined`. */ declare const mergeArrays: (...args: (string[] | undefined)[]) => string[] | undefined; //#endregion export { decrypt, decryptAuthState, decryptSession, encrypt, encryptAuthState, encryptSession, generateNonce, generatePKCE, generateState, isUserInGroup, mergeArrays, parseCallbackParams }; //# sourceMappingURL=index.d.mts.map