gemi 0.186.1 → 0.188.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai/index.js +2 -2
- package/dist/ai/index.js.map +1 -1
- package/dist/app/index.js +1 -1
- package/dist/bin/gemi.js +7 -1
- package/dist/bin/gemi.js.map +3 -3
- package/dist/bun/plugin.js +1 -1
- package/dist/bun/preload.js +1 -1
- package/dist/{chunk-hq710s2a.js → chunk-07mvnzgx.js} +3 -3
- package/dist/{chunk-hq710s2a.js.map → chunk-07mvnzgx.js.map} +1 -1
- package/dist/{chunk-87pn20z5.js → chunk-0sjz2g5b.js} +2 -2
- package/dist/{chunk-87pn20z5.js.map → chunk-0sjz2g5b.js.map} +1 -1
- package/dist/{chunk-7tm669mw.js → chunk-0t5mex63.js} +2 -2
- package/dist/{chunk-7tm669mw.js.map → chunk-0t5mex63.js.map} +1 -1
- package/dist/{chunk-beqhakdf.js → chunk-1mg3x0j0.js} +2 -2
- package/dist/{chunk-beqhakdf.js.map → chunk-1mg3x0j0.js.map} +1 -1
- package/dist/{chunk-2qac05gb.js → chunk-1p7p76er.js} +2 -2
- package/dist/{chunk-2qac05gb.js.map → chunk-1p7p76er.js.map} +1 -1
- package/dist/{chunk-wtdmwmm7.js → chunk-24vv42t6.js} +3 -3
- package/dist/{chunk-wtdmwmm7.js.map → chunk-24vv42t6.js.map} +1 -1
- package/dist/{chunk-spmxhsze.js → chunk-2tfafjmk.js} +2 -2
- package/dist/{chunk-spmxhsze.js.map → chunk-2tfafjmk.js.map} +1 -1
- package/dist/{chunk-xmjzyzn6.js → chunk-3kd3w33a.js} +2 -2
- package/dist/{chunk-xmjzyzn6.js.map → chunk-3kd3w33a.js.map} +1 -1
- package/dist/{chunk-dh4ax9cj.js → chunk-4x22y92r.js} +2 -2
- package/dist/{chunk-dh4ax9cj.js.map → chunk-4x22y92r.js.map} +1 -1
- package/dist/chunk-4xpcx3ws.js +15 -0
- package/dist/{chunk-zenfs4e2.js.map → chunk-4xpcx3ws.js.map} +7 -6
- package/dist/{chunk-dezd1fn5.js → chunk-4xtefwwa.js} +2 -2
- package/dist/{chunk-dezd1fn5.js.map → chunk-4xtefwwa.js.map} +1 -1
- package/dist/{chunk-cf5a958j.js → chunk-4zwnmk3c.js} +2 -2
- package/dist/{chunk-cf5a958j.js.map → chunk-4zwnmk3c.js.map} +1 -1
- package/dist/{chunk-przahq2e.js → chunk-5zgkh1xp.js} +2 -2
- package/dist/{chunk-przahq2e.js.map → chunk-5zgkh1xp.js.map} +1 -1
- package/dist/{chunk-ye72q3kx.js → chunk-6dtq4h9p.js} +2 -2
- package/dist/{chunk-ye72q3kx.js.map → chunk-6dtq4h9p.js.map} +1 -1
- package/dist/{chunk-q6rse2fh.js → chunk-6s6cek6k.js} +2 -2
- package/dist/{chunk-q6rse2fh.js.map → chunk-6s6cek6k.js.map} +1 -1
- package/dist/{chunk-zyzhqnbm.js → chunk-74n9paen.js} +2 -2
- package/dist/{chunk-zyzhqnbm.js.map → chunk-74n9paen.js.map} +1 -1
- package/dist/{chunk-7dhvb6nn.js → chunk-7s6gdgwx.js} +2 -2
- package/dist/{chunk-7dhvb6nn.js.map → chunk-7s6gdgwx.js.map} +1 -1
- package/dist/{chunk-a1414jdv.js → chunk-80cwastb.js} +3 -3
- package/dist/{chunk-a1414jdv.js.map → chunk-80cwastb.js.map} +1 -1
- package/dist/{chunk-vhyabcw9.js → chunk-88508q02.js} +2 -2
- package/dist/{chunk-vhyabcw9.js.map → chunk-88508q02.js.map} +1 -1
- package/dist/{chunk-kzv3v0tm.js → chunk-8a72czrb.js} +3 -3
- package/dist/{chunk-kzv3v0tm.js.map → chunk-8a72czrb.js.map} +1 -1
- package/dist/chunk-8bp5s118.js +117 -0
- package/dist/{chunk-5y6e8kpe.js.map → chunk-8bp5s118.js.map} +14 -7
- package/dist/{chunk-bg2e7stx.js → chunk-9ep490s9.js} +2 -2
- package/dist/{chunk-bg2e7stx.js.map → chunk-9ep490s9.js.map} +1 -1
- package/dist/{chunk-87nekrjj.js → chunk-attv9byj.js} +2 -2
- package/dist/{chunk-87nekrjj.js.map → chunk-attv9byj.js.map} +1 -1
- package/dist/{chunk-a1r1r1z7.js → chunk-babcg0fq.js} +2 -2
- package/dist/{chunk-a1r1r1z7.js.map → chunk-babcg0fq.js.map} +1 -1
- package/dist/{chunk-c07s6w45.js → chunk-bmckdsec.js} +1 -1
- package/dist/{chunk-d5ftst76.js → chunk-bwh1n2cj.js} +2 -2
- package/dist/{chunk-d5ftst76.js.map → chunk-bwh1n2cj.js.map} +1 -1
- package/dist/{chunk-3jpj6hjh.js → chunk-cbjjg80m.js} +1 -1
- package/dist/{chunk-2c2n3v4k.js → chunk-cbp8xrsn.js} +2 -2
- package/dist/{chunk-2c2n3v4k.js.map → chunk-cbp8xrsn.js.map} +1 -1
- package/dist/{chunk-vvwhk2sb.js → chunk-cr37wx3s.js} +2 -2
- package/dist/{chunk-vvwhk2sb.js.map → chunk-cr37wx3s.js.map} +1 -1
- package/dist/{chunk-srsmhbpt.js → chunk-cr9rd0v4.js} +2 -2
- package/dist/{chunk-srsmhbpt.js.map → chunk-cr9rd0v4.js.map} +1 -1
- package/dist/{chunk-kcvzs31p.js → chunk-czw7kqtp.js} +2 -2
- package/dist/{chunk-kcvzs31p.js.map → chunk-czw7kqtp.js.map} +1 -1
- package/dist/{chunk-f2tjtwm0.js → chunk-dm61gz7e.js} +2 -2
- package/dist/{chunk-f2tjtwm0.js.map → chunk-dm61gz7e.js.map} +1 -1
- package/dist/{chunk-2rpz1p8g.js → chunk-e6k0024c.js} +1 -1
- package/dist/{chunk-nadkwh8a.js → chunk-edj701p0.js} +3 -3
- package/dist/{chunk-nadkwh8a.js.map → chunk-edj701p0.js.map} +1 -1
- package/dist/{chunk-3derdn99.js → chunk-fg1mpyp9.js} +2 -2
- package/dist/{chunk-3derdn99.js.map → chunk-fg1mpyp9.js.map} +1 -1
- package/dist/{chunk-z65e3vdy.js → chunk-gcjjwgnt.js} +2 -2
- package/dist/{chunk-z65e3vdy.js.map → chunk-gcjjwgnt.js.map} +1 -1
- package/dist/{chunk-mpt1zsfv.js → chunk-gtbjdx8d.js} +2 -2
- package/dist/{chunk-mpt1zsfv.js.map → chunk-gtbjdx8d.js.map} +1 -1
- package/dist/chunk-h3jxnd65.js +5 -0
- package/dist/{chunk-f25x1sn1.js.map → chunk-h3jxnd65.js.map} +1 -1
- package/dist/{chunk-mpreff3t.js → chunk-jmgjhfya.js} +2 -2
- package/dist/{chunk-mpreff3t.js.map → chunk-jmgjhfya.js.map} +1 -1
- package/dist/{chunk-96r16t57.js → chunk-jsbq8qq0.js} +3 -3
- package/dist/{chunk-96r16t57.js.map → chunk-jsbq8qq0.js.map} +1 -1
- package/dist/{chunk-gtdf51jz.js → chunk-k4c0q1za.js} +1 -1
- package/dist/{chunk-6daabbfj.js → chunk-kcgbb7cd.js} +2 -2
- package/dist/{chunk-6daabbfj.js.map → chunk-kcgbb7cd.js.map} +1 -1
- package/dist/{chunk-84j5b07n.js → chunk-kjtq7vk3.js} +1 -1
- package/dist/{chunk-ty3kycy4.js → chunk-kkymwxt2.js} +2 -2
- package/dist/{chunk-ty3kycy4.js.map → chunk-kkymwxt2.js.map} +1 -1
- package/dist/{chunk-vv8vjjez.js → chunk-ktgmrjj3.js} +2 -2
- package/dist/{chunk-vv8vjjez.js.map → chunk-ktgmrjj3.js.map} +1 -1
- package/dist/{chunk-7gnspwra.js → chunk-kzny5cj2.js} +2 -2
- package/dist/{chunk-7gnspwra.js.map → chunk-kzny5cj2.js.map} +1 -1
- package/dist/{chunk-yx03gndz.js → chunk-m8y3y6sw.js} +2 -2
- package/dist/{chunk-yx03gndz.js.map → chunk-m8y3y6sw.js.map} +1 -1
- package/dist/{chunk-g32mpf79.js → chunk-ma2sders.js} +2 -2
- package/dist/{chunk-g32mpf79.js.map → chunk-ma2sders.js.map} +1 -1
- package/dist/{chunk-rdnxkecg.js → chunk-mx4z8c6r.js} +2 -2
- package/dist/{chunk-rdnxkecg.js.map → chunk-mx4z8c6r.js.map} +1 -1
- package/dist/{chunk-vvg3yxrc.js → chunk-n0mjy9ep.js} +2 -2
- package/dist/{chunk-vvg3yxrc.js.map → chunk-n0mjy9ep.js.map} +1 -1
- package/dist/{chunk-ecv4mtgh.js → chunk-n1b6r6s9.js} +2 -2
- package/dist/{chunk-ecv4mtgh.js.map → chunk-n1b6r6s9.js.map} +1 -1
- package/dist/{chunk-fdpvgeey.js → chunk-n28c9xjp.js} +2 -2
- package/dist/{chunk-fdpvgeey.js.map → chunk-n28c9xjp.js.map} +1 -1
- package/dist/{chunk-d9pnjkxr.js → chunk-nbfzyvav.js} +2 -2
- package/dist/{chunk-d9pnjkxr.js.map → chunk-nbfzyvav.js.map} +1 -1
- package/dist/{chunk-tckf3g8x.js → chunk-p9rf0e8r.js} +2 -2
- package/dist/{chunk-tckf3g8x.js.map → chunk-p9rf0e8r.js.map} +1 -1
- package/dist/{chunk-00sj67nx.js → chunk-pchb1awj.js} +2 -2
- package/dist/{chunk-00sj67nx.js.map → chunk-pchb1awj.js.map} +1 -1
- package/dist/{chunk-9mf6qzxy.js → chunk-ph793v5g.js} +2 -2
- package/dist/{chunk-9mf6qzxy.js.map → chunk-ph793v5g.js.map} +1 -1
- package/dist/{chunk-p4bbsa4x.js → chunk-q8zhfe2s.js} +2 -2
- package/dist/{chunk-p4bbsa4x.js.map → chunk-q8zhfe2s.js.map} +1 -1
- package/dist/{chunk-7bz43qbt.js → chunk-q9b0ndf0.js} +3 -3
- package/dist/{chunk-7bz43qbt.js.map → chunk-q9b0ndf0.js.map} +1 -1
- package/dist/{chunk-6d3527qt.js → chunk-r5cddkyc.js} +2 -2
- package/dist/{chunk-6d3527qt.js.map → chunk-r5cddkyc.js.map} +1 -1
- package/dist/{chunk-krgwft9w.js → chunk-sbhpdhwc.js} +2 -2
- package/dist/{chunk-krgwft9w.js.map → chunk-sbhpdhwc.js.map} +1 -1
- package/dist/{chunk-0ahecas6.js → chunk-scscdtd6.js} +2 -2
- package/dist/{chunk-0ahecas6.js.map → chunk-scscdtd6.js.map} +1 -1
- package/dist/{chunk-6tferehw.js → chunk-t201nja2.js} +2 -2
- package/dist/{chunk-6tferehw.js.map → chunk-t201nja2.js.map} +1 -1
- package/dist/{chunk-skq4g7qa.js → chunk-tfvdrvbn.js} +2 -2
- package/dist/{chunk-skq4g7qa.js.map → chunk-tfvdrvbn.js.map} +1 -1
- package/dist/{chunk-810nrvt4.js → chunk-v6ewt7tc.js} +2 -2
- package/dist/{chunk-810nrvt4.js.map → chunk-v6ewt7tc.js.map} +1 -1
- package/dist/{chunk-xgg9w7ep.js → chunk-vmax8gjr.js} +2 -2
- package/dist/{chunk-xgg9w7ep.js.map → chunk-vmax8gjr.js.map} +1 -1
- package/dist/{chunk-h2t135y3.js → chunk-vpms0v5m.js} +3 -3
- package/dist/{chunk-h2t135y3.js.map → chunk-vpms0v5m.js.map} +1 -1
- package/dist/{chunk-z2k8m02z.js → chunk-vqrqzfyw.js} +8 -2
- package/dist/chunk-vqrqzfyw.js.map +10 -0
- package/dist/{chunk-64r5cs5g.js → chunk-vyqk7de0.js} +1 -1
- package/dist/{chunk-b55zt46z.js → chunk-wk84z25h.js} +2 -2
- package/dist/{chunk-b55zt46z.js.map → chunk-wk84z25h.js.map} +1 -1
- package/dist/{chunk-m906xc76.js → chunk-yp4rbknt.js} +2 -2
- package/dist/{chunk-m906xc76.js.map → chunk-yp4rbknt.js.map} +1 -1
- package/dist/{chunk-tvkdqnhv.js → chunk-yqf1k3kb.js} +3 -3
- package/dist/{chunk-tvkdqnhv.js.map → chunk-yqf1k3kb.js.map} +1 -1
- package/dist/{chunk-xjb2kzkj.js → chunk-zck41hz4.js} +4 -4
- package/dist/{chunk-xjb2kzkj.js.map → chunk-zck41hz4.js.map} +1 -1
- package/dist/{chunk-3fm7gmp5.js → chunk-zjr8kgbg.js} +2 -2
- package/dist/{chunk-3fm7gmp5.js.map → chunk-zjr8kgbg.js.map} +1 -1
- package/dist/{chunk-7b10n8m8.js → chunk-zqcaqwey.js} +2 -2
- package/dist/{chunk-7b10n8m8.js.map → chunk-zqcaqwey.js.map} +1 -1
- package/dist/{chunk-yaacfbky.js → chunk-zrndnz4n.js} +2 -2
- package/dist/{chunk-yaacfbky.js.map → chunk-zrndnz4n.js.map} +1 -1
- package/dist/chunks/{RealtimeClient-C7VTiRUv.js → RealtimeClient-CyGWZr6p.js} +2 -2
- package/dist/chunks/{RealtimeClient-C7VTiRUv.js.map → RealtimeClient-CyGWZr6p.js.map} +1 -1
- package/dist/chunks/{ThemeProvider-Ddumzd7S.js → ThemeProvider-BnmnRvEc.js} +53 -34
- package/dist/chunks/ThemeProvider-BnmnRvEc.js.map +1 -0
- package/dist/chunks/{fetchFileRequest-ClV8HU3g.js → fetchFileRequest-D4fAcY7D.js} +2 -2
- package/dist/chunks/{fetchFileRequest-ClV8HU3g.js.map → fetchFileRequest-D4fAcY7D.js.map} +1 -1
- package/dist/chunks/{live-BAFgp_WN.js → live-B4RW02g2.js} +3 -3
- package/dist/chunks/{live-BAFgp_WN.js.map → live-B4RW02g2.js.map} +1 -1
- package/dist/chunks/{mutationExtras-ozY1Rd1R.js → mutationExtras-DgdYjcaa.js} +2 -2
- package/dist/chunks/{mutationExtras-ozY1Rd1R.js.map → mutationExtras-DgdYjcaa.js.map} +1 -1
- package/dist/chunks/{subscriptionStream-CTiRok5u.js → subscriptionStream-Ca5V54ee.js} +2 -2
- package/dist/chunks/{subscriptionStream-CTiRok5u.js.map → subscriptionStream-Ca5V54ee.js.map} +1 -1
- package/dist/client/QueryManagerContext.d.ts +17 -1
- package/dist/client/QueryManagerContext.d.ts.map +1 -1
- package/dist/client/ServerQueryContext.d.ts +10 -4
- package/dist/client/ServerQueryContext.d.ts.map +1 -1
- package/dist/client/index.js +27 -25
- package/dist/client/index.js.map +1 -1
- package/dist/client/islands.d.ts +47 -2
- package/dist/client/islands.d.ts.map +1 -1
- package/dist/client/useQuery.d.ts.map +1 -1
- package/dist/config/index.js +1 -1
- package/dist/console/run.js +2 -2
- package/dist/console/run.js.map +1 -1
- package/dist/container/index.js +2 -2
- package/dist/container/index.js.map +1 -1
- package/dist/database/index.js +2 -2
- package/dist/database/index.js.map +1 -1
- package/dist/email/index.js +2 -2
- package/dist/email/index.js.map +1 -1
- package/dist/facades/Storage.d.ts +6 -0
- package/dist/facades/Storage.d.ts.map +1 -1
- package/dist/facades/index.js +2 -2
- package/dist/facades/index.js.map +1 -1
- package/dist/foundation/index.js +2 -2
- package/dist/foundation/index.js.map +1 -1
- package/dist/http/index.js +2 -2
- package/dist/http/index.js.map +1 -1
- package/dist/i18n/dictionaryRuntime.js +2 -2
- package/dist/i18n/dictionaryRuntime.js.map +1 -1
- package/dist/i18n/index.js +2 -2
- package/dist/i18n/index.js.map +1 -1
- package/dist/internal/islandRuntime.d.ts +9 -2
- package/dist/internal/islandRuntime.d.ts.map +1 -1
- package/dist/kernel/index.js +2 -2
- package/dist/kernel/index.js.map +1 -1
- package/dist/orm/index.js +2 -2
- package/dist/orm/index.js.map +1 -1
- package/dist/probe/index.js +2 -2
- package/dist/probe/index.js.map +1 -1
- package/dist/server/index.js +2 -2
- package/dist/server/index.js.map +1 -1
- package/dist/services/file-storage/FilesystemManager.d.ts +4 -0
- package/dist/services/file-storage/FilesystemManager.d.ts.map +1 -1
- package/dist/services/file-storage/config.d.ts +16 -0
- package/dist/services/file-storage/config.d.ts.map +1 -1
- package/dist/services/file-storage/fetchTimeouts.d.ts +41 -0
- package/dist/services/file-storage/fetchTimeouts.d.ts.map +1 -0
- package/dist/services/index.d.ts +1 -0
- package/dist/services/index.d.ts.map +1 -1
- package/dist/services/index.js +3 -3
- package/dist/services/index.js.map +2 -2
- package/dist/services/queue/work.js +2 -2
- package/dist/services/queue/work.js.map +1 -1
- package/dist/services/router/ServerQueryStore.d.ts +10 -0
- package/dist/services/router/ServerQueryStore.d.ts.map +1 -1
- package/dist/services/router/ViewRouteDispatcher.d.ts.map +1 -1
- package/dist/services/router/staticDocument.d.ts +8 -0
- package/dist/services/router/staticDocument.d.ts.map +1 -1
- package/dist/stats/route-table.js +1 -1
- package/dist/support/index.js +2 -2
- package/dist/support/index.js.map +1 -1
- package/dist/testing/index.js +15 -2
- package/dist/testing/index.js.map +1 -1
- package/dist/vite/index.mjs +6 -0
- package/dist/vitest/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-5y6e8kpe.js +0 -117
- package/dist/chunk-f25x1sn1.js +0 -5
- package/dist/chunk-z2k8m02z.js.map +0 -10
- package/dist/chunk-zenfs4e2.js +0 -15
- package/dist/chunks/ThemeProvider-Ddumzd7S.js.map +0 -1
- /package/dist/{chunk-c07s6w45.js.map → chunk-bmckdsec.js.map} +0 -0
- /package/dist/{chunk-3jpj6hjh.js.map → chunk-cbjjg80m.js.map} +0 -0
- /package/dist/{chunk-2rpz1p8g.js.map → chunk-e6k0024c.js.map} +0 -0
- /package/dist/{chunk-gtdf51jz.js.map → chunk-k4c0q1za.js.map} +0 -0
- /package/dist/{chunk-84j5b07n.js.map → chunk-kjtq7vk3.js.map} +0 -0
- /package/dist/{chunk-64r5cs5g.js.map → chunk-vyqk7de0.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../services/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,MAAM,0CAA0C,CAAC;AACrF,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAC3E,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EACL,eAAe,EACf,KAAK,qBAAqB,GAC3B,MAAM,wCAAwC,CAAC;AAChD,YAAY,EACV,SAAS,EACT,gBAAgB,EAChB,mBAAmB,EACnB,gBAAgB,EAChB,YAAY,EACZ,kBAAkB,EAClB,cAAc,EACd,aAAa,EACb,eAAe,EAC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M,gBAAgB,CAAC;AACxB,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,KAAK,WAAW,GACjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,KAAK,cAAc,GACpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,GACxB,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACV,gBAAgB,EAChB,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,uBAAuB,EACvB,yBAAyB,EACzB,KAAK,iBAAiB,GACvB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,sBAAsB,EACtB,wBAAwB,EACxB,KAAK,gBAAgB,GACtB,MAAM,2BAA2B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../services/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,MAAM,0CAA0C,CAAC;AACrF,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAC3E,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EACL,eAAe,EACf,KAAK,qBAAqB,GAC3B,MAAM,wCAAwC,CAAC;AAChD,YAAY,EACV,SAAS,EACT,gBAAgB,EAChB,mBAAmB,EACnB,gBAAgB,EAChB,YAAY,EACZ,kBAAkB,EAClB,cAAc,EACd,aAAa,EACb,eAAe,EACf,cAAc,EACd,UAAU,EACV,Y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AAiB,EACjB,mBAAmB,EACnB,KAAK,WAAW,GACjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,KAAK,WAAW,GACjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,KAAK,cAAc,GACpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,GACxB,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACV,gBAAgB,EAChB,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,uBAAuB,EACvB,yBAAyB,EACzB,KAAK,iBAAiB,GACvB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,sBAAsB,EACtB,wBAAwB,EACxB,KAAK,gBAAgB,GACtB,MAAM,2BAA2B,CAAC"}
|
package/dist/services/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{db as _9}from"../chunk-8m9kgynj.js";import{Ab as $9,Bb as J9,Cb as Q9,Db as Y9,Eb as K9,Fb as y4,Gb as O6,Hb as w,Ib as z9,Jb as G9,Kb as X9,Lb as B9,Mb as j9,Nb as F9,Ob as M9,Pb as L9,Qb as N9,Rb as D9,Sb as H9,Tb as U9,Ub as x9,Vb as O9,Wb as S9,Xb as R9,eb as RZ,fb as _Z,gb as kZ,hb as fZ,ib as CZ,jb as w4,kb as VZ,lb as V4,mb as T4,nb as g1,ob as TZ,pb as PZ,qb as iZ,ub as sZ,vb as oZ,wb as aZ,xb as tZ,yb as W9,zb as Z9}from"../chunk-2c2n3v4k.js";import{_b as v4}from"../chunk-a1r1r1z7.js";import{Ad as qZ,Bd as vZ,Cd as IZ,Dd as AZ,Ed as hZ,Fd as gZ,Gd as EZ,Hd as mZ,Id as cZ,Jd as uZ,Kd as pZ,Ld as dZ,Md as lZ,Nd as nZ,yd as bZ,zd as wZ}from"../chunk-xmjzyzn6.js";import{Od as yZ}from"../chunk-bm3pyh9m.js";import{$d as HZ,Pd as YZ,Qd as KZ,Rd as zZ,Sd as GZ,Td as XZ,Ud as BZ,Vd as jZ,Wd as FZ,Xd as MZ,Yd as LZ,Zd as NZ,_d as DZ,ae as UZ,be as xZ,ce as OZ,he as SZ}from"../chunk-87nekrjj.js";import{ie as rZ,je as eZ}from"../chunk-6d3527qt.js";import"../chunk-q19cs1qf.js";import{$f as q8,$g as e8,Af as F8,Bf as M8,Ce as M6,Cf as L8,De as H4,Df as N8,Ee as r0,Ef as D8,Fe as U4,Ge as x4,Gf as H8,Gg as a8,Hf as x6,If as U8,Ke as k5,Kg as t8,Le as f5,Me as C5,Mf as x8,Ne as V5,Nf as O8,Oe as T5,Of as R8,Og as A4,Pe as P5,Pg as E1,Qe as b5,Re as w5,Rf as _8,Se as q5,Sf as k8,Te as l0,Tf as f8,Ue as v5,Uf as C8,Ve as I5,We as y5,Wf as V8,Xe as A5,Xf as T8,Ye as h5,Yf as P8,Zf as b8,_f as w8,_g as r8,ag as v8,bg as I8,cg as y8,dg as A8,ig as U,jg as m,kg as h8,lf as l5,lg as g8,mf as n5,mg as E8,nf as i5,ng as m8,of as s5,og as c8,pf as o5,qf as a5,qg as u8,rg as p8,sg as d8,te as F6,tg as l8,ue as O5,ug as n8,ve as S5,we as R5,wf as G8,xf as X8,xg as i8,ye as _5,yf as B8,yg as s8,zf as j8,zg as o8}from"../chunk-5y6e8kpe.js";import"../chunk-2qac05gb.js";import"../chunk-3derdn99.js";import{Hi as jW,Ii as FW,Li as u5,Mi as p5,Oi as d5,Qi as I1,Th as D4,Uh as M4,Vh as D1,gi as C4,ji as $1,li as a,pi as L4,qi as H1,ri as v1,si as g5,ti as E5,ui as m5,vi as c5}from"../chunk-zenfs4e2.js";import"../chunk-q6rse2fh.js";import{_i as V}from"../chunk-spmxhsze.js";import{gj as J8,hj as Q8,ij as w1,jj as Y8,kj as m0,lj as K8,mj as z8}from"../chunk-7bz43qbt.js";import{sj as W8,tj as Z8,uj as $8}from"../chunk-a1414jdv.js";import"../chunk-vhyabcw9.js";import{bk as S8}from"../chunk-zyzhqnbm.js";import{dk as t5,ek as r5,fk as e5}from"../chunk-vv8vjjez.js";import"../chunk-ecv4mtgh.js";import"../chunk-wtdmwmm7.js";import"../chunk-7gnspwra.js";import"../chunk-yx03gndz.js";import{Xk as WZ,Yk as ZZ,Zk as $Z,_k as JZ,al as QZ}from"../chunk-96r16t57.js";import"../chunk-cf5a958j.js";import{kl as C}from"../chunk-nadkwh8a.js";import"../chunk-krgwft9w.js";import"../chunk-z2k8m02z.js";import"../chunk-m906xc76.js";import"../chunk-rdnxkecg.js";import"../chunk-0ahecas6.js";import{Ll as i0}from"../chunk-mpreff3t.js";import{Buffer as n0}from"buffer";class s0 extends H1{client;config;constructor(...W){super();this.config=W}async connect(){let W=await import("../chunk-xjb2kzkj.js");return this.client??=new W.S3Client(...this.config),{sdk:W,client:this.client}}async put(W,{signal:Z}={}){Z?.throwIfAborted();let $,J,Q,Y=process.env.BUCKET_NAME;if(W instanceof Blob)$=W,Q=`${Bun.randomUUIDv7()}.${W.type.split("/")[1].split(";")[0]}`,J=W.type;else $=W.body,Q=W.name,Y=W.bucket??Y,J=W.contentType||($ instanceof Blob||$ instanceof File?$.type:void 0);J=J||void 0;let K=$ instanceof n0?$:$ instanceof Blob||$ instanceof File?n0.from(await $.arrayBuffer()):"",{sdk:z,client:G}=await this.connect();return Z?.throwIfAborted(),await G.send(new z.PutObjectCommand({Bucket:Y,Key:Q,Body:K,ContentType:J}),{abortSignal:Z}),Q}async delete(W){let Z=typeof W==="string"?W:W.name,$=(typeof W==="string"?void 0:W.bucket)??process.env.BUCKET_NAME;if(!Z)throw Error("Object name has to be specified");let{sdk:J,client:Q}=await this.connect();try{await Q.send(new J.DeleteObjectCommand({Bucket:$,Key:Z}))}catch(Y){if(Y?.name==="NoSuchKey"||Y?.$metadata?.httpStatusCode===404)return;throw Y}}async*pages(W,{bucket:Z,signal:$}){let{sdk:J,client:Q}=await this.connect(),Y;do{$?.throwIfAborted();let K=await Q.send(new J.ListObjectsV2Command({Bucket:Z??process.env.BUCKET_NAME,Prefix:W,ContinuationToken:Y}),{abortSignal:$});yield(K.Contents??[]).map((z)=>({name:z.Key,size:z.Size??0,lastModified:z.LastModified??new Date(0)})),Y=K.IsTruncated?K.NextContinuationToken:void 0}while(Y)}async*objects(W,Z={}){for await(let $ of this.pages(W,Z))yield*$}async deletePrefix(W,Z={}){L4(W);let $=Z.bucket??process.env.BUCKET_NAME,{sdk:J,client:Q}=await this.connect(),Y=0;for await(let K of this.pages(W,{...Z,bucket:$})){if(K.length===0)continue;Z.signal?.throwIfAborted();let G=(await Q.send(new J.DeleteObjectsCommand({Bucket:$,Delete:{Objects:K.map((X)=>({Key:X.name})),Quiet:!0}}),{abortSignal:Z.signal}))?.Errors??[];if(G.length>0){let X=G[0];throw Error(`S3 could not delete ${G.length} object(s) under "${W}", e.g. "${X.Key}": ${X.Code??"unknown"} ${X.Message??""}`.trim())}Y+=K.length}return Y}async list(W){let{sdk:Z,client:$}=await this.connect();return await $.send(new Z.ListObjectsV2Command({Bucket:process.env.BUCKET_NAME,Prefix:W}))}async fetch(W,{signal:Z}={}){Z?.throwIfAborted();let $=process.env.BUCKET_NAME,J;if(typeof W==="string")J=W;else $=W.bucket??$,J=W.name;if(!J)throw Error("Object name has to be specified");let{sdk:Q,client:Y}=await this.connect();Z?.throwIfAborted();let K=await Y.send(new Q.GetObjectCommand({Bucket:$,Key:J}),{abortSignal:Z}),z=v1(K.Body.transformToWebStream(),Z);return Z?.throwIfAborted(),new Response(z,{headers:{"Content-Type":K.ContentType,"Content-Length":K.ContentLength.toString(),"Cache-Control":"private, max-age=12000, must-revalidate","Last-Modified":K.LastModified?.toUTCString()||"",ETag:K.ETag||""}})}async read(W){let Z=typeof W==="string"?{name:W}:W,$=Z.bucket??process.env.BUCKET_NAME,{name:J,range:Q=null}=Z;if(!J)throw Error("Object name has to be specified");let{sdk:Y,client:K}=await this.connect(),z;try{z=await K.send(new Y.GetObjectCommand({Bucket:$,Key:J,Range:Q?M4(Q):void 0}))}catch(j){if(j?.name==="InvalidRange"||j?.$metadata?.httpStatusCode===416)throw new $1(await this.size({name:J,bucket:$}));if(j?.name==="NoSuchKey"||j?.$metadata?.httpStatusCode===404)throw new a(J);throw j}let G=D1(z.ContentRange),X=Boolean(G)&&z.$metadata?.httpStatusCode===206,B=G?.total??z.ContentLength??0;return{body:z.Body.transformToWebStream(),start:G?.start??0,end:G?.end??B-1,total:B,partial:X,type:z.ContentType??"application/octet-stream",etag:z.ETag||void 0,lastModified:z.LastModified,name:J}}async size(W){let Z=typeof W==="string"?W:W.name,$=(typeof W==="string"?void 0:W.bucket)??process.env.BUCKET_NAME,{sdk:J,client:Q}=await this.connect();try{return(await Q.send(new J.HeadObjectCommand({Bucket:$,Key:Z}))).ContentLength??0}catch(Y){if(Y?.name==="NotFound"||Y?.$metadata?.httpStatusCode===404)throw new a(Z);throw Y}}}import{Buffer as o0}from"buffer";import{Readable as NW}from"stream";function N4(W){return W?.statusCode===404||W?.details?.errorCode==="BlobNotFound"||W?.code==="BlobNotFound"}function DW(W){return W?.statusCode===416||W?.details?.errorCode==="InvalidRange"||W?.code==="InvalidRange"}class a0 extends H1{config;serviceClientPromise=null;constructor(W={}){super();this.config=W}async serviceClient(){if(this.config.serviceClient)return this.config.serviceClient;return this.serviceClientPromise??=(async()=>{let W;try{W=await import("@azure/storage-blob")}catch{throw Error("AzureBlobDriver requires the '@azure/storage-blob' package. Install it with `bun add @azure/storage-blob`, or pass a pre-built `serviceClient`.")}let Z=this.config.connectionString??process.env.AZURE_STORAGE_CONNECTION_STRING;if(this.config.url)return new W.BlobServiceClient(this.config.url,this.config.credential);if(Z)return W.BlobServiceClient.fromConnectionString(Z);throw Error("AzureBlobDriver needs a connection string (AZURE_STORAGE_CONNECTION_STRING), a `url`, or a `serviceClient`.")})(),this.serviceClientPromise}async blob(W,Z){if(!W)throw Error("Object name has to be specified");let $=Z??this.config.container??process.env.BUCKET_NAME;if(!$)throw Error("AzureBlobDriver needs a container name, from `bucket`, the `container` config, or BUCKET_NAME.");return(await this.serviceClient()).getContainerClient($).getBlockBlobClient(W)}async put(W,{signal:Z}={}){Z?.throwIfAborted();let $,J,Q,Y;if(W instanceof Blob)$=W,Q=`${Bun.randomUUIDv7()}.${W.type.split("/")[1].split(";")[0]}`,J=W.type;else $=W.body,Q=W.name,Y=W.bucket,J=W.contentType??($ instanceof Blob||$ instanceof File?$.type:void 0);let K=$ instanceof o0?$:o0.from(await $.arrayBuffer()),z=await this.blob(Q,Y);return Z?.throwIfAborted(),await z.uploadData(K,{blobHTTPHeaders:J?{blobContentType:J}:void 0,abortSignal:Z}),Q}async*objects(W,{bucket:Z,signal:$}={}){$?.throwIfAborted();let J=Z??this.config.container??process.env.BUCKET_NAME;if(!J)throw Error("AzureBlobDriver needs a container name, from `bucket`, the `container` config, or BUCKET_NAME.");let Y=(await this.serviceClient()).getContainerClient(J);for await(let K of Y.listBlobsFlat({prefix:W}))$?.throwIfAborted(),yield{name:K.name,size:K.properties?.contentLength??0,lastModified:K.properties?.lastModified??new Date(0)}}async list(W){let Z=this.config.container??process.env.BUCKET_NAME,J=(await this.serviceClient()).getContainerClient(Z),Q=[];for await(let Y of J.listBlobsFlat({prefix:W}))Q.push(Y.name);return Q}async fetch(W,{signal:Z}={}){Z?.throwIfAborted();let $=await this.download(typeof W==="string"?{name:W}:{name:W.name,bucket:W.bucket},Z);return new Response($.body,{headers:{"Content-Type":$.type,"Content-Length":String($.total),"Cache-Control":"private, max-age=12000, must-revalidate","Last-Modified":$.lastModified?.toUTCString()??"",ETag:$.etag??""}})}async read(W){return this.download(typeof W==="string"?{name:W}:W)}async download(W,Z){let{name:$,bucket:J,range:Q=null}=W,Y=await this.blob($,J);Z?.throwIfAborted();let K,z,G=Q?.kind==="suffix"||Q?.kind==="offset"&&Q.end===null&&Q.start===0;if(Q&&G){let S=await this.size({name:$,bucket:J}),o=D4(Q,S);if(!o)throw new $1(S);K=o.start,z=o.length}else if(Q?.kind==="offset")K=Q.start,z=Q.end===null?void 0:Q.end-Q.start+1;let X;try{X=await Y.download(K,z,Z?{abortSignal:Z}:void 0)}catch(S){if(DW(S))throw new $1(await this.size({name:$,bucket:J}));if(N4(S))throw new a($);throw S}let B=D1(X.contentRange),j=Boolean(B),L=B?.total??X.contentLength??0,H=await HW(X);if(H instanceof ReadableStream)H=v1(H,Z);return Z?.throwIfAborted(),{body:H,start:B?.start??0,end:B?.end??L-1,total:L,partial:j,type:X.contentType??"application/octet-stream",etag:X.etag||void 0,lastModified:X.lastModified,name:$}}async size(W){let Z=typeof W==="string"?W:W.name,$=typeof W==="string"?void 0:W.bucket,J=await this.blob(Z,$);try{return(await J.getProperties()).contentLength??0}catch(Q){if(N4(Q))throw new a(Z);throw Q}}async delete(W){let Z=typeof W==="string"?W:W.name,$=typeof W==="string"?void 0:W.bucket,J=await this.blob(Z,$);try{await J.delete()}catch(Q){if(N4(Q))return;throw Q}}}async function HW(W){if(W.blobBody)return await W.blobBody;if(W.readableStreamBody)return NW.toWeb(W.readableStreamBody);return null}function UW(W){return W}class O4 extends Error{code="ERR_RATE_LIMITER_TIMEOUT";constructor(W){super(`RedisRateLimiter: Redis did not answer within ${W}ms.`);this.name="RedisRateLimiterTimeoutError"}}class y1 extends Error{code="ERR_RATE_LIMITER_DISCONNECTED";constructor(){super("RedisRateLimiter: the Redis client is not connected.");this.name="RedisRateLimiterDisconnectedError"}}var t0=1000,xW=60000,OW=`
|
|
2
|
+
import{db as k9}from"../chunk-8m9kgynj.js";import{Ab as J9,Bb as Q9,Cb as Y9,Db as K9,Eb as z9,Fb as y4,Gb as O6,Hb as w,Ib as G9,Jb as X9,Kb as B9,Lb as j9,Mb as F9,Nb as M9,Ob as L9,Pb as N9,Qb as D9,Rb as H9,Sb as U9,Tb as x9,Ub as O9,Vb as S9,Wb as R9,Xb as _9,eb as _Z,fb as kZ,gb as fZ,hb as CZ,ib as VZ,jb as w4,kb as TZ,lb as V4,mb as T4,nb as g1,ob as PZ,pb as bZ,qb as sZ,ub as oZ,vb as aZ,wb as tZ,xb as rZ,yb as Z9,zb as $9}from"../chunk-cbp8xrsn.js";import{_b as v4}from"../chunk-babcg0fq.js";import{Ad as vZ,Bd as IZ,Cd as yZ,Dd as hZ,Ed as gZ,Fd as EZ,Gd as mZ,Hd as cZ,Id as uZ,Jd as pZ,Kd as dZ,Ld as lZ,Md as nZ,Nd as iZ,yd as wZ,zd as qZ}from"../chunk-3kd3w33a.js";import{Od as AZ}from"../chunk-bm3pyh9m.js";import{$d as UZ,Pd as KZ,Qd as zZ,Rd as GZ,Sd as XZ,Td as BZ,Ud as jZ,Vd as FZ,Wd as MZ,Xd as LZ,Yd as NZ,Zd as DZ,_d as HZ,ae as xZ,be as OZ,ce as SZ,he as RZ}from"../chunk-attv9byj.js";import{ie as eZ,je as W9}from"../chunk-r5cddkyc.js";import"../chunk-q19cs1qf.js";import{$f as v8,$g as WZ,Af as M8,Bf as L8,Ce as M6,Cf as N8,De as H4,Df as D8,Ee as r0,Ef as H8,Fe as U4,Ge as x4,Gf as U8,Gg as t8,Hf as x6,If as x8,Ke as k5,Kg as r8,Le as f5,Me as C5,Mf as O8,Ne as V5,Nf as S8,Oe as T5,Of as _8,Og as A4,Pe as P5,Pg as E1,Qe as b5,Re as w5,Rf as k8,Se as q5,Sf as f8,Te as l0,Tf as C8,Ue as v5,Uf as V8,Ve as I5,We as y5,Wf as T8,Xe as A5,Xf as P8,Ye as h5,Yf as b8,Zf as w8,_f as q8,_g as e8,ag as I8,bg as y8,cg as A8,dg as h8,ig as U,jg as m,kg as g8,lf as n5,lg as E8,mf as i5,mg as m8,nf as s5,ng as c8,of as o5,og as u8,pf as a5,qf as t5,qg as p8,rg as d8,sg as l8,te as F6,tg as n8,ue as O5,ug as i8,ve as S5,we as R5,wf as X8,xf as B8,xg as s8,ye as _5,yf as j8,yg as o8,zf as F8,zg as a8}from"../chunk-8bp5s118.js";import"../chunk-1p7p76er.js";import"../chunk-fg1mpyp9.js";import{Ji as jW,Ki as FW,Ni as p5,Oi as d5,Qi as l5,Si as I1,Th as D4,Uh as M4,Vh as D1,gi as C4,ki as $1,mi as a,qi as L4,ri as H1,si as v1,ti as g5,ui as E5,vi as m5,wi as c5,xi as u5}from"../chunk-4xpcx3ws.js";import"../chunk-6s6cek6k.js";import{aj as V}from"../chunk-2tfafjmk.js";import{ij as Q8,jj as Y8,kj as w1,lj as K8,mj as m0,nj as z8,oj as G8}from"../chunk-q9b0ndf0.js";import{uj as Z8,vj as $8,wj as J8}from"../chunk-80cwastb.js";import"../chunk-88508q02.js";import{dk as R8}from"../chunk-74n9paen.js";import{fk as r5,gk as e5,hk as W8}from"../chunk-ktgmrjj3.js";import"../chunk-n1b6r6s9.js";import"../chunk-24vv42t6.js";import"../chunk-kzny5cj2.js";import"../chunk-m8y3y6sw.js";import{$k as JZ,Zk as ZZ,_k as $Z,al as QZ,cl as YZ}from"../chunk-jsbq8qq0.js";import"../chunk-4zwnmk3c.js";import{ml as C}from"../chunk-edj701p0.js";import"../chunk-sbhpdhwc.js";import"../chunk-vqrqzfyw.js";import"../chunk-yp4rbknt.js";import"../chunk-mx4z8c6r.js";import"../chunk-scscdtd6.js";import{Nl as i0}from"../chunk-jmgjhfya.js";import{Buffer as n0}from"buffer";class s0 extends H1{client;config;constructor(...W){super();this.config=W}async connect(){let W=await import("../chunk-zck41hz4.js");return this.client??=new W.S3Client(...this.config),{sdk:W,client:this.client}}async put(W,{signal:Z}={}){Z?.throwIfAborted();let $,J,Q,Y=process.env.BUCKET_NAME;if(W instanceof Blob)$=W,Q=`${Bun.randomUUIDv7()}.${W.type.split("/")[1].split(";")[0]}`,J=W.type;else $=W.body,Q=W.name,Y=W.bucket??Y,J=W.contentType||($ instanceof Blob||$ instanceof File?$.type:void 0);J=J||void 0;let K=$ instanceof n0?$:$ instanceof Blob||$ instanceof File?n0.from(await $.arrayBuffer()):"",{sdk:z,client:G}=await this.connect();return Z?.throwIfAborted(),await G.send(new z.PutObjectCommand({Bucket:Y,Key:Q,Body:K,ContentType:J}),{abortSignal:Z}),Q}async delete(W){let Z=typeof W==="string"?W:W.name,$=(typeof W==="string"?void 0:W.bucket)??process.env.BUCKET_NAME;if(!Z)throw Error("Object name has to be specified");let{sdk:J,client:Q}=await this.connect();try{await Q.send(new J.DeleteObjectCommand({Bucket:$,Key:Z}))}catch(Y){if(Y?.name==="NoSuchKey"||Y?.$metadata?.httpStatusCode===404)return;throw Y}}async*pages(W,{bucket:Z,signal:$}){let{sdk:J,client:Q}=await this.connect(),Y;do{$?.throwIfAborted();let K=await Q.send(new J.ListObjectsV2Command({Bucket:Z??process.env.BUCKET_NAME,Prefix:W,ContinuationToken:Y}),{abortSignal:$});yield(K.Contents??[]).map((z)=>({name:z.Key,size:z.Size??0,lastModified:z.LastModified??new Date(0)})),Y=K.IsTruncated?K.NextContinuationToken:void 0}while(Y)}async*objects(W,Z={}){for await(let $ of this.pages(W,Z))yield*$}async deletePrefix(W,Z={}){L4(W);let $=Z.bucket??process.env.BUCKET_NAME,{sdk:J,client:Q}=await this.connect(),Y=0;for await(let K of this.pages(W,{...Z,bucket:$})){if(K.length===0)continue;Z.signal?.throwIfAborted();let G=(await Q.send(new J.DeleteObjectsCommand({Bucket:$,Delete:{Objects:K.map((X)=>({Key:X.name})),Quiet:!0}}),{abortSignal:Z.signal}))?.Errors??[];if(G.length>0){let X=G[0];throw Error(`S3 could not delete ${G.length} object(s) under "${W}", e.g. "${X.Key}": ${X.Code??"unknown"} ${X.Message??""}`.trim())}Y+=K.length}return Y}async list(W){let{sdk:Z,client:$}=await this.connect();return await $.send(new Z.ListObjectsV2Command({Bucket:process.env.BUCKET_NAME,Prefix:W}))}async fetch(W,{signal:Z}={}){Z?.throwIfAborted();let $=process.env.BUCKET_NAME,J;if(typeof W==="string")J=W;else $=W.bucket??$,J=W.name;if(!J)throw Error("Object name has to be specified");let{sdk:Q,client:Y}=await this.connect();Z?.throwIfAborted();let K=await Y.send(new Q.GetObjectCommand({Bucket:$,Key:J}),{abortSignal:Z}),z=v1(K.Body.transformToWebStream(),Z);return Z?.throwIfAborted(),new Response(z,{headers:{"Content-Type":K.ContentType,"Content-Length":K.ContentLength.toString(),"Cache-Control":"private, max-age=12000, must-revalidate","Last-Modified":K.LastModified?.toUTCString()||"",ETag:K.ETag||""}})}async read(W){let Z=typeof W==="string"?{name:W}:W,$=Z.bucket??process.env.BUCKET_NAME,{name:J,range:Q=null}=Z;if(!J)throw Error("Object name has to be specified");let{sdk:Y,client:K}=await this.connect(),z;try{z=await K.send(new Y.GetObjectCommand({Bucket:$,Key:J,Range:Q?M4(Q):void 0}))}catch(j){if(j?.name==="InvalidRange"||j?.$metadata?.httpStatusCode===416)throw new $1(await this.size({name:J,bucket:$}));if(j?.name==="NoSuchKey"||j?.$metadata?.httpStatusCode===404)throw new a(J);throw j}let G=D1(z.ContentRange),X=Boolean(G)&&z.$metadata?.httpStatusCode===206,B=G?.total??z.ContentLength??0;return{body:z.Body.transformToWebStream(),start:G?.start??0,end:G?.end??B-1,total:B,partial:X,type:z.ContentType??"application/octet-stream",etag:z.ETag||void 0,lastModified:z.LastModified,name:J}}async size(W){let Z=typeof W==="string"?W:W.name,$=(typeof W==="string"?void 0:W.bucket)??process.env.BUCKET_NAME,{sdk:J,client:Q}=await this.connect();try{return(await Q.send(new J.HeadObjectCommand({Bucket:$,Key:Z}))).ContentLength??0}catch(Y){if(Y?.name==="NotFound"||Y?.$metadata?.httpStatusCode===404)throw new a(Z);throw Y}}}import{Buffer as o0}from"buffer";import{Readable as NW}from"stream";function N4(W){return W?.statusCode===404||W?.details?.errorCode==="BlobNotFound"||W?.code==="BlobNotFound"}function DW(W){return W?.statusCode===416||W?.details?.errorCode==="InvalidRange"||W?.code==="InvalidRange"}class a0 extends H1{config;serviceClientPromise=null;constructor(W={}){super();this.config=W}async serviceClient(){if(this.config.serviceClient)return this.config.serviceClient;return this.serviceClientPromise??=(async()=>{let W;try{W=await import("@azure/storage-blob")}catch{throw Error("AzureBlobDriver requires the '@azure/storage-blob' package. Install it with `bun add @azure/storage-blob`, or pass a pre-built `serviceClient`.")}let Z=this.config.connectionString??process.env.AZURE_STORAGE_CONNECTION_STRING;if(this.config.url)return new W.BlobServiceClient(this.config.url,this.config.credential);if(Z)return W.BlobServiceClient.fromConnectionString(Z);throw Error("AzureBlobDriver needs a connection string (AZURE_STORAGE_CONNECTION_STRING), a `url`, or a `serviceClient`.")})(),this.serviceClientPromise}async blob(W,Z){if(!W)throw Error("Object name has to be specified");let $=Z??this.config.container??process.env.BUCKET_NAME;if(!$)throw Error("AzureBlobDriver needs a container name, from `bucket`, the `container` config, or BUCKET_NAME.");return(await this.serviceClient()).getContainerClient($).getBlockBlobClient(W)}async put(W,{signal:Z}={}){Z?.throwIfAborted();let $,J,Q,Y;if(W instanceof Blob)$=W,Q=`${Bun.randomUUIDv7()}.${W.type.split("/")[1].split(";")[0]}`,J=W.type;else $=W.body,Q=W.name,Y=W.bucket,J=W.contentType??($ instanceof Blob||$ instanceof File?$.type:void 0);let K=$ instanceof o0?$:o0.from(await $.arrayBuffer()),z=await this.blob(Q,Y);return Z?.throwIfAborted(),await z.uploadData(K,{blobHTTPHeaders:J?{blobContentType:J}:void 0,abortSignal:Z}),Q}async*objects(W,{bucket:Z,signal:$}={}){$?.throwIfAborted();let J=Z??this.config.container??process.env.BUCKET_NAME;if(!J)throw Error("AzureBlobDriver needs a container name, from `bucket`, the `container` config, or BUCKET_NAME.");let Y=(await this.serviceClient()).getContainerClient(J);for await(let K of Y.listBlobsFlat({prefix:W}))$?.throwIfAborted(),yield{name:K.name,size:K.properties?.contentLength??0,lastModified:K.properties?.lastModified??new Date(0)}}async list(W){let Z=this.config.container??process.env.BUCKET_NAME,J=(await this.serviceClient()).getContainerClient(Z),Q=[];for await(let Y of J.listBlobsFlat({prefix:W}))Q.push(Y.name);return Q}async fetch(W,{signal:Z}={}){Z?.throwIfAborted();let $=await this.download(typeof W==="string"?{name:W}:{name:W.name,bucket:W.bucket},Z);return new Response($.body,{headers:{"Content-Type":$.type,"Content-Length":String($.total),"Cache-Control":"private, max-age=12000, must-revalidate","Last-Modified":$.lastModified?.toUTCString()??"",ETag:$.etag??""}})}async read(W){return this.download(typeof W==="string"?{name:W}:W)}async download(W,Z){let{name:$,bucket:J,range:Q=null}=W,Y=await this.blob($,J);Z?.throwIfAborted();let K,z,G=Q?.kind==="suffix"||Q?.kind==="offset"&&Q.end===null&&Q.start===0;if(Q&&G){let S=await this.size({name:$,bucket:J}),o=D4(Q,S);if(!o)throw new $1(S);K=o.start,z=o.length}else if(Q?.kind==="offset")K=Q.start,z=Q.end===null?void 0:Q.end-Q.start+1;let X;try{X=await Y.download(K,z,Z?{abortSignal:Z}:void 0)}catch(S){if(DW(S))throw new $1(await this.size({name:$,bucket:J}));if(N4(S))throw new a($);throw S}let B=D1(X.contentRange),j=Boolean(B),L=B?.total??X.contentLength??0,H=await HW(X);if(H instanceof ReadableStream)H=v1(H,Z);return Z?.throwIfAborted(),{body:H,start:B?.start??0,end:B?.end??L-1,total:L,partial:j,type:X.contentType??"application/octet-stream",etag:X.etag||void 0,lastModified:X.lastModified,name:$}}async size(W){let Z=typeof W==="string"?W:W.name,$=typeof W==="string"?void 0:W.bucket,J=await this.blob(Z,$);try{return(await J.getProperties()).contentLength??0}catch(Q){if(N4(Q))throw new a(Z);throw Q}}async delete(W){let Z=typeof W==="string"?W:W.name,$=typeof W==="string"?void 0:W.bucket,J=await this.blob(Z,$);try{await J.delete()}catch(Q){if(N4(Q))return;throw Q}}}async function HW(W){if(W.blobBody)return await W.blobBody;if(W.readableStreamBody)return NW.toWeb(W.readableStreamBody);return null}function UW(W){return W}class O4 extends Error{code="ERR_RATE_LIMITER_TIMEOUT";constructor(W){super(`RedisRateLimiter: Redis did not answer within ${W}ms.`);this.name="RedisRateLimiterTimeoutError"}}class y1 extends Error{code="ERR_RATE_LIMITER_DISCONNECTED";constructor(){super("RedisRateLimiter: the Redis client is not connected.");this.name="RedisRateLimiterDisconnectedError"}}var t0=1000,xW=60000,OW=`
|
|
3
3
|
local currentKey = KEYS[1]
|
|
4
4
|
local previousKey = KEYS[2]
|
|
5
5
|
local limit = tonumber(ARGV[1])
|
|
@@ -67,6 +67,6 @@ ${W.resolution}.`;console.warn($),console.warn("To disable this message, import
|
|
|
67
67
|
`)return this.emit(F.DataKeepAlive);this.parser.push(Z.toString())}),this.resetKeepAliveTimeout()}initEventsFromParser(){let W=this.requestData.payloadIsError;this.parser.on(W1.ParsedData,(Z)=>{if(W&&W(Z))this.emit(F.DataError,Z),this.emit(F.Error,{type:F.DataError,error:Z,message:"Twitter sent a payload that is detected as an error payload."});else this.emit(F.Data,Z)}),this.parser.on(W1.ParseError,(Z)=>{this.emit(F.TweetParseError,Z),this.emit(F.Error,{type:F.TweetParseError,error:Z,message:"Failed to parse stream data."})})}resetKeepAliveTimeout(){if(this.unbindKeepAliveTimeout(),this.keepAliveTimeoutMs!==1/0)this.keepAliveTimeout=setTimeout(this.onKeepAliveTimeout,this.keepAliveTimeoutMs)}onKeepAliveTimeout(){this.emit(F.ConnectionLost),this.onConnectionError()}unbindTimeouts(){this.unbindRetryTimeout(),this.unbindKeepAliveTimeout()}unbindKeepAliveTimeout(){if(this.keepAliveTimeout)clearTimeout(this.keepAliveTimeout),this.keepAliveTimeout=void 0}unbindRetryTimeout(){if(this.retryTimeout)clearTimeout(this.retryTimeout),this.retryTimeout=void 0}closeWithoutEmit(){if(this.unbindTimeouts(),this.res)this.res.removeAllListeners(),this.res.destroy();if(this.req)this.req.removeAllListeners(),this.req.destroy()}close(){this.emit(F.ConnectionClosed),this.closeWithoutEmit()}destroy(){this.removeAllListeners(),this.close()}async clone(){let Z=await new V1(this.requestData).makeRequestAsStream(),$=this.eventNames();for(let J of $){let Q=this.listeners(J);for(let Y of Q)Z.on(J,Y)}return Z}async connect(W={}){if(typeof W.autoReconnect<"u")this.autoReconnect=W.autoReconnect;if(typeof W.autoReconnectRetries<"u")this.autoReconnectRetries=W.autoReconnectRetries==="unlimited"?1/0:W.autoReconnectRetries;if(typeof W.keepAliveTimeout<"u")this.keepAliveTimeoutMs=W.keepAliveTimeout==="disable"?1/0:W.keepAliveTimeout;if(typeof W.nextRetryTimeout<"u")this.nextRetryTimeout=W.nextRetryTimeout;this.unbindTimeouts();try{await this.reconnect()}catch(Z){if(this.emit(F.ConnectError,0),this.emit(F.Error,{type:F.ConnectError,error:Z,message:"Connect error - Initial connection just failed."}),this.autoReconnect)this.makeAutoReconnectRetry(0,Z);else throw Z}return this}async reconnect(){if(this.connectionProcessRunning)throw Error("Connection process is already running.");this.connectionProcessRunning=!0;try{let W=!0;if(this.req)W=!1,this.closeWithoutEmit();let{req:Z,res:$,originalResponse:J}=await new V1(this.requestData).makeRequestAndResolveWhenReady();this.req=Z,this.res=$,this.originalResponse=J,this.emit(W?F.Connected:F.Reconnected),this.parser.reset(),this.initEventsFromRequest()}finally{this.connectionProcessRunning=!1}}async onConnectionError(W=0){if(this.unbindTimeouts(),this.closeWithoutEmit(),!this.autoReconnect){this.emit(F.ConnectionClosed);return}if(W>=this.autoReconnectRetries){this.emit(F.ReconnectLimitExceeded),this.emit(F.ConnectionClosed);return}try{this.emit(F.ReconnectAttempt,W),await this.reconnect()}catch(Z){this.emit(F.ReconnectError,W),this.emit(F.Error,{type:F.ReconnectError,error:Z,message:`Reconnect error - ${W+1} attempts made yet.`}),this.makeAutoReconnectRetry(W,Z)}}makeAutoReconnectRetry(W,Z){let $=this.nextRetryTimeout(W+1,Z);this.retryTimeout=setTimeout(()=>{this.onConnectionError(W+1)},$)}async*[Symbol.asyncIterator](){let W=new q6(this);try{while(!0){if(!this.req||this.req.aborted)throw Error("Connection closed");if(W.hasStack())yield*W.popStack();let{type:Z,payload:$}=await W.nextEvent();if(Z==="error")throw $}}finally{W.destroy()}}}var i1=I6;function y6(W){var Z;if(!((Z=W.clientSettings.plugins)===null||Z===void 0?void 0:Z.length))return!1;for(let $ of W.clientSettings.plugins)if($.onRequestError||$.onResponseError)return!0;return!1}async function A6(W,Z,$,J){let Q;if(J instanceof R1||J instanceof _1)Q=await this.applyPluginMethod("onRequestError",{client:this,url:this.getUrlObjectFromUrlString(W.url),params:W,computedParams:Z,requestOptions:$,error:J});else if(J instanceof k1)Q=await this.applyPluginMethod("onResponseError",{client:this,url:this.getUrlObjectFromUrlString(W.url),params:W,computedParams:Z,requestOptions:$,error:J});if(Q&&Q instanceof f1)return Q.value;return Promise.reject(J)}import*as E6 from"crypto";class q{constructor(W){this.nonceLength=32,this.consumerKeys=W.consumerKeys}static percentEncode(W){return encodeURIComponent(W).replace(/!/g,"%21").replace(/\*/g,"%2A").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29")}hash(W,Z){return E6.createHmac("sha1",Z).update(W).digest("base64")}authorize(W,Z={}){let $={oauth_consumer_key:this.consumerKeys.key,oauth_nonce:this.getNonce(),oauth_signature_method:"HMAC-SHA1",oauth_timestamp:this.getTimestamp(),oauth_version:"1.0"};if(Z.key!==void 0)$.oauth_token=Z.key;if(!W.data)W.data={};return $.oauth_signature=this.getSignature(W,Z.secret,$),$}toHeader(W){let Z=g6(W),$="OAuth ";for(let J of Z){if(J.key.indexOf("oauth_")!==0)continue;$+=q.percentEncode(J.key)+'="'+q.percentEncode(J.value)+'",'}return{Authorization:$.slice(0,$.length-1)}}getNonce(){let Z="";for(let $=0;$<this.nonceLength;$++)Z+="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[Math.trunc(Math.random()*62)];return Z}getTimestamp(){return Math.trunc(new Date().getTime()/1000)}getSignature(W,Z,$){return this.hash(this.getBaseString(W,$),this.getSigningKey(Z))}getSigningKey(W){return q.percentEncode(this.consumerKeys.secret)+"&"+q.percentEncode(W||"")}getBaseString(W,Z){return W.method.toUpperCase()+"&"+q.percentEncode(this.getBaseUrl(W.url))+"&"+q.percentEncode(this.getParameterString(W,Z))}getParameterString(W,Z){let $=g6(tW(h6(Z,h6(W.data,aW(W.url))))),J="";for(let{key:Q,value:Y}of $)if(Y&&Array.isArray(Y)){Y.sort();let K="";Y.forEach((z,G)=>{if(K+=Q+"="+z,G<Y.length)K+="&"}),J+=K}else J+=Q+"="+Y+"&";return J.slice(0,J.length-1)}getBaseUrl(W){return W.split("?")[0]}}var T1=q;function h6(W,Z){return{...W||{},...Z||{}}}function g6(W){return Object.keys(W).sort().map((Z)=>({key:Z,value:W[Z]}))}function oW(W){let Z=W.split("&"),$={};for(let J of Z){let[Q,Y=""]=J.split("=");if($[Q]){if(!Array.isArray($[Q]))$[Q]=[$[Q]];$[Q].push(decodeURIComponent(Y))}else $[Q]=decodeURIComponent(Y)}return $}function aW(W){let Z=W.split("?");if(Z.length===1)return{};return oW(Z[1])}function tW(W){let Z={};for(let $ in W){let J=W[$];if(J&&Array.isArray(J))J=J.map((Q)=>q.percentEncode(Q));else J=q.percentEncode(J);Z[q.percentEncode($)]=J}return Z}class v{constructor(){this._boundary="",this._chunks=[]}bodyAppend(...W){let Z=W.map(($)=>$ instanceof Buffer?$:Buffer.from($));this._chunks.push(...Z)}append(W,Z,$){let J=Z instanceof Buffer?Z:Z.toString(),Q=this.getMultipartHeader(W,J,$);this.bodyAppend(Q,J,v.LINE_BREAK)}getHeaders(){return{"content-type":"multipart/form-data; boundary="+this.getBoundary()}}getLength(){return this._chunks.reduce((W,Z)=>W+Z.length,this.getMultipartFooter().length)}getBuffer(){let W=[...this._chunks,this.getMultipartFooter()],Z=Buffer.alloc(this.getLength()),$=0;for(let J of W)for(let Q=0;Q<J.length;$++,Q++)Z[$]=J[Q];return Z}getBoundary(){if(!this._boundary)this.generateBoundary();return this._boundary}generateBoundary(){let W="--------------------------";for(let Z=0;Z<24;Z++)W+=Math.floor(Math.random()*10).toString(16);this._boundary=W}getMultipartHeader(W,Z,$){if(!$)$=Z instanceof Buffer?v.DEFAULT_CONTENT_TYPE:"";let J={"Content-Disposition":["form-data",`name="${W}"`],"Content-Type":$},Q="";for(let[Y,K]of Object.entries(J)){if(!K.length)continue;Q+=Y+": "+l1(K).join("; ")+v.LINE_BREAK}return"--"+this.getBoundary()+v.LINE_BREAK+Q+v.LINE_BREAK}getMultipartFooter(){if(this._footerChunk)return this._footerChunk;return this._footerChunk=Buffer.from("--"+this.getBoundary()+"--"+v.LINE_BREAK)}}v.LINE_BREAK=`\r
|
|
68
68
|
`;v.DEFAULT_CONTENT_TYPE="application/octet-stream";class p4{static formatQueryToString(W){let Z={};for(let $ in W)if(typeof W[$]==="string")Z[$]=W[$];else if(typeof W[$]<"u")Z[$]=String(W[$]);return Z}static autoDetectBodyType(W){if(W.pathname.startsWith("/2/")||W.pathname.startsWith("/labs/2/")){if(W.password.startsWith("/2/oauth2"))return"url";return"json"}if(W.hostname==="upload.x.com"){if(W.pathname==="/1.1/media/upload.json")return"form-data";return"json"}let Z=W.pathname.split("/1.1/",2)[1];if(this.JSON_1_1_ENDPOINTS.has(Z))return"json";return"url"}static addQueryParamsToUrl(W,Z){let $=Object.entries(Z);if($.length){let J="";for(let[Q,Y]of $)J+=(J.length?"&":"?")+`${T1.percentEncode(Q)}=${T1.percentEncode(Y)}`;W.search=J}}static constructBodyParams(W,Z,$){if(W instanceof Buffer)return W;if($==="json"){if(!Z["content-type"])Z["content-type"]="application/json;charset=UTF-8";return JSON.stringify(W)}else if($==="url"){if(!Z["content-type"])Z["content-type"]="application/x-www-form-urlencoded;charset=UTF-8";if(Object.keys(W).length)return new URLSearchParams(W).toString().replace(/\*/g,"%2A");return""}else if($==="raw")throw Error("You can only use raw body mode with Buffers. To give a string, use Buffer.from(str).");else{let J=new v;for(let Q in W)J.append(Q,W[Q]);if(!Z["content-type"]){let Q=J.getHeaders();Z["content-type"]=Q["content-type"]}return J.getBuffer()}}static setBodyLengthHeader(W,Z){var $;if(W.headers=($=W.headers)!==null&&$!==void 0?$:{},typeof Z==="string")W.headers["content-length"]=Buffer.byteLength(Z);else W.headers["content-length"]=Z.length}static isOAuthSerializable(W){return!(W instanceof Buffer)}static mergeQueryAndBodyForOAuth(W,Z){let $={};for(let J in W)$[J]=W[J];if(this.isOAuthSerializable(Z))for(let J in Z){let Q=Z[J];if(this.isOAuthSerializable(Q))$[J]=typeof Q==="object"&&Q!==null&&"toString"in Q?Q.toString():Q}return $}static moveUrlQueryParamsIntoObject(W,Z){for(let[$,J]of W.searchParams)Z[$]=J;return W.search="",W}static applyRequestParametersToUrl(W,Z){return W.pathname=W.pathname.replace(/:([A-Z_-]+)/ig,($,J)=>{if(Z[J]!==void 0)return String(Z[J]);return $}),W}}p4.JSON_1_1_ENDPOINTS=new Set(["direct_messages/events/new.json","direct_messages/welcome_messages/new.json","direct_messages/welcome_messages/rules/new.json","media/metadata/create.json","collections/entries/curate.json"]);var T=p4;import*as m6 from"crypto";class Z1{static getCodeVerifier(){return this.generateRandomString(128)}static getCodeChallengeFromVerifier(W){return this.escapeBase64Url(m6.createHash("sha256").update(W).digest("base64"))}static getAuthHeader(W,Z){let $=encodeURIComponent(W)+":"+encodeURIComponent(Z);return Buffer.from($).toString("base64")}static generateRandomString(W){let Z="",$="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~";for(let J=0;J<W;J++)Z+=$[Math.floor(Math.random()*$.length)];return Z}static escapeBase64Url(W){return W.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}}class z1{constructor(W){if(this.rateLimits={},this.clientSettings={},W)this.clientSettings=W}getRateLimits(){return this.rateLimits}saveRateLimit(W,Z){this.rateLimits[W]=Z}async send(W){var Z,$,J,Q,Y;if((Z=this.clientSettings.plugins)===null||Z===void 0?void 0:Z.length){let j=await this.applyPreRequestConfigHooks(W);if(j)return j}let K=this.getHttpRequestArgs(W),z={method:K.method,headers:K.headers,timeout:W.timeout,agent:this.clientSettings.httpAgent},G=W.enableRateLimitSave!==!1;if(K.body)T.setBodyLengthHeader(z,K.body);if(($=this.clientSettings.plugins)===null||$===void 0?void 0:$.length)await this.applyPreRequestHooks(W,K,z);let X=new V1({url:K.url,options:z,body:K.body,rateLimitSaver:G?this.saveRateLimit.bind(this,K.rawUrl):void 0,requestEventDebugHandler:W.requestEventDebugHandler,compression:(Q=(J=W.compression)!==null&&J!==void 0?J:this.clientSettings.compression)!==null&&Q!==void 0?Q:!0,forceParseMode:W.forceParseMode}).makeRequest();if(y6(this))X=this.applyResponseErrorHooks(W,K,z,X);let B=await X;if((Y=this.clientSettings.plugins)===null||Y===void 0?void 0:Y.length){let j=await this.applyPostRequestHooks(W,K,z,B);if(j)return j.value}return B}sendStream(W){var Z,$;if(this.clientSettings.plugins)this.applyPreStreamRequestConfigHooks(W);let J=this.getHttpRequestArgs(W),Q={method:J.method,headers:J.headers,agent:this.clientSettings.httpAgent},Y=W.enableRateLimitSave!==!1,K=W.autoConnect!==!1;if(J.body)T.setBodyLengthHeader(Q,J.body);let z={url:J.url,options:Q,body:J.body,rateLimitSaver:Y?this.saveRateLimit.bind(this,J.rawUrl):void 0,payloadIsError:W.payloadIsError,compression:($=(Z=W.compression)!==null&&Z!==void 0?Z:this.clientSettings.compression)!==null&&$!==void 0?$:!0},G=new i1(z);if(!K)return G;return G.connect()}initializeToken(W){if(typeof W==="string")this.bearerToken=W;else if(typeof W==="object"&&"appKey"in W){if(this.consumerToken=W.appKey,this.consumerSecret=W.appSecret,W.accessToken&&W.accessSecret)this.accessToken=W.accessToken,this.accessSecret=W.accessSecret;this._oauth=this.buildOAuth()}else if(typeof W==="object"&&"username"in W){let Z=encodeURIComponent(W.username)+":"+encodeURIComponent(W.password);this.basicToken=Buffer.from(Z).toString("base64")}else if(typeof W==="object"&&"clientId"in W)this.clientId=W.clientId,this.clientSecret=W.clientSecret}getActiveTokens(){if(this.bearerToken)return{type:"oauth2",bearerToken:this.bearerToken};else if(this.basicToken)return{type:"basic",token:this.basicToken};else if(this.consumerSecret&&this._oauth)return{type:"oauth-1.0a",appKey:this.consumerToken,appSecret:this.consumerSecret,accessToken:this.accessToken,accessSecret:this.accessSecret};else if(this.clientId)return{type:"oauth2-user",clientId:this.clientId};return{type:"none"}}buildOAuth(){if(!this.consumerSecret||!this.consumerToken)throw Error("Invalid consumer tokens");return new T1({consumerKeys:{key:this.consumerToken,secret:this.consumerSecret}})}getOAuthAccessTokens(){if(!this.accessSecret||!this.accessToken)return;return{key:this.accessToken,secret:this.accessSecret}}getPlugins(){var W;return(W=this.clientSettings.plugins)!==null&&W!==void 0?W:[]}hasPlugins(){var W;return!!((W=this.clientSettings.plugins)===null||W===void 0?void 0:W.length)}async applyPluginMethod(W,Z){var $;let J;for(let Q of this.getPlugins()){let Y=await(($=Q[W])===null||$===void 0?void 0:$.call(Q,Z));if(Y&&Y instanceof f1)J=Y}return J}writeAuthHeaders({headers:W,bodyInSignature:Z,url:$,method:J,query:Q,body:Y}){if(W={...W},this.bearerToken)W.Authorization="Bearer "+this.bearerToken;else if(this.basicToken)W.Authorization="Basic "+this.basicToken;else if(this.clientId&&this.clientSecret)W.Authorization="Basic "+Z1.getAuthHeader(this.clientId,this.clientSecret);else if(this.consumerSecret&&this._oauth){let K=Z?T.mergeQueryAndBodyForOAuth(Q,Y):Q,z=this._oauth.authorize({url:$.toString(),method:J,data:K},this.getOAuthAccessTokens());W={...W,...this._oauth.toHeader(z)}}return W}getUrlObjectFromUrlString(W){if(!W.startsWith("http"))W="https://"+W;return new URL(W)}getHttpRequestArgs({url:W,method:Z,query:$={},body:J={},headers:Q,forceBodyMode:Y,enableAuth:K,params:z}){let G=void 0;if(Z=Z.toUpperCase(),Q=Q!==null&&Q!==void 0?Q:{},!Q["x-user-agent"])Q["x-user-agent"]="Node.twitter-api-v2";let X=this.getUrlObjectFromUrlString(W),B=X.origin+X.pathname;if(z)T.applyRequestParametersToUrl(X,z);let j=T.formatQueryToString($);if(T.moveUrlQueryParamsIntoObject(X,j),!(J instanceof Buffer))P6(J);let L=Y!==null&&Y!==void 0?Y:T.autoDetectBodyType(X);if(K!==!1){let H=z1.BODY_METHODS.has(Z)&&L==="url";Q=this.writeAuthHeaders({headers:Q,bodyInSignature:H,method:Z,query:j,url:X,body:J})}if(z1.BODY_METHODS.has(Z))G=T.constructBodyParams(J,Q,L)||void 0;return T.addQueryParamsToUrl(X,j),{rawUrl:B,url:X,method:Z,headers:Q,body:G}}async applyPreRequestConfigHooks(W){var Z;let $=this.getUrlObjectFromUrlString(W.url);for(let J of this.getPlugins()){let Q=await((Z=J.onBeforeRequestConfig)===null||Z===void 0?void 0:Z.call(J,{client:this,url:$,params:W}));if(Q)return Q}}applyPreStreamRequestConfigHooks(W){var Z;let $=this.getUrlObjectFromUrlString(W.url);for(let J of this.getPlugins())(Z=J.onBeforeStreamRequestConfig)===null||Z===void 0||Z.call(J,{client:this,url:$,params:W})}async applyPreRequestHooks(W,Z,$){await this.applyPluginMethod("onBeforeRequest",{client:this,url:this.getUrlObjectFromUrlString(W.url),params:W,computedParams:Z,requestOptions:$})}async applyPostRequestHooks(W,Z,$,J){return await this.applyPluginMethod("onAfterRequest",{client:this,url:this.getUrlObjectFromUrlString(W.url),params:W,computedParams:Z,requestOptions:$,response:J})}applyResponseErrorHooks(W,Z,$,J){return J.catch(A6.bind(this,W,Z,$))}}z1.BODY_METHODS=new Set(["POST","PUT","PATCH"]);class i{constructor(W,Z={}){if(this._currentUser=null,this._currentUserV2=null,W instanceof i)this._requestMaker=W._requestMaker;else this._requestMaker=new z1(Z),this._requestMaker.initializeToken(W)}setPrefix(W){this._prefix=W}cloneWithPrefix(W){let Z=this.constructor(this);return Z.setPrefix(W),Z}getActiveTokens(){return this._requestMaker.getActiveTokens()}getPlugins(){return this._requestMaker.getPlugins()}getPluginOfType(W){return this.getPlugins().find((Z)=>Z instanceof W)}hasHitRateLimit(W){var Z;if(this.isRateLimitStatusObsolete(W))return!1;return((Z=this.getLastRateLimitStatus(W))===null||Z===void 0?void 0:Z.remaining)===0}isRateLimitStatusObsolete(W){let Z=this.getLastRateLimitStatus(W);if(Z===void 0)return!0;return Z.reset*1000<Date.now()}getLastRateLimitStatus(W){let Z=W.match(/^https?:\/\//)?W:this._prefix+W;return this._requestMaker.getRateLimits()[Z]}getCurrentUserObject(W=!1){if(!W&&this._currentUser){if(this._currentUser.value)return Promise.resolve(this._currentUser.value);return this._currentUser.promise}return this._currentUser=c4(()=>this.get("account/verify_credentials.json",{tweet_mode:"extended"},{prefix:l})),this._currentUser.promise}getCurrentUserV2Object(W=!1){if(!W&&this._currentUserV2){if(this._currentUserV2.value)return Promise.resolve(this._currentUserV2.value);return this._currentUserV2.promise}return this._currentUserV2=c4(()=>this.get("users/me",void 0,{prefix:d})),this._currentUserV2.promise}async get(W,Z={},{fullResponse:$,prefix:J=this._prefix,...Q}={}){if(J)W=J+W;let Y=await this._requestMaker.send({url:W,method:"GET",query:Z,...Q});return $?Y:Y.data}async delete(W,Z={},{fullResponse:$,prefix:J=this._prefix,...Q}={}){if(J)W=J+W;let Y=await this._requestMaker.send({url:W,method:"DELETE",query:Z,...Q});return $?Y:Y.data}async post(W,Z,{fullResponse:$,prefix:J=this._prefix,...Q}={}){if(J)W=J+W;let Y=await this._requestMaker.send({url:W,method:"POST",body:Z,...Q});return $?Y:Y.data}async put(W,Z,{fullResponse:$,prefix:J=this._prefix,...Q}={}){if(J)W=J+W;let Y=await this._requestMaker.send({url:W,method:"PUT",body:Z,...Q});return $?Y:Y.data}async patch(W,Z,{fullResponse:$,prefix:J=this._prefix,...Q}={}){if(J)W=J+W;let Y=await this._requestMaker.send({url:W,method:"PATCH",body:Z,...Q});return $?Y:Y.data}getStream(W,Z,{prefix:$=this._prefix,...J}={}){return this._requestMaker.sendStream({url:$?$+W:W,method:"GET",query:Z,...J})}postStream(W,Z,{prefix:$=this._prefix,...J}={}){return this._requestMaker.sendStream({url:$?$+W:W,method:"POST",body:Z,...J})}}class P extends i{constructor(W){if(!(W instanceof i))throw Error("You must instance SubTwitterApi instance from existing TwitterApi instance.");super(W)}}class G1 extends K1{constructor(){super(...arguments);this.hasFinishedFetch=!1}refreshInstanceFromResult(W,Z){let $=W.data;if(this._rateLimit=W.rateLimit,Z)this._realData.push(...$),this.hasFinishedFetch=$.length===0}getNextQueryParams(W){let Z=BigInt(this._realData[this._realData.length-1].id_str);return{...this.injectQueryParams(W),max_id:(Z-BigInt(1)).toString()}}getPageLengthFromRequest(W){return W.data.length}isFetchLastOver(W){return!W.data.length}canFetchNextPage(W){return W.length>0}getItemArray(){return this.tweets}get tweets(){return this._realData}get done(){return super.done||this.hasFinishedFetch}}class d4 extends G1{constructor(){super(...arguments);this._endpoint="statuses/home_timeline.json"}}class l4 extends G1{constructor(){super(...arguments);this._endpoint="statuses/mentions_timeline.json"}}class o1 extends G1{constructor(){super(...arguments);this._endpoint="statuses/user_timeline.json"}}class n4 extends G1{constructor(){super(...arguments);this._endpoint="lists/statuses.json"}}class a1 extends G1{constructor(){super(...arguments);this._endpoint="favorites/list.json"}}class i4 extends x{constructor(){super(...arguments);this._endpoint="mutes/users/list.json"}refreshInstanceFromResult(W,Z){let $=W.data;if(this._rateLimit=W.rateLimit,Z)this._realData.users.push(...$.users),this._realData.next_cursor=$.next_cursor}getPageLengthFromRequest(W){return W.data.users.length}getItemArray(){return this.users}get users(){return this._realData.users}}class s4 extends x{constructor(){super(...arguments);this._endpoint="mutes/users/ids.json",this._maxResultsWhenFetchLast=5000}refreshInstanceFromResult(W,Z){let $=W.data;if(this._rateLimit=W.rateLimit,Z)this._realData.ids.push(...$.ids),this._realData.next_cursor=$.next_cursor}getPageLengthFromRequest(W){return W.data.ids.length}getItemArray(){return this.ids}get ids(){return this._realData.ids}}class o4 extends x{constructor(){super(...arguments);this._endpoint="followers/list.json"}refreshInstanceFromResult(W,Z){let $=W.data;if(this._rateLimit=W.rateLimit,Z)this._realData.users.push(...$.users),this._realData.next_cursor=$.next_cursor}getPageLengthFromRequest(W){return W.data.users.length}getItemArray(){return this.users}get users(){return this._realData.users}}class a4 extends x{constructor(){super(...arguments);this._endpoint="followers/ids.json",this._maxResultsWhenFetchLast=5000}refreshInstanceFromResult(W,Z){let $=W.data;if(this._rateLimit=W.rateLimit,Z)this._realData.ids.push(...$.ids),this._realData.next_cursor=$.next_cursor}getPageLengthFromRequest(W){return W.data.ids.length}getItemArray(){return this.ids}get ids(){return this._realData.ids}}class t4 extends x{constructor(){super(...arguments);this._endpoint="friends/list.json"}refreshInstanceFromResult(W,Z){let $=W.data;if(this._rateLimit=W.rateLimit,Z)this._realData.users.push(...$.users),this._realData.next_cursor=$.next_cursor}getPageLengthFromRequest(W){return W.data.users.length}getItemArray(){return this.users}get users(){return this._realData.users}}class r4 extends x{constructor(){super(...arguments);this._endpoint="friends/ids.json",this._maxResultsWhenFetchLast=5000}refreshInstanceFromResult(W,Z){let $=W.data;if(this._rateLimit=W.rateLimit,Z)this._realData.ids.push(...$.ids),this._realData.next_cursor=$.next_cursor}getPageLengthFromRequest(W){return W.data.ids.length}getItemArray(){return this.ids}get ids(){return this._realData.ids}}class e4 extends K1{constructor(){super(...arguments);this._endpoint="users/search.json"}refreshInstanceFromResult(W,Z){let $=W.data;if(this._rateLimit=W.rateLimit,Z)this._realData.push(...$)}getNextQueryParams(W){var Z;let $=Number((Z=this._queryParams.page)!==null&&Z!==void 0?Z:"1");return{...this._queryParams,page:$+1,...W?{count:W}:{}}}getPageLengthFromRequest(W){return W.data.length}isFetchLastOver(W){return!W.data.length}canFetchNextPage(W){return W.length>0}getItemArray(){return this.users}get users(){return this._realData}}class t1 extends x{constructor(){super(...arguments);this._endpoint="friendships/incoming.json",this._maxResultsWhenFetchLast=5000}refreshInstanceFromResult(W,Z){let $=W.data;if(this._rateLimit=W.rateLimit,Z)this._realData.ids.push(...$.ids),this._realData.next_cursor=$.next_cursor}getPageLengthFromRequest(W){return W.data.ids.length}getItemArray(){return this.ids}get ids(){return this._realData.ids}}class W0 extends t1{constructor(){super(...arguments);this._endpoint="friendships/outgoing.json"}}class r1 extends x{refreshInstanceFromResult(W,Z){let $=W.data;if(this._rateLimit=W.rateLimit,Z)this._realData.lists.push(...$.lists),this._realData.next_cursor=$.next_cursor}getPageLengthFromRequest(W){return W.data.lists.length}getItemArray(){return this.lists}get lists(){return this._realData.lists}}class Z0 extends r1{constructor(){super(...arguments);this._endpoint="lists/memberships.json"}}class $0 extends r1{constructor(){super(...arguments);this._endpoint="lists/ownerships.json"}}class J0 extends r1{constructor(){super(...arguments);this._endpoint="lists/subscriptions.json"}}class Q0 extends x{refreshInstanceFromResult(W,Z){let $=W.data;if(this._rateLimit=W.rateLimit,Z)this._realData.users.push(...$.users),this._realData.next_cursor=$.next_cursor}getPageLengthFromRequest(W){return W.data.users.length}getItemArray(){return this.users}get users(){return this._realData.users}}class Y0 extends Q0{constructor(){super(...arguments);this._endpoint="lists/members.json"}}class K0 extends Q0{constructor(){super(...arguments);this._endpoint="lists/subscribers.json"}}class X1 extends P{constructor(){super(...arguments);this._prefix=l}singleTweet(W,Z={}){return this.get("statuses/show.json",{tweet_mode:"extended",id:W,...Z})}tweets(W,Z={}){return this.post("statuses/lookup.json",{tweet_mode:"extended",id:W,...Z})}oembedTweet(W,Z={}){return this.get("oembed",{url:`https://x.com/i/statuses/${W}`,...Z},{prefix:"https://publish.x.com/"})}async homeTimeline(W={}){let Z={tweet_mode:"extended",...W},$=await this.get("statuses/home_timeline.json",Z,{fullResponse:!0});return new d4({realData:$.data,rateLimit:$.rateLimit,instance:this,queryParams:Z})}async mentionTimeline(W={}){let Z={tweet_mode:"extended",...W},$=await this.get("statuses/mentions_timeline.json",Z,{fullResponse:!0});return new l4({realData:$.data,rateLimit:$.rateLimit,instance:this,queryParams:Z})}async userTimeline(W,Z={}){let $={tweet_mode:"extended",user_id:W,...Z},J=await this.get("statuses/user_timeline.json",$,{fullResponse:!0});return new o1({realData:J.data,rateLimit:J.rateLimit,instance:this,queryParams:$})}async userTimelineByUsername(W,Z={}){let $={tweet_mode:"extended",screen_name:W,...Z},J=await this.get("statuses/user_timeline.json",$,{fullResponse:!0});return new o1({realData:J.data,rateLimit:J.rateLimit,instance:this,queryParams:$})}async favoriteTimeline(W,Z={}){let $={tweet_mode:"extended",user_id:W,...Z},J=await this.get("favorites/list.json",$,{fullResponse:!0});return new a1({realData:J.data,rateLimit:J.rateLimit,instance:this,queryParams:$})}async favoriteTimelineByUsername(W,Z={}){let $={tweet_mode:"extended",screen_name:W,...Z},J=await this.get("favorites/list.json",$,{fullResponse:!0});return new a1({realData:J.data,rateLimit:J.rateLimit,instance:this,queryParams:$})}user(W){return this.get("users/show.json",{tweet_mode:"extended",...W})}users(W){return this.get("users/lookup.json",{tweet_mode:"extended",...W})}verifyCredentials(W={}){return this.get("account/verify_credentials.json",W)}async listMutedUsers(W={}){let Z={tweet_mode:"extended",...W},$=await this.get("mutes/users/list.json",Z,{fullResponse:!0});return new i4({realData:$.data,rateLimit:$.rateLimit,instance:this,queryParams:Z})}async listMutedUserIds(W={}){let Z={stringify_ids:!0,...W},$=await this.get("mutes/users/ids.json",Z,{fullResponse:!0});return new s4({realData:$.data,rateLimit:$.rateLimit,instance:this,queryParams:Z})}async userFriendList(W={}){let Z={...W},$=await this.get("friends/list.json",Z,{fullResponse:!0});return new t4({realData:$.data,rateLimit:$.rateLimit,instance:this,queryParams:Z})}async userFollowerList(W={}){let Z={...W},$=await this.get("followers/list.json",Z,{fullResponse:!0});return new o4({realData:$.data,rateLimit:$.rateLimit,instance:this,queryParams:Z})}async userFollowerIds(W={}){let Z={stringify_ids:!0,...W},$=await this.get("followers/ids.json",Z,{fullResponse:!0});return new a4({realData:$.data,rateLimit:$.rateLimit,instance:this,queryParams:Z})}async userFollowingIds(W={}){let Z={stringify_ids:!0,...W},$=await this.get("friends/ids.json",Z,{fullResponse:!0});return new r4({realData:$.data,rateLimit:$.rateLimit,instance:this,queryParams:Z})}async searchUsers(W,Z={}){let $={q:W,tweet_mode:"extended",page:1,...Z},J=await this.get("users/search.json",$,{fullResponse:!0});return new e4({realData:J.data,rateLimit:J.rateLimit,instance:this,queryParams:$})}friendship(W){return this.get("friendships/show.json",W)}friendships(W){return this.get("friendships/lookup.json",W)}friendshipsNoRetweets(){return this.get("friendships/no_retweets/ids.json",{stringify_ids:!0})}async friendshipsIncoming(W={}){let Z={stringify_ids:!0,...W},$=await this.get("friendships/incoming.json",Z,{fullResponse:!0});return new t1({realData:$.data,rateLimit:$.rateLimit,instance:this,queryParams:Z})}async friendshipsOutgoing(W={}){let Z={stringify_ids:!0,...W},$=await this.get("friendships/outgoing.json",Z,{fullResponse:!0});return new W0({realData:$.data,rateLimit:$.rateLimit,instance:this,queryParams:Z})}accountSettings(){return this.get("account/settings.json")}userProfileBannerSizes(W){return this.get("users/profile_banner.json",W)}list(W){return this.get("lists/show.json",{tweet_mode:"extended",...W})}lists(W={}){return this.get("lists/list.json",{tweet_mode:"extended",...W})}async listMembers(W={}){let Z={tweet_mode:"extended",...W},$=await this.get("lists/members.json",Z,{fullResponse:!0});return new Y0({realData:$.data,rateLimit:$.rateLimit,instance:this,queryParams:Z})}listGetMember(W){return this.get("lists/members/show.json",{tweet_mode:"extended",...W})}async listMemberships(W={}){let Z={tweet_mode:"extended",...W},$=await this.get("lists/memberships.json",Z,{fullResponse:!0});return new Z0({realData:$.data,rateLimit:$.rateLimit,instance:this,queryParams:Z})}async listOwnerships(W={}){let Z={tweet_mode:"extended",...W},$=await this.get("lists/ownerships.json",Z,{fullResponse:!0});return new $0({realData:$.data,rateLimit:$.rateLimit,instance:this,queryParams:Z})}async listStatuses(W){let Z={tweet_mode:"extended",...W},$=await this.get("lists/statuses.json",Z,{fullResponse:!0});return new n4({realData:$.data,rateLimit:$.rateLimit,instance:this,queryParams:Z})}async listSubscribers(W={}){let Z={tweet_mode:"extended",...W},$=await this.get("lists/subscribers.json",Z,{fullResponse:!0});return new K0({realData:$.data,rateLimit:$.rateLimit,instance:this,queryParams:Z})}listGetSubscriber(W){return this.get("lists/subscribers/show.json",{tweet_mode:"extended",...W})}async listSubscriptions(W={}){let Z={tweet_mode:"extended",...W},$=await this.get("lists/subscriptions.json",Z,{fullResponse:!0});return new J0({realData:$.data,rateLimit:$.rateLimit,instance:this,queryParams:Z})}mediaInfo(W){return this.get("media/upload.json",{command:"STATUS",media_id:W},{prefix:c})}filterStream({autoConnect:W,...Z}={}){let $={};for(let[Q,Y]of Object.entries(Z))if(Q==="follow"||Q==="track")$[Q]=Y.toString();else if(Q==="locations"){let K=Y;$.locations=l1(K).map((z)=>`${z.lng},${z.lat}`).join(",")}else $[Q]=Y;return this.stream.postStream("statuses/filter.json",$,{autoConnect:W})}sampleStream({autoConnect:W,...Z}={}){return this.stream.getStream("statuses/sample.json",Z,{autoConnect:W})}get stream(){let W=new e1(this);return W.setPrefix(C6),W}trendsByPlace(W,Z={}){return this.get("trends/place.json",{id:W,...Z})}trendsAvailable(){return this.get("trends/available.json")}trendsClosest(W,Z){return this.get("trends/closest.json",{lat:W,long:Z})}geoPlace(W){return this.get("geo/id/:place_id.json",void 0,{params:{place_id:W}})}geoSearch(W){return this.get("geo/search.json",W)}geoReverseGeoCode(W){return this.get("geo/reverse_geocode.json",W)}rateLimitStatuses(...W){return this.get("application/rate_limit_status.json",{resources:W})}supportedLanguages(){return this.get("help/languages.json")}}import*as s from"fs";async function z0(W){let Z=await G0(W);if(typeof Z==="number")return new Promise(($,J)=>{s.readFile(Z,(Q,Y)=>{if(Q)return J(Q);$(Y)})});else if(Z instanceof Buffer)return Z;else return Z.readFile()}function G0(W){if(typeof W==="string")return s.promises.open(W,"r");else if(typeof W==="number")return W;else if(typeof W==="object"&&!(W instanceof Buffer))return W;else if(!(W instanceof Buffer))throw Error("Given file is not valid, please check its type.");else return W}async function c6(W){if(typeof W==="number")return(await new Promise(($,J)=>{s.fstat(W,(Q,Y)=>{if(Q)J(Q);$(Y)})})).size;else if(W instanceof Buffer)return W.length;else return(await W.stat()).size}function u6(W,Z,$){if(typeof $==="string")return $;else if(typeof W==="string"&&!Z)return rW(W);else if(typeof Z==="string")return eW(Z);throw Error("You must specify type if file is a file handle or Buffer.")}function rW(W){if(W.endsWith(".jpeg")||W.endsWith(".jpg"))return D.Jpeg;if(W.endsWith(".png"))return D.Png;if(W.endsWith(".webp"))return D.Webp;if(W.endsWith(".gif"))return D.Gif;if(W.endsWith(".mpeg4")||W.endsWith(".mp4"))return D.Mp4;if(W.endsWith(".mov")||W.endsWith(".mov"))return D.Mov;if(W.endsWith(".srt"))return D.Srt;return u4({instance:"TwitterApiv1ReadWrite",method:"uploadMedia",problem:"options.mimeType is missing and filename couldn't help to resolve MIME type, so it will fallback to image/jpeg",resolution:"If you except to give filenames without extensions, please specify explicitlty the MIME type using options.mimeType"}),D.Jpeg}function eW(W){if(u4({instance:"TwitterApiv1ReadWrite",method:"uploadMedia",problem:"you're using options.type",resolution:"Remove options.type argument and migrate to options.mimeType which takes the real MIME type. If you're using type=longmp4, add options.longVideo alongside of mimeType=EUploadMimeType.Mp4"}),W==="gif")return D.Gif;if(W==="jpg")return D.Jpeg;if(W==="png")return D.Png;if(W==="webp")return D.Webp;if(W==="srt")return D.Srt;if(W==="mp4"||W==="longmp4")return D.Mp4;if(W==="mov")return D.Mov;return W}function p6(W,Z){if(W===D.Mp4||W===D.Mov)return Z==="tweet"?"TweetVideo":"DmVideo";if(W===D.Gif)return Z==="tweet"?"TweetGif":"DmGif";if(W===D.Srt)return"Subtitles";else return Z==="tweet"?"TweetImage":"DmImage"}function X0(W){return new Promise((Z)=>setTimeout(Z,W*1000))}async function B0(W,Z,$=0,J){if(W instanceof Buffer){let Y=W.slice($,$+Z);return[Y,Y.length]}if(!J)throw Error("Well, we will need a buffer to store file content.");let Q;if(typeof W==="number")Q=await new Promise((Y,K)=>{s.read(W,J,0,Z,$,(z,G)=>{if(z)K(z);Y(G)})});else Q=(await W.read(J,0,Z,$)).bytesRead;return[J,Q]}var j0="media/upload.json";class B1 extends X1{constructor(){super(...arguments);this._prefix=l}get readOnly(){return this}tweet(W,Z={}){let $={status:W,tweet_mode:"extended",...Z};return this.post("statuses/update.json",$)}async quote(W,Z,$={}){let J="https://x.com/i/statuses/"+Z;return this.tweet(W,{...$,attachment_url:J})}async tweetThread(W){let Z=[];for(let $ of W){let J=Z.length?Z[Z.length-1]:null,Q={...typeof $==="string"?{status:$}:$},Y=J?J.id_str:Q.in_reply_to_status_id,K=Q.status;if(Y)Z.push(await this.reply(K,Y,Q));else Z.push(await this.tweet(K,Q))}return Z}reply(W,Z,$={}){return this.tweet(W,{auto_populate_reply_metadata:!0,in_reply_to_status_id:Z,...$})}deleteTweet(W){return this.post("statuses/destroy/:id.json",{tweet_mode:"extended"},{params:{id:W}})}reportUserAsSpam(W){return this.post("users/report_spam.json",{tweet_mode:"extended",...W})}updateFriendship(W){return this.post("friendships/update.json",W)}createFriendship(W){return this.post("friendships/create.json",W)}destroyFriendship(W){return this.post("friendships/destroy.json",W)}updateAccountSettings(W){return this.post("account/settings.json",W)}updateAccountProfile(W){return this.post("account/update_profile.json",W)}async updateAccountProfileBanner(W,Z={}){let $={banner:await z0(W),...Z};return this.post("account/update_profile_banner.json",$,{forceBodyMode:"form-data"})}async updateAccountProfileImage(W,Z={}){let $={tweet_mode:"extended",image:await z0(W),...Z};return this.post("account/update_profile_image.json",$,{forceBodyMode:"form-data"})}removeAccountProfileBanner(){return this.post("account/remove_profile_banner.json")}createList(W){return this.post("lists/create.json",{tweet_mode:"extended",...W})}updateList(W){return this.post("lists/update.json",{tweet_mode:"extended",...W})}removeList(W){return this.post("lists/destroy.json",{tweet_mode:"extended",...W})}addListMembers(W){let $=W.user_id&&C1(W.user_id)||W.screen_name&&C1(W.screen_name)?"lists/members/create_all.json":"lists/members/create.json";return this.post($,W)}removeListMembers(W){let $=W.user_id&&C1(W.user_id)||W.screen_name&&C1(W.screen_name)?"lists/members/destroy_all.json":"lists/members/destroy.json";return this.post($,W)}subscribeToList(W){return this.post("lists/subscribers/create.json",{tweet_mode:"extended",...W})}unsubscribeOfList(W){return this.post("lists/subscribers/destroy.json",{tweet_mode:"extended",...W})}createMediaMetadata(W,Z){return this.post("media/metadata/create.json",{media_id:W,...Z},{prefix:c,forceBodyMode:"json"})}createMediaSubtitles(W,Z){return this.post("media/subtitles/create.json",{media_id:W,media_category:"TweetVideo",subtitle_info:{subtitles:Z}},{prefix:c,forceBodyMode:"json"})}deleteMediaSubtitles(W,...Z){return this.post("media/subtitles/delete.json",{media_id:W,media_category:"TweetVideo",subtitle_info:{subtitles:Z.map(($)=>({language_code:$}))}},{prefix:c,forceBodyMode:"json"})}async uploadMedia(W,Z={},$=!1){var J;let Q=(J=Z.chunkLength)!==null&&J!==void 0?J:1048576,{fileHandle:Y,mediaCategory:K,fileSize:z,mimeType:G}=await this.getUploadMediaRequirements(W,Z);try{let X=await this.post(j0,{command:"INIT",total_bytes:z,media_type:G,media_category:K,additional_owners:Z.additionalOwners,shared:Z.shared?!0:void 0},{prefix:c});await this.mediaChunkedUpload(Y,Q,X.media_id_string,Z.maxConcurrentUploads);let B=await this.post(j0,{command:"FINALIZE",media_id:X.media_id_string},{prefix:c});if(B.processing_info&&B.processing_info.state!=="succeeded")await this.awaitForMediaProcessingCompletion(B);if($)return B;else return B.media_id_string}finally{if(typeof W==="number")F0.close(W,()=>{});else if(typeof Y==="object"&&!(Y instanceof Buffer))Y.close()}}async awaitForMediaProcessingCompletion(W){var Z;while(!0){W=await this.mediaInfo(W.media_id_string);let{processing_info:$}=W;if(!$||$.state==="succeeded")return;if((Z=$.error)===null||Z===void 0?void 0:Z.code){let{name:J,message:Q}=$.error;throw Error(`Failed to process media: ${J} - ${Q}.`)}if($.state==="failed")throw Error("Failed to process the media.");if($.check_after_secs)await X0($.check_after_secs);else await X0(5)}}async getUploadMediaRequirements(W,{mimeType:Z,type:$,target:J,longVideo:Q}={}){let Y;try{Y=await G0(W);let K=u6(W,$,Z),z;if(K===D.Mp4&&(!Z&&!$&&J!=="dm"||Q))z="amplify_video";else z=p6(K,J!==null&&J!==void 0?J:"tweet");return{fileHandle:Y,mediaCategory:z,fileSize:await c6(Y),mimeType:K}}catch(K){if(typeof W==="number")F0.close(W,()=>{});else if(typeof Y==="object"&&!(Y instanceof Buffer))Y.close();throw K}}async mediaChunkedUpload(W,Z,$,J=3){let Q=0;if(J<1)throw RangeError("Bad maxConcurrentUploads parameter.");let Y=W instanceof Buffer?void 0:Buffer.alloc(Z),K,z,G=0;[K,z]=await B0(W,Z,G,Y),G+=z;let X=new Set;while(z){let B=K.slice(0,z);if(B.length){let j=this.post(j0,{command:"APPEND",media_id:$,segment_index:Q,media:B},{prefix:c});X.add(j),j.then(()=>{X.delete(j)}),Q++}if(X.size>=J)await Promise.race(X);[K,z]=await B0(W,Z,G,Y),G+=z}await Promise.all([...X])}}class d6 extends B1{constructor(){super(...arguments);this._prefix=l}get readWrite(){return this}sendDm({recipient_id:W,custom_profile_id:Z,...$}){let J={event:{type:n.Create,[n.Create]:{target:{recipient_id:W},message_data:$}}};if(Z)J.event[n.Create].custom_profile_id=Z;return this.post("direct_messages/events/new.json",J,{forceBodyMode:"json"})}getDmEvent(W){return this.get("direct_messages/events/show.json",{id:W})}deleteDm(W){return this.delete("direct_messages/events/destroy.json",{id:W})}async listDmEvents(W={}){let Z={...W},$=await this.get("direct_messages/events/list.json",Z,{fullResponse:!0});return new E4({realData:$.data,rateLimit:$.rateLimit,instance:this,queryParams:Z})}newWelcomeDm(W,Z){let $={[n.WelcomeCreate]:{name:W,message_data:Z}};return this.post("direct_messages/welcome_messages/new.json",$,{forceBodyMode:"json"})}getWelcomeDm(W){return this.get("direct_messages/welcome_messages/show.json",{id:W})}deleteWelcomeDm(W){return this.delete("direct_messages/welcome_messages/destroy.json",{id:W})}updateWelcomeDm(W,Z){let $={message_data:Z};return this.put("direct_messages/welcome_messages/update.json",$,{forceBodyMode:"json",query:{id:W}})}async listWelcomeDms(W={}){let Z={...W},$=await this.get("direct_messages/welcome_messages/list.json",Z,{fullResponse:!0});return new m4({realData:$.data,rateLimit:$.rateLimit,instance:this,queryParams:Z})}newWelcomeDmRule(W){return this.post("direct_messages/welcome_messages/rules/new.json",{welcome_message_rule:{welcome_message_id:W}},{forceBodyMode:"json"})}getWelcomeDmRule(W){return this.get("direct_messages/welcome_messages/rules/show.json",{id:W})}deleteWelcomeDmRule(W){return this.delete("direct_messages/welcome_messages/rules/destroy.json",{id:W})}async listWelcomeDmRules(W={}){let Z={...W};return this.get("direct_messages/welcome_messages/rules/list.json",Z)}async setWelcomeDm(W,Z=!0){var $;let J=await this.listWelcomeDmRules();if(($=J.welcome_message_rules)===null||$===void 0?void 0:$.length){for(let Q of J.welcome_message_rules)if(await this.deleteWelcomeDmRule(Q.id),Z)await this.deleteWelcomeDm(Q.welcome_message_id)}return this.newWelcomeDmRule(W)}markDmAsRead(W,Z){return this.post("direct_messages/mark_read.json",{last_read_event_id:W,recipient_id:Z},{forceBodyMode:"url"})}indicateDmTyping(W){return this.post("direct_messages/indicate_typing.json",{recipient_id:W},{forceBodyMode:"url"})}async downloadDmImage(W){if(typeof W!=="string"){let $=W[n.Create].message_data.attachment;if(!$)throw Error("The given direct message doesn't contain any attachment");W=$.media.media_url_https}let Z=await this.get(W,void 0,{forceParseMode:"buffer",prefix:""});if(!Z.length)throw Error("Image not found. Make sure you are logged with credentials able to access direct messages, and check the URL.");return Z}}var e1=d6;class N{constructor(W){this.result=W}get tweets(){return N.tweets(this.result)}static tweets(W){var Z,$;return($=(Z=W.includes)===null||Z===void 0?void 0:Z.tweets)!==null&&$!==void 0?$:[]}tweetById(W){return N.tweetById(this.result,W)}static tweetById(W,Z){return this.tweets(W).find(($)=>$.id===Z)}retweet(W){return N.retweet(this.result,W)}static retweet(W,Z){var $;let J=(($=Z.referenced_tweets)!==null&&$!==void 0?$:[]).filter((Q)=>Q.type==="retweeted").map((Q)=>Q.id);return this.tweets(W).find((Q)=>J.includes(Q.id))}quote(W){return N.quote(this.result,W)}static quote(W,Z){var $;let J=(($=Z.referenced_tweets)!==null&&$!==void 0?$:[]).filter((Q)=>Q.type==="quoted").map((Q)=>Q.id);return this.tweets(W).find((Q)=>J.includes(Q.id))}repliedTo(W){return N.repliedTo(this.result,W)}static repliedTo(W,Z){var $;let J=(($=Z.referenced_tweets)!==null&&$!==void 0?$:[]).filter((Q)=>Q.type==="replied_to").map((Q)=>Q.id);return this.tweets(W).find((Q)=>J.includes(Q.id))}author(W){return N.author(this.result,W)}static author(W,Z){let $=Z.author_id;return $?this.users(W).find((J)=>J.id===$):void 0}repliedToAuthor(W){return N.repliedToAuthor(this.result,W)}static repliedToAuthor(W,Z){let $=Z.in_reply_to_user_id;return $?this.users(W).find((J)=>J.id===$):void 0}get users(){return N.users(this.result)}static users(W){var Z,$;return($=(Z=W.includes)===null||Z===void 0?void 0:Z.users)!==null&&$!==void 0?$:[]}userById(W){return N.userById(this.result,W)}static userById(W,Z){return this.users(W).find(($)=>$.id===Z)}pinnedTweet(W){return N.pinnedTweet(this.result,W)}static pinnedTweet(W,Z){return Z.pinned_tweet_id?this.tweets(W).find(($)=>$.id===Z.pinned_tweet_id):void 0}get media(){return N.media(this.result)}static media(W){var Z,$;return($=(Z=W.includes)===null||Z===void 0?void 0:Z.media)!==null&&$!==void 0?$:[]}medias(W){return N.medias(this.result,W)}static medias(W,Z){var $,J;let Q=(J=($=Z.attachments)===null||$===void 0?void 0:$.media_keys)!==null&&J!==void 0?J:[];return this.media(W).filter((Y)=>Q.includes(Y.media_key))}get polls(){return N.polls(this.result)}static polls(W){var Z,$;return($=(Z=W.includes)===null||Z===void 0?void 0:Z.polls)!==null&&$!==void 0?$:[]}poll(W){return N.poll(this.result,W)}static poll(W,Z){var $,J;let Q=(J=($=Z.attachments)===null||$===void 0?void 0:$.poll_ids)!==null&&J!==void 0?J:[];if(Q.length){let Y=Q[0];return this.polls(W).find((K)=>K.id===Y)}return}get places(){return N.places(this.result)}static places(W){var Z,$;return($=(Z=W.includes)===null||Z===void 0?void 0:Z.places)!==null&&$!==void 0?$:[]}place(W){return N.place(this.result,W)}static place(W,Z){var $;let J=($=Z.geo)===null||$===void 0?void 0:$.place_id;return J?this.places(W).find((Q)=>Q.id===J):void 0}listOwner(W){return N.listOwner(this.result,W)}static listOwner(W,Z){let $=Z.owner_id;return $?this.users(W).find((J)=>J.id===$):void 0}spaceCreator(W){return N.spaceCreator(this.result,W)}static spaceCreator(W,Z){let $=Z.creator_id;return $?this.users(W).find((J)=>J.id===$):void 0}spaceHosts(W){return N.spaceHosts(this.result,W)}static spaceHosts(W,Z){var $;let J=($=Z.host_ids)!==null&&$!==void 0?$:[];return this.users(W).filter((Q)=>J.includes(Q.id))}spaceSpeakers(W){return N.spaceSpeakers(this.result,W)}static spaceSpeakers(W,Z){var $;let J=($=Z.speaker_ids)!==null&&$!==void 0?$:[];return this.users(W).filter((Q)=>J.includes(Q.id))}spaceInvitedUsers(W){return N.spaceInvitedUsers(this.result,W)}static spaceInvitedUsers(W,Z){var $;let J=($=Z.invited_user_ids)!==null&&$!==void 0?$:[];return this.users(W).filter((Q)=>J.includes(Q.id))}}class W4 extends g4{updateIncludes(W){if(W.errors){if(!this._realData.errors)this._realData.errors=[];this._realData.errors=[...this._realData.errors,...W.errors]}if(!W.includes)return;if(!this._realData.includes)this._realData.includes={};let Z=this._realData.includes;for(let[$,J]of Object.entries(W.includes)){if(!Z[$])Z[$]=[];Z[$]=[...Z[$],...J]}}assertUsable(){if(this.unusable)throw Error("Unable to use this paginator to fetch more data, as it does not contain any metadata. Check .errors property for more details.")}get meta(){return this._realData.meta}get includes(){var W;if(!((W=this._realData)===null||W===void 0?void 0:W.includes))return new N(this._realData);if(this._includesInstance)return this._includesInstance;return this._includesInstance=new N(this._realData)}get errors(){var W;return(W=this._realData.errors)!==null&&W!==void 0?W:[]}get unusable(){return this.errors.length>0&&!this._realData.meta&&!this._realData.data}}class h extends W4{refreshInstanceFromResult(W,Z){var $;let J=W.data,Q=($=J.data)!==null&&$!==void 0?$:[];if(this._rateLimit=W.rateLimit,!this._realData.data)this._realData.data=[];if(Z)this._realData.meta.result_count+=J.meta.result_count,this._realData.meta.next_token=J.meta.next_token,this._realData.data.push(...Q);else this._realData.meta.result_count+=J.meta.result_count,this._realData.meta.previous_token=J.meta.previous_token,this._realData.data.unshift(...Q);this.updateIncludes(J)}getNextQueryParams(W){return this.assertUsable(),{...this.injectQueryParams(W),pagination_token:this._realData.meta.next_token}}getPreviousQueryParams(W){return this.assertUsable(),{...this.injectQueryParams(W),pagination_token:this._realData.meta.previous_token}}getPageLengthFromRequest(W){var Z,$;return($=(Z=W.data.data)===null||Z===void 0?void 0:Z.length)!==null&&$!==void 0?$:0}isFetchLastOver(W){var Z;return!((Z=W.data.data)===null||Z===void 0?void 0:Z.length)||!this.canFetchNextPage(W.data)}canFetchNextPage(W){var Z;return!!((Z=W.meta)===null||Z===void 0?void 0:Z.next_token)}}class M0 extends W4{refreshInstanceFromResult(W,Z){var $;let J=W.data,Q=($=J.data)!==null&&$!==void 0?$:[];if(this._rateLimit=W.rateLimit,!this._realData.data)this._realData.data=[];if(Z)this._realData.meta.oldest_id=J.meta.oldest_id,this._realData.meta.result_count+=J.meta.result_count,this._realData.meta.next_token=J.meta.next_token,this._realData.data.push(...Q);else this._realData.meta.newest_id=J.meta.newest_id,this._realData.meta.result_count+=J.meta.result_count,this._realData.data.unshift(...Q);this.updateIncludes(J)}getNextQueryParams(W){this.assertUsable();let Z={...this.injectQueryParams(W)};if(this._realData.meta.next_token)Z.next_token=this._realData.meta.next_token;else{if(Z.start_time)Z.since_id=this.dateStringToSnowflakeId(Z.start_time),delete Z.start_time;if(Z.end_time)delete Z.end_time;Z.until_id=this._realData.meta.oldest_id}return Z}getPreviousQueryParams(W){return this.assertUsable(),{...this.injectQueryParams(W),since_id:this._realData.meta.newest_id}}getPageLengthFromRequest(W){var Z,$;return($=(Z=W.data.data)===null||Z===void 0?void 0:Z.length)!==null&&$!==void 0?$:0}isFetchLastOver(W){var Z;return!((Z=W.data.data)===null||Z===void 0?void 0:Z.length)||!this.canFetchNextPage(W.data)}canFetchNextPage(W){return!!W.meta.next_token}getItemArray(){return this.tweets}dateStringToSnowflakeId(W){let Z=BigInt("1288834974657"),$=new Date(W);if(isNaN($.valueOf()))throw Error("Unable to convert start_time/end_time to a valid date. A ISO 8601 DateTime is excepted, please check your input.");return(BigInt($.valueOf())-Z<<BigInt("22")).toString()}get tweets(){var W;return(W=this._realData.data)!==null&&W!==void 0?W:[]}get meta(){return super.meta}}class j1 extends h{refreshInstanceFromResult(W,Z){super.refreshInstanceFromResult(W,Z);let $=W.data;if(Z)this._realData.meta.oldest_id=$.meta.oldest_id;else this._realData.meta.newest_id=$.meta.newest_id}getItemArray(){return this.tweets}get tweets(){var W;return(W=this._realData.data)!==null&&W!==void 0?W:[]}get meta(){return super.meta}}class L0 extends M0{constructor(){super(...arguments);this._endpoint="tweets/search/recent"}}class N0 extends M0{constructor(){super(...arguments);this._endpoint="tweets/search/all"}}class D0 extends j1{constructor(){super(...arguments);this._endpoint="tweets/:id/quote_tweets"}}class H0 extends j1{constructor(){super(...arguments);this._endpoint="users/:id/timelines/reverse_chronological"}}class U0 extends j1{constructor(){super(...arguments);this._endpoint="users/:id/tweets"}}class x0 extends j1{constructor(){super(...arguments);this._endpoint="users/:id/mentions"}}class O0 extends j1{constructor(){super(...arguments);this._endpoint="users/:id/bookmarks"}}class S0 extends h{get tweets(){var W;return(W=this._realData.data)!==null&&W!==void 0?W:[]}get meta(){return super.meta}getItemArray(){return this.tweets}}class R0 extends S0{constructor(){super(...arguments);this._endpoint="users/:id/liked_tweets"}}class _0 extends S0{constructor(){super(...arguments);this._endpoint="lists/:id/tweets"}}class u extends h{getItemArray(){return this.users}get users(){var W;return(W=this._realData.data)!==null&&W!==void 0?W:[]}get meta(){return super.meta}}class k0 extends u{constructor(){super(...arguments);this._endpoint="users/:id/blocking"}}class f0 extends u{constructor(){super(...arguments);this._endpoint="users/:id/muting"}}class C0 extends u{constructor(){super(...arguments);this._endpoint="users/:id/followers"}}class V0 extends u{constructor(){super(...arguments);this._endpoint="users/:id/following"}}class T0 extends u{constructor(){super(...arguments);this._endpoint="lists/:id/members"}}class P0 extends u{constructor(){super(...arguments);this._endpoint="lists/:id/followers"}}class b0 extends u{constructor(){super(...arguments);this._endpoint="tweets/:id/liking_users"}}class w0 extends u{constructor(){super(...arguments);this._endpoint="tweets/:id/retweeted_by"}}class Z4 extends h{getItemArray(){return this.lists}get lists(){var W;return(W=this._realData.data)!==null&&W!==void 0?W:[]}get meta(){return super.meta}}class q0 extends Z4{constructor(){super(...arguments);this._endpoint="users/:id/owned_lists"}}class v0 extends Z4{constructor(){super(...arguments);this._endpoint="users/:id/list_memberships"}}class I0 extends Z4{constructor(){super(...arguments);this._endpoint="users/:id/followed_lists"}}class F1 extends P{constructor(){super(...arguments);this._prefix=J1}}class $4 extends h{getItemArray(){return this.events}get events(){var W;return(W=this._realData.data)!==null&&W!==void 0?W:[]}get meta(){return super.meta}}class y0 extends $4{constructor(){super(...arguments);this._endpoint="dm_events"}}class A0 extends $4{constructor(){super(...arguments);this._endpoint="dm_conversations/with/:participant_id/dm_events"}}class h0 extends $4{constructor(){super(...arguments);this._endpoint="dm_conversations/:dm_conversation_id/dm_events"}}class M1 extends P{constructor(){super(...arguments);this._prefix=d}get labs(){if(this._labs)return this._labs;return this._labs=new F1(this)}async search(W,Z={}){let $=typeof W==="string"?{...Z,query:W}:{...W},J=await this.get("tweets/search/recent",$,{fullResponse:!0});return new L0({realData:J.data,rateLimit:J.rateLimit,instance:this,queryParams:$})}async searchAll(W,Z={}){let $={...Z,query:W},J=await this.get("tweets/search/all",$,{fullResponse:!0});return new N0({realData:J.data,rateLimit:J.rateLimit,instance:this,queryParams:$})}singleTweet(W,Z={}){return this.get("tweets/:id",Z,{params:{id:W}})}tweets(W,Z={}){return this.get("tweets",{ids:W,...Z})}tweetCountRecent(W,Z={}){return this.get("tweets/counts/recent",{query:W,...Z})}tweetCountAll(W,Z={}){return this.get("tweets/counts/all",{query:W,...Z})}async tweetRetweetedBy(W,Z={}){let{asPaginator:$,...J}=Z,Q=await this.get("tweets/:id/retweeted_by",J,{fullResponse:!0,params:{id:W}});if(!$)return Q.data;return new w0({realData:Q.data,rateLimit:Q.rateLimit,instance:this,queryParams:J,sharedParams:{id:W}})}async tweetLikedBy(W,Z={}){let{asPaginator:$,...J}=Z,Q=await this.get("tweets/:id/liking_users",J,{fullResponse:!0,params:{id:W}});if(!$)return Q.data;return new b0({realData:Q.data,rateLimit:Q.rateLimit,instance:this,queryParams:J,sharedParams:{id:W}})}async homeTimeline(W={}){let Z=await this.getCurrentUserV2Object(),$=await this.get("users/:id/timelines/reverse_chronological",W,{fullResponse:!0,params:{id:Z.data.id}});return new H0({realData:$.data,rateLimit:$.rateLimit,instance:this,queryParams:W,sharedParams:{id:Z.data.id}})}async userTimeline(W,Z={}){let $=await this.get("users/:id/tweets",Z,{fullResponse:!0,params:{id:W}});return new U0({realData:$.data,rateLimit:$.rateLimit,instance:this,queryParams:Z,sharedParams:{id:W}})}async userMentionTimeline(W,Z={}){let $=await this.get("users/:id/mentions",Z,{fullResponse:!0,params:{id:W}});return new x0({realData:$.data,rateLimit:$.rateLimit,instance:this,queryParams:Z,sharedParams:{id:W}})}async quotes(W,Z={}){let $=await this.get("tweets/:id/quote_tweets",Z,{fullResponse:!0,params:{id:W}});return new D0({realData:$.data,rateLimit:$.rateLimit,instance:this,queryParams:Z,sharedParams:{id:W}})}async bookmarks(W={}){let Z=await this.getCurrentUserV2Object(),$=await this.get("users/:id/bookmarks",W,{fullResponse:!0,params:{id:Z.data.id}});return new O0({realData:$.data,rateLimit:$.rateLimit,instance:this,queryParams:W,sharedParams:{id:Z.data.id}})}me(W={}){return this.get("users/me",W)}user(W,Z={}){return this.get("users/:id",Z,{params:{id:W}})}users(W,Z={}){let $=Array.isArray(W)?W.join(","):W;return this.get("users",{...Z,ids:$})}userByUsername(W,Z={}){return this.get("users/by/username/:username",Z,{params:{username:W}})}usersByUsernames(W,Z={}){return W=Array.isArray(W)?W.join(","):W,this.get("users/by",{...Z,usernames:W})}async followers(W,Z={}){let{asPaginator:$,...J}=Z,Q={id:W};if(!$)return this.get("users/:id/followers",J,{params:Q});let Y=await this.get("users/:id/followers",J,{fullResponse:!0,params:Q});return new C0({realData:Y.data,rateLimit:Y.rateLimit,instance:this,queryParams:J,sharedParams:Q})}async following(W,Z={}){let{asPaginator:$,...J}=Z,Q={id:W};if(!$)return this.get("users/:id/following",J,{params:Q});let Y=await this.get("users/:id/following",J,{fullResponse:!0,params:Q});return new V0({realData:Y.data,rateLimit:Y.rateLimit,instance:this,queryParams:J,sharedParams:Q})}async userLikedTweets(W,Z={}){let $={id:W},J=await this.get("users/:id/liked_tweets",Z,{fullResponse:!0,params:$});return new R0({realData:J.data,rateLimit:J.rateLimit,instance:this,queryParams:{...Z},sharedParams:$})}async userBlockingUsers(W,Z={}){let $={id:W},J=await this.get("users/:id/blocking",Z,{fullResponse:!0,params:$});return new k0({realData:J.data,rateLimit:J.rateLimit,instance:this,queryParams:{...Z},sharedParams:$})}async userMutingUsers(W,Z={}){let $={id:W},J=await this.get("users/:id/muting",Z,{fullResponse:!0,params:$});return new f0({realData:J.data,rateLimit:J.rateLimit,instance:this,queryParams:{...Z},sharedParams:$})}list(W,Z={}){return this.get("lists/:id",Z,{params:{id:W}})}async listsOwned(W,Z={}){let $={id:W},J=await this.get("users/:id/owned_lists",Z,{fullResponse:!0,params:$});return new q0({realData:J.data,rateLimit:J.rateLimit,instance:this,queryParams:{...Z},sharedParams:$})}async listMemberships(W,Z={}){let $={id:W},J=await this.get("users/:id/list_memberships",Z,{fullResponse:!0,params:$});return new v0({realData:J.data,rateLimit:J.rateLimit,instance:this,queryParams:{...Z},sharedParams:$})}async listFollowed(W,Z={}){let $={id:W},J=await this.get("users/:id/followed_lists",Z,{fullResponse:!0,params:$});return new I0({realData:J.data,rateLimit:J.rateLimit,instance:this,queryParams:{...Z},sharedParams:$})}async listTweets(W,Z={}){let $={id:W},J=await this.get("lists/:id/tweets",Z,{fullResponse:!0,params:$});return new _0({realData:J.data,rateLimit:J.rateLimit,instance:this,queryParams:{...Z},sharedParams:$})}async listMembers(W,Z={}){let $={id:W},J=await this.get("lists/:id/members",Z,{fullResponse:!0,params:$});return new T0({realData:J.data,rateLimit:J.rateLimit,instance:this,queryParams:{...Z},sharedParams:$})}async listFollowers(W,Z={}){let $={id:W},J=await this.get("lists/:id/followers",Z,{fullResponse:!0,params:$});return new P0({realData:J.data,rateLimit:J.rateLimit,instance:this,queryParams:{...Z},sharedParams:$})}async listDmEvents(W={}){let Z=await this.get("dm_events",W,{fullResponse:!0});return new y0({realData:Z.data,rateLimit:Z.rateLimit,instance:this,queryParams:{...W}})}async listDmEventsWithParticipant(W,Z={}){let $={participant_id:W},J=await this.get("dm_conversations/with/:participant_id/dm_events",Z,{fullResponse:!0,params:$});return new A0({realData:J.data,rateLimit:J.rateLimit,instance:this,queryParams:{...Z},sharedParams:$})}async listDmEventsOfConversation(W,Z={}){let $={dm_conversation_id:W},J=await this.get("dm_conversations/:dm_conversation_id/dm_events",Z,{fullResponse:!0,params:$});return new h0({realData:J.data,rateLimit:J.rateLimit,instance:this,queryParams:{...Z},sharedParams:$})}space(W,Z={}){return this.get("spaces/:id",Z,{params:{id:W}})}spaces(W,Z={}){return this.get("spaces",{ids:W,...Z})}spacesByCreators(W,Z={}){return this.get("spaces/by/creator_ids",{user_ids:W,...Z})}searchSpaces(W){return this.get("spaces/search",W)}spaceBuyers(W,Z={}){return this.get("spaces/:id/buyers",Z,{params:{id:W}})}spaceTweets(W,Z={}){return this.get("spaces/:id/tweets",Z,{params:{id:W}})}searchStream({autoConnect:W,...Z}={}){return this.getStream("tweets/search/stream",Z,{payloadIsError:n1,autoConnect:W})}streamRules(W={}){return this.get("tweets/search/stream/rules",W)}updateStreamRules(W,Z={}){return this.post("tweets/search/stream/rules",W,{query:Z})}sampleStream({autoConnect:W,...Z}={}){return this.getStream("tweets/sample/stream",Z,{payloadIsError:n1,autoConnect:W})}sample10Stream({autoConnect:W,...Z}={}){return this.getStream("tweets/sample10/stream",Z,{payloadIsError:n1,autoConnect:W})}complianceJobs(W){return this.get("compliance/jobs",W)}complianceJob(W){return this.get("compliance/jobs/:id",void 0,{params:{id:W}})}async sendComplianceJob(W){let Z=await this.post("compliance/jobs",{type:W.type,name:W.name}),$=W.ids instanceof Buffer?W.ids:Buffer.from(W.ids.join(`
|
|
69
69
|
`));return await this.put(Z.data.upload_url,$,{forceBodyMode:"raw",enableAuth:!1,headers:{"Content-Type":"text/plain"},prefix:""}),Z}async complianceJobResult(W){let Z=W;while(Z.status!=="complete"){if(Z.status==="expired"||Z.status==="failed")throw Error("Job failed to be completed.");await new Promise((J)=>setTimeout(J,3500)),Z=(await this.complianceJob(W.id)).data}return(await this.get(W.download_url,void 0,{enableAuth:!1,prefix:""})).trim().split(`
|
|
70
|
-
`).filter((J)=>J).map((J)=>JSON.parse(J))}async usage(W={}){return this.get("usage/tweets",W)}community(W,Z={}){return this.get("communities/:id",Z,{params:{id:W}})}searchCommunities(W,Z={}){return this.get("communities/search",{query:W,...Z})}}class L1 extends F1{constructor(){super(...arguments);this._prefix=J1}get readOnly(){return this}}class N1 extends M1{constructor(){super(...arguments);this._prefix=d}get readOnly(){return this}get labs(){if(this._labs)return this._labs;return this._labs=new L1(this)}hideReply(W,Z){return this.put("tweets/:id/hidden",{hidden:Z},{params:{id:W}})}like(W,Z){return this.post("users/:id/likes",{tweet_id:Z},{params:{id:W}})}unlike(W,Z){return this.delete("users/:id/likes/:tweet_id",void 0,{params:{id:W,tweet_id:Z}})}retweet(W,Z){return this.post("users/:id/retweets",{tweet_id:Z},{params:{id:W}})}unretweet(W,Z){return this.delete("users/:id/retweets/:tweet_id",void 0,{params:{id:W,tweet_id:Z}})}tweet(W,Z={}){if(typeof W==="object")Z=W;else Z={text:W,...Z};return this.post("tweets",Z)}async uploadMedia(W,Z,$=1048576){let J=Z.media_category;if(!Z.media_category){if(Z.media_type.includes("gif"))J="tweet_gif";else if(Z.media_type.includes("image"))J="tweet_image";else if(Z.media_type.includes("video"))J="tweet_video"}let Q={additional_owners:Z.additional_owners,media_type:Z.media_type,total_bytes:W.length,media_category:J},K=(await this.post("media/upload/initialize",Q)).data.id,z=Math.ceil(W.length/$),G=new Uint8Array(W);for(let B=0;B<z;B++){let j=B*$,L=Math.min(j+$,W.length),H=G.slice(j,L),S=Buffer.from(H),o={segment_index:B,media:S};await this.post(`media/upload/${K}/append`,o,{forceBodyMode:"form-data"})}if((await this.post(`media/upload/${K}/finalize`)).data.processing_info)await this.waitForMediaProcessing(K);return K}async waitForMediaProcessing(W){var Z;let J=(await this.get("media/upload",{command:"STATUS",media_id:W})).data.processing_info;if(!J)return;switch(J.state){case"succeeded":return;case"failed":throw Error(`Media processing failed: ${(Z=J.error)===null||Z===void 0?void 0:Z.message}`);case"pending":case"in_progress":{let Q=J===null||J===void 0?void 0:J.check_after_secs;if(Q&&Q>0)await new Promise((Y)=>setTimeout(Y,Q*1000)),await this.waitForMediaProcessing(W)}}}createMediaMetadata(W,Z){return this.post("media/metadata",{id:W,metadata:Z})}reply(W,Z,$={}){var J;let Q={in_reply_to_tweet_id:Z,...(J=$.reply)!==null&&J!==void 0?J:{}};return this.post("tweets",{text:W,...$,reply:Q})}quote(W,Z,$={}){return this.tweet(W,{...$,quote_tweet_id:Z})}async tweetThread(W){var Z,$;let J=[];for(let Q of W){let Y=J.length?J[J.length-1]:null,K={...typeof Q==="string"?{text:Q}:Q},z=Y?Y.data.id:(Z=K.reply)===null||Z===void 0?void 0:Z.in_reply_to_tweet_id,G=($=K.text)!==null&&$!==void 0?$:"";if(z)J.push(await this.reply(G,z,K));else J.push(await this.tweet(G,K))}return J}deleteTweet(W){return this.delete("tweets/:id",void 0,{params:{id:W}})}async bookmark(W){let Z=await this.getCurrentUserV2Object();return this.post("users/:id/bookmarks",{tweet_id:W},{params:{id:Z.data.id}})}async deleteBookmark(W){let Z=await this.getCurrentUserV2Object();return this.delete("users/:id/bookmarks/:tweet_id",void 0,{params:{id:Z.data.id,tweet_id:W}})}follow(W,Z){return this.post("users/:id/following",{target_user_id:Z},{params:{id:W}})}unfollow(W,Z){return this.delete("users/:source_user_id/following/:target_user_id",void 0,{params:{source_user_id:W,target_user_id:Z}})}block(W,Z){return this.post("users/:id/blocking",{target_user_id:Z},{params:{id:W}})}unblock(W,Z){return this.delete("users/:source_user_id/blocking/:target_user_id",void 0,{params:{source_user_id:W,target_user_id:Z}})}mute(W,Z){return this.post("users/:id/muting",{target_user_id:Z},{params:{id:W}})}unmute(W,Z){return this.delete("users/:source_user_id/muting/:target_user_id",void 0,{params:{source_user_id:W,target_user_id:Z}})}createList(W){return this.post("lists",W)}updateList(W,Z={}){return this.put("lists/:id",Z,{params:{id:W}})}removeList(W){return this.delete("lists/:id",void 0,{params:{id:W}})}addListMember(W,Z){return this.post("lists/:id/members",{user_id:Z},{params:{id:W}})}removeListMember(W,Z){return this.delete("lists/:id/members/:user_id",void 0,{params:{id:W,user_id:Z}})}subscribeToList(W,Z){return this.post("users/:id/followed_lists",{list_id:Z},{params:{id:W}})}unsubscribeOfList(W,Z){return this.delete("users/:id/followed_lists/:list_id",void 0,{params:{id:W,list_id:Z}})}pinList(W,Z){return this.post("users/:id/pinned_lists",{list_id:Z},{params:{id:W}})}unpinList(W,Z){return this.delete("users/:id/pinned_lists/:list_id",void 0,{params:{id:W,list_id:Z}})}sendDmInConversation(W,Z){return this.post("dm_conversations/:dm_conversation_id/messages",Z,{params:{dm_conversation_id:W}})}sendDmToParticipant(W,Z){return this.post("dm_conversations/with/:participant_id/messages",Z,{params:{participant_id:W}})}createDmConversation(W){return this.post("dm_conversations",W)}}class l6 extends L1{constructor(){super(...arguments);this._prefix=J1}get readWrite(){return this}}var n6=l6;class i6 extends N1{constructor(){super(...arguments);this._prefix=d}get readWrite(){return this}get labs(){if(this._labs)return this._labs;return this._labs=new n6(this)}}var s6=i6;class P1 extends i{get v1(){if(this._v1)return this._v1;return this._v1=new X1(this)}get v2(){if(this._v2)return this._v2;return this._v2=new M1(this)}async currentUser(W=!1){return await this.getCurrentUserObject(W)}async currentUserV2(W=!1){return await this.getCurrentUserV2Object(W)}search(W,Z){return this.v2.search(W,Z)}async generateAuthLink(W="oob",{authAccessType:Z,linkMode:$="authenticate",forceLogin:J,screenName:Q}={}){let Y=await this.post("https://api.x.com/oauth/request_token",{oauth_callback:W,x_auth_access_type:Z}),K=`https://api.x.com/oauth/${$}?oauth_token=${encodeURIComponent(Y.oauth_token)}`;if(J!==void 0)K+=`&force_login=${encodeURIComponent(J)}`;if(Q!==void 0)K+=`&screen_name=${encodeURIComponent(Q)}`;if(this._requestMaker.hasPlugins())this._requestMaker.applyPluginMethod("onOAuth1RequestToken",{client:this._requestMaker,url:K,oauthResult:Y});return{url:K,...Y}}async login(W){let Z=this.getActiveTokens();if(Z.type!=="oauth-1.0a")throw Error("You must setup TwitterApi instance with consumer keys to accept OAuth 1.0 login");let $=await this.post("https://api.x.com/oauth/access_token",{oauth_token:Z.accessToken,oauth_verifier:W}),J=new this.constructor({appKey:Z.appKey,appSecret:Z.appSecret,accessToken:$.oauth_token,accessSecret:$.oauth_token_secret},this._requestMaker.clientSettings);return{accessToken:$.oauth_token,accessSecret:$.oauth_token_secret,userId:$.user_id,screenName:$.screen_name,client:J}}async appLogin(){let W=this.getActiveTokens();if(W.type!=="oauth-1.0a")throw Error("You must setup TwitterApi instance with consumer keys to accept app-only login");let $=await new this.constructor({username:W.appKey,password:W.appSecret},this._requestMaker.clientSettings).post("https://api.x.com/oauth2/token",{grant_type:"client_credentials"});return new this.constructor($.access_token,this._requestMaker.clientSettings)}generateOAuth2AuthLink(W,Z={}){var $,J;if(!this._requestMaker.clientId)throw Error("Twitter API instance is not initialized with client ID. You can find your client ID in Twitter Developer Portal. Please build an instance with: new TwitterApi({ clientId: '<yourClientId>' })");let Q=($=Z.state)!==null&&$!==void 0?$:Z1.generateRandomString(32),Y=Z1.getCodeVerifier(),K=Z1.getCodeChallengeFromVerifier(Y),z=(J=Z.scope)!==null&&J!==void 0?J:"",G=Array.isArray(z)?z.join(" "):z,X=new URL("https://x.com/i/oauth2/authorize"),B={response_type:"code",client_id:this._requestMaker.clientId,redirect_uri:W,state:Q,code_challenge:K,code_challenge_method:"s256",scope:G};T.addQueryParamsToUrl(X,B);let j={url:X.toString(),state:Q,codeVerifier:Y,codeChallenge:K};if(this._requestMaker.hasPlugins())this._requestMaker.applyPluginMethod("onOAuth2RequestToken",{client:this._requestMaker,result:j,redirectUri:W});return j}async loginWithOAuth2({code:W,codeVerifier:Z,redirectUri:$}){if(!this._requestMaker.clientId)throw Error("Twitter API instance is not initialized with client ID. Please build an instance with: new TwitterApi({ clientId: '<yourClientId>' })");let J=await this.post("https://api.x.com/2/oauth2/token",{code:W,code_verifier:Z,redirect_uri:$,grant_type:"authorization_code",client_id:this._requestMaker.clientId,client_secret:this._requestMaker.clientSecret});return this.parseOAuth2AccessTokenResult(J)}async refreshOAuth2Token(W){if(!this._requestMaker.clientId)throw Error("Twitter API instance is not initialized with client ID. Please build an instance with: new TwitterApi({ clientId: '<yourClientId>' })");let Z=await this.post("https://api.x.com/2/oauth2/token",{refresh_token:W,grant_type:"refresh_token",client_id:this._requestMaker.clientId,client_secret:this._requestMaker.clientSecret});return this.parseOAuth2AccessTokenResult(Z)}async revokeOAuth2Token(W,Z="access_token"){if(!this._requestMaker.clientId)throw Error("Twitter API instance is not initialized with client ID. Please build an instance with: new TwitterApi({ clientId: '<yourClientId>' })");return await this.post("https://api.x.com/2/oauth2/revoke",{client_id:this._requestMaker.clientId,client_secret:this._requestMaker.clientSecret,token:W,token_type_hint:Z})}parseOAuth2AccessTokenResult(W){let Z=new this.constructor(W.access_token,this._requestMaker.clientSettings),$=W.scope.split(" ").filter((J)=>J);return{client:Z,expiresIn:W.expires_in,accessToken:W.access_token,scope:$,refreshToken:W.refresh_token}}}class b1 extends P1{get v1(){if(this._v1)return this._v1;return this._v1=new B1(this)}get v2(){if(this._v2)return this._v2;return this._v2=new N1(this)}get readOnly(){return this}}class J4 extends P{constructor(){super(...arguments);this._prefix=Q1}}class Q4 extends J4{constructor(){super(...arguments);this._prefix=Q1}get readOnly(){return this}}class Y4 extends P{constructor(){super(...arguments);this._prefix=Y1}}class K4 extends Y4{constructor(){super(...arguments);this._prefix=Y1}get readOnly(){return this}}class o6 extends K4{constructor(){super(...arguments);this._prefix=Y1}get readWrite(){return this}}var a6=o6;class t6 extends Q4{constructor(){super(...arguments);this._prefix=Q1}get readWrite(){return this}get sandbox(){if(this._sandbox)return this._sandbox;return this._sandbox=new a6(this)}}var r6=t6;class z4 extends b1{get v1(){if(this._v1)return this._v1;return this._v1=new e1(this)}get v2(){if(this._v2)return this._v2;return this._v2=new s6(this)}get readWrite(){return this}get ads(){if(this._ads)return this._ads;return this._ads=new r6(this)}static getErrors(W){var Z;if(typeof W!=="object")return[];if(!("data"in W))return[];return(Z=W.data.errors)!==null&&Z!==void 0?Z:[]}static getProfileImageInSize(W,Z){let $=W.split("/").pop(),J=["normal","bigger","mini"],Q=W;for(let K of J)if($.includes(`_${K}`)){Q=W.replace(`_${K}`,"");break}if(Z==="original")return Q;let Y=Q.lastIndexOf(".");if(Y!==-1){let K=Q.slice(Y+1);return Q.slice(0,Y)+"_"+Z+"."+K}else return Q+"_"+Z}}var W5={clientId:process.env.X_CLIENT_ID,clientSecret:process.env.X_SECRET,redirectPath:"/auth/oauth/x/callback",scope:["tweet.read","users.read","offline.access"]};class e6 extends m{config;client;constructor(W={}){super();this.config={...W5,...W},this.client=new z4({clientId:this.config.clientId,clientSecret:this.config.clientSecret})}redirectUri(){return`${V()??""}${this.config.redirectPath}`}clientFor(W){return p(this,W,{name:"XOAuthProvider",resolve:this.config.resolve,clientId:this.config.clientId,clientSecret:this.config.clientSecret,redirectPath:this.config.redirectPath,staticRedirectUri:()=>this.redirectUri(),staticOrigin:()=>V()??""})}staticClient(){return{clientId:this.config.clientId,clientSecret:this.config.clientSecret,redirectUri:this.redirectUri()}}getRedirectUrl(W,Z){if(!Z)throw Error("XOAuthProvider needs the state and PKCE challenge gemi passes.");if(!this.config.resolve)return this.authorizationUrl(this.staticClient(),Z);return this.clientFor(W??null).then(($)=>{if(!$)throw Error("XOAuthProvider is not offered on this request.");return this.authorizationUrl($,Z)})}authorizationUrl(W,Z){let $=new URL("https://x.com/i/oauth2/authorize"),J={response_type:"code",client_id:W.clientId,redirect_uri:W.redirectUri,state:Z.state,code_challenge:Z.codeChallenge,code_challenge_method:Z.codeChallengeMethod,scope:this.config.scope.join(" ")};for(let[Q,Y]of Object.entries(J))$.searchParams.set(Q,Y);return $.toString()}async onCallback(W,Z){let $=W.search.get("code");if(!$)throw new U("missing_code");if(!Z?.codeVerifier)throw new U("invalid_state");let J=this.config.resolve?await this.clientFor(W):this.staticClient();if(!J)throw new U("unknown_provider");let Q=this.config.resolve?new z4({clientId:J.clientId,clientSecret:J.clientSecret}):this.client,Y;try{Y=await Q.loginWithOAuth2({code:$,codeVerifier:Z.codeVerifier,redirectUri:J.redirectUri})}catch(j){throw console.error("X OAuth error: token exchange failed",j),new U("exchange_failed")}let{data:K}=await Y.client.v2.me({"user.fields":["name","username","entities"]}),{name:z,email:G,id:X="",username:B}=K??{};return{name:z,email:G,username:B,providerId:X}}}var ZW=["instagram_business_basic"],g={authorizeUrl:"https://www.instagram.com/oauth/authorize",tokenUrl:"https://api.instagram.com/oauth/access_token",graphUrl:"https://graph.instagram.com"};class I extends Error{status;type;code;constructor(W,Z,$,J,Q){super(W,Q);this.status=Z;this.type=$;this.code=J;this.name="InstagramApiError"}}async function G4(W){let Z=new URLSearchParams({client_id:W.clientId,client_secret:W.clientSecret,grant_type:"authorization_code",redirect_uri:W.redirectUri,code:W.code.replace(/#_$/,"")}),$=await B4(W.tokenUrl??g.tokenUrl,"code exchange",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:Z.toString()}),J=Array.isArray($.data)?$.data[0]:$,Q=J?.access_token;if(typeof Q!=="string"||Q==="")throw new I("Instagram's code exchange answered without an access token.",200);let Y=J?.permissions;return{accessToken:Q,userId:g0(J?.user_id),permissions:Array.isArray(Y)?Y.map(String):typeof Y==="string"?Y.split(/[\s,]+/).filter(Boolean):null}}async function $W(W){let Z=new URL("/access_token",W.graphUrl??g.graphUrl);return Z.searchParams.set("grant_type","ig_exchange_token"),Z.searchParams.set("client_secret",W.clientSecret),Z.searchParams.set("access_token",W.accessToken),QW(await B4(Z.toString(),"long-lived token exchange",{method:"GET"}))}async function JW(W){let Z=new URL("/refresh_access_token",W.graphUrl??g.graphUrl);return Z.searchParams.set("grant_type","ig_refresh_token"),Z.searchParams.set("access_token",W.accessToken),QW(await B4(Z.toString(),"token refresh",{method:"GET"}))}async function X4(W){let Z=W.graphApiVersion?`/${W.graphApiVersion.replace(/^\/+|\/+$/g,"")}`:"",$=new URL(`${Z}/me`,W.graphUrl??g.graphUrl);$.searchParams.set("fields",(W.fields??["user_id","username","name","account_type","profile_picture_url"]).join(",")),$.searchParams.set("access_token",W.accessToken);let J=await B4($.toString(),"profile request",{method:"GET"}),Q=Array.isArray(J.data)?J.data[0]:J,Y=g0(Q?.user_id);if(!Y)throw new I("Instagram's /me answered without a user_id.",200);let K={user_id:Y},z=g0(Q?.id);if(z)K.id=z;for(let G of["username","name","account_type","profile_picture_url"]){let X=Q?.[G];if(typeof X==="string"&&X!=="")K[G]=X}return K}function QW(W){if(typeof W.access_token!=="string"||W.access_token==="")throw new I("Instagram answered without an access token.",200);let Z=Number(W.expires_in);return{accessToken:W.access_token,tokenType:typeof W.token_type==="string"?W.token_type:null,expiresIn:Number.isFinite(Z)&&Z>0?Z:null}}async function B4(W,Z,$){let J;try{J=await fetch(W,{...$,redirect:"error"})}catch(Y){throw new I(`Instagram's ${Z} failed to reach Instagram.`,void 0,void 0,void 0,{cause:Y})}let Q=E0(await J.text().catch(()=>""));if(!J.ok){let Y=Q.error??{},K=WW(Q.error_type)??WW(Y.type),z=Number(Q.code??Y.code);throw new I(`Instagram refused the ${Z} (HTTP ${J.status}${K?`, ${K}`:""}${Number.isFinite(z)?` ${z}`:""}).`,J.status,K,Number.isFinite(z)?z:void 0)}return Q}function E0(W){try{let Z=JSON.parse(W.replace(/("(?:user_id|id)"\s*:\s*)(-?\d+)(?=\s*[,}\]])/g,'$1"$2"'));return Z&&typeof Z==="object"?Z:{}}catch{return{}}}function g0(W){if(typeof W==="string"&&W!=="")return W;if(typeof W==="number"&&Number.isSafeInteger(W))return String(W);return null}function WW(W){return typeof W==="string"&&W!==""?W:void 0}class YW extends m{createUsersWithoutEmail=!0;linkByEmail=!1;config;constructor(W={}){super();this.config={clientId:process.env.INSTAGRAM_CLIENT_ID??"",clientSecret:process.env.INSTAGRAM_CLIENT_SECRET??"",scopes:ZW,redirectPath:"/auth/oauth/instagram/callback",authorizationParams:{},...W}}redirectUri(){return`${V()??""}${this.config.redirectPath}`}clientFor(W){return p(this,W,{name:"InstagramOAuthProvider",resolve:this.config.resolve,clientId:this.config.clientId,clientSecret:this.config.clientSecret,redirectPath:this.config.redirectPath,staticRedirectUri:()=>this.redirectUri(),staticOrigin:()=>V()??""})}staticClient(){return{clientId:this.config.clientId,clientSecret:this.config.clientSecret,redirectUri:this.redirectUri()}}getRedirectUrl(W,Z){if(!this.config.resolve)return this.authorizationUrl(this.staticClient(),Z);return this.clientFor(W??null).then(($)=>{if(!$)throw Error("InstagramOAuthProvider is not offered on this request.");return this.authorizationUrl($,Z)})}authorizationUrl(W,Z){let $=new URL(this.config.authorizeUrl??g.authorizeUrl),J={...this.config.authorizationParams,client_id:W.clientId,redirect_uri:W.redirectUri,response_type:"code",scope:this.config.scopes.join(",")};if(Z)J.state=Z.state;for(let[Q,Y]of Object.entries(J))$.searchParams.set(Q,Y);return $.toString()}async onCallback(W){let Z=W.search.get("code");if(!Z)throw new U("missing_code");let $=this.config.resolve?await this.clientFor(W):this.staticClient();if(!$)throw new U("unknown_provider");let J;try{let Q=await G4({code:Z,clientId:$.clientId,clientSecret:$.clientSecret,redirectUri:$.redirectUri,tokenUrl:this.config.tokenUrl});J=await X4({accessToken:Q.accessToken,graphUrl:this.config.graphUrl,graphApiVersion:this.config.graphApiVersion,fields:["user_id","username","name"]})}catch(Q){if(Q instanceof I)throw console.error(`Instagram OAuth error: ${Q.message}`),new U("exchange_failed");throw Q}return{providerId:J.user_id,username:J.username,name:J.name||J.username}}}import{createHmac as Z5,timingSafeEqual as $5}from"crypto";class y extends Error{reason;constructor(W,Z){super(Z);this.reason=W;this.name="MetaSignedRequestError"}}function J5(W,Z,$={}){if(!Z)throw Error("parseMetaSignedRequest needs the app secret.");if(typeof W!=="string")throw new y("malformed","No signed_request was given.");let J=W.indexOf(".");if(J<=0||J===W.length-1||W.indexOf(".",J+1)!==-1)throw new y("malformed","A signed_request is <signature>.<payload>.");let Q=W.slice(0,J),Y=W.slice(J+1);if(!/^[A-Za-z0-9_-]+={0,2}$/.test(Q)||!/^[A-Za-z0-9_-]+={0,2}$/.test(Y))throw new y("malformed","A signed_request is base64url.");let K=Z5("sha256",Z).update(Y).digest(),z=Buffer.from(Q,"base64url");if(z.length!==K.length||!$5(z,K))throw new y("bad_signature","The signed_request's signature does not match the app secret.");let G;try{let L=Buffer.from(Y,"base64url").toString("utf8").replace(/("user_id"\s*:\s*)(-?\d+)(?=\s*[,}])/g,'$1"$2"');G=JSON.parse(L)}catch{throw new y("malformed","The signed_request's payload is not JSON.")}if(!G||typeof G!=="object")throw new y("malformed","The signed_request's payload is not an object.");if(String(G.algorithm??"").toUpperCase()!=="HMAC-SHA256")throw new y("unsupported_algorithm","Only HMAC-SHA256 signed_requests are accepted.");let X=Math.floor(($.now??Date.now())/1000),B=Number(G.expires);if(Number.isFinite(B)&&B>0&&B<X)throw new y("expired","The signed_request has expired.");let j=G.user_id;if((typeof j!=="string"||j==="")&&typeof j!=="number")throw new y("missing_user","The signed_request names no user.");return{...G,algorithm:String(G.algorithm),user_id:String(j)}}var Q5=86400000;class F4 extends m0{instagram;constructor(W={}){let Z={authorizeUrl:W.authorizeUrl??g.authorizeUrl,tokenUrl:W.tokenUrl??g.tokenUrl,graphUrl:W.graphUrl??g.graphUrl,graphApiVersion:W.graphApiVersion};super({authorizeUrl:Z.authorizeUrl,tokenUrl:Z.tokenUrl,clientId:W.clientId??process.env.INSTAGRAM_CLIENT_ID??"",clientSecret:W.clientSecret??process.env.INSTAGRAM_CLIENT_SECRET??"",scopes:W.scopes??["instagram_business_basic","instagram_business_content_publish"],scopeSeparator:",",pkce:!1,authorizationParams:W.authorizationParams??{},redirectUri:W.redirectUri,apiBaseUrl:Z.graphUrl,refreshLeewaySeconds:W.refreshLeewaySeconds??864000,multiple:W.multiple??!1,tokenPlacement:"query",isTokenRejected:Y5,refreshStrategy:async($)=>{if(Date.now()-$.issuedAt.getTime()<Q5){if($.reason==="rejected")throw new w1("refresh_failed","Instagram refused the access token (OAuthException 190).",{status:401});return null}let J=await j4("refresh_failed",()=>JW({accessToken:$.accessToken,graphUrl:Z.graphUrl}));return{accessToken:J.accessToken,refreshToken:null,tokenType:J.tokenType,expiresAt:J.expiresIn===null?null:new Date(Date.now()+J.expiresIn*1000),scopes:$.scopes,providerAccountId:$.providerAccountId}}});this.instagram=Z}async exchangeCode(W){let Z=await j4("exchange_failed",()=>G4({code:W.code,clientId:this.config.clientId,clientSecret:this.config.clientSecret,redirectUri:W.redirectUri,tokenUrl:this.instagram.tokenUrl})),$=await j4("exchange_failed",()=>$W({accessToken:Z.accessToken,clientSecret:this.config.clientSecret,graphUrl:this.instagram.graphUrl})),J=await j4("exchange_failed",()=>X4({accessToken:$.accessToken,graphUrl:this.instagram.graphUrl,graphApiVersion:this.instagram.graphApiVersion}));return{accessToken:$.accessToken,refreshToken:null,tokenType:$.tokenType,expiresAt:$.expiresIn===null?null:new Date(Date.now()+$.expiresIn*1000),scopes:Z.permissions??this.config.scopes,providerAccountId:J.user_id,profile:{...J}}}refresh(){return Promise.reject(new w1("refresh_failed","Instagram connections renew the access token itself; call connection.refresh()."))}}async function Y5(W){if(W.status===401)return!0;if(W.status!==400)return!1;let Z=await W.clone().json().catch(()=>null);return Number(Z?.error?.code)===190}async function j4(W,Z){try{return await Z()}catch($){if($ instanceof I)throw new w1(W,$.message,{cause:$,status:$.status===200?502:$.status});throw $}}class O extends Error{code;status;graphCode;graphSubcode;containerId;constructor(W,Z,$={}){super(Z);this.code=W;this.name="InstagramPublishError",this.status=$.status,this.graphCode=$.graphCode,this.graphSubcode=$.graphSubcode,this.containerId=$.containerId}}var f={captionLength:2200,hashtags:30,mentions:20,userTags:20,carouselMin:2,carouselMax:10},KW="instagram_business_content_publish",K5={for(W,Z={}){return new p0(W,Z)}};class p0{connection;version;pollIntervalMs;maxPollIntervalMs;timeoutMs;constructor(W,Z={}){this.connection=W;let $=W.connectionProvider();if(!($ instanceof F4))throw TypeError(`Instagram.for() takes an Instagram connection; "${W.provider}" is not an InstagramConnectionProvider.`);let J=Z.graphApiVersion??$.instagram.graphApiVersion;this.version=J?`/${J.replace(/^\/+|\/+$/g,"")}`:"",this.pollIntervalMs=Z.pollIntervalMs??2000,this.maxPollIntervalMs=Z.maxPollIntervalMs??1e4,this.timeoutMs=Z.timeoutMs??300000}async publishImage(W,Z={}){if(q1("imageUrl",W.imageUrl),u0(W.caption),W.altText!==void 0&&typeof W.altText!=="string")_("altText must be a string.");if(W.userTags!==void 0)U5(W.userTags);let $=this.start(Z),J=await this.createContainer({image_url:W.imageUrl,caption:W.caption,alt_text:W.altText,user_tags:W.userTags?JSON.stringify(W.userTags):void 0,location_id:W.locationId},$);return this.publishContainer(J,!1,$)}async publishCarousel(W,Z={}){let $=W.items;if(!Array.isArray($)||$.length<f.carouselMin||$.length>f.carouselMax)_(`A carousel takes ${f.carouselMin} to ${f.carouselMax} items.`);$.forEach((z,G)=>BW(`items[${G}]`,z)),u0(W.caption);let J=this.start(Z),Q=[];for(let z of $)Q.push(await this.createContainer(z.videoUrl!==void 0?{media_type:"VIDEO",video_url:z.videoUrl,is_carousel_item:"true"}:{image_url:z.imageUrl,is_carousel_item:"true"},J));for(let[z,G]of $.entries())if(G.videoUrl!==void 0)await this.waitUntilFinished(Q[z],J);let Y=$.some((z)=>z.videoUrl!==void 0),K=await this.createContainer({media_type:"CAROUSEL",children:Q.join(","),caption:W.caption},J);return this.publishContainer(K,Y,J)}async publishReel(W,Z={}){if(q1("videoUrl",W.videoUrl),W.coverUrl!==void 0)q1("coverUrl",W.coverUrl);if(u0(W.caption),W.thumbOffset!==void 0&&!(Number.isInteger(W.thumbOffset)&&W.thumbOffset>=0))_("thumbOffset must be a whole number of milliseconds, 0 or more.");let $=this.start(Z),J=await this.createContainer({media_type:"REELS",video_url:W.videoUrl,caption:W.caption,cover_url:W.coverUrl,share_to_feed:W.shareToFeed===void 0?void 0:String(W.shareToFeed),thumb_offset:W.thumbOffset===void 0?void 0:String(W.thumbOffset)},$);return this.publishContainer(J,!0,$)}async publishStory(W,Z={}){BW("story",W);let $=this.start(Z),J=W.videoUrl!==void 0,Q=await this.createContainer(J?{media_type:"STORIES",video_url:W.videoUrl}:{media_type:"STORIES",image_url:W.imageUrl},$);return this.publishContainer(Q,J,$)}async publishingLimit(W={}){let Z=this.start(W),$=await this.call("publishing limit request",`/${this.accountId()}/content_publishing_limit?fields=quota_usage,config`,void 0,Z),J=Array.isArray($.data)?$.data[0]:$,Q=J?.config??{},Y=c0(J?.quota_usage,0),K=c0(Q.quota_total,100);return{quotaUsage:Y,quotaTotal:K,quotaDurationSeconds:c0(Q.quota_duration,86400),remaining:Math.max(0,K-Y)}}async containerStatus(W,Z={}){return this.readStatus(W,this.start(Z))}start(W){if(W.signal?.throwIfAborted(),!this.connection.hasScopes(KW))throw new O("permission_denied",`The Instagram connection was not granted ${KW}; connect it again with that scope.`);return{signal:W.signal,deadline:Date.now()+(W.timeoutMs??this.timeoutMs)}}accountId(){let W=this.connection.providerAccountId;if(!W)throw new O("invalid_input","The Instagram connection has no account id (providerAccountId).");return W}async createContainer(W,Z){let $=await this.call("media container request",`/${this.accountId()}/media`,W,Z);return GW($,"media container request")}async publishContainer(W,Z,$){try{if(Z)await this.waitUntilFinished(W,$);let J=await this.publishOnce(W,Z,$);return{mediaId:J,permalink:await this.permalink(J,$)}}catch(J){throw J instanceof O?D5(J,W):J}}async publishOnce(W,Z,$){try{return await this.mediaPublish(W,$)}catch(J){if(!(J instanceof O))throw J;if(J.code==="transient"){let{statusCode:Q}=await this.readStatus(W,$);if(Q==="PUBLISHED")throw new O("unconfirmed","Instagram's media_publish failed, but the container reads PUBLISHED: the post is probably live. Do not publish it again.",{status:J.status,graphCode:J.graphCode,graphSubcode:J.graphSubcode});if(Q!=="FINISHED")throw J;return this.mediaPublish(W,$)}if(N5(J)&&!Z)return await this.waitUntilFinished(W,$),this.mediaPublish(W,$);throw J}}async mediaPublish(W,Z){let $=await this.call("media_publish request",`/${this.accountId()}/media_publish`,{creation_id:W},Z,{retry:!1});return GW($,"media_publish request")}async permalink(W,Z){try{let $=await this.call("permalink request",`/${W}?fields=permalink`,void 0,Z,{retry:!1});return typeof $.permalink==="string"?$.permalink:void 0}catch{return}}async readStatus(W,Z){if(!/^\d+$/.test(W))_("A container id is a string of digits.");let $=await this.call("container status request",`/${W}?fields=status_code,status`,void 0,Z),J=$.status_code;if(typeof J!=="string"||!z5.has(J))throw new O("graph_error","Instagram's container status answered without a known status_code.",{status:200,containerId:W});let Q={id:W,statusCode:J};if(typeof $.status==="string"&&$.status!=="")Q.status=MW($.status);return Q}async waitUntilFinished(W,Z){let $=this.pollIntervalMs;for(;;){let{statusCode:J,status:Q}=await this.readStatus(W,Z);if(J==="FINISHED")return;if(J==="PUBLISHED")throw new O("invalid_input","That media container has been published already.",{containerId:W});if(J==="ERROR")throw new O("invalid_media",`Instagram could not process the media${Q?` (${Q})`:""}.`,{containerId:W});if(J==="EXPIRED")throw new O("expired","The media container expired before it was published.",{containerId:W});let Y=Z.deadline-Date.now();if(Y<=0)throw new O("timeout","Instagram had not finished processing the media in time; the container is still processing.",{containerId:W});await H5(Math.min($,Y),Z.signal),$=Math.min($*1.5,this.maxPollIntervalMs)}}async call(W,Z,$,J,{retry:Q=!0}={}){try{return await this.callOnce(W,Z,$,J)}catch(Y){if(!Q||!(Y instanceof O)||Y.code!=="transient")throw Y;return this.callOnce(W,Z,$,J)}}async callOnce(W,Z,$,J){J.signal?.throwIfAborted();let Q={method:$?"POST":"GET",signal:J.signal};if($){let z=new URLSearchParams;for(let[G,X]of Object.entries($))if(X!==void 0)z.set(G,X);Q.body=z}let Y;try{Y=await this.connection.fetch(`${this.version}${Z}`,Q)}catch(z){if(J.signal?.aborted)throw J.signal.reason;if(z instanceof TypeError)throw new O("transient",`Instagram's ${W} failed to reach Instagram.`);throw z}let K=E0(await Y.text().catch(()=>""));if(Y.ok)return K;throw L5(W,Y.status,K)}}var z5=new Set(["EXPIRED","ERROR","FINISHED","IN_PROGRESS","PUBLISHED"]),G5=new Set([4,17,32,613,80002]),X5=new Set([3,10]),B5=new Set([9004,352,36000,36001,36002,36003,36004]),j5=new Set([2207004,2207005,2207006,2207009,2207023,2207026,2207028,2207052]),F5=new Set([102,190,463,467]),M5=new Set([2207001,2207003,2207053]),zW={code:9007,subcode:2207027};function L5(W,Z,$){let J=$.error??{},Q=XW(J.code),Y=XW(J.error_subcode),K=typeof J.type==="string"&&J.type!==""?J.type:void 0,z=typeof J.message==="string"&&J.message!==""?`: ${MW(J.message)}`:"",G=[Q,Y].filter((j)=>j!==void 0).join("/"),X=`Instagram refused the ${W} (HTTP ${Z}${K?`, ${K}`:""}${G?` ${G}`:""})${z}`,B="graph_error";if(Y===2207042)B="quota_exceeded";else if(Y===2207010)B="invalid_input";else if(Q!==void 0&&G5.has(Q))B="rate_limited";else if(Q!==void 0&&F5.has(Q))B="reconnect_required";else if(Q!==void 0&&(X5.has(Q)||Q>=200&&Q<=299))B="permission_denied";else if(Q!==void 0&&B5.has(Q)||Y!==void 0&&j5.has(Y))B="invalid_media";else if(J.is_transient===!0||Q===1||Q===2||Y!==void 0&&M5.has(Y)||Z>=500||Z===429)B=Z===429?"rate_limited":"transient";return new O(B,X,{status:Z,graphCode:Q,graphSubcode:Y})}function N5(W){return W.graphCode===zW.code||W.graphSubcode===zW.subcode}function D5(W,Z){if(W.containerId)return W;return new O(W.code,W.message,{status:W.status,graphCode:W.graphCode,graphSubcode:W.graphSubcode,containerId:Z})}function MW(W){return W.replace(/access_token=[^&\s"']*/gi,"access_token=[redacted]").replace(/\b(?:IG|EAA)[A-Za-z0-9_-]{20,}/g,"[redacted]").slice(0,500)}function GW(W,Z){let $=W.id;if(typeof $==="string"&&$!=="")return $;if(typeof $==="number"&&Number.isSafeInteger($))return String($);throw new O("graph_error",`Instagram's ${Z} answered without an id.`,{status:200})}function XW(W){let Z=Number(W);return W!==void 0&&W!==null&&Number.isFinite(Z)?Z:void 0}function c0(W,Z){let $=Number(W);return W!==void 0&&W!==null&&Number.isFinite($)?$:Z}function H5(W,Z){return new Promise(($,J)=>{if(Z?.aborted)return J(Z.reason);let Q=()=>{clearTimeout(Y),J(Z?.reason)},Y=setTimeout(()=>{Z?.removeEventListener("abort",Q),$()},W);Z?.addEventListener("abort",Q,{once:!0})})}function _(W){throw new O("invalid_input",W)}function u0(W){if(W===void 0)return;if(typeof W!=="string")_("caption must be a string.");if([...W].length>f.captionLength)_(`A caption takes at most ${f.captionLength} characters.`);if((W.match(/#[\p{L}\p{N}_]+/gu)??[]).length>f.hashtags)_(`A caption takes at most ${f.hashtags} hashtags.`);if((W.match(/(?<![\p{L}\p{N}_.@])@[\p{L}\p{N}_.]+/gu)??[]).length>f.mentions)_(`A caption takes at most ${f.mentions} @mentions.`)}function U5(W){if(!Array.isArray(W)||W.length>f.userTags)_(`userTags takes at most ${f.userTags} tags.`);for(let Z of W){let $=(J)=>typeof J==="number"&&J>=0&&J<=1;if(typeof Z?.username!=="string"||Z.username===""||!$(Z.x)||!$(Z.y))_("Each user tag needs a username, and x and y between 0 and 1.")}}function BW(W,Z){let $=Z?.imageUrl!==void 0,J=Z?.videoUrl!==void 0;if($===J)_(`${W} takes exactly one of imageUrl and videoUrl.`);if($)q1(`${W}.imageUrl`,Z.imageUrl);else q1(`${W}.videoUrl`,Z.videoUrl)}function q1(W,Z){let $;try{$=new URL(Z)}catch{_(`${W} is not an absolute URL.`)}if($.protocol!=="https:")_(`${W} must be an https URL: Instagram fetches the media from it.`);let J=$.hostname.replace(/^\[|\]$/g,"").toLowerCase(),Q=jW(J);if(Q?FW(Q)!==null:!J.includes(".")||/(^|\.)(localhost|local|internal)$/.test(J))_(`${W} must be a public URL: Instagram fetches the media from it.`)}class d0{describe;rollout;when;serverOnly;salt;constructor(W={}){if(W.rollout!==void 0){let{rollout:Z}=W;if(!Number.isFinite(Z)||Z<0||Z>100)throw Error(`A feature's \`rollout\` must be a number between 0 and 100, received ${String(Z)}.`)}this.describe=W.describe,this.rollout=W.rollout,this.when=W.when,this.serverOnly=W.serverOnly??!1,this.salt=W.salt}}function x5(W={}){return new d0(W)}class LW extends l0{rows=new Map;constructor(W={}){super();for(let[Z,$]of Object.entries(W))this.rows.set(Z,{key:Z,active:$})}async load(){return[...this.rows.values()].map((W)=>({...W}))}async write(W,Z,$){return this.rows.set(W,{key:W,active:Z,updatedBy:$.actor,updatedAt:new Date}),{actorRecorded:!0}}}export{l8 as viewRouteConfigDefaults,eZ as translationConfigDefaults,M4 as toRangeHeaderValue,b5 as subjectFor,u5 as sniffContentType,hZ as scheduleConfigDefaults,D4 as resolveRange,x9 as redisConfigDefaults,D9 as rateLimiterConfigDefaults,jZ as queueConfigDefaults,J5 as parseMetaSignedRequest,D1 as parseContentRange,R5 as mintSessionToken,e8 as middlewareConfigDefaults,fZ as mcpCallOf,JZ as mailConfigDefaults,F9 as logConfigDefaults,S5 as isSessionToken,b8 as isFinalRunStatus,O6 as isBroadcastEvent,p5 as isActiveContentType,T5 as inRollout,m8 as imageConfigDefaults,m5 as filesystemConfigDefaults,J9 as featuresConfigDefaults,EZ as eventConfigDefaults,P5 as evaluateFeature,B8 as encodeCursor,i8 as documentScriptCspHash,pZ as discoverWorkflows,nZ as discoverListeners,uZ as discoverJobs,dZ as discoverCronJobs,lZ as discoverCommands,rZ as defineTranslationConfig,AZ as defineScheduleConfig,V8 as defineRunsConfig,p8 as defineRouteConfig,U9 as defineRedisConfig,N9 as defineRateLimiterConfig,BZ as defineQueueConfig,r8 as defineMiddlewareConfig,$Z as defineMailConfig,j9 as defineLogConfig,E8 as defineImageConfig,E5 as defineFilesystemConfig,$9 as defineFeaturesConfig,x5 as defineFeature,gZ as defineEventConfig,UW as defineEncryptionConfig,qZ as defineCommandConfig,IZ as defineCommand,G8 as defineChangeFeedConfig,l5 as defineCacheConfig,x8 as defineBroadcastConfig,k5 as defineAuthConfig,j8 as decodeCursor,GZ as createWorkflowTableStatements,v8 as createRunsTableStatements,vZ as commandConfigDefaults,X8 as changeFeedConfigDefaults,n5 as cacheConfigDefaults,V5 as bucketOf,C5 as bucketKey,O8 as broadcastConfigDefaults,w4 as bearerToken,f5 as authConfigDefaults,L4 as assertDeletablePrefix,d8 as apiRouteConfigDefaults,e6 as XOAuthProvider,xZ as WorkflowRuntime,HZ as WorkflowCancelledError,cZ as Workflow,NZ as WaitTimeoutError,a8 as ViewRouteDispatcher,y5 as UndeclaredFeatureError,a5 as TaggedCache,DZ as StepTimeoutError,LZ as StepFailedError,UZ as Step,LW as StaticFeatureFlagSource,g8 as Sharp,PZ as Scheduler,W9 as ScheduleServiceProvider,o8 as STATIC_NAVIGATION_CSP_HASH,U8 as SOCKET_ID_HEADER,O5 as SESSION_TOKEN_PREFIX,s0 as S3Driver,R9 as RunsServiceProvider,I8 as RunNotFoundError,A8 as RunManager,y8 as RunFailure,S9 as RouteServiceProvider,ZZ as ResendDriver,O9 as RedisServiceProvider,O4 as RedisRateLimiterTimeoutError,y1 as RedisRateLimiterDisconnectedError,e0 as RedisRateLimiter,I1 as RedisManager,s5 as RedisCacheStore,R8 as RedisBroadcastDriver,H9 as RateLimiterServiceProvider,U4 as RateLimiterDriver,_5 as RateLimiter,$1 as RangeNotSatisfiableError,iZ as QueueServiceProvider,OZ as QueueManager,z8 as ProviderConnection,H6 as PrismaMcpOAuthStore,f8 as PendingBroadcast,P8 as OPEN_RUN_STATUSES,Y8 as OAuthReconnectRequiredError,m as OAuthProvider,m0 as OAuthConnectionProvider,w1 as OAuthConnectionError,U as OAuthCallbackError,L9 as MiddlewareServiceProvider,u8 as MiddlewareRegistry,y as MetaSignedRequestError,FZ as MemoryWorkflowStore,w8 as MemoryRunStore,MZ as MemoryQueueDriver,D6 as MemoryMcpOAuthStore,KZ as MemoryLockStore,J8 as MemoryConnectionStore,M8 as MemoryChangeFeedDriver,i5 as MemoryCacheStore,S8 as MemoryBroadcastDriver,_Z as McpToolError,CZ as McpRegistry,L6 as McpOAuthServer,TZ as McpHttpServer,kZ as McpCallRefusedError,VZ as McpApiKeyResolver,Y9 as MailServiceProvider,QZ as MailManager,M9 as LogServiceProvider,d5 as LogManager,e5 as LockManager,t5 as LockLostError,mZ as Listener,B9 as KernelIdServiceProvider,n8 as KernelId,SZ as Job,H8 as InvalidChannelError,p0 as InstagramPublisher,O as InstagramPublishError,YW as InstagramOAuthProvider,F4 as InstagramConnectionProvider,I as InstagramApiError,K5 as Instagram,x4 as InMemoryRateLimiter,X9 as ImageServiceProvider,h8 as ImageOptimizationDriver,c8 as ImageManager,s8 as ISLAND_LOADER_CSP_HASH,f as INSTAGRAM_LIMITS,r5 as HeldLock,_6 as GoogleOAuthProvider,f6 as GitHubOAuthProvider,G9 as FilesystemServiceProvider,c5 as FilesystemManager,g5 as FileSystemDriver,H1 as FileStorageDriver,a as FileNotFoundError,Q9 as FeaturesServiceProvider,I5 as FeatureSourceReadOnlyError,A5 as FeatureScope,w5 as FeatureReloadError,v5 as FeatureModelMissingError,h5 as FeatureManager,q5 as FeatureFlagStore,l0 as FeatureFlagSource,d0 as Feature,T8 as FINAL_RUN_STATUSES,z9 as EventServiceProvider,w as EventManager,p1 as Event,K9 as EncryptionServiceProvider,Z8 as EncryptionKeyError,W8 as Encrypter,WZ as EmailDriver,$8 as DecryptionError,zZ as DatabaseWorkflowStore,q8 as DatabaseRunStore,XZ as DatabaseQueueDriver,YZ as DatabaseLockStore,Z9 as DatabaseFeatureFlagSource,Q8 as DatabaseConnectionStore,F8 as DatabaseChangeFeedDriver,RZ as DEFAULT_MCP_SCOPE,yZ as CronJob,K8 as ConnectionManager,_9 as CommandRegistry,bZ as CommandFailed,wZ as Command,D8 as ChangeFeedSubscription,aZ as ChangeFeedServiceProvider,N8 as ChangeFeedManager,L8 as ChangeFeedFullError,oZ as CacheServiceProvider,o5 as CacheManager,A1 as CONSENT_PAGE_HEADERS,sZ as BroadcastServiceProvider,C8 as BroadcastScope,_8 as BroadcastPayloadTooLargeError,k8 as BroadcastManager,S6 as BroadcastEvent,a0 as AzureBlobDriver,tZ as AuthServiceProvider,E1 as AuthManager,t8 as ApiRouteDispatcher};
|
|
70
|
+
`).filter((J)=>J).map((J)=>JSON.parse(J))}async usage(W={}){return this.get("usage/tweets",W)}community(W,Z={}){return this.get("communities/:id",Z,{params:{id:W}})}searchCommunities(W,Z={}){return this.get("communities/search",{query:W,...Z})}}class L1 extends F1{constructor(){super(...arguments);this._prefix=J1}get readOnly(){return this}}class N1 extends M1{constructor(){super(...arguments);this._prefix=d}get readOnly(){return this}get labs(){if(this._labs)return this._labs;return this._labs=new L1(this)}hideReply(W,Z){return this.put("tweets/:id/hidden",{hidden:Z},{params:{id:W}})}like(W,Z){return this.post("users/:id/likes",{tweet_id:Z},{params:{id:W}})}unlike(W,Z){return this.delete("users/:id/likes/:tweet_id",void 0,{params:{id:W,tweet_id:Z}})}retweet(W,Z){return this.post("users/:id/retweets",{tweet_id:Z},{params:{id:W}})}unretweet(W,Z){return this.delete("users/:id/retweets/:tweet_id",void 0,{params:{id:W,tweet_id:Z}})}tweet(W,Z={}){if(typeof W==="object")Z=W;else Z={text:W,...Z};return this.post("tweets",Z)}async uploadMedia(W,Z,$=1048576){let J=Z.media_category;if(!Z.media_category){if(Z.media_type.includes("gif"))J="tweet_gif";else if(Z.media_type.includes("image"))J="tweet_image";else if(Z.media_type.includes("video"))J="tweet_video"}let Q={additional_owners:Z.additional_owners,media_type:Z.media_type,total_bytes:W.length,media_category:J},K=(await this.post("media/upload/initialize",Q)).data.id,z=Math.ceil(W.length/$),G=new Uint8Array(W);for(let B=0;B<z;B++){let j=B*$,L=Math.min(j+$,W.length),H=G.slice(j,L),S=Buffer.from(H),o={segment_index:B,media:S};await this.post(`media/upload/${K}/append`,o,{forceBodyMode:"form-data"})}if((await this.post(`media/upload/${K}/finalize`)).data.processing_info)await this.waitForMediaProcessing(K);return K}async waitForMediaProcessing(W){var Z;let J=(await this.get("media/upload",{command:"STATUS",media_id:W})).data.processing_info;if(!J)return;switch(J.state){case"succeeded":return;case"failed":throw Error(`Media processing failed: ${(Z=J.error)===null||Z===void 0?void 0:Z.message}`);case"pending":case"in_progress":{let Q=J===null||J===void 0?void 0:J.check_after_secs;if(Q&&Q>0)await new Promise((Y)=>setTimeout(Y,Q*1000)),await this.waitForMediaProcessing(W)}}}createMediaMetadata(W,Z){return this.post("media/metadata",{id:W,metadata:Z})}reply(W,Z,$={}){var J;let Q={in_reply_to_tweet_id:Z,...(J=$.reply)!==null&&J!==void 0?J:{}};return this.post("tweets",{text:W,...$,reply:Q})}quote(W,Z,$={}){return this.tweet(W,{...$,quote_tweet_id:Z})}async tweetThread(W){var Z,$;let J=[];for(let Q of W){let Y=J.length?J[J.length-1]:null,K={...typeof Q==="string"?{text:Q}:Q},z=Y?Y.data.id:(Z=K.reply)===null||Z===void 0?void 0:Z.in_reply_to_tweet_id,G=($=K.text)!==null&&$!==void 0?$:"";if(z)J.push(await this.reply(G,z,K));else J.push(await this.tweet(G,K))}return J}deleteTweet(W){return this.delete("tweets/:id",void 0,{params:{id:W}})}async bookmark(W){let Z=await this.getCurrentUserV2Object();return this.post("users/:id/bookmarks",{tweet_id:W},{params:{id:Z.data.id}})}async deleteBookmark(W){let Z=await this.getCurrentUserV2Object();return this.delete("users/:id/bookmarks/:tweet_id",void 0,{params:{id:Z.data.id,tweet_id:W}})}follow(W,Z){return this.post("users/:id/following",{target_user_id:Z},{params:{id:W}})}unfollow(W,Z){return this.delete("users/:source_user_id/following/:target_user_id",void 0,{params:{source_user_id:W,target_user_id:Z}})}block(W,Z){return this.post("users/:id/blocking",{target_user_id:Z},{params:{id:W}})}unblock(W,Z){return this.delete("users/:source_user_id/blocking/:target_user_id",void 0,{params:{source_user_id:W,target_user_id:Z}})}mute(W,Z){return this.post("users/:id/muting",{target_user_id:Z},{params:{id:W}})}unmute(W,Z){return this.delete("users/:source_user_id/muting/:target_user_id",void 0,{params:{source_user_id:W,target_user_id:Z}})}createList(W){return this.post("lists",W)}updateList(W,Z={}){return this.put("lists/:id",Z,{params:{id:W}})}removeList(W){return this.delete("lists/:id",void 0,{params:{id:W}})}addListMember(W,Z){return this.post("lists/:id/members",{user_id:Z},{params:{id:W}})}removeListMember(W,Z){return this.delete("lists/:id/members/:user_id",void 0,{params:{id:W,user_id:Z}})}subscribeToList(W,Z){return this.post("users/:id/followed_lists",{list_id:Z},{params:{id:W}})}unsubscribeOfList(W,Z){return this.delete("users/:id/followed_lists/:list_id",void 0,{params:{id:W,list_id:Z}})}pinList(W,Z){return this.post("users/:id/pinned_lists",{list_id:Z},{params:{id:W}})}unpinList(W,Z){return this.delete("users/:id/pinned_lists/:list_id",void 0,{params:{id:W,list_id:Z}})}sendDmInConversation(W,Z){return this.post("dm_conversations/:dm_conversation_id/messages",Z,{params:{dm_conversation_id:W}})}sendDmToParticipant(W,Z){return this.post("dm_conversations/with/:participant_id/messages",Z,{params:{participant_id:W}})}createDmConversation(W){return this.post("dm_conversations",W)}}class l6 extends L1{constructor(){super(...arguments);this._prefix=J1}get readWrite(){return this}}var n6=l6;class i6 extends N1{constructor(){super(...arguments);this._prefix=d}get readWrite(){return this}get labs(){if(this._labs)return this._labs;return this._labs=new n6(this)}}var s6=i6;class P1 extends i{get v1(){if(this._v1)return this._v1;return this._v1=new X1(this)}get v2(){if(this._v2)return this._v2;return this._v2=new M1(this)}async currentUser(W=!1){return await this.getCurrentUserObject(W)}async currentUserV2(W=!1){return await this.getCurrentUserV2Object(W)}search(W,Z){return this.v2.search(W,Z)}async generateAuthLink(W="oob",{authAccessType:Z,linkMode:$="authenticate",forceLogin:J,screenName:Q}={}){let Y=await this.post("https://api.x.com/oauth/request_token",{oauth_callback:W,x_auth_access_type:Z}),K=`https://api.x.com/oauth/${$}?oauth_token=${encodeURIComponent(Y.oauth_token)}`;if(J!==void 0)K+=`&force_login=${encodeURIComponent(J)}`;if(Q!==void 0)K+=`&screen_name=${encodeURIComponent(Q)}`;if(this._requestMaker.hasPlugins())this._requestMaker.applyPluginMethod("onOAuth1RequestToken",{client:this._requestMaker,url:K,oauthResult:Y});return{url:K,...Y}}async login(W){let Z=this.getActiveTokens();if(Z.type!=="oauth-1.0a")throw Error("You must setup TwitterApi instance with consumer keys to accept OAuth 1.0 login");let $=await this.post("https://api.x.com/oauth/access_token",{oauth_token:Z.accessToken,oauth_verifier:W}),J=new this.constructor({appKey:Z.appKey,appSecret:Z.appSecret,accessToken:$.oauth_token,accessSecret:$.oauth_token_secret},this._requestMaker.clientSettings);return{accessToken:$.oauth_token,accessSecret:$.oauth_token_secret,userId:$.user_id,screenName:$.screen_name,client:J}}async appLogin(){let W=this.getActiveTokens();if(W.type!=="oauth-1.0a")throw Error("You must setup TwitterApi instance with consumer keys to accept app-only login");let $=await new this.constructor({username:W.appKey,password:W.appSecret},this._requestMaker.clientSettings).post("https://api.x.com/oauth2/token",{grant_type:"client_credentials"});return new this.constructor($.access_token,this._requestMaker.clientSettings)}generateOAuth2AuthLink(W,Z={}){var $,J;if(!this._requestMaker.clientId)throw Error("Twitter API instance is not initialized with client ID. You can find your client ID in Twitter Developer Portal. Please build an instance with: new TwitterApi({ clientId: '<yourClientId>' })");let Q=($=Z.state)!==null&&$!==void 0?$:Z1.generateRandomString(32),Y=Z1.getCodeVerifier(),K=Z1.getCodeChallengeFromVerifier(Y),z=(J=Z.scope)!==null&&J!==void 0?J:"",G=Array.isArray(z)?z.join(" "):z,X=new URL("https://x.com/i/oauth2/authorize"),B={response_type:"code",client_id:this._requestMaker.clientId,redirect_uri:W,state:Q,code_challenge:K,code_challenge_method:"s256",scope:G};T.addQueryParamsToUrl(X,B);let j={url:X.toString(),state:Q,codeVerifier:Y,codeChallenge:K};if(this._requestMaker.hasPlugins())this._requestMaker.applyPluginMethod("onOAuth2RequestToken",{client:this._requestMaker,result:j,redirectUri:W});return j}async loginWithOAuth2({code:W,codeVerifier:Z,redirectUri:$}){if(!this._requestMaker.clientId)throw Error("Twitter API instance is not initialized with client ID. Please build an instance with: new TwitterApi({ clientId: '<yourClientId>' })");let J=await this.post("https://api.x.com/2/oauth2/token",{code:W,code_verifier:Z,redirect_uri:$,grant_type:"authorization_code",client_id:this._requestMaker.clientId,client_secret:this._requestMaker.clientSecret});return this.parseOAuth2AccessTokenResult(J)}async refreshOAuth2Token(W){if(!this._requestMaker.clientId)throw Error("Twitter API instance is not initialized with client ID. Please build an instance with: new TwitterApi({ clientId: '<yourClientId>' })");let Z=await this.post("https://api.x.com/2/oauth2/token",{refresh_token:W,grant_type:"refresh_token",client_id:this._requestMaker.clientId,client_secret:this._requestMaker.clientSecret});return this.parseOAuth2AccessTokenResult(Z)}async revokeOAuth2Token(W,Z="access_token"){if(!this._requestMaker.clientId)throw Error("Twitter API instance is not initialized with client ID. Please build an instance with: new TwitterApi({ clientId: '<yourClientId>' })");return await this.post("https://api.x.com/2/oauth2/revoke",{client_id:this._requestMaker.clientId,client_secret:this._requestMaker.clientSecret,token:W,token_type_hint:Z})}parseOAuth2AccessTokenResult(W){let Z=new this.constructor(W.access_token,this._requestMaker.clientSettings),$=W.scope.split(" ").filter((J)=>J);return{client:Z,expiresIn:W.expires_in,accessToken:W.access_token,scope:$,refreshToken:W.refresh_token}}}class b1 extends P1{get v1(){if(this._v1)return this._v1;return this._v1=new B1(this)}get v2(){if(this._v2)return this._v2;return this._v2=new N1(this)}get readOnly(){return this}}class J4 extends P{constructor(){super(...arguments);this._prefix=Q1}}class Q4 extends J4{constructor(){super(...arguments);this._prefix=Q1}get readOnly(){return this}}class Y4 extends P{constructor(){super(...arguments);this._prefix=Y1}}class K4 extends Y4{constructor(){super(...arguments);this._prefix=Y1}get readOnly(){return this}}class o6 extends K4{constructor(){super(...arguments);this._prefix=Y1}get readWrite(){return this}}var a6=o6;class t6 extends Q4{constructor(){super(...arguments);this._prefix=Q1}get readWrite(){return this}get sandbox(){if(this._sandbox)return this._sandbox;return this._sandbox=new a6(this)}}var r6=t6;class z4 extends b1{get v1(){if(this._v1)return this._v1;return this._v1=new e1(this)}get v2(){if(this._v2)return this._v2;return this._v2=new s6(this)}get readWrite(){return this}get ads(){if(this._ads)return this._ads;return this._ads=new r6(this)}static getErrors(W){var Z;if(typeof W!=="object")return[];if(!("data"in W))return[];return(Z=W.data.errors)!==null&&Z!==void 0?Z:[]}static getProfileImageInSize(W,Z){let $=W.split("/").pop(),J=["normal","bigger","mini"],Q=W;for(let K of J)if($.includes(`_${K}`)){Q=W.replace(`_${K}`,"");break}if(Z==="original")return Q;let Y=Q.lastIndexOf(".");if(Y!==-1){let K=Q.slice(Y+1);return Q.slice(0,Y)+"_"+Z+"."+K}else return Q+"_"+Z}}var W5={clientId:process.env.X_CLIENT_ID,clientSecret:process.env.X_SECRET,redirectPath:"/auth/oauth/x/callback",scope:["tweet.read","users.read","offline.access"]};class e6 extends m{config;client;constructor(W={}){super();this.config={...W5,...W},this.client=new z4({clientId:this.config.clientId,clientSecret:this.config.clientSecret})}redirectUri(){return`${V()??""}${this.config.redirectPath}`}clientFor(W){return p(this,W,{name:"XOAuthProvider",resolve:this.config.resolve,clientId:this.config.clientId,clientSecret:this.config.clientSecret,redirectPath:this.config.redirectPath,staticRedirectUri:()=>this.redirectUri(),staticOrigin:()=>V()??""})}staticClient(){return{clientId:this.config.clientId,clientSecret:this.config.clientSecret,redirectUri:this.redirectUri()}}getRedirectUrl(W,Z){if(!Z)throw Error("XOAuthProvider needs the state and PKCE challenge gemi passes.");if(!this.config.resolve)return this.authorizationUrl(this.staticClient(),Z);return this.clientFor(W??null).then(($)=>{if(!$)throw Error("XOAuthProvider is not offered on this request.");return this.authorizationUrl($,Z)})}authorizationUrl(W,Z){let $=new URL("https://x.com/i/oauth2/authorize"),J={response_type:"code",client_id:W.clientId,redirect_uri:W.redirectUri,state:Z.state,code_challenge:Z.codeChallenge,code_challenge_method:Z.codeChallengeMethod,scope:this.config.scope.join(" ")};for(let[Q,Y]of Object.entries(J))$.searchParams.set(Q,Y);return $.toString()}async onCallback(W,Z){let $=W.search.get("code");if(!$)throw new U("missing_code");if(!Z?.codeVerifier)throw new U("invalid_state");let J=this.config.resolve?await this.clientFor(W):this.staticClient();if(!J)throw new U("unknown_provider");let Q=this.config.resolve?new z4({clientId:J.clientId,clientSecret:J.clientSecret}):this.client,Y;try{Y=await Q.loginWithOAuth2({code:$,codeVerifier:Z.codeVerifier,redirectUri:J.redirectUri})}catch(j){throw console.error("X OAuth error: token exchange failed",j),new U("exchange_failed")}let{data:K}=await Y.client.v2.me({"user.fields":["name","username","entities"]}),{name:z,email:G,id:X="",username:B}=K??{};return{name:z,email:G,username:B,providerId:X}}}var ZW=["instagram_business_basic"],g={authorizeUrl:"https://www.instagram.com/oauth/authorize",tokenUrl:"https://api.instagram.com/oauth/access_token",graphUrl:"https://graph.instagram.com"};class I extends Error{status;type;code;constructor(W,Z,$,J,Q){super(W,Q);this.status=Z;this.type=$;this.code=J;this.name="InstagramApiError"}}async function G4(W){let Z=new URLSearchParams({client_id:W.clientId,client_secret:W.clientSecret,grant_type:"authorization_code",redirect_uri:W.redirectUri,code:W.code.replace(/#_$/,"")}),$=await B4(W.tokenUrl??g.tokenUrl,"code exchange",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:Z.toString()}),J=Array.isArray($.data)?$.data[0]:$,Q=J?.access_token;if(typeof Q!=="string"||Q==="")throw new I("Instagram's code exchange answered without an access token.",200);let Y=J?.permissions;return{accessToken:Q,userId:g0(J?.user_id),permissions:Array.isArray(Y)?Y.map(String):typeof Y==="string"?Y.split(/[\s,]+/).filter(Boolean):null}}async function $W(W){let Z=new URL("/access_token",W.graphUrl??g.graphUrl);return Z.searchParams.set("grant_type","ig_exchange_token"),Z.searchParams.set("client_secret",W.clientSecret),Z.searchParams.set("access_token",W.accessToken),QW(await B4(Z.toString(),"long-lived token exchange",{method:"GET"}))}async function JW(W){let Z=new URL("/refresh_access_token",W.graphUrl??g.graphUrl);return Z.searchParams.set("grant_type","ig_refresh_token"),Z.searchParams.set("access_token",W.accessToken),QW(await B4(Z.toString(),"token refresh",{method:"GET"}))}async function X4(W){let Z=W.graphApiVersion?`/${W.graphApiVersion.replace(/^\/+|\/+$/g,"")}`:"",$=new URL(`${Z}/me`,W.graphUrl??g.graphUrl);$.searchParams.set("fields",(W.fields??["user_id","username","name","account_type","profile_picture_url"]).join(",")),$.searchParams.set("access_token",W.accessToken);let J=await B4($.toString(),"profile request",{method:"GET"}),Q=Array.isArray(J.data)?J.data[0]:J,Y=g0(Q?.user_id);if(!Y)throw new I("Instagram's /me answered without a user_id.",200);let K={user_id:Y},z=g0(Q?.id);if(z)K.id=z;for(let G of["username","name","account_type","profile_picture_url"]){let X=Q?.[G];if(typeof X==="string"&&X!=="")K[G]=X}return K}function QW(W){if(typeof W.access_token!=="string"||W.access_token==="")throw new I("Instagram answered without an access token.",200);let Z=Number(W.expires_in);return{accessToken:W.access_token,tokenType:typeof W.token_type==="string"?W.token_type:null,expiresIn:Number.isFinite(Z)&&Z>0?Z:null}}async function B4(W,Z,$){let J;try{J=await fetch(W,{...$,redirect:"error"})}catch(Y){throw new I(`Instagram's ${Z} failed to reach Instagram.`,void 0,void 0,void 0,{cause:Y})}let Q=E0(await J.text().catch(()=>""));if(!J.ok){let Y=Q.error??{},K=WW(Q.error_type)??WW(Y.type),z=Number(Q.code??Y.code);throw new I(`Instagram refused the ${Z} (HTTP ${J.status}${K?`, ${K}`:""}${Number.isFinite(z)?` ${z}`:""}).`,J.status,K,Number.isFinite(z)?z:void 0)}return Q}function E0(W){try{let Z=JSON.parse(W.replace(/("(?:user_id|id)"\s*:\s*)(-?\d+)(?=\s*[,}\]])/g,'$1"$2"'));return Z&&typeof Z==="object"?Z:{}}catch{return{}}}function g0(W){if(typeof W==="string"&&W!=="")return W;if(typeof W==="number"&&Number.isSafeInteger(W))return String(W);return null}function WW(W){return typeof W==="string"&&W!==""?W:void 0}class YW extends m{createUsersWithoutEmail=!0;linkByEmail=!1;config;constructor(W={}){super();this.config={clientId:process.env.INSTAGRAM_CLIENT_ID??"",clientSecret:process.env.INSTAGRAM_CLIENT_SECRET??"",scopes:ZW,redirectPath:"/auth/oauth/instagram/callback",authorizationParams:{},...W}}redirectUri(){return`${V()??""}${this.config.redirectPath}`}clientFor(W){return p(this,W,{name:"InstagramOAuthProvider",resolve:this.config.resolve,clientId:this.config.clientId,clientSecret:this.config.clientSecret,redirectPath:this.config.redirectPath,staticRedirectUri:()=>this.redirectUri(),staticOrigin:()=>V()??""})}staticClient(){return{clientId:this.config.clientId,clientSecret:this.config.clientSecret,redirectUri:this.redirectUri()}}getRedirectUrl(W,Z){if(!this.config.resolve)return this.authorizationUrl(this.staticClient(),Z);return this.clientFor(W??null).then(($)=>{if(!$)throw Error("InstagramOAuthProvider is not offered on this request.");return this.authorizationUrl($,Z)})}authorizationUrl(W,Z){let $=new URL(this.config.authorizeUrl??g.authorizeUrl),J={...this.config.authorizationParams,client_id:W.clientId,redirect_uri:W.redirectUri,response_type:"code",scope:this.config.scopes.join(",")};if(Z)J.state=Z.state;for(let[Q,Y]of Object.entries(J))$.searchParams.set(Q,Y);return $.toString()}async onCallback(W){let Z=W.search.get("code");if(!Z)throw new U("missing_code");let $=this.config.resolve?await this.clientFor(W):this.staticClient();if(!$)throw new U("unknown_provider");let J;try{let Q=await G4({code:Z,clientId:$.clientId,clientSecret:$.clientSecret,redirectUri:$.redirectUri,tokenUrl:this.config.tokenUrl});J=await X4({accessToken:Q.accessToken,graphUrl:this.config.graphUrl,graphApiVersion:this.config.graphApiVersion,fields:["user_id","username","name"]})}catch(Q){if(Q instanceof I)throw console.error(`Instagram OAuth error: ${Q.message}`),new U("exchange_failed");throw Q}return{providerId:J.user_id,username:J.username,name:J.name||J.username}}}import{createHmac as Z5,timingSafeEqual as $5}from"crypto";class y extends Error{reason;constructor(W,Z){super(Z);this.reason=W;this.name="MetaSignedRequestError"}}function J5(W,Z,$={}){if(!Z)throw Error("parseMetaSignedRequest needs the app secret.");if(typeof W!=="string")throw new y("malformed","No signed_request was given.");let J=W.indexOf(".");if(J<=0||J===W.length-1||W.indexOf(".",J+1)!==-1)throw new y("malformed","A signed_request is <signature>.<payload>.");let Q=W.slice(0,J),Y=W.slice(J+1);if(!/^[A-Za-z0-9_-]+={0,2}$/.test(Q)||!/^[A-Za-z0-9_-]+={0,2}$/.test(Y))throw new y("malformed","A signed_request is base64url.");let K=Z5("sha256",Z).update(Y).digest(),z=Buffer.from(Q,"base64url");if(z.length!==K.length||!$5(z,K))throw new y("bad_signature","The signed_request's signature does not match the app secret.");let G;try{let L=Buffer.from(Y,"base64url").toString("utf8").replace(/("user_id"\s*:\s*)(-?\d+)(?=\s*[,}])/g,'$1"$2"');G=JSON.parse(L)}catch{throw new y("malformed","The signed_request's payload is not JSON.")}if(!G||typeof G!=="object")throw new y("malformed","The signed_request's payload is not an object.");if(String(G.algorithm??"").toUpperCase()!=="HMAC-SHA256")throw new y("unsupported_algorithm","Only HMAC-SHA256 signed_requests are accepted.");let X=Math.floor(($.now??Date.now())/1000),B=Number(G.expires);if(Number.isFinite(B)&&B>0&&B<X)throw new y("expired","The signed_request has expired.");let j=G.user_id;if((typeof j!=="string"||j==="")&&typeof j!=="number")throw new y("missing_user","The signed_request names no user.");return{...G,algorithm:String(G.algorithm),user_id:String(j)}}var Q5=86400000;class F4 extends m0{instagram;constructor(W={}){let Z={authorizeUrl:W.authorizeUrl??g.authorizeUrl,tokenUrl:W.tokenUrl??g.tokenUrl,graphUrl:W.graphUrl??g.graphUrl,graphApiVersion:W.graphApiVersion};super({authorizeUrl:Z.authorizeUrl,tokenUrl:Z.tokenUrl,clientId:W.clientId??process.env.INSTAGRAM_CLIENT_ID??"",clientSecret:W.clientSecret??process.env.INSTAGRAM_CLIENT_SECRET??"",scopes:W.scopes??["instagram_business_basic","instagram_business_content_publish"],scopeSeparator:",",pkce:!1,authorizationParams:W.authorizationParams??{},redirectUri:W.redirectUri,apiBaseUrl:Z.graphUrl,refreshLeewaySeconds:W.refreshLeewaySeconds??864000,multiple:W.multiple??!1,tokenPlacement:"query",isTokenRejected:Y5,refreshStrategy:async($)=>{if(Date.now()-$.issuedAt.getTime()<Q5){if($.reason==="rejected")throw new w1("refresh_failed","Instagram refused the access token (OAuthException 190).",{status:401});return null}let J=await j4("refresh_failed",()=>JW({accessToken:$.accessToken,graphUrl:Z.graphUrl}));return{accessToken:J.accessToken,refreshToken:null,tokenType:J.tokenType,expiresAt:J.expiresIn===null?null:new Date(Date.now()+J.expiresIn*1000),scopes:$.scopes,providerAccountId:$.providerAccountId}}});this.instagram=Z}async exchangeCode(W){let Z=await j4("exchange_failed",()=>G4({code:W.code,clientId:this.config.clientId,clientSecret:this.config.clientSecret,redirectUri:W.redirectUri,tokenUrl:this.instagram.tokenUrl})),$=await j4("exchange_failed",()=>$W({accessToken:Z.accessToken,clientSecret:this.config.clientSecret,graphUrl:this.instagram.graphUrl})),J=await j4("exchange_failed",()=>X4({accessToken:$.accessToken,graphUrl:this.instagram.graphUrl,graphApiVersion:this.instagram.graphApiVersion}));return{accessToken:$.accessToken,refreshToken:null,tokenType:$.tokenType,expiresAt:$.expiresIn===null?null:new Date(Date.now()+$.expiresIn*1000),scopes:Z.permissions??this.config.scopes,providerAccountId:J.user_id,profile:{...J}}}refresh(){return Promise.reject(new w1("refresh_failed","Instagram connections renew the access token itself; call connection.refresh()."))}}async function Y5(W){if(W.status===401)return!0;if(W.status!==400)return!1;let Z=await W.clone().json().catch(()=>null);return Number(Z?.error?.code)===190}async function j4(W,Z){try{return await Z()}catch($){if($ instanceof I)throw new w1(W,$.message,{cause:$,status:$.status===200?502:$.status});throw $}}class O extends Error{code;status;graphCode;graphSubcode;containerId;constructor(W,Z,$={}){super(Z);this.code=W;this.name="InstagramPublishError",this.status=$.status,this.graphCode=$.graphCode,this.graphSubcode=$.graphSubcode,this.containerId=$.containerId}}var f={captionLength:2200,hashtags:30,mentions:20,userTags:20,carouselMin:2,carouselMax:10},KW="instagram_business_content_publish",K5={for(W,Z={}){return new p0(W,Z)}};class p0{connection;version;pollIntervalMs;maxPollIntervalMs;timeoutMs;constructor(W,Z={}){this.connection=W;let $=W.connectionProvider();if(!($ instanceof F4))throw TypeError(`Instagram.for() takes an Instagram connection; "${W.provider}" is not an InstagramConnectionProvider.`);let J=Z.graphApiVersion??$.instagram.graphApiVersion;this.version=J?`/${J.replace(/^\/+|\/+$/g,"")}`:"",this.pollIntervalMs=Z.pollIntervalMs??2000,this.maxPollIntervalMs=Z.maxPollIntervalMs??1e4,this.timeoutMs=Z.timeoutMs??300000}async publishImage(W,Z={}){if(q1("imageUrl",W.imageUrl),u0(W.caption),W.altText!==void 0&&typeof W.altText!=="string")_("altText must be a string.");if(W.userTags!==void 0)U5(W.userTags);let $=this.start(Z),J=await this.createContainer({image_url:W.imageUrl,caption:W.caption,alt_text:W.altText,user_tags:W.userTags?JSON.stringify(W.userTags):void 0,location_id:W.locationId},$);return this.publishContainer(J,!1,$)}async publishCarousel(W,Z={}){let $=W.items;if(!Array.isArray($)||$.length<f.carouselMin||$.length>f.carouselMax)_(`A carousel takes ${f.carouselMin} to ${f.carouselMax} items.`);$.forEach((z,G)=>BW(`items[${G}]`,z)),u0(W.caption);let J=this.start(Z),Q=[];for(let z of $)Q.push(await this.createContainer(z.videoUrl!==void 0?{media_type:"VIDEO",video_url:z.videoUrl,is_carousel_item:"true"}:{image_url:z.imageUrl,is_carousel_item:"true"},J));for(let[z,G]of $.entries())if(G.videoUrl!==void 0)await this.waitUntilFinished(Q[z],J);let Y=$.some((z)=>z.videoUrl!==void 0),K=await this.createContainer({media_type:"CAROUSEL",children:Q.join(","),caption:W.caption},J);return this.publishContainer(K,Y,J)}async publishReel(W,Z={}){if(q1("videoUrl",W.videoUrl),W.coverUrl!==void 0)q1("coverUrl",W.coverUrl);if(u0(W.caption),W.thumbOffset!==void 0&&!(Number.isInteger(W.thumbOffset)&&W.thumbOffset>=0))_("thumbOffset must be a whole number of milliseconds, 0 or more.");let $=this.start(Z),J=await this.createContainer({media_type:"REELS",video_url:W.videoUrl,caption:W.caption,cover_url:W.coverUrl,share_to_feed:W.shareToFeed===void 0?void 0:String(W.shareToFeed),thumb_offset:W.thumbOffset===void 0?void 0:String(W.thumbOffset)},$);return this.publishContainer(J,!0,$)}async publishStory(W,Z={}){BW("story",W);let $=this.start(Z),J=W.videoUrl!==void 0,Q=await this.createContainer(J?{media_type:"STORIES",video_url:W.videoUrl}:{media_type:"STORIES",image_url:W.imageUrl},$);return this.publishContainer(Q,J,$)}async publishingLimit(W={}){let Z=this.start(W),$=await this.call("publishing limit request",`/${this.accountId()}/content_publishing_limit?fields=quota_usage,config`,void 0,Z),J=Array.isArray($.data)?$.data[0]:$,Q=J?.config??{},Y=c0(J?.quota_usage,0),K=c0(Q.quota_total,100);return{quotaUsage:Y,quotaTotal:K,quotaDurationSeconds:c0(Q.quota_duration,86400),remaining:Math.max(0,K-Y)}}async containerStatus(W,Z={}){return this.readStatus(W,this.start(Z))}start(W){if(W.signal?.throwIfAborted(),!this.connection.hasScopes(KW))throw new O("permission_denied",`The Instagram connection was not granted ${KW}; connect it again with that scope.`);return{signal:W.signal,deadline:Date.now()+(W.timeoutMs??this.timeoutMs)}}accountId(){let W=this.connection.providerAccountId;if(!W)throw new O("invalid_input","The Instagram connection has no account id (providerAccountId).");return W}async createContainer(W,Z){let $=await this.call("media container request",`/${this.accountId()}/media`,W,Z);return GW($,"media container request")}async publishContainer(W,Z,$){try{if(Z)await this.waitUntilFinished(W,$);let J=await this.publishOnce(W,Z,$);return{mediaId:J,permalink:await this.permalink(J,$)}}catch(J){throw J instanceof O?D5(J,W):J}}async publishOnce(W,Z,$){try{return await this.mediaPublish(W,$)}catch(J){if(!(J instanceof O))throw J;if(J.code==="transient"){let{statusCode:Q}=await this.readStatus(W,$);if(Q==="PUBLISHED")throw new O("unconfirmed","Instagram's media_publish failed, but the container reads PUBLISHED: the post is probably live. Do not publish it again.",{status:J.status,graphCode:J.graphCode,graphSubcode:J.graphSubcode});if(Q!=="FINISHED")throw J;return this.mediaPublish(W,$)}if(N5(J)&&!Z)return await this.waitUntilFinished(W,$),this.mediaPublish(W,$);throw J}}async mediaPublish(W,Z){let $=await this.call("media_publish request",`/${this.accountId()}/media_publish`,{creation_id:W},Z,{retry:!1});return GW($,"media_publish request")}async permalink(W,Z){try{let $=await this.call("permalink request",`/${W}?fields=permalink`,void 0,Z,{retry:!1});return typeof $.permalink==="string"?$.permalink:void 0}catch{return}}async readStatus(W,Z){if(!/^\d+$/.test(W))_("A container id is a string of digits.");let $=await this.call("container status request",`/${W}?fields=status_code,status`,void 0,Z),J=$.status_code;if(typeof J!=="string"||!z5.has(J))throw new O("graph_error","Instagram's container status answered without a known status_code.",{status:200,containerId:W});let Q={id:W,statusCode:J};if(typeof $.status==="string"&&$.status!=="")Q.status=MW($.status);return Q}async waitUntilFinished(W,Z){let $=this.pollIntervalMs;for(;;){let{statusCode:J,status:Q}=await this.readStatus(W,Z);if(J==="FINISHED")return;if(J==="PUBLISHED")throw new O("invalid_input","That media container has been published already.",{containerId:W});if(J==="ERROR")throw new O("invalid_media",`Instagram could not process the media${Q?` (${Q})`:""}.`,{containerId:W});if(J==="EXPIRED")throw new O("expired","The media container expired before it was published.",{containerId:W});let Y=Z.deadline-Date.now();if(Y<=0)throw new O("timeout","Instagram had not finished processing the media in time; the container is still processing.",{containerId:W});await H5(Math.min($,Y),Z.signal),$=Math.min($*1.5,this.maxPollIntervalMs)}}async call(W,Z,$,J,{retry:Q=!0}={}){try{return await this.callOnce(W,Z,$,J)}catch(Y){if(!Q||!(Y instanceof O)||Y.code!=="transient")throw Y;return this.callOnce(W,Z,$,J)}}async callOnce(W,Z,$,J){J.signal?.throwIfAborted();let Q={method:$?"POST":"GET",signal:J.signal};if($){let z=new URLSearchParams;for(let[G,X]of Object.entries($))if(X!==void 0)z.set(G,X);Q.body=z}let Y;try{Y=await this.connection.fetch(`${this.version}${Z}`,Q)}catch(z){if(J.signal?.aborted)throw J.signal.reason;if(z instanceof TypeError)throw new O("transient",`Instagram's ${W} failed to reach Instagram.`);throw z}let K=E0(await Y.text().catch(()=>""));if(Y.ok)return K;throw L5(W,Y.status,K)}}var z5=new Set(["EXPIRED","ERROR","FINISHED","IN_PROGRESS","PUBLISHED"]),G5=new Set([4,17,32,613,80002]),X5=new Set([3,10]),B5=new Set([9004,352,36000,36001,36002,36003,36004]),j5=new Set([2207004,2207005,2207006,2207009,2207023,2207026,2207028,2207052]),F5=new Set([102,190,463,467]),M5=new Set([2207001,2207003,2207053]),zW={code:9007,subcode:2207027};function L5(W,Z,$){let J=$.error??{},Q=XW(J.code),Y=XW(J.error_subcode),K=typeof J.type==="string"&&J.type!==""?J.type:void 0,z=typeof J.message==="string"&&J.message!==""?`: ${MW(J.message)}`:"",G=[Q,Y].filter((j)=>j!==void 0).join("/"),X=`Instagram refused the ${W} (HTTP ${Z}${K?`, ${K}`:""}${G?` ${G}`:""})${z}`,B="graph_error";if(Y===2207042)B="quota_exceeded";else if(Y===2207010)B="invalid_input";else if(Q!==void 0&&G5.has(Q))B="rate_limited";else if(Q!==void 0&&F5.has(Q))B="reconnect_required";else if(Q!==void 0&&(X5.has(Q)||Q>=200&&Q<=299))B="permission_denied";else if(Q!==void 0&&B5.has(Q)||Y!==void 0&&j5.has(Y))B="invalid_media";else if(J.is_transient===!0||Q===1||Q===2||Y!==void 0&&M5.has(Y)||Z>=500||Z===429)B=Z===429?"rate_limited":"transient";return new O(B,X,{status:Z,graphCode:Q,graphSubcode:Y})}function N5(W){return W.graphCode===zW.code||W.graphSubcode===zW.subcode}function D5(W,Z){if(W.containerId)return W;return new O(W.code,W.message,{status:W.status,graphCode:W.graphCode,graphSubcode:W.graphSubcode,containerId:Z})}function MW(W){return W.replace(/access_token=[^&\s"']*/gi,"access_token=[redacted]").replace(/\b(?:IG|EAA)[A-Za-z0-9_-]{20,}/g,"[redacted]").slice(0,500)}function GW(W,Z){let $=W.id;if(typeof $==="string"&&$!=="")return $;if(typeof $==="number"&&Number.isSafeInteger($))return String($);throw new O("graph_error",`Instagram's ${Z} answered without an id.`,{status:200})}function XW(W){let Z=Number(W);return W!==void 0&&W!==null&&Number.isFinite(Z)?Z:void 0}function c0(W,Z){let $=Number(W);return W!==void 0&&W!==null&&Number.isFinite($)?$:Z}function H5(W,Z){return new Promise(($,J)=>{if(Z?.aborted)return J(Z.reason);let Q=()=>{clearTimeout(Y),J(Z?.reason)},Y=setTimeout(()=>{Z?.removeEventListener("abort",Q),$()},W);Z?.addEventListener("abort",Q,{once:!0})})}function _(W){throw new O("invalid_input",W)}function u0(W){if(W===void 0)return;if(typeof W!=="string")_("caption must be a string.");if([...W].length>f.captionLength)_(`A caption takes at most ${f.captionLength} characters.`);if((W.match(/#[\p{L}\p{N}_]+/gu)??[]).length>f.hashtags)_(`A caption takes at most ${f.hashtags} hashtags.`);if((W.match(/(?<![\p{L}\p{N}_.@])@[\p{L}\p{N}_.]+/gu)??[]).length>f.mentions)_(`A caption takes at most ${f.mentions} @mentions.`)}function U5(W){if(!Array.isArray(W)||W.length>f.userTags)_(`userTags takes at most ${f.userTags} tags.`);for(let Z of W){let $=(J)=>typeof J==="number"&&J>=0&&J<=1;if(typeof Z?.username!=="string"||Z.username===""||!$(Z.x)||!$(Z.y))_("Each user tag needs a username, and x and y between 0 and 1.")}}function BW(W,Z){let $=Z?.imageUrl!==void 0,J=Z?.videoUrl!==void 0;if($===J)_(`${W} takes exactly one of imageUrl and videoUrl.`);if($)q1(`${W}.imageUrl`,Z.imageUrl);else q1(`${W}.videoUrl`,Z.videoUrl)}function q1(W,Z){let $;try{$=new URL(Z)}catch{_(`${W} is not an absolute URL.`)}if($.protocol!=="https:")_(`${W} must be an https URL: Instagram fetches the media from it.`);let J=$.hostname.replace(/^\[|\]$/g,"").toLowerCase(),Q=jW(J);if(Q?FW(Q)!==null:!J.includes(".")||/(^|\.)(localhost|local|internal)$/.test(J))_(`${W} must be a public URL: Instagram fetches the media from it.`)}class d0{describe;rollout;when;serverOnly;salt;constructor(W={}){if(W.rollout!==void 0){let{rollout:Z}=W;if(!Number.isFinite(Z)||Z<0||Z>100)throw Error(`A feature's \`rollout\` must be a number between 0 and 100, received ${String(Z)}.`)}this.describe=W.describe,this.rollout=W.rollout,this.when=W.when,this.serverOnly=W.serverOnly??!1,this.salt=W.salt}}function x5(W={}){return new d0(W)}class LW extends l0{rows=new Map;constructor(W={}){super();for(let[Z,$]of Object.entries(W))this.rows.set(Z,{key:Z,active:$})}async load(){return[...this.rows.values()].map((W)=>({...W}))}async write(W,Z,$){return this.rows.set(W,{key:W,active:Z,updatedBy:$.actor,updatedAt:new Date}),{actorRecorded:!0}}}export{n8 as viewRouteConfigDefaults,W9 as translationConfigDefaults,M4 as toRangeHeaderValue,b5 as subjectFor,p5 as sniffContentType,gZ as scheduleConfigDefaults,D4 as resolveRange,O9 as redisConfigDefaults,H9 as rateLimiterConfigDefaults,FZ as queueConfigDefaults,J5 as parseMetaSignedRequest,D1 as parseContentRange,R5 as mintSessionToken,WZ as middlewareConfigDefaults,CZ as mcpCallOf,QZ as mailConfigDefaults,M9 as logConfigDefaults,S5 as isSessionToken,w8 as isFinalRunStatus,O6 as isBroadcastEvent,d5 as isActiveContentType,T5 as inRollout,c8 as imageConfigDefaults,m5 as filesystemConfigDefaults,Q9 as featuresConfigDefaults,mZ as eventConfigDefaults,P5 as evaluateFeature,j8 as encodeCursor,s8 as documentScriptCspHash,dZ as discoverWorkflows,iZ as discoverListeners,pZ as discoverJobs,lZ as discoverCronJobs,nZ as discoverCommands,eZ as defineTranslationConfig,hZ as defineScheduleConfig,T8 as defineRunsConfig,d8 as defineRouteConfig,x9 as defineRedisConfig,D9 as defineRateLimiterConfig,jZ as defineQueueConfig,e8 as defineMiddlewareConfig,JZ as defineMailConfig,F9 as defineLogConfig,m8 as defineImageConfig,E5 as defineFilesystemConfig,J9 as defineFeaturesConfig,x5 as defineFeature,EZ as defineEventConfig,UW as defineEncryptionConfig,vZ as defineCommandConfig,yZ as defineCommand,X8 as defineChangeFeedConfig,n5 as defineCacheConfig,O8 as defineBroadcastConfig,k5 as defineAuthConfig,F8 as decodeCursor,XZ as createWorkflowTableStatements,I8 as createRunsTableStatements,IZ as commandConfigDefaults,B8 as changeFeedConfigDefaults,i5 as cacheConfigDefaults,V5 as bucketOf,C5 as bucketKey,S8 as broadcastConfigDefaults,w4 as bearerToken,f5 as authConfigDefaults,L4 as assertDeletablePrefix,l8 as apiRouteConfigDefaults,e6 as XOAuthProvider,OZ as WorkflowRuntime,UZ as WorkflowCancelledError,uZ as Workflow,DZ as WaitTimeoutError,t8 as ViewRouteDispatcher,y5 as UndeclaredFeatureError,t5 as TaggedCache,u5 as StorageFetchTimeoutError,HZ as StepTimeoutError,NZ as StepFailedError,xZ as Step,LW as StaticFeatureFlagSource,E8 as Sharp,bZ as Scheduler,Z9 as ScheduleServiceProvider,a8 as STATIC_NAVIGATION_CSP_HASH,x8 as SOCKET_ID_HEADER,O5 as SESSION_TOKEN_PREFIX,s0 as S3Driver,_9 as RunsServiceProvider,y8 as RunNotFoundError,h8 as RunManager,A8 as RunFailure,R9 as RouteServiceProvider,$Z as ResendDriver,S9 as RedisServiceProvider,O4 as RedisRateLimiterTimeoutError,y1 as RedisRateLimiterDisconnectedError,e0 as RedisRateLimiter,I1 as RedisManager,o5 as RedisCacheStore,_8 as RedisBroadcastDriver,U9 as RateLimiterServiceProvider,U4 as RateLimiterDriver,_5 as RateLimiter,$1 as RangeNotSatisfiableError,sZ as QueueServiceProvider,SZ as QueueManager,G8 as ProviderConnection,H6 as PrismaMcpOAuthStore,C8 as PendingBroadcast,b8 as OPEN_RUN_STATUSES,K8 as OAuthReconnectRequiredError,m as OAuthProvider,m0 as OAuthConnectionProvider,w1 as OAuthConnectionError,U as OAuthCallbackError,N9 as MiddlewareServiceProvider,p8 as MiddlewareRegistry,y as MetaSignedRequestError,MZ as MemoryWorkflowStore,q8 as MemoryRunStore,LZ as MemoryQueueDriver,D6 as MemoryMcpOAuthStore,zZ as MemoryLockStore,Q8 as MemoryConnectionStore,L8 as MemoryChangeFeedDriver,s5 as MemoryCacheStore,R8 as MemoryBroadcastDriver,kZ as McpToolError,VZ as McpRegistry,L6 as McpOAuthServer,PZ as McpHttpServer,fZ as McpCallRefusedError,TZ as McpApiKeyResolver,K9 as MailServiceProvider,YZ as MailManager,L9 as LogServiceProvider,l5 as LogManager,W8 as LockManager,r5 as LockLostError,cZ as Listener,j9 as KernelIdServiceProvider,i8 as KernelId,RZ as Job,U8 as InvalidChannelError,p0 as InstagramPublisher,O as InstagramPublishError,YW as InstagramOAuthProvider,F4 as InstagramConnectionProvider,I as InstagramApiError,K5 as Instagram,x4 as InMemoryRateLimiter,B9 as ImageServiceProvider,g8 as ImageOptimizationDriver,u8 as ImageManager,o8 as ISLAND_LOADER_CSP_HASH,f as INSTAGRAM_LIMITS,e5 as HeldLock,_6 as GoogleOAuthProvider,f6 as GitHubOAuthProvider,X9 as FilesystemServiceProvider,c5 as FilesystemManager,g5 as FileSystemDriver,H1 as FileStorageDriver,a as FileNotFoundError,Y9 as FeaturesServiceProvider,I5 as FeatureSourceReadOnlyError,A5 as FeatureScope,w5 as FeatureReloadError,v5 as FeatureModelMissingError,h5 as FeatureManager,q5 as FeatureFlagStore,l0 as FeatureFlagSource,d0 as Feature,P8 as FINAL_RUN_STATUSES,G9 as EventServiceProvider,w as EventManager,p1 as Event,z9 as EncryptionServiceProvider,$8 as EncryptionKeyError,Z8 as Encrypter,ZZ as EmailDriver,J8 as DecryptionError,GZ as DatabaseWorkflowStore,v8 as DatabaseRunStore,BZ as DatabaseQueueDriver,KZ as DatabaseLockStore,$9 as DatabaseFeatureFlagSource,Y8 as DatabaseConnectionStore,M8 as DatabaseChangeFeedDriver,_Z as DEFAULT_MCP_SCOPE,AZ as CronJob,z8 as ConnectionManager,k9 as CommandRegistry,wZ as CommandFailed,qZ as Command,H8 as ChangeFeedSubscription,tZ as ChangeFeedServiceProvider,D8 as ChangeFeedManager,N8 as ChangeFeedFullError,aZ as CacheServiceProvider,a5 as CacheManager,A1 as CONSENT_PAGE_HEADERS,oZ as BroadcastServiceProvider,V8 as BroadcastScope,k8 as BroadcastPayloadTooLargeError,f8 as BroadcastManager,S6 as BroadcastEvent,a0 as AzureBlobDriver,rZ as AuthServiceProvider,E1 as AuthManager,r8 as ApiRouteDispatcher};
|
|
71
71
|
|
|
72
|
-
//# debugId=
|
|
72
|
+
//# debugId=8789AE8A4327EA0D64756E2164756E21
|