@directus/sdk
Advanced tools
Comparing version 16.1.1 to 16.1.2
@@ -1,2 +0,2 @@ | ||
function I(e){return e?`/auth/login/${e}`:"/auth/login"}var F="/",G=(e,t)=>(e.endsWith(F)&&(e=e.slice(0,-1)),t.startsWith(F)||(t=F+t),e+t),b=(e,t,r)=>{let a=e.pathname===F?t:G(e.pathname,t),s=new globalThis.URL(a,e);if(r)for(let[p,i]of Object.entries(v(r)))if(i&&typeof i=="object"&&!Array.isArray(i))for(let[c,y]of Object.entries(i))s.searchParams.set(`${p}[${c}]`,String(y));else s.searchParams.set(p,i);return s};function U(e){return typeof e!="object"||!e?!1:"headers"in e&&"ok"in e&&"json"in e&&typeof e.json=="function"&&"text"in e&&typeof e.json=="function"}async function J(e){if(!(typeof e!="object"||!e)){if(U(e)){let t=e.headers.get("Content-Type")?.toLowerCase();if(t?.startsWith("application/json")||t?.startsWith("application/health+json")){let r=await e.json();if(!e.ok)throw r;return"data"in r?r.data:r}if(t?.startsWith("text/html")||t?.startsWith("text/plain")){let r=await e.text();if(!e.ok)throw r;return r}return e}return"data"in e?e.data:e}}var D=async(e,t,r=globalThis.fetch)=>(t.headers=typeof t.headers=="object"&&!Array.isArray(t.headers)?t.headers:{},r(e,t).then(a=>J(a).catch(s=>{let p=typeof s=="object"&&"errors"in s?s.errors:s;return Promise.reject({errors:p,response:a})})));var $=()=>{let e=null;return{get:async()=>e,set:async t=>{e=t}}};var L={msRefreshBeforeExpires:3e4,autoRefresh:!0},H=2**31-1,ce=(e="cookie",t={})=>r=>{let a={...L,...t},s=null,p=null,i=a.storage??$(),c=async()=>i.set({access_token:null,refresh_token:null,expires:null,expires_at:null}),y=async()=>{try{await s}finally{s=null}},x=async()=>{let d=await i.get();return s||!d?.expires_at||d.expires_at<new Date().getTime()+a.msRefreshBeforeExpires&&T().catch(l=>{}),y()},O=async d=>{let l=d.expires??0;d.expires_at=new Date().getTime()+l,await i.set(d),a.autoRefresh&&l>a.msRefreshBeforeExpires&&l<H&&(p&&clearTimeout(p),p=setTimeout(()=>{p=null,T().catch(f=>{})},l-a.msRefreshBeforeExpires))},T=async()=>(s=(async()=>{let l=await i.get();await c();let f={method:"POST",headers:{"Content-Type":"application/json"}};"credentials"in a&&(f.credentials=a.credentials);let m={mode:e};e==="json"&&l?.refresh_token&&(m.refresh_token=l.refresh_token),f.body=JSON.stringify(m);let n=b(r.url,"/auth/refresh");return D(n.toString(),f,r.globals.fetch).then(h=>O(h).then(()=>h))})(),s);return{refresh:T,async login(d,l,f={}){await c();let m={email:d,password:l};"otp"in f&&(m.otp=f.otp),m.mode=f.mode??e;let n=I(f.provider),h=b(r.url,n),u={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(m)};"credentials"in a&&(u.credentials=a.credentials);let g=await D(h.toString(),u,r.globals.fetch);return await O(g),g},async logout(){let d=await i.get(),l={method:"POST",headers:{"Content-Type":"application/json"}};"credentials"in a&&(l.credentials=a.credentials);let f={mode:e};e==="json"&&d?.refresh_token&&(f.refresh_token=d.refresh_token),l.body=JSON.stringify(f);let m=b(r.url,"/auth/logout");await D(m.toString(),l,r.globals.fetch),this.stopRefreshing(),await c()},stopRefreshing(){p&&clearTimeout(p)},async getToken(){return await x().catch(()=>{}),(await i.get())?.access_token??null},async setToken(d){return i.set({access_token:d,refresh_token:null,expires:null,expires_at:null})}}};var he=e=>t=>{let r=e??null;return{async getToken(){return r},async setToken(a){r=a}}};var k={fetch:globalThis.fetch,WebSocket:globalThis.WebSocket,URL:globalThis.URL,logger:globalThis.console},fe=(e,t={})=>{let r=t.globals?{...k,...t.globals}:k;return{globals:r,url:new r.URL(e),with(a){return{...this,...a(this)}}}};var V={},Ce=(e={})=>t=>{let r={...V,...e};return{async query(a,s,p="items"){let i={method:"POST",body:JSON.stringify({query:a,variables:s})};"credentials"in r&&(i.credentials=r.credentials);let c={};if("getToken"in this){let O=await this.getToken();O&&(c.Authorization=`Bearer ${O}`)}"Content-Type"in c||(c["Content-Type"]="application/json"),i.headers=c;let y=p==="items"?"/graphql":"/graphql/system",x=b(t.url,y);return await D(x.toString(),i,t.globals.fetch)}}};function E(e){return JSON.stringify({...e,type:"auth"})}var K=()=>JSON.stringify({type:"pong"});var A=(e,t=1e3)=>new Promise((r,a)=>{let s=y=>{try{let x=JSON.parse(y.data);typeof x=="object"&&!Array.isArray(x)&&x!==null?(i(),r(x)):(i(),p())}catch{i(),r(y)}},p=()=>a(),i=()=>{clearTimeout(c),e.removeEventListener("message",s),e.removeEventListener("error",p),e.removeEventListener("close",p)};e.addEventListener("message",s),e.addEventListener("error",p),e.addEventListener("close",p);let c=setTimeout(()=>{i(),r(void 0)},t)});function*w(){let e=1;for(;;)yield String(e),e++}var M={authMode:"handshake",heartbeat:!0,debug:!1,reconnect:{delay:1e3,retries:10}};function Ue(e={}){return t=>{e={...M,...e};let r=w(),a={code:"closed"},s={attempts:0,active:!1},p=new Set,i=m=>"getToken"in m,c=(m,...n)=>e.debug&&t.globals.logger[m]("[Directus SDK]",...n),y=async(m,n)=>{let h=new t.globals.URL(m);if(e.authMode==="strict"&&i(n)){let u=await n.getToken();u&&h.searchParams.set("access_token",u)}return h.toString()},x=async m=>{if("url"in e)return await y(e.url,m);if(["ws:","wss:"].includes(t.url.protocol))return await y(t.url,m);let n=new t.globals.URL(t.url.toString());return n.protocol=t.url.protocol==="https:"?"wss:":"ws:",n.pathname="/websocket",await y(n,m)},O=m=>{let n=new Promise((h,u)=>{if(!e.reconnect)return u();if(c("info",`reconnect #${s.attempts} `+(s.attempts>=e.reconnect.retries?"maximum retries reached":`trying again in ${Math.max(100,e.reconnect.delay)}ms`)),s.active)return s.active;if(s.attempts>=e.reconnect.retries)return u();setTimeout(()=>m.connect().then(g=>(p.forEach(S=>{m.sendMessage(S)}),g)).then(h).catch(u),Math.max(100,e.reconnect.delay))});s.attempts+=1,s.active=n.catch(()=>{}).finally(()=>{s.active=!1})},T={open:new Set([]),error:new Set([]),close:new Set([]),message:new Set([])};function d(m){return"type"in m&&"status"in m&&"error"in m&&"code"in m.error&&"message"in m.error&&m.type==="auth"&&m.status==="error"}async function l(m,n){if(a.code==="open"){if(m.error.code==="TOKEN_EXPIRED"&&(c("warn","Authentication token expired!"),i(n))){let h=await n.getToken();if(!h)throw Error("No token for re-authenticating the websocket");a.connection.send(E({access_token:h}))}if(m.error.code==="AUTH_TIMEOUT")return a.firstMessage&&e.authMode==="public"?(c("warn",'Authentication failed! Currently the "authMode" is "public" try using "handshake" instead'),e.reconnect=!1):c("warn","Authentication timed out!"),a.connection.close();if(m.error.code==="AUTH_FAILED"){if(a.firstMessage&&e.authMode==="public")return c("warn",'Authentication failed! Currently the "authMode" is "public" try using "handshake" instead'),e.reconnect=!1,a.connection.close();c("warn","Authentication failed!")}}}let f=async m=>{for(;a.code==="open";){let n=await A(a.connection).catch(()=>{});if(n){if(d(n)){await l(n,m),a.firstMessage=!1;continue}if(e.heartbeat&&n.type==="ping"){a.connection.send(K()),a.firstMessage=!1;continue}T.message.forEach(h=>{a.code==="open"&&h.call(a.connection,n)}),a.firstMessage=!1}}};return{async connect(){if(a.code==="connecting")return await a.connection;if(a.code!=="closed")throw new Error(`Cannot connect when state is "${a.code}"`);let m=this,n=await x(m);c("info",`Connecting to ${n}...`);let h=new Promise((u,g)=>{let S=!1,C=new t.globals.WebSocket(n);C.addEventListener("open",async j=>{if(c("info","Connection open."),a={code:"open",connection:C,firstMessage:!0},s.attempts=0,s.active=!1,f(m),e.authMode==="handshake"&&i(m)){let R=await m.getToken();if(!R)throw Error("No token for authenticating the websocket. Make sure to provide one or call the login() function beforehand.");C.send(E({access_token:R}));let P=await A(C);if(P&&"type"in P&&"status"in P&&P.type==="auth"&&P.status==="ok")c("info","Authentication successful!");else return g("Authentication failed while opening websocket connection")}T.open.forEach(R=>R.call(C,j)),S=!0,u(C)}),C.addEventListener("error",j=>{c("warn","Connection errored."),T.error.forEach(R=>R.call(C,j)),C.close(),a={code:"error"},S||g(j)}),C.addEventListener("close",j=>{c("info","Connection closed."),T.close.forEach(R=>R.call(C,j)),r=w(),a={code:"closed"},O(this),S||g(j)})});return a={code:"connecting",connection:h},h},disconnect(){a.code==="open"&&a.connection.close()},onWebSocket(m,n){if(m==="message"){let h=function(u){if(typeof u.data!="string")return n.call(this,u);try{return n.call(this,JSON.parse(u.data))}catch{return n.call(this,u)}};return T[m].add(h),()=>T[m].delete(h)}return T[m].add(n),()=>T[m].delete(n)},sendMessage(m){if(a.code!=="open")throw new Error('Cannot send messages without an open connection. Make sure you are calling "await client.connect()".');if(typeof m=="string")return a.connection.send(m);"uid"in m||(m.uid=r.next().value),a.connection.send(JSON.stringify(m))},async subscribe(m,n={}){"uid"in n||(n.uid=r.next().value),p.add({...n,collection:m,type:"subscribe"}),a.code!=="open"&&(c("info","No connection available for subscribing!"),await this.connect()),this.sendMessage({...n,collection:m,type:"subscribe"});let h=!0;async function*u(){for(;h&&a.code==="open";){let S=await A(a.connection).catch(()=>{});if(S){if("type"in S&&"status"in S&&S.type==="subscribe"&&S.status==="error")throw S;"type"in S&&"uid"in S&&S.type==="subscription"&&S.uid===n.uid&&(yield S)}}e.reconnect&&s.active&&(await s.active,a.code==="open"&&(a.connection.send(JSON.stringify({...n,collection:m,type:"subscribe"})),yield*u()))}let g=()=>{p.delete({...n,collection:m,type:"subscribe"}),this.sendMessage({uid:n.uid,type:"unsubscribe"}),h=!1};return{subscription:u(),unsubscribe:g}}}}}var $e=e=>new Promise(t=>setTimeout(()=>t(),e));var ze=(e,t,r={})=>()=>{let a=I(r.provider),s={email:e,password:t};return"otp"in r&&(s.otp=r.otp),s.mode=r.mode??"cookie",{path:a,method:"POST",body:JSON.stringify(s)}};var Ye=(e,t="cookie")=>()=>({path:"/auth/logout",method:"POST",body:JSON.stringify(e?{refresh_token:e,mode:t}:{mode:t})});var et=(e,t)=>()=>({path:"/auth/password/request",method:"POST",body:JSON.stringify({email:e,...t?{reset_url:t}:{}})});var rt=(e,t)=>()=>({path:"/auth/password/reset",method:"POST",body:JSON.stringify({token:e,password:t})});var at=(e=!1)=>()=>({path:e?"/auth?sessionOnly":"/auth",method:"GET"});var mt=(e="cookie",t)=>()=>({path:"/auth/refresh",method:"POST",body:JSON.stringify(e==="json"?{refresh_token:t,mode:e}:{mode:e})});var St=(e,t)=>()=>({path:"/activity/comment",params:t??{},body:JSON.stringify(e),method:"POST"});var ft=(e,t)=>()=>({path:"/collections",params:t??{},body:JSON.stringify(e),method:"POST"});var xt=(e,t)=>()=>({path:"/dashboards",params:t??{},body:JSON.stringify(e),method:"POST"}),Tt=(e,t)=>()=>({path:"/dashboards",params:t??{},body:JSON.stringify(e),method:"POST"});var gt=(e,t,r)=>()=>({path:`/fields/${e}`,params:r??{},body:JSON.stringify(t),method:"POST"});var bt=(e,t)=>()=>({path:"/files",method:"POST",body:e,params:t??{},headers:{"Content-Type":"multipart/form-data"}}),Dt=(e,t={},r)=>()=>({path:"/files/import",method:"POST",body:JSON.stringify({url:e,data:t}),params:r??{}});var jt=(e,t)=>()=>({path:"/flows",params:t??{},body:JSON.stringify(e),method:"POST"}),Pt=(e,t)=>()=>({path:"/flows",params:t??{},body:JSON.stringify(e),method:"POST"});var Ft=(e,t)=>()=>({path:"/folders",params:t??{},body:JSON.stringify(e),method:"POST"}),At=(e,t)=>()=>({path:"/folders",params:t??{},body:JSON.stringify(e),method:"POST"});import{isSystemCollection as W}from"@directus/system-data";var Nt=(e,t,r)=>()=>{let a=String(e);if(W(a))throw new Error("Cannot use createItems for core collections");return{path:`/items/${a}`,params:r??{},body:JSON.stringify(t),method:"POST"}},vt=(e,t,r)=>()=>{let a=String(e);if(W(a))throw new Error("Cannot use createItem for core collections");return{path:`/items/${a}`,params:r??{},body:JSON.stringify(t),method:"POST"}};var Jt=(e,t)=>()=>({path:"/notifications",params:t??{},body:JSON.stringify(e),method:"POST"}),$t=(e,t)=>()=>({path:"/notifications",params:t??{},body:JSON.stringify(e),method:"POST"});var Kt=(e,t)=>()=>({path:"/operations",params:t??{},body:JSON.stringify(e),method:"POST"}),Wt=(e,t)=>()=>({path:"/operations",params:t??{},body:JSON.stringify(e),method:"POST"});var Lt=(e,t)=>()=>({path:"/panels",params:t??{},body:JSON.stringify(e),method:"POST"}),Ht=(e,t)=>()=>({path:"/panels",params:t??{},body:JSON.stringify(e),method:"POST"});var Mt=(e,t)=>()=>({path:"/permissions",params:t??{},body:JSON.stringify(e),method:"POST"}),Bt=(e,t)=>()=>({path:"/permissions",params:t??{},body:JSON.stringify(e),method:"POST"});var qt=(e,t)=>()=>({path:"/presets",params:t??{},body:JSON.stringify(e),method:"POST"}),zt=(e,t)=>()=>({path:"/presets",params:t??{},body:JSON.stringify(e),method:"POST"});var Yt=e=>()=>({path:"/relations",body:JSON.stringify(e),method:"POST"});var er=(e,t)=>()=>({path:"/roles",params:t??{},body:JSON.stringify(e),method:"POST"}),tr=(e,t)=>()=>({path:"/roles",params:t??{},body:JSON.stringify(e),method:"POST"});var or=(e,t)=>()=>({path:"/shares",params:t??{},body:JSON.stringify(e),method:"POST"}),ar=(e,t)=>()=>({path:"/shares",params:t??{},body:JSON.stringify(e),method:"POST"});var mr=(e,t)=>()=>({path:"/translations",params:t??{},body:JSON.stringify(e),method:"POST"}),ir=(e,t)=>()=>({path:"/translations",params:t??{},body:JSON.stringify(e),method:"POST"});var cr=(e,t)=>()=>({path:"/users",params:t??{},body:JSON.stringify(e),method:"POST"}),pr=(e,t)=>()=>({path:"/users",params:t??{},body:JSON.stringify(e),method:"POST"});var ur=(e,t)=>()=>({path:"/versions",params:t??{},body:JSON.stringify(e),method:"POST"}),yr=(e,t)=>()=>({path:"/versions",params:t??{},body:JSON.stringify(e),method:"POST"});var Sr=(e,t)=>()=>({path:"/webhooks",params:t??{},body:JSON.stringify(e),method:"POST"}),lr=(e,t)=>()=>({path:"/webhooks",params:t??{},body:JSON.stringify(e),method:"POST"});var kr=e=>()=>({path:`/activity/comment/${e}`,method:"DELETE"});var Wr=e=>()=>({path:`/collections/${e}`,method:"DELETE"});var N=e=>{let t=(r,a=[])=>{if(typeof r=="object"){let s=[];for(let p in r){let i=r[p]??[];if(Array.isArray(i))for(let c of i)s.push(t(c,[...a,p]));else if(typeof i=="object")for(let c of Object.keys(i)){let y=i[c];for(let x of y)s.push(t(x,[...a,`${p}:${c}`]))}}return s.flatMap(p=>p)}return[...a,String(r)].join(".")};return e.flatMap(r=>t(r))},v=e=>{let t={};Array.isArray(e.fields)&&e.fields.length>0&&(t.fields=N(e.fields).join(",")),e.filter&&Object.keys(e.filter).length>0&&(t.filter=JSON.stringify(e.filter)),e.search&&(t.search=e.search),"sort"in e&&e.sort&&(t.sort=typeof e.sort=="string"?e.sort:e.sort.join(",")),typeof e.limit=="number"&&e.limit>=-1&&(t.limit=String(e.limit)),typeof e.offset=="number"&&e.offset>=0&&(t.offset=String(e.offset)),typeof e.page=="number"&&e.page>=1&&(t.page=String(e.page)),e.deep&&Object.keys(e.deep).length>0&&(t.deep=JSON.stringify(e.deep)),e.alias&&Object.keys(e.alias).length>0&&(t.alias=JSON.stringify(e.alias)),e.aggregate&&Object.keys(e.aggregate).length>0&&(t.aggregate=JSON.stringify(e.aggregate)),e.groupBy&&e.groupBy.length>0&&(t.groupBy=e.groupBy.join(","));for(let[r,a]of Object.entries(e))r in t||(typeof a=="string"||typeof a=="number"||typeof a=="boolean"?t[r]=String(a):t[r]=JSON.stringify(a));return t};var o=(e,t)=>{if(e.length===0)throw new Error(t)};import{isSystemCollection as B}from"@directus/system-data";var Q=(e,t)=>{if(B(String(e)))throw new Error(t)};var Zr=e=>()=>(o(e,"Keys cannot be empty"),{path:"/dashboards",body:JSON.stringify(e),method:"DELETE"}),eo=e=>()=>(o(e,"Key cannot be empty"),{path:`/dashboards/${e}`,method:"DELETE"});var oo=(e,t)=>()=>(o(e,"Collection cannot be empty"),o(t,"Field cannot be empty"),{path:`/fields/${e}/${t}`,method:"DELETE"});var mo=e=>()=>(o(e,"Keys cannot be empty"),{path:"/files",body:JSON.stringify(e),method:"DELETE"}),io=e=>()=>(o(e,"Key cannot be empty"),{path:`/files/${e}`,method:"DELETE"});var po=e=>()=>(o(e,"Keys cannot be empty"),{path:"/flows",body:JSON.stringify(e),method:"DELETE"}),ho=e=>()=>(o(e,"Key cannot be empty"),{path:`/flows/${e}`,method:"DELETE"});var So=e=>()=>(o(e,"Keys cannot be empty"),{path:"/folders",body:JSON.stringify(e),method:"DELETE"}),lo=e=>()=>(o(e,"Key cannot be empty"),{path:`/folders/${e}`,method:"DELETE"});var xo=(e,t)=>()=>{let r={};return o(String(e),"Collection cannot be empty"),Q(e,"Cannot use deleteItems for core collections"),Array.isArray(t)?(o(t,"keysOrQuery cannot be empty"),r={keys:t}):(o(Object.keys(t),"keysOrQuery cannot be empty"),r={query:t}),{path:`/items/${e}`,body:JSON.stringify(r),method:"DELETE"}},To=(e,t)=>()=>(o(String(e),"Collection cannot be empty"),Q(e,"Cannot use deleteItem for core collections"),o(String(t),"Key cannot be empty"),{path:`/items/${e}/${t}`,method:"DELETE"});var Ro=e=>()=>(o(e,"Keys cannot be empty"),{path:"/notifications",body:JSON.stringify(e),method:"DELETE"}),bo=e=>()=>(o(e,"Key cannot be empty"),{path:`/notifications/${e}`,method:"DELETE"});var jo=e=>()=>(o(e,"Keys cannot be empty"),{path:"/operations",body:JSON.stringify(e),method:"DELETE"}),Po=e=>()=>(o(e,"Key cannot be empty"),{path:`/operations/${e}`,method:"DELETE"});var Ao=e=>()=>(o(e,"Keys cannot be empty"),{path:"/panels",body:JSON.stringify(e),method:"DELETE"}),Eo=e=>()=>(o(e,"Key cannot be empty"),{path:`/panels/${e}`,method:"DELETE"});var vo=e=>()=>(o(e,"Keys cannot be empty"),{path:"/permissions",body:JSON.stringify(e),method:"DELETE"}),Uo=e=>()=>(o(String(e),"Key cannot be empty"),{path:`/permissions/${e}`,method:"DELETE"});var ko=e=>()=>(o(e,"Keys cannot be empty"),{path:"/presets",body:JSON.stringify(e),method:"DELETE"}),Ko=e=>()=>(o(String(e),"Key cannot be empty"),{path:`/presets/${e}`,method:"DELETE"});var Lo=(e,t)=>()=>(o(e,"Collection cannot be empty"),o(t,"Field cannot be empty"),{path:`/relations/${e}/${t}`,method:"DELETE"});var Mo=e=>()=>(o(e,"Keys cannot be empty"),{path:"/roles",body:JSON.stringify(e),method:"DELETE"}),Bo=e=>()=>(o(String(e),"Key cannot be empty"),{path:`/roles/${e}`,method:"DELETE"});var zo=e=>()=>(o(e,"Keys cannot be empty"),{path:"/shares",body:JSON.stringify(e),method:"DELETE"}),Xo=e=>()=>(o(String(e),"Key cannot be empty"),{path:`/shares/${e}`,method:"DELETE"});var ea=e=>()=>(o(e,"Keys cannot be empty"),{path:"/translations",body:JSON.stringify(e),method:"DELETE"}),ta=e=>()=>(o(String(e),"Key cannot be empty"),{path:`/translations/${e}`,method:"DELETE"});var aa=e=>()=>(o(e,"Keys cannot be empty"),{path:"/users",body:JSON.stringify(e),method:"DELETE"}),sa=e=>()=>(o(String(e),"Key cannot be empty"),{path:`/users/${e}`,method:"DELETE"});var na=e=>()=>(o(e,"Keys cannot be empty"),{path:"/versions",body:JSON.stringify(e),method:"DELETE"}),ca=e=>()=>(o(e,"Key cannot be empty"),{path:`/versions/${e}`,method:"DELETE"});var ua=e=>()=>(o(e,"Keys cannot be empty"),{path:"/webhooks",body:JSON.stringify(e),method:"DELETE"}),ya=e=>()=>(o(String(e),"Key cannot be empty"),{path:`/webhooks/${e}`,method:"DELETE"});var Ja=e=>()=>({path:"/activity",params:e??{},method:"GET"}),$a=(e,t)=>()=>(o(String(e),"Key cannot be empty"),{path:`/activity/${e}`,params:t??{},method:"GET"});import{isSystemCollection as _}from"@directus/system-data";var La=(e,t)=>()=>{let r=String(e);return o(r,"Collection cannot be empty"),{path:_(r)?`/${r.substring(9)}`:`/items/${r}`,method:"GET",params:{...t.query??{},...t.groupBy?{groupBy:t.groupBy}:{},aggregate:t.aggregate}}};var Ma=(e,t)=>()=>(o(String(e),"Key cannot be empty"),{path:`/assets/${e}`,params:t??{},method:"GET",onResponse:r=>r.body}),Ba=(e,t)=>()=>(o(String(e),"Key cannot be empty"),{path:`/assets/${e}`,params:t??{},method:"GET",onResponse:r=>r.blob()}),_a=(e,t)=>()=>(o(String(e),"Key cannot be empty"),{path:`/assets/${e}`,params:t??{},method:"GET",onResponse:r=>r.arrayBuffer()});var Xa=()=>()=>({path:"/collections",method:"GET"}),Ya=e=>()=>(o(e,"Collection cannot be empty"),{path:`/collections/${e}`,method:"GET"});var ts=e=>()=>({path:"/dashboards",params:e??{},method:"GET"}),rs=(e,t)=>()=>(o(String(e),"Key cannot be empty"),{path:`/dashboards/${e}`,params:t??{},method:"GET"});var as=()=>()=>({path:"/extensions/",method:"GET"});var is=()=>()=>({path:"/fields",method:"GET"}),ns=e=>()=>(o(e,"Collection cannot be empty"),{path:`/fields/${e}`,method:"GET"}),cs=(e,t)=>()=>(o(e,"Collection cannot be empty"),o(t,"Field cannot be empty"),{path:`/fields/${e}/${t}`,method:"GET"});var us=e=>()=>({path:"/files",params:e??{},method:"GET"}),ys=(e,t)=>()=>(o(String(e),"Key cannot be empty"),{path:`/files/${e}`,params:t??{},method:"GET"});var ls=e=>()=>({path:"/flows",params:e??{},method:"GET"}),fs=(e,t)=>()=>(o(String(e),"Key cannot be empty"),{path:`/flows/${e}`,params:t??{},method:"GET"});var Ts=e=>()=>({path:"/folders",params:e??{},method:"GET"}),Cs=(e,t)=>()=>(o(String(e),"Key cannot be empty"),{path:`/folders/${e}`,params:t??{},method:"GET"});var bs=(e,t)=>()=>(o(String(e),"Collection cannot be empty"),Q(e,"Cannot use readItems for core collections"),{path:`/items/${e}`,params:t??{},method:"GET"}),Ds=(e,t,r)=>()=>(o(String(e),"Collection cannot be empty"),Q(e,"Cannot use readItem for core collections"),o(String(t),"Key cannot be empty"),{path:`/items/${e}/${t}`,params:r??{},method:"GET"});var Ps=e=>()=>({path:"/notifications",params:e??{},method:"GET"}),Is=(e,t)=>()=>(o(String(e),"Key cannot be empty"),{path:`/notifications/${e}`,params:t??{},method:"GET"});var Es=e=>()=>({path:"/operations",params:e??{},method:"GET"}),ws=(e,t)=>()=>(o(String(e),"Key cannot be empty"),{path:`/operations/${e}`,params:t??{},method:"GET"});var Us=e=>()=>({path:"/panels",params:e??{},method:"GET"}),Js=(e,t)=>()=>(o(String(e),"Key cannot be empty"),{path:`/panels/${e}`,params:t??{},method:"GET"});var Ks=e=>()=>({path:"/permissions",params:e??{},method:"GET"}),Ws=(e,t)=>()=>(o(String(e),"Key cannot be empty"),{path:`/permissions/${e}`,params:t??{},method:"GET"}),Gs=(e,t)=>()=>(o(String(e),"Collection cannot be empty"),{path:`/permissions/me/${t?`${e}/${t}`:`${e}`}`,method:"GET"});var Vs=e=>()=>({path:"/presets",params:e??{},method:"GET"}),Ms=(e,t)=>()=>(o(String(e),"Key cannot be empty"),{path:`/presets/${e}`,params:t??{},method:"GET"});var qs=()=>()=>({path:"/relations",method:"GET"}),zs=e=>()=>({path:`/relations/${e}`,method:"GET"}),Xs=(e,t)=>()=>(o(e,"Collection cannot be empty"),o(t,"Field cannot be empty"),{path:`/relations/${e}/${t}`,method:"GET"});var em=e=>()=>({path:"/revisions",params:e??{},method:"GET"}),tm=(e,t)=>()=>(o(String(e),"Key cannot be empty"),{path:`/revisions/${e}`,params:t??{},method:"GET"});var am=e=>()=>({path:"/roles",params:e??{},method:"GET"}),sm=(e,t)=>()=>(o(String(e),"Key cannot be empty"),{path:`/roles/${e}`,params:t??{},method:"GET"});var im=e=>()=>({path:"/settings",params:e??{},method:"GET"});var pm=e=>()=>({path:"/shares",params:e??{},method:"GET"}),hm=(e,t)=>()=>(o(String(e),"Key cannot be empty"),{path:`/shares/${e}`,params:t??{},method:"GET"});var dm=(e,t)=>()=>(o(String(e),"Collection cannot be empty"),Q(e,"Cannot use readSingleton for core collections"),{path:`/items/${e}`,params:t??{},method:"GET"});var fm=e=>()=>({path:"/translations",params:e??{},method:"GET"}),Qm=(e,t)=>()=>(o(String(e),"Key cannot be empty"),{path:`/translations/${e}`,params:t??{},method:"GET"});var Cm=e=>()=>({path:"/users",params:e??{},method:"GET"}),gm=(e,t)=>()=>(o(String(e),"Key cannot be empty"),{path:`/users/${e}`,params:t??{},method:"GET"}),Rm=e=>()=>({path:"/users/me",params:e??{},method:"GET"});var Om=e=>()=>({path:"/versions",params:e??{},method:"GET"}),jm=(e,t)=>()=>(o(String(e),"Key cannot be empty"),{path:`/versions/${e}`,params:t??{},method:"GET"});var Fm=e=>()=>({path:"/webhooks",params:e??{},method:"GET"}),Am=(e,t)=>()=>(o(String(e),"Key cannot be empty"),{path:`/webhooks/${e}`,params:t??{},method:"GET"});var mi=e=>()=>({method:"POST",path:"/schema/apply",body:JSON.stringify(e)});var ni=(e,t=!1)=>()=>({method:"POST",path:"/schema/diff",params:t?{force:t}:{},body:JSON.stringify(e)});var pi=()=>()=>({method:"GET",path:"/schema/snapshot"});var li=(e="item")=>()=>({method:"GET",path:e==="item"?"/server/specs/graphql":"/server/specs/graphql/system"});var Qi=()=>()=>({method:"GET",path:"/server/health"});var Ti=()=>()=>({method:"GET",path:"/server/info"});var gi=()=>()=>({method:"GET",path:"/server/specs/oas"});var bi=()=>()=>({method:"GET",path:"/server/ping"});var wi=(e,t,r)=>()=>(o(String(e),"Key cannot be empty"),{path:`/activity/comment/${e}`,params:r??{},body:JSON.stringify(t),method:"PATCH"});var Ui=(e,t,r)=>()=>(o(e,"Collection cannot be empty"),{path:`/collections/${e}`,params:r??{},body:JSON.stringify(t),method:"PATCH"}),Ji=(e,t)=>()=>({path:"/collections",params:t??{},body:JSON.stringify(e),method:"PATCH"});var Ki=(e,t,r)=>()=>(o(e,"Keys cannot be empty"),{path:"/dashboards",params:r??{},body:JSON.stringify({keys:e,data:t}),method:"PATCH"}),Wi=(e,t)=>()=>({path:"/dashboards",params:t??{},body:JSON.stringify(e),method:"PATCH"}),Gi=(e,t,r)=>()=>(o(e,"Key cannot be empty"),{path:`/dashboards/${e}`,params:r??{},body:JSON.stringify(t),method:"PATCH"});var Vi=(e,t,r)=>()=>(e!==null&&o(e,"Bundle cannot be an empty string"),o(t,"Name cannot be empty"),{path:e?`/extensions/${e}/${t}`:`/extensions/${t}`,params:{},body:JSON.stringify(r),method:"PATCH"});var _i=(e,t,r,a)=>()=>(o(e,"Keys cannot be empty"),o(t,"Field cannot be empty"),{path:`/fields/${e}/${t}`,params:a??{},body:JSON.stringify(r),method:"PATCH"});var Xi=(e,t,r)=>()=>(o(e,"Keys cannot be empty"),{path:"/files",params:r??{},body:JSON.stringify({keys:e,data:t}),method:"PATCH"}),Yi=(e,t)=>()=>({path:"/files",params:t??{},body:JSON.stringify(e),method:"PATCH"}),Zi=(e,t,r)=>()=>(o(e,"Key cannot be empty"),t instanceof FormData?{path:`/files/${e}`,params:r??{},body:t,method:"PATCH",headers:{"Content-Type":"multipart/form-data"}}:{path:`/files/${e}`,params:r??{},body:JSON.stringify(t),method:"PATCH"});var rn=(e,t,r)=>()=>(o(e,"Keys cannot be empty"),{path:"/flows",params:r??{},body:JSON.stringify({keys:e,data:t}),method:"PATCH"}),on=(e,t)=>()=>({path:"/flows",params:t??{},body:JSON.stringify(e),method:"PATCH"}),an=(e,t,r)=>()=>(o(e,"Key cannot be empty"),{path:`/flows/${e}`,params:r??{},body:JSON.stringify(t),method:"PATCH"});var nn=(e,t,r)=>()=>(o(e,"Keys cannot be empty"),{path:"/folders",params:r??{},body:JSON.stringify({keys:e,data:t}),method:"PATCH"}),cn=(e,t)=>()=>({path:"/folders",params:t??{},body:JSON.stringify(e),method:"PATCH"}),pn=(e,t,r)=>()=>(o(e,"Key cannot be empty"),{path:`/folders/${e}`,params:r??{},body:JSON.stringify(t),method:"PATCH"});var yn=(e,t,r,a)=>()=>{let s={};return o(String(e),"Collection cannot be empty"),Q(e,"Cannot use updateItems for core collections"),Array.isArray(t)?(o(t,"keysOrQuery cannot be empty"),s={keys:t}):(o(Object.keys(t),"keysOrQuery cannot be empty"),s={query:t}),s.data=r,{path:`/items/${e}`,params:a??{},body:JSON.stringify(s),method:"PATCH"}},dn=(e,t,r)=>()=>(o(String(e),"Collection cannot be empty"),Q(e,"Cannot use updateItems for core collections"),{path:`/items/${e}`,params:r??{},body:JSON.stringify(t),method:"PATCH"}),Sn=(e,t,r,a)=>()=>(o(String(t),"Key cannot be empty"),o(String(e),"Collection cannot be empty"),Q(e,"Cannot use updateItem for core collections"),{path:`/items/${e}/${t}`,params:a??{},body:JSON.stringify(r),method:"PATCH"});var Qn=(e,t,r)=>()=>(o(e,"Keys cannot be empty"),{path:"/notifications",params:r??{},body:JSON.stringify({keys:e,data:t}),method:"PATCH"}),xn=(e,t)=>()=>({path:"/notifications",params:t??{},body:JSON.stringify(e),method:"PATCH"}),Tn=(e,t,r)=>()=>(o(e,"Key cannot be empty"),{path:`/notifications/${e}`,params:r??{},body:JSON.stringify(t),method:"PATCH"});var Rn=(e,t,r)=>()=>(o(e,"Keys cannot be empty"),{path:"/operations",params:r??{},body:JSON.stringify({keys:e,data:t}),method:"PATCH"}),bn=(e,t)=>()=>({path:"/operations",params:t??{},body:JSON.stringify(e),method:"PATCH"}),Dn=(e,t,r)=>()=>(o(e,"Key cannot be empty"),{path:`/operations/${e}`,params:r??{},body:JSON.stringify(t),method:"PATCH"});var Pn=(e,t,r)=>()=>(o(e,"Keys cannot be empty"),{path:"/panels",params:r??{},body:JSON.stringify({keys:e,data:t}),method:"PATCH"}),In=(e,t)=>()=>({path:"/panels",params:t??{},body:JSON.stringify(e),method:"PATCH"}),Fn=(e,t,r)=>()=>(o(e,"Key cannot be empty"),{path:`/panels/${e}`,params:r??{},body:JSON.stringify(t),method:"PATCH"});var wn=(e,t,r)=>()=>(o(e,"Keys cannot be empty"),{path:"/permissions",params:r??{},body:JSON.stringify({keys:e,data:t}),method:"PATCH"}),Nn=(e,t)=>()=>({path:"/permissions",params:t??{},body:JSON.stringify(e),method:"PATCH"}),vn=(e,t,r)=>()=>(o(String(e),"Key cannot be empty"),{path:`/permissions/${e}`,params:r??{},body:JSON.stringify(t),method:"PATCH"});var $n=(e,t,r)=>()=>(o(e,"Keys cannot be empty"),{path:"/presets",params:r??{},body:JSON.stringify({keys:e,data:t}),method:"PATCH"}),kn=(e,t)=>()=>({path:"/presets",params:t??{},body:JSON.stringify(e),method:"PATCH"}),Kn=(e,t,r)=>()=>(o(String(e),"Key cannot be empty"),{path:`/presets/${e}`,params:r??{},body:JSON.stringify(t),method:"PATCH"});var Ln=(e,t,r,a)=>()=>(o(e,"Collection cannot be empty"),o(t,"Field cannot be empty"),{path:`/relations/${e}/${t}`,params:a??{},body:JSON.stringify(r),method:"PATCH"});var Mn=(e,t,r)=>()=>(o(e,"Keys cannot be empty"),{path:"/roles",params:r??{},body:JSON.stringify({keys:e,data:t}),method:"PATCH"}),Bn=(e,t)=>()=>({path:"/roles",params:t??{},body:JSON.stringify(e),method:"PATCH"}),_n=(e,t,r)=>()=>(o(e,"Key cannot be empty"),{path:`/roles/${e}`,params:r??{},body:JSON.stringify(t),method:"PATCH"});var zn=(e,t)=>()=>({path:"/settings",params:t??{},body:JSON.stringify(e),method:"PATCH"});var Zn=(e,t,r)=>()=>(o(e,"Keys cannot be empty"),{path:"/shares",params:r??{},body:JSON.stringify({keys:e,data:t}),method:"PATCH"}),ec=(e,t)=>()=>({path:"/shares",params:t??{},body:JSON.stringify(e),method:"PATCH"}),tc=(e,t,r)=>()=>(o(e,"Key cannot be empty"),{path:`/shares/${e}`,params:r??{},body:JSON.stringify(t),method:"PATCH"});var ac=(e,t,r)=>()=>(o(String(e),"Collection cannot be empty"),Q(e,"Cannot use updateSingleton for core collections"),{path:`/items/${e}`,params:r??{},body:JSON.stringify(t),method:"PATCH"});var ic=(e,t,r)=>()=>(o(e,"Keys cannot be empty"),{path:"/translations",params:r??{},body:JSON.stringify({keys:e,data:t}),method:"PATCH"}),nc=(e,t)=>()=>({path:"/translations",params:t??{},body:JSON.stringify(e),method:"PATCH"}),cc=(e,t,r)=>()=>(o(String(e),"Key cannot be empty"),{path:`/translations/${e}`,params:r??{},body:JSON.stringify(t),method:"PATCH"});var uc=(e,t,r)=>()=>(o(e,"Keys cannot be empty"),{path:"/users",params:r??{},body:JSON.stringify({keys:e,data:t}),method:"PATCH"}),yc=(e,t)=>()=>({path:"/users",params:t??{},body:JSON.stringify(e),method:"PATCH"}),dc=(e,t,r)=>()=>(o(e,"Key cannot be empty"),{path:`/users/${e}`,params:r??{},body:JSON.stringify(t),method:"PATCH"}),Sc=(e,t)=>()=>({path:"/users/me",params:t??{},body:JSON.stringify(e),method:"PATCH"});var Qc=(e,t,r)=>()=>(o(e,"Keys cannot be empty"),{path:"/versions",params:r??{},body:JSON.stringify({keys:e,data:t}),method:"PATCH"}),xc=(e,t)=>()=>({path:"/versions",params:t??{},body:JSON.stringify(e),method:"PATCH"}),Tc=(e,t,r)=>()=>(o(e,"Key cannot be empty"),{path:`/versions/${e}`,params:r??{},body:JSON.stringify(t),method:"PATCH"});var Rc=(e,t,r)=>()=>(o(e,"Keys cannot be empty"),{path:"/webhooks",params:r??{},body:JSON.stringify({keys:e,data:t}),method:"PATCH"}),bc=(e,t,r)=>()=>(o(String(e),"Key cannot be empty"),{path:`/webhooks/${e}`,params:r??{},body:JSON.stringify(t),method:"PATCH"});var zc=()=>()=>({method:"POST",path:"/utils/cache/clear"});var Yc=(e,t,r,a)=>()=>({method:"POST",path:`/utils/export/${e}`,body:JSON.stringify({format:t,query:r,file:a})});var ep=(e,t,r)=>()=>e==="GET"?{path:`/flows/trigger/${t}`,params:r??{},method:"GET"}:{path:`/flows/trigger/${t}`,body:JSON.stringify(r??{}),method:"POST"};var rp=e=>()=>({method:"POST",path:"/utils/hash/generate",body:JSON.stringify({string:e})}),op=(e,t)=>()=>({method:"POST",path:"/utils/hash/verify",body:JSON.stringify({string:e,hash:t})});var sp=(e,t)=>()=>({path:`/utils/import/${e}`,method:"POST",body:t,headers:{"Content-Type":"multipart/form-data"}});var ip=(e,t)=>()=>({path:`/operations/trigger/${e}`,body:JSON.stringify(t??{}),method:"POST"});var cp=(e,t,r="cookie")=>()=>({path:"/shares/auth",method:"POST",body:JSON.stringify({share:e,password:t,mode:r})}),pp=(e,t)=>()=>({path:"/shares/invite",method:"POST",body:JSON.stringify({share:e,emails:t})}),hp=e=>()=>({path:`/shares/info/${e}`,method:"GET"});var yp=(e,t,r)=>()=>({method:"POST",path:`/utils/sort/${e}`,body:JSON.stringify({item:t,to:r})});var Sp=(e,t,r)=>()=>({path:"/users/invite",method:"POST",body:JSON.stringify({email:e,role:t,...r?{invite_url:r}:{}})}),lp=(e,t)=>()=>({path:"/users/invite/accept",method:"POST",body:JSON.stringify({token:e,password:t})}),fp=(e,t,r={})=>()=>({path:"/users/register",method:"POST",body:JSON.stringify({email:e,password:t,...r})}),Qp=e=>()=>({path:"/users/register/verify-email",params:{token:e},method:"GET"}),xp=e=>()=>({path:"/users/me/tfa/generate",method:"POST",body:JSON.stringify({password:e})}),Tp=(e,t)=>()=>({path:"/users/me/tfa/enable",method:"POST",body:JSON.stringify({secret:e,otp:t})}),Cp=e=>()=>({path:"/users/me/tfa/disable",method:"POST",body:JSON.stringify({otp:e})});var bp=(e,t)=>()=>(o(e,"ID cannot be empty"),{path:`/versions/${e}/save`,method:"POST",body:JSON.stringify(t)}),Dp=e=>()=>(o(e,"ID cannot be empty"),{path:`/versions/${e}/compare`,method:"GET"}),Op=(e,t,r)=>()=>(o(e,"ID cannot be empty"),{path:`/versions/${e}/promote`,method:"POST",body:JSON.stringify(r?{mainHash:t,fields:r}:{mainHash:t})});var Pp=e=>()=>({method:"GET",path:"/utils/random/string",params:e!==void 0?{length:e}:{}});var q={},Zp=(e={})=>t=>{let r={...q,...e};return{async request(a){let s=a();if(s.headers||(s.headers={}),"Content-Type"in s.headers?s.headers["Content-Type"]==="multipart/form-data"&&delete s.headers["Content-Type"]:s.headers["Content-Type"]="application/json","getToken"in this){let y=await this.getToken();y&&(s.headers||(s.headers={}),s.headers.Authorization=`Bearer ${y}`)}let p=b(t.url,s.path,s.params),i={method:s.method??"GET",headers:s.headers??{}};"credentials"in r&&(i.credentials=r.credentials),s.body&&(i.body=s.body),s.onRequest&&(i=await s.onRequest(i)),r.onRequest&&(i=await r.onRequest(i));let c=await D(p.toString(),i,t.globals.fetch);return"onResponse"in s&&(c=await s.onResponse(c,i)),"onResponse"in e&&(c=await e.onResponse(c,i)),c}}};function th(e,t){return()=>{let r=e();return typeof t=="function"?r.onRequest=t:r.onRequest=a=>({...a,...t}),r}}function ah(e){return()=>{let t=e();return t.method==="GET"&&t.params&&(t.method="SEARCH",t.body=JSON.stringify({query:{...t.params,fields:N(t.params.fields??[])}}),delete t.params),t}}function mh(e,t){return()=>{let r=t();return e&&(r.headers||(r.headers={}),r.headers.Authorization=`Bearer ${e}`),r}}function nh(e){return()=>e}export{lp as acceptUserInvite,La as aggregate,E as auth,cp as authenticateShare,ce as authentication,zc as clearCache,Dp as compareContentVersion,ft as createCollection,St as createComment,yr as createContentVersion,ur as createContentVersions,Tt as createDashboard,xt as createDashboards,fe as createDirectus,gt as createField,Pt as createFlow,jt as createFlows,At as createFolder,Ft as createFolders,vt as createItem,Nt as createItems,$t as createNotification,Jt as createNotifications,Wt as createOperation,Kt as createOperations,Ht as createPanel,Lt as createPanels,Bt as createPermission,Mt as createPermissions,zt as createPreset,qt as createPresets,Yt as createRelation,tr as createRole,er as createRoles,ar as createShare,or as createShares,ir as createTranslation,mr as createTranslations,pr as createUser,cr as createUsers,lr as createWebhook,Sr as createWebhooks,nh as customEndpoint,Wr as deleteCollection,kr as deleteComment,ca as deleteContentVersion,na as deleteContentVersions,eo as deleteDashboard,Zr as deleteDashboards,oo as deleteField,io as deleteFile,mo as deleteFiles,ho as deleteFlow,po as deleteFlows,lo as deleteFolder,So as deleteFolders,To as deleteItem,xo as deleteItems,bo as deleteNotification,Ro as deleteNotifications,Po as deleteOperation,jo as deleteOperations,Eo as deletePanel,Ao as deletePanels,Uo as deletePermission,vo as deletePermissions,Ko as deletePreset,ko as deletePresets,Lo as deleteRelation,Bo as deleteRole,Mo as deleteRoles,Xo as deleteShare,zo as deleteShares,ta as deleteTranslation,ea as deleteTranslations,sa as deleteUser,aa as deleteUsers,ya as deleteWebhook,ua as deleteWebhooks,Cp as disableTwoFactor,Tp as enableTwoFactor,N as formatFields,rp as generateHash,xp as generateTwoFactorSecret,w as generateUid,I as getAuthEndpoint,Ce as graphql,Dt as importFile,pp as inviteShare,Sp as inviteUser,ze as login,Ye as logout,$ as memoryStorage,A as messageCallback,et as passwordRequest,rt as passwordReset,K as pong,Op as promoteContentVersion,v as queryToParams,Pp as randomString,Ja as readActivities,$a as readActivity,_a as readAssetArrayBuffer,Ba as readAssetBlob,Ma as readAssetRaw,Ya as readCollection,Xa as readCollections,jm as readContentVersion,Om as readContentVersions,rs as readDashboard,ts as readDashboards,as as readExtensions,cs as readField,is as readFields,ns as readFieldsByCollection,ys as readFile,us as readFiles,fs as readFlow,ls as readFlows,Cs as readFolder,Ts as readFolders,li as readGraphqlSdl,Ds as readItem,Gs as readItemPermissions,bs as readItems,Rm as readMe,Is as readNotification,Ps as readNotifications,gi as readOpenApiSpec,ws as readOperation,Es as readOperations,Js as readPanel,Us as readPanels,Ws as readPermission,Ks as readPermissions,Ms as readPreset,Vs as readPresets,at as readProviders,Xs as readRelation,zs as readRelationByCollection,qs as readRelations,tm as readRevision,em as readRevisions,sm as readRole,am as readRoles,im as readSettings,hm as readShare,hp as readShareInfo,pm as readShares,dm as readSingleton,Qm as readTranslation,fm as readTranslations,gm as readUser,Cm as readUsers,Am as readWebhook,Fm as readWebhooks,Ue as realtime,mt as refresh,fp as registerUser,Qp as registerUserVerify,Zp as rest,bp as saveToContentVersion,mi as schemaApply,ni as schemaDiff,pi as schemaSnapshot,Qi as serverHealth,Ti as serverInfo,bi as serverPing,$e as sleep,he as staticToken,Q as throwIfCoreCollection,o as throwIfEmpty,ep as triggerFlow,ip as triggerOperation,Ui as updateCollection,Ji as updateCollectionsBatch,wi as updateComment,Tc as updateContentVersion,Qc as updateContentVersions,xc as updateContentVersionsBatch,Gi as updateDashboard,Ki as updateDashboards,Wi as updateDashboardsBatch,Vi as updateExtension,_i as updateField,Zi as updateFile,Xi as updateFiles,Yi as updateFilesBatch,an as updateFlow,rn as updateFlows,on as updateFlowsBatch,pn as updateFolder,nn as updateFolders,cn as updateFoldersBatch,Sn as updateItem,yn as updateItems,dn as updateItemsBatch,Sc as updateMe,Tn as updateNotification,Qn as updateNotifications,xn as updateNotificationsBatch,Dn as updateOperation,Rn as updateOperations,bn as updateOperationsBatch,Fn as updatePanel,Pn as updatePanels,In as updatePanelsBatch,vn as updatePermission,wn as updatePermissions,Nn as updatePermissionsBatch,Kn as updatePreset,$n as updatePresets,kn as updatePresetsBatch,Ln as updateRelation,_n as updateRole,Mn as updateRoles,Bn as updateRolesBatch,zn as updateSettings,tc as updateShare,Zn as updateShares,ec as updateSharesBatch,ac as updateSingleton,cc as updateTranslation,ic as updateTranslations,nc as updateTranslationsBatch,dc as updateUser,uc as updateUsers,yc as updateUsersBatch,bc as updateWebhook,Rc as updateWebhooks,bt as uploadFiles,yp as utilitySort,Yc as utilsExport,sp as utilsImport,op as verifyHash,th as withOptions,ah as withSearch,mh as withToken}; | ||
function A(e){return e?`/auth/login/${e}`:"/auth/login"}var E="/",L=(e,t)=>(e.endsWith(E)&&(e=e.slice(0,-1)),t.startsWith(E)||(t=E+t),e+t),R=(e,t,r)=>{let a=e.pathname===E?t:L(e.pathname,t),s=new globalThis.URL(a,e);if(r)for(let[c,i]of Object.entries(J(r)))if(i&&typeof i=="object"&&!Array.isArray(i))for(let[p,u]of Object.entries(i))s.searchParams.set(`${c}[${p}]`,String(u));else s.searchParams.set(c,i);return s};function $(e){return typeof e!="object"||!e?!1:"headers"in e&&"ok"in e&&"json"in e&&typeof e.json=="function"&&"text"in e&&typeof e.json=="function"}async function k(e){if(!(typeof e!="object"||!e)){if($(e)){let t=e.headers.get("Content-Type")?.toLowerCase();if(t?.startsWith("application/json")||t?.startsWith("application/health+json")){let r=await e.json();if(!e.ok)throw r;return"data"in r?r.data:r}if(t?.startsWith("text/html")||t?.startsWith("text/plain")){let r=await e.text();if(!e.ok)throw r;return r}return e}return"data"in e?e.data:e}}var b=async(e,t,r=globalThis.fetch)=>(t.headers=typeof t.headers=="object"&&!Array.isArray(t.headers)?t.headers:{},r(e,t).then(a=>k(a).catch(s=>{let c=typeof s=="object"&&"errors"in s?s.errors:s;return Promise.reject({errors:c,response:a})})));var K=()=>{let e=null;return{get:async()=>e,set:async t=>{e=t}}};var H={msRefreshBeforeExpires:3e4,autoRefresh:!0},_=2**31-1,ne=(e="cookie",t={})=>r=>{let a={...H,...t},s=null,c=null,i=a.storage??K(),p=async()=>i.set({access_token:null,refresh_token:null,expires:null,expires_at:null}),u=async()=>{try{await s}finally{s=null}},f=async()=>{let h=await i.get();return s||!h?.expires_at||h.expires_at<new Date().getTime()+a.msRefreshBeforeExpires&&I().catch(l=>{}),u()},D=async h=>{let l=h.expires??0;h.expires_at=new Date().getTime()+l,await i.set(h),a.autoRefresh&&l>a.msRefreshBeforeExpires&&l<_&&(c&&clearTimeout(c),c=setTimeout(()=>{c=null,I().catch(Q=>{})},l-a.msRefreshBeforeExpires))},I=async()=>(s=(async()=>{let l=await i.get();await p();let Q={method:"POST",headers:{"Content-Type":"application/json"}};"credentials"in a&&(Q.credentials=a.credentials);let C={mode:e};e==="json"&&l?.refresh_token&&(C.refresh_token=l.refresh_token),Q.body=JSON.stringify(C);let m=R(r.url,"/auth/refresh");return b(m.toString(),Q,r.globals.fetch).then(n=>D(n).then(()=>n))})(),s);return{refresh:I,async login(h,l,Q={}){await p();let C={email:h,password:l};"otp"in Q&&(C.otp=Q.otp),C.mode=Q.mode??e;let m=A(Q.provider),n=R(r.url,m),y={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(C)};"credentials"in a&&(y.credentials=a.credentials);let d=await b(n.toString(),y,r.globals.fetch);return await D(d),d},async logout(){let h=await i.get(),l={method:"POST",headers:{"Content-Type":"application/json"}};"credentials"in a&&(l.credentials=a.credentials);let Q={mode:e};e==="json"&&h?.refresh_token&&(Q.refresh_token=h.refresh_token),l.body=JSON.stringify(Q);let C=R(r.url,"/auth/logout");await b(C.toString(),l,r.globals.fetch),this.stopRefreshing(),await p()},stopRefreshing(){c&&clearTimeout(c)},async getToken(){return await f().catch(()=>{}),(await i.get())?.access_token??null},async setToken(h){return i.set({access_token:h,refresh_token:null,expires:null,expires_at:null})}}};var pe=e=>t=>{let r=e??null;return{async getToken(){return r},async setToken(a){r=a}}};var W={fetch:globalThis.fetch,WebSocket:globalThis.WebSocket,URL:globalThis.URL,logger:globalThis.console},le=(e,t={})=>{let r=t.globals?{...W,...t.globals}:W;return{globals:r,url:new r.URL(e),with(a){return{...this,...a(this)}}}};var V={},Te=(e={})=>t=>{let r={...V,...e};return{async query(a,s,c="items"){let i={method:"POST",body:JSON.stringify({query:a,variables:s})};"credentials"in r&&(i.credentials=r.credentials);let p={};if("getToken"in this){let D=await this.getToken();D&&(p.Authorization=`Bearer ${D}`)}"Content-Type"in p||(p["Content-Type"]="application/json"),i.headers=p;let u=c==="items"?"/graphql":"/graphql/system",f=R(t.url,u);return await b(f.toString(),i,t.globals.fetch)}}};function N(e){return JSON.stringify({...e,type:"auth"})}var G=()=>JSON.stringify({type:"pong"});function*v(){let e=1;for(;;)yield String(e),e++}var w=(e,t=1e3)=>new Promise((r,a)=>{let s=u=>{try{let f=JSON.parse(u.data);typeof f=="object"&&!Array.isArray(f)&&f!==null?(i(),r(f)):(i(),c())}catch{i(),r(u)}},c=()=>a(),i=()=>{clearTimeout(p),e.removeEventListener("message",s),e.removeEventListener("error",c),e.removeEventListener("close",c)};e.addEventListener("message",s),e.addEventListener("error",c),e.addEventListener("close",c);let p=setTimeout(()=>{i(),r(void 0)},t)});var M={authMode:"handshake",heartbeat:!0,debug:!1,reconnect:{delay:1e3,retries:10}};function ve(e={}){return t=>{e={...M,...e};let r=v(),a={code:"closed"},s={attempts:0,active:!1},c=!1,i=new Set,p=m=>"getToken"in m,u=(m,...n)=>e.debug&&t.globals.logger[m]("[Directus SDK]",...n),f=async(m,n)=>{let y=new t.globals.URL(m);if(e.authMode==="strict"&&p(n)){let d=await n.getToken();d&&y.searchParams.set("access_token",d)}return y.toString()},D=async m=>{if("url"in e)return await f(e.url,m);if(["ws:","wss:"].includes(t.url.protocol))return await f(t.url,m);let n=new t.globals.URL(t.url.toString());return n.protocol=t.url.protocol==="https:"?"wss:":"ws:",n.pathname="/websocket",await f(n,m)},I=m=>{let n=new Promise((y,d)=>{if(!e.reconnect||c)return d();if(u("info",`reconnect #${s.attempts} `+(s.attempts>=e.reconnect.retries?"maximum retries reached":`trying again in ${Math.max(100,e.reconnect.delay)}ms`)),s.active)return s.active;if(s.attempts>=e.reconnect.retries)return d();setTimeout(()=>m.connect().then(O=>(i.forEach(S=>{m.sendMessage(S)}),O)).then(y).catch(d),Math.max(100,e.reconnect.delay))});s.attempts+=1,s.active=n.catch(()=>{}).finally(()=>{s.active=!1})},h={open:new Set([]),error:new Set([]),close:new Set([]),message:new Set([])};function l(m){return"type"in m&&"status"in m&&"error"in m&&"code"in m.error&&"message"in m.error&&m.type==="auth"&&m.status==="error"}async function Q(m,n){if(a.code==="open"){if(m.error.code==="TOKEN_EXPIRED"&&(u("warn","Authentication token expired!"),p(n))){let y=await n.getToken();if(!y)throw Error("No token for re-authenticating the websocket");a.connection.send(N({access_token:y}))}if(m.error.code==="AUTH_TIMEOUT")return a.firstMessage&&e.authMode==="public"?(u("warn",'Authentication failed! Currently the "authMode" is "public" try using "handshake" instead'),e.reconnect=!1):u("warn","Authentication timed out!"),a.connection.close();if(m.error.code==="AUTH_FAILED"){if(a.firstMessage&&e.authMode==="public")return u("warn",'Authentication failed! Currently the "authMode" is "public" try using "handshake" instead'),e.reconnect=!1,a.connection.close();u("warn","Authentication failed!")}}}let C=async m=>{for(;a.code==="open";){let n=await w(a.connection).catch(()=>{});if(n){if(l(n)){await Q(n,m),a.firstMessage=!1;continue}if(e.heartbeat&&n.type==="ping"){a.connection.send(G()),a.firstMessage=!1;continue}h.message.forEach(y=>{a.code==="open"&&y.call(a.connection,n)}),a.firstMessage=!1}}};return{async connect(){if(c=!1,a.code==="connecting")return await a.connection;if(a.code!=="closed")throw new Error(`Cannot connect when state is "${a.code}"`);let m=this,n=await D(m);u("info",`Connecting to ${n}...`);let y=new Promise((d,O)=>{let S=!1,T=new t.globals.WebSocket(n);T.addEventListener("open",async j=>{if(u("info","Connection open."),a={code:"open",connection:T,firstMessage:!0},s.attempts=0,s.active=!1,C(m),e.authMode==="handshake"&&p(m)){let g=await m.getToken();if(!g)throw Error("No token for authenticating the websocket. Make sure to provide one or call the login() function beforehand.");T.send(N({access_token:g}));let F=await w(T);if(F&&"type"in F&&"status"in F&&F.type==="auth"&&F.status==="ok")u("info","Authentication successful!");else return O("Authentication failed while opening websocket connection")}h.open.forEach(g=>g.call(T,j)),S=!0,d(T)}),T.addEventListener("error",j=>{u("warn","Connection errored."),h.error.forEach(g=>g.call(T,j)),T.close(),a={code:"error"},S||O(j)}),T.addEventListener("close",j=>{u("info","Connection closed."),h.close.forEach(g=>g.call(T,j)),r=v(),a={code:"closed"},I(this),S||O(j)})});return a={code:"connecting",connection:y},y},disconnect(){c=!0,a.code==="open"&&a.connection.close()},onWebSocket(m,n){if(m==="message"){let y=function(d){if(typeof d.data!="string")return n.call(this,d);try{return n.call(this,JSON.parse(d.data))}catch{return n.call(this,d)}};return h[m].add(y),()=>h[m].delete(y)}return h[m].add(n),()=>h[m].delete(n)},sendMessage(m){if(a.code!=="open")throw new Error('Cannot send messages without an open connection. Make sure you are calling "await client.connect()".');if(typeof m=="string")return a.connection.send(m);"uid"in m||(m.uid=r.next().value),a.connection.send(JSON.stringify(m))},async subscribe(m,n={}){"uid"in n||(n.uid=r.next().value),i.add({...n,collection:m,type:"subscribe"}),a.code!=="open"&&(u("info","No connection available for subscribing!"),await this.connect()),this.sendMessage({...n,collection:m,type:"subscribe"});let y=!0;async function*d(){for(;y&&a.code==="open";){let S=await w(a.connection).catch(()=>{});if(S){if("type"in S&&"status"in S&&S.type==="subscribe"&&S.status==="error")throw S;"type"in S&&"uid"in S&&S.type==="subscription"&&S.uid===n.uid&&(yield S)}}e.reconnect&&s.active&&(await s.active,a.code==="open"&&(a.connection.send(JSON.stringify({...n,collection:m,type:"subscribe"})),yield*d()))}let O=()=>{i.delete({...n,collection:m,type:"subscribe"}),this.sendMessage({uid:n.uid,type:"unsubscribe"}),y=!1};return{subscription:d(),unsubscribe:O}}}}}var Je=e=>new Promise(t=>setTimeout(()=>t(),e));var qe=(e,t,r={})=>()=>{let a=A(r.provider),s={email:e,password:t};return"otp"in r&&(s.otp=r.otp),s.mode=r.mode??"cookie",{path:a,method:"POST",body:JSON.stringify(s)}};var Xe=(e,t="cookie")=>()=>({path:"/auth/logout",method:"POST",body:JSON.stringify(e?{refresh_token:e,mode:t}:{mode:t})});var Ze=(e,t)=>()=>({path:"/auth/password/request",method:"POST",body:JSON.stringify({email:e,...t?{reset_url:t}:{}})});var tt=(e,t)=>()=>({path:"/auth/password/reset",method:"POST",body:JSON.stringify({token:e,password:t})});var ot=(e=!1)=>()=>({path:e?"/auth?sessionOnly":"/auth",method:"GET"});var st=(e="cookie",t)=>()=>({path:"/auth/refresh",method:"POST",body:JSON.stringify(e==="json"?{refresh_token:t,mode:e}:{mode:e})});var dt=(e,t)=>()=>({path:"/activity/comment",params:t??{},body:JSON.stringify(e),method:"POST"});var lt=(e,t)=>()=>({path:"/collections",params:t??{},body:JSON.stringify(e),method:"POST"});var Qt=(e,t)=>()=>({path:"/dashboards",params:t??{},body:JSON.stringify(e),method:"POST"}),xt=(e,t)=>()=>({path:"/dashboards",params:t??{},body:JSON.stringify(e),method:"POST"});var Ct=(e,t,r)=>()=>({path:`/fields/${e}`,params:r??{},body:JSON.stringify(t),method:"POST"});var Rt=(e,t)=>()=>({path:"/files",method:"POST",body:e,params:t??{},headers:{"Content-Type":"multipart/form-data"}}),bt=(e,t={},r)=>()=>({path:"/files/import",method:"POST",body:JSON.stringify({url:e,data:t}),params:r??{}});var Ot=(e,t)=>()=>({path:"/flows",params:t??{},body:JSON.stringify(e),method:"POST"}),jt=(e,t)=>()=>({path:"/flows",params:t??{},body:JSON.stringify(e),method:"POST"});var It=(e,t)=>()=>({path:"/folders",params:t??{},body:JSON.stringify(e),method:"POST"}),Ft=(e,t)=>()=>({path:"/folders",params:t??{},body:JSON.stringify(e),method:"POST"});function P(e){return["directus_activity","directus_collections","directus_fields","directus_files","directus_folders","directus_migrations","directus_permissions","directus_presets","directus_relations","directus_revisions","directus_roles","directus_sessions","directus_settings","directus_users","directus_webhooks","directus_dashboards","directus_panels","directus_notifications","directus_shares","directus_flows","directus_operations","directus_translations","directus_versions","directus_extensions"].includes(e)}var Nt=(e,t,r)=>()=>{let a=String(e);if(P(a))throw new Error("Cannot use createItems for core collections");return{path:`/items/${a}`,params:r??{},body:JSON.stringify(t),method:"POST"}},vt=(e,t,r)=>()=>{let a=String(e);if(P(a))throw new Error("Cannot use createItem for core collections");return{path:`/items/${a}`,params:r??{},body:JSON.stringify(t),method:"POST"}};var Jt=(e,t)=>()=>({path:"/notifications",params:t??{},body:JSON.stringify(e),method:"POST"}),$t=(e,t)=>()=>({path:"/notifications",params:t??{},body:JSON.stringify(e),method:"POST"});var Kt=(e,t)=>()=>({path:"/operations",params:t??{},body:JSON.stringify(e),method:"POST"}),Wt=(e,t)=>()=>({path:"/operations",params:t??{},body:JSON.stringify(e),method:"POST"});var Lt=(e,t)=>()=>({path:"/panels",params:t??{},body:JSON.stringify(e),method:"POST"}),Ht=(e,t)=>()=>({path:"/panels",params:t??{},body:JSON.stringify(e),method:"POST"});var Vt=(e,t)=>()=>({path:"/permissions",params:t??{},body:JSON.stringify(e),method:"POST"}),Mt=(e,t)=>()=>({path:"/permissions",params:t??{},body:JSON.stringify(e),method:"POST"});var qt=(e,t)=>()=>({path:"/presets",params:t??{},body:JSON.stringify(e),method:"POST"}),zt=(e,t)=>()=>({path:"/presets",params:t??{},body:JSON.stringify(e),method:"POST"});var Yt=e=>()=>({path:"/relations",body:JSON.stringify(e),method:"POST"});var er=(e,t)=>()=>({path:"/roles",params:t??{},body:JSON.stringify(e),method:"POST"}),tr=(e,t)=>()=>({path:"/roles",params:t??{},body:JSON.stringify(e),method:"POST"});var or=(e,t)=>()=>({path:"/shares",params:t??{},body:JSON.stringify(e),method:"POST"}),ar=(e,t)=>()=>({path:"/shares",params:t??{},body:JSON.stringify(e),method:"POST"});var mr=(e,t)=>()=>({path:"/translations",params:t??{},body:JSON.stringify(e),method:"POST"}),ir=(e,t)=>()=>({path:"/translations",params:t??{},body:JSON.stringify(e),method:"POST"});var cr=(e,t)=>()=>({path:"/users",params:t??{},body:JSON.stringify(e),method:"POST"}),pr=(e,t)=>()=>({path:"/users",params:t??{},body:JSON.stringify(e),method:"POST"});var hr=(e,t)=>()=>({path:"/versions",params:t??{},body:JSON.stringify(e),method:"POST"}),yr=(e,t)=>()=>({path:"/versions",params:t??{},body:JSON.stringify(e),method:"POST"});var Sr=(e,t)=>()=>({path:"/webhooks",params:t??{},body:JSON.stringify(e),method:"POST"}),lr=(e,t)=>()=>({path:"/webhooks",params:t??{},body:JSON.stringify(e),method:"POST"});var kr=e=>()=>({path:`/activity/comment/${e}`,method:"DELETE"});var Wr=e=>()=>({path:`/collections/${e}`,method:"DELETE"});var U=e=>{let t=(r,a=[])=>{if(typeof r=="object"){let s=[];for(let c in r){let i=r[c]??[];if(Array.isArray(i))for(let p of i)s.push(t(p,[...a,c]));else if(typeof i=="object")for(let p of Object.keys(i)){let u=i[p];for(let f of u)s.push(t(f,[...a,`${c}:${p}`]))}}return s.flatMap(c=>c)}return[...a,String(r)].join(".")};return e.flatMap(r=>t(r))},J=e=>{let t={};Array.isArray(e.fields)&&e.fields.length>0&&(t.fields=U(e.fields).join(",")),e.filter&&Object.keys(e.filter).length>0&&(t.filter=JSON.stringify(e.filter)),e.search&&(t.search=e.search),"sort"in e&&e.sort&&(t.sort=typeof e.sort=="string"?e.sort:e.sort.join(",")),typeof e.limit=="number"&&e.limit>=-1&&(t.limit=String(e.limit)),typeof e.offset=="number"&&e.offset>=0&&(t.offset=String(e.offset)),typeof e.page=="number"&&e.page>=1&&(t.page=String(e.page)),e.deep&&Object.keys(e.deep).length>0&&(t.deep=JSON.stringify(e.deep)),e.alias&&Object.keys(e.alias).length>0&&(t.alias=JSON.stringify(e.alias)),e.aggregate&&Object.keys(e.aggregate).length>0&&(t.aggregate=JSON.stringify(e.aggregate)),e.groupBy&&e.groupBy.length>0&&(t.groupBy=e.groupBy.join(","));for(let[r,a]of Object.entries(e))r in t||(typeof a=="string"||typeof a=="number"||typeof a=="boolean"?t[r]=String(a):t[r]=JSON.stringify(a));return t};var o=(e,t)=>{if(e.length===0)throw new Error(t)};var x=(e,t)=>{if(P(String(e)))throw new Error(t)};var Zr=e=>()=>(o(e,"Keys cannot be empty"),{path:"/dashboards",body:JSON.stringify(e),method:"DELETE"}),eo=e=>()=>(o(e,"Key cannot be empty"),{path:`/dashboards/${e}`,method:"DELETE"});var oo=(e,t)=>()=>(o(e,"Collection cannot be empty"),o(t,"Field cannot be empty"),{path:`/fields/${e}/${t}`,method:"DELETE"});var mo=e=>()=>(o(e,"Keys cannot be empty"),{path:"/files",body:JSON.stringify(e),method:"DELETE"}),io=e=>()=>(o(e,"Key cannot be empty"),{path:`/files/${e}`,method:"DELETE"});var po=e=>()=>(o(e,"Keys cannot be empty"),{path:"/flows",body:JSON.stringify(e),method:"DELETE"}),uo=e=>()=>(o(e,"Key cannot be empty"),{path:`/flows/${e}`,method:"DELETE"});var So=e=>()=>(o(e,"Keys cannot be empty"),{path:"/folders",body:JSON.stringify(e),method:"DELETE"}),lo=e=>()=>(o(e,"Key cannot be empty"),{path:`/folders/${e}`,method:"DELETE"});var xo=(e,t)=>()=>{let r={};return o(String(e),"Collection cannot be empty"),x(e,"Cannot use deleteItems for core collections"),Array.isArray(t)?(o(t,"keysOrQuery cannot be empty"),r={keys:t}):(o(Object.keys(t),"keysOrQuery cannot be empty"),r={query:t}),{path:`/items/${e}`,body:JSON.stringify(r),method:"DELETE"}},To=(e,t)=>()=>(o(String(e),"Collection cannot be empty"),x(e,"Cannot use deleteItem for core collections"),o(String(t),"Key cannot be empty"),{path:`/items/${e}/${t}`,method:"DELETE"});var Ro=e=>()=>(o(e,"Keys cannot be empty"),{path:"/notifications",body:JSON.stringify(e),method:"DELETE"}),bo=e=>()=>(o(e,"Key cannot be empty"),{path:`/notifications/${e}`,method:"DELETE"});var jo=e=>()=>(o(e,"Keys cannot be empty"),{path:"/operations",body:JSON.stringify(e),method:"DELETE"}),Po=e=>()=>(o(e,"Key cannot be empty"),{path:`/operations/${e}`,method:"DELETE"});var Ao=e=>()=>(o(e,"Keys cannot be empty"),{path:"/panels",body:JSON.stringify(e),method:"DELETE"}),Eo=e=>()=>(o(e,"Key cannot be empty"),{path:`/panels/${e}`,method:"DELETE"});var vo=e=>()=>(o(e,"Keys cannot be empty"),{path:"/permissions",body:JSON.stringify(e),method:"DELETE"}),Uo=e=>()=>(o(String(e),"Key cannot be empty"),{path:`/permissions/${e}`,method:"DELETE"});var ko=e=>()=>(o(e,"Keys cannot be empty"),{path:"/presets",body:JSON.stringify(e),method:"DELETE"}),Ko=e=>()=>(o(String(e),"Key cannot be empty"),{path:`/presets/${e}`,method:"DELETE"});var Lo=(e,t)=>()=>(o(e,"Collection cannot be empty"),o(t,"Field cannot be empty"),{path:`/relations/${e}/${t}`,method:"DELETE"});var Vo=e=>()=>(o(e,"Keys cannot be empty"),{path:"/roles",body:JSON.stringify(e),method:"DELETE"}),Mo=e=>()=>(o(String(e),"Key cannot be empty"),{path:`/roles/${e}`,method:"DELETE"});var zo=e=>()=>(o(e,"Keys cannot be empty"),{path:"/shares",body:JSON.stringify(e),method:"DELETE"}),Xo=e=>()=>(o(String(e),"Key cannot be empty"),{path:`/shares/${e}`,method:"DELETE"});var ea=e=>()=>(o(e,"Keys cannot be empty"),{path:"/translations",body:JSON.stringify(e),method:"DELETE"}),ta=e=>()=>(o(String(e),"Key cannot be empty"),{path:`/translations/${e}`,method:"DELETE"});var aa=e=>()=>(o(e,"Keys cannot be empty"),{path:"/users",body:JSON.stringify(e),method:"DELETE"}),sa=e=>()=>(o(String(e),"Key cannot be empty"),{path:`/users/${e}`,method:"DELETE"});var na=e=>()=>(o(e,"Keys cannot be empty"),{path:"/versions",body:JSON.stringify(e),method:"DELETE"}),ca=e=>()=>(o(e,"Key cannot be empty"),{path:`/versions/${e}`,method:"DELETE"});var ha=e=>()=>(o(e,"Keys cannot be empty"),{path:"/webhooks",body:JSON.stringify(e),method:"DELETE"}),ya=e=>()=>(o(String(e),"Key cannot be empty"),{path:`/webhooks/${e}`,method:"DELETE"});var Ja=e=>()=>({path:"/activity",params:e??{},method:"GET"}),$a=(e,t)=>()=>(o(String(e),"Key cannot be empty"),{path:`/activity/${e}`,params:t??{},method:"GET"});var La=(e,t)=>()=>{let r=String(e);return o(r,"Collection cannot be empty"),{path:P(r)?`/${r.substring(9)}`:`/items/${r}`,method:"GET",params:{...t.query??{},...t.groupBy?{groupBy:t.groupBy}:{},aggregate:t.aggregate}}};var Va=(e,t)=>()=>(o(String(e),"Key cannot be empty"),{path:`/assets/${e}`,params:t??{},method:"GET",onResponse:r=>r.body}),Ma=(e,t)=>()=>(o(String(e),"Key cannot be empty"),{path:`/assets/${e}`,params:t??{},method:"GET",onResponse:r=>r.blob()}),Ba=(e,t)=>()=>(o(String(e),"Key cannot be empty"),{path:`/assets/${e}`,params:t??{},method:"GET",onResponse:r=>r.arrayBuffer()});var Xa=()=>()=>({path:"/collections",method:"GET"}),Ya=e=>()=>(o(e,"Collection cannot be empty"),{path:`/collections/${e}`,method:"GET"});var ts=e=>()=>({path:"/dashboards",params:e??{},method:"GET"}),rs=(e,t)=>()=>(o(String(e),"Key cannot be empty"),{path:`/dashboards/${e}`,params:t??{},method:"GET"});var as=()=>()=>({path:"/extensions/",method:"GET"});var is=()=>()=>({path:"/fields",method:"GET"}),ns=e=>()=>(o(e,"Collection cannot be empty"),{path:`/fields/${e}`,method:"GET"}),cs=(e,t)=>()=>(o(e,"Collection cannot be empty"),o(t,"Field cannot be empty"),{path:`/fields/${e}/${t}`,method:"GET"});var hs=e=>()=>({path:"/files",params:e??{},method:"GET"}),ys=(e,t)=>()=>(o(String(e),"Key cannot be empty"),{path:`/files/${e}`,params:t??{},method:"GET"});var ls=e=>()=>({path:"/flows",params:e??{},method:"GET"}),fs=(e,t)=>()=>(o(String(e),"Key cannot be empty"),{path:`/flows/${e}`,params:t??{},method:"GET"});var Ts=e=>()=>({path:"/folders",params:e??{},method:"GET"}),Cs=(e,t)=>()=>(o(String(e),"Key cannot be empty"),{path:`/folders/${e}`,params:t??{},method:"GET"});var bs=(e,t)=>()=>(o(String(e),"Collection cannot be empty"),x(e,"Cannot use readItems for core collections"),{path:`/items/${e}`,params:t??{},method:"GET"}),Ds=(e,t,r)=>()=>(o(String(e),"Collection cannot be empty"),x(e,"Cannot use readItem for core collections"),o(String(t),"Key cannot be empty"),{path:`/items/${e}/${t}`,params:r??{},method:"GET"});var Ps=e=>()=>({path:"/notifications",params:e??{},method:"GET"}),Is=(e,t)=>()=>(o(String(e),"Key cannot be empty"),{path:`/notifications/${e}`,params:t??{},method:"GET"});var Es=e=>()=>({path:"/operations",params:e??{},method:"GET"}),ws=(e,t)=>()=>(o(String(e),"Key cannot be empty"),{path:`/operations/${e}`,params:t??{},method:"GET"});var Us=e=>()=>({path:"/panels",params:e??{},method:"GET"}),Js=(e,t)=>()=>(o(String(e),"Key cannot be empty"),{path:`/panels/${e}`,params:t??{},method:"GET"});var Ks=e=>()=>({path:"/permissions",params:e??{},method:"GET"}),Ws=(e,t)=>()=>(o(String(e),"Key cannot be empty"),{path:`/permissions/${e}`,params:t??{},method:"GET"}),Gs=(e,t)=>()=>(o(String(e),"Collection cannot be empty"),{path:`/permissions/me/${t?`${e}/${t}`:`${e}`}`,method:"GET"});var _s=e=>()=>({path:"/presets",params:e??{},method:"GET"}),Vs=(e,t)=>()=>(o(String(e),"Key cannot be empty"),{path:`/presets/${e}`,params:t??{},method:"GET"});var qs=()=>()=>({path:"/relations",method:"GET"}),zs=e=>()=>({path:`/relations/${e}`,method:"GET"}),Xs=(e,t)=>()=>(o(e,"Collection cannot be empty"),o(t,"Field cannot be empty"),{path:`/relations/${e}/${t}`,method:"GET"});var em=e=>()=>({path:"/revisions",params:e??{},method:"GET"}),tm=(e,t)=>()=>(o(String(e),"Key cannot be empty"),{path:`/revisions/${e}`,params:t??{},method:"GET"});var am=e=>()=>({path:"/roles",params:e??{},method:"GET"}),sm=(e,t)=>()=>(o(String(e),"Key cannot be empty"),{path:`/roles/${e}`,params:t??{},method:"GET"});var im=e=>()=>({path:"/settings",params:e??{},method:"GET"});var pm=e=>()=>({path:"/shares",params:e??{},method:"GET"}),um=(e,t)=>()=>(o(String(e),"Key cannot be empty"),{path:`/shares/${e}`,params:t??{},method:"GET"});var dm=(e,t)=>()=>(o(String(e),"Collection cannot be empty"),x(e,"Cannot use readSingleton for core collections"),{path:`/items/${e}`,params:t??{},method:"GET"});var fm=e=>()=>({path:"/translations",params:e??{},method:"GET"}),Qm=(e,t)=>()=>(o(String(e),"Key cannot be empty"),{path:`/translations/${e}`,params:t??{},method:"GET"});var Cm=e=>()=>({path:"/users",params:e??{},method:"GET"}),gm=(e,t)=>()=>(o(String(e),"Key cannot be empty"),{path:`/users/${e}`,params:t??{},method:"GET"}),Rm=e=>()=>({path:"/users/me",params:e??{},method:"GET"});var Om=e=>()=>({path:"/versions",params:e??{},method:"GET"}),jm=(e,t)=>()=>(o(String(e),"Key cannot be empty"),{path:`/versions/${e}`,params:t??{},method:"GET"});var Fm=e=>()=>({path:"/webhooks",params:e??{},method:"GET"}),Am=(e,t)=>()=>(o(String(e),"Key cannot be empty"),{path:`/webhooks/${e}`,params:t??{},method:"GET"});var mi=e=>()=>({method:"POST",path:"/schema/apply",body:JSON.stringify(e)});var ni=(e,t=!1)=>()=>({method:"POST",path:"/schema/diff",params:t?{force:t}:{},body:JSON.stringify(e)});var pi=()=>()=>({method:"GET",path:"/schema/snapshot"});var li=(e="item")=>()=>({method:"GET",path:e==="item"?"/server/specs/graphql":"/server/specs/graphql/system"});var Qi=()=>()=>({method:"GET",path:"/server/health"});var Ti=()=>()=>({method:"GET",path:"/server/info"});var gi=()=>()=>({method:"GET",path:"/server/specs/oas"});var bi=()=>()=>({method:"GET",path:"/server/ping"});var wi=(e,t,r)=>()=>(o(String(e),"Key cannot be empty"),{path:`/activity/comment/${e}`,params:r??{},body:JSON.stringify(t),method:"PATCH"});var Ui=(e,t,r)=>()=>(o(e,"Collection cannot be empty"),{path:`/collections/${e}`,params:r??{},body:JSON.stringify(t),method:"PATCH"}),Ji=(e,t)=>()=>({path:"/collections",params:t??{},body:JSON.stringify(e),method:"PATCH"});var Ki=(e,t,r)=>()=>(o(e,"Keys cannot be empty"),{path:"/dashboards",params:r??{},body:JSON.stringify({keys:e,data:t}),method:"PATCH"}),Wi=(e,t)=>()=>({path:"/dashboards",params:t??{},body:JSON.stringify(e),method:"PATCH"}),Gi=(e,t,r)=>()=>(o(e,"Key cannot be empty"),{path:`/dashboards/${e}`,params:r??{},body:JSON.stringify(t),method:"PATCH"});var _i=(e,t,r)=>()=>(e!==null&&o(e,"Bundle cannot be an empty string"),o(t,"Name cannot be empty"),{path:e?`/extensions/${e}/${t}`:`/extensions/${t}`,params:{},body:JSON.stringify(r),method:"PATCH"});var Bi=(e,t,r,a)=>()=>(o(e,"Keys cannot be empty"),o(t,"Field cannot be empty"),{path:`/fields/${e}/${t}`,params:a??{},body:JSON.stringify(r),method:"PATCH"});var Xi=(e,t,r)=>()=>(o(e,"Keys cannot be empty"),{path:"/files",params:r??{},body:JSON.stringify({keys:e,data:t}),method:"PATCH"}),Yi=(e,t)=>()=>({path:"/files",params:t??{},body:JSON.stringify(e),method:"PATCH"}),Zi=(e,t,r)=>()=>(o(e,"Key cannot be empty"),t instanceof FormData?{path:`/files/${e}`,params:r??{},body:t,method:"PATCH",headers:{"Content-Type":"multipart/form-data"}}:{path:`/files/${e}`,params:r??{},body:JSON.stringify(t),method:"PATCH"});var rn=(e,t,r)=>()=>(o(e,"Keys cannot be empty"),{path:"/flows",params:r??{},body:JSON.stringify({keys:e,data:t}),method:"PATCH"}),on=(e,t)=>()=>({path:"/flows",params:t??{},body:JSON.stringify(e),method:"PATCH"}),an=(e,t,r)=>()=>(o(e,"Key cannot be empty"),{path:`/flows/${e}`,params:r??{},body:JSON.stringify(t),method:"PATCH"});var nn=(e,t,r)=>()=>(o(e,"Keys cannot be empty"),{path:"/folders",params:r??{},body:JSON.stringify({keys:e,data:t}),method:"PATCH"}),cn=(e,t)=>()=>({path:"/folders",params:t??{},body:JSON.stringify(e),method:"PATCH"}),pn=(e,t,r)=>()=>(o(e,"Key cannot be empty"),{path:`/folders/${e}`,params:r??{},body:JSON.stringify(t),method:"PATCH"});var yn=(e,t,r,a)=>()=>{let s={};return o(String(e),"Collection cannot be empty"),x(e,"Cannot use updateItems for core collections"),Array.isArray(t)?(o(t,"keysOrQuery cannot be empty"),s={keys:t}):(o(Object.keys(t),"keysOrQuery cannot be empty"),s={query:t}),s.data=r,{path:`/items/${e}`,params:a??{},body:JSON.stringify(s),method:"PATCH"}},dn=(e,t,r)=>()=>(o(String(e),"Collection cannot be empty"),x(e,"Cannot use updateItems for core collections"),{path:`/items/${e}`,params:r??{},body:JSON.stringify(t),method:"PATCH"}),Sn=(e,t,r,a)=>()=>(o(String(t),"Key cannot be empty"),o(String(e),"Collection cannot be empty"),x(e,"Cannot use updateItem for core collections"),{path:`/items/${e}/${t}`,params:a??{},body:JSON.stringify(r),method:"PATCH"});var Qn=(e,t,r)=>()=>(o(e,"Keys cannot be empty"),{path:"/notifications",params:r??{},body:JSON.stringify({keys:e,data:t}),method:"PATCH"}),xn=(e,t)=>()=>({path:"/notifications",params:t??{},body:JSON.stringify(e),method:"PATCH"}),Tn=(e,t,r)=>()=>(o(e,"Key cannot be empty"),{path:`/notifications/${e}`,params:r??{},body:JSON.stringify(t),method:"PATCH"});var Rn=(e,t,r)=>()=>(o(e,"Keys cannot be empty"),{path:"/operations",params:r??{},body:JSON.stringify({keys:e,data:t}),method:"PATCH"}),bn=(e,t)=>()=>({path:"/operations",params:t??{},body:JSON.stringify(e),method:"PATCH"}),Dn=(e,t,r)=>()=>(o(e,"Key cannot be empty"),{path:`/operations/${e}`,params:r??{},body:JSON.stringify(t),method:"PATCH"});var Pn=(e,t,r)=>()=>(o(e,"Keys cannot be empty"),{path:"/panels",params:r??{},body:JSON.stringify({keys:e,data:t}),method:"PATCH"}),In=(e,t)=>()=>({path:"/panels",params:t??{},body:JSON.stringify(e),method:"PATCH"}),Fn=(e,t,r)=>()=>(o(e,"Key cannot be empty"),{path:`/panels/${e}`,params:r??{},body:JSON.stringify(t),method:"PATCH"});var wn=(e,t,r)=>()=>(o(e,"Keys cannot be empty"),{path:"/permissions",params:r??{},body:JSON.stringify({keys:e,data:t}),method:"PATCH"}),Nn=(e,t)=>()=>({path:"/permissions",params:t??{},body:JSON.stringify(e),method:"PATCH"}),vn=(e,t,r)=>()=>(o(String(e),"Key cannot be empty"),{path:`/permissions/${e}`,params:r??{},body:JSON.stringify(t),method:"PATCH"});var $n=(e,t,r)=>()=>(o(e,"Keys cannot be empty"),{path:"/presets",params:r??{},body:JSON.stringify({keys:e,data:t}),method:"PATCH"}),kn=(e,t)=>()=>({path:"/presets",params:t??{},body:JSON.stringify(e),method:"PATCH"}),Kn=(e,t,r)=>()=>(o(String(e),"Key cannot be empty"),{path:`/presets/${e}`,params:r??{},body:JSON.stringify(t),method:"PATCH"});var Ln=(e,t,r,a)=>()=>(o(e,"Collection cannot be empty"),o(t,"Field cannot be empty"),{path:`/relations/${e}/${t}`,params:a??{},body:JSON.stringify(r),method:"PATCH"});var Vn=(e,t,r)=>()=>(o(e,"Keys cannot be empty"),{path:"/roles",params:r??{},body:JSON.stringify({keys:e,data:t}),method:"PATCH"}),Mn=(e,t)=>()=>({path:"/roles",params:t??{},body:JSON.stringify(e),method:"PATCH"}),Bn=(e,t,r)=>()=>(o(e,"Key cannot be empty"),{path:`/roles/${e}`,params:r??{},body:JSON.stringify(t),method:"PATCH"});var zn=(e,t)=>()=>({path:"/settings",params:t??{},body:JSON.stringify(e),method:"PATCH"});var Zn=(e,t,r)=>()=>(o(e,"Keys cannot be empty"),{path:"/shares",params:r??{},body:JSON.stringify({keys:e,data:t}),method:"PATCH"}),ec=(e,t)=>()=>({path:"/shares",params:t??{},body:JSON.stringify(e),method:"PATCH"}),tc=(e,t,r)=>()=>(o(e,"Key cannot be empty"),{path:`/shares/${e}`,params:r??{},body:JSON.stringify(t),method:"PATCH"});var ac=(e,t,r)=>()=>(o(String(e),"Collection cannot be empty"),x(e,"Cannot use updateSingleton for core collections"),{path:`/items/${e}`,params:r??{},body:JSON.stringify(t),method:"PATCH"});var ic=(e,t,r)=>()=>(o(e,"Keys cannot be empty"),{path:"/translations",params:r??{},body:JSON.stringify({keys:e,data:t}),method:"PATCH"}),nc=(e,t)=>()=>({path:"/translations",params:t??{},body:JSON.stringify(e),method:"PATCH"}),cc=(e,t,r)=>()=>(o(String(e),"Key cannot be empty"),{path:`/translations/${e}`,params:r??{},body:JSON.stringify(t),method:"PATCH"});var hc=(e,t,r)=>()=>(o(e,"Keys cannot be empty"),{path:"/users",params:r??{},body:JSON.stringify({keys:e,data:t}),method:"PATCH"}),yc=(e,t)=>()=>({path:"/users",params:t??{},body:JSON.stringify(e),method:"PATCH"}),dc=(e,t,r)=>()=>(o(e,"Key cannot be empty"),{path:`/users/${e}`,params:r??{},body:JSON.stringify(t),method:"PATCH"}),Sc=(e,t)=>()=>({path:"/users/me",params:t??{},body:JSON.stringify(e),method:"PATCH"});var Qc=(e,t,r)=>()=>(o(e,"Keys cannot be empty"),{path:"/versions",params:r??{},body:JSON.stringify({keys:e,data:t}),method:"PATCH"}),xc=(e,t)=>()=>({path:"/versions",params:t??{},body:JSON.stringify(e),method:"PATCH"}),Tc=(e,t,r)=>()=>(o(e,"Key cannot be empty"),{path:`/versions/${e}`,params:r??{},body:JSON.stringify(t),method:"PATCH"});var Rc=(e,t,r)=>()=>(o(e,"Keys cannot be empty"),{path:"/webhooks",params:r??{},body:JSON.stringify({keys:e,data:t}),method:"PATCH"}),bc=(e,t,r)=>()=>(o(String(e),"Key cannot be empty"),{path:`/webhooks/${e}`,params:r??{},body:JSON.stringify(t),method:"PATCH"});var zc=()=>()=>({method:"POST",path:"/utils/cache/clear"});var Yc=(e,t,r,a)=>()=>({method:"POST",path:`/utils/export/${e}`,body:JSON.stringify({format:t,query:r,file:a})});var ep=(e,t,r)=>()=>e==="GET"?{path:`/flows/trigger/${t}`,params:r??{},method:"GET"}:{path:`/flows/trigger/${t}`,body:JSON.stringify(r??{}),method:"POST"};var rp=e=>()=>({method:"POST",path:"/utils/hash/generate",body:JSON.stringify({string:e})}),op=(e,t)=>()=>({method:"POST",path:"/utils/hash/verify",body:JSON.stringify({string:e,hash:t})});var sp=(e,t)=>()=>({path:`/utils/import/${e}`,method:"POST",body:t,headers:{"Content-Type":"multipart/form-data"}});var ip=(e,t)=>()=>({path:`/operations/trigger/${e}`,body:JSON.stringify(t??{}),method:"POST"});var cp=(e,t,r="cookie")=>()=>({path:"/shares/auth",method:"POST",body:JSON.stringify({share:e,password:t,mode:r})}),pp=(e,t)=>()=>({path:"/shares/invite",method:"POST",body:JSON.stringify({share:e,emails:t})}),up=e=>()=>({path:`/shares/info/${e}`,method:"GET"});var yp=(e,t,r)=>()=>({method:"POST",path:`/utils/sort/${e}`,body:JSON.stringify({item:t,to:r})});var Sp=(e,t,r)=>()=>({path:"/users/invite",method:"POST",body:JSON.stringify({email:e,role:t,...r?{invite_url:r}:{}})}),lp=(e,t)=>()=>({path:"/users/invite/accept",method:"POST",body:JSON.stringify({token:e,password:t})}),fp=(e,t,r={})=>()=>({path:"/users/register",method:"POST",body:JSON.stringify({email:e,password:t,...r})}),Qp=e=>()=>({path:"/users/register/verify-email",params:{token:e},method:"GET"}),xp=e=>()=>({path:"/users/me/tfa/generate",method:"POST",body:JSON.stringify({password:e})}),Tp=(e,t)=>()=>({path:"/users/me/tfa/enable",method:"POST",body:JSON.stringify({secret:e,otp:t})}),Cp=e=>()=>({path:"/users/me/tfa/disable",method:"POST",body:JSON.stringify({otp:e})});var bp=(e,t)=>()=>(o(e,"ID cannot be empty"),{path:`/versions/${e}/save`,method:"POST",body:JSON.stringify(t)}),Dp=e=>()=>(o(e,"ID cannot be empty"),{path:`/versions/${e}/compare`,method:"GET"}),Op=(e,t,r)=>()=>(o(e,"ID cannot be empty"),{path:`/versions/${e}/promote`,method:"POST",body:JSON.stringify(r?{mainHash:t,fields:r}:{mainHash:t})});var Pp=e=>()=>({method:"GET",path:"/utils/random/string",params:e!==void 0?{length:e}:{}});var B={},Zp=(e={})=>t=>{let r={...B,...e};return{async request(a){let s=a();if(s.headers||(s.headers={}),"Content-Type"in s.headers?s.headers["Content-Type"]==="multipart/form-data"&&delete s.headers["Content-Type"]:s.headers["Content-Type"]="application/json","getToken"in this){let u=await this.getToken();u&&(s.headers||(s.headers={}),s.headers.Authorization=`Bearer ${u}`)}let c=R(t.url,s.path,s.params),i={method:s.method??"GET",headers:s.headers??{}};"credentials"in r&&(i.credentials=r.credentials),s.body&&(i.body=s.body),s.onRequest&&(i=await s.onRequest(i)),r.onRequest&&(i=await r.onRequest(i));let p=await b(c.toString(),i,t.globals.fetch);return"onResponse"in s&&(p=await s.onResponse(p,i)),"onResponse"in e&&(p=await e.onResponse(p,i)),p}}};function tu(e,t){return()=>{let r=e();return typeof t=="function"?r.onRequest=t:r.onRequest=a=>({...a,...t}),r}}function au(e){return()=>{let t=e();return t.method==="GET"&&t.params&&(t.method="SEARCH",t.body=JSON.stringify({query:{...t.params,fields:U(t.params.fields??[])}}),delete t.params),t}}function mu(e,t){return()=>{let r=t();return e&&(r.headers||(r.headers={}),r.headers.Authorization=`Bearer ${e}`),r}}function nu(e){return()=>e}export{lp as acceptUserInvite,La as aggregate,N as auth,cp as authenticateShare,ne as authentication,zc as clearCache,Dp as compareContentVersion,lt as createCollection,dt as createComment,yr as createContentVersion,hr as createContentVersions,xt as createDashboard,Qt as createDashboards,le as createDirectus,Ct as createField,jt as createFlow,Ot as createFlows,Ft as createFolder,It as createFolders,vt as createItem,Nt as createItems,$t as createNotification,Jt as createNotifications,Wt as createOperation,Kt as createOperations,Ht as createPanel,Lt as createPanels,Mt as createPermission,Vt as createPermissions,zt as createPreset,qt as createPresets,Yt as createRelation,tr as createRole,er as createRoles,ar as createShare,or as createShares,ir as createTranslation,mr as createTranslations,pr as createUser,cr as createUsers,lr as createWebhook,Sr as createWebhooks,nu as customEndpoint,Wr as deleteCollection,kr as deleteComment,ca as deleteContentVersion,na as deleteContentVersions,eo as deleteDashboard,Zr as deleteDashboards,oo as deleteField,io as deleteFile,mo as deleteFiles,uo as deleteFlow,po as deleteFlows,lo as deleteFolder,So as deleteFolders,To as deleteItem,xo as deleteItems,bo as deleteNotification,Ro as deleteNotifications,Po as deleteOperation,jo as deleteOperations,Eo as deletePanel,Ao as deletePanels,Uo as deletePermission,vo as deletePermissions,Ko as deletePreset,ko as deletePresets,Lo as deleteRelation,Mo as deleteRole,Vo as deleteRoles,Xo as deleteShare,zo as deleteShares,ta as deleteTranslation,ea as deleteTranslations,sa as deleteUser,aa as deleteUsers,ya as deleteWebhook,ha as deleteWebhooks,Cp as disableTwoFactor,Tp as enableTwoFactor,U as formatFields,rp as generateHash,xp as generateTwoFactorSecret,v as generateUid,A as getAuthEndpoint,Te as graphql,bt as importFile,pp as inviteShare,Sp as inviteUser,qe as login,Xe as logout,K as memoryStorage,w as messageCallback,Ze as passwordRequest,tt as passwordReset,G as pong,Op as promoteContentVersion,J as queryToParams,Pp as randomString,Ja as readActivities,$a as readActivity,Ba as readAssetArrayBuffer,Ma as readAssetBlob,Va as readAssetRaw,Ya as readCollection,Xa as readCollections,jm as readContentVersion,Om as readContentVersions,rs as readDashboard,ts as readDashboards,as as readExtensions,cs as readField,is as readFields,ns as readFieldsByCollection,ys as readFile,hs as readFiles,fs as readFlow,ls as readFlows,Cs as readFolder,Ts as readFolders,li as readGraphqlSdl,Ds as readItem,Gs as readItemPermissions,bs as readItems,Rm as readMe,Is as readNotification,Ps as readNotifications,gi as readOpenApiSpec,ws as readOperation,Es as readOperations,Js as readPanel,Us as readPanels,Ws as readPermission,Ks as readPermissions,Vs as readPreset,_s as readPresets,ot as readProviders,Xs as readRelation,zs as readRelationByCollection,qs as readRelations,tm as readRevision,em as readRevisions,sm as readRole,am as readRoles,im as readSettings,um as readShare,up as readShareInfo,pm as readShares,dm as readSingleton,Qm as readTranslation,fm as readTranslations,gm as readUser,Cm as readUsers,Am as readWebhook,Fm as readWebhooks,ve as realtime,st as refresh,fp as registerUser,Qp as registerUserVerify,Zp as rest,bp as saveToContentVersion,mi as schemaApply,ni as schemaDiff,pi as schemaSnapshot,Qi as serverHealth,Ti as serverInfo,bi as serverPing,Je as sleep,pe as staticToken,x as throwIfCoreCollection,o as throwIfEmpty,ep as triggerFlow,ip as triggerOperation,Ui as updateCollection,Ji as updateCollectionsBatch,wi as updateComment,Tc as updateContentVersion,Qc as updateContentVersions,xc as updateContentVersionsBatch,Gi as updateDashboard,Ki as updateDashboards,Wi as updateDashboardsBatch,_i as updateExtension,Bi as updateField,Zi as updateFile,Xi as updateFiles,Yi as updateFilesBatch,an as updateFlow,rn as updateFlows,on as updateFlowsBatch,pn as updateFolder,nn as updateFolders,cn as updateFoldersBatch,Sn as updateItem,yn as updateItems,dn as updateItemsBatch,Sc as updateMe,Tn as updateNotification,Qn as updateNotifications,xn as updateNotificationsBatch,Dn as updateOperation,Rn as updateOperations,bn as updateOperationsBatch,Fn as updatePanel,Pn as updatePanels,In as updatePanelsBatch,vn as updatePermission,wn as updatePermissions,Nn as updatePermissionsBatch,Kn as updatePreset,$n as updatePresets,kn as updatePresetsBatch,Ln as updateRelation,Bn as updateRole,Vn as updateRoles,Mn as updateRolesBatch,zn as updateSettings,tc as updateShare,Zn as updateShares,ec as updateSharesBatch,ac as updateSingleton,cc as updateTranslation,ic as updateTranslations,nc as updateTranslationsBatch,dc as updateUser,hc as updateUsers,yc as updateUsersBatch,bc as updateWebhook,Rc as updateWebhooks,Rt as uploadFiles,yp as utilitySort,Yc as utilsExport,sp as utilsImport,op as verifyHash,tu as withOptions,au as withSearch,mu as withToken}; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@directus/sdk", | ||
"version": "16.1.1", | ||
"version": "16.1.2", | ||
"description": "Directus JavaScript SDK", | ||
@@ -25,10 +25,9 @@ "homepage": "https://directus.io", | ||
], | ||
"dependencies": { | ||
"@directus/system-data": "1.1.0" | ||
}, | ||
"devDependencies": { | ||
"@types/node-fetch": "2.6.11", | ||
"tsup": "8.1.0", | ||
"tsup": "8.2.2", | ||
"esbuild-plugin-replace": "1.4.0", | ||
"typescript": "5.4.5", | ||
"vitest": "1.5.3", | ||
"@directus/system-data": "1.1.1", | ||
"@directus/tsconfig": "1.0.1" | ||
@@ -35,0 +34,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
516837
0
3504
0
7
- Removed@directus/system-data@1.1.0
- Removed@directus/system-data@1.1.0(transitive)