@poe-platform/safe-bash 0.1.816 → 0.1.818
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/image-ast/index.js +2 -2
- package/dist/mp4-ast/index.d.ts +2 -1
- package/dist/mp4-ast/mp4-metadata-source.d.ts +10 -0
- package/dist/mp4-ast/mp4-packets-source.d.ts +8 -1
- package/dist/mp4-ast/types.d.ts +21 -3
- package/dist/pdf-ast/ast.d.ts +2 -0
- package/dist/pdf-ast/content/evaluator.d.ts +11 -0
- package/dist/pdf-ast/content/retained-evaluator.d.ts +2 -2
- package/dist/pdf-ast/content/retained-page.d.ts +2 -2
- package/dist/pdf-ast/cos/value-parser.d.ts +2 -0
- package/dist/pdf-ast/extract/html-text-stream.d.ts +14 -0
- package/dist/pdf-ast/extract/logical-text-stream.d.ts +14 -0
- package/dist/pdf-ast/extract/raw-text-index.d.ts +18 -4
- package/dist/pdf-ast/extract/retained-color.d.ts +6 -6
- package/dist/pdf-ast/extract/retained-decoded-image.d.ts +2 -2
- package/dist/pdf-ast/extract/stored-text-glyphs.d.ts +8 -0
- package/dist/pdf-ast/fonts/resolve.d.ts +5 -1
- package/dist/pdf-ast/fonts/retained.d.ts +2 -2
- package/dist/pdf-ast/image.d.ts +2 -0
- package/dist/pdf-ast/image.js +19 -0
- package/dist/pdf-ast/index.d.ts +3 -0
- package/dist/pdf-ast/index.js +264 -66845
- package/dist/pdf-ast/render/postscript.d.ts +6 -0
- package/dist/pdf-ast/render/raster.d.ts +21 -1
- package/dist/pdf-ast/retained-document.d.ts +16 -95
- package/dist/pdf-ast/retained-reader.d.ts +109 -0
- package/dist/safe-bash/command-chunks/biff-AYJZR2YV-JPESBEOO.js +5741 -0
- package/dist/safe-bash/command-chunks/{chunk-SL4LD25A.js → chunk-232N24HE.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-ALD53QFL.js → chunk-2C4QMQQD.js} +42 -12
- package/dist/safe-bash/command-chunks/{chunk-3PM46VWH.js → chunk-2FEMMALH.js} +4 -4
- package/dist/safe-bash/command-chunks/chunk-2J4OQT3F.js +153 -0
- package/dist/safe-bash/command-chunks/{chunk-QDV2NIFR.js → chunk-2TMTGVJR.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-ARE267HR.js → chunk-2WTDP3TP.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-GEDO5V32.js → chunk-2XR7B6DY.js} +602 -211
- package/dist/safe-bash/command-chunks/{chunk-EY3UE26F.js → chunk-2YC6MWQB.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-UPWLHHZ2.js → chunk-37KBCKDF.js} +13 -13
- package/dist/safe-bash/command-chunks/{chunk-DOVWHVHI.js → chunk-3B6554G6.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-FB2WPI3M.js → chunk-3ZGO24WG.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-GR4ONCQ5.js → chunk-424NYO35.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-MQE77MEQ.js → chunk-45GTHPL5.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-AF2IO57Q.js → chunk-4OHTYYNU.js} +8 -136
- package/dist/safe-bash/command-chunks/{chunk-ICJH6A73.js → chunk-4PMMJ45F.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-57PK2QFX.js → chunk-4SFX6YGC.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-G3LUT475.js → chunk-4WHTTCKY.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-DBZCTL7C.js → chunk-4Z7PBIMP.js} +20 -18
- package/dist/safe-bash/command-chunks/{chunk-A4P37F3P.js → chunk-57SKL76U.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-J6FNSVHT.js → chunk-5GP4A3TD.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-OFONWWEZ.js → chunk-5IHJWBDR.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-A2L3U7DW.js → chunk-5OS4Q3AX.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-FUYZUETI.js → chunk-5PMLTSQ5.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-TXU7MMHN.js → chunk-5RDS6CNQ.js} +13 -13
- package/dist/safe-bash/command-chunks/{chunk-FR63MJSO.js → chunk-5UGQGB5Y.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-UKAGRRLZ.js → chunk-5VY5O37W.js} +1 -1
- package/dist/safe-bash/command-chunks/chunk-5WS6DXYE.js +68444 -0
- package/dist/safe-bash/command-chunks/{chunk-2ALHVXEM.js → chunk-6EK76ERE.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-4772DJKS.js → chunk-6GCK2KSL.js} +61 -26
- package/dist/safe-bash/command-chunks/{chunk-T5OQ53XS.js → chunk-6IID5HTY.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-EZDWPTYB.js → chunk-6LOAJOWK.js} +13 -13
- package/dist/safe-bash/command-chunks/{chunk-WMBELKPP.js → chunk-6PE2L522.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-ZAYTFXUX.js → chunk-73KY3MZ3.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-BOVDUJ3A.js → chunk-77WBFVZQ.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-3DWFXESW.js → chunk-7GJJDM2F.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-WIW3KDBS.js → chunk-7NFICYRU.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-35DU6I2M.js → chunk-7ZEGARPB.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-A5SPMSKD.js → chunk-A32PUWYE.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-KYIGYYEY.js → chunk-A32ZROH5.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-IOXMGD2H.js → chunk-ADVQZLLE.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-CGJ7GMHO.js → chunk-AEZU6NZE.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-KDDXLHN7.js → chunk-ATHU53C2.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-R7LF4XQV.js → chunk-B6T2526I.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-PPN53PX3.js → chunk-BB7HBO56.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-ZM7HMBAJ.js → chunk-BDGNKRY4.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-VMZIAFVJ.js → chunk-BFRSYJUC.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-X42MJT2J.js → chunk-BJL7AGA5.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-VZTVR3JI.js → chunk-C2QUG7IP.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-IVKAFEPO.js → chunk-C34RLMAC.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-5O45KGW5.js → chunk-C5VUJOUQ.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-LQDANF2B.js → chunk-CCNOZKAK.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-FEBTT5NH.js → chunk-CEHICGP6.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-SICTBSLW.js → chunk-CODJMTSA.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-LJ3UYESS.js → chunk-CP5EO5TT.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-45DKGZYO.js → chunk-CSS5KXQC.js} +329 -152
- package/dist/safe-bash/command-chunks/{chunk-6RLWPB44.js → chunk-CZSLXQU2.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-3ZWFE4CK.js → chunk-D2ZT2UUT.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-WH624PKJ.js → chunk-D5XSGHXN.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-NDALIHKK.js → chunk-D7UFAIBS.js} +18 -18
- package/dist/safe-bash/command-chunks/{chunk-ISFGPCED.js → chunk-DCKAY6HV.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-LNAZ3E4Q.js → chunk-DGCJVZW6.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-LFSWLJPR.js → chunk-DJB5RB6U.js} +288 -32
- package/dist/safe-bash/command-chunks/{chunk-FGHSE3RZ.js → chunk-DZ4ELL34.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-LQX7RAF7.js → chunk-EBKKYRQJ.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-QNETPOMH.js → chunk-EDBNI7WE.js} +14 -14
- package/dist/safe-bash/command-chunks/{chunk-5GDF5FAS.js → chunk-EEJ3YXVO.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-RTHYAGKI.js → chunk-ETN25WCR.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-ET6LMDEX.js → chunk-EV3DPRWE.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-3MUFXGA2.js → chunk-F2JUB7JI.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-345YBIHP.js → chunk-F42WV2YO.js} +19 -19
- package/dist/safe-bash/command-chunks/{chunk-FTZFCMVI.js → chunk-FAVWWMFW.js} +12 -12
- package/dist/safe-bash/command-chunks/{chunk-XBWD6SI3.js → chunk-FDRE535F.js} +16 -16
- package/dist/safe-bash/command-chunks/{chunk-WMV5224N.js → chunk-FILE5PBI.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-XPQUUFQD.js → chunk-FPOM47UA.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-QMBMZSJF.js → chunk-FQ2WRT4Q.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-H56BSMFQ.js → chunk-FVAFISPY.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-2QZUAZTH.js → chunk-GIQUIF6E.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-2TWXRJPB.js → chunk-GNORF6RY.js} +13 -13
- package/dist/safe-bash/command-chunks/{chunk-K7VDCBXW.js → chunk-GPLN6JV2.js} +24 -24
- package/dist/safe-bash/command-chunks/{chunk-DZOKH5BL.js → chunk-GQ7BD75U.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-N4HWOLGZ.js → chunk-GY2C555A.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-N32AP43V.js → chunk-GZNX5SS4.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-YPG55QTP.js → chunk-HCJWEB6P.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-4ABR3KGK.js → chunk-HNY7LZ5P.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-P462JTNT.js → chunk-HOBXZX23.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-5KZMR6AJ.js → chunk-HW3IOXT6.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-3VGQTLO6.js → chunk-HX7QQNWS.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-TXWDR2P4.js → chunk-IBT3OWXB.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-OHEZQ4QA.js → chunk-IFBLXBBM.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-HOJ7WDTS.js → chunk-IJZUUXLL.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-BZRWZ6GO.js → chunk-IKU7ZBF3.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-CKIXC7AO.js → chunk-IPKYPADE.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-IWVANZWH.js → chunk-JLPBGKVC.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-6M3JTPKE.js → chunk-JNRX5EFF.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-5YL453ZF.js → chunk-JSX5CFZY.js} +36 -36
- package/dist/safe-bash/command-chunks/{chunk-V6JPIZUW.js → chunk-JT656DKZ.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-DM5WURQL.js → chunk-JY2T3KV2.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-IZ3SD5S2.js → chunk-K2NV6H7E.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-62RG3GHF.js → chunk-K6E56LND.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-FLSXHLJG.js → chunk-KADQKXZE.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-URQSUMMJ.js → chunk-KFFV7HBL.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-ONQP4FNV.js → chunk-KZICRCQ7.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-N35IJXBK.js → chunk-L6X4EEN6.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-SHLT5R64.js → chunk-LF7YJ5VQ.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-GMBUOYTN.js → chunk-LNHTLWIL.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-A6OTPNNI.js → chunk-LPKMNCC5.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-MUTARE5I.js → chunk-LSKA4IR4.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-N3ZH4YYH.js → chunk-LTWX23FS.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-JA36YOZI.js → chunk-LUJUYUOG.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-4X2MPZXW.js → chunk-M42GCI5F.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-AYQPJQJR.js → chunk-M5BFAMXD.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-OFDJJRAD.js → chunk-M7DZ7COK.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-RINR7XPR.js → chunk-MMSKDYK6.js} +234 -8
- package/dist/safe-bash/command-chunks/{chunk-NKK76B4V.js → chunk-MN7EEK6Y.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-OBIXFO25.js → chunk-MOJQT6RW.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-HOKPYTHQ.js → chunk-MPRUGL4W.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-CORUUCS2.js → chunk-MRBX4KEP.js} +3 -3
- package/dist/safe-bash/command-chunks/chunk-MTWFSBNG.js +137 -0
- package/dist/safe-bash/command-chunks/{chunk-RRAQII52.js → chunk-MURNTGDL.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-KDBU5Q2N.js → chunk-MWVELMXZ.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-PRO7JOIH.js → chunk-N3MAYM6Y.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-E22EAYJN.js → chunk-NFWLZDMY.js} +177 -34
- package/dist/safe-bash/command-chunks/{chunk-GAROGIVU.js → chunk-NP2QXF2X.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-SNA2LVBX.js → chunk-NPVOYY2A.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-ENMJHB2C.js → chunk-NTXRKJPZ.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-3K5CVXUV.js → chunk-NZF56C25.js} +10 -10
- package/dist/safe-bash/command-chunks/{chunk-5MNQTHED.js → chunk-OA4MEWTN.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-SWIF6BBY.js → chunk-OL75SBZL.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-LT2YCGC5.js → chunk-OVQSILY3.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-WDVPHDBH.js → chunk-P57V45F2.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-OWCBX5M2.js → chunk-PAY4ULWY.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-CHZE6FNT.js → chunk-PFUZPAXQ.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-NLCUQD7Y.js → chunk-PX6E5MHY.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-POGVOCOB.js → chunk-QCN7MRRU.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-ZZERSKAR.js → chunk-QLE6JUR7.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-LZY46GYY.js → chunk-QMWBKR4C.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-BIJW6QWB.js → chunk-QNLX3CZH.js} +13 -13
- package/dist/safe-bash/command-chunks/{chunk-MDFNUNK5.js → chunk-QWX5IERU.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-WOL3LBXE.js → chunk-R2N3E267.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-ZNCPIZCN.js → chunk-R6X63VAO.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-FGARVKAX.js → chunk-RNIFPFGC.js} +13 -11
- package/dist/safe-bash/command-chunks/{chunk-OIHQXURE.js → chunk-ROE6KD4C.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-BKK4MS3V.js → chunk-RR6XG2I6.js} +1 -1
- package/dist/safe-bash/command-chunks/chunk-RYOHOS2I.js +398 -0
- package/dist/safe-bash/command-chunks/{chunk-4QEJPP3K.js → chunk-S5X7PBO4.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-IHLZ6HNQ.js → chunk-TSKJNCKD.js} +3 -2
- package/dist/safe-bash/command-chunks/{chunk-U42WHQRH.js → chunk-TTTNFKT6.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-EWC56JNI.js → chunk-TTVJJZOM.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-TY7JXEWI.js → chunk-UBX5I5HY.js} +11 -11
- package/dist/safe-bash/command-chunks/{chunk-QOKFSYD5.js → chunk-UE34SQET.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-DXOXUKQB.js → chunk-UH4CQIU3.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-VNNNVT4C.js → chunk-UZZ2WJQV.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-QNX5LZBK.js → chunk-V6NZVM7C.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-KLAC2MIZ.js → chunk-VEZULAIA.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-OCV5ZU35.js → chunk-VSTAHYCV.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-UFLMOU3B.js → chunk-VUJCVXD4.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-5V7WIQ2D.js → chunk-VW67MA53.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-B2C3UPJS.js → chunk-W42SUPD6.js} +13 -1
- package/dist/safe-bash/command-chunks/{chunk-2IMIKROX.js → chunk-WI5NEHPD.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-SBXS4S6Y.js → chunk-WJSU2UVG.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-VVWHFNHD.js → chunk-WPEIOUJN.js} +415 -25
- package/dist/safe-bash/command-chunks/{chunk-YKODRSGT.js → chunk-WRCYZJNO.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-TID5TSQW.js → chunk-WRJV7OVO.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-T4SEQU66.js → chunk-X4TWJNW7.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-CKA7ZROU.js → chunk-X6KFCAWZ.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-ROQ3VNVX.js → chunk-X6KO7D6R.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-S5ER73EA.js → chunk-XB5ZZHFD.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-FHQOFEQK.js → chunk-XLFOLLUZ.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-UJYXSLM6.js → chunk-XLPEPCQC.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-UT5X6QRU.js → chunk-XQFEP43Y.js} +5 -5
- package/dist/safe-bash/command-chunks/chunk-Y7XL6CWB.js +771 -0
- package/dist/safe-bash/command-chunks/{chunk-RVWIEXR7.js → chunk-YKEMSPJZ.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-ERWIJYCS.js → chunk-YN3OEJAZ.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-6YF2QADH.js → chunk-YOYK2I4N.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-26JE5JEB.js → chunk-YS5ZKMRJ.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-LMLBQSAM.js → chunk-YW7WU7W2.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-YXR4JE4U.js → chunk-Z33YS3DW.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-T2FRXSQT.js → chunk-ZBXUAM34.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-VVV45NLY.js → chunk-ZJUU5IAS.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-7OCTMVYJ.js → chunk-ZNABMTV3.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-6JGICYHP.js → chunk-ZSF2T5D4.js} +1 -1
- package/dist/safe-bash/command-chunks/{command-engine-GHE6QUHU.js → command-engine-PFYHL7GS.js} +14 -4
- package/dist/safe-bash/command-chunks/{engine-RG6HQCCB-FXYZS264.js → engine-5AVSKFBI-D7Q5VPUN.js} +1 -1
- package/dist/safe-bash/command-chunks/model-store-IIWQHSEZ.js +54 -0
- package/dist/safe-bash/command-chunks/odf-SL5TG4B3-XI3FNOTN.js +3041 -0
- package/dist/safe-bash/command-chunks/{xlsx-RE54MFCS-IQ6OXXKK.js → xlsx-RE54MFCS-4UZ5W3U7.js} +1 -1
- package/dist/safe-bash-command-apply-patch/apply.js +1 -1
- package/dist/safe-bash-command-apply-patch/index.js +1 -1
- package/dist/safe-bash-command-awk/awk-inspection.js +2 -2
- package/dist/safe-bash-command-awk/awk.js +5 -5
- package/dist/safe-bash-command-awk/index.js +5 -5
- package/dist/safe-bash-command-cp/index.js +4 -4
- package/dist/safe-bash-command-csvkit/index.js +1 -1
- package/dist/safe-bash-command-diff/diff.js +2 -2
- package/dist/safe-bash-command-diff/index.js +2 -2
- package/dist/safe-bash-command-ffmpeg/index.js +1 -1
- package/dist/safe-bash-command-ffprobe/index.js +2 -2
- package/dist/safe-bash-command-ffprobe/media.js +2 -2
- package/dist/safe-bash-command-node/commands/node/browser.js +6 -6
- package/dist/safe-bash-command-node/commands/node/default-runtime.js +6 -6
- package/dist/safe-bash-command-node/commands/node/filesystem.js +2 -2
- package/dist/safe-bash-command-node/commands/node/safejs.js +6 -6
- package/dist/safe-bash-command-node/commands/node/timers.js +2 -2
- package/dist/safe-bash-command-patch/index.js +3 -3
- package/dist/safe-bash-command-patch/patch-formats.js +2 -2
- package/dist/safe-bash-command-patch/patch.js +3 -3
- package/dist/safe-bash-command-patch/unified.js +1 -1
- package/dist/safe-bash-command-pdftoppm/index.js +89 -124
- package/dist/safe-bash-command-pdftotext/index.d.ts +1 -1
- package/dist/safe-bash-command-pdftotext/index.js +538 -379
- package/dist/safe-bash-command-playwright-cli/index.js +19 -19
- package/dist/safe-bash-command-playwright-cli/playwright/abilities.js +6 -6
- package/dist/safe-bash-command-playwright-cli/playwright/adapter.js +3 -3
- package/dist/safe-bash-command-playwright-cli/playwright/controller.js +13 -13
- package/dist/safe-bash-command-playwright-cli/playwright/index.js +19 -19
- package/dist/safe-bash-command-playwright-cli/playwright/native-storage-replacement.js +2 -2
- package/dist/safe-bash-command-playwright-cli/playwright/open-options.js +2 -2
- package/dist/safe-bash-command-playwright-cli/playwright/profile.js +5 -5
- package/dist/safe-bash-command-playwright-cli/playwright/standard-capabilities.js +4 -4
- package/dist/safe-bash-command-playwright-cli/playwright/storage-capabilities.js +3 -3
- package/dist/safe-bash-command-pptx/engine.js +1 -1
- package/dist/safe-bash-command-python/executor.js +10 -10
- package/dist/safe-bash-command-python/index.js +10 -10
- package/dist/safe-bash-command-python/jspi.js +2 -2
- package/dist/safe-bash-command-safejs/index.js +2 -2
- package/dist/safe-bash-command-safejs/runtime.js +2 -2
- package/dist/safe-bash-command-ssconvert/index.js +16 -16
- package/dist/safe-bash-command-unzip/index.js +4 -4
- package/dist/safe-bash-docx-engine/ancillary-resources.js +10 -10
- package/dist/safe-bash-docx-engine/batch-operations.js +67 -67
- package/dist/safe-bash-docx-engine/batch-result-schema.js +79 -79
- package/dist/safe-bash-docx-engine/batch.js +78 -78
- package/dist/safe-bash-docx-engine/bookmarks.js +18 -18
- package/dist/safe-bash-docx-engine/charts.js +11 -11
- package/dist/safe-bash-docx-engine/command-option-rules.js +6 -6
- package/dist/safe-bash-docx-engine/command-properties.js +3 -3
- package/dist/safe-bash-docx-engine/comments.js +26 -26
- package/dist/safe-bash-docx-engine/control-bindings.js +21 -21
- package/dist/safe-bash-docx-engine/control-repeat.js +21 -21
- package/dist/safe-bash-docx-engine/controls.js +19 -19
- package/dist/safe-bash-docx-engine/create.js +11 -11
- package/dist/safe-bash-docx-engine/diagrams.js +11 -11
- package/dist/safe-bash-docx-engine/diff.js +13 -13
- package/dist/safe-bash-docx-engine/document-properties.js +16 -16
- package/dist/safe-bash-docx-engine/equations.js +17 -17
- package/dist/safe-bash-docx-engine/extract.js +14 -14
- package/dist/safe-bash-docx-engine/fields.js +23 -23
- package/dist/safe-bash-docx-engine/font-inventory.js +18 -18
- package/dist/safe-bash-docx-engine/font-resources.js +6 -6
- package/dist/safe-bash-docx-engine/image-batch-operations.js +14 -14
- package/dist/safe-bash-docx-engine/image-insertion.js +21 -21
- package/dist/safe-bash-docx-engine/image-layout.js +19 -19
- package/dist/safe-bash-docx-engine/image-replacement.js +22 -22
- package/dist/safe-bash-docx-engine/images.js +19 -19
- package/dist/safe-bash-docx-engine/index.js +111 -111
- package/dist/safe-bash-docx-engine/inspection.js +20 -20
- package/dist/safe-bash-docx-engine/invocation.js +9 -9
- package/dist/safe-bash-docx-engine/io.js +9 -9
- package/dist/safe-bash-docx-engine/links.js +21 -21
- package/dist/safe-bash-docx-engine/lists.js +20 -20
- package/dist/safe-bash-docx-engine/locations.js +15 -15
- package/dist/safe-bash-docx-engine/notes.js +22 -22
- package/dist/safe-bash-docx-engine/objects.js +19 -19
- package/dist/safe-bash-docx-engine/operation-json-schema.js +3 -3
- package/dist/safe-bash-docx-engine/operation-schema.js +2 -2
- package/dist/safe-bash-docx-engine/pack.js +14 -14
- package/dist/safe-bash-docx-engine/package-view-batch-operations.js +22 -22
- package/dist/safe-bash-docx-engine/pandoc-adapter.js +29 -29
- package/dist/safe-bash-docx-engine/paragraph-edit.js +25 -25
- package/dist/safe-bash-docx-engine/part-provider.js +3 -3
- package/dist/safe-bash-docx-engine/property-values.js +3 -3
- package/dist/safe-bash-docx-engine/publication.js +9 -9
- package/dist/safe-bash-docx-engine/removal.js +21 -21
- package/dist/safe-bash-docx-engine/revision-decisions.js +22 -22
- package/dist/safe-bash-docx-engine/revision-edit.js +20 -20
- package/dist/safe-bash-docx-engine/revisions.js +18 -18
- package/dist/safe-bash-docx-engine/run-format.js +20 -20
- package/dist/safe-bash-docx-engine/sanitize.js +34 -34
- package/dist/safe-bash-docx-engine/sections.js +19 -19
- package/dist/safe-bash-docx-engine/settings.js +11 -11
- package/dist/safe-bash-docx-engine/shape-edit.js +21 -21
- package/dist/safe-bash-docx-engine/signatures.js +15 -15
- package/dist/safe-bash-docx-engine/stories.js +22 -22
- package/dist/safe-bash-docx-engine/structure-model-batch-operations.js +38 -38
- package/dist/safe-bash-docx-engine/style-model-batch-operations.js +27 -27
- package/dist/safe-bash-docx-engine/style-model-result-schema.js +44 -44
- package/dist/safe-bash-docx-engine/styles.js +18 -18
- package/dist/safe-bash-docx-engine/table-edit.js +27 -27
- package/dist/safe-bash-docx-engine/table-read.js +16 -16
- package/dist/safe-bash-docx-engine/template.js +22 -22
- package/dist/safe-bash-docx-engine/text-replace.js +20 -20
- package/dist/safe-bash-docx-engine/text-resource-read.js +16 -16
- package/dist/safe-bash-docx-engine/text.js +16 -16
- package/dist/safe-bash-docx-engine/validation.js +7 -7
- package/dist/safe-bash-docx-engine/xml-parts.js +22 -22
- package/dist/safe-bash-network-engine/index.js +4 -4
- package/dist/safe-bash-network-engine/transfer.js +12 -12
- package/dist/safe-bash-presentation-engine/accessibility.js +15 -15
- package/dist/safe-bash-presentation-engine/animation-editing.js +5 -5
- package/dist/safe-bash-presentation-engine/animations.js +5 -5
- package/dist/safe-bash-presentation-engine/backgrounds.js +6 -6
- package/dist/safe-bash-presentation-engine/chart-editing.js +18 -18
- package/dist/safe-bash-presentation-engine/chart-object-operations.js +12 -12
- package/dist/safe-bash-presentation-engine/charts.js +15 -15
- package/dist/safe-bash-presentation-engine/command-placeholder.js +39 -38
- package/dist/safe-bash-presentation-engine/comments.js +6 -6
- package/dist/safe-bash-presentation-engine/connector-operations.js +16 -16
- package/dist/safe-bash-presentation-engine/connectors.js +13 -13
- package/dist/safe-bash-presentation-engine/diff.js +21 -20
- package/dist/safe-bash-presentation-engine/drawing-format.js +7 -7
- package/dist/safe-bash-presentation-engine/drawing-operations.js +15 -15
- package/dist/safe-bash-presentation-engine/drawing-schema.js +8 -8
- package/dist/safe-bash-presentation-engine/equations.js +6 -6
- package/dist/safe-bash-presentation-engine/fields.js +6 -6
- package/dist/safe-bash-presentation-engine/image-extraction.js +7 -7
- package/dist/safe-bash-presentation-engine/image-formatting.js +16 -16
- package/dist/safe-bash-presentation-engine/image-insertion.js +6 -6
- package/dist/safe-bash-presentation-engine/image-replacement.js +7 -7
- package/dist/safe-bash-presentation-engine/images.js +6 -6
- package/dist/safe-bash-presentation-engine/index.js +96 -95
- package/dist/safe-bash-presentation-engine/layouts.js +5 -5
- package/dist/safe-bash-presentation-engine/links.js +5 -5
- package/dist/safe-bash-presentation-engine/masters.js +4 -4
- package/dist/safe-bash-presentation-engine/media-editing.js +10 -10
- package/dist/safe-bash-presentation-engine/media-extraction.js +6 -6
- package/dist/safe-bash-presentation-engine/media.js +5 -5
- package/dist/safe-bash-presentation-engine/memberships.d.ts +1 -0
- package/dist/safe-bash-presentation-engine/memberships.js +12 -6
- package/dist/safe-bash-presentation-engine/notes.js +6 -6
- package/dist/safe-bash-presentation-engine/ole-insertion.js +6 -6
- package/dist/safe-bash-presentation-engine/opaque-objects.js +2 -2
- package/dist/safe-bash-presentation-engine/package-tools.js +6 -6
- package/dist/safe-bash-presentation-engine/presentation-model.js +38 -37
- package/dist/safe-bash-presentation-engine/presentation-settings.d.ts +1 -0
- package/dist/safe-bash-presentation-engine/presentation-settings.js +12 -5
- package/dist/safe-bash-presentation-engine/properties.js +7 -6
- package/dist/safe-bash-presentation-engine/retained-inspection.js +3 -3
- package/dist/safe-bash-presentation-engine/retained-memberships.d.ts +25 -0
- package/dist/safe-bash-presentation-engine/retained-presentation-settings.d.ts +25 -0
- package/dist/safe-bash-presentation-engine/retained-tags.d.ts +20 -0
- package/dist/safe-bash-presentation-engine/retained-text.d.ts +24 -4
- package/dist/safe-bash-presentation-engine/retained-text.js +17 -15
- package/dist/safe-bash-presentation-engine/sanitize.js +8 -7
- package/dist/safe-bash-presentation-engine/selectors.js +2 -2
- package/dist/safe-bash-presentation-engine/shape-groups.js +15 -15
- package/dist/safe-bash-presentation-engine/shape-operations.js +14 -14
- package/dist/safe-bash-presentation-engine/shape-path-operations.js +16 -16
- package/dist/safe-bash-presentation-engine/shape-paths.js +5 -5
- package/dist/safe-bash-presentation-engine/shape-selection.js +15 -15
- package/dist/safe-bash-presentation-engine/shape-transforms.js +5 -5
- package/dist/safe-bash-presentation-engine/shapes.js +11 -11
- package/dist/safe-bash-presentation-engine/slide-copy.js +7 -5
- package/dist/safe-bash-presentation-engine/slide-import.js +6 -6
- package/dist/safe-bash-presentation-engine/slide-merge-split.js +8 -8
- package/dist/safe-bash-presentation-engine/slide-model.js +24 -24
- package/dist/safe-bash-presentation-engine/slide-removal.js +7 -7
- package/dist/safe-bash-presentation-engine/slide-transfer-budget.js +2 -2
- package/dist/safe-bash-presentation-engine/slides.js +5 -5
- package/dist/safe-bash-presentation-engine/table-operations.js +17 -17
- package/dist/safe-bash-presentation-engine/table-spans.js +16 -16
- package/dist/safe-bash-presentation-engine/tables.js +15 -15
- package/dist/safe-bash-presentation-engine/tags.d.ts +2 -0
- package/dist/safe-bash-presentation-engine/tags.js +15 -7
- package/dist/safe-bash-presentation-engine/template-bindings.js +16 -16
- package/dist/safe-bash-presentation-engine/template-repeat.js +24 -22
- package/dist/safe-bash-presentation-engine/text-fitting.js +11 -11
- package/dist/safe-bash-presentation-engine/text-frames.js +11 -11
- package/dist/safe-bash-presentation-engine/text-paragraphs.js +11 -11
- package/dist/safe-bash-presentation-engine/text-reading.js +3 -3
- package/dist/safe-bash-presentation-engine/text-replacement.js +6 -6
- package/dist/safe-bash-presentation-engine/text-runs.js +8 -8
- package/dist/safe-bash-presentation-engine/themes.js +5 -5
- package/dist/safe-bash-presentation-engine/transitions.js +5 -5
- package/dist/safe-bash-presentation-engine/validation.js +2 -2
- package/dist/safe-bash-presentation-engine/xml-parts.js +5 -5
- package/dist/safe-bash-xml-engine/document.js +2 -2
- package/dist/safe-bash-xml-engine/index.js +2 -2
- package/dist/safe-bash-xml-engine/recovery.d.ts +6 -2
- package/dist/safe-bash-xml-engine/stored-document.d.ts +3 -0
- package/dist/safe-bash-xml-engine/stored-document.js +1 -1
- package/dist/safe-bash-xml-engine/stored-evaluate.js +2 -2
- package/dist/safe-bash-xml-engine/stored-map.d.ts +21 -0
- package/dist/safe-bash-zip-engine/index.js +3 -3
- package/dist/safe-bash-zip-engine/zip/repair.js +3 -3
- package/dist/safe-bash-zip-engine/zip/safety.js +1 -1
- package/dist/safe-bash-zip-engine/zip/sfx.js +3 -3
- package/dist/safe-bash-zip-engine/zip/volumes.js +1 -1
- package/dist/safe-bash-zip-engine/zip-format.js +3 -3
- package/dist/spreadsheet-engine/formatting/cell-text.js +1 -1
- package/dist/spreadsheet-engine/{rendering/print → formatting}/general-number.js +3 -3
- package/dist/spreadsheet-engine/formulas/functions/python-printf.js +9 -7
- package/dist/spreadsheet-engine/solver/program.js +3 -2
- package/dist/spreadsheet-engine/solver/run.js +8 -2
- package/dist/spreadsheet-engine/solver/sensitivity.d.ts +4 -2
- package/dist/spreadsheet-engine/solver/sensitivity.js +80 -42
- package/dist/spreadsheet-format-xls/biff-properties-merge.d.ts +2 -1
- package/dist/spreadsheet-format-xls/biff-properties-merge.js +36 -30
- package/dist/spreadsheet-format-xls/biff-properties-write.js +16 -7
- package/dist/spreadsheet-format-xls/biff-properties.d.ts +4 -2
- package/dist/spreadsheet-format-xls/biff-properties.js +141 -122
- package/dist/spreadsheet-format-xls/biff-property-names.d.ts +27 -0
- package/dist/spreadsheet-format-xls/biff-property-names.js +210 -0
- package/dist/spreadsheet-format-xls/biff-property-observations.d.ts +33 -0
- package/dist/spreadsheet-format-xls/biff-property-observations.js +160 -0
- package/dist/xlsx-ast/comment-geometry.js +1 -1
- package/package.json +7 -4
- package/third-party/pdf-ast/THIRD_PARTY_NOTICES.md +15 -0
- package/third-party/pdf-ast/licenses/PYTHON-PSF.txt +254 -0
- package/third-party/pdf-ast/licenses/V8-BSD.txt +61 -0
- package/dist/safe-bash/command-chunks/biff-UBP2BZLK-JPODPKS3.js +0 -5448
- package/dist/safe-bash/command-chunks/chunk-6EZWG56T.js +0 -455
- package/dist/safe-bash/command-chunks/chunk-O2HNOQQG.js +0 -161
- package/dist/safe-bash/command-chunks/chunk-ZUP5TBRG.js +0 -99
- package/dist/safe-bash/command-chunks/model-store-I7YAWL5V.js +0 -54
- package/dist/safe-bash/command-chunks/odf-3EA3EVSD-7B5GVNTC.js +0 -3097
- package/dist/safe-bash/command-chunks/{chunk-SRXARACJ.js → chunk-3TP4SSPS.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-NCNHJRIY.js → chunk-3W3HLPCX.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-P4OWVKMD.js → chunk-BQXKO3X7.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-OCOJMKDP.js → chunk-CVMHDJ7J.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-AV6N7DDA.js → chunk-DDYPQAXN.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-FEKECRJP.js → chunk-EBTKM7KX.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-WVD5WZXD.js → chunk-FPNUGKCX.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-6W4RMBFH.js → chunk-N6VNHC3B.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-M3OXQXCU.js → chunk-NBRXQUK7.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-LECGQSQW.js → chunk-SF56V6QK.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-2ANW3FXH.js → chunk-U33GIOUY.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-5QXRIZSS.js → chunk-V3NKL42J.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-OEKLEUUW.js → chunk-YZE7BKHC.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-WXW665TV.js → chunk-ZSHXZ3XG.js} +6 -6
- package/dist/safe-bash/command-chunks/{dif-BXKPQOCO-4KB3RC6G.js → dif-BXKPQOCO-FVJYYGYB.js} +4 -4
- package/dist/safe-bash/command-chunks/{pln-DFS7VLVS-OVOBS4QX.js → pln-DFS7VLVS-JATX6FS7.js} +3 -3
- package/dist/safe-bash/command-chunks/{psion-YBI6JEQI-GY4S6ZLC.js → psion-YBI6JEQI-6OMC2PGC.js} +3 -3
- package/dist/safe-bash/command-chunks/{sylk-25D7TL2Y-RU6ANKGT.js → sylk-25D7TL2Y-NJKBZZTF.js} +4 -4
- /package/dist/spreadsheet-engine/{rendering/print → formatting}/general-number.d.ts +0 -0
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { BiffPropertyNames } from "./biff-property-names.js";
|
|
1
2
|
import { propertyChunks, stagePropertyBytes } from "./biff-property-bytes.js";
|
|
2
3
|
import { SsconvertError } from "../spreadsheet-engine/contracts.js";
|
|
3
4
|
import { biffPropertyFields, biffPropertyFormats, isBiffKeywordSpace } from "./biff-properties.js";
|
|
@@ -6,7 +7,7 @@ const fieldByName = new Map([...biffPropertyFields].flatMap(([guid, fields]) =>
|
|
|
6
7
|
const maximumFileTime = 0xffffffffffffffffn;
|
|
7
8
|
/** Only discard a generic loss report when every XML field has been handled.
|
|
8
9
|
* Keep the original record on the caller's workbook, including unknown content. */
|
|
9
|
-
function handledPropertyRecord(record,
|
|
10
|
+
function handledPropertyRecord(record, properties, charge) {
|
|
10
11
|
if (record.disposition !== "retained" || record.source !== "Gnumeric_XmlIO:sax" || record.kind !== "document-meta")
|
|
11
12
|
return false;
|
|
12
13
|
const office = "urn:oasis:names:tc:opendocument:xmlns:office:1.0", meta = "urn:oasis:names:tc:opendocument:xmlns:meta:1.0";
|
|
@@ -85,7 +86,7 @@ function handledPropertyRecord(record, keys, charge) {
|
|
|
85
86
|
return false;
|
|
86
87
|
}
|
|
87
88
|
const keyword = field.namespace === meta && field.name === "keyword";
|
|
88
|
-
if (key === undefined || !
|
|
89
|
+
if (key === undefined || !Object.prototype.propertyIsEnumerable.call(properties ?? {}, key) || seen.has(key) && !(keyword && seen.get(key)))
|
|
89
90
|
return false;
|
|
90
91
|
seen.set(key, keyword);
|
|
91
92
|
}
|
|
@@ -141,7 +142,6 @@ function durationTicks(text) {
|
|
|
141
142
|
}
|
|
142
143
|
export async function writeBiffProperties(book, context, staged = false) {
|
|
143
144
|
const planned = new Map(), sections = new Map();
|
|
144
|
-
const handledKeys = new Set();
|
|
145
145
|
const unsupportedKeys = [];
|
|
146
146
|
let work = 0, textBytes = 0, nodes = 0, payloadBytes = 0;
|
|
147
147
|
const charge = (amount) => {
|
|
@@ -275,7 +275,6 @@ export async function writeBiffProperties(book, context, staged = false) {
|
|
|
275
275
|
if (++nodes > (context.limits.workbookNodes ?? context.limits.outputBytes))
|
|
276
276
|
throw new SsconvertError("resource-limit", "ssconvert BIFF property node limit exceeded");
|
|
277
277
|
const field = fieldByName.get(key);
|
|
278
|
-
handledKeys.add(key);
|
|
279
278
|
let source = book.properties[key];
|
|
280
279
|
if (key === "dc:keywords" && Array.isArray(source)) {
|
|
281
280
|
charge(source.length);
|
|
@@ -318,7 +317,7 @@ export async function writeBiffProperties(book, context, staged = false) {
|
|
|
318
317
|
const handledMetadata = new Set();
|
|
319
318
|
for (const record of book.unsupportedRecords ?? []) {
|
|
320
319
|
charge(1);
|
|
321
|
-
if (handledPropertyRecord(record,
|
|
320
|
+
if (handledPropertyRecord(record, book.properties, charge))
|
|
322
321
|
handledMetadata.add(record);
|
|
323
322
|
}
|
|
324
323
|
if (names.length) {
|
|
@@ -399,6 +398,7 @@ export async function writeBiffProperties(book, context, staged = false) {
|
|
|
399
398
|
const snapshots = (book.unsupportedRecords ?? []).some(record => record.source === "biff" && record.kind === "ole-properties" && record.disposition === "retained");
|
|
400
399
|
const streams = new Map(), inputs = [];
|
|
401
400
|
const sources = new Map();
|
|
401
|
+
let preserved;
|
|
402
402
|
const close = async () => {
|
|
403
403
|
const errors = [];
|
|
404
404
|
for (const source of [...sources.values(), ...inputs])
|
|
@@ -408,6 +408,12 @@ export async function writeBiffProperties(book, context, staged = false) {
|
|
|
408
408
|
catch (error) {
|
|
409
409
|
errors.push(error);
|
|
410
410
|
}
|
|
411
|
+
try {
|
|
412
|
+
await preserved?.close();
|
|
413
|
+
}
|
|
414
|
+
catch (error) {
|
|
415
|
+
errors.push(error);
|
|
416
|
+
}
|
|
411
417
|
if (errors.length === 1)
|
|
412
418
|
throw errors[0];
|
|
413
419
|
if (errors.length)
|
|
@@ -431,10 +437,13 @@ export async function writeBiffProperties(book, context, staged = false) {
|
|
|
431
437
|
streams.set(name, bytes);
|
|
432
438
|
}
|
|
433
439
|
}
|
|
434
|
-
|
|
440
|
+
if (snapshots && unsupportedKeys.length)
|
|
441
|
+
preserved = new BiffPropertyNames(context, charge);
|
|
442
|
+
await mergeBiffProperties(book, streams, handledMetadata, context, charge, allocate, staged ? { sources, reserve } : undefined, preserved);
|
|
435
443
|
for (const key of unsupportedKeys)
|
|
436
|
-
if (!preserved
|
|
444
|
+
if (!await preserved?.has(key))
|
|
437
445
|
await context.diagnostic?.({ code: "biff-loss-warning", severity: "warning", message: `Unsupported Excel BIFF document property: ${key}` });
|
|
446
|
+
await preserved?.close();
|
|
438
447
|
if (!staged)
|
|
439
448
|
return { streams, handledMetadata, async close() { } };
|
|
440
449
|
for (const [name, value] of snapshots ? streams : planned)
|
|
@@ -7,11 +7,13 @@ export declare const biffPropertyFormats: {
|
|
|
7
7
|
};
|
|
8
8
|
export declare const biffPropertyFields: Map<string, ReadonlyMap<number, string>>;
|
|
9
9
|
export declare function isBiffKeywordSpace(code: number): boolean;
|
|
10
|
-
/** Property offsets are section-relative; dictionaries have no variant header.
|
|
10
|
+
/** Property offsets are section-relative; dictionaries have no variant header.
|
|
11
|
+
* With collect=false, await observations without retaining a result record; exact
|
|
12
|
+
* duplicate-name checks use bounded caller storage when available. */
|
|
11
13
|
export declare function readBiffProperties(streams: ReadonlyMap<string, Uint8Array | RangeSource>, context: CapabilityContext, accountText: (text: string) => string, accountWork: (amount: number) => void, retained: UnsupportedRecord[] | undefined, observe?: (property: {
|
|
12
14
|
stream: string;
|
|
13
15
|
section: number;
|
|
14
16
|
id: number;
|
|
15
17
|
key: string;
|
|
16
18
|
value: ImportedValue;
|
|
17
|
-
}) => void): Promise<Readonly<Record<string, ImportedValue>>>;
|
|
19
|
+
}) => void | Promise<void>, collect?: boolean): Promise<Readonly<Record<string, ImportedValue>>>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { BiffPropertyNames } from './biff-property-names.js';
|
|
1
2
|
import { visitBiffPropertyDictionary } from './biff-property-dictionary.js';
|
|
2
3
|
import { SsconvertError } from "../spreadsheet-engine/contracts.js";
|
|
3
4
|
import { invalidBiff } from "./biff-binary.js";
|
|
@@ -19,9 +20,12 @@ export const biffPropertyFields = new Map([
|
|
|
19
20
|
export function isBiffKeywordSpace(code) {
|
|
20
21
|
return code > 0 && code <= 32 || code >= 0x2000 && code <= 0x200b || code === 0x2028 || code === 0x2029;
|
|
21
22
|
}
|
|
22
|
-
/** Property offsets are section-relative; dictionaries have no variant header.
|
|
23
|
-
|
|
23
|
+
/** Property offsets are section-relative; dictionaries have no variant header.
|
|
24
|
+
* With collect=false, await observations without retaining a result record; exact
|
|
25
|
+
* duplicate-name checks use bounded caller storage when available. */
|
|
26
|
+
export async function readBiffProperties(streams, context, accountText, accountWork, retained, observe, collect = true) {
|
|
24
27
|
const properties = Object.create(null);
|
|
28
|
+
let names;
|
|
25
29
|
let nodes = 0;
|
|
26
30
|
const admit = (count) => {
|
|
27
31
|
accountWork(count);
|
|
@@ -29,138 +33,153 @@ export async function readBiffProperties(streams, context, accountText, accountW
|
|
|
29
33
|
if (nodes > (context.limits.workbookNodes ?? context.limits.inputBytes))
|
|
30
34
|
throw new SsconvertError("resource-limit", "ssconvert BIFF property node limit exceeded");
|
|
31
35
|
};
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
try {
|
|
37
|
+
for (const target of ["\u0005SummaryInformation", "\u0005DocumentSummaryInformation"]) {
|
|
38
|
+
let streamName = target, bytes = streams.get(target);
|
|
39
|
+
if (!bytes)
|
|
40
|
+
for (const [name, data] of streams) {
|
|
41
|
+
accountWork(1);
|
|
42
|
+
if (name.toUpperCase() === target.toUpperCase()) {
|
|
43
|
+
streamName = name;
|
|
44
|
+
bytes = data;
|
|
45
|
+
break;
|
|
46
|
+
}
|
|
41
47
|
}
|
|
42
|
-
|
|
43
|
-
if (!bytes)
|
|
44
|
-
continue;
|
|
45
|
-
const file = propertyRange(bytes, context);
|
|
46
|
-
accountWork(file.size);
|
|
47
|
-
const sections = readPropertySectionRanges(file, admit, accountWork, context);
|
|
48
|
-
let unknown = false;
|
|
49
|
-
const modeled = retained ? [] : undefined;
|
|
50
|
-
for await (const { guid, offset, end } of sections) {
|
|
51
|
-
if (!biffPropertyFields.has(guid) && guid !== custom) {
|
|
52
|
-
unknown = true;
|
|
48
|
+
if (!bytes)
|
|
53
49
|
continue;
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
50
|
+
const file = propertyRange(bytes, context);
|
|
51
|
+
accountWork(file.size);
|
|
52
|
+
const sections = readPropertySectionRanges(file, admit, accountWork, context);
|
|
53
|
+
let unknown = false;
|
|
54
|
+
const modeled = retained ? [] : undefined;
|
|
55
|
+
for await (const { guid, offset, end } of sections) {
|
|
56
|
+
if (!biffPropertyFields.has(guid) && guid !== custom) {
|
|
57
|
+
unknown = true;
|
|
58
|
+
continue;
|
|
62
59
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
if (
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
else if (type === 5) {
|
|
82
|
-
value = await data.f64(4);
|
|
83
|
-
if (!Number.isFinite(value))
|
|
84
|
-
invalidBiff("nonfinite property value");
|
|
60
|
+
await withPropertyValueRanges(file.slice(offset, end - offset), admit, accountWork, context, async (values) => {
|
|
61
|
+
const cp = await values.get(1);
|
|
62
|
+
let codepage = 1252;
|
|
63
|
+
if (cp) {
|
|
64
|
+
if ((await cp.u32(0)) !== 2)
|
|
65
|
+
invalidBiff("invalid property codepage type");
|
|
66
|
+
codepage = await cp.u16(4);
|
|
67
|
+
}
|
|
68
|
+
const dictionary = guid === custom ? await values.get(0) : undefined;
|
|
69
|
+
const supported = await visitBiffPropertyDictionary(dictionary, codepage, context, admit, accountText, accountWork, async (getName) => {
|
|
70
|
+
for await (const [id, data] of values.entries()) {
|
|
71
|
+
context.signal.throwIfAborted();
|
|
72
|
+
if (id < 2)
|
|
73
|
+
continue;
|
|
74
|
+
const key = guid === custom ? await getName(id) : biffPropertyFields.get(guid)?.get(id);
|
|
75
|
+
if (key === undefined || (collect ? Object.hasOwn(properties, key) : await (names ??= new BiffPropertyNames(context, accountWork)).has(key))) {
|
|
76
|
+
unknown = true;
|
|
77
|
+
continue;
|
|
85
78
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
79
|
+
let value;
|
|
80
|
+
const type = await data.u32(0);
|
|
81
|
+
try {
|
|
82
|
+
if (type === 30 || type === 31)
|
|
83
|
+
value = (await readBiffPropertyText(data, 4, type === 31 ? 1200 : codepage, context, accountText, accountWork)).value;
|
|
84
|
+
else if (type === 3)
|
|
85
|
+
value = (await data.u32(4)) | 0;
|
|
86
|
+
else if (type === 5) {
|
|
87
|
+
value = await data.f64(4);
|
|
88
|
+
if (!Number.isFinite(value))
|
|
89
|
+
invalidBiff("nonfinite property value");
|
|
90
|
+
}
|
|
91
|
+
else if (type === 11)
|
|
92
|
+
value = (await data.u16(4)) !== 0;
|
|
93
|
+
else if (type === 64) {
|
|
94
|
+
const ticks = BigInt(await data.u32(4)) + (BigInt(await data.u32(8)) << 32n);
|
|
95
|
+
if (guid === summary && id === 10) {
|
|
96
|
+
const fraction = (ticks % 10000000n).toString().padStart(7, "0");
|
|
97
|
+
let end = fraction.length;
|
|
98
|
+
while (end && fraction[end - 1] === "0")
|
|
99
|
+
end--;
|
|
100
|
+
value = `PT${ticks / 600000000n}M${ticks / 10000000n % 60n}${end ? "." + fraction.slice(0, end) : ""}S`;
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
value = new Date(Number(ticks / 10000n) - 11644473600000).toISOString();
|
|
104
|
+
// The workbook model stores timestamps as strings; retain the
|
|
105
|
+
// original property bytes when Date's millisecond precision loses ticks.
|
|
106
|
+
if (ticks % 10000n)
|
|
107
|
+
unknown = true;
|
|
108
|
+
}
|
|
109
|
+
accountText(value);
|
|
96
110
|
}
|
|
97
|
-
else {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
111
|
+
else if (type === 7) {
|
|
112
|
+
const days = await data.f64(4);
|
|
113
|
+
if (!Number.isFinite(days) || days <= -657435 || days >= 2958466)
|
|
114
|
+
invalidBiff("invalid OLE property date");
|
|
115
|
+
// OLE Automation uses 1899-12-30 and the absolute fractional day.
|
|
116
|
+
// LibreOffice's oleprops DATE path truncates it and uses 1899-12-31;
|
|
117
|
+
// the documented Automation representation governs the stored value.
|
|
118
|
+
value = new Date(-2209161600000 + Math.round((Math.trunc(days) + Math.abs(days % 1)) * 86400000)).toISOString();
|
|
119
|
+
accountText(value);
|
|
103
120
|
}
|
|
104
|
-
accountText(value);
|
|
105
121
|
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
invalidBiff("invalid OLE property date");
|
|
110
|
-
// OLE Automation uses 1899-12-30 and the absolute fractional day.
|
|
111
|
-
// LibreOffice's oleprops DATE path truncates it and uses 1899-12-31;
|
|
112
|
-
// the documented Automation representation governs the stored value.
|
|
113
|
-
value = new Date(-2209161600000 + Math.round((Math.trunc(days) + Math.abs(days % 1)) * 86400000)).toISOString();
|
|
114
|
-
accountText(value);
|
|
122
|
+
catch (error) {
|
|
123
|
+
if (!(error instanceof SsconvertError) || error.code !== "unsupported-feature")
|
|
124
|
+
throw error;
|
|
115
125
|
}
|
|
126
|
+
if (value === undefined) {
|
|
127
|
+
unknown = true;
|
|
128
|
+
continue;
|
|
129
|
+
}
|
|
130
|
+
if (guid === summary && id === 5 && typeof value === "string") {
|
|
131
|
+
let count = 1;
|
|
132
|
+
for (const character of value)
|
|
133
|
+
if (character === ",")
|
|
134
|
+
count++;
|
|
135
|
+
admit(count);
|
|
136
|
+
accountWork(value.length);
|
|
137
|
+
value = value.split(",").map(keyword => {
|
|
138
|
+
let start = 0, end = keyword.length;
|
|
139
|
+
while (start < end && isBiffKeywordSpace(keyword.charCodeAt(start)))
|
|
140
|
+
start++;
|
|
141
|
+
while (end > start && isBiffKeywordSpace(keyword.charCodeAt(end - 1)))
|
|
142
|
+
end--;
|
|
143
|
+
return keyword.slice(start, end);
|
|
144
|
+
}).filter(Boolean);
|
|
145
|
+
}
|
|
146
|
+
accountText(key);
|
|
147
|
+
if (collect)
|
|
148
|
+
properties[key] = value;
|
|
149
|
+
else
|
|
150
|
+
await names.add(key);
|
|
151
|
+
modeled?.push([offset, id, key]);
|
|
152
|
+
await observe?.({ stream: streamName, section: offset, id, key, value });
|
|
116
153
|
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
}
|
|
121
|
-
if (value === undefined) {
|
|
122
|
-
unknown = true;
|
|
123
|
-
continue;
|
|
124
|
-
}
|
|
125
|
-
if (guid === summary && id === 5 && typeof value === "string") {
|
|
126
|
-
let count = 1;
|
|
127
|
-
for (const character of value)
|
|
128
|
-
if (character === ",")
|
|
129
|
-
count++;
|
|
130
|
-
admit(count);
|
|
131
|
-
accountWork(value.length);
|
|
132
|
-
value = value.split(",").map(keyword => {
|
|
133
|
-
let start = 0, end = keyword.length;
|
|
134
|
-
while (start < end && isBiffKeywordSpace(keyword.charCodeAt(start)))
|
|
135
|
-
start++;
|
|
136
|
-
while (end > start && isBiffKeywordSpace(keyword.charCodeAt(end - 1)))
|
|
137
|
-
end--;
|
|
138
|
-
return keyword.slice(start, end);
|
|
139
|
-
}).filter(Boolean);
|
|
140
|
-
}
|
|
141
|
-
accountText(key);
|
|
142
|
-
properties[key] = value;
|
|
143
|
-
modeled?.push([offset, id, key]);
|
|
144
|
-
observe?.({ stream: streamName, section: offset, id, key, value });
|
|
145
|
-
}
|
|
154
|
+
});
|
|
155
|
+
if (!supported)
|
|
156
|
+
unknown = true;
|
|
146
157
|
});
|
|
147
|
-
if (!supported)
|
|
148
|
-
unknown = true;
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
if (unknown && retained && modeled) {
|
|
152
|
-
if (file.size * 2 > (context.limits.workbookTextBytes ?? context.limits.inputBytes * 2))
|
|
153
|
-
throw new SsconvertError("resource-limit", "ssconvert BIFF property retention limit exceeded");
|
|
154
|
-
let encoded = "";
|
|
155
|
-
for (let at = 0; at < file.size;) {
|
|
156
|
-
const chunk = await file.read(at, Math.min(16384, file.size - at));
|
|
157
|
-
encoded += Array.from(chunk, byte => byte.toString(16).padStart(2, "0")).join("");
|
|
158
|
-
at += chunk.length;
|
|
159
158
|
}
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
159
|
+
if (unknown && retained && modeled) {
|
|
160
|
+
if (file.size * 2 > (context.limits.workbookTextBytes ?? context.limits.inputBytes * 2))
|
|
161
|
+
throw new SsconvertError("resource-limit", "ssconvert BIFF property retention limit exceeded");
|
|
162
|
+
let encoded = "";
|
|
163
|
+
for (let at = 0; at < file.size;) {
|
|
164
|
+
const chunk = await file.read(at, Math.min(16384, file.size - at));
|
|
165
|
+
encoded += Array.from(chunk, byte => byte.toString(16).padStart(2, "0")).join("");
|
|
166
|
+
at += chunk.length;
|
|
167
|
+
}
|
|
168
|
+
const hex = accountText(encoded);
|
|
169
|
+
retained.push({ source: "biff", kind: "ole-properties", disposition: "retained", data: { stream: streamName, bytes: hex, modeled } });
|
|
170
|
+
await context.diagnostic?.({ code: "biff-loss-warning", severity: "warning", message: `BIFF property stream ${streamName.slice(1)} retained with uninterpreted values` });
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
catch (error) {
|
|
175
|
+
try {
|
|
176
|
+
await names?.close();
|
|
177
|
+
}
|
|
178
|
+
catch (cleanup) {
|
|
179
|
+
throw new AggregateError([error, cleanup], 'BIFF property observation cleanup failed');
|
|
163
180
|
}
|
|
181
|
+
throw error;
|
|
164
182
|
}
|
|
183
|
+
await names?.close();
|
|
165
184
|
return properties;
|
|
166
185
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type CapabilityContext } from "../spreadsheet-engine/contracts.js";
|
|
2
|
+
/** Exact UTF-16 identity, including empty names and embedded NULs. Calls are sequential.
|
|
3
|
+
* A bounded hash index points to name records; collisions use exact bounded comparisons. */
|
|
4
|
+
export declare class BiffPropertyNames {
|
|
5
|
+
private readonly context;
|
|
6
|
+
private readonly charge;
|
|
7
|
+
private readonly storage;
|
|
8
|
+
private readonly index;
|
|
9
|
+
private readonly fallback;
|
|
10
|
+
private initialized;
|
|
11
|
+
private first;
|
|
12
|
+
private last;
|
|
13
|
+
private pending;
|
|
14
|
+
private closed;
|
|
15
|
+
private closing;
|
|
16
|
+
constructor(context: CapabilityContext, charge: (amount: number) => void);
|
|
17
|
+
private check;
|
|
18
|
+
private io;
|
|
19
|
+
private allocate;
|
|
20
|
+
private read;
|
|
21
|
+
private fingerprint;
|
|
22
|
+
private contains;
|
|
23
|
+
has(name: string): Promise<boolean>;
|
|
24
|
+
add(name: string): Promise<void>;
|
|
25
|
+
values(): AsyncIterable<string>;
|
|
26
|
+
close(): Promise<void>;
|
|
27
|
+
}
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import { sha256 } from '@noble/hashes/sha2.js';
|
|
2
|
+
import { IntegerTable } from "@poe-platform/safe-fs/storage";
|
|
3
|
+
import { SsconvertError } from "../spreadsheet-engine/contracts.js";
|
|
4
|
+
/** Exact UTF-16 identity, including empty names and embedded NULs. Calls are sequential.
|
|
5
|
+
* A bounded hash index points to name records; collisions use exact bounded comparisons. */
|
|
6
|
+
export class BiffPropertyNames {
|
|
7
|
+
context;
|
|
8
|
+
charge;
|
|
9
|
+
storage;
|
|
10
|
+
index;
|
|
11
|
+
fallback;
|
|
12
|
+
initialized = false;
|
|
13
|
+
first = 0;
|
|
14
|
+
last = 0;
|
|
15
|
+
pending = Promise.resolve();
|
|
16
|
+
closed = false;
|
|
17
|
+
closing;
|
|
18
|
+
constructor(context, charge) {
|
|
19
|
+
this.context = context;
|
|
20
|
+
this.charge = charge;
|
|
21
|
+
this.storage = context.createWorkingStorage?.();
|
|
22
|
+
if (this.storage)
|
|
23
|
+
this.index = new IntegerTable({ allocate: length => this.allocate(length),
|
|
24
|
+
read: (at, length) => this.read(at, length),
|
|
25
|
+
write: async (at, bytes) => {
|
|
26
|
+
const owned = new Uint8Array(bytes);
|
|
27
|
+
try {
|
|
28
|
+
await this.io(() => this.storage.write(at, owned));
|
|
29
|
+
}
|
|
30
|
+
finally {
|
|
31
|
+
owned.fill(0);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}, 64);
|
|
35
|
+
else
|
|
36
|
+
this.fallback = new Set();
|
|
37
|
+
context.own(() => this.close());
|
|
38
|
+
}
|
|
39
|
+
check() {
|
|
40
|
+
this.context.signal.throwIfAborted();
|
|
41
|
+
if (this.closed)
|
|
42
|
+
throw new SsconvertError('invalid-request', 'BIFF property name index is closed');
|
|
43
|
+
}
|
|
44
|
+
io(action) {
|
|
45
|
+
const result = this.pending.then(async () => { this.check(); const value = await action(); this.check(); return value; });
|
|
46
|
+
this.pending = result.then(() => undefined, () => undefined);
|
|
47
|
+
return result;
|
|
48
|
+
}
|
|
49
|
+
allocate(length) {
|
|
50
|
+
this.check();
|
|
51
|
+
const position = this.storage.allocate(length);
|
|
52
|
+
this.check();
|
|
53
|
+
return position;
|
|
54
|
+
}
|
|
55
|
+
read(at, length) {
|
|
56
|
+
return this.io(async () => {
|
|
57
|
+
const bytes = await this.storage.read(at, length);
|
|
58
|
+
if (bytes.length !== length)
|
|
59
|
+
throw new SsconvertError('io', 'Truncated BIFF property name index');
|
|
60
|
+
return new Uint8Array(bytes);
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
fingerprint(name) {
|
|
64
|
+
const hash = sha256.create(), buffer = new Uint8Array(Math.min(16384, name.length * 2)), view = new DataView(buffer.buffer);
|
|
65
|
+
try {
|
|
66
|
+
for (let at = 0; at < name.length;) {
|
|
67
|
+
this.check();
|
|
68
|
+
const count = Math.min(buffer.length / 2, name.length - at);
|
|
69
|
+
for (let i = 0; i < count; i++)
|
|
70
|
+
view.setUint16(i * 2, name.charCodeAt(at + i), true);
|
|
71
|
+
hash.update(buffer.subarray(0, count * 2));
|
|
72
|
+
at += count;
|
|
73
|
+
}
|
|
74
|
+
const digest = hash.digest();
|
|
75
|
+
return new DataView(digest.buffer, digest.byteOffset, digest.byteLength).getBigUint64(0, true);
|
|
76
|
+
}
|
|
77
|
+
finally {
|
|
78
|
+
buffer.fill(0);
|
|
79
|
+
hash.destroy();
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
async contains(name, head) {
|
|
83
|
+
let position = Number(head ?? 0n);
|
|
84
|
+
while (position) {
|
|
85
|
+
this.charge(1);
|
|
86
|
+
const record = new DataView((await this.read(position, 24)).buffer);
|
|
87
|
+
position = record.getFloat64(0, true);
|
|
88
|
+
if (record.getFloat64(8, true) !== name.length)
|
|
89
|
+
continue;
|
|
90
|
+
const start = record.getFloat64(16, true);
|
|
91
|
+
let same = true;
|
|
92
|
+
for (let at = 0; at < name.length;) {
|
|
93
|
+
const count = Math.min(8192, name.length - at);
|
|
94
|
+
this.charge(count);
|
|
95
|
+
const bytes = await this.read(start + at * 2, count * 2);
|
|
96
|
+
const view = new DataView(bytes.buffer);
|
|
97
|
+
for (let i = 0; i < count; i++)
|
|
98
|
+
if (view.getUint16(i * 2, true) !== name.charCodeAt(at + i)) {
|
|
99
|
+
same = false;
|
|
100
|
+
break;
|
|
101
|
+
}
|
|
102
|
+
if (!same)
|
|
103
|
+
break;
|
|
104
|
+
at += count;
|
|
105
|
+
}
|
|
106
|
+
if (same)
|
|
107
|
+
return true;
|
|
108
|
+
}
|
|
109
|
+
return false;
|
|
110
|
+
}
|
|
111
|
+
async has(name) {
|
|
112
|
+
this.check();
|
|
113
|
+
this.charge(name.length + 1);
|
|
114
|
+
if (this.fallback)
|
|
115
|
+
return this.fallback.has(name);
|
|
116
|
+
const head = await this.index.get(this.fingerprint(name));
|
|
117
|
+
this.check();
|
|
118
|
+
return this.contains(name, head);
|
|
119
|
+
}
|
|
120
|
+
async add(name) {
|
|
121
|
+
this.check();
|
|
122
|
+
this.charge(name.length + 1);
|
|
123
|
+
if (this.fallback) {
|
|
124
|
+
this.fallback.add(name);
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
if (!this.initialized) {
|
|
128
|
+
this.allocate(8);
|
|
129
|
+
this.check();
|
|
130
|
+
this.initialized = true;
|
|
131
|
+
}
|
|
132
|
+
const key = this.fingerprint(name), head = await this.index.get(key);
|
|
133
|
+
this.check();
|
|
134
|
+
if (await this.contains(name, head))
|
|
135
|
+
return;
|
|
136
|
+
const start = this.allocate(name.length * 2), buffer = new Uint8Array(Math.min(16384, name.length * 2));
|
|
137
|
+
const view = new DataView(buffer.buffer);
|
|
138
|
+
try {
|
|
139
|
+
for (let at = 0; at < name.length;) {
|
|
140
|
+
const count = Math.min(buffer.length / 2, name.length - at);
|
|
141
|
+
for (let i = 0; i < count; i++)
|
|
142
|
+
view.setUint16(i * 2, name.charCodeAt(at + i), true);
|
|
143
|
+
await this.io(() => this.storage.write(start + at * 2, buffer.subarray(0, count * 2)));
|
|
144
|
+
at += count;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
finally {
|
|
148
|
+
buffer.fill(0);
|
|
149
|
+
}
|
|
150
|
+
const record = new Uint8Array(32), descriptor = new DataView(record.buffer);
|
|
151
|
+
descriptor.setFloat64(0, Number(head ?? 0n), true);
|
|
152
|
+
descriptor.setFloat64(8, name.length, true);
|
|
153
|
+
descriptor.setFloat64(16, start, true);
|
|
154
|
+
const position = this.allocate(record.length);
|
|
155
|
+
try {
|
|
156
|
+
await this.io(() => this.storage.write(position, record));
|
|
157
|
+
}
|
|
158
|
+
finally {
|
|
159
|
+
record.fill(0);
|
|
160
|
+
}
|
|
161
|
+
await this.index.set(key, BigInt(position));
|
|
162
|
+
this.check();
|
|
163
|
+
if (this.last) {
|
|
164
|
+
const link = new Uint8Array(8);
|
|
165
|
+
new DataView(link.buffer).setFloat64(0, position, true);
|
|
166
|
+
try {
|
|
167
|
+
await this.io(() => this.storage.write(this.last + 24, link));
|
|
168
|
+
}
|
|
169
|
+
finally {
|
|
170
|
+
link.fill(0);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
else
|
|
174
|
+
this.first = position;
|
|
175
|
+
this.last = position;
|
|
176
|
+
}
|
|
177
|
+
async *values() {
|
|
178
|
+
this.check();
|
|
179
|
+
if (this.fallback) {
|
|
180
|
+
for (const name of this.fallback) {
|
|
181
|
+
this.check();
|
|
182
|
+
yield name;
|
|
183
|
+
}
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
let position = this.first;
|
|
187
|
+
while (position) {
|
|
188
|
+
const record = new DataView((await this.read(position, 32)).buffer);
|
|
189
|
+
const length = record.getFloat64(8, true), start = record.getFloat64(16, true);
|
|
190
|
+
position = record.getFloat64(24, true);
|
|
191
|
+
this.charge(length + 1);
|
|
192
|
+
let name = '';
|
|
193
|
+
for (let at = 0; at < length;) {
|
|
194
|
+
const count = Math.min(8192, length - at), bytes = await this.read(start + at * 2, count * 2);
|
|
195
|
+
const view = new DataView(bytes.buffer), units = new Uint16Array(count);
|
|
196
|
+
for (let i = 0; i < count; i++)
|
|
197
|
+
units[i] = view.getUint16(i * 2, true);
|
|
198
|
+
name += String.fromCharCode(...units);
|
|
199
|
+
at += count;
|
|
200
|
+
}
|
|
201
|
+
yield name;
|
|
202
|
+
}
|
|
203
|
+
this.check();
|
|
204
|
+
}
|
|
205
|
+
close() {
|
|
206
|
+
this.closed = true;
|
|
207
|
+
this.fallback?.clear();
|
|
208
|
+
return this.closing ??= this.pending.then(async () => { await this.storage?.close(); });
|
|
209
|
+
}
|
|
210
|
+
}
|