External module "crud/user"
Functions
Const addApprovedLocation
- addApprovedLocation(userId: number, ipAddress: string): Promise<Object>
-
Parameters
-
userId: number
-
ipAddress: string
Returns Promise<Object>
Const checkApprovedLocation
- checkApprovedLocation(userId: number, ipAddress: string): Promise<boolean>
-
Parameters
-
userId: number
-
ipAddress: string
Returns Promise<boolean>
Const createApiKey
- createApiKey(apiKey: ApiKey): Promise<Object>
-
Parameters
Returns Promise<Object>
Const createBackupCodes
- createBackupCodes(userId: number, count?: number): Promise<void>
-
Parameters
-
userId: number
-
Default value count: number = 1
Returns Promise<void>
Const createUser
- createUser(user: User): Promise<Object>
-
Parameters
Returns Promise<Object>
Const deleteAllUserApprovedLocations
- deleteAllUserApprovedLocations(userId: number): Promise<Object>
-
Parameters
Returns Promise<Object>
Const deleteApiKey
- deleteApiKey(apiKey: string): Promise<Object>
-
Parameters
Returns Promise<Object>
Const deleteBackupCode
- deleteBackupCode(backupCode: number): Promise<Object>
-
Parameters
Returns Promise<Object>
Const deleteUser
- deleteUser(id: number): Promise<Object>
-
Parameters
Returns Promise<Object>
Const deleteUserBackupCodes
- deleteUserBackupCodes(userId: number): Promise<Object>
-
Parameters
Returns Promise<Object>
Const getAllUsers
- getAllUsers(): Promise<User[]>
-
Returns Promise<User[]>
Const getApiKey
- getApiKey(apiKey: string): Promise<ApiKey>
-
Parameters
Returns Promise<ApiKey>
Const getApiKeySecret
- getApiKeySecret(apiKey: string, secretKey: string): Promise<ApiKey>
-
Parameters
-
apiKey: string
-
secretKey: string
Returns Promise<ApiKey>
Const getUser
- getUser(id: number, secureOrigin?: boolean): Promise<User>
-
Parameters
-
id: number
-
Default value secureOrigin: boolean = false
Returns Promise<User>
Const getUserApiKeys
- getUserApiKeys(userId: number): Promise<ApiKey[]>
-
Parameters
Returns Promise<ApiKey[]>
Const getUserApprovedLocations
- getUserApprovedLocations(userId: number): Promise<Object>
-
Parameters
Returns Promise<Object>
Const getUserBackupCode
- getUserBackupCode(userId: number, backupCode: number): Promise<BackupCode>
-
Parameters
-
userId: number
-
backupCode: number
Const getUserBackupCodes
- getUserBackupCodes(userId: number): Promise<Object>
-
Parameters
Returns Promise<Object>
Const getUserByEmail
- getUserByEmail(email: string, secureOrigin?: boolean): Promise<User>
-
Parameters
-
email: string
-
Default value secureOrigin: boolean = false
Returns Promise<User>
Const updateApiKey
- updateApiKey(apiKey: string, data: KeyValue): Promise<Object>
-
Parameters
Returns Promise<Object>
Const updateBackupCode
- updateBackupCode(backupCode: number, code: KeyValue): Promise<Object>
-
Parameters
Returns Promise<Object>
Const updateUser
- updateUser(id: number, user: KeyValue): Promise<Object>
-
Parameters
Returns Promise<Object>
Add a new approved location for a user