UNPKG

agentlang

Version:

The easiest way to build the most reliable AI agents - enterprise-grade teams of AI agents that collaborate with each other and humans

68 lines 5.86 kB
import { Result, Environment } from '../interpreter.js'; import { Instance, RbacPermissionFlag } from '../module.js'; import { UserInfo } from '../auth/interface.js'; import { ActiveSessionInfo } from '../auth/defs.js'; import { getHttpStatusForError } from '../auth/cognito.js'; export declare const CoreAuthModuleName: string; declare const _default: string; export default _default; export declare function createUser(id: string, email: string, firstName: string, lastName: string, env: Environment, status?: string): Promise<Result>; export declare function findUser(id: string, env: Environment): Promise<Result>; export declare function findUserByEmail(email: string, env: Environment): Promise<Result>; export declare function updateUser(userId: string, firstName: string, lastName: string, env: Environment): Promise<Result>; export declare function updateUserStatus(userId: string, status: string, env: Environment): Promise<Result>; export declare function inactivateUser(userId: string, env: Environment): Promise<Result>; export declare function activateUser(userId: string, env: Environment): Promise<Result>; export declare function deleteUser(userId: string, email: string, env: Environment): Promise<Result>; export declare function updateUserLastLogin(id: string, env: Environment): Promise<Result>; export declare function ensureUser(email: string, firstName: string, lastName: string, env: Environment, status?: string): Promise<any>; export declare function ensureUserRoles(userid: string, userRoles: string[], env: Environment): Promise<void>; export declare function ensureUserSession(userId: string, token: string, accessToken: string, refreshToken: string, env: Environment): Promise<Instance>; export declare function createSession(id: string, userId: string, token: string, accessToken: string, refreshToken: string, env: Environment): Promise<Result>; export declare function findSession(id: string, env: Environment): Promise<Result>; export declare function findUserSession(userId: string, env: Environment): Promise<Result>; export declare function updateSession(id: string, token: string, accessToken: string, refreshToken: string, env: Environment): Promise<Result>; export declare function removeSession(id: string, env: Environment): Promise<Result>; export declare function findRole(name: string, env: Environment): Promise<Result>; export declare function createRole(name: string, env: Environment): Promise<void>; export declare function createPermission(id: string, roleName: string, resourceFqName: string, c: boolean | undefined, r: boolean | undefined, u: boolean | undefined, d: boolean | undefined, env: Environment): Promise<void>; export declare function assignUserToRole(userId: string, roleName: string, env: Environment): Promise<boolean>; export declare function assignUserToRoleByEmail(email: string, roleName: string, env: Environment): Promise<boolean>; export declare function findUserRoles(userId: string, env: Environment): Promise<Result>; export declare function userHasPermissions(userId: string, resourceFqName: string, perms: Set<RbacPermissionFlag>, env: Environment): Promise<boolean>; type PermCheckForUser = (userId: string, resourceFqName: string, env: Environment) => Promise<boolean>; export declare const canUserCreate: PermCheckForUser; export declare const canUserRead: PermCheckForUser; export declare const canUserUpdate: PermCheckForUser; export declare const canUserDelete: PermCheckForUser; export declare function signUpUser(firstName: string, lastName: string, username: string, password: string, userData: object, env: Environment): Promise<UserInfo>; export declare function confirmSignupUser(username: string, confirmationCode: string, env: Environment): Promise<Result>; export declare function resendConfirmationCodeUser(username: string, env: Environment): Promise<Result>; export declare function forgotPasswordUser(username: string, env: Environment): Promise<Result>; export declare function confirmForgotPasswordUser(username: string, confirmationCode: string, newPassword: string, env: Environment): Promise<Result>; export declare function loginUser(username: string, password: string, env: Environment): Promise<string | object>; export declare function callbackUser(code: string, env: Environment): Promise<string | object>; export declare function logoutUser(env: Environment): Promise<Result>; export declare function changePassword(newPassword: string, password: string, env: Environment): Promise<Result>; export declare function verifySession(token: string, env?: Environment): Promise<ActiveSessionInfo>; export declare function getUserInfo(userId: string, env: Environment): Promise<UserInfo>; export declare function getUserInfoByEmail(email: string, env: Environment): Promise<UserInfo>; export declare function refreshUserToken(refreshToken: string, env: Environment): Promise<object>; export declare function inviteUser(email: string, firstName: string, lastName: string, userData: Map<string, any> | undefined, role: string | undefined, env: Environment): Promise<object>; export declare function resendInvitationUser(email: string, env: Environment): Promise<object>; export declare function acceptInvitationUser(email: string, tempPassword: string, newPassword: string, env: Environment): Promise<object>; export declare function requireAuth(moduleName: string, eventName: string): boolean; export { getHttpStatusForError }; export declare function createAuthErrorResponse(error: Error): { error: string; message: string; statusCode: number; }; export declare function isAuthError(error: any): boolean; export declare function sanitizeErrorForLogging(error: Error): { name: string; message: string; sanitizedMessage: string; }; export declare function isRetryableError(error: Error): boolean; //# sourceMappingURL=auth.d.ts.map