createDevice
createDevice: (
input: {
deviceName?: string;
period?: number;
skew?: number;
userContext: UserContext;
userId: string;
userIdentifierInfo?: string;
},
) => Promise<
| {
deviceName: string;
qrCodeString: string;
secret: string;
status: "OK";
}
| { status: "DEVICE_ALREADY_EXISTS_ERROR" }
| { status: "UNKNOWN_USER_ID_ERROR" },
>
getUserIdentifierInfoForUserId
getUserIdentifierInfoForUserId: (
input: { userContext: UserContext; userId: string },
) => Promise<
| { info: string; status: "OK" }
| {
status:
| "UNKNOWN_USER_ID_ERROR"
| "USER_IDENTIFIER_INFO_DOES_NOT_EXIST_ERROR";
},
>
listDevices
listDevices: (
input: { userContext: UserContext; userId: string },
) => Promise<
{
devices: {
name: string;
period: number;
skew: number;
verified: boolean;
}[];
status: "OK";
},
>
removeDevice
removeDevice: (
input: { deviceName: string; userContext: UserContext; userId: string },
) => Promise<{ didDeviceExist: boolean; status: "OK" }>
updateDevice
updateDevice: (
input: {
existingDeviceName: string;
newDeviceName: string;
userContext: UserContext;
userId: string;
},
) => Promise<
{
status: "OK"
| "UNKNOWN_DEVICE_ERROR"
| "DEVICE_ALREADY_EXISTS_ERROR";
},
>
verifyDevice
verifyDevice: (
input: {
deviceName: string;
tenantId: string;
totp: string;
userContext: UserContext;
userId: string;
},
) => Promise<
| { status: "OK"; wasAlreadyVerified: boolean }
| { status: "UNKNOWN_DEVICE_ERROR" }
| {
currentNumberOfFailedAttempts: number;
maxNumberOfFailedAttempts: number;
status: "INVALID_TOTP_ERROR";
}
| { retryAfterMs: number; status: "LIMIT_REACHED_ERROR" },
>
verifyTOTP
verifyTOTP: (
input: {
tenantId: string;
totp: string;
userContext: UserContext;
userId: string;
},
) => Promise<
| { status: "OK"
| "UNKNOWN_USER_ID_ERROR" }
| {
currentNumberOfFailedAttempts: number;
maxNumberOfFailedAttempts: number;
status: "INVALID_TOTP_ERROR";
}
| { retryAfterMs: number; status: "LIMIT_REACHED_ERROR" },
>