feat(apiclient): add TypeScript API client (ts_apiclient) with resource managers and package exports
This commit is contained in:
17
ts_apiclient/classes.config.ts
Normal file
17
ts_apiclient/classes.config.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import * as interfaces from '../ts_interfaces/index.js';
|
||||
import type { DcRouterApiClient } from './classes.dcrouterapiclient.js';
|
||||
|
||||
export class ConfigManager {
|
||||
private clientRef: DcRouterApiClient;
|
||||
|
||||
constructor(clientRef: DcRouterApiClient) {
|
||||
this.clientRef = clientRef;
|
||||
}
|
||||
|
||||
public async get(section?: string): Promise<interfaces.requests.IReq_GetConfiguration['response']> {
|
||||
return this.clientRef.request<interfaces.requests.IReq_GetConfiguration>(
|
||||
'getConfiguration',
|
||||
this.clientRef.buildRequestPayload({ section }) as any,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user