docs: consolidate docs (#2182)

Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
Philip Molares 2022-07-21 22:36:46 +02:00 committed by GitHub
parent 8d46d7e39e
commit ecffebc43c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
307 changed files with 1474 additions and 487 deletions

View file

@ -7,7 +7,8 @@ import { DeleteApiRequestBuilder } from '../common/api-request-builder/delete-ap
/**
* Requests to log out the current user.
* @throws Error if logout is not possible.
*
* @throws {Error} if logout is not possible.
*/
export const doLogout = async (): Promise<void> => {
await new DeleteApiRequestBuilder('auth/logout').sendRequest()

View file

@ -9,11 +9,13 @@ import { AuthError } from './types'
import { PostApiRequestBuilder } from '../common/api-request-builder/post-api-request-builder'
/**
* Requests to login a user via LDAP credentials.
* Requests to log in a user via LDAP credentials.
*
* @param provider The identifier of the LDAP provider with which to login.
* @param username The username with which to try the login.
* @param password The password of the user.
* @throws {AuthError.INVALID_CREDENTIALS} if the LDAP provider denied the given credentials.
* @throws {Error} when the api request wasn't successfull
*/
export const doLdapLogin = async (provider: string, username: string, password: string): Promise<void> => {
await new PostApiRequestBuilder<void, LoginDto>('auth/ldap/' + provider)

View file

@ -10,10 +10,12 @@ import { PutApiRequestBuilder } from '../common/api-request-builder/put-api-requ
/**
* Requests to do a local login with a provided username and password.
*
* @param username The username for which the login should be tried.
* @param password The password which should be used to log in.
* @throws {AuthError.INVALID_CREDENTIALS} when the username or password is wrong.
* @throws {AuthError.LOGIN_DISABLED} when the local login is disabled on the backend.
* @throws {Error} when the api request wasn't successful.
*/
export const doLocalLogin = async (username: string, password: string): Promise<void> => {
await new PostApiRequestBuilder<void, LoginDto>('auth/local/login')
@ -30,11 +32,13 @@ export const doLocalLogin = async (username: string, password: string): Promise<
/**
* Requests to register a new local user in the backend.
*
* @param username The username of the new user.
* @param displayName The display name of the new user.
* @param password The password of the new user.
* @throws {RegisterError.USERNAME_EXISTING} when there is already an existing user with the same username.
* @throws {RegisterError.REGISTRATION_DISABLED} when the registration of local users has been disabled on the backend.
* @throws {Error} when the api request wasn't successful.
*/
export const doLocalRegister = async (username: string, displayName: string, password: string): Promise<void> => {
await new PostApiRequestBuilder<void, RegisterDto>('auth/local')