MCPcopy Index your code
hub / github.com/callstack/agent-device / streamFileToHttpRequest

Function streamFileToHttpRequest

src/upload-stream.ts:30–48  ·  view source on GitHub ↗
(options: {
  url: URL;
  method: 'POST' | 'PUT';
  headers: Record<string, string>;
  payloadPath: string;
  timeoutMessage: string;
  timeoutHint?: string;
  errorMessage: string;
  errorHint?: string;
  retryable?: boolean;
  progress?: UploadStreamProgressOptions;
})

Source from the content-addressed store, hash-verified

28};
29
30export 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
50export function isRetryableUploadStreamError(error: unknown): boolean {
51 return error instanceof AppError && error.details?.[UPLOAD_STREAM_RETRYABLE_DETAIL] === true;

Callers 2

uploadLegacyArtifactFunction · 0.90
uploadDirectArtifactFunction · 0.90

Calls 1

Tested by

no test coverage detected