@poe-platform/safe-bash 0.1.811 → 0.1.813
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/audio-ast/id3-source.d.ts +27 -0
- package/dist/audio-ast/index.d.ts +5 -0
- package/dist/audio-ast/index.js +1001 -596
- package/dist/audio-ast/mp3-source.d.ts +18 -0
- package/dist/audio-ast/ogg-source.d.ts +25 -0
- package/dist/audio-ast/ogg-stream-source.d.ts +22 -0
- package/dist/audio-ast/vorbis.d.ts +14 -0
- package/dist/image-ast/index.js +139 -9
- package/dist/mp4-ast/containers/adapters.d.ts +7 -0
- package/dist/office-xml/retained-xml-document.d.ts +8 -0
- package/dist/pdf-ast/ast.d.ts +2 -0
- package/dist/pdf-ast/content/dictionary-cursor.d.ts +15 -0
- package/dist/pdf-ast/content/range-operator-parser.d.ts +4 -0
- package/dist/pdf-ast/content/stored-dictionary.d.ts +10 -0
- package/dist/pdf-ast/cos/lexer.d.ts +8 -5
- package/dist/pdf-ast/cos/object-reader.d.ts +4 -3
- package/dist/pdf-ast/cos/range-parser.d.ts +4 -0
- package/dist/pdf-ast/cos/retained-objects.d.ts +1 -0
- package/dist/pdf-ast/cos/retained-writer.d.ts +1 -0
- package/dist/pdf-ast/cos/value-parser.d.ts +32 -2
- package/dist/pdf-ast/edit/retained-append-attachments.d.ts +13 -0
- package/dist/pdf-ast/edit/retained-bookmarks.d.ts +13 -0
- package/dist/pdf-ast/edit/retained-graph.d.ts +6 -0
- package/dist/pdf-ast/edit/retained-save.d.ts +2 -0
- package/dist/pdf-ast/edit/retained-stamps.d.ts +9 -0
- package/dist/pdf-ast/extract/retained-form-field-details.d.ts +20 -0
- package/dist/pdf-ast/extract/retained-form-fields.d.ts +17 -4
- package/dist/pdf-ast/fonts/resolve.d.ts +3 -1
- package/dist/pdf-ast/index.d.ts +4 -1
- package/dist/pdf-ast/index.js +2127 -975
- package/dist/pdf-ast/retained-document.d.ts +4 -0
- package/dist/safe-bash/audio-ast.browser.js +7 -1
- package/dist/safe-bash/chunks/{chunk-HHSOUC3Z.js → chunk-HPQE675Q.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-BUYRKFW2.js → chunk-I6ECNJMR.js} +1 -1
- package/dist/safe-bash/chunks/{pdftk-WRYEP3CA.js → pdftk-Y2TX74LY.js} +2 -1
- package/dist/safe-bash/command-chunks/biff-4ALVARRF-7SRX6R6N.js +5192 -0
- package/dist/safe-bash/command-chunks/{chunk-EHSM5ZQS.js → chunk-2DGJOOXM.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-Q6S57NOQ.js → chunk-2E2H7MBH.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-MMBZTYXO.js → chunk-2PQRZDNR.js} +221 -0
- package/dist/safe-bash/command-chunks/{chunk-5OO2P27R.js → chunk-2V6FOLXV.js} +78 -25
- package/dist/safe-bash/command-chunks/{chunk-56NYSX65.js → chunk-2Z3WRRFT.js} +9 -9
- package/dist/safe-bash/command-chunks/chunk-3D24WDND.js +63 -0
- package/dist/safe-bash/command-chunks/{chunk-47NEG4UO.js → chunk-3JST2Q7G.js} +219 -43
- package/dist/safe-bash/command-chunks/{chunk-WGG6G2KG.js → chunk-3LJAXFH5.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-AHA6IWAJ.js → chunk-3TYDSGAH.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-YSMNXMAO.js → chunk-3Y4XZB24.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-ZIIO6GRY.js → chunk-4PBNMKAT.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-JFYWVQ4V.js → chunk-4Z6W5EOC.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-GEM47B2P.js → chunk-57DDYKE5.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-HARUYHH7.js → chunk-5HUICAWD.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-4CKFNXRN.js → chunk-5IFRAI7Y.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-RHYJVTJO.js → chunk-5KGEZ3RW.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-A5FZBR7X.js → chunk-5MFDRSGG.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-7GKKMNL6.js → chunk-5P6I2T63.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-6M6TM5Z5.js → chunk-5VQVZPP3.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-MIRL7HTF.js → chunk-6244HYJY.js} +1 -1
- package/dist/safe-bash/command-chunks/chunk-63EMPQ7Z.js +115 -0
- package/dist/safe-bash/command-chunks/{chunk-XRVKWGVQ.js → chunk-6CY5BHBS.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-XVP6V5K3.js → chunk-6IWE7PTK.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-6QBMND4A.js → chunk-6SRHWVEB.js} +1 -1
- package/dist/safe-bash/command-chunks/chunk-6ZHQB453.js +35 -0
- package/dist/safe-bash/command-chunks/chunk-73NYFNAS.js +173 -0
- package/dist/safe-bash/command-chunks/{chunk-VU3EQF7F.js → chunk-7NXTEWPR.js} +229 -75
- package/dist/safe-bash/command-chunks/{chunk-554Z6IKP.js → chunk-7PRL6RJ6.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-SDTPO2VV.js → chunk-7PZHWMK6.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-XZ2FWFNV.js → chunk-7QZ2HP2F.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-OEJM666F.js → chunk-7UC2Q6Z6.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-COKYZUBW.js → chunk-AJI55RS7.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-2VCKUNDZ.js → chunk-B2C3UPJS.js} +27 -17
- package/dist/safe-bash/command-chunks/{chunk-WXRYDALR.js → chunk-BBAB7LC4.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-QYMEASQ6.js → chunk-BEHUSUOY.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-Z2JW6M2D.js → chunk-BK7ISUJL.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-33YCKZZX.js → chunk-C5KLFZGT.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-TVH4JORU.js → chunk-C5QDEB3I.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-N4R2SHSS.js → chunk-CCZZVCHX.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-2VLAXKTS.js → chunk-CTDC4LJT.js} +121 -85
- package/dist/safe-bash/command-chunks/{chunk-S6R3IB36.js → chunk-D55REQA3.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-Y4EYCZFT.js → chunk-D6WJY6QO.js} +10 -10
- package/dist/safe-bash/command-chunks/{chunk-2CORNDGF.js → chunk-DBLHCJJU.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-SPW4GW4Z.js → chunk-DFI7QF3M.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-456PHA3L.js → chunk-DMCI6T6N.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-TW73OXPR.js → chunk-EJTNVXWF.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-QD7ZRDUN.js → chunk-ET2VPDUA.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-5LI2DLNZ.js → chunk-EXOQGXEU.js} +26 -26
- package/dist/safe-bash/command-chunks/{chunk-CRV2Q3PB.js → chunk-EZ4NQIPL.js} +1 -1
- package/dist/safe-bash/command-chunks/chunk-FWKLBDMK.js +0 -0
- package/dist/safe-bash/command-chunks/{chunk-22MOB45U.js → chunk-FWPVQGYK.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-QC5RMGSA.js → chunk-G3RUXKVY.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-JYUJAF4L.js → chunk-G7NENPYV.js} +4 -0
- package/dist/safe-bash/command-chunks/{chunk-KCOJA7EM.js → chunk-GKILM4HZ.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-HTVIYLVB.js → chunk-GNXTMSYN.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-D2ASPM7R.js → chunk-GOBUDKZ3.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-RNSKXOG3.js → chunk-GVWVRPG6.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-ZHRGYR7B.js → chunk-HCKYUQ3L.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-AGLK7OJR.js → chunk-HDSIIQBS.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-DM2CPMB4.js → chunk-HKOMXGJS.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-IT7TAC3F.js → chunk-HVW53ARH.js} +16 -16
- package/dist/safe-bash/command-chunks/{chunk-M7QE2MN7.js → chunk-I4GMCWAT.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-5MB64DWR.js → chunk-IHSOOSNC.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-LCZDBW55.js → chunk-JAHJWVGF.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-MOZD7RUY.js → chunk-JORIVUPM.js} +27 -11
- package/dist/safe-bash/command-chunks/{chunk-PMAM4N33.js → chunk-JUJHYPYL.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-ENT3IV2G.js → chunk-KBUBSMCQ.js} +12 -12
- package/dist/safe-bash/command-chunks/{chunk-ZXR6LXV5.js → chunk-KCE5D4Z4.js} +48 -4
- package/dist/safe-bash/command-chunks/{chunk-FIIAYCWS.js → chunk-KZ5ODST6.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-PNGDJA6M.js → chunk-LD7BONZY.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-KJ4XXZIL.js → chunk-M3Z5PU2M.js} +582 -59
- package/dist/safe-bash/command-chunks/{chunk-LXLLA4PM.js → chunk-MKX4JAZ6.js} +17 -17
- package/dist/safe-bash/command-chunks/{chunk-RQIQ75W5.js → chunk-MNHBQBF6.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-A2CLZMQZ.js → chunk-MPKY37QR.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-K5GB2YMN.js → chunk-MUUWBZIC.js} +10 -10
- package/dist/safe-bash/command-chunks/{chunk-JOCFI7TG.js → chunk-N32GSM3J.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-EUT24Y5Z.js → chunk-NKTULXVD.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-5HPU7D36.js → chunk-NMPED6L5.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-QZZ73J2O.js → chunk-NPFHUS4X.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-X7FA7ZD5.js → chunk-O675URF4.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-R6EGGK5M.js → chunk-P7EL2FWW.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-YS25EI54.js → chunk-PCCFLPUQ.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-RRL3Y562.js → chunk-PI6MOMHA.js} +11 -11
- package/dist/safe-bash/command-chunks/{chunk-26VCZHLJ.js → chunk-PIOQBOEK.js} +1 -1
- package/dist/safe-bash/command-chunks/chunk-PK36TVXB.js +175 -0
- package/dist/safe-bash/command-chunks/{chunk-72C3TZ2U.js → chunk-PKLJRB7W.js} +264 -129
- package/dist/safe-bash/command-chunks/{chunk-6CCQI6XZ.js → chunk-PSCOXGCA.js} +12 -12
- package/dist/safe-bash/command-chunks/{chunk-XPD636C4.js → chunk-PVGZMLC6.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-JQVHUSDD.js → chunk-PXWS3Q7L.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-HDJVJTCK.js → chunk-QFF5KBOM.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-MPUHH2KR.js → chunk-QM2HZJSJ.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-UAXSE3XE.js → chunk-R2BMZAHG.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-KB7DUBVL.js → chunk-RGOQKIG6.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-D2KZ66W4.js → chunk-RLCQ7BN3.js} +187 -39
- package/dist/safe-bash/command-chunks/{chunk-B5LDP7AA.js → chunk-S2N2V5U4.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-OA75SGN2.js → chunk-SGPCXAG7.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-Z5QOVRVH.js → chunk-SU26FZLJ.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-QUM3SYAJ.js → chunk-SYSX46IV.js} +3 -3
- package/dist/safe-bash/command-chunks/chunk-T3E5RV3U.js +737 -0
- package/dist/safe-bash/command-chunks/{chunk-YORJDX4V.js → chunk-T5ERNELL.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-KL3OIBKB.js → chunk-T6C5QP7T.js} +6495 -6343
- package/dist/safe-bash/command-chunks/{chunk-ATTWQVR2.js → chunk-TKRLZIFI.js} +17 -17
- package/dist/safe-bash/command-chunks/{chunk-ZMHEGDU2.js → chunk-TODWFDYB.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-YSY6R6AS.js → chunk-TQEB4DH4.js} +703 -102
- package/dist/safe-bash/command-chunks/{chunk-36XGIPOG.js → chunk-U5TWQFZY.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-APEWTWCC.js → chunk-UAF4IX5H.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-6VPQ3CDZ.js → chunk-V37D6AHO.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-RID6VYS3.js → chunk-V6XBEYPC.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-WJCN2IXI.js → chunk-VQOINPVF.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-W5YSINXC.js → chunk-VVWXY6IA.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-HKATEVAP.js → chunk-WPVBUVFK.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-UYWSIIUX.js → chunk-X53AEG36.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-L5MCW6CM.js → chunk-X64XGIXZ.js} +9 -155
- package/dist/safe-bash/command-chunks/{chunk-Q73EMLLZ.js → chunk-X6RHJ6YN.js} +84 -5
- package/dist/safe-bash/command-chunks/{chunk-7PVHO47B.js → chunk-XG6UWQV5.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-NQDIT667.js → chunk-XIDGHIGB.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-DPR5CYQV.js → chunk-XITDDJFT.js} +2 -0
- package/dist/safe-bash/command-chunks/{chunk-CV7M2QJU.js → chunk-XLYIVBAR.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-WVMHRNXZ.js → chunk-YUXTK3XA.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-SPLOIABU.js → chunk-YXD6VGVG.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-2ZFLMWOX.js → chunk-Z5BIM5B7.js} +1 -1
- package/dist/safe-bash/command-chunks/chunk-ZYLGNIGA.js +156 -0
- package/dist/safe-bash/command-chunks/{command-engine-BEWABZ75.js → command-engine-X3OLN7N6.js} +206 -86
- package/dist/safe-bash/command-chunks/{engine-AXXFTGCL-QBQNBI6K.js → engine-XUCIFZ7V-LJFGZM6O.js} +1 -1
- package/dist/safe-bash/command-chunks/paradox-4FCZE53D-LQPGVMEL.js +365 -0
- package/dist/safe-bash/commands/pandoc/index.browser.js +1 -1
- package/dist/safe-bash/full-core.browser.js +2 -2
- package/dist/safe-bash/plugins/index.browser.js +2 -2
- package/dist/safe-bash-command-apply-patch/apply.js +4 -4
- package/dist/safe-bash-command-apply-patch/index.js +4 -4
- package/dist/safe-bash-command-apply-patch/matcher.js +2 -2
- package/dist/safe-bash-command-apply-patch/parser.js +2 -2
- package/dist/safe-bash-command-apply-patch/shared.d.ts +2 -0
- package/dist/safe-bash-command-apply-patch/shared.js +1 -1
- package/dist/safe-bash-command-diff/diff.js +1 -1
- package/dist/safe-bash-command-diff/index.js +1 -1
- 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.d.ts +3 -1
- package/dist/safe-bash-command-ffprobe/media.js +2 -2
- package/dist/safe-bash-command-html-to-markdown/budget.js +2 -1
- package/dist/safe-bash-command-html-to-markdown/entities.js +4 -3
- package/dist/safe-bash-command-html-to-markdown/index.js +564 -110
- package/dist/safe-bash-command-html-to-markdown/input.js +6 -5
- package/dist/safe-bash-command-html-to-markdown/options.js +2 -1
- package/dist/safe-bash-command-html-to-markdown/parser.js +5 -4
- package/dist/safe-bash-command-html-to-markdown/render.js +6 -5
- package/dist/safe-bash-command-html-to-markdown/text.js +3 -2
- package/dist/safe-bash-command-htmlq/index.js +361 -37
- package/dist/safe-bash-command-htmlq/tree.d.ts +3 -2
- package/dist/safe-bash-command-pandoc/command.js +7 -7
- package/dist/safe-bash-command-pandoc/index.js +55 -55
- package/dist/safe-bash-command-patch/index.js +6 -6
- package/dist/safe-bash-command-patch/patch-envelope.js +53 -3
- package/dist/safe-bash-command-patch/patch-formats.d.ts +2 -2
- package/dist/safe-bash-command-patch/patch-formats.js +2 -2
- package/dist/safe-bash-command-patch/patch-gnu-reject.d.ts +2 -1
- package/dist/safe-bash-command-patch/patch-gnu-reject.js +4 -3
- package/dist/safe-bash-command-patch/patch-publication.js +2 -1
- package/dist/safe-bash-command-patch/patch.js +6 -6
- package/dist/safe-bash-command-patch/unified.d.ts +10 -2
- package/dist/safe-bash-command-patch/unified.js +1 -1
- package/dist/safe-bash-command-pdftk/index.d.ts +6 -2
- package/dist/safe-bash-command-pdftk/index.js +835 -243
- package/dist/safe-bash-command-pptx/command-engine.d.ts +15 -3
- package/dist/safe-bash-command-pptx/engine.d.ts +2 -2
- package/dist/safe-bash-command-pptx/engine.js +1 -1
- package/dist/safe-bash-command-pptx/index.js +9 -2
- package/dist/safe-bash-command-soffice/index.js +1 -1
- package/dist/safe-bash-command-ssconvert/index.js +2 -2
- package/dist/safe-bash-command-xmllint/index.js +22 -31
- package/dist/safe-bash-diff-engine/document.d.ts +2 -1
- package/dist/safe-bash-diff-engine/document.js +7 -4
- package/dist/safe-bash-presentation-engine/accessibility.js +31 -30
- package/dist/safe-bash-presentation-engine/animation-editing.js +16 -15
- package/dist/safe-bash-presentation-engine/animations.js +16 -15
- package/dist/safe-bash-presentation-engine/backgrounds.js +17 -16
- package/dist/safe-bash-presentation-engine/bytes.js +3 -3
- package/dist/safe-bash-presentation-engine/chart-editing.js +34 -33
- package/dist/safe-bash-presentation-engine/chart-object-operations.js +25 -24
- package/dist/safe-bash-presentation-engine/charts.js +31 -30
- package/dist/safe-bash-presentation-engine/command-placeholder.js +59 -55
- package/dist/safe-bash-presentation-engine/comments.js +17 -16
- package/dist/safe-bash-presentation-engine/connector-operations.js +32 -31
- package/dist/safe-bash-presentation-engine/connectors.js +29 -28
- package/dist/safe-bash-presentation-engine/content-types.js +4 -4
- package/dist/safe-bash-presentation-engine/creation.js +6 -6
- package/dist/safe-bash-presentation-engine/diff.js +32 -31
- package/dist/safe-bash-presentation-engine/drawing-enums.d.ts +10 -10
- package/dist/safe-bash-presentation-engine/drawing-format.js +20 -19
- package/dist/safe-bash-presentation-engine/drawing-operations.js +31 -30
- package/dist/safe-bash-presentation-engine/drawing-schema.js +21 -20
- package/dist/safe-bash-presentation-engine/equations.js +17 -16
- package/dist/safe-bash-presentation-engine/errors.js +2 -2
- package/dist/safe-bash-presentation-engine/fields.js +17 -16
- package/dist/safe-bash-presentation-engine/font-metrics.js +3 -3
- package/dist/safe-bash-presentation-engine/image-extraction.js +20 -19
- package/dist/safe-bash-presentation-engine/image-formatting.js +32 -31
- package/dist/safe-bash-presentation-engine/image-insertion.js +18 -17
- package/dist/safe-bash-presentation-engine/image-replacement.js +21 -20
- package/dist/safe-bash-presentation-engine/image-value.js +4 -4
- package/dist/safe-bash-presentation-engine/images.js +19 -18
- package/dist/safe-bash-presentation-engine/index.d.ts +6 -2
- package/dist/safe-bash-presentation-engine/index.js +112 -97
- package/dist/safe-bash-presentation-engine/layouts.js +16 -15
- package/dist/safe-bash-presentation-engine/length.js +3 -3
- package/dist/safe-bash-presentation-engine/links.js +16 -15
- package/dist/safe-bash-presentation-engine/masters.js +15 -14
- package/dist/safe-bash-presentation-engine/media-editing.js +24 -23
- package/dist/safe-bash-presentation-engine/media-extraction.js +17 -16
- package/dist/safe-bash-presentation-engine/media.js +16 -15
- package/dist/safe-bash-presentation-engine/memberships.js +15 -14
- package/dist/safe-bash-presentation-engine/notes.js +16 -15
- package/dist/safe-bash-presentation-engine/ole-enum.js +4 -4
- package/dist/safe-bash-presentation-engine/ole-insertion.js +20 -19
- package/dist/safe-bash-presentation-engine/opaque-objects.js +9 -9
- package/dist/safe-bash-presentation-engine/package-reader.js +5 -5
- package/dist/safe-bash-presentation-engine/package-tools.d.ts +3 -0
- package/dist/safe-bash-presentation-engine/package-tools.js +27 -17
- package/dist/safe-bash-presentation-engine/package-uri.js +3 -3
- package/dist/safe-bash-presentation-engine/package-writer.js +4 -4
- package/dist/safe-bash-presentation-engine/presentation-model.js +58 -54
- package/dist/safe-bash-presentation-engine/presentation-settings.js +14 -13
- package/dist/safe-bash-presentation-engine/properties.js +16 -15
- package/dist/safe-bash-presentation-engine/relationships.js +4 -4
- package/dist/safe-bash-presentation-engine/resource-limits.js +1 -1
- package/dist/safe-bash-presentation-engine/retained-archive-staging.d.ts +19 -0
- package/dist/safe-bash-presentation-engine/retained-extraction-output.d.ts +18 -0
- package/dist/safe-bash-presentation-engine/retained-inspection.js +14 -12
- package/dist/safe-bash-presentation-engine/retained-package-extraction.d.ts +22 -0
- package/dist/safe-bash-presentation-engine/retained-package-packing.d.ts +19 -0
- package/dist/safe-bash-presentation-engine/retained-package.d.ts +2 -0
- package/dist/safe-bash-presentation-engine/retained-package.js +6 -4
- package/dist/safe-bash-presentation-engine/retained-slide-publication.d.ts +24 -0
- package/dist/safe-bash-presentation-engine/retained-text.js +19 -17
- package/dist/safe-bash-presentation-engine/retained-xml-parts.d.ts +5 -1
- package/dist/safe-bash-presentation-engine/retained-xml-publication.d.ts +18 -0
- package/dist/safe-bash-presentation-engine/retained-xml-replacement.d.ts +13 -0
- package/dist/safe-bash-presentation-engine/sanitize.js +17 -16
- package/dist/safe-bash-presentation-engine/selectors.js +10 -10
- package/dist/safe-bash-presentation-engine/shape-groups.js +31 -30
- package/dist/safe-bash-presentation-engine/shape-operations.js +30 -29
- package/dist/safe-bash-presentation-engine/shape-path-operations.js +32 -31
- package/dist/safe-bash-presentation-engine/shape-paths.js +16 -15
- package/dist/safe-bash-presentation-engine/shape-presets.js +3 -3
- package/dist/safe-bash-presentation-engine/shape-selection.js +31 -30
- package/dist/safe-bash-presentation-engine/shape-transforms.js +18 -17
- package/dist/safe-bash-presentation-engine/shapes.d.ts +1 -1
- package/dist/safe-bash-presentation-engine/shapes.js +27 -26
- package/dist/safe-bash-presentation-engine/slide-copy.js +17 -16
- package/dist/safe-bash-presentation-engine/slide-import.js +18 -17
- package/dist/safe-bash-presentation-engine/slide-merge-split.js +20 -19
- package/dist/safe-bash-presentation-engine/slide-model.js +43 -42
- package/dist/safe-bash-presentation-engine/slide-removal.js +18 -17
- package/dist/safe-bash-presentation-engine/slide-transfer-budget.js +9 -9
- package/dist/safe-bash-presentation-engine/slides.d.ts +1 -0
- package/dist/safe-bash-presentation-engine/slides.js +23 -17
- package/dist/safe-bash-presentation-engine/table-operations.js +33 -32
- package/dist/safe-bash-presentation-engine/table-spans.js +32 -31
- package/dist/safe-bash-presentation-engine/tables.js +31 -30
- package/dist/safe-bash-presentation-engine/tags.js +16 -15
- package/dist/safe-bash-presentation-engine/template-bindings.js +33 -32
- package/dist/safe-bash-presentation-engine/template-repeat.js +40 -39
- package/dist/safe-bash-presentation-engine/text-fitting.js +27 -26
- package/dist/safe-bash-presentation-engine/text-frames.js +27 -26
- package/dist/safe-bash-presentation-engine/text-paragraphs.js +27 -26
- package/dist/safe-bash-presentation-engine/text-reading.js +11 -11
- package/dist/safe-bash-presentation-engine/text-replacement.js +17 -16
- package/dist/safe-bash-presentation-engine/text-runs.js +20 -19
- package/dist/safe-bash-presentation-engine/themes.js +16 -15
- package/dist/safe-bash-presentation-engine/transitions.js +16 -15
- package/dist/safe-bash-presentation-engine/validation.js +10 -9
- package/dist/safe-bash-presentation-engine/xml-parts.d.ts +2 -0
- package/dist/safe-bash-presentation-engine/xml-parts.js +23 -15
- package/dist/safe-bash-presentation-engine/xml-view.js +3 -3
- package/dist/safe-bash-presentation-engine/xml.js +3 -3
- package/dist/safe-bash-regex-engine/index.js +1 -1
- package/dist/safe-bash-regex-engine/python-glob.js +1 -1
- package/dist/safe-bash-regex-engine/text/regex.d.ts +19 -0
- package/dist/safe-bash-regex-engine/text/regex.js +1 -1
- package/dist/safe-bash-xml-engine/document.js +3 -3
- package/dist/safe-bash-xml-engine/evaluate.js +1 -1
- package/dist/safe-bash-xml-engine/index.d.ts +1 -0
- package/dist/safe-bash-xml-engine/index.js +8 -4
- package/dist/safe-bash-xml-engine/query.js +2 -2
- package/dist/safe-bash-xml-engine/recovery.d.ts +10 -0
- package/dist/safe-bash-xml-engine/stored-document.d.ts +1 -1
- package/dist/safe-bash-xml-engine/stored-document.js +1 -1
- package/dist/safe-bash-xml-engine/stored-evaluate.js +1 -1
- package/dist/spreadsheet-engine/formulas/functions/python-printf.js +56 -33
- package/dist/spreadsheet-format-xls/biff-encrypted-properties.d.ts +2 -2
- package/dist/spreadsheet-format-xls/biff-encrypted-properties.js +86 -24
- package/dist/spreadsheet-format-xls/biff-metadata.d.ts +1 -0
- package/dist/spreadsheet-format-xls/biff-metadata.js +2 -2
- package/dist/spreadsheet-format-xls/biff-properties-merge.d.ts +6 -2
- package/dist/spreadsheet-format-xls/biff-properties-merge.js +413 -296
- package/dist/spreadsheet-format-xls/biff-properties-write.js +40 -23
- package/dist/spreadsheet-format-xls/biff-properties.js +3 -68
- package/dist/spreadsheet-format-xls/biff-property-index.d.ts +23 -0
- package/dist/spreadsheet-format-xls/biff-property-index.js +93 -0
- package/dist/spreadsheet-format-xls/biff-property-name.d.ts +4 -0
- package/dist/spreadsheet-format-xls/biff-property-name.js +114 -0
- package/dist/spreadsheet-format-xls/biff-property-text.d.ts +6 -0
- package/dist/spreadsheet-format-xls/biff-property-text.js +68 -0
- package/dist/spreadsheet-format-xls/biff-property-transcode.d.ts +5 -0
- package/dist/spreadsheet-format-xls/biff-property-transcode.js +45 -0
- package/dist/spreadsheet-format-xls/biff-write-metadata.js +10 -1
- package/package.json +6 -3
- package/dist/safe-bash/command-chunks/biff-3EFLKBAH-NYWZOYQS.js +0 -4942
- package/dist/safe-bash/command-chunks/chunk-5Q22ZLNC.js +0 -127
- package/dist/safe-bash/command-chunks/chunk-JKLOBSMP.js +0 -56
- package/dist/safe-bash/command-chunks/chunk-JYTESTBS.js +0 -99
- package/dist/safe-bash/command-chunks/chunk-WH3TIOTS.js +0 -326
- package/dist/safe-bash/command-chunks/paradox-ZWWXYY4J-JYOSWSBL.js +0 -362
- package/dist/spreadsheet-format-xls/biff-properties-layout.js +0 -56
|
@@ -18,7 +18,7 @@ export declare class StoredXmlDocument {
|
|
|
18
18
|
get document(): number;
|
|
19
19
|
static parse(source: AsyncIterable<string> | Iterable<string>, context: PagedStorageContext & {
|
|
20
20
|
readonly registerCleanup?: (cleanup: () => Promise<void>) => void;
|
|
21
|
-
}, budget: XmlBudget, pages?: number): Promise<StoredXmlDocument>;
|
|
21
|
+
}, budget: XmlBudget, pages?: number, recover?: (message: string) => void): Promise<StoredXmlDocument>;
|
|
22
22
|
private field;
|
|
23
23
|
private set;
|
|
24
24
|
private append;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { SsconvertError } from "../../contracts.js";
|
|
2
2
|
import { boundedText } from "./common.js";
|
|
3
|
+
import { rendered } from "../values.js";
|
|
3
4
|
import { nonPrintable } from "./python-printf-profile.js";
|
|
4
5
|
import { inUnicodeRanges } from "./python-unicode-profile.js";
|
|
5
6
|
class PythonFormatError extends Error {
|
|
@@ -20,49 +21,66 @@ function floatText(value) {
|
|
|
20
21
|
const text = String(value);
|
|
21
22
|
return text.includes(".") ? text : text + ".0";
|
|
22
23
|
}
|
|
23
|
-
function pythonText(profile, value, repr, ascii, host
|
|
24
|
+
function* pythonText(profile, value, repr, ascii, host) {
|
|
24
25
|
host.tick();
|
|
25
|
-
if (value === null)
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
if (typeof value === "
|
|
30
|
-
|
|
26
|
+
if (value === null) {
|
|
27
|
+
yield* "None";
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
if (typeof value === "number") {
|
|
31
|
+
yield* floatText(value);
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
if (typeof value === "boolean") {
|
|
35
|
+
yield* value ? "True" : "False";
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
31
38
|
if (typeof value === "object") {
|
|
32
39
|
if ("range" in value) {
|
|
33
|
-
//
|
|
34
|
-
|
|
35
|
-
const prefix = "<RangeRef object at 0x";
|
|
36
|
-
if (precision !== undefined && precision <= prefix.length)
|
|
37
|
-
return prefix.slice(0, precision);
|
|
40
|
+
// Precision may stop before the address, whose native bytes are unstable.
|
|
41
|
+
yield* "<RangeRef object at 0x";
|
|
38
42
|
throw new SsconvertError("unsupported-feature", "Unsupported ssconvert feature: Python RangeRef object representation");
|
|
39
43
|
}
|
|
40
|
-
|
|
44
|
+
yield "[";
|
|
45
|
+
for (let column = 0; column < value.columns.length; column++) {
|
|
46
|
+
if (column)
|
|
47
|
+
yield* ", ";
|
|
48
|
+
yield "[";
|
|
49
|
+
const cells = value.columns[column];
|
|
50
|
+
for (let row = 0; row < cells.length; row++) {
|
|
51
|
+
if (row)
|
|
52
|
+
yield* ", ";
|
|
53
|
+
yield* pythonText(profile, cells[row], true, ascii, host);
|
|
54
|
+
}
|
|
55
|
+
yield "]";
|
|
56
|
+
}
|
|
57
|
+
yield "]";
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
if (!repr) {
|
|
61
|
+
yield* value;
|
|
62
|
+
return;
|
|
41
63
|
}
|
|
42
|
-
if (!repr)
|
|
43
|
-
return value;
|
|
44
64
|
const quote = value.includes("'") && !value.includes('"') ? '"' : "'";
|
|
45
|
-
|
|
65
|
+
yield quote;
|
|
46
66
|
for (const char of value) {
|
|
47
67
|
host.tick();
|
|
48
68
|
const code = char.codePointAt(0);
|
|
49
69
|
if (char === quote || char === "\\")
|
|
50
|
-
|
|
70
|
+
yield* "\\" + char;
|
|
51
71
|
else if (char === "\n")
|
|
52
|
-
|
|
72
|
+
yield* "\\n";
|
|
53
73
|
else if (char === "\r")
|
|
54
|
-
|
|
74
|
+
yield* "\\r";
|
|
55
75
|
else if (char === "\t")
|
|
56
|
-
|
|
76
|
+
yield* "\\t";
|
|
57
77
|
else if (ascii && code > 127 || inUnicodeRanges(code, nonPrintable) || inUnicodeRanges(code, profile.nonPrintable))
|
|
58
|
-
|
|
78
|
+
yield* code <= 255 ? "\\x" + code.toString(16).padStart(2, "0") : code <= 65535 ?
|
|
59
79
|
"\\u" + code.toString(16).padStart(4, "0") : "\\U" + code.toString(16).padStart(8, "0");
|
|
60
80
|
else
|
|
61
|
-
|
|
62
|
-
if (result.length > host.context.limits.outputBytes)
|
|
63
|
-
throw new SsconvertError("resource-limit", "ssconvert calculation text limit exceeded");
|
|
81
|
+
yield char;
|
|
64
82
|
}
|
|
65
|
-
|
|
83
|
+
yield quote;
|
|
66
84
|
}
|
|
67
85
|
function pythonValue(value, host, argument = true) {
|
|
68
86
|
host.tick();
|
|
@@ -81,7 +99,7 @@ function pythonValue(value, host, argument = true) {
|
|
|
81
99
|
return { columns: Array.from({ length: rows[0]?.length ?? 0 }, (_, column) => rows.map(row => pythonValue(row[column], host, false))) };
|
|
82
100
|
}
|
|
83
101
|
// Both Python C-string acquisition and returned Gnumeric strings stop at NUL.
|
|
84
|
-
return typeof value.value === "string" ? value.
|
|
102
|
+
return typeof value.value === "string" ? rendered(value).split("\0", 1)[0] : value.value;
|
|
85
103
|
}
|
|
86
104
|
function decimalRatio(value) {
|
|
87
105
|
const view = new DataView(new ArrayBuffer(8));
|
|
@@ -234,16 +252,21 @@ export function pythonPrintf(profile, args, host) {
|
|
|
234
252
|
const value = take();
|
|
235
253
|
let text, sign = "", prefix = "", numeric = false;
|
|
236
254
|
if ("sra".includes(conversion)) {
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
for (
|
|
255
|
+
const representation = pythonText(profile, value, conversion !== "s", conversion === "a", host);
|
|
256
|
+
text = "";
|
|
257
|
+
try {
|
|
258
|
+
for (let count = 0; precision === undefined || count < precision; count++) {
|
|
241
259
|
host.tick();
|
|
242
|
-
|
|
260
|
+
const next = representation.next();
|
|
261
|
+
if (next.done)
|
|
243
262
|
break;
|
|
244
|
-
|
|
263
|
+
text += next.value;
|
|
264
|
+
if (text.length > limit)
|
|
265
|
+
throw new SsconvertError("resource-limit", "ssconvert calculation text limit exceeded");
|
|
245
266
|
}
|
|
246
|
-
|
|
267
|
+
}
|
|
268
|
+
finally {
|
|
269
|
+
representation.return(undefined);
|
|
247
270
|
}
|
|
248
271
|
}
|
|
249
272
|
else if (conversion === "c") {
|
|
@@ -7,6 +7,6 @@ export declare function encryptedBiffPropertyStream(streams: ReadonlyMap<string,
|
|
|
7
7
|
/** MS-OFFCRYPTO 2.3.5.4: header/table restart block 0; each payload restarts its
|
|
8
8
|
* descriptor block. These are not Workbook's absolute-position 1024-byte chunks. */
|
|
9
9
|
export declare function decryptBiffPropertyContainer(encrypted: Uint8Array, keyStream: (block: number, length: number) => Uint8Array, context: CapabilityContext, charge: (amount: number) => void, createCipher?: (block: number) => BiffRc4Cipher): ReadonlyMap<string, Uint8Array>;
|
|
10
|
-
/** Decrypt retained ciphertext directly into caller storage.
|
|
11
|
-
*
|
|
10
|
+
/** Decrypt retained ciphertext and descriptor bytes directly into caller storage.
|
|
11
|
+
* Parsed descriptors, duplicate names and overlap order use caller-backed indexes. */
|
|
12
12
|
export declare function decryptBiffPropertySources(encrypted: Uint8Array | RangeSource, createCipher: (block: number) => BiffRc4Cipher, context: CapabilityContext, charge: (amount: number) => void): Promise<ReadonlyMap<string, BiffPropertySource>>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { BiffPropertyDescriptorIndex } from "./biff-property-index.js";
|
|
1
2
|
import { SsconvertError } from "../spreadsheet-engine/contracts.js";
|
|
2
3
|
import { stagePropertyBytes } from "./biff-property-bytes.js";
|
|
3
4
|
import { Binary, invalidBiff } from "./biff-binary.js";
|
|
@@ -105,7 +106,27 @@ export function decryptBiffPropertyContainer(encrypted, keyStream, context, char
|
|
|
105
106
|
if (encrypted.length > context.limits.inputBytes)
|
|
106
107
|
throw new SsconvertError("resource-limit", "ssconvert encrypted BIFF property input limit exceeded");
|
|
107
108
|
const source = new Binary(encrypted), { offset, size } = propertyTableRange(decrypt(source.slice(0, 8), 0), source);
|
|
108
|
-
const
|
|
109
|
+
const table = new Binary(decrypt(source.slice(offset, size), 0));
|
|
110
|
+
const reader = readEncryptedPropertyDescriptors(source, offset, size, context, charge);
|
|
111
|
+
const descriptors = [], names = new Set();
|
|
112
|
+
let step = reader.next();
|
|
113
|
+
while (!step.done) {
|
|
114
|
+
if ("entry" in step.value) {
|
|
115
|
+
const entry = step.value.entry, name = entry.name.toUpperCase();
|
|
116
|
+
if (names.has(name))
|
|
117
|
+
invalidBiff("duplicate or invalid encrypted property stream name");
|
|
118
|
+
names.add(name);
|
|
119
|
+
descriptors.push(entry);
|
|
120
|
+
step = reader.next(new Uint8Array());
|
|
121
|
+
}
|
|
122
|
+
else
|
|
123
|
+
step = reader.next(table.slice(step.value.at, step.value.size));
|
|
124
|
+
}
|
|
125
|
+
table.bytes.fill(0);
|
|
126
|
+
const ordered = [...descriptors].sort((a, b) => a.offset - b.offset);
|
|
127
|
+
for (let i = 1; i < ordered.length; i++)
|
|
128
|
+
if (ordered[i].offset < ordered[i - 1].offset + ordered[i - 1].size)
|
|
129
|
+
invalidBiff("overlapping encrypted property payloads");
|
|
109
130
|
for (const entry of descriptors)
|
|
110
131
|
result.set(entry.name, decrypt(source.slice(entry.offset, entry.size), entry.block));
|
|
111
132
|
return result;
|
|
@@ -123,62 +144,65 @@ function propertyTableRange(bytes, source) {
|
|
|
123
144
|
source.check(offset, size);
|
|
124
145
|
return { offset, size };
|
|
125
146
|
}
|
|
126
|
-
function readEncryptedPropertyDescriptors(source, offset, size,
|
|
127
|
-
const
|
|
147
|
+
function* readEncryptedPropertyDescriptors(source, offset, size, context, charge) {
|
|
148
|
+
const count = new Binary(yield { at: 0, size: 4 }).u32(0);
|
|
128
149
|
if (count > Math.floor((size - 4) / 18))
|
|
129
150
|
invalidBiff("invalid encrypted property descriptor count");
|
|
130
151
|
if (count > (context.limits.workbookNodes ?? context.limits.inputBytes))
|
|
131
152
|
throw new SsconvertError("resource-limit", "ssconvert encrypted BIFF property node limit exceeded");
|
|
132
153
|
charge(count);
|
|
133
154
|
let at = 4, textBytes = 0;
|
|
134
|
-
const descriptors = [], names = new Set();
|
|
135
155
|
for (let i = 0; i < count; i++) {
|
|
136
156
|
context.signal.throwIfAborted();
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
157
|
+
const entry = new Binary(yield { at, size: 18 });
|
|
158
|
+
entry.check(0, 18);
|
|
159
|
+
const start = entry.u32(0), length = entry.u32(4), block = entry.u16(8), nameLength = entry.u8(10), flags = entry.u8(11);
|
|
160
|
+
if (flags !== 1 || entry.u32(12) !== 0)
|
|
140
161
|
invalidBiff("invalid encrypted property descriptor flags");
|
|
141
162
|
at += 16;
|
|
142
163
|
if (!nameLength || nameLength > 31)
|
|
143
164
|
invalidBiff("invalid encrypted property stream name");
|
|
144
|
-
|
|
165
|
+
const nameBytes = new Binary(yield { at, size: (nameLength + 1) * 2 });
|
|
166
|
+
nameBytes.check(0, (nameLength + 1) * 2);
|
|
145
167
|
charge(nameLength);
|
|
146
|
-
if (
|
|
168
|
+
if (nameBytes.u16(nameLength * 2) !== 0)
|
|
147
169
|
invalidBiff("unterminated encrypted property stream name");
|
|
148
170
|
textBytes += nameLength * 3;
|
|
149
171
|
if (textBytes > (context.limits.workbookTextBytes ?? context.limits.inputBytes))
|
|
150
172
|
throw new SsconvertError("resource-limit", "ssconvert encrypted BIFF property text limit exceeded");
|
|
151
173
|
let name;
|
|
152
174
|
try {
|
|
153
|
-
name = new TextDecoder("utf-16le", { fatal: true, ignoreBOM: true }).decode(
|
|
175
|
+
name = new TextDecoder("utf-16le", { fatal: true, ignoreBOM: true }).decode(nameBytes.slice(0, nameLength * 2));
|
|
154
176
|
}
|
|
155
177
|
catch {
|
|
156
178
|
invalidBiff("invalid encrypted property stream name");
|
|
157
179
|
}
|
|
158
|
-
if (name.includes("\0")
|
|
180
|
+
if (name.includes("\0"))
|
|
159
181
|
invalidBiff("duplicate or invalid encrypted property stream name");
|
|
160
|
-
names.add(name.toUpperCase());
|
|
161
182
|
at += (nameLength + 1) * 2;
|
|
162
183
|
source.check(start, length);
|
|
163
184
|
if (start < 8 || start < offset + size && start + length > offset)
|
|
164
185
|
invalidBiff("overlapping encrypted property ranges");
|
|
165
|
-
|
|
186
|
+
yield { entry: { offset: start, size: length, block, name } };
|
|
166
187
|
}
|
|
167
188
|
if (at !== size)
|
|
168
189
|
invalidBiff("invalid encrypted property descriptor size");
|
|
169
|
-
table.bytes.fill(0);
|
|
170
190
|
charge(count * Math.ceil(Math.log2(count + 1)));
|
|
171
|
-
const ordered = [...descriptors].sort((a, b) => a.offset - b.offset);
|
|
172
|
-
for (let i = 1; i < ordered.length; i++)
|
|
173
|
-
if (ordered[i].offset < ordered[i - 1].offset + ordered[i - 1].size)
|
|
174
|
-
invalidBiff("overlapping encrypted property payloads");
|
|
175
|
-
return descriptors;
|
|
176
191
|
}
|
|
177
|
-
/** Decrypt retained ciphertext directly into caller storage.
|
|
178
|
-
*
|
|
192
|
+
/** Decrypt retained ciphertext and descriptor bytes directly into caller storage.
|
|
193
|
+
* Parsed descriptors, duplicate names and overlap order use caller-backed indexes. */
|
|
179
194
|
export async function decryptBiffPropertySources(encrypted, createCipher, context, charge) {
|
|
180
195
|
const result = new Map(), owned = [];
|
|
181
196
|
const input = propertyRange(encrypted, context);
|
|
197
|
+
let indexStorage;
|
|
198
|
+
let indexClosing;
|
|
199
|
+
const retireIndex = () => {
|
|
200
|
+
if (!indexStorage)
|
|
201
|
+
return indexClosing ?? Promise.resolve();
|
|
202
|
+
const storage = indexStorage;
|
|
203
|
+
indexStorage = undefined;
|
|
204
|
+
return indexClosing = storage.close();
|
|
205
|
+
};
|
|
182
206
|
let closed = false;
|
|
183
207
|
const check = () => { context.signal.throwIfAborted(); if (closed)
|
|
184
208
|
throw new SsconvertError("invalid-request", "Encrypted BIFF property reader disposed"); };
|
|
@@ -186,7 +210,7 @@ export async function decryptBiffPropertySources(encrypted, createCipher, contex
|
|
|
186
210
|
closed = true;
|
|
187
211
|
for (const bytes of owned)
|
|
188
212
|
bytes.fill(0);
|
|
189
|
-
const outcomes = await Promise.allSettled([...result.values()].map(source => source.close()));
|
|
213
|
+
const outcomes = await Promise.allSettled([...result.values()].map(source => source.close()).concat([retireIndex()]));
|
|
190
214
|
result.clear();
|
|
191
215
|
const errors = outcomes.filter((value) => value.status === "rejected").map(value => value.reason);
|
|
192
216
|
if (errors.length)
|
|
@@ -234,12 +258,50 @@ export async function decryptBiffPropertySources(encrypted, createCipher, contex
|
|
|
234
258
|
return output;
|
|
235
259
|
};
|
|
236
260
|
const { offset, size } = propertyTableRange(await decrypt(0, 8), input);
|
|
237
|
-
const
|
|
238
|
-
|
|
261
|
+
const table = await stagePropertyBytes({ length: size, chunks: () => chunks(offset, size, 0) }, context, context.limits.inputBytes);
|
|
262
|
+
let index;
|
|
263
|
+
try {
|
|
264
|
+
indexStorage = context.createWorkingStorage();
|
|
265
|
+
check();
|
|
266
|
+
index = new BiffPropertyDescriptorIndex(indexStorage, check);
|
|
267
|
+
const reader = readEncryptedPropertyDescriptors(input, offset, size, context, charge);
|
|
268
|
+
let step = reader.next();
|
|
269
|
+
while (!step.done) {
|
|
270
|
+
if ("entry" in step.value) {
|
|
271
|
+
await index.add(step.value.entry);
|
|
272
|
+
step = reader.next(new Uint8Array());
|
|
273
|
+
continue;
|
|
274
|
+
}
|
|
275
|
+
const bytes = await table.read(step.value.at, step.value.size, { signal: context.signal });
|
|
276
|
+
try {
|
|
277
|
+
check();
|
|
278
|
+
step = reader.next(bytes);
|
|
279
|
+
}
|
|
280
|
+
finally {
|
|
281
|
+
bytes.fill(0);
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
catch (error) {
|
|
286
|
+
try {
|
|
287
|
+
await table.close();
|
|
288
|
+
}
|
|
289
|
+
catch (cleanup) {
|
|
290
|
+
throw new AggregateError([error, cleanup], "Encrypted BIFF descriptor read and cleanup failed");
|
|
291
|
+
}
|
|
292
|
+
throw error;
|
|
293
|
+
}
|
|
294
|
+
await table.close();
|
|
295
|
+
check();
|
|
296
|
+
await index.validate();
|
|
297
|
+
check();
|
|
298
|
+
for await (const entry of index.entries()) {
|
|
239
299
|
const source = await stagePropertyBytes({ length: entry.size, chunks: () => chunks(entry.offset, entry.size, entry.block) }, context, context.limits.inputBytes);
|
|
240
300
|
result.set(entry.name, source);
|
|
241
301
|
check();
|
|
242
302
|
}
|
|
303
|
+
await retireIndex();
|
|
304
|
+
check();
|
|
243
305
|
return result;
|
|
244
306
|
}
|
|
245
307
|
catch (error) {
|
|
@@ -5,6 +5,7 @@ import { type BiffRecord } from "./biff-binary.js";
|
|
|
5
5
|
export declare function biffNode(name: string, attributes: Readonly<Record<string, ImportedValue>>, text?: string, children?: readonly ImportedValue[]): ImportedValue;
|
|
6
6
|
export declare const biffProtectionPermissions: readonly ["objects", "scenarios", "formatCells", "formatColumns", "formatRows", "insertColumns", "insertRows", "insertHyperlinks", "deleteColumns", "deleteRows", "selectLockedCells", "sort", "autoFilter", "pivotTables", "selectUnlockedCells"];
|
|
7
7
|
export declare const biffMetadataOpcodes: Set<number>;
|
|
8
|
+
export declare function biffHeaderParts(text: string): Readonly<Record<string, string>>;
|
|
8
9
|
/** Source-backed neutral records consumed by both existing workbook writers. */
|
|
9
10
|
interface BiffMetadata {
|
|
10
11
|
records: UnsupportedRecord[];
|
|
@@ -11,7 +11,7 @@ export const biffProtectionPermissions = ["objects", "scenarios", "formatCells",
|
|
|
11
11
|
"sort", "autoFilter", "pivotTables", "selectUnlockedCells"];
|
|
12
12
|
export const biffMetadataOpcodes = new Set([0x2a, 0x2b, 0x25, 0x225, 0x81, 0x83, 0x84, 0xa1, 0x55, 0x23e, 0x3e,
|
|
13
13
|
0x1d, 0x1a, 0x1b, 0x41, 0xa0, 0x867, 0x1c, 0x1b6]);
|
|
14
|
-
function
|
|
14
|
+
export function biffHeaderParts(text) {
|
|
15
15
|
const values = { Left: "", Middle: "", Right: "" };
|
|
16
16
|
const substitutions = { P: "&[PAGE]", N: "&[PAGES]", D: "&[DATE]", T: "&[TIME]", F: "&[FILE]", A: "&[TAB]", Z: "&[PATH]" };
|
|
17
17
|
let side = "Left";
|
|
@@ -234,7 +234,7 @@ function* metadataSteps(length, revision, codepage, context) {
|
|
|
234
234
|
result.push({ source: "Gnumeric_XmlIO:sax", kind: "PrintInformation", disposition: "retained",
|
|
235
235
|
data: biffNode("PrintInformation", {}, "", [biffNode("Margins", {}, "", Object.entries(margins).map(([name, Points]) => biffNode(name, { Points, PrefUnit: "mm" }))),
|
|
236
236
|
biffNode("Scale", fitToPage ? { type: "fit", cols: fitColumns, rows: fitRows } : scale), ...Object.entries(print).map(([name, value]) => biffNode(name, { value })), biffNode("order", {}, order),
|
|
237
|
-
biffNode("orientation", {}, orientation), biffNode("Header",
|
|
237
|
+
biffNode("orientation", {}, orientation), biffNode("Header", biffHeaderParts(headerText)), biffNode("Footer", biffHeaderParts(footerText)),
|
|
238
238
|
biffNode("paper", {}, paper), biffNode("comments", { placement: commentPlacement }), biffNode("errors", { PrintErrorsAs: errorDisplay }), ...breaks]) });
|
|
239
239
|
if (objects.length)
|
|
240
240
|
result.push({ source: "Gnumeric_XmlIO:sax", kind: "Objects", disposition: "retained", data: biffNode("Objects", {}, "", objects) });
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { BiffPropertySource } from './biff-encrypted-properties-write.js';
|
|
2
|
+
import { type CapabilityContext, type RangeSource } from "../spreadsheet-engine/contracts.js";
|
|
2
3
|
import type { UnsupportedRecord, Workbook } from "../spreadsheet-ast/index.js";
|
|
3
4
|
/** Rebuild offsets around original opaque spans. Never transcode their codepage. */
|
|
4
|
-
export declare function mergeBiffProperties(book: Workbook, streams: Map<string, Uint8Array>, handled: Set<UnsupportedRecord>, context: CapabilityContext, charge: (amount: number) => void, allocate: (length: number) => Uint8Array
|
|
5
|
+
export declare function mergeBiffProperties(book: Workbook, streams: Map<string, Uint8Array | RangeSource>, handled: Set<UnsupportedRecord>, context: CapabilityContext, charge: (amount: number) => void, allocate: (length: number) => Uint8Array, staged?: {
|
|
6
|
+
sources: Map<string, BiffPropertySource>;
|
|
7
|
+
reserve: (length: number) => number;
|
|
8
|
+
}): Promise<ReadonlySet<string>>;
|