mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-20 02:05:21 -04:00
docs: consolidate docs (#2182)
Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
parent
8d46d7e39e
commit
ecffebc43c
307 changed files with 1474 additions and 487 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue