@shumai-one/shumai 0.6.2 → 0.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/{chunk-mcj1xpcc.js → chunk-01vx2chc.js} +2 -2
- package/bin/chunk-0epkrexd.js +2 -0
- package/bin/chunk-0h5239kt.js +2 -0
- package/bin/{chunk-jt0ykktx.js → chunk-0jnstdgf.js} +1 -1
- package/bin/{chunk-x03jwaga.js → chunk-0njsjy6x.js} +4 -4
- package/bin/{chunk-7naa7tpn.js → chunk-13rq2gtr.js} +2 -2
- package/bin/chunk-1aqs9sdh.js +3 -0
- package/bin/{chunk-m0q2cgfg.js → chunk-22jbsrka.js} +1 -1
- package/bin/chunk-2qknebmd.js +1 -0
- package/bin/{chunk-a411xhmm.js → chunk-2qzmh3ae.js} +4 -4
- package/bin/{chunk-2nhgdqdg.js → chunk-2tt0b8ym.js} +2 -2
- package/bin/{chunk-p3f5aevs.js → chunk-2zm7czk6.js} +1 -1
- package/bin/{chunk-p4s95471.js → chunk-396tfwdx.js} +1 -1
- package/bin/chunk-3mx4trvh.js +10 -0
- package/bin/{chunk-b5rhvzv9.js → chunk-45pb3kzz.js} +2 -2
- package/bin/{chunk-q83h0hkx.js → chunk-47fmhzwv.js} +2 -2
- package/bin/chunk-4awk4xhq.js +2 -0
- package/bin/{chunk-2cdxm1cp.js → chunk-4b2x2qba.js} +23 -23
- package/bin/{chunk-knj2s8mg.js → chunk-4rjy7ybr.js} +8 -8
- package/bin/{chunk-q8w4mbw4.js → chunk-598x693h.js} +2 -2
- package/bin/chunk-5c7ztqs7.js +1 -0
- package/bin/{chunk-2jj4j8cn.js → chunk-65dh7x4c.js} +2 -2
- package/bin/{chunk-hnkcgvcj.js → chunk-66e2vrky.js} +1 -1
- package/bin/{chunk-g22wmpk1.js → chunk-6j3beg6n.js} +2 -2
- package/bin/{chunk-cgmebxx6.js → chunk-6ke13k69.js} +1 -1
- package/bin/{chunk-7sgrtxbt.js → chunk-6rqakmg0.js} +2 -2
- package/bin/{chunk-4mws03es.js → chunk-6ty4tfmf.js} +3 -3
- package/bin/chunk-7e9ws6dh.js +129 -0
- package/bin/chunk-7mdddkfc.js +1 -0
- package/bin/{chunk-q2bew2vc.js → chunk-7q4mgd5x.js} +2 -2
- package/bin/chunk-7yv7shad.js +1 -0
- package/bin/{chunk-qwpkcp8d.js → chunk-81b8rfv7.js} +2 -2
- package/bin/{chunk-atfz7g7e.js → chunk-8a7ymmd4.js} +2 -2
- package/bin/chunk-8ac9at5y.js +2 -0
- package/bin/{chunk-gxepkvt2.js → chunk-8zcfgz9c.js} +1 -1
- package/bin/{chunk-mcw198kg.js → chunk-955kf5kc.js} +8 -8
- package/bin/{chunk-jzgbxqdg.js → chunk-978rm9a9.js} +2 -2
- package/bin/{chunk-jt02kpfc.js → chunk-9qzbrp4d.js} +2 -2
- package/bin/{chunk-tekwpkjf.js → chunk-a283dh05.js} +2 -2
- package/bin/chunk-aa2a06cc.js +1 -0
- package/bin/{chunk-8cjet7pp.js → chunk-ajr1w3vq.js} +6 -6
- package/bin/chunk-akafypge.js +218 -0
- package/bin/chunk-amk373q2.js +2 -0
- package/bin/chunk-apq2gvvp.js +4 -0
- package/bin/chunk-av2w1sez.js +2 -0
- package/bin/{chunk-5wapd171.js → chunk-b6kmj34z.js} +12 -12
- package/bin/chunk-bkzaw9p8.js +1 -0
- package/bin/{chunk-zezje74z.js → chunk-bssb9tar.js} +3 -3
- package/bin/chunk-bwvj1aqc.js +1 -0
- package/bin/chunk-by9esjn7.js +3 -0
- package/bin/chunk-bywk8mbc.js +2 -0
- package/bin/{chunk-9xhjy897.js → chunk-c61g9hfa.js} +4 -4
- package/bin/{chunk-zrszykjf.js → chunk-cdcgjh8k.js} +1 -1
- package/bin/{chunk-yk12hydf.js → chunk-d277evce.js} +4 -4
- package/bin/{chunk-55h9ze53.js → chunk-d3brvxh7.js} +2 -2
- package/bin/{chunk-9t3p4xp6.js → chunk-dcb1nzf1.js} +1 -1
- package/bin/{chunk-mzsw9var.js → chunk-dfbzatq9.js} +2 -2
- package/bin/chunk-e0bckx12.js +2 -0
- package/bin/{chunk-3ckkwdjx.js → chunk-e2p4s2pj.js} +3 -3
- package/bin/chunk-e8zzg57c.js +2 -0
- package/bin/{chunk-vp3czaeh.js → chunk-edfaqwaq.js} +2 -2
- package/bin/chunk-ehgrp0f9.js +1 -0
- package/bin/chunk-evs2aaav.js +12 -0
- package/bin/{chunk-s9ksftq2.js → chunk-f5bhcjhw.js} +1 -1
- package/bin/{chunk-ns33grgx.js → chunk-fb9dedm2.js} +2 -2
- package/bin/{chunk-srxp5jav.js → chunk-ff0mh9p3.js} +32 -32
- package/bin/chunk-fpfby5tz.js +1 -0
- package/bin/{chunk-eyjfhdp9.js → chunk-gd3b5akr.js} +2 -2
- package/bin/{chunk-1wfg56z3.js → chunk-gm1fy3hm.js} +5 -5
- package/bin/{chunk-9n1w5dw1.js → chunk-gqkjx7rz.js} +3 -3
- package/bin/{chunk-1nvd90g2.js → chunk-h7f5370s.js} +1 -1
- package/bin/chunk-hcyhsn8e.js +2 -0
- package/bin/{chunk-vcrmjtcz.js → chunk-jxm0gzmf.js} +2 -2
- package/bin/{chunk-b7bnp021.js → chunk-k3ggy3xk.js} +2 -2
- package/bin/{chunk-257dcd2f.js → chunk-k9vjs21p.js} +2 -2
- package/bin/chunk-ka40gv72.js +1 -0
- package/bin/chunk-km70p970.js +2 -0
- package/bin/{chunk-e4yscwen.js → chunk-m6v8rb39.js} +8 -8
- package/bin/chunk-m8spagwp.js +4 -0
- package/bin/{chunk-y241cxff.js → chunk-mfh7mg5b.js} +1 -1
- package/bin/chunk-n0cn0218.js +2 -0
- package/bin/chunk-n54ftsdx.js +2 -0
- package/bin/{chunk-02fvcrej.js → chunk-n7cvj15k.js} +7 -7
- package/bin/chunk-na5fh7er.js +2 -0
- package/bin/chunk-neazdbxy.js +1 -0
- package/bin/chunk-nk24qw3m.js +1 -0
- package/bin/{chunk-73yncv54.js → chunk-nsbbseff.js} +2 -2
- package/bin/chunk-nseef85h.js +1 -0
- package/bin/chunk-p35ztj2z.js +3 -0
- package/bin/chunk-pcjc9ygv.js +2 -0
- package/bin/{chunk-167z646e.js → chunk-pemmtd8q.js} +1 -1
- package/bin/{chunk-82tps5n1.js → chunk-pzrqnnpg.js} +1 -1
- package/bin/{chunk-a74g6h8a.js → chunk-q43m934j.js} +2 -2
- package/bin/{chunk-r1xer8gn.js → chunk-q57m34h0.js} +3 -3
- package/bin/chunk-q5k72jz9.js +3 -0
- package/bin/chunk-q9fsxakd.js +2 -0
- package/bin/chunk-qadpe0ct.js +2 -0
- package/bin/chunk-qeypjv4f.css +1 -0
- package/bin/chunk-qw92z3wf.js +2 -0
- package/bin/chunk-r0byfq1t.js +1 -0
- package/bin/chunk-r0q88qw3.js +2 -0
- package/bin/chunk-rjhczkh3.js +2 -0
- package/bin/{chunk-mwktrwtx.js → chunk-s0wxbybf.js} +1 -1
- package/bin/{chunk-q5vkxee3.js → chunk-s4hkcw24.js} +2 -2
- package/bin/chunk-szta50g1.js +1 -0
- package/bin/chunk-t6cb99gp.js +2 -0
- package/bin/chunk-tcr080b9.js +1 -0
- package/bin/{chunk-yq32evnn.js → chunk-v4nqx084.js} +5 -5
- package/bin/{chunk-ympbfzz4.js → chunk-v7jzc3ye.js} +1 -1
- package/bin/{chunk-9zsv6d2f.js → chunk-vbe8wred.js} +1 -1
- package/bin/{chunk-hpbn0k9n.js → chunk-vf9s8b5t.js} +2 -2
- package/bin/{chunk-m9adtgzk.js → chunk-vk3eqr65.js} +1 -1
- package/bin/{chunk-hpwv4am3.js → chunk-vm9bbk97.js} +4 -4
- package/bin/{chunk-v05rrxp5.js → chunk-w4gqg27w.js} +2 -2
- package/bin/{chunk-x8mjh387.js → chunk-w6ym7tsd.js} +4 -4
- package/bin/{chunk-hzkjgcre.js → chunk-ways29d1.js} +1 -1
- package/bin/chunk-wesg7tg9.js +1 -0
- package/bin/chunk-wmrrapwv.js +2 -0
- package/bin/chunk-wnwsjgj8.js +2 -0
- package/bin/{chunk-hw6czrya.js → chunk-wrb4xq9v.js} +1 -1
- package/bin/{chunk-v5cn90cf.js → chunk-wzrzc07t.js} +2 -2
- package/bin/chunk-xd1axsdv.js +2 -0
- package/bin/{chunk-cwat1jwx.js → chunk-xk0jmx4s.js} +2 -2
- package/bin/{chunk-g6sdezec.js → chunk-y545vfn0.js} +1 -1
- package/bin/{chunk-fatmqnp1.js → chunk-y6h885fs.js} +1 -1
- package/bin/{chunk-cz13a82m.js → chunk-yncmfr39.js} +2 -2
- package/bin/{chunk-01052ssf.js → chunk-yxnz4ypt.js} +11 -11
- package/bin/chunk-zc1asygg.js +2 -0
- package/bin/{chunk-m82tkhaa.js → chunk-zc7wzcvh.js} +7 -7
- package/bin/chunk-zdvhh8mk.js +2 -0
- package/bin/{chunk-kvhf12b4.js → chunk-zg0b902x.js} +2 -2
- package/bin/{chunk-7v7mypc6.js → chunk-zhq7a7hs.js} +2 -2
- package/bin/{chunk-f25fe9th.js → chunk-zmnvskn7.js} +11 -11
- package/bin/shumai-app.html +1 -1
- package/bin/shumai-app.js +470 -389
- package/package.json +7 -7
- package/prisma/migrations/20261102032402_add_archive_storage/migration.sql +25 -0
- package/prisma/schema.prisma +12 -6
- package/bin/chunk-0bj887zm.js +0 -2
- package/bin/chunk-1ktk6764.js +0 -10
- package/bin/chunk-26qn7fek.js +0 -2
- package/bin/chunk-2ne2b54t.js +0 -2
- package/bin/chunk-2vbeqczj.js +0 -1
- package/bin/chunk-37p6bcx2.js +0 -1
- package/bin/chunk-3knfx6dm.js +0 -1
- package/bin/chunk-3z85zxkn.js +0 -1
- package/bin/chunk-54tbfvya.js +0 -2
- package/bin/chunk-56kh5fxc.js +0 -1
- package/bin/chunk-576nj64j.js +0 -2
- package/bin/chunk-6cnqjngz.js +0 -1
- package/bin/chunk-7g46e1wy.js +0 -3
- package/bin/chunk-84x8p7v5.js +0 -1
- package/bin/chunk-88jg9dq5.js +0 -2
- package/bin/chunk-8fyg9dy4.js +0 -2
- package/bin/chunk-8gtfgkrn.js +0 -2
- package/bin/chunk-8mqbztj8.js +0 -2
- package/bin/chunk-8qdtvfx3.css +0 -1
- package/bin/chunk-8xb6yz11.js +0 -2
- package/bin/chunk-8yjsmr7g.js +0 -2
- package/bin/chunk-91rb0jpb.js +0 -2
- package/bin/chunk-96qpjght.js +0 -2
- package/bin/chunk-9f1xk1nt.js +0 -1
- package/bin/chunk-9mk9cvbk.js +0 -1
- package/bin/chunk-9nw5w8vh.js +0 -1
- package/bin/chunk-ah8fjb6f.js +0 -2
- package/bin/chunk-cf5axr8c.js +0 -1
- package/bin/chunk-dk42gf7v.js +0 -2
- package/bin/chunk-e4f56spj.js +0 -4
- package/bin/chunk-eb7mzbfm.js +0 -1
- package/bin/chunk-er14d498.js +0 -3
- package/bin/chunk-f6avg5qe.js +0 -129
- package/bin/chunk-fvx9k1dc.js +0 -2
- package/bin/chunk-gtf19jc1.js +0 -2
- package/bin/chunk-h1n7jqnw.js +0 -1
- package/bin/chunk-hfm82066.js +0 -2
- package/bin/chunk-j2s311yc.js +0 -3
- package/bin/chunk-kj6h5j5a.js +0 -4
- package/bin/chunk-km4gn6b6.js +0 -1
- package/bin/chunk-ny1kbmxt.js +0 -2
- package/bin/chunk-p3j6ydk1.js +0 -1
- package/bin/chunk-pk406dgy.js +0 -2
- package/bin/chunk-s1e4qy3q.js +0 -14
- package/bin/chunk-swtwaaqe.js +0 -1
- package/bin/chunk-tagdrg7p.js +0 -1
- package/bin/chunk-twtxnzbv.js +0 -2
- package/bin/chunk-v5mcjwxy.js +0 -2
- package/bin/chunk-vkzasgxw.js +0 -2
- package/bin/chunk-x342vzdx.js +0 -2
- package/bin/chunk-xc54vhfz.js +0 -2
- package/bin/chunk-xvkwbczx.js +0 -3
- package/bin/chunk-z1p13dnc.js +0 -2
- package/bin/chunk-zarz3sqn.js +0 -211
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,Je}from"./chunk-akafypge.js";import"./chunk-evs2aaav.js";import"./chunk-fb9dedm2.js";import"./chunk-7q4mgd5x.js";import"./chunk-7e9ws6dh.js";import"./chunk-d3brvxh7.js";import"./chunk-xd1axsdv.js";import"./chunk-zdvhh8mk.js";import"./chunk-bssb9tar.js";import"./chunk-q57m34h0.js";import"./chunk-3mx4trvh.js";import"./chunk-q9fsxakd.js";import"./chunk-s4hkcw24.js";import{Ma}from"./chunk-zc1asygg.js";import"./chunk-av2w1sez.js";import"./chunk-km70p970.js";import"./chunk-8a7ymmd4.js";import"./chunk-k9vjs21p.js";import"./chunk-n54ftsdx.js";import"./chunk-na5fh7er.js";import"./chunk-qw92z3wf.js";import"./chunk-zg0b902x.js";import"./chunk-81b8rfv7.js";import"./chunk-wzrzc07t.js";function r(){let{shareId:e}=o.useParams();return a(Ma,{shareId:e})}var o=Je("/share/$shareId/")({component:r});export{o as Route};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{S,L,a,ee,Je,R,Ft,$t,oA}from"./chunk-akafypge.js";import"./chunk-d3brvxh7.js";import"./chunk-3mx4trvh.js";import"./chunk-wmrrapwv.js";import"./chunk-s4hkcw24.js";import{dc}from"./chunk-ff0mh9p3.js";import"./chunk-45pb3kzz.js";import"./chunk-6rqakmg0.js";import"./chunk-vf9s8b5t.js";import{yr}from"./chunk-e8zzg57c.js";import"./chunk-k9vjs21p.js";import"./chunk-n54ftsdx.js";import"./chunk-na5fh7er.js";L();function m(){let{projectId:e,folderId:s}=c.useParams(),{teamId:r,ensureTeamIdForProject:t}=Ft();S(()=>{t(e)},[e,t]);let{data:d}=yr(oA(e)),o=d?.rootFolder,{data:f}=ee({queryKey:["folders",o],queryFn:async()=>{let n=await R.api.folders[":folderId"].$get({param:{folderId:o}});if(!n.ok)throw Error("failed to fetch folder");return await n.json()},enabled:!!o});if(!r||!o||!f)return a($t,{});return a(dc,{teamId:r,projectId:e,projectName:d.name??"",assetId:s,rootFolderId:o,isRoot:!1})}var c=Je("/projects/$projectId/folders/$folderId_/agentsmd")({component:m});export{c as Route};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{j}from"./chunk-akafypge.js";var e=[["path",{d:"m2 21 9.6-9.6",key:"9l79m3"}],["path",{d:"m7.5 15.5 2.3 2.3a1 1 0 0 1 0 1.4l-2.1 2.1a1 1 0 0 1-1.4 0L4 19",key:"fw8biw"}],["circle",{cx:"15.5",cy:"7.5",r:"5.5",key:"4wxmhb"}]],Hi=j("key",e);var c=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Iu=j("shield-check",c);
|
|
2
|
+
export{Hi,Iu};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{S,L,a,ee,X,Je,R,_y,Ft,nA,_v}from"./chunk-akafypge.js";import"./chunk-7e9ws6dh.js";import"./chunk-evs2aaav.js";import"./chunk-fb9dedm2.js";import"./chunk-7q4mgd5x.js";import"./chunk-d3brvxh7.js";import"./chunk-3mx4trvh.js";import"./chunk-wmrrapwv.js";import"./chunk-t6cb99gp.js";import"./chunk-xd1axsdv.js";import"./chunk-zdvhh8mk.js";import"./chunk-bssb9tar.js";import"./chunk-q57m34h0.js";import"./chunk-s4hkcw24.js";import{To}from"./chunk-e0bckx12.js";import"./chunk-vf9s8b5t.js";import{yr}from"./chunk-e8zzg57c.js";import"./chunk-av2w1sez.js";import"./chunk-km70p970.js";import"./chunk-8a7ymmd4.js";import"./chunk-k9vjs21p.js";import"./chunk-n54ftsdx.js";import"./chunk-na5fh7er.js";import"./chunk-qw92z3wf.js";import"./chunk-zg0b902x.js";import"./chunk-81b8rfv7.js";import"./chunk-wzrzc07t.js";L();function f(){let{projectId:e,collectionId:n}=I.useParams(),{teamId:c,ensureTeamIdForProject:i}=Ft();S(()=>{i(e)},[e,i]);let{data:l}=yr(nA(e)),{data:r,refetch:d}=ee({..._v(n)}),{mutate:p}=X({mutationFn:async(t)=>{let s=await R.api.collections[":collectionId"].$patch({param:{collectionId:n},json:t});if(!s.ok)throw Error("Failed to update collection");return await s.json()},onSuccess:()=>{d()}}),o=l?.rootFolder,{data:m}=ee({queryKey:["folders",o],queryFn:async()=>{let t=await R.api.folders[":folderId"].$get({param:{folderId:o}});if(!t.ok)throw Error("Failed to fetch folder");return await t.json()},enabled:!!o});if(!c||!o||!m||!r)return a("div",{children:_y()});let u=r.filter.sourceFolderId||o;return a(To,{teamId:c,projectId:e,projectName:l.name??"",assetId:u,rootFolderId:o,collection:r,onUpdateCollection:p})}var I=Je("/projects/$projectId/collections/$collectionId")({component:f});export{I as Route};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{xc,Cc}from"./chunk-dfbzatq9.js";import{jm,qm,$m,Tf}from"./chunk-2qzmh3ae.js";function p(e){return`'${e.replaceAll("'","''")}'`}function f(e){return async(t)=>{if(t.length===0)return[];let n=(await e.batch(t.map((r)=>e.prepare(`PRAGMA index_list(${p(r)})`)))).flatMap((r,o)=>{let i=t[o];if(!i)return[];return r.results.map((u)=>({...u,tableName:i}))});if(n.length===0)return[];let l=await e.batch(n.map((r)=>e.prepare(`PRAGMA index_info(${p(r.name)})`)));return n.map((r,o)=>({columns:(l[o]?.results??[]).map((i)=>({fullLength:i.name!==null,name:i.name,position:i.seqno})),name:r.name,partial:r.partial!==0,table:r.tableName,unique:r.unique!==0,valid:!0}))}}var h=class extends Cc{get supportsMultipleConnections(){return!0}},m=class{#e;#t;constructor(e){this.#e={...e}}async init(){if(this.#t=new w(this.#e.database),this.#e.onCreateConnection)await this.#e.onCreateConnection(this.#t)}async acquireConnection(){return this.#t}async beginTransaction(){throw Error("D1 does not support interactive transactions. Use the D1 batch() API instead.")}async commitTransaction(){throw Error("D1 does not support interactive transactions. Use the D1 batch() API instead.")}async rollbackTransaction(){throw Error("D1 does not support interactive transactions. Use the D1 batch() API instead.")}async releaseConnection(){}async destroy(){}},w=class{#e;constructor(e){this.#e=e}async executeQuery(e){let t=await this.#e.prepare(e.sql).bind(...e.parameters).all(),n=t.meta.changes!=null?BigInt(t.meta.changes):void 0;return{insertId:t.meta.last_row_id===void 0||t.meta.last_row_id===null?void 0:BigInt(t.meta.last_row_id),rows:t?.results||[],numAffectedRows:n}}async*streamQuery(){throw Error("D1 does not support streaming queries.")}},d=class{#e;#t;constructor(e,t){this.#e=e,this.#t=t}async getSchemas(){return[]}async getTables(e={withInternalKyselyTables:!1}){let t=this.#e.selectFrom("sqlite_master").where("type","in",["table","view"]).where("name","not like","sqlite_%").where("name","not like","_cf_%").select(["name","type"]).$castTo();if(!e.withInternalKyselyTables)t=t.where("name","!=",jm).where("name","!=",qm);let n=await t.execute();if(n.length===0)return[];let l=n.map((a)=>this.#t.prepare("SELECT * FROM pragma_table_info(?)").bind(a.name)),r=await this.#t.batch(l),o=n.flatMap((a,s)=>{let c=$m(r[s]?.results??[]);return c?[{index:s,tableName:a.name,column:c}]:[]}),i=o.length?await this.#t.batch(o.map(({tableName:a})=>this.#t.prepare(`PRAGMA index_list(${p(a)})`))):[],u=new Map(o.filter((a,s)=>!i[s]?.results?.some((c)=>c.origin==="pk")).map(({index:a,column:s})=>[a,s]));return n.map((a,s)=>Tf(a,r[s]?.results??[],u.get(s)))}async getMetadata(e){return{tables:await this.getTables(e)}}},y=class extends xc{},q=class{#e;constructor(e){this.#e={...e}}createDriver(){return new m(this.#e)}createQueryCompiler(){return new y}createAdapter(){return new h}createIntrospector(e){return new d(e,this.#e.database)}};export{q as D1SqliteDialect,f as createD1IndexIntrospector};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ee}from"./chunk-
|
|
2
|
+
import{Ee}from"./chunk-d277evce.js";import{ei}from"./chunk-0njsjy6x.js";function B(u,f){if(typeof u==="string"&&typeof f==="string")return u.toLowerCase()===f.toLowerCase();return u===f}function T(u,f){if(typeof u!=="string")return f.includes(u);return f.some((w)=>typeof w==="string"&&u.toLowerCase()===w.toLowerCase())}function k(u,f){return!T(u,f)}function J(u,f){if(typeof u!=="string"||typeof f!=="string")return!1;return u.toLowerCase().includes(f.toLowerCase())}function v(u,f){if(typeof u!=="string"||typeof f!=="string")return!1;return u.toLowerCase().startsWith(f.toLowerCase())}function _(u,f){if(typeof u!=="string"||typeof f!=="string")return!1;return u.toLowerCase().endsWith(f.toLowerCase())}function N(u){let f=new Map;for(let w of u)f.set(w.id,w);return f}function x(u,f,w){let L=new Set([...Object.keys(f),...Object.keys(w)]);for(let j of L){if(!(j in w)){delete u[j];continue}let d=N(f[j]??[]),m=w[j]??[],R=N(m),M=u[j]??[],A=[],O=new Set;for(let n of M){let r=n.id,l=d.get(r),c=R.get(r);if(l!==void 0&&c===void 0)continue;if(c!==void 0&&F(l,c))A.push(c);else A.push(n);O.add(r)}for(let n of m)if(!d.has(n.id)&&!O.has(n.id))A.push(n);u[j]=A}}function F(u,f){if(u===void 0)return!0;return JSON.stringify(u)!==JSON.stringify(f)}var q=(u,f)=>{let w=null,L=(d)=>ei({config:{adapterId:"memory",adapterName:"Memory Adapter",usePlural:!1,debugLogs:f?.debugLogs||!1,supportsArrays:!0,customTransformInput(m){if(m.options.advanced?.database?.generateId==="serial"&&m.field==="id"&&m.action==="create")return d[m.model].length+1;return m.data},transaction:async(m)=>{let R=structuredClone(d),M=structuredClone(d),A=await m(L(M)(w));return x(d,R,M),A}},adapter:({getFieldName:m,getDefaultFieldName:R,options:M})=>{let A=(n,r,l)=>{if(!r)return n;return n.sort((c,o)=>{let a=m({model:l,field:r.field}),s=c[a],g=o[a],y=0;if(s==null&&g==null)y=0;else if(s==null)y=-1;else if(g==null)y=1;else if(typeof s==="string"&&typeof g==="string")y=s.localeCompare(g);else if(s instanceof Date&&g instanceof Date)y=s.getTime()-g.getTime();else if(typeof s==="number"&&typeof g==="number")y=s-g;else if(typeof s==="boolean"&&typeof g==="boolean")y=s===g?0:s?1:-1;else y=String(s).localeCompare(String(g));return r.direction==="asc"?y:-y})};function O(n,r,l,c,o){let a=(()=>{let y=d[r];if(!y)throw Ee.error(`[MemoryAdapter] Model ${r} not found in the DB`,Object.keys(d)),Error(`Model ${r} not found`);let h=(e,p)=>{let{field:i,value:t,operator:S,mode:I="sensitive"}=p,b=I==="insensitive"&&(typeof t==="string"||Array.isArray(t)&&t.every((E)=>typeof E==="string"));switch(S){case"in":if(!Array.isArray(t))throw Error("Value must be an array");if(b)return T(e[i],t);return t.includes(e[i]);case"not_in":if(!Array.isArray(t))throw Error("Value must be an array");if(b)return k(e[i],t);return!t.includes(e[i]);case"contains":if(b)return J(e[i],t);return e[i]?.includes(t);case"starts_with":if(b)return v(e[i],t);return e[i].startsWith(t);case"ends_with":if(b)return _(e[i],t);return e[i].endsWith(t);case"ne":return b?!B(e[i],t):e[i]!==t;case"gt":return t!=null&&Boolean(e[i]>t);case"gte":return t!=null&&Boolean(e[i]>=t);case"lt":return t!=null&&Boolean(e[i]<t);case"lte":return t!=null&&Boolean(e[i]<=t);default:if(b)return B(e[i],t);if(t===null)return e[i]==null;return e[i]===t}},C=y.filter((e)=>{if(!n.length||n.length===0)return!0;let p=h(e,n[0]);for(let i of n){let t=h(e,i);if(i.connector==="OR")p=p||t;else p=p&&t}return p});if(o?.length&&o.length>0)C=C.map((e)=>Object.fromEntries(Object.entries(e).filter(([p])=>o.includes(R({model:l,field:p})))));return C})();if(!c)return a;let s=new Map,g=new Map;for(let y of a){let h=String(y.id);if(!s.has(h)){let e={...y};for(let[p,i]of Object.entries(c)){let t=p;if(i.relation==="one-to-one")e[t]=null;else e[t]=[],g.set(`${h}-${p}`,new Set)}s.set(h,e)}let C=s.get(h);for(let[e,p]of Object.entries(c)){let i=e,t=d[i];if(!t)throw Ee.error(`[MemoryAdapter] JoinOption model ${i} not found in the DB`,Object.keys(d)),Error(`JoinOption model ${i} not found`);let S=t.filter((I)=>I[p.on.to]===y[p.on.from]);if(p.relation==="one-to-one")C[i]=S[0]||null;else{let I=g.get(`${h}-${e}`),b=p.limit??100,E=0;for(let W of S){if(E>=b)break;if(!I.has(W.id))C[i].push(W),I.add(W.id),E++}}}}return Array.from(s.values())}return{create:async({model:n,data:r})=>{if(M.advanced?.database?.generateId==="serial")r.id=d[n].length+1;if(!d[n])d[n]=[];return d[n].push(r),r},findOne:async({model:n,modelKey:r=n,where:l,select:c,join:o})=>{let a=O(l,n,r,o,c);if(o){let s=a;if(!s.length)return null;return s[0]}return a[0]||null},findMany:async({model:n,modelKey:r=n,where:l,sortBy:c,limit:o,select:a,offset:s,join:g})=>{let y=O(l||[],n,r,g,a);if(g){let C=y;if(!C.length)return[];A(C,c,r);let e=C;if(s!==void 0)e=e.slice(s);if(o!==void 0)e=e.slice(0,o);return e}let h=A(y,c,r);if(s!==void 0)h=h.slice(s);if(o!==void 0)h=h.slice(0,o);return h||[]},count:async({model:n,modelKey:r=n,where:l})=>{if(l)return O(l,n,r).length;return d[n].length},update:async({model:n,modelKey:r=n,where:l,update:c})=>{if(l.length===0)return null;let o=O(l,n,r);return o.forEach((a)=>{Object.assign(a,c)}),o[0]||null},delete:async({model:n,modelKey:r=n,where:l})=>{if(l.length===0)return;let c=d[n],o=O(l,n,r);d[n]=c.filter((a)=>!o.includes(a))},deleteMany:async({model:n,modelKey:r=n,where:l})=>{let c=d[n],o=O(l,n,r),a=0;return d[n]=c.filter((s)=>{if(o.includes(s))return a++,!1;return!o.includes(s)}),a},consumeOne:async({model:n,modelKey:r=n,where:l})=>{let c=d[n],o=O(l,n,r)[0];if(!o)return null;return d[n]=c.filter((a)=>a!==o),o},incrementOne:async({model:n,modelKey:r=n,where:l,increment:c,set:o})=>{let a=O(l,n,r)[0];if(!a)return null;for(let[s,g]of Object.entries(c))a[s]=(typeof a[s]==="number"?a[s]:0)+g;if(o)Object.assign(a,o);return a},updateMany:async({model:n,modelKey:r=n,where:l,update:c})=>{let o=O(l,n,r);return o.forEach((a)=>{Object.assign(a,c)}),o.length}}}}),j=L(u);return(d)=>(w=d,j(d))};export{q as memoryAdapter};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
function
|
|
3
|
-
export{
|
|
2
|
+
function yi(i){let t=3735928559,h=1103547991;for(let e=0;e<i.length;e++){let l=i.charCodeAt(e);t=Math.imul(t^l,2654435761),h=Math.imul(h^l,1597334677)}return t=Math.imul(t^t>>>16,2246822507)^Math.imul(h^h>>>13,3266489909),h=Math.imul(h^h>>>16,2246822507)^Math.imul(t^t>>>13,3266489909),(h>>>0).toString(36)+(t>>>0).toString(36)}
|
|
3
|
+
export{yi};
|