@loaders.gl/core 5.0.0-beta.1 → 5.0.0-beta.11
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/GEOARROW-README.md +1 -1
- package/README.md +4 -2
- package/SCAN-README.md +3 -3
- package/SCHEMA-UTILS-README.md +1 -1
- package/dist/arrow-geometry/binary-geometry-to-wkb.cjs +2 -2
- package/dist/arrow-geometry/binary-geometry-to-wkb.cjs.map +2 -2
- package/dist/arrow-geometry/binary-geometry-to-wkb.js +1 -1
- package/dist/arrow-geometry/binary-geometry-to-wkb.js.map +1 -1
- package/dist/arrow-geometry/feature-collection-to-arrow.cjs.map +2 -2
- package/dist/arrow-geometry/feature-collection-to-arrow.d.ts +4 -3
- package/dist/arrow-geometry/feature-collection-to-arrow.d.ts.map +1 -1
- package/dist/arrow-geometry/feature-collection-to-arrow.js +1 -1
- package/dist/arrow-geometry/feature-collection-to-arrow.js.map +1 -1
- package/dist/arrow-geometry/feature-table.cjs +2 -6
- package/dist/arrow-geometry/feature-table.cjs.map +2 -2
- package/dist/arrow-geometry/feature-table.d.ts +6 -5
- package/dist/arrow-geometry/feature-table.d.ts.map +1 -1
- package/dist/arrow-geometry/feature-table.js +5 -9
- package/dist/arrow-geometry/feature-table.js.map +1 -1
- package/dist/arrow-geometry/geojson-table.cjs +295 -18
- package/dist/arrow-geometry/geojson-table.cjs.map +3 -3
- package/dist/arrow-geometry/geojson-table.d.ts +10 -3
- package/dist/arrow-geometry/geojson-table.d.ts.map +1 -1
- package/dist/arrow-geometry/geojson-table.js +23 -13
- package/dist/arrow-geometry/geojson-table.js.map +1 -1
- package/dist/arrow-geometry/geometry-codecs.cjs +6 -6
- package/dist/arrow-geometry/geometry-codecs.cjs.map +2 -2
- package/dist/arrow-geometry/geometry-codecs.js +1 -1
- package/dist/arrow-geometry/geometry-codecs.js.map +1 -1
- package/dist/arrow-geometry/geometry-to-wkt.cjs +2 -2
- package/dist/arrow-geometry/geometry-to-wkt.cjs.map +2 -2
- package/dist/arrow-geometry/geometry-to-wkt.js +1 -1
- package/dist/arrow-geometry/geometry-to-wkt.js.map +1 -1
- package/dist/arrow-geometry/index.cjs +0 -11
- package/dist/arrow-geometry/index.cjs.map +2 -2
- package/dist/arrow-geometry/index.d.ts +0 -1
- package/dist/arrow-geometry/index.d.ts.map +1 -1
- package/dist/arrow-geometry/index.js +0 -1
- package/dist/arrow-geometry/index.js.map +1 -1
- package/dist/arrow-geometry/wkb-arrow-utils.cjs +1 -5
- package/dist/arrow-geometry/wkb-arrow-utils.cjs.map +2 -2
- package/dist/arrow-geometry/wkb-arrow-utils.d.ts +7 -7
- package/dist/arrow-geometry/wkb-arrow-utils.d.ts.map +1 -1
- package/dist/arrow-geometry/wkb-arrow-utils.js +4 -8
- package/dist/arrow-geometry/wkb-arrow-utils.js.map +1 -1
- package/dist/arrow-geometry/wkb-builder.cjs +3 -3
- package/dist/arrow-geometry/wkb-builder.cjs.map +2 -2
- package/dist/arrow-geometry/wkb-builder.d.ts +1 -1
- package/dist/arrow-geometry/wkb-builder.d.ts.map +1 -1
- package/dist/arrow-geometry/wkb-builder.js +1 -1
- package/dist/arrow-geometry/wkb-builder.js.map +1 -1
- package/dist/arrow-geometry/wkb-statistics.cjs +2 -2
- package/dist/arrow-geometry/wkb-statistics.cjs.map +2 -2
- package/dist/arrow-geometry/wkb-statistics.js +1 -1
- package/dist/arrow-geometry/wkb-statistics.js.map +1 -1
- package/dist/arrow-worker-transport.cjs +105 -0
- package/dist/arrow-worker-transport.cjs.map +6 -0
- package/dist/arrow-worker-transport.d.ts +11 -0
- package/dist/arrow-worker-transport.d.ts.map +1 -0
- package/dist/arrow-worker-transport.js +77 -0
- package/dist/arrow-worker-transport.js.map +1 -0
- package/dist/cluster-source.cjs +6874 -0
- package/dist/cluster-source.cjs.map +6 -0
- package/dist/cluster-source.d.ts +2 -0
- package/dist/cluster-source.d.ts.map +1 -0
- package/dist/cluster-source.js +2 -0
- package/dist/cluster-source.js.map +1 -0
- package/dist/dist.dev.js +3040 -817
- package/dist/dist.min.js +3 -3
- package/dist/federated-table-scan-source.cjs +2409 -0
- package/dist/federated-table-scan-source.cjs.map +6 -0
- package/dist/federated-table-scan-source.d.ts +2 -0
- package/dist/federated-table-scan-source.d.ts.map +1 -0
- package/dist/federated-table-scan-source.js +2 -0
- package/dist/federated-table-scan-source.js.map +1 -0
- package/dist/geoarrow/binary-polygon-to-geoarrow.cjs +2 -2
- package/dist/geoarrow/binary-polygon-to-geoarrow.cjs.map +2 -2
- package/dist/geoarrow/binary-polygon-to-geoarrow.d.ts +1 -1
- package/dist/geoarrow/binary-polygon-to-geoarrow.d.ts.map +1 -1
- package/dist/geoarrow/binary-polygon-to-geoarrow.js +1 -1
- package/dist/geoarrow/binary-polygon-to-geoarrow.js.map +1 -1
- package/dist/geoarrow/clustering/cluster-source.cjs +16 -19
- package/dist/geoarrow/clustering/cluster-source.cjs.map +2 -2
- package/dist/geoarrow/clustering/cluster-source.d.ts +3 -2
- package/dist/geoarrow/clustering/cluster-source.d.ts.map +1 -1
- package/dist/geoarrow/clustering/cluster-source.js +13 -18
- package/dist/geoarrow/clustering/cluster-source.js.map +1 -1
- package/dist/geoarrow/convert-table-to-geoarrow.cjs +5 -12
- package/dist/geoarrow/convert-table-to-geoarrow.cjs.map +2 -2
- package/dist/geoarrow/convert-table-to-geoarrow.d.ts +6 -6
- package/dist/geoarrow/convert-table-to-geoarrow.d.ts.map +1 -1
- package/dist/geoarrow/convert-table-to-geoarrow.js +8 -14
- package/dist/geoarrow/convert-table-to-geoarrow.js.map +1 -1
- package/dist/geoarrow/geoarrow-bounds.cjs +7 -7
- package/dist/geoarrow/geoarrow-bounds.cjs.map +2 -2
- package/dist/geoarrow/geoarrow-bounds.js +3 -3
- package/dist/geoarrow/geoarrow-bounds.js.map +1 -1
- package/dist/geoarrow/geoarrow-capabilities.cjs +2 -2
- package/dist/geoarrow/geoarrow-capabilities.cjs.map +2 -2
- package/dist/geoarrow/geoarrow-capabilities.js +1 -1
- package/dist/geoarrow/geoarrow-capabilities.js.map +1 -1
- package/dist/geoarrow/geoarrow-converter/convert-geoarrow-geometry.cjs +8 -8
- package/dist/geoarrow/geoarrow-converter/convert-geoarrow-geometry.cjs.map +2 -2
- package/dist/geoarrow/geoarrow-converter/convert-geoarrow-geometry.js +2 -2
- package/dist/geoarrow/geoarrow-converter/convert-geoarrow-geometry.js.map +1 -1
- package/dist/geoarrow/geoarrow-converter/convert-geoarrow.cjs +6 -4
- package/dist/geoarrow/geoarrow-converter/convert-geoarrow.cjs.map +2 -2
- package/dist/geoarrow/geoarrow-converter/convert-geoarrow.d.ts +3 -3
- package/dist/geoarrow/geoarrow-converter/convert-geoarrow.d.ts.map +1 -1
- package/dist/geoarrow/geoarrow-converter/convert-geoarrow.js +9 -4
- package/dist/geoarrow/geoarrow-converter/convert-geoarrow.js.map +1 -1
- package/dist/geoarrow/geoarrow-converter/geoarrow-converter.cjs +5 -4
- package/dist/geoarrow/geoarrow-converter/geoarrow-converter.cjs.map +2 -2
- package/dist/geoarrow/geoarrow-converter/geoarrow-converter.d.ts +3 -3
- package/dist/geoarrow/geoarrow-converter/geoarrow-converter.d.ts.map +1 -1
- package/dist/geoarrow/geoarrow-converter/geoarrow-converter.js +5 -4
- package/dist/geoarrow/geoarrow-converter/geoarrow-converter.js.map +1 -1
- package/dist/geoarrow/geoarrow-inspection.cjs +2 -2
- package/dist/geoarrow/geoarrow-inspection.cjs.map +2 -2
- package/dist/geoarrow/geoarrow-inspection.js +1 -1
- package/dist/geoarrow/geoarrow-inspection.js.map +1 -1
- package/dist/geoarrow/geoarrow-stream.cjs +11 -12
- package/dist/geoarrow/geoarrow-stream.cjs.map +2 -2
- package/dist/geoarrow/geoarrow-stream.d.ts +2 -2
- package/dist/geoarrow/geoarrow-stream.d.ts.map +1 -1
- package/dist/geoarrow/geoarrow-stream.js +10 -13
- package/dist/geoarrow/geoarrow-stream.js.map +1 -1
- package/dist/geoarrow/get-geoarrow-vertex-count.cjs +2 -2
- package/dist/geoarrow/get-geoarrow-vertex-count.cjs.map +2 -2
- package/dist/geoarrow/get-geoarrow-vertex-count.js +1 -1
- package/dist/geoarrow/get-geoarrow-vertex-count.js.map +1 -1
- package/dist/geoarrow/lib/feature-collection-converters/convert-arrow-binary-feature-collection.cjs.map +1 -1
- package/dist/geoarrow/lib/feature-collection-converters/convert-arrow-binary-feature-collection.js +3 -3
- package/dist/geoarrow/lib/feature-collection-converters/convert-arrow-binary-feature-collection.js.map +1 -1
- package/dist/geoarrow/lib/feature-collection-converters/convert-geometry-column-to-binary-feature-collection.cjs +4 -8
- package/dist/geoarrow/lib/feature-collection-converters/convert-geometry-column-to-binary-feature-collection.cjs.map +2 -2
- package/dist/geoarrow/lib/feature-collection-converters/convert-geometry-column-to-binary-feature-collection.d.ts.map +1 -1
- package/dist/geoarrow/lib/feature-collection-converters/convert-geometry-column-to-binary-feature-collection.js +4 -8
- package/dist/geoarrow/lib/feature-collection-converters/convert-geometry-column-to-binary-feature-collection.js.map +1 -1
- package/dist/geoarrow/lib/geometry-converters/wkb/convert-wkb-to-binary-geometry.cjs +4 -4
- package/dist/geoarrow/lib/geometry-converters/wkb/convert-wkb-to-binary-geometry.cjs.map +2 -2
- package/dist/geoarrow/lib/geometry-converters/wkb/convert-wkb-to-binary-geometry.js +1 -1
- package/dist/geoarrow/lib/geometry-converters/wkb/convert-wkb-to-binary-geometry.js.map +1 -1
- package/dist/geoarrow/lib/geometry-converters/wkb/helpers/parse-wkb-header.cjs +3 -3
- package/dist/geoarrow/lib/geometry-converters/wkb/helpers/parse-wkb-header.cjs.map +2 -2
- package/dist/geoarrow/lib/geometry-converters/wkb/helpers/parse-wkb-header.js +1 -1
- package/dist/geoarrow/lib/geometry-converters/wkb/helpers/parse-wkb-header.js.map +1 -1
- package/dist/geoarrow/lib/kernels/encode-geoarrow-box.cjs +3 -3
- package/dist/geoarrow/lib/kernels/encode-geoarrow-box.cjs.map +2 -2
- package/dist/geoarrow/lib/kernels/encode-geoarrow-box.js +1 -1
- package/dist/geoarrow/lib/kernels/encode-geoarrow-box.js.map +1 -1
- package/dist/geoarrow/lib/table-converters/convert-geoarrow-table.cjs +0 -6
- package/dist/geoarrow/lib/table-converters/convert-geoarrow-table.cjs.map +2 -2
- package/dist/geoarrow/lib/table-converters/convert-geoarrow-table.d.ts +5 -3
- package/dist/geoarrow/lib/table-converters/convert-geoarrow-table.d.ts.map +1 -1
- package/dist/geoarrow/lib/table-converters/convert-geoarrow-table.js +0 -6
- package/dist/geoarrow/lib/table-converters/convert-geoarrow-table.js.map +1 -1
- package/dist/geoarrow/mesharrow/arrow-fixed-size-list-utils.cjs +3 -2
- package/dist/geoarrow/mesharrow/arrow-fixed-size-list-utils.cjs.map +2 -2
- package/dist/geoarrow/mesharrow/arrow-fixed-size-list-utils.d.ts.map +1 -1
- package/dist/geoarrow/mesharrow/arrow-fixed-size-list-utils.js +3 -2
- package/dist/geoarrow/mesharrow/arrow-fixed-size-list-utils.js.map +1 -1
- package/dist/geoarrow/metadata/geoarrow-metadata.cjs +44 -2
- package/dist/geoarrow/metadata/geoarrow-metadata.cjs.map +4 -4
- package/dist/geoarrow/metadata/geoarrow-metadata.d.ts.map +1 -1
- package/dist/geoarrow/metadata/geoarrow-metadata.js +3 -4
- package/dist/geoarrow/metadata/geoarrow-metadata.js.map +1 -1
- package/dist/index.cjs +746 -1365
- package/dist/index.cjs.map +3 -3
- package/dist/index.d.ts +2 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -5
- package/dist/index.js.map +1 -1
- package/dist/lib/api/create-data-source.d.ts +20 -9
- package/dist/lib/api/create-data-source.d.ts.map +1 -1
- package/dist/lib/api/create-data-source.js +55 -45
- package/dist/lib/api/create-data-source.js.map +1 -1
- package/dist/lib/api/encode.d.ts +1 -1
- package/dist/lib/api/encode.d.ts.map +1 -1
- package/dist/lib/api/encode.js +11 -2
- package/dist/lib/api/encode.js.map +1 -1
- package/dist/lib/api/load-in-batches.d.ts +3 -2
- package/dist/lib/api/load-in-batches.d.ts.map +1 -1
- package/dist/lib/api/load-in-batches.js.map +1 -1
- package/dist/lib/api/load-loader.d.ts +3 -3
- package/dist/lib/api/load-loader.d.ts.map +1 -1
- package/dist/lib/api/load-loader.js +15 -19
- package/dist/lib/api/load-loader.js.map +1 -1
- package/dist/lib/api/load.d.ts +7 -3
- package/dist/lib/api/load.d.ts.map +1 -1
- package/dist/lib/api/load.js +15 -67
- package/dist/lib/api/load.js.map +1 -1
- package/dist/lib/api/loader-options.d.ts +6 -0
- package/dist/lib/api/loader-options.d.ts.map +1 -1
- package/dist/lib/api/loader-options.js +48 -0
- package/dist/lib/api/loader-options.js.map +1 -1
- package/dist/lib/api/parse-file.d.ts +5 -3
- package/dist/lib/api/parse-file.d.ts.map +1 -1
- package/dist/lib/api/parse-file.js +8 -6
- package/dist/lib/api/parse-file.js.map +1 -1
- package/dist/lib/api/parse-in-batches.d.ts +5 -3
- package/dist/lib/api/parse-in-batches.d.ts.map +1 -1
- package/dist/lib/api/parse-in-batches.js +60 -9
- package/dist/lib/api/parse-in-batches.js.map +1 -1
- package/dist/lib/api/parse-sync.d.ts +5 -3
- package/dist/lib/api/parse-sync.d.ts.map +1 -1
- package/dist/lib/api/parse-sync.js +3 -4
- package/dist/lib/api/parse-sync.js.map +1 -1
- package/dist/lib/api/parse.d.ts +5 -3
- package/dist/lib/api/parse.d.ts.map +1 -1
- package/dist/lib/api/parse.js +22 -14
- package/dist/lib/api/parse.js.map +1 -1
- package/dist/lib/api/select-loader.d.ts +4 -2
- package/dist/lib/api/select-loader.d.ts.map +1 -1
- package/dist/lib/api/select-loader.js +47 -53
- package/dist/lib/api/select-loader.js.map +1 -1
- package/dist/lib/api/select-source.d.ts.map +1 -1
- package/dist/lib/api/select-source.js +1 -1
- package/dist/lib/api/select-source.js.map +1 -1
- package/dist/lib/init.js +1 -1
- package/dist/lib/init.js.map +1 -1
- package/dist/lib/loader-utils/get-fetch-function.js +2 -2
- package/dist/lib/loader-utils/get-fetch-function.js.map +1 -1
- package/dist/lib/loader-utils/loggers.d.ts +2 -37
- package/dist/lib/loader-utils/loggers.d.ts.map +1 -1
- package/dist/lib/loader-utils/loggers.js +2 -63
- package/dist/lib/loader-utils/loggers.js.map +1 -1
- package/dist/lib/loader-utils/native-arrow.d.ts +13 -0
- package/dist/lib/loader-utils/native-arrow.d.ts.map +1 -0
- package/dist/lib/loader-utils/native-arrow.js +66 -0
- package/dist/lib/loader-utils/native-arrow.js.map +1 -0
- package/dist/lib/loader-utils/option-defaults.d.ts +3 -2
- package/dist/lib/loader-utils/option-defaults.d.ts.map +1 -1
- package/dist/lib/loader-utils/option-defaults.js +9 -10
- package/dist/lib/loader-utils/option-defaults.js.map +1 -1
- package/dist/lib/loader-utils/option-utils.d.ts +0 -6
- package/dist/lib/loader-utils/option-utils.d.ts.map +1 -1
- package/dist/lib/loader-utils/option-utils.js +31 -114
- package/dist/lib/loader-utils/option-utils.js.map +1 -1
- package/dist/loader-utils/format-types.d.ts +3 -0
- package/dist/loader-utils/format-types.d.ts.map +1 -1
- package/dist/loader-utils/index.cjs +854 -1295
- package/dist/loader-utils/index.cjs.map +3 -3
- package/dist/loader-utils/index.d.ts +17 -8
- package/dist/loader-utils/index.d.ts.map +1 -1
- package/dist/loader-utils/index.js +9 -5
- package/dist/loader-utils/index.js.map +1 -1
- package/dist/loader-utils/json-loader.js +1 -1
- package/dist/loader-utils/json-loader.js.map +1 -1
- package/dist/loader-utils/lib/files/http-file-transport.d.ts +4 -0
- package/dist/loader-utils/lib/files/http-file-transport.d.ts.map +1 -1
- package/dist/loader-utils/lib/files/http-file-transport.js +45 -1
- package/dist/loader-utils/lib/files/http-file-transport.js.map +1 -1
- package/dist/loader-utils/lib/files/http-file-types.d.ts +2 -0
- package/dist/loader-utils/lib/files/http-file-types.d.ts.map +1 -1
- package/dist/loader-utils/lib/files/read-range-response.d.ts +3 -0
- package/dist/loader-utils/lib/files/read-range-response.d.ts.map +1 -0
- package/dist/loader-utils/lib/files/read-range-response.js +62 -0
- package/dist/loader-utils/lib/files/read-range-response.js.map +1 -0
- package/dist/loader-utils/lib/log-utils/log.d.ts +23 -1
- package/dist/loader-utils/lib/log-utils/log.d.ts.map +1 -1
- package/dist/loader-utils/lib/log-utils/log.js +32 -1
- package/dist/loader-utils/lib/log-utils/log.js.map +1 -1
- package/dist/loader-utils/lib/pace-batch-iterator.d.ts +14 -0
- package/dist/loader-utils/lib/pace-batch-iterator.d.ts.map +1 -0
- package/dist/loader-utils/lib/pace-batch-iterator.js +51 -0
- package/dist/loader-utils/lib/pace-batch-iterator.js.map +1 -0
- package/dist/loader-utils/lib/request-utils/request-credentials.js +1 -1
- package/dist/loader-utils/lib/request-utils/request-credentials.js.map +1 -1
- package/dist/loader-utils/lib/scan-utils/logical-table-query.d.ts +43 -0
- package/dist/loader-utils/lib/scan-utils/logical-table-query.d.ts.map +1 -0
- package/dist/loader-utils/lib/scan-utils/logical-table-query.js +104 -0
- package/dist/loader-utils/lib/scan-utils/logical-table-query.js.map +1 -0
- package/dist/loader-utils/lib/scan-utils/{experimental-scan-options.d.ts → query-options.d.ts} +5 -8
- package/dist/loader-utils/lib/scan-utils/query-options.d.ts.map +1 -0
- package/dist/{schema-utils/lib/table/batch-builder/table-batch-aggregator.js → loader-utils/lib/scan-utils/query-options.js} +1 -1
- package/dist/loader-utils/lib/scan-utils/query-options.js.map +1 -0
- package/dist/loader-utils/lib/scan-utils/scan-query-metadata.d.ts +58 -18
- package/dist/loader-utils/lib/scan-utils/scan-query-metadata.d.ts.map +1 -1
- package/dist/loader-utils/lib/scan-utils/scan-query-metadata.js +17 -6
- package/dist/loader-utils/lib/scan-utils/scan-query-metadata.js.map +1 -1
- package/dist/loader-utils/lib/scan-utils/table-query.d.ts +54 -3
- package/dist/loader-utils/lib/scan-utils/table-query.d.ts.map +1 -1
- package/dist/loader-utils/lib/scan-utils/table-query.js +6 -0
- package/dist/loader-utils/lib/scan-utils/table-query.js.map +1 -1
- package/dist/loader-utils/lib/scan-utils/table-scan-batch.d.ts +18 -12
- package/dist/loader-utils/lib/scan-utils/table-scan-batch.d.ts.map +1 -1
- package/dist/loader-utils/lib/scan-utils/table-scan-batch.js +58 -29
- package/dist/loader-utils/lib/scan-utils/table-scan-batch.js.map +1 -1
- package/dist/loader-utils/lib/sources/data-source.d.ts +4 -0
- package/dist/loader-utils/lib/sources/data-source.d.ts.map +1 -1
- package/dist/loader-utils/lib/sources/data-source.js +53 -14
- package/dist/loader-utils/lib/sources/data-source.js.map +1 -1
- package/dist/loader-utils/lib/sources/image-source.d.ts +1 -1
- package/dist/loader-utils/lib/sources/table-source-collection.d.ts +31 -0
- package/dist/loader-utils/lib/sources/table-source-collection.d.ts.map +1 -0
- package/dist/loader-utils/lib/{scan-utils/experimental-scan-options.js → sources/table-source-collection.js} +1 -1
- package/dist/loader-utils/lib/sources/table-source-collection.js.map +1 -0
- package/dist/loader-utils/lib/sources/utils/utils.js +1 -1
- package/dist/loader-utils/lib/sources/utils/utils.js.map +1 -1
- package/dist/loader-utils/lib/sources/vector-source.d.ts +4 -3
- package/dist/loader-utils/lib/sources/vector-source.d.ts.map +1 -1
- package/dist/loader-utils/lib/sources/vector-tile-source.d.ts +4 -3
- package/dist/loader-utils/lib/sources/vector-tile-source.d.ts.map +1 -1
- package/dist/loader-utils/lib/worker-loader-utils/encode-with-worker.d.ts.map +1 -1
- package/dist/loader-utils/lib/worker-loader-utils/encode-with-worker.js +2 -5
- package/dist/loader-utils/lib/worker-loader-utils/encode-with-worker.js.map +1 -1
- package/dist/loader-utils/lib/worker-loader-utils/parse-with-worker.d.ts.map +1 -1
- package/dist/loader-utils/lib/worker-loader-utils/parse-with-worker.js +40 -21
- package/dist/loader-utils/lib/worker-loader-utils/parse-with-worker.js.map +1 -1
- package/dist/loader-utils/loader-types.d.ts +118 -91
- package/dist/loader-utils/loader-types.d.ts.map +1 -1
- package/dist/loader-utils/loader-types.js.map +1 -1
- package/dist/loader-utils/source-types.d.ts +7 -5
- package/dist/loader-utils/source-types.d.ts.map +1 -1
- package/dist/loader-utils/source-types.js +9 -1
- package/dist/loader-utils/source-types.js.map +1 -1
- package/dist/null-loader.d.ts +0 -18
- package/dist/null-loader.d.ts.map +1 -1
- package/dist/null-loader.js +1 -19
- package/dist/null-loader.js.map +1 -1
- package/dist/null-worker-node.js +771 -82
- package/dist/null-worker.js +742 -81
- package/dist/polyfills/images/encode-image-node.d.ts +18 -15
- package/dist/polyfills/images/encode-image-node.d.ts.map +1 -1
- package/dist/polyfills/images/encode-image-node.js +19 -33
- package/dist/polyfills/images/encode-image-node.js.map +1 -1
- package/dist/polyfills/images/image-codecs-node.d.ts +2 -6
- package/dist/polyfills/images/image-codecs-node.d.ts.map +1 -1
- package/dist/polyfills/images/image-codecs-node.js +2 -24
- package/dist/polyfills/images/image-codecs-node.js.map +1 -1
- package/dist/polyfills/images/load-sharp.d.ts +3 -0
- package/dist/polyfills/images/load-sharp.d.ts.map +1 -0
- package/dist/polyfills/images/load-sharp.js +11 -0
- package/dist/polyfills/images/load-sharp.js.map +1 -0
- package/dist/polyfills/images/node-image-bitmap.d.ts +1 -1
- package/dist/polyfills/images/node-image-bitmap.js +1 -1
- package/dist/polyfills/images/node-image-formats.d.ts +1 -1
- package/dist/polyfills/images/node-image-formats.d.ts.map +1 -1
- package/dist/polyfills/images/node-image-formats.js +10 -4
- package/dist/polyfills/images/node-image-formats.js.map +1 -1
- package/dist/polyfills/images/parse-image-node.d.ts +10 -2
- package/dist/polyfills/images/parse-image-node.d.ts.map +1 -1
- package/dist/polyfills/images/parse-image-node.js +20 -32
- package/dist/polyfills/images/parse-image-node.js.map +1 -1
- package/dist/polyfills/index.cjs +76 -151
- package/dist/polyfills/index.d.ts.map +1 -1
- package/dist/polyfills/index.js +2 -2
- package/dist/polyfills/index.js.map +1 -1
- package/dist/scan/arrow-execution/expressions.cjs +134 -0
- package/dist/scan/arrow-execution/expressions.cjs.map +7 -0
- package/dist/scan/arrow-execution/expressions.d.ts +11 -0
- package/dist/scan/arrow-execution/expressions.d.ts.map +1 -0
- package/dist/scan/arrow-execution/expressions.js +86 -0
- package/dist/scan/arrow-execution/expressions.js.map +1 -0
- package/dist/scan/arrow-execution/filter-arrow-table.cjs +255 -0
- package/dist/scan/arrow-execution/filter-arrow-table.cjs.map +7 -0
- package/dist/scan/arrow-execution/filter-arrow-table.d.ts +18 -0
- package/dist/scan/arrow-execution/filter-arrow-table.d.ts.map +1 -0
- package/dist/scan/arrow-execution/filter-arrow-table.js +224 -0
- package/dist/scan/arrow-execution/filter-arrow-table.js.map +1 -0
- package/dist/scan/arrow-execution/project-arrow-table.cjs +70 -0
- package/dist/scan/arrow-execution/project-arrow-table.cjs.map +7 -0
- package/dist/scan/arrow-execution/project-arrow-table.d.ts +8 -0
- package/dist/scan/arrow-execution/project-arrow-table.d.ts.map +1 -0
- package/dist/scan/arrow-execution/project-arrow-table.js +39 -0
- package/dist/scan/arrow-execution/project-arrow-table.js.map +1 -0
- package/dist/scan/arrow-execution.cjs +34 -0
- package/dist/scan/arrow-execution.cjs.map +7 -0
- package/dist/scan/arrow-execution.d.ts +4 -0
- package/dist/scan/arrow-execution.d.ts.map +1 -0
- package/dist/scan/arrow-execution.js +6 -0
- package/dist/scan/arrow-execution.js.map +1 -0
- package/dist/scan/arrow-query-worker-entry.cjs +121 -0
- package/dist/scan/arrow-query-worker-entry.cjs.map +7 -0
- package/dist/scan/arrow-query-worker-entry.d.ts +2 -0
- package/dist/scan/arrow-query-worker-entry.d.ts.map +1 -0
- package/dist/scan/arrow-query-worker-entry.js +7 -0
- package/dist/scan/arrow-query-worker-entry.js.map +1 -0
- package/dist/scan/arrow-query-worker.cjs +197 -0
- package/dist/scan/arrow-query-worker.cjs.map +7 -0
- package/dist/scan/arrow-query-worker.d.ts +47 -0
- package/dist/scan/arrow-query-worker.d.ts.map +1 -0
- package/dist/scan/arrow-query-worker.js +101 -0
- package/dist/scan/arrow-query-worker.js.map +1 -0
- package/dist/scan/arrow-query.cjs.map +1 -1
- package/dist/scan/arrow-query.d.ts +1 -1
- package/dist/scan/arrow-query.d.ts.map +1 -1
- package/dist/scan/catalog-query-source.cjs +122 -0
- package/dist/scan/catalog-query-source.cjs.map +7 -0
- package/dist/scan/catalog-query-source.d.ts +6 -0
- package/dist/scan/catalog-query-source.d.ts.map +1 -0
- package/dist/scan/catalog-query-source.js +115 -0
- package/dist/scan/catalog-query-source.js.map +1 -0
- package/dist/scan/federated-table-scan-source.cjs +42 -43
- package/dist/scan/federated-table-scan-source.cjs.map +2 -2
- package/dist/scan/federated-table-scan-source.d.ts +6 -10
- package/dist/scan/federated-table-scan-source.d.ts.map +1 -1
- package/dist/scan/federated-table-scan-source.js +39 -40
- package/dist/scan/federated-table-scan-source.js.map +1 -1
- package/dist/scan/index.cjs +213 -6
- package/dist/scan/index.cjs.map +4 -4
- package/dist/scan/index.d.ts +15 -4
- package/dist/scan/index.d.ts.map +1 -1
- package/dist/scan/index.js +8 -2
- package/dist/scan/index.js.map +1 -1
- package/dist/scan/parse-sql-predicate.cjs +3 -294
- package/dist/scan/parse-sql-predicate.cjs.map +3 -3
- package/dist/scan/parse-sql-predicate.d.ts +6 -9
- package/dist/scan/parse-sql-predicate.d.ts.map +1 -1
- package/dist/scan/parse-sql-predicate.js +5 -314
- package/dist/scan/parse-sql-predicate.js.map +1 -1
- package/dist/scan/query-arrow-table-in-batches.cjs +75 -0
- package/dist/scan/query-arrow-table-in-batches.cjs.map +7 -0
- package/dist/scan/query-arrow-table-in-batches.d.ts +8 -0
- package/dist/scan/query-arrow-table-in-batches.d.ts.map +1 -0
- package/dist/scan/query-arrow-table-in-batches.js +54 -0
- package/dist/scan/query-arrow-table-in-batches.js.map +1 -0
- package/dist/scan/query-arrow-table.cjs +65 -202
- package/dist/scan/query-arrow-table.cjs.map +3 -3
- package/dist/scan/query-arrow-table.d.ts +7 -40
- package/dist/scan/query-arrow-table.d.ts.map +1 -1
- package/dist/scan/query-arrow-table.js +51 -211
- package/dist/scan/query-arrow-table.js.map +1 -1
- package/dist/scan/query-open-source.cjs +52 -0
- package/dist/scan/query-open-source.cjs.map +7 -0
- package/dist/scan/query-open-source.d.ts +4 -0
- package/dist/scan/query-open-source.d.ts.map +1 -0
- package/dist/scan/query-open-source.js +26 -0
- package/dist/scan/query-open-source.js.map +1 -0
- package/dist/scan/query-progressive.cjs +190 -0
- package/dist/scan/query-progressive.cjs.map +7 -0
- package/dist/scan/query-progressive.d.ts +39 -0
- package/dist/scan/query-progressive.d.ts.map +1 -0
- package/dist/scan/query-progressive.js +173 -0
- package/dist/scan/query-progressive.js.map +1 -0
- package/dist/scan/query-pushdown.cjs +140 -0
- package/dist/scan/query-pushdown.cjs.map +7 -0
- package/dist/scan/query-pushdown.d.ts +14 -0
- package/dist/scan/query-pushdown.d.ts.map +1 -0
- package/dist/scan/query-pushdown.js +133 -0
- package/dist/scan/query-pushdown.js.map +1 -0
- package/dist/scan/query-scales.cjs +140 -0
- package/dist/scan/query-scales.cjs.map +7 -0
- package/dist/scan/query-scales.d.ts +35 -0
- package/dist/scan/query-scales.d.ts.map +1 -0
- package/dist/scan/query-scales.js +120 -0
- package/dist/scan/query-scales.js.map +1 -0
- package/dist/scan/query.cjs +385 -0
- package/dist/scan/query.cjs.map +7 -0
- package/dist/scan/query.d.ts +67 -0
- package/dist/scan/query.d.ts.map +1 -0
- package/dist/scan/query.js +402 -0
- package/dist/scan/query.js.map +1 -0
- package/dist/scan/resolve-query-source.cjs +59 -0
- package/dist/scan/resolve-query-source.cjs.map +7 -0
- package/dist/scan/resolve-query-source.d.ts +6 -0
- package/dist/scan/resolve-query-source.d.ts.map +1 -0
- package/dist/scan/resolve-query-source.js +37 -0
- package/dist/scan/resolve-query-source.js.map +1 -0
- package/dist/scan/rows-to-arrow.cjs +1 -28
- package/dist/scan/rows-to-arrow.cjs.map +2 -2
- package/dist/scan/rows-to-arrow.d.ts +3 -3
- package/dist/scan/rows-to-arrow.d.ts.map +1 -1
- package/dist/scan/rows-to-arrow.js +2 -32
- package/dist/scan/rows-to-arrow.js.map +1 -1
- package/dist/scan/scan-engine.cjs.map +2 -2
- package/dist/scan/scan-engine.d.ts +5 -5
- package/dist/scan/scan-engine.d.ts.map +1 -1
- package/dist/scan/scan-engine.js.map +1 -1
- package/dist/scan/sql-catalog.cjs +110 -0
- package/dist/scan/sql-catalog.cjs.map +7 -0
- package/dist/scan/sql-catalog.d.ts +47 -0
- package/dist/scan/sql-catalog.d.ts.map +1 -0
- package/dist/scan/sql-catalog.js +97 -0
- package/dist/scan/sql-catalog.js.map +1 -0
- package/dist/scan/table-query.cjs.map +2 -2
- package/dist/scan/table-query.d.ts +4 -1
- package/dist/scan/table-query.d.ts.map +1 -1
- package/dist/scan/table-query.js.map +1 -1
- package/dist/scan/vector-table-scan-source.cjs +24 -17
- package/dist/scan/vector-table-scan-source.cjs.map +4 -4
- package/dist/scan/vector-table-scan-source.d.ts +8 -8
- package/dist/scan/vector-table-scan-source.d.ts.map +1 -1
- package/dist/scan/vector-table-scan-source.js +19 -17
- package/dist/scan/vector-table-scan-source.js.map +1 -1
- package/dist/schema/categories/category-mesh.d.ts +3 -10
- package/dist/schema/categories/category-mesh.d.ts.map +1 -1
- package/dist/schema/categories/category-mesh.js.map +1 -1
- package/dist/schema/categories/category-table.d.ts +2 -19
- package/dist/schema/categories/category-table.d.ts.map +1 -1
- package/dist/schema/geometry/arrow-binary-features.d.ts +1 -1
- package/dist/schema/geometry/arrow-binary-features.d.ts.map +1 -1
- package/dist/schema/geometry/geoarrow.d.ts +3 -6
- package/dist/schema/geometry/geoarrow.d.ts.map +1 -1
- package/dist/schema/index.cjs +11 -7
- package/dist/schema/index.cjs.map +2 -2
- package/dist/schema/index.d.ts +4 -4
- package/dist/schema/index.d.ts.map +1 -1
- package/dist/schema/index.js +2 -2
- package/dist/schema/index.js.map +1 -1
- package/dist/schema/types/batch.d.ts +0 -4
- package/dist/schema/types/batch.d.ts.map +1 -1
- package/dist/schema-utils/index.cjs +404 -620
- package/dist/schema-utils/index.cjs.map +3 -3
- package/dist/schema-utils/index.d.ts +6 -6
- package/dist/schema-utils/index.d.ts.map +1 -1
- package/dist/schema-utils/index.js +6 -5
- package/dist/schema-utils/index.js.map +1 -1
- package/dist/schema-utils/lib/arrow/arrow-metadata.d.ts +16 -0
- package/dist/schema-utils/lib/arrow/arrow-metadata.d.ts.map +1 -0
- package/dist/schema-utils/lib/arrow/arrow-metadata.js +109 -0
- package/dist/schema-utils/lib/arrow/arrow-metadata.js.map +1 -0
- package/dist/schema-utils/lib/converters/convert.js +9 -2
- package/dist/schema-utils/lib/converters/convert.js.map +1 -1
- package/dist/schema-utils/lib/converters/types.d.ts +2 -0
- package/dist/schema-utils/lib/converters/types.d.ts.map +1 -1
- package/dist/schema-utils/lib/mesh/convert-mesh-to-table.d.ts +8 -12
- package/dist/schema-utils/lib/mesh/convert-mesh-to-table.d.ts.map +1 -1
- package/dist/schema-utils/lib/mesh/convert-mesh-to-table.js +8 -21
- package/dist/schema-utils/lib/mesh/convert-mesh-to-table.js.map +1 -1
- package/dist/schema-utils/lib/mesh/convert-table-to-mesh.d.ts +5 -4
- package/dist/schema-utils/lib/mesh/convert-table-to-mesh.d.ts.map +1 -1
- package/dist/schema-utils/lib/mesh/convert-table-to-mesh.js +18 -13
- package/dist/schema-utils/lib/mesh/convert-table-to-mesh.js.map +1 -1
- package/dist/schema-utils/lib/mesh/get-mesh-bounding-box.d.ts +14 -0
- package/dist/schema-utils/lib/mesh/get-mesh-bounding-box.d.ts.map +1 -0
- package/dist/schema-utils/lib/mesh/get-mesh-bounding-box.js +39 -0
- package/dist/schema-utils/lib/mesh/get-mesh-bounding-box.js.map +1 -0
- package/dist/schema-utils/lib/mesh/mesh-utils.d.ts +2 -14
- package/dist/schema-utils/lib/mesh/mesh-utils.d.ts.map +1 -1
- package/dist/schema-utils/lib/mesh/mesh-utils.js +1 -35
- package/dist/schema-utils/lib/mesh/mesh-utils.js.map +1 -1
- package/dist/schema-utils/lib/mesh/point-cloud-tiler.d.ts.map +1 -1
- package/dist/schema-utils/lib/mesh/point-cloud-tiler.js +6 -5
- package/dist/schema-utils/lib/mesh/point-cloud-tiler.js.map +1 -1
- package/dist/schema-utils/lib/schema/deduce-table-schema.d.ts +2 -1
- package/dist/schema-utils/lib/schema/deduce-table-schema.d.ts.map +1 -1
- package/dist/schema-utils/lib/schema/deduce-table-schema.js +7 -3
- package/dist/schema-utils/lib/schema/deduce-table-schema.js.map +1 -1
- package/dist/schema-utils/lib/table/arrow-api/arrow-like-table.d.ts +6 -5
- package/dist/schema-utils/lib/table/arrow-api/arrow-like-table.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/arrow-api/arrow-like-table.js +6 -5
- package/dist/schema-utils/lib/table/arrow-api/arrow-like-table.js.map +1 -1
- package/dist/schema-utils/lib/table/batch-builder/arrow-table-builder.d.ts +9 -9
- package/dist/schema-utils/lib/table/batch-builder/arrow-table-builder.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/batch-builder/arrow-table-builder.js +13 -46
- package/dist/schema-utils/lib/table/batch-builder/arrow-table-builder.js.map +1 -1
- package/dist/schema-utils/lib/table/batch-builder/table-batch-builder.d.ts +9 -20
- package/dist/schema-utils/lib/table/batch-builder/table-batch-builder.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/batch-builder/table-batch-builder.js +61 -73
- package/dist/schema-utils/lib/table/batch-builder/table-batch-builder.js.map +1 -1
- package/dist/schema-utils/lib/table/batches/convert-batches.d.ts +4 -3
- package/dist/schema-utils/lib/table/batches/convert-batches.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/batches/convert-batches.js +27 -9
- package/dist/schema-utils/lib/table/batches/convert-batches.js.map +1 -1
- package/dist/schema-utils/lib/table/batches/make-arrow-batch-iterator.d.ts +6 -9
- package/dist/schema-utils/lib/table/batches/make-arrow-batch-iterator.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/batches/make-arrow-batch-iterator.js +22 -15
- package/dist/schema-utils/lib/table/batches/make-arrow-batch-iterator.js.map +1 -1
- package/dist/schema-utils/lib/table/batches/make-table-from-batches.d.ts +4 -1
- package/dist/schema-utils/lib/table/batches/make-table-from-batches.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/batches/make-table-from-batches.js +13 -9
- package/dist/schema-utils/lib/table/batches/make-table-from-batches.js.map +1 -1
- package/dist/schema-utils/lib/table/query-arrow-table.d.ts +3 -3
- package/dist/schema-utils/lib/table/query-arrow-table.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/query-arrow-table.js +9 -23
- package/dist/schema-utils/lib/table/query-arrow-table.js.map +1 -1
- package/dist/schema-utils/lib/table/tables/convert-arrow-table.d.ts +9 -10
- package/dist/schema-utils/lib/table/tables/convert-arrow-table.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/tables/convert-arrow-table.js +13 -75
- package/dist/schema-utils/lib/table/tables/convert-arrow-table.js.map +1 -1
- package/dist/schema-utils/lib/table/tables/convert-table.d.ts +6 -36
- package/dist/schema-utils/lib/table/tables/convert-table.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/tables/convert-table.js +5 -42
- package/dist/schema-utils/lib/table/tables/convert-table.js.map +1 -1
- package/dist/schema-utils/lib/table/tables/make-table.d.ts +3 -55
- package/dist/schema-utils/lib/table/tables/make-table.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/tables/make-table.js +3 -59
- package/dist/schema-utils/lib/table/tables/make-table.js.map +1 -1
- package/dist/schema-utils/lib/table/tables/row-utils.js +2 -2
- package/dist/schema-utils/lib/table/tables/row-utils.js.map +1 -1
- package/dist/schema-utils/lib/table/tables/table-accessors.d.ts +18 -16
- package/dist/schema-utils/lib/table/tables/table-accessors.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/tables/table-accessors.js +36 -39
- package/dist/schema-utils/lib/table/tables/table-accessors.js.map +1 -1
- package/dist/schema-utils/lib/table/tables/table-converter/convert-tables.d.ts +6 -5
- package/dist/schema-utils/lib/table/tables/table-converter/convert-tables.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/tables/table-converter/convert-tables.js +2 -2
- package/dist/schema-utils/lib/table/tables/table-converter/convert-tables.js.map +1 -1
- package/dist/schema-utils/lib/table/tables/table-converter/table-converter.d.ts +1 -1
- package/dist/schema-utils/lib/table/tables/table-converter/table-converter.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/tables/table-converter/table-converter.js +8 -5
- package/dist/schema-utils/lib/table/tables/table-converter/table-converter.js.map +1 -1
- package/dist/schema-utils/lib/table/tables/table-types.d.ts +1 -3
- package/dist/schema-utils/lib/table/tables/table-types.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/tables/table-types.js +0 -4
- package/dist/schema-utils/lib/table/tables/table-types.js.map +1 -1
- package/dist/vector-table-scan-source.cjs +1766 -0
- package/dist/vector-table-scan-source.cjs.map +6 -0
- package/dist/vector-table-scan-source.d.ts +2 -0
- package/dist/vector-table-scan-source.d.ts.map +1 -0
- package/dist/vector-table-scan-source.js +2 -0
- package/dist/vector-table-scan-source.js.map +1 -0
- package/dist/worker-utils/index.cjs +407 -1184
- package/dist/worker-utils/index.cjs.map +3 -3
- package/dist/worker-utils/index.d.ts +2 -8
- package/dist/worker-utils/index.d.ts.map +1 -1
- package/dist/worker-utils/index.js +1 -10
- package/dist/worker-utils/index.js.map +1 -1
- package/dist/worker-utils/lib/env-utils/version.js +1 -1
- package/dist/worker-utils/lib/env-utils/version.js.map +1 -1
- package/dist/worker-utils/lib/library-utils/library-utils.d.ts.map +1 -1
- package/dist/worker-utils/lib/library-utils/library-utils.js +3 -2
- package/dist/worker-utils/lib/library-utils/library-utils.js.map +1 -1
- package/dist/worker-utils/lib/process-utils/child-process-proxy.d.ts.map +1 -1
- package/dist/worker-utils/lib/process-utils/child-process-proxy.js +8 -7
- package/dist/worker-utils/lib/process-utils/child-process-proxy.js.map +1 -1
- package/dist/worker-utils/lib/worker-api/create-worker.d.ts +5 -7
- package/dist/worker-utils/lib/worker-api/create-worker.d.ts.map +1 -1
- package/dist/worker-utils/lib/worker-api/create-worker.js +76 -146
- package/dist/worker-utils/lib/worker-api/create-worker.js.map +1 -1
- package/dist/worker-utils/lib/worker-api/get-worker-url.d.ts.map +1 -1
- package/dist/worker-utils/lib/worker-api/get-worker-url.js +5 -2
- package/dist/worker-utils/lib/worker-api/get-worker-url.js.map +1 -1
- package/dist/worker-utils/lib/worker-api/process-on-worker.d.ts +17 -45
- package/dist/worker-utils/lib/worker-api/process-on-worker.d.ts.map +1 -1
- package/dist/worker-utils/lib/worker-api/process-on-worker.js +214 -312
- package/dist/worker-utils/lib/worker-api/process-on-worker.js.map +1 -1
- package/dist/worker-utils/lib/worker-api/task-runtime.d.ts +36 -0
- package/dist/worker-utils/lib/worker-api/task-runtime.d.ts.map +1 -0
- package/dist/worker-utils/lib/worker-api/task-runtime.js +23 -0
- package/dist/worker-utils/lib/worker-api/task-runtime.js.map +1 -0
- package/dist/worker-utils/lib/worker-utils/get-loadable-worker-url.js +1 -6
- package/dist/worker-utils/lib/worker-utils/get-loadable-worker-url.js.map +1 -1
- package/dist/worker-utils/lib/worker-utils/get-transfer-list.d.ts +1 -0
- package/dist/worker-utils/lib/worker-utils/get-transfer-list.d.ts.map +1 -1
- package/dist/worker-utils/lib/worker-utils/get-transfer-list.js +3 -1
- package/dist/worker-utils/lib/worker-utils/get-transfer-list.js.map +1 -1
- package/dist/worker-utils/null-worker-node.js +836 -147
- package/dist/worker-utils/null-worker-node.js.map +4 -4
- package/dist/worker-utils/null-worker.js +804 -143
- package/dist/worker-utils/null-worker.js.map +4 -4
- package/dist/worker-utils/types.d.ts +55 -72
- package/dist/worker-utils/types.d.ts.map +1 -1
- package/package.json +141 -35
- package/src/arrow-geometry/binary-geometry-to-wkb.ts +1 -1
- package/src/arrow-geometry/feature-collection-to-arrow.ts +4 -3
- package/src/arrow-geometry/feature-table.ts +8 -17
- package/src/arrow-geometry/geojson-table.ts +32 -21
- package/src/arrow-geometry/geometry-codecs.ts +2 -2
- package/src/arrow-geometry/geometry-to-wkt.ts +2 -2
- package/src/arrow-geometry/index.ts +0 -9
- package/src/arrow-geometry/wkb-arrow-utils.ts +8 -12
- package/src/arrow-geometry/wkb-builder.ts +2 -2
- package/src/arrow-geometry/wkb-statistics.ts +2 -2
- package/src/arrow-worker-transport.ts +126 -0
- package/src/cluster-source.ts +1 -0
- package/src/federated-table-scan-source.ts +1 -0
- package/src/geoarrow/binary-polygon-to-geoarrow.ts +2 -2
- package/src/geoarrow/clustering/cluster-source.ts +20 -30
- package/src/geoarrow/convert-table-to-geoarrow.ts +14 -24
- package/src/geoarrow/geoarrow-bounds.ts +3 -3
- package/src/geoarrow/geoarrow-capabilities.ts +1 -1
- package/src/geoarrow/geoarrow-converter/convert-geoarrow-geometry.ts +3 -3
- package/src/geoarrow/geoarrow-converter/convert-geoarrow.ts +14 -9
- package/src/geoarrow/geoarrow-converter/geoarrow-converter.ts +7 -6
- package/src/geoarrow/geoarrow-inspection.ts +2 -2
- package/src/geoarrow/geoarrow-stream.ts +16 -16
- package/src/geoarrow/get-geoarrow-vertex-count.ts +1 -1
- package/src/geoarrow/lib/feature-collection-converters/convert-arrow-binary-feature-collection.ts +3 -3
- package/src/geoarrow/lib/feature-collection-converters/convert-geometry-column-to-binary-feature-collection.ts +4 -11
- package/src/geoarrow/lib/geometry-converters/wkb/convert-wkb-to-binary-geometry.ts +1 -1
- package/src/geoarrow/lib/geometry-converters/wkb/helpers/parse-wkb-header.ts +2 -2
- package/src/geoarrow/lib/kernels/encode-geoarrow-box.ts +1 -1
- package/src/geoarrow/lib/table-converters/convert-geoarrow-table.ts +11 -11
- package/src/geoarrow/mesharrow/arrow-fixed-size-list-utils.ts +3 -2
- package/src/geoarrow/metadata/geoarrow-metadata.ts +3 -4
- package/src/index.ts +2 -6
- package/src/lib/api/create-data-source.ts +148 -58
- package/src/lib/api/encode.ts +14 -3
- package/src/lib/api/load-in-batches.ts +15 -7
- package/src/lib/api/load-loader.ts +22 -21
- package/src/lib/api/load.ts +51 -127
- package/src/lib/api/loader-options.ts +69 -0
- package/src/lib/api/parse-file.ts +32 -22
- package/src/lib/api/parse-in-batches.ts +121 -20
- package/src/lib/api/parse-sync.ts +30 -16
- package/src/lib/api/parse.ts +46 -29
- package/src/lib/api/select-loader.ts +54 -69
- package/src/lib/api/select-source.ts +7 -1
- package/src/lib/loader-utils/get-fetch-function.ts +2 -2
- package/src/lib/loader-utils/loggers.ts +2 -70
- package/src/lib/loader-utils/native-arrow.ts +83 -0
- package/src/lib/loader-utils/option-defaults.ts +9 -10
- package/src/lib/loader-utils/option-utils.ts +33 -122
- package/src/loader-utils/format-types.ts +4 -0
- package/src/loader-utils/index.ts +50 -10
- package/src/loader-utils/lib/files/http-file-transport.ts +65 -1
- package/src/loader-utils/lib/files/http-file-types.ts +2 -0
- package/src/loader-utils/lib/files/read-range-response.ts +66 -0
- package/src/loader-utils/lib/log-utils/log.ts +36 -1
- package/src/loader-utils/lib/pace-batch-iterator.ts +66 -0
- package/src/loader-utils/lib/request-utils/request-credentials.ts +1 -1
- package/src/loader-utils/lib/scan-utils/logical-table-query.ts +174 -0
- package/src/loader-utils/lib/scan-utils/query-options.ts +44 -0
- package/src/loader-utils/lib/scan-utils/scan-query-metadata.ts +81 -28
- package/src/loader-utils/lib/scan-utils/table-query.ts +76 -8
- package/src/loader-utils/lib/scan-utils/table-scan-batch.ts +101 -53
- package/src/loader-utils/lib/sources/data-source.ts +57 -16
- package/src/loader-utils/lib/sources/image-source.ts +1 -1
- package/src/loader-utils/lib/sources/table-source-collection.ts +39 -0
- package/src/loader-utils/lib/sources/utils/utils.ts +1 -1
- package/src/loader-utils/lib/sources/vector-source.ts +3 -3
- package/src/loader-utils/lib/sources/vector-tile-source.ts +4 -9
- package/src/loader-utils/lib/worker-loader-utils/encode-with-worker.ts +5 -6
- package/src/loader-utils/lib/worker-loader-utils/parse-with-worker.ts +41 -24
- package/src/loader-utils/loader-types.ts +190 -111
- package/src/loader-utils/source-types.ts +17 -6
- package/src/null-loader.ts +1 -20
- package/src/polyfills/README.md +2 -2
- package/src/polyfills/images/encode-image-node.ts +44 -37
- package/src/polyfills/images/image-codecs-node.ts +2 -37
- package/src/polyfills/images/load-sharp.ts +13 -0
- package/src/polyfills/images/node-image-bitmap.ts +1 -1
- package/src/polyfills/images/node-image-formats.ts +10 -4
- package/src/polyfills/images/parse-image-node.ts +31 -40
- package/src/polyfills/index.ts +3 -3
- package/src/scan/arrow-execution/expressions.ts +116 -0
- package/src/scan/arrow-execution/filter-arrow-table.ts +298 -0
- package/src/scan/arrow-execution/project-arrow-table.ts +53 -0
- package/src/scan/arrow-execution.ts +7 -0
- package/src/scan/arrow-query-worker-entry.ts +8 -0
- package/src/scan/arrow-query-worker.ts +158 -0
- package/src/scan/arrow-query.ts +3 -0
- package/src/scan/catalog-query-source.ts +132 -0
- package/src/scan/federated-table-scan-source.ts +67 -78
- package/src/scan/index.ts +64 -6
- package/src/scan/parse-sql-predicate.ts +14 -367
- package/src/scan/query-arrow-table-in-batches.ts +55 -0
- package/src/scan/query-arrow-table.ts +81 -271
- package/src/scan/query-open-source.ts +39 -0
- package/src/scan/query-progressive.ts +229 -0
- package/src/scan/query-pushdown.ts +184 -0
- package/src/scan/query-scales.ts +199 -0
- package/src/scan/query.ts +594 -0
- package/src/scan/resolve-query-source.ts +47 -0
- package/src/scan/rows-to-arrow.ts +3 -39
- package/src/scan/scan-engine.ts +6 -6
- package/src/scan/sql-catalog.ts +167 -0
- package/src/scan/table-query.ts +6 -1
- package/src/scan/vector-table-scan-source.ts +25 -26
- package/src/schema/categories/category-mesh.ts +3 -11
- package/src/schema/categories/category-table.ts +2 -28
- package/src/schema/geometry/arrow-binary-features.ts +1 -1
- package/src/schema/geometry/geoarrow.ts +8 -19
- package/src/schema/index.ts +4 -5
- package/src/schema/types/batch.ts +0 -5
- package/src/schema-utils/index.ts +19 -10
- package/src/schema-utils/lib/arrow/arrow-metadata.ts +139 -0
- package/src/schema-utils/lib/converters/convert.ts +7 -2
- package/src/schema-utils/lib/converters/types.ts +2 -0
- package/src/schema-utils/lib/mesh/convert-mesh-to-table.ts +15 -43
- package/src/schema-utils/lib/mesh/convert-table-to-mesh.ts +19 -16
- package/src/schema-utils/lib/mesh/get-mesh-bounding-box.ts +52 -0
- package/src/schema-utils/lib/mesh/mesh-utils.ts +3 -49
- package/src/schema-utils/lib/mesh/point-cloud-tiler.ts +6 -5
- package/src/schema-utils/lib/schema/deduce-table-schema.ts +8 -4
- package/src/schema-utils/lib/table/arrow-api/arrow-like-table.ts +10 -9
- package/src/schema-utils/lib/table/batch-builder/arrow-table-builder.ts +21 -51
- package/src/schema-utils/lib/table/batch-builder/table-batch-builder.ts +68 -83
- package/src/schema-utils/lib/table/batches/convert-batches.ts +38 -21
- package/src/schema-utils/lib/table/batches/make-arrow-batch-iterator.ts +29 -19
- package/src/schema-utils/lib/table/batches/make-table-from-batches.ts +26 -7
- package/src/schema-utils/lib/table/query-arrow-table.ts +14 -32
- package/src/schema-utils/lib/table/tables/convert-arrow-table.ts +27 -95
- package/src/schema-utils/lib/table/tables/convert-table.ts +11 -57
- package/src/schema-utils/lib/table/tables/make-table.ts +6 -70
- package/src/schema-utils/lib/table/tables/row-utils.ts +2 -2
- package/src/schema-utils/lib/table/tables/table-accessors.ts +60 -63
- package/src/schema-utils/lib/table/tables/table-converter/convert-tables.ts +12 -14
- package/src/schema-utils/lib/table/tables/table-converter/table-converter.ts +12 -9
- package/src/schema-utils/lib/table/tables/table-types.ts +1 -7
- package/src/vector-table-scan-source.ts +1 -0
- package/src/worker-utils/index.ts +2 -18
- package/src/worker-utils/lib/library-utils/library-utils.ts +3 -2
- package/src/worker-utils/lib/process-utils/child-process-proxy.ts +8 -7
- package/src/worker-utils/lib/worker-api/create-worker.ts +89 -188
- package/src/worker-utils/lib/worker-api/get-worker-url.ts +4 -3
- package/src/worker-utils/lib/worker-api/process-on-worker.ts +246 -402
- package/src/worker-utils/lib/worker-api/task-runtime.ts +66 -0
- package/src/worker-utils/lib/worker-utils/get-loadable-worker-url.ts +1 -6
- package/src/worker-utils/lib/worker-utils/get-transfer-list.ts +2 -0
- package/src/worker-utils/types.ts +74 -109
- package/dist/arrow-geometry/arrow-geoarrow-adapter.cjs +0 -477
- package/dist/arrow-geometry/arrow-geoarrow-adapter.cjs.map +0 -7
- package/dist/arrow-geometry/arrow-geoarrow-adapter.d.ts +0 -29
- package/dist/arrow-geometry/arrow-geoarrow-adapter.d.ts.map +0 -1
- package/dist/arrow-geometry/arrow-geoarrow-adapter.js +0 -434
- package/dist/arrow-geometry/arrow-geoarrow-adapter.js.map +0 -1
- package/dist/geoarrow/lib/arrow-geoarrow-adapter.cjs +0 -39
- package/dist/geoarrow/lib/arrow-geoarrow-adapter.cjs.map +0 -7
- package/dist/geoarrow/lib/arrow-geoarrow-adapter.d.ts +0 -2
- package/dist/geoarrow/lib/arrow-geoarrow-adapter.d.ts.map +0 -1
- package/dist/geoarrow/lib/arrow-geoarrow-adapter.js +0 -5
- package/dist/geoarrow/lib/arrow-geoarrow-adapter.js.map +0 -1
- package/dist/loader-utils/lib/file-provider/data-view-file.d.ts +0 -40
- package/dist/loader-utils/lib/file-provider/data-view-file.d.ts.map +0 -1
- package/dist/loader-utils/lib/file-provider/data-view-file.js +0 -68
- package/dist/loader-utils/lib/file-provider/data-view-file.js.map +0 -1
- package/dist/loader-utils/lib/file-provider/file-handle-file.d.ts +0 -54
- package/dist/loader-utils/lib/file-provider/file-handle-file.d.ts.map +0 -1
- package/dist/loader-utils/lib/file-provider/file-handle-file.js +0 -102
- package/dist/loader-utils/lib/file-provider/file-handle-file.js.map +0 -1
- package/dist/loader-utils/lib/file-provider/file-provider-interface.d.ts +0 -45
- package/dist/loader-utils/lib/file-provider/file-provider-interface.d.ts.map +0 -1
- package/dist/loader-utils/lib/file-provider/file-provider-interface.js +0 -13
- package/dist/loader-utils/lib/file-provider/file-provider-interface.js.map +0 -1
- package/dist/loader-utils/lib/file-provider/file-provider.d.ts +0 -57
- package/dist/loader-utils/lib/file-provider/file-provider.d.ts.map +0 -1
- package/dist/loader-utils/lib/file-provider/file-provider.js +0 -114
- package/dist/loader-utils/lib/file-provider/file-provider.js.map +0 -1
- package/dist/loader-utils/lib/scan-utils/experimental-scan-options.d.ts.map +0 -1
- package/dist/loader-utils/lib/scan-utils/experimental-scan-options.js.map +0 -1
- package/dist/schema/deprecated/mesh-utils.d.ts +0 -12
- package/dist/schema/deprecated/mesh-utils.d.ts.map +0 -1
- package/dist/schema/deprecated/mesh-utils.js +0 -37
- package/dist/schema/deprecated/mesh-utils.js.map +0 -1
- package/dist/schema-utils/arrow-transport.cjs +0 -691
- package/dist/schema-utils/arrow-transport.cjs.map +0 -6
- package/dist/schema-utils/arrow-transport.d.ts +0 -4
- package/dist/schema-utils/arrow-transport.d.ts.map +0 -1
- package/dist/schema-utils/arrow-transport.js +0 -7
- package/dist/schema-utils/arrow-transport.js.map +0 -1
- package/dist/schema-utils/lib/arrow/arrow-table-transport.d.ts +0 -76
- package/dist/schema-utils/lib/arrow/arrow-table-transport.d.ts.map +0 -1
- package/dist/schema-utils/lib/arrow/arrow-table-transport.js +0 -182
- package/dist/schema-utils/lib/arrow/arrow-table-transport.js.map +0 -1
- package/dist/schema-utils/lib/arrow/split-arrow-buffers.d.ts +0 -33
- package/dist/schema-utils/lib/arrow/split-arrow-buffers.d.ts.map +0 -1
- package/dist/schema-utils/lib/arrow/split-arrow-buffers.js +0 -134
- package/dist/schema-utils/lib/arrow/split-arrow-buffers.js.map +0 -1
- package/dist/schema-utils/lib/table/batch-builder/arrow-table-batch-aggregator.d.ts +0 -10
- package/dist/schema-utils/lib/table/batch-builder/arrow-table-batch-aggregator.d.ts.map +0 -1
- package/dist/schema-utils/lib/table/batch-builder/arrow-table-batch-aggregator.js +0 -71
- package/dist/schema-utils/lib/table/batch-builder/arrow-table-batch-aggregator.js.map +0 -1
- package/dist/schema-utils/lib/table/batch-builder/base-table-batch-aggregator.d.ts +0 -19
- package/dist/schema-utils/lib/table/batch-builder/base-table-batch-aggregator.d.ts.map +0 -1
- package/dist/schema-utils/lib/table/batch-builder/base-table-batch-aggregator.js +0 -64
- package/dist/schema-utils/lib/table/batch-builder/base-table-batch-aggregator.js.map +0 -1
- package/dist/schema-utils/lib/table/batch-builder/columnar-table-batch-aggregator.d.ts +0 -20
- package/dist/schema-utils/lib/table/batch-builder/columnar-table-batch-aggregator.d.ts.map +0 -1
- package/dist/schema-utils/lib/table/batch-builder/columnar-table-batch-aggregator.js +0 -83
- package/dist/schema-utils/lib/table/batch-builder/columnar-table-batch-aggregator.js.map +0 -1
- package/dist/schema-utils/lib/table/batch-builder/row-table-batch-aggregator.d.ts +0 -21
- package/dist/schema-utils/lib/table/batch-builder/row-table-batch-aggregator.d.ts.map +0 -1
- package/dist/schema-utils/lib/table/batch-builder/row-table-batch-aggregator.js +0 -86
- package/dist/schema-utils/lib/table/batch-builder/row-table-batch-aggregator.js.map +0 -1
- package/dist/schema-utils/lib/table/batch-builder/table-batch-aggregator.d.ts +0 -24
- package/dist/schema-utils/lib/table/batch-builder/table-batch-aggregator.d.ts.map +0 -1
- package/dist/schema-utils/lib/table/batch-builder/table-batch-aggregator.js.map +0 -1
- package/dist/worker-utils/lib/async-queue/async-queue.d.ts +0 -32
- package/dist/worker-utils/lib/async-queue/async-queue.d.ts.map +0 -1
- package/dist/worker-utils/lib/async-queue/async-queue.js +0 -91
- package/dist/worker-utils/lib/async-queue/async-queue.js.map +0 -1
- package/dist/worker-utils/lib/worker-farm/worker-body.d.ts +0 -20
- package/dist/worker-utils/lib/worker-farm/worker-body.d.ts.map +0 -1
- package/dist/worker-utils/lib/worker-farm/worker-body.js +0 -131
- package/dist/worker-utils/lib/worker-farm/worker-body.js.map +0 -1
- package/dist/worker-utils/lib/worker-farm/worker-farm.d.ts +0 -58
- package/dist/worker-utils/lib/worker-farm/worker-farm.d.ts.map +0 -1
- package/dist/worker-utils/lib/worker-farm/worker-farm.js +0 -116
- package/dist/worker-utils/lib/worker-farm/worker-farm.js.map +0 -1
- package/dist/worker-utils/lib/worker-farm/worker-job.d.ts +0 -34
- package/dist/worker-utils/lib/worker-farm/worker-job.d.ts.map +0 -1
- package/dist/worker-utils/lib/worker-farm/worker-job.js +0 -74
- package/dist/worker-utils/lib/worker-farm/worker-job.js.map +0 -1
- package/dist/worker-utils/lib/worker-farm/worker-pool.d.ts +0 -94
- package/dist/worker-utils/lib/worker-farm/worker-pool.d.ts.map +0 -1
- package/dist/worker-utils/lib/worker-farm/worker-pool.js +0 -246
- package/dist/worker-utils/lib/worker-farm/worker-pool.js.map +0 -1
- package/dist/worker-utils/lib/worker-farm/worker-thread.d.ts +0 -67
- package/dist/worker-utils/lib/worker-farm/worker-thread.d.ts.map +0 -1
- package/dist/worker-utils/lib/worker-farm/worker-thread.js +0 -175
- package/dist/worker-utils/lib/worker-farm/worker-thread.js.map +0 -1
- package/src/arrow-geometry/arrow-geoarrow-adapter.ts +0 -568
- package/src/geoarrow/lib/arrow-geoarrow-adapter.ts +0 -12
- package/src/loader-utils/lib/file-provider/data-view-file.ts +0 -83
- package/src/loader-utils/lib/file-provider/file-handle-file.ts +0 -114
- package/src/loader-utils/lib/file-provider/file-provider-interface.ts +0 -60
- package/src/loader-utils/lib/file-provider/file-provider.ts +0 -130
- package/src/loader-utils/lib/scan-utils/experimental-scan-options.ts +0 -46
- package/src/polyfills/images/encode-image.node.ts.disabled +0 -41
- package/src/polyfills/images/parse-image.node.ts.disabled +0 -55
- package/src/schema/deprecated/mesh-utils.ts +0 -46
- package/src/schema-utils/arrow-transport.ts +0 -7
- package/src/schema-utils/lib/arrow/arrow-table-transport.ts +0 -282
- package/src/schema-utils/lib/arrow/split-arrow-buffers.ts +0 -247
- package/src/schema-utils/lib/table/batch-builder/arrow-table-batch-aggregator-builders.ts.disabled +0 -190
- package/src/schema-utils/lib/table/batch-builder/arrow-table-batch-aggregator.ts +0 -85
- package/src/schema-utils/lib/table/batch-builder/base-table-batch-aggregator.ts +0 -82
- package/src/schema-utils/lib/table/batch-builder/columnar-table-batch-aggregator.ts +0 -103
- package/src/schema-utils/lib/table/batch-builder/row-table-batch-aggregator.ts +0 -108
- package/src/schema-utils/lib/table/batch-builder/table-batch-aggregator.ts +0 -28
- package/src/worker-utils/lib/async-queue/async-queue.ts +0 -100
- package/src/worker-utils/lib/worker-farm/worker-body.ts +0 -145
- package/src/worker-utils/lib/worker-farm/worker-farm.ts +0 -144
- package/src/worker-utils/lib/worker-farm/worker-job.ts +0 -85
- package/src/worker-utils/lib/worker-farm/worker-pool.ts +0 -316
- package/src/worker-utils/lib/worker-farm/worker-thread.ts +0 -206
|
@@ -3,6 +3,14 @@ var __defProp = Object.defineProperty;
|
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __esm = (fn, res, err) => function __init() {
|
|
7
|
+
if (err) throw err[0];
|
|
8
|
+
try {
|
|
9
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
10
|
+
} catch (e) {
|
|
11
|
+
throw err = [e], e;
|
|
12
|
+
}
|
|
13
|
+
};
|
|
6
14
|
var __export = (target, all) => {
|
|
7
15
|
for (var name in all)
|
|
8
16
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -17,6 +25,34 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
25
|
};
|
|
18
26
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
27
|
|
|
28
|
+
// src/worker-utils/lib/node/worker_threads-browser.ts
|
|
29
|
+
var worker_threads_browser_exports = {};
|
|
30
|
+
__export(worker_threads_browser_exports, {
|
|
31
|
+
NodeWorker: () => NodeWorker,
|
|
32
|
+
parentPort: () => parentPort
|
|
33
|
+
});
|
|
34
|
+
var NodeWorker, parentPort;
|
|
35
|
+
var init_worker_threads_browser = __esm({
|
|
36
|
+
"src/worker-utils/lib/node/worker_threads-browser.ts"() {
|
|
37
|
+
"use strict";
|
|
38
|
+
NodeWorker = class {
|
|
39
|
+
/** Restores the native worker constructor when this browser shim is embedded in a Node bundle. */
|
|
40
|
+
constructor(...arguments_) {
|
|
41
|
+
var _a;
|
|
42
|
+
const runtimeProcess = globalThis.process;
|
|
43
|
+
const WorkerConstructor = (_a = runtimeProcess == null ? void 0 : runtimeProcess.getBuiltinModule) == null ? void 0 : _a.call(runtimeProcess, "node:worker_threads").Worker;
|
|
44
|
+
if (WorkerConstructor) {
|
|
45
|
+
return new WorkerConstructor(...arguments_);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
/** No-op browser fallback matching the native Worker API. */
|
|
49
|
+
terminate() {
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
parentPort = null;
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
|
|
20
56
|
// dist/loader-utils/index.js
|
|
21
57
|
var index_exports = {};
|
|
22
58
|
__export(index_exports, {
|
|
@@ -68,6 +104,7 @@ __export(index_exports, {
|
|
|
68
104
|
createLAZChunkDecoderCursor: () => createLAZChunkDecoderCursor,
|
|
69
105
|
createLAZChunkEncoder: () => createLAZChunkEncoder,
|
|
70
106
|
createLoaderWorker: () => createLoaderWorker,
|
|
107
|
+
createQueryMetadata: () => createQueryMetadata,
|
|
71
108
|
createQueryParameterCredential: () => createQueryParameterCredential,
|
|
72
109
|
createRangeStats: () => createRangeStats,
|
|
73
110
|
createScanQueryMetadata: () => createScanQueryMetadata,
|
|
@@ -79,7 +116,7 @@ __export(index_exports, {
|
|
|
79
116
|
decodeLAZChunkInBatches: () => decodeLAZChunkInBatches,
|
|
80
117
|
decodeLAZChunkTable: () => decodeLAZChunkTable,
|
|
81
118
|
document: () => document_,
|
|
82
|
-
|
|
119
|
+
emitQueryComplete: () => emitQueryComplete,
|
|
83
120
|
encodeArrayBufferToBase64: () => encodeArrayBufferToBase64,
|
|
84
121
|
encodeHex: () => encodeHex,
|
|
85
122
|
encodeLASzipVLR: () => encodeLASzipVLR,
|
|
@@ -105,6 +142,7 @@ __export(index_exports, {
|
|
|
105
142
|
getLAZChunkByteLength: () => getLAZChunkByteLength,
|
|
106
143
|
getLAZChunkDeclaredByteLength: () => getLAZChunkDeclaredByteLength,
|
|
107
144
|
getLAZChunkHeaderByteLength: () => getLAZChunkHeaderByteLength,
|
|
145
|
+
getLoaderLog: () => getLoaderLog,
|
|
108
146
|
getMagicString: () => getMagicString,
|
|
109
147
|
getPathPrefix: () => getPathPrefix,
|
|
110
148
|
getRangeStats: () => getRangeStats,
|
|
@@ -146,11 +184,12 @@ __export(index_exports, {
|
|
|
146
184
|
log: () => log,
|
|
147
185
|
makeLineIterator: () => makeLineIterator,
|
|
148
186
|
makeNumberedLineIterator: () => makeNumberedLineIterator,
|
|
149
|
-
makeTableScanBatch: () => makeTableScanBatch,
|
|
150
187
|
makeTextDecoderIterator: () => makeTextDecoderIterator,
|
|
151
188
|
makeTextEncoderIterator: () => makeTextEncoderIterator,
|
|
152
189
|
mergeOptions: () => mergeOptions,
|
|
153
190
|
nodeVersion: () => nodeVersion,
|
|
191
|
+
normalizeTableQuery: () => normalizeTableQuery,
|
|
192
|
+
paceBatchIterator: () => paceBatchIterator,
|
|
154
193
|
padStringToByteAlignment: () => padStringToByteAlignment,
|
|
155
194
|
padToNBytes: () => padToNBytes,
|
|
156
195
|
parseContentType: () => parseContentType,
|
|
@@ -161,6 +200,7 @@ __export(index_exports, {
|
|
|
161
200
|
parseWithWorker: () => parseWithWorker,
|
|
162
201
|
parseWithWorkerInBatches: () => parseWithWorkerInBatches,
|
|
163
202
|
path: () => path_exports,
|
|
203
|
+
planLogicalTableQuery: () => planLogicalTableQuery,
|
|
164
204
|
planRelationalQuery: () => planRelationalQuery,
|
|
165
205
|
planTableQuery: () => planTableQuery,
|
|
166
206
|
processLoaderWorkerBatches: () => processLoaderWorkerBatches,
|
|
@@ -169,6 +209,7 @@ __export(index_exports, {
|
|
|
169
209
|
promisify1: () => promisify1,
|
|
170
210
|
promisify2: () => promisify2,
|
|
171
211
|
rasterCoordinateToPixel: () => rasterCoordinateToPixel,
|
|
212
|
+
readRangeResponse: () => readRangeResponse,
|
|
172
213
|
redactCredentialURL: () => redactCredentialURL,
|
|
173
214
|
registerJSModules: () => registerJSModules,
|
|
174
215
|
resolveAuthenticationOptions: () => resolveAuthenticationOptions,
|
|
@@ -184,17 +225,20 @@ __export(index_exports, {
|
|
|
184
225
|
shouldParseWithWorker: () => shouldParseWithWorker,
|
|
185
226
|
sliceArrayBuffer: () => sliceArrayBuffer,
|
|
186
227
|
stream: () => stream_browser_exports,
|
|
228
|
+
supportsSourceCreation: () => supportsSourceCreation,
|
|
187
229
|
toArrayBuffer: () => toArrayBuffer2,
|
|
188
230
|
toArrayBufferIterator: () => toArrayBufferIterator,
|
|
189
231
|
toArrayBufferView: () => toArrayBufferView,
|
|
190
232
|
toBuffer: () => toBuffer2,
|
|
191
233
|
truncateTableBatch: () => truncateTableBatch,
|
|
234
|
+
validateBatchDeliveryRate: () => validateBatchDeliveryRate,
|
|
192
235
|
validateColumnarPredicate: () => validateColumnarPredicate,
|
|
193
236
|
validatePointCloudQueryOptions: () => validatePointCloudQueryOptions,
|
|
194
237
|
validateRasterQueryOptions: () => validateRasterQueryOptions,
|
|
195
238
|
validateRasterRegion: () => validateRasterRegion,
|
|
196
239
|
validateTableQueryLimit: () => validateTableQueryLimit,
|
|
197
240
|
validateTableQueryOptions: () => validateTableQueryOptions,
|
|
241
|
+
validateTableReference: () => validateTableReference,
|
|
198
242
|
validateTileGrid: () => validateTileGrid,
|
|
199
243
|
validateTileGridLimits: () => validateTileGridLimits,
|
|
200
244
|
waitForPromiseWithSignal: () => waitForPromiseWithSignal,
|
|
@@ -248,18 +292,48 @@ var nodeVersion = matches && parseFloat(matches[1]) || 0;
|
|
|
248
292
|
|
|
249
293
|
// dist/loader-utils/lib/log-utils/log.js
|
|
250
294
|
var import_log = require("probe.gl/log");
|
|
251
|
-
var VERSION = true ? "5.0.0-beta.
|
|
295
|
+
var VERSION = true ? "5.0.0-beta.11" : "latest";
|
|
252
296
|
var version = VERSION[0] >= "0" && VERSION[0] <= "9" ? `v${VERSION}` : "";
|
|
253
297
|
function createLog() {
|
|
254
|
-
const
|
|
298
|
+
const log3 = new import_log.Log({ id: "loaders.gl" });
|
|
255
299
|
globalThis.loaders ||= {};
|
|
256
|
-
globalThis.loaders.log =
|
|
300
|
+
globalThis.loaders.log = log3;
|
|
257
301
|
globalThis.loaders.version = version;
|
|
258
302
|
globalThis.probe ||= {};
|
|
259
|
-
globalThis.probe.loaders =
|
|
260
|
-
return
|
|
303
|
+
globalThis.probe.loaders = log3;
|
|
304
|
+
return log3;
|
|
261
305
|
}
|
|
262
306
|
var log = createLog();
|
|
307
|
+
var NullLog = class {
|
|
308
|
+
/** Discards debug messages. */
|
|
309
|
+
log() {
|
|
310
|
+
return ignoreMessage;
|
|
311
|
+
}
|
|
312
|
+
/** Discards informational messages. */
|
|
313
|
+
info() {
|
|
314
|
+
return ignoreMessage;
|
|
315
|
+
}
|
|
316
|
+
/** Discards messages marked to be emitted once. */
|
|
317
|
+
once() {
|
|
318
|
+
return ignoreMessage;
|
|
319
|
+
}
|
|
320
|
+
/** Discards warnings. */
|
|
321
|
+
warn() {
|
|
322
|
+
return ignoreMessage;
|
|
323
|
+
}
|
|
324
|
+
/** Discards errors. */
|
|
325
|
+
error() {
|
|
326
|
+
return ignoreMessage;
|
|
327
|
+
}
|
|
328
|
+
};
|
|
329
|
+
function ignoreMessage() {
|
|
330
|
+
}
|
|
331
|
+
var nullLog = new NullLog();
|
|
332
|
+
function getLoaderLog(options) {
|
|
333
|
+
var _a;
|
|
334
|
+
const logger = (_a = options == null ? void 0 : options.core) == null ? void 0 : _a.log;
|
|
335
|
+
return logger === null ? nullLog : logger || log;
|
|
336
|
+
}
|
|
263
337
|
|
|
264
338
|
// dist/loader-utils/lib/javascript-utils/is-type.js
|
|
265
339
|
var isBoolean = (value) => typeof value === "boolean";
|
|
@@ -368,15 +442,6 @@ var LOADERS_GL_RAW_FIXTURE_URL = `https://raw.githubusercontent.com/visgl/loader
|
|
|
368
442
|
var LOADERS_GL_REDIRECTING_FIXTURE_URL = `https://github.com/visgl/loaders.gl/raw/${LOADERS_GL_FIXTURE_BRANCH}/`;
|
|
369
443
|
var NPM_TAG = "beta";
|
|
370
444
|
|
|
371
|
-
// src/worker-utils/lib/env-utils/version.ts
|
|
372
|
-
function getVersion() {
|
|
373
|
-
const version2 = typeof __VERSION__ === "undefined" ? NPM_TAG : __VERSION__;
|
|
374
|
-
globalThis._loadersgl_ = globalThis._loadersgl_ || {};
|
|
375
|
-
globalThis._loadersgl_.version ||= version2;
|
|
376
|
-
return version2;
|
|
377
|
-
}
|
|
378
|
-
var VERSION2 = getVersion();
|
|
379
|
-
|
|
380
445
|
// src/worker-utils/lib/env-utils/assert.ts
|
|
381
446
|
function assert2(condition, message) {
|
|
382
447
|
if (!condition) {
|
|
@@ -403,818 +468,51 @@ var isMobile = typeof window !== "undefined" && typeof window.orientation !== "u
|
|
|
403
468
|
var matches2 = typeof process !== "undefined" && process.version && /v([0-9]*)/.exec(process.version);
|
|
404
469
|
var nodeVersion2 = matches2 && parseFloat(matches2[1]) || 0;
|
|
405
470
|
|
|
406
|
-
// src/worker-utils/lib/worker-
|
|
407
|
-
var
|
|
408
|
-
name;
|
|
409
|
-
workerThread;
|
|
410
|
-
isRunning = true;
|
|
411
|
-
/** Promise that resolves when Job is done */
|
|
412
|
-
result;
|
|
413
|
-
_resolve = () => {
|
|
414
|
-
};
|
|
415
|
-
_reject = () => {
|
|
416
|
-
};
|
|
417
|
-
constructor(jobName, workerThread) {
|
|
418
|
-
this.name = jobName;
|
|
419
|
-
this.workerThread = workerThread;
|
|
420
|
-
this.result = new Promise((resolve2, reject) => {
|
|
421
|
-
this._resolve = resolve2;
|
|
422
|
-
this._reject = reject;
|
|
423
|
-
});
|
|
424
|
-
}
|
|
425
|
-
/**
|
|
426
|
-
* Send a message to the job's worker thread
|
|
427
|
-
* @param data any data structure, ideally consisting mostly of transferrable objects
|
|
428
|
-
*/
|
|
429
|
-
postMessage(type, payload) {
|
|
430
|
-
if (!this.isRunning) return;
|
|
431
|
-
this.workerThread.postMessage({
|
|
432
|
-
source: "loaders.gl",
|
|
433
|
-
// Lets worker ignore unrelated messages
|
|
434
|
-
type,
|
|
435
|
-
payload
|
|
436
|
-
});
|
|
437
|
-
}
|
|
438
|
-
/**
|
|
439
|
-
* Call to resolve the `result` Promise with the supplied value
|
|
440
|
-
*/
|
|
441
|
-
done(value) {
|
|
442
|
-
if (!this.isRunning) {
|
|
443
|
-
return;
|
|
444
|
-
}
|
|
445
|
-
this.isRunning = false;
|
|
446
|
-
this._resolve(value);
|
|
447
|
-
}
|
|
448
|
-
/**
|
|
449
|
-
* Call to reject the `result` Promise with the supplied error
|
|
450
|
-
*/
|
|
451
|
-
error(error) {
|
|
452
|
-
if (!this.isRunning) {
|
|
453
|
-
return;
|
|
454
|
-
}
|
|
455
|
-
this.isRunning = false;
|
|
456
|
-
this._reject(error);
|
|
457
|
-
}
|
|
458
|
-
/**
|
|
459
|
-
* Terminates the worker executing this job and rejects its result.
|
|
460
|
-
* @param reason Abort reason supplied by the caller, or a cross-runtime `AbortError`.
|
|
461
|
-
*/
|
|
462
|
-
abort(reason) {
|
|
463
|
-
if (!this.isRunning) {
|
|
464
|
-
return;
|
|
465
|
-
}
|
|
466
|
-
this.workerThread.destroy();
|
|
467
|
-
this.error(
|
|
468
|
-
arguments.length ? reason : createAbortError(`Worker job "${this.name}" was aborted`)
|
|
469
|
-
);
|
|
470
|
-
}
|
|
471
|
-
};
|
|
472
|
-
function createAbortError(message) {
|
|
473
|
-
const error = new Error(message);
|
|
474
|
-
error.name = "AbortError";
|
|
475
|
-
return error;
|
|
476
|
-
}
|
|
477
|
-
|
|
478
|
-
// src/worker-utils/lib/node/worker_threads-browser.ts
|
|
479
|
-
var NodeWorker = class {
|
|
480
|
-
/** Restores the native worker constructor when this browser shim is embedded in a Node bundle. */
|
|
481
|
-
constructor(...arguments_) {
|
|
482
|
-
var _a;
|
|
483
|
-
const runtimeProcess = globalThis.process;
|
|
484
|
-
const WorkerConstructor = (_a = runtimeProcess == null ? void 0 : runtimeProcess.getBuiltinModule) == null ? void 0 : _a.call(runtimeProcess, "node:worker_threads").Worker;
|
|
485
|
-
if (WorkerConstructor) {
|
|
486
|
-
return new WorkerConstructor(...arguments_);
|
|
487
|
-
}
|
|
488
|
-
}
|
|
489
|
-
/** No-op browser fallback matching the native Worker API. */
|
|
490
|
-
terminate() {
|
|
491
|
-
}
|
|
492
|
-
};
|
|
493
|
-
var parentPort = null;
|
|
494
|
-
|
|
495
|
-
// src/worker-utils/lib/worker-utils/get-loadable-worker-url.ts
|
|
496
|
-
var workerURLCache = /* @__PURE__ */ new Map();
|
|
497
|
-
function getLoadableWorkerURL(props) {
|
|
498
|
-
assert2(props.source && !props.url || !props.source && props.url);
|
|
499
|
-
let workerURL = workerURLCache.get(props.source || props.url);
|
|
500
|
-
if (!workerURL) {
|
|
501
|
-
if (props.url) {
|
|
502
|
-
workerURL = getLoadableWorkerURLFromURL(props.url);
|
|
503
|
-
workerURLCache.set(props.url, workerURL);
|
|
504
|
-
}
|
|
505
|
-
if (props.source) {
|
|
506
|
-
workerURL = getLoadableWorkerURLFromSource(props.source);
|
|
507
|
-
workerURLCache.set(props.source, workerURL);
|
|
508
|
-
}
|
|
509
|
-
}
|
|
510
|
-
assert2(workerURL);
|
|
511
|
-
return workerURL;
|
|
512
|
-
}
|
|
513
|
-
function getLoadableWorkerURLFromURL(url) {
|
|
514
|
-
if (!url.startsWith("http")) {
|
|
515
|
-
return url;
|
|
516
|
-
}
|
|
517
|
-
const workerSource = buildScriptSource(url);
|
|
518
|
-
return getLoadableWorkerURLFromSource(workerSource);
|
|
519
|
-
}
|
|
520
|
-
function getLoadableWorkerURLFromSource(workerSource) {
|
|
521
|
-
const blob = new Blob([workerSource], { type: "application/javascript" });
|
|
522
|
-
return URL.createObjectURL(blob);
|
|
523
|
-
}
|
|
524
|
-
function buildScriptSource(workerUrl) {
|
|
525
|
-
return `try {
|
|
526
|
-
importScripts('${workerUrl}');
|
|
527
|
-
} catch (error) {
|
|
528
|
-
console.error(error);
|
|
529
|
-
throw error;
|
|
530
|
-
}`;
|
|
531
|
-
}
|
|
532
|
-
|
|
533
|
-
// src/worker-utils/lib/worker-utils/get-transfer-list.ts
|
|
534
|
-
function getTransferList(object, recursive = true, transfers) {
|
|
535
|
-
const transfersSet = transfers || /* @__PURE__ */ new Set();
|
|
536
|
-
if (!object) {
|
|
537
|
-
} else if (isTransferable(object)) {
|
|
538
|
-
transfersSet.add(object);
|
|
539
|
-
} else if (isTransferable(object.buffer)) {
|
|
540
|
-
transfersSet.add(object.buffer);
|
|
541
|
-
} else if (ArrayBuffer.isView(object)) {
|
|
542
|
-
} else if (recursive && typeof object === "object") {
|
|
543
|
-
for (const key in object) {
|
|
544
|
-
getTransferList(object[key], recursive, transfersSet);
|
|
545
|
-
}
|
|
546
|
-
}
|
|
547
|
-
return transfers === void 0 ? Array.from(transfersSet) : [];
|
|
548
|
-
}
|
|
549
|
-
function isTransferable(object) {
|
|
550
|
-
if (!object) {
|
|
551
|
-
return false;
|
|
552
|
-
}
|
|
553
|
-
if (object instanceof ArrayBuffer) {
|
|
554
|
-
return true;
|
|
555
|
-
}
|
|
556
|
-
if (typeof MessagePort !== "undefined" && object instanceof MessagePort) {
|
|
557
|
-
return true;
|
|
558
|
-
}
|
|
559
|
-
if (typeof ImageBitmap !== "undefined" && object instanceof ImageBitmap) {
|
|
560
|
-
return true;
|
|
561
|
-
}
|
|
562
|
-
if (typeof OffscreenCanvas !== "undefined" && object instanceof OffscreenCanvas) {
|
|
563
|
-
return true;
|
|
564
|
-
}
|
|
565
|
-
return false;
|
|
566
|
-
}
|
|
567
|
-
function getTransferListForWriter(object) {
|
|
568
|
-
if (object === null) {
|
|
569
|
-
return {};
|
|
570
|
-
}
|
|
571
|
-
const clone = Object.assign({}, object);
|
|
572
|
-
Object.keys(clone).forEach((key) => {
|
|
573
|
-
if (typeof object[key] === "object" && !ArrayBuffer.isView(object[key]) && !(object[key] instanceof Array)) {
|
|
574
|
-
clone[key] = getTransferListForWriter(object[key]);
|
|
575
|
-
} else if (typeof clone[key] === "function" || clone[key] instanceof RegExp) {
|
|
576
|
-
clone[key] = {};
|
|
577
|
-
} else {
|
|
578
|
-
clone[key] = object[key];
|
|
579
|
-
}
|
|
580
|
-
});
|
|
581
|
-
return clone;
|
|
582
|
-
}
|
|
583
|
-
|
|
584
|
-
// src/worker-utils/lib/worker-farm/worker-thread.ts
|
|
585
|
-
var NOOP = () => {
|
|
586
|
-
};
|
|
587
|
-
var WorkerThread = class {
|
|
588
|
-
name;
|
|
589
|
-
source;
|
|
590
|
-
url;
|
|
591
|
-
/** Lazily resolves the classic worker URL used as a fallback. */
|
|
592
|
-
getUrl;
|
|
593
|
-
/** Creates a browser Worker directly. */
|
|
594
|
-
loadWorker;
|
|
595
|
-
terminated = false;
|
|
596
|
-
worker;
|
|
597
|
-
onMessage;
|
|
598
|
-
onError;
|
|
599
|
-
_loadableURL = "";
|
|
600
|
-
/** Checks if workers are supported on this platform */
|
|
601
|
-
static isSupported() {
|
|
602
|
-
return typeof Worker !== "undefined" && isBrowser2 || typeof NodeWorker !== "undefined" && !isBrowser2;
|
|
603
|
-
}
|
|
604
|
-
constructor(props) {
|
|
605
|
-
const { name, source, url, getUrl, loadWorker } = props;
|
|
606
|
-
assert2(source || url || getUrl || loadWorker);
|
|
607
|
-
this.name = name;
|
|
608
|
-
this.source = source;
|
|
609
|
-
this.url = url;
|
|
610
|
-
this.getUrl = getUrl;
|
|
611
|
-
this.loadWorker = loadWorker;
|
|
612
|
-
this.onMessage = NOOP;
|
|
613
|
-
this.onError = (error) => console.log(error);
|
|
614
|
-
this.worker = isBrowser2 ? this._createBrowserWorker() : this._createNodeWorker();
|
|
615
|
-
}
|
|
616
|
-
/**
|
|
617
|
-
* Terminate this worker thread
|
|
618
|
-
* @note Can free up significant memory
|
|
619
|
-
*/
|
|
620
|
-
destroy() {
|
|
621
|
-
this.onMessage = NOOP;
|
|
622
|
-
this.onError = NOOP;
|
|
623
|
-
this.worker.terminate();
|
|
624
|
-
this.terminated = true;
|
|
625
|
-
}
|
|
626
|
-
/** Keeps this worker from preventing Node.js process exit while idle. */
|
|
627
|
-
unref() {
|
|
628
|
-
if (!isBrowser2 && typeof this.worker.unref === "function") {
|
|
629
|
-
this.worker.unref();
|
|
630
|
-
}
|
|
631
|
-
}
|
|
632
|
-
/** Keeps this worker alive while it is actively processing a job. */
|
|
633
|
-
ref() {
|
|
634
|
-
if (!isBrowser2 && typeof this.worker.ref === "function") {
|
|
635
|
-
this.worker.ref();
|
|
636
|
-
}
|
|
637
|
-
}
|
|
638
|
-
get isRunning() {
|
|
639
|
-
return Boolean(this.onMessage);
|
|
640
|
-
}
|
|
641
|
-
/**
|
|
642
|
-
* Send a message to this worker thread
|
|
643
|
-
* @param data any data structure, ideally consisting mostly of transferrable objects
|
|
644
|
-
* @param transferList If not supplied, calculated automatically by traversing data
|
|
645
|
-
*/
|
|
646
|
-
postMessage(data, transferList) {
|
|
647
|
-
transferList = transferList || getTransferList(data);
|
|
648
|
-
this.worker.postMessage(data, transferList);
|
|
649
|
-
}
|
|
650
|
-
// PRIVATE
|
|
651
|
-
/**
|
|
652
|
-
* Generate a standard Error from an ErrorEvent
|
|
653
|
-
* @param event
|
|
654
|
-
*/
|
|
655
|
-
_getErrorFromErrorEvent(event) {
|
|
656
|
-
let message = "Failed to load ";
|
|
657
|
-
message += `worker ${this.name} from ${this.url || "built-in worker factory"}. `;
|
|
658
|
-
if (event.message) {
|
|
659
|
-
message += `${event.message} in `;
|
|
660
|
-
}
|
|
661
|
-
if (event.lineno) {
|
|
662
|
-
message += `:${event.lineno}:${event.colno}`;
|
|
663
|
-
}
|
|
664
|
-
return new Error(message);
|
|
665
|
-
}
|
|
666
|
-
/**
|
|
667
|
-
* Creates a worker thread on the browser
|
|
668
|
-
*/
|
|
669
|
-
_createBrowserWorker() {
|
|
670
|
-
var _a;
|
|
671
|
-
if (this.loadWorker) {
|
|
672
|
-
try {
|
|
673
|
-
const worker2 = this.loadWorker();
|
|
674
|
-
if (worker2) {
|
|
675
|
-
return this._initializeBrowserWorker(worker2);
|
|
676
|
-
}
|
|
677
|
-
} catch (error) {
|
|
678
|
-
if (!this.source && !this.url && !this.getUrl) {
|
|
679
|
-
throw error;
|
|
680
|
-
}
|
|
681
|
-
}
|
|
682
|
-
}
|
|
683
|
-
const url = this.url || ((_a = this.getUrl) == null ? void 0 : _a.call(this));
|
|
684
|
-
this._loadableURL = getLoadableWorkerURL({ source: this.source, url });
|
|
685
|
-
const worker = new Worker(this._loadableURL, { name: this.name });
|
|
686
|
-
return this._initializeBrowserWorker(worker);
|
|
687
|
-
}
|
|
688
|
-
/** Attaches protocol handlers to a browser worker. */
|
|
689
|
-
_initializeBrowserWorker(worker) {
|
|
690
|
-
worker.onmessage = (event) => {
|
|
691
|
-
if (!event.data) {
|
|
692
|
-
this.onError(new Error("No data received"));
|
|
693
|
-
} else {
|
|
694
|
-
this.onMessage(event.data);
|
|
695
|
-
}
|
|
696
|
-
};
|
|
697
|
-
worker.onerror = (error) => {
|
|
698
|
-
this.onError(this._getErrorFromErrorEvent(error));
|
|
699
|
-
this.terminated = true;
|
|
700
|
-
};
|
|
701
|
-
worker.onmessageerror = (event) => console.error(event);
|
|
702
|
-
return worker;
|
|
703
|
-
}
|
|
704
|
-
/**
|
|
705
|
-
* Creates a worker thread in node.js
|
|
706
|
-
* @todo https://nodejs.org/api/async_hooks.html#async-resource-worker-pool
|
|
707
|
-
*/
|
|
708
|
-
_createNodeWorker() {
|
|
709
|
-
let worker;
|
|
710
|
-
if (this.url) {
|
|
711
|
-
const absolute = this.url.includes(":/") || this.url.startsWith("/");
|
|
712
|
-
const url = absolute ? this.url : `./${this.url}`;
|
|
713
|
-
const workerUrl = url.startsWith("file:") ? new URL(url) : url;
|
|
714
|
-
const type = this.url.endsWith(".ts") || this.url.endsWith(".mjs") ? "module" : "commonjs";
|
|
715
|
-
worker = new NodeWorker(workerUrl, { eval: false, type });
|
|
716
|
-
} else if (this.source) {
|
|
717
|
-
worker = new NodeWorker(this.source, { eval: true });
|
|
718
|
-
} else {
|
|
719
|
-
throw new Error("no worker");
|
|
720
|
-
}
|
|
721
|
-
worker.on("message", (data) => {
|
|
722
|
-
this.onMessage(data);
|
|
723
|
-
});
|
|
724
|
-
worker.on("error", (error) => {
|
|
725
|
-
this.onError(error);
|
|
726
|
-
});
|
|
727
|
-
worker.on("exit", (_code) => {
|
|
728
|
-
});
|
|
729
|
-
return worker;
|
|
730
|
-
}
|
|
731
|
-
};
|
|
732
|
-
|
|
733
|
-
// src/worker-utils/lib/worker-farm/worker-pool.ts
|
|
734
|
-
var WorkerPool = class {
|
|
735
|
-
name = "unnamed";
|
|
736
|
-
source;
|
|
737
|
-
// | Function;
|
|
738
|
-
url;
|
|
739
|
-
/** Lazily resolves a classic worker fallback URL. */
|
|
740
|
-
getUrl;
|
|
741
|
-
/** Creates a browser Worker directly. */
|
|
742
|
-
loadWorker;
|
|
743
|
-
maxConcurrency = 1;
|
|
744
|
-
maxMobileConcurrency = 1;
|
|
745
|
-
onDebug = () => {
|
|
746
|
-
};
|
|
747
|
-
reuseWorkers = true;
|
|
748
|
-
props = {};
|
|
749
|
-
jobQueue = [];
|
|
750
|
-
idleQueue = [];
|
|
751
|
-
activeJobs = /* @__PURE__ */ new Set();
|
|
752
|
-
count = 0;
|
|
753
|
-
isDestroyed = false;
|
|
754
|
-
/** Checks if workers are supported on this platform */
|
|
755
|
-
static isSupported() {
|
|
756
|
-
return WorkerThread.isSupported();
|
|
757
|
-
}
|
|
758
|
-
/**
|
|
759
|
-
* @param processor - worker function
|
|
760
|
-
* @param maxConcurrency - max count of workers
|
|
761
|
-
*/
|
|
762
|
-
constructor(props) {
|
|
763
|
-
this.source = props.source;
|
|
764
|
-
this.url = props.url;
|
|
765
|
-
this.getUrl = props.getUrl;
|
|
766
|
-
this.loadWorker = props.loadWorker;
|
|
767
|
-
this.setProps(props);
|
|
768
|
-
}
|
|
769
|
-
/**
|
|
770
|
-
* Terminates all workers in the pool and aborts active jobs.
|
|
771
|
-
* @param reason Optional error delivered to active jobs.
|
|
772
|
-
* @note Can free up significant memory
|
|
773
|
-
*/
|
|
774
|
-
destroy(reason = new Error("Worker pool was destroyed")) {
|
|
775
|
-
this.isDestroyed = true;
|
|
776
|
-
this.activeJobs.forEach((job) => job.abort(reason));
|
|
777
|
-
const queuedJobs = this.jobQueue.splice(0);
|
|
778
|
-
queuedJobs.forEach((queuedJob) => {
|
|
779
|
-
queuedJob.removeAbortListener();
|
|
780
|
-
queuedJob.onReject(reason);
|
|
781
|
-
});
|
|
782
|
-
this.idleQueue.forEach((worker) => worker.destroy());
|
|
783
|
-
this.isDestroyed = true;
|
|
784
|
-
}
|
|
785
|
-
setProps(props) {
|
|
786
|
-
this.props = { ...this.props, ...props };
|
|
787
|
-
if (props.name !== void 0) {
|
|
788
|
-
this.name = props.name;
|
|
789
|
-
}
|
|
790
|
-
if (props.maxConcurrency !== void 0) {
|
|
791
|
-
this.maxConcurrency = props.maxConcurrency;
|
|
792
|
-
}
|
|
793
|
-
if (props.maxMobileConcurrency !== void 0) {
|
|
794
|
-
this.maxMobileConcurrency = props.maxMobileConcurrency;
|
|
795
|
-
}
|
|
796
|
-
if (props.reuseWorkers !== void 0) {
|
|
797
|
-
this.reuseWorkers = props.reuseWorkers;
|
|
798
|
-
}
|
|
799
|
-
if (props.onDebug !== void 0) {
|
|
800
|
-
this.onDebug = props.onDebug;
|
|
801
|
-
}
|
|
802
|
-
}
|
|
803
|
-
async startJob(name, onMessage2 = (job, type, data) => job.done(data), onError = (job, error) => job.error(error), signal) {
|
|
804
|
-
if (signal == null ? void 0 : signal.aborted) {
|
|
805
|
-
throw signal.reason;
|
|
806
|
-
}
|
|
807
|
-
if (this.isDestroyed) {
|
|
808
|
-
return Promise.reject(new Error("Worker pool was destroyed"));
|
|
809
|
-
}
|
|
810
|
-
const startPromise = new Promise((onStart, onReject) => {
|
|
811
|
-
const abortQueuedJob = () => {
|
|
812
|
-
const index = this.jobQueue.indexOf(queuedJob);
|
|
813
|
-
if (index >= 0) {
|
|
814
|
-
this.jobQueue.splice(index, 1);
|
|
815
|
-
queuedJob.removeAbortListener();
|
|
816
|
-
onReject(signal == null ? void 0 : signal.reason);
|
|
817
|
-
}
|
|
818
|
-
};
|
|
819
|
-
const queuedJob = {
|
|
820
|
-
name,
|
|
821
|
-
onMessage: onMessage2,
|
|
822
|
-
onError,
|
|
823
|
-
onStart,
|
|
824
|
-
onReject,
|
|
825
|
-
signal,
|
|
826
|
-
removeAbortListener: () => signal == null ? void 0 : signal.removeEventListener("abort", abortQueuedJob)
|
|
827
|
-
};
|
|
828
|
-
this.jobQueue.push(queuedJob);
|
|
829
|
-
signal == null ? void 0 : signal.addEventListener("abort", abortQueuedJob, { once: true });
|
|
830
|
-
return this;
|
|
831
|
-
});
|
|
832
|
-
this._startQueuedJob();
|
|
833
|
-
return await startPromise;
|
|
834
|
-
}
|
|
835
|
-
// PRIVATE
|
|
836
|
-
/**
|
|
837
|
-
* Starts first queued job if worker is available or can be created
|
|
838
|
-
* Called when job is started and whenever a worker returns to the idleQueue
|
|
839
|
-
*/
|
|
840
|
-
async _startQueuedJob() {
|
|
841
|
-
var _a, _b, _c;
|
|
842
|
-
if (!this.jobQueue.length) {
|
|
843
|
-
return;
|
|
844
|
-
}
|
|
845
|
-
let workerThread;
|
|
846
|
-
try {
|
|
847
|
-
workerThread = this._getAvailableWorker();
|
|
848
|
-
} catch (error) {
|
|
849
|
-
const queuedJob2 = this.jobQueue.shift();
|
|
850
|
-
queuedJob2 == null ? void 0 : queuedJob2.removeAbortListener();
|
|
851
|
-
queuedJob2 == null ? void 0 : queuedJob2.onReject(error);
|
|
852
|
-
void this._startQueuedJob();
|
|
853
|
-
return;
|
|
854
|
-
}
|
|
855
|
-
if (!workerThread) {
|
|
856
|
-
return;
|
|
857
|
-
}
|
|
858
|
-
const queuedJob = this.jobQueue.shift();
|
|
859
|
-
if (queuedJob) {
|
|
860
|
-
this.onDebug({
|
|
861
|
-
message: "Starting job",
|
|
862
|
-
name: queuedJob.name,
|
|
863
|
-
workerThread,
|
|
864
|
-
backlog: this.jobQueue.length
|
|
865
|
-
});
|
|
866
|
-
const job = new WorkerJob(queuedJob.name, workerThread);
|
|
867
|
-
queuedJob.removeAbortListener();
|
|
868
|
-
const abortJob = () => {
|
|
869
|
-
var _a2;
|
|
870
|
-
return job.abort((_a2 = queuedJob.signal) == null ? void 0 : _a2.reason);
|
|
871
|
-
};
|
|
872
|
-
(_a = queuedJob.signal) == null ? void 0 : _a.addEventListener("abort", abortJob, { once: true });
|
|
873
|
-
if ((_b = queuedJob.signal) == null ? void 0 : _b.aborted) abortJob();
|
|
874
|
-
this.activeJobs.add(job);
|
|
875
|
-
workerThread.ref();
|
|
876
|
-
workerThread.onMessage = (data) => {
|
|
877
|
-
if (job.isRunning) queuedJob.onMessage(job, data.type, data.payload);
|
|
878
|
-
};
|
|
879
|
-
workerThread.onError = (error) => queuedJob.onError(job, error);
|
|
880
|
-
queuedJob.onStart(job);
|
|
881
|
-
try {
|
|
882
|
-
await job.result;
|
|
883
|
-
} catch {
|
|
884
|
-
} finally {
|
|
885
|
-
(_c = queuedJob.signal) == null ? void 0 : _c.removeEventListener("abort", abortJob);
|
|
886
|
-
this.activeJobs.delete(job);
|
|
887
|
-
this.returnWorkerToQueue(workerThread);
|
|
888
|
-
}
|
|
889
|
-
} else {
|
|
890
|
-
this.returnWorkerToQueue(workerThread);
|
|
891
|
-
}
|
|
892
|
-
}
|
|
893
|
-
/**
|
|
894
|
-
* Returns a worker to the idle queue
|
|
895
|
-
* Destroys the worker if
|
|
896
|
-
* - pool is destroyed
|
|
897
|
-
* - if this pool doesn't reuse workers
|
|
898
|
-
* - if maxConcurrency has been lowered
|
|
899
|
-
* @param worker
|
|
900
|
-
*/
|
|
901
|
-
returnWorkerToQueue(worker) {
|
|
902
|
-
const shouldDestroyWorker = (
|
|
903
|
-
// Aborted jobs terminate their worker immediately.
|
|
904
|
-
worker.terminated || // If the pool is destroyed, there is no reason to keep the worker around
|
|
905
|
-
this.isDestroyed || // If the app has disabled worker reuse, any completed workers should be destroyed
|
|
906
|
-
!this.reuseWorkers || // If concurrency has been lowered, this worker might be surplus to requirements
|
|
907
|
-
this.count > this._getMaxConcurrency()
|
|
908
|
-
);
|
|
909
|
-
if (shouldDestroyWorker) {
|
|
910
|
-
if (!worker.terminated) {
|
|
911
|
-
worker.destroy();
|
|
912
|
-
}
|
|
913
|
-
this.count--;
|
|
914
|
-
} else {
|
|
915
|
-
worker.unref();
|
|
916
|
-
this.idleQueue.push(worker);
|
|
917
|
-
}
|
|
918
|
-
if (!this.isDestroyed) {
|
|
919
|
-
this._startQueuedJob();
|
|
920
|
-
}
|
|
921
|
-
}
|
|
922
|
-
/**
|
|
923
|
-
* Returns idle worker or creates new worker if maxConcurrency has not been reached
|
|
924
|
-
*/
|
|
925
|
-
_getAvailableWorker() {
|
|
926
|
-
if (this.idleQueue.length > 0) {
|
|
927
|
-
return this.idleQueue.shift() || null;
|
|
928
|
-
}
|
|
929
|
-
if (this.count < this._getMaxConcurrency()) {
|
|
930
|
-
this.count++;
|
|
931
|
-
const name = `${this.name.toLowerCase()} (#${this.count} of ${this.maxConcurrency})`;
|
|
932
|
-
try {
|
|
933
|
-
return new WorkerThread({
|
|
934
|
-
name,
|
|
935
|
-
source: this.source,
|
|
936
|
-
url: this.url,
|
|
937
|
-
getUrl: this.getUrl,
|
|
938
|
-
loadWorker: this.loadWorker
|
|
939
|
-
});
|
|
940
|
-
} catch (error) {
|
|
941
|
-
this.count--;
|
|
942
|
-
throw error;
|
|
943
|
-
}
|
|
944
|
-
}
|
|
945
|
-
return null;
|
|
946
|
-
}
|
|
947
|
-
_getMaxConcurrency() {
|
|
948
|
-
return isMobile ? this.maxMobileConcurrency : this.maxConcurrency;
|
|
949
|
-
}
|
|
950
|
-
};
|
|
471
|
+
// src/worker-utils/lib/worker-api/process-on-worker.ts
|
|
472
|
+
var import_tasks2 = require("@math.gl/tasks");
|
|
951
473
|
|
|
952
|
-
// src/
|
|
953
|
-
var
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
}
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
workerPools = /* @__PURE__ */ new Map();
|
|
965
|
-
// singleton
|
|
966
|
-
static _workerFarm;
|
|
967
|
-
/** Checks if workers are supported on this platform */
|
|
968
|
-
static isSupported() {
|
|
969
|
-
return WorkerThread.isSupported();
|
|
970
|
-
}
|
|
971
|
-
/** Get the singleton instance of the global worker farm */
|
|
972
|
-
static getWorkerFarm(props = {}) {
|
|
973
|
-
_WorkerFarm._workerFarm = _WorkerFarm._workerFarm || new _WorkerFarm({});
|
|
974
|
-
_WorkerFarm._workerFarm.setProps(props);
|
|
975
|
-
return _WorkerFarm._workerFarm;
|
|
976
|
-
}
|
|
977
|
-
/** get global instance with WorkerFarm.getWorkerFarm() */
|
|
978
|
-
constructor(props) {
|
|
979
|
-
this.props = { ...DEFAULT_PROPS };
|
|
980
|
-
this.setProps(props);
|
|
981
|
-
this.workerPools = /* @__PURE__ */ new Map();
|
|
982
|
-
}
|
|
983
|
-
/**
|
|
984
|
-
* Terminate all workers in the farm and abort active jobs.
|
|
985
|
-
* @param reason Optional error delivered to active jobs.
|
|
986
|
-
* @note Can free up significant memory
|
|
987
|
-
*/
|
|
988
|
-
destroy(reason) {
|
|
989
|
-
for (const workerPool of this.workerPools.values()) {
|
|
990
|
-
workerPool.destroy(reason);
|
|
991
|
-
}
|
|
992
|
-
this.workerPools = /* @__PURE__ */ new Map();
|
|
993
|
-
}
|
|
994
|
-
/**
|
|
995
|
-
* Set props used when initializing worker pools
|
|
996
|
-
* @param props
|
|
997
|
-
*/
|
|
998
|
-
setProps(props) {
|
|
999
|
-
this.props = { ...this.props, ...props };
|
|
1000
|
-
for (const workerPool of this.workerPools.values()) {
|
|
1001
|
-
workerPool.setProps(this._getWorkerPoolProps());
|
|
1002
|
-
}
|
|
1003
|
-
}
|
|
1004
|
-
/**
|
|
1005
|
-
* Returns a worker pool for the specified worker
|
|
1006
|
-
* @param options Worker target used to identify and initialize the pool.
|
|
1007
|
-
* @param options.name Worker name used as the base pool identity.
|
|
1008
|
-
* @param options.url Worker script URL.
|
|
1009
|
-
* @param options.source Inline worker source.
|
|
1010
|
-
* @param options.loadWorker Built-in browser worker factory.
|
|
1011
|
-
* @example
|
|
1012
|
-
* const job = WorkerFarm.getWorkerFarm().getWorkerPool({name, url}).startJob(...);
|
|
1013
|
-
*/
|
|
1014
|
-
getWorkerPool(options) {
|
|
1015
|
-
const { name, source, url, getUrl, loadWorker } = options;
|
|
1016
|
-
const workerPoolKey = getWorkerPoolKey(options);
|
|
1017
|
-
let workerPool = this.workerPools.get(workerPoolKey);
|
|
1018
|
-
if (!workerPool) {
|
|
1019
|
-
workerPool = new WorkerPool({
|
|
1020
|
-
name,
|
|
1021
|
-
source,
|
|
1022
|
-
url,
|
|
1023
|
-
getUrl,
|
|
1024
|
-
loadWorker
|
|
1025
|
-
});
|
|
1026
|
-
workerPool.setProps(this._getWorkerPoolProps());
|
|
1027
|
-
this.workerPools.set(workerPoolKey, workerPool);
|
|
1028
|
-
}
|
|
1029
|
-
return workerPool;
|
|
1030
|
-
}
|
|
1031
|
-
_getWorkerPoolProps() {
|
|
1032
|
-
return {
|
|
1033
|
-
maxConcurrency: this.props.maxConcurrency,
|
|
1034
|
-
maxMobileConcurrency: this.props.maxMobileConcurrency,
|
|
1035
|
-
reuseWorkers: this.props.reuseWorkers,
|
|
1036
|
-
onDebug: this.props.onDebug
|
|
1037
|
-
};
|
|
1038
|
-
}
|
|
1039
|
-
};
|
|
1040
|
-
function getWorkerPoolKey(options) {
|
|
1041
|
-
const { name, source, url, urlKey, loadWorker } = options;
|
|
1042
|
-
const sourceKey = source ? `source:${source}` : "";
|
|
1043
|
-
const urlKeyPart = url || urlKey ? `url:${url || urlKey}` : "";
|
|
1044
|
-
const loadWorkerKey = loadWorker ? `loadWorker:${getLoadWorkerId(loadWorker)}` : "";
|
|
1045
|
-
return [name, sourceKey, urlKeyPart, loadWorkerKey].filter(Boolean).join("|");
|
|
474
|
+
// src/loader-utils/lib/log-utils/log.ts
|
|
475
|
+
var import_log3 = require("probe.gl/log");
|
|
476
|
+
var VERSION2 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
|
|
477
|
+
var version2 = VERSION2[0] >= "0" && VERSION2[0] <= "9" ? `v${VERSION2}` : "";
|
|
478
|
+
function createLog2() {
|
|
479
|
+
const log3 = new import_log3.Log({ id: "loaders.gl" });
|
|
480
|
+
globalThis.loaders ||= {};
|
|
481
|
+
globalThis.loaders.log = log3;
|
|
482
|
+
globalThis.loaders.version = version2;
|
|
483
|
+
globalThis.probe ||= {};
|
|
484
|
+
globalThis.probe.loaders = log3;
|
|
485
|
+
return log3;
|
|
1046
486
|
}
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
487
|
+
var log2 = createLog2();
|
|
488
|
+
var NullLog2 = class {
|
|
489
|
+
/** Discards debug messages. */
|
|
490
|
+
log() {
|
|
491
|
+
return ignoreMessage2;
|
|
1052
492
|
}
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
// src/worker-utils/lib/worker-farm/worker-body.ts
|
|
1057
|
-
async function getParentPort() {
|
|
1058
|
-
return parentPort;
|
|
1059
|
-
}
|
|
1060
|
-
var onMessageWrapperMap = /* @__PURE__ */ new Map();
|
|
1061
|
-
var WorkerBody = class {
|
|
1062
|
-
/** Check that we are actually in a worker thread */
|
|
1063
|
-
static async inWorkerThread() {
|
|
1064
|
-
return typeof self !== "undefined" || Boolean(await getParentPort());
|
|
1065
|
-
}
|
|
1066
|
-
/*
|
|
1067
|
-
* (type: WorkerMessageType, payload: WorkerMessagePayload) => any
|
|
1068
|
-
*/
|
|
1069
|
-
static set onmessage(onMessage2) {
|
|
1070
|
-
async function handleMessage(message) {
|
|
1071
|
-
const parentPort2 = await getParentPort();
|
|
1072
|
-
const { type, payload } = parentPort2 ? message : message.data;
|
|
1073
|
-
onMessage2(type, payload);
|
|
1074
|
-
}
|
|
1075
|
-
getParentPort().then((parentPort2) => {
|
|
1076
|
-
if (parentPort2) {
|
|
1077
|
-
parentPort2.on("message", (message) => {
|
|
1078
|
-
handleMessage(message);
|
|
1079
|
-
});
|
|
1080
|
-
parentPort2.on("exit", () => console.debug("Node worker closing"));
|
|
1081
|
-
} else {
|
|
1082
|
-
globalThis.onmessage = handleMessage;
|
|
1083
|
-
}
|
|
1084
|
-
});
|
|
493
|
+
/** Discards informational messages. */
|
|
494
|
+
info() {
|
|
495
|
+
return ignoreMessage2;
|
|
1085
496
|
}
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
onMessageWrapper = (message) => {
|
|
1090
|
-
const messageData = getWorkerMessageData(message);
|
|
1091
|
-
if (!messageData) {
|
|
1092
|
-
return;
|
|
1093
|
-
}
|
|
1094
|
-
onMessage2(messageData.type, messageData.payload);
|
|
1095
|
-
};
|
|
1096
|
-
onMessageWrapperMap.set(onMessage2, onMessageWrapper);
|
|
1097
|
-
}
|
|
1098
|
-
const parentPort2 = await getParentPort();
|
|
1099
|
-
if (parentPort2) {
|
|
1100
|
-
parentPort2.on("message", onMessageWrapper);
|
|
1101
|
-
} else {
|
|
1102
|
-
globalThis.addEventListener("message", onMessageWrapper);
|
|
1103
|
-
}
|
|
497
|
+
/** Discards messages marked to be emitted once. */
|
|
498
|
+
once() {
|
|
499
|
+
return ignoreMessage2;
|
|
1104
500
|
}
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
if (!onMessageWrapper) {
|
|
1109
|
-
return;
|
|
1110
|
-
}
|
|
1111
|
-
const parentPort2 = await getParentPort();
|
|
1112
|
-
if (parentPort2) {
|
|
1113
|
-
parentPort2.off("message", onMessageWrapper);
|
|
1114
|
-
} else {
|
|
1115
|
-
globalThis.removeEventListener("message", onMessageWrapper);
|
|
1116
|
-
}
|
|
501
|
+
/** Discards warnings. */
|
|
502
|
+
warn() {
|
|
503
|
+
return ignoreMessage2;
|
|
1117
504
|
}
|
|
1118
|
-
/**
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
* @param payload
|
|
1122
|
-
*/
|
|
1123
|
-
static async postMessage(type, payload) {
|
|
1124
|
-
const data = { source: "loaders.gl", type, payload };
|
|
1125
|
-
const transferList = getTransferList(payload);
|
|
1126
|
-
const parentPort2 = await getParentPort();
|
|
1127
|
-
if (parentPort2) {
|
|
1128
|
-
parentPort2.postMessage(data, transferList);
|
|
1129
|
-
} else {
|
|
1130
|
-
globalThis.postMessage(data, transferList);
|
|
1131
|
-
}
|
|
505
|
+
/** Discards errors. */
|
|
506
|
+
error() {
|
|
507
|
+
return ignoreMessage2;
|
|
1132
508
|
}
|
|
1133
509
|
};
|
|
1134
|
-
function
|
|
1135
|
-
if (!message || typeof message !== "object") {
|
|
1136
|
-
return null;
|
|
1137
|
-
}
|
|
1138
|
-
const messageData = "data" in message && message.type === "message" ? message.data : message;
|
|
1139
|
-
return messageData && typeof messageData.source === "string" && messageData.source.startsWith("loaders.gl") ? messageData : null;
|
|
510
|
+
function ignoreMessage2() {
|
|
1140
511
|
}
|
|
1141
|
-
|
|
1142
|
-
// src/worker-utils/lib/async-queue/async-queue.ts
|
|
1143
|
-
var AsyncQueue = class {
|
|
1144
|
-
_values;
|
|
1145
|
-
_settlers;
|
|
1146
|
-
_closed;
|
|
1147
|
-
constructor() {
|
|
1148
|
-
this._values = [];
|
|
1149
|
-
this._settlers = [];
|
|
1150
|
-
this._closed = false;
|
|
1151
|
-
}
|
|
1152
|
-
/** Return an async iterator for this queue */
|
|
1153
|
-
[Symbol.asyncIterator]() {
|
|
1154
|
-
return this;
|
|
1155
|
-
}
|
|
1156
|
-
/** Push a new value - the async iterator will yield a promise resolved to this value */
|
|
1157
|
-
push(value) {
|
|
1158
|
-
return this.enqueue(value);
|
|
1159
|
-
}
|
|
1160
|
-
/**
|
|
1161
|
-
* Push a new value - the async iterator will yield a promise resolved to this value
|
|
1162
|
-
* Add an error - the async iterator will yield a promise rejected with this value
|
|
1163
|
-
*/
|
|
1164
|
-
enqueue(value) {
|
|
1165
|
-
if (this._closed) {
|
|
1166
|
-
throw new Error("Closed");
|
|
1167
|
-
}
|
|
1168
|
-
if (this._settlers.length > 0) {
|
|
1169
|
-
if (this._values.length > 0) {
|
|
1170
|
-
throw new Error("Illegal internal state");
|
|
1171
|
-
}
|
|
1172
|
-
const settler = this._settlers.shift();
|
|
1173
|
-
if (value instanceof Error) {
|
|
1174
|
-
settler.reject(value);
|
|
1175
|
-
} else {
|
|
1176
|
-
settler.resolve({ value });
|
|
1177
|
-
}
|
|
1178
|
-
} else {
|
|
1179
|
-
this._values.push(value);
|
|
1180
|
-
}
|
|
1181
|
-
}
|
|
1182
|
-
/** Indicate that we not waiting for more values - The async iterator will be done */
|
|
1183
|
-
close() {
|
|
1184
|
-
while (this._settlers.length > 0) {
|
|
1185
|
-
const settler = this._settlers.shift();
|
|
1186
|
-
settler.resolve({ done: true });
|
|
1187
|
-
}
|
|
1188
|
-
this._closed = true;
|
|
1189
|
-
}
|
|
1190
|
-
// ITERATOR IMPLEMENTATION
|
|
1191
|
-
/** @returns a Promise for an IteratorResult */
|
|
1192
|
-
next() {
|
|
1193
|
-
if (this._values.length > 0) {
|
|
1194
|
-
const value = this._values.shift();
|
|
1195
|
-
if (value instanceof Error) {
|
|
1196
|
-
return Promise.reject(value);
|
|
1197
|
-
}
|
|
1198
|
-
return Promise.resolve({ done: false, value });
|
|
1199
|
-
}
|
|
1200
|
-
if (this._closed) {
|
|
1201
|
-
if (this._settlers.length > 0) {
|
|
1202
|
-
throw new Error("Illegal internal state");
|
|
1203
|
-
}
|
|
1204
|
-
return Promise.resolve({ done: true, value: void 0 });
|
|
1205
|
-
}
|
|
1206
|
-
return new Promise((resolve2, reject) => {
|
|
1207
|
-
this._settlers.push({ resolve: resolve2, reject });
|
|
1208
|
-
});
|
|
1209
|
-
}
|
|
1210
|
-
};
|
|
512
|
+
var nullLog2 = new NullLog2();
|
|
1211
513
|
|
|
1212
514
|
// src/worker-utils/lib/worker-api/get-worker-url.ts
|
|
1213
515
|
var warnedWorkerVersionFallbacks = /* @__PURE__ */ new Set();
|
|
1214
|
-
function getWorkerName(worker) {
|
|
1215
|
-
const warning = worker.version !== VERSION2 ? ` (worker-utils@${VERSION2})` : "";
|
|
1216
|
-
return `${worker.name}@${worker.version}${warning}`;
|
|
1217
|
-
}
|
|
1218
516
|
function getCustomWorkerURL(worker, options = {}) {
|
|
1219
517
|
var _a, _b;
|
|
1220
518
|
const workerFile = isBrowser2 ? worker.workerFile || `${worker.id}-worker.js` : worker.workerNode || `${worker.id}-worker-node.js`;
|
|
@@ -1244,11 +542,11 @@ function getWorkerURL(worker, options = {}) {
|
|
|
1244
542
|
}
|
|
1245
543
|
function getDefaultWorkerURL(worker, warn = false) {
|
|
1246
544
|
const workerFile = isBrowser2 ? worker.workerFile || `${worker.id}-worker.js` : worker.workerNode || `${worker.id}-worker-node.js`;
|
|
1247
|
-
let
|
|
1248
|
-
if (
|
|
1249
|
-
|
|
545
|
+
let version3 = worker.version;
|
|
546
|
+
if (version3 === "latest") {
|
|
547
|
+
version3 = NPM_TAG;
|
|
1250
548
|
}
|
|
1251
|
-
const versionTag =
|
|
549
|
+
const versionTag = version3 ? `@${version3}` : "";
|
|
1252
550
|
const url = `https://unpkg.com/@loaders.gl/${worker.module}${versionTag}/dist/${workerFile}`;
|
|
1253
551
|
if (warn) {
|
|
1254
552
|
warnIfUsingNpmTagFallback(worker, url);
|
|
@@ -1264,417 +562,373 @@ function warnIfUsingNpmTagFallback(worker, url) {
|
|
|
1264
562
|
return;
|
|
1265
563
|
}
|
|
1266
564
|
warnedWorkerVersionFallbacks.add(workerId);
|
|
1267
|
-
|
|
565
|
+
log2.warn(
|
|
1268
566
|
`loaders.gl: ${worker.name} loader worker version is "latest" because __VERSION__ was not injected. Fetching ${url} from CDN.`
|
|
1269
|
-
);
|
|
567
|
+
)();
|
|
1270
568
|
}
|
|
1271
569
|
|
|
1272
|
-
// src/worker-utils/lib/worker-api/
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
}
|
|
1277
|
-
const workerOptions = options == null ? void 0 : options[worker.id];
|
|
1278
|
-
return Boolean(
|
|
1279
|
-
(worker.worker || worker.loadWorker || (workerOptions == null ? void 0 : workerOptions.workerUrl)) && (options == null ? void 0 : options.worker)
|
|
1280
|
-
);
|
|
1281
|
-
}
|
|
1282
|
-
function canProcessOnWorkerInBatches(worker, options = {}) {
|
|
1283
|
-
if (!canProcessOnWorker(worker, options)) return false;
|
|
1284
|
-
if (options.workerInBatches !== void 0) return options.workerInBatches;
|
|
1285
|
-
return Boolean(
|
|
1286
|
-
worker.workerInBatches && !options.source && !getConfiguredWorkerURL(worker, options)
|
|
1287
|
-
);
|
|
570
|
+
// src/worker-utils/lib/worker-api/task-runtime.ts
|
|
571
|
+
var import_tasks = require("@math.gl/tasks");
|
|
572
|
+
function normalizeTaskProgress(progress) {
|
|
573
|
+
return { ...progress, phase: progress.phase ?? "process", unit: progress.unit ?? "items" };
|
|
1288
574
|
}
|
|
1289
|
-
async function
|
|
575
|
+
async function isWorkerThread() {
|
|
1290
576
|
var _a;
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
const job = await workerPool.startJob(
|
|
1297
|
-
jobName,
|
|
1298
|
-
// eslint-disable-next-line
|
|
1299
|
-
onMessage.bind(null, context, options),
|
|
1300
|
-
void 0,
|
|
1301
|
-
options.signal
|
|
1302
|
-
);
|
|
1303
|
-
try {
|
|
1304
|
-
if ((_a = options.signal) == null ? void 0 : _a.aborted) job.abort(getAbortReason(options.signal));
|
|
1305
|
-
const { signal: _signal, onProgress: _onProgress, ...workerOptions } = options;
|
|
1306
|
-
const transferableOptions = getTransferListForWriter(workerOptions);
|
|
1307
|
-
const transferableContext = getTransferListForWriter(jobContext);
|
|
1308
|
-
if (job.isRunning) {
|
|
1309
|
-
job.postMessage("process", {
|
|
1310
|
-
input: data,
|
|
1311
|
-
options: transferableOptions,
|
|
1312
|
-
context: transferableContext
|
|
1313
|
-
});
|
|
1314
|
-
}
|
|
1315
|
-
const result = await job.result;
|
|
1316
|
-
return result.result;
|
|
1317
|
-
} catch (error) {
|
|
1318
|
-
job.abort(error);
|
|
1319
|
-
throw error;
|
|
577
|
+
if (typeof self !== "undefined" && typeof document === "undefined" && typeof self.postMessage === "function")
|
|
578
|
+
return true;
|
|
579
|
+
if (typeof process !== "undefined" && ((_a = process.versions) == null ? void 0 : _a.node)) {
|
|
580
|
+
const { isMainThread } = await Promise.resolve().then(() => (init_worker_threads_browser(), worker_threads_browser_exports));
|
|
581
|
+
return !isMainThread;
|
|
1320
582
|
}
|
|
583
|
+
return false;
|
|
1321
584
|
}
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
const batchJobFailed = new Error("Worker batch job failed");
|
|
1337
|
-
const closeJobInput = () => {
|
|
1338
|
-
if (!inputFinished && !inputCleanupRequested) {
|
|
1339
|
-
inputCleanupRequested = true;
|
|
1340
|
-
closeInputIterator(inputIterator);
|
|
1341
|
-
}
|
|
1342
|
-
};
|
|
1343
|
-
const finishOutput = () => {
|
|
1344
|
-
if (!outputFinished) {
|
|
1345
|
-
outputFinished = true;
|
|
1346
|
-
outputBatches.close();
|
|
1347
|
-
}
|
|
1348
|
-
};
|
|
1349
|
-
const failOutput = (_error) => {
|
|
1350
|
-
if (!outputFinished) {
|
|
1351
|
-
outputFinished = true;
|
|
1352
|
-
outputBatches.enqueue(batchJobFailed);
|
|
1353
|
-
outputBatches.close();
|
|
1354
|
-
}
|
|
1355
|
-
};
|
|
1356
|
-
const job = await workerPool.startJob(
|
|
1357
|
-
options.jobName || worker.name,
|
|
1358
|
-
(activeJob, type, payload) => {
|
|
1359
|
-
switch (type) {
|
|
1360
|
-
case "progress":
|
|
1361
|
-
reportProgress(activeJob, options, payload);
|
|
1362
|
-
break;
|
|
1363
|
-
case "input-request":
|
|
1364
|
-
inputRequest = inputRequest.then(async () => {
|
|
1365
|
-
if (!activeJob.isRunning) return;
|
|
1366
|
-
const nextBatch = await inputIterator.next();
|
|
1367
|
-
if (!activeJob.isRunning) {
|
|
1368
|
-
return;
|
|
1369
|
-
}
|
|
1370
|
-
if (nextBatch.done) {
|
|
1371
|
-
inputFinished = true;
|
|
1372
|
-
activeJob.postMessage("input-done", {});
|
|
1373
|
-
} else {
|
|
1374
|
-
activeJob.postMessage("input-batch", { input: nextBatch.value });
|
|
1375
|
-
}
|
|
1376
|
-
}).catch((error) => activeJob.abort(error));
|
|
1377
|
-
break;
|
|
1378
|
-
case "output-batch":
|
|
1379
|
-
outputBatches.push(payload.result);
|
|
1380
|
-
break;
|
|
1381
|
-
case "done":
|
|
1382
|
-
activeJob.done(payload);
|
|
1383
|
-
finishOutput();
|
|
1384
|
-
break;
|
|
1385
|
-
case "error": {
|
|
1386
|
-
const error = new Error(payload.error || "Worker batch processing failed");
|
|
1387
|
-
activeJob.error(error);
|
|
1388
|
-
failOutput(error);
|
|
1389
|
-
break;
|
|
1390
|
-
}
|
|
1391
|
-
case "process":
|
|
1392
|
-
void onMessage(context, options, activeJob, type, payload);
|
|
1393
|
-
break;
|
|
1394
|
-
default: {
|
|
1395
|
-
const error = new Error(`Unexpected worker batch message: ${type}`);
|
|
1396
|
-
activeJob.error(error);
|
|
1397
|
-
failOutput(error);
|
|
1398
|
-
break;
|
|
1399
|
-
}
|
|
1400
|
-
}
|
|
1401
|
-
},
|
|
1402
|
-
void 0,
|
|
1403
|
-
options.signal
|
|
1404
|
-
).catch((error) => {
|
|
1405
|
-
closeJobInput();
|
|
1406
|
-
throw error;
|
|
1407
|
-
});
|
|
1408
|
-
void job.result.catch((error) => {
|
|
1409
|
-
failOutput(error);
|
|
1410
|
-
closeJobInput();
|
|
1411
|
-
});
|
|
1412
|
-
try {
|
|
1413
|
-
const { signal: _signal, onProgress: _onProgress, ...workerOptions } = options;
|
|
1414
|
-
if (job.isRunning) {
|
|
1415
|
-
job.postMessage("process-in-batches", {
|
|
1416
|
-
options: getTransferListForWriter(workerOptions),
|
|
1417
|
-
context: getTransferListForWriter(jobContext)
|
|
1418
|
-
});
|
|
1419
|
-
}
|
|
1420
|
-
try {
|
|
1421
|
-
for await (const outputBatch of outputBatches) {
|
|
1422
|
-
yield outputBatch;
|
|
1423
|
-
if (job.isRunning) {
|
|
1424
|
-
job.postMessage("output-ack", {});
|
|
1425
|
-
}
|
|
1426
|
-
}
|
|
1427
|
-
} catch (error) {
|
|
1428
|
-
if (error === batchJobFailed) {
|
|
1429
|
-
await job.result;
|
|
1430
|
-
}
|
|
1431
|
-
throw error;
|
|
1432
|
-
}
|
|
1433
|
-
await job.result;
|
|
1434
|
-
} finally {
|
|
1435
|
-
if (job.isRunning) {
|
|
1436
|
-
job.abort(createAbortError2("Worker batch iterator was closed"));
|
|
585
|
+
var initializeTaskWorker = import_tasks.initializeTaskWorker;
|
|
586
|
+
|
|
587
|
+
// src/worker-utils/lib/worker-utils/get-transfer-list.ts
|
|
588
|
+
function getTransferList(object, recursive = true, transfers) {
|
|
589
|
+
const transfersSet = transfers || /* @__PURE__ */ new Set();
|
|
590
|
+
if (!object) {
|
|
591
|
+
} else if (isTransferable(object)) {
|
|
592
|
+
transfersSet.add(object);
|
|
593
|
+
} else if (isTransferable(object.buffer)) {
|
|
594
|
+
transfersSet.add(object.buffer);
|
|
595
|
+
} else if (ArrayBuffer.isView(object)) {
|
|
596
|
+
} else if (recursive && typeof object === "object") {
|
|
597
|
+
for (const key in object) {
|
|
598
|
+
getTransferList(object[key], recursive, transfersSet);
|
|
1437
599
|
}
|
|
1438
|
-
closeJobInput();
|
|
1439
600
|
}
|
|
601
|
+
return transfers === void 0 ? Array.from(transfersSet) : [];
|
|
602
|
+
}
|
|
603
|
+
function isTransferable(object) {
|
|
604
|
+
if (!object) {
|
|
605
|
+
return false;
|
|
606
|
+
}
|
|
607
|
+
if (object instanceof ArrayBuffer) {
|
|
608
|
+
return true;
|
|
609
|
+
}
|
|
610
|
+
if (typeof MessagePort !== "undefined" && object instanceof MessagePort) {
|
|
611
|
+
return true;
|
|
612
|
+
}
|
|
613
|
+
if (typeof ImageBitmap !== "undefined" && object instanceof ImageBitmap) {
|
|
614
|
+
return true;
|
|
615
|
+
}
|
|
616
|
+
if (typeof OffscreenCanvas !== "undefined" && object instanceof OffscreenCanvas) {
|
|
617
|
+
return true;
|
|
618
|
+
}
|
|
619
|
+
return false;
|
|
1440
620
|
}
|
|
1441
|
-
function
|
|
1442
|
-
if (
|
|
1443
|
-
return;
|
|
621
|
+
function getTransferListForWriter(object) {
|
|
622
|
+
if (object === null) {
|
|
623
|
+
return {};
|
|
1444
624
|
}
|
|
1445
|
-
|
|
625
|
+
const clone = Object.assign({}, object);
|
|
626
|
+
Object.keys(clone).forEach((key) => {
|
|
627
|
+
if (object[key] !== null && typeof object[key] === "object" && !ArrayBuffer.isView(object[key]) && !(object[key] instanceof Array)) {
|
|
628
|
+
clone[key] = getTransferListForWriter(object[key]);
|
|
629
|
+
} else if (typeof clone[key] === "function" || clone[key] instanceof RegExp) {
|
|
630
|
+
clone[key] = {};
|
|
631
|
+
} else {
|
|
632
|
+
clone[key] = object[key];
|
|
633
|
+
}
|
|
634
|
+
});
|
|
635
|
+
return clone;
|
|
1446
636
|
}
|
|
1447
|
-
|
|
1448
|
-
|
|
637
|
+
|
|
638
|
+
// src/worker-utils/lib/worker-api/process-on-worker.ts
|
|
639
|
+
var runners = /* @__PURE__ */ new WeakMap();
|
|
640
|
+
var activeRunners = /* @__PURE__ */ new Set();
|
|
641
|
+
var moduleWorkerUrls = /* @__PURE__ */ new Map();
|
|
642
|
+
function canProcessOnWorker(worker, options = {}) {
|
|
643
|
+
const supported = isBrowser2 ? typeof Worker !== "undefined" : Boolean(options._nodeWorkers);
|
|
644
|
+
return Boolean(
|
|
645
|
+
supported && options.worker && (worker.worker || worker.loadWorker || getConfiguredWorkerURL(worker, options))
|
|
646
|
+
);
|
|
1449
647
|
}
|
|
1450
|
-
function
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
return
|
|
648
|
+
function canProcessOnWorkerInBatches(worker, options = {}) {
|
|
649
|
+
if (!canProcessOnWorker(worker, options)) return false;
|
|
650
|
+
if (options.workerInBatches !== void 0) return options.workerInBatches;
|
|
651
|
+
return Boolean(worker.workerInBatches && !getConfiguredWorkerURL(worker, options));
|
|
1454
652
|
}
|
|
1455
|
-
function
|
|
1456
|
-
|
|
1457
|
-
|
|
653
|
+
async function processOnWorker(worker, data, options = {}, context = {}, jobContext = {}) {
|
|
654
|
+
const session = await openSession(worker, options, context, jobContext);
|
|
655
|
+
try {
|
|
656
|
+
const result = await session.handle.runTask(
|
|
657
|
+
{ value: data },
|
|
658
|
+
{
|
|
659
|
+
...getControls(options),
|
|
660
|
+
options: getParserOptions(options)
|
|
661
|
+
}
|
|
662
|
+
);
|
|
663
|
+
return result.value;
|
|
664
|
+
} finally {
|
|
665
|
+
await session.close();
|
|
1458
666
|
}
|
|
1459
|
-
return (async function* iterateSynchronously() {
|
|
1460
|
-
yield* input;
|
|
1461
|
-
})();
|
|
1462
667
|
}
|
|
1463
|
-
function
|
|
668
|
+
async function* processOnWorkerInBatches(worker, input, options = {}, context = {}, jobContext = {}) {
|
|
1464
669
|
var _a;
|
|
670
|
+
const taskInput = wrapInput(input);
|
|
671
|
+
let session;
|
|
1465
672
|
try {
|
|
1466
|
-
|
|
1467
|
-
|
|
673
|
+
session = await openSession(worker, options, context, jobContext);
|
|
674
|
+
for await (const result of session.handle.runTaskInBatches(taskInput, {
|
|
675
|
+
...getControls(options),
|
|
676
|
+
options: getParserOptions(options)
|
|
677
|
+
}))
|
|
678
|
+
yield result.value;
|
|
679
|
+
} finally {
|
|
680
|
+
const closingInput = (_a = taskInput.return) == null ? void 0 : _a.call(taskInput);
|
|
681
|
+
void (closingInput == null ? void 0 : closingInput.catch(() => {
|
|
682
|
+
}));
|
|
683
|
+
await (session == null ? void 0 : session.close());
|
|
1468
684
|
}
|
|
1469
685
|
}
|
|
1470
|
-
function
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
686
|
+
function getTask(worker, options) {
|
|
687
|
+
var _a;
|
|
688
|
+
if (options.source || ((_a = options.core) == null ? void 0 : _a.source))
|
|
689
|
+
throw new Error(
|
|
690
|
+
"Inline legacy worker source is unsupported; use a TaskRunner worker URL or factory"
|
|
691
|
+
);
|
|
692
|
+
const create = !getCustomWorkerURL(worker, options) && isBrowser2 ? worker.loadWorker : void 0;
|
|
693
|
+
const url = getWorkerURL(worker, options);
|
|
694
|
+
return {
|
|
695
|
+
id: `${worker.module}:${worker.id}`,
|
|
696
|
+
initialize: (state) => state,
|
|
697
|
+
worker: {
|
|
698
|
+
...create ? { create: () => create() ?? createModuleWorker(url) } : { url },
|
|
699
|
+
capabilities: { atomic: true, streaming: true }
|
|
700
|
+
}
|
|
701
|
+
};
|
|
702
|
+
}
|
|
703
|
+
function getControls(options) {
|
|
704
|
+
return {
|
|
705
|
+
execution: "worker",
|
|
706
|
+
signal: options.signal,
|
|
707
|
+
inputOwnership: options.inputOwnership ?? "transfer",
|
|
708
|
+
outputOwnership: options.outputOwnership ?? "transfer",
|
|
709
|
+
onProgress: options.onProgress ? (progress) => {
|
|
710
|
+
var _a;
|
|
711
|
+
return (_a = options.onProgress) == null ? void 0 : _a.call(options, normalizeTaskProgress(progress));
|
|
712
|
+
} : void 0
|
|
713
|
+
};
|
|
714
|
+
}
|
|
715
|
+
function getParserOptions(options) {
|
|
716
|
+
const { signal, onProgress, parserOptions, ...workerOptions } = options;
|
|
717
|
+
return getTransferListForWriter(parserOptions ?? workerOptions);
|
|
718
|
+
}
|
|
719
|
+
async function openSession(worker, options, context, jobContext) {
|
|
720
|
+
var _a, _b;
|
|
721
|
+
(_a = options.signal) == null ? void 0 : _a.throwIfAborted();
|
|
722
|
+
const task = getTask(worker, options);
|
|
723
|
+
let state = runners.get(worker);
|
|
724
|
+
if (!state) {
|
|
725
|
+
state = {
|
|
726
|
+
runner: new import_tasks2.TaskRunner({
|
|
727
|
+
maxConcurrency: isMobile ? options.maxMobileConcurrency ?? 1 : options.maxConcurrency ?? 3
|
|
728
|
+
}),
|
|
729
|
+
requests: 0
|
|
1484
730
|
};
|
|
731
|
+
runners.set(worker, state);
|
|
1485
732
|
}
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
733
|
+
const runnerState = state;
|
|
734
|
+
const channel = context.process ? new MessageChannel() : void 0;
|
|
735
|
+
const callbackController = new AbortController();
|
|
736
|
+
let channelClosed = false;
|
|
737
|
+
const abortCallbacks = () => {
|
|
738
|
+
var _a2;
|
|
739
|
+
return callbackController.abort((_a2 = options.signal) == null ? void 0 : _a2.reason);
|
|
740
|
+
};
|
|
741
|
+
(_b = options.signal) == null ? void 0 : _b.addEventListener("abort", abortCallbacks, { once: true });
|
|
742
|
+
const closeChannel = () => {
|
|
743
|
+
var _a2;
|
|
744
|
+
channelClosed = true;
|
|
745
|
+
(_a2 = options.signal) == null ? void 0 : _a2.removeEventListener("abort", abortCallbacks);
|
|
746
|
+
callbackController.abort();
|
|
747
|
+
channel == null ? void 0 : channel.port1.close();
|
|
748
|
+
channel == null ? void 0 : channel.port2.close();
|
|
749
|
+
};
|
|
750
|
+
if (channel) {
|
|
751
|
+
channel.port1.onmessage = async ({ data }) => {
|
|
1501
752
|
try {
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
payload.context || {}
|
|
753
|
+
const value = await context.process(
|
|
754
|
+
data.input,
|
|
755
|
+
data.options,
|
|
756
|
+
{
|
|
757
|
+
signal: callbackController.signal,
|
|
758
|
+
throwIfAborted: () => callbackController.signal.throwIfAborted()
|
|
759
|
+
},
|
|
760
|
+
data.context
|
|
1511
761
|
);
|
|
1512
|
-
|
|
762
|
+
if (!channelClosed && !callbackController.signal.aborted)
|
|
763
|
+
channel.port1.postMessage({ identifier: data.identifier, value }, getTransferList(value));
|
|
1513
764
|
} catch (error) {
|
|
1514
|
-
|
|
1515
|
-
|
|
765
|
+
if (channelClosed || callbackController.signal.aborted) return;
|
|
766
|
+
channel.port1.postMessage({
|
|
767
|
+
identifier: data.identifier,
|
|
768
|
+
error: {
|
|
769
|
+
name: error instanceof Error ? error.name : "Error",
|
|
770
|
+
message: error instanceof Error ? error.message : String(error)
|
|
771
|
+
}
|
|
772
|
+
});
|
|
1516
773
|
}
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
774
|
+
};
|
|
775
|
+
channel.port1.start();
|
|
776
|
+
}
|
|
777
|
+
runnerState.requests++;
|
|
778
|
+
activeRunners.add(runnerState);
|
|
779
|
+
let released = false;
|
|
780
|
+
const releaseRunner = () => {
|
|
781
|
+
if (released) return;
|
|
782
|
+
released = true;
|
|
783
|
+
runnerState.requests--;
|
|
784
|
+
if (!runnerState.requests) activeRunners.delete(runnerState);
|
|
785
|
+
};
|
|
786
|
+
let handle;
|
|
1525
787
|
try {
|
|
1526
|
-
|
|
788
|
+
handle = await runnerState.runner.initializeTask(
|
|
789
|
+
task,
|
|
790
|
+
{
|
|
791
|
+
context: structuredClone(jobContext),
|
|
792
|
+
...channel ? { port: channel.port2 } : {}
|
|
793
|
+
},
|
|
794
|
+
// The callback port is setup state, independent of the caller's payload ownership.
|
|
795
|
+
{ ...getControls(options), inputOwnership: "transfer" }
|
|
796
|
+
);
|
|
1527
797
|
} catch (error) {
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
// src/worker-utils/lib/worker-api/create-worker.ts
|
|
1533
|
-
var requestId = 0;
|
|
1534
|
-
var activeInputBatches = null;
|
|
1535
|
-
var activeOutputAcknowledgements = null;
|
|
1536
|
-
async function createWorker(process2, processInBatches) {
|
|
1537
|
-
if (!await WorkerBody.inWorkerThread()) {
|
|
1538
|
-
return;
|
|
798
|
+
releaseRunner();
|
|
799
|
+
closeChannel();
|
|
800
|
+
throw error;
|
|
1539
801
|
}
|
|
1540
|
-
|
|
1541
|
-
|
|
802
|
+
return {
|
|
803
|
+
handle,
|
|
804
|
+
/** Releases the worker and callback channel on success, failure, and early stream return. */
|
|
805
|
+
async close() {
|
|
806
|
+
try {
|
|
807
|
+
await handle.close();
|
|
808
|
+
} finally {
|
|
809
|
+
closeChannel();
|
|
810
|
+
releaseRunner();
|
|
811
|
+
}
|
|
812
|
+
}
|
|
1542
813
|
};
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
if (!processInBatches) {
|
|
1566
|
-
throw new Error("Worker does not support batched processing");
|
|
1567
|
-
}
|
|
1568
|
-
const inputBatches = new AsyncQueue();
|
|
1569
|
-
const outputAcknowledgements = new AsyncQueue();
|
|
1570
|
-
activeInputBatches = inputBatches;
|
|
1571
|
-
activeOutputAcknowledgements = outputAcknowledgements;
|
|
1572
|
-
try {
|
|
1573
|
-
const resultIterator = processInBatches(
|
|
1574
|
-
createDemandDrivenIterator(inputBatches),
|
|
1575
|
-
payload.options || {},
|
|
1576
|
-
jobContext,
|
|
1577
|
-
payload.context || {}
|
|
1578
|
-
);
|
|
1579
|
-
for await (const batch of resultIterator) {
|
|
1580
|
-
await WorkerBody.postMessage("output-batch", { result: batch });
|
|
1581
|
-
await outputAcknowledgements.next();
|
|
1582
|
-
}
|
|
1583
|
-
reporter == null ? void 0 : reporter.finish();
|
|
1584
|
-
await WorkerBody.postMessage("done", {});
|
|
1585
|
-
} finally {
|
|
1586
|
-
activeInputBatches = null;
|
|
1587
|
-
activeOutputAcknowledgements = null;
|
|
1588
|
-
}
|
|
1589
|
-
break;
|
|
1590
|
-
case "input-batch":
|
|
1591
|
-
if (!activeInputBatches) {
|
|
1592
|
-
throw new Error("Worker has no active batched processing session");
|
|
1593
|
-
}
|
|
1594
|
-
activeInputBatches.push(payload.input);
|
|
1595
|
-
break;
|
|
1596
|
-
case "input-done":
|
|
1597
|
-
if (!activeInputBatches) {
|
|
1598
|
-
throw new Error("Worker has no active batched processing session");
|
|
1599
|
-
}
|
|
1600
|
-
activeInputBatches.close();
|
|
1601
|
-
break;
|
|
1602
|
-
case "output-ack":
|
|
1603
|
-
if (!activeOutputAcknowledgements) {
|
|
1604
|
-
throw new Error("Worker has no active batched processing session");
|
|
1605
|
-
}
|
|
1606
|
-
activeOutputAcknowledgements.push(void 0);
|
|
1607
|
-
break;
|
|
1608
|
-
default:
|
|
814
|
+
}
|
|
815
|
+
function wrapInput(input) {
|
|
816
|
+
const iterator = Symbol.asyncIterator in input ? input[Symbol.asyncIterator]() : input[Symbol.iterator]();
|
|
817
|
+
let inputClosed = false;
|
|
818
|
+
return {
|
|
819
|
+
[Symbol.asyncIterator]() {
|
|
820
|
+
return this;
|
|
821
|
+
},
|
|
822
|
+
async next() {
|
|
823
|
+
if (inputClosed) return { done: true, value: void 0 };
|
|
824
|
+
const next = await iterator.next();
|
|
825
|
+
if (next.done || inputClosed) {
|
|
826
|
+
inputClosed = true;
|
|
827
|
+
return { done: true, value: void 0 };
|
|
828
|
+
}
|
|
829
|
+
return { done: false, value: { value: next.value } };
|
|
830
|
+
},
|
|
831
|
+
async return() {
|
|
832
|
+
var _a;
|
|
833
|
+
if (!inputClosed) {
|
|
834
|
+
inputClosed = true;
|
|
835
|
+
await ((_a = iterator.return) == null ? void 0 : _a.call(iterator));
|
|
1609
836
|
}
|
|
1610
|
-
|
|
1611
|
-
reporter == null ? void 0 : reporter.finish();
|
|
1612
|
-
const message = error instanceof Error ? error.message : "";
|
|
1613
|
-
WorkerBody.postMessage("error", { error: message });
|
|
837
|
+
return { done: true, value: void 0 };
|
|
1614
838
|
}
|
|
1615
839
|
};
|
|
1616
840
|
}
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
841
|
+
function createModuleWorker(url) {
|
|
842
|
+
var _a;
|
|
843
|
+
const resolved = new URL(url, ((_a = globalThis.document) == null ? void 0 : _a.baseURI) ?? globalThis.location.href);
|
|
844
|
+
let workerUrl = resolved.href;
|
|
845
|
+
if (/^https?:$/.test(resolved.protocol) && resolved.origin !== globalThis.location.origin) {
|
|
846
|
+
let shimUrl = moduleWorkerUrls.get(resolved.href);
|
|
847
|
+
if (!shimUrl) {
|
|
848
|
+
shimUrl = URL.createObjectURL(
|
|
849
|
+
new Blob([`import ${JSON.stringify(resolved.href)};`], { type: "application/javascript" })
|
|
850
|
+
);
|
|
851
|
+
moduleWorkerUrls.set(resolved.href, shimUrl);
|
|
1623
852
|
}
|
|
1624
|
-
|
|
853
|
+
workerUrl = shimUrl;
|
|
1625
854
|
}
|
|
855
|
+
return new Worker(workerUrl, { type: "module" });
|
|
1626
856
|
}
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
return;
|
|
1633
|
-
}
|
|
1634
|
-
switch (type) {
|
|
1635
|
-
case "done":
|
|
1636
|
-
WorkerBody.removeEventListener(onMessage2);
|
|
1637
|
-
resolve2(payload2.result);
|
|
1638
|
-
break;
|
|
1639
|
-
case "error":
|
|
1640
|
-
WorkerBody.removeEventListener(onMessage2);
|
|
1641
|
-
reject(payload2.error);
|
|
1642
|
-
break;
|
|
1643
|
-
default:
|
|
1644
|
-
}
|
|
1645
|
-
};
|
|
1646
|
-
WorkerBody.addEventListener(onMessage2);
|
|
1647
|
-
const payload = { id, input: arrayBuffer, options, context: jobContext };
|
|
1648
|
-
WorkerBody.postMessage("process", payload);
|
|
1649
|
-
});
|
|
857
|
+
|
|
858
|
+
// src/worker-utils/lib/worker-api/create-worker.ts
|
|
859
|
+
async function createWorker(process2, processInBatches) {
|
|
860
|
+
if (!await isWorkerThread()) return;
|
|
861
|
+
await initializeTaskWorker(createWorkerTask(process2, processInBatches));
|
|
1650
862
|
}
|
|
1651
|
-
function
|
|
1652
|
-
let pending;
|
|
1653
|
-
let finished = false;
|
|
1654
|
-
let scheduled = false;
|
|
1655
|
-
const flush = () => {
|
|
1656
|
-
scheduled = false;
|
|
1657
|
-
if (pending) {
|
|
1658
|
-
WorkerBody.postMessage("progress", { progress: pending });
|
|
1659
|
-
pending = void 0;
|
|
1660
|
-
}
|
|
1661
|
-
};
|
|
863
|
+
function createWorkerTask(process2, processInBatches) {
|
|
1662
864
|
return {
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
if (!scheduled) {
|
|
1669
|
-
scheduled = true;
|
|
1670
|
-
setTimeout(flush, 0);
|
|
1671
|
-
}
|
|
865
|
+
id: "loaders.gl",
|
|
866
|
+
initialize: (state) => state,
|
|
867
|
+
destroy: (state) => {
|
|
868
|
+
var _a;
|
|
869
|
+
return (_a = state.port) == null ? void 0 : _a.close();
|
|
1672
870
|
},
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
871
|
+
process: async ({ value }, options, context) => {
|
|
872
|
+
if (!process2) throw new Error("Worker does not support atomic processing");
|
|
873
|
+
return { value: await process2(value, options, createContext(context), context.state.context) };
|
|
874
|
+
},
|
|
875
|
+
...processInBatches ? {
|
|
876
|
+
processInBatches: async function* (inputs, options, context) {
|
|
877
|
+
async function* values() {
|
|
878
|
+
for await (const input of inputs) yield input.value;
|
|
879
|
+
}
|
|
880
|
+
for await (const value of processInBatches(
|
|
881
|
+
values(),
|
|
882
|
+
options,
|
|
883
|
+
createContext(context),
|
|
884
|
+
context.state.context
|
|
885
|
+
)) {
|
|
886
|
+
yield { value };
|
|
887
|
+
}
|
|
888
|
+
}
|
|
889
|
+
} : {}
|
|
890
|
+
};
|
|
891
|
+
}
|
|
892
|
+
function createContext(context) {
|
|
893
|
+
let requestIdentifier = 0;
|
|
894
|
+
const port = context.state.port;
|
|
895
|
+
return {
|
|
896
|
+
signal: context.signal,
|
|
897
|
+
throwIfAborted: () => context.throwIfAborted(),
|
|
898
|
+
reportProgress: (progress) => context.reportProgress(normalizeTaskProgress(progress)),
|
|
899
|
+
process: port ? (input, options = {}, jobContext = {}) => {
|
|
900
|
+
context.throwIfAborted();
|
|
901
|
+
const identifier = ++requestIdentifier;
|
|
902
|
+
return new Promise((resolve2, reject) => {
|
|
903
|
+
const onMessage = (event) => {
|
|
904
|
+
if (event.data.identifier !== identifier) return;
|
|
905
|
+
cleanup();
|
|
906
|
+
if (event.data.error) {
|
|
907
|
+
const error = new Error(event.data.error.message);
|
|
908
|
+
error.name = event.data.error.name;
|
|
909
|
+
reject(error);
|
|
910
|
+
} else resolve2(event.data.value);
|
|
911
|
+
};
|
|
912
|
+
const onAbort = () => {
|
|
913
|
+
cleanup();
|
|
914
|
+
reject(context.signal.reason);
|
|
915
|
+
};
|
|
916
|
+
const cleanup = () => {
|
|
917
|
+
port.removeEventListener("message", onMessage);
|
|
918
|
+
context.signal.removeEventListener("abort", onAbort);
|
|
919
|
+
};
|
|
920
|
+
port.addEventListener("message", onMessage);
|
|
921
|
+
context.signal.addEventListener("abort", onAbort, { once: true });
|
|
922
|
+
port.start();
|
|
923
|
+
try {
|
|
924
|
+
const request = { identifier, input, options, context: jobContext };
|
|
925
|
+
port.postMessage(request, getTransferList(request));
|
|
926
|
+
} catch (error) {
|
|
927
|
+
cleanup();
|
|
928
|
+
reject(error);
|
|
929
|
+
}
|
|
930
|
+
});
|
|
931
|
+
} : void 0
|
|
1678
932
|
};
|
|
1679
933
|
}
|
|
1680
934
|
|
|
@@ -1725,13 +979,13 @@ function createWorkerCoreApi() {
|
|
|
1725
979
|
loadInBatches: unavailable("loadInBatches")
|
|
1726
980
|
};
|
|
1727
981
|
}
|
|
1728
|
-
function createParseOnMainThread(
|
|
982
|
+
function createParseOnMainThread(processOnMainThread) {
|
|
1729
983
|
return (arrayBuffer, loaders, options, context) => {
|
|
1730
|
-
if (!
|
|
984
|
+
if (!processOnMainThread) {
|
|
1731
985
|
throw new Error("Worker not set up to parse on main thread");
|
|
1732
986
|
}
|
|
1733
987
|
const parseArguments = getMainThreadParseArguments(loaders, options, context);
|
|
1734
|
-
return
|
|
988
|
+
return processOnMainThread(arrayBuffer, parseArguments.options, {
|
|
1735
989
|
...parseArguments.context,
|
|
1736
990
|
...Array.isArray(loaders) || loaders && isLoaderObject(loaders) ? {
|
|
1737
991
|
_loaderIsArray: Array.isArray(loaders),
|
|
@@ -1759,7 +1013,7 @@ function getSerializableLoaderContext(context) {
|
|
|
1759
1013
|
if (!context) {
|
|
1760
1014
|
return void 0;
|
|
1761
1015
|
}
|
|
1762
|
-
const { fetch: fetch2, loaders, coreApi, signal, reportProgress
|
|
1016
|
+
const { fetch: fetch2, loaders, coreApi, signal, reportProgress, _parse, _parseSync, _parseInBatches, ...serializableContext } = context;
|
|
1763
1017
|
return JSON.parse(JSON.stringify(serializableContext));
|
|
1764
1018
|
}
|
|
1765
1019
|
async function parseData({ loader, arrayBuffer, options, context }) {
|
|
@@ -1795,7 +1049,7 @@ function canParseWithWorker(loader, options) {
|
|
|
1795
1049
|
return false;
|
|
1796
1050
|
if ((_d = (_c = options == null ? void 0 : options.core) == null ? void 0 : _c.credentials) == null ? void 0 : _d.some((credential) => credential.type === "request" || "token" in credential && typeof credential.token === "function"))
|
|
1797
1051
|
return false;
|
|
1798
|
-
if (loader.id === "shapefile" &&
|
|
1052
|
+
if (loader.id === "shapefile" && typeof ((_e = options == null ? void 0 : options.core) == null ? void 0 : _e.fetch) === "function")
|
|
1799
1053
|
return false;
|
|
1800
1054
|
const workerOptions = getWorkerOptions(options);
|
|
1801
1055
|
const nodeWorkers = workerOptions._nodeWorkers;
|
|
@@ -1839,12 +1093,16 @@ async function parseWithWorker(loader, data, options, context, parseOnMainThread
|
|
|
1839
1093
|
signal: workerSignal,
|
|
1840
1094
|
onProgress: (options == null ? void 0 : options.onProgress) || (context == null ? void 0 : context.reportProgress)
|
|
1841
1095
|
}, {
|
|
1842
|
-
process: async (input, processOptions,
|
|
1096
|
+
process: async (input, processOptions, workerContext, parseContext) => {
|
|
1843
1097
|
if (!parseOnMainThread) {
|
|
1844
1098
|
throw new Error("Worker not set up to parse on main thread");
|
|
1845
1099
|
}
|
|
1846
1100
|
const { _loaderIds, _loaderIsArray, ...workerParseContext } = parseContext || {};
|
|
1847
|
-
const mainThreadContext = context || parseContext
|
|
1101
|
+
const mainThreadContext = context || parseContext || (workerContext == null ? void 0 : workerContext.signal) ? {
|
|
1102
|
+
...context,
|
|
1103
|
+
...workerParseContext,
|
|
1104
|
+
signal: (workerContext == null ? void 0 : workerContext.signal) ?? (context == null ? void 0 : context.signal)
|
|
1105
|
+
} : void 0;
|
|
1848
1106
|
return await callParseOnMainThread(parseOnMainThread, input, processOptions, mainThreadContext, resolveWorkerLoaders(loader, _loaderIds, _loaderIsArray, context, options));
|
|
1849
1107
|
}
|
|
1850
1108
|
}, getSerializableLoaderContext2(context));
|
|
@@ -1857,12 +1115,16 @@ async function* parseWithWorkerInBatches(loader, inputIterator, options, context
|
|
|
1857
1115
|
signal: workerSignal,
|
|
1858
1116
|
onProgress: (options == null ? void 0 : options.onProgress) || (context == null ? void 0 : context.reportProgress)
|
|
1859
1117
|
}, {
|
|
1860
|
-
process: async (input, processOptions,
|
|
1118
|
+
process: async (input, processOptions, workerContext, parseContext) => {
|
|
1861
1119
|
if (!parseOnMainThread) {
|
|
1862
1120
|
throw new Error("Worker not set up to parse on main thread");
|
|
1863
1121
|
}
|
|
1864
1122
|
const { _loaderIds, _loaderIsArray, ...workerParseContext } = parseContext || {};
|
|
1865
|
-
const mainThreadContext = context || parseContext
|
|
1123
|
+
const mainThreadContext = context || parseContext || (workerContext == null ? void 0 : workerContext.signal) ? {
|
|
1124
|
+
...context,
|
|
1125
|
+
...workerParseContext,
|
|
1126
|
+
signal: (workerContext == null ? void 0 : workerContext.signal) ?? (context == null ? void 0 : context.signal)
|
|
1127
|
+
} : void 0;
|
|
1866
1128
|
return await callParseOnMainThread(parseOnMainThread, input, processOptions, mainThreadContext, resolveWorkerLoaders(loader, _loaderIds, _loaderIsArray, context, options));
|
|
1867
1129
|
}
|
|
1868
1130
|
}, getSerializableLoaderContext2(context));
|
|
@@ -1916,13 +1178,19 @@ function resolveWorkerLoaders(loader, loaderIds, loaderIsArray, context, options
|
|
|
1916
1178
|
}
|
|
1917
1179
|
}
|
|
1918
1180
|
function getWorkerOptions(options = {}, loader) {
|
|
1919
|
-
var _a;
|
|
1181
|
+
var _a, _b;
|
|
1920
1182
|
const portableOptions = ((_a = loader == null ? void 0 : loader.serializeWorkerOptions) == null ? void 0 : _a.call(loader, options)) || options;
|
|
1921
1183
|
const optionsToSerialize = {
|
|
1922
1184
|
...portableOptions,
|
|
1923
1185
|
signal: void 0,
|
|
1924
1186
|
onProgress: void 0,
|
|
1925
|
-
...portableOptions.core ? {
|
|
1187
|
+
...portableOptions.core ? {
|
|
1188
|
+
core: {
|
|
1189
|
+
...portableOptions.core,
|
|
1190
|
+
authentications: void 0,
|
|
1191
|
+
log: isDisabledLog(portableOptions.core.log) ? null : void 0
|
|
1192
|
+
}
|
|
1193
|
+
} : {}
|
|
1926
1194
|
};
|
|
1927
1195
|
const serializedOptions = JSON.parse(JSON.stringify(optionsToSerialize, (_key, value) => {
|
|
1928
1196
|
if (typeof Headers !== "undefined" && value instanceof Headers)
|
|
@@ -1932,17 +1200,17 @@ function getWorkerOptions(options = {}, loader) {
|
|
|
1932
1200
|
return typeof value === "bigint" ? null : value;
|
|
1933
1201
|
}));
|
|
1934
1202
|
restoreBigIntOptions(optionsToSerialize, serializedOptions);
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
...serializedOptions
|
|
1938
|
-
};
|
|
1939
|
-
if (workerOptions.worker === "auto") {
|
|
1940
|
-
workerOptions.worker = true;
|
|
1203
|
+
if (((_b = serializedOptions.core) == null ? void 0 : _b.worker) === "auto") {
|
|
1204
|
+
serializedOptions.core.worker = true;
|
|
1941
1205
|
}
|
|
1942
1206
|
if (loader) {
|
|
1943
|
-
|
|
1207
|
+
serializedOptions._workerLoaderId = loader.id;
|
|
1944
1208
|
}
|
|
1945
|
-
return
|
|
1209
|
+
return {
|
|
1210
|
+
...serializedOptions,
|
|
1211
|
+
...serializedOptions.core,
|
|
1212
|
+
parserOptions: serializedOptions
|
|
1213
|
+
};
|
|
1946
1214
|
}
|
|
1947
1215
|
function restoreBigIntOptions(original, serialized) {
|
|
1948
1216
|
if (!serialized || typeof serialized !== "object")
|
|
@@ -1959,30 +1227,30 @@ function getSerializableLoaderContext2(context) {
|
|
|
1959
1227
|
if (!context) {
|
|
1960
1228
|
return {};
|
|
1961
1229
|
}
|
|
1962
|
-
const { fetch: fetch2, loaders, coreApi, signal, reportProgress
|
|
1230
|
+
const { fetch: fetch2, loaders, coreApi, signal, reportProgress, _parse, _parseSync, _parseInBatches, ...serializableContext } = context;
|
|
1963
1231
|
return JSON.parse(JSON.stringify(serializableContext));
|
|
1964
1232
|
}
|
|
1965
1233
|
function shouldParseCSVWithWorker(options) {
|
|
1966
1234
|
var _a, _b;
|
|
1967
1235
|
const csvOptions = options;
|
|
1968
|
-
return (((_a = csvOptions == null ? void 0 : csvOptions.csv) == null ? void 0 : _a.shape) ?? ((_b = csvOptions == null ? void 0 : csvOptions.core) == null ? void 0 : _b.shape)) === "arrow
|
|
1236
|
+
return (((_a = csvOptions == null ? void 0 : csvOptions.csv) == null ? void 0 : _a.shape) ?? ((_b = csvOptions == null ? void 0 : csvOptions.core) == null ? void 0 : _b.shape)) === "arrow";
|
|
1969
1237
|
}
|
|
1970
1238
|
function isLoaderWithWorkerResultDeserializer(loader) {
|
|
1971
1239
|
return typeof loader.deserializeWorkerResult === "function";
|
|
1972
1240
|
}
|
|
1241
|
+
function isDisabledLog(logger) {
|
|
1242
|
+
return logger === null || logger instanceof NullLog;
|
|
1243
|
+
}
|
|
1973
1244
|
|
|
1974
1245
|
// dist/loader-utils/lib/worker-loader-utils/encode-with-worker.js
|
|
1975
1246
|
function canEncodeWithWorker(writer, options) {
|
|
1976
1247
|
var _a, _b;
|
|
1977
|
-
if (!WorkerFarm.isSupported()) {
|
|
1978
|
-
return false;
|
|
1979
|
-
}
|
|
1980
1248
|
const nodeWorkers = (options == null ? void 0 : options._nodeWorkers) ?? ((_a = options == null ? void 0 : options.core) == null ? void 0 : _a._nodeWorkers);
|
|
1981
1249
|
const useWorkers = (options == null ? void 0 : options.worker) ?? ((_b = options == null ? void 0 : options.core) == null ? void 0 : _b.worker);
|
|
1982
1250
|
if (!isBrowser && !nodeWorkers) {
|
|
1983
1251
|
return false;
|
|
1984
1252
|
}
|
|
1985
|
-
return
|
|
1253
|
+
return canProcessOnWorker({ ...writer, options: writer.options || {} }, { worker: Boolean(useWorkers), _nodeWorkers: Boolean(nodeWorkers) });
|
|
1986
1254
|
}
|
|
1987
1255
|
|
|
1988
1256
|
// dist/loader-utils/lib/binary-utils/get-first-characters.js
|
|
@@ -2507,7 +1775,7 @@ var STAT_ACTIVE_REQUESTS = "Active Requests";
|
|
|
2507
1775
|
var STAT_CANCELLED_REQUESTS = "Cancelled Requests";
|
|
2508
1776
|
var STAT_QUEUED_REQUESTS_EVER = "Queued Requests Ever";
|
|
2509
1777
|
var STAT_ACTIVE_REQUESTS_EVER = "Active Requests Ever";
|
|
2510
|
-
var
|
|
1778
|
+
var DEFAULT_PROPS = {
|
|
2511
1779
|
id: "request-scheduler",
|
|
2512
1780
|
/** Specifies if the request scheduler should throttle incoming requests, mainly for comparative testing. */
|
|
2513
1781
|
throttleRequests: true,
|
|
@@ -2529,7 +1797,7 @@ var RequestScheduler = class {
|
|
|
2529
1797
|
/** Pending arrival debounce or next-tick refill; only new arrivals replace this timer. */
|
|
2530
1798
|
updateTimer = null;
|
|
2531
1799
|
constructor(props = {}) {
|
|
2532
|
-
this.props = { ...
|
|
1800
|
+
this.props = { ...DEFAULT_PROPS, ...props };
|
|
2533
1801
|
this.stats = new import_stats.Stats({ id: this.props.id });
|
|
2534
1802
|
this.stats.get(STAT_QUEUED_REQUESTS);
|
|
2535
1803
|
this.stats.get(STAT_ACTIVE_REQUESTS);
|
|
@@ -2789,7 +2057,7 @@ var RequestCache = class {
|
|
|
2789
2057
|
return cached;
|
|
2790
2058
|
}
|
|
2791
2059
|
if (signal == null ? void 0 : signal.aborted) {
|
|
2792
|
-
return Promise.reject(
|
|
2060
|
+
return Promise.reject(createAbortError());
|
|
2793
2061
|
}
|
|
2794
2062
|
const controller = new AbortController();
|
|
2795
2063
|
let resolveRequest;
|
|
@@ -2847,7 +2115,7 @@ var RequestCache = class {
|
|
|
2847
2115
|
}
|
|
2848
2116
|
waitForEntry(key, entry, signal) {
|
|
2849
2117
|
if (signal == null ? void 0 : signal.aborted) {
|
|
2850
|
-
return Promise.reject(
|
|
2118
|
+
return Promise.reject(createAbortError());
|
|
2851
2119
|
}
|
|
2852
2120
|
if (!entry.pending) {
|
|
2853
2121
|
return entry.promise;
|
|
@@ -2866,7 +2134,7 @@ var RequestCache = class {
|
|
|
2866
2134
|
if (!waiting)
|
|
2867
2135
|
return;
|
|
2868
2136
|
finishWaiting();
|
|
2869
|
-
reject(
|
|
2137
|
+
reject(createAbortError());
|
|
2870
2138
|
if (entry.pending && entry.waiterCount === 0 && this.entries.get(key) === entry) {
|
|
2871
2139
|
this.removeEntry(key, "abort");
|
|
2872
2140
|
}
|
|
@@ -2919,7 +2187,7 @@ var RequestCache = class {
|
|
|
2919
2187
|
return true;
|
|
2920
2188
|
}
|
|
2921
2189
|
};
|
|
2922
|
-
function
|
|
2190
|
+
function createAbortError() {
|
|
2923
2191
|
const error = new Error("Request aborted");
|
|
2924
2192
|
error.name = "AbortError";
|
|
2925
2193
|
return error;
|
|
@@ -3092,7 +2360,7 @@ function createAuthenticatedFetch(options) {
|
|
|
3092
2360
|
}
|
|
3093
2361
|
function getAuthenticatedFetch(options = {}) {
|
|
3094
2362
|
var _a, _b, _c;
|
|
3095
|
-
const fetchOption =
|
|
2363
|
+
const fetchOption = (_a = options.core) == null ? void 0 : _a.fetch;
|
|
3096
2364
|
let fetchFunction;
|
|
3097
2365
|
if (typeof fetchOption === "function") {
|
|
3098
2366
|
fetchFunction = fetchOption;
|
|
@@ -3275,7 +2543,7 @@ var RANGE_STATS_KEYS = {
|
|
|
3275
2543
|
abortedLogicalRanges: "Aborted Logical Range Requests",
|
|
3276
2544
|
fullResponseFallbacks: "Full Response Fallbacks"
|
|
3277
2545
|
};
|
|
3278
|
-
var
|
|
2546
|
+
var DEFAULT_PROPS2 = {
|
|
3279
2547
|
batchDelayMs: 50,
|
|
3280
2548
|
maxGapBytes: 65536,
|
|
3281
2549
|
rangeExpansionBytes: 65536,
|
|
@@ -3314,16 +2582,16 @@ var RangeRequestScheduler = class {
|
|
|
3314
2582
|
flushTimer = null;
|
|
3315
2583
|
/** Creates a scheduler for one group of byte-range-addressable resources. */
|
|
3316
2584
|
constructor(props = {}) {
|
|
3317
|
-
const rangeExpansionBytes = props.rangeExpansionBytes ?? props.maxGapBytes ??
|
|
2585
|
+
const rangeExpansionBytes = props.rangeExpansionBytes ?? props.maxGapBytes ?? DEFAULT_PROPS2.rangeExpansionBytes;
|
|
3318
2586
|
this.props = {
|
|
3319
|
-
batchDelayMs: props.batchDelayMs ??
|
|
2587
|
+
batchDelayMs: props.batchDelayMs ?? DEFAULT_PROPS2.batchDelayMs,
|
|
3320
2588
|
maxGapBytes: props.maxGapBytes ?? rangeExpansionBytes,
|
|
3321
2589
|
rangeExpansionBytes,
|
|
3322
|
-
maxMergedBytes: props.maxMergedBytes ??
|
|
2590
|
+
maxMergedBytes: props.maxMergedBytes ?? DEFAULT_PROPS2.maxMergedBytes,
|
|
3323
2591
|
maxConcurrency: props.maxConcurrency ?? 6,
|
|
3324
2592
|
maxQueueSize: props.maxQueueSize ?? 4096,
|
|
3325
2593
|
maxRangeBytes: props.maxRangeBytes ?? 64 * 1024 * 1024,
|
|
3326
|
-
maxTotalBytes: props.maxTotalBytes ??
|
|
2594
|
+
maxTotalBytes: props.maxTotalBytes ?? DEFAULT_PROPS2.maxTotalBytes
|
|
3327
2595
|
};
|
|
3328
2596
|
for (const value of [
|
|
3329
2597
|
this.props.maxConcurrency,
|
|
@@ -3353,7 +2621,7 @@ var RangeRequestScheduler = class {
|
|
|
3353
2621
|
return Promise.reject(new Error("Byte range length cannot be negative"));
|
|
3354
2622
|
}
|
|
3355
2623
|
if ((_a = request.signal) == null ? void 0 : _a.aborted) {
|
|
3356
|
-
return Promise.reject(request.signal.reason ??
|
|
2624
|
+
return Promise.reject(request.signal.reason ?? createAbortError2());
|
|
3357
2625
|
}
|
|
3358
2626
|
if (request.length === 0) {
|
|
3359
2627
|
return Promise.resolve(new ArrayBuffer(0));
|
|
@@ -3618,7 +2886,7 @@ var RangeRequestScheduler = class {
|
|
|
3618
2886
|
}
|
|
3619
2887
|
}
|
|
3620
2888
|
this.transportQueue = this.transportQueue.filter((group) => group.requests.length > 0);
|
|
3621
|
-
request.reject(((_a = request.signal) == null ? void 0 : _a.reason) ??
|
|
2889
|
+
request.reject(((_a = request.signal) == null ? void 0 : _a.reason) ?? createAbortError2());
|
|
3622
2890
|
this.trackEvent({
|
|
3623
2891
|
type: "abort",
|
|
3624
2892
|
sourceId: request.sourceId,
|
|
@@ -3849,7 +3117,7 @@ function getTimestamp() {
|
|
|
3849
3117
|
var _a;
|
|
3850
3118
|
return ((_a = globalThis.performance) == null ? void 0 : _a.now()) ?? Date.now();
|
|
3851
3119
|
}
|
|
3852
|
-
function
|
|
3120
|
+
function createAbortError2() {
|
|
3853
3121
|
if (typeof DOMException !== "undefined") {
|
|
3854
3122
|
return new DOMException("Request aborted", "AbortError");
|
|
3855
3123
|
}
|
|
@@ -3931,7 +3199,7 @@ var RangeRequestCache = class {
|
|
|
3931
3199
|
(_a = this.onEvent) == null ? void 0 : _a.call(this, { type: "miss", sourceId, offset, length });
|
|
3932
3200
|
if (this.cache.maxEntries === 0 || length > this.cache.maxBytes) {
|
|
3933
3201
|
if (signal == null ? void 0 : signal.aborted) {
|
|
3934
|
-
throw
|
|
3202
|
+
throw createAbortError3();
|
|
3935
3203
|
}
|
|
3936
3204
|
const arrayBuffer = await fetchRange(offset, length, signal || new AbortController().signal);
|
|
3937
3205
|
validateResponseLength(arrayBuffer, length);
|
|
@@ -4042,7 +3310,7 @@ function validateResponseLength(arrayBuffer, expectedLength) {
|
|
|
4042
3310
|
throw new Error(`Range request returned ${arrayBuffer.byteLength} bytes; expected ${expectedLength}`);
|
|
4043
3311
|
}
|
|
4044
3312
|
}
|
|
4045
|
-
function
|
|
3313
|
+
function createAbortError3() {
|
|
4046
3314
|
const error = new Error("Request aborted");
|
|
4047
3315
|
error.name = "AbortError";
|
|
4048
3316
|
return error;
|
|
@@ -6213,14 +5481,14 @@ var Byte14Decompressor = class {
|
|
|
6213
5481
|
};
|
|
6214
5482
|
function createPointDecompressor(stream, metadata, outputMode, selection) {
|
|
6215
5483
|
const extraByteCount = getExtraByteCount(metadata);
|
|
6216
|
-
for (const
|
|
5484
|
+
for (const version3 of [
|
|
6217
5485
|
metadata.point10ItemVersion,
|
|
6218
5486
|
metadata.gpsTime11ItemVersion,
|
|
6219
5487
|
metadata.rgb12ItemVersion,
|
|
6220
5488
|
metadata.byteItemVersion
|
|
6221
5489
|
]) {
|
|
6222
|
-
if (
|
|
6223
|
-
throw new Error(`Unsupported legacy LASzip item version ${
|
|
5490
|
+
if (version3 !== void 0 && version3 !== 1 && version3 !== 2) {
|
|
5491
|
+
throw new Error(`Unsupported legacy LASzip item version ${version3}`);
|
|
6224
5492
|
}
|
|
6225
5493
|
}
|
|
6226
5494
|
switch (metadata.pointDataRecordFormat) {
|
|
@@ -9524,7 +8792,7 @@ function validateMetadata(rawBytes, metadata) {
|
|
|
9524
8792
|
metadata.gpsTime11ItemVersion,
|
|
9525
8793
|
metadata.rgb12ItemVersion,
|
|
9526
8794
|
metadata.byteItemVersion
|
|
9527
|
-
].some((
|
|
8795
|
+
].some((version3) => version3 !== void 0 && version3 !== 2)) {
|
|
9528
8796
|
throw new Error("TypeScript LAZ encoder only supports legacy item version 2");
|
|
9529
8797
|
}
|
|
9530
8798
|
if (!Number.isInteger(metadata.pointCount) || metadata.pointCount < 0) {
|
|
@@ -9941,7 +9209,7 @@ var CachedUriResolver = class {
|
|
|
9941
9209
|
};
|
|
9942
9210
|
|
|
9943
9211
|
// dist/loader-utils/json-loader.js
|
|
9944
|
-
var VERSION3 = true ? "5.0.0-beta.
|
|
9212
|
+
var VERSION3 = true ? "5.0.0-beta.11" : "latest";
|
|
9945
9213
|
var JSONLoader = {
|
|
9946
9214
|
dataType: null,
|
|
9947
9215
|
batchType: null,
|
|
@@ -10180,6 +9448,8 @@ var HttpFileTransport = class {
|
|
|
10180
9448
|
identityHints;
|
|
10181
9449
|
/** Failure objects already included in telemetry. */
|
|
10182
9450
|
countedFailures = /* @__PURE__ */ new WeakSet();
|
|
9451
|
+
/** Observer for cumulative transport counters, including asynchronous cancellation. */
|
|
9452
|
+
onTelemetry;
|
|
10183
9453
|
/** Mutable counters backing immutable telemetry snapshots. */
|
|
10184
9454
|
telemetry = {
|
|
10185
9455
|
requestedBytes: 0,
|
|
@@ -10193,6 +9463,7 @@ var HttpFileTransport = class {
|
|
|
10193
9463
|
constructor(url, options) {
|
|
10194
9464
|
validateKnownByteLength(options.byteLength);
|
|
10195
9465
|
this.url = url;
|
|
9466
|
+
this.onTelemetry = options.onTelemetry;
|
|
10196
9467
|
this.fetchFunction = options.fetch || ((input, init) => globalThis.fetch(input, init));
|
|
10197
9468
|
this.fetchOptions = options.fetchOptions ? { ...options.fetchOptions, headers: new Headers(options.fetchOptions.headers) } : void 0;
|
|
10198
9469
|
this.consistency = options.consistency || "best-effort";
|
|
@@ -10219,6 +9490,7 @@ var HttpFileTransport = class {
|
|
|
10219
9490
|
}
|
|
10220
9491
|
/** Counts each failure object once even when it passes through several async layers. */
|
|
10221
9492
|
trackFailure(error) {
|
|
9493
|
+
var _a;
|
|
10222
9494
|
if (typeof error === "object" && error !== null) {
|
|
10223
9495
|
if (this.countedFailures.has(error)) {
|
|
10224
9496
|
return;
|
|
@@ -10230,10 +9502,11 @@ var HttpFileTransport = class {
|
|
|
10230
9502
|
} else {
|
|
10231
9503
|
this.telemetry.errorCount++;
|
|
10232
9504
|
}
|
|
9505
|
+
(_a = this.onTelemetry) == null ? void 0 : _a.call(this, this.getTelemetry(), error);
|
|
10233
9506
|
}
|
|
10234
9507
|
/** Performs and validates one exact HTTP range request. */
|
|
10235
9508
|
async requestRange(offset, length, signal, expectedIdentity) {
|
|
10236
|
-
var _a;
|
|
9509
|
+
var _a, _b;
|
|
10237
9510
|
const requestStartTime = getTimestamp2();
|
|
10238
9511
|
const abortContext = createCombinedAbortContext(signal, (_a = this.fetchOptions) == null ? void 0 : _a.signal);
|
|
10239
9512
|
this.telemetry.requestCount++;
|
|
@@ -10247,7 +9520,7 @@ var HttpFileTransport = class {
|
|
|
10247
9520
|
await cancelResponse(response);
|
|
10248
9521
|
throw new Error(`HTTP byte-range request expected 206, received ${response.status}`);
|
|
10249
9522
|
}
|
|
10250
|
-
const contentRange = await readContentRange(response);
|
|
9523
|
+
const contentRange = response.headers.has("Content-Range") ? await readContentRange(response) : await this.inferContentRange(response, offset, length, expectedIdentity, abortContext.signal);
|
|
10251
9524
|
const responseIdentity = getResponseIdentity(response, contentRange.byteLength);
|
|
10252
9525
|
const responseError = getIdentityError(expectedIdentity, responseIdentity, this.identityHints, this.consistency) || getRangeError(contentRange, offset, length);
|
|
10253
9526
|
if (responseError) {
|
|
@@ -10274,6 +9547,39 @@ var HttpFileTransport = class {
|
|
|
10274
9547
|
} finally {
|
|
10275
9548
|
abortContext.removeAbortListeners();
|
|
10276
9549
|
this.telemetry.networkTimeMs += getTimestamp2() - requestStartTime;
|
|
9550
|
+
(_b = this.onTelemetry) == null ? void 0 : _b.call(this, this.getTelemetry());
|
|
9551
|
+
}
|
|
9552
|
+
}
|
|
9553
|
+
/** Infers bounds for a CORS-filtered 206; the caller still validates the body length. */
|
|
9554
|
+
async inferContentRange(response, offset, length, expectedIdentity, signal) {
|
|
9555
|
+
var _a;
|
|
9556
|
+
try {
|
|
9557
|
+
let byteLength = (expectedIdentity == null ? void 0 : expectedIdentity.byteLength) ?? this.identityHints.byteLength;
|
|
9558
|
+
if (byteLength === void 0) {
|
|
9559
|
+
const headers = new Headers((_a = this.fetchOptions) == null ? void 0 : _a.headers);
|
|
9560
|
+
headers.delete("Range");
|
|
9561
|
+
this.telemetry.requestCount++;
|
|
9562
|
+
const metadata = await this.fetchFunction(this.url, {
|
|
9563
|
+
...this.fetchOptions,
|
|
9564
|
+
method: "HEAD",
|
|
9565
|
+
body: void 0,
|
|
9566
|
+
headers,
|
|
9567
|
+
signal
|
|
9568
|
+
});
|
|
9569
|
+
await cancelResponse(metadata);
|
|
9570
|
+
const value = metadata.headers.get("Content-Length");
|
|
9571
|
+
byteLength = value && /^\d+$/.test(value) ? Number(value) : NaN;
|
|
9572
|
+
if (metadata.status !== 200 || !Number.isSafeInteger(byteLength) || byteLength < offset + length) {
|
|
9573
|
+
throw new Error("HTTP byte-range response is missing Content-Range and HEAD did not provide a valid file length");
|
|
9574
|
+
}
|
|
9575
|
+
const identityError = getIdentityError(getResponseIdentity(metadata, byteLength), getResponseIdentity(response, byteLength), this.identityHints, this.consistency);
|
|
9576
|
+
if (identityError)
|
|
9577
|
+
throw new Error(identityError);
|
|
9578
|
+
}
|
|
9579
|
+
return { offset, endOffset: offset + length - 1, byteLength };
|
|
9580
|
+
} catch (error) {
|
|
9581
|
+
await cancelResponse(response);
|
|
9582
|
+
throw error;
|
|
10277
9583
|
}
|
|
10278
9584
|
}
|
|
10279
9585
|
/** Validates and consumes the special empty-object identity response. */
|
|
@@ -10459,7 +9765,7 @@ var HttpFile = class _HttpFile {
|
|
|
10459
9765
|
async open(signal) {
|
|
10460
9766
|
this.assertOpen();
|
|
10461
9767
|
if (signal == null ? void 0 : signal.aborted) {
|
|
10462
|
-
const error =
|
|
9768
|
+
const error = createAbortError4();
|
|
10463
9769
|
this.transport.trackFailure(error);
|
|
10464
9770
|
throw error;
|
|
10465
9771
|
}
|
|
@@ -10501,7 +9807,7 @@ var HttpFile = class _HttpFile {
|
|
|
10501
9807
|
async read(offset = 0, length = 0, signal) {
|
|
10502
9808
|
this.assertOpen();
|
|
10503
9809
|
if (signal == null ? void 0 : signal.aborted) {
|
|
10504
|
-
const error =
|
|
9810
|
+
const error = createAbortError4();
|
|
10505
9811
|
this.transport.trackFailure(error);
|
|
10506
9812
|
throw error;
|
|
10507
9813
|
}
|
|
@@ -10609,7 +9915,7 @@ function validateRange2(offset, length, byteLength) {
|
|
|
10609
9915
|
throw new Error("HTTP byte range extends beyond the end of the file");
|
|
10610
9916
|
}
|
|
10611
9917
|
}
|
|
10612
|
-
function
|
|
9918
|
+
function createAbortError4() {
|
|
10613
9919
|
if (typeof DOMException !== "undefined") {
|
|
10614
9920
|
return new DOMException("Request aborted", "AbortError");
|
|
10615
9921
|
}
|
|
@@ -10702,7 +10008,10 @@ var NodeFileSystemFacade = class {
|
|
|
10702
10008
|
|
|
10703
10009
|
// dist/loader-utils/source-types.js
|
|
10704
10010
|
function isSourceLoader(loader) {
|
|
10705
|
-
return Boolean(loader && typeof loader === "object" && "
|
|
10011
|
+
return Boolean(loader && typeof loader === "object" && "createDataSourceSync" in loader && "fromUrl" in loader && "testURL" in loader);
|
|
10012
|
+
}
|
|
10013
|
+
function supportsSourceCreation(loader) {
|
|
10014
|
+
return Boolean(loader.createDataSourceSync || loader.preload && loader.fromUrl !== void 0);
|
|
10706
10015
|
}
|
|
10707
10016
|
|
|
10708
10017
|
// dist/loader-utils/lib/sources/data-source.js
|
|
@@ -10728,6 +10037,8 @@ var DataSource = class _DataSource {
|
|
|
10728
10037
|
options;
|
|
10729
10038
|
data;
|
|
10730
10039
|
url;
|
|
10040
|
+
/** Stable query-visible name, resolved without fetching source data. */
|
|
10041
|
+
name;
|
|
10731
10042
|
/** Shared parser options derived from the source options, excluding source-only core controls. */
|
|
10732
10043
|
loadOptions;
|
|
10733
10044
|
/** A resolved fetch function extracted from the shared core options. */
|
|
@@ -10741,6 +10052,7 @@ var DataSource = class _DataSource {
|
|
|
10741
10052
|
this.options = mergeOptions(mergeOptions(_DataSource.defaultOptions, defaultOptions || {}), options);
|
|
10742
10053
|
this.data = data;
|
|
10743
10054
|
this.url = typeof data === "string" ? resolvePath(data) : "";
|
|
10055
|
+
this.name = getDataSourceName(data, this.options);
|
|
10744
10056
|
const loadOptions = resolveAuthenticationOptions(getSourceLoaderOptions(this.options));
|
|
10745
10057
|
this.loadOptions = loadOptions;
|
|
10746
10058
|
const fetch2 = getFetchFunction(loadOptions);
|
|
@@ -10749,6 +10061,9 @@ var DataSource = class _DataSource {
|
|
|
10749
10061
|
this.fetch = fetch2;
|
|
10750
10062
|
}
|
|
10751
10063
|
setProps(options) {
|
|
10064
|
+
var _a;
|
|
10065
|
+
if (((_a = options.core) == null ? void 0 : _a.name) !== void 0 && options.core.name !== this.name)
|
|
10066
|
+
throw new Error("Data source names are fixed at creation.");
|
|
10752
10067
|
const mergedOptions = mergeOptions(this.options, options);
|
|
10753
10068
|
const loadOptions = resolveAuthenticationOptions(getSourceLoaderOptions(mergedOptions));
|
|
10754
10069
|
this.options = mergedOptions;
|
|
@@ -10779,7 +10094,7 @@ var DataSource = class _DataSource {
|
|
|
10779
10094
|
if (callback) {
|
|
10780
10095
|
callback(normalizedError, this);
|
|
10781
10096
|
} else {
|
|
10782
|
-
|
|
10097
|
+
getLoaderLog(this.options).warn(`${this.constructor.name}: ${normalizedError.message}`)();
|
|
10783
10098
|
}
|
|
10784
10099
|
return normalizedError;
|
|
10785
10100
|
}
|
|
@@ -10796,23 +10111,13 @@ function getSourceLoaderOptions(options) {
|
|
|
10796
10111
|
if (options == null ? void 0 : options.core) {
|
|
10797
10112
|
loadOptions.core = { ...options.core };
|
|
10798
10113
|
const parserCore = loadOptions.core;
|
|
10799
|
-
for (const key of ["type", "attributions", "loaders", "onError", "loadOptions"]) {
|
|
10114
|
+
for (const key of ["type", "name", "attributions", "loaders", "onError", "loadOptions"]) {
|
|
10800
10115
|
delete parserCore[key];
|
|
10801
10116
|
}
|
|
10802
10117
|
if (Object.keys(parserCore).length === 0) {
|
|
10803
10118
|
delete loadOptions.core;
|
|
10804
10119
|
}
|
|
10805
10120
|
}
|
|
10806
|
-
const topLevelBaseUri = typeof loadOptions.baseUri === "string" ? loadOptions.baseUri : void 0;
|
|
10807
|
-
const topLevelBaseUrl = typeof loadOptions.baseUrl === "string" ? loadOptions.baseUrl : void 0;
|
|
10808
|
-
if (topLevelBaseUri !== void 0 || topLevelBaseUrl !== void 0) {
|
|
10809
|
-
loadOptions.core ||= {};
|
|
10810
|
-
if (loadOptions.core.baseUrl === void 0) {
|
|
10811
|
-
loadOptions.core.baseUrl = topLevelBaseUrl ?? topLevelBaseUri;
|
|
10812
|
-
}
|
|
10813
|
-
delete loadOptions.baseUri;
|
|
10814
|
-
delete loadOptions.baseUrl;
|
|
10815
|
-
}
|
|
10816
10121
|
return loadOptions;
|
|
10817
10122
|
}
|
|
10818
10123
|
function normalizeError(error, message) {
|
|
@@ -10826,9 +10131,48 @@ function normalizeError(error, message) {
|
|
|
10826
10131
|
}
|
|
10827
10132
|
function unavailableCoreApiMethod(methodName) {
|
|
10828
10133
|
return () => {
|
|
10829
|
-
throw new Error(`CoreAPI.${methodName} is unavailable. Use @loaders.gl/core.
|
|
10134
|
+
throw new Error(`CoreAPI.${methodName} is unavailable. Use @loaders.gl/core.createDataSourceSync().`);
|
|
10830
10135
|
};
|
|
10831
10136
|
}
|
|
10137
|
+
function getDataSourceName(data, options) {
|
|
10138
|
+
var _a, _b, _c;
|
|
10139
|
+
const explicitName = (_a = options.core) == null ? void 0 : _a.name;
|
|
10140
|
+
if (explicitName !== void 0) {
|
|
10141
|
+
if (typeof explicitName !== "string" || !explicitName.trim())
|
|
10142
|
+
throw new Error("Data source name must be a non-empty string.");
|
|
10143
|
+
return explicitName;
|
|
10144
|
+
}
|
|
10145
|
+
if (data && typeof data === "object") {
|
|
10146
|
+
const named = data;
|
|
10147
|
+
if (typeof named.name === "string" && named.name.trim())
|
|
10148
|
+
return data instanceof Blob ? removeFileExtension(named.name) : named.name;
|
|
10149
|
+
const metadata = (_b = named.schema) == null ? void 0 : _b.metadata;
|
|
10150
|
+
const embeddedName = metadata instanceof Map ? metadata.get("name") : metadata == null ? void 0 : metadata.name;
|
|
10151
|
+
if (typeof embeddedName === "string" && embeddedName.trim())
|
|
10152
|
+
return embeddedName;
|
|
10153
|
+
}
|
|
10154
|
+
if (typeof data === "string") {
|
|
10155
|
+
try {
|
|
10156
|
+
const url = new URL(data.replace(/\\/g, "/"), "https://source.invalid/");
|
|
10157
|
+
if (!["data:", "blob:"].includes(url.protocol)) {
|
|
10158
|
+
let basename = url.pathname.split("/").filter(Boolean).pop();
|
|
10159
|
+
if (basename) {
|
|
10160
|
+
try {
|
|
10161
|
+
basename = decodeURIComponent(basename);
|
|
10162
|
+
} catch {
|
|
10163
|
+
}
|
|
10164
|
+
return removeFileExtension(basename);
|
|
10165
|
+
}
|
|
10166
|
+
}
|
|
10167
|
+
} catch {
|
|
10168
|
+
}
|
|
10169
|
+
}
|
|
10170
|
+
return ((_c = options.core) == null ? void 0 : _c.type) && options.core.type !== "auto" ? options.core.type : "source";
|
|
10171
|
+
}
|
|
10172
|
+
function removeFileExtension(name) {
|
|
10173
|
+
const extension = name.lastIndexOf(".");
|
|
10174
|
+
return extension > 0 ? name.slice(0, extension) : name;
|
|
10175
|
+
}
|
|
10832
10176
|
|
|
10833
10177
|
// dist/loader-utils/lib/sources/data-source-manager.js
|
|
10834
10178
|
var DataSourceManager = class {
|
|
@@ -10937,8 +10281,8 @@ var DataSourceManager = class {
|
|
|
10937
10281
|
unsubscribe({ consumerId }) {
|
|
10938
10282
|
const consumer = this.consumers[consumerId];
|
|
10939
10283
|
if (consumer) {
|
|
10940
|
-
for (const
|
|
10941
|
-
const request = consumer[
|
|
10284
|
+
for (const requestId in consumer) {
|
|
10285
|
+
const request = consumer[requestId];
|
|
10942
10286
|
const dataSourceEntry = this.dataSources[request.dataSourceId];
|
|
10943
10287
|
dataSourceEntry == null ? void 0 : dataSourceEntry.unsubscribe(request);
|
|
10944
10288
|
}
|
|
@@ -10947,13 +10291,13 @@ var DataSourceManager = class {
|
|
|
10947
10291
|
}
|
|
10948
10292
|
}
|
|
10949
10293
|
/** Subscribes a consumer to a managed DataSource. */
|
|
10950
|
-
subscribe({ dataSourceId, onChange, consumerId, requestId
|
|
10294
|
+
subscribe({ dataSourceId, onChange, consumerId, requestId = "default" }) {
|
|
10951
10295
|
const normalizedDataSourceId = this.normalizeDataSourceId(dataSourceId);
|
|
10952
10296
|
if (dataSourceId.startsWith(this.protocol) && !this.dataSources[normalizedDataSourceId]) {
|
|
10953
10297
|
this.add({ dataSourceId: normalizedDataSourceId, dataSource: null, persistent: false });
|
|
10954
10298
|
}
|
|
10955
10299
|
const dataSourceEntry = this.dataSources[normalizedDataSourceId];
|
|
10956
|
-
this.track(consumerId,
|
|
10300
|
+
this.track(consumerId, requestId, dataSourceEntry, onChange);
|
|
10957
10301
|
return dataSourceEntry == null ? void 0 : dataSourceEntry.getDataSource();
|
|
10958
10302
|
}
|
|
10959
10303
|
/** Schedules pruning of unused non-persistent DataSources. */
|
|
@@ -10996,10 +10340,10 @@ var DataSourceManager = class {
|
|
|
10996
10340
|
throw new Error("DataSourceManager.getOrCreate requires dataSourceId or data.");
|
|
10997
10341
|
}
|
|
10998
10342
|
/** Tracks one consumer request against one managed DataSource entry. */
|
|
10999
|
-
track(consumerId,
|
|
10343
|
+
track(consumerId, requestId, dataSourceEntry, onChange) {
|
|
11000
10344
|
this.consumers[consumerId] = this.consumers[consumerId] || /* @__PURE__ */ Object.create(null);
|
|
11001
10345
|
const consumer = this.consumers[consumerId];
|
|
11002
|
-
let request = consumer[
|
|
10346
|
+
let request = consumer[requestId];
|
|
11003
10347
|
const oldDataSourceEntry = (request == null ? void 0 : request.dataSourceId) && this.dataSources[request.dataSourceId];
|
|
11004
10348
|
if (oldDataSourceEntry) {
|
|
11005
10349
|
oldDataSourceEntry.unsubscribe(request);
|
|
@@ -11012,7 +10356,7 @@ var DataSourceManager = class {
|
|
|
11012
10356
|
} else {
|
|
11013
10357
|
request = { onChange, dataSourceId: dataSourceEntry.id };
|
|
11014
10358
|
}
|
|
11015
|
-
consumer[
|
|
10359
|
+
consumer[requestId] = request;
|
|
11016
10360
|
dataSourceEntry.subscribe(request);
|
|
11017
10361
|
}
|
|
11018
10362
|
}
|
|
@@ -11570,11 +10914,11 @@ function throwIfScanAborted(signal) {
|
|
|
11570
10914
|
|
|
11571
10915
|
// dist/loader-utils/lib/scan-utils/scan-query-metadata.js
|
|
11572
10916
|
var import_crs = require("@math.gl/geospatial/crs");
|
|
11573
|
-
function
|
|
10917
|
+
function emitQueryComplete(callback, summary) {
|
|
11574
10918
|
if (!callback)
|
|
11575
10919
|
return;
|
|
11576
10920
|
try {
|
|
11577
|
-
callback(
|
|
10921
|
+
callback(summary);
|
|
11578
10922
|
} catch {
|
|
11579
10923
|
}
|
|
11580
10924
|
}
|
|
@@ -11596,6 +10940,7 @@ function createScanQueryMetadata(options) {
|
|
|
11596
10940
|
metadata: field.metadata || Object.freeze({})
|
|
11597
10941
|
});
|
|
11598
10942
|
});
|
|
10943
|
+
const queryCapabilities = Object.freeze({ ...options.capabilities });
|
|
11599
10944
|
return Object.freeze({
|
|
11600
10945
|
sourceType: options.sourceType,
|
|
11601
10946
|
queryType: options.queryType,
|
|
@@ -11604,7 +10949,9 @@ function createScanQueryMetadata(options) {
|
|
|
11604
10949
|
description: options.description,
|
|
11605
10950
|
schema,
|
|
11606
10951
|
columns: Object.freeze(columns),
|
|
11607
|
-
capabilities:
|
|
10952
|
+
capabilities: queryCapabilities,
|
|
10953
|
+
queryCapabilities,
|
|
10954
|
+
...options.hasDefaultRowWindow ? { hasDefaultRowWindow: true } : {},
|
|
11608
10955
|
spatial: options.spatial ? Object.freeze({
|
|
11609
10956
|
...options.spatial,
|
|
11610
10957
|
bounds: options.spatial.bounds ? Object.freeze({
|
|
@@ -11641,6 +10988,13 @@ function getNonEmptyMetadataValue(metadata, key) {
|
|
|
11641
10988
|
const value = metadata == null ? void 0 : metadata[key];
|
|
11642
10989
|
return value || void 0;
|
|
11643
10990
|
}
|
|
10991
|
+
function createQueryMetadata(options) {
|
|
10992
|
+
const { queryCapabilities, ...metadataOptions } = options;
|
|
10993
|
+
return createScanQueryMetadata({
|
|
10994
|
+
...metadataOptions,
|
|
10995
|
+
capabilities: queryCapabilities
|
|
10996
|
+
});
|
|
10997
|
+
}
|
|
11644
10998
|
|
|
11645
10999
|
// dist/loader-utils/lib/scan-utils/table-query.js
|
|
11646
11000
|
function planTableQuery(sourceColumnNames, options = {}) {
|
|
@@ -11684,14 +11038,18 @@ function validateTableQueryLimit(limit) {
|
|
|
11684
11038
|
throw new Error("Table query limit must be a non-negative safe integer.");
|
|
11685
11039
|
}
|
|
11686
11040
|
}
|
|
11041
|
+
function validateTableQueryOffset(offset) {
|
|
11042
|
+
if (offset !== void 0 && (!Number.isSafeInteger(offset) || offset < 0)) {
|
|
11043
|
+
throw new Error("Table query offset must be a non-negative safe integer.");
|
|
11044
|
+
}
|
|
11045
|
+
}
|
|
11687
11046
|
|
|
11688
11047
|
// dist/loader-utils/lib/scan-utils/table-scan-batch.js
|
|
11689
|
-
function makeTableScanBatch(table) {
|
|
11690
|
-
return { ...table, batchType: "data", length: table.data.numRows };
|
|
11691
|
-
}
|
|
11692
11048
|
async function* executeTableScanBatches(readBatches, options = {}, operators = {}) {
|
|
11693
|
-
var _a;
|
|
11049
|
+
var _a, _b, _c, _d, _e;
|
|
11694
11050
|
validateTableQueryLimit(options.limit);
|
|
11051
|
+
validateTableQueryOffset(options.offset);
|
|
11052
|
+
let skip = options.offset ?? 0;
|
|
11695
11053
|
const startedAt = Date.now();
|
|
11696
11054
|
let sourcesRead = 0;
|
|
11697
11055
|
let batchesRead = 0;
|
|
@@ -11705,6 +11063,7 @@ async function* executeTableScanBatches(readBatches, options = {}, operators = {
|
|
|
11705
11063
|
let executionError;
|
|
11706
11064
|
let remaining = options.limit === void 0 ? Number.POSITIVE_INFINITY : Math.max(0, options.limit);
|
|
11707
11065
|
try {
|
|
11066
|
+
(_a = options.signal) == null ? void 0 : _a.throwIfAborted();
|
|
11708
11067
|
if (remaining <= 0) {
|
|
11709
11068
|
earlyTerminationReason = "limit";
|
|
11710
11069
|
return;
|
|
@@ -11715,36 +11074,47 @@ async function* executeTableScanBatches(readBatches, options = {}, operators = {
|
|
|
11715
11074
|
earlyTerminationReason = "limit";
|
|
11716
11075
|
return;
|
|
11717
11076
|
}
|
|
11077
|
+
(_b = options.signal) == null ? void 0 : _b.throwIfAborted();
|
|
11718
11078
|
batchesRead++;
|
|
11719
|
-
|
|
11720
|
-
|
|
11079
|
+
const rowCount = getScanBatchRowCount(batch);
|
|
11080
|
+
rowsRead += rowCount;
|
|
11081
|
+
if (options.predicate && !operators.filter && !("shape" in batch)) {
|
|
11082
|
+
throw new Error("Native Arrow scans require a filter kernel for residual predicates.");
|
|
11083
|
+
}
|
|
11084
|
+
const filteredBatch = operators.filter ? await operators.filter(batch, options.predicate, options.signal) : "shape" in batch ? filterTableBatch(batch, options.predicate) : batch;
|
|
11085
|
+
(_c = options.signal) == null ? void 0 : _c.throwIfAborted();
|
|
11086
|
+
const filteredRowCount = getScanBatchRowCount(filteredBatch);
|
|
11721
11087
|
if (options.predicate) {
|
|
11722
|
-
rowsTested +=
|
|
11723
|
-
rowsRetained +=
|
|
11724
|
-
}
|
|
11725
|
-
|
|
11726
|
-
|
|
11727
|
-
|
|
11728
|
-
|
|
11729
|
-
|
|
11730
|
-
|
|
11731
|
-
|
|
11732
|
-
|
|
11088
|
+
rowsTested += rowCount;
|
|
11089
|
+
rowsRetained += filteredRowCount;
|
|
11090
|
+
}
|
|
11091
|
+
if (skip >= filteredRowCount && (skip > 0 || options.skipEmptyBatches)) {
|
|
11092
|
+
skip -= filteredRowCount;
|
|
11093
|
+
continue;
|
|
11094
|
+
}
|
|
11095
|
+
const end = Math.min(filteredRowCount, skip + remaining);
|
|
11096
|
+
const window2 = skip || end < filteredRowCount ? "shape" in filteredBatch ? sliceTableBatch(filteredBatch, skip, end) : filteredBatch.slice(skip, end) : filteredBatch;
|
|
11097
|
+
skip = 0;
|
|
11098
|
+
const output = operators.project ? operators.project(window2, options.columns) : projectTableBatch(window2, options.columns);
|
|
11099
|
+
remaining -= getScanBatchRowCount(window2);
|
|
11100
|
+
rowsReturned += getScanBatchRowCount(output);
|
|
11101
|
+
if (remaining === 0)
|
|
11733
11102
|
earlyTerminationReason = "limit";
|
|
11734
|
-
|
|
11103
|
+
yield output;
|
|
11104
|
+
if (remaining === 0)
|
|
11735
11105
|
return;
|
|
11736
|
-
|
|
11106
|
+
(_d = options.signal) == null ? void 0 : _d.throwIfAborted();
|
|
11737
11107
|
}
|
|
11738
11108
|
status = "completed";
|
|
11739
11109
|
} catch (error) {
|
|
11740
|
-
status = ((
|
|
11110
|
+
status = ((_e = options.signal) == null ? void 0 : _e.aborted) ? "cancelled" : "failed";
|
|
11741
11111
|
executionError = error;
|
|
11742
11112
|
throw error;
|
|
11743
11113
|
} finally {
|
|
11744
11114
|
if (status === "early-terminated" && !earlyTerminationReason) {
|
|
11745
11115
|
earlyTerminationReason = "consumer-return";
|
|
11746
11116
|
}
|
|
11747
|
-
|
|
11117
|
+
emitQueryComplete(options.onQueryComplete, Object.freeze({
|
|
11748
11118
|
status,
|
|
11749
11119
|
sourcesPlanned: 1,
|
|
11750
11120
|
sourcesRead,
|
|
@@ -11764,27 +11134,36 @@ async function* executeTableScanBatches(readBatches, options = {}, operators = {
|
|
|
11764
11134
|
}));
|
|
11765
11135
|
}
|
|
11766
11136
|
}
|
|
11137
|
+
function getScanBatchRowCount(batch) {
|
|
11138
|
+
return "shape" in batch ? batch.length : batch.numRows;
|
|
11139
|
+
}
|
|
11767
11140
|
function truncateTableBatch(batch, length) {
|
|
11141
|
+
return "shape" in batch ? sliceTableBatch(batch, 0, length) : batch.slice(0, length);
|
|
11142
|
+
}
|
|
11143
|
+
function sliceTableBatch(batch, start, end) {
|
|
11144
|
+
const length = end - start;
|
|
11768
11145
|
if (batch.shape === "object-row-table" || batch.shape === "array-row-table") {
|
|
11769
|
-
return { ...batch, data: batch.data.slice(
|
|
11146
|
+
return { ...batch, data: batch.data.slice(start, end), length };
|
|
11770
11147
|
}
|
|
11771
11148
|
if (batch.shape === "columnar-table") {
|
|
11772
11149
|
return {
|
|
11773
11150
|
...batch,
|
|
11774
11151
|
data: Object.fromEntries(Object.entries(batch.data).map(([name, values]) => [
|
|
11775
11152
|
name,
|
|
11776
|
-
Array.from(values).slice(
|
|
11153
|
+
Array.from(values).slice(start, end)
|
|
11777
11154
|
])),
|
|
11778
11155
|
length
|
|
11779
11156
|
};
|
|
11780
11157
|
}
|
|
11781
|
-
|
|
11782
|
-
return { ...batch, data: batch.data.slice(0, length), length };
|
|
11783
|
-
return { ...batch, features: batch.features.slice(0, length), length };
|
|
11158
|
+
return { ...batch, features: batch.features.slice(start, end), length };
|
|
11784
11159
|
}
|
|
11785
11160
|
function projectTableBatch(batch, columns) {
|
|
11786
11161
|
if (columns === void 0)
|
|
11787
11162
|
return batch;
|
|
11163
|
+
if (!("shape" in batch)) {
|
|
11164
|
+
const indices = columns.map((column) => batch.schema.fields.findIndex((field) => field.name === column)).filter((index) => index >= 0);
|
|
11165
|
+
return batch.selectAt(indices);
|
|
11166
|
+
}
|
|
11788
11167
|
const schema = projectTableSchema(batch, columns);
|
|
11789
11168
|
if (batch.shape === "object-row-table") {
|
|
11790
11169
|
return {
|
|
@@ -11800,8 +11179,6 @@ function projectTableBatch(batch, columns) {
|
|
|
11800
11179
|
data: Object.fromEntries(columns.map((column) => [column, batch.data[column]]))
|
|
11801
11180
|
};
|
|
11802
11181
|
}
|
|
11803
|
-
if (batch.shape === "arrow-table")
|
|
11804
|
-
return { ...batch, schema, data: batch.data.select([...columns]) };
|
|
11805
11182
|
return batch;
|
|
11806
11183
|
}
|
|
11807
11184
|
function projectTableSchema(batch, columns) {
|
|
@@ -12761,4 +12138,186 @@ function getXYZTileGridOptions(metadata) {
|
|
|
12761
12138
|
function isClose(actual, expected) {
|
|
12762
12139
|
return Number.isFinite(actual) && Math.abs(actual - expected) <= Math.abs(expected) * 1e-10;
|
|
12763
12140
|
}
|
|
12141
|
+
|
|
12142
|
+
// dist/loader-utils/lib/scan-utils/logical-table-query.js
|
|
12143
|
+
function normalizeTableQuery(sourceColumnNames, query = {}) {
|
|
12144
|
+
if (!query || typeof query !== "object" || Array.isArray(query)) {
|
|
12145
|
+
throw new Error("Table query must be an object.");
|
|
12146
|
+
}
|
|
12147
|
+
for (const key of Object.keys(query)) {
|
|
12148
|
+
if (!["from", "select", "where", "offset", "limit"].includes(key)) {
|
|
12149
|
+
throw new Error(`Unsupported table query option: ${key}`);
|
|
12150
|
+
}
|
|
12151
|
+
}
|
|
12152
|
+
if (query.select !== void 0 && (!Array.isArray(query.select) || query.select.length === 0)) {
|
|
12153
|
+
throw new Error("Table query select must be a non-empty array.");
|
|
12154
|
+
}
|
|
12155
|
+
validateTableReference(query.from);
|
|
12156
|
+
validateTableQueryOffset(query.offset);
|
|
12157
|
+
validateTableQueryLimit(query.limit);
|
|
12158
|
+
if (query.where !== void 0) {
|
|
12159
|
+
validateColumnarPredicate(query.where, new Set(sourceColumnNames));
|
|
12160
|
+
}
|
|
12161
|
+
const outputNames = /* @__PURE__ */ new Set();
|
|
12162
|
+
const select = (query.select ?? sourceColumnNames).map((selection) => {
|
|
12163
|
+
if (typeof selection !== "string" && (!selection || typeof selection !== "object" || Array.isArray(selection))) {
|
|
12164
|
+
throw new Error("Table query selection must be a column name or {column, as}.");
|
|
12165
|
+
}
|
|
12166
|
+
if (typeof selection !== "string" && Object.keys(selection).some((key) => key !== "column" && key !== "as")) {
|
|
12167
|
+
throw new Error("Unsupported table query selection field.");
|
|
12168
|
+
}
|
|
12169
|
+
const column = typeof selection === "string" ? selection : selection.column;
|
|
12170
|
+
const outputName = typeof selection === "string" ? selection : selection.as === void 0 ? column : selection.as;
|
|
12171
|
+
if (typeof column !== "string" || !sourceColumnNames.includes(column)) {
|
|
12172
|
+
throw new Error(`Table query column not found: ${column}`);
|
|
12173
|
+
}
|
|
12174
|
+
if (typeof outputName !== "string" || outputName.length === 0) {
|
|
12175
|
+
throw new Error("Table query output name must be a non-empty string.");
|
|
12176
|
+
}
|
|
12177
|
+
if (outputNames.has(outputName)) {
|
|
12178
|
+
throw new Error(`Duplicate table query output name: ${outputName}`);
|
|
12179
|
+
}
|
|
12180
|
+
outputNames.add(outputName);
|
|
12181
|
+
return Object.freeze({ column, as: outputName });
|
|
12182
|
+
});
|
|
12183
|
+
planTableQuery(sourceColumnNames, {
|
|
12184
|
+
columns: [...new Set(select.map((selection) => selection.column))],
|
|
12185
|
+
predicate: query.where,
|
|
12186
|
+
limit: query.limit
|
|
12187
|
+
});
|
|
12188
|
+
return Object.freeze({
|
|
12189
|
+
select: Object.freeze(select),
|
|
12190
|
+
...query.from === void 0 ? {} : { from: typeof query.from === "string" ? query.from : Object.freeze({ ...query.from }) },
|
|
12191
|
+
...query.where === void 0 ? {} : { where: query.where },
|
|
12192
|
+
...query.offset === void 0 ? {} : { offset: query.offset },
|
|
12193
|
+
...query.limit === void 0 ? {} : { limit: query.limit }
|
|
12194
|
+
});
|
|
12195
|
+
}
|
|
12196
|
+
function planLogicalTableQuery(sourceColumnNames, query = {}) {
|
|
12197
|
+
const normalized = normalizeTableQuery(sourceColumnNames, query);
|
|
12198
|
+
const plan = planTableQuery(sourceColumnNames, {
|
|
12199
|
+
columns: [...new Set(normalized.select.map((selection) => selection.column))],
|
|
12200
|
+
predicate: normalized.where,
|
|
12201
|
+
limit: normalized.limit
|
|
12202
|
+
});
|
|
12203
|
+
const steps = [];
|
|
12204
|
+
for (const step of plan) {
|
|
12205
|
+
if (step.kind === "limit" && normalized.offset !== void 0)
|
|
12206
|
+
steps.push(Object.freeze({ kind: "offset", offset: normalized.offset }));
|
|
12207
|
+
steps.push(step.kind === "project" ? Object.freeze({ kind: "project", select: normalized.select }) : step);
|
|
12208
|
+
}
|
|
12209
|
+
if (normalized.limit === void 0 && normalized.offset !== void 0)
|
|
12210
|
+
steps.push(Object.freeze({ kind: "offset", offset: normalized.offset }));
|
|
12211
|
+
return Object.freeze(steps);
|
|
12212
|
+
}
|
|
12213
|
+
function validateTableReference(reference) {
|
|
12214
|
+
if (reference === void 0)
|
|
12215
|
+
return;
|
|
12216
|
+
if (typeof reference === "string" && reference.trim())
|
|
12217
|
+
return;
|
|
12218
|
+
if (reference && typeof reference === "object" && !Array.isArray(reference)) {
|
|
12219
|
+
const value = reference;
|
|
12220
|
+
if (Object.keys(value).every((key) => key === "source" || key === "table") && typeof value.source === "string" && value.source.trim() && typeof value.table === "string" && value.table.trim())
|
|
12221
|
+
return;
|
|
12222
|
+
}
|
|
12223
|
+
throw new Error("FROM must be a source name or {source, table} with non-empty names.");
|
|
12224
|
+
}
|
|
12225
|
+
|
|
12226
|
+
// dist/loader-utils/lib/files/read-range-response.js
|
|
12227
|
+
async function readRangeResponse(response, offset, length, signal) {
|
|
12228
|
+
var _a, _b, _c;
|
|
12229
|
+
if (typeof offset === "number" && (!Number.isSafeInteger(offset) || offset < 0) || typeof offset === "bigint" && offset < 0n || !Number.isSafeInteger(length) || length <= 0) {
|
|
12230
|
+
await ((_a = response.body) == null ? void 0 : _a.cancel().catch(() => {
|
|
12231
|
+
}));
|
|
12232
|
+
throw new RangeError("Invalid HTTP byte range");
|
|
12233
|
+
}
|
|
12234
|
+
const start = BigInt(offset);
|
|
12235
|
+
const end = start + BigInt(length) - 1n;
|
|
12236
|
+
const value = response.headers.get("Content-Range");
|
|
12237
|
+
const match = value === null ? null : /^bytes (\d+)-(\d+)\/(\d+|\*)$/.exec(value);
|
|
12238
|
+
if (response.status !== 206 || value !== null && (!match || BigInt(match[1]) !== start || BigInt(match[2]) !== end || match[3] !== "*" && BigInt(match[3]) <= end)) {
|
|
12239
|
+
await ((_b = response.body) == null ? void 0 : _b.cancel().catch(() => {
|
|
12240
|
+
}));
|
|
12241
|
+
throw new Error("HTTP range requires 206 and matching Content-Range when visible");
|
|
12242
|
+
}
|
|
12243
|
+
const reader = (_c = response.body) == null ? void 0 : _c.getReader();
|
|
12244
|
+
if (!reader)
|
|
12245
|
+
throw new Error("HTTP range response has no body");
|
|
12246
|
+
let received = 0;
|
|
12247
|
+
const abort = () => {
|
|
12248
|
+
void reader.cancel(signal == null ? void 0 : signal.reason).catch(() => {
|
|
12249
|
+
});
|
|
12250
|
+
};
|
|
12251
|
+
signal == null ? void 0 : signal.addEventListener("abort", abort, { once: true });
|
|
12252
|
+
try {
|
|
12253
|
+
signal == null ? void 0 : signal.throwIfAborted();
|
|
12254
|
+
const bytes = new Uint8Array(length);
|
|
12255
|
+
for (; ; ) {
|
|
12256
|
+
const chunk = await reader.read();
|
|
12257
|
+
signal == null ? void 0 : signal.throwIfAborted();
|
|
12258
|
+
if (chunk.done)
|
|
12259
|
+
break;
|
|
12260
|
+
if (received + chunk.value.byteLength > length)
|
|
12261
|
+
throw new Error("HTTP range body exceeds requested length");
|
|
12262
|
+
bytes.set(chunk.value, received);
|
|
12263
|
+
received += chunk.value.byteLength;
|
|
12264
|
+
}
|
|
12265
|
+
if (received !== length)
|
|
12266
|
+
throw new Error("HTTP range body has truncated length");
|
|
12267
|
+
return bytes;
|
|
12268
|
+
} catch (error) {
|
|
12269
|
+
await reader.cancel(error).catch(() => {
|
|
12270
|
+
});
|
|
12271
|
+
throw error;
|
|
12272
|
+
} finally {
|
|
12273
|
+
signal == null ? void 0 : signal.removeEventListener("abort", abort);
|
|
12274
|
+
reader.releaseLock();
|
|
12275
|
+
}
|
|
12276
|
+
}
|
|
12277
|
+
|
|
12278
|
+
// dist/loader-utils/lib/pace-batch-iterator.js
|
|
12279
|
+
function validateBatchDeliveryRate(rate) {
|
|
12280
|
+
if (!Number.isFinite(rate) || rate < 0) {
|
|
12281
|
+
throw new RangeError("core.batchMaxRowsPerSecond must be a finite nonnegative number");
|
|
12282
|
+
}
|
|
12283
|
+
}
|
|
12284
|
+
async function* paceBatchIterator(batches, { batchMaxRowsPerSecond = 0, getRowCount, signal }) {
|
|
12285
|
+
validateBatchDeliveryRate(batchMaxRowsPerSecond);
|
|
12286
|
+
signal == null ? void 0 : signal.throwIfAborted();
|
|
12287
|
+
if (batchMaxRowsPerSecond === 0) {
|
|
12288
|
+
yield* batches;
|
|
12289
|
+
return;
|
|
12290
|
+
}
|
|
12291
|
+
let deadline = 0;
|
|
12292
|
+
for await (const batch of batches) {
|
|
12293
|
+
signal == null ? void 0 : signal.throwIfAborted();
|
|
12294
|
+
const rowCount = getRowCount(batch);
|
|
12295
|
+
if (rowCount !== void 0 && rowCount > 0) {
|
|
12296
|
+
let remaining = deadline - performance.now();
|
|
12297
|
+
while (remaining > 0) {
|
|
12298
|
+
await waitForBatch(Math.min(Math.ceil(remaining), 2 ** 31 - 1), signal);
|
|
12299
|
+
remaining = deadline - performance.now();
|
|
12300
|
+
}
|
|
12301
|
+
signal == null ? void 0 : signal.throwIfAborted();
|
|
12302
|
+
deadline = performance.now() + rowCount / batchMaxRowsPerSecond * 1e3;
|
|
12303
|
+
}
|
|
12304
|
+
yield batch;
|
|
12305
|
+
signal == null ? void 0 : signal.throwIfAborted();
|
|
12306
|
+
}
|
|
12307
|
+
}
|
|
12308
|
+
function waitForBatch(delay, signal) {
|
|
12309
|
+
signal == null ? void 0 : signal.throwIfAborted();
|
|
12310
|
+
return new Promise((resolve2, reject) => {
|
|
12311
|
+
const timer = setTimeout(() => {
|
|
12312
|
+
signal == null ? void 0 : signal.removeEventListener("abort", abort);
|
|
12313
|
+
resolve2();
|
|
12314
|
+
}, delay);
|
|
12315
|
+
function abort() {
|
|
12316
|
+
clearTimeout(timer);
|
|
12317
|
+
signal == null ? void 0 : signal.removeEventListener("abort", abort);
|
|
12318
|
+
reject(signal == null ? void 0 : signal.reason);
|
|
12319
|
+
}
|
|
12320
|
+
signal == null ? void 0 : signal.addEventListener("abort", abort, { once: true });
|
|
12321
|
+
});
|
|
12322
|
+
}
|
|
12764
12323
|
//# sourceMappingURL=index.cjs.map
|