MCPcopy Create free account
hub / github.com/callstack/agent-device / requireResumableUpload

Function requireResumableUpload

src/daemon/resumable-upload.ts:199–211  ·  view source on GitHub ↗
(
  uploadId: string,
  tenantId: string | undefined,
)

Source from the content-addressed store, hash-verified

197}
198
199function requireResumableUpload(
200 uploadId: string,
201 tenantId: string | undefined,
202): ResumableUploadEntry {
203 const entry = RESUMABLE_UPLOADS_BY_ID.get(uploadId);
204 if (!entry) {
205 throw new AppError('INVALID_ARGS', `Upload not found: ${uploadId}`);
206 }
207 if (entry.tenantId && entry.tenantId !== tenantId) {
208 throw new AppError('UNAUTHORIZED', 'Upload belongs to a different tenant');
209 }
210 return entry;
211}
212
213function currentResumableUploadOffset(entry: ResumableUploadEntry): number {
214 if (!fs.existsSync(entry.payloadPath)) return 0;

Callers 2

finalizeResumableUploadFunction · 0.85

Calls 1

getMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…