File tree Expand file tree Collapse file tree 3 files changed +2788
-1
lines changed Expand file tree Collapse file tree 3 files changed +2788
-1
lines changed Original file line number Diff line number Diff line change @@ -51,8 +51,15 @@ export class OFS {
5151 return "Basic " + hash ;
5252 }
5353
54- private _get ( partialURL : string ) : Promise < OFSResponse > {
54+ private _get (
55+ partialURL : string ,
56+ params : any = undefined
57+ ) : Promise < OFSResponse > {
5558 var theURL = new URL ( partialURL , this . _baseURL ) ;
59+ if ( params != undefined ) {
60+ const urlSearchParams = new URLSearchParams ( params ) ;
61+ theURL . search = urlSearchParams . toString ( ) ;
62+ }
5663 var myHeaders = new Headers ( ) ;
5764 myHeaders . append ( "Authorization" , this . authorization ) ;
5865 var requestOptions = {
@@ -271,6 +278,20 @@ export class OFS {
271278 return this . _patch ( partialURL , data ) ;
272279 }
273280
281+ // Core: User Management
282+ async getUsers (
283+ offset : number = 0 ,
284+ limit : number = 100
285+ ) : Promise < OFSResponse > {
286+ const partialURL = "/rest/ofscCore/v1/users" ;
287+ return this . _get ( partialURL , { offset : offset , limit : limit } ) ;
288+ }
289+
290+ async getUserDetails ( uname : string ) : Promise < OFSResponse > {
291+ const partialURL = `/rest/ofscCore/v1/users/${ uname } ` ;
292+ return this . _get ( partialURL ) ;
293+ }
294+
274295 // Metadata: Plugin Management
275296 async importPlugins ( file ?: PathLike , data ?: string ) : Promise < OFSResponse > {
276297 const partialURL =
You can’t perform that action at this time.
0 commit comments