@poe-platform/safe-bash 0.1.815 → 0.1.816
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 +1 -1
- package/dist/mp4-ast/codecs.d.ts +3 -0
- package/dist/mp4-ast/esds-source.d.ts +7 -0
- package/dist/mp4-ast/index.d.ts +5 -1
- package/dist/mp4-ast/mp4-codec-metadata.d.ts +48 -0
- package/dist/mp4-ast/mp4-codec-source.d.ts +8 -0
- package/dist/mp4-ast/mp4-packets-source.d.ts +11 -0
- package/dist/pdf-ast/ast.d.ts +6 -0
- package/dist/pdf-ast/content/evaluator.d.ts +4 -1
- package/dist/pdf-ast/content/stored-dictionary.d.ts +15 -1
- package/dist/pdf-ast/content/stored-record.d.ts +6 -0
- package/dist/pdf-ast/cos/retained-writer.d.ts +1 -0
- package/dist/pdf-ast/cos/value-parser.d.ts +5 -0
- package/dist/pdf-ast/edit/retained-graph.d.ts +1 -0
- package/dist/pdf-ast/edit/retained-page-copy.d.ts +10 -0
- package/dist/pdf-ast/extract/images.d.ts +2 -1
- package/dist/pdf-ast/fonts/resolve.d.ts +1 -0
- package/dist/pdf-ast/index.d.ts +2 -0
- package/dist/pdf-ast/index.js +1091 -322
- package/dist/pdf-ast/render/raster.d.ts +14 -0
- package/dist/pdf-ast/render/svg-image-stream.d.ts +6 -0
- package/dist/pdf-ast/render/svg-path-stream.d.ts +15 -0
- package/dist/pdf-ast/retained-document.d.ts +1 -1
- package/dist/safe-bash/chunks/{chunk-I6ECNJMR.js → chunk-AXGI5JVL.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-TPG55BAQ.js → chunk-FQRI5AS5.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-TWWGAW4M.js → chunk-HD6DWOAC.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-5JCZEXEM.js → chunk-SXSEF5E2.js} +12 -7
- package/dist/safe-bash/command-chunks/biff-UBP2BZLK-JPODPKS3.js +5448 -0
- package/dist/safe-bash/command-chunks/{chunk-S7HIOT7Z.js → chunk-26JE5JEB.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-AG2SNMP5.js → chunk-2ALHVXEM.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-4YLACJHE.js → chunk-2IMIKROX.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-MYZ46FQL.js → chunk-2QZUAZTH.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-YAD7EV4N.js → chunk-2TWXRJPB.js} +11 -11
- package/dist/safe-bash/command-chunks/{chunk-NYFYTL5G.js → chunk-345YBIHP.js} +27 -27
- package/dist/safe-bash/command-chunks/{chunk-3MG5EAMX.js → chunk-35DU6I2M.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-FSVJ67G5.js → chunk-3DWFXESW.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-TKCUGMRZ.js → chunk-3K5CVXUV.js} +18 -18
- package/dist/safe-bash/command-chunks/{chunk-6LPSKLLD.js → chunk-3MUFXGA2.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-44F5TOHZ.js → chunk-3PM46VWH.js} +15 -15
- package/dist/safe-bash/command-chunks/{chunk-6QYSF7I2.js → chunk-3ZWFE4CK.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-NEYITAAO.js → chunk-45DKGZYO.js} +744 -328
- package/dist/safe-bash/command-chunks/{chunk-U3C6IT2C.js → chunk-4772DJKS.js} +14 -10
- package/dist/safe-bash/command-chunks/{chunk-FOONI6BD.js → chunk-4ABR3KGK.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-7KZ5LWV2.js → chunk-4IDV763L.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-FGGHYUWR.js → chunk-4QEJPP3K.js} +102 -7
- package/dist/safe-bash/command-chunks/{chunk-RV5AGXOV.js → chunk-4X2MPZXW.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-LNTEV56A.js → chunk-4YFTJS5U.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-6XES7Z4G.js → chunk-57PK2QFX.js} +12 -12
- package/dist/safe-bash/command-chunks/{chunk-42MEXZBJ.js → chunk-5GDF5FAS.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-BS3ZEQGT.js → chunk-5KZMR6AJ.js} +18 -16
- package/dist/safe-bash/command-chunks/{chunk-ZU2KJMXO.js → chunk-5MNQTHED.js} +10 -10
- package/dist/safe-bash/command-chunks/{chunk-W25EIKDJ.js → chunk-5NC2IQMQ.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-KY4LCHUF.js → chunk-5O45KGW5.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-GYM5ICK4.js → chunk-5V7WIQ2D.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-GPGLTWNR.js → chunk-5XUWGUGN.js} +16 -11
- package/dist/safe-bash/command-chunks/{chunk-SUTHGUD3.js → chunk-5YL453ZF.js} +34 -34
- package/dist/safe-bash/command-chunks/{chunk-IHXZMAMY.js → chunk-62RG3GHF.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-P2LT6TGR.js → chunk-6EZWG56T.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-CCMAHM3I.js → chunk-6JGICYHP.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-AWPI4DZR.js → chunk-6KJDTKE4.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-FUQMEUAT.js → chunk-6M3JTPKE.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-H33D4R26.js → chunk-6RLWPB44.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-3GRMU7TM.js → chunk-6W4RMBFH.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-RIVKF77R.js → chunk-6YF2QADH.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-LEO4VRIN.js → chunk-77ROD2TR.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-XNGM3W5R.js → chunk-7B2MHKIW.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-RFMHNTTF.js → chunk-7OCTMVYJ.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-DBLQUZGN.js → chunk-7PYDVQPB.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-AM5LANIE.js → chunk-A2L3U7DW.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-UYGQEQIP.js → chunk-A4P37F3P.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-ADHFF2IM.js → chunk-A5SPMSKD.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-ENEIE44W.js → chunk-A6OTPNNI.js} +3 -3
- package/dist/safe-bash/command-chunks/chunk-AF2IO57Q.js +733 -0
- package/dist/safe-bash/command-chunks/{chunk-AFPXADZG.js → chunk-AHD3CGAY.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-YW2VYN4V.js → chunk-ALD53QFL.js} +74 -27
- package/dist/safe-bash/command-chunks/{chunk-4B2ZUGLT.js → chunk-ARE267HR.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-OTF2AJ5M.js → chunk-AYQPJQJR.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-2VVJRVYM.js → chunk-B6XTAKKQ.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-GCHB7VNX.js → chunk-BIJW6QWB.js} +17 -17
- package/dist/safe-bash/command-chunks/{chunk-OVEPYULA.js → chunk-BKK4MS3V.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-3EB2FSAN.js → chunk-BOVDUJ3A.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-SEPUP6TZ.js → chunk-BSTABZIK.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-ATHHWPSE.js → chunk-BZRWZ6GO.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-BZMNC7Q5.js → chunk-CGJ7GMHO.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-RGDOYWOD.js → chunk-CHZE6FNT.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-V7E3PZOK.js → chunk-CKA7ZROU.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-MEM2ZPMI.js → chunk-CKIXC7AO.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-Y54L4P4J.js → chunk-CORUUCS2.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-QDVDBN2N.js → chunk-DBZCTL7C.js} +150 -35
- package/dist/safe-bash/command-chunks/{chunk-6ZGCKUAM.js → chunk-DIRK47GT.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-WYZG3DRR.js → chunk-DM5WURQL.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-EBHOZIBS.js → chunk-DOVWHVHI.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-ZIGENXGC.js → chunk-DXOXUKQB.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-JR3Q6QNL.js → chunk-DZOKH5BL.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-6EINUY5G.js → chunk-E22EAYJN.js} +54 -12
- package/dist/safe-bash/command-chunks/{chunk-3EASXF5D.js → chunk-E4TF5W6O.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-MLOYUXUV.js → chunk-EJ4UP7DA.js} +31 -9
- package/dist/safe-bash/command-chunks/{chunk-USGZN2KE.js → chunk-ENMJHB2C.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-ZSQZHFWS.js → chunk-ERWIJYCS.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-S2QNBAN6.js → chunk-ET6LMDEX.js} +12 -12
- package/dist/safe-bash/command-chunks/{chunk-6XGDWFNQ.js → chunk-EWC56JNI.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-EQWFKNHJ.js → chunk-EZDWPTYB.js} +19 -19
- package/dist/safe-bash/command-chunks/{chunk-CQBACD2V.js → chunk-F2NF6FHV.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-NFII726L.js → chunk-FAU2KL6I.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-4EHY6J2Z.js → chunk-FB2WPI3M.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-2PKBXGXD.js → chunk-FEBTT5NH.js} +5 -5
- package/dist/safe-bash/command-chunks/chunk-FGARVKAX.js +704 -0
- package/dist/safe-bash/command-chunks/{chunk-N4MUBJCT.js → chunk-FGHSE3RZ.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-WBKB7HBZ.js → chunk-FHQOFEQK.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-3ZRCL756.js → chunk-FJLSYX5P.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-PMWW7KSB.js → chunk-FJSD43VF.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-XKAUKLF7.js → chunk-FLSXHLJG.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-3EW7GYHM.js → chunk-FR63MJSO.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-NRFTYZ2R.js → chunk-FUYZUETI.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-JUHOL5KB.js → chunk-G3FK5VVG.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-4UPKVQWH.js → chunk-G3LUT475.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-Q7UZTMF4.js → chunk-GAROGIVU.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-4RRYWHED.js → chunk-GMBUOYTN.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-FYYFV6PW.js → chunk-GR4ONCQ5.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-XTEIT5CI.js → chunk-GTOMW4VV.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-OVQP6KH5.js → chunk-H56BSMFQ.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-RQYPFLZJ.js → chunk-HOJ7WDTS.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-BLIFGBIO.js → chunk-HOKPYTHQ.js} +2 -2
- package/dist/safe-bash/command-chunks/chunk-HQEYSSZV.js +152 -0
- package/dist/safe-bash/command-chunks/{chunk-NEMUPUUB.js → chunk-ICJH6A73.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-CSE4VQKG.js → chunk-IJE65P52.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-MKOIPOXX.js → chunk-IOXMGD2H.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-LDW3RF7Y.js → chunk-ISFGPCED.js} +12 -12
- package/dist/safe-bash/command-chunks/{chunk-S43QRKDC.js → chunk-IVKAFEPO.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-A347DLRB.js → chunk-IWVANZWH.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-ZXELXF2H.js → chunk-IZ3SD5S2.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-HGIMFVI2.js → chunk-J6FNSVHT.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-GLAF45M7.js → chunk-JA36YOZI.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-WHNYT34N.js → chunk-K2R7H3KO.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-HQ2UN2L2.js → chunk-K7VDCBXW.js} +21 -21
- package/dist/safe-bash/command-chunks/{chunk-CKEMZUE3.js → chunk-KDBU5Q2N.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-6VBDJC6V.js → chunk-KDDXLHN7.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-NEVQWOU6.js → chunk-KLAC2MIZ.js} +10 -10
- package/dist/safe-bash/command-chunks/{chunk-QGD64UHJ.js → chunk-KLCHCSIV.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-CXME4YHU.js → chunk-KM2SMMXZ.js} +59 -201
- package/dist/safe-bash/command-chunks/{chunk-RHU44OMN.js → chunk-KXM3HTAF.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-AVOGFREX.js → chunk-KYIGYYEY.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-5OM3UIK3.js → chunk-L2VLASZ4.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-Z7QOSXQC.js → chunk-LECGQSQW.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-RXQ2G2YK.js → chunk-LFSWLJPR.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-OSYY6E23.js → chunk-LJ3UYESS.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-MVLVIMJ6.js → chunk-LMLBQSAM.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-MGMTRGKM.js → chunk-LNAZ3E4Q.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-WJ2ERUCQ.js → chunk-LNKZVU5V.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-WWHMI4S3.js → chunk-LQDANF2B.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-CIRDVCAZ.js → chunk-LQX7RAF7.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-SWAKALDJ.js → chunk-LT2YCGC5.js} +10 -10
- package/dist/safe-bash/command-chunks/{chunk-Y7AXMCFV.js → chunk-LZY46GYY.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-VT2PHQ63.js → chunk-MDFNUNK5.js} +15 -15
- package/dist/safe-bash/command-chunks/{chunk-YP3WWV5N.js → chunk-MN3BB4WW.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-WTVJLHMG.js → chunk-MOUCMZZP.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-IB5QP4LF.js → chunk-MQE77MEQ.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-FSYMSWJU.js → chunk-MUTARE5I.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-F762XDNG.js → chunk-MZYQKH26.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-N6G3345Q.js → chunk-N32AP43V.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-XU6S3XUZ.js → chunk-N35IJXBK.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-EVYKV3QI.js → chunk-N3ZH4YYH.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-VUWXLH3E.js → chunk-N4HWOLGZ.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-WAT2562G.js → chunk-N5J3IZZK.js} +8042 -7189
- package/dist/safe-bash/command-chunks/{chunk-W3ZSWK76.js → chunk-NCNHJRIY.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-FXCSPPYE.js → chunk-NDALIHKK.js} +20 -20
- package/dist/safe-bash/command-chunks/{chunk-BS5JEUEW.js → chunk-NKK76B4V.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-4EZJV4FZ.js → chunk-NLCUQD7Y.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-RHDERFMR.js → chunk-O2HNOQQG.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-G2COZLXX.js → chunk-OBIXFO25.js} +10 -10
- package/dist/safe-bash/command-chunks/{chunk-47IAU25U.js → chunk-OCV5ZU35.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-3YEQI5B7.js → chunk-OFDJJRAD.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-VDTFVRYX.js → chunk-OFONWWEZ.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-F4YFTO2K.js → chunk-OHEZQ4QA.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-JW6WVNTM.js → chunk-OIHQXURE.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-ZTMZO4IT.js → chunk-ONQP4FNV.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-K2WOMJOQ.js → chunk-OVUY46QF.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-DGBQ7QDE.js → chunk-OWCBX5M2.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-LKGTH2Q7.js → chunk-P462JTNT.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-5LFGXN3D.js → chunk-P4OWVKMD.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-46AMTJPE.js → chunk-POGVOCOB.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-PLMF35XK.js → chunk-PPN53PX3.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-V5XC43BX.js → chunk-PRO7JOIH.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-UJERQEJB.js → chunk-PU5DMQGG.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-IWHNRYER.js → chunk-Q65GWGQR.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-BLGGAHQW.js → chunk-QCIAX6HZ.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-ET5SFGRH.js → chunk-QDV2NIFR.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-Y42KSX63.js → chunk-QMBMZSJF.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-KUOCGGEU.js → chunk-QNETPOMH.js} +6 -5
- package/dist/safe-bash/command-chunks/{chunk-QB72X7FF.js → chunk-QNX5LZBK.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-LZ2JFMKT.js → chunk-QOKFSYD5.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-7DOLY7IV.js → chunk-R7LF4XQV.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-6CDDKNNA.js → chunk-RINR7XPR.js} +36 -10
- package/dist/safe-bash/command-chunks/{chunk-MPXMRTMY.js → chunk-ROQ3VNVX.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-6WNVGCXD.js → chunk-RRAQII52.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-2BNGPR6Z.js → chunk-RTHYAGKI.js} +2 -2
- package/dist/safe-bash/command-chunks/chunk-RTKDZBJS.js +816 -0
- package/dist/safe-bash/command-chunks/{chunk-JVKE7YZN.js → chunk-RVWIEXR7.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-XM5QJCPD.js → chunk-S5ER73EA.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-YRPXBGRX.js → chunk-SBXS4S6Y.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-HI6ZYH3W.js → chunk-SHLT5R64.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-Q5PWYPQV.js → chunk-SICTBSLW.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-AXXZNB7U.js → chunk-SL4LD25A.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-JGKSWDGP.js → chunk-SNA2LVBX.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-TXPDKEGY.js → chunk-SWIF6BBY.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-PS5GDFIP.js → chunk-T2FRXSQT.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-HELAVGZH.js → chunk-T4SEQU66.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-3SPLP2DB.js → chunk-T5OQ53XS.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-KBAQHE5Y.js → chunk-TG2RVQLP.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-CZ5K2YPU.js → chunk-TXU7MMHN.js} +24 -24
- package/dist/safe-bash/command-chunks/{chunk-TYPS5MOU.js → chunk-TXWDR2P4.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-ETXPMVR6.js → chunk-TY7JXEWI.js} +11 -11
- package/dist/safe-bash/command-chunks/{chunk-X6OHFKBL.js → chunk-U42WHQRH.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-Z2WNYEPD.js → chunk-UFLMOU3B.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-2BLTUQNK.js → chunk-UJYXSLM6.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-Q7TVCBU2.js → chunk-UKAGRRLZ.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-4GQKCUS5.js → chunk-UPWLHHZ2.js} +13 -13
- package/dist/safe-bash/command-chunks/{chunk-5L4YGRQU.js → chunk-URQSUMMJ.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-KPHLESD4.js → chunk-UT5X6QRU.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-T5S4SJGO.js → chunk-V6JPIZUW.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-MKK6FM5H.js → chunk-VMZIAFVJ.js} +11 -11
- package/dist/safe-bash/command-chunks/{chunk-HK6MSB7Z.js → chunk-VNNNVT4C.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-ROL5AEX6.js → chunk-VVV45NLY.js} +1 -1
- package/dist/safe-bash/command-chunks/chunk-VVWHFNHD.js +502 -0
- package/dist/safe-bash/command-chunks/{chunk-KCLJGRU7.js → chunk-VZTVR3JI.js} +12 -12
- package/dist/safe-bash/command-chunks/{chunk-PLR5IULU.js → chunk-WDVPHDBH.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-MNK3DDH6.js → chunk-WH624PKJ.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-TJLXSENN.js → chunk-WHZ6XK7Y.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-DN6MSXY7.js → chunk-WIW3KDBS.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-GXMPXMDP.js → chunk-WMBELKPP.js} +11 -11
- package/dist/safe-bash/command-chunks/{chunk-NHNZYWPW.js → chunk-WMV5224N.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-RTNI47C5.js → chunk-WOL3LBXE.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-7SOE7XIS.js → chunk-WVD5WZXD.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-XMTR7QGL.js → chunk-X42MJT2J.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-XUJAQA3S.js → chunk-XBWD6SI3.js} +33 -33
- package/dist/safe-bash/command-chunks/{chunk-ZQM37BGE.js → chunk-XFIDOCYH.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-IBYMPAUW.js → chunk-XPQUUFQD.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-NQINS4XY.js → chunk-XVEI4HZL.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-KSBNZTAZ.js → chunk-YKODRSGT.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-WZRFS5OY.js → chunk-YXR4JE4U.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-DCMSPMMD.js → chunk-Z7UIOPHJ.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-AY3KQ4EN.js → chunk-ZAYTFXUX.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-DZH54L3F.js → chunk-ZM7HMBAJ.js} +10 -10
- package/dist/safe-bash/command-chunks/{chunk-NFGCBQN3.js → chunk-ZNCPIZCN.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-HKGNBH7Z.js → chunk-ZRHKXN6W.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-A45UG4KT.js → chunk-ZZERSKAR.js} +5 -5
- package/dist/safe-bash/command-chunks/{clipboard-BBDK33GP-QZ4ERNQX.js → clipboard-BBDK33GP-VB22F7GI.js} +2 -2
- package/dist/safe-bash/command-chunks/{command-engine-M7S4QIXV.js → command-engine-GHE6QUHU.js} +53 -21
- package/dist/safe-bash/command-chunks/{engine-YUYZJIB4-NZUDFEHL.js → engine-RG6HQCCB-FXYZS264.js} +1 -1
- package/dist/safe-bash/command-chunks/{gnumeric-UJPXWBVR-7VOHQAPM.js → gnumeric-UJPXWBVR-YPXTNEDZ.js} +2 -2
- package/dist/safe-bash/command-chunks/model-store-I7YAWL5V.js +54 -0
- package/dist/safe-bash/command-chunks/{xlsx-RE54MFCS-DI3F765V.js → xlsx-RE54MFCS-IQ6OXXKK.js} +1 -1
- package/dist/safe-bash/commands/bc/index.browser.js +1 -1
- package/dist/safe-bash/full-core.browser.js +4 -4
- package/dist/safe-bash/plugins/index.browser.js +3 -3
- package/dist/safe-bash/registry-entry.browser.js +2 -2
- package/dist/safe-bash/search.browser.js +1 -1
- package/dist/safe-bash/shell/runtime.d.ts +1 -0
- package/dist/safe-bash/shell/runtime.js +12 -3
- package/dist/safe-bash/shell/sync-extra-evaluators.js +7 -4
- package/dist/safe-bash/shell-entry.browser.js +2 -2
- package/dist/safe-bash-command-awk/awk-runtime.js +3 -3
- package/dist/safe-bash-command-awk/awk.js +4 -4
- package/dist/safe-bash-command-awk/index.js +4 -4
- package/dist/safe-bash-command-cp/index.js +3 -3
- 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 +3 -3
- package/dist/safe-bash-command-diff/sync.js +2 -2
- package/dist/safe-bash-command-factor/command.js +2 -2
- package/dist/safe-bash-command-factor/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.d.ts +5 -1
- package/dist/safe-bash-command-ffprobe/media.js +2 -2
- package/dist/safe-bash-command-getopt/command.js +2 -2
- package/dist/safe-bash-command-getopt/index.js +2 -2
- package/dist/safe-bash-command-html-to-markdown/index.js +51 -813
- package/dist/safe-bash-command-html-to-markdown/stored-destination.d.ts +8 -0
- package/dist/safe-bash-command-html-to-markdown/stored-destination.js +10 -0
- package/dist/safe-bash-command-html-to-markdown/stored-text.d.ts +4 -1
- package/dist/safe-bash-command-html-to-markdown/stored-text.js +1 -1
- package/dist/safe-bash-command-htmlq/index.js +1280 -419
- package/dist/safe-bash-command-iconv/command.js +2 -2
- package/dist/safe-bash-command-iconv/index.js +2 -2
- package/dist/safe-bash-command-llm/index.js +2 -2
- package/dist/safe-bash-command-llm/openai.js +2 -2
- package/dist/safe-bash-command-llm/providers/index.js +2 -2
- package/dist/safe-bash-command-llm/providers/openai.js +2 -2
- package/dist/safe-bash-command-node/commands/node/browser.js +4 -4
- package/dist/safe-bash-command-node/commands/node/default-runtime.js +4 -4
- package/dist/safe-bash-command-node/commands/node/safejs.js +4 -4
- package/dist/safe-bash-command-pandoc/command.js +10 -9
- package/dist/safe-bash-command-pandoc/index.js +60 -59
- package/dist/safe-bash-command-patch/index.js +6 -6
- package/dist/safe-bash-command-patch/patch-formats.js +3 -3
- package/dist/safe-bash-command-patch/patch-gnu-reject.js +1 -1
- package/dist/safe-bash-command-patch/patch.js +6 -6
- package/dist/safe-bash-command-patch/stored-patch.d.ts +7 -6
- package/dist/safe-bash-command-patch/unified.d.ts +5 -5
- package/dist/safe-bash-command-patch/unified.js +2 -2
- package/dist/safe-bash-command-pdftk/index.js +21 -108
- package/dist/safe-bash-command-pdftoppm/index.js +131 -27
- package/dist/safe-bash-command-playwright-cli/index.js +12 -12
- package/dist/safe-bash-command-playwright-cli/playwright/abilities.js +1 -1
- package/dist/safe-bash-command-playwright-cli/playwright/capability-events.js +1 -1
- package/dist/safe-bash-command-playwright-cli/playwright/capability-result.js +1 -1
- package/dist/safe-bash-command-playwright-cli/playwright/controller.js +7 -7
- package/dist/safe-bash-command-playwright-cli/playwright/download-capabilities.js +1 -1
- package/dist/safe-bash-command-playwright-cli/playwright/drop-capability.js +1 -1
- package/dist/safe-bash-command-playwright-cli/playwright/index.js +12 -12
- package/dist/safe-bash-command-playwright-cli/playwright/modal-capabilities.js +1 -1
- package/dist/safe-bash-command-playwright-cli/playwright/native-evaluation.js +1 -1
- package/dist/safe-bash-command-playwright-cli/playwright/native-json-snapshot.js +1 -1
- package/dist/safe-bash-command-playwright-cli/playwright/native-snapshot.js +1 -1
- package/dist/safe-bash-command-playwright-cli/playwright/open-options.js +2 -2
- package/dist/safe-bash-command-playwright-cli/playwright/profile.js +3 -3
- package/dist/safe-bash-command-playwright-cli/playwright/recording-capabilities.js +1 -1
- package/dist/safe-bash-command-playwright-cli/playwright/route-capabilities.js +1 -1
- package/dist/safe-bash-command-playwright-cli/playwright/snapshot.js +3 -3
- package/dist/safe-bash-command-playwright-cli/playwright/standard-capabilities.js +1 -1
- package/dist/safe-bash-command-playwright-cli/playwright/storage-capabilities.js +1 -1
- package/dist/safe-bash-command-playwright-cli/playwright/tracing-capabilities.js +1 -1
- package/dist/safe-bash-command-playwright-cli/playwright/webmcp-capabilities.js +1 -1
- package/dist/safe-bash-command-pptx/engine.js +1 -1
- package/dist/safe-bash-command-python/executor.js +11 -11
- package/dist/safe-bash-command-python/index.js +11 -11
- package/dist/safe-bash-command-python/jspi.js +2 -2
- package/dist/safe-bash-command-rg/index.js +3 -3
- package/dist/safe-bash-command-rg/rg-command.js +3 -3
- package/dist/safe-bash-command-safejs/index.js +4 -4
- package/dist/safe-bash-command-safejs/io.js +3 -3
- package/dist/safe-bash-command-safejs/render.js +2 -2
- package/dist/safe-bash-command-safejs/runtime.js +4 -4
- package/dist/safe-bash-command-soffice/index.js +5 -4
- package/dist/safe-bash-command-sort/index.js +3 -3
- package/dist/safe-bash-command-ssconvert/index.js +13 -13
- package/dist/safe-bash-command-tar/create.js +3 -3
- package/dist/safe-bash-command-tar/extract.js +3 -3
- package/dist/safe-bash-command-tar/index.js +7 -7
- package/dist/safe-bash-command-tar/modes.js +5 -5
- package/dist/safe-bash-command-unzip/index.js +2 -2
- package/dist/safe-bash-command-unzip/unzip.js +2 -2
- package/dist/safe-bash-command-xmllint/index.js +1 -1
- package/dist/safe-bash-command-xz/index.js +5 -5
- package/dist/safe-bash-compression-engine/files.js +5 -5
- package/dist/safe-bash-compression-engine/index.js +3 -3
- package/dist/safe-bash-compression-engine/operand.js +6 -6
- package/dist/safe-bash-compression-engine/stream.js +3 -3
- package/dist/safe-bash-compression-engine/zstd-decode.js +2 -2
- package/dist/safe-bash-contracts/escaping.js +3 -3
- package/dist/safe-bash-contracts/filesystem-output.js +3 -3
- package/dist/safe-bash-contracts/index.js +10 -10
- package/dist/safe-bash-docx-engine/ancillary-resources.js +9 -9
- package/dist/safe-bash-docx-engine/batch-operations.js +66 -66
- package/dist/safe-bash-docx-engine/batch-result-schema.js +78 -78
- package/dist/safe-bash-docx-engine/batch.js +77 -77
- package/dist/safe-bash-docx-engine/bookmarks.js +17 -17
- package/dist/safe-bash-docx-engine/charts.js +10 -10
- package/dist/safe-bash-docx-engine/command-option-rules.js +5 -5
- package/dist/safe-bash-docx-engine/command-properties.js +3 -3
- package/dist/safe-bash-docx-engine/comments.js +25 -25
- package/dist/safe-bash-docx-engine/control-bindings.js +20 -20
- package/dist/safe-bash-docx-engine/control-repeat.js +20 -20
- package/dist/safe-bash-docx-engine/controls.js +18 -18
- package/dist/safe-bash-docx-engine/create.js +10 -10
- package/dist/safe-bash-docx-engine/diagrams.js +10 -10
- package/dist/safe-bash-docx-engine/diff.js +12 -12
- package/dist/safe-bash-docx-engine/document-properties.js +15 -15
- package/dist/safe-bash-docx-engine/equations.js +16 -16
- package/dist/safe-bash-docx-engine/extract.js +13 -13
- package/dist/safe-bash-docx-engine/fields.js +22 -22
- package/dist/safe-bash-docx-engine/font-inventory.js +17 -17
- package/dist/safe-bash-docx-engine/font-resources.js +5 -5
- package/dist/safe-bash-docx-engine/image-batch-operations.js +13 -13
- package/dist/safe-bash-docx-engine/image-insertion.js +20 -20
- package/dist/safe-bash-docx-engine/image-layout.js +18 -18
- package/dist/safe-bash-docx-engine/image-replacement.js +21 -21
- package/dist/safe-bash-docx-engine/images.js +18 -18
- package/dist/safe-bash-docx-engine/index.js +113 -113
- package/dist/safe-bash-docx-engine/inspection.js +19 -19
- package/dist/safe-bash-docx-engine/invocation.js +8 -8
- package/dist/safe-bash-docx-engine/io.js +8 -8
- package/dist/safe-bash-docx-engine/links.js +20 -20
- package/dist/safe-bash-docx-engine/lists.js +19 -19
- package/dist/safe-bash-docx-engine/locations.js +14 -14
- package/dist/safe-bash-docx-engine/notes.js +21 -21
- package/dist/safe-bash-docx-engine/objects.js +18 -18
- 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 +13 -13
- package/dist/safe-bash-docx-engine/package-view-batch-operations.js +21 -21
- package/dist/safe-bash-docx-engine/pandoc-adapter.js +28 -28
- package/dist/safe-bash-docx-engine/paragraph-edit.js +24 -24
- 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 +8 -8
- package/dist/safe-bash-docx-engine/removal.js +20 -20
- package/dist/safe-bash-docx-engine/revision-decisions.js +21 -21
- package/dist/safe-bash-docx-engine/revision-edit.js +19 -19
- package/dist/safe-bash-docx-engine/revisions.js +17 -17
- package/dist/safe-bash-docx-engine/run-format.js +19 -19
- package/dist/safe-bash-docx-engine/sanitize.js +33 -33
- package/dist/safe-bash-docx-engine/sections.js +18 -18
- package/dist/safe-bash-docx-engine/settings.js +10 -10
- package/dist/safe-bash-docx-engine/shape-edit.js +20 -20
- package/dist/safe-bash-docx-engine/signatures.js +14 -14
- package/dist/safe-bash-docx-engine/stories.js +21 -21
- package/dist/safe-bash-docx-engine/structure-model-batch-operations.js +37 -37
- package/dist/safe-bash-docx-engine/style-model-batch-operations.js +26 -26
- package/dist/safe-bash-docx-engine/style-model-result-schema.js +43 -43
- package/dist/safe-bash-docx-engine/styles.js +17 -17
- package/dist/safe-bash-docx-engine/table-edit.js +26 -26
- package/dist/safe-bash-docx-engine/table-read.js +15 -15
- package/dist/safe-bash-docx-engine/template.js +21 -21
- package/dist/safe-bash-docx-engine/text-replace.js +19 -19
- package/dist/safe-bash-docx-engine/text-resource-read.js +15 -15
- package/dist/safe-bash-docx-engine/text.js +15 -15
- package/dist/safe-bash-docx-engine/validation.js +6 -6
- package/dist/safe-bash-docx-engine/xml-parts.js +21 -21
- package/dist/safe-bash-line-ending-engine/command.js +4 -4
- package/dist/safe-bash-line-ending-engine/index.js +7 -7
- package/dist/safe-bash-markdown-engine/commonmark-blocks.js +3 -3
- package/dist/safe-bash-markdown-engine/commonmark-inlines.js +3 -3
- package/dist/safe-bash-markdown-engine/gfm-syntax.js +2 -2
- package/dist/safe-bash-markdown-engine/index.js +4 -4
- package/dist/safe-bash-network-engine/aggregate.js +3 -3
- package/dist/safe-bash-network-engine/args.js +3 -3
- package/dist/safe-bash-network-engine/body.js +4 -4
- package/dist/safe-bash-network-engine/decode.js +3 -3
- package/dist/safe-bash-network-engine/fetch-transport.js +3 -3
- package/dist/safe-bash-network-engine/index.js +3 -3
- package/dist/safe-bash-network-engine/output.js +3 -3
- package/dist/safe-bash-network-engine/platform-portable.js +3 -3
- package/dist/safe-bash-network-engine/shared.js +2 -2
- package/dist/safe-bash-network-engine/transfer.js +9 -9
- 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 +4 -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 +60 -58
- 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 +5 -4
- package/dist/safe-bash-presentation-engine/creation.js +7 -6
- package/dist/safe-bash-presentation-engine/diff.d.ts +1 -0
- package/dist/safe-bash-presentation-engine/diff.js +44 -33
- 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 +3 -2
- package/dist/safe-bash-presentation-engine/fields.js +17 -16
- package/dist/safe-bash-presentation-engine/font-metrics.js +4 -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 +5 -4
- package/dist/safe-bash-presentation-engine/images.js +19 -18
- package/dist/safe-bash-presentation-engine/index.js +135 -132
- package/dist/safe-bash-presentation-engine/layouts.js +16 -15
- package/dist/safe-bash-presentation-engine/length.js +4 -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 +18 -17
- package/dist/safe-bash-presentation-engine/ole-enum.js +5 -4
- package/dist/safe-bash-presentation-engine/ole-insertion.js +20 -19
- package/dist/safe-bash-presentation-engine/opaque-objects.js +10 -9
- package/dist/safe-bash-presentation-engine/package-reader.js +6 -5
- package/dist/safe-bash-presentation-engine/package-tools.js +19 -18
- package/dist/safe-bash-presentation-engine/package-uri.js +4 -3
- package/dist/safe-bash-presentation-engine/package-writer.js +5 -4
- package/dist/safe-bash-presentation-engine/presentation-model.js +59 -57
- package/dist/safe-bash-presentation-engine/presentation-settings.js +14 -13
- package/dist/safe-bash-presentation-engine/properties.d.ts +2 -1
- package/dist/safe-bash-presentation-engine/properties.js +25 -15
- package/dist/safe-bash-presentation-engine/relationships.js +5 -4
- package/dist/safe-bash-presentation-engine/resource-limits.js +2 -1
- package/dist/safe-bash-presentation-engine/retained-diff.d.ts +56 -0
- package/dist/safe-bash-presentation-engine/retained-inspection.js +14 -13
- package/dist/safe-bash-presentation-engine/retained-package.js +6 -5
- package/dist/safe-bash-presentation-engine/retained-properties.d.ts +26 -0
- package/dist/safe-bash-presentation-engine/retained-text.js +33 -517
- package/dist/safe-bash-presentation-engine/sanitize.js +20 -16
- package/dist/safe-bash-presentation-engine/selectors.js +11 -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 +4 -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.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 +10 -9
- package/dist/safe-bash-presentation-engine/slides.js +19 -18
- 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 +12 -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.js +19 -18
- package/dist/safe-bash-presentation-engine/xml-view.js +4 -3
- package/dist/safe-bash-presentation-engine/xml.js +4 -3
- package/dist/safe-bash-query-engine/index.js +3 -3
- package/dist/safe-bash-query-engine/interpreter.js +2 -2
- package/dist/safe-bash-query-engine/query-core.js +3 -3
- package/dist/safe-bash-regex-engine/ere/matcher.js +3 -3
- 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.js +4 -4
- package/dist/safe-bash-xml-engine/json.js +14 -10
- package/dist/safe-bash-xml-engine/query.js +2 -2
- package/dist/safe-bash-xml-engine/stored-document.d.ts +4 -0
- package/dist/safe-bash-xml-engine/stored-document.js +1 -1
- package/dist/safe-bash-xml-engine/stored-evaluate.js +3 -3
- package/dist/safe-bash-zip-engine/index.js +2 -2
- package/dist/safe-bash-zip-engine/zip/repair.js +2 -2
- package/dist/safe-bash-zip-engine/zip/sfx.js +2 -2
- package/dist/safe-bash-zip-engine/zip-format.js +2 -2
- package/dist/spreadsheet-format-xls/biff-properties-merge.js +63 -67
- package/dist/spreadsheet-format-xls/biff-properties.js +3 -3
- package/dist/spreadsheet-format-xls/biff-property-transcode.d.ts +6 -1
- package/dist/spreadsheet-format-xls/biff-property-transcode.js +15 -4
- package/dist/spreadsheet-format-xls/biff-property-values.d.ts +6 -1
- package/dist/spreadsheet-format-xls/biff-property-values.js +81 -12
- package/dist/xlsx-ast/comment-geometry.d.ts +12 -0
- package/dist/xlsx-ast/comment-geometry.js +71 -0
- package/dist/xlsx-ast/xlsx-metadata.d.ts +1 -1
- package/dist/xlsx-ast/xlsx-metadata.js +27 -2
- package/dist/xlsx-ast/xlsx-write-metadata.js +9 -1
- package/dist/xlsx-ast/xlsx.js +9 -4
- package/package.json +5 -3
- package/dist/safe-bash/command-chunks/biff-A7XPBWAK-DCLG5QKF.js +0 -5417
- package/dist/safe-bash/command-chunks/chunk-DBNJEXHK.js +0 -387
- package/dist/safe-bash/command-chunks/chunk-EV5G535P.js +0 -240
- package/dist/safe-bash/command-chunks/model-store-UB5DWMAP.js +0 -54
- package/dist/safe-bash/command-chunks/{chunk-NGSO645G.js → chunk-3ZVK2OAY.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-W2FKFEVY.js → chunk-4YSBUQPV.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-UJSLBBQ7.js → chunk-5MFRN3CB.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-AW4Q3GZW.js → chunk-5QXRIZSS.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-KUGV3SSL.js → chunk-CZXYWGVO.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-JWORWL72.js → chunk-DX7KU6YU.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-Z37OM247.js → chunk-E3BL7W5C.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-RIKNMBLZ.js → chunk-FEKECRJP.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-D3HW7R2N.js → chunk-FTZFCMVI.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-KRRG4MGH.js → chunk-GEDO5V32.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-NBRXQUK7.js → chunk-M3OXQXCU.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-JRSZ5IGD.js → chunk-OAM2SUUI.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-HFKS6AET.js → chunk-OCOJMKDP.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-FMJKCVSQ.js → chunk-OOB7YCFQ.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-GGH376XQ.js → chunk-OU4VE5CR.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-DYERIXPU.js → chunk-QGTQJCKW.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-ZSQCROFE.js → chunk-RXXNLH7A.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-TI52LKLL.js → chunk-UVM6QG2H.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-BJXADHRT.js → chunk-WKU65Z3Q.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-KGKF5NM2.js → chunk-WOXLPDO6.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-Y5ADXWBQ.js → chunk-WXW665TV.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-FWCUEZ3K.js → chunk-WYBCSJFG.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-BXU5Y7I5.js → chunk-XI2LETBJ.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-LNLACEAN.js → chunk-Y3ZRIZL7.js} +3 -3
|
@@ -0,0 +1,733 @@
|
|
|
1
|
+
import {
|
|
2
|
+
openRetainedPresentationIndex,
|
|
3
|
+
stageRetainedOutput,
|
|
4
|
+
streamJson
|
|
5
|
+
} from "./chunk-FB2WPI3M.js";
|
|
6
|
+
import {
|
|
7
|
+
attr,
|
|
8
|
+
escape,
|
|
9
|
+
invalid,
|
|
10
|
+
loadShared,
|
|
11
|
+
nextRel
|
|
12
|
+
} from "./chunk-A5SPMSKD.js";
|
|
13
|
+
import {
|
|
14
|
+
SelectionError
|
|
15
|
+
} from "./chunk-NCNHJRIY.js";
|
|
16
|
+
import {
|
|
17
|
+
openRetainedPresentationValidation
|
|
18
|
+
} from "./chunk-6W4RMBFH.js";
|
|
19
|
+
import {
|
|
20
|
+
dialects
|
|
21
|
+
} from "./chunk-6KJDTKE4.js";
|
|
22
|
+
import {
|
|
23
|
+
parseXmlPart
|
|
24
|
+
} from "./chunk-7PYDVQPB.js";
|
|
25
|
+
import {
|
|
26
|
+
OfficeError,
|
|
27
|
+
RetainedValues,
|
|
28
|
+
characters,
|
|
29
|
+
equal,
|
|
30
|
+
folded,
|
|
31
|
+
literal,
|
|
32
|
+
openRetainedXmlDocument,
|
|
33
|
+
resolveOfficeResources
|
|
34
|
+
} from "./chunk-KM2SMMXZ.js";
|
|
35
|
+
import {
|
|
36
|
+
readJsonNumber
|
|
37
|
+
} from "./chunk-NUGQQDGE.js";
|
|
38
|
+
|
|
39
|
+
// packages/safe-bash-presentation-engine/src/property-value.ts
|
|
40
|
+
function decodePropertyValue(type, value) {
|
|
41
|
+
if (type === "number")
|
|
42
|
+
return value.trim() !== "" && Number.isFinite(Number(value)) ? Number(value) : null;
|
|
43
|
+
if (type === "boolean")
|
|
44
|
+
return value === "true" || value === "1" ? true : value === "false" || value === "0" ? false : null;
|
|
45
|
+
if (type === "date") {
|
|
46
|
+
const segments = value.split("T");
|
|
47
|
+
if (segments.length > 2) return null;
|
|
48
|
+
const calendar = segments[0].split("-");
|
|
49
|
+
if (calendar.length > 3 || calendar[0]?.length !== 4 || calendar.some(
|
|
50
|
+
(v, i) => v.length !== (i === 0 ? 4 : 2) || [...v].some((c) => c < "0" || c > "9")
|
|
51
|
+
))
|
|
52
|
+
return null;
|
|
53
|
+
const year = Number(calendar[0]), month = Number(calendar[1] ?? 1), day = Number(calendar[2] ?? 1);
|
|
54
|
+
const leap = year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
|
|
55
|
+
if (year < 1 || month < 1 || month > 12 || day < 1 || day > [31, leap ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month - 1])
|
|
56
|
+
return null;
|
|
57
|
+
if (segments.length === 2 && (calendar.length !== 3 || !(value.endsWith("Z") || value.slice(19).includes("+") || value.slice(19).includes("-"))))
|
|
58
|
+
return null;
|
|
59
|
+
const date = new Date(
|
|
60
|
+
segments.length === 1 ? `${calendar[0]}-${calendar[1] ?? "01"}-${calendar[2] ?? "01"}T00:00:00Z` : value
|
|
61
|
+
);
|
|
62
|
+
return Number.isFinite(date.getTime()) ? date.toISOString().slice(0, 19) + "Z" : null;
|
|
63
|
+
}
|
|
64
|
+
return value;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// packages/safe-bash-presentation-engine/src/properties.ts
|
|
68
|
+
import { SaxesParser } from "saxes";
|
|
69
|
+
|
|
70
|
+
// packages/safe-bash-presentation-engine/src/retained-properties.ts
|
|
71
|
+
import { PagedStorage } from "@poe-platform/safe-fs/storage";
|
|
72
|
+
|
|
73
|
+
// packages/safe-bash-presentation-engine/src/retained-property-value.ts
|
|
74
|
+
async function readRetainedPropertyValue(type, source, check) {
|
|
75
|
+
if (type !== "number") {
|
|
76
|
+
let value2 = "", overflow = false, fraction = false, fractionDigits = 0;
|
|
77
|
+
const limit = type === "boolean" ? 5 : 128;
|
|
78
|
+
for await (const character of characters(source)) {
|
|
79
|
+
check();
|
|
80
|
+
if (overflow) continue;
|
|
81
|
+
if (type === "date") {
|
|
82
|
+
if (fraction && character >= "0" && character <= "9") {
|
|
83
|
+
if (fractionDigits++ < 3) value2 += character;
|
|
84
|
+
continue;
|
|
85
|
+
}
|
|
86
|
+
fraction = value2.length === 19 && character === ".";
|
|
87
|
+
}
|
|
88
|
+
if (value2.length >= limit) overflow = true;
|
|
89
|
+
else value2 += character;
|
|
90
|
+
}
|
|
91
|
+
check();
|
|
92
|
+
return overflow ? null : decodePropertyValue(type, value2);
|
|
93
|
+
}
|
|
94
|
+
let state = "start";
|
|
95
|
+
let invalid2 = false, trailing = false, signed = false, firstZero = false, integerDigits = 0, radix = 0, radixDigits = 0, prefix = "", radixOverflow = false;
|
|
96
|
+
async function* decimal() {
|
|
97
|
+
for await (const character of characters(source)) {
|
|
98
|
+
check();
|
|
99
|
+
if (invalid2) continue;
|
|
100
|
+
if (character.trim() === "") {
|
|
101
|
+
if (state !== "start") trailing = true;
|
|
102
|
+
continue;
|
|
103
|
+
}
|
|
104
|
+
if (trailing) {
|
|
105
|
+
invalid2 = true;
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
const digit = character >= "0" && character <= "9";
|
|
109
|
+
if (state === "radix") {
|
|
110
|
+
const code = character.toLowerCase().charCodeAt(0), value2 = digit ? code - 48 : code >= 97 && code <= 102 ? code - 87 : Infinity;
|
|
111
|
+
if (value2 >= radix) {
|
|
112
|
+
invalid2 = true;
|
|
113
|
+
continue;
|
|
114
|
+
}
|
|
115
|
+
radixDigits++;
|
|
116
|
+
if (prefix || value2) {
|
|
117
|
+
if (prefix.length < 1024) prefix += character;
|
|
118
|
+
else radixOverflow = true;
|
|
119
|
+
}
|
|
120
|
+
continue;
|
|
121
|
+
}
|
|
122
|
+
if (state === "start" || state === "sign") {
|
|
123
|
+
if (state === "start" && (character === "+" || character === "-")) {
|
|
124
|
+
signed = true;
|
|
125
|
+
state = "sign";
|
|
126
|
+
yield character;
|
|
127
|
+
continue;
|
|
128
|
+
}
|
|
129
|
+
if (digit) {
|
|
130
|
+
state = "integer";
|
|
131
|
+
integerDigits = 1;
|
|
132
|
+
firstZero = character === "0";
|
|
133
|
+
} else if (character === ".") state = "dot";
|
|
134
|
+
else invalid2 = true;
|
|
135
|
+
} else if (state === "integer") {
|
|
136
|
+
if (digit) integerDigits++;
|
|
137
|
+
else if (!signed && firstZero && integerDigits === 1 && ["x", "b", "o"].includes(character.toLowerCase())) {
|
|
138
|
+
radix = { x: 16, b: 2, o: 8 }[character.toLowerCase()];
|
|
139
|
+
state = "radix";
|
|
140
|
+
continue;
|
|
141
|
+
} else if (character === ".") state = "fraction";
|
|
142
|
+
else if (character === "e" || character === "E") state = "exponent";
|
|
143
|
+
else invalid2 = true;
|
|
144
|
+
} else if (state === "dot") {
|
|
145
|
+
if (digit) state = "fraction";
|
|
146
|
+
else invalid2 = true;
|
|
147
|
+
} else if (state === "fraction") {
|
|
148
|
+
if (character === "e" || character === "E") state = "exponent";
|
|
149
|
+
else if (!digit) invalid2 = true;
|
|
150
|
+
} else if (state === "exponent" || state === "exponent-sign") {
|
|
151
|
+
if (digit) state = "exponent-digits";
|
|
152
|
+
else if (state === "exponent" && (character === "+" || character === "-")) state = "exponent-sign";
|
|
153
|
+
else invalid2 = true;
|
|
154
|
+
} else if (!digit) invalid2 = true;
|
|
155
|
+
if (!invalid2) yield character;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
const value = await readJsonNumber(decimal(), async () => {
|
|
159
|
+
check();
|
|
160
|
+
}, false);
|
|
161
|
+
check();
|
|
162
|
+
if (invalid2 || ["start", "sign", "dot", "exponent", "exponent-sign"].includes(state)) return null;
|
|
163
|
+
if (radix) {
|
|
164
|
+
if (!radixDigits || radixOverflow) return null;
|
|
165
|
+
const result = Number(`0${radix === 16 ? "x" : radix === 8 ? "o" : "b"}${prefix || "0"}`);
|
|
166
|
+
return Number.isFinite(result) ? result : null;
|
|
167
|
+
}
|
|
168
|
+
return Number.isFinite(value) ? value : null;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
// packages/safe-bash-presentation-engine/src/retained-properties.ts
|
|
172
|
+
var coreNamespace = "http://schemas.openxmlformats.org/package/2006/metadata/core-properties";
|
|
173
|
+
var terms = "http://purl.org/dc/terms/";
|
|
174
|
+
var customNamespaces = ["http://schemas.openxmlformats.org/officeDocument/2006/custom-properties", "http://purl.oclc.org/ooxml/officeDocument/customProperties"];
|
|
175
|
+
var valueNamespaces = ["http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes", "http://purl.oclc.org/ooxml/officeDocument/docPropsVTypes"];
|
|
176
|
+
var types = ["unknown", "string", "number", "boolean", "date"];
|
|
177
|
+
var kinds = ["unknown", "core", "custom"];
|
|
178
|
+
async function openRetainedProperties(archive, fingerprint, query, settings) {
|
|
179
|
+
if (!query || typeof query !== "object" || ![Object.prototype, null].includes(Object.getPrototypeOf(query)) || Object.keys(query).some((key) => key !== "name")) throw new OfficeError("invalid-value", "Invalid property options.", "usage");
|
|
180
|
+
if (query.name !== void 0 && (typeof query.name !== "string" || !query.name)) throw new OfficeError("invalid-value", "Expected property name.", "usage");
|
|
181
|
+
const selected = query.name, context = resolveOfficeResources(settings), working = { ...settings.workingStorage }, signal = context.signal ?? new AbortController().signal;
|
|
182
|
+
const index = await openRetainedPresentationIndex(archive, fingerprint, { ...context, workingStorage: working });
|
|
183
|
+
const pages = new PagedStorage({ fs: working.fs, cwd: working.directory, env: {}, signal }, (working.cacheBytes ?? 1024 * 1024) / 16384);
|
|
184
|
+
let closed = false, closing, head = 0, tail = 0;
|
|
185
|
+
const check = () => {
|
|
186
|
+
if (closed) throw new OfficeError("invalid-handle", "Properties are closed.", "index");
|
|
187
|
+
if (signal.aborted) throw new OfficeError("cancelled", "Operation cancelled.", "index");
|
|
188
|
+
};
|
|
189
|
+
const close = () => {
|
|
190
|
+
closed = true;
|
|
191
|
+
return closing ??= (async () => {
|
|
192
|
+
const outcomes = await Promise.allSettled([index.close(), pages.close()]);
|
|
193
|
+
for (const outcome of outcomes) if (outcome.status === "rejected") throw outcome.reason;
|
|
194
|
+
})();
|
|
195
|
+
};
|
|
196
|
+
const values = new RetainedValues(pages, check, signal);
|
|
197
|
+
const range = (row2, offset) => ({ start: row2[offset], length: row2[offset + 1] });
|
|
198
|
+
async function row(pointer) {
|
|
199
|
+
check();
|
|
200
|
+
const bytes = await pages.read(pointer, 12 /* Count */ * 8), view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
201
|
+
return Array.from({ length: 12 /* Count */ }, (_, n) => view.getFloat64(n * 8, true));
|
|
202
|
+
}
|
|
203
|
+
async function write(pointer, numbers) {
|
|
204
|
+
check();
|
|
205
|
+
const bytes = new Uint8Array(numbers.length * 8), view = new DataView(bytes.buffer);
|
|
206
|
+
numbers.forEach((number, n) => view.setFloat64(n * 8, number, true));
|
|
207
|
+
await pages.write(pointer, bytes);
|
|
208
|
+
}
|
|
209
|
+
async function bounded(value) {
|
|
210
|
+
const decoder = new TextDecoder();
|
|
211
|
+
let result = "";
|
|
212
|
+
for await (const bytes of values.read(value)) result += decoder.decode(bytes, { stream: true });
|
|
213
|
+
return result + decoder.decode();
|
|
214
|
+
}
|
|
215
|
+
async function matches(document, node, local, namespace) {
|
|
216
|
+
return await equal(document.raw(node.localName), literal(local)) && await equal(document.namespace(node), literal(namespace));
|
|
217
|
+
}
|
|
218
|
+
async function attribute(document, node, local, namespace = "") {
|
|
219
|
+
for await (const attr2 of document.attributes(node)) if (await matches(document, attr2, local, namespace)) return attr2;
|
|
220
|
+
return void 0;
|
|
221
|
+
}
|
|
222
|
+
async function unknownType(document, node) {
|
|
223
|
+
const annotation = await attribute(document, node, "type", "http://www.w3.org/2001/XMLSchema-instance");
|
|
224
|
+
if (!annotation) return false;
|
|
225
|
+
if (!await equal(document.namespace(node), literal(terms))) return true;
|
|
226
|
+
let colons = 0, local = "";
|
|
227
|
+
for await (const char of characters(document.text(annotation))) {
|
|
228
|
+
if (char === ":") {
|
|
229
|
+
colons++;
|
|
230
|
+
local = "";
|
|
231
|
+
} else if (local.length <= 6) local += char;
|
|
232
|
+
}
|
|
233
|
+
if (colons > 1 || local !== "W3CDTF") return true;
|
|
234
|
+
async function* prefix() {
|
|
235
|
+
if (colons) for await (const char of characters(document.text(annotation))) {
|
|
236
|
+
if (char === ":") break;
|
|
237
|
+
yield* literal(char);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
const resolved = await document.resolveNamespace(node, prefix);
|
|
241
|
+
return !resolved || !await equal(resolved, literal(terms));
|
|
242
|
+
}
|
|
243
|
+
try {
|
|
244
|
+
const validation = await openRetainedPresentationValidation(archive, { ...context, workingStorage: working }, { ...context.xmlLimits, ...context.relationshipLimits, maxBytes: Math.min(context.xmlLimits.maxBytes, context.relationshipLimits.maxBytes), maxEntries: context.archiveLimits.maxMembers });
|
|
245
|
+
const valid = validation.valid;
|
|
246
|
+
try {
|
|
247
|
+
await validation.close();
|
|
248
|
+
} catch (error) {
|
|
249
|
+
if (valid) await Promise.reject(error);
|
|
250
|
+
}
|
|
251
|
+
if (!valid) throw new OfficeError("invalid-opc", "Invalid presentation graph.", "validate-intent");
|
|
252
|
+
for await (const part of archive.parts()) {
|
|
253
|
+
const key = await values.store(folded(literal(part))), value = await values.store(literal(part));
|
|
254
|
+
await values.insert("parts", key, value);
|
|
255
|
+
}
|
|
256
|
+
const main = await openRetainedXmlDocument(archive.read(index.records.main), { ...context, workingStorage: working });
|
|
257
|
+
let dialect = dialects[0], failed = false;
|
|
258
|
+
try {
|
|
259
|
+
for (const candidate of dialects) if (await equal(main.namespace(main.root), literal(candidate.p))) dialect = candidate;
|
|
260
|
+
} catch (error) {
|
|
261
|
+
failed = true;
|
|
262
|
+
throw error;
|
|
263
|
+
} finally {
|
|
264
|
+
try {
|
|
265
|
+
await main.close();
|
|
266
|
+
} catch (error) {
|
|
267
|
+
if (!failed) await Promise.reject(error);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
for await (const edge of index.inventory.relationships) {
|
|
271
|
+
if (edge.owner !== "/" || edge.external) continue;
|
|
272
|
+
const core = await equal(edge.type(), literal("http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties"));
|
|
273
|
+
if (!core && !await equal(edge.type(), literal(`${dialect.r}/custom-properties`))) continue;
|
|
274
|
+
const original = edge.targetPart ? await values.find("parts", () => folded(edge.targetPart())) : void 0;
|
|
275
|
+
if (!original) throw new OfficeError("missing-binding", "Package member is absent.", "index");
|
|
276
|
+
const part = await values.store(edge.targetPart());
|
|
277
|
+
const document = await openRetainedXmlDocument(archive.read(await bounded(original)), { ...context, workingStorage: working });
|
|
278
|
+
let failed2 = false;
|
|
279
|
+
try {
|
|
280
|
+
let admitted = core ? await matches(document, document.root, "coreProperties", coreNamespace) : false;
|
|
281
|
+
if (!core) {
|
|
282
|
+
for (const namespace of customNamespaces) if (await matches(document, document.root, "Properties", namespace)) admitted = true;
|
|
283
|
+
}
|
|
284
|
+
if (!admitted) throw new OfficeError("invalid-opc", "Invalid metadata root.", "index");
|
|
285
|
+
for await (const node of document.children(document.root)) {
|
|
286
|
+
if (node.kind !== "element") continue;
|
|
287
|
+
let definition;
|
|
288
|
+
if (core) {
|
|
289
|
+
for (const [name2, schema] of Object.entries(corePropertyDefinitions)) if (await matches(document, node, schema[1], schema[0])) {
|
|
290
|
+
definition = [name2, schema];
|
|
291
|
+
break;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
const custom2 = !core && await equal(document.namespace(node), document.namespace(document.root)) && await equal(document.raw(node.localName), literal("property"));
|
|
295
|
+
let valueNode, count = 0;
|
|
296
|
+
if (custom2) {
|
|
297
|
+
for await (const child of document.children(node)) if (child.kind === "element") {
|
|
298
|
+
valueNode = child;
|
|
299
|
+
count++;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
if (count !== 1) valueNode = void 0;
|
|
303
|
+
let type = definition?.[1][2] ?? "unknown";
|
|
304
|
+
if (!definition && valueNode) {
|
|
305
|
+
for (const namespace2 of valueNamespaces) for (const [local, value2] of Object.entries({ lpwstr: "string", lpstr: "string", bstr: "string", i4: "number", int: "number", r8: "number", bool: "boolean", filetime: "date" })) if (await matches(document, valueNode, local, namespace2)) type = value2;
|
|
306
|
+
}
|
|
307
|
+
if (await unknownType(document, node)) type = "unknown";
|
|
308
|
+
const nameAttribute = custom2 ? await attribute(document, node, "name") : void 0;
|
|
309
|
+
const name = await values.store(definition ? literal(definition[0]) : nameAttribute ? document.text(nameAttribute) : document.raw(node.localName));
|
|
310
|
+
const namespace = await values.store(document.namespace(node));
|
|
311
|
+
let value, scalar = false;
|
|
312
|
+
if (type === "string" || type === "unknown") value = await values.store(document.text(valueNode ?? node));
|
|
313
|
+
else {
|
|
314
|
+
const decoded = await readRetainedPropertyValue(type, document.text(valueNode ?? node), check);
|
|
315
|
+
scalar = typeof decoded !== "string";
|
|
316
|
+
value = await values.store(literal(scalar ? JSON.stringify(Object.is(decoded, -0) ? "-0" : decoded) : decoded));
|
|
317
|
+
}
|
|
318
|
+
const pointer = pages.allocate(12 /* Count */ * 8);
|
|
319
|
+
await write(pointer, [0, name.start, name.length, namespace.start, namespace.length, part.start, part.length, value.start, value.length, types.indexOf(type), kinds.indexOf(definition ? "core" : custom2 ? "custom" : "unknown"), Number(scalar)]);
|
|
320
|
+
if (tail) await write(tail, [pointer]);
|
|
321
|
+
else head = pointer;
|
|
322
|
+
tail = pointer;
|
|
323
|
+
}
|
|
324
|
+
} catch (error) {
|
|
325
|
+
failed2 = true;
|
|
326
|
+
throw error;
|
|
327
|
+
} finally {
|
|
328
|
+
try {
|
|
329
|
+
await document.close();
|
|
330
|
+
} catch (error) {
|
|
331
|
+
if (!failed2) await Promise.reject(error);
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
await index.close();
|
|
336
|
+
return Object.freeze({ close, async *records() {
|
|
337
|
+
check();
|
|
338
|
+
for (let pointer = head; pointer; ) {
|
|
339
|
+
const data = await row(pointer);
|
|
340
|
+
pointer = data[0 /* Next */];
|
|
341
|
+
if (selected !== void 0 && !await equal(values.read(range(data, 1 /* Name */)), literal(selected))) continue;
|
|
342
|
+
const scalar = data[11 /* Scalar */] ? JSON.parse(await bounded(range(data, 7 /* Value */))) : void 0;
|
|
343
|
+
yield { name: () => values.read(range(data, 1 /* Name */)), kind: kinds[data[10 /* Kind */]], type: types[data[9 /* Type */]], value: data[11 /* Scalar */] ? scalar === "-0" ? -0 : scalar : () => values.read(range(data, 7 /* Value */)), part: () => values.read(range(data, 5 /* Part */)), namespace: () => values.read(range(data, 3 /* Namespace */)) };
|
|
344
|
+
}
|
|
345
|
+
check();
|
|
346
|
+
} });
|
|
347
|
+
} catch (error) {
|
|
348
|
+
await close().catch(() => {
|
|
349
|
+
});
|
|
350
|
+
throw error instanceof OfficeError ? error : new OfficeError(signal.aborted ? "cancelled" : "io-failure", "Property storage operation failed.", "index");
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
async function stageRetainedProperties(archive, fingerprint, query, settings, output) {
|
|
354
|
+
const format = { ...output };
|
|
355
|
+
if (!["properties.list", "properties.get"].includes(format.operation)) throw new OfficeError("invalid-value", "Invalid property read operation.", "usage");
|
|
356
|
+
const properties = await openRetainedProperties(archive, fingerprint, query, settings);
|
|
357
|
+
let staged;
|
|
358
|
+
try {
|
|
359
|
+
if (format.operation === "properties.get") {
|
|
360
|
+
let count = 0;
|
|
361
|
+
for await (const ignoredRecord of properties.records()) count++;
|
|
362
|
+
if (count !== 1) throw new SelectionError(count ? "ambiguous-selection" : "missing-selection");
|
|
363
|
+
}
|
|
364
|
+
async function* render() {
|
|
365
|
+
if (format.json) {
|
|
366
|
+
yield* streamJson({ version: 1, operation: format.operation, ok: true, data: { properties: properties.records() }, affected: 0, warnings: [], errors: [], locations: [] });
|
|
367
|
+
yield* literal("\n");
|
|
368
|
+
} else for await (const property of properties.records()) {
|
|
369
|
+
yield* streamJson(property.name);
|
|
370
|
+
yield* literal(": ");
|
|
371
|
+
yield* streamJson(property.value);
|
|
372
|
+
yield* literal("\n");
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
staged = await stageRetainedOutput(render(), settings, format.maxOutputBytes);
|
|
376
|
+
await properties.close();
|
|
377
|
+
return staged;
|
|
378
|
+
} catch (error) {
|
|
379
|
+
await Promise.allSettled([properties.close(), staged?.close()]);
|
|
380
|
+
throw error;
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
// packages/safe-bash-presentation-engine/src/properties.ts
|
|
385
|
+
var cp = "http://schemas.openxmlformats.org/package/2006/metadata/core-properties";
|
|
386
|
+
var dc = "http://purl.org/dc/elements/1.1/";
|
|
387
|
+
var terms2 = "http://purl.org/dc/terms/";
|
|
388
|
+
var custom = "http://schemas.openxmlformats.org/officeDocument/2006/custom-properties";
|
|
389
|
+
var vt = "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes";
|
|
390
|
+
var strictCustom = "http://purl.oclc.org/ooxml/officeDocument/customProperties";
|
|
391
|
+
var strictVt = "http://purl.oclc.org/ooxml/officeDocument/docPropsVTypes";
|
|
392
|
+
var relationships = "http://schemas.openxmlformats.org/package/2006/relationships";
|
|
393
|
+
var corePropertyDefinitions = Object.freeze({
|
|
394
|
+
author: [dc, "creator", "string"],
|
|
395
|
+
category: [cp, "category", "string"],
|
|
396
|
+
comments: [dc, "description", "string"],
|
|
397
|
+
content_status: [cp, "contentStatus", "string"],
|
|
398
|
+
created: [terms2, "created", "date"],
|
|
399
|
+
identifier: [dc, "identifier", "string"],
|
|
400
|
+
keywords: [cp, "keywords", "string"],
|
|
401
|
+
language: [dc, "language", "string"],
|
|
402
|
+
last_modified_by: [cp, "lastModifiedBy", "string"],
|
|
403
|
+
last_printed: [cp, "lastPrinted", "date"],
|
|
404
|
+
modified: [terms2, "modified", "date"],
|
|
405
|
+
revision: [cp, "revision", "number"],
|
|
406
|
+
subject: [dc, "subject", "string"],
|
|
407
|
+
title: [dc, "title", "string"],
|
|
408
|
+
version: [cp, "version", "string"]
|
|
409
|
+
});
|
|
410
|
+
function coreDefinition(name) {
|
|
411
|
+
return Object.hasOwn(corePropertyDefinitions, name) ? corePropertyDefinitions[name] : void 0;
|
|
412
|
+
}
|
|
413
|
+
function text(doc, node) {
|
|
414
|
+
let value = "";
|
|
415
|
+
const parser = new SaxesParser({ xmlns: true });
|
|
416
|
+
parser.on("text", (s) => value += s);
|
|
417
|
+
parser.on("cdata", (s) => value += s);
|
|
418
|
+
parser.write(doc.markup(node, true)).close();
|
|
419
|
+
return value;
|
|
420
|
+
}
|
|
421
|
+
function validatePropertyValue(name, type, value) {
|
|
422
|
+
const known = coreDefinition(name);
|
|
423
|
+
for (const input of [name, ...typeof value === "string" ? [value] : []])
|
|
424
|
+
for (const c of input) {
|
|
425
|
+
const p = c.codePointAt(0);
|
|
426
|
+
if (p < 32 && p !== 9 && p !== 10 && p !== 13 || p >= 55296 && p <= 57343 || p === 65534 || p === 65535)
|
|
427
|
+
invalid("Invalid XML property text.");
|
|
428
|
+
}
|
|
429
|
+
if (!name || !["string", "number", "boolean", "date"].includes(type) || known && known[2] !== type)
|
|
430
|
+
invalid("Invalid property name or type.");
|
|
431
|
+
if (type === "string" && (typeof value !== "string" || known && [...value].length > 255))
|
|
432
|
+
invalid("Core strings allow at most 255 Unicode code points.");
|
|
433
|
+
if (type === "number" && (typeof value !== "number" || !Number.isFinite(value) || name === "revision" && (!Number.isSafeInteger(value) || value < 0)))
|
|
434
|
+
invalid("Invalid numeric property.");
|
|
435
|
+
if (type === "boolean" && typeof value !== "boolean") invalid("Expected a boolean property.");
|
|
436
|
+
if (type === "date") {
|
|
437
|
+
if (typeof value !== "string" || value.length !== 20 || value.startsWith("0000") || !value.endsWith("Z"))
|
|
438
|
+
invalid("Expected UTC date in whole seconds.");
|
|
439
|
+
const date = new Date(value);
|
|
440
|
+
if (!Number.isFinite(date.getTime()) || date.toISOString() !== value.slice(0, -1) + ".000Z")
|
|
441
|
+
invalid("Invalid UTC date.");
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
function parts(s) {
|
|
445
|
+
return s.index.inventory.relationships.filter(
|
|
446
|
+
(e) => e.owner === "/" && !e.external && (e.type === `${relationships}/metadata/core-properties` || e.type === `${s.r}/custom-properties`)
|
|
447
|
+
).map((e) => ({
|
|
448
|
+
part: e.targetPart,
|
|
449
|
+
kind: e.type === `${relationships}/metadata/core-properties` ? "core" : "custom"
|
|
450
|
+
}));
|
|
451
|
+
}
|
|
452
|
+
function records(s) {
|
|
453
|
+
return parts(s).flatMap(({ part, kind }) => {
|
|
454
|
+
const doc = s.doc(part);
|
|
455
|
+
if ((kind === "core" ? doc.root.name.namespace !== cp : ![custom, strictCustom].includes(doc.root.name.namespace)) || doc.root.name.localName !== (kind === "core" ? "coreProperties" : "Properties"))
|
|
456
|
+
throw new OfficeError("invalid-opc", "Invalid metadata root.", "index");
|
|
457
|
+
return doc.root.children.map((node) => {
|
|
458
|
+
const definition = kind === "core" ? Object.entries(corePropertyDefinitions).find(
|
|
459
|
+
([, d]) => d[0] === node.name.namespace && d[1] === node.name.localName
|
|
460
|
+
) : void 0;
|
|
461
|
+
const customNode = kind === "custom" && node.name.namespace === doc.root.name.namespace && node.name.localName === "property";
|
|
462
|
+
const valueNode = customNode && node.children.length === 1 ? node.children[0] : void 0;
|
|
463
|
+
const types2 = {
|
|
464
|
+
lpwstr: "string",
|
|
465
|
+
lpstr: "string",
|
|
466
|
+
bstr: "string",
|
|
467
|
+
i4: "number",
|
|
468
|
+
int: "number",
|
|
469
|
+
r8: "number",
|
|
470
|
+
bool: "boolean",
|
|
471
|
+
filetime: "date"
|
|
472
|
+
};
|
|
473
|
+
const type = unknownDeclaredType(doc, node) ? "unknown" : definition?.[1][2] ?? (valueNode && [vt, strictVt].includes(valueNode.name.namespace) && Object.hasOwn(types2, valueNode.name.localName) ? types2[valueNode.name.localName] : void 0) ?? "unknown";
|
|
474
|
+
const name = definition?.[0] ?? (customNode ? attr(node, "name") : void 0) ?? node.name.localName;
|
|
475
|
+
return {
|
|
476
|
+
doc,
|
|
477
|
+
node,
|
|
478
|
+
record: {
|
|
479
|
+
name,
|
|
480
|
+
kind: definition ? "core" : customNode ? "custom" : "unknown",
|
|
481
|
+
type,
|
|
482
|
+
value: decodePropertyValue(type, text(doc, valueNode ?? node)),
|
|
483
|
+
part,
|
|
484
|
+
namespace: node.name.namespace
|
|
485
|
+
}
|
|
486
|
+
};
|
|
487
|
+
});
|
|
488
|
+
});
|
|
489
|
+
}
|
|
490
|
+
function options(value, keys) {
|
|
491
|
+
if (!value || typeof value !== "object" || ![Object.prototype, null].includes(Object.getPrototypeOf(value)) || Object.keys(value).some((k) => !keys.includes(k)))
|
|
492
|
+
invalid("Invalid property options.");
|
|
493
|
+
}
|
|
494
|
+
async function readProperties(input, query, context) {
|
|
495
|
+
options(query, ["name"]);
|
|
496
|
+
if (query.name !== void 0 && (typeof query.name !== "string" || !query.name))
|
|
497
|
+
invalid("Expected property name.");
|
|
498
|
+
return records(await loadShared(input, context, false)).map((x) => x.record).filter((x) => query.name === void 0 || x.name === query.name);
|
|
499
|
+
}
|
|
500
|
+
function createPropertyPart(s, kind, context) {
|
|
501
|
+
let part = `/docProps/${kind}.xml`;
|
|
502
|
+
let suffix = 1;
|
|
503
|
+
while (s.reader.has(part)) part = `/docProps/${kind}${suffix++}.xml`;
|
|
504
|
+
const doc = parseXmlPart(
|
|
505
|
+
new TextEncoder().encode(
|
|
506
|
+
`<${kind === "core" ? "coreProperties" : "Properties"} xmlns="${kind === "core" ? cp : s.r.startsWith("http://purl.oclc.org/") ? strictCustom : custom}"/>`
|
|
507
|
+
),
|
|
508
|
+
context.xmlLimits
|
|
509
|
+
);
|
|
510
|
+
s.save(part, doc);
|
|
511
|
+
const rel = s.doc("/_rels/.rels");
|
|
512
|
+
s.save(
|
|
513
|
+
"/_rels/.rels",
|
|
514
|
+
rel.spliceChildren(rel.root, rel.root.children.length, 0, [
|
|
515
|
+
`<Relationship xmlns="${relationships}" Id="${nextRel(rel)}" Type="${kind === "core" ? `${relationships}/metadata/core-properties` : `${s.r}/custom-properties`}" Target="${part.slice(1)}"/>`
|
|
516
|
+
])
|
|
517
|
+
);
|
|
518
|
+
const types2 = s.doc("/[Content_Types].xml");
|
|
519
|
+
s.save(
|
|
520
|
+
"/[Content_Types].xml",
|
|
521
|
+
types2.spliceChildren(types2.root, types2.root.children.length, 0, [
|
|
522
|
+
`<Override xmlns="${types2.root.name.namespace}" PartName="${part}" ContentType="application/vnd.openxmlformats-${kind === "core" ? "package.core-properties" : "officedocument.custom-properties"}+xml"/>`
|
|
523
|
+
])
|
|
524
|
+
);
|
|
525
|
+
return part;
|
|
526
|
+
}
|
|
527
|
+
async function mutateProperty(input, action, query, context) {
|
|
528
|
+
options(query, action === "set" ? ["name", "value", "type"] : ["name"]);
|
|
529
|
+
if (typeof query.name !== "string" || !query.name || !["set", "remove"].includes(action))
|
|
530
|
+
invalid("Invalid property operation.");
|
|
531
|
+
const s = await loadShared(input, context);
|
|
532
|
+
const matches = records(s).filter((x) => x.record.name === query.name);
|
|
533
|
+
if (matches.length > 1)
|
|
534
|
+
throw new OfficeError("ambiguous-selection", "Property name is ambiguous.", "select");
|
|
535
|
+
const found = matches[0];
|
|
536
|
+
if (action === "remove") {
|
|
537
|
+
if (!found) throw new OfficeError("missing-selection", "Property is absent.", "select");
|
|
538
|
+
if (found.record.type === "unknown" || !safeRemoval(found.node, found.record.kind))
|
|
539
|
+
throw new OfficeError(
|
|
540
|
+
"unsupported-edit",
|
|
541
|
+
"Unknown property is preserved.",
|
|
542
|
+
"validate-intent"
|
|
543
|
+
);
|
|
544
|
+
s.save(
|
|
545
|
+
found.record.part,
|
|
546
|
+
found.doc.spliceChildren(found.doc.root, found.doc.root.children.indexOf(found.node), 1, [])
|
|
547
|
+
);
|
|
548
|
+
return s.finish(found.record.part, []);
|
|
549
|
+
}
|
|
550
|
+
const type = query.type ?? found?.record.type ?? coreDefinition(query.name)?.[2];
|
|
551
|
+
if (found?.record.type === "unknown")
|
|
552
|
+
throw new OfficeError("unsupported-edit", "Unknown property is preserved.", "validate-intent");
|
|
553
|
+
if (!type || type === "unknown") invalid("New properties require an explicit supported type.");
|
|
554
|
+
if (found && found.record.type !== type) invalid("Property type cannot be coerced.");
|
|
555
|
+
validatePropertyValue(query.name, type, query.value);
|
|
556
|
+
if (found?.record.kind === "custom" && ["i4", "int"].includes(found.node.children[0]?.name.localName ?? "") && (!Number.isInteger(query.value) || query.value < -2147483648 || query.value > 2147483647))
|
|
557
|
+
invalid("Integer property exceeds signed 32-bit bounds.");
|
|
558
|
+
const definition = coreDefinition(query.name);
|
|
559
|
+
if (found && definition && found.record.kind !== "core")
|
|
560
|
+
invalid("Custom names cannot collide with core names.");
|
|
561
|
+
const kind = definition ? "core" : "custom";
|
|
562
|
+
const candidates = parts(s).filter((p) => p.kind === kind);
|
|
563
|
+
if (candidates.length > 1)
|
|
564
|
+
throw new OfficeError("ambiguous-selection", "Multiple property parts.", "select");
|
|
565
|
+
const part = found?.record.part ?? candidates[0]?.part ?? createPropertyPart(s, kind, context);
|
|
566
|
+
let doc = s.doc(part);
|
|
567
|
+
if (found && kind === "core")
|
|
568
|
+
doc = setCoreText(
|
|
569
|
+
doc,
|
|
570
|
+
doc.root.children[found.doc.root.children.indexOf(found.node)],
|
|
571
|
+
String(query.value)
|
|
572
|
+
);
|
|
573
|
+
else if (found) {
|
|
574
|
+
const node = doc.root.children[found.doc.root.children.indexOf(found.node)];
|
|
575
|
+
doc = doc.setText(node.children[0], String(query.value));
|
|
576
|
+
} else {
|
|
577
|
+
let markup;
|
|
578
|
+
if (definition) {
|
|
579
|
+
const [ns, local] = definition;
|
|
580
|
+
markup = `<m:${local} xmlns="" xmlns:m="${ns}"${type === "date" && ns === terms2 ? ` xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dcterms="${terms2}" xsi:type="dcterms:W3CDTF"` : ""}>${escape(String(query.value))}</m:${local}>`;
|
|
581
|
+
} else {
|
|
582
|
+
let pid = 2;
|
|
583
|
+
const ids = new Set(doc.root.children.map((n) => attr(n, "pid")));
|
|
584
|
+
while (ids.has(String(pid))) pid++;
|
|
585
|
+
const tag = { string: "lpwstr", number: "r8", boolean: "bool", date: "filetime" }[type];
|
|
586
|
+
markup = `<property xmlns="${doc.root.name.namespace}" fmtid="{D5CDD505-2E9C-101B-9397-08002B2CF9AE}" pid="${pid}" name="${escape(query.name)}"><vt:${tag} xmlns:vt="${doc.root.name.namespace === strictCustom ? strictVt : vt}">${escape(String(query.value))}</vt:${tag}></property>`;
|
|
587
|
+
}
|
|
588
|
+
doc = doc.spliceChildren(doc.root, doc.root.children.length, 0, [markup]);
|
|
589
|
+
}
|
|
590
|
+
s.save(part, doc);
|
|
591
|
+
return s.finish(part, []);
|
|
592
|
+
}
|
|
593
|
+
function unknownDeclaredType(doc, node) {
|
|
594
|
+
const annotation = node.attributes.find(
|
|
595
|
+
(a) => a.name.namespace === "http://www.w3.org/2001/XMLSchema-instance" && a.name.localName === "type"
|
|
596
|
+
);
|
|
597
|
+
if (!annotation) return false;
|
|
598
|
+
const names = annotation.value.split(":");
|
|
599
|
+
const prefix = names.length === 2 ? names[0] : "";
|
|
600
|
+
const local = names.at(-1);
|
|
601
|
+
return node.name.namespace !== terms2 || names.length > 2 || local !== "W3CDTF" || doc.resolveNamespace(node, prefix) !== terms2;
|
|
602
|
+
}
|
|
603
|
+
function setCoreText(doc, node, value) {
|
|
604
|
+
if (unknownDeclaredType(doc, node))
|
|
605
|
+
throw new OfficeError(
|
|
606
|
+
"unsupported-edit",
|
|
607
|
+
"Unknown declared property type is preserved.",
|
|
608
|
+
"validate-intent"
|
|
609
|
+
);
|
|
610
|
+
const index = doc.root.children.indexOf(node);
|
|
611
|
+
let updated = doc.setText(node, value);
|
|
612
|
+
if (node.name.namespace !== terms2) return updated;
|
|
613
|
+
let qname = "";
|
|
614
|
+
const parser = new SaxesParser({ xmlns: true });
|
|
615
|
+
parser.on("opentag", (tag) => {
|
|
616
|
+
if (!qname) qname = tag.name;
|
|
617
|
+
});
|
|
618
|
+
parser.write(doc.markup(node, true)).close();
|
|
619
|
+
const colon = qname.indexOf(":");
|
|
620
|
+
const prefix = colon < 0 ? "" : qname.slice(0, colon) + ":";
|
|
621
|
+
updated = updated.merge(updated.root.children[index], {
|
|
622
|
+
attributes: [
|
|
623
|
+
{
|
|
624
|
+
namespace: "http://www.w3.org/2001/XMLSchema-instance",
|
|
625
|
+
localName: "type",
|
|
626
|
+
value: prefix + "W3CDTF"
|
|
627
|
+
}
|
|
628
|
+
]
|
|
629
|
+
});
|
|
630
|
+
return updated;
|
|
631
|
+
}
|
|
632
|
+
function safeRemoval(node, kind) {
|
|
633
|
+
return kind === "core" ? node.children.length === 0 && node.attributes.every(
|
|
634
|
+
(a) => a.name.namespace === "http://www.w3.org/2001/XMLSchema-instance" && a.name.localName === "type"
|
|
635
|
+
) : node.children.length === 1 && node.children[0].children.length === 0 && node.children[0].attributes.length === 0 && node.attributes.every(
|
|
636
|
+
(a) => a.name.namespace === "" && ["name", "pid", "fmtid"].includes(a.name.localName)
|
|
637
|
+
);
|
|
638
|
+
}
|
|
639
|
+
async function sanitizeProperties(input, context) {
|
|
640
|
+
const s = await loadShared(input, context);
|
|
641
|
+
const known = records(s).filter(
|
|
642
|
+
(x) => x.record.type !== "unknown" && safeRemoval(x.node, x.record.kind)
|
|
643
|
+
);
|
|
644
|
+
for (const part of new Set(known.map((x) => x.record.part))) {
|
|
645
|
+
let doc = s.doc(part);
|
|
646
|
+
const indices = known.filter((x) => x.record.part === part).map((x) => x.doc.root.children.indexOf(x.node)).sort((a, b) => b - a);
|
|
647
|
+
for (const index of indices) doc = doc.spliceChildren(doc.root, index, 1, []);
|
|
648
|
+
s.save(part, doc);
|
|
649
|
+
}
|
|
650
|
+
return s.finish(s.main, []);
|
|
651
|
+
}
|
|
652
|
+
var CoreProperties = class {
|
|
653
|
+
#read;
|
|
654
|
+
constructor(read, write) {
|
|
655
|
+
this.#read = read;
|
|
656
|
+
for (const [name, [namespace, localName, type]] of Object.entries(corePropertyDefinitions))
|
|
657
|
+
Object.defineProperty(this, name, {
|
|
658
|
+
enumerable: true,
|
|
659
|
+
get: () => {
|
|
660
|
+
const doc = read();
|
|
661
|
+
const matches = doc.root.children.filter(
|
|
662
|
+
(n) => n.name.namespace === namespace && n.name.localName === localName
|
|
663
|
+
);
|
|
664
|
+
if (matches.length > 1)
|
|
665
|
+
throw new OfficeError("ambiguous-selection", "Duplicate core property.", "select");
|
|
666
|
+
const raw = matches[0] ? text(doc, matches[0]) : "";
|
|
667
|
+
if (type === "string") return raw;
|
|
668
|
+
if (type === "number") {
|
|
669
|
+
const value2 = Number(raw);
|
|
670
|
+
const digits = raw.trim();
|
|
671
|
+
const unsigned = digits.startsWith("+") ? digits.slice(1) : digits;
|
|
672
|
+
return unsigned && [...unsigned].every((c) => c >= "0" && c <= "9") && Number.isSafeInteger(value2) && value2 >= 0 ? value2 : 0;
|
|
673
|
+
}
|
|
674
|
+
const value = decodePropertyValue("date", raw);
|
|
675
|
+
return value === null ? null : new Date(value);
|
|
676
|
+
},
|
|
677
|
+
set: (value) => {
|
|
678
|
+
const serialized = type === "date" ? value instanceof Date && Number.isFinite(value.getTime()) ? value.toISOString().slice(0, 19) + "Z" : invalid("Expected valid UTC Date.") : value;
|
|
679
|
+
validatePropertyValue(name, type, serialized);
|
|
680
|
+
let doc = read();
|
|
681
|
+
const matches = doc.root.children.filter(
|
|
682
|
+
(n) => n.name.namespace === namespace && n.name.localName === localName
|
|
683
|
+
);
|
|
684
|
+
if (matches.length > 1)
|
|
685
|
+
throw new OfficeError("ambiguous-selection", "Duplicate core property.", "select");
|
|
686
|
+
if (matches[0]) doc = setCoreText(doc, matches[0], String(serialized));
|
|
687
|
+
else
|
|
688
|
+
doc = doc.spliceChildren(doc.root, doc.root.children.length, 0, [
|
|
689
|
+
`<m:${localName} xmlns="" xmlns:m="${namespace}"${type === "date" && namespace === terms2 ? ` xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dcterms="${terms2}" xsi:type="dcterms:W3CDTF"` : ""}>${escape(String(serialized))}</m:${localName}>`
|
|
690
|
+
]);
|
|
691
|
+
write(doc);
|
|
692
|
+
}
|
|
693
|
+
});
|
|
694
|
+
}
|
|
695
|
+
get part() {
|
|
696
|
+
return this.#read();
|
|
697
|
+
}
|
|
698
|
+
};
|
|
699
|
+
async function openPropertySession(input, context) {
|
|
700
|
+
const s = await loadShared(input, context);
|
|
701
|
+
const candidates = parts(s).filter((p) => p.kind === "core");
|
|
702
|
+
if (candidates.length > 1)
|
|
703
|
+
throw new OfficeError("ambiguous-selection", "Multiple core property parts.", "select");
|
|
704
|
+
let part = candidates[0]?.part;
|
|
705
|
+
let model;
|
|
706
|
+
return {
|
|
707
|
+
get core_properties() {
|
|
708
|
+
part ??= createPropertyPart(s, "core", context);
|
|
709
|
+
return model ??= new CoreProperties(
|
|
710
|
+
() => s.doc(part),
|
|
711
|
+
(doc) => s.save(part, doc)
|
|
712
|
+
);
|
|
713
|
+
},
|
|
714
|
+
async save() {
|
|
715
|
+
return (await s.finish(s.main, [])).bytes;
|
|
716
|
+
}
|
|
717
|
+
};
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
export {
|
|
721
|
+
readRetainedPropertyValue,
|
|
722
|
+
openRetainedProperties,
|
|
723
|
+
stageRetainedProperties,
|
|
724
|
+
corePropertyDefinitions,
|
|
725
|
+
coreDefinition,
|
|
726
|
+
validatePropertyValue,
|
|
727
|
+
readProperties,
|
|
728
|
+
createPropertyPart,
|
|
729
|
+
mutateProperty,
|
|
730
|
+
sanitizeProperties,
|
|
731
|
+
CoreProperties,
|
|
732
|
+
openPropertySession
|
|
733
|
+
};
|