var c=Object.defineProperty;var i=(a,t,e)=>t in a?c(a,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[t]=e;var d=(a,t,e)=>(i(a,typeof t!="symbol"?t+"":t,e),e);import{k as r}from"./router.29e08ea4.js";import"./jwt-decode.esm.32f71954.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new Error().stack;t&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[t]="f55e072a-d1ec-4b6a-95c5-30b79974e326",a._sentryDebugIdIdentifier="sentry-dbid-f55e072a-d1ec-4b6a-95c5-30b79974e326")}catch{}})();class y{async createTask(t,e,s){return fetch("/_editor/api/tasks",{method:"POST",body:JSON.stringify({name:t,payload:s,stage_id:e}),headers:{"Content-Type":"application/json"}}).then(n=>n.json())}async getAllTasks(t,e){const s={offset:t.currentIndex*t.pageSize,limit:t.pageSize,filter:{stage:e.stage,status:e.status,startDate:e.dateRange?e.dateRange[0]:void 0,endDate:e.dateRange?e.dateRange[1]:void 0}};return fetch("/_editor/api/tasks/list",{method:"POST",body:JSON.stringify(s),headers:{"Content-Type":"application/json"}}).then(n=>n.json())}async getStageTasks(t){return fetch(`/_editor/api/tasks/${t}`).then(e=>e.json())}async getSentStageTasks(t){return fetch(`/_editor/api/tasks/${t}/sent`).then(e=>e.json())}async updateTaskStatus(t,e){return fetch(`/_editor/api/tasks/${t}/status`,{method:"PUT",body:JSON.stringify({status:e}),headers:{"Content-Type":"application/json"}}).then(s=>s.json())}async clearAllTasks(){return fetch("/_editor/api/tasks/clear",{method:"DELETE"}).then(t=>t.json())}}class h{constructor(t){d(this,"projectId");this.projectId=t}async createTask(t,e,s){return await r.post(`projects/${this.projectId}/tasks`,{name:t,stageId:e,payload:s})}async getAllTasks(t,e){const s={offset:(t.currentIndex*t.pageSize).toString(),limit:t.pageSize.toString(),stageId:e.stage,status:e.status,startDate:e.dateRange?e.dateRange[0]:void 0,endDate:e.dateRange?e.dateRange[1]:void 0};return Object.keys(s).forEach(o=>s[o]===void 0&&delete s[o]),await r.get(`projects/${this.projectId}/tasks`,s)}async getTasksStatistics(){return await r.get(`projects/${this.projectId}/tasks/statistics`)}async getStageTasks(t){const e={stageId:t,offset:"0",limit:"1000"};return await r.get(`projects/${this.projectId}/tasks`,e)}async getSentStageTasks(t){const e={sourceStageId:t,offset:"0",limit:"1000"};return await r.get(`projects/${this.projectId}/tasks`,e)}async updateTaskStatus(t,e){throw new Error("Method not implemented.")}async fetchStages(){throw new Error("Method not implemented.")}async fetchStatuses(){throw new Error("Method not implemented.")}async clearAllTasks(){throw new Error("Method not implemented.")}}export{y as L,h as R};
//# sourceMappingURL=repository.e580214f.js.map
