apx-toolkit
Version:
Automatically discover APIs and generate complete integration packages: code in 12 languages, TypeScript types, test suites, SDK packages, API documentation, mock servers, performance reports, and contract tests. Saves 2-4 weeks of work in seconds.
138 lines • 3.51 kB
TypeScript
/**
* Request labels for routing between discovery and API processing phases
*/
export declare const REQUEST_LABELS: {
readonly START_DISCOVERY: "START_DISCOVERY";
readonly API_PROCESS: "API_PROCESS";
};
export type RequestLabel = typeof REQUEST_LABELS[keyof typeof REQUEST_LABELS];
/**
* Input configuration for the Actor
*/
export interface ActorInput {
startUrls: Array<{
url: string;
}>;
apiPatterns?: string[];
minResponseSize?: number;
discoveryTimeout?: number;
maxPages?: number;
maxConcurrency?: number;
dataPath?: string;
paginationType?: 'auto' | 'offset' | 'page' | 'cursor';
exportFormats?: ExportFormat[];
generateDocumentation?: boolean;
authHeaders?: Record<string, string>;
apiKey?: string;
bearerToken?: string;
loginUrl?: string;
oauthFlow?: boolean;
enableInteractionSimulation?: boolean;
interactionWaitTime?: number;
generateGitHubActions?: boolean;
generateSecurityReport?: boolean;
generateEnhancedDocs?: boolean;
enableGitIntegration?: boolean;
generateMockServer?: boolean;
generatePerformanceBenchmark?: boolean;
generateContractTests?: boolean;
generateMCPIntegration?: boolean;
generateX402Integration?: boolean;
generateDependencyGraph?: boolean;
}
/**
* Export format options
*/
export type ExportFormat = 'openapi' | 'postman' | 'curl' | 'insomnia';
/**
* API documentation export
*/
export interface APIExport {
format: ExportFormat;
content: string;
filename: string;
mimeType: string;
}
/**
* Discovered API endpoint metadata
*/
export interface RateLimitInfo {
limit?: number;
remaining?: number;
reset?: number;
resetAfter?: number;
retryAfter?: number;
}
export interface DiscoveredAPI {
url: string;
baseUrl: string;
method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
headers: Record<string, string>;
queryParams?: Record<string, string>;
body?: unknown;
paginationInfo?: PaginationInfo;
dataPath?: string;
rateLimitInfo?: RateLimitInfo;
isGraphQL?: boolean;
graphQLQuery?: string;
graphQLOperationName?: string;
isWebSocket?: boolean;
webSocketUrl?: string;
webSocketProtocols?: string[];
requestExample?: any;
responseExample?: any;
data?: any;
bearerToken?: string;
}
/**
* Pagination information extracted from API response
*/
export interface PaginationInfo {
type: 'offset' | 'page' | 'cursor';
currentPage?: number;
currentOffset?: number;
pageSize?: number;
totalRecords?: number;
totalPages?: number;
hasNext?: boolean;
nextCursor?: string;
paramName?: string;
}
/**
* User data stored with API_PROCESS requests
*/
export interface APIRequestUserData {
page?: number;
offset?: number;
cursor?: string;
totalRecords?: number;
totalPages?: number;
discoveredAPI: DiscoveredAPI;
}
/**
* API response structure (common patterns)
*/
export interface APIResponse {
data?: {
items?: unknown[];
results?: unknown[];
list?: unknown[];
};
results?: unknown[];
items?: unknown[];
meta?: {
total?: number;
page?: number;
limit?: number;
offset?: number;
hasNext?: boolean;
nextCursor?: string;
};
pagination?: {
page?: number;
total?: number;
limit?: number;
};
[key: string]: unknown;
}
//# sourceMappingURL=types.d.ts.map