@revmax/agent-sdk
Version:
Official Node.js SDK for RevMax - billing, customer management, and usage tracking
66 lines • 1.89 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Customers = void 0;
/**
* Customer resource for managing customers
*/
class Customers {
/**
* Create a new customer resource
* @param client - API client
* @param logger - Logger instance
*/
constructor(client, logger) {
this.basePath = '/customers';
this.client = client;
this.logger = logger;
}
/**
* Create a new customer
* @param params - Customer creation parameters
* @returns Created customer
*/
async create(params) {
this.logger.info('Creating customer', params);
return this.client.post(this.basePath, params);
}
/**
* Get a specific customer by ID
* @param id - Customer ID
* @returns Customer data
*/
async get(id) {
this.logger.info(`Retrieving customer: ${id}`);
return this.client.get(`${this.basePath}/${id}`);
}
/**
* Update a customer
* @param id - Customer ID
* @param params - Customer update parameters
* @returns Updated customer
*/
async update(id, params) {
this.logger.info(`Updating customer: ${id}`, params);
return this.client.patch(`${this.basePath}/${id}`, params);
}
/**
* Delete a customer
* @param id - Customer ID
* @returns Void
*/
async delete(id) {
this.logger.info(`Deleting customer: ${id}`);
return this.client.delete(`${this.basePath}/${id}`);
}
/**
* List customers with pagination and filtering
* @param params - List parameters
* @returns Paginated list of customers
*/
async list(params = {}) {
this.logger.info('Listing customers', params);
return this.client.get(this.basePath, params);
}
}
exports.Customers = Customers;
//# sourceMappingURL=customers.js.map