documents.js 1.57.1 → 1.58.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -0
- package/dist/blr-types-CYYC3yYU.d.cts +35 -0
- package/dist/blr-types-CYYC3yYU.d.ts +35 -0
- package/dist/cell-CNHPsDEk.d.cts +17 -0
- package/dist/cell-CNHPsDEk.d.ts +17 -0
- package/dist/color-71eoF1Up.d.cts +2 -0
- package/dist/color-Bo228AY2.d.ts +2 -0
- package/dist/convert/codec.cjs +51 -0
- package/dist/convert/codec.d.cts +13 -0
- package/dist/convert/codec.d.ts +13 -0
- package/dist/convert/codec.js +42 -0
- package/dist/convert/convert.cjs +443 -0
- package/dist/convert/convert.d.cts +55 -0
- package/dist/convert/convert.d.ts +55 -0
- package/dist/convert/convert.js +419 -0
- package/dist/convert/local.cjs +393 -0
- package/dist/convert/local.d.cts +5 -0
- package/dist/convert/local.d.ts +5 -0
- package/dist/convert/local.js +392 -0
- package/dist/convert/port.cjs +0 -0
- package/dist/convert/port.d.cts +34 -0
- package/dist/convert/port.d.ts +34 -0
- package/dist/convert/port.js +0 -0
- package/dist/edit/docx/content.cjs +71 -0
- package/dist/edit/docx/content.d.cts +6 -0
- package/dist/edit/docx/content.d.ts +6 -0
- package/dist/edit/docx/content.js +70 -0
- package/dist/edit/docx/editor.cjs +116 -0
- package/dist/edit/docx/editor.d.cts +23 -0
- package/dist/edit/docx/editor.d.ts +23 -0
- package/dist/edit/docx/editor.js +113 -0
- package/dist/edit/docx/image.cjs +74 -0
- package/dist/edit/docx/image.d.cts +2 -0
- package/dist/edit/docx/image.d.ts +2 -0
- package/dist/edit/docx/image.js +72 -0
- package/dist/edit/docx/paragraph.cjs +132 -0
- package/dist/edit/docx/paragraph.d.cts +40 -0
- package/dist/edit/docx/paragraph.d.ts +40 -0
- package/dist/edit/docx/paragraph.js +130 -0
- package/dist/edit/docx/props.cjs +132 -0
- package/dist/edit/docx/props.d.cts +20 -0
- package/dist/edit/docx/props.d.ts +20 -0
- package/dist/edit/docx/props.js +117 -0
- package/dist/edit/docx/run.cjs +143 -0
- package/dist/edit/docx/run.d.cts +2 -0
- package/dist/edit/docx/run.d.ts +2 -0
- package/dist/edit/docx/run.js +141 -0
- package/dist/edit/docx/scaffold.cjs +97 -0
- package/dist/edit/docx/scaffold.d.cts +5 -0
- package/dist/edit/docx/scaffold.d.ts +5 -0
- package/dist/edit/docx/scaffold.js +96 -0
- package/dist/edit/docx/table.cjs +99 -0
- package/dist/edit/docx/table.d.cts +34 -0
- package/dist/edit/docx/table.d.ts +34 -0
- package/dist/edit/docx/table.js +95 -0
- package/dist/edit/odg/content.cjs +65 -0
- package/dist/edit/odg/content.d.cts +6 -0
- package/dist/edit/odg/content.d.ts +6 -0
- package/dist/edit/odg/content.js +64 -0
- package/dist/edit/odg/editor.cjs +96 -0
- package/dist/edit/odg/editor.d.cts +19 -0
- package/dist/edit/odg/editor.d.ts +19 -0
- package/dist/edit/odg/editor.js +93 -0
- package/dist/edit/odg/page.cjs +70 -0
- package/dist/edit/odg/page.d.cts +34 -0
- package/dist/edit/odg/page.d.ts +34 -0
- package/dist/edit/odg/page.js +69 -0
- package/dist/edit/odg/scaffold.cjs +106 -0
- package/dist/edit/odg/scaffold.d.cts +7 -0
- package/dist/edit/odg/scaffold.d.ts +7 -0
- package/dist/edit/odg/scaffold.js +103 -0
- package/dist/edit/odg/style.cjs +83 -0
- package/dist/edit/odg/style.d.cts +14 -0
- package/dist/edit/odg/style.d.ts +14 -0
- package/dist/edit/odg/style.js +78 -0
- package/dist/edit/odg/svg-path.cjs +30 -0
- package/dist/edit/odg/svg-path.d.cts +7 -0
- package/dist/edit/odg/svg-path.d.ts +7 -0
- package/dist/edit/odg/svg-path.js +27 -0
- package/dist/edit/odg/vector.cjs +208 -0
- package/dist/edit/odg/vector.d.cts +2 -0
- package/dist/edit/odg/vector.d.ts +2 -0
- package/dist/edit/odg/vector.js +201 -0
- package/dist/edit/odp/content.cjs +42 -0
- package/dist/edit/odp/content.d.cts +6 -0
- package/dist/edit/odp/content.d.ts +6 -0
- package/dist/edit/odp/content.js +41 -0
- package/dist/edit/odp/editor.cjs +113 -0
- package/dist/edit/odp/editor.d.cts +20 -0
- package/dist/edit/odp/editor.d.ts +20 -0
- package/dist/edit/odp/editor.js +110 -0
- package/dist/edit/odp/image.cjs +10 -0
- package/dist/edit/odp/image.d.cts +2 -0
- package/dist/edit/odp/image.d.ts +2 -0
- package/dist/edit/odp/image.js +9 -0
- package/dist/edit/odp/scaffold.cjs +108 -0
- package/dist/edit/odp/scaffold.d.cts +7 -0
- package/dist/edit/odp/scaffold.d.ts +7 -0
- package/dist/edit/odp/scaffold.js +105 -0
- package/dist/edit/odp/shape.cjs +133 -0
- package/dist/edit/odp/shape.d.cts +2 -0
- package/dist/edit/odp/shape.d.ts +2 -0
- package/dist/edit/odp/shape.js +130 -0
- package/dist/edit/odp/slide.cjs +80 -0
- package/dist/edit/odp/slide.d.cts +31 -0
- package/dist/edit/odp/slide.d.ts +31 -0
- package/dist/edit/odp/slide.js +79 -0
- package/dist/edit/ods/address.cjs +108 -0
- package/dist/edit/ods/address.d.cts +15 -0
- package/dist/edit/ods/address.d.ts +15 -0
- package/dist/edit/ods/address.js +97 -0
- package/dist/edit/ods/cell.cjs +177 -0
- package/dist/edit/ods/cell.d.cts +2 -0
- package/dist/edit/ods/cell.d.ts +2 -0
- package/dist/edit/ods/cell.js +176 -0
- package/dist/edit/ods/content.cjs +26 -0
- package/dist/edit/ods/content.d.cts +6 -0
- package/dist/edit/ods/content.d.ts +6 -0
- package/dist/edit/ods/content.js +25 -0
- package/dist/edit/ods/editor.cjs +84 -0
- package/dist/edit/ods/editor.d.cts +17 -0
- package/dist/edit/ods/editor.d.ts +17 -0
- package/dist/edit/ods/editor.js +81 -0
- package/dist/edit/ods/print-settings.cjs +90 -0
- package/dist/edit/ods/print-settings.d.cts +7 -0
- package/dist/edit/ods/print-settings.d.ts +7 -0
- package/dist/edit/ods/print-settings.js +88 -0
- package/dist/edit/ods/scaffold.cjs +129 -0
- package/dist/edit/ods/scaffold.d.cts +9 -0
- package/dist/edit/ods/scaffold.d.ts +9 -0
- package/dist/edit/ods/scaffold.js +124 -0
- package/dist/edit/ods/sheet.cjs +70 -0
- package/dist/edit/ods/sheet.d.cts +22 -0
- package/dist/edit/ods/sheet.d.ts +22 -0
- package/dist/edit/ods/sheet.js +69 -0
- package/dist/edit/odt/automatic-styles.cjs +49 -0
- package/dist/edit/odt/automatic-styles.d.cts +8 -0
- package/dist/edit/odt/automatic-styles.d.ts +8 -0
- package/dist/edit/odt/automatic-styles.js +45 -0
- package/dist/edit/odt/content.cjs +110 -0
- package/dist/edit/odt/content.d.cts +9 -0
- package/dist/edit/odt/content.d.ts +9 -0
- package/dist/edit/odt/content.js +108 -0
- package/dist/edit/odt/editor.cjs +98 -0
- package/dist/edit/odt/editor.d.cts +25 -0
- package/dist/edit/odt/editor.d.ts +25 -0
- package/dist/edit/odt/editor.js +95 -0
- package/dist/edit/odt/list.cjs +82 -0
- package/dist/edit/odt/list.d.cts +2 -0
- package/dist/edit/odt/list.d.ts +2 -0
- package/dist/edit/odt/list.js +79 -0
- package/dist/edit/odt/paragraph.cjs +84 -0
- package/dist/edit/odt/paragraph.d.cts +2 -0
- package/dist/edit/odt/paragraph.d.ts +2 -0
- package/dist/edit/odt/paragraph.js +82 -0
- package/dist/edit/odt/props.cjs +26 -0
- package/dist/edit/odt/props.d.cts +7 -0
- package/dist/edit/odt/props.d.ts +7 -0
- package/dist/edit/odt/props.js +23 -0
- package/dist/edit/odt/run.cjs +82 -0
- package/dist/edit/odt/run.d.cts +2 -0
- package/dist/edit/odt/run.d.ts +2 -0
- package/dist/edit/odt/run.js +80 -0
- package/dist/edit/odt/scaffold.cjs +109 -0
- package/dist/edit/odt/scaffold.d.cts +5 -0
- package/dist/edit/odt/scaffold.d.ts +5 -0
- package/dist/edit/odt/scaffold.js +108 -0
- package/dist/edit/odt/table.cjs +123 -0
- package/dist/edit/odt/table.d.cts +37 -0
- package/dist/edit/odt/table.d.ts +37 -0
- package/dist/edit/odt/table.js +119 -0
- package/dist/edit/pptx/content.cjs +49 -0
- package/dist/edit/pptx/content.d.cts +6 -0
- package/dist/edit/pptx/content.d.ts +6 -0
- package/dist/edit/pptx/content.js +48 -0
- package/dist/edit/pptx/editor.cjs +187 -0
- package/dist/edit/pptx/editor.d.cts +20 -0
- package/dist/edit/pptx/editor.d.ts +20 -0
- package/dist/edit/pptx/editor.js +184 -0
- package/dist/edit/pptx/image.cjs +27 -0
- package/dist/edit/pptx/image.d.cts +2 -0
- package/dist/edit/pptx/image.d.ts +2 -0
- package/dist/edit/pptx/image.js +26 -0
- package/dist/edit/pptx/scaffold.cjs +292 -0
- package/dist/edit/pptx/scaffold.d.cts +13 -0
- package/dist/edit/pptx/scaffold.d.ts +13 -0
- package/dist/edit/pptx/scaffold.js +283 -0
- package/dist/edit/pptx/shape.cjs +182 -0
- package/dist/edit/pptx/shape.d.cts +2 -0
- package/dist/edit/pptx/shape.d.ts +2 -0
- package/dist/edit/pptx/shape.js +179 -0
- package/dist/edit/pptx/slide.cjs +146 -0
- package/dist/edit/pptx/slide.d.cts +33 -0
- package/dist/edit/pptx/slide.d.ts +33 -0
- package/dist/edit/pptx/slide.js +145 -0
- package/dist/firebird/backup.cjs +150 -0
- package/dist/firebird/backup.d.cts +21 -0
- package/dist/firebird/backup.d.ts +21 -0
- package/dist/firebird/backup.js +145 -0
- package/dist/firebird/blr-types.cjs +118 -0
- package/dist/firebird/blr-types.d.cts +2 -0
- package/dist/firebird/blr-types.d.ts +2 -0
- package/dist/firebird/blr-types.js +90 -0
- package/dist/firebird/data.cjs +231 -0
- package/dist/firebird/data.d.cts +17 -0
- package/dist/firebird/data.d.ts +17 -0
- package/dist/firebird/data.js +228 -0
- package/dist/firebird/date.cjs +63 -0
- package/dist/firebird/date.d.cts +17 -0
- package/dist/firebird/date.d.ts +17 -0
- package/dist/firebird/date.js +58 -0
- package/dist/firebird/reader.cjs +157 -0
- package/dist/firebird/reader.d.cts +2 -0
- package/dist/firebird/reader.d.ts +2 -0
- package/dist/firebird/reader.js +154 -0
- package/dist/firebird/schema.cjs +91 -0
- package/dist/firebird/schema.d.cts +2 -0
- package/dist/firebird/schema.d.ts +2 -0
- package/dist/firebird/schema.js +89 -0
- package/dist/geometry-DvwdrIij.d.cts +5 -0
- package/dist/geometry-DvwdrIij.d.ts +5 -0
- package/dist/hsqldb/cache.cjs +88 -0
- package/dist/hsqldb/cache.d.cts +13 -0
- package/dist/hsqldb/cache.d.ts +13 -0
- package/dist/hsqldb/cache.js +84 -0
- package/dist/hsqldb/rowformat.cjs +222 -0
- package/dist/hsqldb/rowformat.d.cts +21 -0
- package/dist/hsqldb/rowformat.d.ts +21 -0
- package/dist/hsqldb/rowformat.js +218 -0
- package/dist/hsqldb/script.cjs +450 -0
- package/dist/hsqldb/script.d.cts +19 -0
- package/dist/hsqldb/script.d.ts +19 -0
- package/dist/hsqldb/script.js +447 -0
- package/dist/image-B-xQWYYS.d.ts +16 -0
- package/dist/image-BZDy72Jb.d.cts +16 -0
- package/dist/image-BfRLAD9B.d.cts +18 -0
- package/dist/image-BfRLAD9B.d.ts +18 -0
- package/dist/image-CeqwL-Qs.d.ts +14 -0
- package/dist/image-DWX6cNOD.d.cts +14 -0
- package/dist/index.cjs +201 -10863
- package/dist/index.d.cts +71 -1406
- package/dist/index.d.ts +71 -1406
- package/dist/index.js +67 -10727
- package/dist/layout/drawing.cjs +117 -0
- package/dist/layout/drawing.d.cts +13 -0
- package/dist/layout/drawing.d.ts +13 -0
- package/dist/layout/drawing.js +116 -0
- package/dist/layout/engine.cjs +216 -0
- package/dist/layout/engine.d.cts +19 -0
- package/dist/layout/engine.d.ts +19 -0
- package/dist/layout/engine.js +215 -0
- package/dist/layout/reconstruct.cjs +809 -0
- package/dist/layout/reconstruct.d.cts +12 -0
- package/dist/layout/reconstruct.d.ts +12 -0
- package/dist/layout/reconstruct.js +805 -0
- package/dist/layout/shared.cjs +104 -0
- package/dist/layout/shared.d.cts +15 -0
- package/dist/layout/shared.d.ts +15 -0
- package/dist/layout/shared.js +96 -0
- package/dist/layout/sheets.cjs +413 -0
- package/dist/layout/sheets.d.cts +14 -0
- package/dist/layout/sheets.d.ts +14 -0
- package/dist/layout/sheets.js +414 -0
- package/dist/layout/slides.cjs +194 -0
- package/dist/layout/slides.d.cts +25 -0
- package/dist/layout/slides.d.ts +25 -0
- package/dist/layout/slides.js +192 -0
- package/dist/list-BuBM9rwQ.d.cts +24 -0
- package/dist/list-CvKxhy3y.d.ts +24 -0
- package/dist/mathml/compose.cjs +53 -0
- package/dist/mathml/compose.d.cts +8 -0
- package/dist/mathml/compose.d.ts +8 -0
- package/dist/mathml/compose.js +49 -0
- package/dist/mathml/layout-types.cjs +0 -0
- package/dist/mathml/layout-types.d.cts +50 -0
- package/dist/mathml/layout-types.d.ts +50 -0
- package/dist/mathml/layout-types.js +0 -0
- package/dist/mathml/layout.cjs +373 -0
- package/dist/mathml/layout.d.cts +24 -0
- package/dist/mathml/layout.d.ts +24 -0
- package/dist/mathml/layout.js +371 -0
- package/dist/mathml/length.cjs +41 -0
- package/dist/mathml/length.d.cts +4 -0
- package/dist/mathml/length.d.ts +4 -0
- package/dist/mathml/length.js +40 -0
- package/dist/mathml/metrics.cjs +0 -0
- package/dist/mathml/metrics.d.cts +44 -0
- package/dist/mathml/metrics.d.ts +44 -0
- package/dist/mathml/metrics.js +0 -0
- package/dist/mathml/nodes.cjs +39 -0
- package/dist/mathml/nodes.d.cts +2 -0
- package/dist/mathml/nodes.d.ts +2 -0
- package/dist/mathml/nodes.js +32 -0
- package/dist/mathml/operators.cjs +189 -0
- package/dist/mathml/operators.d.cts +13 -0
- package/dist/mathml/operators.d.ts +13 -0
- package/dist/mathml/operators.js +188 -0
- package/dist/mathml/radical.cjs +46 -0
- package/dist/mathml/radical.d.cts +10 -0
- package/dist/mathml/radical.d.ts +10 -0
- package/dist/mathml/radical.js +45 -0
- package/dist/mathml/variant.cjs +1160 -0
- package/dist/mathml/variant.d.cts +7 -0
- package/dist/mathml/variant.d.ts +7 -0
- package/dist/mathml/variant.js +1157 -0
- package/dist/model/bytes.cjs +88 -0
- package/dist/model/bytes.d.cts +12 -0
- package/dist/model/bytes.d.ts +12 -0
- package/dist/model/bytes.js +80 -0
- package/dist/model/color.cjs +26 -0
- package/dist/model/color.d.cts +2 -0
- package/dist/model/color.d.ts +2 -0
- package/dist/model/color.js +2 -0
- package/dist/model/content.cjs +34 -0
- package/dist/model/content.d.cts +362 -0
- package/dist/model/content.d.ts +362 -0
- package/dist/model/content.js +32 -0
- package/dist/model/formula.cjs +0 -0
- package/dist/model/formula.d.cts +8 -0
- package/dist/model/formula.d.ts +8 -0
- package/dist/model/formula.js +0 -0
- package/dist/model/geometry.cjs +55 -0
- package/dist/model/geometry.d.cts +2 -0
- package/dist/model/geometry.d.ts +2 -0
- package/dist/model/geometry.js +12 -0
- package/dist/model/style.cjs +20 -0
- package/dist/model/style.d.cts +2 -0
- package/dist/model/style.d.ts +2 -0
- package/dist/model/style.js +2 -0
- package/dist/model/units.cjs +55 -0
- package/dist/model/units.d.cts +20 -0
- package/dist/model/units.d.ts +20 -0
- package/dist/model/units.js +38 -0
- package/dist/nodes-pArN9ilm.d.cts +27 -0
- package/dist/nodes-pArN9ilm.d.ts +27 -0
- package/dist/odb/csv.cjs +48 -0
- package/dist/odb/csv.d.cts +14 -0
- package/dist/odb/csv.d.ts +14 -0
- package/dist/odb/csv.js +45 -0
- package/dist/odb/read.cjs +87 -0
- package/dist/odb/read.d.cts +15 -0
- package/dist/odb/read.d.ts +15 -0
- package/dist/odb/read.js +85 -0
- package/dist/odb/spreadsheet.cjs +68 -0
- package/dist/odb/spreadsheet.d.cts +6 -0
- package/dist/odb/spreadsheet.d.ts +6 -0
- package/dist/odb/spreadsheet.js +67 -0
- package/dist/odf/formula/detect.cjs +29 -0
- package/dist/odf/formula/detect.d.cts +12 -0
- package/dist/odf/formula/detect.d.ts +12 -0
- package/dist/odf/formula/detect.js +28 -0
- package/dist/odf/formula/placeholder.cjs +37 -0
- package/dist/odf/formula/placeholder.d.cts +14 -0
- package/dist/odf/formula/placeholder.d.ts +14 -0
- package/dist/odf/formula/placeholder.js +36 -0
- package/dist/odf/formula/read.cjs +32 -0
- package/dist/odf/formula/read.d.cts +11 -0
- package/dist/odf/formula/read.d.ts +11 -0
- package/dist/odf/formula/read.js +30 -0
- package/dist/odf/odg/read.cjs +15 -0
- package/dist/odf/odg/read.d.cts +6 -0
- package/dist/odf/odg/read.d.ts +6 -0
- package/dist/odf/odg/read.js +14 -0
- package/dist/odf/odp/read.cjs +45 -0
- package/dist/odf/odp/read.d.cts +11 -0
- package/dist/odf/odp/read.d.ts +11 -0
- package/dist/odf/odp/read.js +44 -0
- package/dist/odf/ods/read.cjs +15 -0
- package/dist/odf/ods/read.d.cts +6 -0
- package/dist/odf/ods/read.d.ts +6 -0
- package/dist/odf/ods/read.js +14 -0
- package/dist/odf/odt/read.cjs +43 -0
- package/dist/odf/odt/read.d.cts +11 -0
- package/dist/odf/odt/read.d.ts +11 -0
- package/dist/odf/odt/read.js +42 -0
- package/dist/odf-package/manifest.cjs +62 -0
- package/dist/odf-package/manifest.d.cts +2 -0
- package/dist/odf-package/manifest.d.ts +2 -0
- package/dist/odf-package/manifest.js +2 -0
- package/dist/odf-package/media.cjs +34 -0
- package/dist/odf-package/media.d.cts +8 -0
- package/dist/odf-package/media.d.ts +8 -0
- package/dist/odf-package/media.js +34 -0
- package/dist/ooxml/docx/read.cjs +15 -0
- package/dist/ooxml/docx/read.d.cts +6 -0
- package/dist/ooxml/docx/read.d.ts +6 -0
- package/dist/ooxml/docx/read.js +14 -0
- package/dist/ooxml/pptx/read.cjs +15 -0
- package/dist/ooxml/pptx/read.d.cts +6 -0
- package/dist/ooxml/pptx/read.d.ts +6 -0
- package/dist/ooxml/pptx/read.js +14 -0
- package/dist/opc/content-types.cjs +47 -0
- package/dist/opc/content-types.d.cts +7 -0
- package/dist/opc/content-types.d.ts +7 -0
- package/dist/opc/content-types.js +44 -0
- package/dist/opc/media.cjs +45 -0
- package/dist/opc/media.d.cts +10 -0
- package/dist/opc/media.d.ts +10 -0
- package/dist/opc/media.js +44 -0
- package/dist/opc/paths.cjs +28 -0
- package/dist/opc/paths.d.cts +5 -0
- package/dist/opc/paths.d.ts +5 -0
- package/dist/opc/paths.js +26 -0
- package/dist/opc/rels.cjs +47 -0
- package/dist/opc/rels.d.cts +10 -0
- package/dist/opc/rels.d.ts +10 -0
- package/dist/opc/rels.js +46 -0
- package/dist/paragraph-BXbXKPy3.d.cts +30 -0
- package/dist/paragraph-CoUi_88j.d.ts +30 -0
- package/dist/ports/abort.cjs +7 -0
- package/dist/ports/abort.d.cts +4 -0
- package/dist/ports/abort.d.ts +4 -0
- package/dist/ports/abort.js +6 -0
- package/dist/ports/clock.cjs +9 -0
- package/dist/ports/clock.d.cts +8 -0
- package/dist/ports/clock.d.ts +8 -0
- package/dist/ports/clock.js +7 -0
- package/dist/reader-DP0Mbaj4.d.cts +41 -0
- package/dist/reader-DP0Mbaj4.d.ts +41 -0
- package/dist/run-B3GNScJH.d.cts +38 -0
- package/dist/run-CJfh8rv3.d.ts +38 -0
- package/dist/run-D2rTWHbt.d.ts +38 -0
- package/dist/run-F8JN7Vy4.d.cts +38 -0
- package/dist/schema-Acco3Ezi.d.cts +22 -0
- package/dist/schema-VkAA6pF5.d.ts +22 -0
- package/dist/shape-BUfjw5eZ.d.cts +35 -0
- package/dist/shape-BfN3m52m.d.ts +30 -0
- package/dist/shape-CN2ycxOo.d.cts +30 -0
- package/dist/shape-CTkl6kt8.d.ts +35 -0
- package/dist/style-DkamR3aY.d.cts +2 -0
- package/dist/style-DkamR3aY.d.ts +2 -0
- package/dist/vector-ClohqsOe.d.cts +76 -0
- package/dist/vector-ClohqsOe.d.ts +76 -0
- package/dist/xml/edit.cjs +65 -0
- package/dist/xml/edit.d.cts +12 -0
- package/dist/xml/edit.d.ts +12 -0
- package/dist/xml/edit.js +57 -0
- package/dist/xml/entities.cjs +12 -0
- package/dist/xml/entities.d.cts +5 -0
- package/dist/xml/entities.d.ts +5 -0
- package/dist/xml/entities.js +10 -0
- package/dist/xml/fragment.cjs +22 -0
- package/dist/xml/fragment.d.cts +6 -0
- package/dist/xml/fragment.d.ts +6 -0
- package/dist/xml/fragment.js +20 -0
- package/dist/xml/odf-text.cjs +53 -0
- package/dist/xml/odf-text.d.cts +6 -0
- package/dist/xml/odf-text.d.ts +6 -0
- package/dist/xml/odf-text.js +51 -0
- package/dist/xml/query.cjs +33 -0
- package/dist/xml/query.d.cts +12 -0
- package/dist/xml/query.d.ts +12 -0
- package/dist/xml/query.js +29 -0
- package/package.json +9 -1
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { el, txt } from "../../xml/fragment.js";
|
|
2
|
+
import { removeChild } from "../../xml/edit.js";
|
|
3
|
+
import { buildRelativeTarget } from "../../opc/paths.js";
|
|
4
|
+
import { addRelationship } from "../../opc/rels.js";
|
|
5
|
+
import { ensureContentTypeOverride } from "../../opc/content-types.js";
|
|
6
|
+
import { encodeXmlText } from "../../xml/entities.js";
|
|
7
|
+
import { DML_NS, NOTES_MASTER_REL_TYPE, PML_NS, buildEmptyGroupSpTree, ensureNotesMaster } from "./scaffold.js";
|
|
8
|
+
import { PptxShape, buildTextBoxShape } from "./shape.js";
|
|
9
|
+
import { insertPictureShapeMedia } from "./image.js";
|
|
10
|
+
import { resolveRelationships, rootElement, textContent } from "ooxml.js";
|
|
11
|
+
//#region src/edit/pptx/slide.ts
|
|
12
|
+
function directChild(parent, tag) {
|
|
13
|
+
for (const child of parent.children) if (child.type === "element" && child.tag === tag) return child;
|
|
14
|
+
}
|
|
15
|
+
function findSpTree(slideRoot) {
|
|
16
|
+
const cSld = directChild(slideRoot, "p:cSld");
|
|
17
|
+
const spTree = cSld === void 0 ? void 0 : directChild(cSld, "p:spTree");
|
|
18
|
+
if (spTree === void 0) throw new Error("slide has no p:cSld/p:spTree element");
|
|
19
|
+
return spTree;
|
|
20
|
+
}
|
|
21
|
+
function nextIdIn(root) {
|
|
22
|
+
let max = 0;
|
|
23
|
+
const stack = [root];
|
|
24
|
+
while (stack.length > 0) {
|
|
25
|
+
const node = stack.pop();
|
|
26
|
+
if (node === void 0) continue;
|
|
27
|
+
if (node.tag === "p:cNvPr") {
|
|
28
|
+
for (const a of node.attributes) if (a.name === "id") {
|
|
29
|
+
const n = Number.parseInt(a.value, 10);
|
|
30
|
+
if (!Number.isNaN(n) && n > max) max = n;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
for (const child of node.children) if (child.type === "element") stack.push(child);
|
|
34
|
+
}
|
|
35
|
+
return max + 1;
|
|
36
|
+
}
|
|
37
|
+
const NOTES_SLIDE_RELATIONSHIP_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesSlide";
|
|
38
|
+
const NOTES_SLIDE_CONTENT_TYPE = "application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml";
|
|
39
|
+
function buildMinimalNotesSlide(text) {
|
|
40
|
+
const body = el("p:sp", {}, [
|
|
41
|
+
el("p:nvSpPr", {}, [
|
|
42
|
+
el("p:cNvPr", {
|
|
43
|
+
id: "2",
|
|
44
|
+
name: "Notes Placeholder"
|
|
45
|
+
}),
|
|
46
|
+
el("p:cNvSpPr", {}, [el("a:spLocks", { noGrp: "1" })]),
|
|
47
|
+
el("p:nvPr", {}, [el("p:ph", {
|
|
48
|
+
type: "body",
|
|
49
|
+
idx: "1"
|
|
50
|
+
})])
|
|
51
|
+
]),
|
|
52
|
+
el("p:spPr", {}, [el("a:xfrm", {}, [el("a:off", {
|
|
53
|
+
x: "685800",
|
|
54
|
+
y: "4400550"
|
|
55
|
+
}), el("a:ext", {
|
|
56
|
+
cx: "5486400",
|
|
57
|
+
cy: "4200525"
|
|
58
|
+
})])]),
|
|
59
|
+
el("p:txBody", {}, [
|
|
60
|
+
el("a:bodyPr"),
|
|
61
|
+
el("a:lstStyle"),
|
|
62
|
+
el("a:p", {}, [el("a:r", {}, [el("a:t", {}, [txt(encodeXmlText(text))])])])
|
|
63
|
+
])
|
|
64
|
+
]);
|
|
65
|
+
const spTree = buildEmptyGroupSpTree();
|
|
66
|
+
spTree.children.push(body);
|
|
67
|
+
return el("p:notes", {
|
|
68
|
+
"xmlns:p": PML_NS,
|
|
69
|
+
"xmlns:a": DML_NS
|
|
70
|
+
}, [el("p:cSld", {}, [spTree]), el("p:clrMapOvr", {}, [el("a:masterClrMapping")])]);
|
|
71
|
+
}
|
|
72
|
+
var PptxSlide = class {
|
|
73
|
+
container;
|
|
74
|
+
node;
|
|
75
|
+
context;
|
|
76
|
+
removed = false;
|
|
77
|
+
constructor(container, node, context) {
|
|
78
|
+
this.container = container;
|
|
79
|
+
this.node = node;
|
|
80
|
+
this.context = context;
|
|
81
|
+
}
|
|
82
|
+
live() {
|
|
83
|
+
if (this.removed) throw new Error("this PptxSlide has been removed from the presentation and can no longer be used");
|
|
84
|
+
return this.node;
|
|
85
|
+
}
|
|
86
|
+
shapes() {
|
|
87
|
+
const spTree = findSpTree(this.live());
|
|
88
|
+
const out = [];
|
|
89
|
+
for (const child of spTree.children) if (child.type === "element" && (child.tag === "p:sp" || child.tag === "p:pic")) out.push(new PptxShape(spTree.children, child));
|
|
90
|
+
return out;
|
|
91
|
+
}
|
|
92
|
+
addTextBox(init) {
|
|
93
|
+
const spTree = findSpTree(this.live());
|
|
94
|
+
const id = nextIdIn(spTree);
|
|
95
|
+
const shapeElement = buildTextBoxShape(init.frame, init.text, id);
|
|
96
|
+
spTree.children.push(shapeElement);
|
|
97
|
+
return new PptxShape(spTree.children, shapeElement);
|
|
98
|
+
}
|
|
99
|
+
addImage(init) {
|
|
100
|
+
const slideRoot = this.live();
|
|
101
|
+
const spTree = findSpTree(slideRoot);
|
|
102
|
+
const media = {
|
|
103
|
+
pkg: this.context.pkg,
|
|
104
|
+
partPath: this.context.slidePartPath,
|
|
105
|
+
mediaDir: this.context.mediaDir
|
|
106
|
+
};
|
|
107
|
+
const shapeElement = insertPictureShapeMedia(media, slideRoot, init.frame, init);
|
|
108
|
+
spTree.children.push(shapeElement);
|
|
109
|
+
return new PptxShape(spTree.children, shapeElement);
|
|
110
|
+
}
|
|
111
|
+
get notes() {
|
|
112
|
+
const notesRel = [...resolveRelationships(this.context.pkg, this.context.slidePartPath).values()].find((r) => r.type === NOTES_SLIDE_RELATIONSHIP_TYPE);
|
|
113
|
+
if (notesRel === void 0) return "";
|
|
114
|
+
const notesRoot = rootElement(this.context.pkg.parts[notesRel.target]);
|
|
115
|
+
return notesRoot === void 0 ? "" : textContent(notesRoot);
|
|
116
|
+
}
|
|
117
|
+
set notes(value) {
|
|
118
|
+
const { pkg, slidePartPath } = this.context;
|
|
119
|
+
const existingRel = [...resolveRelationships(pkg, slidePartPath).values()].find((r) => r.type === NOTES_SLIDE_RELATIONSHIP_TYPE);
|
|
120
|
+
let notesPartPath;
|
|
121
|
+
if (existingRel === void 0) {
|
|
122
|
+
notesPartPath = `ppt/notesSlides/notesSlide${Object.keys(pkg.parts).filter((p) => /^ppt\/notesSlides\/notesSlide\d+\.xml$/.test(p)).length + 1}.xml`;
|
|
123
|
+
ensureContentTypeOverride(pkg, notesPartPath, NOTES_SLIDE_CONTENT_TYPE);
|
|
124
|
+
addRelationship(pkg, slidePartPath, {
|
|
125
|
+
type: NOTES_SLIDE_RELATIONSHIP_TYPE,
|
|
126
|
+
target: buildRelativeTarget(slidePartPath, notesPartPath)
|
|
127
|
+
});
|
|
128
|
+
const notesMasterPartPath = ensureNotesMaster(pkg);
|
|
129
|
+
addRelationship(pkg, notesPartPath, {
|
|
130
|
+
type: NOTES_MASTER_REL_TYPE,
|
|
131
|
+
target: buildRelativeTarget(notesPartPath, notesMasterPartPath)
|
|
132
|
+
});
|
|
133
|
+
} else notesPartPath = existingRel.target;
|
|
134
|
+
pkg.parts[notesPartPath] = {
|
|
135
|
+
kind: "xml",
|
|
136
|
+
nodes: [buildMinimalNotesSlide(value)]
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
remove() {
|
|
140
|
+
removeChild(this.container, this.live());
|
|
141
|
+
this.removed = true;
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
//#endregion
|
|
145
|
+
export { PptxSlide };
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_firebird_reader = require("./reader.cjs");
|
|
3
|
+
const require_firebird_schema = require("./schema.cjs");
|
|
4
|
+
const require_firebird_data = require("./data.cjs");
|
|
5
|
+
//#region src/firebird/backup.ts
|
|
6
|
+
const REC_DATABASE = 1;
|
|
7
|
+
const REC_RELATION = 3;
|
|
8
|
+
const REC_RELATION_DATA = 8;
|
|
9
|
+
const REC_END = 10;
|
|
10
|
+
const REC_PHYSICAL_DB = 14;
|
|
11
|
+
const FLAT_SKIPPABLE_RECORD_TYPES = /* @__PURE__ */ new Set([
|
|
12
|
+
2,
|
|
13
|
+
24,
|
|
14
|
+
31,
|
|
15
|
+
32,
|
|
16
|
+
33,
|
|
17
|
+
34,
|
|
18
|
+
35,
|
|
19
|
+
19,
|
|
20
|
+
20,
|
|
21
|
+
26,
|
|
22
|
+
12,
|
|
23
|
+
25,
|
|
24
|
+
36,
|
|
25
|
+
37,
|
|
26
|
+
39,
|
|
27
|
+
21,
|
|
28
|
+
22,
|
|
29
|
+
40,
|
|
30
|
+
41,
|
|
31
|
+
42,
|
|
32
|
+
43
|
|
33
|
+
]);
|
|
34
|
+
var FirebirdBackupFormatError = class extends Error {
|
|
35
|
+
constructor(message) {
|
|
36
|
+
super(`Firebird backup: ${message}`);
|
|
37
|
+
this.name = "FirebirdBackupFormatError";
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
const ATT_BACKUP_FORMAT = 2;
|
|
41
|
+
const ATT_BACKUP_COMPRESS = 4;
|
|
42
|
+
const ATT_BACKUP_TRANSPORTABLE = 5;
|
|
43
|
+
const ATT_PAGE_SIZE = 5;
|
|
44
|
+
function readBurpHeader(reader) {
|
|
45
|
+
let backupFormatVersion;
|
|
46
|
+
let transportable = false;
|
|
47
|
+
let compressed = false;
|
|
48
|
+
for (;;) {
|
|
49
|
+
const attribute = reader.readTag();
|
|
50
|
+
if (attribute === 0) break;
|
|
51
|
+
switch (attribute) {
|
|
52
|
+
case ATT_BACKUP_FORMAT:
|
|
53
|
+
backupFormatVersion = reader.readInt32Attribute();
|
|
54
|
+
break;
|
|
55
|
+
case ATT_BACKUP_TRANSPORTABLE:
|
|
56
|
+
transportable = reader.readInt32Attribute() !== 0;
|
|
57
|
+
break;
|
|
58
|
+
case ATT_BACKUP_COMPRESS:
|
|
59
|
+
compressed = reader.readInt32Attribute() !== 0;
|
|
60
|
+
break;
|
|
61
|
+
default: reader.skipAttributeValue();
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
if (backupFormatVersion === void 0) throw new FirebirdBackupFormatError("the leading rec_burp record had no att_backup_format attribute -- not a recognisable gbak backup stream");
|
|
65
|
+
return {
|
|
66
|
+
backupFormatVersion,
|
|
67
|
+
transportable,
|
|
68
|
+
compressed
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
function readDatabaseHeader(reader) {
|
|
72
|
+
let pageSizeBytes;
|
|
73
|
+
for (;;) {
|
|
74
|
+
const attribute = reader.readTag();
|
|
75
|
+
if (attribute === 0) break;
|
|
76
|
+
if (attribute === ATT_PAGE_SIZE) pageSizeBytes = reader.readInt32Attribute();
|
|
77
|
+
else reader.skipAttributeValue();
|
|
78
|
+
}
|
|
79
|
+
return { pageSizeBytes };
|
|
80
|
+
}
|
|
81
|
+
const SUPPORTED_BACKUP_FORMAT_VERSION = 10;
|
|
82
|
+
function relationToColumns(relation) {
|
|
83
|
+
return relation.fields.filter((field) => !field.computed).map((field) => ({
|
|
84
|
+
name: field.name,
|
|
85
|
+
type: field.typeLabel
|
|
86
|
+
}));
|
|
87
|
+
}
|
|
88
|
+
function readFirebirdBackup(bytes) {
|
|
89
|
+
const reader = new require_firebird_reader.FirebirdBackupReader(bytes);
|
|
90
|
+
const leadingRecordType = reader.readTag();
|
|
91
|
+
if (leadingRecordType !== 0) throw new FirebirdBackupFormatError(`expected the stream to open with rec_burp (tag 0), found tag ${leadingRecordType} -- not a recognisable gbak backup stream`);
|
|
92
|
+
const { backupFormatVersion, transportable, compressed } = readBurpHeader(reader);
|
|
93
|
+
if (backupFormatVersion !== 10) throw new FirebirdBackupFormatError(`backup format version ${backupFormatVersion} is not supported -- this reader has only been built and verified against format version 10 (Firebird 3.0-era gbak output). Refusing to guess at a different format's own attribute/record shape rather than risk silently misdecoding it.`);
|
|
94
|
+
if (!transportable) throw new FirebirdBackupFormatError("backup is in non-transportable (native binary) row format (att_backup_transportable=false) -- this reader only decodes the transportable/XDR row encoding, the one every real fixture it was built against actually uses (gbak's own default).");
|
|
95
|
+
let pageSizeBytes;
|
|
96
|
+
const schema = /* @__PURE__ */ new Map();
|
|
97
|
+
const tablesInOrder = [];
|
|
98
|
+
const rowsByRelation = /* @__PURE__ */ new Map();
|
|
99
|
+
for (;;) {
|
|
100
|
+
const recordType = reader.readTag();
|
|
101
|
+
if (recordType === REC_END) break;
|
|
102
|
+
if (recordType === REC_DATABASE || recordType === REC_PHYSICAL_DB) {
|
|
103
|
+
pageSizeBytes = readDatabaseHeader(reader).pageSizeBytes ?? pageSizeBytes;
|
|
104
|
+
continue;
|
|
105
|
+
}
|
|
106
|
+
if (recordType === REC_RELATION) {
|
|
107
|
+
const relation = require_firebird_schema.readRelationSchema(reader, (nestedRecordType) => {
|
|
108
|
+
throw new require_firebird_data.FirebirdCompositeRecordUnsupportedError(nestedRecordType, "reading a relation's own schema (a rec_view child, most likely)");
|
|
109
|
+
});
|
|
110
|
+
schema.set(relation.name, relation);
|
|
111
|
+
tablesInOrder.push(relation.name);
|
|
112
|
+
continue;
|
|
113
|
+
}
|
|
114
|
+
if (recordType === REC_RELATION_DATA) {
|
|
115
|
+
const result = require_firebird_data.readRelationData(reader, schema, compressed);
|
|
116
|
+
rowsByRelation.set(result.relationName, result.rows);
|
|
117
|
+
continue;
|
|
118
|
+
}
|
|
119
|
+
if (FLAT_SKIPPABLE_RECORD_TYPES.has(recordType)) {
|
|
120
|
+
reader.skipFlatRecordAttributes();
|
|
121
|
+
continue;
|
|
122
|
+
}
|
|
123
|
+
throw new require_firebird_data.FirebirdCompositeRecordUnsupportedError(recordType, "walking the backup stream's own top-level record sequence");
|
|
124
|
+
}
|
|
125
|
+
const tables = tablesInOrder.map((name) => {
|
|
126
|
+
const relation = schema.get(name);
|
|
127
|
+
if (relation === void 0) throw new FirebirdBackupFormatError(`internal error: relation "${name}" missing from its own schema map`);
|
|
128
|
+
const rows = rowsByRelation.get(name) ?? [];
|
|
129
|
+
return {
|
|
130
|
+
tableName: relation.name,
|
|
131
|
+
columns: relationToColumns(relation),
|
|
132
|
+
rows
|
|
133
|
+
};
|
|
134
|
+
});
|
|
135
|
+
return {
|
|
136
|
+
summary: {
|
|
137
|
+
backupFormatVersion,
|
|
138
|
+
transportable,
|
|
139
|
+
compressed,
|
|
140
|
+
pageSizeBytes
|
|
141
|
+
},
|
|
142
|
+
tables
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
//#endregion
|
|
146
|
+
exports.FirebirdBackupFormatError = FirebirdBackupFormatError;
|
|
147
|
+
exports.FirebirdCompositeRecordUnsupportedError = require_firebird_data.FirebirdCompositeRecordUnsupportedError;
|
|
148
|
+
exports.FirebirdSchemaParseError = require_firebird_schema.FirebirdSchemaParseError;
|
|
149
|
+
exports.SUPPORTED_BACKUP_FORMAT_VERSION = SUPPORTED_BACKUP_FORMAT_VERSION;
|
|
150
|
+
exports.readFirebirdBackup = readFirebirdBackup;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { HsqldbTable } from "../hsqldb/script.cjs";
|
|
2
|
+
import { r as FirebirdSchemaParseError } from "../schema-Acco3Ezi.cjs";
|
|
3
|
+
import { FirebirdCompositeRecordUnsupportedError } from "./data.cjs";
|
|
4
|
+
//#region src/firebird/backup.d.ts
|
|
5
|
+
declare class FirebirdBackupFormatError extends Error {
|
|
6
|
+
constructor(message: string);
|
|
7
|
+
}
|
|
8
|
+
interface FirebirdBackupSummary {
|
|
9
|
+
readonly backupFormatVersion: number;
|
|
10
|
+
readonly transportable: boolean;
|
|
11
|
+
readonly compressed: boolean;
|
|
12
|
+
readonly pageSizeBytes: number | undefined;
|
|
13
|
+
}
|
|
14
|
+
declare const SUPPORTED_BACKUP_FORMAT_VERSION = 10;
|
|
15
|
+
interface ReadFirebirdBackupResult {
|
|
16
|
+
readonly summary: FirebirdBackupSummary;
|
|
17
|
+
readonly tables: readonly HsqldbTable[];
|
|
18
|
+
}
|
|
19
|
+
declare function readFirebirdBackup(bytes: Uint8Array<ArrayBuffer>): ReadFirebirdBackupResult;
|
|
20
|
+
//#endregion
|
|
21
|
+
export { FirebirdBackupFormatError, FirebirdBackupSummary, FirebirdCompositeRecordUnsupportedError, FirebirdSchemaParseError, ReadFirebirdBackupResult, SUPPORTED_BACKUP_FORMAT_VERSION, readFirebirdBackup };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { HsqldbTable } from "../hsqldb/script.js";
|
|
2
|
+
import { r as FirebirdSchemaParseError } from "../schema-VkAA6pF5.js";
|
|
3
|
+
import { FirebirdCompositeRecordUnsupportedError } from "./data.js";
|
|
4
|
+
//#region src/firebird/backup.d.ts
|
|
5
|
+
declare class FirebirdBackupFormatError extends Error {
|
|
6
|
+
constructor(message: string);
|
|
7
|
+
}
|
|
8
|
+
interface FirebirdBackupSummary {
|
|
9
|
+
readonly backupFormatVersion: number;
|
|
10
|
+
readonly transportable: boolean;
|
|
11
|
+
readonly compressed: boolean;
|
|
12
|
+
readonly pageSizeBytes: number | undefined;
|
|
13
|
+
}
|
|
14
|
+
declare const SUPPORTED_BACKUP_FORMAT_VERSION = 10;
|
|
15
|
+
interface ReadFirebirdBackupResult {
|
|
16
|
+
readonly summary: FirebirdBackupSummary;
|
|
17
|
+
readonly tables: readonly HsqldbTable[];
|
|
18
|
+
}
|
|
19
|
+
declare function readFirebirdBackup(bytes: Uint8Array<ArrayBuffer>): ReadFirebirdBackupResult;
|
|
20
|
+
//#endregion
|
|
21
|
+
export { FirebirdBackupFormatError, FirebirdBackupSummary, FirebirdCompositeRecordUnsupportedError, FirebirdSchemaParseError, ReadFirebirdBackupResult, SUPPORTED_BACKUP_FORMAT_VERSION, readFirebirdBackup };
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { FirebirdBackupReader } from "./reader.js";
|
|
2
|
+
import { FirebirdSchemaParseError, readRelationSchema } from "./schema.js";
|
|
3
|
+
import { FirebirdCompositeRecordUnsupportedError, readRelationData } from "./data.js";
|
|
4
|
+
//#region src/firebird/backup.ts
|
|
5
|
+
const REC_DATABASE = 1;
|
|
6
|
+
const REC_RELATION = 3;
|
|
7
|
+
const REC_RELATION_DATA = 8;
|
|
8
|
+
const REC_END = 10;
|
|
9
|
+
const REC_PHYSICAL_DB = 14;
|
|
10
|
+
const FLAT_SKIPPABLE_RECORD_TYPES = /* @__PURE__ */ new Set([
|
|
11
|
+
2,
|
|
12
|
+
24,
|
|
13
|
+
31,
|
|
14
|
+
32,
|
|
15
|
+
33,
|
|
16
|
+
34,
|
|
17
|
+
35,
|
|
18
|
+
19,
|
|
19
|
+
20,
|
|
20
|
+
26,
|
|
21
|
+
12,
|
|
22
|
+
25,
|
|
23
|
+
36,
|
|
24
|
+
37,
|
|
25
|
+
39,
|
|
26
|
+
21,
|
|
27
|
+
22,
|
|
28
|
+
40,
|
|
29
|
+
41,
|
|
30
|
+
42,
|
|
31
|
+
43
|
|
32
|
+
]);
|
|
33
|
+
var FirebirdBackupFormatError = class extends Error {
|
|
34
|
+
constructor(message) {
|
|
35
|
+
super(`Firebird backup: ${message}`);
|
|
36
|
+
this.name = "FirebirdBackupFormatError";
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
const ATT_BACKUP_FORMAT = 2;
|
|
40
|
+
const ATT_BACKUP_COMPRESS = 4;
|
|
41
|
+
const ATT_BACKUP_TRANSPORTABLE = 5;
|
|
42
|
+
const ATT_PAGE_SIZE = 5;
|
|
43
|
+
function readBurpHeader(reader) {
|
|
44
|
+
let backupFormatVersion;
|
|
45
|
+
let transportable = false;
|
|
46
|
+
let compressed = false;
|
|
47
|
+
for (;;) {
|
|
48
|
+
const attribute = reader.readTag();
|
|
49
|
+
if (attribute === 0) break;
|
|
50
|
+
switch (attribute) {
|
|
51
|
+
case ATT_BACKUP_FORMAT:
|
|
52
|
+
backupFormatVersion = reader.readInt32Attribute();
|
|
53
|
+
break;
|
|
54
|
+
case ATT_BACKUP_TRANSPORTABLE:
|
|
55
|
+
transportable = reader.readInt32Attribute() !== 0;
|
|
56
|
+
break;
|
|
57
|
+
case ATT_BACKUP_COMPRESS:
|
|
58
|
+
compressed = reader.readInt32Attribute() !== 0;
|
|
59
|
+
break;
|
|
60
|
+
default: reader.skipAttributeValue();
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
if (backupFormatVersion === void 0) throw new FirebirdBackupFormatError("the leading rec_burp record had no att_backup_format attribute -- not a recognisable gbak backup stream");
|
|
64
|
+
return {
|
|
65
|
+
backupFormatVersion,
|
|
66
|
+
transportable,
|
|
67
|
+
compressed
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
function readDatabaseHeader(reader) {
|
|
71
|
+
let pageSizeBytes;
|
|
72
|
+
for (;;) {
|
|
73
|
+
const attribute = reader.readTag();
|
|
74
|
+
if (attribute === 0) break;
|
|
75
|
+
if (attribute === ATT_PAGE_SIZE) pageSizeBytes = reader.readInt32Attribute();
|
|
76
|
+
else reader.skipAttributeValue();
|
|
77
|
+
}
|
|
78
|
+
return { pageSizeBytes };
|
|
79
|
+
}
|
|
80
|
+
const SUPPORTED_BACKUP_FORMAT_VERSION = 10;
|
|
81
|
+
function relationToColumns(relation) {
|
|
82
|
+
return relation.fields.filter((field) => !field.computed).map((field) => ({
|
|
83
|
+
name: field.name,
|
|
84
|
+
type: field.typeLabel
|
|
85
|
+
}));
|
|
86
|
+
}
|
|
87
|
+
function readFirebirdBackup(bytes) {
|
|
88
|
+
const reader = new FirebirdBackupReader(bytes);
|
|
89
|
+
const leadingRecordType = reader.readTag();
|
|
90
|
+
if (leadingRecordType !== 0) throw new FirebirdBackupFormatError(`expected the stream to open with rec_burp (tag 0), found tag ${leadingRecordType} -- not a recognisable gbak backup stream`);
|
|
91
|
+
const { backupFormatVersion, transportable, compressed } = readBurpHeader(reader);
|
|
92
|
+
if (backupFormatVersion !== 10) throw new FirebirdBackupFormatError(`backup format version ${backupFormatVersion} is not supported -- this reader has only been built and verified against format version 10 (Firebird 3.0-era gbak output). Refusing to guess at a different format's own attribute/record shape rather than risk silently misdecoding it.`);
|
|
93
|
+
if (!transportable) throw new FirebirdBackupFormatError("backup is in non-transportable (native binary) row format (att_backup_transportable=false) -- this reader only decodes the transportable/XDR row encoding, the one every real fixture it was built against actually uses (gbak's own default).");
|
|
94
|
+
let pageSizeBytes;
|
|
95
|
+
const schema = /* @__PURE__ */ new Map();
|
|
96
|
+
const tablesInOrder = [];
|
|
97
|
+
const rowsByRelation = /* @__PURE__ */ new Map();
|
|
98
|
+
for (;;) {
|
|
99
|
+
const recordType = reader.readTag();
|
|
100
|
+
if (recordType === REC_END) break;
|
|
101
|
+
if (recordType === REC_DATABASE || recordType === REC_PHYSICAL_DB) {
|
|
102
|
+
pageSizeBytes = readDatabaseHeader(reader).pageSizeBytes ?? pageSizeBytes;
|
|
103
|
+
continue;
|
|
104
|
+
}
|
|
105
|
+
if (recordType === REC_RELATION) {
|
|
106
|
+
const relation = readRelationSchema(reader, (nestedRecordType) => {
|
|
107
|
+
throw new FirebirdCompositeRecordUnsupportedError(nestedRecordType, "reading a relation's own schema (a rec_view child, most likely)");
|
|
108
|
+
});
|
|
109
|
+
schema.set(relation.name, relation);
|
|
110
|
+
tablesInOrder.push(relation.name);
|
|
111
|
+
continue;
|
|
112
|
+
}
|
|
113
|
+
if (recordType === REC_RELATION_DATA) {
|
|
114
|
+
const result = readRelationData(reader, schema, compressed);
|
|
115
|
+
rowsByRelation.set(result.relationName, result.rows);
|
|
116
|
+
continue;
|
|
117
|
+
}
|
|
118
|
+
if (FLAT_SKIPPABLE_RECORD_TYPES.has(recordType)) {
|
|
119
|
+
reader.skipFlatRecordAttributes();
|
|
120
|
+
continue;
|
|
121
|
+
}
|
|
122
|
+
throw new FirebirdCompositeRecordUnsupportedError(recordType, "walking the backup stream's own top-level record sequence");
|
|
123
|
+
}
|
|
124
|
+
const tables = tablesInOrder.map((name) => {
|
|
125
|
+
const relation = schema.get(name);
|
|
126
|
+
if (relation === void 0) throw new FirebirdBackupFormatError(`internal error: relation "${name}" missing from its own schema map`);
|
|
127
|
+
const rows = rowsByRelation.get(name) ?? [];
|
|
128
|
+
return {
|
|
129
|
+
tableName: relation.name,
|
|
130
|
+
columns: relationToColumns(relation),
|
|
131
|
+
rows
|
|
132
|
+
};
|
|
133
|
+
});
|
|
134
|
+
return {
|
|
135
|
+
summary: {
|
|
136
|
+
backupFormatVersion,
|
|
137
|
+
transportable,
|
|
138
|
+
compressed,
|
|
139
|
+
pageSizeBytes
|
|
140
|
+
},
|
|
141
|
+
tables
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
//#endregion
|
|
145
|
+
export { FirebirdBackupFormatError, FirebirdCompositeRecordUnsupportedError, FirebirdSchemaParseError, SUPPORTED_BACKUP_FORMAT_VERSION, readFirebirdBackup };
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
//#region src/firebird/blr-types.ts
|
|
3
|
+
const BLR_SHORT = 7;
|
|
4
|
+
const BLR_LONG = 8;
|
|
5
|
+
const BLR_QUAD = 9;
|
|
6
|
+
const BLR_FLOAT = 10;
|
|
7
|
+
const BLR_D_FLOAT = 11;
|
|
8
|
+
const BLR_SQL_DATE = 12;
|
|
9
|
+
const BLR_SQL_TIME = 13;
|
|
10
|
+
const BLR_TEXT = 14;
|
|
11
|
+
const BLR_TEXT2 = 15;
|
|
12
|
+
const BLR_INT64 = 16;
|
|
13
|
+
const BLR_BOOL = 23;
|
|
14
|
+
const BLR_DEC64 = 24;
|
|
15
|
+
const BLR_DEC128 = 25;
|
|
16
|
+
const BLR_INT128 = 26;
|
|
17
|
+
const BLR_DOUBLE = 27;
|
|
18
|
+
const BLR_SQL_TIME_TZ = 28;
|
|
19
|
+
const BLR_TIMESTAMP_TZ = 29;
|
|
20
|
+
const BLR_EX_TIME_TZ = 30;
|
|
21
|
+
const BLR_EX_TIMESTAMP_TZ = 31;
|
|
22
|
+
const BLR_TIMESTAMP = 35;
|
|
23
|
+
const BLR_VARYING = 37;
|
|
24
|
+
const BLR_VARYING2 = 38;
|
|
25
|
+
const BLR_CSTRING = 40;
|
|
26
|
+
const BLR_CSTRING2 = 41;
|
|
27
|
+
const BLR_BLOB = 261;
|
|
28
|
+
const BLR_TO_PHYSICAL_TYPE = /* @__PURE__ */ new Map([
|
|
29
|
+
[7, "short"],
|
|
30
|
+
[8, "long"],
|
|
31
|
+
[9, "quad"],
|
|
32
|
+
[10, "real"],
|
|
33
|
+
[11, "double"],
|
|
34
|
+
[12, "sql_date"],
|
|
35
|
+
[13, "sql_time"],
|
|
36
|
+
[14, "text"],
|
|
37
|
+
[15, "text"],
|
|
38
|
+
[16, "int64"],
|
|
39
|
+
[23, "boolean"],
|
|
40
|
+
[24, "dec64"],
|
|
41
|
+
[25, "dec128"],
|
|
42
|
+
[26, "int128"],
|
|
43
|
+
[27, "double"],
|
|
44
|
+
[28, "unsupported-tz"],
|
|
45
|
+
[29, "unsupported-tz"],
|
|
46
|
+
[30, "unsupported-tz"],
|
|
47
|
+
[31, "unsupported-tz"],
|
|
48
|
+
[35, "timestamp"],
|
|
49
|
+
[37, "varying"],
|
|
50
|
+
[38, "varying"],
|
|
51
|
+
[40, "cstring"],
|
|
52
|
+
[41, "cstring"],
|
|
53
|
+
[261, "blob"]
|
|
54
|
+
]);
|
|
55
|
+
var FirebirdUnsupportedFieldTypeError = class extends Error {
|
|
56
|
+
blrType;
|
|
57
|
+
constructor(blrType) {
|
|
58
|
+
super(`Firebird backup: field has BLR type ${blrType}, which is not a recognised column datatype opcode for a Firebird-embedded .odb's own user/system tables`);
|
|
59
|
+
this.name = "FirebirdUnsupportedFieldTypeError";
|
|
60
|
+
this.blrType = blrType;
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
function decodeBlrType(blrType) {
|
|
64
|
+
const physical = BLR_TO_PHYSICAL_TYPE.get(blrType);
|
|
65
|
+
if (physical === void 0) throw new FirebirdUnsupportedFieldTypeError(blrType);
|
|
66
|
+
return physical;
|
|
67
|
+
}
|
|
68
|
+
function describeFieldType(physical, lengthBytes, scale, characterLength) {
|
|
69
|
+
switch (physical) {
|
|
70
|
+
case "short": return scale === 0 ? "SMALLINT" : `NUMERIC(4,${-scale})`;
|
|
71
|
+
case "long": return scale === 0 ? "INTEGER" : `NUMERIC(9,${-scale})`;
|
|
72
|
+
case "int64": return scale === 0 ? "BIGINT" : `NUMERIC(18,${-scale})`;
|
|
73
|
+
case "real": return "FLOAT";
|
|
74
|
+
case "double": return "DOUBLE PRECISION";
|
|
75
|
+
case "sql_date": return "DATE";
|
|
76
|
+
case "sql_time": return "TIME";
|
|
77
|
+
case "timestamp": return "TIMESTAMP";
|
|
78
|
+
case "text": return `CHAR(${characterLength ?? lengthBytes})`;
|
|
79
|
+
case "varying": return `VARCHAR(${characterLength ?? lengthBytes})`;
|
|
80
|
+
case "cstring": return `CSTRING(${characterLength ?? lengthBytes})`;
|
|
81
|
+
case "boolean": return "BOOLEAN";
|
|
82
|
+
case "blob": return "BLOB";
|
|
83
|
+
case "quad": return "ARRAY";
|
|
84
|
+
case "int128": return `NUMERIC(38,${-scale})`;
|
|
85
|
+
case "dec64": return "DECFLOAT(16)";
|
|
86
|
+
case "dec128": return "DECFLOAT(34)";
|
|
87
|
+
case "unsupported-tz": return "TIMESTAMP/TIME WITH TIME ZONE";
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
//#endregion
|
|
91
|
+
exports.BLR_BLOB = BLR_BLOB;
|
|
92
|
+
exports.BLR_BOOL = BLR_BOOL;
|
|
93
|
+
exports.BLR_CSTRING = BLR_CSTRING;
|
|
94
|
+
exports.BLR_CSTRING2 = BLR_CSTRING2;
|
|
95
|
+
exports.BLR_DEC128 = BLR_DEC128;
|
|
96
|
+
exports.BLR_DEC64 = BLR_DEC64;
|
|
97
|
+
exports.BLR_DOUBLE = BLR_DOUBLE;
|
|
98
|
+
exports.BLR_D_FLOAT = BLR_D_FLOAT;
|
|
99
|
+
exports.BLR_EX_TIMESTAMP_TZ = BLR_EX_TIMESTAMP_TZ;
|
|
100
|
+
exports.BLR_EX_TIME_TZ = BLR_EX_TIME_TZ;
|
|
101
|
+
exports.BLR_FLOAT = BLR_FLOAT;
|
|
102
|
+
exports.BLR_INT128 = BLR_INT128;
|
|
103
|
+
exports.BLR_INT64 = BLR_INT64;
|
|
104
|
+
exports.BLR_LONG = BLR_LONG;
|
|
105
|
+
exports.BLR_QUAD = BLR_QUAD;
|
|
106
|
+
exports.BLR_SHORT = BLR_SHORT;
|
|
107
|
+
exports.BLR_SQL_DATE = BLR_SQL_DATE;
|
|
108
|
+
exports.BLR_SQL_TIME = BLR_SQL_TIME;
|
|
109
|
+
exports.BLR_SQL_TIME_TZ = BLR_SQL_TIME_TZ;
|
|
110
|
+
exports.BLR_TEXT = BLR_TEXT;
|
|
111
|
+
exports.BLR_TEXT2 = BLR_TEXT2;
|
|
112
|
+
exports.BLR_TIMESTAMP = BLR_TIMESTAMP;
|
|
113
|
+
exports.BLR_TIMESTAMP_TZ = BLR_TIMESTAMP_TZ;
|
|
114
|
+
exports.BLR_VARYING = BLR_VARYING;
|
|
115
|
+
exports.BLR_VARYING2 = BLR_VARYING2;
|
|
116
|
+
exports.FirebirdUnsupportedFieldTypeError = FirebirdUnsupportedFieldTypeError;
|
|
117
|
+
exports.decodeBlrType = decodeBlrType;
|
|
118
|
+
exports.describeFieldType = describeFieldType;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { C as BLR_TIMESTAMP_TZ, D as FirebirdUnsupportedFieldTypeError, E as FirebirdPhysicalType, O as decodeBlrType, S as BLR_TIMESTAMP, T as BLR_VARYING2, _ as BLR_SQL_DATE, a as BLR_DEC128, b as BLR_TEXT, c as BLR_D_FLOAT, d as BLR_FLOAT, f as BLR_INT128, g as BLR_SHORT, h as BLR_QUAD, i as BLR_CSTRING2, k as describeFieldType, l as BLR_EX_TIMESTAMP_TZ, m as BLR_LONG, n as BLR_BOOL, o as BLR_DEC64, p as BLR_INT64, r as BLR_CSTRING, s as BLR_DOUBLE, t as BLR_BLOB, u as BLR_EX_TIME_TZ, v as BLR_SQL_TIME, w as BLR_VARYING, x as BLR_TEXT2, y as BLR_SQL_TIME_TZ } from "../blr-types-CYYC3yYU.cjs";
|
|
2
|
+
export { BLR_BLOB, BLR_BOOL, BLR_CSTRING, BLR_CSTRING2, BLR_DEC128, BLR_DEC64, BLR_DOUBLE, BLR_D_FLOAT, BLR_EX_TIMESTAMP_TZ, BLR_EX_TIME_TZ, BLR_FLOAT, BLR_INT128, BLR_INT64, BLR_LONG, BLR_QUAD, BLR_SHORT, BLR_SQL_DATE, BLR_SQL_TIME, BLR_SQL_TIME_TZ, BLR_TEXT, BLR_TEXT2, BLR_TIMESTAMP, BLR_TIMESTAMP_TZ, BLR_VARYING, BLR_VARYING2, FirebirdPhysicalType, FirebirdUnsupportedFieldTypeError, decodeBlrType, describeFieldType };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { C as BLR_TIMESTAMP_TZ, D as FirebirdUnsupportedFieldTypeError, E as FirebirdPhysicalType, O as decodeBlrType, S as BLR_TIMESTAMP, T as BLR_VARYING2, _ as BLR_SQL_DATE, a as BLR_DEC128, b as BLR_TEXT, c as BLR_D_FLOAT, d as BLR_FLOAT, f as BLR_INT128, g as BLR_SHORT, h as BLR_QUAD, i as BLR_CSTRING2, k as describeFieldType, l as BLR_EX_TIMESTAMP_TZ, m as BLR_LONG, n as BLR_BOOL, o as BLR_DEC64, p as BLR_INT64, r as BLR_CSTRING, s as BLR_DOUBLE, t as BLR_BLOB, u as BLR_EX_TIME_TZ, v as BLR_SQL_TIME, w as BLR_VARYING, x as BLR_TEXT2, y as BLR_SQL_TIME_TZ } from "../blr-types-CYYC3yYU.js";
|
|
2
|
+
export { BLR_BLOB, BLR_BOOL, BLR_CSTRING, BLR_CSTRING2, BLR_DEC128, BLR_DEC64, BLR_DOUBLE, BLR_D_FLOAT, BLR_EX_TIMESTAMP_TZ, BLR_EX_TIME_TZ, BLR_FLOAT, BLR_INT128, BLR_INT64, BLR_LONG, BLR_QUAD, BLR_SHORT, BLR_SQL_DATE, BLR_SQL_TIME, BLR_SQL_TIME_TZ, BLR_TEXT, BLR_TEXT2, BLR_TIMESTAMP, BLR_TIMESTAMP_TZ, BLR_VARYING, BLR_VARYING2, FirebirdPhysicalType, FirebirdUnsupportedFieldTypeError, decodeBlrType, describeFieldType };
|