watchtower-node-sdk
Version:
A TypeScript Node.js SDK for the Watchtower API, providing API key management, connection string generation, and more
65 lines (58 loc) • 1.41 kB
text/typescript
export interface PredictRequest {
organization_apikey: string;
app_apikey: string;
tenant_apikey?: string;
item_id: string;
prediction_type: 'trend' | 'anomaly' | 'failure';
timeframe: '1h' | '24h' | '7d' | '30d';
}
export interface PredictResponse {
timestamp: string;
item_id: string;
prediction: string;
confidence: number;
explanation: string;
timeframe: string;
recommendations: string[];
}
export interface PredictionType {
type: 'trend' | 'anomaly' | 'failure';
description: string;
use_cases: string[];
example: string;
}
export interface Timeframe {
value: '1h' | '24h' | '7d' | '30d';
description: string;
use_cases: string;
}
export interface PredictConfigResponse {
prediction_types: PredictionType[];
timeframes: Timeframe[];
example_request: PredictRequest;
example_response: PredictResponse;
}
export interface Metric {
name: string;
friendly_name?: string;
value: any;
unit?: string;
}
export interface DecideRequest {
organization_apikey: string;
app_apikey: string;
tenant_apikey?: string;
log_data: {
metrics: Metric[];
context: string;
item_name: string;
};
allowed_actions: Record<string, string>;
}
export interface DecideResponse {
timestamp: string;
decision: string;
reason: string;
confidence: number;
message?: string;
}