@gscdump/engine 1.3.2 → 1.4.1
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/adapters/duckdb-node.d.mts +7 -0
- package/dist/adapters/duckdb-node.mjs +94 -0
- package/dist/adapters/filesystem.d.mts +1 -1
- package/dist/adapters/filesystem.mjs +1 -1
- package/dist/adapters/hyparquet.d.mts +4 -3
- package/dist/adapters/hyparquet.mjs +7 -3
- package/dist/adapters/node-harness.d.mts +38 -0
- package/dist/adapters/node-harness.mjs +47 -0
- package/dist/adapters/node.d.mts +4 -100
- package/dist/adapters/node.mjs +4 -240
- package/dist/adapters/parquet-attach.d.mts +23 -0
- package/dist/adapters/parquet-attach.mjs +21 -0
- package/dist/adapters/r2-manifest.d.mts +82 -0
- package/dist/adapters/r2-manifest.mjs +364 -0
- package/dist/adapters/r2.d.mts +1 -1
- package/dist/adapters/read-optional.mjs +15 -0
- package/dist/adapters/snapshot-attach.d.mts +38 -0
- package/dist/adapters/snapshot-attach.mjs +85 -0
- package/dist/analysis-types.d.mts +56 -1
- package/dist/analyzer/define.d.mts +48 -0
- package/dist/analyzer/define.mjs +60 -0
- package/dist/analyzer/dispatch.d.mts +17 -0
- package/dist/analyzer/index.d.mts +4 -14
- package/dist/analyzer/index.mjs +4 -112
- package/dist/analyzer/registry.d.mts +33 -0
- package/dist/analyzer/registry.mjs +49 -0
- package/dist/analyzer/types.d.mts +95 -0
- package/dist/analyzer/types.mjs +5 -0
- package/dist/coerce.d.mts +4 -0
- package/dist/compaction.d.mts +14 -0
- package/dist/{_chunks/parquet-plan.mjs → compaction.mjs} +2 -138
- package/dist/contracts.d.mts +1 -2
- package/dist/{_chunks/schema.d.mts → drizzle-schema.d.mts} +22 -54
- package/dist/{_chunks/schema.mjs → drizzle-schema.mjs} +2 -78
- package/dist/{_chunks/snapshot.d.mts → duckdb.d.mts} +1 -14
- package/dist/duckdb.mjs +207 -0
- package/dist/engine.d.mts +4 -0
- package/dist/engine.mjs +385 -0
- package/dist/entities.d.mts +3 -52
- package/dist/entities.mjs +867 -2
- package/dist/errors.d.mts +114 -1
- package/dist/gc.mjs +92 -0
- package/dist/iceberg/append-sink.d.mts +14 -0
- package/dist/iceberg/append-sink.mjs +142 -0
- package/dist/iceberg/catalog.d.mts +71 -0
- package/dist/iceberg/catalog.mjs +109 -0
- package/dist/iceberg/index.d.mts +4 -13
- package/dist/iceberg/index.mjs +3 -244
- package/dist/iceberg/overwrite-writer.d.mts +161 -0
- package/dist/iceberg/overwrite-writer.mjs +102 -0
- package/dist/iceberg/pyiceberg-runtime.mjs +34 -0
- package/dist/iceberg/schema.d.mts +69 -0
- package/dist/{_chunks/schema2.mjs → iceberg/schema.mjs} +3 -2
- package/dist/index.d.mts +14 -190
- package/dist/index.mjs +10 -645
- package/dist/ingest-accumulator.d.mts +1 -1
- package/dist/ingest.d.mts +1 -1
- package/dist/layout.d.mts +31 -0
- package/dist/node_modules/.pnpm/hyparquet-compressors@1.1.1/node_modules/hyparquet-compressors/src/brotli.bitreader.mjs +88 -0
- package/dist/node_modules/.pnpm/hyparquet-compressors@1.1.1/node_modules/hyparquet-compressors/src/brotli.blocks.mjs +120 -0
- package/dist/node_modules/.pnpm/hyparquet-compressors@1.1.1/node_modules/hyparquet-compressors/src/brotli.context.mjs +1805 -0
- package/dist/node_modules/.pnpm/hyparquet-compressors@1.1.1/node_modules/hyparquet-compressors/src/brotli.contextmap.mjs +49 -0
- package/dist/node_modules/.pnpm/hyparquet-compressors@1.1.1/node_modules/hyparquet-compressors/src/brotli.dictionary.mjs +984 -0
- package/dist/node_modules/.pnpm/hyparquet-compressors@1.1.1/node_modules/hyparquet-compressors/src/brotli.huffman.mjs +266 -0
- package/dist/node_modules/.pnpm/hyparquet-compressors@1.1.1/node_modules/hyparquet-compressors/src/brotli.mjs +340 -0
- package/dist/node_modules/.pnpm/hyparquet-compressors@1.1.1/node_modules/hyparquet-compressors/src/brotli.prefix.mjs +109 -0
- package/dist/node_modules/.pnpm/hyparquet-compressors@1.1.1/node_modules/hyparquet-compressors/src/brotli.streams.mjs +21 -0
- package/dist/node_modules/.pnpm/hyparquet-compressors@1.1.1/node_modules/hyparquet-compressors/src/brotli.transform.mjs +190 -0
- package/dist/node_modules/.pnpm/hyparquet-compressors@1.1.1/node_modules/hyparquet-compressors/src/compressors.mjs +7 -0
- package/dist/node_modules/.pnpm/hyparquet-compressors@1.1.1/node_modules/hyparquet-compressors/src/gzip.huffman.mjs +121 -0
- package/dist/node_modules/.pnpm/hyparquet-compressors@1.1.1/node_modules/hyparquet-compressors/src/gzip.mjs +176 -0
- package/dist/node_modules/.pnpm/hyparquet-compressors@1.1.1/node_modules/hyparquet-compressors/src/index.mjs +7 -0
- package/dist/node_modules/.pnpm/hyparquet-compressors@1.1.1/node_modules/hyparquet-compressors/src/lz4.mjs +52 -0
- package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/bloom.mjs +93 -0
- package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/bytewriter.mjs +91 -0
- package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/column.mjs +186 -0
- package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/datapage.mjs +113 -0
- package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/delta.mjs +111 -0
- package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/dictionary.mjs +99 -0
- package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/dremel.mjs +116 -0
- package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/encoding.mjs +51 -0
- package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/geospatial.mjs +84 -0
- package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/index.mjs +7 -0
- package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/indexes.mjs +31 -0
- package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/metadata.mjs +138 -0
- package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/node.mjs +8 -0
- package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/parquet-writer.mjs +139 -0
- package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/plain.mjs +68 -0
- package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/schema.mjs +254 -0
- package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/snappy.mjs +125 -0
- package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/splitstream.mjs +38 -0
- package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/thrift.mjs +79 -0
- package/dist/{_chunks/libs/hyparquet-writer.d.mts → node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/types.d.mts} +2 -2
- package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/unconvert.mjs +247 -0
- package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/variant.mjs +321 -0
- package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/wkb.mjs +79 -0
- package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/write-rows.mjs +122 -0
- package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/write.mjs +5 -0
- package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/types/bytewriter.d.mts +1 -0
- package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/types/index.d.mts +10 -0
- package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/types/node.d.mts +3 -0
- package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/types/parquet-writer.d.mts +2 -0
- package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/types/schema.d.mts +2 -0
- package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/types/wkb.d.mts +1 -0
- package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/types/write-rows.d.mts +1 -0
- package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/types/write.d.mts +1 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/assemble.mjs +3 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/bloom.mjs +69 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/column.mjs +8 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/constants.mjs +80 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/convert.mjs +3 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/datapage.mjs +6 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/delta.mjs +2 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/encoding.mjs +2 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/filter.mjs +3 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/geoparquet.mjs +1 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/index.mjs +7 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/indexes.mjs +5 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/metadata.mjs +7 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/node.mjs +3 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/plain.mjs +1 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/plan.mjs +5 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/query.mjs +3 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/read.mjs +6 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/rowgroup.mjs +7 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/schema.mjs +54 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/snappy.mjs +1 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/thrift.mjs +1 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/types.d.mts +1 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/utils.mjs +19 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/variant.mjs +3 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/wkb.mjs +1 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/xxhash.mjs +68 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/types/index.d.mts +7 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/types/indexes.d.mts +1 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/types/metadata.d.mts +1 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/types/node.d.mts +2 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/types/query.d.mts +1 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/types/read.d.mts +1 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/types/snappy.d.mts +1 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/types/utils.d.mts +1 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/assemble.mjs +144 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/bloom.mjs +124 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/column.mjs +127 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/constants.mjs +75 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/convert.mjs +118 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/datapage.mjs +144 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/delta.mjs +65 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/encoding.mjs +76 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/filter.mjs +98 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/geoparquet.mjs +24 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/index.mjs +7 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/indexes.mjs +16 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/metadata.mjs +235 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/node.mjs +7 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/plain.mjs +78 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/plan.mjs +147 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/query.mjs +3 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/read.mjs +106 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/rowgroup.mjs +154 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/schema.mjs +75 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/snappy.mjs +70 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/thrift.mjs +86 -0
- package/dist/{_chunks/libs/hyparquet.d.mts → node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/types.d.mts} +6 -8
- package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/utils.mjs +31 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/variant.mjs +225 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/wkb.mjs +94 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/xxhash.mjs +68 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/types/index.d.mts +10 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/types/indexes.d.mts +1 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/types/metadata.d.mts +1 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/types/node.d.mts +3 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/types/query.d.mts +1 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/types/read.d.mts +1 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/types/snappy.d.mts +1 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/types/utils.d.mts +1 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/avro/avro.metadata.mjs +1 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/avro/avro.read.mjs +4 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/avro/avro.write.mjs +2 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/catalog/file.mjs +1 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/catalog/loadTable.mjs +3 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/catalog/rest.mjs +73 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/create.mjs +67 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/delete.mjs +2 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/fetch.mjs +8 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/index.mjs +13 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/json.mjs +147 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/manifest.mjs +2 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/metadata.mjs +3 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/prune.mjs +4 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/puffin/deletion-vector.mjs +2 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/puffin/puffin.mjs +2 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/puffin/roaring.mjs +1 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/read.mjs +9 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/s3.mjs +3 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/schema.mjs +76 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/sigv4.mjs +2 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/sql/icebergDataSource.mjs +8 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/sql/icebergQuery.mjs +5 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/sql/whereFilter.mjs +1 -0
- package/dist/{_chunks/libs/icebird.d.mts → node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/types.d.mts} +5 -33
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/utils.mjs +8 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/commit.mjs +5 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/conversions.mjs +19 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/delete-file.mjs +3 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/geospatial.mjs +1 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/manifest-list.mjs +2 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/manifest.mjs +3 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/parquet.mjs +5 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/partition.mjs +75 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/rewrite.mjs +10 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/serde.mjs +2 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/snapshot.mjs +5 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/sort.mjs +3 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/stage-deletion-vector.mjs +11 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/stage-position-delete.mjs +8 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/stage.mjs +10 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/stats.mjs +4 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/transform.mjs +60 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/write.mjs +45 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/types/catalog/file.d.mts +1 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/types/catalog/rest.d.mts +1 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/types/create.d.mts +1 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/types/fetch.d.mts +1 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/types/index.d.mts +13 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/types/manifest.d.mts +1 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/types/metadata.d.mts +1 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/types/read.d.mts +2 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/types/s3.d.mts +1 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/types/sql/icebergDataSource.d.mts +2 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/types/sql/icebergQuery.d.mts +2 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/types/write/write.d.mts +32 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/ast.d.mts +1 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/backend/dataSource.mjs +1 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/execute/accumulator.mjs +2 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/execute/aggregates.mjs +10 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/execute/execute.mjs +15 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/execute/join.mjs +5 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/execute/scanColumn.mjs +1 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/execute/sort.mjs +5 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/execute/streamingAggregate.mjs +9 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/execute/utils.mjs +1 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/execute/window.mjs +5 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/execute/yield.mjs +17 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/expression/alias.mjs +1 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/expression/binary.mjs +1 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/expression/date.mjs +1 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/expression/evaluate.mjs +15 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/expression/math.mjs +1 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/expression/regexp.mjs +2 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/expression/strings.mjs +3 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/index.d.mts +1 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/index.mjs +9 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/parse/expression.mjs +6 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/parse/extractTables.mjs +1 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/parse/functions.mjs +5 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/parse/joins.mjs +7 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/parse/parse.mjs +10 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/parse/primary.mjs +8 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/parse/state.mjs +2 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/parse/tokenize.mjs +3 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/parse/types.d.mts +1 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/plan/columns.mjs +3 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/plan/plan.mjs +7 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/plan/types.d.mts +1 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/spatial/bbox.mjs +2 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/spatial/equality.mjs +2 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/spatial/operations.mjs +5 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/spatial/pointRelations.mjs +2 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/spatial/primitives.mjs +2 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/spatial/segments.mjs +2 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/spatial/spatial.mjs +6 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/spatial/wkt.mjs +1 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/types.d.mts +3 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/validation/aggregates.mjs +3 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/validation/executionErrors.mjs +2 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/validation/functions.mjs +2 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/validation/keywords.mjs +1 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/validation/parseErrors.mjs +2 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/validation/tables.mjs +2 -0
- package/dist/parquet-plan.d.mts +15 -0
- package/dist/parquet-plan.mjs +139 -0
- package/dist/parquet-pushdown.mjs +58 -0
- package/dist/period/index.d.mts +52 -1
- package/dist/planner.d.mts +2 -14
- package/dist/planner.mjs +2 -1
- package/dist/profile.d.mts +21 -0
- package/dist/profile.mjs +27 -0
- package/dist/query-dim.d.mts +54 -0
- package/dist/query-dim.mjs +91 -0
- package/dist/report/define.d.mts +8 -0
- package/dist/report/define.mjs +15 -0
- package/dist/report/hash.d.mts +13 -0
- package/dist/report/hash.mjs +29 -0
- package/dist/report/index.d.mts +4 -170
- package/dist/report/index.mjs +3 -55
- package/dist/report/registry.d.mts +18 -0
- package/dist/report/registry.mjs +14 -0
- package/dist/report/types.d.mts +139 -0
- package/dist/resolver/adapter.d.mts +13 -0
- package/dist/resolver/adapter.mjs +27 -0
- package/dist/resolver/canonical-source.d.mts +5 -0
- package/dist/resolver/canonical-source.mjs +14 -0
- package/dist/resolver/compile.d.mts +15 -0
- package/dist/resolver/compile.mjs +396 -0
- package/dist/resolver/datasets.d.mts +16 -0
- package/dist/resolver/datasets.mjs +159 -0
- package/dist/resolver/extras-overlay.d.mts +37 -0
- package/dist/resolver/extras-overlay.mjs +17 -0
- package/dist/resolver/filter-utils.d.mts +10 -0
- package/dist/resolver/filter-utils.mjs +59 -0
- package/dist/resolver/fragments.d.mts +60 -0
- package/dist/resolver/fragments.mjs +206 -0
- package/dist/resolver/index.d.mts +11 -371
- package/dist/resolver/index.mjs +10 -1
- package/dist/resolver/pg-adapter.d.mts +56 -0
- package/dist/resolver/pg-adapter.mjs +110 -0
- package/dist/resolver/run-query.d.mts +172 -0
- package/dist/resolver/run-query.mjs +241 -0
- package/dist/resolver/schema-drift.d.mts +15 -0
- package/dist/resolver/schema-drift.mjs +12 -0
- package/dist/rollups.d.mts +4 -4
- package/dist/rollups.mjs +3 -2
- package/dist/schedule.mjs +100 -0
- package/dist/schema.d.mts +34 -1
- package/dist/schema.mjs +78 -1
- package/dist/sink-node.d.mts +1 -159
- package/dist/sink-node.mjs +1 -133
- package/dist/sink.d.mts +125 -0
- package/dist/sinks/in-memory-sink.d.mts +25 -0
- package/dist/sinks/in-memory-sink.mjs +61 -0
- package/dist/sinks/index.d.mts +2 -0
- package/dist/sinks/index.mjs +2 -0
- package/dist/snapshot.d.mts +14 -0
- package/dist/source/attached-table.d.mts +45 -0
- package/dist/source/attached-table.mjs +55 -0
- package/dist/source/create-sql-query-source.d.mts +24 -0
- package/dist/source/create-sql-query-source.mjs +28 -0
- package/dist/source/index.d.mts +6 -66
- package/dist/source/index.mjs +9 -82
- package/dist/source/source-types.d.mts +49 -0
- package/dist/{_chunks/storage.d.mts → storage.d.mts} +4 -14
- package/dist/sync-config.d.mts +36 -0
- package/dist/sync-config.mjs +98 -0
- package/dist/vendor/hysnappy-purejs.mjs +12 -1
- package/package.json +4 -4
- package/dist/_chunks/analysis-types.d.mts +0 -57
- package/dist/_chunks/contracts.d.mts +0 -1
- package/dist/_chunks/engine.mjs +0 -731
- package/dist/_chunks/entities.mjs +0 -967
- package/dist/_chunks/errors.d.mts +0 -115
- package/dist/_chunks/index.d.mts +0 -53
- package/dist/_chunks/libs/hyparquet-compressors.mjs +0 -2796
- package/dist/_chunks/libs/hyparquet-writer.mjs +0 -2524
- package/dist/_chunks/libs/hyparquet.mjs +0 -2596
- package/dist/_chunks/libs/icebird.mjs +0 -564
- package/dist/_chunks/registry.d.mts +0 -213
- package/dist/_chunks/resolver.mjs +0 -1220
- package/dist/_chunks/sink.d.mts +0 -257
- /package/dist/{_chunks → analyzer}/dispatch.mjs +0 -0
- /package/dist/{_chunks/coerce.mjs → coerce.mjs} +0 -0
- /package/dist/{_chunks/layout.mjs → layout.mjs} +0 -0
- /package/dist/{_chunks/manifest-store-utils.mjs → manifest-store-utils.mjs} +0 -0
- /package/dist/{_chunks/libs/fzstd.mjs → node_modules/.pnpm/fzstd@0.1.1/node_modules/fzstd/esm/index.mjs} +0 -0
- /package/dist/{_chunks → resolver}/types.d.mts +0 -0
- /package/dist/{_chunks/schedule.d.mts → schedule.d.mts} +0 -0
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
const kDefaultCodeLength = 8;
|
|
2
|
+
const HUFFMAN_TABLE_BITS = 8;
|
|
3
|
+
const HUFFMAN_TABLE_MASK = 255;
|
|
4
|
+
const CODE_LENGTH_CODES = 18;
|
|
5
|
+
const kCodeLengthCodeOrder = new Uint8Array([
|
|
6
|
+
1,
|
|
7
|
+
2,
|
|
8
|
+
3,
|
|
9
|
+
4,
|
|
10
|
+
0,
|
|
11
|
+
5,
|
|
12
|
+
17,
|
|
13
|
+
6,
|
|
14
|
+
16,
|
|
15
|
+
7,
|
|
16
|
+
8,
|
|
17
|
+
9,
|
|
18
|
+
10,
|
|
19
|
+
11,
|
|
20
|
+
12,
|
|
21
|
+
13,
|
|
22
|
+
14,
|
|
23
|
+
15
|
|
24
|
+
]);
|
|
25
|
+
const kMaxHuffmanTableSize = new Uint16Array([
|
|
26
|
+
256,
|
|
27
|
+
402,
|
|
28
|
+
436,
|
|
29
|
+
468,
|
|
30
|
+
500,
|
|
31
|
+
534,
|
|
32
|
+
566,
|
|
33
|
+
598,
|
|
34
|
+
630,
|
|
35
|
+
662,
|
|
36
|
+
694,
|
|
37
|
+
726,
|
|
38
|
+
758,
|
|
39
|
+
790,
|
|
40
|
+
822,
|
|
41
|
+
854,
|
|
42
|
+
886,
|
|
43
|
+
920,
|
|
44
|
+
952,
|
|
45
|
+
984,
|
|
46
|
+
1016,
|
|
47
|
+
1048,
|
|
48
|
+
1080
|
|
49
|
+
]);
|
|
50
|
+
function HuffmanCode(bits, value) {
|
|
51
|
+
this.bits = bits;
|
|
52
|
+
this.value = value;
|
|
53
|
+
}
|
|
54
|
+
const kCodeLengthRepeatCode = 16;
|
|
55
|
+
const MAX_LENGTH = 15;
|
|
56
|
+
function getNextKey(key, len) {
|
|
57
|
+
let step = 1 << len - 1;
|
|
58
|
+
while (key & step) step >>= 1;
|
|
59
|
+
return (key & step - 1) + step;
|
|
60
|
+
}
|
|
61
|
+
function replicateValue(table, i, step, end, code) {
|
|
62
|
+
do {
|
|
63
|
+
end -= step;
|
|
64
|
+
table[i + end] = new HuffmanCode(code.bits, code.value);
|
|
65
|
+
} while (end > 0);
|
|
66
|
+
}
|
|
67
|
+
function nextTableBitSize(count, len, root_bits) {
|
|
68
|
+
let left = 1 << len - root_bits;
|
|
69
|
+
while (len < MAX_LENGTH) {
|
|
70
|
+
left -= count[len];
|
|
71
|
+
if (left <= 0) break;
|
|
72
|
+
++len;
|
|
73
|
+
left <<= 1;
|
|
74
|
+
}
|
|
75
|
+
return len - root_bits;
|
|
76
|
+
}
|
|
77
|
+
function buildHuffmanTable(root_table, table, root_bits, code_lengths, code_lengths_size) {
|
|
78
|
+
const start_table = table;
|
|
79
|
+
const count = /* @__PURE__ */ new Int32Array(16);
|
|
80
|
+
const offset = /* @__PURE__ */ new Int32Array(16);
|
|
81
|
+
const sorted = new Int32Array(code_lengths_size);
|
|
82
|
+
for (let i = 0; i < code_lengths_size; i++) count[code_lengths[i]]++;
|
|
83
|
+
offset[1] = 0;
|
|
84
|
+
for (let i = 1; i < MAX_LENGTH; i++) offset[i + 1] = offset[i] + count[i];
|
|
85
|
+
for (let i = 0; i < code_lengths_size; i++) if (code_lengths[i] !== 0) sorted[offset[code_lengths[i]]++] = i;
|
|
86
|
+
let table_bits = root_bits;
|
|
87
|
+
let table_size = 1 << table_bits;
|
|
88
|
+
let total_size = table_size;
|
|
89
|
+
if (offset[MAX_LENGTH] === 1) {
|
|
90
|
+
for (let key = 0; key < total_size; ++key) root_table[table + key] = new HuffmanCode(0, sorted[0] & 65535);
|
|
91
|
+
return total_size;
|
|
92
|
+
}
|
|
93
|
+
let key = 0;
|
|
94
|
+
let symbol = 0;
|
|
95
|
+
for (let len = 1, step = 2; len <= root_bits; ++len, step <<= 1) for (; count[len] > 0; --count[len]) {
|
|
96
|
+
const code = new HuffmanCode(len & 255, sorted[symbol++] & 65535);
|
|
97
|
+
replicateValue(root_table, table + key, step, table_size, code);
|
|
98
|
+
key = getNextKey(key, len);
|
|
99
|
+
}
|
|
100
|
+
const mask = total_size - 1;
|
|
101
|
+
let low = -1;
|
|
102
|
+
for (let len = root_bits + 1, step = 2; len <= MAX_LENGTH; ++len, step <<= 1) for (; count[len] > 0; --count[len]) {
|
|
103
|
+
if ((key & mask) !== low) {
|
|
104
|
+
table += table_size;
|
|
105
|
+
table_bits = nextTableBitSize(count, len, root_bits);
|
|
106
|
+
table_size = 1 << table_bits;
|
|
107
|
+
total_size += table_size;
|
|
108
|
+
low = key & mask;
|
|
109
|
+
root_table[start_table + low] = new HuffmanCode(table_bits + root_bits & 255, table - start_table - low & 65535);
|
|
110
|
+
}
|
|
111
|
+
const code = new HuffmanCode(len - root_bits & 255, sorted[symbol++] & 65535);
|
|
112
|
+
replicateValue(root_table, table + (key >> root_bits), step, table_size, code);
|
|
113
|
+
key = getNextKey(key, len);
|
|
114
|
+
}
|
|
115
|
+
return total_size;
|
|
116
|
+
}
|
|
117
|
+
function readHuffmanCode(alphabet_size, tables, table, br) {
|
|
118
|
+
const code_lengths = new Uint8Array(alphabet_size);
|
|
119
|
+
br.readMoreInput();
|
|
120
|
+
const simple_code_or_skip = br.readBits(2);
|
|
121
|
+
if (simple_code_or_skip === 1) {
|
|
122
|
+
let max_bits_counter = alphabet_size - 1;
|
|
123
|
+
let max_bits = 0;
|
|
124
|
+
const symbols = /* @__PURE__ */ new Int32Array(4);
|
|
125
|
+
const num_symbols = br.readBits(2) + 1;
|
|
126
|
+
while (max_bits_counter) {
|
|
127
|
+
max_bits_counter >>= 1;
|
|
128
|
+
max_bits++;
|
|
129
|
+
}
|
|
130
|
+
for (let i = 0; i < num_symbols; i++) {
|
|
131
|
+
symbols[i] = br.readBits(max_bits) % alphabet_size;
|
|
132
|
+
code_lengths[symbols[i]] = 2;
|
|
133
|
+
}
|
|
134
|
+
code_lengths[symbols[0]] = 1;
|
|
135
|
+
switch (num_symbols) {
|
|
136
|
+
case 1: break;
|
|
137
|
+
case 3:
|
|
138
|
+
if (symbols[0] === symbols[1] || symbols[0] === symbols[2] || symbols[1] === symbols[2]) throw new Error("[ReadHuffmanCode] invalid symbols");
|
|
139
|
+
break;
|
|
140
|
+
case 2:
|
|
141
|
+
if (symbols[0] === symbols[1]) throw new Error("[ReadHuffmanCode] invalid symbols");
|
|
142
|
+
code_lengths[symbols[1]] = 1;
|
|
143
|
+
break;
|
|
144
|
+
case 4:
|
|
145
|
+
if (symbols[0] === symbols[1] || symbols[0] === symbols[2] || symbols[0] === symbols[3] || symbols[1] === symbols[2] || symbols[1] === symbols[3] || symbols[2] === symbols[3]) throw new Error("[ReadHuffmanCode] invalid symbols");
|
|
146
|
+
if (br.readBits(1)) {
|
|
147
|
+
code_lengths[symbols[2]] = 3;
|
|
148
|
+
code_lengths[symbols[3]] = 3;
|
|
149
|
+
} else code_lengths[symbols[0]] = 2;
|
|
150
|
+
break;
|
|
151
|
+
}
|
|
152
|
+
} else {
|
|
153
|
+
const code_length_code_lengths = new Uint8Array(CODE_LENGTH_CODES);
|
|
154
|
+
let space = 32;
|
|
155
|
+
let num_codes = 0;
|
|
156
|
+
const huff = [
|
|
157
|
+
new HuffmanCode(2, 0),
|
|
158
|
+
new HuffmanCode(2, 4),
|
|
159
|
+
new HuffmanCode(2, 3),
|
|
160
|
+
new HuffmanCode(3, 2),
|
|
161
|
+
new HuffmanCode(2, 0),
|
|
162
|
+
new HuffmanCode(2, 4),
|
|
163
|
+
new HuffmanCode(2, 3),
|
|
164
|
+
new HuffmanCode(4, 1),
|
|
165
|
+
new HuffmanCode(2, 0),
|
|
166
|
+
new HuffmanCode(2, 4),
|
|
167
|
+
new HuffmanCode(2, 3),
|
|
168
|
+
new HuffmanCode(3, 2),
|
|
169
|
+
new HuffmanCode(2, 0),
|
|
170
|
+
new HuffmanCode(2, 4),
|
|
171
|
+
new HuffmanCode(2, 3),
|
|
172
|
+
new HuffmanCode(4, 5)
|
|
173
|
+
];
|
|
174
|
+
for (let i = simple_code_or_skip; i < CODE_LENGTH_CODES && space > 0; i++) {
|
|
175
|
+
const code_len_idx = kCodeLengthCodeOrder[i];
|
|
176
|
+
let p = 0;
|
|
177
|
+
br.fillBitWindow();
|
|
178
|
+
p += br.val_ >>> br.bit_pos_ & 15;
|
|
179
|
+
br.bit_pos_ += huff[p].bits;
|
|
180
|
+
const v = huff[p].value;
|
|
181
|
+
code_length_code_lengths[code_len_idx] = v;
|
|
182
|
+
if (v !== 0) {
|
|
183
|
+
space -= 32 >> v;
|
|
184
|
+
num_codes++;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
if (!(num_codes === 1 || space === 0)) throw new Error("[ReadHuffmanCode] invalid num_codes or space");
|
|
188
|
+
readHuffmanCodeLengths(code_length_code_lengths, alphabet_size, code_lengths, br);
|
|
189
|
+
}
|
|
190
|
+
const table_size = buildHuffmanTable(tables, table, HUFFMAN_TABLE_BITS, code_lengths, alphabet_size);
|
|
191
|
+
if (!table_size) throw new Error("brotli BuildHuffmanTable failed");
|
|
192
|
+
return table_size;
|
|
193
|
+
}
|
|
194
|
+
function readSymbol(table, index, br) {
|
|
195
|
+
br.fillBitWindow();
|
|
196
|
+
index += br.val_ >>> br.bit_pos_ & HUFFMAN_TABLE_MASK;
|
|
197
|
+
const nbits = table[index].bits - HUFFMAN_TABLE_BITS;
|
|
198
|
+
if (nbits > 0) {
|
|
199
|
+
br.bit_pos_ += HUFFMAN_TABLE_BITS;
|
|
200
|
+
index += table[index].value;
|
|
201
|
+
index += br.val_ >>> br.bit_pos_ & (1 << nbits) - 1;
|
|
202
|
+
}
|
|
203
|
+
br.bit_pos_ += table[index].bits;
|
|
204
|
+
return table[index].value;
|
|
205
|
+
}
|
|
206
|
+
function readHuffmanCodeLengths(code_length_code_lengths, num_symbols, code_lengths, br) {
|
|
207
|
+
let symbol = 0;
|
|
208
|
+
let prev_code_len = kDefaultCodeLength;
|
|
209
|
+
let repeat = 0;
|
|
210
|
+
let repeat_code_len = 0;
|
|
211
|
+
let space = 32768;
|
|
212
|
+
const table = [];
|
|
213
|
+
for (let i = 0; i < 32; i++) table.push(new HuffmanCode(0, 0));
|
|
214
|
+
buildHuffmanTable(table, 0, 5, code_length_code_lengths, CODE_LENGTH_CODES);
|
|
215
|
+
while (symbol < num_symbols && space > 0) {
|
|
216
|
+
let p = 0;
|
|
217
|
+
br.readMoreInput();
|
|
218
|
+
br.fillBitWindow();
|
|
219
|
+
p += br.val_ >>> br.bit_pos_ & 31;
|
|
220
|
+
br.bit_pos_ += table[p].bits;
|
|
221
|
+
const code_len = table[p].value & 255;
|
|
222
|
+
if (code_len < kCodeLengthRepeatCode) {
|
|
223
|
+
repeat = 0;
|
|
224
|
+
code_lengths[symbol++] = code_len;
|
|
225
|
+
if (code_len !== 0) {
|
|
226
|
+
prev_code_len = code_len;
|
|
227
|
+
space -= 32768 >> code_len;
|
|
228
|
+
}
|
|
229
|
+
} else {
|
|
230
|
+
const extra_bits = code_len - 14;
|
|
231
|
+
let new_len = 0;
|
|
232
|
+
if (code_len === kCodeLengthRepeatCode) new_len = prev_code_len;
|
|
233
|
+
if (repeat_code_len !== new_len) {
|
|
234
|
+
repeat = 0;
|
|
235
|
+
repeat_code_len = new_len;
|
|
236
|
+
}
|
|
237
|
+
const old_repeat = repeat;
|
|
238
|
+
if (repeat > 0) {
|
|
239
|
+
repeat -= 2;
|
|
240
|
+
repeat <<= extra_bits;
|
|
241
|
+
}
|
|
242
|
+
repeat += br.readBits(extra_bits) + 3;
|
|
243
|
+
const repeat_delta = repeat - old_repeat;
|
|
244
|
+
if (symbol + repeat_delta > num_symbols) throw new Error("[ReadHuffmanCodeLengths] symbol + repeat_delta > num_symbols");
|
|
245
|
+
for (let x = 0; x < repeat_delta; x++) code_lengths[symbol + x] = repeat_code_len;
|
|
246
|
+
symbol += repeat_delta;
|
|
247
|
+
if (repeat_code_len !== 0) space -= repeat_delta << 15 - repeat_code_len;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
if (space !== 0) throw new Error("[ReadHuffmanCodeLengths] space = " + space);
|
|
251
|
+
for (; symbol < num_symbols; symbol++) code_lengths[symbol] = 0;
|
|
252
|
+
}
|
|
253
|
+
function HuffmanTreeGroup(alphabet_size, num_htrees) {
|
|
254
|
+
this.alphabet_size = alphabet_size;
|
|
255
|
+
this.num_htrees = num_htrees;
|
|
256
|
+
this.codes = new Array(num_htrees + num_htrees * kMaxHuffmanTableSize[alphabet_size + 31 >>> 5]);
|
|
257
|
+
this.htrees = new Uint32Array(num_htrees);
|
|
258
|
+
}
|
|
259
|
+
HuffmanTreeGroup.prototype.decode = function(br) {
|
|
260
|
+
let next = 0;
|
|
261
|
+
for (let i = 0; i < this.num_htrees; i++) {
|
|
262
|
+
this.htrees[i] = next;
|
|
263
|
+
next += readHuffmanCode(this.alphabet_size, this.codes, next, br);
|
|
264
|
+
}
|
|
265
|
+
};
|
|
266
|
+
export { HuffmanCode, HuffmanTreeGroup, readHuffmanCode, readSymbol };
|
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
import { BrotliBitReader } from "./brotli.bitreader.mjs";
|
|
2
|
+
import { HuffmanCode, HuffmanTreeGroup, readHuffmanCode, readSymbol } from "./brotli.huffman.mjs";
|
|
3
|
+
import { kCopyLengthPrefixCode, kCopyRangeLut, kInsertLengthPrefixCode, kInsertRangeLut } from "./brotli.prefix.mjs";
|
|
4
|
+
import { HUFFMAN_MAX_TABLE_SIZE } from "./gzip.huffman.mjs";
|
|
5
|
+
import { copyUncompressedBlockToOutput, decodeBlockType, decodeMetaBlockLength, decodeVarLenUint8, decodeWindowBits, jumpToByteBoundary, readBlockLength } from "./brotli.blocks.mjs";
|
|
6
|
+
import { lookup, lookupOffsets } from "./brotli.context.mjs";
|
|
7
|
+
import { decodeContextMap } from "./brotli.contextmap.mjs";
|
|
8
|
+
import { BrotliInput, BrotliOutput } from "./brotli.streams.mjs";
|
|
9
|
+
import { kNumTransforms, transformDictionaryWord } from "./brotli.transform.mjs";
|
|
10
|
+
const kNumLiteralCodes = 256;
|
|
11
|
+
const kNumInsertAndCopyCodes = 704;
|
|
12
|
+
const kNumBlockLengthCodes = 26;
|
|
13
|
+
const kLiteralContextBits = 6;
|
|
14
|
+
const kDistanceContextBits = 2;
|
|
15
|
+
const NUM_DISTANCE_SHORT_CODES = 16;
|
|
16
|
+
const kDistanceShortCodeIndexOffset = new Uint8Array([
|
|
17
|
+
3,
|
|
18
|
+
2,
|
|
19
|
+
1,
|
|
20
|
+
0,
|
|
21
|
+
3,
|
|
22
|
+
3,
|
|
23
|
+
3,
|
|
24
|
+
3,
|
|
25
|
+
3,
|
|
26
|
+
3,
|
|
27
|
+
2,
|
|
28
|
+
2,
|
|
29
|
+
2,
|
|
30
|
+
2,
|
|
31
|
+
2,
|
|
32
|
+
2
|
|
33
|
+
]);
|
|
34
|
+
const kDistanceShortCodeValueOffset = new Int8Array([
|
|
35
|
+
0,
|
|
36
|
+
0,
|
|
37
|
+
0,
|
|
38
|
+
0,
|
|
39
|
+
-1,
|
|
40
|
+
1,
|
|
41
|
+
-2,
|
|
42
|
+
2,
|
|
43
|
+
-3,
|
|
44
|
+
3,
|
|
45
|
+
-1,
|
|
46
|
+
1,
|
|
47
|
+
-2,
|
|
48
|
+
2,
|
|
49
|
+
-3,
|
|
50
|
+
3
|
|
51
|
+
]);
|
|
52
|
+
const offsetsByLength = new Uint32Array([
|
|
53
|
+
0,
|
|
54
|
+
0,
|
|
55
|
+
0,
|
|
56
|
+
0,
|
|
57
|
+
0,
|
|
58
|
+
4096,
|
|
59
|
+
9216,
|
|
60
|
+
21504,
|
|
61
|
+
35840,
|
|
62
|
+
44032,
|
|
63
|
+
53248,
|
|
64
|
+
63488,
|
|
65
|
+
74752,
|
|
66
|
+
87040,
|
|
67
|
+
93696,
|
|
68
|
+
100864,
|
|
69
|
+
104704,
|
|
70
|
+
106752,
|
|
71
|
+
108928,
|
|
72
|
+
113536,
|
|
73
|
+
115968,
|
|
74
|
+
118528,
|
|
75
|
+
119872,
|
|
76
|
+
121280,
|
|
77
|
+
122016
|
|
78
|
+
]);
|
|
79
|
+
const sizeBitsByLength = new Uint8Array([
|
|
80
|
+
0,
|
|
81
|
+
0,
|
|
82
|
+
0,
|
|
83
|
+
0,
|
|
84
|
+
10,
|
|
85
|
+
10,
|
|
86
|
+
11,
|
|
87
|
+
11,
|
|
88
|
+
10,
|
|
89
|
+
10,
|
|
90
|
+
10,
|
|
91
|
+
10,
|
|
92
|
+
10,
|
|
93
|
+
9,
|
|
94
|
+
9,
|
|
95
|
+
8,
|
|
96
|
+
7,
|
|
97
|
+
7,
|
|
98
|
+
8,
|
|
99
|
+
7,
|
|
100
|
+
7,
|
|
101
|
+
6,
|
|
102
|
+
6,
|
|
103
|
+
5,
|
|
104
|
+
5
|
|
105
|
+
]);
|
|
106
|
+
const minDictionaryWordLength = 4;
|
|
107
|
+
const maxDictionaryWordLength = 24;
|
|
108
|
+
function decompressBrotli(input, outputLength) {
|
|
109
|
+
const output = new Uint8Array(outputLength);
|
|
110
|
+
brotli(new BrotliInput(input), new BrotliOutput(output));
|
|
111
|
+
return output;
|
|
112
|
+
}
|
|
113
|
+
function brotli(input, output) {
|
|
114
|
+
let pos = 0;
|
|
115
|
+
let input_end = 0;
|
|
116
|
+
let window_bits = 0;
|
|
117
|
+
let max_distance = 0;
|
|
118
|
+
const dist_rb = [
|
|
119
|
+
16,
|
|
120
|
+
15,
|
|
121
|
+
11,
|
|
122
|
+
4
|
|
123
|
+
];
|
|
124
|
+
let dist_rb_idx = 0;
|
|
125
|
+
let prev_byte1 = 0;
|
|
126
|
+
let prev_byte2 = 0;
|
|
127
|
+
const hgroup = [
|
|
128
|
+
new HuffmanTreeGroup(0, 0),
|
|
129
|
+
new HuffmanTreeGroup(0, 0),
|
|
130
|
+
new HuffmanTreeGroup(0, 0)
|
|
131
|
+
];
|
|
132
|
+
const kRingBufferWriteAheadSlack = 128 + BrotliBitReader.READ_SIZE;
|
|
133
|
+
const br = new BrotliBitReader(input);
|
|
134
|
+
window_bits = decodeWindowBits(br);
|
|
135
|
+
const max_backward_distance = (1 << window_bits) - 16;
|
|
136
|
+
const ringbuffer_size = 1 << window_bits;
|
|
137
|
+
const ringbuffer_mask = ringbuffer_size - 1;
|
|
138
|
+
const ringbuffer = new Uint8Array(ringbuffer_size + kRingBufferWriteAheadSlack + maxDictionaryWordLength);
|
|
139
|
+
const ringbuffer_end = ringbuffer_size;
|
|
140
|
+
const block_type_trees = [];
|
|
141
|
+
const block_len_trees = [];
|
|
142
|
+
for (let x = 0; x < 3 * HUFFMAN_MAX_TABLE_SIZE; x++) {
|
|
143
|
+
block_type_trees[x] = new HuffmanCode(0, 0);
|
|
144
|
+
block_len_trees[x] = new HuffmanCode(0, 0);
|
|
145
|
+
}
|
|
146
|
+
while (!input_end) {
|
|
147
|
+
let meta_block_remaining_len = 0;
|
|
148
|
+
const block_length = [
|
|
149
|
+
1 << 28,
|
|
150
|
+
1 << 28,
|
|
151
|
+
1 << 28
|
|
152
|
+
];
|
|
153
|
+
const block_type = [0];
|
|
154
|
+
const num_block_types = [
|
|
155
|
+
1,
|
|
156
|
+
1,
|
|
157
|
+
1
|
|
158
|
+
];
|
|
159
|
+
const block_type_rb = [
|
|
160
|
+
0,
|
|
161
|
+
1,
|
|
162
|
+
0,
|
|
163
|
+
1,
|
|
164
|
+
0,
|
|
165
|
+
1
|
|
166
|
+
];
|
|
167
|
+
const block_type_rb_index = [0];
|
|
168
|
+
let context_offset = 0;
|
|
169
|
+
for (let i = 0; i < 3; i++) {
|
|
170
|
+
hgroup[i].codes = [];
|
|
171
|
+
hgroup[i].htrees = /* @__PURE__ */ new Uint32Array();
|
|
172
|
+
}
|
|
173
|
+
br.readMoreInput();
|
|
174
|
+
const _out = decodeMetaBlockLength(br);
|
|
175
|
+
meta_block_remaining_len = _out.meta_block_length;
|
|
176
|
+
if (pos + meta_block_remaining_len > output.buffer.length) {
|
|
177
|
+
const tmp = new Uint8Array(pos + meta_block_remaining_len);
|
|
178
|
+
tmp.set(output.buffer);
|
|
179
|
+
output.buffer = tmp;
|
|
180
|
+
}
|
|
181
|
+
input_end = _out.input_end;
|
|
182
|
+
if (_out.is_metadata) {
|
|
183
|
+
jumpToByteBoundary(br);
|
|
184
|
+
for (; meta_block_remaining_len > 0; --meta_block_remaining_len) {
|
|
185
|
+
br.readMoreInput();
|
|
186
|
+
br.readBits(8);
|
|
187
|
+
}
|
|
188
|
+
continue;
|
|
189
|
+
}
|
|
190
|
+
if (meta_block_remaining_len === 0) continue;
|
|
191
|
+
if (_out.is_uncompressed) {
|
|
192
|
+
br.bit_pos_ = br.bit_pos_ + 7 & -8;
|
|
193
|
+
copyUncompressedBlockToOutput(output, meta_block_remaining_len, pos, ringbuffer, ringbuffer_mask, br);
|
|
194
|
+
pos += meta_block_remaining_len;
|
|
195
|
+
continue;
|
|
196
|
+
}
|
|
197
|
+
for (let i = 0; i < 3; i++) {
|
|
198
|
+
num_block_types[i] = decodeVarLenUint8(br) + 1;
|
|
199
|
+
if (num_block_types[i] >= 2) {
|
|
200
|
+
readHuffmanCode(num_block_types[i] + 2, block_type_trees, i * HUFFMAN_MAX_TABLE_SIZE, br);
|
|
201
|
+
readHuffmanCode(kNumBlockLengthCodes, block_len_trees, i * HUFFMAN_MAX_TABLE_SIZE, br);
|
|
202
|
+
block_length[i] = readBlockLength(block_len_trees, i * HUFFMAN_MAX_TABLE_SIZE, br);
|
|
203
|
+
block_type_rb_index[i] = 1;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
br.readMoreInput();
|
|
207
|
+
const distance_postfix_bits = br.readBits(2);
|
|
208
|
+
const num_direct_distance_codes = NUM_DISTANCE_SHORT_CODES + (br.readBits(4) << distance_postfix_bits);
|
|
209
|
+
const distance_postfix_mask = (1 << distance_postfix_bits) - 1;
|
|
210
|
+
const num_distance_codes = num_direct_distance_codes + (48 << distance_postfix_bits);
|
|
211
|
+
const context_modes = new Uint8Array(num_block_types[0]);
|
|
212
|
+
for (let i = 0; i < num_block_types[0]; i++) {
|
|
213
|
+
br.readMoreInput();
|
|
214
|
+
context_modes[i] = br.readBits(2) << 1;
|
|
215
|
+
}
|
|
216
|
+
const [num_literal_htrees, context_map] = decodeContextMap(num_block_types[0] << kLiteralContextBits, br);
|
|
217
|
+
const [num_dist_htrees, dist_context_map] = decodeContextMap(num_block_types[2] << kDistanceContextBits, br);
|
|
218
|
+
hgroup[0] = new HuffmanTreeGroup(kNumLiteralCodes, num_literal_htrees);
|
|
219
|
+
hgroup[1] = new HuffmanTreeGroup(kNumInsertAndCopyCodes, num_block_types[1]);
|
|
220
|
+
hgroup[2] = new HuffmanTreeGroup(num_distance_codes, num_dist_htrees);
|
|
221
|
+
for (let i = 0; i < 3; ++i) hgroup[i].decode(br);
|
|
222
|
+
let context_map_slice = 0;
|
|
223
|
+
let dist_context_map_slice = 0;
|
|
224
|
+
let context_mode = context_modes[block_type[0]];
|
|
225
|
+
let context_lookup_offset1 = lookupOffsets[context_mode];
|
|
226
|
+
let context_lookup_offset2 = lookupOffsets[context_mode + 1];
|
|
227
|
+
let htree_command = hgroup[1].htrees[0];
|
|
228
|
+
while (meta_block_remaining_len > 0) {
|
|
229
|
+
let distance_code;
|
|
230
|
+
br.readMoreInput();
|
|
231
|
+
if (block_length[1] === 0) {
|
|
232
|
+
decodeBlockType(num_block_types[1], block_type_trees, 1, block_type, block_type_rb, block_type_rb_index, br);
|
|
233
|
+
block_length[1] = readBlockLength(block_len_trees, HUFFMAN_MAX_TABLE_SIZE, br);
|
|
234
|
+
htree_command = hgroup[1].htrees[block_type[1]];
|
|
235
|
+
}
|
|
236
|
+
block_length[1]--;
|
|
237
|
+
const cmd_code = readSymbol(hgroup[1].codes, htree_command, br);
|
|
238
|
+
let range_idx = cmd_code >> 6;
|
|
239
|
+
if (range_idx >= 2) {
|
|
240
|
+
range_idx -= 2;
|
|
241
|
+
distance_code = -1;
|
|
242
|
+
} else distance_code = 0;
|
|
243
|
+
const insertPrefix = kInsertLengthPrefixCode[kInsertRangeLut[range_idx] + (cmd_code >> 3 & 7)];
|
|
244
|
+
const insertLength = insertPrefix.offset + br.readBits(insertPrefix.nbits);
|
|
245
|
+
const copyCode = kCopyLengthPrefixCode[kCopyRangeLut[range_idx] + (cmd_code & 7)];
|
|
246
|
+
const copyLength = copyCode.offset + br.readBits(copyCode.nbits);
|
|
247
|
+
prev_byte1 = ringbuffer[pos - 1 & ringbuffer_mask];
|
|
248
|
+
prev_byte2 = ringbuffer[pos - 2 & ringbuffer_mask];
|
|
249
|
+
for (let j = 0; j < insertLength; j++) {
|
|
250
|
+
br.readMoreInput();
|
|
251
|
+
if (block_length[0] === 0) {
|
|
252
|
+
decodeBlockType(num_block_types[0], block_type_trees, 0, block_type, block_type_rb, block_type_rb_index, br);
|
|
253
|
+
block_length[0] = readBlockLength(block_len_trees, 0, br);
|
|
254
|
+
context_offset = block_type[0] << kLiteralContextBits;
|
|
255
|
+
context_map_slice = context_offset;
|
|
256
|
+
context_mode = context_modes[block_type[0]];
|
|
257
|
+
context_lookup_offset1 = lookupOffsets[context_mode];
|
|
258
|
+
context_lookup_offset2 = lookupOffsets[context_mode + 1];
|
|
259
|
+
}
|
|
260
|
+
const context = lookup[context_lookup_offset1 + prev_byte1] | lookup[context_lookup_offset2 + prev_byte2];
|
|
261
|
+
const literal_htree_index = context_map[context_map_slice + context];
|
|
262
|
+
block_length[0]--;
|
|
263
|
+
prev_byte2 = prev_byte1;
|
|
264
|
+
prev_byte1 = readSymbol(hgroup[0].codes, hgroup[0].htrees[literal_htree_index], br);
|
|
265
|
+
ringbuffer[pos & ringbuffer_mask] = prev_byte1;
|
|
266
|
+
if ((pos & ringbuffer_mask) === ringbuffer_mask) output.write(ringbuffer, ringbuffer_size);
|
|
267
|
+
pos++;
|
|
268
|
+
}
|
|
269
|
+
meta_block_remaining_len -= insertLength;
|
|
270
|
+
if (meta_block_remaining_len <= 0) break;
|
|
271
|
+
if (distance_code < 0) {
|
|
272
|
+
br.readMoreInput();
|
|
273
|
+
if (block_length[2] === 0) {
|
|
274
|
+
decodeBlockType(num_block_types[2], block_type_trees, 2, block_type, block_type_rb, block_type_rb_index, br);
|
|
275
|
+
block_length[2] = readBlockLength(block_len_trees, 2 * HUFFMAN_MAX_TABLE_SIZE, br);
|
|
276
|
+
dist_context_map_slice = block_type[2] << kDistanceContextBits;
|
|
277
|
+
}
|
|
278
|
+
block_length[2]--;
|
|
279
|
+
const context = (copyLength > 4 ? 3 : copyLength - 2) & 255;
|
|
280
|
+
const dist_htree_index = dist_context_map[dist_context_map_slice + context];
|
|
281
|
+
distance_code = readSymbol(hgroup[2].codes, hgroup[2].htrees[dist_htree_index], br);
|
|
282
|
+
if (distance_code >= num_direct_distance_codes) {
|
|
283
|
+
distance_code -= num_direct_distance_codes;
|
|
284
|
+
const postfix = distance_code & distance_postfix_mask;
|
|
285
|
+
distance_code >>= distance_postfix_bits;
|
|
286
|
+
const nbits = (distance_code >> 1) + 1;
|
|
287
|
+
distance_code = num_direct_distance_codes + ((2 + (distance_code & 1) << nbits) - 4 + br.readBits(nbits) << distance_postfix_bits) + postfix;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
const distance = translateShortCodes(distance_code, dist_rb, dist_rb_idx);
|
|
291
|
+
if (distance < 0) throw new Error("[BrotliDecompress] invalid distance");
|
|
292
|
+
if (pos < max_backward_distance && max_distance !== max_backward_distance) max_distance = pos;
|
|
293
|
+
else max_distance = max_backward_distance;
|
|
294
|
+
let copy_dst = pos & ringbuffer_mask;
|
|
295
|
+
if (distance > max_distance) if (copyLength >= minDictionaryWordLength && copyLength <= maxDictionaryWordLength) {
|
|
296
|
+
let offset = offsetsByLength[copyLength];
|
|
297
|
+
const word_id = distance - max_distance - 1;
|
|
298
|
+
const shift = sizeBitsByLength[copyLength];
|
|
299
|
+
const word_idx = word_id & (1 << shift) - 1;
|
|
300
|
+
const transform_idx = word_id >> shift;
|
|
301
|
+
offset += word_idx * copyLength;
|
|
302
|
+
if (transform_idx < kNumTransforms) {
|
|
303
|
+
const len = transformDictionaryWord(ringbuffer, copy_dst, offset, copyLength, transform_idx);
|
|
304
|
+
copy_dst += len;
|
|
305
|
+
pos += len;
|
|
306
|
+
meta_block_remaining_len -= len;
|
|
307
|
+
if (copy_dst >= ringbuffer_end) {
|
|
308
|
+
output.write(ringbuffer, ringbuffer_size);
|
|
309
|
+
for (let _x = 0; _x < copy_dst - ringbuffer_end; _x++) ringbuffer[_x] = ringbuffer[ringbuffer_end + _x];
|
|
310
|
+
}
|
|
311
|
+
} else throw new Error("Invalid backward reference");
|
|
312
|
+
} else throw new Error("Invalid backward reference");
|
|
313
|
+
else {
|
|
314
|
+
if (distance_code > 0) {
|
|
315
|
+
dist_rb[dist_rb_idx & 3] = distance;
|
|
316
|
+
dist_rb_idx++;
|
|
317
|
+
}
|
|
318
|
+
if (copyLength > meta_block_remaining_len) throw new Error("Invalid backward reference");
|
|
319
|
+
for (let j = 0; j < copyLength; j++) {
|
|
320
|
+
ringbuffer[pos & ringbuffer_mask] = ringbuffer[pos - distance & ringbuffer_mask];
|
|
321
|
+
if ((pos & ringbuffer_mask) === ringbuffer_mask) output.write(ringbuffer, ringbuffer_size);
|
|
322
|
+
pos++;
|
|
323
|
+
meta_block_remaining_len--;
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
prev_byte1 = ringbuffer[pos - 1 & ringbuffer_mask];
|
|
327
|
+
prev_byte2 = ringbuffer[pos - 2 & ringbuffer_mask];
|
|
328
|
+
}
|
|
329
|
+
pos &= 1073741823;
|
|
330
|
+
}
|
|
331
|
+
output.write(ringbuffer, pos & ringbuffer_mask);
|
|
332
|
+
}
|
|
333
|
+
function translateShortCodes(code, ringbuffer, index) {
|
|
334
|
+
if (code < NUM_DISTANCE_SHORT_CODES) {
|
|
335
|
+
index += kDistanceShortCodeIndexOffset[code];
|
|
336
|
+
index &= 3;
|
|
337
|
+
return ringbuffer[index] + kDistanceShortCodeValueOffset[code];
|
|
338
|
+
} else return code - NUM_DISTANCE_SHORT_CODES + 1;
|
|
339
|
+
}
|
|
340
|
+
export { decompressBrotli };
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
function prefix([offset, nbits]) {
|
|
2
|
+
return {
|
|
3
|
+
offset,
|
|
4
|
+
nbits
|
|
5
|
+
};
|
|
6
|
+
}
|
|
7
|
+
const kBlockLengthPrefixCode = [
|
|
8
|
+
[1, 2],
|
|
9
|
+
[5, 2],
|
|
10
|
+
[9, 2],
|
|
11
|
+
[13, 2],
|
|
12
|
+
[17, 3],
|
|
13
|
+
[25, 3],
|
|
14
|
+
[33, 3],
|
|
15
|
+
[41, 3],
|
|
16
|
+
[49, 4],
|
|
17
|
+
[65, 4],
|
|
18
|
+
[81, 4],
|
|
19
|
+
[97, 4],
|
|
20
|
+
[113, 5],
|
|
21
|
+
[145, 5],
|
|
22
|
+
[177, 5],
|
|
23
|
+
[209, 5],
|
|
24
|
+
[241, 6],
|
|
25
|
+
[305, 6],
|
|
26
|
+
[369, 7],
|
|
27
|
+
[497, 8],
|
|
28
|
+
[753, 9],
|
|
29
|
+
[1265, 10],
|
|
30
|
+
[2289, 11],
|
|
31
|
+
[4337, 12],
|
|
32
|
+
[8433, 13],
|
|
33
|
+
[16625, 24]
|
|
34
|
+
].map(prefix);
|
|
35
|
+
const kInsertLengthPrefixCode = [
|
|
36
|
+
[0, 0],
|
|
37
|
+
[1, 0],
|
|
38
|
+
[2, 0],
|
|
39
|
+
[3, 0],
|
|
40
|
+
[4, 0],
|
|
41
|
+
[5, 0],
|
|
42
|
+
[6, 1],
|
|
43
|
+
[8, 1],
|
|
44
|
+
[10, 2],
|
|
45
|
+
[14, 2],
|
|
46
|
+
[18, 3],
|
|
47
|
+
[26, 3],
|
|
48
|
+
[34, 4],
|
|
49
|
+
[50, 4],
|
|
50
|
+
[66, 5],
|
|
51
|
+
[98, 5],
|
|
52
|
+
[130, 6],
|
|
53
|
+
[194, 7],
|
|
54
|
+
[322, 8],
|
|
55
|
+
[578, 9],
|
|
56
|
+
[1090, 10],
|
|
57
|
+
[2114, 12],
|
|
58
|
+
[6210, 14],
|
|
59
|
+
[22594, 24]
|
|
60
|
+
].map(prefix);
|
|
61
|
+
const kCopyLengthPrefixCode = [
|
|
62
|
+
[2, 0],
|
|
63
|
+
[3, 0],
|
|
64
|
+
[4, 0],
|
|
65
|
+
[5, 0],
|
|
66
|
+
[6, 0],
|
|
67
|
+
[7, 0],
|
|
68
|
+
[8, 0],
|
|
69
|
+
[9, 0],
|
|
70
|
+
[10, 1],
|
|
71
|
+
[12, 1],
|
|
72
|
+
[14, 2],
|
|
73
|
+
[18, 2],
|
|
74
|
+
[22, 3],
|
|
75
|
+
[30, 3],
|
|
76
|
+
[38, 4],
|
|
77
|
+
[54, 4],
|
|
78
|
+
[70, 5],
|
|
79
|
+
[102, 5],
|
|
80
|
+
[134, 6],
|
|
81
|
+
[198, 7],
|
|
82
|
+
[326, 8],
|
|
83
|
+
[582, 9],
|
|
84
|
+
[1094, 10],
|
|
85
|
+
[2118, 24]
|
|
86
|
+
].map(prefix);
|
|
87
|
+
const kInsertRangeLut = [
|
|
88
|
+
0,
|
|
89
|
+
0,
|
|
90
|
+
8,
|
|
91
|
+
8,
|
|
92
|
+
0,
|
|
93
|
+
16,
|
|
94
|
+
8,
|
|
95
|
+
16,
|
|
96
|
+
16
|
|
97
|
+
];
|
|
98
|
+
const kCopyRangeLut = [
|
|
99
|
+
0,
|
|
100
|
+
8,
|
|
101
|
+
0,
|
|
102
|
+
8,
|
|
103
|
+
16,
|
|
104
|
+
0,
|
|
105
|
+
16,
|
|
106
|
+
8,
|
|
107
|
+
16
|
|
108
|
+
];
|
|
109
|
+
export { kBlockLengthPrefixCode, kCopyLengthPrefixCode, kCopyRangeLut, kInsertLengthPrefixCode, kInsertRangeLut };
|