ciam-client
Advanced tools
Comparing version 1.0.1 to 1.1.0
@@ -113,2 +113,13 @@ import { Axios } from 'axios'; | ||
/** | ||
* List users | ||
* | ||
* @permissions `ciam.user.list` | ||
* @param skip number of users to skip | ||
* @param limit maximum number of users to return in one request | ||
* @returns an array of {@link Model.Role}, or undefined | ||
* @throws if {@link skip} is less than 0 | ||
* @throws if {@link limit} is not in the range 1..100 | ||
*/ | ||
listUsers(skip?: number, limit?: number): Promise<Array<User> | undefined>; | ||
/** | ||
* Check if the current token is valid | ||
@@ -119,3 +130,2 @@ * | ||
valid(): Promise<boolean>; | ||
listUsers(): Promise<Array<User> | undefined>; | ||
/** | ||
@@ -122,0 +132,0 @@ * Get a permission by its flag |
@@ -196,2 +196,17 @@ import axios from 'axios'; | ||
/** | ||
* List users | ||
* | ||
* @permissions `ciam.user.list` | ||
* @param skip number of users to skip | ||
* @param limit maximum number of users to return in one request | ||
* @returns an array of {@link Model.Role}, or undefined | ||
* @throws if {@link skip} is less than 0 | ||
* @throws if {@link limit} is not in the range 1..100 | ||
*/ | ||
async listUsers(skip = 0, limit = 100) { | ||
Check.min(skip, 0, 'skip'); | ||
Check.inRange(limit, 1, 100, 'limit'); | ||
return cast(await this.api.get(`/user/list?skip=${skip}&limit=${limit}`)); | ||
} | ||
/** | ||
* Check if the current token is valid | ||
@@ -206,6 +221,2 @@ * | ||
} | ||
// TODO: not yet implemented on backend | ||
async listUsers() { | ||
return cast(await this.api.get('/user/list')); | ||
} | ||
/** | ||
@@ -212,0 +223,0 @@ * Get a permission by its flag |
{ | ||
"name": "ciam-client", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -215,2 +215,18 @@ import axios, { Axios, AxiosError, AxiosResponse } from 'axios'; | ||
/** | ||
* List users | ||
* | ||
* @permissions `ciam.user.list` | ||
* @param skip number of users to skip | ||
* @param limit maximum number of users to return in one request | ||
* @returns an array of {@link Model.Role}, or undefined | ||
* @throws if {@link skip} is less than 0 | ||
* @throws if {@link limit} is not in the range 1..100 | ||
*/ | ||
async listUsers(skip: number = 0, limit: number = 100): Promise<Array<User> | undefined> { | ||
Check.min(skip, 0, 'skip'); | ||
Check.inRange(limit, 1, 100, 'limit'); | ||
return cast<Array<User>>(await this.api.get(`/user/list?skip=${skip}&limit=${limit}`)); | ||
} | ||
/** | ||
* Check if the current token is valid | ||
@@ -226,7 +242,2 @@ * | ||
// TODO: not yet implemented on backend | ||
async listUsers(): Promise<Array<User> | undefined> { | ||
return cast<Array<User>>(await this.api.get('/user/list')); | ||
} | ||
/** | ||
@@ -233,0 +244,0 @@ * Get a permission by its flag |
38286
925