const StorageBaseService=require("./base");class GenerateProximalSignService extends StorageBaseService{async exec(){const{params:e}=this.ctx.data,{cloudPath:t}=JSON.parse(e)||{};t||this.ctx.throw("cloud_path_required");const a=await this.getAuth(),i=await global.uniCloud.getFileInfo(t);let o,r;i?(o={uid:i.uid,cloudPath:t,createDate:i.createDate,updateDate:i.updateDate},r="update"):(r="create",o={uid:null,cloudPath:t,createDate:0,updateDate:0});const l=a.uid,u=await this.verifyPermission(t,r,{resource:o,auth:a});await global.uniCloud.beforeFileUpload({cloudPath:t,uid:l||null}),!0!==u&&this.ctx.throw("storage_permission_denied: "+t);return global.uniCloud.$scope.file.getUploadFileOptions({cloudPath:t})}}module.exports=GenerateProximalSignService;