File tree 3 files changed +2788
-1
lines changed 3 files changed +2788
-1
lines changed Original file line number Diff line number Diff line change @@ -51,8 +51,15 @@ export class OFS {
51
51
return "Basic " + hash ;
52
52
}
53
53
54
- private _get ( partialURL : string ) : Promise < OFSResponse > {
54
+ private _get (
55
+ partialURL : string ,
56
+ params : any = undefined
57
+ ) : Promise < OFSResponse > {
55
58
var theURL = new URL ( partialURL , this . _baseURL ) ;
59
+ if ( params != undefined ) {
60
+ const urlSearchParams = new URLSearchParams ( params ) ;
61
+ theURL . search = urlSearchParams . toString ( ) ;
62
+ }
56
63
var myHeaders = new Headers ( ) ;
57
64
myHeaders . append ( "Authorization" , this . authorization ) ;
58
65
var requestOptions = {
@@ -271,6 +278,20 @@ export class OFS {
271
278
return this . _patch ( partialURL , data ) ;
272
279
}
273
280
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
+
274
295
// Metadata: Plugin Management
275
296
async importPlugins ( file ?: PathLike , data ?: string ) : Promise < OFSResponse > {
276
297
const partialURL =
You can’t perform that action at this time.
0 commit comments