UNPKG

@revmax/agent-sdk

Version:

Official Node.js SDK for RevMax - billing, customer management, and usage tracking

30 lines (29 loc) 970 B
import { ApiClient } from "../utils/api"; import { Logger } from "../utils/logger"; import { TrackEventParams, TrackEventResponse } from "../types"; /** * Usage resource for tracking usage */ export declare class Usage { private readonly client; private readonly logger; private readonly basePath; /** * Create a new usage resource * @param client - API client * @param logger - Logger instance */ constructor(client: ApiClient, logger: Logger); /** * Track events for a customer - supports both single record and batch operations * @param params - Event tracking parameters (single record or batch) * @returns Tracked event data */ trackEvent(params: TrackEventParams): Promise<TrackEventResponse>; /** * Format a usage record, converting Date objects to ISO strings * @param record - The usage record to format * @returns The formatted record */ private formatRecord; }