tmtaskvcuploadinit = asAPIEndpointDef({ service: 'ingester', method: 'POST', endpoint: '/content/vcupload/tmtaskinit', input: { origin: cLimitedString(128), taskid: cLimitedString(32), fileinfo: cWebUploadInfo }, output: { fileId: t.string, fileName: t.string, uploadedbytes: t.number, uploadedchunks: t.array(cVCChunkInfo) }, options: { crossdomain: 1, allowHeaders: 'Origin, Content-Type' } }); contentvcuploadchunk = asAPIEndpointDef({ service: 'ingester', method: 'POST', endpoint: '/content/vcupload/chunk', input: { fileid: cLimitedString(64), offset: t.number, chunk: cFileInformation }, output: { fileinfo: cUploadingVCFile }, options: { multipart: 1, crossdomain: 1, allowHeaders: 'Origin, Content-Type' } }); contentvcuploadfinish = asAPIEndpointDef({ service: 'ingester', method: 'POST', endpoint: '/content/vcupload/finish', input: { fileid: t.string }, output: { }, options: { crossdomain: 1, allowHeaders: 'Origin, Content-Type' } }); export const cIntBool = t.union([t.literal(0), t.literal(1)], 'IntBool'); export type IntBool = t.TypeOf; export const cWebUploadInfo = t.type({ name: t.string, size: t.number, lastModified: t.number, type: t.string, // MIME type uploadDirectory: t.string }); export type WebUploadInfo = t.TypeOf; export const cUploadingFileBase = t.intersection([ t.type({ name: t.string, ext: t.string, uploaddirectory: t.string, size: t.number, lastmodified: t.number, type: t.string, userid: t.string, email: t.string, started: t.number, ip: t.string }), t.partial({ conversion: cUploadConversionInfo }) ]); export type UploadingFileBase = t.TypeOf; export const cVCChunkInfo = t.type({ offset: t.number, length: t.number, written: cIntBool }); export type VCChunkInfo = t.TypeOf; export const cVCChunksInfo = t.type({ uploadedbytes: t.number, uploadedchunks: t.array(cVCChunkInfo) }); export type VCChunksInfo = t.TypeOf; export const cUploadingVCFile = t.intersection([ cUploadingFileBase, cVCChunksInfo ]); export type UploadingVCFile = t.TypeOf;