UNPKG

@azowl/agentops-sdk

Version:

AgentOps REST client and local task execution SDK for Node.js

31 lines (28 loc) • 1.14 kB
export interface AgentOpsErrorOptions { code?: string; status?: number | null; clientRequestId?: string | null; requestId?: string | null; retryAfterMs?: number | null; outcomeUnknown?: boolean; } export class AgentOpsError extends Error { constructor(message: string, options?: AgentOpsErrorOptions); readonly code: string; readonly status: number | null; readonly clientRequestId: string | null; readonly requestId: string | null; readonly retryAfterMs: number | null; /** A write may have reached the server. Keep the original request UUID. */ readonly outcomeUnknown: boolean; } export const HASH: RegExp; export const IDENTIFIER: RegExp; export function fail(code: string, message: string): never; export function object(value: unknown): value is Record<string, unknown>; export function uuid(value: unknown, field?: string): string; export function duration(value: unknown, field: string): number; export function validUuid(value: unknown): value is string; export function invalidResponse(): never; export function scopeMismatch(): never; export function jsonBody(response: Response): Promise<unknown>;