converteverything-mcp 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,129 @@
1
+ /**
2
+ * ConvertEverything API Client
3
+ *
4
+ * Secure client for interacting with the ConvertEverything.io public API.
5
+ * Only uses documented public endpoints - no internal/admin access.
6
+ */
7
+ import { ClientConfig, ConversionResponse, ConversionListResponse, ConversionOptions, SupportedFormatsResponse, UsageResponse } from "./types.js";
8
+ export interface WaitOptions {
9
+ pollInterval?: number;
10
+ timeout?: number;
11
+ }
12
+ export declare class ConvertEverythingClient {
13
+ private readonly apiKey;
14
+ private readonly baseUrl;
15
+ private readonly timeout;
16
+ private readonly userAgent;
17
+ private readonly maxRetries;
18
+ private formatCache;
19
+ constructor(config: ClientConfig);
20
+ /**
21
+ * Generate a unique correlation ID for request tracing
22
+ */
23
+ private generateCorrelationId;
24
+ /**
25
+ * Calculate exponential backoff delay
26
+ */
27
+ private getRetryDelay;
28
+ /**
29
+ * Sleep for specified milliseconds
30
+ */
31
+ private sleep;
32
+ /**
33
+ * Execute fetch with timeout and abort controller
34
+ */
35
+ private fetchWithTimeout;
36
+ /**
37
+ * Execute fetch with retry logic and rate limit handling
38
+ */
39
+ private fetchWithRetry;
40
+ /**
41
+ * Sanitize and validate the base URL
42
+ */
43
+ private sanitizeUrl;
44
+ /**
45
+ * Make an authenticated API request with retry and correlation ID
46
+ */
47
+ private request;
48
+ /**
49
+ * Get list of supported conversion formats (cached for 1 hour)
50
+ */
51
+ getSupportedFormats(skipCache?: boolean): Promise<SupportedFormatsResponse>;
52
+ /**
53
+ * Clear the format cache
54
+ */
55
+ clearFormatCache(): void;
56
+ /**
57
+ * Get current API usage and limits
58
+ */
59
+ getUsage(): Promise<UsageResponse>;
60
+ /**
61
+ * Get status of a conversion
62
+ */
63
+ getConversionStatus(conversionId: string): Promise<ConversionResponse>;
64
+ /**
65
+ * Validate file path for security
66
+ */
67
+ private validateFilePath;
68
+ /**
69
+ * Convert a file from a local path
70
+ */
71
+ convertFile(filePath: string, targetFormat: string, options?: ConversionOptions): Promise<ConversionResponse>;
72
+ /**
73
+ * Convert a file from a buffer/base64 data
74
+ */
75
+ convertFileBuffer(data: Buffer | string, fileName: string, targetFormat: string, options?: ConversionOptions): Promise<ConversionResponse>;
76
+ /**
77
+ * Download a converted file
78
+ */
79
+ downloadFile(conversionId: string): Promise<{
80
+ data: Buffer;
81
+ filename: string;
82
+ contentType: string;
83
+ }>;
84
+ /**
85
+ * Wait for a conversion to complete
86
+ */
87
+ waitForConversion(conversionId: string, options?: WaitOptions): Promise<ConversionResponse>;
88
+ /**
89
+ * List recent conversions
90
+ */
91
+ listConversions(page?: number, perPage?: number): Promise<ConversionListResponse>;
92
+ /**
93
+ * Cancel/delete an in-progress or completed conversion
94
+ */
95
+ cancelConversion(conversionId: string): Promise<{
96
+ success: boolean;
97
+ message: string;
98
+ }>;
99
+ /**
100
+ * Get file information/metadata
101
+ */
102
+ getFileInfo(filePath: string): Promise<{
103
+ filename: string;
104
+ size: number;
105
+ format: string;
106
+ mimeType: string;
107
+ }>;
108
+ /**
109
+ * Estimate output file size based on conversion options
110
+ */
111
+ estimateOutputSize(inputSize: number, sourceFormat: string, targetFormat: string, options?: ConversionOptions): {
112
+ estimatedSize: number;
113
+ confidence: "low" | "medium" | "high";
114
+ notes: string;
115
+ };
116
+ /**
117
+ * Retry a failed conversion with optional new options
118
+ */
119
+ retryConversion(conversionId: string, newOptions?: ConversionOptions): Promise<ConversionResponse>;
120
+ /**
121
+ * Validate UUID format
122
+ */
123
+ private isValidUuid;
124
+ /**
125
+ * Sanitize filename to prevent issues
126
+ */
127
+ private sanitizeFilename;
128
+ }
129
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,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