@struktoai/mirage-node 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/dist/aliyun-S62BR3TB.js +11 -0
- package/dist/append.lua +17 -0
- package/dist/backblaze-4EKSW63F.js +11 -0
- package/dist/box-ZPLZAGMK.js +8 -0
- package/dist/ceph-ALKLD3MO.js +11 -0
- package/dist/{chunk-VLRSOWHP.js → chunk-2A4YGVBM.js} +5 -14
- package/dist/chunk-2A4YGVBM.js.map +1 -0
- package/dist/chunk-2HCYLVGY.js +28 -0
- package/dist/chunk-2HCYLVGY.js.map +1 -0
- package/dist/chunk-2VPZAH5Q.js +20 -0
- package/dist/chunk-2VPZAH5Q.js.map +1 -0
- package/dist/{chunk-HCU3B6FW.js → chunk-3JZQ6VSZ.js} +5 -4
- package/dist/chunk-3JZQ6VSZ.js.map +1 -0
- package/dist/chunk-4IF4TGAI.js +11 -0
- package/dist/chunk-4IF4TGAI.js.map +1 -0
- package/dist/{chunk-L7FEZ7LU.js → chunk-5H6KNEPP.js} +4 -5
- package/dist/{chunk-L7FEZ7LU.js.map → chunk-5H6KNEPP.js.map} +1 -1
- package/dist/{chunk-25W4XQJZ.js → chunk-5K2MWDCE.js} +4 -5
- package/dist/{chunk-25W4XQJZ.js.map → chunk-5K2MWDCE.js.map} +1 -1
- package/dist/{chunk-L4GMDSMB.js → chunk-6SVXWRKX.js} +4 -5
- package/dist/{chunk-L4GMDSMB.js.map → chunk-6SVXWRKX.js.map} +1 -1
- package/dist/{chunk-H62XQZUM.js → chunk-6VOIUGAD.js} +22 -10
- package/dist/chunk-6VOIUGAD.js.map +1 -0
- package/dist/{chunk-SI4GMRXD.js → chunk-7JYHFXXC.js} +4 -8
- package/dist/chunk-7JYHFXXC.js.map +1 -0
- package/dist/chunk-7VQQFWV6.js +20 -0
- package/dist/chunk-7VQQFWV6.js.map +1 -0
- package/dist/chunk-7ZP6TPHX.js +87 -0
- package/dist/chunk-7ZP6TPHX.js.map +1 -0
- package/dist/{chunk-HWQPEBID.js → chunk-ADEXNSYU.js} +6 -12
- package/dist/chunk-ADEXNSYU.js.map +1 -0
- package/dist/chunk-AQSYAXL4.js +16 -0
- package/dist/chunk-AQSYAXL4.js.map +1 -0
- package/dist/{chunk-NJ42VNXG.js → chunk-ATLXMNKD.js} +8 -3
- package/dist/chunk-ATLXMNKD.js.map +1 -0
- package/dist/{chunk-CB76WPUS.js → chunk-BYCUGFRF.js} +5 -4
- package/dist/chunk-BYCUGFRF.js.map +1 -0
- package/dist/{chunk-4M73WHIE.js → chunk-BZTVYOES.js} +3 -3
- package/dist/{chunk-CQCTCW4S.js → chunk-CRC4YWXB.js} +28 -9
- package/dist/chunk-CRC4YWXB.js.map +1 -0
- package/dist/{chunk-C7TNKIK5.js → chunk-CTGXJHO5.js} +1 -1
- package/dist/chunk-CTGXJHO5.js.map +1 -0
- package/dist/{chunk-HSD24IP2.js → chunk-DCDBIXVZ.js} +7 -2
- package/dist/chunk-DCDBIXVZ.js.map +1 -0
- package/dist/{chunk-HEDE2377.js → chunk-DDAFNROK.js} +318 -322
- package/dist/chunk-DDAFNROK.js.map +1 -0
- package/dist/chunk-DQIEWEAW.js +85 -0
- package/dist/chunk-DQIEWEAW.js.map +1 -0
- package/dist/{chunk-2ERLWAGG.js → chunk-EBI4IHDC.js} +20 -11
- package/dist/chunk-EBI4IHDC.js.map +1 -0
- package/dist/{chunk-RHUEV4I7.js → chunk-EIUTZ6N7.js} +10 -24
- package/dist/chunk-EIUTZ6N7.js.map +1 -0
- package/dist/{chunk-IUXXZHY3.js → chunk-EJZG5VUF.js} +24 -12
- package/dist/chunk-EJZG5VUF.js.map +1 -0
- package/dist/{chunk-BWWU5T2D.js → chunk-ENW5BVYN.js} +3 -3
- package/dist/{chunk-F5NWRF32.js → chunk-ETIAW4YD.js} +3 -3
- package/dist/chunk-EUPXAYPB.js +20 -0
- package/dist/chunk-EUPXAYPB.js.map +1 -0
- package/dist/{chunk-EGZNOUMH.js → chunk-FA6YNU75.js} +4 -5
- package/dist/{chunk-EGZNOUMH.js.map → chunk-FA6YNU75.js.map} +1 -1
- package/dist/{chunk-XUUSWR4U.js → chunk-FFH6R5VQ.js} +7 -2
- package/dist/{chunk-XUUSWR4U.js.map → chunk-FFH6R5VQ.js.map} +1 -1
- package/dist/{chunk-JEBH5APX.js → chunk-GE6H2COM.js} +5 -13
- package/dist/chunk-GE6H2COM.js.map +1 -0
- package/dist/{chunk-TUNR4VUM.js → chunk-GMMQ3ZK4.js} +3 -3
- package/dist/{chunk-SAOQW6ZJ.js → chunk-GSGE3M5P.js} +5 -13
- package/dist/chunk-GSGE3M5P.js.map +1 -0
- package/dist/{chunk-DXU7NZPH.js → chunk-HCRYAFBI.js} +3 -3
- package/dist/{chunk-OSVZKYXS.js → chunk-HOPUP6LA.js} +192 -156
- package/dist/chunk-HOPUP6LA.js.map +1 -0
- package/dist/chunk-HS24BL6W.js +160 -0
- package/dist/chunk-HS24BL6W.js.map +1 -0
- package/dist/chunk-HVYVG5KQ.js +16 -0
- package/dist/chunk-HVYVG5KQ.js.map +1 -0
- package/dist/{chunk-XEMLYWHK.js → chunk-I7CPLZNW.js} +4 -5
- package/dist/{chunk-XEMLYWHK.js.map → chunk-I7CPLZNW.js.map} +1 -1
- package/dist/{chunk-AULFV3KY.js → chunk-IFUCGI4I.js} +7 -2
- package/dist/chunk-IFUCGI4I.js.map +1 -0
- package/dist/{chunk-HGIPWY5Y.js → chunk-IFYXSSKR.js} +6 -6
- package/dist/chunk-IFYXSSKR.js.map +1 -0
- package/dist/chunk-IXA4DQE4.js +20 -0
- package/dist/chunk-IXA4DQE4.js.map +1 -0
- package/dist/chunk-IZMKMD3O.js +11 -0
- package/dist/chunk-IZMKMD3O.js.map +1 -0
- package/dist/{chunk-4X6CLF4F.js → chunk-JJERW2BI.js} +4 -5
- package/dist/{chunk-4X6CLF4F.js.map → chunk-JJERW2BI.js.map} +1 -1
- package/dist/{chunk-M6E7VK4D.js → chunk-JQR4HVUX.js} +2 -5
- package/dist/chunk-JQR4HVUX.js.map +1 -0
- package/dist/{chunk-BWLUBJQG.js → chunk-JXOMDLFS.js} +6 -15
- package/dist/chunk-JXOMDLFS.js.map +1 -0
- package/dist/{chunk-5ZHNPNDD.js → chunk-KIX6N7NT.js} +198 -141
- package/dist/chunk-KIX6N7NT.js.map +1 -0
- package/dist/{chunk-XFSEADPC.js → chunk-L42UTDFK.js} +7 -2
- package/dist/chunk-L42UTDFK.js.map +1 -0
- package/dist/chunk-M2UF2JHJ.js +11 -0
- package/dist/chunk-M2UF2JHJ.js.map +1 -0
- package/dist/{chunk-LPLZLSMK.js → chunk-MONC734W.js} +7 -2
- package/dist/chunk-MONC734W.js.map +1 -0
- package/dist/{chunk-XADEMW6B.js → chunk-N72RLCMU.js} +4 -5
- package/dist/{chunk-XADEMW6B.js.map → chunk-N72RLCMU.js.map} +1 -1
- package/dist/{chunk-ZPB3SLPK.js → chunk-ND4IWJ4V.js} +7 -2
- package/dist/chunk-ND4IWJ4V.js.map +1 -0
- package/dist/{chunk-ZPZQXHW2.js → chunk-NZ3EKGW4.js} +260 -178
- package/dist/chunk-NZ3EKGW4.js.map +1 -0
- package/dist/{chunk-E3KXVEYI.js → chunk-OAE57MNL.js} +22 -10
- package/dist/chunk-OAE57MNL.js.map +1 -0
- package/dist/{chunk-JBDFYIN2.js → chunk-OHKGIQB4.js} +2 -5
- package/dist/chunk-OHKGIQB4.js.map +1 -0
- package/dist/{chunk-V7JVMG63.js → chunk-OXEQSPND.js} +3 -3
- package/dist/{chunk-YRJICL2Q.js → chunk-PKNE5J2B.js} +5 -13
- package/dist/chunk-PKNE5J2B.js.map +1 -0
- package/dist/chunk-PSXXEGYQ.js +16 -0
- package/dist/chunk-PSXXEGYQ.js.map +1 -0
- package/dist/{chunk-KAWDDS27.js → chunk-QAOVABCR.js} +7 -2
- package/dist/chunk-QAOVABCR.js.map +1 -0
- package/dist/{chunk-SYMNWNC3.js → chunk-QQ7FP4GD.js} +4 -5
- package/dist/{chunk-SYMNWNC3.js.map → chunk-QQ7FP4GD.js.map} +1 -1
- package/dist/{chunk-3JZN3GYO.js → chunk-QYLVMC6B.js} +2 -5
- package/dist/chunk-QYLVMC6B.js.map +1 -0
- package/dist/{chunk-CXQGMFI7.js → chunk-RX3XR65X.js} +4 -5
- package/dist/{chunk-CXQGMFI7.js.map → chunk-RX3XR65X.js.map} +1 -1
- package/dist/{chunk-MRXTUFBZ.js → chunk-RYQJJB4C.js} +1 -1
- package/dist/chunk-RYQJJB4C.js.map +1 -0
- package/dist/{chunk-5I7Q7RHW.js → chunk-TUF7TCN7.js} +4 -5
- package/dist/{chunk-5I7Q7RHW.js.map → chunk-TUF7TCN7.js.map} +1 -1
- package/dist/{chunk-NLXJMXVE.js → chunk-TUX36JY5.js} +4 -5
- package/dist/{chunk-NLXJMXVE.js.map → chunk-TUX36JY5.js.map} +1 -1
- package/dist/{chunk-4GYB7DGC.js → chunk-TWRQCQWU.js} +327 -558
- package/dist/chunk-TWRQCQWU.js.map +1 -0
- package/dist/chunk-U6DFQRG3.js +20 -0
- package/dist/chunk-U6DFQRG3.js.map +1 -0
- package/dist/chunk-VI5YTKNY.js +20 -0
- package/dist/chunk-VI5YTKNY.js.map +1 -0
- package/dist/{chunk-FRGTDZQT.js → chunk-VQDF2UH5.js} +19 -5
- package/dist/chunk-VQDF2UH5.js.map +1 -0
- package/dist/{chunk-W5ZLIQFR.js → chunk-WG5YS6TC.js} +308 -200
- package/dist/chunk-WG5YS6TC.js.map +1 -0
- package/dist/{chunk-ZM44MGC5.js → chunk-WMJJ4WGF.js} +4 -5
- package/dist/{chunk-ZM44MGC5.js.map → chunk-WMJJ4WGF.js.map} +1 -1
- package/dist/{chunk-5YRWF5RP.js → chunk-WY4FNH42.js} +6 -5
- package/dist/chunk-WY4FNH42.js.map +1 -0
- package/dist/{chunk-VBYIDRNU.js → chunk-XIG5BWWH.js} +19 -10
- package/dist/chunk-XIG5BWWH.js.map +1 -0
- package/dist/chunk-XJBC3OYX.js +11 -0
- package/dist/chunk-XJBC3OYX.js.map +1 -0
- package/dist/{chunk-ZMREYTHA.js → chunk-XPRDXWK7.js} +8 -8
- package/dist/chunk-XPRDXWK7.js.map +1 -0
- package/dist/chunk-YKRQSZS7.js +96 -0
- package/dist/chunk-YKRQSZS7.js.map +1 -0
- package/dist/{chunk-IEVLWEBO.js → chunk-YMBL3VJB.js} +9 -8
- package/dist/chunk-YMBL3VJB.js.map +1 -0
- package/dist/{chunk-CGGO5NKD.js → chunk-YUJBXFYK.js} +357 -346
- package/dist/chunk-YUJBXFYK.js.map +1 -0
- package/dist/{chunk-S4KVLPBR.js → chunk-YZ4ZJNOL.js} +22 -10
- package/dist/chunk-YZ4ZJNOL.js.map +1 -0
- package/dist/chunk-ZTHVEXIV.js +11 -0
- package/dist/chunk-ZTHVEXIV.js.map +1 -0
- package/dist/{chunk-VHED2STW.js → chunk-ZVSYUCYS.js} +2 -1
- package/dist/chunk-ZVSYUCYS.js.map +1 -0
- package/dist/{config-T2IUIU5C.js → config-2YBCHU2W.js} +2 -2
- package/dist/{config-M3Z47VYU.js → config-3YRGRW72.js} +3 -2
- package/dist/config-4GSOMUMF.js +9 -0
- package/dist/config-5YBUWFUP.js +9 -0
- package/dist/{config-2LASFFRD.js → config-5ZRKJTKG.js} +3 -2
- package/dist/{config-W7EVPJNK.js → config-A25LTL5W.js} +2 -2
- package/dist/{config-WKQ3FGTZ.js → config-CLU7JABG.js} +2 -2
- package/dist/{config-E22XAGYN.js → config-D2RF7L3N.js} +2 -2
- package/dist/{config-HQXNFQZS.js → config-E55TKM6K.js} +2 -2
- package/dist/config-ELDOFRJW.js +9 -0
- package/dist/{config-EX3ZJTZI.js → config-FPC3RBFD.js} +2 -2
- package/dist/config-FPM3LAW7.js +9 -0
- package/dist/{config-IPNWAJHH.js → config-G3F54CS4.js} +3 -2
- package/dist/{config-BBOLI7VE.js → config-G43HRUI3.js} +2 -2
- package/dist/{config-QO2XUME4.js → config-GG3WO5PB.js} +3 -2
- package/dist/{config-QWQGOXQ5.js → config-JUYBWAZE.js} +2 -2
- package/dist/{config-SPW6NESU.js → config-LJ5T6TVA.js} +2 -2
- package/dist/{config-WVILHDFV.js → config-MDSAE4O3.js} +2 -2
- package/dist/{config-MZM3IPFM.js → config-NRIOKK5T.js} +2 -2
- package/dist/{config-L7SBSH5L.js → config-OYK2BSJK.js} +2 -2
- package/dist/config-PB3KA2CE.js +9 -0
- package/dist/{config-54USUVSE.js → config-QY4IL3PH.js} +3 -2
- package/dist/{config-VKKZGC7V.js → config-R4LAOEDS.js} +2 -2
- package/dist/{config-FRK7ZL37.js → config-RIAAD6RW.js} +3 -2
- package/dist/{config-J2C53GOT.js → config-SYNEQAUB.js} +2 -2
- package/dist/{config-XU6D5C7E.js → config-TJKGYA2B.js} +3 -2
- package/dist/{config-DWSJL3NH.js → config-UURRGA7U.js} +4 -2
- package/dist/{config-BIBFLUIR.js → config-VPLHQXVE.js} +2 -2
- package/dist/config-WRACCRPN.js +9 -0
- package/dist/{config-OJ2BPESH.js → config-WVHKXEVE.js} +3 -2
- package/dist/{config-CPYFOUQO.js → config-XU7R36IE.js} +3 -2
- package/dist/{config-A2GQYJDB.js → config-Y2KOUYSS.js} +2 -2
- package/dist/databricks_volume-CNCPTZHS.js +7 -0
- package/dist/digitalocean-DJZOUB6Q.js +11 -0
- package/dist/discord-ETB2CADR.js +7 -0
- package/dist/disk-WEHSTK3F.js +7 -0
- package/dist/dropbox-XN6PGLNE.js +8 -0
- package/dist/email-OV7XCP3T.js +8 -0
- package/dist/gcal-P56MRCGU.js +8 -0
- package/dist/gcs-HFBIAE2C.js +10 -0
- package/dist/gdocs-LQ3UXP3J.js +8 -0
- package/dist/gdrive-N6UBYLON.js +8 -0
- package/dist/github-BPZREGPI.js +8 -0
- package/dist/github_ci-7A4LUIZ7.js +8 -0
- package/dist/{gmail-2TBT4CVH.js → gmail-YED2MF6H.js} +2 -2
- package/dist/gridfs-CPLQ4G62.js +9 -0
- package/dist/gsheets-4BNIJPQ6.js +8 -0
- package/dist/gslides-GDBYLO5A.js +8 -0
- package/dist/hf_buckets-FTJITQ3P.js +10 -0
- package/dist/hf_datasets-6GXVKQD7.js +10 -0
- package/dist/hf_models-PJPGZAC5.js +10 -0
- package/dist/hf_spaces-LFNFOLBF.js +10 -0
- package/dist/index.d.ts +897 -609
- package/dist/index.js +2371 -781
- package/dist/index.js.map +1 -1
- package/dist/jaeger-GCA6MJ6E.js +8 -0
- package/dist/lancedb-TJ5YSJY5.js +7 -0
- package/dist/langfuse-RUMTUMXS.js +8 -0
- package/dist/linear-BCE4KEAC.js +7 -0
- package/dist/minio-5SO6KBTK.js +11 -0
- package/dist/mongodb-7C5MBESV.js +7 -0
- package/dist/nextcloud-4O2LZVW2.js +9 -0
- package/dist/notion-RVKEAQ2M.js +7 -0
- package/dist/oci-OQXOIC62.js +10 -0
- package/dist/postgres-AV45GNRS.js +7 -0
- package/dist/qingstor-W277YA4K.js +11 -0
- package/dist/r2-FUA4IORE.js +10 -0
- package/dist/{redis-6D55Q2WB.js → redis-LPS357NF.js} +2 -2
- package/dist/s3-FPNWWIVM.js +8 -0
- package/dist/scaleway-BP3732U7.js +11 -0
- package/dist/seaweedfs-MC6HIEP4.js +11 -0
- package/dist/slack-JFGW7VLN.js +7 -0
- package/dist/ssh-UYPG42LM.js +8 -0
- package/dist/supabase-A3KUFMDC.js +10 -0
- package/dist/tencent-5464UQ2X.js +11 -0
- package/dist/trello-O2KB3FUO.js +8 -0
- package/dist/wasabi-2IKBIWNO.js +10 -0
- package/dist/wasabi-2IKBIWNO.js.map +1 -0
- package/package.json +15 -3
- package/dist/aliyun-PGI57A43.js +0 -10
- package/dist/backblaze-TSPL6Y56.js +0 -10
- package/dist/box-7XTZYDSO.js +0 -8
- package/dist/ceph-C265UI5T.js +0 -10
- package/dist/chunk-2ERLWAGG.js.map +0 -1
- package/dist/chunk-2QNPKPZZ.js +0 -59
- package/dist/chunk-2QNPKPZZ.js.map +0 -1
- package/dist/chunk-3ASOQTZB.js +0 -59
- package/dist/chunk-3ASOQTZB.js.map +0 -1
- package/dist/chunk-3JZN3GYO.js.map +0 -1
- package/dist/chunk-4GYB7DGC.js.map +0 -1
- package/dist/chunk-5YRWF5RP.js.map +0 -1
- package/dist/chunk-5ZHNPNDD.js.map +0 -1
- package/dist/chunk-AULFV3KY.js.map +0 -1
- package/dist/chunk-BWLUBJQG.js.map +0 -1
- package/dist/chunk-C7TNKIK5.js.map +0 -1
- package/dist/chunk-CB76WPUS.js.map +0 -1
- package/dist/chunk-CGGO5NKD.js.map +0 -1
- package/dist/chunk-CQCTCW4S.js.map +0 -1
- package/dist/chunk-D3U7VQCG.js +0 -25
- package/dist/chunk-D3U7VQCG.js.map +0 -1
- package/dist/chunk-E3KXVEYI.js.map +0 -1
- package/dist/chunk-EVK6HH6Z.js +0 -17
- package/dist/chunk-EVK6HH6Z.js.map +0 -1
- package/dist/chunk-FRGTDZQT.js.map +0 -1
- package/dist/chunk-GF75O2EN.js +0 -54
- package/dist/chunk-GF75O2EN.js.map +0 -1
- package/dist/chunk-GTAS3QVC.js +0 -25
- package/dist/chunk-GTAS3QVC.js.map +0 -1
- package/dist/chunk-H62XQZUM.js.map +0 -1
- package/dist/chunk-HCU3B6FW.js.map +0 -1
- package/dist/chunk-HEDE2377.js.map +0 -1
- package/dist/chunk-HGIPWY5Y.js.map +0 -1
- package/dist/chunk-HSD24IP2.js.map +0 -1
- package/dist/chunk-HWQPEBID.js.map +0 -1
- package/dist/chunk-IEHPTILN.js +0 -21
- package/dist/chunk-IEHPTILN.js.map +0 -1
- package/dist/chunk-IEVLWEBO.js.map +0 -1
- package/dist/chunk-IKJQOYI4.js +0 -26
- package/dist/chunk-IKJQOYI4.js.map +0 -1
- package/dist/chunk-IUXXZHY3.js.map +0 -1
- package/dist/chunk-JBDFYIN2.js.map +0 -1
- package/dist/chunk-JEBH5APX.js.map +0 -1
- package/dist/chunk-JHI2PHHD.js +0 -25
- package/dist/chunk-JHI2PHHD.js.map +0 -1
- package/dist/chunk-KAWDDS27.js.map +0 -1
- package/dist/chunk-KGC2OGXI.js +0 -27
- package/dist/chunk-KGC2OGXI.js.map +0 -1
- package/dist/chunk-LPLZLSMK.js.map +0 -1
- package/dist/chunk-M6E7VK4D.js.map +0 -1
- package/dist/chunk-MIQ3ECZM.js +0 -54
- package/dist/chunk-MIQ3ECZM.js.map +0 -1
- package/dist/chunk-MRXTUFBZ.js.map +0 -1
- package/dist/chunk-NJ42VNXG.js.map +0 -1
- package/dist/chunk-OSVZKYXS.js.map +0 -1
- package/dist/chunk-RHUEV4I7.js.map +0 -1
- package/dist/chunk-S4KVLPBR.js.map +0 -1
- package/dist/chunk-SAOQW6ZJ.js.map +0 -1
- package/dist/chunk-SI4GMRXD.js.map +0 -1
- package/dist/chunk-UAJYJP5C.js +0 -59
- package/dist/chunk-UAJYJP5C.js.map +0 -1
- package/dist/chunk-UYA3XL3J.js +0 -54
- package/dist/chunk-UYA3XL3J.js.map +0 -1
- package/dist/chunk-VBYIDRNU.js.map +0 -1
- package/dist/chunk-VHED2STW.js.map +0 -1
- package/dist/chunk-VIICUPWQ.js +0 -23
- package/dist/chunk-VIICUPWQ.js.map +0 -1
- package/dist/chunk-VLRSOWHP.js.map +0 -1
- package/dist/chunk-W5ZLIQFR.js.map +0 -1
- package/dist/chunk-WTSSEUOZ.js +0 -59
- package/dist/chunk-WTSSEUOZ.js.map +0 -1
- package/dist/chunk-WWP2STF5.js +0 -59
- package/dist/chunk-WWP2STF5.js.map +0 -1
- package/dist/chunk-XFSEADPC.js.map +0 -1
- package/dist/chunk-YBVMZ7SR.js +0 -59
- package/dist/chunk-YBVMZ7SR.js.map +0 -1
- package/dist/chunk-YRJICL2Q.js.map +0 -1
- package/dist/chunk-ZMREYTHA.js.map +0 -1
- package/dist/chunk-ZPB3SLPK.js.map +0 -1
- package/dist/chunk-ZPZQXHW2.js.map +0 -1
- package/dist/config-3WDIJPTG.js +0 -9
- package/dist/config-4QV4QYI5.js +0 -9
- package/dist/config-5ZXN2T2H.js +0 -9
- package/dist/config-EHE52ZTK.js +0 -9
- package/dist/config-HTXOOAOD.js +0 -9
- package/dist/config-K63RX6EU.js +0 -9
- package/dist/config-LEALEMKA.js +0 -9
- package/dist/config-RI7IEZUF.js +0 -9
- package/dist/databricks_volume-ETRDJVVQ.js +0 -7
- package/dist/digitalocean-QP72DR4J.js +0 -10
- package/dist/discord-BSN5RB3E.js +0 -8
- package/dist/disk-24NWTN2I.js +0 -7
- package/dist/dropbox-OSTZXSIE.js +0 -8
- package/dist/email-4ZFPSWIN.js +0 -8
- package/dist/gcs-PFWR6MIW.js +0 -10
- package/dist/gdocs-GPAZRQG5.js +0 -8
- package/dist/gdrive-XSX6A7B3.js +0 -8
- package/dist/github-EQ4NXUTA.js +0 -8
- package/dist/github_ci-QL5B2Q2N.js +0 -8
- package/dist/gridfs-KZRZ6SIB.js +0 -9
- package/dist/gsheets-N53WEXN2.js +0 -8
- package/dist/gslides-TATSARTH.js +0 -8
- package/dist/hf_buckets-BK7NGJWS.js +0 -10
- package/dist/hf_datasets-UQ5QGM4L.js +0 -10
- package/dist/hf_models-75LFCQCS.js +0 -10
- package/dist/hf_spaces-6T2KB3UC.js +0 -10
- package/dist/langfuse-AMQCQWNE.js +0 -8
- package/dist/linear-V3TXO6CV.js +0 -8
- package/dist/minio-IZRZY4C5.js +0 -10
- package/dist/mongodb-VMKPQCPX.js +0 -7
- package/dist/nextcloud-5RHQCGDO.js +0 -9
- package/dist/notion-6PPNTQFM.js +0 -8
- package/dist/oci-CKYBSFZJ.js +0 -10
- package/dist/postgres-WIQBVL5M.js +0 -7
- package/dist/qingstor-AP4IIPLY.js +0 -10
- package/dist/r2-C4XGEWQY.js +0 -10
- package/dist/s3-XQBI2CXN.js +0 -8
- package/dist/scaleway-SEZJVURB.js +0 -10
- package/dist/seaweedfs-3XYIAFU2.js +0 -10
- package/dist/slack-ZHXDJQY4.js +0 -8
- package/dist/ssh-X2MO7JOV.js +0 -8
- package/dist/supabase-BBM44UTM.js +0 -10
- package/dist/tencent-X72USLJ7.js +0 -10
- package/dist/trello-EER5NG7L.js +0 -8
- package/dist/wasabi-O4MVIUFG.js +0 -10
- /package/dist/{aliyun-PGI57A43.js.map → aliyun-S62BR3TB.js.map} +0 -0
- /package/dist/{backblaze-TSPL6Y56.js.map → backblaze-4EKSW63F.js.map} +0 -0
- /package/dist/{box-7XTZYDSO.js.map → box-ZPLZAGMK.js.map} +0 -0
- /package/dist/{ceph-C265UI5T.js.map → ceph-ALKLD3MO.js.map} +0 -0
- /package/dist/{chunk-4M73WHIE.js.map → chunk-BZTVYOES.js.map} +0 -0
- /package/dist/{chunk-BWWU5T2D.js.map → chunk-ENW5BVYN.js.map} +0 -0
- /package/dist/{chunk-F5NWRF32.js.map → chunk-ETIAW4YD.js.map} +0 -0
- /package/dist/{chunk-TUNR4VUM.js.map → chunk-GMMQ3ZK4.js.map} +0 -0
- /package/dist/{chunk-DXU7NZPH.js.map → chunk-HCRYAFBI.js.map} +0 -0
- /package/dist/{chunk-V7JVMG63.js.map → chunk-OXEQSPND.js.map} +0 -0
- /package/dist/{config-2LASFFRD.js.map → config-2YBCHU2W.js.map} +0 -0
- /package/dist/{config-3WDIJPTG.js.map → config-3YRGRW72.js.map} +0 -0
- /package/dist/{config-4QV4QYI5.js.map → config-4GSOMUMF.js.map} +0 -0
- /package/dist/{config-54USUVSE.js.map → config-5YBUWFUP.js.map} +0 -0
- /package/dist/{config-5ZXN2T2H.js.map → config-5ZRKJTKG.js.map} +0 -0
- /package/dist/{config-A2GQYJDB.js.map → config-A25LTL5W.js.map} +0 -0
- /package/dist/{config-BBOLI7VE.js.map → config-CLU7JABG.js.map} +0 -0
- /package/dist/{config-BIBFLUIR.js.map → config-D2RF7L3N.js.map} +0 -0
- /package/dist/{config-CPYFOUQO.js.map → config-E55TKM6K.js.map} +0 -0
- /package/dist/{config-DWSJL3NH.js.map → config-ELDOFRJW.js.map} +0 -0
- /package/dist/{config-E22XAGYN.js.map → config-FPC3RBFD.js.map} +0 -0
- /package/dist/{config-EHE52ZTK.js.map → config-FPM3LAW7.js.map} +0 -0
- /package/dist/{config-EX3ZJTZI.js.map → config-G3F54CS4.js.map} +0 -0
- /package/dist/{config-FRK7ZL37.js.map → config-G43HRUI3.js.map} +0 -0
- /package/dist/{config-HQXNFQZS.js.map → config-GG3WO5PB.js.map} +0 -0
- /package/dist/{config-HTXOOAOD.js.map → config-JUYBWAZE.js.map} +0 -0
- /package/dist/{config-IPNWAJHH.js.map → config-LJ5T6TVA.js.map} +0 -0
- /package/dist/{config-J2C53GOT.js.map → config-MDSAE4O3.js.map} +0 -0
- /package/dist/{config-K63RX6EU.js.map → config-NRIOKK5T.js.map} +0 -0
- /package/dist/{config-L7SBSH5L.js.map → config-OYK2BSJK.js.map} +0 -0
- /package/dist/{config-LEALEMKA.js.map → config-PB3KA2CE.js.map} +0 -0
- /package/dist/{config-M3Z47VYU.js.map → config-QY4IL3PH.js.map} +0 -0
- /package/dist/{config-MZM3IPFM.js.map → config-R4LAOEDS.js.map} +0 -0
- /package/dist/{config-OJ2BPESH.js.map → config-RIAAD6RW.js.map} +0 -0
- /package/dist/{config-QO2XUME4.js.map → config-SYNEQAUB.js.map} +0 -0
- /package/dist/{config-QWQGOXQ5.js.map → config-TJKGYA2B.js.map} +0 -0
- /package/dist/{config-RI7IEZUF.js.map → config-UURRGA7U.js.map} +0 -0
- /package/dist/{config-SPW6NESU.js.map → config-VPLHQXVE.js.map} +0 -0
- /package/dist/{config-T2IUIU5C.js.map → config-WRACCRPN.js.map} +0 -0
- /package/dist/{config-VKKZGC7V.js.map → config-WVHKXEVE.js.map} +0 -0
- /package/dist/{config-W7EVPJNK.js.map → config-XU7R36IE.js.map} +0 -0
- /package/dist/{config-WKQ3FGTZ.js.map → config-Y2KOUYSS.js.map} +0 -0
- /package/dist/{config-WVILHDFV.js.map → databricks_volume-CNCPTZHS.js.map} +0 -0
- /package/dist/{config-XU6D5C7E.js.map → digitalocean-DJZOUB6Q.js.map} +0 -0
- /package/dist/{databricks_volume-ETRDJVVQ.js.map → discord-ETB2CADR.js.map} +0 -0
- /package/dist/{digitalocean-QP72DR4J.js.map → disk-WEHSTK3F.js.map} +0 -0
- /package/dist/{discord-BSN5RB3E.js.map → dropbox-XN6PGLNE.js.map} +0 -0
- /package/dist/{disk-24NWTN2I.js.map → email-OV7XCP3T.js.map} +0 -0
- /package/dist/{dropbox-OSTZXSIE.js.map → gcal-P56MRCGU.js.map} +0 -0
- /package/dist/{email-4ZFPSWIN.js.map → gcs-HFBIAE2C.js.map} +0 -0
- /package/dist/{gcs-PFWR6MIW.js.map → gdocs-LQ3UXP3J.js.map} +0 -0
- /package/dist/{gdocs-GPAZRQG5.js.map → gdrive-N6UBYLON.js.map} +0 -0
- /package/dist/{gdrive-XSX6A7B3.js.map → github-BPZREGPI.js.map} +0 -0
- /package/dist/{github-EQ4NXUTA.js.map → github_ci-7A4LUIZ7.js.map} +0 -0
- /package/dist/{github_ci-QL5B2Q2N.js.map → gmail-YED2MF6H.js.map} +0 -0
- /package/dist/{gmail-2TBT4CVH.js.map → gridfs-CPLQ4G62.js.map} +0 -0
- /package/dist/{gridfs-KZRZ6SIB.js.map → gsheets-4BNIJPQ6.js.map} +0 -0
- /package/dist/{gsheets-N53WEXN2.js.map → gslides-GDBYLO5A.js.map} +0 -0
- /package/dist/{gslides-TATSARTH.js.map → hf_buckets-FTJITQ3P.js.map} +0 -0
- /package/dist/{hf_buckets-BK7NGJWS.js.map → hf_datasets-6GXVKQD7.js.map} +0 -0
- /package/dist/{hf_datasets-UQ5QGM4L.js.map → hf_models-PJPGZAC5.js.map} +0 -0
- /package/dist/{hf_models-75LFCQCS.js.map → hf_spaces-LFNFOLBF.js.map} +0 -0
- /package/dist/{hf_spaces-6T2KB3UC.js.map → jaeger-GCA6MJ6E.js.map} +0 -0
- /package/dist/{langfuse-AMQCQWNE.js.map → lancedb-TJ5YSJY5.js.map} +0 -0
- /package/dist/{linear-V3TXO6CV.js.map → langfuse-RUMTUMXS.js.map} +0 -0
- /package/dist/{minio-IZRZY4C5.js.map → linear-BCE4KEAC.js.map} +0 -0
- /package/dist/{mongodb-VMKPQCPX.js.map → minio-5SO6KBTK.js.map} +0 -0
- /package/dist/{nextcloud-5RHQCGDO.js.map → mongodb-7C5MBESV.js.map} +0 -0
- /package/dist/{notion-6PPNTQFM.js.map → nextcloud-4O2LZVW2.js.map} +0 -0
- /package/dist/{oci-CKYBSFZJ.js.map → notion-RVKEAQ2M.js.map} +0 -0
- /package/dist/{postgres-WIQBVL5M.js.map → oci-OQXOIC62.js.map} +0 -0
- /package/dist/{qingstor-AP4IIPLY.js.map → postgres-AV45GNRS.js.map} +0 -0
- /package/dist/{r2-C4XGEWQY.js.map → qingstor-W277YA4K.js.map} +0 -0
- /package/dist/{redis-6D55Q2WB.js.map → r2-FUA4IORE.js.map} +0 -0
- /package/dist/{s3-XQBI2CXN.js.map → redis-LPS357NF.js.map} +0 -0
- /package/dist/{scaleway-SEZJVURB.js.map → s3-FPNWWIVM.js.map} +0 -0
- /package/dist/{seaweedfs-3XYIAFU2.js.map → scaleway-BP3732U7.js.map} +0 -0
- /package/dist/{slack-ZHXDJQY4.js.map → seaweedfs-MC6HIEP4.js.map} +0 -0
- /package/dist/{ssh-X2MO7JOV.js.map → slack-JFGW7VLN.js.map} +0 -0
- /package/dist/{supabase-BBM44UTM.js.map → ssh-UYPG42LM.js.map} +0 -0
- /package/dist/{tencent-X72USLJ7.js.map → supabase-A3KUFMDC.js.map} +0 -0
- /package/dist/{trello-EER5NG7L.js.map → tencent-5464UQ2X.js.map} +0 -0
- /package/dist/{wasabi-O4MVIUFG.js.map → trello-O2KB3FUO.js.map} +0 -0
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
} from "./chunk-OQKNDS66.js";
|
|
4
4
|
import {
|
|
5
5
|
redactConfig
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-CTGXJHO5.js";
|
|
7
7
|
|
|
8
8
|
// src/resource/gridfs/gridfs.ts
|
|
9
9
|
import {
|
|
10
10
|
BaseResource,
|
|
11
11
|
PathSpec,
|
|
12
|
-
ResourceName as
|
|
12
|
+
ResourceName as ResourceName13,
|
|
13
13
|
makeResolveGlob,
|
|
14
14
|
mountKey,
|
|
15
15
|
mountPrefixOf as mountPrefixOf4,
|
|
@@ -52,18 +52,20 @@ var GridFSAccessor = class extends Accessor {
|
|
|
52
52
|
|
|
53
53
|
// src/commands/builtin/gridfs/index.ts
|
|
54
54
|
import {
|
|
55
|
-
ResourceName as
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
ResourceName as ResourceName11,
|
|
56
|
+
makeGenericCommands,
|
|
57
|
+
resolveGlobOf as resolveGlobOf6,
|
|
58
|
+
withDefaultProvisions
|
|
58
59
|
} from "@struktoai/mirage-core";
|
|
59
60
|
|
|
60
|
-
// src/
|
|
61
|
-
import {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
61
|
+
// src/commands/builtin/gridfs/io.ts
|
|
62
|
+
import { rangeOf } from "@struktoai/mirage-core";
|
|
63
|
+
|
|
64
|
+
// src/core/gridfs/constants.ts
|
|
65
|
+
var SCOPE_ERROR = 5e3;
|
|
66
|
+
|
|
67
|
+
// src/core/gridfs/copy.ts
|
|
68
|
+
import { enoent, invalidateAfterWrite } from "@struktoai/mirage-core";
|
|
67
69
|
|
|
68
70
|
// src/core/gridfs/_client.ts
|
|
69
71
|
import { keyPrefix as kp, mountPrefixOf } from "@struktoai/mirage-core";
|
|
@@ -166,70 +168,101 @@ async function deleteAll(accessor, query) {
|
|
|
166
168
|
}
|
|
167
169
|
}
|
|
168
170
|
|
|
169
|
-
// src/core/gridfs/
|
|
170
|
-
async function
|
|
171
|
-
const
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
return new objectIdCtor(pinnedRevision);
|
|
176
|
-
}
|
|
177
|
-
const doc = await latestFile(accessor, key);
|
|
178
|
-
if (doc === null) throw enoent(path);
|
|
179
|
-
return doc._id;
|
|
180
|
-
}
|
|
181
|
-
async function downloadBytes(accessor, path, fileId, options = {}) {
|
|
171
|
+
// src/core/gridfs/copy.ts
|
|
172
|
+
async function copy(accessor, src, dst) {
|
|
173
|
+
const srcKey = gridfsKey(rawPathOf(src), accessor.config);
|
|
174
|
+
const dstKey = gridfsKey(rawPathOf(dst), accessor.config);
|
|
175
|
+
const doc = await latestFile(accessor, srcKey);
|
|
176
|
+
if (doc === null) throw enoent(src);
|
|
182
177
|
const b = await bucket(accessor);
|
|
183
|
-
const
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
);
|
|
194
|
-
const chunks = [];
|
|
195
|
-
let total = 0;
|
|
196
|
-
try {
|
|
197
|
-
for await (const chunk of readable) {
|
|
198
|
-
chunks.push(chunk);
|
|
199
|
-
total += chunk.byteLength;
|
|
200
|
-
}
|
|
201
|
-
} catch (err) {
|
|
202
|
-
if (err?.code === "ENOENT" || isNoFileError(err)) {
|
|
203
|
-
throw enoent(path);
|
|
204
|
-
}
|
|
205
|
-
throw err;
|
|
206
|
-
}
|
|
207
|
-
const out = new Uint8Array(total);
|
|
208
|
-
let offset = 0;
|
|
209
|
-
for (const c of chunks) {
|
|
210
|
-
out.set(c, offset);
|
|
211
|
-
offset += c.byteLength;
|
|
212
|
-
}
|
|
213
|
-
return out;
|
|
178
|
+
const readable = b.openDownloadStream(doc._id);
|
|
179
|
+
const upload = b.openUploadStream(dstKey);
|
|
180
|
+
await new Promise((resolve, reject) => {
|
|
181
|
+
upload.on("error", reject);
|
|
182
|
+
readable.on("error", reject);
|
|
183
|
+
upload.on("finish", () => {
|
|
184
|
+
resolve();
|
|
185
|
+
});
|
|
186
|
+
readable.pipe(upload);
|
|
187
|
+
});
|
|
188
|
+
await invalidateAfterWrite(dst);
|
|
214
189
|
}
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
190
|
+
|
|
191
|
+
// src/core/gridfs/create.ts
|
|
192
|
+
import { ResourceName as ResourceName2, invalidateAfterWrite as invalidateAfterWrite3, record as record2 } from "@struktoai/mirage-core";
|
|
193
|
+
|
|
194
|
+
// src/core/gridfs/write.ts
|
|
195
|
+
import {
|
|
196
|
+
ResourceName,
|
|
197
|
+
invalidateAfterWrite as invalidateAfterWrite2,
|
|
198
|
+
invalidateAncestors,
|
|
199
|
+
record
|
|
200
|
+
} from "@struktoai/mirage-core";
|
|
201
|
+
async function uploadBytes(accessor, key, data) {
|
|
202
|
+
const b = await bucket(accessor);
|
|
203
|
+
const upload = b.openUploadStream(key);
|
|
204
|
+
await new Promise((resolve, reject) => {
|
|
205
|
+
upload.on("error", reject);
|
|
206
|
+
upload.on("finish", () => {
|
|
207
|
+
resolve();
|
|
208
|
+
});
|
|
209
|
+
upload.end(data);
|
|
210
|
+
});
|
|
219
211
|
}
|
|
220
|
-
async function
|
|
221
|
-
const virtual = path.virtual;
|
|
212
|
+
async function write(accessor, path, data) {
|
|
222
213
|
const raw = rawPathOf(path);
|
|
223
214
|
const key = gridfsKey(raw, accessor.config);
|
|
224
215
|
const startMs = performance.now();
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
216
|
+
await uploadBytes(accessor, key, data);
|
|
217
|
+
record("write", path.virtual, ResourceName.GRIDFS, data.byteLength, startMs);
|
|
218
|
+
await invalidateAfterWrite2(path);
|
|
219
|
+
await invalidateAncestors(path);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
// src/core/gridfs/create.ts
|
|
223
|
+
async function create(accessor, path) {
|
|
224
|
+
const raw = rawPathOf(path);
|
|
225
|
+
const startMs = performance.now();
|
|
226
|
+
await uploadBytes(accessor, gridfsKey(raw, accessor.config), new Uint8Array(0));
|
|
227
|
+
record2("create", path.virtual, ResourceName2.GRIDFS, 0, startMs);
|
|
228
|
+
await invalidateAfterWrite3(path);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
// src/core/gridfs/du/entries.ts
|
|
232
|
+
import { rstripSlash } from "@struktoai/mirage-core";
|
|
233
|
+
|
|
234
|
+
// src/core/gridfs/du/walk.ts
|
|
235
|
+
function duQuery(stem) {
|
|
236
|
+
if (stem === "") return {};
|
|
237
|
+
return {
|
|
238
|
+
$or: [{ filename: stem }, { filename: { $regex: `^${escapeRegex(stem + "/")}` } }]
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
// src/core/gridfs/du/entries.ts
|
|
243
|
+
async function entries(accessor, path) {
|
|
244
|
+
const raw = rawPathOf(path);
|
|
245
|
+
const stem = rstripSlash(gridfsKey(raw, accessor.config));
|
|
246
|
+
const entries2 = [];
|
|
247
|
+
let total = 0;
|
|
248
|
+
for await (const doc of iterLatest(accessor, duQuery(stem))) {
|
|
249
|
+
const entry = "/" + stripKeyPrefix(doc.filename, accessor.config);
|
|
250
|
+
entries2.push([entry, doc.length]);
|
|
251
|
+
total += doc.length;
|
|
252
|
+
}
|
|
253
|
+
return [entries2, total];
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
// src/core/gridfs/du/size.ts
|
|
257
|
+
import { rstripSlash as rstripSlash2 } from "@struktoai/mirage-core";
|
|
258
|
+
async function size(accessor, path) {
|
|
259
|
+
const raw = rawPathOf(path);
|
|
260
|
+
const stem = rstripSlash2(gridfsKey(raw, accessor.config));
|
|
261
|
+
let total = 0;
|
|
262
|
+
for await (const doc of iterLatest(accessor, duQuery(stem))) {
|
|
263
|
+
total += doc.length;
|
|
264
|
+
}
|
|
265
|
+
return total;
|
|
233
266
|
}
|
|
234
267
|
|
|
235
268
|
// src/core/gridfs/stat.ts
|
|
@@ -240,7 +273,7 @@ import {
|
|
|
240
273
|
gnuBasename,
|
|
241
274
|
guessType,
|
|
242
275
|
mountPrefixOf as mountPrefixOf2,
|
|
243
|
-
rstripSlash,
|
|
276
|
+
rstripSlash as rstripSlash3,
|
|
244
277
|
stripSlash
|
|
245
278
|
} from "@struktoai/mirage-core";
|
|
246
279
|
async function stat(accessor, path, index) {
|
|
@@ -290,7 +323,7 @@ async function stat(accessor, path, index) {
|
|
|
290
323
|
});
|
|
291
324
|
}
|
|
292
325
|
}
|
|
293
|
-
const pfx =
|
|
326
|
+
const pfx = rstripSlash3(key) + "/";
|
|
294
327
|
const files = await filesColl(accessor);
|
|
295
328
|
const probe = await files.findOne(
|
|
296
329
|
{ filename: { $regex: `^${escapeRegex(pfx)}` } },
|
|
@@ -302,102 +335,6 @@ async function stat(accessor, path, index) {
|
|
|
302
335
|
throw enoent2(path);
|
|
303
336
|
}
|
|
304
337
|
|
|
305
|
-
// src/commands/builtin/gridfs/du.ts
|
|
306
|
-
import {
|
|
307
|
-
ResourceName as ResourceName4,
|
|
308
|
-
command,
|
|
309
|
-
duGeneric,
|
|
310
|
-
metadataProvision,
|
|
311
|
-
resolveGlobOf,
|
|
312
|
-
specOf
|
|
313
|
-
} from "@struktoai/mirage-core";
|
|
314
|
-
|
|
315
|
-
// src/core/gridfs/du.ts
|
|
316
|
-
import { rstripSlash as rstripSlash2 } from "@struktoai/mirage-core";
|
|
317
|
-
function duQuery(stem) {
|
|
318
|
-
if (stem === "") return {};
|
|
319
|
-
return {
|
|
320
|
-
$or: [{ filename: stem }, { filename: { $regex: `^${escapeRegex(stem + "/")}` } }]
|
|
321
|
-
};
|
|
322
|
-
}
|
|
323
|
-
async function du(accessor, path) {
|
|
324
|
-
const raw = rawPathOf(path);
|
|
325
|
-
const stem = rstripSlash2(gridfsKey(raw, accessor.config));
|
|
326
|
-
let total = 0;
|
|
327
|
-
for await (const doc of iterLatest(accessor, duQuery(stem))) {
|
|
328
|
-
total += doc.length;
|
|
329
|
-
}
|
|
330
|
-
return total;
|
|
331
|
-
}
|
|
332
|
-
async function duAll(accessor, path) {
|
|
333
|
-
const raw = rawPathOf(path);
|
|
334
|
-
const stem = rstripSlash2(gridfsKey(raw, accessor.config));
|
|
335
|
-
const entries = [];
|
|
336
|
-
let total = 0;
|
|
337
|
-
for await (const doc of iterLatest(accessor, duQuery(stem))) {
|
|
338
|
-
const entry = "/" + stripKeyPrefix(doc.filename, accessor.config);
|
|
339
|
-
entries.push([entry, doc.length]);
|
|
340
|
-
total += doc.length;
|
|
341
|
-
}
|
|
342
|
-
return [entries, total];
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
// src/core/gridfs/constants.ts
|
|
346
|
-
var SCOPE_ERROR = 5e3;
|
|
347
|
-
|
|
348
|
-
// src/core/gridfs/copy.ts
|
|
349
|
-
import { enoent as enoent3, invalidateAfterWrite } from "@struktoai/mirage-core";
|
|
350
|
-
async function copy(accessor, src, dst) {
|
|
351
|
-
const srcKey = gridfsKey(rawPathOf(src), accessor.config);
|
|
352
|
-
const dstKey = gridfsKey(rawPathOf(dst), accessor.config);
|
|
353
|
-
const doc = await latestFile(accessor, srcKey);
|
|
354
|
-
if (doc === null) throw enoent3(src);
|
|
355
|
-
const b = await bucket(accessor);
|
|
356
|
-
const readable = b.openDownloadStream(doc._id);
|
|
357
|
-
const upload = b.openUploadStream(dstKey);
|
|
358
|
-
await new Promise((resolve, reject) => {
|
|
359
|
-
upload.on("error", reject);
|
|
360
|
-
readable.on("error", reject);
|
|
361
|
-
upload.on("finish", () => {
|
|
362
|
-
resolve();
|
|
363
|
-
});
|
|
364
|
-
readable.pipe(upload);
|
|
365
|
-
});
|
|
366
|
-
await invalidateAfterWrite(dst);
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
// src/core/gridfs/create.ts
|
|
370
|
-
import { invalidateAfterWrite as invalidateAfterWrite3 } from "@struktoai/mirage-core";
|
|
371
|
-
|
|
372
|
-
// src/core/gridfs/write.ts
|
|
373
|
-
import { ResourceName as ResourceName2, invalidateAfterWrite as invalidateAfterWrite2, record as record2 } from "@struktoai/mirage-core";
|
|
374
|
-
async function uploadBytes(accessor, key, data) {
|
|
375
|
-
const b = await bucket(accessor);
|
|
376
|
-
const upload = b.openUploadStream(key);
|
|
377
|
-
await new Promise((resolve, reject) => {
|
|
378
|
-
upload.on("error", reject);
|
|
379
|
-
upload.on("finish", () => {
|
|
380
|
-
resolve();
|
|
381
|
-
});
|
|
382
|
-
upload.end(data);
|
|
383
|
-
});
|
|
384
|
-
}
|
|
385
|
-
async function write(accessor, path, data) {
|
|
386
|
-
const raw = rawPathOf(path);
|
|
387
|
-
const key = gridfsKey(raw, accessor.config);
|
|
388
|
-
const startMs = performance.now();
|
|
389
|
-
await uploadBytes(accessor, key, data);
|
|
390
|
-
record2("write", path.virtual, ResourceName2.GRIDFS, data.byteLength, startMs);
|
|
391
|
-
await invalidateAfterWrite2(path);
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
// src/core/gridfs/create.ts
|
|
395
|
-
async function create(accessor, path) {
|
|
396
|
-
const raw = rawPathOf(path);
|
|
397
|
-
await uploadBytes(accessor, gridfsKey(raw, accessor.config), new Uint8Array(0));
|
|
398
|
-
await invalidateAfterWrite3(path);
|
|
399
|
-
}
|
|
400
|
-
|
|
401
338
|
// src/core/gridfs/exists.ts
|
|
402
339
|
async function exists(accessor, path) {
|
|
403
340
|
try {
|
|
@@ -414,8 +351,9 @@ import {
|
|
|
414
351
|
buildTree,
|
|
415
352
|
emitStartPath,
|
|
416
353
|
keep,
|
|
417
|
-
rstripSlash as
|
|
418
|
-
startBasename
|
|
354
|
+
rstripSlash as rstripSlash4,
|
|
355
|
+
startBasename,
|
|
356
|
+
compareCodePoints
|
|
419
357
|
} from "@struktoai/mirage-core";
|
|
420
358
|
function globRegex(pattern) {
|
|
421
359
|
if (pattern.includes("[") || pattern.includes("]")) return null;
|
|
@@ -465,10 +403,13 @@ async function find(accessor, path, options = {}) {
|
|
|
465
403
|
const raw = rawPathOf(path);
|
|
466
404
|
const startName = startBasename(path.virtual);
|
|
467
405
|
const pfx = gridfsPrefix(raw, accessor.config);
|
|
406
|
+
const rootKey = rstripSlash4("/" + stripKeyPrefix(pfx, accessor.config)) || "/";
|
|
407
|
+
const baseDepth = rootKey === "/" ? 0 : (rootKey.match(/\//g) ?? []).length;
|
|
468
408
|
const results = [];
|
|
409
|
+
const seenDirs = /* @__PURE__ */ new Set();
|
|
469
410
|
const seen = { descendant: false, marker: false };
|
|
470
411
|
const empty = options.empty === true;
|
|
471
|
-
const pushdown = options.tree === void 0 && options.nameExclude === void 0 && options.orNames === void 0 && options.pathPattern === void 0 && !empty;
|
|
412
|
+
const pushdown = options.tree === void 0 && options.nameExclude === void 0 && options.orNames === void 0 && options.pathPattern === void 0 && !empty && options.type === "f";
|
|
472
413
|
const tree = options.tree ?? buildTree({
|
|
473
414
|
name: options.name,
|
|
474
415
|
iname: options.iname,
|
|
@@ -487,30 +428,39 @@ async function find(accessor, path, options = {}) {
|
|
|
487
428
|
continue;
|
|
488
429
|
}
|
|
489
430
|
seen.descendant = true;
|
|
490
|
-
const relative = key.slice(pfx.length);
|
|
491
|
-
const depth = (relative.match(/\//g) ?? []).length + 1;
|
|
492
|
-
if (options.maxDepth !== null && options.maxDepth !== void 0 && depth > options.maxDepth) {
|
|
493
|
-
continue;
|
|
494
|
-
}
|
|
495
431
|
const isDir = key.endsWith("/");
|
|
496
|
-
const
|
|
497
|
-
const
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
if (!keep(
|
|
502
|
-
{ key: fullPath, name: entryName, kind: isDir ? "d" : "f", depth, isEmpty },
|
|
503
|
-
tree,
|
|
504
|
-
options.minDepth
|
|
505
|
-
)) {
|
|
506
|
-
continue;
|
|
432
|
+
const fullPath = rstripSlash4("/" + stripKeyPrefix(key, accessor.config)) || "/";
|
|
433
|
+
const size2 = doc.length;
|
|
434
|
+
if (isDir) {
|
|
435
|
+
if (seenDirs.has(fullPath)) continue;
|
|
436
|
+
seenDirs.add(fullPath);
|
|
507
437
|
}
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
if (
|
|
438
|
+
const entries2 = [[fullPath, isDir ? "d" : "f"]];
|
|
439
|
+
let parent = fullPath.slice(0, fullPath.lastIndexOf("/")) || "/";
|
|
440
|
+
while (parent !== rootKey && parent !== "/") {
|
|
441
|
+
if (!seenDirs.has(parent)) {
|
|
442
|
+
seenDirs.add(parent);
|
|
443
|
+
entries2.push([parent, "d"]);
|
|
444
|
+
}
|
|
445
|
+
parent = parent.slice(0, parent.lastIndexOf("/")) || "/";
|
|
446
|
+
}
|
|
447
|
+
for (const [ep, kind] of entries2) {
|
|
448
|
+
const entryName = ep.split("/").pop() ?? "";
|
|
449
|
+
const depth = (ep.match(/\//g) ?? []).length - baseDepth;
|
|
450
|
+
if (options.maxDepth !== null && options.maxDepth !== void 0 && depth > options.maxDepth) {
|
|
451
|
+
continue;
|
|
452
|
+
}
|
|
453
|
+
const isEmpty = !empty ? null : kind === "d" ? false : size2 === 0;
|
|
454
|
+
if (!keep({ key: ep, name: entryName, kind, depth, isEmpty }, tree, options.minDepth)) {
|
|
455
|
+
continue;
|
|
456
|
+
}
|
|
457
|
+
if (options.minSize != null || options.maxSize != null) {
|
|
458
|
+
const effective = kind === "d" ? 0 : size2;
|
|
459
|
+
if (options.minSize != null && effective < options.minSize) continue;
|
|
460
|
+
if (options.maxSize != null && effective > options.maxSize) continue;
|
|
461
|
+
}
|
|
462
|
+
results.push(ep);
|
|
512
463
|
}
|
|
513
|
-
results.push(fullPath);
|
|
514
464
|
}
|
|
515
465
|
if (narrowed && !seen.descendant && !seen.marker) {
|
|
516
466
|
const files = await filesColl(accessor);
|
|
@@ -520,11 +470,10 @@ async function find(accessor, path, options = {}) {
|
|
|
520
470
|
);
|
|
521
471
|
seen.descendant = probe !== null;
|
|
522
472
|
}
|
|
523
|
-
const rootKey = rstripSlash3("/" + stripKeyPrefix(pfx, accessor.config)) || "/";
|
|
524
473
|
if (seen.descendant || seen.marker) {
|
|
525
474
|
emitStartPath(results, rootKey, startName, {
|
|
526
475
|
kind: "d",
|
|
527
|
-
isEmpty: empty ?
|
|
476
|
+
isEmpty: empty ? !seen.descendant : null,
|
|
528
477
|
exists: true,
|
|
529
478
|
tree,
|
|
530
479
|
maxDepth: options.maxDepth,
|
|
@@ -533,18 +482,90 @@ async function find(accessor, path, options = {}) {
|
|
|
533
482
|
maxSize: options.maxSize
|
|
534
483
|
});
|
|
535
484
|
}
|
|
536
|
-
return results.sort();
|
|
485
|
+
return [...new Set(results)].sort(compareCodePoints);
|
|
537
486
|
}
|
|
538
487
|
|
|
539
488
|
// src/core/gridfs/mkdir.ts
|
|
540
|
-
import { invalidateAfterWrite as invalidateAfterWrite4, invalidateAncestors } from "@struktoai/mirage-core";
|
|
489
|
+
import { invalidateAfterWrite as invalidateAfterWrite4, invalidateAncestors as invalidateAncestors2 } from "@struktoai/mirage-core";
|
|
541
490
|
async function mkdir(accessor, path, parents = false) {
|
|
542
491
|
const raw = rawPathOf(path);
|
|
543
492
|
const pfx = gridfsPrefix(raw, accessor.config);
|
|
544
493
|
if (pfx === "") return;
|
|
545
494
|
await uploadBytes(accessor, pfx, new Uint8Array(0));
|
|
546
495
|
await invalidateAfterWrite4(path);
|
|
547
|
-
if (parents) await
|
|
496
|
+
if (parents) await invalidateAncestors2(path);
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
// src/core/gridfs/read.ts
|
|
500
|
+
import {
|
|
501
|
+
ResourceName as ResourceName3,
|
|
502
|
+
enoent as enoent3,
|
|
503
|
+
record as record3,
|
|
504
|
+
revisionFor
|
|
505
|
+
} from "@struktoai/mirage-core";
|
|
506
|
+
async function resolveFileId(accessor, path, key) {
|
|
507
|
+
const pinnedRevision = revisionFor(path.virtual);
|
|
508
|
+
if (pinnedRevision !== null) {
|
|
509
|
+
const mod = await loadGridFSModule();
|
|
510
|
+
const objectIdCtor = mod.ObjectId;
|
|
511
|
+
return new objectIdCtor(pinnedRevision);
|
|
512
|
+
}
|
|
513
|
+
const doc = await latestFile(accessor, key);
|
|
514
|
+
if (doc === null) throw enoent3(path);
|
|
515
|
+
return doc._id;
|
|
516
|
+
}
|
|
517
|
+
async function downloadBytes(accessor, path, fileId, options = {}) {
|
|
518
|
+
const b = await bucket(accessor);
|
|
519
|
+
const streamOptions = {};
|
|
520
|
+
if (options.offset !== void 0 && options.offset !== 0) {
|
|
521
|
+
streamOptions.start = options.offset;
|
|
522
|
+
}
|
|
523
|
+
if (options.size !== void 0) {
|
|
524
|
+
streamOptions.end = (options.offset ?? 0) + options.size;
|
|
525
|
+
}
|
|
526
|
+
const readable = b.openDownloadStream(
|
|
527
|
+
fileId,
|
|
528
|
+
Object.keys(streamOptions).length > 0 ? streamOptions : void 0
|
|
529
|
+
);
|
|
530
|
+
const chunks = [];
|
|
531
|
+
let total = 0;
|
|
532
|
+
try {
|
|
533
|
+
for await (const chunk of readable) {
|
|
534
|
+
chunks.push(chunk);
|
|
535
|
+
total += chunk.byteLength;
|
|
536
|
+
}
|
|
537
|
+
} catch (err) {
|
|
538
|
+
if (err?.code === "ENOENT" || isNoFileError(err)) {
|
|
539
|
+
throw enoent3(path);
|
|
540
|
+
}
|
|
541
|
+
throw err;
|
|
542
|
+
}
|
|
543
|
+
const out = new Uint8Array(total);
|
|
544
|
+
let offset = 0;
|
|
545
|
+
for (const c of chunks) {
|
|
546
|
+
out.set(c, offset);
|
|
547
|
+
offset += c.byteLength;
|
|
548
|
+
}
|
|
549
|
+
return out;
|
|
550
|
+
}
|
|
551
|
+
function isNoFileError(err) {
|
|
552
|
+
if (err === null || typeof err !== "object") return false;
|
|
553
|
+
const message = err.message ?? "";
|
|
554
|
+
return message.includes("FileNotFound");
|
|
555
|
+
}
|
|
556
|
+
async function read(accessor, path, _index, options = {}) {
|
|
557
|
+
const virtual = path.virtual;
|
|
558
|
+
const raw = rawPathOf(path);
|
|
559
|
+
const key = gridfsKey(raw, accessor.config);
|
|
560
|
+
const startMs = performance.now();
|
|
561
|
+
const fileId = await resolveFileId(accessor, path, key);
|
|
562
|
+
const bytes = await downloadBytes(accessor, path, fileId, options);
|
|
563
|
+
const revision = fileId.toString();
|
|
564
|
+
record3("read", virtual, ResourceName3.GRIDFS, bytes.byteLength, startMs, {
|
|
565
|
+
fingerprint: revision,
|
|
566
|
+
revision
|
|
567
|
+
});
|
|
568
|
+
return bytes;
|
|
548
569
|
}
|
|
549
570
|
|
|
550
571
|
// src/core/gridfs/readdir.ts
|
|
@@ -552,16 +573,17 @@ import {
|
|
|
552
573
|
IndexEntry,
|
|
553
574
|
ResourceType,
|
|
554
575
|
mountPrefixOf as mountPrefixOf3,
|
|
555
|
-
rstripSlash as
|
|
576
|
+
rstripSlash as rstripSlash5,
|
|
577
|
+
compareCodePoints as compareCodePoints2
|
|
556
578
|
} from "@struktoai/mirage-core";
|
|
557
579
|
async function readdir(accessor, path, index) {
|
|
558
580
|
const original = path.virtual;
|
|
559
581
|
const prefix = mountPrefixOf3(path.virtual, path.resourcePath);
|
|
560
582
|
const virtual = path.pattern !== null ? path.directory : original;
|
|
561
583
|
const rawPath = prefix !== "" && virtual.startsWith(prefix) ? virtual.slice(prefix.length) || "/" : virtual;
|
|
562
|
-
const virtualKey = rawPath === "/" ? "/" :
|
|
584
|
+
const virtualKey = rawPath === "/" ? "/" : rstripSlash5(rawPath) || "/";
|
|
563
585
|
const rawFullKey = prefix !== "" ? `${prefix}${virtualKey}` : virtualKey;
|
|
564
|
-
const fullVirtualKey =
|
|
586
|
+
const fullVirtualKey = rstripSlash5(rawFullKey) || "/";
|
|
565
587
|
if (index !== void 0) {
|
|
566
588
|
const listing = await index.listDir(fullVirtualKey);
|
|
567
589
|
if (listing.entries !== void 0 && listing.entries !== null) {
|
|
@@ -593,13 +615,13 @@ async function readdir(accessor, path, index) {
|
|
|
593
615
|
}
|
|
594
616
|
}
|
|
595
617
|
}
|
|
596
|
-
names.sort();
|
|
618
|
+
names.sort(compareCodePoints2);
|
|
597
619
|
if (names.length > SCOPE_ERROR) {
|
|
598
620
|
console.warn(
|
|
599
621
|
`gridfs readdir: ${fullVirtualKey} returned ${String(names.length)} entries (limit ${String(SCOPE_ERROR)})`
|
|
600
622
|
);
|
|
601
623
|
}
|
|
602
|
-
const virtualEntries = names.map((e) => prefix !== "" ? `${prefix}${e}` : e).sort();
|
|
624
|
+
const virtualEntries = names.map((e) => prefix !== "" ? `${prefix}${e}` : e).sort(compareCodePoints2);
|
|
603
625
|
if (index !== void 0) {
|
|
604
626
|
const indexEntries = names.map((e) => {
|
|
605
627
|
const name = e.split("/").pop() ?? "";
|
|
@@ -660,13 +682,13 @@ async function rmdir(accessor, path) {
|
|
|
660
682
|
}
|
|
661
683
|
|
|
662
684
|
// src/core/gridfs/stream.ts
|
|
663
|
-
import { ResourceName as
|
|
685
|
+
import { ResourceName as ResourceName4, enoent as enoent5, recordStream } from "@struktoai/mirage-core";
|
|
664
686
|
var DEFAULT_CHUNK_SIZE = 8192;
|
|
665
687
|
async function* stream(accessor, path) {
|
|
666
688
|
const virtual = path.virtual;
|
|
667
689
|
const raw = rawPathOf(path);
|
|
668
690
|
const key = gridfsKey(raw, accessor.config);
|
|
669
|
-
const rec = recordStream("read", virtual,
|
|
691
|
+
const rec = recordStream("read", virtual, ResourceName4.GRIDFS);
|
|
670
692
|
const fileId = await resolveFileId(accessor, path, key);
|
|
671
693
|
if (rec !== null) {
|
|
672
694
|
const revision = fileId.toString();
|
|
@@ -698,15 +720,16 @@ async function* stream(accessor, path) {
|
|
|
698
720
|
yield pending;
|
|
699
721
|
}
|
|
700
722
|
}
|
|
701
|
-
async function rangeRead(accessor, path,
|
|
702
|
-
return read(accessor, path, void 0, { offset, size });
|
|
723
|
+
async function rangeRead(accessor, path, start, end) {
|
|
724
|
+
return read(accessor, path, void 0, { offset: start, size: end - start });
|
|
703
725
|
}
|
|
704
726
|
|
|
705
727
|
// src/core/gridfs/truncate.ts
|
|
706
|
-
import { invalidateAfterWrite as invalidateAfterWrite6 } from "@struktoai/mirage-core";
|
|
728
|
+
import { ResourceName as ResourceName5, invalidateAfterWrite as invalidateAfterWrite6, record as record4 } from "@struktoai/mirage-core";
|
|
707
729
|
async function truncate(accessor, path, length) {
|
|
708
730
|
const raw = rawPathOf(path);
|
|
709
731
|
const key = gridfsKey(raw, accessor.config);
|
|
732
|
+
const startMs = performance.now();
|
|
710
733
|
const doc = await latestFile(accessor, key);
|
|
711
734
|
let data = doc === null ? new Uint8Array(0) : await downloadBytes(accessor, path, doc._id);
|
|
712
735
|
if (data.byteLength > length) {
|
|
@@ -717,6 +740,7 @@ async function truncate(accessor, path, length) {
|
|
|
717
740
|
data = padded;
|
|
718
741
|
}
|
|
719
742
|
await uploadBytes(accessor, key, data);
|
|
743
|
+
record4("truncate", path.virtual, ResourceName5.GRIDFS, 0, startMs);
|
|
720
744
|
await invalidateAfterWrite6(path);
|
|
721
745
|
}
|
|
722
746
|
|
|
@@ -733,6 +757,7 @@ async function unlink(accessor, path) {
|
|
|
733
757
|
var GRIDFS_IO = {
|
|
734
758
|
readdir,
|
|
735
759
|
readBytes: read,
|
|
760
|
+
readRange: rangeOf(read),
|
|
736
761
|
readStream: stream,
|
|
737
762
|
stat,
|
|
738
763
|
isMounted: () => true,
|
|
@@ -749,80 +774,77 @@ var GRIDFS_IO = {
|
|
|
749
774
|
create,
|
|
750
775
|
truncate,
|
|
751
776
|
find,
|
|
752
|
-
|
|
753
|
-
duAll
|
|
777
|
+
du: { size, entries }
|
|
754
778
|
};
|
|
755
779
|
|
|
756
|
-
// src/commands/builtin/gridfs/du.ts
|
|
757
|
-
var resolveGlob = resolveGlobOf(GRIDFS_IO);
|
|
758
|
-
async function duCommand(accessor, paths, _texts, opts) {
|
|
759
|
-
const resolved = paths.length > 0 ? await resolveGlob(accessor, paths, opts.index ?? void 0) : [];
|
|
760
|
-
return duGeneric(
|
|
761
|
-
resolved,
|
|
762
|
-
opts,
|
|
763
|
-
(p) => du(accessor, p),
|
|
764
|
-
(p) => duAll(accessor, p)
|
|
765
|
-
);
|
|
766
|
-
}
|
|
767
|
-
var GRIDFS_DU = command({
|
|
768
|
-
name: "du",
|
|
769
|
-
resource: ResourceName4.GRIDFS,
|
|
770
|
-
spec: specOf("du"),
|
|
771
|
-
fn: duCommand,
|
|
772
|
-
provision: metadataProvision
|
|
773
|
-
});
|
|
774
|
-
|
|
775
780
|
// src/commands/builtin/gridfs/mkdir.ts
|
|
776
781
|
import {
|
|
782
|
+
FlagView,
|
|
777
783
|
IOResult,
|
|
778
|
-
ResourceName as
|
|
779
|
-
command
|
|
780
|
-
resolveGlobOf
|
|
781
|
-
specOf
|
|
782
|
-
writeMetadataProvision
|
|
784
|
+
ResourceName as ResourceName6,
|
|
785
|
+
command,
|
|
786
|
+
resolveGlobOf,
|
|
787
|
+
specOf
|
|
783
788
|
} from "@struktoai/mirage-core";
|
|
784
|
-
|
|
789
|
+
import { mkdirLinkRefusal } from "@struktoai/mirage-core";
|
|
790
|
+
var resolveGlob = resolveGlobOf(GRIDFS_IO);
|
|
785
791
|
var ENC = new TextEncoder();
|
|
786
792
|
async function mkdirCommand(accessor, paths, _texts, opts) {
|
|
787
793
|
if (paths.length === 0) {
|
|
788
794
|
return [null, new IOResult({ exitCode: 1, stderr: ENC.encode("mkdir: missing operand\n") })];
|
|
789
795
|
}
|
|
790
|
-
const resolved = await
|
|
791
|
-
const
|
|
792
|
-
const
|
|
796
|
+
const resolved = await resolveGlob(accessor, paths, opts.index ?? void 0);
|
|
797
|
+
const fl = new FlagView(opts.flags, specOf("mkdir"));
|
|
798
|
+
const verbose = fl.asBool("verbose");
|
|
799
|
+
const parents = fl.asBool("parents");
|
|
793
800
|
const lines = [];
|
|
794
801
|
const writes = {};
|
|
802
|
+
const errors = [];
|
|
803
|
+
const links = opts.ns?.links ?? null;
|
|
795
804
|
for (const path of resolved) {
|
|
805
|
+
const collision = await mkdirLinkRefusal(path, links, { parents });
|
|
806
|
+
if (collision.taken) {
|
|
807
|
+
if (collision.message !== null) errors.push(collision.message);
|
|
808
|
+
continue;
|
|
809
|
+
}
|
|
796
810
|
await mkdir(accessor, path, parents);
|
|
797
811
|
writes[path.mountPath] = new Uint8Array();
|
|
798
812
|
if (verbose) lines.push(`mkdir: created directory '${path.virtual}'`);
|
|
799
813
|
}
|
|
800
814
|
const output = lines.length > 0 ? ENC.encode(lines.join("\n") + "\n") : null;
|
|
801
|
-
|
|
815
|
+
const stderr = errors.length > 0 ? ENC.encode(errors.join("\n") + "\n") : void 0;
|
|
816
|
+
return [
|
|
817
|
+
output,
|
|
818
|
+
new IOResult({
|
|
819
|
+
writes,
|
|
820
|
+
exitCode: errors.length > 0 ? 1 : 0,
|
|
821
|
+
...stderr !== void 0 ? { stderr } : {}
|
|
822
|
+
})
|
|
823
|
+
];
|
|
802
824
|
}
|
|
803
|
-
var GRIDFS_MKDIR =
|
|
825
|
+
var GRIDFS_MKDIR = command({
|
|
804
826
|
name: "mkdir",
|
|
805
|
-
resource:
|
|
806
|
-
spec:
|
|
827
|
+
resource: ResourceName6.GRIDFS,
|
|
828
|
+
spec: specOf("mkdir"),
|
|
807
829
|
fn: mkdirCommand,
|
|
808
|
-
write: true
|
|
809
|
-
provision: writeMetadataProvision
|
|
830
|
+
write: true
|
|
810
831
|
});
|
|
811
832
|
|
|
812
833
|
// src/commands/builtin/gridfs/rm.ts
|
|
813
834
|
import {
|
|
814
835
|
FileType as FileType2,
|
|
836
|
+
FlagView as FlagView2,
|
|
815
837
|
IOResult as IOResult2,
|
|
816
|
-
ResourceName as
|
|
817
|
-
command as
|
|
838
|
+
ResourceName as ResourceName7,
|
|
839
|
+
command as command2,
|
|
818
840
|
cpWalk,
|
|
819
841
|
formatRecords,
|
|
820
842
|
removalLines,
|
|
821
|
-
resolveGlobOf as
|
|
822
|
-
specOf as
|
|
823
|
-
writeMetadataProvision as writeMetadataProvision2
|
|
843
|
+
resolveGlobOf as resolveGlobOf2,
|
|
844
|
+
specOf as specOf2
|
|
824
845
|
} from "@struktoai/mirage-core";
|
|
825
|
-
|
|
846
|
+
import { isSlashedLink, rmLinkRefusal } from "@struktoai/mirage-core";
|
|
847
|
+
var resolveGlob2 = resolveGlobOf2(GRIDFS_IO);
|
|
826
848
|
var ENC2 = new TextEncoder();
|
|
827
849
|
async function rmOne(accessor, path, opts, index) {
|
|
828
850
|
const label = path.virtual;
|
|
@@ -864,15 +886,22 @@ async function rmCommand(accessor, paths, _texts, opts) {
|
|
|
864
886
|
if (paths.length === 0) {
|
|
865
887
|
return [null, new IOResult2({ exitCode: 1, stderr: ENC2.encode("rm: missing operand\n") })];
|
|
866
888
|
}
|
|
867
|
-
const resolved = await
|
|
868
|
-
const
|
|
869
|
-
const
|
|
870
|
-
const
|
|
871
|
-
const
|
|
889
|
+
const resolved = await resolveGlob2(accessor, paths, opts.index ?? void 0);
|
|
890
|
+
const fl = new FlagView2(opts.flags, specOf2("rm"));
|
|
891
|
+
const recursive = fl.asBool("r") || fl.asBool("R");
|
|
892
|
+
const force = fl.asBool("f");
|
|
893
|
+
const removeDir = fl.asBool("d");
|
|
894
|
+
const verbose = fl.asBool("v");
|
|
872
895
|
const verboseParts = [];
|
|
873
896
|
const errors = [];
|
|
874
897
|
const writes = {};
|
|
898
|
+
const links = opts.ns?.links ?? null;
|
|
875
899
|
for (const p of resolved) {
|
|
900
|
+
if (isSlashedLink(p, links)) {
|
|
901
|
+
const refusal = await rmLinkRefusal(p, links, { recursive, force });
|
|
902
|
+
if (refusal !== null) errors.push(refusal);
|
|
903
|
+
continue;
|
|
904
|
+
}
|
|
876
905
|
const [error, entryLines] = await rmOne(
|
|
877
906
|
accessor,
|
|
878
907
|
p,
|
|
@@ -897,106 +926,89 @@ async function rmCommand(accessor, paths, _texts, opts) {
|
|
|
897
926
|
})
|
|
898
927
|
];
|
|
899
928
|
}
|
|
900
|
-
var GRIDFS_RM =
|
|
929
|
+
var GRIDFS_RM = command2({
|
|
901
930
|
name: "rm",
|
|
902
|
-
resource:
|
|
903
|
-
spec:
|
|
931
|
+
resource: ResourceName7.GRIDFS,
|
|
932
|
+
spec: specOf2("rm"),
|
|
904
933
|
fn: rmCommand,
|
|
905
|
-
write: true
|
|
906
|
-
provision: writeMetadataProvision2
|
|
934
|
+
write: true
|
|
907
935
|
});
|
|
908
936
|
|
|
909
937
|
// src/commands/builtin/gridfs/stat.ts
|
|
910
938
|
import {
|
|
911
|
-
ResourceName as
|
|
912
|
-
command as
|
|
913
|
-
|
|
914
|
-
resolveGlobOf as
|
|
915
|
-
specOf as
|
|
939
|
+
ResourceName as ResourceName8,
|
|
940
|
+
command as command3,
|
|
941
|
+
overlaidStat,
|
|
942
|
+
resolveGlobOf as resolveGlobOf3,
|
|
943
|
+
specOf as specOf3,
|
|
916
944
|
statGeneric
|
|
917
945
|
} from "@struktoai/mirage-core";
|
|
918
|
-
var
|
|
946
|
+
var resolveGlob3 = resolveGlobOf3(GRIDFS_IO);
|
|
919
947
|
async function statCommand(accessor, paths, _texts, opts) {
|
|
920
|
-
const resolved = paths.length > 0 ? await
|
|
921
|
-
return statGeneric(
|
|
948
|
+
const resolved = paths.length > 0 ? await resolveGlob3(accessor, paths, opts.index ?? void 0) : [];
|
|
949
|
+
return statGeneric(
|
|
950
|
+
resolved,
|
|
951
|
+
opts,
|
|
952
|
+
overlaidStat((p) => stat(accessor, p, opts.index ?? void 0), opts.ns?.statOverlay)
|
|
953
|
+
);
|
|
922
954
|
}
|
|
923
|
-
var GRIDFS_STAT =
|
|
955
|
+
var GRIDFS_STAT = command3({
|
|
924
956
|
name: "stat",
|
|
925
|
-
resource:
|
|
926
|
-
spec:
|
|
927
|
-
fn: statCommand
|
|
928
|
-
provision: metadataProvision2
|
|
957
|
+
resource: ResourceName8.GRIDFS,
|
|
958
|
+
spec: specOf3("stat"),
|
|
959
|
+
fn: statCommand
|
|
929
960
|
});
|
|
930
961
|
|
|
931
962
|
// src/commands/builtin/gridfs/tee.ts
|
|
932
963
|
import {
|
|
933
964
|
IOResult as IOResult3,
|
|
934
|
-
ResourceName as
|
|
935
|
-
command as
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
resolveGlobOf as resolveGlobOf5,
|
|
940
|
-
specOf as specOf5,
|
|
941
|
-
writeOutput
|
|
965
|
+
ResourceName as ResourceName9,
|
|
966
|
+
command as command4,
|
|
967
|
+
resolveGlobOf as resolveGlobOf4,
|
|
968
|
+
specOf as specOf4,
|
|
969
|
+
teeGeneric
|
|
942
970
|
} from "@struktoai/mirage-core";
|
|
943
|
-
var
|
|
971
|
+
var resolveGlob4 = resolveGlobOf4(GRIDFS_IO);
|
|
944
972
|
var ENC3 = new TextEncoder();
|
|
945
973
|
async function teeCommand(accessor, paths, texts, opts) {
|
|
946
974
|
if (paths.length === 0) {
|
|
947
975
|
return [null, new IOResult3({ exitCode: 1, stderr: ENC3.encode("tee: missing operand\n") })];
|
|
948
976
|
}
|
|
949
|
-
const
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
const raw = stdinData ?? ENC3.encode(texts.join(" "));
|
|
958
|
-
let writeData = raw;
|
|
959
|
-
if (parsed.append) {
|
|
960
|
-
let existingFound = false;
|
|
961
|
-
try {
|
|
962
|
-
existingFound = await exists(accessor, first);
|
|
963
|
-
} catch {
|
|
964
|
-
existingFound = false;
|
|
965
|
-
}
|
|
966
|
-
if (existingFound) {
|
|
967
|
-
const existing = await materialize(stream(accessor, first));
|
|
968
|
-
writeData = new Uint8Array(existing.byteLength + raw.byteLength);
|
|
969
|
-
writeData.set(existing, 0);
|
|
970
|
-
writeData.set(raw, existing.byteLength);
|
|
971
|
-
}
|
|
972
|
-
}
|
|
973
|
-
return writeOutput((p, d) => write(accessor, p, d), first, writeData, raw);
|
|
977
|
+
const resolved = await resolveGlob4(accessor, paths, opts.index ?? void 0);
|
|
978
|
+
return teeGeneric(
|
|
979
|
+
resolved,
|
|
980
|
+
texts,
|
|
981
|
+
opts,
|
|
982
|
+
(p) => stream(accessor, p),
|
|
983
|
+
(p, d) => write(accessor, p, d)
|
|
984
|
+
);
|
|
974
985
|
}
|
|
975
|
-
var GRIDFS_TEE =
|
|
986
|
+
var GRIDFS_TEE = command4({
|
|
976
987
|
name: "tee",
|
|
977
|
-
resource:
|
|
978
|
-
spec:
|
|
988
|
+
resource: ResourceName9.GRIDFS,
|
|
989
|
+
spec: specOf4("tee"),
|
|
979
990
|
fn: teeCommand,
|
|
980
991
|
write: true
|
|
981
992
|
});
|
|
982
993
|
|
|
983
994
|
// src/commands/builtin/gridfs/touch.ts
|
|
984
995
|
import {
|
|
996
|
+
FlagView as FlagView3,
|
|
985
997
|
IOResult as IOResult4,
|
|
986
|
-
ResourceName as
|
|
987
|
-
command as
|
|
988
|
-
resolveGlobOf as
|
|
989
|
-
specOf as
|
|
990
|
-
writeMetadataProvision as writeMetadataProvision3
|
|
998
|
+
ResourceName as ResourceName10,
|
|
999
|
+
command as command5,
|
|
1000
|
+
resolveGlobOf as resolveGlobOf5,
|
|
1001
|
+
specOf as specOf5
|
|
991
1002
|
} from "@struktoai/mirage-core";
|
|
992
|
-
var
|
|
1003
|
+
var resolveGlob5 = resolveGlobOf5(GRIDFS_IO);
|
|
993
1004
|
var ENC4 = new TextEncoder();
|
|
994
1005
|
async function touchCommand(accessor, paths, _texts, opts) {
|
|
995
1006
|
if (paths.length === 0) {
|
|
996
1007
|
return [null, new IOResult4({ exitCode: 1, stderr: ENC4.encode("touch: missing operand\n") })];
|
|
997
1008
|
}
|
|
998
|
-
const resolved = await
|
|
999
|
-
const
|
|
1009
|
+
const resolved = await resolveGlob5(accessor, paths, opts.index ?? void 0);
|
|
1010
|
+
const fl = new FlagView3(opts.flags, specOf5("touch"));
|
|
1011
|
+
const createOnly = fl.asBool("c");
|
|
1000
1012
|
const writes = {};
|
|
1001
1013
|
for (const p of resolved) {
|
|
1002
1014
|
if (createOnly) continue;
|
|
@@ -1007,54 +1019,51 @@ async function touchCommand(accessor, paths, _texts, opts) {
|
|
|
1007
1019
|
}
|
|
1008
1020
|
return [null, new IOResult4({ writes })];
|
|
1009
1021
|
}
|
|
1010
|
-
var GRIDFS_TOUCH =
|
|
1022
|
+
var GRIDFS_TOUCH = command5({
|
|
1011
1023
|
name: "touch",
|
|
1012
|
-
resource:
|
|
1013
|
-
spec:
|
|
1024
|
+
resource: ResourceName10.GRIDFS,
|
|
1025
|
+
spec: specOf5("touch"),
|
|
1014
1026
|
fn: touchCommand,
|
|
1015
|
-
write: true
|
|
1016
|
-
provision: writeMetadataProvision3
|
|
1027
|
+
write: true
|
|
1017
1028
|
});
|
|
1018
1029
|
|
|
1019
1030
|
// src/commands/builtin/gridfs/index.ts
|
|
1020
|
-
var GRIDFS_OVERRIDES = /* @__PURE__ */ new Set(["stat", "
|
|
1031
|
+
var GRIDFS_OVERRIDES = /* @__PURE__ */ new Set(["stat", "rm", "mkdir", "tee", "touch"]);
|
|
1021
1032
|
var GRIDFS_COMMANDS = [
|
|
1022
|
-
...
|
|
1023
|
-
resource: ResourceName10.GRIDFS,
|
|
1024
|
-
readBytes: read,
|
|
1025
|
-
statEntry: stat
|
|
1026
|
-
}),
|
|
1027
|
-
...makeGenericCommands(ResourceName10.GRIDFS, GRIDFS_IO, {
|
|
1033
|
+
...makeGenericCommands(ResourceName11.GRIDFS, GRIDFS_IO, {
|
|
1028
1034
|
overrides: GRIDFS_OVERRIDES
|
|
1029
1035
|
}),
|
|
1030
|
-
...
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
+
...withDefaultProvisions(
|
|
1037
|
+
[...GRIDFS_STAT, ...GRIDFS_RM, ...GRIDFS_MKDIR, ...GRIDFS_TEE, ...GRIDFS_TOUCH],
|
|
1038
|
+
GRIDFS_IO.stat,
|
|
1039
|
+
resolveGlobOf6(GRIDFS_IO),
|
|
1040
|
+
GRIDFS_IO.readdir
|
|
1041
|
+
)
|
|
1036
1042
|
];
|
|
1037
1043
|
|
|
1038
1044
|
// src/ops/gridfs/index.ts
|
|
1039
|
-
import { ResourceName as
|
|
1040
|
-
var GRIDFS_OPS = makeGenericOps(
|
|
1041
|
-
|
|
1042
|
-
|
|
1045
|
+
import { ResourceName as ResourceName12, makeGenericOps } from "@struktoai/mirage-core";
|
|
1046
|
+
var GRIDFS_OPS = makeGenericOps(
|
|
1047
|
+
ResourceName12.GRIDFS,
|
|
1048
|
+
GRIDFS_IO,
|
|
1049
|
+
{}
|
|
1050
|
+
);
|
|
1043
1051
|
|
|
1044
1052
|
// src/resource/gridfs/prompt.ts
|
|
1045
1053
|
var GRIDFS_PROMPT = `{prefix}
|
|
1046
1054
|
Remote MongoDB GridFS bucket. Maps GridFS filenames to virtual paths.
|
|
1047
1055
|
IMPORTANT: This is a remote mount. Prefer targeted reads (grep, head) over full scans. Avoid cat on large files without piping to head/tail.
|
|
1048
1056
|
find pushes -name/-type/-size filters into the fs.files query server-side, so find is cheap even on large buckets.
|
|
1049
|
-
Supports: ls, cat, head, tail, grep, rg, wc, find, tree, jq, stat
|
|
1050
|
-
cat on .parquet/.orc/.feather returns a formatted table.`;
|
|
1057
|
+
Supports: ls, cat, head, tail, grep, rg, wc, find, tree, jq, stat.`;
|
|
1051
1058
|
|
|
1052
1059
|
// src/resource/gridfs/gridfs.ts
|
|
1053
1060
|
var globCore = makeResolveGlob(readdir, SCOPE_ERROR);
|
|
1054
1061
|
var GridFSResource = class extends BaseResource {
|
|
1055
|
-
kind =
|
|
1062
|
+
kind = ResourceName13.GRIDFS;
|
|
1056
1063
|
cachesReads = true;
|
|
1057
1064
|
supportsSnapshot = true;
|
|
1065
|
+
// byte store: stat() sizes every file from metadata
|
|
1066
|
+
sizesAlwaysKnown = true;
|
|
1058
1067
|
indexTtl = 600;
|
|
1059
1068
|
prompt = GRIDFS_PROMPT;
|
|
1060
1069
|
config;
|
|
@@ -1072,8 +1081,8 @@ var GridFSResource = class extends BaseResource {
|
|
|
1072
1081
|
read_stream: stream,
|
|
1073
1082
|
range_read: rangeRead,
|
|
1074
1083
|
rm_recursive: rmR,
|
|
1075
|
-
|
|
1076
|
-
|
|
1084
|
+
du_size: size,
|
|
1085
|
+
du_entries: entries,
|
|
1077
1086
|
create,
|
|
1078
1087
|
truncate,
|
|
1079
1088
|
exists,
|
|
@@ -1096,6 +1105,7 @@ var GridFSResource = class extends BaseResource {
|
|
|
1096
1105
|
}
|
|
1097
1106
|
async close() {
|
|
1098
1107
|
await this.accessor.close();
|
|
1108
|
+
await super.close();
|
|
1099
1109
|
}
|
|
1100
1110
|
commands() {
|
|
1101
1111
|
return GRIDFS_COMMANDS;
|
|
@@ -1159,7 +1169,7 @@ var GridFSResource = class extends BaseResource {
|
|
|
1159
1169
|
return rmR(this.accessor, p);
|
|
1160
1170
|
}
|
|
1161
1171
|
du(p) {
|
|
1162
|
-
return
|
|
1172
|
+
return size(this.accessor, p);
|
|
1163
1173
|
}
|
|
1164
1174
|
find(p, options = {}) {
|
|
1165
1175
|
return find(this.accessor, p, options);
|
|
@@ -1189,6 +1199,7 @@ var GridFSResource = class extends BaseResource {
|
|
|
1189
1199
|
|
|
1190
1200
|
export {
|
|
1191
1201
|
GridFSAccessor,
|
|
1202
|
+
GRIDFS_COMMANDS,
|
|
1192
1203
|
GridFSResource
|
|
1193
1204
|
};
|
|
1194
|
-
//# sourceMappingURL=chunk-
|
|
1205
|
+
//# sourceMappingURL=chunk-YUJBXFYK.js.map
|