jialing-code 1.1.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/README.md +97 -0
- package/dist/chunk-065m026w.js +97 -0
- package/dist/chunk-06saje2v.js +39 -0
- package/dist/chunk-0731m51q.js +8 -0
- package/dist/chunk-0975ccyw.js +265 -0
- package/dist/chunk-09n3fjx5.js +67 -0
- package/dist/chunk-0bdjdzew.js +41 -0
- package/dist/chunk-0ce6kd7y.js +212 -0
- package/dist/chunk-0e1xsncc.js +969 -0
- package/dist/chunk-0m2861gw.js +154 -0
- package/dist/chunk-0paqc2yw.js +15 -0
- package/dist/chunk-0rg6yrhy.js +99 -0
- package/dist/chunk-0sakxrcf.js +643 -0
- package/dist/chunk-0v9hwxvz.js +105 -0
- package/dist/chunk-0vkfrmqm.js +690 -0
- package/dist/chunk-0vvfnhhv.js +248 -0
- package/dist/chunk-0w4rsycj.js +145 -0
- package/dist/chunk-0x9b2nmd.js +63 -0
- package/dist/chunk-0xjaqda8.js +1124 -0
- package/dist/chunk-1141xmr4.js +8 -0
- package/dist/chunk-13d1842d.js +154 -0
- package/dist/chunk-1921a6yb.js +32 -0
- package/dist/chunk-1ad8mk9g.js +527 -0
- package/dist/chunk-1ax41pws.js +28 -0
- package/dist/chunk-1c8z1b5v.js +16 -0
- package/dist/chunk-1cbn5kxf.js +7 -0
- package/dist/chunk-1eapde8a.js +726 -0
- package/dist/chunk-1h2famwb.js +49 -0
- package/dist/chunk-1jggnf7z.js +85 -0
- package/dist/chunk-1k92pn9c.js +32 -0
- package/dist/chunk-1qakq4sn.js +802 -0
- package/dist/chunk-1rvz0433.js +722 -0
- package/dist/chunk-1xkekb9y.js +19 -0
- package/dist/chunk-238g70xa.js +36 -0
- package/dist/chunk-24ge0eqa.js +106 -0
- package/dist/chunk-278vghwm.js +5395 -0
- package/dist/chunk-27xc1csx.js +104 -0
- package/dist/chunk-2a42s11t.js +412 -0
- package/dist/chunk-2aa02aw6.js +438 -0
- package/dist/chunk-2eykm0j0.js +20 -0
- package/dist/chunk-2gzv8nrw.js +205 -0
- package/dist/chunk-2k995y2x.js +880 -0
- package/dist/chunk-2nayx6q1.js +63 -0
- package/dist/chunk-2sd2w2h4.js +44 -0
- package/dist/chunk-2tw2ve8h.js +145 -0
- package/dist/chunk-30rst83v.js +168 -0
- package/dist/chunk-3aavh06g.js +1581 -0
- package/dist/chunk-3b0yvt2h.js +469 -0
- package/dist/chunk-3be7ka25.js +56 -0
- package/dist/chunk-3c25bcsw.js +17 -0
- package/dist/chunk-3dyxka97.js +584 -0
- package/dist/chunk-3f7rypmf.js +16544 -0
- package/dist/chunk-3fsd7f51.js +93 -0
- package/dist/chunk-3gqdqmzb.js +75 -0
- package/dist/chunk-3h8a89gy.js +46 -0
- package/dist/chunk-3m84sret.js +71 -0
- package/dist/chunk-3nb7j3js.js +96 -0
- package/dist/chunk-3p08nvn2.js +98 -0
- package/dist/chunk-3r09htpc.js +318 -0
- package/dist/chunk-3r24h7t6.js +113 -0
- package/dist/chunk-3rkfxjtq.js +80 -0
- package/dist/chunk-3tmk7dc2.js +604 -0
- package/dist/chunk-3w6s9m5w.js +16 -0
- package/dist/chunk-43qjymy5.js +92 -0
- package/dist/chunk-44fpr6jq.js +434 -0
- package/dist/chunk-45kxdsp8.js +444 -0
- package/dist/chunk-495d85x1.js +8066 -0
- package/dist/chunk-4ba796se.js +1095 -0
- package/dist/chunk-4g3v8y12.js +23 -0
- package/dist/chunk-4h53xj8n.js +3445 -0
- package/dist/chunk-4jm600zv.js +13 -0
- package/dist/chunk-4jy9dtwk.js +116 -0
- package/dist/chunk-4p60dd45.js +55 -0
- package/dist/chunk-4z0jsrqg.js +81 -0
- package/dist/chunk-4zfkzkt6.js +37 -0
- package/dist/chunk-55wgxwa9.js +13877 -0
- package/dist/chunk-5dbk24zg.js +890 -0
- package/dist/chunk-5hzvp4va.js +115 -0
- package/dist/chunk-5kbt1mbt.js +500 -0
- package/dist/chunk-5pen7vr8.js +176 -0
- package/dist/chunk-5r280eng.js +198 -0
- package/dist/chunk-5srym52s.js +88 -0
- package/dist/chunk-600kg7k6.js +41 -0
- package/dist/chunk-616w0qj3.js +160 -0
- package/dist/chunk-62jw1t8c.js +94 -0
- package/dist/chunk-62xmt9mk.js +372 -0
- package/dist/chunk-64bvg7c3.js +229 -0
- package/dist/chunk-65yhe4s0.js +281 -0
- package/dist/chunk-6aewh27m.js +102 -0
- package/dist/chunk-6bd8brc4.js +48 -0
- package/dist/chunk-6dj5t602.js +341 -0
- package/dist/chunk-6exxdk1p.js +6956 -0
- package/dist/chunk-6f5j8fs0.js +752 -0
- package/dist/chunk-6g62sjpf.js +328 -0
- package/dist/chunk-6gecq2ta.js +1493 -0
- package/dist/chunk-6gr3c3w9.js +378 -0
- package/dist/chunk-6kpbgc5w.js +23 -0
- package/dist/chunk-6kseqw79.js +154 -0
- package/dist/chunk-6mxm1qd0.js +40764 -0
- package/dist/chunk-6n2qgm9v.js +8 -0
- package/dist/chunk-6tq2v3rk.js +186 -0
- package/dist/chunk-6wsdhj3v.js +93 -0
- package/dist/chunk-6zw9fhgb.js +4389 -0
- package/dist/chunk-71grc1mw.js +111 -0
- package/dist/chunk-73rpbt04.js +1947 -0
- package/dist/chunk-748feghg.js +604 -0
- package/dist/chunk-75e8gtg9.js +84 -0
- package/dist/chunk-75th4717.js +780 -0
- package/dist/chunk-760252na.js +101 -0
- package/dist/chunk-7739pg2c.js +4261 -0
- package/dist/chunk-778fnx46.js +472 -0
- package/dist/chunk-77g09znh.js +391 -0
- package/dist/chunk-7aw745vx.js +40175 -0
- package/dist/chunk-7m2nd8da.js +110 -0
- package/dist/chunk-7n35vjtw.js +444 -0
- package/dist/chunk-7n5ss4sh.js +144 -0
- package/dist/chunk-7rjnxcfe.js +107 -0
- package/dist/chunk-7sb5axvf.js +122 -0
- package/dist/chunk-7wm5s02e.js +216 -0
- package/dist/chunk-7ymfj7m3.js +151 -0
- package/dist/chunk-7z8j9qfn.js +121 -0
- package/dist/chunk-7zsapntc.js +216 -0
- package/dist/chunk-805fhkfh.js +908 -0
- package/dist/chunk-80k1nj24.js +253 -0
- package/dist/chunk-83hfzbx3.js +10 -0
- package/dist/chunk-85cypsdd.js +92 -0
- package/dist/chunk-8760caxf.js +2644 -0
- package/dist/chunk-88f6egg6.js +387 -0
- package/dist/chunk-88r7kwgj.js +22 -0
- package/dist/chunk-89e1v45e.js +463 -0
- package/dist/chunk-8bedvdm1.js +32 -0
- package/dist/chunk-8c4x4vdz.js +177 -0
- package/dist/chunk-8hq5kk3y.js +44 -0
- package/dist/chunk-8ngxagxq.js +18 -0
- package/dist/chunk-8tnsngw2.js +31 -0
- package/dist/chunk-8wjnca8h.js +307 -0
- package/dist/chunk-8y12jxg8.js +10 -0
- package/dist/chunk-8ymf4e6z.js +48 -0
- package/dist/chunk-90wp6wez.js +10510 -0
- package/dist/chunk-92bp5bnf.js +650 -0
- package/dist/chunk-92q8sx5z.js +90 -0
- package/dist/chunk-958rtmtx.js +10476 -0
- package/dist/chunk-9e2kqv5g.js +125 -0
- package/dist/chunk-9f4f1hy5.js +281 -0
- package/dist/chunk-9gbamk79.js +93 -0
- package/dist/chunk-9k5s3ryh.js +167 -0
- package/dist/chunk-9xzfqm15.js +97 -0
- package/dist/chunk-9zgdvbm6.js +110 -0
- package/dist/chunk-a0p3q8jw.js +24 -0
- package/dist/chunk-a22sayzp.js +220 -0
- package/dist/chunk-a8ejc632.js +3094 -0
- package/dist/chunk-a8gj9d9z.js +120 -0
- package/dist/chunk-a9vdeb6y.js +258 -0
- package/dist/chunk-a9yev47v.js +674 -0
- package/dist/chunk-a9zh40sj.js +48 -0
- package/dist/chunk-ack5mfba.js +105 -0
- package/dist/chunk-ae76ded0.js +30 -0
- package/dist/chunk-akjw4dh6.js +538 -0
- package/dist/chunk-asc6wz4q.js +1188 -0
- package/dist/chunk-atqejh3p.js +273 -0
- package/dist/chunk-atv2e6b7.js +61 -0
- package/dist/chunk-axvvkwz8.js +1551 -0
- package/dist/chunk-azgz7kj9.js +38 -0
- package/dist/chunk-b3zave8q.js +275 -0
- package/dist/chunk-b4wg70y1.js +54 -0
- package/dist/chunk-b8b13qn2.js +100 -0
- package/dist/chunk-bg3mt9bm.js +28 -0
- package/dist/chunk-bh4jvcjn.js +91 -0
- package/dist/chunk-bhdt6k7w.js +15 -0
- package/dist/chunk-bm1qb16p.js +17 -0
- package/dist/chunk-bpvsd1j1.js +266 -0
- package/dist/chunk-bqfnp99q.js +477 -0
- package/dist/chunk-bsbmmfyt.js +17 -0
- package/dist/chunk-bsbt34jm.js +42 -0
- package/dist/chunk-c78akdhr.js +458 -0
- package/dist/chunk-cdz5yb0r.js +57 -0
- package/dist/chunk-cfv996bs.js +22 -0
- package/dist/chunk-cgfdkzhb.js +12 -0
- package/dist/chunk-ckh4r5er.js +257 -0
- package/dist/chunk-cmgjnvn9.js +89 -0
- package/dist/chunk-cpjgvay8.js +687 -0
- package/dist/chunk-crfryjx9.js +276 -0
- package/dist/chunk-ctw5jwcd.js +213 -0
- package/dist/chunk-cvy3vntc.js +65 -0
- package/dist/chunk-cwbzz504.js +94 -0
- package/dist/chunk-cy2hswr1.js +15 -0
- package/dist/chunk-cyejkay3.js +222 -0
- package/dist/chunk-d18z9pna.js +106 -0
- package/dist/chunk-d5cq0n0v.js +162 -0
- package/dist/chunk-db45aryp.js +50 -0
- package/dist/chunk-de8nqh0z.js +790 -0
- package/dist/chunk-dfw6h350.js +2336 -0
- package/dist/chunk-dgqrcy74.js +48 -0
- package/dist/chunk-dn75ptgd.js +184 -0
- package/dist/chunk-dnh7jtpb.js +37 -0
- package/dist/chunk-dpshyv9m.js +90 -0
- package/dist/chunk-dt8cdvnm.js +642 -0
- package/dist/chunk-dtxby6fr.js +306 -0
- package/dist/chunk-dv1wfr85.js +6373 -0
- package/dist/chunk-dw363edx.js +1154 -0
- package/dist/chunk-dwrdacck.js +62 -0
- package/dist/chunk-dxnnv5e3.js +276 -0
- package/dist/chunk-e3g8q4cn.js +1646 -0
- package/dist/chunk-e3m9k9s2.js +542 -0
- package/dist/chunk-e4q49asn.js +155 -0
- package/dist/chunk-e5pntxye.js +37 -0
- package/dist/chunk-e7393td6.js +42 -0
- package/dist/chunk-ead42yrh.js +87 -0
- package/dist/chunk-eb90vwvr.js +152 -0
- package/dist/chunk-ecvwk9hg.js +250 -0
- package/dist/chunk-edjd6aay.js +173 -0
- package/dist/chunk-eg0h8mtm.js +130 -0
- package/dist/chunk-ehtwnxpg.js +1591 -0
- package/dist/chunk-ek686gx1.js +94 -0
- package/dist/chunk-eqp1rfft.js +17 -0
- package/dist/chunk-evhwt0ar.js +1015 -0
- package/dist/chunk-ewadzrm8.js +103 -0
- package/dist/chunk-ewsgsw9h.js +172291 -0
- package/dist/chunk-f0pa0r7e.js +3198 -0
- package/dist/chunk-f2mhrmww.js +62 -0
- package/dist/chunk-f39zxvwn.js +401 -0
- package/dist/chunk-f46z54tq.js +374 -0
- package/dist/chunk-f5ma3nh5.js +3436 -0
- package/dist/chunk-f60q23az.js +3038 -0
- package/dist/chunk-f6v2nz57.js +107 -0
- package/dist/chunk-f6yjan38.js +38 -0
- package/dist/chunk-fbv4apne.js +51 -0
- package/dist/chunk-fem4s778.js +70 -0
- package/dist/chunk-fezm1kn8.js +376 -0
- package/dist/chunk-fm1n3ysp.js +6108 -0
- package/dist/chunk-frg83bfw.js +225 -0
- package/dist/chunk-fscm8db0.js +692 -0
- package/dist/chunk-fyc5fepv.js +10 -0
- package/dist/chunk-g0j0t6qk.js +26 -0
- package/dist/chunk-g0nc1ftf.js +849 -0
- package/dist/chunk-g338npwr.js +1061 -0
- package/dist/chunk-g3t0act8.js +8 -0
- package/dist/chunk-g75w4hw3.js +26 -0
- package/dist/chunk-g8vp82en.js +1866 -0
- package/dist/chunk-gax0fcbx.js +182 -0
- package/dist/chunk-gsz4dh3y.js +606 -0
- package/dist/chunk-gtfffm7h.js +440 -0
- package/dist/chunk-gver9zb9.js +420 -0
- package/dist/chunk-gyj242zr.js +20 -0
- package/dist/chunk-h0qngp9w.js +157 -0
- package/dist/chunk-h14kemnk.js +123 -0
- package/dist/chunk-h8wj1a74.js +8960 -0
- package/dist/chunk-h9mcb2eg.js +87 -0
- package/dist/chunk-h9nh2980.js +91 -0
- package/dist/chunk-hakdhagh.js +16606 -0
- package/dist/chunk-hbc6ymdv.js +55 -0
- package/dist/chunk-hh7cmy4k.js +20 -0
- package/dist/chunk-hjhc4cpt.js +69 -0
- package/dist/chunk-hjwez8qc.js +5018 -0
- package/dist/chunk-hk9xz7gk.js +118 -0
- package/dist/chunk-hqmz36b3.js +552 -0
- package/dist/chunk-hrzerbfw.js +1299 -0
- package/dist/chunk-hs8ph4p8.js +8 -0
- package/dist/chunk-ht1xwrnd.js +716 -0
- package/dist/chunk-hvmfg2dc.js +338 -0
- package/dist/chunk-hx2tr4ep.js +7189 -0
- package/dist/chunk-hzhe8ygc.js +547 -0
- package/dist/chunk-j2k4p94p.js +55 -0
- package/dist/chunk-j3a4p81y.js +184 -0
- package/dist/chunk-j49g6g3s.js +57 -0
- package/dist/chunk-j5d5hp9h.js +71 -0
- package/dist/chunk-j64ga6ta.js +8035 -0
- package/dist/chunk-j7tyxan1.js +116 -0
- package/dist/chunk-j8v4774z.js +424 -0
- package/dist/chunk-jafes477.js +29 -0
- package/dist/chunk-jd32zbps.js +15 -0
- package/dist/chunk-jdgeec04.js +4249 -0
- package/dist/chunk-jftd4jq5.js +4521 -0
- package/dist/chunk-jkxqhv6y.js +812 -0
- package/dist/chunk-jmfr6h0n.js +120 -0
- package/dist/chunk-jn4aabmx.js +40 -0
- package/dist/chunk-jnhkref0.js +30 -0
- package/dist/chunk-jsbpm1gz.js +27 -0
- package/dist/chunk-jtcyjc3k.js +5802 -0
- package/dist/chunk-jx817w05.js +11 -0
- package/dist/chunk-jzmz18nn.js +65 -0
- package/dist/chunk-k0p9w03v.js +4957 -0
- package/dist/chunk-k3dcdnck.js +89 -0
- package/dist/chunk-k3wadzcd.js +88 -0
- package/dist/chunk-kaeshsk1.js +713 -0
- package/dist/chunk-kbkey9ed.js +522 -0
- package/dist/chunk-kcwfhqbb.js +196 -0
- package/dist/chunk-key6jr7p.js +224 -0
- package/dist/chunk-knay8cy9.js +173 -0
- package/dist/chunk-kr3rg2y1.js +95 -0
- package/dist/chunk-kwekc97v.js +18 -0
- package/dist/chunk-m06q12hg.js +61 -0
- package/dist/chunk-m2mcpbhk.js +43 -0
- package/dist/chunk-m8v220gz.js +71 -0
- package/dist/chunk-mgpqy78h.js +208 -0
- package/dist/chunk-mkejwh4t.js +16 -0
- package/dist/chunk-mptyw5n1.js +107 -0
- package/dist/chunk-mqajm0dp.js +66 -0
- package/dist/chunk-mrksbgxj.js +490 -0
- package/dist/chunk-msjfc5ba.js +246 -0
- package/dist/chunk-mt25echc.js +6157 -0
- package/dist/chunk-mt3jfnr8.js +277 -0
- package/dist/chunk-mtn242d4.js +9300 -0
- package/dist/chunk-mzfkvave.js +169 -0
- package/dist/chunk-n0qaeaa5.js +256 -0
- package/dist/chunk-n1erf6kh.js +22820 -0
- package/dist/chunk-n2avk1r2.js +61 -0
- package/dist/chunk-n6atnpcq.js +765 -0
- package/dist/chunk-n7ttdtk0.js +641 -0
- package/dist/chunk-ncnfzby5.js +822 -0
- package/dist/chunk-ncnr1jtf.js +2058 -0
- package/dist/chunk-nerv0jvx.js +74 -0
- package/dist/chunk-ngd2abep.js +90 -0
- package/dist/chunk-nka1g8f4.js +773 -0
- package/dist/chunk-nnaxkc2z.js +128 -0
- package/dist/chunk-npyrtj8j.js +691 -0
- package/dist/chunk-nq0fxyxh.js +752 -0
- package/dist/chunk-nrmffak7.js +114 -0
- package/dist/chunk-nsz546wq.js +1170 -0
- package/dist/chunk-nt837qt9.js +21 -0
- package/dist/chunk-nv64x1z5.js +86 -0
- package/dist/chunk-nxsh6de2.js +1711 -0
- package/dist/chunk-nz4getcr.js +40 -0
- package/dist/chunk-p1f607pa.js +83 -0
- package/dist/chunk-p2816w9z.js +1486 -0
- package/dist/chunk-p2d5nh3g.js +342 -0
- package/dist/chunk-p4r5y02t.js +90 -0
- package/dist/chunk-p7g7pf3f.js +336 -0
- package/dist/chunk-pb4ad8r2.js +110 -0
- package/dist/chunk-pbrhz0zr.js +716 -0
- package/dist/chunk-ps49ymvj.js +43 -0
- package/dist/chunk-pwnt3veb.js +103 -0
- package/dist/chunk-pwwa7s62.js +11 -0
- package/dist/chunk-px3w0kde.js +299 -0
- package/dist/chunk-pzn777jb.js +756 -0
- package/dist/chunk-q25bjaev.js +15 -0
- package/dist/chunk-q5by3da6.js +8 -0
- package/dist/chunk-q6av622g.js +38 -0
- package/dist/chunk-q6xkvtf2.js +1318 -0
- package/dist/chunk-q81jx1tq.js +476 -0
- package/dist/chunk-qehb6fk5.js +339 -0
- package/dist/chunk-qj1avx1q.js +87 -0
- package/dist/chunk-qn2dxr66.js +105 -0
- package/dist/chunk-qnfx3qtx.js +617 -0
- package/dist/chunk-qp18kd4h.js +48 -0
- package/dist/chunk-qp2qdcda.js +100 -0
- package/dist/chunk-qpjy9tcf.js +133 -0
- package/dist/chunk-qqfa0dqg.js +2343 -0
- package/dist/chunk-qwh3htcz.js +202 -0
- package/dist/chunk-qz2x630m.js +49145 -0
- package/dist/chunk-r3vakcs1.js +496 -0
- package/dist/chunk-r66hz8j6.js +34 -0
- package/dist/chunk-r6b58y3x.js +17 -0
- package/dist/chunk-rekp48rk.js +62 -0
- package/dist/chunk-rn0v1hk8.js +34 -0
- package/dist/chunk-rs1xrs6m.js +534 -0
- package/dist/chunk-rs45skes.js +123 -0
- package/dist/chunk-rzszqp82.js +524 -0
- package/dist/chunk-s274nv8k.js +8 -0
- package/dist/chunk-s3pzvdss.js +50 -0
- package/dist/chunk-s9mesaw0.js +26840 -0
- package/dist/chunk-sd36yzx8.js +954 -0
- package/dist/chunk-sdj9b9wh.js +782 -0
- package/dist/chunk-sdw2q69p.js +227 -0
- package/dist/chunk-sfgp9cc0.js +130 -0
- package/dist/chunk-spqaamnc.js +63 -0
- package/dist/chunk-spzrs4df.js +73 -0
- package/dist/chunk-sxkr7k43.js +55 -0
- package/dist/chunk-szj5wvdy.js +28 -0
- package/dist/chunk-t0rgmccj.js +39 -0
- package/dist/chunk-t1nnzjgg.js +17 -0
- package/dist/chunk-t94fcnt8.js +566 -0
- package/dist/chunk-tjaqa99q.js +125 -0
- package/dist/chunk-tjq2evtw.js +328 -0
- package/dist/chunk-ts2p6bv1.js +224 -0
- package/dist/chunk-ttk5dzz8.js +25 -0
- package/dist/chunk-tw0q7ynt.js +59 -0
- package/dist/chunk-v02jkvgy.js +131 -0
- package/dist/chunk-v084bqt3.js +1529 -0
- package/dist/chunk-v0amythm.js +164 -0
- package/dist/chunk-v1kzp02e.js +785 -0
- package/dist/chunk-v1mgv1et.js +15 -0
- package/dist/chunk-v399mzxk.js +58 -0
- package/dist/chunk-v3gm2day.js +8 -0
- package/dist/chunk-v43hrrxp.js +71 -0
- package/dist/chunk-v6aqb2aj.js +102 -0
- package/dist/chunk-v78fj8by.js +145 -0
- package/dist/chunk-v7qmhjdn.js +1921 -0
- package/dist/chunk-v9smspw2.js +4301 -0
- package/dist/chunk-vdw93s4h.js +2431 -0
- package/dist/chunk-vest0y6x.js +3830 -0
- package/dist/chunk-vf5sd1nq.js +12 -0
- package/dist/chunk-vratq94g.js +349 -0
- package/dist/chunk-vrz7t3m3.js +20 -0
- package/dist/chunk-vtb185z9.js +70 -0
- package/dist/chunk-vx01rvg8.js +654 -0
- package/dist/chunk-vyc0rjyx.js +31 -0
- package/dist/chunk-vyjeh50y.js +2149 -0
- package/dist/chunk-vzpffsza.js +269 -0
- package/dist/chunk-w2ef3kxk.js +3353 -0
- package/dist/chunk-w2z5pqd3.js +336 -0
- package/dist/chunk-w3whm4mn.js +432 -0
- package/dist/chunk-w7wgpqcp.js +157 -0
- package/dist/chunk-waa00cvb.js +301 -0
- package/dist/chunk-wb0qm4es.js +155 -0
- package/dist/chunk-wbkahkdc.js +27 -0
- package/dist/chunk-wfz0qffj.js +3939 -0
- package/dist/chunk-wn0cx0pt.js +283 -0
- package/dist/chunk-wv6gzt9c.js +726 -0
- package/dist/chunk-wx42ycm4.js +998 -0
- package/dist/chunk-wxkpgy05.js +268 -0
- package/dist/chunk-wzpdet3m.js +843 -0
- package/dist/chunk-x0mwzt38.js +714 -0
- package/dist/chunk-x592wbfh.js +244 -0
- package/dist/chunk-x5pqsp9r.js +100 -0
- package/dist/chunk-x679thag.js +825 -0
- package/dist/chunk-x8b7vft8.js +132 -0
- package/dist/chunk-x8cftch7.js +119 -0
- package/dist/chunk-x9q7r885.js +348 -0
- package/dist/chunk-xawkt0vb.js +1585 -0
- package/dist/chunk-xdw5dv00.js +8 -0
- package/dist/chunk-xe9cc860.js +287 -0
- package/dist/chunk-xjr9c3vt.js +101 -0
- package/dist/chunk-xk7zaqta.js +21933 -0
- package/dist/chunk-xktbmawc.js +678 -0
- package/dist/chunk-xn6yw46v.js +140 -0
- package/dist/chunk-xsq9ae7x.js +90 -0
- package/dist/chunk-xszk7n10.js +14358 -0
- package/dist/chunk-xt8a5r1t.js +84 -0
- package/dist/chunk-xydyndkv.js +195 -0
- package/dist/chunk-xzt10yc5.js +60 -0
- package/dist/chunk-y04y95dr.js +91 -0
- package/dist/chunk-y1784krc.js +19 -0
- package/dist/chunk-y1x32h3x.js +128 -0
- package/dist/chunk-y3s7aww5.js +99 -0
- package/dist/chunk-y47cg3kz.js +42 -0
- package/dist/chunk-y7kzvepn.js +469 -0
- package/dist/chunk-y89kbsyc.js +287 -0
- package/dist/chunk-yd87p1c3.js +159 -0
- package/dist/chunk-yf3yw8fw.js +105 -0
- package/dist/chunk-ygbf0ezx.js +1391 -0
- package/dist/chunk-yjbxnshv.js +208 -0
- package/dist/chunk-ynednmqd.js +192 -0
- package/dist/chunk-yvhez44y.js +259 -0
- package/dist/chunk-ywxd4qw4.js +22 -0
- package/dist/chunk-yzrmgpy4.js +117 -0
- package/dist/chunk-z0b2vb24.js +862 -0
- package/dist/chunk-z1zj044v.js +655 -0
- package/dist/chunk-z2dp53wn.js +17 -0
- package/dist/chunk-z3w0xasa.js +165 -0
- package/dist/chunk-z7ycmrb3.js +644 -0
- package/dist/chunk-zh11tdkb.js +347 -0
- package/dist/chunk-zk2wsm7d.js +15 -0
- package/dist/chunk-zqfqcf22.js +229 -0
- package/dist/chunk-zqk2j8px.js +699 -0
- package/dist/chunk-zqvsc10j.js +2833 -0
- package/dist/chunk-zsfxha74.js +17655 -0
- package/dist/chunk-zvc4snyb.js +117 -0
- package/dist/cli.js +194 -0
- package/package.json +173 -0
|
@@ -0,0 +1,3939 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
require_dist_cjs1 as require_dist_cjs3,
|
|
4
|
+
require_dist_cjs2 as require_dist_cjs4
|
|
5
|
+
} from "./chunk-nka1g8f4.js";
|
|
6
|
+
import {
|
|
7
|
+
require_dist_cjs as require_dist_cjs2
|
|
8
|
+
} from "./chunk-30rst83v.js";
|
|
9
|
+
import {
|
|
10
|
+
require_dist_cjs as require_dist_cjs5
|
|
11
|
+
} from "./chunk-j2k4p94p.js";
|
|
12
|
+
import {
|
|
13
|
+
require_dist_cjs
|
|
14
|
+
} from "./chunk-xsq9ae7x.js";
|
|
15
|
+
import {
|
|
16
|
+
require_dist_cjs1 as require_dist_cjs6,
|
|
17
|
+
require_dist_cjs2 as require_dist_cjs7
|
|
18
|
+
} from "./chunk-2nayx6q1.js";
|
|
19
|
+
import {
|
|
20
|
+
__commonJS,
|
|
21
|
+
__require
|
|
22
|
+
} from "./chunk-qp2qdcda.js";
|
|
23
|
+
|
|
24
|
+
// node_modules/.bun/@smithy+util-middleware@4.2.12/node_modules/@smithy/util-middleware/dist-cjs/index.js
|
|
25
|
+
var require_dist_cjs8 = __commonJS((exports) => {
|
|
26
|
+
var types = require_dist_cjs();
|
|
27
|
+
var getSmithyContext = (context) => context[types.SMITHY_CONTEXT_KEY] || (context[types.SMITHY_CONTEXT_KEY] = {});
|
|
28
|
+
var normalizeProvider = (input) => {
|
|
29
|
+
if (typeof input === "function")
|
|
30
|
+
return input;
|
|
31
|
+
const promisified = Promise.resolve(input);
|
|
32
|
+
return () => promisified;
|
|
33
|
+
};
|
|
34
|
+
exports.getSmithyContext = getSmithyContext;
|
|
35
|
+
exports.normalizeProvider = normalizeProvider;
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
// node_modules/.bun/@smithy+core@3.23.13/node_modules/@smithy/core/dist-cjs/submodules/endpoints/index.js
|
|
39
|
+
var require_endpoints = __commonJS((exports) => {
|
|
40
|
+
var urlParser = require_dist_cjs5();
|
|
41
|
+
var toEndpointV1 = (endpoint) => {
|
|
42
|
+
if (typeof endpoint === "object") {
|
|
43
|
+
if ("url" in endpoint) {
|
|
44
|
+
const v1Endpoint = urlParser.parseUrl(endpoint.url);
|
|
45
|
+
if (endpoint.headers) {
|
|
46
|
+
v1Endpoint.headers = {};
|
|
47
|
+
for (const [name, values] of Object.entries(endpoint.headers)) {
|
|
48
|
+
v1Endpoint.headers[name.toLowerCase()] = values.join(", ");
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return v1Endpoint;
|
|
52
|
+
}
|
|
53
|
+
return endpoint;
|
|
54
|
+
}
|
|
55
|
+
return urlParser.parseUrl(endpoint);
|
|
56
|
+
};
|
|
57
|
+
exports.toEndpointV1 = toEndpointV1;
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
// node_modules/.bun/@smithy+core@3.23.13/node_modules/@smithy/core/dist-cjs/submodules/schema/index.js
|
|
61
|
+
var require_schema = __commonJS((exports) => {
|
|
62
|
+
var protocolHttp = require_dist_cjs2();
|
|
63
|
+
var utilMiddleware = require_dist_cjs8();
|
|
64
|
+
var endpoints = require_endpoints();
|
|
65
|
+
var deref = (schemaRef) => {
|
|
66
|
+
if (typeof schemaRef === "function") {
|
|
67
|
+
return schemaRef();
|
|
68
|
+
}
|
|
69
|
+
return schemaRef;
|
|
70
|
+
};
|
|
71
|
+
var operation = (namespace, name, traits, input, output) => ({
|
|
72
|
+
name,
|
|
73
|
+
namespace,
|
|
74
|
+
traits,
|
|
75
|
+
input,
|
|
76
|
+
output
|
|
77
|
+
});
|
|
78
|
+
var schemaDeserializationMiddleware = (config) => (next, context) => async (args) => {
|
|
79
|
+
const { response } = await next(args);
|
|
80
|
+
const { operationSchema } = utilMiddleware.getSmithyContext(context);
|
|
81
|
+
const [, ns, n, t, i, o] = operationSchema ?? [];
|
|
82
|
+
try {
|
|
83
|
+
const parsed = await config.protocol.deserializeResponse(operation(ns, n, t, i, o), {
|
|
84
|
+
...config,
|
|
85
|
+
...context
|
|
86
|
+
}, response);
|
|
87
|
+
return {
|
|
88
|
+
response,
|
|
89
|
+
output: parsed
|
|
90
|
+
};
|
|
91
|
+
} catch (error2) {
|
|
92
|
+
Object.defineProperty(error2, "$response", {
|
|
93
|
+
value: response,
|
|
94
|
+
enumerable: false,
|
|
95
|
+
writable: false,
|
|
96
|
+
configurable: false
|
|
97
|
+
});
|
|
98
|
+
if (!("$metadata" in error2)) {
|
|
99
|
+
const hint = `Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.`;
|
|
100
|
+
try {
|
|
101
|
+
error2.message += `
|
|
102
|
+
` + hint;
|
|
103
|
+
} catch (e) {
|
|
104
|
+
if (!context.logger || context.logger?.constructor?.name === "NoOpLogger") {
|
|
105
|
+
console.warn(hint);
|
|
106
|
+
} else {
|
|
107
|
+
context.logger?.warn?.(hint);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
if (typeof error2.$responseBodyText !== "undefined") {
|
|
111
|
+
if (error2.$response) {
|
|
112
|
+
error2.$response.body = error2.$responseBodyText;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
try {
|
|
116
|
+
if (protocolHttp.HttpResponse.isInstance(response)) {
|
|
117
|
+
const { headers = {} } = response;
|
|
118
|
+
const headerEntries = Object.entries(headers);
|
|
119
|
+
error2.$metadata = {
|
|
120
|
+
httpStatusCode: response.statusCode,
|
|
121
|
+
requestId: findHeader(/^x-[\w-]+-request-?id$/, headerEntries),
|
|
122
|
+
extendedRequestId: findHeader(/^x-[\w-]+-id-2$/, headerEntries),
|
|
123
|
+
cfId: findHeader(/^x-[\w-]+-cf-id$/, headerEntries)
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
} catch (e) {}
|
|
127
|
+
}
|
|
128
|
+
throw error2;
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
var findHeader = (pattern, headers) => {
|
|
132
|
+
return (headers.find(([k]) => {
|
|
133
|
+
return k.match(pattern);
|
|
134
|
+
}) || [undefined, undefined])[1];
|
|
135
|
+
};
|
|
136
|
+
var schemaSerializationMiddleware = (config) => (next, context) => async (args) => {
|
|
137
|
+
const { operationSchema } = utilMiddleware.getSmithyContext(context);
|
|
138
|
+
const [, ns, n, t, i, o] = operationSchema ?? [];
|
|
139
|
+
const endpoint = context.endpointV2 ? async () => endpoints.toEndpointV1(context.endpointV2) : config.endpoint;
|
|
140
|
+
const request = await config.protocol.serializeRequest(operation(ns, n, t, i, o), args.input, {
|
|
141
|
+
...config,
|
|
142
|
+
...context,
|
|
143
|
+
endpoint
|
|
144
|
+
});
|
|
145
|
+
return next({
|
|
146
|
+
...args,
|
|
147
|
+
request
|
|
148
|
+
});
|
|
149
|
+
};
|
|
150
|
+
var deserializerMiddlewareOption = {
|
|
151
|
+
name: "deserializerMiddleware",
|
|
152
|
+
step: "deserialize",
|
|
153
|
+
tags: ["DESERIALIZER"],
|
|
154
|
+
override: true
|
|
155
|
+
};
|
|
156
|
+
var serializerMiddlewareOption = {
|
|
157
|
+
name: "serializerMiddleware",
|
|
158
|
+
step: "serialize",
|
|
159
|
+
tags: ["SERIALIZER"],
|
|
160
|
+
override: true
|
|
161
|
+
};
|
|
162
|
+
function getSchemaSerdePlugin(config) {
|
|
163
|
+
return {
|
|
164
|
+
applyToStack: (commandStack) => {
|
|
165
|
+
commandStack.add(schemaSerializationMiddleware(config), serializerMiddlewareOption);
|
|
166
|
+
commandStack.add(schemaDeserializationMiddleware(config), deserializerMiddlewareOption);
|
|
167
|
+
config.protocol.setSerdeContext(config);
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
class Schema {
|
|
173
|
+
name;
|
|
174
|
+
namespace;
|
|
175
|
+
traits;
|
|
176
|
+
static assign(instance, values) {
|
|
177
|
+
const schema = Object.assign(instance, values);
|
|
178
|
+
return schema;
|
|
179
|
+
}
|
|
180
|
+
static [Symbol.hasInstance](lhs) {
|
|
181
|
+
const isPrototype = this.prototype.isPrototypeOf(lhs);
|
|
182
|
+
if (!isPrototype && typeof lhs === "object" && lhs !== null) {
|
|
183
|
+
const list2 = lhs;
|
|
184
|
+
return list2.symbol === this.symbol;
|
|
185
|
+
}
|
|
186
|
+
return isPrototype;
|
|
187
|
+
}
|
|
188
|
+
getName() {
|
|
189
|
+
return this.namespace + "#" + this.name;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
class ListSchema extends Schema {
|
|
194
|
+
static symbol = Symbol.for("@smithy/lis");
|
|
195
|
+
name;
|
|
196
|
+
traits;
|
|
197
|
+
valueSchema;
|
|
198
|
+
symbol = ListSchema.symbol;
|
|
199
|
+
}
|
|
200
|
+
var list = (namespace, name, traits, valueSchema) => Schema.assign(new ListSchema, {
|
|
201
|
+
name,
|
|
202
|
+
namespace,
|
|
203
|
+
traits,
|
|
204
|
+
valueSchema
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
class MapSchema extends Schema {
|
|
208
|
+
static symbol = Symbol.for("@smithy/map");
|
|
209
|
+
name;
|
|
210
|
+
traits;
|
|
211
|
+
keySchema;
|
|
212
|
+
valueSchema;
|
|
213
|
+
symbol = MapSchema.symbol;
|
|
214
|
+
}
|
|
215
|
+
var map = (namespace, name, traits, keySchema, valueSchema) => Schema.assign(new MapSchema, {
|
|
216
|
+
name,
|
|
217
|
+
namespace,
|
|
218
|
+
traits,
|
|
219
|
+
keySchema,
|
|
220
|
+
valueSchema
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
class OperationSchema extends Schema {
|
|
224
|
+
static symbol = Symbol.for("@smithy/ope");
|
|
225
|
+
name;
|
|
226
|
+
traits;
|
|
227
|
+
input;
|
|
228
|
+
output;
|
|
229
|
+
symbol = OperationSchema.symbol;
|
|
230
|
+
}
|
|
231
|
+
var op = (namespace, name, traits, input, output) => Schema.assign(new OperationSchema, {
|
|
232
|
+
name,
|
|
233
|
+
namespace,
|
|
234
|
+
traits,
|
|
235
|
+
input,
|
|
236
|
+
output
|
|
237
|
+
});
|
|
238
|
+
|
|
239
|
+
class StructureSchema extends Schema {
|
|
240
|
+
static symbol = Symbol.for("@smithy/str");
|
|
241
|
+
name;
|
|
242
|
+
traits;
|
|
243
|
+
memberNames;
|
|
244
|
+
memberList;
|
|
245
|
+
symbol = StructureSchema.symbol;
|
|
246
|
+
}
|
|
247
|
+
var struct = (namespace, name, traits, memberNames, memberList) => Schema.assign(new StructureSchema, {
|
|
248
|
+
name,
|
|
249
|
+
namespace,
|
|
250
|
+
traits,
|
|
251
|
+
memberNames,
|
|
252
|
+
memberList
|
|
253
|
+
});
|
|
254
|
+
|
|
255
|
+
class ErrorSchema extends StructureSchema {
|
|
256
|
+
static symbol = Symbol.for("@smithy/err");
|
|
257
|
+
ctor;
|
|
258
|
+
symbol = ErrorSchema.symbol;
|
|
259
|
+
}
|
|
260
|
+
var error = (namespace, name, traits, memberNames, memberList, ctor) => Schema.assign(new ErrorSchema, {
|
|
261
|
+
name,
|
|
262
|
+
namespace,
|
|
263
|
+
traits,
|
|
264
|
+
memberNames,
|
|
265
|
+
memberList,
|
|
266
|
+
ctor: null
|
|
267
|
+
});
|
|
268
|
+
var traitsCache = [];
|
|
269
|
+
function translateTraits(indicator) {
|
|
270
|
+
if (typeof indicator === "object") {
|
|
271
|
+
return indicator;
|
|
272
|
+
}
|
|
273
|
+
indicator = indicator | 0;
|
|
274
|
+
if (traitsCache[indicator]) {
|
|
275
|
+
return traitsCache[indicator];
|
|
276
|
+
}
|
|
277
|
+
const traits = {};
|
|
278
|
+
let i = 0;
|
|
279
|
+
for (const trait of [
|
|
280
|
+
"httpLabel",
|
|
281
|
+
"idempotent",
|
|
282
|
+
"idempotencyToken",
|
|
283
|
+
"sensitive",
|
|
284
|
+
"httpPayload",
|
|
285
|
+
"httpResponseCode",
|
|
286
|
+
"httpQueryParams"
|
|
287
|
+
]) {
|
|
288
|
+
if ((indicator >> i++ & 1) === 1) {
|
|
289
|
+
traits[trait] = 1;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
return traitsCache[indicator] = traits;
|
|
293
|
+
}
|
|
294
|
+
var anno = {
|
|
295
|
+
it: Symbol.for("@smithy/nor-struct-it"),
|
|
296
|
+
ns: Symbol.for("@smithy/ns")
|
|
297
|
+
};
|
|
298
|
+
var simpleSchemaCacheN = [];
|
|
299
|
+
var simpleSchemaCacheS = {};
|
|
300
|
+
|
|
301
|
+
class NormalizedSchema {
|
|
302
|
+
ref;
|
|
303
|
+
memberName;
|
|
304
|
+
static symbol = Symbol.for("@smithy/nor");
|
|
305
|
+
symbol = NormalizedSchema.symbol;
|
|
306
|
+
name;
|
|
307
|
+
schema;
|
|
308
|
+
_isMemberSchema;
|
|
309
|
+
traits;
|
|
310
|
+
memberTraits;
|
|
311
|
+
normalizedTraits;
|
|
312
|
+
constructor(ref, memberName) {
|
|
313
|
+
this.ref = ref;
|
|
314
|
+
this.memberName = memberName;
|
|
315
|
+
const traitStack = [];
|
|
316
|
+
let _ref = ref;
|
|
317
|
+
let schema = ref;
|
|
318
|
+
this._isMemberSchema = false;
|
|
319
|
+
while (isMemberSchema(_ref)) {
|
|
320
|
+
traitStack.push(_ref[1]);
|
|
321
|
+
_ref = _ref[0];
|
|
322
|
+
schema = deref(_ref);
|
|
323
|
+
this._isMemberSchema = true;
|
|
324
|
+
}
|
|
325
|
+
if (traitStack.length > 0) {
|
|
326
|
+
this.memberTraits = {};
|
|
327
|
+
for (let i = traitStack.length - 1;i >= 0; --i) {
|
|
328
|
+
const traitSet = traitStack[i];
|
|
329
|
+
Object.assign(this.memberTraits, translateTraits(traitSet));
|
|
330
|
+
}
|
|
331
|
+
} else {
|
|
332
|
+
this.memberTraits = 0;
|
|
333
|
+
}
|
|
334
|
+
if (schema instanceof NormalizedSchema) {
|
|
335
|
+
const computedMemberTraits = this.memberTraits;
|
|
336
|
+
Object.assign(this, schema);
|
|
337
|
+
this.memberTraits = Object.assign({}, computedMemberTraits, schema.getMemberTraits(), this.getMemberTraits());
|
|
338
|
+
this.normalizedTraits = undefined;
|
|
339
|
+
this.memberName = memberName ?? schema.memberName;
|
|
340
|
+
return;
|
|
341
|
+
}
|
|
342
|
+
this.schema = deref(schema);
|
|
343
|
+
if (isStaticSchema(this.schema)) {
|
|
344
|
+
this.name = `${this.schema[1]}#${this.schema[2]}`;
|
|
345
|
+
this.traits = this.schema[3];
|
|
346
|
+
} else {
|
|
347
|
+
this.name = this.memberName ?? String(schema);
|
|
348
|
+
this.traits = 0;
|
|
349
|
+
}
|
|
350
|
+
if (this._isMemberSchema && !memberName) {
|
|
351
|
+
throw new Error(`@smithy/core/schema - NormalizedSchema member init ${this.getName(true)} missing member name.`);
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
static [Symbol.hasInstance](lhs) {
|
|
355
|
+
const isPrototype = this.prototype.isPrototypeOf(lhs);
|
|
356
|
+
if (!isPrototype && typeof lhs === "object" && lhs !== null) {
|
|
357
|
+
const ns = lhs;
|
|
358
|
+
return ns.symbol === this.symbol;
|
|
359
|
+
}
|
|
360
|
+
return isPrototype;
|
|
361
|
+
}
|
|
362
|
+
static of(ref) {
|
|
363
|
+
const keyAble = typeof ref === "function" || typeof ref === "object" && ref !== null;
|
|
364
|
+
if (typeof ref === "number") {
|
|
365
|
+
if (simpleSchemaCacheN[ref]) {
|
|
366
|
+
return simpleSchemaCacheN[ref];
|
|
367
|
+
}
|
|
368
|
+
} else if (typeof ref === "string") {
|
|
369
|
+
if (simpleSchemaCacheS[ref]) {
|
|
370
|
+
return simpleSchemaCacheS[ref];
|
|
371
|
+
}
|
|
372
|
+
} else if (keyAble) {
|
|
373
|
+
if (ref[anno.ns]) {
|
|
374
|
+
return ref[anno.ns];
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
const sc = deref(ref);
|
|
378
|
+
if (sc instanceof NormalizedSchema) {
|
|
379
|
+
return sc;
|
|
380
|
+
}
|
|
381
|
+
if (isMemberSchema(sc)) {
|
|
382
|
+
const [ns2, traits] = sc;
|
|
383
|
+
if (ns2 instanceof NormalizedSchema) {
|
|
384
|
+
Object.assign(ns2.getMergedTraits(), translateTraits(traits));
|
|
385
|
+
return ns2;
|
|
386
|
+
}
|
|
387
|
+
throw new Error(`@smithy/core/schema - may not init unwrapped member schema=${JSON.stringify(ref, null, 2)}.`);
|
|
388
|
+
}
|
|
389
|
+
const ns = new NormalizedSchema(sc);
|
|
390
|
+
if (keyAble) {
|
|
391
|
+
return ref[anno.ns] = ns;
|
|
392
|
+
}
|
|
393
|
+
if (typeof sc === "string") {
|
|
394
|
+
return simpleSchemaCacheS[sc] = ns;
|
|
395
|
+
}
|
|
396
|
+
if (typeof sc === "number") {
|
|
397
|
+
return simpleSchemaCacheN[sc] = ns;
|
|
398
|
+
}
|
|
399
|
+
return ns;
|
|
400
|
+
}
|
|
401
|
+
getSchema() {
|
|
402
|
+
const sc = this.schema;
|
|
403
|
+
if (Array.isArray(sc) && sc[0] === 0) {
|
|
404
|
+
return sc[4];
|
|
405
|
+
}
|
|
406
|
+
return sc;
|
|
407
|
+
}
|
|
408
|
+
getName(withNamespace = false) {
|
|
409
|
+
const { name } = this;
|
|
410
|
+
const short = !withNamespace && name && name.includes("#");
|
|
411
|
+
return short ? name.split("#")[1] : name || undefined;
|
|
412
|
+
}
|
|
413
|
+
getMemberName() {
|
|
414
|
+
return this.memberName;
|
|
415
|
+
}
|
|
416
|
+
isMemberSchema() {
|
|
417
|
+
return this._isMemberSchema;
|
|
418
|
+
}
|
|
419
|
+
isListSchema() {
|
|
420
|
+
const sc = this.getSchema();
|
|
421
|
+
return typeof sc === "number" ? sc >= 64 && sc < 128 : sc[0] === 1;
|
|
422
|
+
}
|
|
423
|
+
isMapSchema() {
|
|
424
|
+
const sc = this.getSchema();
|
|
425
|
+
return typeof sc === "number" ? sc >= 128 && sc <= 255 : sc[0] === 2;
|
|
426
|
+
}
|
|
427
|
+
isStructSchema() {
|
|
428
|
+
const sc = this.getSchema();
|
|
429
|
+
if (typeof sc !== "object") {
|
|
430
|
+
return false;
|
|
431
|
+
}
|
|
432
|
+
const id = sc[0];
|
|
433
|
+
return id === 3 || id === -3 || id === 4;
|
|
434
|
+
}
|
|
435
|
+
isUnionSchema() {
|
|
436
|
+
const sc = this.getSchema();
|
|
437
|
+
if (typeof sc !== "object") {
|
|
438
|
+
return false;
|
|
439
|
+
}
|
|
440
|
+
return sc[0] === 4;
|
|
441
|
+
}
|
|
442
|
+
isBlobSchema() {
|
|
443
|
+
const sc = this.getSchema();
|
|
444
|
+
return sc === 21 || sc === 42;
|
|
445
|
+
}
|
|
446
|
+
isTimestampSchema() {
|
|
447
|
+
const sc = this.getSchema();
|
|
448
|
+
return typeof sc === "number" && sc >= 4 && sc <= 7;
|
|
449
|
+
}
|
|
450
|
+
isUnitSchema() {
|
|
451
|
+
return this.getSchema() === "unit";
|
|
452
|
+
}
|
|
453
|
+
isDocumentSchema() {
|
|
454
|
+
return this.getSchema() === 15;
|
|
455
|
+
}
|
|
456
|
+
isStringSchema() {
|
|
457
|
+
return this.getSchema() === 0;
|
|
458
|
+
}
|
|
459
|
+
isBooleanSchema() {
|
|
460
|
+
return this.getSchema() === 2;
|
|
461
|
+
}
|
|
462
|
+
isNumericSchema() {
|
|
463
|
+
return this.getSchema() === 1;
|
|
464
|
+
}
|
|
465
|
+
isBigIntegerSchema() {
|
|
466
|
+
return this.getSchema() === 17;
|
|
467
|
+
}
|
|
468
|
+
isBigDecimalSchema() {
|
|
469
|
+
return this.getSchema() === 19;
|
|
470
|
+
}
|
|
471
|
+
isStreaming() {
|
|
472
|
+
const { streaming } = this.getMergedTraits();
|
|
473
|
+
return !!streaming || this.getSchema() === 42;
|
|
474
|
+
}
|
|
475
|
+
isIdempotencyToken() {
|
|
476
|
+
return !!this.getMergedTraits().idempotencyToken;
|
|
477
|
+
}
|
|
478
|
+
getMergedTraits() {
|
|
479
|
+
return this.normalizedTraits ?? (this.normalizedTraits = {
|
|
480
|
+
...this.getOwnTraits(),
|
|
481
|
+
...this.getMemberTraits()
|
|
482
|
+
});
|
|
483
|
+
}
|
|
484
|
+
getMemberTraits() {
|
|
485
|
+
return translateTraits(this.memberTraits);
|
|
486
|
+
}
|
|
487
|
+
getOwnTraits() {
|
|
488
|
+
return translateTraits(this.traits);
|
|
489
|
+
}
|
|
490
|
+
getKeySchema() {
|
|
491
|
+
const [isDoc, isMap] = [this.isDocumentSchema(), this.isMapSchema()];
|
|
492
|
+
if (!isDoc && !isMap) {
|
|
493
|
+
throw new Error(`@smithy/core/schema - cannot get key for non-map: ${this.getName(true)}`);
|
|
494
|
+
}
|
|
495
|
+
const schema = this.getSchema();
|
|
496
|
+
const memberSchema = isDoc ? 15 : schema[4] ?? 0;
|
|
497
|
+
return member([memberSchema, 0], "key");
|
|
498
|
+
}
|
|
499
|
+
getValueSchema() {
|
|
500
|
+
const sc = this.getSchema();
|
|
501
|
+
const [isDoc, isMap, isList] = [this.isDocumentSchema(), this.isMapSchema(), this.isListSchema()];
|
|
502
|
+
const memberSchema = typeof sc === "number" ? 63 & sc : sc && typeof sc === "object" && (isMap || isList) ? sc[3 + sc[0]] : isDoc ? 15 : undefined;
|
|
503
|
+
if (memberSchema != null) {
|
|
504
|
+
return member([memberSchema, 0], isMap ? "value" : "member");
|
|
505
|
+
}
|
|
506
|
+
throw new Error(`@smithy/core/schema - ${this.getName(true)} has no value member.`);
|
|
507
|
+
}
|
|
508
|
+
getMemberSchema(memberName) {
|
|
509
|
+
const struct2 = this.getSchema();
|
|
510
|
+
if (this.isStructSchema() && struct2[4].includes(memberName)) {
|
|
511
|
+
const i = struct2[4].indexOf(memberName);
|
|
512
|
+
const memberSchema = struct2[5][i];
|
|
513
|
+
return member(isMemberSchema(memberSchema) ? memberSchema : [memberSchema, 0], memberName);
|
|
514
|
+
}
|
|
515
|
+
if (this.isDocumentSchema()) {
|
|
516
|
+
return member([15, 0], memberName);
|
|
517
|
+
}
|
|
518
|
+
throw new Error(`@smithy/core/schema - ${this.getName(true)} has no member=${memberName}.`);
|
|
519
|
+
}
|
|
520
|
+
getMemberSchemas() {
|
|
521
|
+
const buffer = {};
|
|
522
|
+
try {
|
|
523
|
+
for (const [k, v] of this.structIterator()) {
|
|
524
|
+
buffer[k] = v;
|
|
525
|
+
}
|
|
526
|
+
} catch (ignored) {}
|
|
527
|
+
return buffer;
|
|
528
|
+
}
|
|
529
|
+
getEventStreamMember() {
|
|
530
|
+
if (this.isStructSchema()) {
|
|
531
|
+
for (const [memberName, memberSchema] of this.structIterator()) {
|
|
532
|
+
if (memberSchema.isStreaming() && memberSchema.isStructSchema()) {
|
|
533
|
+
return memberName;
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
return "";
|
|
538
|
+
}
|
|
539
|
+
*structIterator() {
|
|
540
|
+
if (this.isUnitSchema()) {
|
|
541
|
+
return;
|
|
542
|
+
}
|
|
543
|
+
if (!this.isStructSchema()) {
|
|
544
|
+
throw new Error("@smithy/core/schema - cannot iterate non-struct schema.");
|
|
545
|
+
}
|
|
546
|
+
const struct2 = this.getSchema();
|
|
547
|
+
const z = struct2[4].length;
|
|
548
|
+
let it = struct2[anno.it];
|
|
549
|
+
if (it && z === it.length) {
|
|
550
|
+
yield* it;
|
|
551
|
+
return;
|
|
552
|
+
}
|
|
553
|
+
it = Array(z);
|
|
554
|
+
for (let i = 0;i < z; ++i) {
|
|
555
|
+
const k = struct2[4][i];
|
|
556
|
+
const v = member([struct2[5][i], 0], k);
|
|
557
|
+
yield it[i] = [k, v];
|
|
558
|
+
}
|
|
559
|
+
struct2[anno.it] = it;
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
function member(memberSchema, memberName) {
|
|
563
|
+
if (memberSchema instanceof NormalizedSchema) {
|
|
564
|
+
return Object.assign(memberSchema, {
|
|
565
|
+
memberName,
|
|
566
|
+
_isMemberSchema: true
|
|
567
|
+
});
|
|
568
|
+
}
|
|
569
|
+
const internalCtorAccess = NormalizedSchema;
|
|
570
|
+
return new internalCtorAccess(memberSchema, memberName);
|
|
571
|
+
}
|
|
572
|
+
var isMemberSchema = (sc) => Array.isArray(sc) && sc.length === 2;
|
|
573
|
+
var isStaticSchema = (sc) => Array.isArray(sc) && sc.length >= 5;
|
|
574
|
+
|
|
575
|
+
class SimpleSchema extends Schema {
|
|
576
|
+
static symbol = Symbol.for("@smithy/sim");
|
|
577
|
+
name;
|
|
578
|
+
schemaRef;
|
|
579
|
+
traits;
|
|
580
|
+
symbol = SimpleSchema.symbol;
|
|
581
|
+
}
|
|
582
|
+
var sim = (namespace, name, schemaRef, traits) => Schema.assign(new SimpleSchema, {
|
|
583
|
+
name,
|
|
584
|
+
namespace,
|
|
585
|
+
traits,
|
|
586
|
+
schemaRef
|
|
587
|
+
});
|
|
588
|
+
var simAdapter = (namespace, name, traits, schemaRef) => Schema.assign(new SimpleSchema, {
|
|
589
|
+
name,
|
|
590
|
+
namespace,
|
|
591
|
+
traits,
|
|
592
|
+
schemaRef
|
|
593
|
+
});
|
|
594
|
+
var SCHEMA = {
|
|
595
|
+
BLOB: 21,
|
|
596
|
+
STREAMING_BLOB: 42,
|
|
597
|
+
BOOLEAN: 2,
|
|
598
|
+
STRING: 0,
|
|
599
|
+
NUMERIC: 1,
|
|
600
|
+
BIG_INTEGER: 17,
|
|
601
|
+
BIG_DECIMAL: 19,
|
|
602
|
+
DOCUMENT: 15,
|
|
603
|
+
TIMESTAMP_DEFAULT: 4,
|
|
604
|
+
TIMESTAMP_DATE_TIME: 5,
|
|
605
|
+
TIMESTAMP_HTTP_DATE: 6,
|
|
606
|
+
TIMESTAMP_EPOCH_SECONDS: 7,
|
|
607
|
+
LIST_MODIFIER: 64,
|
|
608
|
+
MAP_MODIFIER: 128
|
|
609
|
+
};
|
|
610
|
+
|
|
611
|
+
class TypeRegistry {
|
|
612
|
+
namespace;
|
|
613
|
+
schemas;
|
|
614
|
+
exceptions;
|
|
615
|
+
static registries = new Map;
|
|
616
|
+
constructor(namespace, schemas = new Map, exceptions = new Map) {
|
|
617
|
+
this.namespace = namespace;
|
|
618
|
+
this.schemas = schemas;
|
|
619
|
+
this.exceptions = exceptions;
|
|
620
|
+
}
|
|
621
|
+
static for(namespace) {
|
|
622
|
+
if (!TypeRegistry.registries.has(namespace)) {
|
|
623
|
+
TypeRegistry.registries.set(namespace, new TypeRegistry(namespace));
|
|
624
|
+
}
|
|
625
|
+
return TypeRegistry.registries.get(namespace);
|
|
626
|
+
}
|
|
627
|
+
copyFrom(other) {
|
|
628
|
+
const { schemas, exceptions } = this;
|
|
629
|
+
for (const [k, v] of other.schemas) {
|
|
630
|
+
if (!schemas.has(k)) {
|
|
631
|
+
schemas.set(k, v);
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
for (const [k, v] of other.exceptions) {
|
|
635
|
+
if (!exceptions.has(k)) {
|
|
636
|
+
exceptions.set(k, v);
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
register(shapeId, schema) {
|
|
641
|
+
const qualifiedName = this.normalizeShapeId(shapeId);
|
|
642
|
+
for (const r of [this, TypeRegistry.for(qualifiedName.split("#")[0])]) {
|
|
643
|
+
r.schemas.set(qualifiedName, schema);
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
getSchema(shapeId) {
|
|
647
|
+
const id = this.normalizeShapeId(shapeId);
|
|
648
|
+
if (!this.schemas.has(id)) {
|
|
649
|
+
throw new Error(`@smithy/core/schema - schema not found for ${id}`);
|
|
650
|
+
}
|
|
651
|
+
return this.schemas.get(id);
|
|
652
|
+
}
|
|
653
|
+
registerError(es, ctor) {
|
|
654
|
+
const $error2 = es;
|
|
655
|
+
const ns = $error2[1];
|
|
656
|
+
for (const r of [this, TypeRegistry.for(ns)]) {
|
|
657
|
+
r.schemas.set(ns + "#" + $error2[2], $error2);
|
|
658
|
+
r.exceptions.set($error2, ctor);
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
getErrorCtor(es) {
|
|
662
|
+
const $error2 = es;
|
|
663
|
+
if (this.exceptions.has($error2)) {
|
|
664
|
+
return this.exceptions.get($error2);
|
|
665
|
+
}
|
|
666
|
+
const registry = TypeRegistry.for($error2[1]);
|
|
667
|
+
return registry.exceptions.get($error2);
|
|
668
|
+
}
|
|
669
|
+
getBaseException() {
|
|
670
|
+
for (const exceptionKey of this.exceptions.keys()) {
|
|
671
|
+
if (Array.isArray(exceptionKey)) {
|
|
672
|
+
const [, ns, name] = exceptionKey;
|
|
673
|
+
const id = ns + "#" + name;
|
|
674
|
+
if (id.startsWith("smithy.ts.sdk.synthetic.") && id.endsWith("ServiceException")) {
|
|
675
|
+
return exceptionKey;
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
return;
|
|
680
|
+
}
|
|
681
|
+
find(predicate) {
|
|
682
|
+
return [...this.schemas.values()].find(predicate);
|
|
683
|
+
}
|
|
684
|
+
clear() {
|
|
685
|
+
this.schemas.clear();
|
|
686
|
+
this.exceptions.clear();
|
|
687
|
+
}
|
|
688
|
+
normalizeShapeId(shapeId) {
|
|
689
|
+
if (shapeId.includes("#")) {
|
|
690
|
+
return shapeId;
|
|
691
|
+
}
|
|
692
|
+
return this.namespace + "#" + shapeId;
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
exports.ErrorSchema = ErrorSchema;
|
|
696
|
+
exports.ListSchema = ListSchema;
|
|
697
|
+
exports.MapSchema = MapSchema;
|
|
698
|
+
exports.NormalizedSchema = NormalizedSchema;
|
|
699
|
+
exports.OperationSchema = OperationSchema;
|
|
700
|
+
exports.SCHEMA = SCHEMA;
|
|
701
|
+
exports.Schema = Schema;
|
|
702
|
+
exports.SimpleSchema = SimpleSchema;
|
|
703
|
+
exports.StructureSchema = StructureSchema;
|
|
704
|
+
exports.TypeRegistry = TypeRegistry;
|
|
705
|
+
exports.deref = deref;
|
|
706
|
+
exports.deserializerMiddlewareOption = deserializerMiddlewareOption;
|
|
707
|
+
exports.error = error;
|
|
708
|
+
exports.getSchemaSerdePlugin = getSchemaSerdePlugin;
|
|
709
|
+
exports.isStaticSchema = isStaticSchema;
|
|
710
|
+
exports.list = list;
|
|
711
|
+
exports.map = map;
|
|
712
|
+
exports.op = op;
|
|
713
|
+
exports.operation = operation;
|
|
714
|
+
exports.serializerMiddlewareOption = serializerMiddlewareOption;
|
|
715
|
+
exports.sim = sim;
|
|
716
|
+
exports.simAdapter = simAdapter;
|
|
717
|
+
exports.simpleSchemaCacheN = simpleSchemaCacheN;
|
|
718
|
+
exports.simpleSchemaCacheS = simpleSchemaCacheS;
|
|
719
|
+
exports.struct = struct;
|
|
720
|
+
exports.traitsCache = traitsCache;
|
|
721
|
+
exports.translateTraits = translateTraits;
|
|
722
|
+
});
|
|
723
|
+
|
|
724
|
+
// node_modules/.bun/@smithy+util-base64@4.3.2/node_modules/@smithy/util-base64/dist-cjs/fromBase64.js
|
|
725
|
+
var require_fromBase64 = __commonJS((exports) => {
|
|
726
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
727
|
+
exports.fromBase64 = undefined;
|
|
728
|
+
var util_buffer_from_1 = require_dist_cjs6();
|
|
729
|
+
var BASE64_REGEX = /^[A-Za-z0-9+/]*={0,2}$/;
|
|
730
|
+
var fromBase64 = (input) => {
|
|
731
|
+
if (input.length * 3 % 4 !== 0) {
|
|
732
|
+
throw new TypeError(`Incorrect padding on base64 string.`);
|
|
733
|
+
}
|
|
734
|
+
if (!BASE64_REGEX.exec(input)) {
|
|
735
|
+
throw new TypeError(`Invalid base64 string.`);
|
|
736
|
+
}
|
|
737
|
+
const buffer = (0, util_buffer_from_1.fromString)(input, "base64");
|
|
738
|
+
return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength);
|
|
739
|
+
};
|
|
740
|
+
exports.fromBase64 = fromBase64;
|
|
741
|
+
});
|
|
742
|
+
|
|
743
|
+
// node_modules/.bun/@smithy+util-base64@4.3.2/node_modules/@smithy/util-base64/dist-cjs/toBase64.js
|
|
744
|
+
var require_toBase64 = __commonJS((exports) => {
|
|
745
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
746
|
+
exports.toBase64 = undefined;
|
|
747
|
+
var util_buffer_from_1 = require_dist_cjs6();
|
|
748
|
+
var util_utf8_1 = require_dist_cjs7();
|
|
749
|
+
var toBase64 = (_input) => {
|
|
750
|
+
let input;
|
|
751
|
+
if (typeof _input === "string") {
|
|
752
|
+
input = (0, util_utf8_1.fromUtf8)(_input);
|
|
753
|
+
} else {
|
|
754
|
+
input = _input;
|
|
755
|
+
}
|
|
756
|
+
if (typeof input !== "object" || typeof input.byteOffset !== "number" || typeof input.byteLength !== "number") {
|
|
757
|
+
throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");
|
|
758
|
+
}
|
|
759
|
+
return (0, util_buffer_from_1.fromArrayBuffer)(input.buffer, input.byteOffset, input.byteLength).toString("base64");
|
|
760
|
+
};
|
|
761
|
+
exports.toBase64 = toBase64;
|
|
762
|
+
});
|
|
763
|
+
|
|
764
|
+
// node_modules/.bun/@smithy+util-base64@4.3.2/node_modules/@smithy/util-base64/dist-cjs/index.js
|
|
765
|
+
var require_dist_cjs9 = __commonJS((exports) => {
|
|
766
|
+
var fromBase64 = require_fromBase64();
|
|
767
|
+
var toBase64 = require_toBase64();
|
|
768
|
+
Object.prototype.hasOwnProperty.call(fromBase64, "__proto__") && !Object.prototype.hasOwnProperty.call(exports, "__proto__") && Object.defineProperty(exports, "__proto__", {
|
|
769
|
+
enumerable: true,
|
|
770
|
+
value: fromBase64["__proto__"]
|
|
771
|
+
});
|
|
772
|
+
Object.keys(fromBase64).forEach(function(k) {
|
|
773
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k))
|
|
774
|
+
exports[k] = fromBase64[k];
|
|
775
|
+
});
|
|
776
|
+
Object.prototype.hasOwnProperty.call(toBase64, "__proto__") && !Object.prototype.hasOwnProperty.call(exports, "__proto__") && Object.defineProperty(exports, "__proto__", {
|
|
777
|
+
enumerable: true,
|
|
778
|
+
value: toBase64["__proto__"]
|
|
779
|
+
});
|
|
780
|
+
Object.keys(toBase64).forEach(function(k) {
|
|
781
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k))
|
|
782
|
+
exports[k] = toBase64[k];
|
|
783
|
+
});
|
|
784
|
+
});
|
|
785
|
+
|
|
786
|
+
// node_modules/.bun/@smithy+util-stream@4.5.21/node_modules/@smithy/util-stream/dist-cjs/checksum/ChecksumStream.js
|
|
787
|
+
var require_ChecksumStream = __commonJS((exports) => {
|
|
788
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
789
|
+
exports.ChecksumStream = undefined;
|
|
790
|
+
var util_base64_1 = require_dist_cjs9();
|
|
791
|
+
var stream_1 = __require("stream");
|
|
792
|
+
|
|
793
|
+
class ChecksumStream extends stream_1.Duplex {
|
|
794
|
+
expectedChecksum;
|
|
795
|
+
checksumSourceLocation;
|
|
796
|
+
checksum;
|
|
797
|
+
source;
|
|
798
|
+
base64Encoder;
|
|
799
|
+
pendingCallback = null;
|
|
800
|
+
constructor({ expectedChecksum, checksum, source, checksumSourceLocation, base64Encoder }) {
|
|
801
|
+
super();
|
|
802
|
+
if (typeof source.pipe === "function") {
|
|
803
|
+
this.source = source;
|
|
804
|
+
} else {
|
|
805
|
+
throw new Error(`@smithy/util-stream: unsupported source type ${source?.constructor?.name ?? source} in ChecksumStream.`);
|
|
806
|
+
}
|
|
807
|
+
this.base64Encoder = base64Encoder ?? util_base64_1.toBase64;
|
|
808
|
+
this.expectedChecksum = expectedChecksum;
|
|
809
|
+
this.checksum = checksum;
|
|
810
|
+
this.checksumSourceLocation = checksumSourceLocation;
|
|
811
|
+
this.source.pipe(this);
|
|
812
|
+
}
|
|
813
|
+
_read(size) {
|
|
814
|
+
if (this.pendingCallback) {
|
|
815
|
+
const callback = this.pendingCallback;
|
|
816
|
+
this.pendingCallback = null;
|
|
817
|
+
callback();
|
|
818
|
+
}
|
|
819
|
+
}
|
|
820
|
+
_write(chunk, encoding, callback) {
|
|
821
|
+
try {
|
|
822
|
+
this.checksum.update(chunk);
|
|
823
|
+
const canPushMore = this.push(chunk);
|
|
824
|
+
if (!canPushMore) {
|
|
825
|
+
this.pendingCallback = callback;
|
|
826
|
+
return;
|
|
827
|
+
}
|
|
828
|
+
} catch (e) {
|
|
829
|
+
return callback(e);
|
|
830
|
+
}
|
|
831
|
+
return callback();
|
|
832
|
+
}
|
|
833
|
+
async _final(callback) {
|
|
834
|
+
try {
|
|
835
|
+
const digest = await this.checksum.digest();
|
|
836
|
+
const received = this.base64Encoder(digest);
|
|
837
|
+
if (this.expectedChecksum !== received) {
|
|
838
|
+
return callback(new Error(`Checksum mismatch: expected "${this.expectedChecksum}" but received "${received}"` + ` in response header "${this.checksumSourceLocation}".`));
|
|
839
|
+
}
|
|
840
|
+
} catch (e) {
|
|
841
|
+
return callback(e);
|
|
842
|
+
}
|
|
843
|
+
this.push(null);
|
|
844
|
+
return callback();
|
|
845
|
+
}
|
|
846
|
+
}
|
|
847
|
+
exports.ChecksumStream = ChecksumStream;
|
|
848
|
+
});
|
|
849
|
+
|
|
850
|
+
// node_modules/.bun/@smithy+util-stream@4.5.21/node_modules/@smithy/util-stream/dist-cjs/stream-type-check.js
|
|
851
|
+
var require_stream_type_check = __commonJS((exports) => {
|
|
852
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
853
|
+
exports.isBlob = exports.isReadableStream = undefined;
|
|
854
|
+
var isReadableStream = (stream) => typeof ReadableStream === "function" && (stream?.constructor?.name === ReadableStream.name || stream instanceof ReadableStream);
|
|
855
|
+
exports.isReadableStream = isReadableStream;
|
|
856
|
+
var isBlob = (blob) => {
|
|
857
|
+
return typeof Blob === "function" && (blob?.constructor?.name === Blob.name || blob instanceof Blob);
|
|
858
|
+
};
|
|
859
|
+
exports.isBlob = isBlob;
|
|
860
|
+
});
|
|
861
|
+
|
|
862
|
+
// node_modules/.bun/@smithy+util-stream@4.5.21/node_modules/@smithy/util-stream/dist-cjs/checksum/ChecksumStream.browser.js
|
|
863
|
+
var require_ChecksumStream_browser = __commonJS((exports) => {
|
|
864
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
865
|
+
exports.ChecksumStream = undefined;
|
|
866
|
+
var ReadableStreamRef = typeof ReadableStream === "function" ? ReadableStream : function() {};
|
|
867
|
+
|
|
868
|
+
class ChecksumStream extends ReadableStreamRef {
|
|
869
|
+
}
|
|
870
|
+
exports.ChecksumStream = ChecksumStream;
|
|
871
|
+
});
|
|
872
|
+
|
|
873
|
+
// node_modules/.bun/@smithy+util-stream@4.5.21/node_modules/@smithy/util-stream/dist-cjs/checksum/createChecksumStream.browser.js
|
|
874
|
+
var require_createChecksumStream_browser = __commonJS((exports) => {
|
|
875
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
876
|
+
exports.createChecksumStream = undefined;
|
|
877
|
+
var util_base64_1 = require_dist_cjs9();
|
|
878
|
+
var stream_type_check_1 = require_stream_type_check();
|
|
879
|
+
var ChecksumStream_browser_1 = require_ChecksumStream_browser();
|
|
880
|
+
var createChecksumStream = ({ expectedChecksum, checksum, source, checksumSourceLocation, base64Encoder }) => {
|
|
881
|
+
if (!(0, stream_type_check_1.isReadableStream)(source)) {
|
|
882
|
+
throw new Error(`@smithy/util-stream: unsupported source type ${source?.constructor?.name ?? source} in ChecksumStream.`);
|
|
883
|
+
}
|
|
884
|
+
const encoder = base64Encoder ?? util_base64_1.toBase64;
|
|
885
|
+
if (typeof TransformStream !== "function") {
|
|
886
|
+
throw new Error("@smithy/util-stream: unable to instantiate ChecksumStream because API unavailable: ReadableStream/TransformStream.");
|
|
887
|
+
}
|
|
888
|
+
const transform = new TransformStream({
|
|
889
|
+
start() {},
|
|
890
|
+
async transform(chunk, controller) {
|
|
891
|
+
checksum.update(chunk);
|
|
892
|
+
controller.enqueue(chunk);
|
|
893
|
+
},
|
|
894
|
+
async flush(controller) {
|
|
895
|
+
const digest = await checksum.digest();
|
|
896
|
+
const received = encoder(digest);
|
|
897
|
+
if (expectedChecksum !== received) {
|
|
898
|
+
const error = new Error(`Checksum mismatch: expected "${expectedChecksum}" but received "${received}"` + ` in response header "${checksumSourceLocation}".`);
|
|
899
|
+
controller.error(error);
|
|
900
|
+
} else {
|
|
901
|
+
controller.terminate();
|
|
902
|
+
}
|
|
903
|
+
}
|
|
904
|
+
});
|
|
905
|
+
source.pipeThrough(transform);
|
|
906
|
+
const readable = transform.readable;
|
|
907
|
+
Object.setPrototypeOf(readable, ChecksumStream_browser_1.ChecksumStream.prototype);
|
|
908
|
+
return readable;
|
|
909
|
+
};
|
|
910
|
+
exports.createChecksumStream = createChecksumStream;
|
|
911
|
+
});
|
|
912
|
+
|
|
913
|
+
// node_modules/.bun/@smithy+util-stream@4.5.21/node_modules/@smithy/util-stream/dist-cjs/checksum/createChecksumStream.js
|
|
914
|
+
var require_createChecksumStream = __commonJS((exports) => {
|
|
915
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
916
|
+
exports.createChecksumStream = createChecksumStream;
|
|
917
|
+
var stream_type_check_1 = require_stream_type_check();
|
|
918
|
+
var ChecksumStream_1 = require_ChecksumStream();
|
|
919
|
+
var createChecksumStream_browser_1 = require_createChecksumStream_browser();
|
|
920
|
+
function createChecksumStream(init) {
|
|
921
|
+
if (typeof ReadableStream === "function" && (0, stream_type_check_1.isReadableStream)(init.source)) {
|
|
922
|
+
return (0, createChecksumStream_browser_1.createChecksumStream)(init);
|
|
923
|
+
}
|
|
924
|
+
return new ChecksumStream_1.ChecksumStream(init);
|
|
925
|
+
}
|
|
926
|
+
});
|
|
927
|
+
|
|
928
|
+
// node_modules/.bun/@smithy+util-stream@4.5.21/node_modules/@smithy/util-stream/dist-cjs/ByteArrayCollector.js
|
|
929
|
+
var require_ByteArrayCollector = __commonJS((exports) => {
|
|
930
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
931
|
+
exports.ByteArrayCollector = undefined;
|
|
932
|
+
|
|
933
|
+
class ByteArrayCollector {
|
|
934
|
+
allocByteArray;
|
|
935
|
+
byteLength = 0;
|
|
936
|
+
byteArrays = [];
|
|
937
|
+
constructor(allocByteArray) {
|
|
938
|
+
this.allocByteArray = allocByteArray;
|
|
939
|
+
}
|
|
940
|
+
push(byteArray) {
|
|
941
|
+
this.byteArrays.push(byteArray);
|
|
942
|
+
this.byteLength += byteArray.byteLength;
|
|
943
|
+
}
|
|
944
|
+
flush() {
|
|
945
|
+
if (this.byteArrays.length === 1) {
|
|
946
|
+
const bytes = this.byteArrays[0];
|
|
947
|
+
this.reset();
|
|
948
|
+
return bytes;
|
|
949
|
+
}
|
|
950
|
+
const aggregation = this.allocByteArray(this.byteLength);
|
|
951
|
+
let cursor = 0;
|
|
952
|
+
for (let i = 0;i < this.byteArrays.length; ++i) {
|
|
953
|
+
const bytes = this.byteArrays[i];
|
|
954
|
+
aggregation.set(bytes, cursor);
|
|
955
|
+
cursor += bytes.byteLength;
|
|
956
|
+
}
|
|
957
|
+
this.reset();
|
|
958
|
+
return aggregation;
|
|
959
|
+
}
|
|
960
|
+
reset() {
|
|
961
|
+
this.byteArrays = [];
|
|
962
|
+
this.byteLength = 0;
|
|
963
|
+
}
|
|
964
|
+
}
|
|
965
|
+
exports.ByteArrayCollector = ByteArrayCollector;
|
|
966
|
+
});
|
|
967
|
+
|
|
968
|
+
// node_modules/.bun/@smithy+util-stream@4.5.21/node_modules/@smithy/util-stream/dist-cjs/createBufferedReadableStream.js
|
|
969
|
+
var require_createBufferedReadableStream = __commonJS((exports) => {
|
|
970
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
971
|
+
exports.createBufferedReadable = undefined;
|
|
972
|
+
exports.createBufferedReadableStream = createBufferedReadableStream;
|
|
973
|
+
exports.merge = merge;
|
|
974
|
+
exports.flush = flush;
|
|
975
|
+
exports.sizeOf = sizeOf;
|
|
976
|
+
exports.modeOf = modeOf;
|
|
977
|
+
var ByteArrayCollector_1 = require_ByteArrayCollector();
|
|
978
|
+
function createBufferedReadableStream(upstream, size, logger) {
|
|
979
|
+
const reader = upstream.getReader();
|
|
980
|
+
let streamBufferingLoggedWarning = false;
|
|
981
|
+
let bytesSeen = 0;
|
|
982
|
+
const buffers = ["", new ByteArrayCollector_1.ByteArrayCollector((size2) => new Uint8Array(size2))];
|
|
983
|
+
let mode = -1;
|
|
984
|
+
const pull = async (controller) => {
|
|
985
|
+
const { value, done } = await reader.read();
|
|
986
|
+
const chunk = value;
|
|
987
|
+
if (done) {
|
|
988
|
+
if (mode !== -1) {
|
|
989
|
+
const remainder = flush(buffers, mode);
|
|
990
|
+
if (sizeOf(remainder) > 0) {
|
|
991
|
+
controller.enqueue(remainder);
|
|
992
|
+
}
|
|
993
|
+
}
|
|
994
|
+
controller.close();
|
|
995
|
+
} else {
|
|
996
|
+
const chunkMode = modeOf(chunk, false);
|
|
997
|
+
if (mode !== chunkMode) {
|
|
998
|
+
if (mode >= 0) {
|
|
999
|
+
controller.enqueue(flush(buffers, mode));
|
|
1000
|
+
}
|
|
1001
|
+
mode = chunkMode;
|
|
1002
|
+
}
|
|
1003
|
+
if (mode === -1) {
|
|
1004
|
+
controller.enqueue(chunk);
|
|
1005
|
+
return;
|
|
1006
|
+
}
|
|
1007
|
+
const chunkSize = sizeOf(chunk);
|
|
1008
|
+
bytesSeen += chunkSize;
|
|
1009
|
+
const bufferSize = sizeOf(buffers[mode]);
|
|
1010
|
+
if (chunkSize >= size && bufferSize === 0) {
|
|
1011
|
+
controller.enqueue(chunk);
|
|
1012
|
+
} else {
|
|
1013
|
+
const newSize = merge(buffers, mode, chunk);
|
|
1014
|
+
if (!streamBufferingLoggedWarning && bytesSeen > size * 2) {
|
|
1015
|
+
streamBufferingLoggedWarning = true;
|
|
1016
|
+
logger?.warn(`@smithy/util-stream - stream chunk size ${chunkSize} is below threshold of ${size}, automatically buffering.`);
|
|
1017
|
+
}
|
|
1018
|
+
if (newSize >= size) {
|
|
1019
|
+
controller.enqueue(flush(buffers, mode));
|
|
1020
|
+
} else {
|
|
1021
|
+
await pull(controller);
|
|
1022
|
+
}
|
|
1023
|
+
}
|
|
1024
|
+
}
|
|
1025
|
+
};
|
|
1026
|
+
return new ReadableStream({
|
|
1027
|
+
pull
|
|
1028
|
+
});
|
|
1029
|
+
}
|
|
1030
|
+
exports.createBufferedReadable = createBufferedReadableStream;
|
|
1031
|
+
function merge(buffers, mode, chunk) {
|
|
1032
|
+
switch (mode) {
|
|
1033
|
+
case 0:
|
|
1034
|
+
buffers[0] += chunk;
|
|
1035
|
+
return sizeOf(buffers[0]);
|
|
1036
|
+
case 1:
|
|
1037
|
+
case 2:
|
|
1038
|
+
buffers[mode].push(chunk);
|
|
1039
|
+
return sizeOf(buffers[mode]);
|
|
1040
|
+
}
|
|
1041
|
+
}
|
|
1042
|
+
function flush(buffers, mode) {
|
|
1043
|
+
switch (mode) {
|
|
1044
|
+
case 0:
|
|
1045
|
+
const s = buffers[0];
|
|
1046
|
+
buffers[0] = "";
|
|
1047
|
+
return s;
|
|
1048
|
+
case 1:
|
|
1049
|
+
case 2:
|
|
1050
|
+
return buffers[mode].flush();
|
|
1051
|
+
}
|
|
1052
|
+
throw new Error(`@smithy/util-stream - invalid index ${mode} given to flush()`);
|
|
1053
|
+
}
|
|
1054
|
+
function sizeOf(chunk) {
|
|
1055
|
+
return chunk?.byteLength ?? chunk?.length ?? 0;
|
|
1056
|
+
}
|
|
1057
|
+
function modeOf(chunk, allowBuffer = true) {
|
|
1058
|
+
if (allowBuffer && typeof Buffer !== "undefined" && chunk instanceof Buffer) {
|
|
1059
|
+
return 2;
|
|
1060
|
+
}
|
|
1061
|
+
if (chunk instanceof Uint8Array) {
|
|
1062
|
+
return 1;
|
|
1063
|
+
}
|
|
1064
|
+
if (typeof chunk === "string") {
|
|
1065
|
+
return 0;
|
|
1066
|
+
}
|
|
1067
|
+
return -1;
|
|
1068
|
+
}
|
|
1069
|
+
});
|
|
1070
|
+
|
|
1071
|
+
// node_modules/.bun/@smithy+util-stream@4.5.21/node_modules/@smithy/util-stream/dist-cjs/createBufferedReadable.js
|
|
1072
|
+
var require_createBufferedReadable = __commonJS((exports) => {
|
|
1073
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1074
|
+
exports.createBufferedReadable = createBufferedReadable;
|
|
1075
|
+
var node_stream_1 = __require("stream");
|
|
1076
|
+
var ByteArrayCollector_1 = require_ByteArrayCollector();
|
|
1077
|
+
var createBufferedReadableStream_1 = require_createBufferedReadableStream();
|
|
1078
|
+
var stream_type_check_1 = require_stream_type_check();
|
|
1079
|
+
function createBufferedReadable(upstream, size, logger) {
|
|
1080
|
+
if ((0, stream_type_check_1.isReadableStream)(upstream)) {
|
|
1081
|
+
return (0, createBufferedReadableStream_1.createBufferedReadableStream)(upstream, size, logger);
|
|
1082
|
+
}
|
|
1083
|
+
const downstream = new node_stream_1.Readable({ read() {} });
|
|
1084
|
+
let streamBufferingLoggedWarning = false;
|
|
1085
|
+
let bytesSeen = 0;
|
|
1086
|
+
const buffers = [
|
|
1087
|
+
"",
|
|
1088
|
+
new ByteArrayCollector_1.ByteArrayCollector((size2) => new Uint8Array(size2)),
|
|
1089
|
+
new ByteArrayCollector_1.ByteArrayCollector((size2) => Buffer.from(new Uint8Array(size2)))
|
|
1090
|
+
];
|
|
1091
|
+
let mode = -1;
|
|
1092
|
+
upstream.on("data", (chunk) => {
|
|
1093
|
+
const chunkMode = (0, createBufferedReadableStream_1.modeOf)(chunk, true);
|
|
1094
|
+
if (mode !== chunkMode) {
|
|
1095
|
+
if (mode >= 0) {
|
|
1096
|
+
downstream.push((0, createBufferedReadableStream_1.flush)(buffers, mode));
|
|
1097
|
+
}
|
|
1098
|
+
mode = chunkMode;
|
|
1099
|
+
}
|
|
1100
|
+
if (mode === -1) {
|
|
1101
|
+
downstream.push(chunk);
|
|
1102
|
+
return;
|
|
1103
|
+
}
|
|
1104
|
+
const chunkSize = (0, createBufferedReadableStream_1.sizeOf)(chunk);
|
|
1105
|
+
bytesSeen += chunkSize;
|
|
1106
|
+
const bufferSize = (0, createBufferedReadableStream_1.sizeOf)(buffers[mode]);
|
|
1107
|
+
if (chunkSize >= size && bufferSize === 0) {
|
|
1108
|
+
downstream.push(chunk);
|
|
1109
|
+
} else {
|
|
1110
|
+
const newSize = (0, createBufferedReadableStream_1.merge)(buffers, mode, chunk);
|
|
1111
|
+
if (!streamBufferingLoggedWarning && bytesSeen > size * 2) {
|
|
1112
|
+
streamBufferingLoggedWarning = true;
|
|
1113
|
+
logger?.warn(`@smithy/util-stream - stream chunk size ${chunkSize} is below threshold of ${size}, automatically buffering.`);
|
|
1114
|
+
}
|
|
1115
|
+
if (newSize >= size) {
|
|
1116
|
+
downstream.push((0, createBufferedReadableStream_1.flush)(buffers, mode));
|
|
1117
|
+
}
|
|
1118
|
+
}
|
|
1119
|
+
});
|
|
1120
|
+
upstream.on("end", () => {
|
|
1121
|
+
if (mode !== -1) {
|
|
1122
|
+
const remainder = (0, createBufferedReadableStream_1.flush)(buffers, mode);
|
|
1123
|
+
if ((0, createBufferedReadableStream_1.sizeOf)(remainder) > 0) {
|
|
1124
|
+
downstream.push(remainder);
|
|
1125
|
+
}
|
|
1126
|
+
}
|
|
1127
|
+
downstream.push(null);
|
|
1128
|
+
});
|
|
1129
|
+
return downstream;
|
|
1130
|
+
}
|
|
1131
|
+
});
|
|
1132
|
+
|
|
1133
|
+
// node_modules/.bun/@smithy+util-stream@4.5.21/node_modules/@smithy/util-stream/dist-cjs/getAwsChunkedEncodingStream.browser.js
|
|
1134
|
+
var require_getAwsChunkedEncodingStream_browser = __commonJS((exports) => {
|
|
1135
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1136
|
+
exports.getAwsChunkedEncodingStream = undefined;
|
|
1137
|
+
var getAwsChunkedEncodingStream = (readableStream, options) => {
|
|
1138
|
+
const { base64Encoder, bodyLengthChecker, checksumAlgorithmFn, checksumLocationName, streamHasher } = options;
|
|
1139
|
+
const checksumRequired = base64Encoder !== undefined && bodyLengthChecker !== undefined && checksumAlgorithmFn !== undefined && checksumLocationName !== undefined && streamHasher !== undefined;
|
|
1140
|
+
const digest = checksumRequired ? streamHasher(checksumAlgorithmFn, readableStream) : undefined;
|
|
1141
|
+
const reader = readableStream.getReader();
|
|
1142
|
+
return new ReadableStream({
|
|
1143
|
+
async pull(controller) {
|
|
1144
|
+
const { value, done } = await reader.read();
|
|
1145
|
+
if (done) {
|
|
1146
|
+
controller.enqueue(`0\r
|
|
1147
|
+
`);
|
|
1148
|
+
if (checksumRequired) {
|
|
1149
|
+
const checksum = base64Encoder(await digest);
|
|
1150
|
+
controller.enqueue(`${checksumLocationName}:${checksum}\r
|
|
1151
|
+
`);
|
|
1152
|
+
controller.enqueue(`\r
|
|
1153
|
+
`);
|
|
1154
|
+
}
|
|
1155
|
+
controller.close();
|
|
1156
|
+
} else {
|
|
1157
|
+
controller.enqueue(`${(bodyLengthChecker(value) || 0).toString(16)}\r
|
|
1158
|
+
${value}\r
|
|
1159
|
+
`);
|
|
1160
|
+
}
|
|
1161
|
+
}
|
|
1162
|
+
});
|
|
1163
|
+
};
|
|
1164
|
+
exports.getAwsChunkedEncodingStream = getAwsChunkedEncodingStream;
|
|
1165
|
+
});
|
|
1166
|
+
|
|
1167
|
+
// node_modules/.bun/@smithy+util-stream@4.5.21/node_modules/@smithy/util-stream/dist-cjs/getAwsChunkedEncodingStream.js
|
|
1168
|
+
var require_getAwsChunkedEncodingStream = __commonJS((exports) => {
|
|
1169
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1170
|
+
exports.getAwsChunkedEncodingStream = getAwsChunkedEncodingStream;
|
|
1171
|
+
var node_stream_1 = __require("stream");
|
|
1172
|
+
var getAwsChunkedEncodingStream_browser_1 = require_getAwsChunkedEncodingStream_browser();
|
|
1173
|
+
var stream_type_check_1 = require_stream_type_check();
|
|
1174
|
+
function getAwsChunkedEncodingStream(stream, options) {
|
|
1175
|
+
const readable = stream;
|
|
1176
|
+
const readableStream = stream;
|
|
1177
|
+
if ((0, stream_type_check_1.isReadableStream)(readableStream)) {
|
|
1178
|
+
return (0, getAwsChunkedEncodingStream_browser_1.getAwsChunkedEncodingStream)(readableStream, options);
|
|
1179
|
+
}
|
|
1180
|
+
const { base64Encoder, bodyLengthChecker, checksumAlgorithmFn, checksumLocationName, streamHasher } = options;
|
|
1181
|
+
const checksumRequired = base64Encoder !== undefined && checksumAlgorithmFn !== undefined && checksumLocationName !== undefined && streamHasher !== undefined;
|
|
1182
|
+
const digest = checksumRequired ? streamHasher(checksumAlgorithmFn, readable) : undefined;
|
|
1183
|
+
const awsChunkedEncodingStream = new node_stream_1.Readable({
|
|
1184
|
+
read: () => {}
|
|
1185
|
+
});
|
|
1186
|
+
readable.on("data", (data) => {
|
|
1187
|
+
const length = bodyLengthChecker(data) || 0;
|
|
1188
|
+
if (length === 0) {
|
|
1189
|
+
return;
|
|
1190
|
+
}
|
|
1191
|
+
awsChunkedEncodingStream.push(`${length.toString(16)}\r
|
|
1192
|
+
`);
|
|
1193
|
+
awsChunkedEncodingStream.push(data);
|
|
1194
|
+
awsChunkedEncodingStream.push(`\r
|
|
1195
|
+
`);
|
|
1196
|
+
});
|
|
1197
|
+
readable.on("end", async () => {
|
|
1198
|
+
awsChunkedEncodingStream.push(`0\r
|
|
1199
|
+
`);
|
|
1200
|
+
if (checksumRequired) {
|
|
1201
|
+
const checksum = base64Encoder(await digest);
|
|
1202
|
+
awsChunkedEncodingStream.push(`${checksumLocationName}:${checksum}\r
|
|
1203
|
+
`);
|
|
1204
|
+
awsChunkedEncodingStream.push(`\r
|
|
1205
|
+
`);
|
|
1206
|
+
}
|
|
1207
|
+
awsChunkedEncodingStream.push(null);
|
|
1208
|
+
});
|
|
1209
|
+
return awsChunkedEncodingStream;
|
|
1210
|
+
}
|
|
1211
|
+
});
|
|
1212
|
+
|
|
1213
|
+
// node_modules/.bun/@smithy+util-stream@4.5.21/node_modules/@smithy/util-stream/dist-cjs/headStream.browser.js
|
|
1214
|
+
var require_headStream_browser = __commonJS((exports) => {
|
|
1215
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1216
|
+
exports.headStream = headStream;
|
|
1217
|
+
async function headStream(stream, bytes) {
|
|
1218
|
+
let byteLengthCounter = 0;
|
|
1219
|
+
const chunks = [];
|
|
1220
|
+
const reader = stream.getReader();
|
|
1221
|
+
let isDone = false;
|
|
1222
|
+
while (!isDone) {
|
|
1223
|
+
const { done, value } = await reader.read();
|
|
1224
|
+
if (value) {
|
|
1225
|
+
chunks.push(value);
|
|
1226
|
+
byteLengthCounter += value?.byteLength ?? 0;
|
|
1227
|
+
}
|
|
1228
|
+
if (byteLengthCounter >= bytes) {
|
|
1229
|
+
break;
|
|
1230
|
+
}
|
|
1231
|
+
isDone = done;
|
|
1232
|
+
}
|
|
1233
|
+
reader.releaseLock();
|
|
1234
|
+
const collected = new Uint8Array(Math.min(bytes, byteLengthCounter));
|
|
1235
|
+
let offset = 0;
|
|
1236
|
+
for (const chunk of chunks) {
|
|
1237
|
+
if (chunk.byteLength > collected.byteLength - offset) {
|
|
1238
|
+
collected.set(chunk.subarray(0, collected.byteLength - offset), offset);
|
|
1239
|
+
break;
|
|
1240
|
+
} else {
|
|
1241
|
+
collected.set(chunk, offset);
|
|
1242
|
+
}
|
|
1243
|
+
offset += chunk.length;
|
|
1244
|
+
}
|
|
1245
|
+
return collected;
|
|
1246
|
+
}
|
|
1247
|
+
});
|
|
1248
|
+
|
|
1249
|
+
// node_modules/.bun/@smithy+util-stream@4.5.21/node_modules/@smithy/util-stream/dist-cjs/headStream.js
|
|
1250
|
+
var require_headStream = __commonJS((exports) => {
|
|
1251
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1252
|
+
exports.headStream = undefined;
|
|
1253
|
+
var stream_1 = __require("stream");
|
|
1254
|
+
var headStream_browser_1 = require_headStream_browser();
|
|
1255
|
+
var stream_type_check_1 = require_stream_type_check();
|
|
1256
|
+
var headStream = (stream, bytes) => {
|
|
1257
|
+
if ((0, stream_type_check_1.isReadableStream)(stream)) {
|
|
1258
|
+
return (0, headStream_browser_1.headStream)(stream, bytes);
|
|
1259
|
+
}
|
|
1260
|
+
return new Promise((resolve, reject) => {
|
|
1261
|
+
const collector = new Collector;
|
|
1262
|
+
collector.limit = bytes;
|
|
1263
|
+
stream.pipe(collector);
|
|
1264
|
+
stream.on("error", (err) => {
|
|
1265
|
+
collector.end();
|
|
1266
|
+
reject(err);
|
|
1267
|
+
});
|
|
1268
|
+
collector.on("error", reject);
|
|
1269
|
+
collector.on("finish", function() {
|
|
1270
|
+
const bytes2 = new Uint8Array(Buffer.concat(this.buffers));
|
|
1271
|
+
resolve(bytes2);
|
|
1272
|
+
});
|
|
1273
|
+
});
|
|
1274
|
+
};
|
|
1275
|
+
exports.headStream = headStream;
|
|
1276
|
+
|
|
1277
|
+
class Collector extends stream_1.Writable {
|
|
1278
|
+
buffers = [];
|
|
1279
|
+
limit = Infinity;
|
|
1280
|
+
bytesBuffered = 0;
|
|
1281
|
+
_write(chunk, encoding, callback) {
|
|
1282
|
+
this.buffers.push(chunk);
|
|
1283
|
+
this.bytesBuffered += chunk.byteLength ?? 0;
|
|
1284
|
+
if (this.bytesBuffered >= this.limit) {
|
|
1285
|
+
const excess = this.bytesBuffered - this.limit;
|
|
1286
|
+
const tailBuffer = this.buffers[this.buffers.length - 1];
|
|
1287
|
+
this.buffers[this.buffers.length - 1] = tailBuffer.subarray(0, tailBuffer.byteLength - excess);
|
|
1288
|
+
this.emit("finish");
|
|
1289
|
+
}
|
|
1290
|
+
callback();
|
|
1291
|
+
}
|
|
1292
|
+
}
|
|
1293
|
+
});
|
|
1294
|
+
|
|
1295
|
+
// node_modules/.bun/@smithy+fetch-http-handler@5.3.15/node_modules/@smithy/fetch-http-handler/dist-cjs/index.js
|
|
1296
|
+
var require_dist_cjs10 = __commonJS((exports) => {
|
|
1297
|
+
var protocolHttp = require_dist_cjs2();
|
|
1298
|
+
var querystringBuilder = require_dist_cjs3();
|
|
1299
|
+
var utilBase64 = require_dist_cjs9();
|
|
1300
|
+
function createRequest(url, requestOptions) {
|
|
1301
|
+
return new Request(url, requestOptions);
|
|
1302
|
+
}
|
|
1303
|
+
function requestTimeout(timeoutInMs = 0) {
|
|
1304
|
+
return new Promise((resolve, reject) => {
|
|
1305
|
+
if (timeoutInMs) {
|
|
1306
|
+
setTimeout(() => {
|
|
1307
|
+
const timeoutError = new Error(`Request did not complete within ${timeoutInMs} ms`);
|
|
1308
|
+
timeoutError.name = "TimeoutError";
|
|
1309
|
+
reject(timeoutError);
|
|
1310
|
+
}, timeoutInMs);
|
|
1311
|
+
}
|
|
1312
|
+
});
|
|
1313
|
+
}
|
|
1314
|
+
var keepAliveSupport = {
|
|
1315
|
+
supported: undefined
|
|
1316
|
+
};
|
|
1317
|
+
|
|
1318
|
+
class FetchHttpHandler {
|
|
1319
|
+
config;
|
|
1320
|
+
configProvider;
|
|
1321
|
+
static create(instanceOrOptions) {
|
|
1322
|
+
if (typeof instanceOrOptions?.handle === "function") {
|
|
1323
|
+
return instanceOrOptions;
|
|
1324
|
+
}
|
|
1325
|
+
return new FetchHttpHandler(instanceOrOptions);
|
|
1326
|
+
}
|
|
1327
|
+
constructor(options) {
|
|
1328
|
+
if (typeof options === "function") {
|
|
1329
|
+
this.configProvider = options().then((opts) => opts || {});
|
|
1330
|
+
} else {
|
|
1331
|
+
this.config = options ?? {};
|
|
1332
|
+
this.configProvider = Promise.resolve(this.config);
|
|
1333
|
+
}
|
|
1334
|
+
if (keepAliveSupport.supported === undefined) {
|
|
1335
|
+
keepAliveSupport.supported = Boolean(typeof Request !== "undefined" && "keepalive" in createRequest("https://[::1]"));
|
|
1336
|
+
}
|
|
1337
|
+
}
|
|
1338
|
+
destroy() {}
|
|
1339
|
+
async handle(request, { abortSignal, requestTimeout: requestTimeout$1 } = {}) {
|
|
1340
|
+
if (!this.config) {
|
|
1341
|
+
this.config = await this.configProvider;
|
|
1342
|
+
}
|
|
1343
|
+
const requestTimeoutInMs = requestTimeout$1 ?? this.config.requestTimeout;
|
|
1344
|
+
const keepAlive = this.config.keepAlive === true;
|
|
1345
|
+
const credentials = this.config.credentials;
|
|
1346
|
+
if (abortSignal?.aborted) {
|
|
1347
|
+
const abortError = buildAbortError(abortSignal);
|
|
1348
|
+
return Promise.reject(abortError);
|
|
1349
|
+
}
|
|
1350
|
+
let path = request.path;
|
|
1351
|
+
const queryString = querystringBuilder.buildQueryString(request.query || {});
|
|
1352
|
+
if (queryString) {
|
|
1353
|
+
path += `?${queryString}`;
|
|
1354
|
+
}
|
|
1355
|
+
if (request.fragment) {
|
|
1356
|
+
path += `#${request.fragment}`;
|
|
1357
|
+
}
|
|
1358
|
+
let auth = "";
|
|
1359
|
+
if (request.username != null || request.password != null) {
|
|
1360
|
+
const username = request.username ?? "";
|
|
1361
|
+
const password = request.password ?? "";
|
|
1362
|
+
auth = `${username}:${password}@`;
|
|
1363
|
+
}
|
|
1364
|
+
const { port, method } = request;
|
|
1365
|
+
const url = `${request.protocol}//${auth}${request.hostname}${port ? `:${port}` : ""}${path}`;
|
|
1366
|
+
const body = method === "GET" || method === "HEAD" ? undefined : request.body;
|
|
1367
|
+
const requestOptions = {
|
|
1368
|
+
body,
|
|
1369
|
+
headers: new Headers(request.headers),
|
|
1370
|
+
method,
|
|
1371
|
+
credentials
|
|
1372
|
+
};
|
|
1373
|
+
if (this.config?.cache) {
|
|
1374
|
+
requestOptions.cache = this.config.cache;
|
|
1375
|
+
}
|
|
1376
|
+
if (body) {
|
|
1377
|
+
requestOptions.duplex = "half";
|
|
1378
|
+
}
|
|
1379
|
+
if (typeof AbortController !== "undefined") {
|
|
1380
|
+
requestOptions.signal = abortSignal;
|
|
1381
|
+
}
|
|
1382
|
+
if (keepAliveSupport.supported) {
|
|
1383
|
+
requestOptions.keepalive = keepAlive;
|
|
1384
|
+
}
|
|
1385
|
+
if (typeof this.config.requestInit === "function") {
|
|
1386
|
+
Object.assign(requestOptions, this.config.requestInit(request));
|
|
1387
|
+
}
|
|
1388
|
+
let removeSignalEventListener = () => {};
|
|
1389
|
+
const fetchRequest = createRequest(url, requestOptions);
|
|
1390
|
+
const raceOfPromises = [
|
|
1391
|
+
fetch(fetchRequest).then((response) => {
|
|
1392
|
+
const fetchHeaders = response.headers;
|
|
1393
|
+
const transformedHeaders = {};
|
|
1394
|
+
for (const pair of fetchHeaders.entries()) {
|
|
1395
|
+
transformedHeaders[pair[0]] = pair[1];
|
|
1396
|
+
}
|
|
1397
|
+
const hasReadableStream = response.body != null;
|
|
1398
|
+
if (!hasReadableStream) {
|
|
1399
|
+
return response.blob().then((body2) => ({
|
|
1400
|
+
response: new protocolHttp.HttpResponse({
|
|
1401
|
+
headers: transformedHeaders,
|
|
1402
|
+
reason: response.statusText,
|
|
1403
|
+
statusCode: response.status,
|
|
1404
|
+
body: body2
|
|
1405
|
+
})
|
|
1406
|
+
}));
|
|
1407
|
+
}
|
|
1408
|
+
return {
|
|
1409
|
+
response: new protocolHttp.HttpResponse({
|
|
1410
|
+
headers: transformedHeaders,
|
|
1411
|
+
reason: response.statusText,
|
|
1412
|
+
statusCode: response.status,
|
|
1413
|
+
body: response.body
|
|
1414
|
+
})
|
|
1415
|
+
};
|
|
1416
|
+
}),
|
|
1417
|
+
requestTimeout(requestTimeoutInMs)
|
|
1418
|
+
];
|
|
1419
|
+
if (abortSignal) {
|
|
1420
|
+
raceOfPromises.push(new Promise((resolve, reject) => {
|
|
1421
|
+
const onAbort = () => {
|
|
1422
|
+
const abortError = buildAbortError(abortSignal);
|
|
1423
|
+
reject(abortError);
|
|
1424
|
+
};
|
|
1425
|
+
if (typeof abortSignal.addEventListener === "function") {
|
|
1426
|
+
const signal = abortSignal;
|
|
1427
|
+
signal.addEventListener("abort", onAbort, { once: true });
|
|
1428
|
+
removeSignalEventListener = () => signal.removeEventListener("abort", onAbort);
|
|
1429
|
+
} else {
|
|
1430
|
+
abortSignal.onabort = onAbort;
|
|
1431
|
+
}
|
|
1432
|
+
}));
|
|
1433
|
+
}
|
|
1434
|
+
return Promise.race(raceOfPromises).finally(removeSignalEventListener);
|
|
1435
|
+
}
|
|
1436
|
+
updateHttpClientConfig(key, value) {
|
|
1437
|
+
this.config = undefined;
|
|
1438
|
+
this.configProvider = this.configProvider.then((config) => {
|
|
1439
|
+
config[key] = value;
|
|
1440
|
+
return config;
|
|
1441
|
+
});
|
|
1442
|
+
}
|
|
1443
|
+
httpHandlerConfigs() {
|
|
1444
|
+
return this.config ?? {};
|
|
1445
|
+
}
|
|
1446
|
+
}
|
|
1447
|
+
function buildAbortError(abortSignal) {
|
|
1448
|
+
const reason = abortSignal && typeof abortSignal === "object" && "reason" in abortSignal ? abortSignal.reason : undefined;
|
|
1449
|
+
if (reason) {
|
|
1450
|
+
if (reason instanceof Error) {
|
|
1451
|
+
const abortError3 = new Error("Request aborted");
|
|
1452
|
+
abortError3.name = "AbortError";
|
|
1453
|
+
abortError3.cause = reason;
|
|
1454
|
+
return abortError3;
|
|
1455
|
+
}
|
|
1456
|
+
const abortError2 = new Error(String(reason));
|
|
1457
|
+
abortError2.name = "AbortError";
|
|
1458
|
+
return abortError2;
|
|
1459
|
+
}
|
|
1460
|
+
const abortError = new Error("Request aborted");
|
|
1461
|
+
abortError.name = "AbortError";
|
|
1462
|
+
return abortError;
|
|
1463
|
+
}
|
|
1464
|
+
var streamCollector = async (stream) => {
|
|
1465
|
+
if (typeof Blob === "function" && stream instanceof Blob || stream.constructor?.name === "Blob") {
|
|
1466
|
+
if (Blob.prototype.arrayBuffer !== undefined) {
|
|
1467
|
+
return new Uint8Array(await stream.arrayBuffer());
|
|
1468
|
+
}
|
|
1469
|
+
return collectBlob(stream);
|
|
1470
|
+
}
|
|
1471
|
+
return collectStream(stream);
|
|
1472
|
+
};
|
|
1473
|
+
async function collectBlob(blob) {
|
|
1474
|
+
const base64 = await readToBase64(blob);
|
|
1475
|
+
const arrayBuffer = utilBase64.fromBase64(base64);
|
|
1476
|
+
return new Uint8Array(arrayBuffer);
|
|
1477
|
+
}
|
|
1478
|
+
async function collectStream(stream) {
|
|
1479
|
+
const chunks = [];
|
|
1480
|
+
const reader = stream.getReader();
|
|
1481
|
+
let isDone = false;
|
|
1482
|
+
let length = 0;
|
|
1483
|
+
while (!isDone) {
|
|
1484
|
+
const { done, value } = await reader.read();
|
|
1485
|
+
if (value) {
|
|
1486
|
+
chunks.push(value);
|
|
1487
|
+
length += value.length;
|
|
1488
|
+
}
|
|
1489
|
+
isDone = done;
|
|
1490
|
+
}
|
|
1491
|
+
const collected = new Uint8Array(length);
|
|
1492
|
+
let offset = 0;
|
|
1493
|
+
for (const chunk of chunks) {
|
|
1494
|
+
collected.set(chunk, offset);
|
|
1495
|
+
offset += chunk.length;
|
|
1496
|
+
}
|
|
1497
|
+
return collected;
|
|
1498
|
+
}
|
|
1499
|
+
function readToBase64(blob) {
|
|
1500
|
+
return new Promise((resolve, reject) => {
|
|
1501
|
+
const reader = new FileReader;
|
|
1502
|
+
reader.onloadend = () => {
|
|
1503
|
+
if (reader.readyState !== 2) {
|
|
1504
|
+
return reject(new Error("Reader aborted too early"));
|
|
1505
|
+
}
|
|
1506
|
+
const result = reader.result ?? "";
|
|
1507
|
+
const commaIndex = result.indexOf(",");
|
|
1508
|
+
const dataOffset = commaIndex > -1 ? commaIndex + 1 : result.length;
|
|
1509
|
+
resolve(result.substring(dataOffset));
|
|
1510
|
+
};
|
|
1511
|
+
reader.onabort = () => reject(new Error("Read aborted"));
|
|
1512
|
+
reader.onerror = () => reject(reader.error);
|
|
1513
|
+
reader.readAsDataURL(blob);
|
|
1514
|
+
});
|
|
1515
|
+
}
|
|
1516
|
+
exports.FetchHttpHandler = FetchHttpHandler;
|
|
1517
|
+
exports.keepAliveSupport = keepAliveSupport;
|
|
1518
|
+
exports.streamCollector = streamCollector;
|
|
1519
|
+
});
|
|
1520
|
+
|
|
1521
|
+
// node_modules/.bun/@smithy+util-hex-encoding@4.2.2/node_modules/@smithy/util-hex-encoding/dist-cjs/index.js
|
|
1522
|
+
var require_dist_cjs11 = __commonJS((exports) => {
|
|
1523
|
+
var SHORT_TO_HEX = {};
|
|
1524
|
+
var HEX_TO_SHORT = {};
|
|
1525
|
+
for (let i = 0;i < 256; i++) {
|
|
1526
|
+
let encodedByte = i.toString(16).toLowerCase();
|
|
1527
|
+
if (encodedByte.length === 1) {
|
|
1528
|
+
encodedByte = `0${encodedByte}`;
|
|
1529
|
+
}
|
|
1530
|
+
SHORT_TO_HEX[i] = encodedByte;
|
|
1531
|
+
HEX_TO_SHORT[encodedByte] = i;
|
|
1532
|
+
}
|
|
1533
|
+
function fromHex(encoded) {
|
|
1534
|
+
if (encoded.length % 2 !== 0) {
|
|
1535
|
+
throw new Error("Hex encoded strings must have an even number length");
|
|
1536
|
+
}
|
|
1537
|
+
const out = new Uint8Array(encoded.length / 2);
|
|
1538
|
+
for (let i = 0;i < encoded.length; i += 2) {
|
|
1539
|
+
const encodedByte = encoded.slice(i, i + 2).toLowerCase();
|
|
1540
|
+
if (encodedByte in HEX_TO_SHORT) {
|
|
1541
|
+
out[i / 2] = HEX_TO_SHORT[encodedByte];
|
|
1542
|
+
} else {
|
|
1543
|
+
throw new Error(`Cannot decode unrecognized sequence ${encodedByte} as hexadecimal`);
|
|
1544
|
+
}
|
|
1545
|
+
}
|
|
1546
|
+
return out;
|
|
1547
|
+
}
|
|
1548
|
+
function toHex(bytes) {
|
|
1549
|
+
let out = "";
|
|
1550
|
+
for (let i = 0;i < bytes.byteLength; i++) {
|
|
1551
|
+
out += SHORT_TO_HEX[bytes[i]];
|
|
1552
|
+
}
|
|
1553
|
+
return out;
|
|
1554
|
+
}
|
|
1555
|
+
exports.fromHex = fromHex;
|
|
1556
|
+
exports.toHex = toHex;
|
|
1557
|
+
});
|
|
1558
|
+
|
|
1559
|
+
// node_modules/.bun/@smithy+util-stream@4.5.21/node_modules/@smithy/util-stream/dist-cjs/sdk-stream-mixin.browser.js
|
|
1560
|
+
var require_sdk_stream_mixin_browser = __commonJS((exports) => {
|
|
1561
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1562
|
+
exports.sdkStreamMixin = undefined;
|
|
1563
|
+
var fetch_http_handler_1 = require_dist_cjs10();
|
|
1564
|
+
var util_base64_1 = require_dist_cjs9();
|
|
1565
|
+
var util_hex_encoding_1 = require_dist_cjs11();
|
|
1566
|
+
var util_utf8_1 = require_dist_cjs7();
|
|
1567
|
+
var stream_type_check_1 = require_stream_type_check();
|
|
1568
|
+
var ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED = "The stream has already been transformed.";
|
|
1569
|
+
var sdkStreamMixin = (stream) => {
|
|
1570
|
+
if (!isBlobInstance(stream) && !(0, stream_type_check_1.isReadableStream)(stream)) {
|
|
1571
|
+
const name = stream?.__proto__?.constructor?.name || stream;
|
|
1572
|
+
throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${name}`);
|
|
1573
|
+
}
|
|
1574
|
+
let transformed = false;
|
|
1575
|
+
const transformToByteArray = async () => {
|
|
1576
|
+
if (transformed) {
|
|
1577
|
+
throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED);
|
|
1578
|
+
}
|
|
1579
|
+
transformed = true;
|
|
1580
|
+
return await (0, fetch_http_handler_1.streamCollector)(stream);
|
|
1581
|
+
};
|
|
1582
|
+
const blobToWebStream = (blob) => {
|
|
1583
|
+
if (typeof blob.stream !== "function") {
|
|
1584
|
+
throw new Error(`Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled.
|
|
1585
|
+
` + "If you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body");
|
|
1586
|
+
}
|
|
1587
|
+
return blob.stream();
|
|
1588
|
+
};
|
|
1589
|
+
return Object.assign(stream, {
|
|
1590
|
+
transformToByteArray,
|
|
1591
|
+
transformToString: async (encoding) => {
|
|
1592
|
+
const buf = await transformToByteArray();
|
|
1593
|
+
if (encoding === "base64") {
|
|
1594
|
+
return (0, util_base64_1.toBase64)(buf);
|
|
1595
|
+
} else if (encoding === "hex") {
|
|
1596
|
+
return (0, util_hex_encoding_1.toHex)(buf);
|
|
1597
|
+
} else if (encoding === undefined || encoding === "utf8" || encoding === "utf-8") {
|
|
1598
|
+
return (0, util_utf8_1.toUtf8)(buf);
|
|
1599
|
+
} else if (typeof TextDecoder === "function") {
|
|
1600
|
+
return new TextDecoder(encoding).decode(buf);
|
|
1601
|
+
} else {
|
|
1602
|
+
throw new Error("TextDecoder is not available, please make sure polyfill is provided.");
|
|
1603
|
+
}
|
|
1604
|
+
},
|
|
1605
|
+
transformToWebStream: () => {
|
|
1606
|
+
if (transformed) {
|
|
1607
|
+
throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED);
|
|
1608
|
+
}
|
|
1609
|
+
transformed = true;
|
|
1610
|
+
if (isBlobInstance(stream)) {
|
|
1611
|
+
return blobToWebStream(stream);
|
|
1612
|
+
} else if ((0, stream_type_check_1.isReadableStream)(stream)) {
|
|
1613
|
+
return stream;
|
|
1614
|
+
} else {
|
|
1615
|
+
throw new Error(`Cannot transform payload to web stream, got ${stream}`);
|
|
1616
|
+
}
|
|
1617
|
+
}
|
|
1618
|
+
});
|
|
1619
|
+
};
|
|
1620
|
+
exports.sdkStreamMixin = sdkStreamMixin;
|
|
1621
|
+
var isBlobInstance = (stream) => typeof Blob === "function" && stream instanceof Blob;
|
|
1622
|
+
});
|
|
1623
|
+
|
|
1624
|
+
// node_modules/.bun/@smithy+util-stream@4.5.21/node_modules/@smithy/util-stream/dist-cjs/sdk-stream-mixin.js
|
|
1625
|
+
var require_sdk_stream_mixin = __commonJS((exports) => {
|
|
1626
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1627
|
+
exports.sdkStreamMixin = undefined;
|
|
1628
|
+
var node_http_handler_1 = require_dist_cjs4();
|
|
1629
|
+
var util_buffer_from_1 = require_dist_cjs6();
|
|
1630
|
+
var stream_1 = __require("stream");
|
|
1631
|
+
var sdk_stream_mixin_browser_1 = require_sdk_stream_mixin_browser();
|
|
1632
|
+
var ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED = "The stream has already been transformed.";
|
|
1633
|
+
var sdkStreamMixin = (stream) => {
|
|
1634
|
+
if (!(stream instanceof stream_1.Readable)) {
|
|
1635
|
+
try {
|
|
1636
|
+
return (0, sdk_stream_mixin_browser_1.sdkStreamMixin)(stream);
|
|
1637
|
+
} catch (e) {
|
|
1638
|
+
const name = stream?.__proto__?.constructor?.name || stream;
|
|
1639
|
+
throw new Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${name}`);
|
|
1640
|
+
}
|
|
1641
|
+
}
|
|
1642
|
+
let transformed = false;
|
|
1643
|
+
const transformToByteArray = async () => {
|
|
1644
|
+
if (transformed) {
|
|
1645
|
+
throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED);
|
|
1646
|
+
}
|
|
1647
|
+
transformed = true;
|
|
1648
|
+
return await (0, node_http_handler_1.streamCollector)(stream);
|
|
1649
|
+
};
|
|
1650
|
+
return Object.assign(stream, {
|
|
1651
|
+
transformToByteArray,
|
|
1652
|
+
transformToString: async (encoding) => {
|
|
1653
|
+
const buf = await transformToByteArray();
|
|
1654
|
+
if (encoding === undefined || Buffer.isEncoding(encoding)) {
|
|
1655
|
+
return (0, util_buffer_from_1.fromArrayBuffer)(buf.buffer, buf.byteOffset, buf.byteLength).toString(encoding);
|
|
1656
|
+
} else {
|
|
1657
|
+
const decoder = new TextDecoder(encoding);
|
|
1658
|
+
return decoder.decode(buf);
|
|
1659
|
+
}
|
|
1660
|
+
},
|
|
1661
|
+
transformToWebStream: () => {
|
|
1662
|
+
if (transformed) {
|
|
1663
|
+
throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED);
|
|
1664
|
+
}
|
|
1665
|
+
if (stream.readableFlowing !== null) {
|
|
1666
|
+
throw new Error("The stream has been consumed by other callbacks.");
|
|
1667
|
+
}
|
|
1668
|
+
if (typeof stream_1.Readable.toWeb !== "function") {
|
|
1669
|
+
throw new Error("Readable.toWeb() is not supported. Please ensure a polyfill is available.");
|
|
1670
|
+
}
|
|
1671
|
+
transformed = true;
|
|
1672
|
+
return stream_1.Readable.toWeb(stream);
|
|
1673
|
+
}
|
|
1674
|
+
});
|
|
1675
|
+
};
|
|
1676
|
+
exports.sdkStreamMixin = sdkStreamMixin;
|
|
1677
|
+
});
|
|
1678
|
+
|
|
1679
|
+
// node_modules/.bun/@smithy+util-stream@4.5.21/node_modules/@smithy/util-stream/dist-cjs/splitStream.browser.js
|
|
1680
|
+
var require_splitStream_browser = __commonJS((exports) => {
|
|
1681
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1682
|
+
exports.splitStream = splitStream;
|
|
1683
|
+
async function splitStream(stream) {
|
|
1684
|
+
if (typeof stream.stream === "function") {
|
|
1685
|
+
stream = stream.stream();
|
|
1686
|
+
}
|
|
1687
|
+
const readableStream = stream;
|
|
1688
|
+
return readableStream.tee();
|
|
1689
|
+
}
|
|
1690
|
+
});
|
|
1691
|
+
|
|
1692
|
+
// node_modules/.bun/@smithy+util-stream@4.5.21/node_modules/@smithy/util-stream/dist-cjs/splitStream.js
|
|
1693
|
+
var require_splitStream = __commonJS((exports) => {
|
|
1694
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1695
|
+
exports.splitStream = splitStream;
|
|
1696
|
+
var stream_1 = __require("stream");
|
|
1697
|
+
var splitStream_browser_1 = require_splitStream_browser();
|
|
1698
|
+
var stream_type_check_1 = require_stream_type_check();
|
|
1699
|
+
async function splitStream(stream) {
|
|
1700
|
+
if ((0, stream_type_check_1.isReadableStream)(stream) || (0, stream_type_check_1.isBlob)(stream)) {
|
|
1701
|
+
return (0, splitStream_browser_1.splitStream)(stream);
|
|
1702
|
+
}
|
|
1703
|
+
const stream1 = new stream_1.PassThrough;
|
|
1704
|
+
const stream2 = new stream_1.PassThrough;
|
|
1705
|
+
stream.pipe(stream1);
|
|
1706
|
+
stream.pipe(stream2);
|
|
1707
|
+
return [stream1, stream2];
|
|
1708
|
+
}
|
|
1709
|
+
});
|
|
1710
|
+
|
|
1711
|
+
// node_modules/.bun/@smithy+util-stream@4.5.21/node_modules/@smithy/util-stream/dist-cjs/index.js
|
|
1712
|
+
var require_dist_cjs12 = __commonJS((exports) => {
|
|
1713
|
+
var utilBase64 = require_dist_cjs9();
|
|
1714
|
+
var utilUtf8 = require_dist_cjs7();
|
|
1715
|
+
var ChecksumStream = require_ChecksumStream();
|
|
1716
|
+
var createChecksumStream = require_createChecksumStream();
|
|
1717
|
+
var createBufferedReadable = require_createBufferedReadable();
|
|
1718
|
+
var getAwsChunkedEncodingStream = require_getAwsChunkedEncodingStream();
|
|
1719
|
+
var headStream = require_headStream();
|
|
1720
|
+
var sdkStreamMixin = require_sdk_stream_mixin();
|
|
1721
|
+
var splitStream = require_splitStream();
|
|
1722
|
+
var streamTypeCheck = require_stream_type_check();
|
|
1723
|
+
|
|
1724
|
+
class Uint8ArrayBlobAdapter extends Uint8Array {
|
|
1725
|
+
static fromString(source, encoding = "utf-8") {
|
|
1726
|
+
if (typeof source === "string") {
|
|
1727
|
+
if (encoding === "base64") {
|
|
1728
|
+
return Uint8ArrayBlobAdapter.mutate(utilBase64.fromBase64(source));
|
|
1729
|
+
}
|
|
1730
|
+
return Uint8ArrayBlobAdapter.mutate(utilUtf8.fromUtf8(source));
|
|
1731
|
+
}
|
|
1732
|
+
throw new Error(`Unsupported conversion from ${typeof source} to Uint8ArrayBlobAdapter.`);
|
|
1733
|
+
}
|
|
1734
|
+
static mutate(source) {
|
|
1735
|
+
Object.setPrototypeOf(source, Uint8ArrayBlobAdapter.prototype);
|
|
1736
|
+
return source;
|
|
1737
|
+
}
|
|
1738
|
+
transformToString(encoding = "utf-8") {
|
|
1739
|
+
if (encoding === "base64") {
|
|
1740
|
+
return utilBase64.toBase64(this);
|
|
1741
|
+
}
|
|
1742
|
+
return utilUtf8.toUtf8(this);
|
|
1743
|
+
}
|
|
1744
|
+
}
|
|
1745
|
+
exports.isBlob = streamTypeCheck.isBlob;
|
|
1746
|
+
exports.isReadableStream = streamTypeCheck.isReadableStream;
|
|
1747
|
+
exports.Uint8ArrayBlobAdapter = Uint8ArrayBlobAdapter;
|
|
1748
|
+
Object.prototype.hasOwnProperty.call(ChecksumStream, "__proto__") && !Object.prototype.hasOwnProperty.call(exports, "__proto__") && Object.defineProperty(exports, "__proto__", {
|
|
1749
|
+
enumerable: true,
|
|
1750
|
+
value: ChecksumStream["__proto__"]
|
|
1751
|
+
});
|
|
1752
|
+
Object.keys(ChecksumStream).forEach(function(k) {
|
|
1753
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k))
|
|
1754
|
+
exports[k] = ChecksumStream[k];
|
|
1755
|
+
});
|
|
1756
|
+
Object.prototype.hasOwnProperty.call(createChecksumStream, "__proto__") && !Object.prototype.hasOwnProperty.call(exports, "__proto__") && Object.defineProperty(exports, "__proto__", {
|
|
1757
|
+
enumerable: true,
|
|
1758
|
+
value: createChecksumStream["__proto__"]
|
|
1759
|
+
});
|
|
1760
|
+
Object.keys(createChecksumStream).forEach(function(k) {
|
|
1761
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k))
|
|
1762
|
+
exports[k] = createChecksumStream[k];
|
|
1763
|
+
});
|
|
1764
|
+
Object.prototype.hasOwnProperty.call(createBufferedReadable, "__proto__") && !Object.prototype.hasOwnProperty.call(exports, "__proto__") && Object.defineProperty(exports, "__proto__", {
|
|
1765
|
+
enumerable: true,
|
|
1766
|
+
value: createBufferedReadable["__proto__"]
|
|
1767
|
+
});
|
|
1768
|
+
Object.keys(createBufferedReadable).forEach(function(k) {
|
|
1769
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k))
|
|
1770
|
+
exports[k] = createBufferedReadable[k];
|
|
1771
|
+
});
|
|
1772
|
+
Object.prototype.hasOwnProperty.call(getAwsChunkedEncodingStream, "__proto__") && !Object.prototype.hasOwnProperty.call(exports, "__proto__") && Object.defineProperty(exports, "__proto__", {
|
|
1773
|
+
enumerable: true,
|
|
1774
|
+
value: getAwsChunkedEncodingStream["__proto__"]
|
|
1775
|
+
});
|
|
1776
|
+
Object.keys(getAwsChunkedEncodingStream).forEach(function(k) {
|
|
1777
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k))
|
|
1778
|
+
exports[k] = getAwsChunkedEncodingStream[k];
|
|
1779
|
+
});
|
|
1780
|
+
Object.prototype.hasOwnProperty.call(headStream, "__proto__") && !Object.prototype.hasOwnProperty.call(exports, "__proto__") && Object.defineProperty(exports, "__proto__", {
|
|
1781
|
+
enumerable: true,
|
|
1782
|
+
value: headStream["__proto__"]
|
|
1783
|
+
});
|
|
1784
|
+
Object.keys(headStream).forEach(function(k) {
|
|
1785
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k))
|
|
1786
|
+
exports[k] = headStream[k];
|
|
1787
|
+
});
|
|
1788
|
+
Object.prototype.hasOwnProperty.call(sdkStreamMixin, "__proto__") && !Object.prototype.hasOwnProperty.call(exports, "__proto__") && Object.defineProperty(exports, "__proto__", {
|
|
1789
|
+
enumerable: true,
|
|
1790
|
+
value: sdkStreamMixin["__proto__"]
|
|
1791
|
+
});
|
|
1792
|
+
Object.keys(sdkStreamMixin).forEach(function(k) {
|
|
1793
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k))
|
|
1794
|
+
exports[k] = sdkStreamMixin[k];
|
|
1795
|
+
});
|
|
1796
|
+
Object.prototype.hasOwnProperty.call(splitStream, "__proto__") && !Object.prototype.hasOwnProperty.call(exports, "__proto__") && Object.defineProperty(exports, "__proto__", {
|
|
1797
|
+
enumerable: true,
|
|
1798
|
+
value: splitStream["__proto__"]
|
|
1799
|
+
});
|
|
1800
|
+
Object.keys(splitStream).forEach(function(k) {
|
|
1801
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k))
|
|
1802
|
+
exports[k] = splitStream[k];
|
|
1803
|
+
});
|
|
1804
|
+
});
|
|
1805
|
+
|
|
1806
|
+
// node_modules/.bun/tslib@2.8.1/node_modules/tslib/tslib.js
|
|
1807
|
+
var require_tslib = __commonJS((exports, module) => {
|
|
1808
|
+
var __extends;
|
|
1809
|
+
var __assign;
|
|
1810
|
+
var __rest;
|
|
1811
|
+
var __decorate;
|
|
1812
|
+
var __param;
|
|
1813
|
+
var __esDecorate;
|
|
1814
|
+
var __runInitializers;
|
|
1815
|
+
var __propKey;
|
|
1816
|
+
var __setFunctionName;
|
|
1817
|
+
var __metadata;
|
|
1818
|
+
var __awaiter;
|
|
1819
|
+
var __generator;
|
|
1820
|
+
var __exportStar;
|
|
1821
|
+
var __values;
|
|
1822
|
+
var __read;
|
|
1823
|
+
var __spread;
|
|
1824
|
+
var __spreadArrays;
|
|
1825
|
+
var __spreadArray;
|
|
1826
|
+
var __await;
|
|
1827
|
+
var __asyncGenerator;
|
|
1828
|
+
var __asyncDelegator;
|
|
1829
|
+
var __asyncValues;
|
|
1830
|
+
var __makeTemplateObject;
|
|
1831
|
+
var __importStar;
|
|
1832
|
+
var __importDefault;
|
|
1833
|
+
var __classPrivateFieldGet;
|
|
1834
|
+
var __classPrivateFieldSet;
|
|
1835
|
+
var __classPrivateFieldIn;
|
|
1836
|
+
var __createBinding;
|
|
1837
|
+
var __addDisposableResource;
|
|
1838
|
+
var __disposeResources;
|
|
1839
|
+
var __rewriteRelativeImportExtension;
|
|
1840
|
+
(function(factory) {
|
|
1841
|
+
var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {};
|
|
1842
|
+
if (typeof define === "function" && define.amd) {
|
|
1843
|
+
define("tslib", ["exports"], function(exports2) {
|
|
1844
|
+
factory(createExporter(root, createExporter(exports2)));
|
|
1845
|
+
});
|
|
1846
|
+
} else if (typeof module === "object" && typeof exports === "object") {
|
|
1847
|
+
factory(createExporter(root, createExporter(exports)));
|
|
1848
|
+
} else {
|
|
1849
|
+
factory(createExporter(root));
|
|
1850
|
+
}
|
|
1851
|
+
function createExporter(exports2, previous) {
|
|
1852
|
+
if (exports2 !== root) {
|
|
1853
|
+
if (typeof Object.create === "function") {
|
|
1854
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
1855
|
+
} else {
|
|
1856
|
+
exports2.__esModule = true;
|
|
1857
|
+
}
|
|
1858
|
+
}
|
|
1859
|
+
return function(id, v) {
|
|
1860
|
+
return exports2[id] = previous ? previous(id, v) : v;
|
|
1861
|
+
};
|
|
1862
|
+
}
|
|
1863
|
+
})(function(exporter) {
|
|
1864
|
+
var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) {
|
|
1865
|
+
d.__proto__ = b;
|
|
1866
|
+
} || function(d, b) {
|
|
1867
|
+
for (var p in b)
|
|
1868
|
+
if (Object.prototype.hasOwnProperty.call(b, p))
|
|
1869
|
+
d[p] = b[p];
|
|
1870
|
+
};
|
|
1871
|
+
__extends = function(d, b) {
|
|
1872
|
+
if (typeof b !== "function" && b !== null)
|
|
1873
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
1874
|
+
extendStatics(d, b);
|
|
1875
|
+
function __() {
|
|
1876
|
+
this.constructor = d;
|
|
1877
|
+
}
|
|
1878
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __);
|
|
1879
|
+
};
|
|
1880
|
+
__assign = Object.assign || function(t) {
|
|
1881
|
+
for (var s, i = 1, n = arguments.length;i < n; i++) {
|
|
1882
|
+
s = arguments[i];
|
|
1883
|
+
for (var p in s)
|
|
1884
|
+
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
1885
|
+
t[p] = s[p];
|
|
1886
|
+
}
|
|
1887
|
+
return t;
|
|
1888
|
+
};
|
|
1889
|
+
__rest = function(s, e) {
|
|
1890
|
+
var t = {};
|
|
1891
|
+
for (var p in s)
|
|
1892
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1893
|
+
t[p] = s[p];
|
|
1894
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
1895
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s);i < p.length; i++) {
|
|
1896
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
1897
|
+
t[p[i]] = s[p[i]];
|
|
1898
|
+
}
|
|
1899
|
+
return t;
|
|
1900
|
+
};
|
|
1901
|
+
__decorate = function(decorators, target, key, desc) {
|
|
1902
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1903
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
1904
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
1905
|
+
else
|
|
1906
|
+
for (var i = decorators.length - 1;i >= 0; i--)
|
|
1907
|
+
if (d = decorators[i])
|
|
1908
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1909
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1910
|
+
};
|
|
1911
|
+
__param = function(paramIndex, decorator) {
|
|
1912
|
+
return function(target, key) {
|
|
1913
|
+
decorator(target, key, paramIndex);
|
|
1914
|
+
};
|
|
1915
|
+
};
|
|
1916
|
+
__esDecorate = function(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
1917
|
+
function accept(f) {
|
|
1918
|
+
if (f !== undefined && typeof f !== "function")
|
|
1919
|
+
throw new TypeError("Function expected");
|
|
1920
|
+
return f;
|
|
1921
|
+
}
|
|
1922
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
1923
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
1924
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
1925
|
+
var _, done = false;
|
|
1926
|
+
for (var i = decorators.length - 1;i >= 0; i--) {
|
|
1927
|
+
var context = {};
|
|
1928
|
+
for (var p in contextIn)
|
|
1929
|
+
context[p] = p === "access" ? {} : contextIn[p];
|
|
1930
|
+
for (var p in contextIn.access)
|
|
1931
|
+
context.access[p] = contextIn.access[p];
|
|
1932
|
+
context.addInitializer = function(f) {
|
|
1933
|
+
if (done)
|
|
1934
|
+
throw new TypeError("Cannot add initializers after decoration has completed");
|
|
1935
|
+
extraInitializers.push(accept(f || null));
|
|
1936
|
+
};
|
|
1937
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
1938
|
+
if (kind === "accessor") {
|
|
1939
|
+
if (result === undefined)
|
|
1940
|
+
continue;
|
|
1941
|
+
if (result === null || typeof result !== "object")
|
|
1942
|
+
throw new TypeError("Object expected");
|
|
1943
|
+
if (_ = accept(result.get))
|
|
1944
|
+
descriptor.get = _;
|
|
1945
|
+
if (_ = accept(result.set))
|
|
1946
|
+
descriptor.set = _;
|
|
1947
|
+
if (_ = accept(result.init))
|
|
1948
|
+
initializers.unshift(_);
|
|
1949
|
+
} else if (_ = accept(result)) {
|
|
1950
|
+
if (kind === "field")
|
|
1951
|
+
initializers.unshift(_);
|
|
1952
|
+
else
|
|
1953
|
+
descriptor[key] = _;
|
|
1954
|
+
}
|
|
1955
|
+
}
|
|
1956
|
+
if (target)
|
|
1957
|
+
Object.defineProperty(target, contextIn.name, descriptor);
|
|
1958
|
+
done = true;
|
|
1959
|
+
};
|
|
1960
|
+
__runInitializers = function(thisArg, initializers, value) {
|
|
1961
|
+
var useValue = arguments.length > 2;
|
|
1962
|
+
for (var i = 0;i < initializers.length; i++) {
|
|
1963
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
1964
|
+
}
|
|
1965
|
+
return useValue ? value : undefined;
|
|
1966
|
+
};
|
|
1967
|
+
__propKey = function(x) {
|
|
1968
|
+
return typeof x === "symbol" ? x : "".concat(x);
|
|
1969
|
+
};
|
|
1970
|
+
__setFunctionName = function(f, name, prefix) {
|
|
1971
|
+
if (typeof name === "symbol")
|
|
1972
|
+
name = name.description ? "[".concat(name.description, "]") : "";
|
|
1973
|
+
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
|
|
1974
|
+
};
|
|
1975
|
+
__metadata = function(metadataKey, metadataValue) {
|
|
1976
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
1977
|
+
return Reflect.metadata(metadataKey, metadataValue);
|
|
1978
|
+
};
|
|
1979
|
+
__awaiter = function(thisArg, _arguments, P, generator) {
|
|
1980
|
+
function adopt(value) {
|
|
1981
|
+
return value instanceof P ? value : new P(function(resolve) {
|
|
1982
|
+
resolve(value);
|
|
1983
|
+
});
|
|
1984
|
+
}
|
|
1985
|
+
return new (P || (P = Promise))(function(resolve, reject) {
|
|
1986
|
+
function fulfilled(value) {
|
|
1987
|
+
try {
|
|
1988
|
+
step(generator.next(value));
|
|
1989
|
+
} catch (e) {
|
|
1990
|
+
reject(e);
|
|
1991
|
+
}
|
|
1992
|
+
}
|
|
1993
|
+
function rejected(value) {
|
|
1994
|
+
try {
|
|
1995
|
+
step(generator["throw"](value));
|
|
1996
|
+
} catch (e) {
|
|
1997
|
+
reject(e);
|
|
1998
|
+
}
|
|
1999
|
+
}
|
|
2000
|
+
function step(result) {
|
|
2001
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
2002
|
+
}
|
|
2003
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
2004
|
+
});
|
|
2005
|
+
};
|
|
2006
|
+
__generator = function(thisArg, body) {
|
|
2007
|
+
var _ = { label: 0, sent: function() {
|
|
2008
|
+
if (t[0] & 1)
|
|
2009
|
+
throw t[1];
|
|
2010
|
+
return t[1];
|
|
2011
|
+
}, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
2012
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
2013
|
+
return this;
|
|
2014
|
+
}), g;
|
|
2015
|
+
function verb(n) {
|
|
2016
|
+
return function(v) {
|
|
2017
|
+
return step([n, v]);
|
|
2018
|
+
};
|
|
2019
|
+
}
|
|
2020
|
+
function step(op) {
|
|
2021
|
+
if (f)
|
|
2022
|
+
throw new TypeError("Generator is already executing.");
|
|
2023
|
+
while (g && (g = 0, op[0] && (_ = 0)), _)
|
|
2024
|
+
try {
|
|
2025
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
|
|
2026
|
+
return t;
|
|
2027
|
+
if (y = 0, t)
|
|
2028
|
+
op = [op[0] & 2, t.value];
|
|
2029
|
+
switch (op[0]) {
|
|
2030
|
+
case 0:
|
|
2031
|
+
case 1:
|
|
2032
|
+
t = op;
|
|
2033
|
+
break;
|
|
2034
|
+
case 4:
|
|
2035
|
+
_.label++;
|
|
2036
|
+
return { value: op[1], done: false };
|
|
2037
|
+
case 5:
|
|
2038
|
+
_.label++;
|
|
2039
|
+
y = op[1];
|
|
2040
|
+
op = [0];
|
|
2041
|
+
continue;
|
|
2042
|
+
case 7:
|
|
2043
|
+
op = _.ops.pop();
|
|
2044
|
+
_.trys.pop();
|
|
2045
|
+
continue;
|
|
2046
|
+
default:
|
|
2047
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
2048
|
+
_ = 0;
|
|
2049
|
+
continue;
|
|
2050
|
+
}
|
|
2051
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
2052
|
+
_.label = op[1];
|
|
2053
|
+
break;
|
|
2054
|
+
}
|
|
2055
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
2056
|
+
_.label = t[1];
|
|
2057
|
+
t = op;
|
|
2058
|
+
break;
|
|
2059
|
+
}
|
|
2060
|
+
if (t && _.label < t[2]) {
|
|
2061
|
+
_.label = t[2];
|
|
2062
|
+
_.ops.push(op);
|
|
2063
|
+
break;
|
|
2064
|
+
}
|
|
2065
|
+
if (t[2])
|
|
2066
|
+
_.ops.pop();
|
|
2067
|
+
_.trys.pop();
|
|
2068
|
+
continue;
|
|
2069
|
+
}
|
|
2070
|
+
op = body.call(thisArg, _);
|
|
2071
|
+
} catch (e) {
|
|
2072
|
+
op = [6, e];
|
|
2073
|
+
y = 0;
|
|
2074
|
+
} finally {
|
|
2075
|
+
f = t = 0;
|
|
2076
|
+
}
|
|
2077
|
+
if (op[0] & 5)
|
|
2078
|
+
throw op[1];
|
|
2079
|
+
return { value: op[0] ? op[1] : undefined, done: true };
|
|
2080
|
+
}
|
|
2081
|
+
};
|
|
2082
|
+
__exportStar = function(m, o) {
|
|
2083
|
+
for (var p in m)
|
|
2084
|
+
if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
|
|
2085
|
+
__createBinding(o, m, p);
|
|
2086
|
+
};
|
|
2087
|
+
__createBinding = Object.create ? function(o, m, k, k2) {
|
|
2088
|
+
if (k2 === undefined)
|
|
2089
|
+
k2 = k;
|
|
2090
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
2091
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
2092
|
+
desc = { enumerable: true, get: function() {
|
|
2093
|
+
return m[k];
|
|
2094
|
+
} };
|
|
2095
|
+
}
|
|
2096
|
+
Object.defineProperty(o, k2, desc);
|
|
2097
|
+
} : function(o, m, k, k2) {
|
|
2098
|
+
if (k2 === undefined)
|
|
2099
|
+
k2 = k;
|
|
2100
|
+
o[k2] = m[k];
|
|
2101
|
+
};
|
|
2102
|
+
__values = function(o) {
|
|
2103
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
2104
|
+
if (m)
|
|
2105
|
+
return m.call(o);
|
|
2106
|
+
if (o && typeof o.length === "number")
|
|
2107
|
+
return {
|
|
2108
|
+
next: function() {
|
|
2109
|
+
if (o && i >= o.length)
|
|
2110
|
+
o = undefined;
|
|
2111
|
+
return { value: o && o[i++], done: !o };
|
|
2112
|
+
}
|
|
2113
|
+
};
|
|
2114
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
2115
|
+
};
|
|
2116
|
+
__read = function(o, n) {
|
|
2117
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
2118
|
+
if (!m)
|
|
2119
|
+
return o;
|
|
2120
|
+
var i = m.call(o), r, ar = [], e;
|
|
2121
|
+
try {
|
|
2122
|
+
while ((n === undefined || n-- > 0) && !(r = i.next()).done)
|
|
2123
|
+
ar.push(r.value);
|
|
2124
|
+
} catch (error) {
|
|
2125
|
+
e = { error };
|
|
2126
|
+
} finally {
|
|
2127
|
+
try {
|
|
2128
|
+
if (r && !r.done && (m = i["return"]))
|
|
2129
|
+
m.call(i);
|
|
2130
|
+
} finally {
|
|
2131
|
+
if (e)
|
|
2132
|
+
throw e.error;
|
|
2133
|
+
}
|
|
2134
|
+
}
|
|
2135
|
+
return ar;
|
|
2136
|
+
};
|
|
2137
|
+
__spread = function() {
|
|
2138
|
+
for (var ar = [], i = 0;i < arguments.length; i++)
|
|
2139
|
+
ar = ar.concat(__read(arguments[i]));
|
|
2140
|
+
return ar;
|
|
2141
|
+
};
|
|
2142
|
+
__spreadArrays = function() {
|
|
2143
|
+
for (var s = 0, i = 0, il = arguments.length;i < il; i++)
|
|
2144
|
+
s += arguments[i].length;
|
|
2145
|
+
for (var r = Array(s), k = 0, i = 0;i < il; i++)
|
|
2146
|
+
for (var a = arguments[i], j = 0, jl = a.length;j < jl; j++, k++)
|
|
2147
|
+
r[k] = a[j];
|
|
2148
|
+
return r;
|
|
2149
|
+
};
|
|
2150
|
+
__spreadArray = function(to, from, pack) {
|
|
2151
|
+
if (pack || arguments.length === 2)
|
|
2152
|
+
for (var i = 0, l = from.length, ar;i < l; i++) {
|
|
2153
|
+
if (ar || !(i in from)) {
|
|
2154
|
+
if (!ar)
|
|
2155
|
+
ar = Array.prototype.slice.call(from, 0, i);
|
|
2156
|
+
ar[i] = from[i];
|
|
2157
|
+
}
|
|
2158
|
+
}
|
|
2159
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
2160
|
+
};
|
|
2161
|
+
__await = function(v) {
|
|
2162
|
+
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
2163
|
+
};
|
|
2164
|
+
__asyncGenerator = function(thisArg, _arguments, generator) {
|
|
2165
|
+
if (!Symbol.asyncIterator)
|
|
2166
|
+
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
2167
|
+
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
2168
|
+
return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function() {
|
|
2169
|
+
return this;
|
|
2170
|
+
}, i;
|
|
2171
|
+
function awaitReturn(f) {
|
|
2172
|
+
return function(v) {
|
|
2173
|
+
return Promise.resolve(v).then(f, reject);
|
|
2174
|
+
};
|
|
2175
|
+
}
|
|
2176
|
+
function verb(n, f) {
|
|
2177
|
+
if (g[n]) {
|
|
2178
|
+
i[n] = function(v) {
|
|
2179
|
+
return new Promise(function(a, b) {
|
|
2180
|
+
q.push([n, v, a, b]) > 1 || resume(n, v);
|
|
2181
|
+
});
|
|
2182
|
+
};
|
|
2183
|
+
if (f)
|
|
2184
|
+
i[n] = f(i[n]);
|
|
2185
|
+
}
|
|
2186
|
+
}
|
|
2187
|
+
function resume(n, v) {
|
|
2188
|
+
try {
|
|
2189
|
+
step(g[n](v));
|
|
2190
|
+
} catch (e) {
|
|
2191
|
+
settle(q[0][3], e);
|
|
2192
|
+
}
|
|
2193
|
+
}
|
|
2194
|
+
function step(r) {
|
|
2195
|
+
r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r);
|
|
2196
|
+
}
|
|
2197
|
+
function fulfill(value) {
|
|
2198
|
+
resume("next", value);
|
|
2199
|
+
}
|
|
2200
|
+
function reject(value) {
|
|
2201
|
+
resume("throw", value);
|
|
2202
|
+
}
|
|
2203
|
+
function settle(f, v) {
|
|
2204
|
+
if (f(v), q.shift(), q.length)
|
|
2205
|
+
resume(q[0][0], q[0][1]);
|
|
2206
|
+
}
|
|
2207
|
+
};
|
|
2208
|
+
__asyncDelegator = function(o) {
|
|
2209
|
+
var i, p;
|
|
2210
|
+
return i = {}, verb("next"), verb("throw", function(e) {
|
|
2211
|
+
throw e;
|
|
2212
|
+
}), verb("return"), i[Symbol.iterator] = function() {
|
|
2213
|
+
return this;
|
|
2214
|
+
}, i;
|
|
2215
|
+
function verb(n, f) {
|
|
2216
|
+
i[n] = o[n] ? function(v) {
|
|
2217
|
+
return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v;
|
|
2218
|
+
} : f;
|
|
2219
|
+
}
|
|
2220
|
+
};
|
|
2221
|
+
__asyncValues = function(o) {
|
|
2222
|
+
if (!Symbol.asyncIterator)
|
|
2223
|
+
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
2224
|
+
var m = o[Symbol.asyncIterator], i;
|
|
2225
|
+
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() {
|
|
2226
|
+
return this;
|
|
2227
|
+
}, i);
|
|
2228
|
+
function verb(n) {
|
|
2229
|
+
i[n] = o[n] && function(v) {
|
|
2230
|
+
return new Promise(function(resolve, reject) {
|
|
2231
|
+
v = o[n](v), settle(resolve, reject, v.done, v.value);
|
|
2232
|
+
});
|
|
2233
|
+
};
|
|
2234
|
+
}
|
|
2235
|
+
function settle(resolve, reject, d, v) {
|
|
2236
|
+
Promise.resolve(v).then(function(v2) {
|
|
2237
|
+
resolve({ value: v2, done: d });
|
|
2238
|
+
}, reject);
|
|
2239
|
+
}
|
|
2240
|
+
};
|
|
2241
|
+
__makeTemplateObject = function(cooked, raw) {
|
|
2242
|
+
if (Object.defineProperty) {
|
|
2243
|
+
Object.defineProperty(cooked, "raw", { value: raw });
|
|
2244
|
+
} else {
|
|
2245
|
+
cooked.raw = raw;
|
|
2246
|
+
}
|
|
2247
|
+
return cooked;
|
|
2248
|
+
};
|
|
2249
|
+
var __setModuleDefault = Object.create ? function(o, v) {
|
|
2250
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
2251
|
+
} : function(o, v) {
|
|
2252
|
+
o["default"] = v;
|
|
2253
|
+
};
|
|
2254
|
+
var ownKeys = function(o) {
|
|
2255
|
+
ownKeys = Object.getOwnPropertyNames || function(o2) {
|
|
2256
|
+
var ar = [];
|
|
2257
|
+
for (var k in o2)
|
|
2258
|
+
if (Object.prototype.hasOwnProperty.call(o2, k))
|
|
2259
|
+
ar[ar.length] = k;
|
|
2260
|
+
return ar;
|
|
2261
|
+
};
|
|
2262
|
+
return ownKeys(o);
|
|
2263
|
+
};
|
|
2264
|
+
__importStar = function(mod) {
|
|
2265
|
+
if (mod && mod.__esModule)
|
|
2266
|
+
return mod;
|
|
2267
|
+
var result = {};
|
|
2268
|
+
if (mod != null) {
|
|
2269
|
+
for (var k = ownKeys(mod), i = 0;i < k.length; i++)
|
|
2270
|
+
if (k[i] !== "default")
|
|
2271
|
+
__createBinding(result, mod, k[i]);
|
|
2272
|
+
}
|
|
2273
|
+
__setModuleDefault(result, mod);
|
|
2274
|
+
return result;
|
|
2275
|
+
};
|
|
2276
|
+
__importDefault = function(mod) {
|
|
2277
|
+
return mod && mod.__esModule ? mod : { default: mod };
|
|
2278
|
+
};
|
|
2279
|
+
__classPrivateFieldGet = function(receiver, state, kind, f) {
|
|
2280
|
+
if (kind === "a" && !f)
|
|
2281
|
+
throw new TypeError("Private accessor was defined without a getter");
|
|
2282
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
2283
|
+
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
2284
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
2285
|
+
};
|
|
2286
|
+
__classPrivateFieldSet = function(receiver, state, value, kind, f) {
|
|
2287
|
+
if (kind === "m")
|
|
2288
|
+
throw new TypeError("Private method is not writable");
|
|
2289
|
+
if (kind === "a" && !f)
|
|
2290
|
+
throw new TypeError("Private accessor was defined without a setter");
|
|
2291
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
2292
|
+
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
2293
|
+
return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
|
|
2294
|
+
};
|
|
2295
|
+
__classPrivateFieldIn = function(state, receiver) {
|
|
2296
|
+
if (receiver === null || typeof receiver !== "object" && typeof receiver !== "function")
|
|
2297
|
+
throw new TypeError("Cannot use 'in' operator on non-object");
|
|
2298
|
+
return typeof state === "function" ? receiver === state : state.has(receiver);
|
|
2299
|
+
};
|
|
2300
|
+
__addDisposableResource = function(env, value, async) {
|
|
2301
|
+
if (value !== null && value !== undefined) {
|
|
2302
|
+
if (typeof value !== "object" && typeof value !== "function")
|
|
2303
|
+
throw new TypeError("Object expected.");
|
|
2304
|
+
var dispose, inner;
|
|
2305
|
+
if (async) {
|
|
2306
|
+
if (!Symbol.asyncDispose)
|
|
2307
|
+
throw new TypeError("Symbol.asyncDispose is not defined.");
|
|
2308
|
+
dispose = value[Symbol.asyncDispose];
|
|
2309
|
+
}
|
|
2310
|
+
if (dispose === undefined) {
|
|
2311
|
+
if (!Symbol.dispose)
|
|
2312
|
+
throw new TypeError("Symbol.dispose is not defined.");
|
|
2313
|
+
dispose = value[Symbol.dispose];
|
|
2314
|
+
if (async)
|
|
2315
|
+
inner = dispose;
|
|
2316
|
+
}
|
|
2317
|
+
if (typeof dispose !== "function")
|
|
2318
|
+
throw new TypeError("Object not disposable.");
|
|
2319
|
+
if (inner)
|
|
2320
|
+
dispose = function() {
|
|
2321
|
+
try {
|
|
2322
|
+
inner.call(this);
|
|
2323
|
+
} catch (e) {
|
|
2324
|
+
return Promise.reject(e);
|
|
2325
|
+
}
|
|
2326
|
+
};
|
|
2327
|
+
env.stack.push({ value, dispose, async });
|
|
2328
|
+
} else if (async) {
|
|
2329
|
+
env.stack.push({ async: true });
|
|
2330
|
+
}
|
|
2331
|
+
return value;
|
|
2332
|
+
};
|
|
2333
|
+
var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function(error, suppressed, message) {
|
|
2334
|
+
var e = new Error(message);
|
|
2335
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
2336
|
+
};
|
|
2337
|
+
__disposeResources = function(env) {
|
|
2338
|
+
function fail(e) {
|
|
2339
|
+
env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
|
|
2340
|
+
env.hasError = true;
|
|
2341
|
+
}
|
|
2342
|
+
var r, s = 0;
|
|
2343
|
+
function next() {
|
|
2344
|
+
while (r = env.stack.pop()) {
|
|
2345
|
+
try {
|
|
2346
|
+
if (!r.async && s === 1)
|
|
2347
|
+
return s = 0, env.stack.push(r), Promise.resolve().then(next);
|
|
2348
|
+
if (r.dispose) {
|
|
2349
|
+
var result = r.dispose.call(r.value);
|
|
2350
|
+
if (r.async)
|
|
2351
|
+
return s |= 2, Promise.resolve(result).then(next, function(e) {
|
|
2352
|
+
fail(e);
|
|
2353
|
+
return next();
|
|
2354
|
+
});
|
|
2355
|
+
} else
|
|
2356
|
+
s |= 1;
|
|
2357
|
+
} catch (e) {
|
|
2358
|
+
fail(e);
|
|
2359
|
+
}
|
|
2360
|
+
}
|
|
2361
|
+
if (s === 1)
|
|
2362
|
+
return env.hasError ? Promise.reject(env.error) : Promise.resolve();
|
|
2363
|
+
if (env.hasError)
|
|
2364
|
+
throw env.error;
|
|
2365
|
+
}
|
|
2366
|
+
return next();
|
|
2367
|
+
};
|
|
2368
|
+
__rewriteRelativeImportExtension = function(path, preserveJsx) {
|
|
2369
|
+
if (typeof path === "string" && /^\.\.?\//.test(path)) {
|
|
2370
|
+
return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) {
|
|
2371
|
+
return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : d + ext + "." + cm.toLowerCase() + "js";
|
|
2372
|
+
});
|
|
2373
|
+
}
|
|
2374
|
+
return path;
|
|
2375
|
+
};
|
|
2376
|
+
exporter("__extends", __extends);
|
|
2377
|
+
exporter("__assign", __assign);
|
|
2378
|
+
exporter("__rest", __rest);
|
|
2379
|
+
exporter("__decorate", __decorate);
|
|
2380
|
+
exporter("__param", __param);
|
|
2381
|
+
exporter("__esDecorate", __esDecorate);
|
|
2382
|
+
exporter("__runInitializers", __runInitializers);
|
|
2383
|
+
exporter("__propKey", __propKey);
|
|
2384
|
+
exporter("__setFunctionName", __setFunctionName);
|
|
2385
|
+
exporter("__metadata", __metadata);
|
|
2386
|
+
exporter("__awaiter", __awaiter);
|
|
2387
|
+
exporter("__generator", __generator);
|
|
2388
|
+
exporter("__exportStar", __exportStar);
|
|
2389
|
+
exporter("__createBinding", __createBinding);
|
|
2390
|
+
exporter("__values", __values);
|
|
2391
|
+
exporter("__read", __read);
|
|
2392
|
+
exporter("__spread", __spread);
|
|
2393
|
+
exporter("__spreadArrays", __spreadArrays);
|
|
2394
|
+
exporter("__spreadArray", __spreadArray);
|
|
2395
|
+
exporter("__await", __await);
|
|
2396
|
+
exporter("__asyncGenerator", __asyncGenerator);
|
|
2397
|
+
exporter("__asyncDelegator", __asyncDelegator);
|
|
2398
|
+
exporter("__asyncValues", __asyncValues);
|
|
2399
|
+
exporter("__makeTemplateObject", __makeTemplateObject);
|
|
2400
|
+
exporter("__importStar", __importStar);
|
|
2401
|
+
exporter("__importDefault", __importDefault);
|
|
2402
|
+
exporter("__classPrivateFieldGet", __classPrivateFieldGet);
|
|
2403
|
+
exporter("__classPrivateFieldSet", __classPrivateFieldSet);
|
|
2404
|
+
exporter("__classPrivateFieldIn", __classPrivateFieldIn);
|
|
2405
|
+
exporter("__addDisposableResource", __addDisposableResource);
|
|
2406
|
+
exporter("__disposeResources", __disposeResources);
|
|
2407
|
+
exporter("__rewriteRelativeImportExtension", __rewriteRelativeImportExtension);
|
|
2408
|
+
});
|
|
2409
|
+
});
|
|
2410
|
+
|
|
2411
|
+
// node_modules/.bun/@smithy+uuid@1.1.2/node_modules/@smithy/uuid/dist-cjs/randomUUID.js
|
|
2412
|
+
var require_randomUUID = __commonJS((exports) => {
|
|
2413
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2414
|
+
exports.randomUUID = undefined;
|
|
2415
|
+
var tslib_1 = require_tslib();
|
|
2416
|
+
var crypto_1 = tslib_1.__importDefault(__require("crypto"));
|
|
2417
|
+
exports.randomUUID = crypto_1.default.randomUUID.bind(crypto_1.default);
|
|
2418
|
+
});
|
|
2419
|
+
|
|
2420
|
+
// node_modules/.bun/@smithy+uuid@1.1.2/node_modules/@smithy/uuid/dist-cjs/index.js
|
|
2421
|
+
var require_dist_cjs13 = __commonJS((exports) => {
|
|
2422
|
+
var randomUUID = require_randomUUID();
|
|
2423
|
+
var decimalToHex = Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, "0"));
|
|
2424
|
+
var v4 = () => {
|
|
2425
|
+
if (randomUUID.randomUUID) {
|
|
2426
|
+
return randomUUID.randomUUID();
|
|
2427
|
+
}
|
|
2428
|
+
const rnds = new Uint8Array(16);
|
|
2429
|
+
crypto.getRandomValues(rnds);
|
|
2430
|
+
rnds[6] = rnds[6] & 15 | 64;
|
|
2431
|
+
rnds[8] = rnds[8] & 63 | 128;
|
|
2432
|
+
return decimalToHex[rnds[0]] + decimalToHex[rnds[1]] + decimalToHex[rnds[2]] + decimalToHex[rnds[3]] + "-" + decimalToHex[rnds[4]] + decimalToHex[rnds[5]] + "-" + decimalToHex[rnds[6]] + decimalToHex[rnds[7]] + "-" + decimalToHex[rnds[8]] + decimalToHex[rnds[9]] + "-" + decimalToHex[rnds[10]] + decimalToHex[rnds[11]] + decimalToHex[rnds[12]] + decimalToHex[rnds[13]] + decimalToHex[rnds[14]] + decimalToHex[rnds[15]];
|
|
2433
|
+
};
|
|
2434
|
+
exports.v4 = v4;
|
|
2435
|
+
});
|
|
2436
|
+
|
|
2437
|
+
// node_modules/.bun/@smithy+core@3.23.13/node_modules/@smithy/core/dist-cjs/submodules/serde/index.js
|
|
2438
|
+
var require_serde = __commonJS((exports) => {
|
|
2439
|
+
var uuid = require_dist_cjs13();
|
|
2440
|
+
var copyDocumentWithTransform = (source, schemaRef, transform = (_) => _) => source;
|
|
2441
|
+
var parseBoolean = (value) => {
|
|
2442
|
+
switch (value) {
|
|
2443
|
+
case "true":
|
|
2444
|
+
return true;
|
|
2445
|
+
case "false":
|
|
2446
|
+
return false;
|
|
2447
|
+
default:
|
|
2448
|
+
throw new Error(`Unable to parse boolean value "${value}"`);
|
|
2449
|
+
}
|
|
2450
|
+
};
|
|
2451
|
+
var expectBoolean = (value) => {
|
|
2452
|
+
if (value === null || value === undefined) {
|
|
2453
|
+
return;
|
|
2454
|
+
}
|
|
2455
|
+
if (typeof value === "number") {
|
|
2456
|
+
if (value === 0 || value === 1) {
|
|
2457
|
+
logger.warn(stackTraceWarning(`Expected boolean, got ${typeof value}: ${value}`));
|
|
2458
|
+
}
|
|
2459
|
+
if (value === 0) {
|
|
2460
|
+
return false;
|
|
2461
|
+
}
|
|
2462
|
+
if (value === 1) {
|
|
2463
|
+
return true;
|
|
2464
|
+
}
|
|
2465
|
+
}
|
|
2466
|
+
if (typeof value === "string") {
|
|
2467
|
+
const lower = value.toLowerCase();
|
|
2468
|
+
if (lower === "false" || lower === "true") {
|
|
2469
|
+
logger.warn(stackTraceWarning(`Expected boolean, got ${typeof value}: ${value}`));
|
|
2470
|
+
}
|
|
2471
|
+
if (lower === "false") {
|
|
2472
|
+
return false;
|
|
2473
|
+
}
|
|
2474
|
+
if (lower === "true") {
|
|
2475
|
+
return true;
|
|
2476
|
+
}
|
|
2477
|
+
}
|
|
2478
|
+
if (typeof value === "boolean") {
|
|
2479
|
+
return value;
|
|
2480
|
+
}
|
|
2481
|
+
throw new TypeError(`Expected boolean, got ${typeof value}: ${value}`);
|
|
2482
|
+
};
|
|
2483
|
+
var expectNumber = (value) => {
|
|
2484
|
+
if (value === null || value === undefined) {
|
|
2485
|
+
return;
|
|
2486
|
+
}
|
|
2487
|
+
if (typeof value === "string") {
|
|
2488
|
+
const parsed = parseFloat(value);
|
|
2489
|
+
if (!Number.isNaN(parsed)) {
|
|
2490
|
+
if (String(parsed) !== String(value)) {
|
|
2491
|
+
logger.warn(stackTraceWarning(`Expected number but observed string: ${value}`));
|
|
2492
|
+
}
|
|
2493
|
+
return parsed;
|
|
2494
|
+
}
|
|
2495
|
+
}
|
|
2496
|
+
if (typeof value === "number") {
|
|
2497
|
+
return value;
|
|
2498
|
+
}
|
|
2499
|
+
throw new TypeError(`Expected number, got ${typeof value}: ${value}`);
|
|
2500
|
+
};
|
|
2501
|
+
var MAX_FLOAT = Math.ceil(2 ** 127 * (2 - 2 ** -23));
|
|
2502
|
+
var expectFloat32 = (value) => {
|
|
2503
|
+
const expected = expectNumber(value);
|
|
2504
|
+
if (expected !== undefined && !Number.isNaN(expected) && expected !== Infinity && expected !== -Infinity) {
|
|
2505
|
+
if (Math.abs(expected) > MAX_FLOAT) {
|
|
2506
|
+
throw new TypeError(`Expected 32-bit float, got ${value}`);
|
|
2507
|
+
}
|
|
2508
|
+
}
|
|
2509
|
+
return expected;
|
|
2510
|
+
};
|
|
2511
|
+
var expectLong = (value) => {
|
|
2512
|
+
if (value === null || value === undefined) {
|
|
2513
|
+
return;
|
|
2514
|
+
}
|
|
2515
|
+
if (Number.isInteger(value) && !Number.isNaN(value)) {
|
|
2516
|
+
return value;
|
|
2517
|
+
}
|
|
2518
|
+
throw new TypeError(`Expected integer, got ${typeof value}: ${value}`);
|
|
2519
|
+
};
|
|
2520
|
+
var expectInt = expectLong;
|
|
2521
|
+
var expectInt32 = (value) => expectSizedInt(value, 32);
|
|
2522
|
+
var expectShort = (value) => expectSizedInt(value, 16);
|
|
2523
|
+
var expectByte = (value) => expectSizedInt(value, 8);
|
|
2524
|
+
var expectSizedInt = (value, size) => {
|
|
2525
|
+
const expected = expectLong(value);
|
|
2526
|
+
if (expected !== undefined && castInt(expected, size) !== expected) {
|
|
2527
|
+
throw new TypeError(`Expected ${size}-bit integer, got ${value}`);
|
|
2528
|
+
}
|
|
2529
|
+
return expected;
|
|
2530
|
+
};
|
|
2531
|
+
var castInt = (value, size) => {
|
|
2532
|
+
switch (size) {
|
|
2533
|
+
case 32:
|
|
2534
|
+
return Int32Array.of(value)[0];
|
|
2535
|
+
case 16:
|
|
2536
|
+
return Int16Array.of(value)[0];
|
|
2537
|
+
case 8:
|
|
2538
|
+
return Int8Array.of(value)[0];
|
|
2539
|
+
}
|
|
2540
|
+
};
|
|
2541
|
+
var expectNonNull = (value, location) => {
|
|
2542
|
+
if (value === null || value === undefined) {
|
|
2543
|
+
if (location) {
|
|
2544
|
+
throw new TypeError(`Expected a non-null value for ${location}`);
|
|
2545
|
+
}
|
|
2546
|
+
throw new TypeError("Expected a non-null value");
|
|
2547
|
+
}
|
|
2548
|
+
return value;
|
|
2549
|
+
};
|
|
2550
|
+
var expectObject = (value) => {
|
|
2551
|
+
if (value === null || value === undefined) {
|
|
2552
|
+
return;
|
|
2553
|
+
}
|
|
2554
|
+
if (typeof value === "object" && !Array.isArray(value)) {
|
|
2555
|
+
return value;
|
|
2556
|
+
}
|
|
2557
|
+
const receivedType = Array.isArray(value) ? "array" : typeof value;
|
|
2558
|
+
throw new TypeError(`Expected object, got ${receivedType}: ${value}`);
|
|
2559
|
+
};
|
|
2560
|
+
var expectString = (value) => {
|
|
2561
|
+
if (value === null || value === undefined) {
|
|
2562
|
+
return;
|
|
2563
|
+
}
|
|
2564
|
+
if (typeof value === "string") {
|
|
2565
|
+
return value;
|
|
2566
|
+
}
|
|
2567
|
+
if (["boolean", "number", "bigint"].includes(typeof value)) {
|
|
2568
|
+
logger.warn(stackTraceWarning(`Expected string, got ${typeof value}: ${value}`));
|
|
2569
|
+
return String(value);
|
|
2570
|
+
}
|
|
2571
|
+
throw new TypeError(`Expected string, got ${typeof value}: ${value}`);
|
|
2572
|
+
};
|
|
2573
|
+
var expectUnion = (value) => {
|
|
2574
|
+
if (value === null || value === undefined) {
|
|
2575
|
+
return;
|
|
2576
|
+
}
|
|
2577
|
+
const asObject = expectObject(value);
|
|
2578
|
+
const setKeys = Object.entries(asObject).filter(([, v]) => v != null).map(([k]) => k);
|
|
2579
|
+
if (setKeys.length === 0) {
|
|
2580
|
+
throw new TypeError(`Unions must have exactly one non-null member. None were found.`);
|
|
2581
|
+
}
|
|
2582
|
+
if (setKeys.length > 1) {
|
|
2583
|
+
throw new TypeError(`Unions must have exactly one non-null member. Keys ${setKeys} were not null.`);
|
|
2584
|
+
}
|
|
2585
|
+
return asObject;
|
|
2586
|
+
};
|
|
2587
|
+
var strictParseDouble = (value) => {
|
|
2588
|
+
if (typeof value == "string") {
|
|
2589
|
+
return expectNumber(parseNumber(value));
|
|
2590
|
+
}
|
|
2591
|
+
return expectNumber(value);
|
|
2592
|
+
};
|
|
2593
|
+
var strictParseFloat = strictParseDouble;
|
|
2594
|
+
var strictParseFloat32 = (value) => {
|
|
2595
|
+
if (typeof value == "string") {
|
|
2596
|
+
return expectFloat32(parseNumber(value));
|
|
2597
|
+
}
|
|
2598
|
+
return expectFloat32(value);
|
|
2599
|
+
};
|
|
2600
|
+
var NUMBER_REGEX = /(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g;
|
|
2601
|
+
var parseNumber = (value) => {
|
|
2602
|
+
const matches = value.match(NUMBER_REGEX);
|
|
2603
|
+
if (matches === null || matches[0].length !== value.length) {
|
|
2604
|
+
throw new TypeError(`Expected real number, got implicit NaN`);
|
|
2605
|
+
}
|
|
2606
|
+
return parseFloat(value);
|
|
2607
|
+
};
|
|
2608
|
+
var limitedParseDouble = (value) => {
|
|
2609
|
+
if (typeof value == "string") {
|
|
2610
|
+
return parseFloatString(value);
|
|
2611
|
+
}
|
|
2612
|
+
return expectNumber(value);
|
|
2613
|
+
};
|
|
2614
|
+
var handleFloat = limitedParseDouble;
|
|
2615
|
+
var limitedParseFloat = limitedParseDouble;
|
|
2616
|
+
var limitedParseFloat32 = (value) => {
|
|
2617
|
+
if (typeof value == "string") {
|
|
2618
|
+
return parseFloatString(value);
|
|
2619
|
+
}
|
|
2620
|
+
return expectFloat32(value);
|
|
2621
|
+
};
|
|
2622
|
+
var parseFloatString = (value) => {
|
|
2623
|
+
switch (value) {
|
|
2624
|
+
case "NaN":
|
|
2625
|
+
return NaN;
|
|
2626
|
+
case "Infinity":
|
|
2627
|
+
return Infinity;
|
|
2628
|
+
case "-Infinity":
|
|
2629
|
+
return -Infinity;
|
|
2630
|
+
default:
|
|
2631
|
+
throw new Error(`Unable to parse float value: ${value}`);
|
|
2632
|
+
}
|
|
2633
|
+
};
|
|
2634
|
+
var strictParseLong = (value) => {
|
|
2635
|
+
if (typeof value === "string") {
|
|
2636
|
+
return expectLong(parseNumber(value));
|
|
2637
|
+
}
|
|
2638
|
+
return expectLong(value);
|
|
2639
|
+
};
|
|
2640
|
+
var strictParseInt = strictParseLong;
|
|
2641
|
+
var strictParseInt32 = (value) => {
|
|
2642
|
+
if (typeof value === "string") {
|
|
2643
|
+
return expectInt32(parseNumber(value));
|
|
2644
|
+
}
|
|
2645
|
+
return expectInt32(value);
|
|
2646
|
+
};
|
|
2647
|
+
var strictParseShort = (value) => {
|
|
2648
|
+
if (typeof value === "string") {
|
|
2649
|
+
return expectShort(parseNumber(value));
|
|
2650
|
+
}
|
|
2651
|
+
return expectShort(value);
|
|
2652
|
+
};
|
|
2653
|
+
var strictParseByte = (value) => {
|
|
2654
|
+
if (typeof value === "string") {
|
|
2655
|
+
return expectByte(parseNumber(value));
|
|
2656
|
+
}
|
|
2657
|
+
return expectByte(value);
|
|
2658
|
+
};
|
|
2659
|
+
var stackTraceWarning = (message) => {
|
|
2660
|
+
return String(new TypeError(message).stack || message).split(`
|
|
2661
|
+
`).slice(0, 5).filter((s) => !s.includes("stackTraceWarning")).join(`
|
|
2662
|
+
`);
|
|
2663
|
+
};
|
|
2664
|
+
var logger = {
|
|
2665
|
+
warn: console.warn
|
|
2666
|
+
};
|
|
2667
|
+
var DAYS = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
|
|
2668
|
+
var MONTHS = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
|
2669
|
+
function dateToUtcString(date2) {
|
|
2670
|
+
const year2 = date2.getUTCFullYear();
|
|
2671
|
+
const month = date2.getUTCMonth();
|
|
2672
|
+
const dayOfWeek = date2.getUTCDay();
|
|
2673
|
+
const dayOfMonthInt = date2.getUTCDate();
|
|
2674
|
+
const hoursInt = date2.getUTCHours();
|
|
2675
|
+
const minutesInt = date2.getUTCMinutes();
|
|
2676
|
+
const secondsInt = date2.getUTCSeconds();
|
|
2677
|
+
const dayOfMonthString = dayOfMonthInt < 10 ? `0${dayOfMonthInt}` : `${dayOfMonthInt}`;
|
|
2678
|
+
const hoursString = hoursInt < 10 ? `0${hoursInt}` : `${hoursInt}`;
|
|
2679
|
+
const minutesString = minutesInt < 10 ? `0${minutesInt}` : `${minutesInt}`;
|
|
2680
|
+
const secondsString = secondsInt < 10 ? `0${secondsInt}` : `${secondsInt}`;
|
|
2681
|
+
return `${DAYS[dayOfWeek]}, ${dayOfMonthString} ${MONTHS[month]} ${year2} ${hoursString}:${minutesString}:${secondsString} GMT`;
|
|
2682
|
+
}
|
|
2683
|
+
var RFC3339 = new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/);
|
|
2684
|
+
var parseRfc3339DateTime = (value) => {
|
|
2685
|
+
if (value === null || value === undefined) {
|
|
2686
|
+
return;
|
|
2687
|
+
}
|
|
2688
|
+
if (typeof value !== "string") {
|
|
2689
|
+
throw new TypeError("RFC-3339 date-times must be expressed as strings");
|
|
2690
|
+
}
|
|
2691
|
+
const match = RFC3339.exec(value);
|
|
2692
|
+
if (!match) {
|
|
2693
|
+
throw new TypeError("Invalid RFC-3339 date-time value");
|
|
2694
|
+
}
|
|
2695
|
+
const [_, yearStr, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds] = match;
|
|
2696
|
+
const year2 = strictParseShort(stripLeadingZeroes(yearStr));
|
|
2697
|
+
const month = parseDateValue(monthStr, "month", 1, 12);
|
|
2698
|
+
const day = parseDateValue(dayStr, "day", 1, 31);
|
|
2699
|
+
return buildDate(year2, month, day, { hours, minutes, seconds, fractionalMilliseconds });
|
|
2700
|
+
};
|
|
2701
|
+
var RFC3339_WITH_OFFSET$1 = new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/);
|
|
2702
|
+
var parseRfc3339DateTimeWithOffset = (value) => {
|
|
2703
|
+
if (value === null || value === undefined) {
|
|
2704
|
+
return;
|
|
2705
|
+
}
|
|
2706
|
+
if (typeof value !== "string") {
|
|
2707
|
+
throw new TypeError("RFC-3339 date-times must be expressed as strings");
|
|
2708
|
+
}
|
|
2709
|
+
const match = RFC3339_WITH_OFFSET$1.exec(value);
|
|
2710
|
+
if (!match) {
|
|
2711
|
+
throw new TypeError("Invalid RFC-3339 date-time value");
|
|
2712
|
+
}
|
|
2713
|
+
const [_, yearStr, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds, offsetStr] = match;
|
|
2714
|
+
const year2 = strictParseShort(stripLeadingZeroes(yearStr));
|
|
2715
|
+
const month = parseDateValue(monthStr, "month", 1, 12);
|
|
2716
|
+
const day = parseDateValue(dayStr, "day", 1, 31);
|
|
2717
|
+
const date2 = buildDate(year2, month, day, { hours, minutes, seconds, fractionalMilliseconds });
|
|
2718
|
+
if (offsetStr.toUpperCase() != "Z") {
|
|
2719
|
+
date2.setTime(date2.getTime() - parseOffsetToMilliseconds(offsetStr));
|
|
2720
|
+
}
|
|
2721
|
+
return date2;
|
|
2722
|
+
};
|
|
2723
|
+
var IMF_FIXDATE$1 = new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/);
|
|
2724
|
+
var RFC_850_DATE$1 = new RegExp(/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/);
|
|
2725
|
+
var ASC_TIME$1 = new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/);
|
|
2726
|
+
var parseRfc7231DateTime = (value) => {
|
|
2727
|
+
if (value === null || value === undefined) {
|
|
2728
|
+
return;
|
|
2729
|
+
}
|
|
2730
|
+
if (typeof value !== "string") {
|
|
2731
|
+
throw new TypeError("RFC-7231 date-times must be expressed as strings");
|
|
2732
|
+
}
|
|
2733
|
+
let match = IMF_FIXDATE$1.exec(value);
|
|
2734
|
+
if (match) {
|
|
2735
|
+
const [_, dayStr, monthStr, yearStr, hours, minutes, seconds, fractionalMilliseconds] = match;
|
|
2736
|
+
return buildDate(strictParseShort(stripLeadingZeroes(yearStr)), parseMonthByShortName(monthStr), parseDateValue(dayStr, "day", 1, 31), { hours, minutes, seconds, fractionalMilliseconds });
|
|
2737
|
+
}
|
|
2738
|
+
match = RFC_850_DATE$1.exec(value);
|
|
2739
|
+
if (match) {
|
|
2740
|
+
const [_, dayStr, monthStr, yearStr, hours, minutes, seconds, fractionalMilliseconds] = match;
|
|
2741
|
+
return adjustRfc850Year(buildDate(parseTwoDigitYear(yearStr), parseMonthByShortName(monthStr), parseDateValue(dayStr, "day", 1, 31), {
|
|
2742
|
+
hours,
|
|
2743
|
+
minutes,
|
|
2744
|
+
seconds,
|
|
2745
|
+
fractionalMilliseconds
|
|
2746
|
+
}));
|
|
2747
|
+
}
|
|
2748
|
+
match = ASC_TIME$1.exec(value);
|
|
2749
|
+
if (match) {
|
|
2750
|
+
const [_, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds, yearStr] = match;
|
|
2751
|
+
return buildDate(strictParseShort(stripLeadingZeroes(yearStr)), parseMonthByShortName(monthStr), parseDateValue(dayStr.trimLeft(), "day", 1, 31), { hours, minutes, seconds, fractionalMilliseconds });
|
|
2752
|
+
}
|
|
2753
|
+
throw new TypeError("Invalid RFC-7231 date-time value");
|
|
2754
|
+
};
|
|
2755
|
+
var parseEpochTimestamp = (value) => {
|
|
2756
|
+
if (value === null || value === undefined) {
|
|
2757
|
+
return;
|
|
2758
|
+
}
|
|
2759
|
+
let valueAsDouble;
|
|
2760
|
+
if (typeof value === "number") {
|
|
2761
|
+
valueAsDouble = value;
|
|
2762
|
+
} else if (typeof value === "string") {
|
|
2763
|
+
valueAsDouble = strictParseDouble(value);
|
|
2764
|
+
} else if (typeof value === "object" && value.tag === 1) {
|
|
2765
|
+
valueAsDouble = value.value;
|
|
2766
|
+
} else {
|
|
2767
|
+
throw new TypeError("Epoch timestamps must be expressed as floating point numbers or their string representation");
|
|
2768
|
+
}
|
|
2769
|
+
if (Number.isNaN(valueAsDouble) || valueAsDouble === Infinity || valueAsDouble === -Infinity) {
|
|
2770
|
+
throw new TypeError("Epoch timestamps must be valid, non-Infinite, non-NaN numerics");
|
|
2771
|
+
}
|
|
2772
|
+
return new Date(Math.round(valueAsDouble * 1000));
|
|
2773
|
+
};
|
|
2774
|
+
var buildDate = (year2, month, day, time2) => {
|
|
2775
|
+
const adjustedMonth = month - 1;
|
|
2776
|
+
validateDayOfMonth(year2, adjustedMonth, day);
|
|
2777
|
+
return new Date(Date.UTC(year2, adjustedMonth, day, parseDateValue(time2.hours, "hour", 0, 23), parseDateValue(time2.minutes, "minute", 0, 59), parseDateValue(time2.seconds, "seconds", 0, 60), parseMilliseconds(time2.fractionalMilliseconds)));
|
|
2778
|
+
};
|
|
2779
|
+
var parseTwoDigitYear = (value) => {
|
|
2780
|
+
const thisYear = new Date().getUTCFullYear();
|
|
2781
|
+
const valueInThisCentury = Math.floor(thisYear / 100) * 100 + strictParseShort(stripLeadingZeroes(value));
|
|
2782
|
+
if (valueInThisCentury < thisYear) {
|
|
2783
|
+
return valueInThisCentury + 100;
|
|
2784
|
+
}
|
|
2785
|
+
return valueInThisCentury;
|
|
2786
|
+
};
|
|
2787
|
+
var FIFTY_YEARS_IN_MILLIS = 50 * 365 * 24 * 60 * 60 * 1000;
|
|
2788
|
+
var adjustRfc850Year = (input) => {
|
|
2789
|
+
if (input.getTime() - new Date().getTime() > FIFTY_YEARS_IN_MILLIS) {
|
|
2790
|
+
return new Date(Date.UTC(input.getUTCFullYear() - 100, input.getUTCMonth(), input.getUTCDate(), input.getUTCHours(), input.getUTCMinutes(), input.getUTCSeconds(), input.getUTCMilliseconds()));
|
|
2791
|
+
}
|
|
2792
|
+
return input;
|
|
2793
|
+
};
|
|
2794
|
+
var parseMonthByShortName = (value) => {
|
|
2795
|
+
const monthIdx = MONTHS.indexOf(value);
|
|
2796
|
+
if (monthIdx < 0) {
|
|
2797
|
+
throw new TypeError(`Invalid month: ${value}`);
|
|
2798
|
+
}
|
|
2799
|
+
return monthIdx + 1;
|
|
2800
|
+
};
|
|
2801
|
+
var DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
2802
|
+
var validateDayOfMonth = (year2, month, day) => {
|
|
2803
|
+
let maxDays = DAYS_IN_MONTH[month];
|
|
2804
|
+
if (month === 1 && isLeapYear(year2)) {
|
|
2805
|
+
maxDays = 29;
|
|
2806
|
+
}
|
|
2807
|
+
if (day > maxDays) {
|
|
2808
|
+
throw new TypeError(`Invalid day for ${MONTHS[month]} in ${year2}: ${day}`);
|
|
2809
|
+
}
|
|
2810
|
+
};
|
|
2811
|
+
var isLeapYear = (year2) => {
|
|
2812
|
+
return year2 % 4 === 0 && (year2 % 100 !== 0 || year2 % 400 === 0);
|
|
2813
|
+
};
|
|
2814
|
+
var parseDateValue = (value, type, lower, upper) => {
|
|
2815
|
+
const dateVal = strictParseByte(stripLeadingZeroes(value));
|
|
2816
|
+
if (dateVal < lower || dateVal > upper) {
|
|
2817
|
+
throw new TypeError(`${type} must be between ${lower} and ${upper}, inclusive`);
|
|
2818
|
+
}
|
|
2819
|
+
return dateVal;
|
|
2820
|
+
};
|
|
2821
|
+
var parseMilliseconds = (value) => {
|
|
2822
|
+
if (value === null || value === undefined) {
|
|
2823
|
+
return 0;
|
|
2824
|
+
}
|
|
2825
|
+
return strictParseFloat32("0." + value) * 1000;
|
|
2826
|
+
};
|
|
2827
|
+
var parseOffsetToMilliseconds = (value) => {
|
|
2828
|
+
const directionStr = value[0];
|
|
2829
|
+
let direction = 1;
|
|
2830
|
+
if (directionStr == "+") {
|
|
2831
|
+
direction = 1;
|
|
2832
|
+
} else if (directionStr == "-") {
|
|
2833
|
+
direction = -1;
|
|
2834
|
+
} else {
|
|
2835
|
+
throw new TypeError(`Offset direction, ${directionStr}, must be "+" or "-"`);
|
|
2836
|
+
}
|
|
2837
|
+
const hour = Number(value.substring(1, 3));
|
|
2838
|
+
const minute = Number(value.substring(4, 6));
|
|
2839
|
+
return direction * (hour * 60 + minute) * 60 * 1000;
|
|
2840
|
+
};
|
|
2841
|
+
var stripLeadingZeroes = (value) => {
|
|
2842
|
+
let idx = 0;
|
|
2843
|
+
while (idx < value.length - 1 && value.charAt(idx) === "0") {
|
|
2844
|
+
idx++;
|
|
2845
|
+
}
|
|
2846
|
+
if (idx === 0) {
|
|
2847
|
+
return value;
|
|
2848
|
+
}
|
|
2849
|
+
return value.slice(idx);
|
|
2850
|
+
};
|
|
2851
|
+
var LazyJsonString = function LazyJsonString2(val) {
|
|
2852
|
+
const str = Object.assign(new String(val), {
|
|
2853
|
+
deserializeJSON() {
|
|
2854
|
+
return JSON.parse(String(val));
|
|
2855
|
+
},
|
|
2856
|
+
toString() {
|
|
2857
|
+
return String(val);
|
|
2858
|
+
},
|
|
2859
|
+
toJSON() {
|
|
2860
|
+
return String(val);
|
|
2861
|
+
}
|
|
2862
|
+
});
|
|
2863
|
+
return str;
|
|
2864
|
+
};
|
|
2865
|
+
LazyJsonString.from = (object) => {
|
|
2866
|
+
if (object && typeof object === "object" && (object instanceof LazyJsonString || ("deserializeJSON" in object))) {
|
|
2867
|
+
return object;
|
|
2868
|
+
} else if (typeof object === "string" || Object.getPrototypeOf(object) === String.prototype) {
|
|
2869
|
+
return LazyJsonString(String(object));
|
|
2870
|
+
}
|
|
2871
|
+
return LazyJsonString(JSON.stringify(object));
|
|
2872
|
+
};
|
|
2873
|
+
LazyJsonString.fromObject = LazyJsonString.from;
|
|
2874
|
+
function quoteHeader(part) {
|
|
2875
|
+
if (part.includes(",") || part.includes('"')) {
|
|
2876
|
+
part = `"${part.replace(/"/g, "\\\"")}"`;
|
|
2877
|
+
}
|
|
2878
|
+
return part;
|
|
2879
|
+
}
|
|
2880
|
+
var ddd = `(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)(?:[ne|u?r]?s?day)?`;
|
|
2881
|
+
var mmm = `(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)`;
|
|
2882
|
+
var time = `(\\d?\\d):(\\d{2}):(\\d{2})(?:\\.(\\d+))?`;
|
|
2883
|
+
var date = `(\\d?\\d)`;
|
|
2884
|
+
var year = `(\\d{4})`;
|
|
2885
|
+
var RFC3339_WITH_OFFSET = new RegExp(/^(\d{4})-(\d\d)-(\d\d)[tT](\d\d):(\d\d):(\d\d)(\.(\d+))?(([-+]\d\d:\d\d)|[zZ])$/);
|
|
2886
|
+
var IMF_FIXDATE = new RegExp(`^${ddd}, ${date} ${mmm} ${year} ${time} GMT$`);
|
|
2887
|
+
var RFC_850_DATE = new RegExp(`^${ddd}, ${date}-${mmm}-(\\d\\d) ${time} GMT$`);
|
|
2888
|
+
var ASC_TIME = new RegExp(`^${ddd} ${mmm} ( [1-9]|\\d\\d) ${time} ${year}$`);
|
|
2889
|
+
var months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
|
2890
|
+
var _parseEpochTimestamp = (value) => {
|
|
2891
|
+
if (value == null) {
|
|
2892
|
+
return;
|
|
2893
|
+
}
|
|
2894
|
+
let num = NaN;
|
|
2895
|
+
if (typeof value === "number") {
|
|
2896
|
+
num = value;
|
|
2897
|
+
} else if (typeof value === "string") {
|
|
2898
|
+
if (!/^-?\d*\.?\d+$/.test(value)) {
|
|
2899
|
+
throw new TypeError(`parseEpochTimestamp - numeric string invalid.`);
|
|
2900
|
+
}
|
|
2901
|
+
num = Number.parseFloat(value);
|
|
2902
|
+
} else if (typeof value === "object" && value.tag === 1) {
|
|
2903
|
+
num = value.value;
|
|
2904
|
+
}
|
|
2905
|
+
if (isNaN(num) || Math.abs(num) === Infinity) {
|
|
2906
|
+
throw new TypeError("Epoch timestamps must be valid finite numbers.");
|
|
2907
|
+
}
|
|
2908
|
+
return new Date(Math.round(num * 1000));
|
|
2909
|
+
};
|
|
2910
|
+
var _parseRfc3339DateTimeWithOffset = (value) => {
|
|
2911
|
+
if (value == null) {
|
|
2912
|
+
return;
|
|
2913
|
+
}
|
|
2914
|
+
if (typeof value !== "string") {
|
|
2915
|
+
throw new TypeError("RFC3339 timestamps must be strings");
|
|
2916
|
+
}
|
|
2917
|
+
const matches = RFC3339_WITH_OFFSET.exec(value);
|
|
2918
|
+
if (!matches) {
|
|
2919
|
+
throw new TypeError(`Invalid RFC3339 timestamp format ${value}`);
|
|
2920
|
+
}
|
|
2921
|
+
const [, yearStr, monthStr, dayStr, hours, minutes, seconds, , ms, offsetStr] = matches;
|
|
2922
|
+
range(monthStr, 1, 12);
|
|
2923
|
+
range(dayStr, 1, 31);
|
|
2924
|
+
range(hours, 0, 23);
|
|
2925
|
+
range(minutes, 0, 59);
|
|
2926
|
+
range(seconds, 0, 60);
|
|
2927
|
+
const date2 = new Date(Date.UTC(Number(yearStr), Number(monthStr) - 1, Number(dayStr), Number(hours), Number(minutes), Number(seconds), Number(ms) ? Math.round(parseFloat(`0.${ms}`) * 1000) : 0));
|
|
2928
|
+
date2.setUTCFullYear(Number(yearStr));
|
|
2929
|
+
if (offsetStr.toUpperCase() != "Z") {
|
|
2930
|
+
const [, sign, offsetH, offsetM] = /([+-])(\d\d):(\d\d)/.exec(offsetStr) || [undefined, "+", 0, 0];
|
|
2931
|
+
const scalar = sign === "-" ? 1 : -1;
|
|
2932
|
+
date2.setTime(date2.getTime() + scalar * (Number(offsetH) * 60 * 60 * 1000 + Number(offsetM) * 60 * 1000));
|
|
2933
|
+
}
|
|
2934
|
+
return date2;
|
|
2935
|
+
};
|
|
2936
|
+
var _parseRfc7231DateTime = (value) => {
|
|
2937
|
+
if (value == null) {
|
|
2938
|
+
return;
|
|
2939
|
+
}
|
|
2940
|
+
if (typeof value !== "string") {
|
|
2941
|
+
throw new TypeError("RFC7231 timestamps must be strings.");
|
|
2942
|
+
}
|
|
2943
|
+
let day;
|
|
2944
|
+
let month;
|
|
2945
|
+
let year2;
|
|
2946
|
+
let hour;
|
|
2947
|
+
let minute;
|
|
2948
|
+
let second;
|
|
2949
|
+
let fraction;
|
|
2950
|
+
let matches;
|
|
2951
|
+
if (matches = IMF_FIXDATE.exec(value)) {
|
|
2952
|
+
[, day, month, year2, hour, minute, second, fraction] = matches;
|
|
2953
|
+
} else if (matches = RFC_850_DATE.exec(value)) {
|
|
2954
|
+
[, day, month, year2, hour, minute, second, fraction] = matches;
|
|
2955
|
+
year2 = (Number(year2) + 1900).toString();
|
|
2956
|
+
} else if (matches = ASC_TIME.exec(value)) {
|
|
2957
|
+
[, month, day, hour, minute, second, fraction, year2] = matches;
|
|
2958
|
+
}
|
|
2959
|
+
if (year2 && second) {
|
|
2960
|
+
const timestamp = Date.UTC(Number(year2), months.indexOf(month), Number(day), Number(hour), Number(minute), Number(second), fraction ? Math.round(parseFloat(`0.${fraction}`) * 1000) : 0);
|
|
2961
|
+
range(day, 1, 31);
|
|
2962
|
+
range(hour, 0, 23);
|
|
2963
|
+
range(minute, 0, 59);
|
|
2964
|
+
range(second, 0, 60);
|
|
2965
|
+
const date2 = new Date(timestamp);
|
|
2966
|
+
date2.setUTCFullYear(Number(year2));
|
|
2967
|
+
return date2;
|
|
2968
|
+
}
|
|
2969
|
+
throw new TypeError(`Invalid RFC7231 date-time value ${value}.`);
|
|
2970
|
+
};
|
|
2971
|
+
function range(v, min, max) {
|
|
2972
|
+
const _v = Number(v);
|
|
2973
|
+
if (_v < min || _v > max) {
|
|
2974
|
+
throw new Error(`Value ${_v} out of range [${min}, ${max}]`);
|
|
2975
|
+
}
|
|
2976
|
+
}
|
|
2977
|
+
function splitEvery(value, delimiter, numDelimiters) {
|
|
2978
|
+
if (numDelimiters <= 0 || !Number.isInteger(numDelimiters)) {
|
|
2979
|
+
throw new Error("Invalid number of delimiters (" + numDelimiters + ") for splitEvery.");
|
|
2980
|
+
}
|
|
2981
|
+
const segments = value.split(delimiter);
|
|
2982
|
+
if (numDelimiters === 1) {
|
|
2983
|
+
return segments;
|
|
2984
|
+
}
|
|
2985
|
+
const compoundSegments = [];
|
|
2986
|
+
let currentSegment = "";
|
|
2987
|
+
for (let i = 0;i < segments.length; i++) {
|
|
2988
|
+
if (currentSegment === "") {
|
|
2989
|
+
currentSegment = segments[i];
|
|
2990
|
+
} else {
|
|
2991
|
+
currentSegment += delimiter + segments[i];
|
|
2992
|
+
}
|
|
2993
|
+
if ((i + 1) % numDelimiters === 0) {
|
|
2994
|
+
compoundSegments.push(currentSegment);
|
|
2995
|
+
currentSegment = "";
|
|
2996
|
+
}
|
|
2997
|
+
}
|
|
2998
|
+
if (currentSegment !== "") {
|
|
2999
|
+
compoundSegments.push(currentSegment);
|
|
3000
|
+
}
|
|
3001
|
+
return compoundSegments;
|
|
3002
|
+
}
|
|
3003
|
+
var splitHeader = (value) => {
|
|
3004
|
+
const z = value.length;
|
|
3005
|
+
const values = [];
|
|
3006
|
+
let withinQuotes = false;
|
|
3007
|
+
let prevChar = undefined;
|
|
3008
|
+
let anchor = 0;
|
|
3009
|
+
for (let i = 0;i < z; ++i) {
|
|
3010
|
+
const char = value[i];
|
|
3011
|
+
switch (char) {
|
|
3012
|
+
case `"`:
|
|
3013
|
+
if (prevChar !== "\\") {
|
|
3014
|
+
withinQuotes = !withinQuotes;
|
|
3015
|
+
}
|
|
3016
|
+
break;
|
|
3017
|
+
case ",":
|
|
3018
|
+
if (!withinQuotes) {
|
|
3019
|
+
values.push(value.slice(anchor, i));
|
|
3020
|
+
anchor = i + 1;
|
|
3021
|
+
}
|
|
3022
|
+
break;
|
|
3023
|
+
}
|
|
3024
|
+
prevChar = char;
|
|
3025
|
+
}
|
|
3026
|
+
values.push(value.slice(anchor));
|
|
3027
|
+
return values.map((v) => {
|
|
3028
|
+
v = v.trim();
|
|
3029
|
+
const z2 = v.length;
|
|
3030
|
+
if (z2 < 2) {
|
|
3031
|
+
return v;
|
|
3032
|
+
}
|
|
3033
|
+
if (v[0] === `"` && v[z2 - 1] === `"`) {
|
|
3034
|
+
v = v.slice(1, z2 - 1);
|
|
3035
|
+
}
|
|
3036
|
+
return v.replace(/\\"/g, '"');
|
|
3037
|
+
});
|
|
3038
|
+
};
|
|
3039
|
+
var format = /^-?\d*(\.\d+)?$/;
|
|
3040
|
+
|
|
3041
|
+
class NumericValue {
|
|
3042
|
+
string;
|
|
3043
|
+
type;
|
|
3044
|
+
constructor(string, type) {
|
|
3045
|
+
this.string = string;
|
|
3046
|
+
this.type = type;
|
|
3047
|
+
if (!format.test(string)) {
|
|
3048
|
+
throw new Error(`@smithy/core/serde - NumericValue must only contain [0-9], at most one decimal point ".", and an optional negation prefix "-".`);
|
|
3049
|
+
}
|
|
3050
|
+
}
|
|
3051
|
+
toString() {
|
|
3052
|
+
return this.string;
|
|
3053
|
+
}
|
|
3054
|
+
static [Symbol.hasInstance](object) {
|
|
3055
|
+
if (!object || typeof object !== "object") {
|
|
3056
|
+
return false;
|
|
3057
|
+
}
|
|
3058
|
+
const _nv = object;
|
|
3059
|
+
return NumericValue.prototype.isPrototypeOf(object) || _nv.type === "bigDecimal" && format.test(_nv.string);
|
|
3060
|
+
}
|
|
3061
|
+
}
|
|
3062
|
+
function nv(input) {
|
|
3063
|
+
return new NumericValue(String(input), "bigDecimal");
|
|
3064
|
+
}
|
|
3065
|
+
exports.generateIdempotencyToken = uuid.v4;
|
|
3066
|
+
exports.LazyJsonString = LazyJsonString;
|
|
3067
|
+
exports.NumericValue = NumericValue;
|
|
3068
|
+
exports._parseEpochTimestamp = _parseEpochTimestamp;
|
|
3069
|
+
exports._parseRfc3339DateTimeWithOffset = _parseRfc3339DateTimeWithOffset;
|
|
3070
|
+
exports._parseRfc7231DateTime = _parseRfc7231DateTime;
|
|
3071
|
+
exports.copyDocumentWithTransform = copyDocumentWithTransform;
|
|
3072
|
+
exports.dateToUtcString = dateToUtcString;
|
|
3073
|
+
exports.expectBoolean = expectBoolean;
|
|
3074
|
+
exports.expectByte = expectByte;
|
|
3075
|
+
exports.expectFloat32 = expectFloat32;
|
|
3076
|
+
exports.expectInt = expectInt;
|
|
3077
|
+
exports.expectInt32 = expectInt32;
|
|
3078
|
+
exports.expectLong = expectLong;
|
|
3079
|
+
exports.expectNonNull = expectNonNull;
|
|
3080
|
+
exports.expectNumber = expectNumber;
|
|
3081
|
+
exports.expectObject = expectObject;
|
|
3082
|
+
exports.expectShort = expectShort;
|
|
3083
|
+
exports.expectString = expectString;
|
|
3084
|
+
exports.expectUnion = expectUnion;
|
|
3085
|
+
exports.handleFloat = handleFloat;
|
|
3086
|
+
exports.limitedParseDouble = limitedParseDouble;
|
|
3087
|
+
exports.limitedParseFloat = limitedParseFloat;
|
|
3088
|
+
exports.limitedParseFloat32 = limitedParseFloat32;
|
|
3089
|
+
exports.logger = logger;
|
|
3090
|
+
exports.nv = nv;
|
|
3091
|
+
exports.parseBoolean = parseBoolean;
|
|
3092
|
+
exports.parseEpochTimestamp = parseEpochTimestamp;
|
|
3093
|
+
exports.parseRfc3339DateTime = parseRfc3339DateTime;
|
|
3094
|
+
exports.parseRfc3339DateTimeWithOffset = parseRfc3339DateTimeWithOffset;
|
|
3095
|
+
exports.parseRfc7231DateTime = parseRfc7231DateTime;
|
|
3096
|
+
exports.quoteHeader = quoteHeader;
|
|
3097
|
+
exports.splitEvery = splitEvery;
|
|
3098
|
+
exports.splitHeader = splitHeader;
|
|
3099
|
+
exports.strictParseByte = strictParseByte;
|
|
3100
|
+
exports.strictParseDouble = strictParseDouble;
|
|
3101
|
+
exports.strictParseFloat = strictParseFloat;
|
|
3102
|
+
exports.strictParseFloat32 = strictParseFloat32;
|
|
3103
|
+
exports.strictParseInt = strictParseInt;
|
|
3104
|
+
exports.strictParseInt32 = strictParseInt32;
|
|
3105
|
+
exports.strictParseLong = strictParseLong;
|
|
3106
|
+
exports.strictParseShort = strictParseShort;
|
|
3107
|
+
});
|
|
3108
|
+
|
|
3109
|
+
// node_modules/.bun/@smithy+core@3.23.13/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js
|
|
3110
|
+
var require_protocols = __commonJS((exports) => {
|
|
3111
|
+
var utilStream = require_dist_cjs12();
|
|
3112
|
+
var schema = require_schema();
|
|
3113
|
+
var serde = require_serde();
|
|
3114
|
+
var protocolHttp = require_dist_cjs2();
|
|
3115
|
+
var utilBase64 = require_dist_cjs9();
|
|
3116
|
+
var utilUtf8 = require_dist_cjs7();
|
|
3117
|
+
var collectBody = async (streamBody = new Uint8Array, context) => {
|
|
3118
|
+
if (streamBody instanceof Uint8Array) {
|
|
3119
|
+
return utilStream.Uint8ArrayBlobAdapter.mutate(streamBody);
|
|
3120
|
+
}
|
|
3121
|
+
if (!streamBody) {
|
|
3122
|
+
return utilStream.Uint8ArrayBlobAdapter.mutate(new Uint8Array);
|
|
3123
|
+
}
|
|
3124
|
+
const fromContext = context.streamCollector(streamBody);
|
|
3125
|
+
return utilStream.Uint8ArrayBlobAdapter.mutate(await fromContext);
|
|
3126
|
+
};
|
|
3127
|
+
function extendedEncodeURIComponent(str) {
|
|
3128
|
+
return encodeURIComponent(str).replace(/[!'()*]/g, function(c) {
|
|
3129
|
+
return "%" + c.charCodeAt(0).toString(16).toUpperCase();
|
|
3130
|
+
});
|
|
3131
|
+
}
|
|
3132
|
+
|
|
3133
|
+
class SerdeContext {
|
|
3134
|
+
serdeContext;
|
|
3135
|
+
setSerdeContext(serdeContext) {
|
|
3136
|
+
this.serdeContext = serdeContext;
|
|
3137
|
+
}
|
|
3138
|
+
}
|
|
3139
|
+
|
|
3140
|
+
class HttpProtocol extends SerdeContext {
|
|
3141
|
+
options;
|
|
3142
|
+
compositeErrorRegistry;
|
|
3143
|
+
constructor(options) {
|
|
3144
|
+
super();
|
|
3145
|
+
this.options = options;
|
|
3146
|
+
this.compositeErrorRegistry = schema.TypeRegistry.for(options.defaultNamespace);
|
|
3147
|
+
for (const etr of options.errorTypeRegistries ?? []) {
|
|
3148
|
+
this.compositeErrorRegistry.copyFrom(etr);
|
|
3149
|
+
}
|
|
3150
|
+
}
|
|
3151
|
+
getRequestType() {
|
|
3152
|
+
return protocolHttp.HttpRequest;
|
|
3153
|
+
}
|
|
3154
|
+
getResponseType() {
|
|
3155
|
+
return protocolHttp.HttpResponse;
|
|
3156
|
+
}
|
|
3157
|
+
setSerdeContext(serdeContext) {
|
|
3158
|
+
this.serdeContext = serdeContext;
|
|
3159
|
+
this.serializer.setSerdeContext(serdeContext);
|
|
3160
|
+
this.deserializer.setSerdeContext(serdeContext);
|
|
3161
|
+
if (this.getPayloadCodec()) {
|
|
3162
|
+
this.getPayloadCodec().setSerdeContext(serdeContext);
|
|
3163
|
+
}
|
|
3164
|
+
}
|
|
3165
|
+
updateServiceEndpoint(request, endpoint) {
|
|
3166
|
+
if ("url" in endpoint) {
|
|
3167
|
+
request.protocol = endpoint.url.protocol;
|
|
3168
|
+
request.hostname = endpoint.url.hostname;
|
|
3169
|
+
request.port = endpoint.url.port ? Number(endpoint.url.port) : undefined;
|
|
3170
|
+
request.path = endpoint.url.pathname;
|
|
3171
|
+
request.fragment = endpoint.url.hash || undefined;
|
|
3172
|
+
request.username = endpoint.url.username || undefined;
|
|
3173
|
+
request.password = endpoint.url.password || undefined;
|
|
3174
|
+
if (!request.query) {
|
|
3175
|
+
request.query = {};
|
|
3176
|
+
}
|
|
3177
|
+
for (const [k, v] of endpoint.url.searchParams.entries()) {
|
|
3178
|
+
request.query[k] = v;
|
|
3179
|
+
}
|
|
3180
|
+
if (endpoint.headers) {
|
|
3181
|
+
for (const [name, values] of Object.entries(endpoint.headers)) {
|
|
3182
|
+
request.headers[name] = values.join(", ");
|
|
3183
|
+
}
|
|
3184
|
+
}
|
|
3185
|
+
return request;
|
|
3186
|
+
} else {
|
|
3187
|
+
request.protocol = endpoint.protocol;
|
|
3188
|
+
request.hostname = endpoint.hostname;
|
|
3189
|
+
request.port = endpoint.port ? Number(endpoint.port) : undefined;
|
|
3190
|
+
request.path = endpoint.path;
|
|
3191
|
+
request.query = {
|
|
3192
|
+
...endpoint.query
|
|
3193
|
+
};
|
|
3194
|
+
if (endpoint.headers) {
|
|
3195
|
+
for (const [name, value] of Object.entries(endpoint.headers)) {
|
|
3196
|
+
request.headers[name] = value;
|
|
3197
|
+
}
|
|
3198
|
+
}
|
|
3199
|
+
return request;
|
|
3200
|
+
}
|
|
3201
|
+
}
|
|
3202
|
+
setHostPrefix(request, operationSchema, input) {
|
|
3203
|
+
if (this.serdeContext?.disableHostPrefix) {
|
|
3204
|
+
return;
|
|
3205
|
+
}
|
|
3206
|
+
const inputNs = schema.NormalizedSchema.of(operationSchema.input);
|
|
3207
|
+
const opTraits = schema.translateTraits(operationSchema.traits ?? {});
|
|
3208
|
+
if (opTraits.endpoint) {
|
|
3209
|
+
let hostPrefix = opTraits.endpoint?.[0];
|
|
3210
|
+
if (typeof hostPrefix === "string") {
|
|
3211
|
+
const hostLabelInputs = [...inputNs.structIterator()].filter(([, member]) => member.getMergedTraits().hostLabel);
|
|
3212
|
+
for (const [name] of hostLabelInputs) {
|
|
3213
|
+
const replacement = input[name];
|
|
3214
|
+
if (typeof replacement !== "string") {
|
|
3215
|
+
throw new Error(`@smithy/core/schema - ${name} in input must be a string as hostLabel.`);
|
|
3216
|
+
}
|
|
3217
|
+
hostPrefix = hostPrefix.replace(`{${name}}`, replacement);
|
|
3218
|
+
}
|
|
3219
|
+
request.hostname = hostPrefix + request.hostname;
|
|
3220
|
+
}
|
|
3221
|
+
}
|
|
3222
|
+
}
|
|
3223
|
+
deserializeMetadata(output) {
|
|
3224
|
+
return {
|
|
3225
|
+
httpStatusCode: output.statusCode,
|
|
3226
|
+
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
|
|
3227
|
+
extendedRequestId: output.headers["x-amz-id-2"],
|
|
3228
|
+
cfId: output.headers["x-amz-cf-id"]
|
|
3229
|
+
};
|
|
3230
|
+
}
|
|
3231
|
+
async serializeEventStream({ eventStream, requestSchema, initialRequest }) {
|
|
3232
|
+
const eventStreamSerde = await this.loadEventStreamCapability();
|
|
3233
|
+
return eventStreamSerde.serializeEventStream({
|
|
3234
|
+
eventStream,
|
|
3235
|
+
requestSchema,
|
|
3236
|
+
initialRequest
|
|
3237
|
+
});
|
|
3238
|
+
}
|
|
3239
|
+
async deserializeEventStream({ response, responseSchema, initialResponseContainer }) {
|
|
3240
|
+
const eventStreamSerde = await this.loadEventStreamCapability();
|
|
3241
|
+
return eventStreamSerde.deserializeEventStream({
|
|
3242
|
+
response,
|
|
3243
|
+
responseSchema,
|
|
3244
|
+
initialResponseContainer
|
|
3245
|
+
});
|
|
3246
|
+
}
|
|
3247
|
+
async loadEventStreamCapability() {
|
|
3248
|
+
const { EventStreamSerde } = await import("./chunk-a9vdeb6y.js");
|
|
3249
|
+
return new EventStreamSerde({
|
|
3250
|
+
marshaller: this.getEventStreamMarshaller(),
|
|
3251
|
+
serializer: this.serializer,
|
|
3252
|
+
deserializer: this.deserializer,
|
|
3253
|
+
serdeContext: this.serdeContext,
|
|
3254
|
+
defaultContentType: this.getDefaultContentType()
|
|
3255
|
+
});
|
|
3256
|
+
}
|
|
3257
|
+
getDefaultContentType() {
|
|
3258
|
+
throw new Error(`@smithy/core/protocols - ${this.constructor.name} getDefaultContentType() implementation missing.`);
|
|
3259
|
+
}
|
|
3260
|
+
async deserializeHttpMessage(schema2, context, response, arg4, arg5) {
|
|
3261
|
+
return [];
|
|
3262
|
+
}
|
|
3263
|
+
getEventStreamMarshaller() {
|
|
3264
|
+
const context = this.serdeContext;
|
|
3265
|
+
if (!context.eventStreamMarshaller) {
|
|
3266
|
+
throw new Error("@smithy/core - HttpProtocol: eventStreamMarshaller missing in serdeContext.");
|
|
3267
|
+
}
|
|
3268
|
+
return context.eventStreamMarshaller;
|
|
3269
|
+
}
|
|
3270
|
+
}
|
|
3271
|
+
|
|
3272
|
+
class HttpBindingProtocol extends HttpProtocol {
|
|
3273
|
+
async serializeRequest(operationSchema, _input, context) {
|
|
3274
|
+
const input = _input && typeof _input === "object" ? _input : {};
|
|
3275
|
+
const serializer = this.serializer;
|
|
3276
|
+
const query = {};
|
|
3277
|
+
const headers = {};
|
|
3278
|
+
const endpoint = await context.endpoint();
|
|
3279
|
+
const ns = schema.NormalizedSchema.of(operationSchema?.input);
|
|
3280
|
+
const payloadMemberNames = [];
|
|
3281
|
+
const payloadMemberSchemas = [];
|
|
3282
|
+
let hasNonHttpBindingMember = false;
|
|
3283
|
+
let payload;
|
|
3284
|
+
const request = new protocolHttp.HttpRequest({
|
|
3285
|
+
protocol: "",
|
|
3286
|
+
hostname: "",
|
|
3287
|
+
port: undefined,
|
|
3288
|
+
path: "",
|
|
3289
|
+
fragment: undefined,
|
|
3290
|
+
query,
|
|
3291
|
+
headers,
|
|
3292
|
+
body: undefined
|
|
3293
|
+
});
|
|
3294
|
+
if (endpoint) {
|
|
3295
|
+
this.updateServiceEndpoint(request, endpoint);
|
|
3296
|
+
this.setHostPrefix(request, operationSchema, input);
|
|
3297
|
+
const opTraits = schema.translateTraits(operationSchema.traits);
|
|
3298
|
+
if (opTraits.http) {
|
|
3299
|
+
request.method = opTraits.http[0];
|
|
3300
|
+
const [path, search] = opTraits.http[1].split("?");
|
|
3301
|
+
if (request.path == "/") {
|
|
3302
|
+
request.path = path;
|
|
3303
|
+
} else {
|
|
3304
|
+
request.path += path;
|
|
3305
|
+
}
|
|
3306
|
+
const traitSearchParams = new URLSearchParams(search ?? "");
|
|
3307
|
+
Object.assign(query, Object.fromEntries(traitSearchParams));
|
|
3308
|
+
}
|
|
3309
|
+
}
|
|
3310
|
+
for (const [memberName, memberNs] of ns.structIterator()) {
|
|
3311
|
+
const memberTraits = memberNs.getMergedTraits() ?? {};
|
|
3312
|
+
const inputMemberValue = input[memberName];
|
|
3313
|
+
if (inputMemberValue == null && !memberNs.isIdempotencyToken()) {
|
|
3314
|
+
if (memberTraits.httpLabel) {
|
|
3315
|
+
if (request.path.includes(`{${memberName}+}`) || request.path.includes(`{${memberName}}`)) {
|
|
3316
|
+
throw new Error(`No value provided for input HTTP label: ${memberName}.`);
|
|
3317
|
+
}
|
|
3318
|
+
}
|
|
3319
|
+
continue;
|
|
3320
|
+
}
|
|
3321
|
+
if (memberTraits.httpPayload) {
|
|
3322
|
+
const isStreaming = memberNs.isStreaming();
|
|
3323
|
+
if (isStreaming) {
|
|
3324
|
+
const isEventStream = memberNs.isStructSchema();
|
|
3325
|
+
if (isEventStream) {
|
|
3326
|
+
if (input[memberName]) {
|
|
3327
|
+
payload = await this.serializeEventStream({
|
|
3328
|
+
eventStream: input[memberName],
|
|
3329
|
+
requestSchema: ns
|
|
3330
|
+
});
|
|
3331
|
+
}
|
|
3332
|
+
} else {
|
|
3333
|
+
payload = inputMemberValue;
|
|
3334
|
+
}
|
|
3335
|
+
} else {
|
|
3336
|
+
serializer.write(memberNs, inputMemberValue);
|
|
3337
|
+
payload = serializer.flush();
|
|
3338
|
+
}
|
|
3339
|
+
} else if (memberTraits.httpLabel) {
|
|
3340
|
+
serializer.write(memberNs, inputMemberValue);
|
|
3341
|
+
const replacement = serializer.flush();
|
|
3342
|
+
if (request.path.includes(`{${memberName}+}`)) {
|
|
3343
|
+
request.path = request.path.replace(`{${memberName}+}`, replacement.split("/").map(extendedEncodeURIComponent).join("/"));
|
|
3344
|
+
} else if (request.path.includes(`{${memberName}}`)) {
|
|
3345
|
+
request.path = request.path.replace(`{${memberName}}`, extendedEncodeURIComponent(replacement));
|
|
3346
|
+
}
|
|
3347
|
+
} else if (memberTraits.httpHeader) {
|
|
3348
|
+
serializer.write(memberNs, inputMemberValue);
|
|
3349
|
+
headers[memberTraits.httpHeader.toLowerCase()] = String(serializer.flush());
|
|
3350
|
+
} else if (typeof memberTraits.httpPrefixHeaders === "string") {
|
|
3351
|
+
for (const [key, val] of Object.entries(inputMemberValue)) {
|
|
3352
|
+
const amalgam = memberTraits.httpPrefixHeaders + key;
|
|
3353
|
+
serializer.write([memberNs.getValueSchema(), { httpHeader: amalgam }], val);
|
|
3354
|
+
headers[amalgam.toLowerCase()] = serializer.flush();
|
|
3355
|
+
}
|
|
3356
|
+
} else if (memberTraits.httpQuery || memberTraits.httpQueryParams) {
|
|
3357
|
+
this.serializeQuery(memberNs, inputMemberValue, query);
|
|
3358
|
+
} else {
|
|
3359
|
+
hasNonHttpBindingMember = true;
|
|
3360
|
+
payloadMemberNames.push(memberName);
|
|
3361
|
+
payloadMemberSchemas.push(memberNs);
|
|
3362
|
+
}
|
|
3363
|
+
}
|
|
3364
|
+
if (hasNonHttpBindingMember && input) {
|
|
3365
|
+
const [namespace, name] = (ns.getName(true) ?? "#Unknown").split("#");
|
|
3366
|
+
const requiredMembers = ns.getSchema()[6];
|
|
3367
|
+
const payloadSchema = [
|
|
3368
|
+
3,
|
|
3369
|
+
namespace,
|
|
3370
|
+
name,
|
|
3371
|
+
ns.getMergedTraits(),
|
|
3372
|
+
payloadMemberNames,
|
|
3373
|
+
payloadMemberSchemas,
|
|
3374
|
+
undefined
|
|
3375
|
+
];
|
|
3376
|
+
if (requiredMembers) {
|
|
3377
|
+
payloadSchema[6] = requiredMembers;
|
|
3378
|
+
} else {
|
|
3379
|
+
payloadSchema.pop();
|
|
3380
|
+
}
|
|
3381
|
+
serializer.write(payloadSchema, input);
|
|
3382
|
+
payload = serializer.flush();
|
|
3383
|
+
}
|
|
3384
|
+
request.headers = headers;
|
|
3385
|
+
request.query = query;
|
|
3386
|
+
request.body = payload;
|
|
3387
|
+
return request;
|
|
3388
|
+
}
|
|
3389
|
+
serializeQuery(ns, data, query) {
|
|
3390
|
+
const serializer = this.serializer;
|
|
3391
|
+
const traits = ns.getMergedTraits();
|
|
3392
|
+
if (traits.httpQueryParams) {
|
|
3393
|
+
for (const [key, val] of Object.entries(data)) {
|
|
3394
|
+
if (!(key in query)) {
|
|
3395
|
+
const valueSchema = ns.getValueSchema();
|
|
3396
|
+
Object.assign(valueSchema.getMergedTraits(), {
|
|
3397
|
+
...traits,
|
|
3398
|
+
httpQuery: key,
|
|
3399
|
+
httpQueryParams: undefined
|
|
3400
|
+
});
|
|
3401
|
+
this.serializeQuery(valueSchema, val, query);
|
|
3402
|
+
}
|
|
3403
|
+
}
|
|
3404
|
+
return;
|
|
3405
|
+
}
|
|
3406
|
+
if (ns.isListSchema()) {
|
|
3407
|
+
const sparse = !!ns.getMergedTraits().sparse;
|
|
3408
|
+
const buffer = [];
|
|
3409
|
+
for (const item of data) {
|
|
3410
|
+
serializer.write([ns.getValueSchema(), traits], item);
|
|
3411
|
+
const serializable = serializer.flush();
|
|
3412
|
+
if (sparse || serializable !== undefined) {
|
|
3413
|
+
buffer.push(serializable);
|
|
3414
|
+
}
|
|
3415
|
+
}
|
|
3416
|
+
query[traits.httpQuery] = buffer;
|
|
3417
|
+
} else {
|
|
3418
|
+
serializer.write([ns, traits], data);
|
|
3419
|
+
query[traits.httpQuery] = serializer.flush();
|
|
3420
|
+
}
|
|
3421
|
+
}
|
|
3422
|
+
async deserializeResponse(operationSchema, context, response) {
|
|
3423
|
+
const deserializer = this.deserializer;
|
|
3424
|
+
const ns = schema.NormalizedSchema.of(operationSchema.output);
|
|
3425
|
+
const dataObject = {};
|
|
3426
|
+
if (response.statusCode >= 300) {
|
|
3427
|
+
const bytes = await collectBody(response.body, context);
|
|
3428
|
+
if (bytes.byteLength > 0) {
|
|
3429
|
+
Object.assign(dataObject, await deserializer.read(15, bytes));
|
|
3430
|
+
}
|
|
3431
|
+
await this.handleError(operationSchema, context, response, dataObject, this.deserializeMetadata(response));
|
|
3432
|
+
throw new Error("@smithy/core/protocols - HTTP Protocol error handler failed to throw.");
|
|
3433
|
+
}
|
|
3434
|
+
for (const header in response.headers) {
|
|
3435
|
+
const value = response.headers[header];
|
|
3436
|
+
delete response.headers[header];
|
|
3437
|
+
response.headers[header.toLowerCase()] = value;
|
|
3438
|
+
}
|
|
3439
|
+
const nonHttpBindingMembers = await this.deserializeHttpMessage(ns, context, response, dataObject);
|
|
3440
|
+
if (nonHttpBindingMembers.length) {
|
|
3441
|
+
const bytes = await collectBody(response.body, context);
|
|
3442
|
+
if (bytes.byteLength > 0) {
|
|
3443
|
+
const dataFromBody = await deserializer.read(ns, bytes);
|
|
3444
|
+
for (const member of nonHttpBindingMembers) {
|
|
3445
|
+
if (dataFromBody[member] != null) {
|
|
3446
|
+
dataObject[member] = dataFromBody[member];
|
|
3447
|
+
}
|
|
3448
|
+
}
|
|
3449
|
+
}
|
|
3450
|
+
} else if (nonHttpBindingMembers.discardResponseBody) {
|
|
3451
|
+
await collectBody(response.body, context);
|
|
3452
|
+
}
|
|
3453
|
+
dataObject.$metadata = this.deserializeMetadata(response);
|
|
3454
|
+
return dataObject;
|
|
3455
|
+
}
|
|
3456
|
+
async deserializeHttpMessage(schema$1, context, response, arg4, arg5) {
|
|
3457
|
+
let dataObject;
|
|
3458
|
+
if (arg4 instanceof Set) {
|
|
3459
|
+
dataObject = arg5;
|
|
3460
|
+
} else {
|
|
3461
|
+
dataObject = arg4;
|
|
3462
|
+
}
|
|
3463
|
+
let discardResponseBody = true;
|
|
3464
|
+
const deserializer = this.deserializer;
|
|
3465
|
+
const ns = schema.NormalizedSchema.of(schema$1);
|
|
3466
|
+
const nonHttpBindingMembers = [];
|
|
3467
|
+
for (const [memberName, memberSchema] of ns.structIterator()) {
|
|
3468
|
+
const memberTraits = memberSchema.getMemberTraits();
|
|
3469
|
+
if (memberTraits.httpPayload) {
|
|
3470
|
+
discardResponseBody = false;
|
|
3471
|
+
const isStreaming = memberSchema.isStreaming();
|
|
3472
|
+
if (isStreaming) {
|
|
3473
|
+
const isEventStream = memberSchema.isStructSchema();
|
|
3474
|
+
if (isEventStream) {
|
|
3475
|
+
dataObject[memberName] = await this.deserializeEventStream({
|
|
3476
|
+
response,
|
|
3477
|
+
responseSchema: ns
|
|
3478
|
+
});
|
|
3479
|
+
} else {
|
|
3480
|
+
dataObject[memberName] = utilStream.sdkStreamMixin(response.body);
|
|
3481
|
+
}
|
|
3482
|
+
} else if (response.body) {
|
|
3483
|
+
const bytes = await collectBody(response.body, context);
|
|
3484
|
+
if (bytes.byteLength > 0) {
|
|
3485
|
+
dataObject[memberName] = await deserializer.read(memberSchema, bytes);
|
|
3486
|
+
}
|
|
3487
|
+
}
|
|
3488
|
+
} else if (memberTraits.httpHeader) {
|
|
3489
|
+
const key = String(memberTraits.httpHeader).toLowerCase();
|
|
3490
|
+
const value = response.headers[key];
|
|
3491
|
+
if (value != null) {
|
|
3492
|
+
if (memberSchema.isListSchema()) {
|
|
3493
|
+
const headerListValueSchema = memberSchema.getValueSchema();
|
|
3494
|
+
headerListValueSchema.getMergedTraits().httpHeader = key;
|
|
3495
|
+
let sections;
|
|
3496
|
+
if (headerListValueSchema.isTimestampSchema() && headerListValueSchema.getSchema() === 4) {
|
|
3497
|
+
sections = serde.splitEvery(value, ",", 2);
|
|
3498
|
+
} else {
|
|
3499
|
+
sections = serde.splitHeader(value);
|
|
3500
|
+
}
|
|
3501
|
+
const list = [];
|
|
3502
|
+
for (const section of sections) {
|
|
3503
|
+
list.push(await deserializer.read(headerListValueSchema, section.trim()));
|
|
3504
|
+
}
|
|
3505
|
+
dataObject[memberName] = list;
|
|
3506
|
+
} else {
|
|
3507
|
+
dataObject[memberName] = await deserializer.read(memberSchema, value);
|
|
3508
|
+
}
|
|
3509
|
+
}
|
|
3510
|
+
} else if (memberTraits.httpPrefixHeaders !== undefined) {
|
|
3511
|
+
dataObject[memberName] = {};
|
|
3512
|
+
for (const [header, value] of Object.entries(response.headers)) {
|
|
3513
|
+
if (header.startsWith(memberTraits.httpPrefixHeaders)) {
|
|
3514
|
+
const valueSchema = memberSchema.getValueSchema();
|
|
3515
|
+
valueSchema.getMergedTraits().httpHeader = header;
|
|
3516
|
+
dataObject[memberName][header.slice(memberTraits.httpPrefixHeaders.length)] = await deserializer.read(valueSchema, value);
|
|
3517
|
+
}
|
|
3518
|
+
}
|
|
3519
|
+
} else if (memberTraits.httpResponseCode) {
|
|
3520
|
+
dataObject[memberName] = response.statusCode;
|
|
3521
|
+
} else {
|
|
3522
|
+
nonHttpBindingMembers.push(memberName);
|
|
3523
|
+
}
|
|
3524
|
+
}
|
|
3525
|
+
nonHttpBindingMembers.discardResponseBody = discardResponseBody;
|
|
3526
|
+
return nonHttpBindingMembers;
|
|
3527
|
+
}
|
|
3528
|
+
}
|
|
3529
|
+
|
|
3530
|
+
class RpcProtocol extends HttpProtocol {
|
|
3531
|
+
async serializeRequest(operationSchema, _input, context) {
|
|
3532
|
+
const serializer = this.serializer;
|
|
3533
|
+
const query = {};
|
|
3534
|
+
const headers = {};
|
|
3535
|
+
const endpoint = await context.endpoint();
|
|
3536
|
+
const ns = schema.NormalizedSchema.of(operationSchema?.input);
|
|
3537
|
+
const schema$1 = ns.getSchema();
|
|
3538
|
+
let payload;
|
|
3539
|
+
const input = _input && typeof _input === "object" ? _input : {};
|
|
3540
|
+
const request = new protocolHttp.HttpRequest({
|
|
3541
|
+
protocol: "",
|
|
3542
|
+
hostname: "",
|
|
3543
|
+
port: undefined,
|
|
3544
|
+
path: "/",
|
|
3545
|
+
fragment: undefined,
|
|
3546
|
+
query,
|
|
3547
|
+
headers,
|
|
3548
|
+
body: undefined
|
|
3549
|
+
});
|
|
3550
|
+
if (endpoint) {
|
|
3551
|
+
this.updateServiceEndpoint(request, endpoint);
|
|
3552
|
+
this.setHostPrefix(request, operationSchema, input);
|
|
3553
|
+
}
|
|
3554
|
+
if (input) {
|
|
3555
|
+
const eventStreamMember = ns.getEventStreamMember();
|
|
3556
|
+
if (eventStreamMember) {
|
|
3557
|
+
if (input[eventStreamMember]) {
|
|
3558
|
+
const initialRequest = {};
|
|
3559
|
+
for (const [memberName, memberSchema] of ns.structIterator()) {
|
|
3560
|
+
if (memberName !== eventStreamMember && input[memberName]) {
|
|
3561
|
+
serializer.write(memberSchema, input[memberName]);
|
|
3562
|
+
initialRequest[memberName] = serializer.flush();
|
|
3563
|
+
}
|
|
3564
|
+
}
|
|
3565
|
+
payload = await this.serializeEventStream({
|
|
3566
|
+
eventStream: input[eventStreamMember],
|
|
3567
|
+
requestSchema: ns,
|
|
3568
|
+
initialRequest
|
|
3569
|
+
});
|
|
3570
|
+
}
|
|
3571
|
+
} else {
|
|
3572
|
+
serializer.write(schema$1, input);
|
|
3573
|
+
payload = serializer.flush();
|
|
3574
|
+
}
|
|
3575
|
+
}
|
|
3576
|
+
request.headers = Object.assign(request.headers, headers);
|
|
3577
|
+
request.query = query;
|
|
3578
|
+
request.body = payload;
|
|
3579
|
+
request.method = "POST";
|
|
3580
|
+
return request;
|
|
3581
|
+
}
|
|
3582
|
+
async deserializeResponse(operationSchema, context, response) {
|
|
3583
|
+
const deserializer = this.deserializer;
|
|
3584
|
+
const ns = schema.NormalizedSchema.of(operationSchema.output);
|
|
3585
|
+
const dataObject = {};
|
|
3586
|
+
if (response.statusCode >= 300) {
|
|
3587
|
+
const bytes = await collectBody(response.body, context);
|
|
3588
|
+
if (bytes.byteLength > 0) {
|
|
3589
|
+
Object.assign(dataObject, await deserializer.read(15, bytes));
|
|
3590
|
+
}
|
|
3591
|
+
await this.handleError(operationSchema, context, response, dataObject, this.deserializeMetadata(response));
|
|
3592
|
+
throw new Error("@smithy/core/protocols - RPC Protocol error handler failed to throw.");
|
|
3593
|
+
}
|
|
3594
|
+
for (const header in response.headers) {
|
|
3595
|
+
const value = response.headers[header];
|
|
3596
|
+
delete response.headers[header];
|
|
3597
|
+
response.headers[header.toLowerCase()] = value;
|
|
3598
|
+
}
|
|
3599
|
+
const eventStreamMember = ns.getEventStreamMember();
|
|
3600
|
+
if (eventStreamMember) {
|
|
3601
|
+
dataObject[eventStreamMember] = await this.deserializeEventStream({
|
|
3602
|
+
response,
|
|
3603
|
+
responseSchema: ns,
|
|
3604
|
+
initialResponseContainer: dataObject
|
|
3605
|
+
});
|
|
3606
|
+
} else {
|
|
3607
|
+
const bytes = await collectBody(response.body, context);
|
|
3608
|
+
if (bytes.byteLength > 0) {
|
|
3609
|
+
Object.assign(dataObject, await deserializer.read(ns, bytes));
|
|
3610
|
+
}
|
|
3611
|
+
}
|
|
3612
|
+
dataObject.$metadata = this.deserializeMetadata(response);
|
|
3613
|
+
return dataObject;
|
|
3614
|
+
}
|
|
3615
|
+
}
|
|
3616
|
+
var resolvedPath = (resolvedPath2, input, memberName, labelValueProvider, uriLabel, isGreedyLabel) => {
|
|
3617
|
+
if (input != null && input[memberName] !== undefined) {
|
|
3618
|
+
const labelValue = labelValueProvider();
|
|
3619
|
+
if (labelValue == null || labelValue.length <= 0) {
|
|
3620
|
+
throw new Error("Empty value provided for input HTTP label: " + memberName + ".");
|
|
3621
|
+
}
|
|
3622
|
+
resolvedPath2 = resolvedPath2.replace(uriLabel, isGreedyLabel ? labelValue.split("/").map((segment) => extendedEncodeURIComponent(segment)).join("/") : extendedEncodeURIComponent(labelValue));
|
|
3623
|
+
} else {
|
|
3624
|
+
throw new Error("No value provided for input HTTP label: " + memberName + ".");
|
|
3625
|
+
}
|
|
3626
|
+
return resolvedPath2;
|
|
3627
|
+
};
|
|
3628
|
+
function requestBuilder(input, context) {
|
|
3629
|
+
return new RequestBuilder(input, context);
|
|
3630
|
+
}
|
|
3631
|
+
|
|
3632
|
+
class RequestBuilder {
|
|
3633
|
+
input;
|
|
3634
|
+
context;
|
|
3635
|
+
query = {};
|
|
3636
|
+
method = "";
|
|
3637
|
+
headers = {};
|
|
3638
|
+
path = "";
|
|
3639
|
+
body = null;
|
|
3640
|
+
hostname = "";
|
|
3641
|
+
resolvePathStack = [];
|
|
3642
|
+
constructor(input, context) {
|
|
3643
|
+
this.input = input;
|
|
3644
|
+
this.context = context;
|
|
3645
|
+
}
|
|
3646
|
+
async build() {
|
|
3647
|
+
const { hostname, protocol = "https", port, path: basePath } = await this.context.endpoint();
|
|
3648
|
+
this.path = basePath;
|
|
3649
|
+
for (const resolvePath of this.resolvePathStack) {
|
|
3650
|
+
resolvePath(this.path);
|
|
3651
|
+
}
|
|
3652
|
+
return new protocolHttp.HttpRequest({
|
|
3653
|
+
protocol,
|
|
3654
|
+
hostname: this.hostname || hostname,
|
|
3655
|
+
port,
|
|
3656
|
+
method: this.method,
|
|
3657
|
+
path: this.path,
|
|
3658
|
+
query: this.query,
|
|
3659
|
+
body: this.body,
|
|
3660
|
+
headers: this.headers
|
|
3661
|
+
});
|
|
3662
|
+
}
|
|
3663
|
+
hn(hostname) {
|
|
3664
|
+
this.hostname = hostname;
|
|
3665
|
+
return this;
|
|
3666
|
+
}
|
|
3667
|
+
bp(uriLabel) {
|
|
3668
|
+
this.resolvePathStack.push((basePath) => {
|
|
3669
|
+
this.path = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + uriLabel;
|
|
3670
|
+
});
|
|
3671
|
+
return this;
|
|
3672
|
+
}
|
|
3673
|
+
p(memberName, labelValueProvider, uriLabel, isGreedyLabel) {
|
|
3674
|
+
this.resolvePathStack.push((path) => {
|
|
3675
|
+
this.path = resolvedPath(path, this.input, memberName, labelValueProvider, uriLabel, isGreedyLabel);
|
|
3676
|
+
});
|
|
3677
|
+
return this;
|
|
3678
|
+
}
|
|
3679
|
+
h(headers) {
|
|
3680
|
+
this.headers = headers;
|
|
3681
|
+
return this;
|
|
3682
|
+
}
|
|
3683
|
+
q(query) {
|
|
3684
|
+
this.query = query;
|
|
3685
|
+
return this;
|
|
3686
|
+
}
|
|
3687
|
+
b(body) {
|
|
3688
|
+
this.body = body;
|
|
3689
|
+
return this;
|
|
3690
|
+
}
|
|
3691
|
+
m(method) {
|
|
3692
|
+
this.method = method;
|
|
3693
|
+
return this;
|
|
3694
|
+
}
|
|
3695
|
+
}
|
|
3696
|
+
function determineTimestampFormat(ns, settings) {
|
|
3697
|
+
if (settings.timestampFormat.useTrait) {
|
|
3698
|
+
if (ns.isTimestampSchema() && (ns.getSchema() === 5 || ns.getSchema() === 6 || ns.getSchema() === 7)) {
|
|
3699
|
+
return ns.getSchema();
|
|
3700
|
+
}
|
|
3701
|
+
}
|
|
3702
|
+
const { httpLabel, httpPrefixHeaders, httpHeader, httpQuery } = ns.getMergedTraits();
|
|
3703
|
+
const bindingFormat = settings.httpBindings ? typeof httpPrefixHeaders === "string" || Boolean(httpHeader) ? 6 : Boolean(httpQuery) || Boolean(httpLabel) ? 5 : undefined : undefined;
|
|
3704
|
+
return bindingFormat ?? settings.timestampFormat.default;
|
|
3705
|
+
}
|
|
3706
|
+
|
|
3707
|
+
class FromStringShapeDeserializer extends SerdeContext {
|
|
3708
|
+
settings;
|
|
3709
|
+
constructor(settings) {
|
|
3710
|
+
super();
|
|
3711
|
+
this.settings = settings;
|
|
3712
|
+
}
|
|
3713
|
+
read(_schema, data) {
|
|
3714
|
+
const ns = schema.NormalizedSchema.of(_schema);
|
|
3715
|
+
if (ns.isListSchema()) {
|
|
3716
|
+
return serde.splitHeader(data).map((item) => this.read(ns.getValueSchema(), item));
|
|
3717
|
+
}
|
|
3718
|
+
if (ns.isBlobSchema()) {
|
|
3719
|
+
return (this.serdeContext?.base64Decoder ?? utilBase64.fromBase64)(data);
|
|
3720
|
+
}
|
|
3721
|
+
if (ns.isTimestampSchema()) {
|
|
3722
|
+
const format = determineTimestampFormat(ns, this.settings);
|
|
3723
|
+
switch (format) {
|
|
3724
|
+
case 5:
|
|
3725
|
+
return serde._parseRfc3339DateTimeWithOffset(data);
|
|
3726
|
+
case 6:
|
|
3727
|
+
return serde._parseRfc7231DateTime(data);
|
|
3728
|
+
case 7:
|
|
3729
|
+
return serde._parseEpochTimestamp(data);
|
|
3730
|
+
default:
|
|
3731
|
+
console.warn("Missing timestamp format, parsing value with Date constructor:", data);
|
|
3732
|
+
return new Date(data);
|
|
3733
|
+
}
|
|
3734
|
+
}
|
|
3735
|
+
if (ns.isStringSchema()) {
|
|
3736
|
+
const mediaType = ns.getMergedTraits().mediaType;
|
|
3737
|
+
let intermediateValue = data;
|
|
3738
|
+
if (mediaType) {
|
|
3739
|
+
if (ns.getMergedTraits().httpHeader) {
|
|
3740
|
+
intermediateValue = this.base64ToUtf8(intermediateValue);
|
|
3741
|
+
}
|
|
3742
|
+
const isJson = mediaType === "application/json" || mediaType.endsWith("+json");
|
|
3743
|
+
if (isJson) {
|
|
3744
|
+
intermediateValue = serde.LazyJsonString.from(intermediateValue);
|
|
3745
|
+
}
|
|
3746
|
+
return intermediateValue;
|
|
3747
|
+
}
|
|
3748
|
+
}
|
|
3749
|
+
if (ns.isNumericSchema()) {
|
|
3750
|
+
return Number(data);
|
|
3751
|
+
}
|
|
3752
|
+
if (ns.isBigIntegerSchema()) {
|
|
3753
|
+
return BigInt(data);
|
|
3754
|
+
}
|
|
3755
|
+
if (ns.isBigDecimalSchema()) {
|
|
3756
|
+
return new serde.NumericValue(data, "bigDecimal");
|
|
3757
|
+
}
|
|
3758
|
+
if (ns.isBooleanSchema()) {
|
|
3759
|
+
return String(data).toLowerCase() === "true";
|
|
3760
|
+
}
|
|
3761
|
+
return data;
|
|
3762
|
+
}
|
|
3763
|
+
base64ToUtf8(base64String) {
|
|
3764
|
+
return (this.serdeContext?.utf8Encoder ?? utilUtf8.toUtf8)((this.serdeContext?.base64Decoder ?? utilBase64.fromBase64)(base64String));
|
|
3765
|
+
}
|
|
3766
|
+
}
|
|
3767
|
+
|
|
3768
|
+
class HttpInterceptingShapeDeserializer extends SerdeContext {
|
|
3769
|
+
codecDeserializer;
|
|
3770
|
+
stringDeserializer;
|
|
3771
|
+
constructor(codecDeserializer, codecSettings) {
|
|
3772
|
+
super();
|
|
3773
|
+
this.codecDeserializer = codecDeserializer;
|
|
3774
|
+
this.stringDeserializer = new FromStringShapeDeserializer(codecSettings);
|
|
3775
|
+
}
|
|
3776
|
+
setSerdeContext(serdeContext) {
|
|
3777
|
+
this.stringDeserializer.setSerdeContext(serdeContext);
|
|
3778
|
+
this.codecDeserializer.setSerdeContext(serdeContext);
|
|
3779
|
+
this.serdeContext = serdeContext;
|
|
3780
|
+
}
|
|
3781
|
+
read(schema$1, data) {
|
|
3782
|
+
const ns = schema.NormalizedSchema.of(schema$1);
|
|
3783
|
+
const traits = ns.getMergedTraits();
|
|
3784
|
+
const toString = this.serdeContext?.utf8Encoder ?? utilUtf8.toUtf8;
|
|
3785
|
+
if (traits.httpHeader || traits.httpResponseCode) {
|
|
3786
|
+
return this.stringDeserializer.read(ns, toString(data));
|
|
3787
|
+
}
|
|
3788
|
+
if (traits.httpPayload) {
|
|
3789
|
+
if (ns.isBlobSchema()) {
|
|
3790
|
+
const toBytes = this.serdeContext?.utf8Decoder ?? utilUtf8.fromUtf8;
|
|
3791
|
+
if (typeof data === "string") {
|
|
3792
|
+
return toBytes(data);
|
|
3793
|
+
}
|
|
3794
|
+
return data;
|
|
3795
|
+
} else if (ns.isStringSchema()) {
|
|
3796
|
+
if ("byteLength" in data) {
|
|
3797
|
+
return toString(data);
|
|
3798
|
+
}
|
|
3799
|
+
return data;
|
|
3800
|
+
}
|
|
3801
|
+
}
|
|
3802
|
+
return this.codecDeserializer.read(ns, data);
|
|
3803
|
+
}
|
|
3804
|
+
}
|
|
3805
|
+
|
|
3806
|
+
class ToStringShapeSerializer extends SerdeContext {
|
|
3807
|
+
settings;
|
|
3808
|
+
stringBuffer = "";
|
|
3809
|
+
constructor(settings) {
|
|
3810
|
+
super();
|
|
3811
|
+
this.settings = settings;
|
|
3812
|
+
}
|
|
3813
|
+
write(schema$1, value) {
|
|
3814
|
+
const ns = schema.NormalizedSchema.of(schema$1);
|
|
3815
|
+
switch (typeof value) {
|
|
3816
|
+
case "object":
|
|
3817
|
+
if (value === null) {
|
|
3818
|
+
this.stringBuffer = "null";
|
|
3819
|
+
return;
|
|
3820
|
+
}
|
|
3821
|
+
if (ns.isTimestampSchema()) {
|
|
3822
|
+
if (!(value instanceof Date)) {
|
|
3823
|
+
throw new Error(`@smithy/core/protocols - received non-Date value ${value} when schema expected Date in ${ns.getName(true)}`);
|
|
3824
|
+
}
|
|
3825
|
+
const format = determineTimestampFormat(ns, this.settings);
|
|
3826
|
+
switch (format) {
|
|
3827
|
+
case 5:
|
|
3828
|
+
this.stringBuffer = value.toISOString().replace(".000Z", "Z");
|
|
3829
|
+
break;
|
|
3830
|
+
case 6:
|
|
3831
|
+
this.stringBuffer = serde.dateToUtcString(value);
|
|
3832
|
+
break;
|
|
3833
|
+
case 7:
|
|
3834
|
+
this.stringBuffer = String(value.getTime() / 1000);
|
|
3835
|
+
break;
|
|
3836
|
+
default:
|
|
3837
|
+
console.warn("Missing timestamp format, using epoch seconds", value);
|
|
3838
|
+
this.stringBuffer = String(value.getTime() / 1000);
|
|
3839
|
+
}
|
|
3840
|
+
return;
|
|
3841
|
+
}
|
|
3842
|
+
if (ns.isBlobSchema() && "byteLength" in value) {
|
|
3843
|
+
this.stringBuffer = (this.serdeContext?.base64Encoder ?? utilBase64.toBase64)(value);
|
|
3844
|
+
return;
|
|
3845
|
+
}
|
|
3846
|
+
if (ns.isListSchema() && Array.isArray(value)) {
|
|
3847
|
+
let buffer = "";
|
|
3848
|
+
for (const item of value) {
|
|
3849
|
+
this.write([ns.getValueSchema(), ns.getMergedTraits()], item);
|
|
3850
|
+
const headerItem = this.flush();
|
|
3851
|
+
const serialized = ns.getValueSchema().isTimestampSchema() ? headerItem : serde.quoteHeader(headerItem);
|
|
3852
|
+
if (buffer !== "") {
|
|
3853
|
+
buffer += ", ";
|
|
3854
|
+
}
|
|
3855
|
+
buffer += serialized;
|
|
3856
|
+
}
|
|
3857
|
+
this.stringBuffer = buffer;
|
|
3858
|
+
return;
|
|
3859
|
+
}
|
|
3860
|
+
this.stringBuffer = JSON.stringify(value, null, 2);
|
|
3861
|
+
break;
|
|
3862
|
+
case "string":
|
|
3863
|
+
const mediaType = ns.getMergedTraits().mediaType;
|
|
3864
|
+
let intermediateValue = value;
|
|
3865
|
+
if (mediaType) {
|
|
3866
|
+
const isJson = mediaType === "application/json" || mediaType.endsWith("+json");
|
|
3867
|
+
if (isJson) {
|
|
3868
|
+
intermediateValue = serde.LazyJsonString.from(intermediateValue);
|
|
3869
|
+
}
|
|
3870
|
+
if (ns.getMergedTraits().httpHeader) {
|
|
3871
|
+
this.stringBuffer = (this.serdeContext?.base64Encoder ?? utilBase64.toBase64)(intermediateValue.toString());
|
|
3872
|
+
return;
|
|
3873
|
+
}
|
|
3874
|
+
}
|
|
3875
|
+
this.stringBuffer = value;
|
|
3876
|
+
break;
|
|
3877
|
+
default:
|
|
3878
|
+
if (ns.isIdempotencyToken()) {
|
|
3879
|
+
this.stringBuffer = serde.generateIdempotencyToken();
|
|
3880
|
+
} else {
|
|
3881
|
+
this.stringBuffer = String(value);
|
|
3882
|
+
}
|
|
3883
|
+
}
|
|
3884
|
+
}
|
|
3885
|
+
flush() {
|
|
3886
|
+
const buffer = this.stringBuffer;
|
|
3887
|
+
this.stringBuffer = "";
|
|
3888
|
+
return buffer;
|
|
3889
|
+
}
|
|
3890
|
+
}
|
|
3891
|
+
|
|
3892
|
+
class HttpInterceptingShapeSerializer {
|
|
3893
|
+
codecSerializer;
|
|
3894
|
+
stringSerializer;
|
|
3895
|
+
buffer;
|
|
3896
|
+
constructor(codecSerializer, codecSettings, stringSerializer = new ToStringShapeSerializer(codecSettings)) {
|
|
3897
|
+
this.codecSerializer = codecSerializer;
|
|
3898
|
+
this.stringSerializer = stringSerializer;
|
|
3899
|
+
}
|
|
3900
|
+
setSerdeContext(serdeContext) {
|
|
3901
|
+
this.codecSerializer.setSerdeContext(serdeContext);
|
|
3902
|
+
this.stringSerializer.setSerdeContext(serdeContext);
|
|
3903
|
+
}
|
|
3904
|
+
write(schema$1, value) {
|
|
3905
|
+
const ns = schema.NormalizedSchema.of(schema$1);
|
|
3906
|
+
const traits = ns.getMergedTraits();
|
|
3907
|
+
if (traits.httpHeader || traits.httpLabel || traits.httpQuery) {
|
|
3908
|
+
this.stringSerializer.write(ns, value);
|
|
3909
|
+
this.buffer = this.stringSerializer.flush();
|
|
3910
|
+
return;
|
|
3911
|
+
}
|
|
3912
|
+
return this.codecSerializer.write(ns, value);
|
|
3913
|
+
}
|
|
3914
|
+
flush() {
|
|
3915
|
+
if (this.buffer !== undefined) {
|
|
3916
|
+
const buffer = this.buffer;
|
|
3917
|
+
this.buffer = undefined;
|
|
3918
|
+
return buffer;
|
|
3919
|
+
}
|
|
3920
|
+
return this.codecSerializer.flush();
|
|
3921
|
+
}
|
|
3922
|
+
}
|
|
3923
|
+
exports.FromStringShapeDeserializer = FromStringShapeDeserializer;
|
|
3924
|
+
exports.HttpBindingProtocol = HttpBindingProtocol;
|
|
3925
|
+
exports.HttpInterceptingShapeDeserializer = HttpInterceptingShapeDeserializer;
|
|
3926
|
+
exports.HttpInterceptingShapeSerializer = HttpInterceptingShapeSerializer;
|
|
3927
|
+
exports.HttpProtocol = HttpProtocol;
|
|
3928
|
+
exports.RequestBuilder = RequestBuilder;
|
|
3929
|
+
exports.RpcProtocol = RpcProtocol;
|
|
3930
|
+
exports.SerdeContext = SerdeContext;
|
|
3931
|
+
exports.ToStringShapeSerializer = ToStringShapeSerializer;
|
|
3932
|
+
exports.collectBody = collectBody;
|
|
3933
|
+
exports.determineTimestampFormat = determineTimestampFormat;
|
|
3934
|
+
exports.extendedEncodeURIComponent = extendedEncodeURIComponent;
|
|
3935
|
+
exports.requestBuilder = requestBuilder;
|
|
3936
|
+
exports.resolvedPath = resolvedPath;
|
|
3937
|
+
});
|
|
3938
|
+
|
|
3939
|
+
export { require_dist_cjs9 as require_dist_cjs, require_dist_cjs10 as require_dist_cjs1, require_dist_cjs11 as require_dist_cjs2, require_dist_cjs12 as require_dist_cjs3, require_dist_cjs8 as require_dist_cjs4, require_endpoints, require_schema, require_tslib, require_dist_cjs13 as require_dist_cjs5, require_serde, require_protocols };
|