import{n as e}from"./rolldown-runtime-S-ySWqyJ.js";import{n as t}from"./apiClient-8SEVieuP.js";var n=`/api/v1/design-workflow`,r={list:e=>t.get(`${n}/workflows/`,{params:e}),get:e=>t.get(`${n}/workflows/${e}/`),create:e=>t.post(`${n}/workflows/`,e),update:(e,r)=>t.patch(`${n}/workflows/${e}/`,r),delete:e=>t.delete(`${n}/workflows/${e}/`),getLinkDefinitions:e=>t.get(`${n}/workflows/${e}/link_definitions/`),publishPreview:e=>t.get(`${n}/workflows/${e}/publish_preview/`),publish:e=>t.post(`${n}/workflows/${e}/publish/`),unpublish:e=>t.post(`${n}/workflows/${e}/unpublish/`),deprecate:e=>t.post(`${n}/workflows/${e}/deprecate/`),clone:(e,r)=>t.post(`${n}/workflows/${e}/clone/`,r),toDraft:e=>t.post(`${n}/workflows/${e}/to-draft/`),getVersions:e=>t.get(`${n}/workflows/${e}/versions/`),createVersion:(e,r)=>t.post(`${n}/workflows/${e}/create-version/`,r),migrateDocuments:(e,r)=>t.post(`${n}/workflows/${e}/migrate-documents/`,r),unpublishForce:e=>t.post(`${n}/workflows/${e}/unpublish/`,{force:!0}),restoreVersionDryRun:(e,r)=>t.post(`${n}/workflows/${e}/restore-version/`,{version_id:r,dry_run:!0}),restoreVersion:(e,r)=>t.post(`${n}/workflows/${e}/restore-version/`,{version_id:r}),discardPendingDraft:e=>t.delete(`${n}/workflows/${e}/pending-draft/`)},i=`/api/v1/design-workflow`,a={list:e=>t.get(`${i}/link-definitions/`,{params:e}),get:e=>t.get(`${i}/link-definitions/${e}/`),create:e=>t.post(`${i}/link-definitions/`,e),update:(e,n)=>t.patch(`${i}/link-definitions/${e}/`,n),delete:e=>t.delete(`${i}/link-definitions/${e}/`),getAvailableSources:(e,n)=>t.get(`${i}/link-definitions/${e}/available-sources/`,{params:n}),getLinkHistory:(e,n)=>t.get(`${i}/link-definitions/${e}/link-history/`,{params:{source_id:n}}),getOpenTracking:e=>t.get(`${i}/link-definitions/${e}/open-tracking/`),closeAllTracking:e=>t.post(`${i}/link-definitions/${e}/close-all-tracking/`),getLinkedSourcesForTarget:(e,n)=>t.get(`${i}/link-instances/linked-sources-for-target/`,{params:{link_definition_id:e,target_id:n}}),getTargetLinkedSources:(e,n)=>t.get(`${i}/link-instances/target-linked-sources/`,{params:{target_id:e,target_screen_code:n}}),getDocumentSourceTracking:(e,n)=>t.get(`${i}/link-instances/document-source-tracking/`,{params:{source_id:e,source_screen_code:n}})},o=`/api/v1/design-workflow`,s={list:e=>{let n=new URLSearchParams;e?.search&&n.set(`search`,e.search),e?.page&&n.set(`page`,String(e.page)),e?.page_size&&n.set(`page_size`,String(e.page_size)),e?.module&&n.set(`module`,e.module);let r=n.toString();return t.get(`${o}/screens/${r?`?${r}`:``}`)},getFields:(e,n)=>{let r=new URLSearchParams;n?.fk_only&&r.set(`fk_only`,`true`);let i=r.toString();return t.get(`${o}/screens/${e}/fields/${i?`?${i}`:``}`)}},c=`/api/v1/design-workflow`,l={list:e=>t.get(`${c}/key-fields/`,{params:e}),getByLink:e=>t.get(`${c}/key-fields/by_link/`,{params:{link_definition:e}}),get:e=>t.get(`${c}/key-fields/${e}/`),create:e=>t.post(`${c}/key-fields/`,e),bulkCreate:e=>t.post(`${c}/key-fields/bulk_create/`,e),update:(e,n)=>t.patch(`${c}/key-fields/${e}/`,n),delete:e=>t.delete(`${c}/key-fields/${e}/`),validate:e=>t.post(`${c}/key-fields/validate/`,e)},u=`/api/v1/design-workflow`,d={list:e=>t.get(`${u}/field-mappings/`,{params:e}),getByLink:e=>t.get(`${u}/field-mappings/by_link/`,{params:{link_definition:e}}),get:e=>t.get(`${u}/field-mappings/${e}/`),create:e=>t.post(`${u}/field-mappings/`,e),bulkCreate:e=>t.post(`${u}/field-mappings/bulk_create/`,e),update:(e,n)=>t.patch(`${u}/field-mappings/${e}/`,n),delete:e=>t.delete(`${u}/field-mappings/${e}/`),execute:(e,n)=>t.post(`${u}/field-mappings/${e}/execute/`,n)},f=e({workflowApi:()=>r});export{a,s as i,d as n,r as o,l as r,f as t};