UNPKG

@paritydeals/node-sdk

Version:

Node.js SDK for interacting with the ParityDeals API.

51 lines 2.12 kB
import type { ParityDeals } from './client'; import { // Interface for internal payload construction ReportUsageResponse, // Interface for internal payload construction ReportEventResponse } from './models'; import { Behaviour } from './constants'; /** * Handles 'reporting' related API operations. * This class is instantiated by the ParityDeals client and accessed * via `client.reporting`. All methods are asynchronous. */ export declare class ReportingOperations { private client; constructor(client: ParityDeals); /** * Reports usage information to the API. * @param params - Parameters for reporting usage. * - customerId: string - Customer's unique identifier. * - featureId: string - Feature's unique identifier. * - value: number - The usage value. * - behaviour: Behaviour - How the usage should be interpreted ('SET' or 'DELTA'). * - resourceId?: string | null - Optional resource identifier. * @returns A Promise resolving to ReportUsageResponse. */ reportUsage(params: { customerId: string; featureId: string; value: number; behaviour: Behaviour; resourceId?: string | null; }): Promise<ReportUsageResponse>; /** * Reports an event to the API. * @param params - Parameters for reporting an event. * - customerId: string - Customer's unique identifier. * - eventName: string - Name of the event. * - idempotencyKey: string - Unique key for the event. * - timestamp: string - UTC timestamp string ("YYYY-MM-DD HH:MM:SS.ffffff"). * - resourceId?: string | null - Optional resource identifier. * - properties?: Record<string, any> | null - Optional additional properties for the event. * @returns A Promise resolving to ReportEventResponse. */ reportEvent(params: { customerId: string; eventName: string; idempotencyKey: string; timestamp: string; resourceId?: string | null; properties?: Record<string, any> | null; }): Promise<ReportEventResponse>; } //# sourceMappingURL=reporting.d.ts.map