RecipeInterface
RecipeInterface: { consumeCode: any; createCode: any; createNewCodeForDevice: any; listCodesByDeviceId: any; listCodesByEmail: any; listCodesByPhoneNumber: any; listCodesByPreAuthSessionId: any; revokeAllCodes: any; revokeCode: any; updateUser: any }
Type declaration
consumeCode:function
- consumeCode(input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>
Parameters
input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext: any }
Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>
createCode:function
- createCode(input: ({ email: string } & { tenantId: string; userContext: any; userInputCode?: string }) & ({ phoneNumber: string } & { tenantId: string; userContext: any; userInputCode?: string })): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>
Parameters
input: ({ email: string } & { tenantId: string; userContext: any; userInputCode?: string }) & ({ phoneNumber: string } & { tenantId: string; userContext: any; userInputCode?: string })
Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>
createNewCodeForDevice:function
- createNewCodeForDevice(input: { deviceId: string; tenantId: string; userContext: any; userInputCode?: string }): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>
Parameters
input: { deviceId: string; tenantId: string; userContext: any; userInputCode?: string }
deviceId: string
tenantId: string
userContext: any
Optional userInputCode?: string
Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>
listCodesByDeviceId:function
- listCodesByDeviceId(input: { deviceId: string; tenantId: string; userContext: any }): Promise<undefined | DeviceType>
Parameters
input: { deviceId: string; tenantId: string; userContext: any }
deviceId: string
tenantId: string
userContext: any
Returns Promise<undefined | DeviceType>
listCodesByEmail:function
- listCodesByEmail(input: { email: string; tenantId: string; userContext: any }): Promise<DeviceType[]>
Parameters
input: { email: string; tenantId: string; userContext: any }
email: string
tenantId: string
userContext: any
Returns Promise<DeviceType[]>
listCodesByPhoneNumber:function
- listCodesByPhoneNumber(input: { phoneNumber: string; tenantId: string; userContext: any }): Promise<DeviceType[]>
Parameters
input: { phoneNumber: string; tenantId: string; userContext: any }
phoneNumber: string
tenantId: string
userContext: any
Returns Promise<DeviceType[]>
listCodesByPreAuthSessionId:function
- listCodesByPreAuthSessionId(input: { preAuthSessionId: string; tenantId: string; userContext: any }): Promise<undefined | DeviceType>
Parameters
input: { preAuthSessionId: string; tenantId: string; userContext: any }
preAuthSessionId: string
tenantId: string
userContext: any
Returns Promise<undefined | DeviceType>
revokeAllCodes:function
- revokeAllCodes(input: { email: string; tenantId: string; userContext: any } | { phoneNumber: string; tenantId: string; userContext: any }): Promise<{ status: "OK" }>
Parameters
input: { email: string; tenantId: string; userContext: any } | { phoneNumber: string; tenantId: string; userContext: any }
Returns Promise<{ status: "OK" }>
revokeCode:function
- revokeCode(input: { codeId: string; tenantId: string; userContext: any }): Promise<{ status: "OK" }>
Parameters
input: { codeId: string; tenantId: string; userContext: any }
codeId: string
tenantId: string
userContext: any
Returns Promise<{ status: "OK" }>
updateUser:function
- updateUser(input: { email?: string | null; phoneNumber?: string | null; recipeUserId: RecipeUserId; userContext: any }): Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>
Parameters
input: { email?: string | null; phoneNumber?: string | null; recipeUserId: RecipeUserId; userContext: any }
Optional email?: string | null
Optional phoneNumber?: string | null
userContext: any
Returns Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>