1import{u as e,a as t,b as a,c as n}from"./useDocumentManagementV2ApiConfig-DmVD3rY0.js";import{u as d}from"./DocumentManagementServiceHelper-CoP_bJWt.js";import{l as u,c as o,g as c,m as i,a as s}from"./mapDocumentToCreateRequest-B0IRaQ7P.js";function m(){const{mutateAsync:m}=e(),{mutateAsync:r}=t(),{mutateAsync:l}=a(),{mutateAsync:p}=n();async function f({dmsDocumentId:e,documentFileUploadRequest:t,documentUpdateRequest:a,file:n}){if(t&&n){const a=await r({documentId:e,requestBody:t});await d(a,n,t.data.attributes.md5Hash)}await l({documentId:e,requestBody:a})}return{saveAndUploadDocumentsInDMS:function(e,t,a,n,i,s){const r=o(a,n,i,s,t);return Promise.all(e.map((async e=>{try{const{documentUploadRequest:t,file:a}=await r(e),n=await m({requestBody:t});if(!a)return;await d(n,a,t.data.attributes.md5Hash??"");const u=n.data.relationships?.document?.data.id,o=n.included?.find((e=>e.id===u));return o?o.attributes:null}catch(t){return u(`Failed creating document ${c(e)}`,t),null}})))},deleteDocumentsInDMS:async function(e){try{await p({documentId:e})}catch(t){u("Failed deleting document",t)}},updateCxpDocumentInDMS:async function({cxpDocument:e,file:t,additionalProperties:a}){try{const{dmsDocumentId:n,documentFileUploadRequest:d,documentUpdateRequest:u}=await i({cxpDocument:e,file:t,additionalProperties:a});return void(await f({dmsDocumentId:n,documentFileUploadRequest:d,documentUpdateRequest:u,file:t}))}catch(n){u(`Failed updating document ${c(e)}`,n)}},updateChangeSetInDMS:async function({changeSet:e,file:t,additionalProperties:a}){try{const{dmsDocumentId:n,documentFileUploadRequest:d,documentUpdateRequest:u}=await s({changeSet:e,file:t,additionalProperties:a});await f({dmsDocumentId:n,documentFileUploadRequest:d,documentUpdateRequest:u,file:t})}catch(n){u(`Failed updating document ${e.originalFilename||t?.name||"changes"}`,n)}}}}export{m as u}; 2//# sourceMappingURL=useDocumentManagementService-D2ayCzLS.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.