import { APIClient } from './APIClient' ; export class NodeClient { public constructor ( private api ) { } public async getAll ( organizationId ) { return this . api . post ( 'nodes/read' , { organizationId , } ) ; } public async create ( organizationId , name , sku ) { const data = await this . api . post ( 'nodes/create' , { organizationId , name , sku , } ) ; return data . node ; } public async update ( organizationId , nodeId , newName ) { await this . api . post ( 'nodes/update' , { organizationId , nodeId , name : newName , } ) ; } public async delete ( organizationId , nodeId ) { await this . api . post ( 'nodes/delete' , { organizationId , nodeId , } ) ; } public async stop ( organizationId , nodeId ) { await this . api . post ( 'nodes/stop' , { organizationId , nodeId , } ) ; } }