@nibssplc/cams-sdk
Version:
Central Authentication Management Service (CAMS) SDK for popup-based authentication with Azure AD + custom 2FA
47 lines (46 loc) • 1.53 kB
TypeScript
import { z } from "zod";
export declare const ProfileSchema: z.ZodObject<{
state: z.ZodUnion<[z.ZodLiteral<"AUTH_SUCCESS">, z.ZodLiteral<"AUTH_FAILURE">]>;
role: z.ZodEnum<{
SUPER_ADMIN: "SUPER_ADMIN";
ADMIN: "ADMIN";
USER: "USER";
}>;
message: z.ZodString;
profile: z.ZodObject<{
priviledges: z.ZodOptional<z.ZodArray<z.ZodString>>;
userInfo: z.ZodObject<{
id: z.ZodNumber;
name: z.ZodString;
email: z.ZodEmail;
isMFAEnabled: z.ZodBoolean;
}, z.core.$strip>;
tokens: z.ZodObject<{
Nonce: z.ZodString;
Bearer: z.ZodString;
}, z.core.$strip>;
}, z.core.$strip>;
authType: z.ZodOptional<z.ZodEnum<{
MSAL: "MSAL";
AD_CREDENTIALS: "AD_CREDENTIALS";
}>>;
}, z.core.$strip>;
export type Profile = z.infer<typeof ProfileSchema>;
export interface AuthState {
isAuthenticated: boolean;
requiresMFA: boolean;
accessToken: string;
idToken: string;
userProfile?: Profile;
}
export declare const ErrorMessageSchema: z.ZodObject<{
error: z.ZodString;
}, z.core.$strip>;
export declare const AuthFailureMessageSchema: z.ZodObject<{
type: z.ZodLiteral<"AUTH_FAILURE">;
error: z.ZodString;
errorCode: z.ZodString;
errorDetails: z.ZodUnion<[z.ZodObject<{}, z.core.$strip>, z.ZodAny]>;
}, z.core.$strip>;
export type AuthFailureMessage = z.infer<typeof AuthFailureMessageSchema>;
export declare const URLSchema: z.ZodURL;