(options: {
url: URL;
method: 'POST' | 'PUT';
headers: Record<string, string>;
payloadPath: string;
timeoutMessage: string;
timeoutHint?: string;
errorMessage: string;
errorHint?: string;
retryable?: boolean;
progress?: UploadStreamProgressOptions;
})
| 28 | }; |
| 29 | |
| 30 | export async function streamFileToHttpRequest(options: { |
| 31 | url: URL; |
| 32 | method: 'POST' | 'PUT'; |
| 33 | headers: Record<string, string>; |
| 34 | payloadPath: string; |
| 35 | timeoutMessage: string; |
| 36 | timeoutHint?: string; |
| 37 | errorMessage: string; |
| 38 | errorHint?: string; |
| 39 | retryable?: boolean; |
| 40 | progress?: UploadStreamProgressOptions; |
| 41 | }): Promise<UploadStreamResponse> { |
| 42 | return await streamFileToHttpRequestAttempt({ |
| 43 | ...options, |
| 44 | url: options.url, |
| 45 | redirectCount: 0, |
| 46 | startOffset: 0, |
| 47 | }); |
| 48 | } |
| 49 | |
| 50 | export function isRetryableUploadStreamError(error: unknown): boolean { |
| 51 | return error instanceof AppError && error.details?.[UPLOAD_STREAM_RETRYABLE_DETAIL] === true; |
no test coverage detected