UNPKG

@elusion-sdk/briq

Version:

A modern TypeScript SDK for Briq SMS API integration

78 lines 1.96 kB
export interface BriqConfig { apiKey: string; baseUrl?: string; timeout?: number; retries?: number; version?: string; } export interface ApiResponse<T = any> { success: boolean; data?: T; message?: string; error?: string; timestamp?: string; } export interface ApiError { success: false; error: string; message?: string; code?: string | number; details?: Record<string, any>; } export type HttpMethod = "GET" | "POST" | "PATCH" | "PUT" | "DELETE"; export interface RequestConfig { method: HttpMethod; url: string; headers?: Record<string, string>; data?: any; params?: Record<string, any>; timeout?: number; } export interface PaginationParams { page?: number; limit?: number; offset?: number; } export interface PaginatedResponse<T> { success: boolean; data: T[]; pagination: { page: number; limit: number; total: number; totalPages: number; hasNext: boolean; hasPrev: boolean; }; } export interface BaseEntity { id: string; created_at?: string; } export interface ApiEndpoints { readonly messages: { readonly sendInstant: string; readonly sendCampaign: string; readonly logs: string; readonly history: string; }; readonly workspaces: { readonly create: string; readonly getAll: string; readonly getById: (id: string) => string; readonly update: (id: string) => string; }; readonly campaigns: { readonly create: string; readonly getAll: string; readonly getById: (id: string) => string; readonly update: (id: string) => string; }; } export type OperationStatus = "pending" | "success" | "failed" | "cancelled"; export interface RetryConfig { maxRetries: number; retryDelay: number; retryCondition?: (error: any) => boolean; } //# sourceMappingURL=common.d.ts.map