corellium-typescript
Version:
A beautiful TypeScript Corellium library.
1 lines • 1.05 kB
JavaScript
;exports.createFileEndpoints=(r,e)=>({get:async a=>{const t=await r.GET("/v1/instances/{instanceId}/agent/v1/file/device/{filePath}",{params:{path:{instanceId:e,filePath:a}}});if(t.error)throw new Error(t.error.error);return t.data},create:async(a,t)=>{const n=await r.PUT("/v1/instances/{instanceId}/agent/v1/file/device/{filePath}",{params:{path:{instanceId:e,filePath:a}},body:t});if(n.error)throw new Error(n.error.error);return n.data},delete:async a=>{const t=await r.DELETE("/v1/instances/{instanceId}/agent/v1/file/device/{filePath}",{params:{path:{instanceId:e,filePath:a}}});if(t.error)throw new Error(t.error.error);return t.data},generateFilename:async()=>{const a=await r.POST("/v1/instances/{instanceId}/agent/v1/file/temp",{params:{path:{instanceId:e}}});if(a.error)throw new Error(a.error.error);return a.data},update:async(a,t)=>{const n=await r.PATCH("/v1/instances/{instanceId}/agent/v1/file/device/{filePath}",{params:{path:{instanceId:e,filePath:a}},body:t});if(n.error)throw new Error(n.error.error);return n.data}});