@ritas-inc/sapb1commandapi-client
Version:
A stateless TypeScript client for SAP B1 Service Layer Command API with comprehensive error handling, type safety, and batch operations
23 lines (22 loc) • 760 B
JavaScript
import { HTTPClient } from './utils/http.client.js';
import { AuthService } from './services/auth.service.js';
import { PlansService } from './services/plans.service.js';
import { WorkOrdersService } from './services/workorders.service.js';
export class SAPB1CommandClient {
httpClient;
auth;
plans;
workOrders;
constructor(config) {
this.httpClient = new HTTPClient(config);
this.auth = new AuthService(this.httpClient);
this.plans = new PlansService(this.httpClient);
this.workOrders = new WorkOrdersService(this.httpClient);
}
get baseUrl() {
return this.httpClient['client'].defaults.baseURL || '';
}
async health() {
return this.httpClient.get('/api/v1/health');
}
}