@directus/sdk
Advanced tools
Comparing version 16.1.0 to 16.2.0-rc.0
@@ -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=()=>{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=d=>{let l=d.expires??0;d.expires_at=new Date().getTime()+l,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();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),h))})(),s);return{refresh:T,async login(d,l,f={}){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 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(),c()},stopRefreshing(){p&&clearTimeout(p)},async getToken(){return await x().catch(()=>{}),(await i.get())?.access_token??null},setToken(d){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},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 I(e){return e?`/auth/login/${e}`:"/auth/login"}var A="/",W=(e,t)=>(e.endsWith(A)&&(e=e.slice(0,-1)),t.startsWith(A)||(t=A+t),e+t),b=(e,t,r)=>{let a=e.pathname===A?t:W(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(u=>O(u).then(()=>u))})(),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),u=b(r.url,n),h={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(m)};"credentials"in a&&(h.credentials=a.credentials);let R=await D(u.toString(),h,r.globals.fetch);return await O(R),R},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 ue=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 G=()=>JSON.stringify({type:"pong"});var F=(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 u=new t.globals.URL(m);if(e.authMode==="strict"&&i(n)){let h=await n.getToken();h&&u.searchParams.set("access_token",h)}return u.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((u,h)=>{if(!e.reconnect)return h();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 h();setTimeout(()=>m.connect().then(R=>(p.forEach(S=>{m.sendMessage(S)}),R)).then(u).catch(h),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 u=await n.getToken();if(!u)throw Error("No token for re-authenticating the websocket");a.connection.send(E({access_token:u}))}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 F(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(G()),a.firstMessage=!1;continue}T.message.forEach(u=>{a.code==="open"&&u.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 u=new Promise((h,R)=>{let S=!1,C=new t.globals.WebSocket(n);C.addEventListener("open",async P=>{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 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.");C.send(E({access_token:g}));let j=await F(C);if(j&&"type"in j&&"status"in j&&j.type==="auth"&&j.status==="ok")c("info","Authentication successful!");else return R("Authentication failed while opening websocket connection")}T.open.forEach(g=>g.call(C,P)),S=!0,h(C)}),C.addEventListener("error",P=>{c("warn","Connection errored."),T.error.forEach(g=>g.call(C,P)),C.close(),a={code:"error"},S||R(P)}),C.addEventListener("close",P=>{c("info","Connection closed."),T.close.forEach(g=>g.call(C,P)),r=w(),a={code:"closed"},O(this),S||R(P)})});return a={code:"connecting",connection:u},u},disconnect(){a.code==="open"&&a.connection.close()},onWebSocket(m,n){if(m==="message"){let u=function(h){if(typeof h.data!="string")return n.call(this,h);try{return n.call(this,JSON.parse(h.data))}catch{return n.call(this,h)}};return T[m].add(u),()=>T[m].delete(u)}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 u=!0;async function*h(){for(;u&&a.code==="open";){let S=await F(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*h()))}let R=()=>{p.delete({...n,collection:m,type:"subscribe"}),this.sendMessage({uid:n.uid,type:"unsubscribe"}),u=!1};return{subscription:h(),unsubscribe:R}}}}}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 Rt=(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 Pt=(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 At=(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"});import{isSystemCollection as K}from"@directus/system-data";var Nt=(e,t,r)=>()=>{let a=String(e);if(K(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(K(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 Gt=(e,t)=>()=>({path:"/operations",params:t??{},body:JSON.stringify(e),method:"POST"}),Kt=(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"}),_t=(e,t)=>()=>({path:"/permissions",params:t??{},body:JSON.stringify(e),method:"POST"});var qt=(e,t)=>()=>({path:"/policies",params:t??{},body:JSON.stringify(e),method:"POST"}),zt=(e,t)=>()=>({path:"/policies",params:t??{},body:JSON.stringify(e),method:"POST"});var Yt=(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 tr=e=>()=>({path:"/relations",body:JSON.stringify(e),method:"POST"});var or=(e,t)=>()=>({path:"/roles",params:t??{},body:JSON.stringify(e),method:"POST"}),ar=(e,t)=>()=>({path:"/roles",params:t??{},body:JSON.stringify(e),method:"POST"});var mr=(e,t)=>()=>({path:"/shares",params:t??{},body:JSON.stringify(e),method:"POST"}),ir=(e,t)=>()=>({path:"/shares",params:t??{},body:JSON.stringify(e),method:"POST"});var cr=(e,t)=>()=>({path:"/translations",params:t??{},body:JSON.stringify(e),method:"POST"}),pr=(e,t)=>()=>({path:"/translations",params:t??{},body:JSON.stringify(e),method:"POST"});var hr=(e,t)=>()=>({path:"/users",params:t??{},body:JSON.stringify(e),method:"POST"}),yr=(e,t)=>()=>({path:"/users",params:t??{},body:JSON.stringify(e),method:"POST"});var Sr=(e,t)=>()=>({path:"/versions",params:t??{},body:JSON.stringify(e),method:"POST"}),lr=(e,t)=>()=>({path:"/versions",params:t??{},body:JSON.stringify(e),method:"POST"});var Qr=(e,t)=>()=>({path:"/webhooks",params:t??{},body:JSON.stringify(e),method:"POST"}),xr=(e,t)=>()=>({path:"/webhooks",params:t??{},body:JSON.stringify(e),method:"POST"});var Lr=e=>()=>({path:`/activity/comment/${e}`,method:"DELETE"});var Vr=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 _}from"@directus/system-data";var Q=(e,t)=>{if(_(String(e)))throw new Error(t)};var oo=e=>()=>(o(e,"Keys cannot be empty"),{path:"/dashboards",body:JSON.stringify(e),method:"DELETE"}),ao=e=>()=>(o(e,"Key cannot be empty"),{path:`/dashboards/${e}`,method:"DELETE"});var io=(e,t)=>()=>(o(e,"Collection cannot be empty"),o(t,"Field cannot be empty"),{path:`/fields/${e}/${t}`,method:"DELETE"});var po=e=>()=>(o(e,"Keys cannot be empty"),{path:"/files",body:JSON.stringify(e),method:"DELETE"}),uo=e=>()=>(o(e,"Key cannot be empty"),{path:`/files/${e}`,method:"DELETE"});var So=e=>()=>(o(e,"Keys cannot be empty"),{path:"/flows",body:JSON.stringify(e),method:"DELETE"}),lo=e=>()=>(o(e,"Key cannot be empty"),{path:`/flows/${e}`,method:"DELETE"});var xo=e=>()=>(o(e,"Keys cannot be empty"),{path:"/folders",body:JSON.stringify(e),method:"DELETE"}),To=e=>()=>(o(e,"Key cannot be empty"),{path:`/folders/${e}`,method:"DELETE"});var go=(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"}},bo=(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 Po=e=>()=>(o(e,"Keys cannot be empty"),{path:"/notifications",body:JSON.stringify(e),method:"DELETE"}),jo=e=>()=>(o(e,"Key cannot be empty"),{path:`/notifications/${e}`,method:"DELETE"});var Fo=e=>()=>(o(e,"Keys cannot be empty"),{path:"/operations",body:JSON.stringify(e),method:"DELETE"}),Eo=e=>()=>(o(e,"Key cannot be empty"),{path:`/operations/${e}`,method:"DELETE"});var vo=e=>()=>(o(e,"Keys cannot be empty"),{path:"/panels",body:JSON.stringify(e),method:"DELETE"}),Uo=e=>()=>(o(e,"Key cannot be empty"),{path:`/panels/${e}`,method:"DELETE"});var ko=e=>()=>(o(e,"Keys cannot be empty"),{path:"/permissions",body:JSON.stringify(e),method:"DELETE"}),Go=e=>()=>(o(String(e),"Key cannot be empty"),{path:`/permissions/${e}`,method:"DELETE"});var Lo=e=>()=>(o(e,"Keys cannot be empty"),{path:"/policies",body:JSON.stringify(e),method:"DELETE"}),Ho=e=>()=>(o(String(e),"Key cannot be empty"),{path:`/policies/${e}`,method:"DELETE"});var _o=e=>()=>(o(e,"Keys cannot be empty"),{path:"/presets",body:JSON.stringify(e),method:"DELETE"}),Bo=e=>()=>(o(String(e),"Key cannot be empty"),{path:`/presets/${e}`,method:"DELETE"});var Xo=(e,t)=>()=>(o(e,"Collection cannot be empty"),o(t,"Field cannot be empty"),{path:`/relations/${e}/${t}`,method:"DELETE"});var ea=e=>()=>(o(e,"Keys cannot be empty"),{path:"/roles",body:JSON.stringify(e),method:"DELETE"}),ta=e=>()=>(o(String(e),"Key cannot be empty"),{path:`/roles/${e}`,method:"DELETE"});var aa=e=>()=>(o(e,"Keys cannot be empty"),{path:"/shares",body:JSON.stringify(e),method:"DELETE"}),sa=e=>()=>(o(String(e),"Key cannot be empty"),{path:`/shares/${e}`,method:"DELETE"});var na=e=>()=>(o(e,"Keys cannot be empty"),{path:"/translations",body:JSON.stringify(e),method:"DELETE"}),ca=e=>()=>(o(String(e),"Key cannot be empty"),{path:`/translations/${e}`,method:"DELETE"});var ha=e=>()=>(o(e,"Keys cannot be empty"),{path:"/users",body:JSON.stringify(e),method:"DELETE"}),ya=e=>()=>(o(String(e),"Key cannot be empty"),{path:`/users/${e}`,method:"DELETE"});var la=e=>()=>(o(e,"Keys cannot be empty"),{path:"/versions",body:JSON.stringify(e),method:"DELETE"}),fa=e=>()=>(o(e,"Key cannot be empty"),{path:`/versions/${e}`,method:"DELETE"});var Ta=e=>()=>(o(e,"Keys cannot be empty"),{path:"/webhooks",body:JSON.stringify(e),method:"DELETE"}),Ca=e=>()=>(o(String(e),"Key cannot be empty"),{path:`/webhooks/${e}`,method:"DELETE"});var Ma=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 B}from"@directus/system-data";var Ya=(e,t)=>()=>{let r=String(e);return o(r,"Collection cannot be empty"),{path:B(r)?`/${r.substring(9)}`:`/items/${r}`,method:"GET",params:{...t.query??{},...t.groupBy?{groupBy:t.groupBy}:{},aggregate:t.aggregate}}};var ts=(e,t)=>()=>(o(String(e),"Key cannot be empty"),{path:`/assets/${e}`,params:t??{},method:"GET",onResponse:r=>r.body}),rs=(e,t)=>()=>(o(String(e),"Key cannot be empty"),{path:`/assets/${e}`,params:t??{},method:"GET",onResponse:r=>r.blob()}),os=(e,t)=>()=>(o(String(e),"Key cannot be empty"),{path:`/assets/${e}`,params:t??{},method:"GET",onResponse:r=>r.arrayBuffer()});var ms=()=>()=>({path:"/collections",method:"GET"}),is=e=>()=>(o(e,"Collection cannot be empty"),{path:`/collections/${e}`,method:"GET"});var ps=e=>()=>({path:"/dashboards",params:e??{},method:"GET"}),us=(e,t)=>()=>(o(String(e),"Key cannot be empty"),{path:`/dashboards/${e}`,params:t??{},method:"GET"});var ys=()=>()=>({path:"/extensions/",method:"GET"});var ls=()=>()=>({path:"/fields",method:"GET"}),fs=e=>()=>(o(e,"Collection cannot be empty"),{path:`/fields/${e}`,method:"GET"}),Qs=(e,t)=>()=>(o(e,"Collection cannot be empty"),o(t,"Field cannot be empty"),{path:`/fields/${e}/${t}`,method:"GET"});var Cs=e=>()=>({path:"/files",params:e??{},method:"GET"}),Rs=(e,t)=>()=>(o(String(e),"Key cannot be empty"),{path:`/files/${e}`,params:t??{},method:"GET"});var Ds=e=>()=>({path:"/flows",params:e??{},method:"GET"}),Os=(e,t)=>()=>(o(String(e),"Key cannot be empty"),{path:`/flows/${e}`,params:t??{},method:"GET"});var Is=e=>()=>({path:"/folders",params:e??{},method:"GET"}),As=(e,t)=>()=>(o(String(e),"Key cannot be empty"),{path:`/folders/${e}`,params:t??{},method:"GET"});var ws=(e,t)=>()=>(o(String(e),"Collection cannot be empty"),Q(e,"Cannot use readItems for core collections"),{path:`/items/${e}`,params:t??{},method:"GET"}),Ns=(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 Js=e=>()=>({path:"/notifications",params:e??{},method:"GET"}),$s=(e,t)=>()=>(o(String(e),"Key cannot be empty"),{path:`/notifications/${e}`,params:t??{},method:"GET"});var Ks=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 Vs=e=>()=>({path:"/panels",params:e??{},method:"GET"}),Ms=(e,t)=>()=>(o(String(e),"Key cannot be empty"),{path:`/panels/${e}`,params:t??{},method:"GET"});var qs=e=>()=>({path:"/permissions",params:e??{},method:"GET"}),zs=(e,t)=>()=>(o(String(e),"Key cannot be empty"),{path:`/permissions/${e}`,params:t??{},method:"GET"}),Xs=(e,t)=>()=>(o(String(e),"Collection cannot be empty"),{path:`/permissions/me/${t?`${e}/${t}`:`${e}`}`,method:"GET"}),Ys=()=>()=>({path:"/permissions/me",method:"GET"});var tm=e=>()=>({path:"/policies",params:e??{},method:"GET"}),rm=(e,t)=>()=>(o(String(e),"Key cannot be empty"),{path:`/policies/${e}`,params:t??{},method:"GET"}),om=()=>()=>({path:"/policies/me/globals",method:"GET"});var mm=e=>()=>({path:"/presets",params:e??{},method:"GET"}),im=(e,t)=>()=>(o(String(e),"Key cannot be empty"),{path:`/presets/${e}`,params:t??{},method:"GET"});var pm=()=>()=>({path:"/relations",method:"GET"}),um=e=>()=>({path:`/relations/${e}`,method:"GET"}),hm=(e,t)=>()=>(o(e,"Collection cannot be empty"),o(t,"Field cannot be empty"),{path:`/relations/${e}/${t}`,method:"GET"});var Sm=e=>()=>({path:"/revisions",params:e??{},method:"GET"}),lm=(e,t)=>()=>(o(String(e),"Key cannot be empty"),{path:`/revisions/${e}`,params:t??{},method:"GET"});var xm=e=>()=>({path:"/roles",params:e??{},method:"GET"}),Tm=(e,t)=>()=>(o(String(e),"Key cannot be empty"),{path:`/roles/${e}`,params:t??{},method:"GET"}),Cm=e=>()=>({path:"/roles/me",params:e??{},method:"GET"});var gm=e=>()=>({path:"/settings",params:e??{},method:"GET"});var Om=e=>()=>({path:"/shares",params:e??{},method:"GET"}),Pm=(e,t)=>()=>(o(String(e),"Key cannot be empty"),{path:`/shares/${e}`,params:t??{},method:"GET"});var Am=(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 wm=e=>()=>({path:"/translations",params:e??{},method:"GET"}),Nm=(e,t)=>()=>(o(String(e),"Key cannot be empty"),{path:`/translations/${e}`,params:t??{},method:"GET"});var Jm=e=>()=>({path:"/users",params:e??{},method:"GET"}),$m=(e,t)=>()=>(o(String(e),"Key cannot be empty"),{path:`/users/${e}`,params:t??{},method:"GET"}),km=e=>()=>({path:"/users/me",params:e??{},method:"GET"});var Wm=e=>()=>({path:"/versions",params:e??{},method:"GET"}),Lm=(e,t)=>()=>(o(String(e),"Key cannot be empty"),{path:`/versions/${e}`,params:t??{},method:"GET"});var Mm=e=>()=>({path:"/webhooks",params:e??{},method:"GET"}),_m=(e,t)=>()=>(o(String(e),"Key cannot be empty"),{path:`/webhooks/${e}`,params:t??{},method:"GET"});var gi=e=>()=>({method:"POST",path:"/schema/apply",body:JSON.stringify(e)});var Di=(e,t=!1)=>()=>({method:"POST",path:"/schema/diff",params:t?{force:t}:{},body:JSON.stringify(e)});var Pi=()=>()=>({method:"GET",path:"/schema/snapshot"});var wi=(e="item")=>()=>({method:"GET",path:e==="item"?"/server/specs/graphql":"/server/specs/graphql/system"});var vi=()=>()=>({method:"GET",path:"/server/health"});var Ji=()=>()=>({method:"GET",path:"/server/info"});var ki=()=>()=>({method:"GET",path:"/server/specs/oas"});var Ki=()=>()=>({method:"GET",path:"/server/ping"});var zi=(e,t,r)=>()=>(o(String(e),"Key cannot be empty"),{path:`/activity/comment/${e}`,params:r??{},body:JSON.stringify(t),method:"PATCH"});var Zi=(e,t,r)=>()=>(o(e,"Collection cannot be empty"),{path:`/collections/${e}`,params:r??{},body:JSON.stringify(t),method:"PATCH"}),en=(e,t)=>()=>({path:"/collections",params:t??{},body:JSON.stringify(e),method:"PATCH"});var on=(e,t,r)=>()=>(o(e,"Keys cannot be empty"),{path:"/dashboards",params:r??{},body:JSON.stringify({keys:e,data:t}),method:"PATCH"}),an=(e,t)=>()=>({path:"/dashboards",params:t??{},body:JSON.stringify(e),method:"PATCH"}),sn=(e,t,r)=>()=>(o(e,"Key cannot be empty"),{path:`/dashboards/${e}`,params:r??{},body:JSON.stringify(t),method:"PATCH"});var cn=(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 hn=(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 Sn=(e,t,r)=>()=>(o(e,"Keys cannot be empty"),{path:"/files",params:r??{},body:JSON.stringify({keys:e,data:t}),method:"PATCH"}),ln=(e,t)=>()=>({path:"/files",params:t??{},body:JSON.stringify(e),method:"PATCH"}),fn=(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 Tn=(e,t,r)=>()=>(o(e,"Keys cannot be empty"),{path:"/flows",params:r??{},body:JSON.stringify({keys:e,data:t}),method:"PATCH"}),Cn=(e,t)=>()=>({path:"/flows",params:t??{},body:JSON.stringify(e),method:"PATCH"}),Rn=(e,t,r)=>()=>(o(e,"Key cannot be empty"),{path:`/flows/${e}`,params:r??{},body:JSON.stringify(t),method:"PATCH"});var Dn=(e,t,r)=>()=>(o(e,"Keys cannot be empty"),{path:"/folders",params:r??{},body:JSON.stringify({keys:e,data:t}),method:"PATCH"}),On=(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 An=(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"}},Fn=(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"}),En=(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 vn=(e,t,r)=>()=>(o(e,"Keys cannot be empty"),{path:"/notifications",params:r??{},body:JSON.stringify({keys:e,data:t}),method:"PATCH"}),Un=(e,t)=>()=>({path:"/notifications",params:t??{},body:JSON.stringify(e),method:"PATCH"}),Jn=(e,t,r)=>()=>(o(e,"Key cannot be empty"),{path:`/notifications/${e}`,params:r??{},body:JSON.stringify(t),method:"PATCH"});var Gn=(e,t,r)=>()=>(o(e,"Keys cannot be empty"),{path:"/operations",params:r??{},body:JSON.stringify({keys:e,data:t}),method:"PATCH"}),Kn=(e,t)=>()=>({path:"/operations",params:t??{},body:JSON.stringify(e),method:"PATCH"}),Wn=(e,t,r)=>()=>(o(e,"Key cannot be empty"),{path:`/operations/${e}`,params:r??{},body:JSON.stringify(t),method:"PATCH"});var Vn=(e,t,r)=>()=>(o(e,"Keys cannot be empty"),{path:"/panels",params:r??{},body:JSON.stringify({keys:e,data:t}),method:"PATCH"}),Mn=(e,t)=>()=>({path:"/panels",params:t??{},body:JSON.stringify(e),method:"PATCH"}),_n=(e,t,r)=>()=>(o(e,"Key cannot be empty"),{path:`/panels/${e}`,params:r??{},body:JSON.stringify(t),method:"PATCH"});var zn=(e,t,r)=>()=>(o(e,"Keys cannot be empty"),{path:"/permissions",params:r??{},body:JSON.stringify({keys:e,data:t}),method:"PATCH"}),Xn=(e,t)=>()=>({path:"/permissions",params:t??{},body:JSON.stringify(e),method:"PATCH"}),Yn=(e,t,r)=>()=>(o(String(e),"Key cannot be empty"),{path:`/permissions/${e}`,params:r??{},body:JSON.stringify(t),method:"PATCH"});var tc=(e,t,r)=>()=>(o(e,"Keys cannot be empty"),{path:"/policies",params:r??{},body:JSON.stringify({keys:e,data:t}),method:"PATCH"}),rc=(e,t)=>()=>({path:"/policies",params:t??{},body:JSON.stringify(e),method:"PATCH"}),oc=(e,t,r)=>()=>(o(String(e),"Key cannot be empty"),{path:`/policies/${e}`,params:r??{},body:JSON.stringify(t),method:"PATCH"});var mc=(e,t,r)=>()=>(o(e,"Keys cannot be empty"),{path:"/presets",params:r??{},body:JSON.stringify({keys:e,data:t}),method:"PATCH"}),ic=(e,t)=>()=>({path:"/presets",params:t??{},body:JSON.stringify(e),method:"PATCH"}),nc=(e,t,r)=>()=>(o(String(e),"Key cannot be empty"),{path:`/presets/${e}`,params:r??{},body:JSON.stringify(t),method:"PATCH"});var uc=(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 dc=(e,t,r)=>()=>(o(e,"Keys cannot be empty"),{path:"/roles",params:r??{},body:JSON.stringify({keys:e,data:t}),method:"PATCH"}),Sc=(e,t)=>()=>({path:"/roles",params:t??{},body:JSON.stringify(e),method:"PATCH"}),lc=(e,t,r)=>()=>(o(e,"Key cannot be empty"),{path:`/roles/${e}`,params:r??{},body:JSON.stringify(t),method:"PATCH"});var Qc=(e,t)=>()=>({path:"/settings",params:t??{},body:JSON.stringify(e),method:"PATCH"});var Cc=(e,t,r)=>()=>(o(e,"Keys cannot be empty"),{path:"/shares",params:r??{},body:JSON.stringify({keys:e,data:t}),method:"PATCH"}),Rc=(e,t)=>()=>({path:"/shares",params:t??{},body:JSON.stringify(e),method:"PATCH"}),gc=(e,t,r)=>()=>(o(e,"Key cannot be empty"),{path:`/shares/${e}`,params:r??{},body:JSON.stringify(t),method:"PATCH"});var Oc=(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"}),Ac=(e,t)=>()=>({path:"/translations",params:t??{},body:JSON.stringify(e),method:"PATCH"}),Fc=(e,t,r)=>()=>(o(String(e),"Key cannot be empty"),{path:`/translations/${e}`,params:r??{},body:JSON.stringify(t),method:"PATCH"});var Nc=(e,t,r)=>()=>(o(e,"Keys cannot be empty"),{path:"/users",params:r??{},body:JSON.stringify({keys:e,data:t}),method:"PATCH"}),vc=(e,t)=>()=>({path:"/users",params:t??{},body:JSON.stringify(e),method:"PATCH"}),Uc=(e,t,r)=>()=>(o(e,"Key cannot be empty"),{path:`/users/${e}`,params:r??{},body:JSON.stringify(t),method:"PATCH"}),Jc=(e,t)=>()=>({path:"/users/me",params:t??{},body:JSON.stringify(e),method:"PATCH"});var Gc=(e,t,r)=>()=>(o(e,"Keys cannot be empty"),{path:"/versions",params:r??{},body:JSON.stringify({keys:e,data:t}),method:"PATCH"}),Kc=(e,t)=>()=>({path:"/versions",params:t??{},body:JSON.stringify(e),method:"PATCH"}),Wc=(e,t,r)=>()=>(o(e,"Key cannot be empty"),{path:`/versions/${e}`,params:r??{},body:JSON.stringify(t),method:"PATCH"});var Vc=(e,t,r)=>()=>(o(e,"Keys cannot be empty"),{path:"/webhooks",params:r??{},body:JSON.stringify({keys:e,data:t}),method:"PATCH"}),Mc=(e,t,r)=>()=>(o(String(e),"Key cannot be empty"),{path:`/webhooks/${e}`,params:r??{},body:JSON.stringify(t),method:"PATCH"});var xp=()=>()=>({method:"POST",path:"/utils/cache/clear"});var Cp=(e,t,r,a)=>()=>({method:"POST",path:`/utils/export/${e}`,body:JSON.stringify({format:t,query:r,file:a})});var gp=(e,t,r)=>()=>e==="GET"?{path:`/flows/trigger/${t}`,params:r??{},method:"GET"}:{path:`/flows/trigger/${t}`,body:JSON.stringify(r??{}),method:"POST"};var Dp=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 jp=(e,t)=>()=>({path:`/utils/import/${e}`,method:"POST",body:t,headers:{"Content-Type":"multipart/form-data"}});var Ap=(e,t)=>()=>({path:`/operations/trigger/${e}`,body:JSON.stringify(t??{}),method:"POST"});var Ep=(e,t,r="cookie")=>()=>({path:"/shares/auth",method:"POST",body:JSON.stringify({share:e,password:t,mode:r})}),wp=(e,t)=>()=>({path:"/shares/invite",method:"POST",body:JSON.stringify({share:e,emails:t})}),Np=e=>()=>({path:`/shares/info/${e}`,method:"GET"});var Up=(e,t,r)=>()=>({method:"POST",path:`/utils/sort/${e}`,body:JSON.stringify({item:t,to:r})});var $p=(e,t,r)=>()=>({path:"/users/invite",method:"POST",body:JSON.stringify({email:e,role:t,...r?{invite_url:r}:{}})}),kp=(e,t)=>()=>({path:"/users/invite/accept",method:"POST",body:JSON.stringify({token:e,password:t})}),Gp=(e,t,r={})=>()=>({path:"/users/register",method:"POST",body:JSON.stringify({email:e,password:t,...r})}),Kp=e=>()=>({path:"/users/register/verify-email",params:{token:e},method:"GET"}),Wp=e=>()=>({path:"/users/me/tfa/generate",method:"POST",body:JSON.stringify({password:e})}),Lp=(e,t)=>()=>({path:"/users/me/tfa/enable",method:"POST",body:JSON.stringify({secret:e,otp:t})}),Hp=e=>()=>({path:"/users/me/tfa/disable",method:"POST",body:JSON.stringify({otp:e})});var _p=(e,t)=>()=>(o(e,"ID cannot be empty"),{path:`/versions/${e}/save`,method:"POST",body:JSON.stringify(t)}),Bp=e=>()=>(o(e,"ID cannot be empty"),{path:`/versions/${e}/compare`,method:"GET"}),qp=(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 Xp=e=>()=>({method:"GET",path:"/utils/random/string",params:e!==void 0?{length:e}:{}});var q={},Ru=(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 bu(e,t){return()=>{let r=e();return typeof t=="function"?r.onRequest=t:r.onRequest=a=>({...a,...t}),r}}function Pu(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 Iu(e,t){return()=>{let r=t();return e&&(r.headers||(r.headers={}),r.headers.Authorization=`Bearer ${e}`),r}}function Fu(e){return()=>e}export{kp as acceptUserInvite,Ya as aggregate,E as auth,Ep as authenticateShare,ce as authentication,xp as clearCache,Bp as compareContentVersion,ft as createCollection,St as createComment,lr as createContentVersion,Sr as createContentVersions,Tt as createDashboard,xt as createDashboards,fe as createDirectus,Rt as createField,jt as createFlow,Pt as createFlows,Ft as createFolder,At as createFolders,vt as createItem,Nt as createItems,$t as createNotification,Jt as createNotifications,Kt as createOperation,Gt as createOperations,Ht as createPanel,Lt as createPanels,_t as createPermission,Mt as createPermissions,qt as createPolicies,zt as createPolicy,Zt as createPreset,Yt as createPresets,tr as createRelation,ar as createRole,or as createRoles,ir as createShare,mr as createShares,pr as createTranslation,cr as createTranslations,yr as createUser,hr as createUsers,xr as createWebhook,Qr as createWebhooks,Fu as customEndpoint,Vr as deleteCollection,Lr as deleteComment,fa as deleteContentVersion,la as deleteContentVersions,ao as deleteDashboard,oo as deleteDashboards,io as deleteField,uo as deleteFile,po as deleteFiles,lo as deleteFlow,So as deleteFlows,To as deleteFolder,xo as deleteFolders,bo as deleteItem,go as deleteItems,jo as deleteNotification,Po as deleteNotifications,Eo as deleteOperation,Fo as deleteOperations,Uo as deletePanel,vo as deletePanels,Go as deletePermission,ko as deletePermissions,Lo as deletePolicies,Ho as deletePolicy,Bo as deletePreset,_o as deletePresets,Xo as deleteRelation,ta as deleteRole,ea as deleteRoles,sa as deleteShare,aa as deleteShares,ca as deleteTranslation,na as deleteTranslations,ya as deleteUser,ha as deleteUsers,Ca as deleteWebhook,Ta as deleteWebhooks,Hp as disableTwoFactor,Lp as enableTwoFactor,N as formatFields,Dp as generateHash,Wp as generateTwoFactorSecret,w as generateUid,I as getAuthEndpoint,Ce as graphql,Dt as importFile,wp as inviteShare,$p as inviteUser,ze as login,Ye as logout,$ as memoryStorage,F as messageCallback,et as passwordRequest,rt as passwordReset,G as pong,qp as promoteContentVersion,v as queryToParams,Xp as randomString,Ma as readActivities,_a as readActivity,os as readAssetArrayBuffer,rs as readAssetBlob,ts as readAssetRaw,is as readCollection,ms as readCollections,Lm as readContentVersion,Wm as readContentVersions,us as readDashboard,ps as readDashboards,ys as readExtensions,Qs as readField,ls as readFields,fs as readFieldsByCollection,Rs as readFile,Cs as readFiles,Os as readFlow,Ds as readFlows,As as readFolder,Is as readFolders,wi as readGraphqlSdl,Ns as readItem,Xs as readItemPermissions,ws as readItems,km as readMe,$s as readNotification,Js as readNotifications,ki as readOpenApiSpec,Ws as readOperation,Ks as readOperations,Ms as readPanel,Vs as readPanels,zs as readPermission,qs as readPermissions,tm as readPolicies,rm as readPolicy,om as readPolicyGlobals,im as readPreset,mm as readPresets,at as readProviders,hm as readRelation,um as readRelationByCollection,pm as readRelations,lm as readRevision,Sm as readRevisions,Tm as readRole,xm as readRoles,Cm as readRolesMe,gm as readSettings,Pm as readShare,Np as readShareInfo,Om as readShares,Am as readSingleton,Nm as readTranslation,wm as readTranslations,$m as readUser,Ys as readUserPermissions,Jm as readUsers,_m as readWebhook,Mm as readWebhooks,Ue as realtime,mt as refresh,Gp as registerUser,Kp as registerUserVerify,Ru as rest,_p as saveToContentVersion,gi as schemaApply,Di as schemaDiff,Pi as schemaSnapshot,vi as serverHealth,Ji as serverInfo,Ki as serverPing,$e as sleep,ue as staticToken,Q as throwIfCoreCollection,o as throwIfEmpty,gp as triggerFlow,Ap as triggerOperation,Zi as updateCollection,en as updateCollectionsBatch,zi as updateComment,Wc as updateContentVersion,Gc as updateContentVersions,Kc as updateContentVersionsBatch,sn as updateDashboard,on as updateDashboards,an as updateDashboardsBatch,cn as updateExtension,hn as updateField,fn as updateFile,Sn as updateFiles,ln as updateFilesBatch,Rn as updateFlow,Tn as updateFlows,Cn as updateFlowsBatch,Pn as updateFolder,Dn as updateFolders,On as updateFoldersBatch,En as updateItem,An as updateItems,Fn as updateItemsBatch,Jc as updateMe,Jn as updateNotification,vn as updateNotifications,Un as updateNotificationsBatch,Wn as updateOperation,Gn as updateOperations,Kn as updateOperationsBatch,_n as updatePanel,Vn as updatePanels,Mn as updatePanelsBatch,Yn as updatePermission,zn as updatePermissions,Xn as updatePermissionsBatch,tc as updatePolicies,rc as updatePoliciesBatch,oc as updatePolicy,nc as updatePreset,mc as updatePresets,ic as updatePresetsBatch,uc as updateRelation,lc as updateRole,dc as updateRoles,Sc as updateRolesBatch,Qc as updateSettings,gc as updateShare,Cc as updateShares,Rc as updateSharesBatch,Oc as updateSingleton,Fc as updateTranslation,Ic as updateTranslations,Ac as updateTranslationsBatch,Uc as updateUser,Nc as updateUsers,vc as updateUsersBatch,Mc as updateWebhook,Vc as updateWebhooks,bt as uploadFiles,Up as utilitySort,Cp as utilsExport,jp as utilsImport,Op as verifyHash,bu as withOptions,Pu as withSearch,Iu as withToken}; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@directus/sdk", | ||
"version": "16.1.0", | ||
"version": "16.2.0-rc.0", | ||
"description": "Directus JavaScript SDK", | ||
@@ -26,7 +26,7 @@ "homepage": "https://directus.io", | ||
"dependencies": { | ||
"@directus/system-data": "1.0.4" | ||
"@directus/system-data": "2.0.0-rc.0" | ||
}, | ||
"devDependencies": { | ||
"@types/node-fetch": "2.6.11", | ||
"tsup": "8.0.2", | ||
"tsup": "8.1.0", | ||
"typescript": "5.4.5", | ||
@@ -33,0 +33,0 @@ "vitest": "1.5.3", |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
533382
3632
2
+ Added@directus/system-data@2.0.0-rc.0(transitive)
- Removed@directus/system-data@1.0.4(transitive)