import { User } from "./interfaces"; /** * Encodes an input into Base64 * @param inputStr Base64 input to decode */ export declare const encodeString: (inputStr: any) => any; /** * Decodes a Base64 input * @param inputStr Base64 input to decode */ export declare const decodeString: (inputStr: any) => any; /** * Generates a JWT token * @param data Payload to include in the token * @param expirationInMinutes Expiration of the token (in minutes) */ export declare const createJWT: (data: any, expirationInMinutes?: number) => string; /** * Parses a JWT token * @param token JWT token */ export declare const parseJWT: (token: string, disableClientIdCheck?: boolean) => any; /** * Generates a bcrypt hash of a given message * @param message Message to hash */ export declare const hash_bcrypt: (message: string) => string; /** * Compares a raw value with a bcrypt hash * @param message Raw input to compare * @param hash Hash to compare against */ export declare const compare_bcrypt: (message: string, hash: string) => boolean; /** * Creates a Base64 hash signed with the Apiker's installation secret key */ export declare const sign: (message: any) => string; /** * Creates a SHA256 hash signed with the Apiker's installation secret key */ export declare const sign_sha256: (message: string) => string; /** * Creates a SHA1 hash signed with the Apiker's installation secret key */ export declare const sign_sha1: (message: string) => string; /** * Creates a random SHA256 hash */ export declare const randomHash: () => any; /** * Creates a random SHA1 hash */ export declare const randomHash_SHA1: () => string; /** * Creates SHA256 hash */ export declare const stringHash: (content: string) => any; /** * Creates a random SHA1 hash */ export declare const stringHash_SHA1: (content: any) => string; /** * Generating a clientId * This value is returned to client and not stored */ export declare const getClientId: () => string; /** * Retrieves the auth tokens from the request headers or cookies. */ export declare const extractToken: () => string; /** * Fetches the current user by checking for the auth token in the request headers or in the cookies. */ export declare const getCurrentUser: (disableClientIdCheck?: boolean) => Promise; /** * Checks whether a given user is an admin */ export declare const isUserAdmin: (userId?: string) => Promise; /** * Checks whether the current user is an admin */ export declare const isCurrentUserAdmin: () => Promise; /** * Generates auth tokens for a given user * @param userId The user's ID * @param expirationInMinutes The expiration time for the action token. The refresh token does not expire. */ export declare const getTokens: (userId: string, expirationInMinutes?: number) => { userId: string; token: string; refreshToken: string; }; /** * Gets the client's IP */ export declare const getRawIp: () => string; /** * Gets the client's IP signed in SHA1 format. */ export declare const getSignedIp: () => string; //# sourceMappingURL=utils.d.ts.map