@spaceinvoices/js-sdk 2.3.4 → 2.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client-headers.cjs +2 -0
- package/dist/client-headers.cjs.map +1 -0
- package/dist/client-headers.js +2 -0
- package/dist/client-headers.js.map +1 -0
- package/dist/index.cjs +232 -2
- package/dist/index.cjs.map +1 -387
- package/dist/index.js +232 -2
- package/dist/index.js.map +1 -387
- package/dist/sdk/index.cjs +3 -0
- package/dist/sdk/index.cjs.map +1 -0
- package/dist/sdk/index.js +3 -0
- package/dist/sdk/index.js.map +1 -0
- package/package.json +17 -19
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
'use strict';Object.defineProperty(exports,'__esModule',{value:true});var fn="x-spaceinvoices-client";function Re(e){return {[fn]:e}}var g=null,Dn=null,bn="l.account";function ye(e){g=e;}function Cn(){if(!g)throw new Error("SDK not initialized. Call new SpaceInvoices() first.");return g}function Fn(e){if(typeof document>"u")return null;let t=document.cookie.match(new RegExp(`(?:^|; )${e}=([^;]+)`));return t?decodeURIComponent(t[1]):null}function Nn(e){if(!e)return {};if(e instanceof Headers){let t={};return e.forEach((s,p)=>{t[p]=s;}),t}if(Array.isArray(e)){let t={};for(let[s,p]of e)t[s]=p;return t}return e}async function r(e,t){let s=Cn(),p=await Promise.resolve(s.getAccessToken()),n=`${s.baseUrl}${e}`,c={...Nn(t.headers)};s.clientName&&Object.assign(c,Re(s.clientName)),p&&(c.Authorization=`Bearer ${p}`);let u=c["x-account-id"]||c["X-Account-Id"]||Dn||Fn(bn);u&&!c["x-account-id"]&&!c["X-Account-Id"]&&(c["x-account-id"]=u);let d=await fetch(n,{...t,headers:c});d.status===401&&s.onUnauthorized&&s.onUnauthorized(d);let y,An=d.headers.get("content-length"),R=d.headers.get("content-type");if(An==="0"||d.status===204)y=void 0;else if(R?.includes("application/pdf")||R?.includes("application/vnd.openxmlformats-officedocument.wordprocessingml.document")||R?.includes("application/octet-stream")||R?.includes("application/zip")||R?.includes("application/x-zip-compressed")||R?.includes("image/"))y=await d.blob();else if(R?.includes("application/xml")||R?.includes("text/xml"))y=await d.text();else if(R?.includes("text/html"))y=await d.text();else try{y=await d.json();}catch{y=void 0;}return {data:y,status:d.status,headers:d.headers}}var Tn=()=>"/account-webhooks",me=async(e,t)=>r(Tn(),{...t,method:"POST",headers:{"Content-Type":"application/json",...t?.headers},body:JSON.stringify(e)}),Un=e=>{let t=new URLSearchParams;Object.entries(e||{}).forEach(([p,n])=>{n!==void 0&&t.append(p,n===null?"null":n.toString());});let s=t.toString();return s.length>0?`/account-webhooks?${s}`:"/account-webhooks"},ge=async(e,t)=>r(Un(e),{...t,method:"GET"}),kn=e=>`/account-webhooks/${e}`,le=async(e,t)=>r(kn(e),{...t,method:"GET"}),Hn=e=>`/account-webhooks/${e}`,Ee=async(e,t,s)=>r(Hn(e),{...s,method:"PATCH",headers:{"Content-Type":"application/json",...s?.headers},body:JSON.stringify(t)}),On=e=>`/account-webhooks/${e}`,xe=async(e,t)=>r(On(e),{...t,method:"DELETE"}),Bn=e=>`/account-webhooks/${e}/test`,he=async(e,t)=>r(Bn(e),{...t,method:"POST"});var Wn=e=>`/account-webhooks/${e}/rotate-secret`,ve=async(e,t)=>r(Wn(e),{...t,method:"POST"});async function Gn(e,t){return e(...t)}function Ie(e){if(!e?.entity_id&&!e?.account_id&&!e?.signal)return;let t={};return (e.entity_id||e.account_id)&&(t.headers={...e.entity_id?{"x-entity-id":e.entity_id}:{},...e.account_id?{"x-account-id":e.account_id}:{}}),e.signal&&(t.signal=e.signal),t}function o(e){return async(...t)=>{let s=t[t.length-1],p=s&&typeof s=="object"&&("entity_id"in s||"account_id"in s||"signal"in s||Object.keys(s).length===0),n,a;p?(n=t.slice(0,-1),a=Ie(s)):n=[...t],n.push(a);let c=await Gn(e,n);if(c.status>=200&&c.status<300)return c.data;let u=new Error(`API error: ${c.status}`);throw u.status=c.status,u.data=c.data,u}}function i(e){return async t=>{let{entity_id:s,account_id:p,signal:n,...a}=t||{},c=Ie({entity_id:s,account_id:p,signal:n}),u=await e(a,c);if(u.status===200)return u.data;let d=new Error(`API error: ${u.status}`);throw d.status=u.status,d.data=u.data,d}}var l={create:o(me),list:i(ge),get:o(le),update:o(Ee),delete:o(xe),testAccountWebhook:o(he),rotateAccountWebhookSecret:o(ve)};var wn=e=>{let t=new URLSearchParams;Object.entries(e||{}).forEach(([p,n])=>{n!==void 0&&t.append(p,n===null?"null":n.toString());});let s=t.toString();return s.length>0?`/activities?${s}`:"/activities"},Se=async(e,t)=>r(wn(e),{...t,method:"GET"});var E={list:i(Se)};var Vn=e=>`/advance-invoices/shareable/${e}`,Pe=async(e,t)=>r(Vn(e),{...t,method:"GET"}),Ln=(e,t)=>{let s=new URLSearchParams;Object.entries(t||{}).forEach(([n,a])=>{a!==void 0&&s.append(n,a===null?"null":a.toString());});let p=s.toString();return p.length>0?`/advance-invoices/shareable/${e}/html?${p}`:`/advance-invoices/shareable/${e}/html`},Ae=async(e,t,s)=>r(Ln(e,t),{...s,method:"GET"}),qn=(e,t)=>{let s=new URLSearchParams;Object.entries(t||{}).forEach(([n,a])=>{a!==void 0&&s.append(n,a===null?"null":a.toString());});let p=s.toString();return p.length>0?`/advance-invoices/shareable/${e}/pdf?${p}`:`/advance-invoices/shareable/${e}/pdf`},fe=async(e,t,s)=>r(qn(e,t),{...s,method:"GET"}),zn=()=>"/advance-invoices",De=async(e,t)=>r(zn(),{...t,method:"POST",headers:{"Content-Type":"application/json",...t?.headers},body:JSON.stringify(e)}),Mn=e=>{let t=new URLSearchParams;Object.entries(e||{}).forEach(([p,n])=>{n!==void 0&&t.append(p,n===null?"null":n.toString());});let s=t.toString();return s.length>0?`/advance-invoices?${s}`:"/advance-invoices"},be=async(e,t)=>r(Mn(e),{...t,method:"GET"}),$n=()=>"/advance-invoices/custom",Ce=async(e,t)=>r($n(),{...t,method:"POST",headers:{"Content-Type":"application/json",...t?.headers},body:JSON.stringify(e)}),jn=(e,t)=>{let s=new URLSearchParams;Object.entries(t||{}).forEach(([n,a])=>{a!==void 0&&s.append(n,a===null?"null":a.toString());});let p=s.toString();return p.length>0?`/advance-invoices/${e}?${p}`:`/advance-invoices/${e}`},Fe=async(e,t,s)=>r(jn(e,t),{...s,method:"GET"}),Jn=e=>`/advance-invoices/${e}`,Ne=async(e,t,s)=>r(Jn(e),{...s,method:"PATCH",headers:{"Content-Type":"application/json",...s?.headers},body:JSON.stringify(t)}),Kn=e=>`/advance-invoices/${e}/versions`,Te=async(e,t)=>r(Kn(e),{...t,method:"GET"}),Yn=(e,t)=>`/advance-invoices/${e}/versions/${t}`,Ue=async(e,t,s)=>r(Yn(e,t),{...s,method:"GET"}),_n=e=>{let t=new URLSearchParams;Object.entries(e||{}).forEach(([p,n])=>{n!==void 0&&t.append(p,n===null?"null":n.toString());});let s=t.toString();return s.length>0?`/advance-invoices/render?${s}`:"/advance-invoices/render"},ke=async(e,t,s)=>r(_n(t),{...s,method:"POST",headers:{"Content-Type":"application/json",...s?.headers},body:JSON.stringify(e)}),Xn=e=>`/advance-invoices/${e}/void`,He=async(e,t,s)=>r(Xn(e),{...s,method:"POST",headers:{"Content-Type":"application/json",...s?.headers},body:JSON.stringify(t)});var x={getShareableAdvanceInvoice:o(Pe),getShareableAdvanceInvoiceHtml:o(Ae),getShareableAdvanceInvoicePdf:o(fe),create:o(De),list:i(be),createCustom:o(Ce),get:o(Fe),update:o(Ne),getVersions:o(Te),getVersion:o(Ue),renderAdvanceInvoicePreview:o(ke),void:o(He)};var Qn=e=>{let t=new URLSearchParams;Object.entries(e||{}).forEach(([p,n])=>{n!==void 0&&t.append(p,n===null?"null":n.toString());});let s=t.toString();return s.length>0?`/company-registry/search?${s}`:"/company-registry/search"},Oe=async(e,t)=>r(Qn(e),{...t,method:"GET"}),Zn=()=>"/company-registry/countries",Be=async e=>r(Zn(),{...e,method:"GET"});var h={searchCompanyRegistry:o(Oe),list:o(Be)};var ep=e=>`/credit-notes/shareable/${e}`,We=async(e,t)=>r(ep(e),{...t,method:"GET"}),tp=(e,t)=>{let s=new URLSearchParams;Object.entries(t||{}).forEach(([n,a])=>{a!==void 0&&s.append(n,a===null?"null":a.toString());});let p=s.toString();return p.length>0?`/credit-notes/shareable/${e}/html?${p}`:`/credit-notes/shareable/${e}/html`},Ge=async(e,t,s)=>r(tp(e,t),{...s,method:"GET"}),sp=(e,t)=>{let s=new URLSearchParams;Object.entries(t||{}).forEach(([n,a])=>{a!==void 0&&s.append(n,a===null?"null":a.toString());});let p=s.toString();return p.length>0?`/credit-notes/shareable/${e}/pdf?${p}`:`/credit-notes/shareable/${e}/pdf`},we=async(e,t,s)=>r(sp(e,t),{...s,method:"GET"}),rp=e=>`/credit-notes/shareable/${e}/eslog`,Ve=async(e,t)=>r(rp(e),{...t,method:"GET"}),op=()=>"/credit-notes",Le=async(e,t)=>r(op(),{...t,method:"POST",headers:{"Content-Type":"application/json",...t?.headers},body:JSON.stringify(e)}),np=e=>{let t=new URLSearchParams;Object.entries(e||{}).forEach(([p,n])=>{n!==void 0&&t.append(p,n===null?"null":n.toString());});let s=t.toString();return s.length>0?`/credit-notes?${s}`:"/credit-notes"},qe=async(e,t)=>r(np(e),{...t,method:"GET"}),pp=()=>"/credit-notes/custom",ze=async(e,t)=>r(pp(),{...t,method:"POST",headers:{"Content-Type":"application/json",...t?.headers},body:JSON.stringify(e)}),ap=(e,t)=>{let s=new URLSearchParams;Object.entries(t||{}).forEach(([n,a])=>{a!==void 0&&s.append(n,a===null?"null":a.toString());});let p=s.toString();return p.length>0?`/credit-notes/${e}?${p}`:`/credit-notes/${e}`},Me=async(e,t,s)=>r(ap(e,t),{...s,method:"GET"}),ip=e=>`/credit-notes/${e}`,$e=async(e,t,s)=>r(ip(e),{...s,method:"PATCH",headers:{"Content-Type":"application/json",...s?.headers},body:JSON.stringify(t)}),cp=e=>`/credit-notes/${e}/versions`,je=async(e,t)=>r(cp(e),{...t,method:"GET"}),dp=(e,t)=>`/credit-notes/${e}/versions/${t}`,Je=async(e,t,s)=>r(dp(e,t),{...s,method:"GET"}),up=e=>{let t=new URLSearchParams;Object.entries(e||{}).forEach(([p,n])=>{n!==void 0&&t.append(p,n===null?"null":n.toString());});let s=t.toString();return s.length>0?`/credit-notes/render?${s}`:"/credit-notes/render"},Ke=async(e,t,s)=>r(up(t),{...s,method:"POST",headers:{"Content-Type":"application/json",...s?.headers},body:JSON.stringify(e)}),Rp=e=>`/credit-notes/${e}/void`,Ye=async(e,t,s)=>r(Rp(e),{...s,method:"POST",headers:{"Content-Type":"application/json",...s?.headers},body:JSON.stringify(t)});var v={getShareableCreditNote:o(We),getShareableCreditNoteHtml:o(Ge),getShareableCreditNotePdf:o(we),getShareableCreditNoteEslog:o(Ve),create:o(Le),list:i(qe),createCustom:o(ze),get:o(Me),update:o($e),getVersions:o(je),getVersion:o(Je),renderCreditNotePreview:o(Ke),void:o(Ye)};var yp=()=>"/customers",_e=async(e,t)=>r(yp(),{...t,method:"POST",headers:{"Content-Type":"application/json",...t?.headers},body:JSON.stringify(e)}),mp=e=>{let t=new URLSearchParams;Object.entries(e||{}).forEach(([p,n])=>{n!==void 0&&t.append(p,n===null?"null":n.toString());});let s=t.toString();return s.length>0?`/customers?${s}`:"/customers"},Xe=async(e,t)=>r(mp(e),{...t,method:"GET"}),gp=e=>`/customers/${e}`,Qe=async(e,t)=>r(gp(e),{...t,method:"GET"}),lp=e=>`/customers/${e}`,Ze=async(e,t,s)=>r(lp(e),{...s,method:"PATCH",headers:{"Content-Type":"application/json",...s?.headers},body:JSON.stringify(t)}),Ep=e=>`/customers/${e}`,et=async(e,t)=>r(Ep(e),{...t,method:"DELETE"}),xp=e=>`/customers/${e}/restore`,tt=async(e,t)=>r(xp(e),{...t,method:"POST"}),hp=e=>`/customers/${e}/permanent`,st=async(e,t)=>r(hp(e),{...t,method:"DELETE"});var I={create:o(_e),list:i(Xe),get:o(Qe),update:o(Ze),delete:o(et),restoreCustomer:o(tt),permanentDeleteCustomer:o(st)};var vp=e=>`/delivery-notes/shareable/${e}`,rt=async(e,t)=>r(vp(e),{...t,method:"GET"}),Ip=(e,t)=>{let s=new URLSearchParams;Object.entries(t||{}).forEach(([n,a])=>{a!==void 0&&s.append(n,a===null?"null":a.toString());});let p=s.toString();return p.length>0?`/delivery-notes/shareable/${e}/html?${p}`:`/delivery-notes/shareable/${e}/html`},ot=async(e,t,s)=>r(Ip(e,t),{...s,method:"GET"}),Sp=(e,t)=>{let s=new URLSearchParams;Object.entries(t||{}).forEach(([n,a])=>{a!==void 0&&s.append(n,a===null?"null":a.toString());});let p=s.toString();return p.length>0?`/delivery-notes/shareable/${e}/pdf?${p}`:`/delivery-notes/shareable/${e}/pdf`},nt=async(e,t,s)=>r(Sp(e,t),{...s,method:"GET"}),Pp=()=>"/delivery-notes",pt=async(e,t)=>r(Pp(),{...t,method:"POST",headers:{"Content-Type":"application/json",...t?.headers},body:JSON.stringify(e)}),Ap=e=>{let t=new URLSearchParams;Object.entries(e||{}).forEach(([p,n])=>{n!==void 0&&t.append(p,n===null?"null":n.toString());});let s=t.toString();return s.length>0?`/delivery-notes?${s}`:"/delivery-notes"},at=async(e,t)=>r(Ap(e),{...t,method:"GET"}),fp=()=>"/delivery-notes/custom",it=async(e,t)=>r(fp(),{...t,method:"POST",headers:{"Content-Type":"application/json",...t?.headers},body:JSON.stringify(e)}),Dp=(e,t)=>{let s=new URLSearchParams;Object.entries(t||{}).forEach(([n,a])=>{a!==void 0&&s.append(n,a===null?"null":a.toString());});let p=s.toString();return p.length>0?`/delivery-notes/${e}?${p}`:`/delivery-notes/${e}`},ct=async(e,t,s)=>r(Dp(e,t),{...s,method:"GET"}),bp=e=>`/delivery-notes/${e}`,dt=async(e,t,s)=>r(bp(e),{...s,method:"PATCH",headers:{"Content-Type":"application/json",...s?.headers},body:JSON.stringify(t)}),Cp=e=>`/delivery-notes/${e}/versions`,ut=async(e,t)=>r(Cp(e),{...t,method:"GET"}),Fp=(e,t)=>`/delivery-notes/${e}/versions/${t}`,Rt=async(e,t,s)=>r(Fp(e,t),{...s,method:"GET"}),Np=e=>{let t=new URLSearchParams;Object.entries(e||{}).forEach(([p,n])=>{n!==void 0&&t.append(p,n===null?"null":n.toString());});let s=t.toString();return s.length>0?`/delivery-notes/render?${s}`:"/delivery-notes/render"},yt=async(e,t,s)=>r(Np(t),{...s,method:"POST",headers:{"Content-Type":"application/json",...s?.headers},body:JSON.stringify(e)}),Tp=e=>`/delivery-notes/${e}/void`,mt=async(e,t,s)=>r(Tp(e),{...s,method:"POST",headers:{"Content-Type":"application/json",...s?.headers},body:JSON.stringify(t)});var S={getShareableDeliveryNote:o(rt),getShareableDeliveryNoteHtml:o(ot),getShareableDeliveryNotePdf:o(nt),create:o(pt),list:i(at),createCustom:o(it),get:o(ct),update:o(dt),getVersions:o(ut),getVersion:o(Rt),renderDeliveryNotePreview:o(yt),void:o(mt)};var Up=e=>{let t=new URLSearchParams;Object.entries(e||{}).forEach(([p,n])=>{n!==void 0&&t.append(p,n===null?"null":n.toString());});let s=t.toString();return s.length>0?`/documents/next-number?${s}`:"/documents/next-number"},gt=async(e,t)=>r(Up(e),{...t,method:"GET"}),kp=e=>{let t=new URLSearchParams;Object.entries(e||{}).forEach(([p,n])=>{n!==void 0&&t.append(p,n===null?"null":n.toString());});let s=t.toString();return s.length>0?`/documents/calculate?${s}`:"/documents/calculate"},lt=async(e,t,s)=>r(kp(t),{...s,method:"POST",headers:{"Content-Type":"application/json",...s?.headers},body:JSON.stringify(e)}),Hp=(e,t)=>{let s=new URLSearchParams;Object.entries(t||{}).forEach(([n,a])=>{a!==void 0&&s.append(n,a===null?"null":a.toString());});let p=s.toString();return p.length>0?`/documents/${e}/finalize?${p}`:`/documents/${e}/finalize`},Et=async(e,t,s,p)=>r(Hp(e,s),{...p,method:"POST",headers:{"Content-Type":"application/json",...p?.headers},body:JSON.stringify(t)}),Op=(e,t)=>{let s=new URLSearchParams;Object.entries(t||{}).forEach(([n,a])=>{a!==void 0&&s.append(n,a===null?"null":a.toString());});let p=s.toString();return p.length>0?`/documents/${e}/fiscalize?${p}`:`/documents/${e}/fiscalize`},xt=async(e,t,s)=>r(Op(e,t),{...s,method:"POST"}),Bp=(e,t)=>{let s=new URLSearchParams;Object.entries(t||{}).forEach(([n,a])=>{a!==void 0&&s.append(n,a===null?"null":a.toString());});let p=s.toString();return p.length>0?`/documents/${e}?${p}`:`/documents/${e}`},ht=async(e,t,s)=>r(Bp(e,t),{...s,method:"DELETE"}),Wp=(e,t)=>{let s=new URLSearchParams;Object.entries(t||{}).forEach(([n,a])=>{a!==void 0&&s.append(n,a===null?"null":a.toString());});let p=s.toString();return p.length>0?`/documents/${e}/restore?${p}`:`/documents/${e}/restore`},vt=async(e,t,s)=>r(Wp(e,t),{...s,method:"POST"}),Gp=(e,t)=>{let s=new URLSearchParams;Object.entries(t||{}).forEach(([n,a])=>{a!==void 0&&s.append(n,a===null?"null":a.toString());});let p=s.toString();return p.length>0?`/documents/${e}/permanent?${p}`:`/documents/${e}/permanent`},It=async(e,t,s)=>r(Gp(e,t),{...s,method:"DELETE"}),wp=e=>`/documents/${e}/send`,St=async(e,t,s)=>r(wp(e),{...s,method:"POST",headers:{"Content-Type":"application/json",...s?.headers},body:JSON.stringify(t)}),Vp=e=>`/documents/${e}/share`,Pt=async(e,t)=>r(Vp(e),{...t,method:"POST"}),Lp=e=>`/documents/${e}/share`,At=async(e,t)=>r(Lp(e),{...t,method:"GET"}),qp=e=>`/documents/${e}/share`,ft=async(e,t)=>r(qp(e),{...t,method:"DELETE"});var P={getNextNumber:o(gt),calculateDocumentPreview:o(lt),finalizeDocument:o(Et),fiscalizeDocument:o(xt),delete:o(ht),restoreDocument:o(vt),permanentDeleteDocument:o(It),sendDocument:o(St),shareDocument:o(Pt),getShareableId:o(At),unshareDocument:o(ft)};var zp=()=>"/e-invoicing/settings",Dt=async e=>r(zp(),{...e,method:"GET"}),Mp=()=>"/e-invoicing/settings",bt=async(e,t)=>r(Mp(),{...t,method:"PATCH",headers:{"Content-Type":"application/json",...t?.headers},body:JSON.stringify(e)}),$p=()=>"/e-invoicing/supplier",Ct=async(e,t)=>r($p(),{...t,method:"POST",headers:{"Content-Type":"application/json",...t?.headers},body:JSON.stringify(e)}),jp=()=>"/e-invoicing/supplier",Ft=async e=>r(jp(),{...e,method:"GET"});var Jp=()=>"/e-invoicing/customer-search",Nt=async(e,t)=>r(Jp(),{...t,method:"POST",headers:{"Content-Type":"application/json",...t?.headers},body:JSON.stringify(e)}),Kp=()=>"/e-invoicing/send/:documentType/:documentId",Tt=async(e,t)=>r(Kp(),{...t,method:"POST",headers:{"Content-Type":"application/json",...t?.headers},body:JSON.stringify(e)}),Yp=e=>{let t=new URLSearchParams;Object.entries(e||{}).forEach(([p,n])=>{n!==void 0&&t.append(p,n===null?"null":n.toString());});let s=t.toString();return s.length>0?`/e-invoicing/submissions?${s}`:"/e-invoicing/submissions"},Ut=async(e,t)=>r(Yp(e),{...t,method:"GET"}),_p=()=>"/e-invoicing/submissions/:id",kt=async e=>r(_p(),{...e,method:"GET"}),Xp=()=>"/e-invoicing/submissions/:id/retry",Ht=async e=>r(Xp(),{...e,method:"POST"}),Qp=()=>"/e-invoicing/webhooks/flowin",Ot=async(e,t)=>r(Qp(),{...t,method:"POST",headers:{"Content-Type":"application/json",...t?.headers},body:JSON.stringify(e)});var A={list:o(Dt),update:o(bt),registerEInvoicingSupplier:o(Ct),getEInvoicingSupplier:o(Ft),searchEInvoicingCustomer:o(Nt),sendEInvoice:o(Tt),listEInvoicingSubmissions:o(Ut),getEInvoicingSubmission:o(kt),retryEInvoicingSubmission:o(Ht),handleFlowinWebhook:o(Ot)};var Zp=()=>"/email/send",Bt=async(e,t)=>r(Zp(),{...t,method:"POST",headers:{"Content-Type":"application/json",...t?.headers},body:JSON.stringify(e)});var f={sendEmail:o(Bt)};var ea=()=>"/entities",Wt=async(e,t)=>r(ea(),{...t,method:"POST",headers:{"Content-Type":"application/json",...t?.headers},body:JSON.stringify(e)}),ta=e=>{let t=new URLSearchParams;Object.entries(e||{}).forEach(([p,n])=>{n!==void 0&&t.append(p,n===null?"null":n.toString());});let s=t.toString();return s.length>0?`/entities?${s}`:"/entities"},Gt=async(e,t)=>r(ta(e),{...t,method:"GET"}),sa=e=>`/entities/${e}`,wt=async(e,t)=>r(sa(e),{...t,method:"GET"}),ra=e=>`/entities/${e}`,Vt=async(e,t,s)=>r(ra(e),{...s,method:"PUT",headers:{"Content-Type":"application/json",...s?.headers},body:JSON.stringify(t)}),oa=e=>`/entities/${e}/enable`,Lt=async(e,t)=>r(oa(e),{...t,method:"POST"}),na=e=>`/entities/${e}/disable`,qt=async(e,t)=>r(na(e),{...t,method:"POST"});var D={create:o(Wt),list:i(Gt),get:o(wt),update:o(Vt),enableEntity:o(Lt),disableEntity:o(qt)};var pa=()=>"/entities/api-keys",zt=async e=>r(pa(),{...e,method:"GET"}),aa=()=>"/entities/api-keys",Mt=async(e,t)=>r(aa(),{...t,method:"POST",headers:{"Content-Type":"application/json",...t?.headers},body:JSON.stringify(e)}),ia=e=>`/entities/api-keys/${e}`,$t=async(e,t)=>r(ia(e),{...t,method:"DELETE"});var b={listEntityApiKeys:o(zt),create:o(Mt),delete:o($t)};var ca=()=>"/entities/invitations",jt=async e=>r(ca(),{...e,method:"GET"}),da=e=>`/entities/invitations/${e}`,Jt=async(e,t)=>r(da(e),{...t,method:"GET"}),ua=e=>`/entities/invitations/${e}`,Kt=async(e,t)=>r(ua(e),{...t,method:"DELETE"}),Ra=e=>`/entities/invitations/${e}/resend`,Yt=async(e,t)=>r(Ra(e),{...t,method:"POST"}),ya=e=>{let t=new URLSearchParams;Object.entries(e||{}).forEach(([p,n])=>{n!==void 0&&t.append(p,n===null?"null":n.toString());});let s=t.toString();return s.length>0?`/invitations/accept?${s}`:"/invitations/accept"},_t=async(e,t,s)=>r(ya(t),{...s,method:"POST",headers:{"Content-Type":"application/json",...s?.headers},body:JSON.stringify(e)});var C={listEntityInvitations:o(jt),getEntityInvitation:o(Jt),cancelEntityInvitation:o(Kt),resendEntityInvitation:o(Yt),acceptEntityInvitation:o(_t)};var ma=()=>"/stats/query",Xt=async(e,t)=>r(ma(),{...t,method:"POST",headers:{"Content-Type":"application/json",...t?.headers},body:JSON.stringify(e)});var F={queryEntityStats:o(Xt)};var ga=()=>"/entities/users",Qt=async e=>r(ga(),{...e,method:"GET"}),la=()=>"/entities/users",Zt=async(e,t)=>r(la(),{...t,method:"POST",headers:{"Content-Type":"application/json",...t?.headers},body:JSON.stringify(e)}),Ea=e=>`/entities/users/${e}`,es=async(e,t,s)=>r(Ea(e),{...s,method:"PATCH",headers:{"Content-Type":"application/json",...s?.headers},body:JSON.stringify(t)}),xa=e=>`/entities/users/${e}`,ts=async(e,t)=>r(xa(e),{...t,method:"DELETE"}),ha=e=>`/entities/users/${e}/token`,ss=async(e,t)=>r(ha(e),{...t,method:"POST"});var N={list:o(Qt),addEntityUser:o(Zt),update:o(es),removeEntityUser:o(ts),generateEntityUserToken:o(ss)};var va=e=>`/estimates/shareable/${e}`,rs=async(e,t)=>r(va(e),{...t,method:"GET"}),Ia=(e,t)=>{let s=new URLSearchParams;Object.entries(t||{}).forEach(([n,a])=>{a!==void 0&&s.append(n,a===null?"null":a.toString());});let p=s.toString();return p.length>0?`/estimates/shareable/${e}/html?${p}`:`/estimates/shareable/${e}/html`},os=async(e,t,s)=>r(Ia(e,t),{...s,method:"GET"}),Sa=(e,t)=>{let s=new URLSearchParams;Object.entries(t||{}).forEach(([n,a])=>{a!==void 0&&s.append(n,a===null?"null":a.toString());});let p=s.toString();return p.length>0?`/estimates/shareable/${e}/pdf?${p}`:`/estimates/shareable/${e}/pdf`},ns=async(e,t,s)=>r(Sa(e,t),{...s,method:"GET"}),Pa=()=>"/estimates",ps=async(e,t)=>r(Pa(),{...t,method:"POST",headers:{"Content-Type":"application/json",...t?.headers},body:JSON.stringify(e)}),Aa=e=>{let t=new URLSearchParams;Object.entries(e||{}).forEach(([p,n])=>{n!==void 0&&t.append(p,n===null?"null":n.toString());});let s=t.toString();return s.length>0?`/estimates?${s}`:"/estimates"},as=async(e,t)=>r(Aa(e),{...t,method:"GET"}),fa=()=>"/estimates/custom",is=async(e,t)=>r(fa(),{...t,method:"POST",headers:{"Content-Type":"application/json",...t?.headers},body:JSON.stringify(e)}),Da=(e,t)=>{let s=new URLSearchParams;Object.entries(t||{}).forEach(([n,a])=>{a!==void 0&&s.append(n,a===null?"null":a.toString());});let p=s.toString();return p.length>0?`/estimates/${e}?${p}`:`/estimates/${e}`},cs=async(e,t,s)=>r(Da(e,t),{...s,method:"GET"}),ba=e=>`/estimates/${e}`,ds=async(e,t,s)=>r(ba(e),{...s,method:"PATCH",headers:{"Content-Type":"application/json",...s?.headers},body:JSON.stringify(t)}),Ca=e=>`/estimates/${e}/versions`,us=async(e,t)=>r(Ca(e),{...t,method:"GET"}),Fa=(e,t)=>`/estimates/${e}/versions/${t}`,Rs=async(e,t,s)=>r(Fa(e,t),{...s,method:"GET"}),Na=e=>{let t=new URLSearchParams;Object.entries(e||{}).forEach(([p,n])=>{n!==void 0&&t.append(p,n===null?"null":n.toString());});let s=t.toString();return s.length>0?`/estimates/render?${s}`:"/estimates/render"},ys=async(e,t,s)=>r(Na(t),{...s,method:"POST",headers:{"Content-Type":"application/json",...s?.headers},body:JSON.stringify(e)});var T={getShareableEstimate:o(rs),getShareableEstimateHtml:o(os),getShareableEstimatePdf:o(ns),create:o(ps),list:i(as),createCustom:o(is),get:o(cs),update:o(ds),getVersions:o(us),getVersion:o(Rs),renderEstimatePreview:o(ys)};var Ta=e=>{let t=new URLSearchParams;Object.entries(e||{}).forEach(([p,n])=>{n!==void 0&&t.append(p,n===null?"null":n.toString());});let s=t.toString();return s.length>0?`/documents/export?${s}`:"/documents/export"},ms=async(e,t)=>r(Ta(e),{...t,method:"GET"}),Ua=e=>{let t=new URLSearchParams;Object.entries(e||{}).forEach(([p,n])=>{n!==void 0&&t.append(p,n===null?"null":n.toString());});let s=t.toString();return s.length>0?`/documents/export/sales-per-item?${s}`:"/documents/export/sales-per-item"},gs=async(e,t)=>r(Ua(e),{...t,method:"GET"}),ka=()=>"/documents/export/pdf",ls=async(e,t)=>r(ka(),{...t,method:"POST",headers:{"Content-Type":"application/json",...t?.headers},body:JSON.stringify(e)}),Ha=e=>`/documents/export/pdf/${e}`,Es=async(e,t)=>r(Ha(e),{...t,method:"GET"}),Oa=e=>`/documents/export/pdf/${e}/download`,xs=async(e,t)=>r(Oa(e),{...t,method:"GET"}),Ba=()=>"/documents/export/eslog",hs=async(e,t)=>r(Ba(),{...t,method:"POST",headers:{"Content-Type":"application/json",...t?.headers},body:JSON.stringify(e)});var Wa=e=>`/documents/export/eslog/${e}/download`,vs=async(e,t)=>r(Wa(e),{...t,method:"GET"});var U={exportDocuments:o(ms),exportSalesPerItem:o(gs),startPdfExport:o(ls),list:i(Es),downloadPdfExport:o(xs),startEslogExport:o(hs),downloadEslogExport:o(vs)};var Ga=()=>"/files",Is=async(e,t)=>{let s=new FormData;return e.file!==void 0&&s.append("file",e.file),s.append("category",e.category),e.account_payable_id!==void 0&&s.append("account_payable_id",e.account_payable_id),e.incoming_purchase_document_id!==void 0&&s.append("incoming_purchase_document_id",e.incoming_purchase_document_id),r(Ga(),{...t,method:"POST",body:s})},wa=e=>{let t=new URLSearchParams;Object.entries(e||{}).forEach(([p,n])=>{n!==void 0&&t.append(p,n===null?"null":n.toString());});let s=t.toString();return s.length>0?`/files?${s}`:"/files"},Ss=async(e,t)=>r(wa(e),{...t,method:"GET"}),Va=e=>`/files/${e}`,Ps=async(e,t)=>r(Va(e),{...t,method:"GET"}),La=e=>`/files/${e}`,As=async(e,t)=>r(La(e),{...t,method:"DELETE"});var k={uploadFile:o(Is),list:i(Ss),get:o(Ps),delete:o(As)};var qa=()=>"/fiscalization/fina/settings/certificate",fs=async(e,t)=>{let s=new FormData;return e.file!==void 0&&s.append("file",e.file),e.passphrase!==void 0&&s.append("passphrase",e.passphrase),r(qa(),{...t,method:"POST",body:s})},za=()=>"/fiscalization/fina/settings/certificate",Ds=async e=>r(za(),{...e,method:"GET"}),Ma=()=>"/fiscalization/fina/settings/certificate",bs=async e=>r(Ma(),{...e,method:"DELETE"});var H={uploadFinaCertificate:o(fs),getFinaCertificate:o(Ds),delete:o(bs)};var $a=e=>`/fiscalization/fina/premises/${e}/devices`,Cs=async(e,t)=>r($a(e),{...t,method:"GET"}),ja=e=>`/fiscalization/fina/premises/${e}/devices`,Fs=async(e,t,s)=>r(ja(e),{...s,method:"POST",headers:{"Content-Type":"application/json",...s?.headers},body:JSON.stringify(t)}),Ja=e=>`/fiscalization/fina/devices/${e}`,Ns=async(e,t)=>r(Ja(e),{...t,method:"GET"}),Ka=e=>`/fiscalization/fina/devices/${e}`,Ts=async(e,t)=>r(Ka(e),{...t,method:"DELETE"});var O={listFinaDevices:o(Cs),registerFinaDevice:o(Fs),getFinaDevice:o(Ns),delete:o(Ts)};var Ya=()=>"/fiscalization/fina/premises",Us=async e=>r(Ya(),{...e,method:"GET"}),_a=()=>"/fiscalization/fina/premises",ks=async(e,t)=>r(_a(),{...t,method:"POST",headers:{"Content-Type":"application/json",...t?.headers},body:JSON.stringify(e)}),Xa=e=>`/fiscalization/fina/premises/${e}`,Hs=async(e,t)=>r(Xa(e),{...t,method:"GET"}),Qa=e=>`/fiscalization/fina/premises/${e}`,Os=async(e,t)=>r(Qa(e),{...t,method:"DELETE"});var B={listFinaPremises:o(Us),create:o(ks),getFinaPremise:o(Hs),delete:o(Os)};var Za=()=>"/fiscalization/fina/settings",Bs=async e=>r(Za(),{...e,method:"GET"}),ei=()=>"/fiscalization/fina/settings",Ws=async(e,t)=>r(ei(),{...t,method:"PUT",headers:{"Content-Type":"application/json",...t?.headers},body:JSON.stringify(e)});var W={list:o(Bs),update:o(Ws)};var ti=()=>"/fiscalization/furs/settings/certificate",Gs=async(e,t)=>{let s=new FormData;return e.file!==void 0&&s.append("file",e.file),e.passphrase!==void 0&&s.append("passphrase",e.passphrase),r(ti(),{...t,method:"POST",body:s})},si=()=>"/fiscalization/furs/settings/certificate",ws=async e=>r(si(),{...e,method:"GET"}),ri=()=>"/fiscalization/furs/settings/certificate",Vs=async e=>r(ri(),{...e,method:"DELETE"});var G={uploadFursCertificate:o(Gs),getFursCertificate:o(ws),delete:o(Vs)};var oi=e=>`/fiscalization/furs/premises/${e}/devices`,Ls=async(e,t)=>r(oi(e),{...t,method:"GET"}),ni=e=>`/fiscalization/furs/premises/${e}/devices`,qs=async(e,t,s)=>r(ni(e),{...s,method:"POST",headers:{"Content-Type":"application/json",...s?.headers},body:JSON.stringify(t)}),pi=e=>`/fiscalization/furs/devices/${e}`,zs=async(e,t)=>r(pi(e),{...t,method:"GET"});var w={listFursElectronicDevices:o(Ls),registerFursElectronicDevice:o(qs),getFursElectronicDevice:o(zs)};var ai=()=>"/fiscalization/furs/internal-act/report.pdf",Ms=async e=>r(ai(),{...e,method:"GET"}),ii=()=>"/fiscalization/furs/internal-act/report.docx",$s=async e=>r(ii(),{...e,method:"GET"});var V={generateFursInternalActPdf:o(Ms),generateFursInternalActDocx:o($s)};var ci=()=>"/fiscalization/furs/premises",js=async e=>r(ci(),{...e,method:"GET"}),di=e=>`/fiscalization/furs/premises/${e}`,Js=async(e,t)=>r(di(e),{...t,method:"GET"}),ui=()=>"/fiscalization/furs/premises/real-estate",Ks=async(e,t)=>r(ui(),{...t,method:"POST",headers:{"Content-Type":"application/json",...t?.headers},body:JSON.stringify(e)}),Ri=()=>"/fiscalization/furs/premises/movable",Ys=async(e,t)=>r(Ri(),{...t,method:"POST",headers:{"Content-Type":"application/json",...t?.headers},body:JSON.stringify(e)}),yi=e=>`/fiscalization/furs/premises/${e}/close`,_s=async(e,t)=>r(yi(e),{...t,method:"POST"});var L={listFursBusinessPremises:o(js),getFursBusinessPremise:o(Js),registerFursRealEstatePremise:o(Ks),registerFursMovablePremise:o(Ys),closeFursBusinessPremise:o(_s)};var mi=()=>"/fiscalization/furs/settings",Xs=async e=>r(mi(),{...e,method:"GET"}),gi=()=>"/fiscalization/furs/settings",Qs=async(e,t)=>r(gi(),{...t,method:"PUT",headers:{"Content-Type":"application/json",...t?.headers},body:JSON.stringify(e)});var q={list:o(Xs),update:o(Qs)};var li=()=>"/health/live",Zs=async e=>r(li(),{...e,method:"GET"}),Ei=()=>"/health/ready",er=async e=>r(Ei(),{...e,method:"GET"}),xi=()=>"/health",tr=async e=>r(xi(),{...e,method:"GET"});var z={livenessCheck:o(Zs),readinessCheck:o(er),healthCheck:o(tr)};var hi=()=>"/incoming-purchase-documents",sr=async(e,t)=>r(hi(),{...t,method:"POST",headers:{"Content-Type":"application/json",...t?.headers},body:JSON.stringify(e)}),vi=e=>{let t=new URLSearchParams;Object.entries(e||{}).forEach(([p,n])=>{n!==void 0&&t.append(p,n===null?"null":n.toString());});let s=t.toString();return s.length>0?`/incoming-purchase-documents?${s}`:"/incoming-purchase-documents"},rr=async(e,t)=>r(vi(e),{...t,method:"GET"}),Ii=()=>"/incoming-purchase-documents/custom",or=async(e,t)=>r(Ii(),{...t,method:"POST",headers:{"Content-Type":"application/json",...t?.headers},body:JSON.stringify(e)}),Si=e=>`/incoming-purchase-documents/${e}`,nr=async(e,t)=>r(Si(e),{...t,method:"GET"}),Pi=e=>`/incoming-purchase-documents/${e}`,pr=async(e,t,s)=>r(Pi(e),{...s,method:"PATCH",headers:{"Content-Type":"application/json",...s?.headers},body:JSON.stringify(t)}),Ai=e=>`/incoming-purchase-documents/${e}/attachments`,ar=async(e,t,s)=>{let p=new FormData;return t.file!==void 0&&p.append("file",t.file),r(Ai(e),{...s,method:"POST",body:p})};var fi=(e,t)=>`/incoming-purchase-documents/${e}/attachments/${t}`,ir=async(e,t,s)=>r(fi(e,t),{...s,method:"DELETE"});var M={create:o(sr),list:i(rr),createCustom:o(or),get:o(nr),update:o(pr),uploadIncomingPurchaseDocumentAttachment:o(ar),delete:o(ir)};var Di=e=>`/invoices/shareable/${e}`,cr=async(e,t)=>r(Di(e),{...t,method:"GET"}),bi=(e,t)=>{let s=new URLSearchParams;Object.entries(t||{}).forEach(([n,a])=>{a!==void 0&&s.append(n,a===null?"null":a.toString());});let p=s.toString();return p.length>0?`/invoices/shareable/${e}/html?${p}`:`/invoices/shareable/${e}/html`},dr=async(e,t,s)=>r(bi(e,t),{...s,method:"GET"}),Ci=(e,t)=>{let s=new URLSearchParams;Object.entries(t||{}).forEach(([n,a])=>{a!==void 0&&s.append(n,a===null?"null":a.toString());});let p=s.toString();return p.length>0?`/invoices/shareable/${e}/pdf?${p}`:`/invoices/shareable/${e}/pdf`},ur=async(e,t,s)=>r(Ci(e,t),{...s,method:"GET"}),Fi=e=>`/invoices/shareable/${e}/eslog`,Rr=async(e,t)=>r(Fi(e),{...t,method:"GET"}),Ni=()=>"/invoices",yr=async(e,t)=>r(Ni(),{...t,method:"POST",headers:{"Content-Type":"application/json",...t?.headers},body:JSON.stringify(e)}),Ti=e=>{let t=new URLSearchParams;Object.entries(e||{}).forEach(([p,n])=>{n!==void 0&&t.append(p,n===null?"null":n.toString());});let s=t.toString();return s.length>0?`/invoices?${s}`:"/invoices"},mr=async(e,t)=>r(Ti(e),{...t,method:"GET"}),Ui=()=>"/invoices/custom",gr=async(e,t)=>r(Ui(),{...t,method:"POST",headers:{"Content-Type":"application/json",...t?.headers},body:JSON.stringify(e)}),ki=(e,t)=>{let s=new URLSearchParams;Object.entries(t||{}).forEach(([n,a])=>{a!==void 0&&s.append(n,a===null?"null":a.toString());});let p=s.toString();return p.length>0?`/invoices/${e}?${p}`:`/invoices/${e}`},lr=async(e,t,s)=>r(ki(e,t),{...s,method:"GET"}),Hi=e=>`/invoices/${e}`,Er=async(e,t,s)=>r(Hi(e),{...s,method:"PATCH",headers:{"Content-Type":"application/json",...s?.headers},body:JSON.stringify(t)}),Oi=e=>`/invoices/${e}/versions`,xr=async(e,t)=>r(Oi(e),{...t,method:"GET"}),Bi=(e,t)=>`/invoices/${e}/versions/${t}`,hr=async(e,t,s)=>r(Bi(e,t),{...s,method:"GET"}),Wi=e=>{let t=new URLSearchParams;Object.entries(e||{}).forEach(([p,n])=>{n!==void 0&&t.append(p,n===null?"null":n.toString());});let s=t.toString();return s.length>0?`/invoices/render?${s}`:"/invoices/render"},vr=async(e,t,s)=>r(Wi(t),{...s,method:"POST",headers:{"Content-Type":"application/json",...s?.headers},body:JSON.stringify(e)}),Gi=e=>`/invoices/${e}/void`,Ir=async(e,t,s)=>r(Gi(e),{...s,method:"POST",headers:{"Content-Type":"application/json",...s?.headers},body:JSON.stringify(t)}),wi=e=>`/invoices/${e}/fiscalize`,Sr=async(e,t)=>r(wi(e),{...t,method:"POST"}),Vi=(e,t)=>{let s=new URLSearchParams;Object.entries(t||{}).forEach(([n,a])=>{a!==void 0&&s.append(n,a===null?"null":a.toString());});let p=s.toString();return p.length>0?`/documents/${e}/html?${p}`:`/documents/${e}/html`},Pr=async(e,t,s)=>r(Vi(e,t),{...s,method:"GET"}),Li=(e,t)=>{let s=new URLSearchParams;Object.entries(t||{}).forEach(([n,a])=>{a!==void 0&&s.append(n,a===null?"null":a.toString());});let p=s.toString();return p.length>0?`/documents/${e}/pdf?${p}`:`/documents/${e}/pdf`},Ar=async(e,t,s)=>r(Li(e,t),{...s,method:"GET"});function fr(e,t){let s=URL.createObjectURL(e),p=document.createElement("a");p.href=s,p.download=t,document.body.appendChild(p),p.click(),document.body.removeChild(p),URL.revokeObjectURL(s);}var Dr=o(Ar),$={getShareableInvoice:o(cr),getShareableInvoiceHtml:o(dr),getShareableInvoicePdf:o(ur),getShareableInvoiceEslog:o(Rr),create:o(yr),list:i(mr),createCustom:o(gr),get:o(lr),update:o(Er),getVersions:o(xr),getVersion:o(hr),renderInvoicePreview:o(vr),void:o(Ir),fiscalizeInvoice:o(Sr),renderHtml:o(Pr),renderPdf:Dr,async downloadPdf(e,t,s,p){let n=await Dr(e,s,p);fr(n,t);}};var qi=()=>"/items",br=async(e,t)=>r(qi(),{...t,method:"POST",headers:{"Content-Type":"application/json",...t?.headers},body:JSON.stringify(e)}),zi=e=>{let t=new URLSearchParams;Object.entries(e||{}).forEach(([p,n])=>{n!==void 0&&t.append(p,n===null?"null":n.toString());});let s=t.toString();return s.length>0?`/items?${s}`:"/items"},Cr=async(e,t)=>r(zi(e),{...t,method:"GET"}),Mi=e=>`/items/${e}`,Fr=async(e,t,s)=>r(Mi(e),{...s,method:"PATCH",headers:{"Content-Type":"application/json",...s?.headers},body:JSON.stringify(t)}),$i=e=>`/items/${e}`,Nr=async(e,t)=>r($i(e),{...t,method:"DELETE"}),ji=e=>`/items/${e}/restore`,Tr=async(e,t)=>r(ji(e),{...t,method:"POST"}),Ji=e=>`/items/${e}/permanent`,Ur=async(e,t)=>r(Ji(e),{...t,method:"DELETE"});var j={create:o(br),list:i(Cr),update:o(Fr),delete:o(Nr),restoreItem:o(Tr),permanentDeleteItem:o(Ur)};var Ki=()=>"/legacy-migration/auth",kr=async(e,t)=>r(Ki(),{...t,method:"POST",headers:{"Content-Type":"application/json",...t?.headers},body:JSON.stringify(e)}),Yi=()=>"/legacy-migration/jobs",Hr=async(e,t)=>r(Yi(),{...t,method:"POST",headers:{"Content-Type":"application/json",...t?.headers},body:JSON.stringify(e)}),_i=()=>"/legacy-migration/jobs",Or=async e=>r(_i(),{...e,method:"GET"}),Xi=e=>`/legacy-migration/jobs/${e}`,Br=async(e,t)=>r(Xi(e),{...t,method:"GET"});var J={legacyMigrationAuth:o(kr),create:o(Hr),listMigrationJobs:o(Or),getMigrationJob:o(Br)};var Qi=()=>"/locale/detect",Wr=async e=>r(Qi(),{...e,method:"GET"});var K={detectLocale:o(Wr)};var Zi=()=>"/order-integrations/shopify/authorize",Gr=async(e,t)=>r(Zi(),{...t,method:"POST",headers:{"Content-Type":"application/json",...t?.headers},body:JSON.stringify(e)}),ec=e=>`/order-integrations/${e}/sync-shopify`,wr=async(e,t,s)=>r(ec(e),{...s,method:"POST",headers:{"Content-Type":"application/json",...s?.headers},body:JSON.stringify(t)}),tc=()=>"/order-integrations",Vr=async(e,t)=>r(tc(),{...t,method:"POST",headers:{"Content-Type":"application/json",...t?.headers},body:JSON.stringify(e)}),sc=e=>{let t=new URLSearchParams;Object.entries(e||{}).forEach(([p,n])=>{n!==void 0&&t.append(p,n===null?"null":n.toString());});let s=t.toString();return s.length>0?`/order-integrations?${s}`:"/order-integrations"},Lr=async(e,t)=>r(sc(e),{...t,method:"GET"}),rc=e=>`/order-integrations/${e}`,qr=async(e,t)=>r(rc(e),{...t,method:"GET"}),oc=e=>`/order-integrations/${e}`,zr=async(e,t,s)=>r(oc(e),{...s,method:"PATCH",headers:{"Content-Type":"application/json",...s?.headers},body:JSON.stringify(t)}),nc=e=>`/order-integrations/${e}`,Mr=async(e,t)=>r(nc(e),{...t,method:"DELETE"});var Y={authorizeShopify:o(Gr),syncShopifyOrders:o(wr),create:o(Vr),list:i(Lr),get:o(qr),update:o(zr),delete:o(Mr)};var pc=()=>"/orders",$r=async(e,t)=>r(pc(),{...t,method:"POST",headers:{"Content-Type":"application/json",...t?.headers},body:JSON.stringify(e)}),ac=e=>{let t=new URLSearchParams;Object.entries(e||{}).forEach(([p,n])=>{n!==void 0&&t.append(p,n===null?"null":n.toString());});let s=t.toString();return s.length>0?`/orders?${s}`:"/orders"},jr=async(e,t)=>r(ac(e),{...t,method:"GET"}),ic=e=>`/orders/${e}`,Jr=async(e,t)=>r(ic(e),{...t,method:"GET"}),cc=e=>`/orders/${e}`,Kr=async(e,t,s)=>r(cc(e),{...s,method:"PATCH",headers:{"Content-Type":"application/json",...s?.headers},body:JSON.stringify(t)}),dc=e=>`/orders/${e}`,Yr=async(e,t)=>r(dc(e),{...t,method:"DELETE"}),uc=e=>`/orders/${e}/process`,_r=async(e,t)=>r(uc(e),{...t,method:"POST"}),Rc=e=>`/orders/${e}/cancel`,Xr=async(e,t)=>r(Rc(e),{...t,method:"POST"}),yc=e=>`/orders/${e}/reissue`,Qr=async(e,t)=>r(yc(e),{...t,method:"POST"});var _={create:o($r),list:i(jr),get:o(Jr),update:o(Kr),delete:o(Yr),processOrder:o(_r),cancelOrder:o(Xr),reissueOrder:o(Qr)};var mc=()=>"/payments",Zr=async(e,t)=>r(mc(),{...t,method:"POST",headers:{"Content-Type":"application/json",...t?.headers},body:JSON.stringify(e)}),gc=e=>{let t=new URLSearchParams;Object.entries(e||{}).forEach(([p,n])=>{n!==void 0&&t.append(p,n===null?"null":n.toString());});let s=t.toString();return s.length>0?`/payments?${s}`:"/payments"},eo=async(e,t)=>r(gc(e),{...t,method:"GET"}),lc=(e,t)=>{let s=new URLSearchParams;Object.entries(t||{}).forEach(([n,a])=>{a!==void 0&&s.append(n,a===null?"null":a.toString());});let p=s.toString();return p.length>0?`/payments/${e}?${p}`:`/payments/${e}`},to=async(e,t,s)=>r(lc(e,t),{...s,method:"GET"}),Ec=e=>`/payments/${e}`,so=async(e,t,s)=>r(Ec(e),{...s,method:"PATCH",headers:{"Content-Type":"application/json",...s?.headers},body:JSON.stringify(t)}),xc=e=>`/payments/${e}`,ro=async(e,t)=>r(xc(e),{...t,method:"DELETE"}),hc=e=>`/payments/${e}/restore`,oo=async(e,t)=>r(hc(e),{...t,method:"POST"}),vc=e=>`/payments/${e}/permanent`,no=async(e,t)=>r(vc(e),{...t,method:"DELETE"});var X={create:o(Zr),list:i(eo),get:o(to),update:o(so),delete:o(ro),restorePayment:o(oo),permanentDeletePayment:o(no)};var Ic=()=>"/fiscalization/pt/atcud-series",po=async(e,t)=>r(Ic(),{...t,method:"POST",headers:{"Content-Type":"application/json",...t?.headers},body:JSON.stringify(e)}),Sc=e=>{let t=new URLSearchParams;Object.entries(e||{}).forEach(([p,n])=>{n!==void 0&&t.append(p,n===null?"null":n.toString());});let s=t.toString();return s.length>0?`/fiscalization/pt/atcud-series?${s}`:"/fiscalization/pt/atcud-series"},ao=async(e,t)=>r(Sc(e),{...t,method:"GET"}),Pc=e=>`/fiscalization/pt/atcud-series/${e}`,io=async(e,t)=>r(Pc(e),{...t,method:"GET"}),Ac=e=>{let t=new URLSearchParams;Object.entries(e||{}).forEach(([p,n])=>{n!==void 0&&t.append(p,n===null?"null":n.toString());});let s=t.toString();return s.length>0?`/fiscalization/pt/atcud-series/active?${s}`:"/fiscalization/pt/atcud-series/active"},co=async(e,t)=>r(Ac(e),{...t,method:"POST"});var Q={create:o(po),list:i(ao),get:o(io),getActive:o(co)};var fc=e=>{let t=new URLSearchParams;Object.entries(e||{}).forEach(([p,n])=>{n!==void 0&&t.append(p,n===null?"null":n.toString());});let s=t.toString();return s.length>0?`/fiscalization/pt/saft/report?${s}`:"/fiscalization/pt/saft/report"},uo=async(e,t)=>r(fc(e),{...t,method:"GET"});var Z={generateReport:o(uo)};var Dc=()=>"/recurring-invoices",Ro=async(e,t)=>r(Dc(),{...t,method:"POST",headers:{"Content-Type":"application/json",...t?.headers},body:JSON.stringify(e)}),bc=e=>{let t=new URLSearchParams;Object.entries(e||{}).forEach(([p,n])=>{n!==void 0&&t.append(p,n===null?"null":n.toString());});let s=t.toString();return s.length>0?`/recurring-invoices?${s}`:"/recurring-invoices"},yo=async(e,t)=>r(bc(e),{...t,method:"GET"}),Cc=e=>`/recurring-invoices/${e}`,mo=async(e,t)=>r(Cc(e),{...t,method:"GET"}),Fc=e=>`/recurring-invoices/${e}`,go=async(e,t,s)=>r(Fc(e),{...s,method:"PATCH",headers:{"Content-Type":"application/json",...s?.headers},body:JSON.stringify(t)}),Nc=e=>`/recurring-invoices/${e}`,lo=async(e,t)=>r(Nc(e),{...t,method:"DELETE"}),Tc=e=>`/recurring-invoices/${e}/restore`,Eo=async(e,t)=>r(Tc(e),{...t,method:"POST"}),Uc=e=>`/recurring-invoices/${e}/permanent`,xo=async(e,t)=>r(Uc(e),{...t,method:"DELETE"}),kc=e=>`/recurring-invoices/${e}/pause`,ho=async(e,t)=>r(kc(e),{...t,method:"POST"}),Hc=e=>`/recurring-invoices/${e}/resume`,vo=async(e,t)=>r(Hc(e),{...t,method:"POST"}),Oc=e=>`/recurring-invoices/${e}/trigger`,Io=async(e,t)=>r(Oc(e),{...t,method:"POST"});var ee={create:o(Ro),list:i(yo),get:o(mo),update:o(go),delete:o(lo),restoreRecurringInvoice:o(Eo),permanentDeleteRecurringInvoice:o(xo),pauseRecurringInvoice:o(ho),resumeRecurringInvoice:o(vo),triggerRecurringInvoice:o(Io)};var Bc=()=>"/stripe-app/authorize",So=async e=>r(Bc(),{...e,method:"GET"}),Wc=e=>{let t=new URLSearchParams;Object.entries(e||{}).forEach(([p,n])=>{n!==void 0&&t.append(p,n===null?"null":n.toString());});let s=t.toString();return s.length>0?`/stripe-app/oauth/callback?${s}`:"/stripe-app/oauth/callback"},Po=async(e,t)=>r(Wc(e),{...t,method:"GET"}),Gc=()=>"/stripe-app/webhooks",Ao=async e=>r(Gc(),{...e,method:"POST"}),wc=()=>"/stripe-app/marketplace-authorize",fo=async(e,t)=>r(wc(),{...t,method:"POST",headers:{"Content-Type":"application/json",...t?.headers},body:JSON.stringify(e)}),Vc=()=>"/stripe-app/connect",Do=async(e,t)=>r(Vc(),{...t,method:"POST",headers:{"Content-Type":"application/json",...t?.headers},body:JSON.stringify(e)}),Lc=()=>"/stripe-app/connection",bo=async e=>r(Lc(),{...e,method:"GET"}),qc=()=>"/stripe-app/connection",Co=async e=>r(qc(),{...e,method:"DELETE"}),zc=()=>"/stripe-app/settings",Fo=async e=>r(zc(),{...e,method:"GET"}),Mc=()=>"/stripe-app/settings",No=async(e,t)=>r(Mc(),{...t,method:"PATCH",headers:{"Content-Type":"application/json",...t?.headers},body:JSON.stringify(e)}),$c=()=>"/stripe-app/invoices",To=async(e,t)=>r($c(),{...t,method:"POST",headers:{"Content-Type":"application/json",...t?.headers},body:JSON.stringify(e)}),jc=e=>{let t=new URLSearchParams;Object.entries(e||{}).forEach(([p,n])=>{n!==void 0&&t.append(p,n===null?"null":n.toString());});let s=t.toString();return s.length>0?`/stripe-app/invoices?${s}`:"/stripe-app/invoices"},Uo=async(e,t)=>r(jc(e),{...t,method:"GET"}),Jc=e=>{let t=new URLSearchParams;Object.entries(e||{}).forEach(([p,n])=>{n!==void 0&&t.append(p,n===null?"null":n.toString());});let s=t.toString();return s.length>0?`/stripe-app/invoices/lookup?${s}`:"/stripe-app/invoices/lookup"},ko=async(e,t)=>r(Jc(e),{...t,method:"GET"}),Kc=e=>`/stripe-app/invoices/${e}`,Ho=async(e,t)=>r(Kc(e),{...t,method:"GET"}),Yc=()=>"/stripe-app/entity-connection",Oo=async e=>r(Yc(),{...e,method:"GET"}),_c=()=>"/stripe-app/entity-connection",Bo=async e=>r(_c(),{...e,method:"DELETE"}),Xc=()=>"/stripe-app/entity-settings",Wo=async e=>r(Xc(),{...e,method:"GET"}),Qc=()=>"/stripe-app/entity-settings",Go=async(e,t)=>r(Qc(),{...t,method:"PATCH",headers:{"Content-Type":"application/json",...t?.headers},body:JSON.stringify(e)});var te={stripeAppAuthorize:o(So),stripeAppOAuthCallback:o(Po),stripeAppWebhook:o(Ao),stripeAppMarketplaceAuthorize:o(fo),stripeAppConnect:o(Do),stripeAppGetConnection:o(bo),stripeAppDisconnect:o(Co),stripeAppGetSettings:o(Fo),stripeAppUpdateSettings:o(No),stripeAppCreateInvoice:o(To),stripeAppListInvoices:o(Uo),stripeAppLookupInvoice:o(ko),stripeAppGetInvoice:o(Ho),stripeAppEntityGetConnection:o(Oo),stripeAppEntityDisconnect:o(Bo),stripeAppEntityGetSettings:o(Wo),stripeAppEntityUpdateSettings:o(Go)};var Zc=()=>"/suppliers",wo=async(e,t)=>r(Zc(),{...t,method:"POST",headers:{"Content-Type":"application/json",...t?.headers},body:JSON.stringify(e)}),ed=e=>{let t=new URLSearchParams;Object.entries(e||{}).forEach(([p,n])=>{n!==void 0&&t.append(p,n===null?"null":n.toString());});let s=t.toString();return s.length>0?`/suppliers?${s}`:"/suppliers"},Vo=async(e,t)=>r(ed(e),{...t,method:"GET"}),td=e=>`/suppliers/${e}`,Lo=async(e,t)=>r(td(e),{...t,method:"GET"}),sd=e=>`/suppliers/${e}`,qo=async(e,t,s)=>r(sd(e),{...s,method:"PATCH",headers:{"Content-Type":"application/json",...s?.headers},body:JSON.stringify(t)});var se={create:o(wo),list:i(Vo),get:o(Lo),update:o(qo)};var rd=e=>{let t=new URLSearchParams;Object.entries(e||{}).forEach(([p,n])=>{n!==void 0&&t.append(p,n===null?"null":n.toString());});let s=t.toString();return s.length>0?`/tax-reports/kir?${s}`:"/tax-reports/kir"},zo=async(e,t)=>r(rd(e),{...t,method:"POST"}),od=()=>"/tax-reports/si/profile",Mo=async e=>r(od(),{...e,method:"GET"}),nd=()=>"/tax-reports/si/profile",$o=async(e,t)=>r(nd(),{...t,method:"PUT",headers:{"Content-Type":"application/json",...t?.headers},body:JSON.stringify(e)}),pd=()=>"/tax-reports/si/yearly/normirani/review",jo=async(e,t)=>r(pd(),{...t,method:"POST",headers:{"Content-Type":"application/json",...t?.headers},body:JSON.stringify(e)}),ad=()=>"/tax-reports/si/yearly/normirani/export",Jo=async(e,t)=>r(ad(),{...t,method:"POST",headers:{"Content-Type":"application/json",...t?.headers},body:JSON.stringify(e)}),id=()=>"/tax-reports/si/accounting/vod/export",Ko=async(e,t)=>r(id(),{...t,method:"POST",headers:{"Content-Type":"application/json",...t?.headers},body:JSON.stringify(e)});var re={generateKirExport:o(zo),getSloveniaTaxProfile:o(Mo),updateSloveniaTaxProfile:o($o),reviewSloveniaYearlyNormiraniReport:o(jo),exportSloveniaYearlyNormiraniReport:o(Jo),exportSloveniaVodXml:o(Ko)};var cd=()=>"/taxes",Yo=async(e,t)=>r(cd(),{...t,method:"POST",headers:{"Content-Type":"application/json",...t?.headers},body:JSON.stringify(e)}),dd=e=>{let t=new URLSearchParams;Object.entries(e||{}).forEach(([p,n])=>{n!==void 0&&t.append(p,n===null?"null":n.toString());});let s=t.toString();return s.length>0?`/taxes?${s}`:"/taxes"},_o=async(e,t)=>r(dd(e),{...t,method:"GET"}),ud=e=>`/taxes/${e}`,Xo=async(e,t,s)=>r(ud(e),{...s,method:"PATCH",headers:{"Content-Type":"application/json",...s?.headers},body:JSON.stringify(t)}),Rd=e=>`/taxes/${e}`,Qo=async(e,t,s)=>r(Rd(e),{...s,method:"PUT",headers:{"Content-Type":"application/json",...s?.headers},body:JSON.stringify(t)}),yd=e=>`/taxes/${e}`,Zo=async(e,t)=>r(yd(e),{...t,method:"DELETE"}),md=e=>`/taxes/${e}/restore`,en=async(e,t)=>r(md(e),{...t,method:"POST"}),gd=e=>`/taxes/${e}/permanent`,tn=async(e,t)=>r(gd(e),{...t,method:"DELETE"});var oe={create:o(Yo),list:i(_o),update:o(Xo),replaceTax:o(Qo),delete:o(Zo),restoreTax:o(en),permanentDeleteTax:o(tn)};var ld=()=>"/transaction-type/check",sn=async(e,t)=>r(ld(),{...t,method:"POST",headers:{"Content-Type":"application/json",...t?.headers},body:JSON.stringify(e)});var ne={checkTransactionType:o(sn)};var rn="https://eu.spaceinvoices.com";var Ed=()=>"/upload/image",on=async(e,t)=>{let s=new FormData;return s.append("file",e.file),r(Ed(),{...t,method:"POST",body:s})};var pe={uploadImage:o(on)};var xd=()=>"/users/me",nn=async e=>r(xd(),{...e,method:"GET"}),hd=()=>"/users/me",pn=async(e,t)=>r(hd(),{...t,method:"PATCH",headers:{"Content-Type":"application/json",...t?.headers},body:JSON.stringify(e)}),vd=()=>"/users/me/settings/furs",an=async(e,t)=>r(vd(),{...t,method:"PUT",headers:{"Content-Type":"application/json",...t?.headers},body:JSON.stringify(e)}),Id=()=>"/users/me/settings/fina",cn=async(e,t)=>r(Id(),{...t,method:"PUT",headers:{"Content-Type":"application/json",...t?.headers},body:JSON.stringify(e)});var ae={getMe:o(nn),update:o(pn),updateFursSettings:o(an),updateFinaSettings:o(cn)};var Sd=()=>"/vies/check",dn=async(e,t)=>r(Sd(),{...t,method:"POST",headers:{"Content-Type":"application/json",...t?.headers},body:JSON.stringify(e)});var ie={checkVies:o(dn)};var Pd=()=>"/webhooks",un=async(e,t)=>r(Pd(),{...t,method:"POST",headers:{"Content-Type":"application/json",...t?.headers},body:JSON.stringify(e)}),Ad=e=>{let t=new URLSearchParams;Object.entries(e||{}).forEach(([p,n])=>{n!==void 0&&t.append(p,n===null?"null":n.toString());});let s=t.toString();return s.length>0?`/webhooks?${s}`:"/webhooks"},Rn=async(e,t)=>r(Ad(e),{...t,method:"GET"}),fd=e=>`/webhooks/${e}`,yn=async(e,t)=>r(fd(e),{...t,method:"GET"}),Dd=e=>`/webhooks/${e}`,mn=async(e,t,s)=>r(Dd(e),{...s,method:"PATCH",headers:{"Content-Type":"application/json",...s?.headers},body:JSON.stringify(t)}),bd=e=>`/webhooks/${e}`,gn=async(e,t)=>r(bd(e),{...t,method:"DELETE"}),Cd=e=>`/webhooks/${e}/test`,ln=async(e,t)=>r(Cd(e),{...t,method:"POST"});var Fd=e=>`/webhooks/${e}/rotate-secret`,En=async(e,t)=>r(Fd(e),{...t,method:"POST"});var ce={create:o(un),list:i(Rn),get:o(yn),update:o(mn),delete:o(gn),testWebhook:o(ln),rotateWebhookSecret:o(En)};var Nd=()=>"/white-label-subscriptions",xn=async e=>r(Nd(),{...e,method:"GET"}),Td=()=>"/white-label-subscriptions/plans",hn=async e=>r(Td(),{...e,method:"GET"}),Ud=e=>`/white-label-subscriptions/check-feature/${e}`,vn=async(e,t)=>r(Ud(e),{...t,method:"GET"}),kd=e=>`/white-label-subscriptions/check-limit/${e}`,In=async(e,t)=>r(kd(e),{...t,method:"GET"}),Hd=()=>"/white-label-subscriptions/billing-email",Sn=async(e,t)=>r(Hd(),{...t,method:"PATCH",headers:{"Content-Type":"application/json",...t?.headers},body:JSON.stringify(e)});var de={getCurrentWLSubscription:o(xn),list:o(hn),checkWLFeature:o(vn),checkWLLimit:o(In),update:o(Sn)};var Od=()=>"/white-labels/current",Pn=async e=>r(Od(),{...e,method:"GET"});var ue={getCurrentWhiteLabel:o(Pn)};var m=class{accountWebhooks=l;activities=E;advanceInvoices=x;companyRegistry=h;creditNotes=v;customers=I;deliveryNotes=S;documents=P;eInvoicing=A;email=f;entities=D;entityApiKeys=b;entityInvitations=C;entityStats=F;entityUsers=N;estimates=T;exports=U;files=k;finaCertificate=H;finaDevices=O;finaPremises=B;finaSettings=W;fursCertificate=G;fursDevices=w;fursInternalAct=V;fursPremises=L;fursSettings=q;health=z;incomingPurchaseDocuments=M;invoices=$;items=j;legacyMigration=J;locale=K;orderIntegrations=Y;orders=_;payments=X;ptAtcudSeries=Q;ptSafT=Z;recurringInvoices=ee;stripeApp=te;suppliers=se;taxReports=re;taxes=oe;transactionType=ne;upload=pe;users=ae;vies=ie;webhooks=ce;whiteLabelSubscriptions=de;whiteLabels=ue;constructor(t){let s=typeof t=="string"?{accessToken:t}:t,p=typeof s.accessToken=="function"?s.accessToken:()=>s.accessToken;ye({baseUrl:s.basePath??rn,getAccessToken:p,clientName:s.clientName??"js-sdk",onUnauthorized:s.onUnauthorized});}};async function Bd(e,t,s){let p=new URLSearchParams({type:t.type}).toString();return r(`/eslog/${e}/download?${p}`,{...s,method:"GET"})}var Wd={download:o(Bd)};
|
|
2
|
+
exports.DEFAULT_BASE_URL=rn;exports.SpaceInvoices=m;exports.accountWebhooks=l;exports.activities=E;exports.advanceInvoices=x;exports.companyRegistry=h;exports.creditNotes=v;exports.customers=I;exports.default=m;exports.deliveryNotes=S;exports.documents=P;exports.eInvoicing=A;exports.eSlog=Wd;exports.email=f;exports.entities=D;exports.entityApiKeys=b;exports.entityInvitations=C;exports.entityStats=F;exports.entityUsers=N;exports.estimates=T;exports.exports=U;exports.files=k;exports.finaCertificate=H;exports.finaDevices=O;exports.finaPremises=B;exports.finaSettings=W;exports.fursCertificate=G;exports.fursDevices=w;exports.fursInternalAct=V;exports.fursPremises=L;exports.fursSettings=q;exports.health=z;exports.incomingPurchaseDocuments=M;exports.invoices=$;exports.items=j;exports.legacyMigration=J;exports.locale=K;exports.orderIntegrations=Y;exports.orders=_;exports.payments=X;exports.ptAtcudSeries=Q;exports.ptSafT=Z;exports.recurringInvoices=ee;exports.stripeApp=te;exports.suppliers=se;exports.taxReports=re;exports.taxes=oe;exports.transactionType=ne;exports.upload=pe;exports.users=ae;exports.vies=ie;exports.webhooks=ce;exports.whiteLabelSubscriptions=de;exports.whiteLabels=ue;exports.wrapListMethod=i;exports.wrapMethod=o;//# sourceMappingURL=index.cjs.map
|
|
3
|
+
//# sourceMappingURL=index.cjs.map
|