@altus4/sdk
Version:
Official TypeScript SDK for Altus 4 - AI-Enhanced MySQL Full-Text Search Engine
77 lines • 1.7 kB
TypeScript
/**
* Common types used across the Altus 4 SDK
*/
/**
* Standard API response wrapper
*/
export interface ApiResponse<T = unknown> {
success: boolean;
data?: T;
error?: {
code: string;
message: string;
details?: unknown;
};
meta?: {
timestamp: Date;
requestId: string;
version: string;
};
}
/**
* User roles in the system
*/
export type UserRole = 'admin' | 'user';
/**
* Environment types
*/
export type Environment = 'test' | 'live';
/**
* Rate limiting tiers
*/
export type RateLimitTier = 'free' | 'pro' | 'enterprise';
/**
* Time periods for analytics
*/
export type Period = 'day' | 'week' | 'month' | 'year';
/**
* Search modes
*/
export type SearchMode = 'natural' | 'boolean' | 'semantic';
/**
* Error codes
*/
export declare const ErrorCode: {
readonly VALIDATION_ERROR: "VALIDATION_ERROR";
readonly AUTHENTICATION_ERROR: "AUTHENTICATION_ERROR";
readonly AUTHORIZATION_ERROR: "AUTHORIZATION_ERROR";
readonly NOT_FOUND: "NOT_FOUND";
readonly RATE_LIMIT_EXCEEDED: "RATE_LIMIT_EXCEEDED";
readonly INTERNAL_ERROR: "INTERNAL_ERROR";
readonly NETWORK_ERROR: "NETWORK_ERROR";
readonly DATABASE_ERROR: "DATABASE_ERROR";
};
/**
* Pagination parameters
*/
export interface PaginationParams {
page?: number;
limit?: number;
sort?: string;
order?: 'asc' | 'desc';
}
/**
* Paginated response
*/
export interface PaginatedResponse<T> {
data: T[];
pagination: {
page: number;
limit: number;
total: number;
totalPages: number;
hasNext: boolean;
hasPrevious: boolean;
};
}
//# sourceMappingURL=common.d.ts.map