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

@ -10,7 +10,9 @@ import { DeleteApiRequestBuilder } from '../common/api-request-builder/delete-ap
/**
* Retrieves the access tokens for the current user.
*
* @return List of access token metadata.
* @throws {Error} when the api request wasn't successful.
*/
export const getAccessTokenList = async (): Promise<AccessToken[]> => {
const response = await new GetApiRequestBuilder<AccessToken[]>('tokens').sendRequest()
@ -19,9 +21,11 @@ export const getAccessTokenList = async (): Promise<AccessToken[]> => {
/**
* Creates a new access token for the current user.
*
* @param label The user-defined label for the new access token.
* @param validUntil The user-defined expiry date of the new access token in milliseconds of unix time.
* @return The new access token metadata along with its secret.
* @throws {Error} when the api request wasn't successful.
*/
export const postNewAccessToken = async (label: string, validUntil: number): Promise<AccessTokenWithSecret> => {
const response = await new PostApiRequestBuilder<AccessTokenWithSecret, CreateAccessTokenDto>('tokens')
@ -35,7 +39,9 @@ export const postNewAccessToken = async (label: string, validUntil: number): Pro
/**
* Removes an access token from the current user account.
*
* @param keyId The key id of the access token to delete.
* @throws {Error} when the api request wasn't successful.
*/
export const deleteAccessToken = async (keyId: string): Promise<void> => {
await new DeleteApiRequestBuilder('tokens/' + keyId).sendRequest()