diff --git a/.codespellrc b/.codespellrc index 775b8703ee..6c0159c6cd 100644 --- a/.codespellrc +++ b/.codespellrc @@ -18,4 +18,4 @@ [codespell] dictionary = .codespell-dictionary,- ignore-words = .codespell-ignore -skip = go/adbc/go.sum +skip = go/adbc/go.sum,javascript/package-lock.json diff --git a/.github/workflows/javascript.yml b/.github/workflows/javascript.yml new file mode 100644 index 0000000000..30ff4a0c91 --- /dev/null +++ b/.github/workflows/javascript.yml @@ -0,0 +1,200 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +name: JavaScript + +env: + DEBUG: napi:* + APP_NAME: adbc-driver-manager + MACOSX_DEPLOYMENT_TARGET: '10.15' + CARGO_INCREMENTAL: '1' + +on: + workflow_dispatch: + push: + branches: + - main + paths: + - 'javascript/**' + - 'rust/**' + - '.github/workflows/javascript.yml' + pull_request: + paths: + - 'javascript/**' + - 'rust/**' + - '.github/workflows/javascript.yml' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + lint: + name: Lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + with: + fetch-depth: 0 + persist-credentials: false + - name: Setup node + uses: actions/setup-node@v4 + with: + node-version: 22 + cache: 'npm' + cache-dependency-path: javascript/package-lock.json + - name: Use stable Rust + run: | + rustup toolchain install stable --no-self-update + rustup default stable + rustup component add clippy rustfmt + - name: Install dependencies + working-directory: javascript + run: npm ci + - name: Check JS + working-directory: javascript + run: npm run check:js + - name: Check Rust + working-directory: javascript + run: npm run check:rust + + build: + strategy: + fail-fast: false + matrix: + settings: + - host: macos-15-intel + target: x86_64-apple-darwin + - host: macos-latest + target: aarch64-apple-darwin + - host: windows-latest + target: x86_64-pc-windows-msvc + - host: ubuntu-latest + target: x86_64-unknown-linux-gnu + - host: ubuntu-24.04-arm + target: aarch64-unknown-linux-gnu + name: Build Node.js ${{ matrix.settings.target }} + runs-on: ${{ matrix.settings.host }} + steps: + - uses: actions/checkout@v6 + with: + fetch-depth: 0 + persist-credentials: false + - name: Setup node + uses: actions/setup-node@v4 + with: + node-version: 22 + cache: 'npm' + cache-dependency-path: javascript/package-lock.json + - name: Use stable Rust + run: | + rustup toolchain install stable --no-self-update + rustup default stable + rustup target add ${{ matrix.settings.target }} + - name: Install dependencies + working-directory: javascript + run: npm ci + - name: Build + working-directory: javascript + shell: bash + run: | + npx napi build --platform --release --target ${{ matrix.settings.target }} + mv index.js binding.js + mv index.d.ts binding.d.ts + npx tsc + - name: Ad-hoc sign binary (macOS) + if: runner.os == 'macOS' + working-directory: javascript + run: codesign --sign - *.node + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: bindings-${{ matrix.settings.target }} + path: javascript/*.node + if-no-files-found: error + + test: + name: Test ${{ matrix.settings.target }} + needs: build + runs-on: ${{ matrix.settings.host }} + strategy: + fail-fast: false + matrix: + settings: + - host: ubuntu-latest + target: x86_64-unknown-linux-gnu + - host: ubuntu-24.04-arm + target: aarch64-unknown-linux-gnu + - host: macos-15-intel + target: x86_64-apple-darwin + - host: macos-latest + target: aarch64-apple-darwin + - host: windows-latest + target: x86_64-pc-windows-msvc + steps: + - uses: actions/checkout@v6 + with: + fetch-depth: 0 + persist-credentials: false + - name: Setup node + uses: actions/setup-node@v4 + with: + node-version: 22 + cache: 'npm' + cache-dependency-path: javascript/package-lock.json + - name: Install dependencies + working-directory: javascript + run: npm ci --omit=optional + - name: Download artifacts + uses: actions/download-artifact@v4 + with: + name: bindings-${{ matrix.settings.target }} + path: javascript + - name: Setup conda (Windows) + if: runner.os == 'Windows' + uses: conda-incubator/setup-miniconda@fc2d68f6413eb2d87b895e92f8584b5b94a10167 # v3.3.0 + with: + miniforge-version: latest + - name: Install C++ dependencies (Windows) + if: runner.os == 'Windows' + run: conda install -c conda-forge --file ci/conda_env_cpp.txt + - name: Install C++ dependencies (Linux) + if: runner.os == 'Linux' + run: sudo apt-get install libsqlite3-dev + - name: Set cmake args (Windows) + if: runner.os == 'Windows' + shell: pwsh + run: echo "ADBC_CMAKE_ARGS=-DCMAKE_PREFIX_PATH=$env:CONDA_PREFIX/Library" >> $env:GITHUB_ENV + - name: Build Driver + # We need to build the SQLite driver for tests. + shell: bash + run: ci/scripts/node_build.sh "${{ github.workspace }}/javascript/build" + - name: Set driver path (Linux) + if: runner.os == 'Linux' + run: echo "ADBC_DRIVER_MANAGER_TEST_LIB=${{ github.workspace }}/javascript/build/lib/libadbc_driver_sqlite.so" >> "$GITHUB_ENV" + - name: Set driver path (macOS) + if: runner.os == 'macOS' + run: echo "ADBC_DRIVER_MANAGER_TEST_LIB=${{ github.workspace }}/javascript/build/lib/libadbc_driver_sqlite.dylib" >> "$GITHUB_ENV" + - name: Set driver path (Windows) + if: runner.os == 'Windows' + shell: pwsh + run: | + echo "PATH=${{ github.workspace }}/javascript/build/bin;$env:CONDA_PREFIX\Library\bin;$env:PATH" >> $env:GITHUB_ENV + echo "ADBC_DRIVER_MANAGER_TEST_LIB=${{ github.workspace }}/javascript/build/bin/adbc_driver_sqlite.dll" >> $env:GITHUB_ENV + - name: Run Tests + working-directory: javascript + run: npm test diff --git a/.github/workflows/packaging.yml b/.github/workflows/packaging.yml index c4930b8f9c..6ee1547d7e 100644 --- a/.github/workflows/packaging.yml +++ b/.github/workflows/packaging.yml @@ -1096,6 +1096,136 @@ jobs: docker compose run python-sdist-test popd + node-binaries: + name: "Node.js ${{ matrix.settings.target }}" + runs-on: ${{ matrix.settings.host }} + needs: + - source + strategy: + fail-fast: false + matrix: + settings: + - host: macos-15-intel + target: x86_64-apple-darwin + - host: macos-latest + target: aarch64-apple-darwin + - host: windows-latest + target: x86_64-pc-windows-msvc + - host: ubuntu-latest + target: x86_64-unknown-linux-gnu + - host: ubuntu-24.04-arm + target: aarch64-unknown-linux-gnu + steps: + - uses: actions/download-artifact@v6 + with: + name: source + + - name: Extract source archive + run: | + source_archive=$(echo apache-arrow-adbc-*.tar.gz) + VERSION=${source_archive#apache-arrow-adbc-} + VERSION=${VERSION%.tar.gz} + + tar xf apache-arrow-adbc-${VERSION}.tar.gz + mv apache-arrow-adbc-${VERSION} adbc + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 22 + cache: 'npm' + cache-dependency-path: adbc/javascript/package-lock.json + + - name: Setup Rust + run: | + rustup toolchain install stable --no-self-update + rustup default stable + rustup target add ${{ matrix.settings.target }} + + - name: Install Node dependencies + working-directory: adbc/javascript + run: npm ci + + - name: Build Node.js binaries + working-directory: adbc/javascript + run: npx napi build --platform --release --target ${{ matrix.settings.target }} + shell: bash + + - name: Sign binary (macOS) + if: runner.os == 'macOS' + working-directory: adbc/javascript + run: codesign --sign - *.node + + - name: Upload Node.js binaries + uses: actions/upload-artifact@v5 + with: + name: bindings-${{ matrix.settings.target }} + path: adbc/javascript/*.node + if-no-files-found: error + + node-dist: + name: "Node.js Package" + runs-on: ubuntu-latest + needs: + - source + - node-binaries + steps: + - uses: actions/download-artifact@v6 + with: + name: source + + - name: Extract source archive + run: | + source_archive=$(echo apache-arrow-adbc-*.tar.gz) + VERSION=${source_archive#apache-arrow-adbc-} + VERSION=${VERSION%.tar.gz} + + tar xf apache-arrow-adbc-${VERSION}.tar.gz + mv apache-arrow-adbc-${VERSION} adbc + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 22 + cache: 'npm' + cache-dependency-path: adbc/javascript/package-lock.json + + - name: Install Node dependencies + working-directory: adbc/javascript + run: npm ci + + - name: Build Node.js JS + working-directory: adbc/javascript + run: npm run build:ts + + - name: Download Node.js binaries + uses: actions/download-artifact@v6 + with: + pattern: bindings-* + path: adbc/javascript/artifacts + merge-multiple: true + + - name: Package Node.js artifacts + working-directory: adbc/javascript + env: + HUSKY: "0" + run: | + npx napi artifacts + # Pack the main package + npm pack + # Pack the platform-specific packages + for dir in npm/*; do + npm pack "./$dir" + done + + - name: Upload Node.js packages + uses: actions/upload-artifact@v5 + with: + name: node-packages + retention-days: 7 + path: | + adbc/javascript/*.tgz + release: name: "Create release" runs-on: ubuntu-latest @@ -1106,6 +1236,7 @@ jobs: - source - java - linux + - node-dist - python-manylinux - python-macos - python-windows @@ -1140,6 +1271,9 @@ jobs: ')' \ -exec mv '{}' upload-staging \; + # Handle Node.js packages (in tarball form) + find ./release-artifacts/ -name 'adbc-driver-manager-*.tgz' -exec mv '{}' upload-staging \; + UPLOAD=$(find upload-staging -type f | sort | uniq) echo "Uploading files:" >> $GITHUB_STEP_SUMMARY diff --git a/.gitignore b/.gitignore index dbc278a0fd..48f1da926a 100644 --- a/.gitignore +++ b/.gitignore @@ -131,3 +131,10 @@ target/ # Meson subproject support /c/subprojects/* !/c/subprojects/*.wrap + +# Node.js specific ignores +javascript/**/node_modules/ +javascript/**/target/ +javascript/**/dist/ +javascript/native/*.node +javascript/native/build/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index cd7f0097e5..06729ffa49 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -143,7 +143,12 @@ repos: hooks: - id: fmt name: rustfmt + files: ^rust/ args: ["--all", "--manifest-path", "rust/Cargo.toml", "--"] + - id: fmt + name: rustfmt-node + files: ^javascript/ + args: ["--all", "--manifest-path", "javascript/Cargo.toml", "--"] - repo: https://github.com/codespell-project/codespell rev: 63c8f8312b7559622c0d82815639671ae42132ac # v2.4.1 hooks: diff --git a/c/driver/sqlite/CMakeLists.txt b/c/driver/sqlite/CMakeLists.txt index 4c6bb1f1a7..87ad731b09 100644 --- a/c/driver/sqlite/CMakeLists.txt +++ b/c/driver/sqlite/CMakeLists.txt @@ -32,7 +32,7 @@ if(EXISTS "${SQLite3_INCLUDE_DIRS}/sqlite3.h") ADBC_SQLITE_WITH_LOAD_EXTENSION) endif() -if(NOT ADBC_SQLITE_WITH_LOAD_EXTENSION) +if(ADBC_SQLITE_WITH_LOAD_EXTENSION EQUAL -1) set(ADBC_SQLITE_COMPILE_DEFINES "-DADBC_SQLITE_WITH_NO_LOAD_EXTENSION") endif() diff --git a/ci/scripts/node_build.sh b/ci/scripts/node_build.sh new file mode 100755 index 0000000000..dca6afb8bc --- /dev/null +++ b/ci/scripts/node_build.sh @@ -0,0 +1,51 @@ +#!/usr/bin/env bash +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +set -e + +# Usage: ./node_build.sh +if [ "$#" -ne 1 ]; then + echo "Usage: $0 " + exit 1 +fi + +REPO_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd) +OUT_DIR="$1" + +# 1. Build the C++ Drivers +echo "=== Building C++ Drivers ===" +mkdir -p "${OUT_DIR}" + +cmake -S "${REPO_ROOT}/c" -B "${OUT_DIR}" \ + ${ADBC_CMAKE_ARGS} \ + -DCMAKE_INSTALL_PREFIX="${OUT_DIR}" \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DADBC_DRIVER_SQLITE=ON \ + -DADBC_BUILD_TESTS=OFF \ + -DADBC_BUILD_SHARED=ON + +cmake --build "${OUT_DIR}" --target install -j + +# 2. Build Node.js Package +echo "=== Building Node.js Package ===" +pushd "${REPO_ROOT}/javascript" + +npm install +npm run build + +popd diff --git a/ci/scripts/node_license.sh b/ci/scripts/node_license.sh new file mode 100755 index 0000000000..b4fcedfc3f --- /dev/null +++ b/ci/scripts/node_license.sh @@ -0,0 +1,49 @@ +#!/usr/bin/env bash +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# Helper to assemble LICENSE.txt for the JavaScript native addon, +# covering the Rust crates statically linked into the binary. +# https://infra.apache.org/licensing-howto.html + +set -e +set -o pipefail +set -u + +main() { + local -r source_dir="${1}" + local -r output="${2}" + + local -r tmp_file="${output}.tmp" + + # Generate third-party Rust crate license attributions. + # Must run before writing to ${output} because cargo-about scans the + # package directory for license files; if LICENSE.txt already exists + # there it creates a separate license entry that breaks grouping. + pushd "${source_dir}/javascript" + cargo about generate license.hbs > "${tmp_file}" + popd + + # Prepend the Apache 2.0 header that covers our own code, then strip + # trailing blank lines that the handlebars template may emit. + head -202 "${source_dir}/LICENSE.txt" > "${output}" + cat "${tmp_file}" >> "${output}" + rm "${tmp_file}" + perl -i -0777 -pe 's/\n+$/\n/' "${output}" +} + +main "$@" diff --git a/dev/release/rat_exclude_files.txt b/dev/release/rat_exclude_files.txt index 62de66100b..5ba67f0f3a 100644 --- a/dev/release/rat_exclude_files.txt +++ b/dev/release/rat_exclude_files.txt @@ -43,3 +43,7 @@ r/*/.Rbuildignore r/*/tests/testthat/_snaps/* rust/Cargo.lock testing/* +javascript/core/Cargo.lock +javascript/binding.d.ts +javascript/binding.js +javascript/license.hbs diff --git a/javascript/.cargo/config.toml b/javascript/.cargo/config.toml new file mode 100644 index 0000000000..60aafc2cce --- /dev/null +++ b/javascript/.cargo/config.toml @@ -0,0 +1,19 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +[target.x86_64-pc-windows-msvc] +rustflags = ["-C", "target-feature=+crt-static"] diff --git a/javascript/.editorconfig b/javascript/.editorconfig new file mode 100644 index 0000000000..294ae97c86 --- /dev/null +++ b/javascript/.editorconfig @@ -0,0 +1,32 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# EditorConfig helps developers define and maintain consistent +# coding styles between different editors or IDEs +# http://editorconfig.org +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false diff --git a/javascript/.gitattributes b/javascript/.gitattributes new file mode 100644 index 0000000000..96c63d3c66 --- /dev/null +++ b/javascript/.gitattributes @@ -0,0 +1,30 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# Auto detect text files and perform LF normalization +* text=auto + + +*.ts text eol=lf merge=union +*.tsx text eol=lf merge=union +*.rs text eol=lf merge=union +*.js text eol=lf merge=union +*.json text eol=lf merge=union + +# Generated codes +binding.js linguist-detectable=false linguist-generated=true +binding.d.ts linguist-detectable=false linguist-generated=true diff --git a/javascript/.gitignore b/javascript/.gitignore new file mode 100644 index 0000000000..f1333a04be --- /dev/null +++ b/javascript/.gitignore @@ -0,0 +1,21 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +Cargo.lock +dist +*.node +*.tsbuildinfo diff --git a/javascript/.husky/.gitignore b/javascript/.husky/.gitignore new file mode 100644 index 0000000000..f01d8c864e --- /dev/null +++ b/javascript/.husky/.gitignore @@ -0,0 +1,18 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +_ diff --git a/javascript/.husky/pre-commit b/javascript/.husky/pre-commit new file mode 100755 index 0000000000..e8dbc6bf49 --- /dev/null +++ b/javascript/.husky/pre-commit @@ -0,0 +1,21 @@ +#!/bin/sh +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +. "$(dirname "$0")/_/husky.sh" + +npx lint-staged diff --git a/javascript/.prettierignore b/javascript/.prettierignore new file mode 100644 index 0000000000..66f46bd3e1 --- /dev/null +++ b/javascript/.prettierignore @@ -0,0 +1,23 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +target +build +dist +binding.js +binding.d.ts +license.hbs diff --git a/javascript/.taplo.toml b/javascript/.taplo.toml new file mode 100644 index 0000000000..44b2e71dea --- /dev/null +++ b/javascript/.taplo.toml @@ -0,0 +1,24 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +exclude = ["node_modules/**/*.toml"] + +# https://taplo.tamasfe.dev/configuration/formatter-options.html +[formatting] +align_entries = true +indent_tables = true +reorder_keys = true diff --git a/javascript/Cargo.toml b/javascript/Cargo.toml new file mode 100644 index 0000000000..1f897063a1 --- /dev/null +++ b/javascript/Cargo.toml @@ -0,0 +1,42 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +[package] +edition = "2021" +name = "adbc_driver_manager" +version = "0.1.0" +license = "Apache-2.0" + +[lib] +crate-type = ["cdylib"] + +[dependencies] +napi = "3.0.0" +napi-derive = "3.0.0" +adbc_core = { path = "../rust/core" } +adbc_driver_manager = { path = "../rust/driver_manager" } +arrow-array = { version = ">=53.1.0", default-features = false, features = ["ffi"] } +arrow-ipc = { version = ">=53.1.0" } +arrow-schema = { version = ">=53.1.0" } +thiserror = "1.0" + +[build-dependencies] +napi-build = "2" + +[profile.release] +lto = true +strip = "symbols" diff --git a/javascript/LICENSE.txt b/javascript/LICENSE.txt new file mode 100644 index 0000000000..a127f3119c --- /dev/null +++ b/javascript/LICENSE.txt @@ -0,0 +1,523 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +-------------------------------------------------------------------------------- +The following crates are used under the Apache License 2.0 (see above): + adbc_driver_manager 0.1.0 + adbc_core 0.23.0 (https://github.com/apache/arrow-adbc) + adbc_driver_manager 0.23.0 (https://github.com/apache/arrow-adbc) + adbc_ffi 0.23.0 (https://github.com/apache/arrow-adbc) + ahash 0.8.12 (https://github.com/tkaitchuck/ahash) + android_system_properties 0.1.5 (https://github.com/nical/android_system_properties) + arrow-array 58.0.0 (https://github.com/apache/arrow-rs) + arrow-buffer 58.0.0 (https://github.com/apache/arrow-rs) + arrow-data 58.0.0 (https://github.com/apache/arrow-rs) + arrow-ipc 58.0.0 (https://github.com/apache/arrow-rs) + arrow-schema 58.0.0 (https://github.com/apache/arrow-rs) + arrow-select 58.0.0 (https://github.com/apache/arrow-rs) + autocfg 1.5.0 (https://github.com/cuviper/autocfg) + bitflags 2.11.0 (https://github.com/bitflags/bitflags) + bumpalo 3.20.2 (https://github.com/fitzgen/bumpalo) + cc 1.2.56 (https://github.com/rust-lang/cc-rs) + cfg-if 1.0.4 (https://github.com/rust-lang/cfg-if) + chrono 0.4.44 (https://github.com/chronotope/chrono) + const-random-macro 0.1.16 (https://github.com/tkaitchuck/constrandom) + const-random 0.1.18 (https://github.com/tkaitchuck/constrandom) + core-foundation-sys 0.8.7 (https://github.com/servo/core-foundation-rs) + ctor-proc-macro 0.0.7 (https://github.com/mmastrac/rust-ctor) + ctor 0.6.3 (https://github.com/mmastrac/rust-ctor) + dtor-proc-macro 0.0.6 (https://github.com/mmastrac/rust-ctor) + dtor 0.1.1 (https://github.com/mmastrac/rust-ctor) + find-msvc-tools 0.1.9 (https://github.com/rust-lang/cc-rs) + flatbuffers 25.12.19 (https://github.com/google/flatbuffers) + futures-channel 0.3.32 (https://github.com/rust-lang/futures-rs) + futures-core 0.3.32 (https://github.com/rust-lang/futures-rs) + futures-executor 0.3.32 (https://github.com/rust-lang/futures-rs) + futures-io 0.3.32 (https://github.com/rust-lang/futures-rs) + futures-macro 0.3.32 (https://github.com/rust-lang/futures-rs) + futures-sink 0.3.32 (https://github.com/rust-lang/futures-rs) + futures-task 0.3.32 (https://github.com/rust-lang/futures-rs) + futures-util 0.3.32 (https://github.com/rust-lang/futures-rs) + futures 0.3.32 (https://github.com/rust-lang/futures-rs) + getrandom 0.2.17 (https://github.com/rust-random/getrandom) + getrandom 0.3.4 (https://github.com/rust-random/getrandom) + half 2.7.1 (https://github.com/VoidStarKat/half-rs) + hashbrown 0.16.1 (https://github.com/rust-lang/hashbrown) + iana-time-zone-haiku 0.1.2 (https://github.com/strawlab/iana-time-zone) + iana-time-zone 0.1.65 (https://github.com/strawlab/iana-time-zone) + js-sys 0.3.91 (https://github.com/wasm-bindgen/wasm-bindgen/tree/master/crates/js-sys) + libc 0.2.182 (https://github.com/rust-lang/libc) + log 0.4.29 (https://github.com/rust-lang/log) + nohash-hasher 0.2.0 (https://github.com/paritytech/nohash-hasher) + num-bigint 0.4.6 (https://github.com/rust-num/num-bigint) + num-complex 0.4.6 (https://github.com/rust-num/num-complex) + num-integer 0.1.46 (https://github.com/rust-num/num-integer) + num-traits 0.2.19 (https://github.com/rust-num/num-traits) + once_cell 1.21.3 (https://github.com/matklad/once_cell) + pin-project-lite 0.2.17 (https://github.com/taiki-e/pin-project-lite) + proc-macro2 1.0.106 (https://github.com/dtolnay/proc-macro2) + quote 1.0.45 (https://github.com/dtolnay/quote) + r-efi 5.3.0 (https://github.com/r-efi/r-efi) + regex-automata 0.4.14 (https://github.com/rust-lang/regex) + regex-syntax 0.8.10 (https://github.com/rust-lang/regex) + regex 1.12.3 (https://github.com/rust-lang/regex) + rustc-hash 2.1.1 (https://github.com/rust-lang/rustc-hash) + rustc_version 0.4.1 (https://github.com/djc/rustc-version-rs) + rustversion 1.0.22 (https://github.com/dtolnay/rustversion) + semver 1.0.27 (https://github.com/dtolnay/semver) + serde_spanned 1.0.4 (https://github.com/toml-rs/toml) + shlex 1.3.0 (https://github.com/comex/rust-shlex) + syn 2.0.117 (https://github.com/dtolnay/syn) + thiserror-impl 1.0.69 (https://github.com/dtolnay/thiserror) + thiserror 1.0.69 (https://github.com/dtolnay/thiserror) + toml 1.0.3+spec-1.1.0 (https://github.com/toml-rs/toml) + toml_datetime 1.0.0+spec-1.1.0 (https://github.com/toml-rs/toml) + toml_parser 1.0.9+spec-1.1.0 (https://github.com/toml-rs/toml) + toml_writer 1.0.6+spec-1.1.0 (https://github.com/toml-rs/toml) + unicode-ident 1.0.24 (https://github.com/dtolnay/unicode-ident) + unicode-segmentation 1.12.0 (https://github.com/unicode-rs/unicode-segmentation) + version_check 0.9.5 (https://github.com/SergioBenitez/version_check) + wasi 0.11.1+wasi-snapshot-preview1 (https://github.com/bytecodealliance/wasi) + wasip2 1.0.2+wasi-0.2.9 (https://github.com/bytecodealliance/wasi-rs) + wasm-bindgen-macro-support 0.2.114 (https://github.com/wasm-bindgen/wasm-bindgen/tree/master/crates/macro-support) + wasm-bindgen-macro 0.2.114 (https://github.com/wasm-bindgen/wasm-bindgen/tree/master/crates/macro) + wasm-bindgen-shared 0.2.114 (https://github.com/wasm-bindgen/wasm-bindgen/tree/master/crates/shared) + wasm-bindgen 0.2.114 (https://github.com/wasm-bindgen/wasm-bindgen) + windows-core 0.62.2 (https://github.com/microsoft/windows-rs) + windows-implement 0.60.2 (https://github.com/microsoft/windows-rs) + windows-interface 0.59.3 (https://github.com/microsoft/windows-rs) + windows-link 0.2.1 (https://github.com/microsoft/windows-rs) + windows-registry 0.6.1 (https://github.com/microsoft/windows-rs) + windows-result 0.4.1 (https://github.com/microsoft/windows-rs) + windows-strings 0.5.1 (https://github.com/microsoft/windows-rs) + windows-sys 0.61.2 (https://github.com/microsoft/windows-rs) + wit-bindgen 0.51.0 (https://github.com/bytecodealliance/wit-bindgen) + zerocopy-derive 0.8.40 (https://github.com/google/zerocopy) + zerocopy 0.8.40 (https://github.com/google/zerocopy) + +-------------------------------------------------------------------------------- +Creative Commons Zero v1.0 Universal (CC0-1.0) + +The following crates are used under this license: + tiny-keccak 2.0.2 +Creative Commons Legal Code + +CC0 1.0 Universal + + CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE + LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN + ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS + INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES + REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS + PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM + THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED + HEREUNDER. + +Statement of Purpose + +The laws of most jurisdictions throughout the world automatically confer +exclusive Copyright and Related Rights (defined below) upon the creator +and subsequent owner(s) (each and all, an "owner") of an original work of +authorship and/or a database (each, a "Work"). + +Certain owners wish to permanently relinquish those rights to a Work for +the purpose of contributing to a commons of creative, cultural and +scientific works ("Commons") that the public can reliably and without fear +of later claims of infringement build upon, modify, incorporate in other +works, reuse and redistribute as freely as possible in any form whatsoever +and for any purposes, including without limitation commercial purposes. +These owners may contribute to the Commons to promote the ideal of a free +culture and the further production of creative, cultural and scientific +works, or to gain reputation or greater distribution for their Work in +part through the use and efforts of others. + +For these and/or other purposes and motivations, and without any +expectation of additional consideration or compensation, the person +associating CC0 with a Work (the "Affirmer"), to the extent that he or she +is an owner of Copyright and Related Rights in the Work, voluntarily +elects to apply CC0 to the Work and publicly distribute the Work under its +terms, with knowledge of his or her Copyright and Related Rights in the +Work and the meaning and intended legal effect of CC0 on those rights. + +1. Copyright and Related Rights. A Work made available under CC0 may be +protected by copyright and related or neighboring rights ("Copyright and +Related Rights"). Copyright and Related Rights include, but are not +limited to, the following: + + i. the right to reproduce, adapt, distribute, perform, display, + communicate, and translate a Work; + ii. moral rights retained by the original author(s) and/or performer(s); +iii. publicity and privacy rights pertaining to a person's image or + likeness depicted in a Work; + iv. rights protecting against unfair competition in regards to a Work, + subject to the limitations in paragraph 4(a), below; + v. rights protecting the extraction, dissemination, use and reuse of data + in a Work; + vi. database rights (such as those arising under Directive 96/9/EC of the + European Parliament and of the Council of 11 March 1996 on the legal + protection of databases, and under any national implementation + thereof, including any amended or successor version of such + directive); and +vii. other similar, equivalent or corresponding rights throughout the + world based on applicable law or treaty, and any national + implementations thereof. + +2. Waiver. To the greatest extent permitted by, but not in contravention +of, applicable law, Affirmer hereby overtly, fully, permanently, +irrevocably and unconditionally waives, abandons, and surrenders all of +Affirmer's Copyright and Related Rights and associated claims and causes +of action, whether now known or unknown (including existing as well as +future claims and causes of action), in the Work (i) in all territories +worldwide, (ii) for the maximum duration provided by applicable law or +treaty (including future time extensions), (iii) in any current or future +medium and for any number of copies, and (iv) for any purpose whatsoever, +including without limitation commercial, advertising or promotional +purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each +member of the public at large and to the detriment of Affirmer's heirs and +successors, fully intending that such Waiver shall not be subject to +revocation, rescission, cancellation, termination, or any other legal or +equitable action to disrupt the quiet enjoyment of the Work by the public +as contemplated by Affirmer's express Statement of Purpose. + +3. Public License Fallback. Should any part of the Waiver for any reason +be judged legally invalid or ineffective under applicable law, then the +Waiver shall be preserved to the maximum extent permitted taking into +account Affirmer's express Statement of Purpose. In addition, to the +extent the Waiver is so judged Affirmer hereby grants to each affected +person a royalty-free, non transferable, non sublicensable, non exclusive, +irrevocable and unconditional license to exercise Affirmer's Copyright and +Related Rights in the Work (i) in all territories worldwide, (ii) for the +maximum duration provided by applicable law or treaty (including future +time extensions), (iii) in any current or future medium and for any number +of copies, and (iv) for any purpose whatsoever, including without +limitation commercial, advertising or promotional purposes (the +"License"). The License shall be deemed effective as of the date CC0 was +applied by Affirmer to the Work. Should any part of the License for any +reason be judged legally invalid or ineffective under applicable law, such +partial invalidity or ineffectiveness shall not invalidate the remainder +of the License, and in such case Affirmer hereby affirms that he or she +will not (i) exercise any of his or her remaining Copyright and Related +Rights in the Work or (ii) assert any associated claims and causes of +action with respect to the Work, in either case contrary to Affirmer's +express Statement of Purpose. + +4. Limitations and Disclaimers. + + a. No trademark or patent rights held by Affirmer are waived, abandoned, + surrendered, licensed or otherwise affected by this document. + b. Affirmer offers the Work as-is and makes no representations or + warranties of any kind concerning the Work, express, implied, + statutory or otherwise, including without limitation warranties of + title, merchantability, fitness for a particular purpose, non + infringement, or the absence of latent or other defects, accuracy, or + the present or absence of errors, whether or not discoverable, all to + the greatest extent permissible under applicable law. + c. Affirmer disclaims responsibility for clearing rights of other persons + that may apply to the Work or any use thereof, including without + limitation any person's Copyright and Related Rights in the Work. + Further, Affirmer disclaims responsibility for obtaining any necessary + consents, permissions or other rights required for any use of the + Work. + d. Affirmer understands and acknowledges that Creative Commons is not a + party to this document and has no duty or obligation with respect to + this CC0 or use of the Work. + + +-------------------------------------------------------------------------------- +ISC License (ISC) + +The following crates are used under this license: + libloading 0.8.9 (https://github.com/nagisa/rust_libloading/) + libloading 0.9.0 (https://github.com/nagisa/rust_libloading/) +ISC License: + +Copyright (c) 2004-2010 by Internet Systems Consortium, Inc. ("ISC") +Copyright (c) 1995-2003 by Internet Software Consortium + +Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + +-------------------------------------------------------------------------------- +MIT License (MIT) + +The following crates are used under this license: + aho-corasick 1.1.4 (https://github.com/BurntSushi/aho-corasick) + bytes 1.11.1 (https://github.com/tokio-rs/bytes) + convert_case 0.11.0 (https://github.com/rutrum/convert-case) + crunchy 0.2.4 (https://github.com/eira-fransham/crunchy) + libm 0.2.16 (https://github.com/rust-lang/compiler-builtins) + memchr 2.8.0 (https://github.com/BurntSushi/memchr) + napi-build 2.3.1 (https://github.com/napi-rs/napi-rs) + napi-derive-backend 5.0.2 (https://github.com/napi-rs/napi-rs) + napi-derive 3.5.2 (https://github.com/napi-rs/napi-rs) + napi-sys 3.2.1 (https://github.com/napi-rs/napi-rs) + napi 3.8.3 (https://github.com/napi-rs/napi-rs) + path-slash 0.2.1 (https://github.com/rhysd/path-slash) + slab 0.4.12 (https://github.com/tokio-rs/slab) + winnow 0.7.14 (https://github.com/winnow-rs/winnow) +MIT License + +Copyright (c) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and +associated documentation files (the "Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the +following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial +portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT +LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO +EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +USE OR OTHER DEALINGS IN THE SOFTWARE. + + +-------------------------------------------------------------------------------- +Unicode License v3 (Unicode-3.0) + +The following crates are used under this license: + unicode-ident 1.0.24 (https://github.com/dtolnay/unicode-ident) +UNICODE LICENSE V3 + +COPYRIGHT AND PERMISSION NOTICE + +Copyright © 1991-2023 Unicode, Inc. + +NOTICE TO USER: Carefully read the following legal agreement. BY +DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING DATA FILES, AND/OR +SOFTWARE, YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE +TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT AGREE, DO NOT +DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA FILES OR SOFTWARE. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of data files and any associated documentation (the "Data Files") or +software and any associated documentation (the "Software") to deal in the +Data Files or Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, and/or sell +copies of the Data Files or Software, and to permit persons to whom the +Data Files or Software are furnished to do so, provided that either (a) +this copyright and permission notice appear with all copies of the Data +Files or Software, or (b) this copyright and permission notice appear in +associated Documentation. + +THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF +THIRD PARTY RIGHTS. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE +BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, +OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA +FILES OR SOFTWARE. + +Except as contained in this notice, the name of a copyright holder shall +not be used in advertising or otherwise to promote the sale, use or other +dealings in these Data Files or Software without prior written +authorization of the copyright holder. diff --git a/javascript/README.md b/javascript/README.md new file mode 100644 index 0000000000..244d840f94 --- /dev/null +++ b/javascript/README.md @@ -0,0 +1,116 @@ + + +# Apache Arrow ADBC: Node.js Driver Manager + +Node.js bindings for the [Arrow Database Connectivity (ADBC)](https://arrow.apache.org/adbc/) standard. +Built on a native [NAPI](https://nodejs.org/api/n-api.html) addon — requires Node.js 22+ and does not +support browser or Deno environments. Bun is not officially tested. + +**Alpha: APIs may change without notice.** + +## Installation + +```bash +npm install adbc-driver-manager apache-arrow +``` + +## Usage + +The `driver` option accepts either a full path to a shared library or a short +name. When using a short name, the driver manager searches system and user +paths for a matching ADBC driver manifest or library. + +```typescript +import { AdbcDatabase } from 'adbc-driver-manager' + +// Full path to a driver shared library +const db = new AdbcDatabase({ driver: '/path/to/libadbc_driver_sqlite.dylib' }) +``` + +```typescript +// Short name (resolves from system/user paths) +const db = new AdbcDatabase({ driver: 'sqlite' }) +``` + +Once you have a database, open a connection and run queries: + +```typescript +const connection = await db.connect() + +// Execute a query and iterate Arrow RecordBatches +const reader = await connection.query('SELECT 1 AS value') +for await (const batch of reader) { + console.log(batch.toArray()) +} + +// Or use the lower-level statement API +const stmt = await connection.createStatement() +await stmt.setSqlQuery('SELECT 1 AS value') +const result = await stmt.executeQuery() +for await (const batch of result) { + console.log(`Received batch with ${batch.numRows} rows`) +} +await stmt.close() + +await connection.close() +await db.close() +``` + +## Development + +### Prerequisites + +- Node.js 22+ +- Rust (latest stable) +- CMake 3.14+ and a C/C++ compiler (for building the driver libraries) +- npm (usually comes with Node.js) + +### Building from Source + +1. Install dependencies: + + ```bash + npm install + ``` + +2. Build the Rust addon: + + ```bash + npm run build:debug # debug build (faster) + npm run build # release build + ``` + +### Testing + +The tests require a built ADBC driver library (e.g. SQLite). Build everything including the SQLite driver with: + +```bash +npm run build:driver +``` + +This runs CMake to compile the C ADBC drivers into `build/lib/` and builds the Rust Node.js addon. Once built, run the tests: + +```bash +npm test +``` + +## License + +Apache-2.0 diff --git a/javascript/__test__/bind.spec.ts b/javascript/__test__/bind.spec.ts new file mode 100644 index 0000000000..2599b52721 --- /dev/null +++ b/javascript/__test__/bind.spec.ts @@ -0,0 +1,86 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import { test, before, after } from 'node:test' +import assert from 'node:assert/strict' +import { createSqliteDatabase, createTestTable } from './test_utils' +import { AdbcDatabase, AdbcConnection, AdbcStatement } from '../lib/index.js' +import { tableFromArrays, Table } from 'apache-arrow' + +let db: AdbcDatabase +let conn: AdbcConnection +let stmt: AdbcStatement + +before(async () => { + db = await createSqliteDatabase() + conn = await db.connect() + stmt = await conn.createStatement() + await createTestTable(stmt, 'bind_test') +}) + +after(async () => { + try { + await stmt?.close() + await conn?.close() + await db?.close() + } catch { + // ignore + } +}) + +test('statement: bind and query data', async () => { + const recordBatchToBind = tableFromArrays({ + id: [null], + name: ['test_name'], + }) + + assert.strictEqual(recordBatchToBind.numRows, 1) + await stmt.bind(recordBatchToBind) + + await stmt.setSqlQuery('INSERT INTO bind_test (id, name) VALUES (?, ?)') + const insertResult = await stmt.executeUpdate() + assert.strictEqual(insertResult, 1) + + await stmt.setSqlQuery('SELECT id, name FROM bind_test') + const reader = await stmt.executeQuery() + + let rowCount = 0 + for await (const batch of reader) { + rowCount += batch.numRows + const idVector = batch.getChild('id') + const nameVector = batch.getChild('name') + assert.strictEqual(idVector?.get(0), null) + assert.strictEqual(nameVector?.get(0), 'test_name') + } + + assert.strictEqual(rowCount, 1) +}) + +test('statement: bind multi-batch table throws descriptive error', async () => { + // Both batches must share the same schema instance for Table to accept them + const base = tableFromArrays({ id: [10], name: ['first'] }) + const batch1 = base.batches[0] + const batch2 = base.batches[0] // same schema, reused to construct a multi-batch Table + const multiTable = new Table([batch1, batch2]) + assert.strictEqual(multiTable.batches.length, 2) + + const stmt2 = await conn.createStatement() + const error = await stmt2.bind(multiTable).catch((e) => e) + assert.ok(error instanceof Error) + assert.match(error.message, /bind\(\).*batches|batches.*bind\(\)/i) + await stmt2.close() +}) diff --git a/javascript/__test__/error_handling.spec.ts b/javascript/__test__/error_handling.spec.ts new file mode 100644 index 0000000000..bb671c96cb --- /dev/null +++ b/javascript/__test__/error_handling.spec.ts @@ -0,0 +1,116 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import { test, before, after } from 'node:test' +import assert from 'node:assert/strict' +import { createSqliteDatabase } from './test_utils' +import { AdbcDatabase, AdbcConnection, AdbcStatement, AdbcError } from '../lib/index.js' + +let db: AdbcDatabase +let conn: AdbcConnection +let stmt: AdbcStatement + +before(async () => { + db = await createSqliteDatabase() + conn = await db.connect() + stmt = await conn.createStatement() +}) + +after(async () => { + try { + await stmt?.close() + await conn?.close() + await db?.close() + } catch { + // ignore + } +}) + +test('error: invalid sql syntax', async () => { + let error: unknown + try { + await stmt.setSqlQuery('SELECT * FROM') // Syntax error + const reader = await stmt.executeQuery() + for await (const _ of reader) { + } + } catch (e) { + error = e + } + + assert.ok(error instanceof AdbcError) + assert.match(error.message, /syntax error|incomplete input/i) + assert.strictEqual(error.code, 'InvalidArguments') + // SQLite does not expose a numeric vendor code; the ADBC sentinel (INT32_MIN) is filtered to undefined + assert.strictEqual(error.vendorCode, undefined) + // SQLite does not set a SQLSTATE for this error + assert.strictEqual(error.sqlState, undefined) +}) + +test('error: table not found', async () => { + let error: unknown + try { + await stmt.setSqlQuery('SELECT * FROM non_existent_table') + const reader = await stmt.executeQuery() + for await (const _ of reader) { + } + } catch (e) { + error = e + } + + assert.ok(error instanceof AdbcError) + assert.match(error.message, /no such table/i) + assert.strictEqual(error.code, 'InvalidArguments') + assert.strictEqual(error.vendorCode, undefined) + assert.strictEqual(error.sqlState, undefined) +}) + +test('error: constraint violation', async () => { + const setupStmt = await conn.createStatement() + await setupStmt.setSqlQuery('CREATE TABLE IF NOT EXISTS err_test (id INTEGER PRIMARY KEY)') + await setupStmt.executeUpdate() + await setupStmt.setSqlQuery('INSERT INTO err_test (id) VALUES (1)') + await setupStmt.executeUpdate() + await setupStmt.close() + + await stmt.setSqlQuery('INSERT INTO err_test (id) VALUES (1)') + let error: unknown + try { + await stmt.executeUpdate() + } catch (e) { + error = e + } + + assert.ok(error instanceof AdbcError) + assert.match(error.code, /AlreadyExists|Integrity|IO/) + assert.strictEqual(error.vendorCode, undefined) + assert.strictEqual(error.sqlState, undefined) +}) + +test('error: unsupported option', () => { + // SQLite does not support the read_only connection option at runtime + let error: unknown + try { + conn.setOption('adbc.connection.read_only', 'true') + } catch (e) { + error = e + } + + assert.ok(error instanceof AdbcError) + assert.strictEqual(error.code, 'NotImplemented') + assert.strictEqual(error.vendorCode, undefined) + assert.strictEqual(error.sqlState, undefined) +}) diff --git a/javascript/__test__/metadata.spec.ts b/javascript/__test__/metadata.spec.ts new file mode 100644 index 0000000000..36c4e04989 --- /dev/null +++ b/javascript/__test__/metadata.spec.ts @@ -0,0 +1,82 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import { test, before, after } from 'node:test' +import assert from 'node:assert/strict' +import { createSqliteDatabase, createTestTable, dumpReader } from './test_utils' +import { AdbcDatabase, AdbcConnection, AdbcStatement } from '../lib/index.js' + +let db: AdbcDatabase +let conn: AdbcConnection +let stmt: AdbcStatement + +before(async () => { + db = await createSqliteDatabase() + conn = await db.connect() + stmt = await conn.createStatement() + await createTestTable(stmt, 'metadata_test') +}) + +after(async () => { + try { + await stmt?.close() + await conn?.close() + await db?.close() + } catch (e) { + console.error('Error cleaning up test resources:', e) + } +}) + +test('metadata: getTableTypes', async () => { + const tableTypes = await dumpReader(await conn.getTableTypes()) + + // Sort actual results for consistent comparison + tableTypes.sort((a, b) => (a.table_type || '').localeCompare(b.table_type || '')) + + assert.strictEqual(tableTypes[0].table_type, 'table') + assert.strictEqual(tableTypes[1].table_type, 'view') +}) + +test('metadata: getTableSchema', async () => { + const schema = await conn.getTableSchema({ tableName: 'metadata_test' }) + + assert.strictEqual(schema.fields[0].name, 'id') + assert.strictEqual(schema.fields[0].nullable, true) + assert.strictEqual(schema.fields[1].name, 'name') + assert.strictEqual(schema.fields[1].nullable, true) +}) + +test('metadata: getObjects', async () => { + // SQLite structure: Catalog (null/main) -> Schemas (null/main) -> Tables + const objects = await dumpReader( + await conn.getObjects({ + depth: 3, + tableName: 'metadata_test', + tableType: ['table', 'view'], + }), + ) + + const tables = objects[0].catalog_db_schemas[0].db_schema_tables + assert.ok(tables.some((t: { table_name: string }) => t.table_name === 'metadata_test')) +}) + +test('metadata: getInfo', async () => { + const info = await dumpReader(await conn.getInfo()) + + assert.strictEqual(info[0].info_name, 0) + assert.strictEqual(info[0].info_value, 'SQLite') +}) diff --git a/javascript/__test__/options.spec.ts b/javascript/__test__/options.spec.ts new file mode 100644 index 0000000000..0aca070e51 --- /dev/null +++ b/javascript/__test__/options.spec.ts @@ -0,0 +1,82 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import { test, before, after } from 'node:test' +import assert from 'node:assert/strict' +import { createSqliteDatabase } from './test_utils' +import { AdbcDatabase, AdbcConnection, AdbcStatement, AdbcError } from '../lib/index.js' + +let db: AdbcDatabase +let conn: AdbcConnection +let stmt: AdbcStatement + +before(async () => { + db = await createSqliteDatabase() + conn = await db.connect() + stmt = await conn.createStatement() +}) + +after(async () => { + try { + await stmt?.close() + await conn?.close() + await db?.close() + } catch { + // ignore + } +}) + +test('options: connection setOption', () => { + // Test setting autocommit via canonical ADBC key (supported by SQLite) + assert.doesNotThrow(() => { + conn.setOption('adbc.connection.autocommit', 'true') + }) + + // Test setting read_only via canonical ADBC key (not supported by SQLite at runtime) + let errorReadOnly: unknown + try { + conn.setOption('adbc.connection.read_only', 'false') + } catch (e) { + errorReadOnly = e + } + assert.ok(errorReadOnly instanceof AdbcError) + assert.strictEqual(errorReadOnly.code, 'NotImplemented') + assert.match(errorReadOnly.message, /Unknown connection option/i) + + // Test setting generic option (SQLite driver is strict and rejects unknown options) + let errorCustom: unknown + try { + conn.setOption('custom_option', 'custom_value') + } catch (e) { + errorCustom = e + } + assert.ok(errorCustom instanceof AdbcError) + assert.strictEqual(errorCustom.code, 'NotImplemented') +}) + +test('options: statement setOption', () => { + // Test setting an unknown statement option (SQLite driver is strict) + let error: unknown + try { + stmt.setOption('adbc.stmt.some_option', 'value') + } catch (e) { + error = e + } + assert.ok(error instanceof AdbcError) + assert.strictEqual(error.code, 'NotImplemented') + assert.match(error.message, /Unknown statement option/i) +}) diff --git a/javascript/__test__/profile.spec.ts b/javascript/__test__/profile.spec.ts new file mode 100644 index 0000000000..6405773749 --- /dev/null +++ b/javascript/__test__/profile.spec.ts @@ -0,0 +1,80 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import { test } from 'node:test' +import assert from 'node:assert/strict' +import { mkdtempSync, writeFileSync, rmSync } from 'node:fs' +import { join, isAbsolute } from 'node:path' +import { tmpdir } from 'node:os' +import { AdbcDatabase } from '../lib/index.js' +import { dumpReader } from './test_utils.js' + +const testLib = process.env.ADBC_DRIVER_MANAGER_TEST_LIB + +test('profile: load database from profile:// URI', async () => { + const driver = testLib ?? 'sqlite' + const tmpDir = mkdtempSync(join(tmpdir(), 'adbc-profile-test-')) + try { + // Create a SQLite file with a known table so we can confirm the profile + // is actually pointing us at the right database. + const dbPath = join(tmpDir, 'test.db') + const setupDb = new AdbcDatabase({ driver, databaseOptions: { uri: dbPath } }) + const setupConn = await setupDb.connect() + await setupConn.execute('CREATE TABLE profile_marker (id INTEGER, value TEXT)') + await setupConn.execute("INSERT INTO profile_marker VALUES (42, 'from_profile')") + await setupConn.close() + await setupDb.close() + + // TOML requires forward slashes — backslashes are escape sequences + const toml = (p: string) => p.replaceAll('\\', '/') + writeFileSync( + join(tmpDir, 'test_sqlite.toml'), + `version = 1\ndriver = "${toml(driver)}"\n\n[options]\nuri = "${toml(dbPath)}"\n`, + ) + + const db = new AdbcDatabase({ + driver: 'profile://test_sqlite', + searchPaths: [tmpDir], + }) + const conn = await db.connect() + + const rows = await dumpReader(await conn.query('SELECT id, value FROM profile_marker')) + assert.strictEqual(rows.length, 1) + assert.strictEqual(rows[0].id, 42n) + assert.strictEqual(rows[0].value, 'from_profile') + + await conn.close() + await db.close() + } finally { + rmSync(tmpDir, { recursive: true }) + } +}) + +// URI-style driver strings require a short name as the scheme — skip when the +// test env var is set to an absolute path (e.g. on Windows CI). +test('profile: load database from sqlite: URI', { skip: testLib !== undefined && isAbsolute(testLib) }, async () => { + const driver = testLib ?? 'sqlite' + const db = new AdbcDatabase({ + driver: `${driver}::memory:`, + }) + const conn = await db.connect() + + await conn.query('SELECT 1 AS n') + + await conn.close() + await db.close() +}) diff --git a/javascript/__test__/query.spec.ts b/javascript/__test__/query.spec.ts new file mode 100644 index 0000000000..f38675a5bf --- /dev/null +++ b/javascript/__test__/query.spec.ts @@ -0,0 +1,117 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import { test, before, after } from 'node:test' +import assert from 'node:assert/strict' +import { createSqliteDatabase, createTestTable, dumpReader } from './test_utils' +import { AdbcDatabase, AdbcConnection, AdbcStatement } from '../lib/index.js' +import { tableFromArrays } from 'apache-arrow' + +let db: AdbcDatabase +let conn: AdbcConnection +let stmt: AdbcStatement + +before(async () => { + db = await createSqliteDatabase() + conn = await db.connect() + stmt = await conn.createStatement() + + await createTestTable(stmt, 'query_test') + await stmt.setSqlQuery(`INSERT INTO query_test (id, name) VALUES (1, 'alice'), (2, 'bob'), (3, 'carol')`) + await stmt.executeUpdate() +}) + +after(async () => { + try { + await stmt?.close() + await conn?.close() + await db?.close() + } catch { + // ignore + } +}) + +test('query: SELECT returns correct rows', async () => { + await stmt.setSqlQuery('SELECT id, name FROM query_test ORDER BY id') + const reader = await stmt.executeQuery() + + const rows: { id: unknown; name: unknown }[] = [] + for await (const batch of reader) { + const idCol = batch.getChild('id') + const nameCol = batch.getChild('name') + for (let i = 0; i < batch.numRows; i++) { + rows.push({ id: idCol?.get(i), name: nameCol?.get(i) }) + } + } + + assert.strictEqual(rows.length, 3) + assert.strictEqual(rows[0].name, 'alice') + assert.strictEqual(rows[1].name, 'bob') + assert.strictEqual(rows[2].name, 'carol') +}) + +test('query: executeUpdate returns affected row count', async () => { + const stmt = await conn.createStatement() + try { + await stmt.setSqlQuery(`UPDATE query_test SET name = 'updated' WHERE id = 1`) + const affected = await stmt.executeUpdate() + assert.strictEqual(typeof affected, 'number') + assert.strictEqual(affected, 1) + } finally { + await stmt.close() + } +}) + +test('query: conn.query() returns correct rows', async () => { + // id=2 (bob) is never mutated by other tests in this file + const rows = await dumpReader(await conn.query('SELECT id, name FROM query_test WHERE id = 2')) + assert.strictEqual(rows.length, 1) + assert.strictEqual(rows[0].name, 'bob') +}) + +test('query: conn.execute() returns affected row count', async () => { + const affected = await conn.execute(`UPDATE query_test SET name = 'via_execute' WHERE id = 3`) + assert.strictEqual(affected, 1) +}) + +test('query: conn.execute() with bound params inserts a row', async () => { + const params = tableFromArrays({ id: [99], name: ['bound_insert'] }) + const affected = await conn.execute('INSERT INTO query_test (id, name) VALUES (?, ?)', params) + assert.strictEqual(affected, 1) + + const rows = await dumpReader(await conn.query('SELECT name FROM query_test WHERE id = 99')) + assert.strictEqual(rows.length, 1) + assert.strictEqual(rows[0].name, 'bound_insert') +}) + +test('query: empty result set', async () => { + // Use a fresh statement — ADBC statements should not be reused after executeQuery + const stmt = await conn.createStatement() + try { + await stmt.setSqlQuery('SELECT * FROM query_test WHERE id = 9999') + const reader = await stmt.executeQuery() + + let rowCount = 0 + for await (const batch of reader) { + rowCount += batch.numRows + } + + assert.strictEqual(rowCount, 0) + } finally { + await stmt.close() + } +}) diff --git a/javascript/__test__/safety.spec.ts b/javascript/__test__/safety.spec.ts new file mode 100644 index 0000000000..ced7fb1581 --- /dev/null +++ b/javascript/__test__/safety.spec.ts @@ -0,0 +1,90 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import { test, before, after } from 'node:test' +import assert from 'node:assert/strict' +import { createSqliteDatabase } from './test_utils' +import { AdbcDatabase, AdbcConnection, AdbcStatement } from '../lib/index.js' + +let db: AdbcDatabase | undefined +let conn: AdbcConnection | undefined +let stmt: AdbcStatement | undefined + +before(async () => { + db = await createSqliteDatabase() + conn = await db.connect() + stmt = await conn.createStatement() + await stmt.setSqlQuery('SELECT 1 as val') +}) + +after(async () => { + try { + if (stmt) await stmt.close() + } catch {} + try { + if (conn) await conn.close() + } catch {} + try { + if (db) await db.close() + } catch {} +}) + +test('safety: iterator survives connection close', async () => { + // Rationale: + // The ADBC C API Specification states regarding Resource Management: + // "Releasing a parent object does not automatically release child objects, but it may invalidate them." + // (https://arrow.apache.org/adbc/current/c/api/index.html#resource-management) + // + // In a raw C application, accessing a Child (Iterator) after closing the Parent (Connection) + // would often result in a Use-After-Free (Segfault). + // + // However, in Node.js, a Segfault is unacceptable. This driver implementation (via the Rust adbc_driver_manager) + // uses Reference Counting (Arc) to manage the lifecycle of the underlying C structs. + // When we "Close" the connection in JavaScript, we are releasing the JavaScript handle's + // reference to the resource. + // + // The Iterator (Reader) holds its own strong reference to the underlying Statement/Connection + // to ensure it can safely finish reading. The actual C-level teardown of the Connection + // only occurs when *all* references (Connection handle + all active Iterators) are dropped. + // + // This test verifies that "Safety" mechanism: ensuring that premature closure of the parent + // handle does not crash the process or interrupt the child stream. + + // Get Reader (which holds iterator) + const reader = await stmt!.executeQuery() + + // Close Statement and Connection immediately. + // The Iterator (inside Reader) should keep the underlying resources alive. + await stmt!.close() + stmt = undefined + + await conn!.close() + conn = undefined + + await db!.close() + db = undefined + + // Iterate — must still work despite all handles being closed + let rowCount = 0 + for await (const batch of reader) { + rowCount += batch.numRows + const valVector = batch.getChild('val') + assert.strictEqual(valVector?.get(0), 1n) + } + + assert.strictEqual(rowCount, 1) +}) diff --git a/javascript/__test__/test_utils.ts b/javascript/__test__/test_utils.ts new file mode 100644 index 0000000000..c845e5812b --- /dev/null +++ b/javascript/__test__/test_utils.ts @@ -0,0 +1,73 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import { RecordBatchReader } from 'apache-arrow' +import { AdbcDatabase, AdbcStatement } from '../lib/index.js' + +export async function createSqliteDatabase(): Promise { + const driver = process.env.ADBC_DRIVER_MANAGER_TEST_LIB ?? 'sqlite' + return new AdbcDatabase({ driver }) +} + +export async function createTestTable(stmt: AdbcStatement, tableName: string = 'test_table'): Promise { + try { + await stmt.setSqlQuery(`DROP TABLE IF EXISTS ${tableName}`) + await stmt.executeUpdate() + } catch { + // Ignore errors + } + await stmt.setSqlQuery(`CREATE TABLE ${tableName} (id INTEGER, name TEXT)`) + await stmt.executeUpdate() +} + +export async function dumpReader(reader: RecordBatchReader): Promise { + const rows: any[] = [] + for await (const batch of reader) { + for (const row of batch) { + rows.push(deepUnwrap(row?.toJSON())) + } + } + return rows +} + +function deepUnwrap(obj: any): any { + if (obj === null || obj === undefined) return obj + + if (Array.isArray(obj)) { + return obj.map(deepUnwrap) + } + + // Heuristic to identify Arrow Vectors: iterable and has a 'get' method + if ( + typeof obj === 'object' && + obj !== null && + typeof obj[Symbol.iterator] === 'function' && + typeof obj.get === 'function' + ) { + return [...obj].map(deepUnwrap) + } + + if (typeof obj === 'object') { + const result: any = {} + for (const key of Object.keys(obj)) { + result[key] = deepUnwrap(obj[key]) + } + return result + } + + return obj +} diff --git a/javascript/__test__/transaction.spec.ts b/javascript/__test__/transaction.spec.ts new file mode 100644 index 0000000000..a325d1f1b0 --- /dev/null +++ b/javascript/__test__/transaction.spec.ts @@ -0,0 +1,97 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import { test, before, after } from 'node:test' +import assert from 'node:assert/strict' +import { createSqliteDatabase, createTestTable } from './test_utils' +import { AdbcDatabase, AdbcConnection, AdbcStatement } from '../lib/index.js' + +let db: AdbcDatabase +let conn: AdbcConnection +let stmt: AdbcStatement + +before(async () => { + db = await createSqliteDatabase() + conn = await db.connect() + stmt = await conn.createStatement() + await createTestTable(stmt, 'tx_test') +}) + +after(async () => { + try { + await stmt?.close() + await conn?.close() + await db?.close() + } catch { + // ignore + } +}) + +test('transaction: rollback reverts changes', async () => { + conn.setAutoCommit(false) + + const newStmt = await conn.createStatement() + try { + await newStmt.setSqlQuery('INSERT INTO tx_test (id) VALUES (1)') + await newStmt.executeUpdate() + + await conn.rollback() + + await newStmt.setSqlQuery('SELECT * FROM tx_test') + const reader = await newStmt.executeQuery() + let count = 0 + for await (const batch of reader) count += batch.numRows + assert.strictEqual(count, 0) + } finally { + await newStmt.close() + } +}) + +test('transaction: commit persists changes', async () => { + conn.setAutoCommit(false) + + const newStmt = await conn.createStatement() + try { + await newStmt.setSqlQuery('INSERT INTO tx_test (id) VALUES (2)') + const affectedRows = await newStmt.executeUpdate() + assert.strictEqual(affectedRows, 1) + + // Verify row is visible before commit (within the transaction) + await newStmt.setSqlQuery('SELECT * FROM tx_test') + const readerBeforeCommit = await newStmt.executeQuery() + let countBeforeCommit = 0 + for await (const batch of readerBeforeCommit) countBeforeCommit += batch.numRows + assert.strictEqual(countBeforeCommit, 1) + + await conn.commit() + + // ADBC Spec: "Calling commit or rollback on the connection may invalidate active statements." + // Create a fresh statement to read back the committed data. + const verifyStmt = await conn.createStatement() + try { + await verifyStmt.setSqlQuery('SELECT * FROM tx_test') + const reader = await verifyStmt.executeQuery() + let count = 0 + for await (const batch of reader) count += batch.numRows + assert.strictEqual(count, 1) + } finally { + await verifyStmt.close() + } + } finally { + await newStmt.close() + } +}) diff --git a/javascript/about.toml b/javascript/about.toml new file mode 100644 index 0000000000..5e82de2bbd --- /dev/null +++ b/javascript/about.toml @@ -0,0 +1,24 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +accepted = [ + "Apache-2.0", + "MIT", + "ISC", + "Unicode-3.0", + "CC0-1.0", +] diff --git a/javascript/binding.d.ts b/javascript/binding.d.ts new file mode 100644 index 0000000000..c771d3ea75 --- /dev/null +++ b/javascript/binding.d.ts @@ -0,0 +1,66 @@ +/* auto-generated by NAPI-RS */ +/* eslint-disable */ +export declare class NativeAdbcConnection { + createStatement(): Promise + setOption(key: string, value: string): void + getObjects(opts: GetObjectsOptions): Promise + getTableSchema(opts: GetTableSchemaOptions): Promise + getTableTypes(): Promise + getInfo(infoCodes?: Array | undefined | null): Promise + commit(): Promise + rollback(): Promise + close(): void +} +export type _NativeAdbcConnection = NativeAdbcConnection + +export declare class NativeAdbcDatabase { + constructor(opts: ConnectOptions) + connect(options?: Record | undefined | null): Promise + close(): void +} +export type _NativeAdbcDatabase = NativeAdbcDatabase + +export declare class NativeAdbcResultIterator { + next(): Promise + close(): void +} +export type _NativeAdbcResultIterator = NativeAdbcResultIterator + +export declare class NativeAdbcStatement { + setSqlQuery(query: string): void + setOption(key: string, value: string): void + executeQuery(): Promise + executeUpdate(): Promise + bind(data: Buffer): Promise + close(): void +} +export type _NativeAdbcStatement = NativeAdbcStatement + +export interface ConnectOptions { + driver: string + entrypoint?: string + searchPaths?: Array + loadFlags?: number + databaseOptions?: Record +} + +export declare function crateVersion(): string + +export declare function defaultAdbcVersion(): string + +export declare function defaultLoadFlags(): number + +export interface GetObjectsOptions { + depth: number + catalog?: string + dbSchema?: string + tableName?: string + tableType?: Array + columnName?: string +} + +export interface GetTableSchemaOptions { + catalog?: string + dbSchema?: string + tableName: string +} diff --git a/javascript/binding.js b/javascript/binding.js new file mode 100644 index 0000000000..fa19e91dc9 --- /dev/null +++ b/javascript/binding.js @@ -0,0 +1,589 @@ +// prettier-ignore +/* eslint-disable */ +// @ts-nocheck +/* auto-generated by NAPI-RS */ + +const { readFileSync } = require('node:fs') +let nativeBinding = null +const loadErrors = [] + +const isMusl = () => { + let musl = false + if (process.platform === 'linux') { + musl = isMuslFromFilesystem() + if (musl === null) { + musl = isMuslFromReport() + } + if (musl === null) { + musl = isMuslFromChildProcess() + } + } + return musl +} + +const isFileMusl = (f) => f.includes('libc.musl-') || f.includes('ld-musl-') + +const isMuslFromFilesystem = () => { + try { + return readFileSync('/usr/bin/ldd', 'utf-8').includes('musl') + } catch { + return null + } +} + +const isMuslFromReport = () => { + let report = null + if (typeof process.report?.getReport === 'function') { + process.report.excludeNetwork = true + report = process.report.getReport() + } + if (!report) { + return null + } + if (report.header && report.header.glibcVersionRuntime) { + return false + } + if (Array.isArray(report.sharedObjects)) { + if (report.sharedObjects.some(isFileMusl)) { + return true + } + } + return false +} + +const isMuslFromChildProcess = () => { + try { + return require('child_process').execSync('ldd --version', { encoding: 'utf8' }).includes('musl') + } catch (e) { + // If we reach this case, we don't know if the system is musl or not, so is better to just fallback to false + return false + } +} + +function requireNative() { + if (process.env.NAPI_RS_NATIVE_LIBRARY_PATH) { + try { + return require(process.env.NAPI_RS_NATIVE_LIBRARY_PATH); + } catch (err) { + loadErrors.push(err) + } + } else if (process.platform === 'android') { + if (process.arch === 'arm64') { + try { + return require('./adbc-driver-manager.android-arm64.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('adbc-driver-manager-android-arm64') + const bindingPackageVersion = require('adbc-driver-manager-android-arm64/package.json').version + if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } else if (process.arch === 'arm') { + try { + return require('./adbc-driver-manager.android-arm-eabi.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('adbc-driver-manager-android-arm-eabi') + const bindingPackageVersion = require('adbc-driver-manager-android-arm-eabi/package.json').version + if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } else { + loadErrors.push(new Error(`Unsupported architecture on Android ${process.arch}`)) + } + } else if (process.platform === 'win32') { + if (process.arch === 'x64') { + if (process.config?.variables?.shlib_suffix === 'dll.a' || process.config?.variables?.node_target_type === 'shared_library') { + try { + return require('./adbc-driver-manager.win32-x64-gnu.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('adbc-driver-manager-win32-x64-gnu') + const bindingPackageVersion = require('adbc-driver-manager-win32-x64-gnu/package.json').version + if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } else { + try { + return require('./adbc-driver-manager.win32-x64-msvc.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('adbc-driver-manager-win32-x64-msvc') + const bindingPackageVersion = require('adbc-driver-manager-win32-x64-msvc/package.json').version + if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } + } else if (process.arch === 'ia32') { + try { + return require('./adbc-driver-manager.win32-ia32-msvc.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('adbc-driver-manager-win32-ia32-msvc') + const bindingPackageVersion = require('adbc-driver-manager-win32-ia32-msvc/package.json').version + if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } else if (process.arch === 'arm64') { + try { + return require('./adbc-driver-manager.win32-arm64-msvc.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('adbc-driver-manager-win32-arm64-msvc') + const bindingPackageVersion = require('adbc-driver-manager-win32-arm64-msvc/package.json').version + if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } else { + loadErrors.push(new Error(`Unsupported architecture on Windows: ${process.arch}`)) + } + } else if (process.platform === 'darwin') { + try { + return require('./adbc-driver-manager.darwin-universal.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('adbc-driver-manager-darwin-universal') + const bindingPackageVersion = require('adbc-driver-manager-darwin-universal/package.json').version + if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + if (process.arch === 'x64') { + try { + return require('./adbc-driver-manager.darwin-x64.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('adbc-driver-manager-darwin-x64') + const bindingPackageVersion = require('adbc-driver-manager-darwin-x64/package.json').version + if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } else if (process.arch === 'arm64') { + try { + return require('./adbc-driver-manager.darwin-arm64.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('adbc-driver-manager-darwin-arm64') + const bindingPackageVersion = require('adbc-driver-manager-darwin-arm64/package.json').version + if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } else { + loadErrors.push(new Error(`Unsupported architecture on macOS: ${process.arch}`)) + } + } else if (process.platform === 'freebsd') { + if (process.arch === 'x64') { + try { + return require('./adbc-driver-manager.freebsd-x64.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('adbc-driver-manager-freebsd-x64') + const bindingPackageVersion = require('adbc-driver-manager-freebsd-x64/package.json').version + if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } else if (process.arch === 'arm64') { + try { + return require('./adbc-driver-manager.freebsd-arm64.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('adbc-driver-manager-freebsd-arm64') + const bindingPackageVersion = require('adbc-driver-manager-freebsd-arm64/package.json').version + if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } else { + loadErrors.push(new Error(`Unsupported architecture on FreeBSD: ${process.arch}`)) + } + } else if (process.platform === 'linux') { + if (process.arch === 'x64') { + if (isMusl()) { + try { + return require('./adbc-driver-manager.linux-x64-musl.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('adbc-driver-manager-linux-x64-musl') + const bindingPackageVersion = require('adbc-driver-manager-linux-x64-musl/package.json').version + if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } else { + try { + return require('./adbc-driver-manager.linux-x64-gnu.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('adbc-driver-manager-linux-x64-gnu') + const bindingPackageVersion = require('adbc-driver-manager-linux-x64-gnu/package.json').version + if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } + } else if (process.arch === 'arm64') { + if (isMusl()) { + try { + return require('./adbc-driver-manager.linux-arm64-musl.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('adbc-driver-manager-linux-arm64-musl') + const bindingPackageVersion = require('adbc-driver-manager-linux-arm64-musl/package.json').version + if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } else { + try { + return require('./adbc-driver-manager.linux-arm64-gnu.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('adbc-driver-manager-linux-arm64-gnu') + const bindingPackageVersion = require('adbc-driver-manager-linux-arm64-gnu/package.json').version + if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } + } else if (process.arch === 'arm') { + if (isMusl()) { + try { + return require('./adbc-driver-manager.linux-arm-musleabihf.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('adbc-driver-manager-linux-arm-musleabihf') + const bindingPackageVersion = require('adbc-driver-manager-linux-arm-musleabihf/package.json').version + if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } else { + try { + return require('./adbc-driver-manager.linux-arm-gnueabihf.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('adbc-driver-manager-linux-arm-gnueabihf') + const bindingPackageVersion = require('adbc-driver-manager-linux-arm-gnueabihf/package.json').version + if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } + } else if (process.arch === 'loong64') { + if (isMusl()) { + try { + return require('./adbc-driver-manager.linux-loong64-musl.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('adbc-driver-manager-linux-loong64-musl') + const bindingPackageVersion = require('adbc-driver-manager-linux-loong64-musl/package.json').version + if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } else { + try { + return require('./adbc-driver-manager.linux-loong64-gnu.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('adbc-driver-manager-linux-loong64-gnu') + const bindingPackageVersion = require('adbc-driver-manager-linux-loong64-gnu/package.json').version + if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } + } else if (process.arch === 'riscv64') { + if (isMusl()) { + try { + return require('./adbc-driver-manager.linux-riscv64-musl.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('adbc-driver-manager-linux-riscv64-musl') + const bindingPackageVersion = require('adbc-driver-manager-linux-riscv64-musl/package.json').version + if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } else { + try { + return require('./adbc-driver-manager.linux-riscv64-gnu.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('adbc-driver-manager-linux-riscv64-gnu') + const bindingPackageVersion = require('adbc-driver-manager-linux-riscv64-gnu/package.json').version + if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } + } else if (process.arch === 'ppc64') { + try { + return require('./adbc-driver-manager.linux-ppc64-gnu.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('adbc-driver-manager-linux-ppc64-gnu') + const bindingPackageVersion = require('adbc-driver-manager-linux-ppc64-gnu/package.json').version + if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } else if (process.arch === 's390x') { + try { + return require('./adbc-driver-manager.linux-s390x-gnu.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('adbc-driver-manager-linux-s390x-gnu') + const bindingPackageVersion = require('adbc-driver-manager-linux-s390x-gnu/package.json').version + if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } else { + loadErrors.push(new Error(`Unsupported architecture on Linux: ${process.arch}`)) + } + } else if (process.platform === 'openharmony') { + if (process.arch === 'arm64') { + try { + return require('./adbc-driver-manager.openharmony-arm64.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('adbc-driver-manager-openharmony-arm64') + const bindingPackageVersion = require('adbc-driver-manager-openharmony-arm64/package.json').version + if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } else if (process.arch === 'x64') { + try { + return require('./adbc-driver-manager.openharmony-x64.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('adbc-driver-manager-openharmony-x64') + const bindingPackageVersion = require('adbc-driver-manager-openharmony-x64/package.json').version + if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } else if (process.arch === 'arm') { + try { + return require('./adbc-driver-manager.openharmony-arm.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('adbc-driver-manager-openharmony-arm') + const bindingPackageVersion = require('adbc-driver-manager-openharmony-arm/package.json').version + if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } else { + loadErrors.push(new Error(`Unsupported architecture on OpenHarmony: ${process.arch}`)) + } + } else { + loadErrors.push(new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`)) + } +} + +nativeBinding = requireNative() + +if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) { + let wasiBinding = null + let wasiBindingError = null + try { + wasiBinding = require('./adbc-driver-manager.wasi.cjs') + nativeBinding = wasiBinding + } catch (err) { + if (process.env.NAPI_RS_FORCE_WASI) { + wasiBindingError = err + } + } + if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) { + try { + wasiBinding = require('adbc-driver-manager-wasm32-wasi') + nativeBinding = wasiBinding + } catch (err) { + if (process.env.NAPI_RS_FORCE_WASI) { + if (!wasiBindingError) { + wasiBindingError = err + } else { + wasiBindingError.cause = err + } + loadErrors.push(err) + } + } + } + if (process.env.NAPI_RS_FORCE_WASI === 'error' && !wasiBinding) { + const error = new Error('WASI binding not found and NAPI_RS_FORCE_WASI is set to error') + error.cause = wasiBindingError + throw error + } +} + +if (!nativeBinding) { + if (loadErrors.length > 0) { + throw new Error( + `Cannot find native binding. ` + + `npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). ` + + 'Please try `npm i` again after removing both package-lock.json and node_modules directory.', + { + cause: loadErrors.reduce((err, cur) => { + cur.cause = err + return cur + }), + }, + ) + } + throw new Error(`Failed to load native binding`) +} + +module.exports = nativeBinding +module.exports.NativeAdbcConnection = nativeBinding.NativeAdbcConnection +module.exports._NativeAdbcConnection = nativeBinding._NativeAdbcConnection +module.exports.NativeAdbcDatabase = nativeBinding.NativeAdbcDatabase +module.exports._NativeAdbcDatabase = nativeBinding._NativeAdbcDatabase +module.exports.NativeAdbcResultIterator = nativeBinding.NativeAdbcResultIterator +module.exports._NativeAdbcResultIterator = nativeBinding._NativeAdbcResultIterator +module.exports.NativeAdbcStatement = nativeBinding.NativeAdbcStatement +module.exports._NativeAdbcStatement = nativeBinding._NativeAdbcStatement +module.exports.crateVersion = nativeBinding.crateVersion +module.exports.defaultAdbcVersion = nativeBinding.defaultAdbcVersion +module.exports.defaultLoadFlags = nativeBinding.defaultLoadFlags diff --git a/javascript/build.rs b/javascript/build.rs new file mode 100644 index 0000000000..4b034faafb --- /dev/null +++ b/javascript/build.rs @@ -0,0 +1,20 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +fn main() { + napi_build::setup(); +} diff --git a/javascript/lib/error.ts b/javascript/lib/error.ts new file mode 100644 index 0000000000..e145480a69 --- /dev/null +++ b/javascript/lib/error.ts @@ -0,0 +1,46 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * Structured error class for ADBC operations. + */ +export class AdbcError extends Error { + code: string + vendorCode?: number + sqlState?: string + + constructor(message: string, code: string, vendorCode?: number, sqlState?: string) { + super(message) + this.name = 'AdbcError' + this.code = code + this.vendorCode = vendorCode + this.sqlState = sqlState + } + + /** + * Promotes a raw error thrown by the native binding into a structured AdbcError. + * + * Non-ADBC errors (e.g. a standard JS TypeError) are returned unmodified. + */ + static fromError(err: any): any { + if (err instanceof Error && err.name === 'AdbcError') { + const e = err as any + return new AdbcError(e.message, e.code ?? 'UNKNOWN', e.vendorCode, e.sqlState) + } + return err + } +} diff --git a/javascript/lib/index.ts b/javascript/lib/index.ts new file mode 100644 index 0000000000..181a9f82d8 --- /dev/null +++ b/javascript/lib/index.ts @@ -0,0 +1,331 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import { NativeAdbcDatabase, NativeAdbcConnection, NativeAdbcStatement } from '../binding.js' + +import type { + AdbcDatabase as AdbcDatabaseInterface, + AdbcConnection as AdbcConnectionInterface, + AdbcStatement as AdbcStatementInterface, + ConnectOptions, + GetObjectsOptions, +} from './types.js' +import { LoadFlags, ObjectDepth, InfoCode } from './types.js' + +import { RecordBatchReader, RecordBatch, Table, tableToIPC, Schema } from 'apache-arrow' +import { AdbcError } from './error.js' + +// Safely define Symbol.asyncDispose for compatibility with Node.js environments older than v21. +const asyncDisposeSymbol = (Symbol as any).asyncDispose ?? Symbol('Symbol.asyncDispose') + +type NativeIterator = { next(): Promise; close(): void } + +/** + * Converts the native result iterator into an Apache Arrow `RecordBatchReader`. + * + * The native iterator yields Arrow IPC stream bytes (schema + record batches) as a + * Node.js `Buffer`. Since `Buffer` is a subclass of `Uint8Array`, we can wrap the + * iterator directly as `AsyncIterable` and pass it to + * `RecordBatchReader.from()`, which accepts an async iterable of IPC bytes and + * returns a standard Arrow `RecordBatchReader`. + */ +async function iteratorToReader(iterator: NativeIterator): Promise { + const asyncIterable: AsyncIterable = { + [Symbol.asyncIterator]: async function* () { + try { + while (true) { + const chunk = await iterator.next().catch((e) => { + throw AdbcError.fromError(e) + }) + if (!chunk) { + break + } + yield chunk as Uint8Array + } + } finally { + try { + iterator.close() + } catch {} + } + }, + } + return RecordBatchReader.from(asyncIterable) +} + +// Export Options types, constants, and Error class +export type { ConnectOptions, GetObjectsOptions } +export { AdbcError, LoadFlags, ObjectDepth, InfoCode } + +/** + * Represents an ADBC Database. + */ +export class AdbcDatabase implements AdbcDatabaseInterface { + private _inner: NativeAdbcDatabase + + constructor(options: ConnectOptions) { + try { + this._inner = new NativeAdbcDatabase(options) + } catch (e) { + throw AdbcError.fromError(e) + } + } + + async connect(): Promise { + try { + const connInner = await this._inner.connect(null) + return new AdbcConnection(connInner as NativeAdbcConnection) + } catch (e) { + throw AdbcError.fromError(e) + } + } + + async close(): Promise { + try { + await this._inner.close() + } catch (e) { + throw AdbcError.fromError(e) + } + } + + async [asyncDisposeSymbol](): Promise { + return this.close() + } +} + +/** + * Represents a single connection to a database. + */ +export class AdbcConnection implements AdbcConnectionInterface { + private _inner: NativeAdbcConnection + + constructor(inner: NativeAdbcConnection) { + this._inner = inner + } + + async createStatement(): Promise { + try { + const stmtInner = await this._inner.createStatement() + return new AdbcStatement(stmtInner as NativeAdbcStatement) + } catch (e) { + throw AdbcError.fromError(e) + } + } + + setOption(key: string, value: string): void { + try { + this._inner.setOption(key, value) + } catch (e) { + throw AdbcError.fromError(e) + } + } + + setAutoCommit(enabled: boolean): void { + this.setOption('adbc.connection.autocommit', enabled ? 'true' : 'false') + } + + setReadOnly(enabled: boolean): void { + this.setOption('adbc.connection.read_only', enabled ? 'true' : 'false') + } + + async getObjects(options?: GetObjectsOptions): Promise { + try { + const opts = { + depth: options?.depth ?? 0, + catalog: options?.catalog, + dbSchema: options?.dbSchema, + tableName: options?.tableName, + tableType: options?.tableType, + columnName: options?.columnName, + } + const iterator = await this._inner.getObjects(opts) + return iteratorToReader(iterator as NativeIterator) + } catch (e) { + throw AdbcError.fromError(e) + } + } + + async getTableSchema(options: { catalog?: string; dbSchema?: string; tableName: string }): Promise { + try { + const buffer = await this._inner.getTableSchema(options) + const reader = RecordBatchReader.from(buffer as Uint8Array) + if (!reader.schema) { + await reader.next() + } + return reader.schema + } catch (e) { + throw AdbcError.fromError(e) + } + } + + async getTableTypes(): Promise { + try { + const iterator = await this._inner.getTableTypes() + return iteratorToReader(iterator as NativeIterator) + } catch (e) { + throw AdbcError.fromError(e) + } + } + + async getInfo(infoCodes?: InfoCode[]): Promise { + try { + const iterator = await this._inner.getInfo(infoCodes) + return iteratorToReader(iterator as NativeIterator) + } catch (e) { + throw AdbcError.fromError(e) + } + } + + async query(sql: string, params?: RecordBatch | Table): Promise { + const stmt = await this.createStatement() + try { + await stmt.setSqlQuery(sql) + if (params !== undefined) { + await stmt.bind(params) + } + return await stmt.executeQuery() + } finally { + await stmt.close() + } + } + + async execute(sql: string, params?: RecordBatch | Table): Promise { + const stmt = await this.createStatement() + try { + await stmt.setSqlQuery(sql) + if (params !== undefined) { + await stmt.bind(params) + } + return await stmt.executeUpdate() + } finally { + await stmt.close() + } + } + + async commit(): Promise { + try { + await this._inner.commit() + } catch (e) { + throw AdbcError.fromError(e) + } + } + + async rollback(): Promise { + try { + await this._inner.rollback() + } catch (e) { + throw AdbcError.fromError(e) + } + } + + async close(): Promise { + try { + await this._inner.close() + } catch (e) { + throw AdbcError.fromError(e) + } + } + + async [asyncDisposeSymbol](): Promise { + return this.close() + } +} + +/** + * Represents a query statement. + */ +export class AdbcStatement implements AdbcStatementInterface { + private _inner: NativeAdbcStatement + + constructor(inner: NativeAdbcStatement) { + this._inner = inner + } + + async setSqlQuery(query: string): Promise { + try { + this._inner.setSqlQuery(query) + } catch (e) { + throw AdbcError.fromError(e) + } + } + + setOption(key: string, value: string): void { + try { + this._inner.setOption(key, value) + } catch (e) { + throw AdbcError.fromError(e) + } + } + + /** + * Execute the query and return a RecordBatchReader. + * + * Per the ADBC spec, behavior is undefined if the statement is reused after + * calling executeQuery(). Create a new statement for each query. + */ + async executeQuery(): Promise { + try { + const iterator = await this._inner.executeQuery() + return iteratorToReader(iterator as NativeIterator) + } catch (e) { + throw AdbcError.fromError(e) + } + } + + async executeUpdate(): Promise { + try { + const rows = await this._inner.executeUpdate() + return rows as number + } catch (e) { + throw AdbcError.fromError(e) + } + } + + async bind(data: RecordBatch | Table): Promise { + try { + let table: Table + if (data instanceof Table) { + table = data + } else { + table = new Table(data) + } + + if (table.batches.length > 1) { + throw new Error( + `bind() requires a single-batch Table or RecordBatch, but received ${table.batches.length} batches. ` + + `Concatenate the table into one batch first (e.g. tableFromArrays(...)).`, + ) + } + + const ipcBytes = tableToIPC(table, 'stream') + await this._inner.bind(Buffer.from(ipcBytes)) + } catch (e) { + throw AdbcError.fromError(e) + } + } + + async close(): Promise { + try { + await this._inner.close() + } catch (e) { + throw AdbcError.fromError(e) + } + } + + async [asyncDisposeSymbol](): Promise { + return this.close() + } +} diff --git a/javascript/lib/types.ts b/javascript/lib/types.ts new file mode 100644 index 0000000000..bf506d12b4 --- /dev/null +++ b/javascript/lib/types.ts @@ -0,0 +1,354 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import { RecordBatch, RecordBatchReader, Table, Schema } from 'apache-arrow' + +/** + * Bitmask flags controlling how the driver manager resolves a driver name. + * + * These values correspond to the `ADBC_LOAD_FLAG_*` constants in the ADBC spec. + * Flags can be combined with bitwise OR. When `loadFlags` is omitted in + * `ConnectOptions`, `LoadFlags.Default` is used. + * + * @example + * // Only search system paths, disallow relative paths + * const db = new AdbcDatabase({ + * driver: 'sqlite', + * loadFlags: LoadFlags.SearchSystem, + * }) + */ +export const LoadFlags = { + /** Search directory paths in the `ADBC_DRIVER_PATH` environment variable (and the conda environment, if installed via conda). */ + SearchEnv: 1 << 1, + /** Search the user configuration directory. */ + SearchUser: 1 << 2, + /** Search the system configuration directory. */ + SearchSystem: 1 << 3, + /** Allow a relative path to be provided as the driver name. */ + AllowRelativePaths: 1 << 4, + /** All defined flags enabled. This is the default when `loadFlags` is omitted. */ + Default: (1 << 1) | (1 << 2) | (1 << 3) | (1 << 4), +} as const +export type LoadFlags = (typeof LoadFlags)[keyof typeof LoadFlags] + +/** + * Depth values for the `getObjects` metadata call. + * + * These correspond to the `ADBC_OBJECT_DEPTH_*` constants in the ADBC spec. + * + * @example + * // Retrieve catalogs and schemas only + * await conn.getObjects({ depth: ObjectDepth.Schemas }) + */ +export const ObjectDepth = { + /** Catalogs, schemas, tables, and columns (default). */ + All: 0, + /** Catalogs only. */ + Catalogs: 1, + /** Catalogs and schemas. */ + Schemas: 2, + /** Catalogs, schemas, and tables. */ + Tables: 3, +} as const +export type ObjectDepth = (typeof ObjectDepth)[keyof typeof ObjectDepth] + +/** + * Info codes for the `getInfo` metadata call. + * + * These correspond to the `ADBC_INFO_*` constants in the ADBC spec. + * Pass a subset to `getInfo()` to retrieve only specific metadata fields. + * + * @example + * const reader = await conn.getInfo([InfoCode.VendorName, InfoCode.DriverVersion]) + */ +export const InfoCode = { + /** The database vendor/product name (string). */ + VendorName: 0, + /** The database vendor/product version (string). */ + VendorVersion: 1, + /** The Arrow library version used by the vendor (string). */ + VendorArrowVersion: 2, + /** Whether the vendor supports SQL queries (bool). */ + VendorSql: 3, + /** Whether the vendor supports Substrait queries (bool). */ + VendorSubstrait: 4, + /** Minimum supported Substrait version, or null (string). */ + VendorSubstraitMinVersion: 5, + /** Maximum supported Substrait version, or null (string). */ + VendorSubstraitMaxVersion: 6, + /** The driver name (string). */ + DriverName: 100, + /** The driver version (string). */ + DriverVersion: 101, + /** The Arrow library version used by the driver (string). */ + DriverArrowVersion: 102, + /** The ADBC API version implemented by the driver (int64). Available since ADBC 1.1.0. */ + DriverAdbcVersion: 103, +} as const +export type InfoCode = (typeof InfoCode)[keyof typeof InfoCode] + +/** + * Options for connecting to a driver/database. + * + * These options configure how the ADBC driver is loaded and how the initial connection is established. + */ +export interface ConnectOptions { + /** + * Driver to load. Accepts any of the following forms: + * - Short name: `"sqlite"`, `"postgresql"` — the driver manager searches for a matching + * manifest file (e.g. `sqlite.toml`) in the configured directories, then falls back to + * `LD_LIBRARY_PATH` / `PATH`. + * - Absolute path to a shared library: `"/usr/lib/libadbc_driver_sqlite.so"` + * - Absolute path to a driver manifest `.toml` file (with or without the `.toml` extension). + * - Relative path (only valid when {@link LoadFlags.AllowRelativePaths} is set). + * - URI-style string: `"sqlite:file::memory:"`, `"postgresql://user:pass@host/db"` — the + * driver name is the URI scheme and the remainder is passed as the connection URI. + * - Connection profile URI: `"profile://my_profile"` — loads a named profile from a + * `.toml` file found in {@link searchPaths} or the default search directories. + */ + driver: string + /** + * Name of the entrypoint function (optional). + * If not provided, ADBC will attempt to guess the entrypoint symbol name based on the driver name. + */ + entrypoint?: string + /** + * Additional directories to search for drivers and driver manifest (`.toml`) profile files (optional). + * Searched before the default system and user configuration directories. + */ + searchPaths?: string[] + /** + * Bitmask controlling how the driver name is resolved (optional). + * Use the {@link LoadFlags} constants to compose a value. + * Defaults to {@link LoadFlags.Default} (all search locations enabled) when omitted. + */ + loadFlags?: number + /** + * Database-specific options. + * Key-value pairs passed to the driver during database initialization (e.g., "uri", "username"). + */ + databaseOptions?: Record +} + +/** Options for getObjects metadata call. */ +export interface GetObjectsOptions { + /** + * The level of depth to retrieve. Use the {@link ObjectDepth} constants. + * Defaults to {@link ObjectDepth.All} when omitted. + */ + depth?: ObjectDepth + /** Filter by catalog name pattern. */ + catalog?: string + /** Filter by database schema name pattern. */ + dbSchema?: string + /** Filter by table name pattern. */ + tableName?: string + /** Filter by table type (e.g., ["table", "view"]). */ + tableType?: string[] + /** Filter by column name pattern. */ + columnName?: string +} + +/** + * Represents an ADBC Database. + * + * An AdbcDatabase represents a handle to a database. This may be a single file (SQLite), + * a connection configuration (PostgreSQL), or an in-memory database. + * It holds state that is shared across multiple connections. + */ +export interface AdbcDatabase { + /** + * Open a new connection to the database. + * + * @returns A Promise resolving to a new AdbcConnection. + */ + connect(): Promise + + /** + * Release the database resources. + * After closing, the database object should not be used. + */ + close(): Promise +} + +/** + * Represents a single connection to a database. + * + * An AdbcConnection maintains the state of a connection to the database, such as + * current transaction state and session options. + */ +export interface AdbcConnection { + /** + * Create a new statement for executing queries. + * + * @returns A Promise resolving to a new AdbcStatement. + */ + createStatement(): Promise + + /** + * Set an option on the connection. + * + * @param key The option name (e.g., "adbc.connection.autocommit"). + * @param value The option value. + */ + setOption(key: string, value: string): void + + /** + * Toggle autocommit behavior. + * + * @param enabled Whether autocommit should be enabled. + */ + setAutoCommit(enabled: boolean): void + + /** + * Toggle read-only mode. + * + * @param enabled Whether the connection should be read-only. + */ + setReadOnly(enabled: boolean): void + + /** + * Get a hierarchical view of database objects (catalogs, schemas, tables, columns). + * + * @param options Filtering options for the metadata query. + * @returns A RecordBatchReader containing the metadata. + */ + getObjects(options?: GetObjectsOptions): Promise + + /** + * Get the Arrow schema for a specific table. + * + * @param options An object containing catalog, dbSchema, and tableName. + * @param options.catalog The catalog name (or undefined). + * @param options.dbSchema The schema name (or undefined). + * @param options.tableName The table name. + * @returns A Promise resolving to the Arrow Schema of the table. + */ + getTableSchema(options: { catalog?: string; dbSchema?: string; tableName: string }): Promise + + /** + * Get a list of table types supported by the database. + * + * @returns A RecordBatchReader containing a single string column of table types. + */ + getTableTypes(): Promise + + /** + * Get metadata about the driver and database. + * + * @param infoCodes Optional list of info codes to retrieve. Use the {@link InfoCode} constants. + * If omitted, all available info is returned. + * @returns A RecordBatchReader containing the requested metadata info. + */ + getInfo(infoCodes?: InfoCode[]): Promise + + /** + * Execute a SQL query and return the results as a RecordBatchReader. + * + * Convenience method that creates a statement, sets the SQL, optionally binds + * parameters, executes the query, and closes the statement. The reader remains + * valid after the statement is closed because the underlying iterator holds its + * own reference to the native resources. + * + * @param sql The SQL query to execute. + * @param params Optional Arrow RecordBatch or Table to bind as parameters. + * @returns A Promise resolving to an Apache Arrow RecordBatchReader. + */ + query(sql: string, params?: RecordBatch | Table): Promise + + /** + * Execute a SQL statement (INSERT, UPDATE, DELETE, DDL) and return the row count. + * + * Convenience method that creates a statement, sets the SQL, optionally binds + * parameters, executes the update, and closes the statement. + * + * @param sql The SQL statement to execute. + * @param params Optional Arrow RecordBatch or Table to bind as parameters. + * @returns A Promise resolving to the number of rows affected, or -1 if unknown. + */ + execute(sql: string, params?: RecordBatch | Table): Promise + + /** + * Commit any pending transactions. + * Only valid if autocommit is disabled. + */ + commit(): Promise + + /** + * Rollback any pending transactions. + * Only valid if autocommit is disabled. + */ + rollback(): Promise + + /** + * Close the connection and release resources. + */ + close(): Promise +} + +/** + * Represents a query statement. + * + * An AdbcStatement is used to execute SQL queries or prepare bulk insertions. + * State such as the SQL query string or bound parameters is held by the statement. + */ +export interface AdbcStatement { + /** + * Set the SQL query string. + * + * @param query The SQL query to execute. + */ + setSqlQuery(query: string): Promise + + /** + * Set an option on the statement. + * + * @param key The option name (e.g., "adbc.ingest.target_table"). + * @param value The option value. + */ + setOption(key: string, value: string): void + + /** + * Execute the query and return a stream of results. + * + * @returns A Promise resolving to an Apache Arrow RecordBatchReader. + * The reader must be consumed or closed to release resources. + */ + executeQuery(): Promise + + /** + * Execute an update command (e.g., INSERT, UPDATE, DELETE) that returns no data. + * + * @returns A Promise resolving to the number of rows affected (if known), or -1. + */ + executeUpdate(): Promise + + /** + * Bind parameters or data for ingestion. + * + * This binds an Arrow RecordBatch or Table to the statement. + * This is used for bulk ingestion or parameterized queries. + * + * @param data Arrow RecordBatch or Table containing the data to bind. + */ + bind(data: RecordBatch | Table): Promise + + /** + * Close the statement and release resources. + */ + close(): Promise +} diff --git a/javascript/license.hbs b/javascript/license.hbs new file mode 100644 index 0000000000..785c37f2e4 --- /dev/null +++ b/javascript/license.hbs @@ -0,0 +1,33 @@ +{{!-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--}} +{{#each licenses}}{{#if first_of_kind}} +-------------------------------------------------------------------------------- +{{#if (eq id "Apache-2.0")}} +The following crates are used under the Apache License 2.0 (see above): +{{else}} +{{name}} ({{id}}) + +The following crates are used under this license: +{{/if}} +{{#each used_by}} {{crate.name}} {{crate.version}}{{#if crate.repository}} ({{crate.repository}}){{/if}} +{{/each}} +{{#unless (eq id "Apache-2.0")}} +{{{text}}} +{{/unless~}} +{{/if}}{{/each}} diff --git a/javascript/npm/darwin-arm64/README.md b/javascript/npm/darwin-arm64/README.md new file mode 100644 index 0000000000..ee43332a08 --- /dev/null +++ b/javascript/npm/darwin-arm64/README.md @@ -0,0 +1,22 @@ + + +# `adbc-driver-manager-darwin-arm64` + +This is the **aarch64-apple-darwin** binary for `adbc-driver-manager` diff --git a/javascript/npm/darwin-arm64/package.json b/javascript/npm/darwin-arm64/package.json new file mode 100644 index 0000000000..70d6ac8831 --- /dev/null +++ b/javascript/npm/darwin-arm64/package.json @@ -0,0 +1,24 @@ +{ + "name": "adbc-driver-manager-darwin-arm64", + "version": "0.0.1", + "cpu": [ + "arm64" + ], + "main": "adbc-driver-manager.darwin-arm64.node", + "files": [ + "adbc-driver-manager.darwin-arm64.node" + ], + "description": "Node.js ADBC Driver Manager", + "license": "Apache-2.0", + "engines": { + "node": ">=22.0.0" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/apache/arrow-adbc.git", + "directory": "javascript" + }, + "os": [ + "darwin" + ] +} diff --git a/javascript/npm/darwin-x64/README.md b/javascript/npm/darwin-x64/README.md new file mode 100644 index 0000000000..2ae2bc9522 --- /dev/null +++ b/javascript/npm/darwin-x64/README.md @@ -0,0 +1,22 @@ + + +# `adbc-driver-manager-darwin-x64` + +This is the **x86_64-apple-darwin** binary for `adbc-driver-manager` diff --git a/javascript/npm/darwin-x64/package.json b/javascript/npm/darwin-x64/package.json new file mode 100644 index 0000000000..e635cc5d79 --- /dev/null +++ b/javascript/npm/darwin-x64/package.json @@ -0,0 +1,24 @@ +{ + "name": "adbc-driver-manager-darwin-x64", + "version": "0.0.1", + "cpu": [ + "x64" + ], + "main": "adbc-driver-manager.darwin-x64.node", + "files": [ + "adbc-driver-manager.darwin-x64.node" + ], + "description": "Node.js ADBC Driver Manager", + "license": "Apache-2.0", + "engines": { + "node": ">=22.0.0" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/apache/arrow-adbc.git", + "directory": "javascript" + }, + "os": [ + "darwin" + ] +} diff --git a/javascript/npm/linux-arm64-gnu/README.md b/javascript/npm/linux-arm64-gnu/README.md new file mode 100644 index 0000000000..2473065bbb --- /dev/null +++ b/javascript/npm/linux-arm64-gnu/README.md @@ -0,0 +1,22 @@ + + +# `adbc-driver-manager-linux-arm64-gnu` + +This is the **aarch64-unknown-linux-gnu** binary for `adbc-driver-manager` diff --git a/javascript/npm/linux-arm64-gnu/package.json b/javascript/npm/linux-arm64-gnu/package.json new file mode 100644 index 0000000000..952bfc205a --- /dev/null +++ b/javascript/npm/linux-arm64-gnu/package.json @@ -0,0 +1,27 @@ +{ + "name": "adbc-driver-manager-linux-arm64-gnu", + "version": "0.0.1", + "cpu": [ + "arm64" + ], + "main": "adbc-driver-manager.linux-arm64-gnu.node", + "files": [ + "adbc-driver-manager.linux-arm64-gnu.node" + ], + "description": "Node.js ADBC Driver Manager", + "license": "Apache-2.0", + "engines": { + "node": ">=22.0.0" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/apache/arrow-adbc.git", + "directory": "javascript" + }, + "os": [ + "linux" + ], + "libc": [ + "glibc" + ] +} diff --git a/javascript/npm/linux-x64-gnu/README.md b/javascript/npm/linux-x64-gnu/README.md new file mode 100644 index 0000000000..384513ab3d --- /dev/null +++ b/javascript/npm/linux-x64-gnu/README.md @@ -0,0 +1,22 @@ + + +# `adbc-driver-manager-linux-x64-gnu` + +This is the **x86_64-unknown-linux-gnu** binary for `adbc-driver-manager` diff --git a/javascript/npm/linux-x64-gnu/package.json b/javascript/npm/linux-x64-gnu/package.json new file mode 100644 index 0000000000..ae5fbd9dc9 --- /dev/null +++ b/javascript/npm/linux-x64-gnu/package.json @@ -0,0 +1,27 @@ +{ + "name": "adbc-driver-manager-linux-x64-gnu", + "version": "0.0.1", + "cpu": [ + "x64" + ], + "main": "adbc-driver-manager.linux-x64-gnu.node", + "files": [ + "adbc-driver-manager.linux-x64-gnu.node" + ], + "description": "Node.js ADBC Driver Manager", + "license": "Apache-2.0", + "engines": { + "node": ">=22.0.0" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/apache/arrow-adbc.git", + "directory": "javascript" + }, + "os": [ + "linux" + ], + "libc": [ + "glibc" + ] +} diff --git a/javascript/npm/win32-x64-msvc/README.md b/javascript/npm/win32-x64-msvc/README.md new file mode 100644 index 0000000000..76b0257818 --- /dev/null +++ b/javascript/npm/win32-x64-msvc/README.md @@ -0,0 +1,22 @@ + + +# `adbc-driver-manager-win32-x64-msvc` + +This is the **x86_64-pc-windows-msvc** binary for `adbc-driver-manager` diff --git a/javascript/npm/win32-x64-msvc/package.json b/javascript/npm/win32-x64-msvc/package.json new file mode 100644 index 0000000000..cc637a175f --- /dev/null +++ b/javascript/npm/win32-x64-msvc/package.json @@ -0,0 +1,24 @@ +{ + "name": "adbc-driver-manager-win32-x64-msvc", + "version": "0.0.1", + "cpu": [ + "x64" + ], + "main": "adbc-driver-manager.win32-x64-msvc.node", + "files": [ + "adbc-driver-manager.win32-x64-msvc.node" + ], + "description": "Node.js ADBC Driver Manager", + "license": "Apache-2.0", + "engines": { + "node": ">=22.0.0" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/apache/arrow-adbc.git", + "directory": "javascript" + }, + "os": [ + "win32" + ] +} diff --git a/javascript/package-lock.json b/javascript/package-lock.json new file mode 100644 index 0000000000..f143331cc1 --- /dev/null +++ b/javascript/package-lock.json @@ -0,0 +1,3608 @@ +{ + "name": "adbc-driver-manager", + "version": "0.0.1", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "adbc-driver-manager", + "version": "0.0.1", + "license": "Apache-2.0", + "devDependencies": { + "@napi-rs/cli": "^3.2.0", + "@taplo/cli": "^0.7.0", + "husky": "^9.1.7", + "lint-staged": "^16.1.6", + "oxlint": "^1.14.0", + "prettier": "^3.6.2", + "tsx": "^4.0.0", + "typescript": "^5.9.2" + }, + "engines": { + "node": ">=22.0.0" + }, + "optionalDependencies": { + "adbc-driver-manager-darwin-arm64": "0.0.1", + "adbc-driver-manager-darwin-x64": "0.0.1", + "adbc-driver-manager-linux-arm64-gnu": "0.0.1", + "adbc-driver-manager-linux-x64-gnu": "0.0.1", + "adbc-driver-manager-win32-x64-msvc": "0.0.1" + }, + "peerDependencies": { + "apache-arrow": "^21.1.0" + } + }, + "node_modules/@emnapi/core": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.8.1.tgz", + "integrity": "sha512-AvT9QFpxK0Zd8J0jopedNm+w/2fIzvtPKPjqyw9jwvBaReTTqPBk9Hixaz7KbjimP+QNz605/XnjFcDAL2pqBg==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/wasi-threads": "1.1.0", + "tslib": "^2.4.0" + } + }, + "node_modules/@emnapi/runtime": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.8.1.tgz", + "integrity": "sha512-mehfKSMWjjNol8659Z8KxEMrdSJDDot5SXMq00dM8BN4o+CLNXQ0xH2V7EchNHV4RmbZLmmPdEaXZc5H2FXmDg==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@emnapi/wasi-threads": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.1.0.tgz", + "integrity": "sha512-WI0DdZ8xFSbgMjR1sFsKABJ/C5OnRrjT06JXbZKexJGrDuPTzZdDYfFlsgcCXCyf+suG5QU2e/y1Wo2V/OapLQ==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.3.tgz", + "integrity": "sha512-9fJMTNFTWZMh5qwrBItuziu834eOCUcEqymSH7pY+zoMVEZg3gcPuBNxH1EvfVYe9h0x/Ptw8KBzv7qxb7l8dg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.27.3.tgz", + "integrity": "sha512-i5D1hPY7GIQmXlXhs2w8AWHhenb00+GxjxRncS2ZM7YNVGNfaMxgzSGuO8o8SJzRc/oZwU2bcScvVERk03QhzA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.27.3.tgz", + "integrity": "sha512-YdghPYUmj/FX2SYKJ0OZxf+iaKgMsKHVPF1MAq/P8WirnSpCStzKJFjOjzsW0QQ7oIAiccHdcqjbHmJxRb/dmg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.27.3.tgz", + "integrity": "sha512-IN/0BNTkHtk8lkOM8JWAYFg4ORxBkZQf9zXiEOfERX/CzxW3Vg1ewAhU7QSWQpVIzTW+b8Xy+lGzdYXV6UZObQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.3.tgz", + "integrity": "sha512-Re491k7ByTVRy0t3EKWajdLIr0gz2kKKfzafkth4Q8A5n1xTHrkqZgLLjFEHVD+AXdUGgQMq+Godfq45mGpCKg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.27.3.tgz", + "integrity": "sha512-vHk/hA7/1AckjGzRqi6wbo+jaShzRowYip6rt6q7VYEDX4LEy1pZfDpdxCBnGtl+A5zq8iXDcyuxwtv3hNtHFg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.3.tgz", + "integrity": "sha512-ipTYM2fjt3kQAYOvo6vcxJx3nBYAzPjgTCk7QEgZG8AUO3ydUhvelmhrbOheMnGOlaSFUoHXB6un+A7q4ygY9w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.27.3.tgz", + "integrity": "sha512-dDk0X87T7mI6U3K9VjWtHOXqwAMJBNN2r7bejDsc+j03SEjtD9HrOl8gVFByeM0aJksoUuUVU9TBaZa2rgj0oA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.27.3.tgz", + "integrity": "sha512-s6nPv2QkSupJwLYyfS+gwdirm0ukyTFNl3KTgZEAiJDd+iHZcbTPPcWCcRYH+WlNbwChgH2QkE9NSlNrMT8Gfw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.27.3.tgz", + "integrity": "sha512-sZOuFz/xWnZ4KH3YfFrKCf1WyPZHakVzTiqji3WDc0BCl2kBwiJLCXpzLzUBLgmp4veFZdvN5ChW4Eq/8Fc2Fg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.27.3.tgz", + "integrity": "sha512-yGlQYjdxtLdh0a3jHjuwOrxQjOZYD/C9PfdbgJJF3TIZWnm/tMd/RcNiLngiu4iwcBAOezdnSLAwQDPqTmtTYg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.27.3.tgz", + "integrity": "sha512-WO60Sn8ly3gtzhyjATDgieJNet/KqsDlX5nRC5Y3oTFcS1l0KWba+SEa9Ja1GfDqSF1z6hif/SkpQJbL63cgOA==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.27.3.tgz", + "integrity": "sha512-APsymYA6sGcZ4pD6k+UxbDjOFSvPWyZhjaiPyl/f79xKxwTnrn5QUnXR5prvetuaSMsb4jgeHewIDCIWljrSxw==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.27.3.tgz", + "integrity": "sha512-eizBnTeBefojtDb9nSh4vvVQ3V9Qf9Df01PfawPcRzJH4gFSgrObw+LveUyDoKU3kxi5+9RJTCWlj4FjYXVPEA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.27.3.tgz", + "integrity": "sha512-3Emwh0r5wmfm3ssTWRQSyVhbOHvqegUDRd0WhmXKX2mkHJe1SFCMJhagUleMq+Uci34wLSipf8Lagt4LlpRFWQ==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.27.3.tgz", + "integrity": "sha512-pBHUx9LzXWBc7MFIEEL0yD/ZVtNgLytvx60gES28GcWMqil8ElCYR4kvbV2BDqsHOvVDRrOxGySBM9Fcv744hw==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.27.3.tgz", + "integrity": "sha512-Czi8yzXUWIQYAtL/2y6vogER8pvcsOsk5cpwL4Gk5nJqH5UZiVByIY8Eorm5R13gq+DQKYg0+JyQoytLQas4dA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.3.tgz", + "integrity": "sha512-sDpk0RgmTCR/5HguIZa9n9u+HVKf40fbEUt+iTzSnCaGvY9kFP0YKBWZtJaraonFnqef5SlJ8/TiPAxzyS+UoA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.27.3.tgz", + "integrity": "sha512-P14lFKJl/DdaE00LItAukUdZO5iqNH7+PjoBm+fLQjtxfcfFE20Xf5CrLsmZdq5LFFZzb5JMZ9grUwvtVYzjiA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.3.tgz", + "integrity": "sha512-AIcMP77AvirGbRl/UZFTq5hjXK+2wC7qFRGoHSDrZ5v5b8DK/GYpXW3CPRL53NkvDqb9D+alBiC/dV0Fb7eJcw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.27.3.tgz", + "integrity": "sha512-DnW2sRrBzA+YnE70LKqnM3P+z8vehfJWHXECbwBmH/CU51z6FiqTQTHFenPlHmo3a8UgpLyH3PT+87OViOh1AQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openharmony-arm64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.3.tgz", + "integrity": "sha512-NinAEgr/etERPTsZJ7aEZQvvg/A6IsZG/LgZy+81wON2huV7SrK3e63dU0XhyZP4RKGyTm7aOgmQk0bGp0fy2g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.27.3.tgz", + "integrity": "sha512-PanZ+nEz+eWoBJ8/f8HKxTTD172SKwdXebZ0ndd953gt1HRBbhMsaNqjTyYLGLPdoWHy4zLU7bDVJztF5f3BHA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.27.3.tgz", + "integrity": "sha512-B2t59lWWYrbRDw/tjiWOuzSsFh1Y/E95ofKz7rIVYSQkUYBjfSgf6oeYPNWHToFRr2zx52JKApIcAS/D5TUBnA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.27.3.tgz", + "integrity": "sha512-QLKSFeXNS8+tHW7tZpMtjlNb7HKau0QDpwm49u0vUp9y1WOF+PEzkU84y9GqYaAVW8aH8f3GcBck26jh54cX4Q==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.27.3.tgz", + "integrity": "sha512-4uJGhsxuptu3OcpVAzli+/gWusVGwZZHTlS63hh++ehExkVT8SgiEf7/uC/PclrPPkLhZqGgCTjd0VWLo6xMqA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@inquirer/ansi": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@inquirer/ansi/-/ansi-2.0.3.tgz", + "integrity": "sha512-g44zhR3NIKVs0zUesa4iMzExmZpLUdTLRMCStqX3GE5NT6VkPcxQGJ+uC8tDgBUC/vB1rUhUd55cOf++4NZcmw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0" + } + }, + "node_modules/@inquirer/checkbox": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@inquirer/checkbox/-/checkbox-5.1.0.tgz", + "integrity": "sha512-/HjF1LN0a1h4/OFsbGKHNDtWICFU/dqXCdym719HFTyJo9IG7Otr+ziGWc9S0iQuohRZllh+WprSgd5UW5Fw0g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@inquirer/ansi": "^2.0.3", + "@inquirer/core": "^11.1.5", + "@inquirer/figures": "^2.0.3", + "@inquirer/type": "^4.0.3" + }, + "engines": { + "node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0" + }, + "peerDependencies": { + "@types/node": ">=18" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + } + }, + "node_modules/@inquirer/confirm": { + "version": "6.0.8", + "resolved": "https://registry.npmjs.org/@inquirer/confirm/-/confirm-6.0.8.tgz", + "integrity": "sha512-Di6dgmiZ9xCSUxWUReWTqDtbhXCuG2MQm2xmgSAIruzQzBqNf49b8E07/vbCYY506kDe8BiwJbegXweG8M1klw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@inquirer/core": "^11.1.5", + "@inquirer/type": "^4.0.3" + }, + "engines": { + "node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0" + }, + "peerDependencies": { + "@types/node": ">=18" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + } + }, + "node_modules/@inquirer/core": { + "version": "11.1.5", + "resolved": "https://registry.npmjs.org/@inquirer/core/-/core-11.1.5.tgz", + "integrity": "sha512-QQPAX+lka8GyLcZ7u7Nb1h6q72iZ/oy0blilC3IB2nSt1Qqxp7akt94Jqhi/DzARuN3Eo9QwJRvtl4tmVe4T5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@inquirer/ansi": "^2.0.3", + "@inquirer/figures": "^2.0.3", + "@inquirer/type": "^4.0.3", + "cli-width": "^4.1.0", + "fast-wrap-ansi": "^0.2.0", + "mute-stream": "^3.0.0", + "signal-exit": "^4.1.0" + }, + "engines": { + "node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0" + }, + "peerDependencies": { + "@types/node": ">=18" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + } + }, + "node_modules/@inquirer/editor": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/@inquirer/editor/-/editor-5.0.8.tgz", + "integrity": "sha512-sLcpbb9B3XqUEGrj1N66KwhDhEckzZ4nI/W6SvLXyBX8Wic3LDLENlWRvkOGpCPoserabe+MxQkpiMoI8irvyA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@inquirer/core": "^11.1.5", + "@inquirer/external-editor": "^2.0.3", + "@inquirer/type": "^4.0.3" + }, + "engines": { + "node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0" + }, + "peerDependencies": { + "@types/node": ">=18" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + } + }, + "node_modules/@inquirer/expand": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/@inquirer/expand/-/expand-5.0.8.tgz", + "integrity": "sha512-QieW3F1prNw3j+hxO7/NKkG1pk3oz7pOB6+5Upwu3OIwADfPX0oZVppsqlL+Vl/uBHHDSOBY0BirLctLnXwGGg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@inquirer/core": "^11.1.5", + "@inquirer/type": "^4.0.3" + }, + "engines": { + "node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0" + }, + "peerDependencies": { + "@types/node": ">=18" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + } + }, + "node_modules/@inquirer/external-editor": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@inquirer/external-editor/-/external-editor-2.0.3.tgz", + "integrity": "sha512-LgyI7Agbda74/cL5MvA88iDpvdXI2KuMBCGRkbCl2Dg1vzHeOgs+s0SDcXV7b+WZJrv2+ERpWSM65Fpi9VfY3w==", + "dev": true, + "license": "MIT", + "dependencies": { + "chardet": "^2.1.1", + "iconv-lite": "^0.7.2" + }, + "engines": { + "node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0" + }, + "peerDependencies": { + "@types/node": ">=18" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + } + }, + "node_modules/@inquirer/figures": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@inquirer/figures/-/figures-2.0.3.tgz", + "integrity": "sha512-y09iGt3JKoOCBQ3w4YrSJdokcD8ciSlMIWsD+auPu+OZpfxLuyz+gICAQ6GCBOmJJt4KEQGHuZSVff2jiNOy7g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0" + } + }, + "node_modules/@inquirer/input": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/@inquirer/input/-/input-5.0.8.tgz", + "integrity": "sha512-p0IJslw0AmedLEkOU+yrEX3Aj2RTpQq7ZOf8nc1DIhjzaxRWrrgeuE5Kyh39fVRgtcACaMXx/9WNo8+GjgBOfw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@inquirer/core": "^11.1.5", + "@inquirer/type": "^4.0.3" + }, + "engines": { + "node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0" + }, + "peerDependencies": { + "@types/node": ">=18" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + } + }, + "node_modules/@inquirer/number": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/@inquirer/number/-/number-4.0.8.tgz", + "integrity": "sha512-uGLiQah9A0F9UIvJBX52m0CnqtLaym0WpT9V4YZrjZ+YRDKZdwwoEPz06N6w8ChE2lrnsdyhY9sL+Y690Kh9gQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@inquirer/core": "^11.1.5", + "@inquirer/type": "^4.0.3" + }, + "engines": { + "node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0" + }, + "peerDependencies": { + "@types/node": ">=18" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + } + }, + "node_modules/@inquirer/password": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/@inquirer/password/-/password-5.0.8.tgz", + "integrity": "sha512-zt1sF4lYLdvPqvmvHdmjOzuUUjuCQ897pdUCO8RbXMUDKXJTTyOQgtn23le+jwcb+MpHl3VAFvzIdxRAf6aPlA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@inquirer/ansi": "^2.0.3", + "@inquirer/core": "^11.1.5", + "@inquirer/type": "^4.0.3" + }, + "engines": { + "node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0" + }, + "peerDependencies": { + "@types/node": ">=18" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + } + }, + "node_modules/@inquirer/prompts": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/@inquirer/prompts/-/prompts-8.3.0.tgz", + "integrity": "sha512-JAj66kjdH/F1+B7LCigjARbwstt3SNUOSzMdjpsvwJmzunK88gJeXmcm95L9nw1KynvFVuY4SzXh/3Y0lvtgSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@inquirer/checkbox": "^5.1.0", + "@inquirer/confirm": "^6.0.8", + "@inquirer/editor": "^5.0.8", + "@inquirer/expand": "^5.0.8", + "@inquirer/input": "^5.0.8", + "@inquirer/number": "^4.0.8", + "@inquirer/password": "^5.0.8", + "@inquirer/rawlist": "^5.2.4", + "@inquirer/search": "^4.1.4", + "@inquirer/select": "^5.1.0" + }, + "engines": { + "node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0" + }, + "peerDependencies": { + "@types/node": ">=18" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + } + }, + "node_modules/@inquirer/rawlist": { + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/@inquirer/rawlist/-/rawlist-5.2.4.tgz", + "integrity": "sha512-fTuJ5Cq9W286isLxwj6GGyfTjx1Zdk4qppVEPexFuA6yioCCXS4V1zfKroQqw7QdbDPN73xs2DiIAlo55+kBqg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@inquirer/core": "^11.1.5", + "@inquirer/type": "^4.0.3" + }, + "engines": { + "node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0" + }, + "peerDependencies": { + "@types/node": ">=18" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + } + }, + "node_modules/@inquirer/search": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/@inquirer/search/-/search-4.1.4.tgz", + "integrity": "sha512-9yPTxq7LPmYjrGn3DRuaPuPbmC6u3fiWcsE9ggfLcdgO/ICHYgxq7mEy1yJ39brVvgXhtOtvDVjDh9slJxE4LQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@inquirer/core": "^11.1.5", + "@inquirer/figures": "^2.0.3", + "@inquirer/type": "^4.0.3" + }, + "engines": { + "node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0" + }, + "peerDependencies": { + "@types/node": ">=18" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + } + }, + "node_modules/@inquirer/select": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@inquirer/select/-/select-5.1.0.tgz", + "integrity": "sha512-OyYbKnchS1u+zRe14LpYrN8S0wH1vD0p2yKISvSsJdH2TpI87fh4eZdWnpdbrGauCRWDph3NwxRmM4Pcm/hx1Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@inquirer/ansi": "^2.0.3", + "@inquirer/core": "^11.1.5", + "@inquirer/figures": "^2.0.3", + "@inquirer/type": "^4.0.3" + }, + "engines": { + "node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0" + }, + "peerDependencies": { + "@types/node": ">=18" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + } + }, + "node_modules/@inquirer/type": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@inquirer/type/-/type-4.0.3.tgz", + "integrity": "sha512-cKZN7qcXOpj1h+1eTTcGDVLaBIHNMT1Rz9JqJP5MnEJ0JhgVWllx7H/tahUp5YEK1qaByH2Itb8wLG/iScD5kw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0" + }, + "peerDependencies": { + "@types/node": ">=18" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + } + }, + "node_modules/@napi-rs/cli": { + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/@napi-rs/cli/-/cli-3.5.1.tgz", + "integrity": "sha512-XBfLQRDcB3qhu6bazdMJsecWW55kR85l5/k0af9BIBELXQSsCFU0fzug7PX8eQp6vVdm7W/U3z6uP5WmITB2Gw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@inquirer/prompts": "^8.0.0", + "@napi-rs/cross-toolchain": "^1.0.3", + "@napi-rs/wasm-tools": "^1.0.1", + "@octokit/rest": "^22.0.1", + "clipanion": "^4.0.0-rc.4", + "colorette": "^2.0.20", + "emnapi": "^1.7.1", + "es-toolkit": "^1.41.0", + "js-yaml": "^4.1.0", + "obug": "^2.0.0", + "semver": "^7.7.3", + "typanion": "^3.14.0" + }, + "bin": { + "napi": "dist/cli.js", + "napi-raw": "cli.mjs" + }, + "engines": { + "node": ">= 16" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Brooooooklyn" + }, + "peerDependencies": { + "@emnapi/runtime": "^1.7.1" + }, + "peerDependenciesMeta": { + "@emnapi/runtime": { + "optional": true + } + } + }, + "node_modules/@napi-rs/cross-toolchain": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@napi-rs/cross-toolchain/-/cross-toolchain-1.0.3.tgz", + "integrity": "sha512-ENPfLe4937bsKVTDA6zdABx4pq9w0tHqRrJHyaGxgaPq03a2Bd1unD5XSKjXJjebsABJ+MjAv1A2OvCgK9yehg==", + "dev": true, + "license": "MIT", + "workspaces": [ + ".", + "arm64/*", + "x64/*" + ], + "dependencies": { + "@napi-rs/lzma": "^1.4.5", + "@napi-rs/tar": "^1.1.0", + "debug": "^4.4.1" + }, + "peerDependencies": { + "@napi-rs/cross-toolchain-arm64-target-aarch64": "^1.0.3", + "@napi-rs/cross-toolchain-arm64-target-armv7": "^1.0.3", + "@napi-rs/cross-toolchain-arm64-target-ppc64le": "^1.0.3", + "@napi-rs/cross-toolchain-arm64-target-s390x": "^1.0.3", + "@napi-rs/cross-toolchain-arm64-target-x86_64": "^1.0.3", + "@napi-rs/cross-toolchain-x64-target-aarch64": "^1.0.3", + "@napi-rs/cross-toolchain-x64-target-armv7": "^1.0.3", + "@napi-rs/cross-toolchain-x64-target-ppc64le": "^1.0.3", + "@napi-rs/cross-toolchain-x64-target-s390x": "^1.0.3", + "@napi-rs/cross-toolchain-x64-target-x86_64": "^1.0.3" + }, + "peerDependenciesMeta": { + "@napi-rs/cross-toolchain-arm64-target-aarch64": { + "optional": true + }, + "@napi-rs/cross-toolchain-arm64-target-armv7": { + "optional": true + }, + "@napi-rs/cross-toolchain-arm64-target-ppc64le": { + "optional": true + }, + "@napi-rs/cross-toolchain-arm64-target-s390x": { + "optional": true + }, + "@napi-rs/cross-toolchain-arm64-target-x86_64": { + "optional": true + }, + "@napi-rs/cross-toolchain-x64-target-aarch64": { + "optional": true + }, + "@napi-rs/cross-toolchain-x64-target-armv7": { + "optional": true + }, + "@napi-rs/cross-toolchain-x64-target-ppc64le": { + "optional": true + }, + "@napi-rs/cross-toolchain-x64-target-s390x": { + "optional": true + }, + "@napi-rs/cross-toolchain-x64-target-x86_64": { + "optional": true + } + } + }, + "node_modules/@napi-rs/lzma": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/@napi-rs/lzma/-/lzma-1.4.5.tgz", + "integrity": "sha512-zS5LuN1OBPAyZpda2ZZgYOEDC+xecUdAGnrvbYzjnLXkrq/OBC3B9qcRvlxbDR3k5H/gVfvef1/jyUqPknqjbg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 10" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Brooooooklyn" + }, + "optionalDependencies": { + "@napi-rs/lzma-android-arm-eabi": "1.4.5", + "@napi-rs/lzma-android-arm64": "1.4.5", + "@napi-rs/lzma-darwin-arm64": "1.4.5", + "@napi-rs/lzma-darwin-x64": "1.4.5", + "@napi-rs/lzma-freebsd-x64": "1.4.5", + "@napi-rs/lzma-linux-arm-gnueabihf": "1.4.5", + "@napi-rs/lzma-linux-arm64-gnu": "1.4.5", + "@napi-rs/lzma-linux-arm64-musl": "1.4.5", + "@napi-rs/lzma-linux-ppc64-gnu": "1.4.5", + "@napi-rs/lzma-linux-riscv64-gnu": "1.4.5", + "@napi-rs/lzma-linux-s390x-gnu": "1.4.5", + "@napi-rs/lzma-linux-x64-gnu": "1.4.5", + "@napi-rs/lzma-linux-x64-musl": "1.4.5", + "@napi-rs/lzma-wasm32-wasi": "1.4.5", + "@napi-rs/lzma-win32-arm64-msvc": "1.4.5", + "@napi-rs/lzma-win32-ia32-msvc": "1.4.5", + "@napi-rs/lzma-win32-x64-msvc": "1.4.5" + } + }, + "node_modules/@napi-rs/lzma-android-arm-eabi": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/@napi-rs/lzma-android-arm-eabi/-/lzma-android-arm-eabi-1.4.5.tgz", + "integrity": "sha512-Up4gpyw2SacmyKWWEib06GhiDdF+H+CCU0LAV8pnM4aJIDqKKd5LHSlBht83Jut6frkB0vwEPmAkv4NjQ5u//Q==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/lzma-android-arm64": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/@napi-rs/lzma-android-arm64/-/lzma-android-arm64-1.4.5.tgz", + "integrity": "sha512-uwa8sLlWEzkAM0MWyoZJg0JTD3BkPknvejAFG2acUA1raXM8jLrqujWCdOStisXhqQjZ2nDMp3FV6cs//zjfuQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/lzma-darwin-arm64": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/@napi-rs/lzma-darwin-arm64/-/lzma-darwin-arm64-1.4.5.tgz", + "integrity": "sha512-0Y0TQLQ2xAjVabrMDem1NhIssOZzF/y/dqetc6OT8mD3xMTDtF8u5BqZoX3MyPc9FzpsZw4ksol+w7DsxHrpMA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/lzma-darwin-x64": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/@napi-rs/lzma-darwin-x64/-/lzma-darwin-x64-1.4.5.tgz", + "integrity": "sha512-vR2IUyJY3En+V1wJkwmbGWcYiT8pHloTAWdW4pG24+51GIq+intst6Uf6D/r46citObGZrlX0QvMarOkQeHWpw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/lzma-freebsd-x64": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/@napi-rs/lzma-freebsd-x64/-/lzma-freebsd-x64-1.4.5.tgz", + "integrity": "sha512-XpnYQC5SVovO35tF0xGkbHYjsS6kqyNCjuaLQ2dbEblFRr5cAZVvsJ/9h7zj/5FluJPJRDojVNxGyRhTp4z2lw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/lzma-linux-arm-gnueabihf": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/@napi-rs/lzma-linux-arm-gnueabihf/-/lzma-linux-arm-gnueabihf-1.4.5.tgz", + "integrity": "sha512-ic1ZZMoRfRMwtSwxkyw4zIlbDZGC6davC9r+2oX6x9QiF247BRqqT94qGeL5ZP4Vtz0Hyy7TEViWhx5j6Bpzvw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/lzma-linux-arm64-gnu": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/@napi-rs/lzma-linux-arm64-gnu/-/lzma-linux-arm64-gnu-1.4.5.tgz", + "integrity": "sha512-asEp7FPd7C1Yi6DQb45a3KPHKOFBSfGuJWXcAd4/bL2Fjetb2n/KK2z14yfW8YC/Fv6x3rBM0VAZKmJuz4tysg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/lzma-linux-arm64-musl": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/@napi-rs/lzma-linux-arm64-musl/-/lzma-linux-arm64-musl-1.4.5.tgz", + "integrity": "sha512-yWjcPDgJ2nIL3KNvi4536dlT/CcCWO0DUyEOlBs/SacG7BeD6IjGh6yYzd3/X1Y3JItCbZoDoLUH8iB1lTXo3w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/lzma-linux-ppc64-gnu": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/@napi-rs/lzma-linux-ppc64-gnu/-/lzma-linux-ppc64-gnu-1.4.5.tgz", + "integrity": "sha512-0XRhKuIU/9ZjT4WDIG/qnX7Xz7mSQHYZo9Gb3MP2gcvBgr6BA4zywQ9k3gmQaPn9ECE+CZg2V7DV7kT+x2pUMQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/lzma-linux-riscv64-gnu": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/@napi-rs/lzma-linux-riscv64-gnu/-/lzma-linux-riscv64-gnu-1.4.5.tgz", + "integrity": "sha512-QrqDIPEUUB23GCpyQj/QFyMlr8SGxxyExeZz9OWFnHfb70kXdTLWrHS/hEI1Ru+lSbQ/6xRqeoGyQ4Aqdg+/RA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/lzma-linux-s390x-gnu": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/@napi-rs/lzma-linux-s390x-gnu/-/lzma-linux-s390x-gnu-1.4.5.tgz", + "integrity": "sha512-k8RVM5aMhW86E9H0QXdquwojew4H3SwPxbRVbl49/COJQWCUjGi79X6mYruMnMPEznZinUiT1jgKbFo2A00NdA==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/lzma-linux-x64-gnu": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/@napi-rs/lzma-linux-x64-gnu/-/lzma-linux-x64-gnu-1.4.5.tgz", + "integrity": "sha512-6rMtBgnIq2Wcl1rQdZsnM+rtCcVCbws1nF8S2NzaUsVaZv8bjrPiAa0lwg4Eqnn1d9lgwqT+cZgm5m+//K08Kw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/lzma-linux-x64-musl": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/@napi-rs/lzma-linux-x64-musl/-/lzma-linux-x64-musl-1.4.5.tgz", + "integrity": "sha512-eiadGBKi7Vd0bCArBUOO/qqRYPHt/VQVvGyYvDFt6C2ZSIjlD+HuOl+2oS1sjf4CFjK4eDIog6EdXnL0NE6iyQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/lzma-wasm32-wasi": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/@napi-rs/lzma-wasm32-wasi/-/lzma-wasm32-wasi-1.4.5.tgz", + "integrity": "sha512-+VyHHlr68dvey6fXc2hehw9gHVFIW3TtGF1XkcbAu65qVXsA9D/T+uuoRVqhE+JCyFHFrO0ixRbZDRK1XJt1sA==", + "cpu": [ + "wasm32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@napi-rs/wasm-runtime": "^1.0.3" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@napi-rs/lzma-win32-arm64-msvc": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/@napi-rs/lzma-win32-arm64-msvc/-/lzma-win32-arm64-msvc-1.4.5.tgz", + "integrity": "sha512-eewnqvIyyhHi3KaZtBOJXohLvwwN27gfS2G/YDWdfHlbz1jrmfeHAmzMsP5qv8vGB+T80TMHNkro4kYjeh6Deg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/lzma-win32-ia32-msvc": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/@napi-rs/lzma-win32-ia32-msvc/-/lzma-win32-ia32-msvc-1.4.5.tgz", + "integrity": "sha512-OeacFVRCJOKNU/a0ephUfYZ2Yt+NvaHze/4TgOwJ0J0P4P7X1mHzN+ig9Iyd74aQDXYqc7kaCXA2dpAOcH87Cg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/lzma-win32-x64-msvc": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/@napi-rs/lzma-win32-x64-msvc/-/lzma-win32-x64-msvc-1.4.5.tgz", + "integrity": "sha512-T4I1SamdSmtyZgDXGAGP+y5LEK5vxHUFwe8mz6D4R7Sa5/WCxTcCIgPJ9BD7RkpO17lzhlaM2vmVvMy96Lvk9Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/tar": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@napi-rs/tar/-/tar-1.1.0.tgz", + "integrity": "sha512-7cmzIu+Vbupriudo7UudoMRH2OA3cTw67vva8MxeoAe5S7vPFI7z0vp0pMXiA25S8IUJefImQ90FeJjl8fjEaQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 10" + }, + "optionalDependencies": { + "@napi-rs/tar-android-arm-eabi": "1.1.0", + "@napi-rs/tar-android-arm64": "1.1.0", + "@napi-rs/tar-darwin-arm64": "1.1.0", + "@napi-rs/tar-darwin-x64": "1.1.0", + "@napi-rs/tar-freebsd-x64": "1.1.0", + "@napi-rs/tar-linux-arm-gnueabihf": "1.1.0", + "@napi-rs/tar-linux-arm64-gnu": "1.1.0", + "@napi-rs/tar-linux-arm64-musl": "1.1.0", + "@napi-rs/tar-linux-ppc64-gnu": "1.1.0", + "@napi-rs/tar-linux-s390x-gnu": "1.1.0", + "@napi-rs/tar-linux-x64-gnu": "1.1.0", + "@napi-rs/tar-linux-x64-musl": "1.1.0", + "@napi-rs/tar-wasm32-wasi": "1.1.0", + "@napi-rs/tar-win32-arm64-msvc": "1.1.0", + "@napi-rs/tar-win32-ia32-msvc": "1.1.0", + "@napi-rs/tar-win32-x64-msvc": "1.1.0" + } + }, + "node_modules/@napi-rs/tar-android-arm-eabi": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@napi-rs/tar-android-arm-eabi/-/tar-android-arm-eabi-1.1.0.tgz", + "integrity": "sha512-h2Ryndraj/YiKgMV/r5by1cDusluYIRT0CaE0/PekQ4u+Wpy2iUVqvzVU98ZPnhXaNeYxEvVJHNGafpOfaD0TA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/tar-android-arm64": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@napi-rs/tar-android-arm64/-/tar-android-arm64-1.1.0.tgz", + "integrity": "sha512-DJFyQHr1ZxNZorm/gzc1qBNLF/FcKzcH0V0Vwan5P+o0aE2keQIGEjJ09FudkF9v6uOuJjHCVDdK6S6uHtShAw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/tar-darwin-arm64": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@napi-rs/tar-darwin-arm64/-/tar-darwin-arm64-1.1.0.tgz", + "integrity": "sha512-Zz2sXRzjIX4e532zD6xm2SjXEym6MkvfCvL2RMpG2+UwNVDVscHNcz3d47Pf3sysP2e2af7fBB3TIoK2f6trPw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/tar-darwin-x64": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@napi-rs/tar-darwin-x64/-/tar-darwin-x64-1.1.0.tgz", + "integrity": "sha512-EI+CptIMNweT0ms9S3mkP/q+J6FNZ1Q6pvpJOEcWglRfyfQpLqjlC0O+dptruTPE8VamKYuqdjxfqD8hifZDOA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/tar-freebsd-x64": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@napi-rs/tar-freebsd-x64/-/tar-freebsd-x64-1.1.0.tgz", + "integrity": "sha512-J0PIqX+pl6lBIAckL/c87gpodLbjZB1OtIK+RDscKC9NLdpVv6VGOxzUV/fYev/hctcE8EfkLbgFOfpmVQPg2g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/tar-linux-arm-gnueabihf": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@napi-rs/tar-linux-arm-gnueabihf/-/tar-linux-arm-gnueabihf-1.1.0.tgz", + "integrity": "sha512-SLgIQo3f3EjkZ82ZwvrEgFvMdDAhsxCYjyoSuWfHCz0U16qx3SuGCp8+FYOPYCECHN3ZlGjXnoAIt9ERd0dEUg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/tar-linux-arm64-gnu": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@napi-rs/tar-linux-arm64-gnu/-/tar-linux-arm64-gnu-1.1.0.tgz", + "integrity": "sha512-d014cdle52EGaH6GpYTQOP9Py7glMO1zz/+ynJPjjzYFSxvdYx0byrjumZk2UQdIyGZiJO2MEFpCkEEKFSgPYA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/tar-linux-arm64-musl": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@napi-rs/tar-linux-arm64-musl/-/tar-linux-arm64-musl-1.1.0.tgz", + "integrity": "sha512-L/y1/26q9L/uBqiW/JdOb/Dc94egFvNALUZV2WCGKQXc6UByPBMgdiEyW2dtoYxYYYYc+AKD+jr+wQPcvX2vrQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/tar-linux-ppc64-gnu": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@napi-rs/tar-linux-ppc64-gnu/-/tar-linux-ppc64-gnu-1.1.0.tgz", + "integrity": "sha512-EPE1K/80RQvPbLRJDJs1QmCIcH+7WRi0F73+oTe1582y9RtfGRuzAkzeBuAGRXAQEjRQw/RjtNqr6UTJ+8UuWQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/tar-linux-s390x-gnu": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@napi-rs/tar-linux-s390x-gnu/-/tar-linux-s390x-gnu-1.1.0.tgz", + "integrity": "sha512-B2jhWiB1ffw1nQBqLUP1h4+J1ovAxBOoe5N2IqDMOc63fsPZKNqF1PvO/dIem8z7LL4U4bsfmhy3gBfu547oNQ==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/tar-linux-x64-gnu": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@napi-rs/tar-linux-x64-gnu/-/tar-linux-x64-gnu-1.1.0.tgz", + "integrity": "sha512-tbZDHnb9617lTnsDMGo/eAMZxnsQFnaRe+MszRqHguKfMwkisc9CCJnks/r1o84u5fECI+J/HOrKXgczq/3Oww==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/tar-linux-x64-musl": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@napi-rs/tar-linux-x64-musl/-/tar-linux-x64-musl-1.1.0.tgz", + "integrity": "sha512-dV6cODlzbO8u6Anmv2N/ilQHq/AWz0xyltuXoLU3yUyXbZcnWYZuB2rL8OBGPmqNcD+x9NdScBNXh7vWN0naSQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/tar-wasm32-wasi": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@napi-rs/tar-wasm32-wasi/-/tar-wasm32-wasi-1.1.0.tgz", + "integrity": "sha512-jIa9nb2HzOrfH0F8QQ9g3WE4aMH5vSI5/1NYVNm9ysCmNjCCtMXCAhlI3WKCdm/DwHf0zLqdrrtDFXODcNaqMw==", + "cpu": [ + "wasm32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@napi-rs/wasm-runtime": "^1.0.3" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@napi-rs/tar-win32-arm64-msvc": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@napi-rs/tar-win32-arm64-msvc/-/tar-win32-arm64-msvc-1.1.0.tgz", + "integrity": "sha512-vfpG71OB0ijtjemp3WTdmBKJm9R70KM8vsSExMsIQtV0lVzP07oM1CW6JbNRPXNLhRoue9ofYLiUDk8bE0Hckg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/tar-win32-ia32-msvc": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@napi-rs/tar-win32-ia32-msvc/-/tar-win32-ia32-msvc-1.1.0.tgz", + "integrity": "sha512-hGPyPW60YSpOSgzfy68DLBHgi6HxkAM+L59ZZZPMQ0TOXjQg+p2EW87+TjZfJOkSpbYiEkULwa/f4a2hcVjsqQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/tar-win32-x64-msvc": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@napi-rs/tar-win32-x64-msvc/-/tar-win32-x64-msvc-1.1.0.tgz", + "integrity": "sha512-L6Ed1DxXK9YSCMyvpR8MiNAyKNkQLjsHsHK9E0qnHa8NzLFqzDKhvs5LfnWxM2kJ+F7m/e5n9zPm24kHb3LsVw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/wasm-runtime": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.1.1.tgz", + "integrity": "sha512-p64ah1M1ld8xjWv3qbvFwHiFVWrq1yFvV4f7w+mzaqiR4IlSgkqhcRdHwsGgomwzBH51sRY4NEowLxnaBjcW/A==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/core": "^1.7.1", + "@emnapi/runtime": "^1.7.1", + "@tybys/wasm-util": "^0.10.1" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Brooooooklyn" + } + }, + "node_modules/@napi-rs/wasm-tools": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@napi-rs/wasm-tools/-/wasm-tools-1.0.1.tgz", + "integrity": "sha512-enkZYyuCdo+9jneCPE/0fjIta4wWnvVN9hBo2HuiMpRF0q3lzv1J6b/cl7i0mxZUKhBrV3aCKDBQnCOhwKbPmQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 10" + }, + "optionalDependencies": { + "@napi-rs/wasm-tools-android-arm-eabi": "1.0.1", + "@napi-rs/wasm-tools-android-arm64": "1.0.1", + "@napi-rs/wasm-tools-darwin-arm64": "1.0.1", + "@napi-rs/wasm-tools-darwin-x64": "1.0.1", + "@napi-rs/wasm-tools-freebsd-x64": "1.0.1", + "@napi-rs/wasm-tools-linux-arm64-gnu": "1.0.1", + "@napi-rs/wasm-tools-linux-arm64-musl": "1.0.1", + "@napi-rs/wasm-tools-linux-x64-gnu": "1.0.1", + "@napi-rs/wasm-tools-linux-x64-musl": "1.0.1", + "@napi-rs/wasm-tools-wasm32-wasi": "1.0.1", + "@napi-rs/wasm-tools-win32-arm64-msvc": "1.0.1", + "@napi-rs/wasm-tools-win32-ia32-msvc": "1.0.1", + "@napi-rs/wasm-tools-win32-x64-msvc": "1.0.1" + } + }, + "node_modules/@napi-rs/wasm-tools-android-arm-eabi": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@napi-rs/wasm-tools-android-arm-eabi/-/wasm-tools-android-arm-eabi-1.0.1.tgz", + "integrity": "sha512-lr07E/l571Gft5v4aA1dI8koJEmF1F0UigBbsqg9OWNzg80H3lDPO+auv85y3T/NHE3GirDk7x/D3sLO57vayw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/wasm-tools-android-arm64": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@napi-rs/wasm-tools-android-arm64/-/wasm-tools-android-arm64-1.0.1.tgz", + "integrity": "sha512-WDR7S+aRLV6LtBJAg5fmjKkTZIdrEnnQxgdsb7Cf8pYiMWBHLU+LC49OUVppQ2YSPY0+GeYm9yuZWW3kLjJ7Bg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/wasm-tools-darwin-arm64": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@napi-rs/wasm-tools-darwin-arm64/-/wasm-tools-darwin-arm64-1.0.1.tgz", + "integrity": "sha512-qWTI+EEkiN0oIn/N2gQo7+TVYil+AJ20jjuzD2vATS6uIjVz+Updeqmszi7zq7rdFTLp6Ea3/z4kDKIfZwmR9g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/wasm-tools-darwin-x64": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@napi-rs/wasm-tools-darwin-x64/-/wasm-tools-darwin-x64-1.0.1.tgz", + "integrity": "sha512-bA6hubqtHROR5UI3tToAF/c6TDmaAgF0SWgo4rADHtQ4wdn0JeogvOk50gs2TYVhKPE2ZD2+qqt7oBKB+sxW3A==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/wasm-tools-freebsd-x64": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@napi-rs/wasm-tools-freebsd-x64/-/wasm-tools-freebsd-x64-1.0.1.tgz", + "integrity": "sha512-90+KLBkD9hZEjPQW1MDfwSt5J1L46EUKacpCZWyRuL6iIEO5CgWU0V/JnEgFsDOGyyYtiTvHc5bUdUTWd4I9Vg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/wasm-tools-linux-arm64-gnu": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@napi-rs/wasm-tools-linux-arm64-gnu/-/wasm-tools-linux-arm64-gnu-1.0.1.tgz", + "integrity": "sha512-rG0QlS65x9K/u3HrKafDf8cFKj5wV2JHGfl8abWgKew0GVPyp6vfsDweOwHbWAjcHtp2LHi6JHoW80/MTHm52Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/wasm-tools-linux-arm64-musl": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@napi-rs/wasm-tools-linux-arm64-musl/-/wasm-tools-linux-arm64-musl-1.0.1.tgz", + "integrity": "sha512-jAasbIvjZXCgX0TCuEFQr+4D6Lla/3AAVx2LmDuMjgG4xoIXzjKWl7c4chuaD+TI+prWT0X6LJcdzFT+ROKGHQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/wasm-tools-linux-x64-gnu": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@napi-rs/wasm-tools-linux-x64-gnu/-/wasm-tools-linux-x64-gnu-1.0.1.tgz", + "integrity": "sha512-Plgk5rPqqK2nocBGajkMVbGm010Z7dnUgq0wtnYRZbzWWxwWcXfZMPa8EYxrK4eE8SzpI7VlZP1tdVsdjgGwMw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/wasm-tools-linux-x64-musl": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@napi-rs/wasm-tools-linux-x64-musl/-/wasm-tools-linux-x64-musl-1.0.1.tgz", + "integrity": "sha512-GW7AzGuWxtQkyHknHWYFdR0CHmW6is8rG2Rf4V6GNmMpmwtXt/ItWYWtBe4zqJWycMNazpfZKSw/BpT7/MVCXQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/wasm-tools-wasm32-wasi": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@napi-rs/wasm-tools-wasm32-wasi/-/wasm-tools-wasm32-wasi-1.0.1.tgz", + "integrity": "sha512-/nQVSTrqSsn7YdAc2R7Ips/tnw5SPUcl3D7QrXCNGPqjbatIspnaexvaOYNyKMU6xPu+pc0BTnKVmqhlJJCPLA==", + "cpu": [ + "wasm32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@napi-rs/wasm-runtime": "^1.0.3" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@napi-rs/wasm-tools-win32-arm64-msvc": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@napi-rs/wasm-tools-win32-arm64-msvc/-/wasm-tools-win32-arm64-msvc-1.0.1.tgz", + "integrity": "sha512-PFi7oJIBu5w7Qzh3dwFea3sHRO3pojMsaEnUIy22QvsW+UJfNQwJCryVrpoUt8m4QyZXI+saEq/0r4GwdoHYFQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/wasm-tools-win32-ia32-msvc": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@napi-rs/wasm-tools-win32-ia32-msvc/-/wasm-tools-win32-ia32-msvc-1.0.1.tgz", + "integrity": "sha512-gXkuYzxQsgkj05Zaq+KQTkHIN83dFAwMcTKa2aQcpYPRImFm2AQzEyLtpXmyCWzJ0F9ZYAOmbSyrNew8/us6bw==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/wasm-tools-win32-x64-msvc": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@napi-rs/wasm-tools-win32-x64-msvc/-/wasm-tools-win32-x64-msvc-1.0.1.tgz", + "integrity": "sha512-rEAf05nol3e3eei2sRButmgXP+6ATgm0/38MKhz9Isne82T4rPIMYsCIFj0kOisaGeVwoi2fnm7O9oWp5YVnYQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@octokit/auth-token": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-6.0.0.tgz", + "integrity": "sha512-P4YJBPdPSpWTQ1NU4XYdvHvXJJDxM6YwpS0FZHRgP7YFkdVxsWcpWGy/NVqlAA7PcPCnMacXlRm1y2PFZRWL/w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 20" + } + }, + "node_modules/@octokit/core": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/@octokit/core/-/core-7.0.6.tgz", + "integrity": "sha512-DhGl4xMVFGVIyMwswXeyzdL4uXD5OGILGX5N8Y+f6W7LhC1Ze2poSNrkF/fedpVDHEEZ+PHFW0vL14I+mm8K3Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/auth-token": "^6.0.0", + "@octokit/graphql": "^9.0.3", + "@octokit/request": "^10.0.6", + "@octokit/request-error": "^7.0.2", + "@octokit/types": "^16.0.0", + "before-after-hook": "^4.0.0", + "universal-user-agent": "^7.0.0" + }, + "engines": { + "node": ">= 20" + } + }, + "node_modules/@octokit/endpoint": { + "version": "11.0.3", + "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-11.0.3.tgz", + "integrity": "sha512-FWFlNxghg4HrXkD3ifYbS/IdL/mDHjh9QcsNyhQjN8dplUoZbejsdpmuqdA76nxj2xoWPs7p8uX2SNr9rYu0Ag==", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/types": "^16.0.0", + "universal-user-agent": "^7.0.2" + }, + "engines": { + "node": ">= 20" + } + }, + "node_modules/@octokit/graphql": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-9.0.3.tgz", + "integrity": "sha512-grAEuupr/C1rALFnXTv6ZQhFuL1D8G5y8CN04RgrO4FIPMrtm+mcZzFG7dcBm+nq+1ppNixu+Jd78aeJOYxlGA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/request": "^10.0.6", + "@octokit/types": "^16.0.0", + "universal-user-agent": "^7.0.0" + }, + "engines": { + "node": ">= 20" + } + }, + "node_modules/@octokit/openapi-types": { + "version": "27.0.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-27.0.0.tgz", + "integrity": "sha512-whrdktVs1h6gtR+09+QsNk2+FO+49j6ga1c55YZudfEG+oKJVvJLQi3zkOm5JjiUXAagWK2tI2kTGKJ2Ys7MGA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@octokit/plugin-paginate-rest": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-14.0.0.tgz", + "integrity": "sha512-fNVRE7ufJiAA3XUrha2omTA39M6IXIc6GIZLvlbsm8QOQCYvpq/LkMNGyFlB1d8hTDzsAXa3OKtybdMAYsV/fw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/types": "^16.0.0" + }, + "engines": { + "node": ">= 20" + }, + "peerDependencies": { + "@octokit/core": ">=6" + } + }, + "node_modules/@octokit/plugin-request-log": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-6.0.0.tgz", + "integrity": "sha512-UkOzeEN3W91/eBq9sPZNQ7sUBvYCqYbrrD8gTbBuGtHEuycE4/awMXcYvx6sVYo7LypPhmQwwpUe4Yyu4QZN5Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 20" + }, + "peerDependencies": { + "@octokit/core": ">=6" + } + }, + "node_modules/@octokit/plugin-rest-endpoint-methods": { + "version": "17.0.0", + "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-17.0.0.tgz", + "integrity": "sha512-B5yCyIlOJFPqUUeiD0cnBJwWJO8lkJs5d8+ze9QDP6SvfiXSz1BF+91+0MeI1d2yxgOhU/O+CvtiZ9jSkHhFAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/types": "^16.0.0" + }, + "engines": { + "node": ">= 20" + }, + "peerDependencies": { + "@octokit/core": ">=6" + } + }, + "node_modules/@octokit/request": { + "version": "10.0.8", + "resolved": "https://registry.npmjs.org/@octokit/request/-/request-10.0.8.tgz", + "integrity": "sha512-SJZNwY9pur9Agf7l87ywFi14W+Hd9Jg6Ifivsd33+/bGUQIjNujdFiXII2/qSlN2ybqUHfp5xpekMEjIBTjlSw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/endpoint": "^11.0.3", + "@octokit/request-error": "^7.0.2", + "@octokit/types": "^16.0.0", + "fast-content-type-parse": "^3.0.0", + "json-with-bigint": "^3.5.3", + "universal-user-agent": "^7.0.2" + }, + "engines": { + "node": ">= 20" + } + }, + "node_modules/@octokit/request-error": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-7.1.0.tgz", + "integrity": "sha512-KMQIfq5sOPpkQYajXHwnhjCC0slzCNScLHs9JafXc4RAJI+9f+jNDlBNaIMTvazOPLgb4BnlhGJOTbnN0wIjPw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/types": "^16.0.0" + }, + "engines": { + "node": ">= 20" + } + }, + "node_modules/@octokit/rest": { + "version": "22.0.1", + "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-22.0.1.tgz", + "integrity": "sha512-Jzbhzl3CEexhnivb1iQ0KJ7s5vvjMWcmRtq5aUsKmKDrRW6z3r84ngmiFKFvpZjpiU/9/S6ITPFRpn5s/3uQJw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/core": "^7.0.6", + "@octokit/plugin-paginate-rest": "^14.0.0", + "@octokit/plugin-request-log": "^6.0.0", + "@octokit/plugin-rest-endpoint-methods": "^17.0.0" + }, + "engines": { + "node": ">= 20" + } + }, + "node_modules/@octokit/types": { + "version": "16.0.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-16.0.0.tgz", + "integrity": "sha512-sKq+9r1Mm4efXW1FCk7hFSeJo4QKreL/tTbR0rz/qx/r1Oa2VV83LTA/H/MuCOX7uCIJmQVRKBcbmWoySjAnSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/openapi-types": "^27.0.0" + } + }, + "node_modules/@oxlint/binding-android-arm-eabi": { + "version": "1.50.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-android-arm-eabi/-/binding-android-arm-eabi-1.50.0.tgz", + "integrity": "sha512-G7MRGk/6NCe+L8ntonRdZP7IkBfEpiZ/he3buLK6JkLgMHgJShXZ+BeOwADmspXez7U7F7L1Anf4xLSkLHiGTg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-android-arm64": { + "version": "1.50.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-android-arm64/-/binding-android-arm64-1.50.0.tgz", + "integrity": "sha512-GeSuMoJWCVpovJi/e3xDSNgjeR8WEZ6MCXL6EtPiCIM2NTzv7LbflARINTXTJy2oFBYyvdf/l2PwHzYo6EdXvg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-darwin-arm64": { + "version": "1.50.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-darwin-arm64/-/binding-darwin-arm64-1.50.0.tgz", + "integrity": "sha512-w3SY5YtxGnxCHPJ8Twl3KmS9oja1gERYk3AMoZ7Hv8P43ZtB6HVfs02TxvarxfL214Tm3uzvc2vn+DhtUNeKnw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-darwin-x64": { + "version": "1.50.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-darwin-x64/-/binding-darwin-x64-1.50.0.tgz", + "integrity": "sha512-hNfogDqy7tvmllXKBSlHo6k5x7dhTUVOHbMSE15CCAcXzmqf5883aPvBYPOq9AE7DpDUQUZ1kVE22YbiGW+tuw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-freebsd-x64": { + "version": "1.50.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-freebsd-x64/-/binding-freebsd-x64-1.50.0.tgz", + "integrity": "sha512-ykZevOWEyu0nsxolA911ucxpEv0ahw8jfEeGWOwwb/VPoE4xoexuTOAiPNlWZNJqANlJl7yp8OyzCtXTUAxotw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-arm-gnueabihf": { + "version": "1.50.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.50.0.tgz", + "integrity": "sha512-hif3iDk7vo5GGJ4OLCCZAf2vjnU9FztGw4L0MbQL0M2iY9LKFtDMMiQAHmkF0PQGQMVbTYtPdXCLKVgdkiqWXQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-arm-musleabihf": { + "version": "1.50.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-arm-musleabihf/-/binding-linux-arm-musleabihf-1.50.0.tgz", + "integrity": "sha512-dVp9iSssiGAnTNey2Ruf6xUaQhdnvcFOJyRWd/mu5o2jVbFK15E5fbWGeFRfmuobu5QXuROtFga44+7DOS3PLg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-arm64-gnu": { + "version": "1.50.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.50.0.tgz", + "integrity": "sha512-1cT7yz2HA910CKA9NkH1ZJo50vTtmND2fkoW1oyiSb0j6WvNtJ0Wx2zoySfXWc/c+7HFoqRK5AbEoL41LOn9oA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-arm64-musl": { + "version": "1.50.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.50.0.tgz", + "integrity": "sha512-++B3k/HEPFVlj89cOz8kWfQccMZB/aWL9AhsW7jPIkG++63Mpwb2cE9XOEsd0PATbIan78k2Gky+09uWM1d/gQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-ppc64-gnu": { + "version": "1.50.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.50.0.tgz", + "integrity": "sha512-Z9b/KpFMkx66w3gVBqjIC1AJBTZAGoI9+U+K5L4QM0CB/G0JSNC1es9b3Y0Vcrlvtdn8A+IQTkYjd/Q0uCSaZw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-riscv64-gnu": { + "version": "1.50.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-riscv64-gnu/-/binding-linux-riscv64-gnu-1.50.0.tgz", + "integrity": "sha512-jvmuIw8wRSohsQlFNIST5uUwkEtEJmOQYr33bf/K2FrFPXHhM4KqGekI3ShYJemFS/gARVacQFgBzzJKCAyJjg==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-riscv64-musl": { + "version": "1.50.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-riscv64-musl/-/binding-linux-riscv64-musl-1.50.0.tgz", + "integrity": "sha512-x+UrN47oYNh90nmAAyql8eQaaRpHbDPu5guasDg10+OpszUQ3/1+1J6zFMmV4xfIEgTcUXG/oI5fxJhF4eWCNA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-s390x-gnu": { + "version": "1.50.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.50.0.tgz", + "integrity": "sha512-i/JLi2ljLUIVfekMj4ISmdt+Hn11wzYUdRRrkVUYsCWw7zAy5xV7X9iA+KMyM156LTFympa7s3oKBjuCLoTAUQ==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-x64-gnu": { + "version": "1.50.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.50.0.tgz", + "integrity": "sha512-/C7brhn6c6UUPccgSPCcpLQXcp+xKIW/3sji/5VZ8/OItL3tQ2U7KalHz887UxxSQeEOmd1kY6lrpuwFnmNqOA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-x64-musl": { + "version": "1.50.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-x64-musl/-/binding-linux-x64-musl-1.50.0.tgz", + "integrity": "sha512-oDR1f+bGOYU8LfgtEW8XtotWGB63ghtcxk5Jm6IDTCk++rTA/IRMsjOid2iMd+1bW+nP9Mdsmcdc7VbPD3+iyQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-openharmony-arm64": { + "version": "1.50.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-openharmony-arm64/-/binding-openharmony-arm64-1.50.0.tgz", + "integrity": "sha512-4CmRGPp5UpvXyu4jjP9Tey/SrXDQLRvZXm4pb4vdZBxAzbFZkCyh0KyRy4txld/kZKTJlW4TO8N1JKrNEk+mWw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-win32-arm64-msvc": { + "version": "1.50.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.50.0.tgz", + "integrity": "sha512-Fq0M6vsGcFsSfeuWAACDhd5KJrO85ckbEfe1EGuBj+KPyJz7KeWte2fSFrFGmNKNXyhEMyx4tbgxiWRujBM2KQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-win32-ia32-msvc": { + "version": "1.50.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-1.50.0.tgz", + "integrity": "sha512-qTdWR9KwY/vxJGhHVIZG2eBOhidOQvOwzDxnX+jhW/zIVacal1nAhR8GLkiywW8BIFDkQKXo/zOfT+/DY+ns/w==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-win32-x64-msvc": { + "version": "1.50.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.50.0.tgz", + "integrity": "sha512-682t7npLC4G2Ca+iNlI9fhAKTcFPYYXJjwoa88H4q+u5HHHlsnL/gHULapX3iqp+A8FIJbgdylL5KMYo2LaluQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@swc/helpers": { + "version": "0.5.19", + "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.19.tgz", + "integrity": "sha512-QamiFeIK3txNjgUTNppE6MiG3p7TdninpZu0E0PbqVh1a9FNLT2FRhisaa4NcaX52XVhA5l7Pk58Ft7Sqi/2sA==", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.8.0" + } + }, + "node_modules/@taplo/cli": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/@taplo/cli/-/cli-0.7.0.tgz", + "integrity": "sha512-Ck3zFhQhIhi02Hl6T4ZmJsXdnJE+wXcJz5f8klxd4keRYgenMnip3JDPMGDRLbnC/2iGd8P0sBIQqI3KxfVjBg==", + "dev": true, + "license": "MIT", + "bin": { + "taplo": "dist/cli.js" + } + }, + "node_modules/@tybys/wasm-util": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.1.tgz", + "integrity": "sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@types/command-line-args": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/@types/command-line-args/-/command-line-args-5.2.3.tgz", + "integrity": "sha512-uv0aG6R0Y8WHZLTamZwtfsDLVRnOa+n+n5rEvFWL5Na5gZ8V2Teab/duDPFzIIIhs9qizDpcavCusCLJZu62Kw==", + "license": "MIT", + "peer": true + }, + "node_modules/@types/command-line-usage": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/@types/command-line-usage/-/command-line-usage-5.0.4.tgz", + "integrity": "sha512-BwR5KP3Es/CSht0xqBcUXS3qCAUVXwpRKsV2+arxeb65atasuXG9LykC9Ab10Cw3s2raH92ZqOeILaQbsB2ACg==", + "license": "MIT", + "peer": true + }, + "node_modules/@types/node": { + "version": "24.10.15", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.10.15.tgz", + "integrity": "sha512-BgjLoRuSr0MTI5wA6gMw9Xy0sFudAaUuvrnjgGx9wZ522fYYLA5SYJ+1Y30vTcJEG+DRCyDHx/gzQVfofYzSdg==", + "license": "MIT", + "peer": true, + "dependencies": { + "undici-types": "~7.16.0" + } + }, + "node_modules/ansi-escapes": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-7.3.0.tgz", + "integrity": "sha512-BvU8nYgGQBxcmMuEeUEmNTvrMVjJNSH7RgW24vXexN4Ven6qCvy4TntnvlnwnMLTVlcRQQdbRY8NKnaIoeWDNg==", + "dev": true, + "license": "MIT", + "dependencies": { + "environment": "^1.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-regex": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/ansi-styles": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", + "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/apache-arrow": { + "version": "21.1.0", + "resolved": "https://registry.npmjs.org/apache-arrow/-/apache-arrow-21.1.0.tgz", + "integrity": "sha512-kQrYLxhC+NTVVZ4CCzGF6L/uPVOzJmD1T3XgbiUnP7oTeVFOFgEUu6IKNwCDkpFoBVqDKQivlX4RUFqqnWFlEA==", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@swc/helpers": "^0.5.11", + "@types/command-line-args": "^5.2.3", + "@types/command-line-usage": "^5.0.4", + "@types/node": "^24.0.3", + "command-line-args": "^6.0.1", + "command-line-usage": "^7.0.1", + "flatbuffers": "^25.1.24", + "json-bignum": "^0.0.3", + "tslib": "^2.6.2" + }, + "bin": { + "arrow2csv": "bin/arrow2csv.js" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true, + "license": "Python-2.0" + }, + "node_modules/array-back": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-6.2.2.tgz", + "integrity": "sha512-gUAZ7HPyb4SJczXAMUXMGAvI976JoK3qEx9v1FTmeYuJj0IBiaKttG1ydtGKdkfqWkIkouke7nG8ufGy77+Cvw==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=12.17" + } + }, + "node_modules/before-after-hook": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-4.0.0.tgz", + "integrity": "sha512-q6tR3RPqIB1pMiTRMFcZwuG5T8vwp+vUvEG0vuI6B+Rikh5BfPp2fQ82c925FOs+b0lcFQ8CFrL+KbilfZFhOQ==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, + "license": "MIT", + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/chalk-template": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/chalk-template/-/chalk-template-0.4.0.tgz", + "integrity": "sha512-/ghrgmhfY8RaSdeo43hNXxpoHAtxdbskUHjPpfqUWGttFgycUhYPGx3YZBCnUCvOa7Doivn1IZec3DEGFoMgLg==", + "license": "MIT", + "peer": true, + "dependencies": { + "chalk": "^4.1.2" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/chalk-template?sponsor=1" + } + }, + "node_modules/chalk-template/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "license": "MIT", + "peer": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/chalk-template/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/chardet": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-2.1.1.tgz", + "integrity": "sha512-PsezH1rqdV9VvyNhxxOW32/d75r01NY7TQCmOqomRo15ZSOKbpTFVsfjghxo6JloQUCGnH4k1LGu0R4yCLlWQQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/cli-cursor": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-5.0.0.tgz", + "integrity": "sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==", + "dev": true, + "license": "MIT", + "dependencies": { + "restore-cursor": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cli-width": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-4.1.0.tgz", + "integrity": "sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">= 12" + } + }, + "node_modules/clipanion": { + "version": "4.0.0-rc.4", + "resolved": "https://registry.npmjs.org/clipanion/-/clipanion-4.0.0-rc.4.tgz", + "integrity": "sha512-CXkMQxU6s9GklO/1f714dkKBMu1lopS1WFF0B8o4AxPykR1hpozxSiUZ5ZUeBjfPgCWqbcNOtZVFhB8Lkfp1+Q==", + "dev": true, + "license": "MIT", + "workspaces": [ + "website" + ], + "dependencies": { + "typanion": "^3.8.0" + }, + "peerDependencies": { + "typanion": "*" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "license": "MIT", + "peer": true + }, + "node_modules/colorette": { + "version": "2.0.20", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", + "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", + "dev": true, + "license": "MIT" + }, + "node_modules/command-line-args": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/command-line-args/-/command-line-args-6.0.1.tgz", + "integrity": "sha512-Jr3eByUjqyK0qd8W0SGFW1nZwqCaNCtbXjRo2cRJC1OYxWl3MZ5t1US3jq+cO4sPavqgw4l9BMGX0CBe+trepg==", + "license": "MIT", + "peer": true, + "dependencies": { + "array-back": "^6.2.2", + "find-replace": "^5.0.2", + "lodash.camelcase": "^4.3.0", + "typical": "^7.2.0" + }, + "engines": { + "node": ">=12.20" + }, + "peerDependencies": { + "@75lb/nature": "latest" + }, + "peerDependenciesMeta": { + "@75lb/nature": { + "optional": true + } + } + }, + "node_modules/command-line-usage": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/command-line-usage/-/command-line-usage-7.0.3.tgz", + "integrity": "sha512-PqMLy5+YGwhMh1wS04mVG44oqDsgyLRSKJBdOo1bnYhMKBW65gZF1dRp2OZRhiTjgUHljy99qkO7bsctLaw35Q==", + "license": "MIT", + "peer": true, + "dependencies": { + "array-back": "^6.2.2", + "chalk-template": "^0.4.0", + "table-layout": "^4.1.0", + "typical": "^7.1.1" + }, + "engines": { + "node": ">=12.20.0" + } + }, + "node_modules/commander": { + "version": "14.0.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-14.0.3.tgz", + "integrity": "sha512-H+y0Jo/T1RZ9qPP4Eh1pkcQcLRglraJaSLoyOtHxu6AapkjWVCy2Sit1QQ4x3Dng8qDlSsZEet7g5Pq06MvTgw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=20" + } + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/emnapi": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/emnapi/-/emnapi-1.8.1.tgz", + "integrity": "sha512-34i2BbgHx1LnEO4JCGQYo6h6s4e4KrdWtdTHfllBNLbXSHPmdIHplxKejfabsRK+ukNciqVdalB+fxMibqHdaQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "node-addon-api": ">= 6.1.0" + }, + "peerDependenciesMeta": { + "node-addon-api": { + "optional": true + } + } + }, + "node_modules/emoji-regex": { + "version": "10.6.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.6.0.tgz", + "integrity": "sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==", + "dev": true, + "license": "MIT" + }, + "node_modules/environment": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/environment/-/environment-1.1.0.tgz", + "integrity": "sha512-xUtoPkMggbz0MPyPiIWr1Kp4aeWJjDZ6SMvURhimjdZgsRuDplF5/s9hcgGhyXMhs+6vpnuoiZ2kFiu3FMnS8Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/es-toolkit": { + "version": "1.44.0", + "resolved": "https://registry.npmjs.org/es-toolkit/-/es-toolkit-1.44.0.tgz", + "integrity": "sha512-6penXeZalaV88MM3cGkFZZfOoLGWshWWfdy0tWw/RlVVyhvMaWSBTOvXNeiW3e5FwdS5ePW0LGEu17zT139ktg==", + "dev": true, + "license": "MIT", + "workspaces": [ + "docs", + "benchmarks" + ] + }, + "node_modules/esbuild": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.3.tgz", + "integrity": "sha512-8VwMnyGCONIs6cWue2IdpHxHnAjzxnw2Zr7MkVxB2vjmQ2ivqGFb4LEG3SMnv0Gb2F/G/2yA8zUaiL1gywDCCg==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.27.3", + "@esbuild/android-arm": "0.27.3", + "@esbuild/android-arm64": "0.27.3", + "@esbuild/android-x64": "0.27.3", + "@esbuild/darwin-arm64": "0.27.3", + "@esbuild/darwin-x64": "0.27.3", + "@esbuild/freebsd-arm64": "0.27.3", + "@esbuild/freebsd-x64": "0.27.3", + "@esbuild/linux-arm": "0.27.3", + "@esbuild/linux-arm64": "0.27.3", + "@esbuild/linux-ia32": "0.27.3", + "@esbuild/linux-loong64": "0.27.3", + "@esbuild/linux-mips64el": "0.27.3", + "@esbuild/linux-ppc64": "0.27.3", + "@esbuild/linux-riscv64": "0.27.3", + "@esbuild/linux-s390x": "0.27.3", + "@esbuild/linux-x64": "0.27.3", + "@esbuild/netbsd-arm64": "0.27.3", + "@esbuild/netbsd-x64": "0.27.3", + "@esbuild/openbsd-arm64": "0.27.3", + "@esbuild/openbsd-x64": "0.27.3", + "@esbuild/openharmony-arm64": "0.27.3", + "@esbuild/sunos-x64": "0.27.3", + "@esbuild/win32-arm64": "0.27.3", + "@esbuild/win32-ia32": "0.27.3", + "@esbuild/win32-x64": "0.27.3" + } + }, + "node_modules/eventemitter3": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.4.tgz", + "integrity": "sha512-mlsTRyGaPBjPedk6Bvw+aqbsXDtoAyAzm5MO7JgU+yVRyMQ5O8bD4Kcci7BS85f93veegeCPkL8R4GLClnjLFw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-content-type-parse": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/fast-content-type-parse/-/fast-content-type-parse-3.0.0.tgz", + "integrity": "sha512-ZvLdcY8P+N8mGQJahJV5G4U88CSvT1rP8ApL6uETe88MBXrBHAkZlSEySdUlyztF7ccb+Znos3TFqaepHxdhBg==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT" + }, + "node_modules/fast-string-truncated-width": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/fast-string-truncated-width/-/fast-string-truncated-width-3.0.3.tgz", + "integrity": "sha512-0jjjIEL6+0jag3l2XWWizO64/aZVtpiGE3t0Zgqxv0DPuxiMjvB3M24fCyhZUO4KomJQPj3LTSUnDP3GpdwC0g==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-string-width": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/fast-string-width/-/fast-string-width-3.0.2.tgz", + "integrity": "sha512-gX8LrtNEI5hq8DVUfRQMbr5lpaS4nMIWV+7XEbXk2b8kiQIizgnlr12B4dA3ZEx3308ze0O4Q1R+cHts8kyUJg==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-string-truncated-width": "^3.0.2" + } + }, + "node_modules/fast-wrap-ansi": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/fast-wrap-ansi/-/fast-wrap-ansi-0.2.0.tgz", + "integrity": "sha512-rLV8JHxTyhVmFYhBJuMujcrHqOT2cnO5Zxj37qROj23CP39GXubJRBUFF0z8KFK77Uc0SukZUf7JZhsVEQ6n8w==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-string-width": "^3.0.2" + } + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, + "license": "MIT", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find-replace": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/find-replace/-/find-replace-5.0.2.tgz", + "integrity": "sha512-Y45BAiE3mz2QsrN2fb5QEtO4qb44NcS7en/0y9PEVsg351HsLeVclP8QPMH79Le9sH3rs5RSwJu99W0WPZO43Q==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@75lb/nature": "latest" + }, + "peerDependenciesMeta": { + "@75lb/nature": { + "optional": true + } + } + }, + "node_modules/flatbuffers": { + "version": "25.9.23", + "resolved": "https://registry.npmjs.org/flatbuffers/-/flatbuffers-25.9.23.tgz", + "integrity": "sha512-MI1qs7Lo4Syw0EOzUl0xjs2lsoeqFku44KpngfIduHBYvzm8h2+7K8YMQh1JtVVVrUvhLpNwqVi4DERegUJhPQ==", + "license": "Apache-2.0", + "peer": true + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/get-east-asian-width": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.5.0.tgz", + "integrity": "sha512-CQ+bEO+Tva/qlmw24dCejulK5pMzVnUOFOijVogd3KQs07HnRIgp8TGipvCCRT06xeYEbpbgwaCxglFyiuIcmA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/get-tsconfig": { + "version": "4.13.6", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.13.6.tgz", + "integrity": "sha512-shZT/QMiSHc/YBLxxOkMtgSid5HFoauqCE3/exfsEcwg1WkeqjG+V40yBbBrsD+jW2HDXcs28xOfcbm2jI8Ddw==", + "dev": true, + "license": "MIT", + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + }, + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + } + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/husky": { + "version": "9.1.7", + "resolved": "https://registry.npmjs.org/husky/-/husky-9.1.7.tgz", + "integrity": "sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA==", + "dev": true, + "license": "MIT", + "bin": { + "husky": "bin.js" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/typicode" + } + }, + "node_modules/iconv-lite": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.2.tgz", + "integrity": "sha512-im9DjEDQ55s9fL4EYzOAv0yMqmMBSZp6G0VvFyTMPKWxiSBHUj9NW/qqLmXUwXrrM7AvqSlTCfvqRb0cM8yYqw==", + "dev": true, + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/js-yaml": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz", + "integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/json-bignum": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/json-bignum/-/json-bignum-0.0.3.tgz", + "integrity": "sha512-2WHyXj3OfHSgNyuzDbSxI1w2jgw5gkWSWhS7Qg4bWXx1nLk3jnbwfUeS0PSba3IzpTUWdHxBieELUzXRjQB2zg==", + "peer": true, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/json-with-bigint": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/json-with-bigint/-/json-with-bigint-3.5.3.tgz", + "integrity": "sha512-QObKu6nxy7NsxqR0VK4rkXnsNr5L9ElJaGEg+ucJ6J7/suoKZ0n+p76cu9aCqowytxEbwYNzvrMerfMkXneF5A==", + "dev": true, + "license": "MIT" + }, + "node_modules/lint-staged": { + "version": "16.2.7", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-16.2.7.tgz", + "integrity": "sha512-lDIj4RnYmK7/kXMya+qJsmkRFkGolciXjrsZ6PC25GdTfWOAWetR0ZbsNXRAj1EHHImRSalc+whZFg56F5DVow==", + "dev": true, + "license": "MIT", + "dependencies": { + "commander": "^14.0.2", + "listr2": "^9.0.5", + "micromatch": "^4.0.8", + "nano-spawn": "^2.0.0", + "pidtree": "^0.6.0", + "string-argv": "^0.3.2", + "yaml": "^2.8.1" + }, + "bin": { + "lint-staged": "bin/lint-staged.js" + }, + "engines": { + "node": ">=20.17" + }, + "funding": { + "url": "https://opencollective.com/lint-staged" + } + }, + "node_modules/listr2": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/listr2/-/listr2-9.0.5.tgz", + "integrity": "sha512-ME4Fb83LgEgwNw96RKNvKV4VTLuXfoKudAmm2lP8Kk87KaMK0/Xrx/aAkMWmT8mDb+3MlFDspfbCs7adjRxA2g==", + "dev": true, + "license": "MIT", + "dependencies": { + "cli-truncate": "^5.0.0", + "colorette": "^2.0.20", + "eventemitter3": "^5.0.1", + "log-update": "^6.1.0", + "rfdc": "^1.4.1", + "wrap-ansi": "^9.0.0" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/listr2/node_modules/cli-truncate": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-5.1.1.tgz", + "integrity": "sha512-SroPvNHxUnk+vIW/dOSfNqdy1sPEFkrTk6TUtqLCnBlo3N7TNYYkzzN7uSD6+jVjrdO4+p8nH7JzH6cIvUem6A==", + "dev": true, + "license": "MIT", + "dependencies": { + "slice-ansi": "^7.1.0", + "string-width": "^8.0.0" + }, + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/listr2/node_modules/cli-truncate/node_modules/string-width": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-8.2.0.tgz", + "integrity": "sha512-6hJPQ8N0V0P3SNmP6h2J99RLuzrWz2gvT7VnK5tKvrNqJoyS9W4/Fb8mo31UiPvy00z7DQXkP2hnKBVav76thw==", + "dev": true, + "license": "MIT", + "dependencies": { + "get-east-asian-width": "^1.5.0", + "strip-ansi": "^7.1.2" + }, + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/listr2/node_modules/is-fullwidth-code-point": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-5.1.0.tgz", + "integrity": "sha512-5XHYaSyiqADb4RnZ1Bdad6cPp8Toise4TzEjcOYDHZkTCbKgiUl7WTUCpNWHuxmDt91wnsZBc9xinNzopv3JMQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "get-east-asian-width": "^1.3.1" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/listr2/node_modules/slice-ansi": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-7.1.2.tgz", + "integrity": "sha512-iOBWFgUX7caIZiuutICxVgX1SdxwAVFFKwt1EvMYYec/NWO5meOJ6K5uQxhrYBdQJne4KxiqZc+KptFOWFSI9w==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.2.1", + "is-fullwidth-code-point": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/chalk/slice-ansi?sponsor=1" + } + }, + "node_modules/listr2/node_modules/wrap-ansi": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.2.tgz", + "integrity": "sha512-42AtmgqjV+X1VpdOfyTGOYRi0/zsoLqtXQckTmqTeybT+BDIbM/Guxo7x3pE2vtpr1ok6xRqM9OpBe+Jyoqyww==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.2.1", + "string-width": "^7.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/lodash.camelcase": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", + "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==", + "license": "MIT", + "peer": true + }, + "node_modules/log-update": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/log-update/-/log-update-6.1.0.tgz", + "integrity": "sha512-9ie8ItPR6tjY5uYJh8K/Zrv/RMZ5VOlOWvtZdEHYSTFKZfIBPQa9tOAEeAWhd+AnIneLJ22w5fjOYtoutpWq5w==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-escapes": "^7.0.0", + "cli-cursor": "^5.0.0", + "slice-ansi": "^7.1.0", + "strip-ansi": "^7.1.0", + "wrap-ansi": "^9.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-update/node_modules/is-fullwidth-code-point": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-5.1.0.tgz", + "integrity": "sha512-5XHYaSyiqADb4RnZ1Bdad6cPp8Toise4TzEjcOYDHZkTCbKgiUl7WTUCpNWHuxmDt91wnsZBc9xinNzopv3JMQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "get-east-asian-width": "^1.3.1" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-update/node_modules/slice-ansi": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-7.1.2.tgz", + "integrity": "sha512-iOBWFgUX7caIZiuutICxVgX1SdxwAVFFKwt1EvMYYec/NWO5meOJ6K5uQxhrYBdQJne4KxiqZc+KptFOWFSI9w==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.2.1", + "is-fullwidth-code-point": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/chalk/slice-ansi?sponsor=1" + } + }, + "node_modules/log-update/node_modules/wrap-ansi": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.2.tgz", + "integrity": "sha512-42AtmgqjV+X1VpdOfyTGOYRi0/zsoLqtXQckTmqTeybT+BDIbM/Guxo7x3pE2vtpr1ok6xRqM9OpBe+Jyoqyww==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.2.1", + "string-width": "^7.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/micromatch": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "dev": true, + "license": "MIT", + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/micromatch/node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/mimic-function": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/mimic-function/-/mimic-function-5.0.1.tgz", + "integrity": "sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/mute-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-3.0.0.tgz", + "integrity": "sha512-dkEJPVvun4FryqBmZ5KhDo0K9iDXAwn08tMLDinNdRBNPcYEDiWYysLcc6k3mjTMlbP9KyylvRpd4wFtwrT9rw==", + "dev": true, + "license": "ISC", + "engines": { + "node": "^20.17.0 || >=22.9.0" + } + }, + "node_modules/nano-spawn": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/nano-spawn/-/nano-spawn-2.0.0.tgz", + "integrity": "sha512-tacvGzUY5o2D8CBh2rrwxyNojUsZNU2zjNTzKQrkgGJQTbGAfArVWXSKMBokBeeg6C7OLRGUEyoFlYbfeWQIqw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=20.17" + }, + "funding": { + "url": "https://github.com/sindresorhus/nano-spawn?sponsor=1" + } + }, + "node_modules/obug": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/obug/-/obug-2.1.1.tgz", + "integrity": "sha512-uTqF9MuPraAQ+IsnPf366RG4cP9RtUi7MLO1N3KEc+wb0a6yKpeL0lmk2IB1jY5KHPAlTc6T/JRdC/YqxHNwkQ==", + "dev": true, + "funding": [ + "https://github.com/sponsors/sxzz", + "https://opencollective.com/debug" + ], + "license": "MIT" + }, + "node_modules/onetime": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-7.0.0.tgz", + "integrity": "sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "mimic-function": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/oxlint": { + "version": "1.50.0", + "resolved": "https://registry.npmjs.org/oxlint/-/oxlint-1.50.0.tgz", + "integrity": "sha512-iSJ4IZEICBma8cZX7kxIIz9PzsYLF2FaLAYN6RKu7VwRVKdu7RIgpP99bTZaGl//Yao7fsaGZLSEo5xBrI5ReQ==", + "dev": true, + "license": "MIT", + "bin": { + "oxlint": "bin/oxlint" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "optionalDependencies": { + "@oxlint/binding-android-arm-eabi": "1.50.0", + "@oxlint/binding-android-arm64": "1.50.0", + "@oxlint/binding-darwin-arm64": "1.50.0", + "@oxlint/binding-darwin-x64": "1.50.0", + "@oxlint/binding-freebsd-x64": "1.50.0", + "@oxlint/binding-linux-arm-gnueabihf": "1.50.0", + "@oxlint/binding-linux-arm-musleabihf": "1.50.0", + "@oxlint/binding-linux-arm64-gnu": "1.50.0", + "@oxlint/binding-linux-arm64-musl": "1.50.0", + "@oxlint/binding-linux-ppc64-gnu": "1.50.0", + "@oxlint/binding-linux-riscv64-gnu": "1.50.0", + "@oxlint/binding-linux-riscv64-musl": "1.50.0", + "@oxlint/binding-linux-s390x-gnu": "1.50.0", + "@oxlint/binding-linux-x64-gnu": "1.50.0", + "@oxlint/binding-linux-x64-musl": "1.50.0", + "@oxlint/binding-openharmony-arm64": "1.50.0", + "@oxlint/binding-win32-arm64-msvc": "1.50.0", + "@oxlint/binding-win32-ia32-msvc": "1.50.0", + "@oxlint/binding-win32-x64-msvc": "1.50.0" + }, + "peerDependencies": { + "oxlint-tsgolint": ">=0.14.1" + }, + "peerDependenciesMeta": { + "oxlint-tsgolint": { + "optional": true + } + } + }, + "node_modules/pidtree": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/pidtree/-/pidtree-0.6.0.tgz", + "integrity": "sha512-eG2dWTVw5bzqGRztnHExczNxt5VGsE6OwTeCG3fdUf9KBsZzO3R5OIIIzWR+iZA0NtZ+RDVdaoE2dK1cn6jH4g==", + "dev": true, + "license": "MIT", + "bin": { + "pidtree": "bin/pidtree.js" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/prettier": { + "version": "3.8.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.8.1.tgz", + "integrity": "sha512-UOnG6LftzbdaHZcKoPFtOcCKztrQ57WkHDeRD9t/PTQtmT0NHSeWWepj6pS0z/N7+08BHFDQVUrfmfMRcZwbMg==", + "dev": true, + "license": "MIT", + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + } + }, + "node_modules/restore-cursor": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-5.1.0.tgz", + "integrity": "sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==", + "dev": true, + "license": "MIT", + "dependencies": { + "onetime": "^7.0.0", + "signal-exit": "^4.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/rfdc": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.4.1.tgz", + "integrity": "sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==", + "dev": true, + "license": "MIT" + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true, + "license": "MIT" + }, + "node_modules/semver": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz", + "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/string-argv": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.2.tgz", + "integrity": "sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.6.19" + } + }, + "node_modules/string-width": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", + "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^10.3.0", + "get-east-asian-width": "^1.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/strip-ansi": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz", + "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.2.2" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "license": "MIT", + "peer": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/table-layout": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/table-layout/-/table-layout-4.1.1.tgz", + "integrity": "sha512-iK5/YhZxq5GO5z8wb0bY1317uDF3Zjpha0QFFLA8/trAoiLbQD0HUbMesEaxyzUgDxi2QlcbM8IvqOlEjgoXBA==", + "license": "MIT", + "peer": true, + "dependencies": { + "array-back": "^6.2.2", + "wordwrapjs": "^5.1.0" + }, + "engines": { + "node": ">=12.17" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "license": "0BSD" + }, + "node_modules/tsx": { + "version": "4.21.0", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.21.0.tgz", + "integrity": "sha512-5C1sg4USs1lfG0GFb2RLXsdpXqBSEhAaA/0kPL01wxzpMqLILNxIxIOKiILz+cdg/pLnOUxFYOR5yhHU666wbw==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "~0.27.0", + "get-tsconfig": "^4.7.5" + }, + "bin": { + "tsx": "dist/cli.mjs" + }, + "engines": { + "node": ">=18.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + } + }, + "node_modules/typanion": { + "version": "3.14.0", + "resolved": "https://registry.npmjs.org/typanion/-/typanion-3.14.0.tgz", + "integrity": "sha512-ZW/lVMRabETuYCd9O9ZvMhAh8GslSqaUjxmK/JLPCh6l73CvLBiuXswj/+7LdnWOgYsQ130FqLzFz5aGT4I3Ug==", + "dev": true, + "license": "MIT", + "workspaces": [ + "website" + ] + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/typical": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/typical/-/typical-7.3.0.tgz", + "integrity": "sha512-ya4mg/30vm+DOWfBg4YK3j2WD6TWtRkCbasOJr40CseYENzCUby/7rIvXA99JGsQHeNxLbnXdyLLxKSv3tauFw==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=12.17" + } + }, + "node_modules/undici-types": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz", + "integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==", + "license": "MIT", + "peer": true + }, + "node_modules/universal-user-agent": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-7.0.3.tgz", + "integrity": "sha512-TmnEAEAsBJVZM/AADELsK76llnwcf9vMKuPz8JflO1frO8Lchitr0fNaN9d+Ap0BjKtqWqd/J17qeDnXh8CL2A==", + "dev": true, + "license": "ISC" + }, + "node_modules/wordwrapjs": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/wordwrapjs/-/wordwrapjs-5.1.1.tgz", + "integrity": "sha512-0yweIbkINJodk27gX9LBGMzyQdBDan3s/dEAiwBOj+Mf0PPyWL6/rikalkv8EeD0E8jm4o5RXEOrFTP3NXbhJg==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=12.17" + } + }, + "node_modules/yaml": { + "version": "2.8.2", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.2.tgz", + "integrity": "sha512-mplynKqc1C2hTVYxd0PU2xQAc22TI1vShAYGksCCfxbn/dFwnHTNi1bvYsBTkhdUNtGIf5xNOg938rrSSYvS9A==", + "dev": true, + "license": "ISC", + "bin": { + "yaml": "bin.mjs" + }, + "engines": { + "node": ">= 14.6" + }, + "funding": { + "url": "https://github.com/sponsors/eemeli" + } + } + } +} diff --git a/javascript/package.json b/javascript/package.json new file mode 100644 index 0000000000..fec339b5a1 --- /dev/null +++ b/javascript/package.json @@ -0,0 +1,90 @@ +{ + "name": "adbc-driver-manager", + "version": "0.0.1", + "description": "Node.js ADBC Driver Manager", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "repository": { + "type": "git", + "url": "git+https://github.com/apache/arrow-adbc.git", + "directory": "javascript" + }, + "license": "Apache-2.0", + "keywords": [ + "adbc", + "arrow", + "database", + "arrow-adbc" + ], + "files": [ + "dist", + "binding.d.ts", + "binding.js" + ], + "napi": { + "binaryName": "adbc-driver-manager", + "targets": [ + "x86_64-pc-windows-msvc", + "x86_64-apple-darwin", + "x86_64-unknown-linux-gnu", + "aarch64-unknown-linux-gnu", + "aarch64-apple-darwin" + ] + }, + "engines": { + "node": ">=22.0.0" + }, + "scripts": { + "artifacts": "napi artifacts", + "build": "napi build --platform --release && mv index.js binding.js && mv index.d.ts binding.d.ts && tsc", + "build:debug": "napi build --platform && mv index.js binding.js && mv index.d.ts binding.d.ts && tsc", + "build:ts": "tsc", + "build:driver": "../ci/scripts/node_build.sh $(pwd)/build", + "fix": "prettier . -w && oxlint . --fix", + "check": "npm run check:js && npm run check:rust", + "check:js": "prettier --check . && oxlint . && tsc --noEmit", + "check:rust": "cargo fmt -- --check && cargo clippy -- -D warnings", + "test": "tsx --test __test__/*.spec.ts", + "preversion": "napi build --platform && git add .", + "version": "napi version", + "prepare": "husky" + }, + "devDependencies": { + "@napi-rs/cli": "^3.2.0", + "@taplo/cli": "^0.7.0", + "tsx": "^4.0.0", + "husky": "^9.1.7", + "lint-staged": "^16.1.6", + "oxlint": "^1.14.0", + "prettier": "^3.6.2", + "typescript": "^5.9.2" + }, + "lint-staged": { + "*.@(js|ts|tsx)": [ + "oxlint --fix" + ], + "*.@(js|ts|tsx|yml|yaml|md|json)": [ + "prettier --write" + ], + "*.toml": [ + "taplo format" + ] + }, + "prettier": { + "printWidth": 120, + "semi": false, + "trailingComma": "all", + "singleQuote": true, + "arrowParens": "always" + }, + "peerDependencies": { + "apache-arrow": "^21.1.0" + }, + "optionalDependencies": { + "adbc-driver-manager-win32-x64-msvc": "0.0.1", + "adbc-driver-manager-darwin-x64": "0.0.1", + "adbc-driver-manager-linux-x64-gnu": "0.0.1", + "adbc-driver-manager-linux-arm64-gnu": "0.0.1", + "adbc-driver-manager-darwin-arm64": "0.0.1" + } +} diff --git a/javascript/rustfmt.toml b/javascript/rustfmt.toml new file mode 100644 index 0000000000..e7ac63b078 --- /dev/null +++ b/javascript/rustfmt.toml @@ -0,0 +1,18 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +tab_spaces = 2 diff --git a/javascript/src/client.rs b/javascript/src/client.rs new file mode 100644 index 0000000000..3bc2e8dbb3 --- /dev/null +++ b/javascript/src/client.rs @@ -0,0 +1,349 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +use std::collections::{HashMap, HashSet}; +use std::path::PathBuf; +use std::sync::Mutex; + +use adbc_core::{ + options::{ + AdbcVersion, InfoCode, ObjectDepth, OptionConnection, OptionDatabase, OptionStatement, + OptionValue, + }, + Connection, Database, Driver, Optionable, Statement, LOAD_FLAG_DEFAULT, +}; +use adbc_driver_manager::{ManagedConnection, ManagedDatabase, ManagedDriver, ManagedStatement}; +use arrow_array::RecordBatchReader; +use arrow_ipc::reader::StreamReader; +use arrow_ipc::writer::StreamWriter; + +#[derive(Debug, thiserror::Error)] +pub enum ClientError { + #[error("ADBC Error: {0}")] + Adbc(#[from] adbc_core::error::Error), + #[error("Arrow Error: {0}")] + Arrow(#[from] arrow_schema::ArrowError), + #[error("Other Error: {0}")] + Other(String), +} + +pub type Result = std::result::Result; + +pub struct ConnectOptions { + pub driver: String, + pub entrypoint: Option, + pub search_paths: Option>, + pub load_flags: Option, + pub database_options: Option>, +} + +pub struct GetObjectsOptions { + pub depth: i32, + pub catalog: Option, + pub db_schema: Option, + pub table_name: Option, + pub table_type: Option>, + pub column_name: Option, +} + +pub struct GetTableSchemaOptions { + pub catalog: Option, + pub db_schema: Option, + pub table_name: String, +} + +pub struct AdbcDatabaseCore { + inner: ManagedDatabase, +} + +impl AdbcDatabaseCore { + pub fn new(opts: ConnectOptions) -> Result { + let version = AdbcVersion::V110; + let load_flags = opts.load_flags.unwrap_or(LOAD_FLAG_DEFAULT); + let entrypoint = opts.entrypoint.as_ref().map(|s| s.as_bytes().to_vec()); + + let search_paths: Option> = opts + .search_paths + .map(|paths| paths.into_iter().map(PathBuf::from).collect()); + + let database_opts = opts.database_options.map(map_database_options); + + let database = if opts.driver.contains(':') { + // URI-style ("sqlite:file::memory:") or profile URI ("profile://my_profile") + ManagedDatabase::from_uri_with_opts( + &opts.driver, + entrypoint.as_deref(), + version, + load_flags, + search_paths, + database_opts.into_iter().flatten(), + )? + } else { + // Short name ("sqlite") or path ("/usr/lib/libadbc_driver_sqlite.so") + let mut driver = ManagedDriver::load_from_name( + &opts.driver, + entrypoint.as_deref(), + version, + load_flags, + search_paths, + )?; + match database_opts { + Some(db_opts) => driver.new_database_with_opts(db_opts)?, + None => driver.new_database()?, + } + }; + + Ok(Self { inner: database }) + } + + pub fn connect(&self, options: Option>) -> Result { + let conn = if let Some(opts) = options { + self + .inner + .new_connection_with_opts(map_connection_options(opts))? + } else { + self.inner.new_connection()? + }; + Ok(AdbcConnectionCore { + inner: Mutex::new(conn), + }) + } +} + +pub struct AdbcConnectionCore { + inner: Mutex, +} + +impl AdbcConnectionCore { + pub fn new_statement(&self) -> Result { + let mut conn = self + .inner + .lock() + .map_err(|e| ClientError::Other(e.to_string()))?; + let stmt = conn.new_statement()?; + Ok(AdbcStatementCore { inner: stmt }) + } + + pub fn set_option(&self, key: &str, value: &str) -> Result<()> { + let mut conn = self + .inner + .lock() + .map_err(|e| ClientError::Other(e.to_string()))?; + conn.set_option( + OptionConnection::Other(key.to_string()), + OptionValue::String(value.to_string()), + )?; + Ok(()) + } + + pub fn get_objects(&self, opts: GetObjectsOptions) -> Result { + let conn = self + .inner + .lock() + .map_err(|e| ClientError::Other(e.to_string()))?; + let depth = match opts.depth { + 1 => ObjectDepth::Catalogs, + 2 => ObjectDepth::Schemas, + 3 => ObjectDepth::Tables, + _ => ObjectDepth::All, + }; + + let table_types_str: Option> = opts + .table_type + .as_ref() + .map(|v| v.iter().map(|s| s.as_str()).collect()); + + let reader = conn.get_objects( + depth, + opts.catalog.as_deref(), + opts.db_schema.as_deref(), + opts.table_name.as_deref(), + table_types_str, + opts.column_name.as_deref(), + )?; + + Ok(AdbcResultIteratorCore { + reader, + exhausted: false, + }) + } + + pub fn get_table_schema(&self, opts: GetTableSchemaOptions) -> Result> { + let conn = self + .inner + .lock() + .map_err(|e| ClientError::Other(e.to_string()))?; + let schema = conn.get_table_schema( + opts.catalog.as_deref(), + opts.db_schema.as_deref(), + &opts.table_name, + )?; + + let mut output = Vec::new(); + let mut writer = StreamWriter::try_new(&mut output, &schema)?; + writer.finish()?; + Ok(output) + } + + pub fn get_table_types(&self) -> Result { + let conn = self + .inner + .lock() + .map_err(|e| ClientError::Other(e.to_string()))?; + let reader = conn.get_table_types()?; + + Ok(AdbcResultIteratorCore { + reader, + exhausted: false, + }) + } + + pub fn get_info(&self, info_codes: Option>) -> Result { + let conn = self + .inner + .lock() + .map_err(|e| ClientError::Other(e.to_string()))?; + let codes: Option> = info_codes.map(|v| { + v.into_iter() + .filter_map(|code| InfoCode::try_from(code).ok()) + .collect::>() + }); + let reader = conn.get_info(codes)?; + + Ok(AdbcResultIteratorCore { + reader, + exhausted: false, + }) + } + + pub fn commit(&self) -> Result<()> { + let mut conn = self + .inner + .lock() + .map_err(|e| ClientError::Other(e.to_string()))?; + conn.commit()?; + Ok(()) + } + + pub fn rollback(&self) -> Result<()> { + let mut conn = self + .inner + .lock() + .map_err(|e| ClientError::Other(e.to_string()))?; + conn.rollback()?; + Ok(()) + } +} + +pub struct AdbcStatementCore { + inner: ManagedStatement, +} + +impl AdbcStatementCore { + pub fn set_sql_query(&mut self, query: &str) -> Result<()> { + self.inner.set_sql_query(query)?; + Ok(()) + } + + pub fn set_option(&mut self, key: &str, value: &str) -> Result<()> { + self.inner.set_option( + OptionStatement::Other(key.to_string()), + OptionValue::String(value.to_string()), + )?; + Ok(()) + } + + pub fn execute_query(&mut self) -> Result { + let reader = self.inner.execute()?; + + Ok(AdbcResultIteratorCore { + reader, + exhausted: false, + }) + } + + pub fn execute_update(&mut self) -> Result { + let rows = self.inner.execute_update()?; + Ok(rows.unwrap_or(-1)) + } + + pub fn bind(&mut self, c_data: Vec) -> Result<()> { + let mut reader = + StreamReader::try_new(std::io::Cursor::new(c_data), None).map_err(ClientError::Arrow)?; + let batch = match reader.next() { + Some(Ok(b)) => b, + Some(Err(e)) => return Err(ClientError::Arrow(e)), + None => { + return Err(ClientError::Other( + "bind() received an empty record batch stream".to_string(), + )) + } + }; + if reader.next().is_some() { + return Err(ClientError::Other( + "bind() received multiple record batches; concatenate into one batch first".to_string(), + )); + } + self.inner.bind(batch)?; + Ok(()) + } +} + +pub struct AdbcResultIteratorCore { + reader: Box, + exhausted: bool, +} + +impl AdbcResultIteratorCore { + pub fn next(&mut self) -> Result>> { + if self.exhausted { + return Ok(None); + } + self.exhausted = true; + + let schema = self.reader.schema(); + let mut output = Vec::new(); + let mut writer = StreamWriter::try_new(&mut output, &schema)?; + for batch in self.reader.by_ref() { + writer.write(&batch?)?; + } + writer.finish()?; + Ok(Some(output)) + } +} + +fn map_database_options( + opts: HashMap, +) -> impl Iterator { + opts.into_iter().map(|(k, v)| { + let key = match k.as_str() { + "uri" => OptionDatabase::Uri, + "user" => OptionDatabase::Username, + "password" => OptionDatabase::Password, + other => OptionDatabase::Other(other.to_string()), + }; + (key, OptionValue::String(v)) + }) +} + +fn map_connection_options( + opts: HashMap, +) -> impl Iterator { + opts + .into_iter() + .map(|(k, v)| (OptionConnection::Other(k), OptionValue::String(v))) +} diff --git a/javascript/src/lib.rs b/javascript/src/lib.rs new file mode 100644 index 0000000000..94d5bc7a87 --- /dev/null +++ b/javascript/src/lib.rs @@ -0,0 +1,733 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +mod client; +use crate::client::{ + AdbcConnectionCore as CoreConnection, AdbcDatabaseCore as CoreDatabase, + AdbcResultIteratorCore as CoreResultIterator, AdbcStatementCore as CoreStatement, ClientError, + ConnectOptions as CoreConnectOptions, GetObjectsOptions as CoreGetObjectsOptions, + GetTableSchemaOptions as CoreGetTableSchemaOptions, +}; +use adbc_core::options::AdbcVersion; +use napi::bindgen_prelude::{ + AsyncTask, Buffer, Error, JsObjectValue, Result, Status, ToNapiValue, Unknown, +}; +use napi::{Env, Task}; +use std::collections::HashMap; +use std::sync::{Arc, Mutex}; + +#[macro_use] +extern crate napi_derive; + +fn to_napi_err(err: ClientError) -> Error { + match err { + ClientError::Adbc(e) => Error::new(Status::GenericFailure, e.message), + ClientError::Arrow(e) => Error::new(Status::GenericFailure, format!("Arrow Error: {e}")), + ClientError::Other(e) => Error::new(Status::GenericFailure, format!("Internal Error: {e}")), + } +} + +/// Converts an ADBC error into a `napi::Error` whose JS form is a structured `AdbcError` +/// object with `name`, `code`, `vendorCode`, and `sqlState` properties. +/// +/// The JS object is stored via `napi_ref` (napi-rs's `maybe_raw` field) so napi-rs uses it +/// directly as the throw/rejection value. This avoids `env.throw()`, which sets a V8 pending +/// exception that would escape `Task::reject` as an uncaughtException instead of rejecting +/// the Promise. +fn build_adbc_err(env: Env, ae: adbc_core::error::Error) -> Error { + let adbc_core::error::Error { + message, + status, + vendor_code, + sqlstate, + .. + } = ae; + // details (ADBC 1.1.0 key-value metadata) are not yet exposed to JS. + let Ok(mut js_err) = env.create_error(Error::new(Status::GenericFailure, message.as_str())) + else { + return Error::new(Status::GenericFailure, message); + }; + let _ = js_err.set_named_property("name", "AdbcError"); + let _ = js_err.set_named_property("code", format!("{status:?}").as_str()); + if vendor_code != i32::MIN { + let _ = js_err.set_named_property("vendorCode", vendor_code); + } + let sqlstate_bytes: [u8; 5] = sqlstate.map(|c| c as u8); + if sqlstate_bytes.iter().any(|&b| b != 0) { + let sql_state = std::str::from_utf8(&sqlstate_bytes).unwrap_or(""); + let _ = js_err.set_named_property("sqlState", sql_state); + } + let raw_env = env.raw(); + match unsafe { ToNapiValue::to_napi_value(raw_env, js_err) } { + Ok(raw_val) => Error::from(unsafe { Unknown::from_raw_unchecked(raw_env, raw_val) }), + Err(fallback) => fallback, + } +} + +/// For synchronous `#[napi]` methods: converts a `ClientError` to a `napi::Error` that, +/// when propagated by napi-rs, throws a structured `AdbcError` JS object. +fn sync_adbc_err(err: ClientError, env: Env) -> Error { + match err { + ClientError::Adbc(ae) => build_adbc_err(env, ae), + other => to_napi_err(other), + } +} + +/// Captures an ADBC error from a thread-pool `compute()` result into `sink` so that +/// `reject()` (main JS thread) can later call `build_adbc_err` with an `Env`. +fn capture_adbc_err( + result: crate::client::Result, + sink: &mut Option, +) -> Result { + result.map_err(|e| match e { + ClientError::Adbc(ae) => { + let napi_err = Error::new(Status::GenericFailure, ae.message.as_str()); + *sink = Some(ae); + napi_err + } + other => to_napi_err(other), + }) +} + +fn reject_adbc( + env: Env, + adbc_err: &mut Option, + err: Error, +) -> Result { + Err( + adbc_err + .take() + .map(|ae| build_adbc_err(env, ae)) + .unwrap_or(err), + ) +} + +fn closed_err() -> Error { + Error::new(Status::GenericFailure, "Object is closed") +} + +#[napi] +pub fn crate_version() -> String { + env!("CARGO_PKG_VERSION").to_string() +} + +#[napi] +pub fn default_adbc_version() -> String { + match AdbcVersion::default() { + AdbcVersion::V100 => "1.0.0".to_string(), + AdbcVersion::V110 => "1.1.0".to_string(), + _ => "unknown".to_string(), + } +} + +#[napi] +pub fn default_load_flags() -> u32 { + adbc_core::LOAD_FLAG_DEFAULT +} + +// Options +#[napi(object)] +pub struct ConnectOptions { + pub driver: String, + pub entrypoint: Option, + pub search_paths: Option>, + pub load_flags: Option, + pub database_options: Option>, +} + +impl From for CoreConnectOptions { + fn from(opts: ConnectOptions) -> Self { + Self { + driver: opts.driver, + entrypoint: opts.entrypoint, + search_paths: opts.search_paths, + load_flags: opts.load_flags, + database_options: opts.database_options, + } + } +} + +#[napi(object)] +pub struct GetObjectsOptions { + pub depth: i32, + pub catalog: Option, + pub db_schema: Option, + pub table_name: Option, + pub table_type: Option>, + pub column_name: Option, +} + +impl From for CoreGetObjectsOptions { + fn from(opts: GetObjectsOptions) -> Self { + Self { + depth: opts.depth, + catalog: opts.catalog, + db_schema: opts.db_schema, + table_name: opts.table_name, + table_type: opts.table_type, + column_name: opts.column_name, + } + } +} + +#[napi(object)] +pub struct GetTableSchemaOptions { + pub catalog: Option, + pub db_schema: Option, + pub table_name: String, +} + +impl From for CoreGetTableSchemaOptions { + fn from(opts: GetTableSchemaOptions) -> Self { + Self { + catalog: opts.catalog, + db_schema: opts.db_schema, + table_name: opts.table_name, + } + } +} + +// --- Database --- + +#[napi] +pub struct _NativeAdbcDatabase { + inner: Option>, +} + +#[napi] +impl _NativeAdbcDatabase { + #[napi(constructor)] + pub fn new(opts: ConnectOptions) -> Result { + let db = CoreDatabase::new(opts.into()).map_err(to_napi_err)?; + Ok(Self { + inner: Some(Arc::new(db)), + }) + } + + #[napi] + pub fn connect( + &self, + options: Option>, + ) -> Result> { + let db = self.inner.as_ref().ok_or_else(closed_err)?; + Ok(AsyncTask::new(ConnectTask { + database: db.clone(), + options, + adbc_err: None, + })) + } + + #[napi] + pub fn close(&mut self) -> Result<()> { + self.inner.take(); + Ok(()) + } +} + +pub struct ConnectTask { + database: Arc, + options: Option>, + adbc_err: Option, +} + +impl Task for ConnectTask { + type Output = CoreConnection; + type JsValue = _NativeAdbcConnection; + + fn compute(&mut self) -> Result { + capture_adbc_err( + self.database.connect(self.options.take()), + &mut self.adbc_err, + ) + } + + fn resolve(&mut self, _env: Env, output: Self::Output) -> Result { + Ok(_NativeAdbcConnection { + inner: Some(Arc::new(output)), + }) + } + + fn reject(&mut self, env: Env, err: Error) -> Result { + reject_adbc(env, &mut self.adbc_err, err) + } +} + +// --- Connection --- + +#[napi] +pub struct _NativeAdbcConnection { + inner: Option>, +} + +#[napi] +impl _NativeAdbcConnection { + #[napi] + pub fn create_statement(&self) -> Result> { + let conn = self.inner.as_ref().ok_or_else(closed_err)?; + Ok(AsyncTask::new(CreateStatementTask { + connection: conn.clone(), + adbc_err: None, + })) + } + + #[napi] + pub fn set_option(&self, env: Env, key: String, value: String) -> Result<()> { + let conn = self.inner.as_ref().ok_or_else(closed_err)?; + conn + .set_option(&key, &value) + .map_err(|e| sync_adbc_err(e, env)) + } + + #[napi] + pub fn get_objects(&self, opts: GetObjectsOptions) -> Result> { + let conn = self.inner.as_ref().ok_or_else(closed_err)?; + Ok(AsyncTask::new(GetObjectsTask { + connection: conn.clone(), + options: Some(opts.into()), + adbc_err: None, + })) + } + + #[napi] + pub fn get_table_schema( + &self, + opts: GetTableSchemaOptions, + ) -> Result> { + let conn = self.inner.as_ref().ok_or_else(closed_err)?; + Ok(AsyncTask::new(GetTableSchemaTask { + connection: conn.clone(), + options: Some(opts.into()), + adbc_err: None, + })) + } + + #[napi] + pub fn get_table_types(&self) -> Result> { + let conn = self.inner.as_ref().ok_or_else(closed_err)?; + Ok(AsyncTask::new(GetTableTypesTask { + connection: conn.clone(), + adbc_err: None, + })) + } + + #[napi] + pub fn get_info(&self, info_codes: Option>) -> Result> { + let conn = self.inner.as_ref().ok_or_else(closed_err)?; + Ok(AsyncTask::new(GetInfoTask { + connection: conn.clone(), + info_codes, + adbc_err: None, + })) + } + + #[napi] + pub fn commit(&self) -> Result> { + let conn = self.inner.as_ref().ok_or_else(closed_err)?; + Ok(AsyncTask::new(CommitTask { + connection: conn.clone(), + adbc_err: None, + })) + } + + #[napi] + pub fn rollback(&self) -> Result> { + let conn = self.inner.as_ref().ok_or_else(closed_err)?; + Ok(AsyncTask::new(RollbackTask { + connection: conn.clone(), + adbc_err: None, + })) + } + + #[napi] + pub fn close(&mut self) -> Result<()> { + self.inner.take(); + Ok(()) + } +} + +pub struct CreateStatementTask { + connection: Arc, + adbc_err: Option, +} + +impl Task for CreateStatementTask { + type Output = CoreStatement; + type JsValue = _NativeAdbcStatement; + + fn compute(&mut self) -> Result { + capture_adbc_err(self.connection.new_statement(), &mut self.adbc_err) + } + + fn resolve(&mut self, _env: Env, output: Self::Output) -> Result { + Ok(_NativeAdbcStatement { + inner: Some(Arc::new(Mutex::new(output))), + }) + } + + fn reject(&mut self, env: Env, err: Error) -> Result { + reject_adbc(env, &mut self.adbc_err, err) + } +} + +// Metadata Tasks + +pub struct GetObjectsTask { + connection: Arc, + options: Option, + adbc_err: Option, +} + +impl Task for GetObjectsTask { + type Output = CoreResultIterator; + type JsValue = _NativeAdbcResultIterator; + + fn compute(&mut self) -> Result { + let opts = self.options.take().expect("compute called twice"); + capture_adbc_err(self.connection.get_objects(opts), &mut self.adbc_err) + } + + fn resolve(&mut self, _env: Env, output: Self::Output) -> Result { + Ok(_NativeAdbcResultIterator { + inner: Some(Arc::new(Mutex::new(output))), + }) + } + + fn reject(&mut self, env: Env, err: Error) -> Result { + reject_adbc(env, &mut self.adbc_err, err) + } +} + +pub struct GetTableSchemaTask { + connection: Arc, + options: Option, + adbc_err: Option, +} + +impl Task for GetTableSchemaTask { + type Output = Vec; + type JsValue = Buffer; + + fn compute(&mut self) -> Result { + let opts = self.options.take().expect("compute called twice"); + capture_adbc_err(self.connection.get_table_schema(opts), &mut self.adbc_err) + } + + fn resolve(&mut self, _env: Env, output: Self::Output) -> Result { + Ok(Buffer::from(output)) + } + + fn reject(&mut self, env: Env, err: Error) -> Result { + reject_adbc(env, &mut self.adbc_err, err) + } +} + +pub struct GetTableTypesTask { + connection: Arc, + adbc_err: Option, +} + +impl Task for GetTableTypesTask { + type Output = CoreResultIterator; + type JsValue = _NativeAdbcResultIterator; + + fn compute(&mut self) -> Result { + capture_adbc_err(self.connection.get_table_types(), &mut self.adbc_err) + } + + fn resolve(&mut self, _env: Env, output: Self::Output) -> Result { + Ok(_NativeAdbcResultIterator { + inner: Some(Arc::new(Mutex::new(output))), + }) + } + + fn reject(&mut self, env: Env, err: Error) -> Result { + reject_adbc(env, &mut self.adbc_err, err) + } +} + +pub struct GetInfoTask { + connection: Arc, + info_codes: Option>, + adbc_err: Option, +} + +impl Task for GetInfoTask { + type Output = CoreResultIterator; + type JsValue = _NativeAdbcResultIterator; + + fn compute(&mut self) -> Result { + capture_adbc_err( + self.connection.get_info(self.info_codes.take()), + &mut self.adbc_err, + ) + } + + fn resolve(&mut self, _env: Env, output: Self::Output) -> Result { + Ok(_NativeAdbcResultIterator { + inner: Some(Arc::new(Mutex::new(output))), + }) + } + + fn reject(&mut self, env: Env, err: Error) -> Result { + reject_adbc(env, &mut self.adbc_err, err) + } +} + +pub struct CommitTask { + connection: Arc, + adbc_err: Option, +} + +impl Task for CommitTask { + type Output = (); + type JsValue = (); + + fn compute(&mut self) -> Result { + capture_adbc_err(self.connection.commit(), &mut self.adbc_err) + } + + fn resolve(&mut self, _env: Env, _output: Self::Output) -> Result { + Ok(()) + } + + fn reject(&mut self, env: Env, err: Error) -> Result { + reject_adbc(env, &mut self.adbc_err, err) + } +} + +pub struct RollbackTask { + connection: Arc, + adbc_err: Option, +} + +impl Task for RollbackTask { + type Output = (); + type JsValue = (); + + fn compute(&mut self) -> Result { + capture_adbc_err(self.connection.rollback(), &mut self.adbc_err) + } + + fn resolve(&mut self, _env: Env, _output: Self::Output) -> Result { + Ok(()) + } + + fn reject(&mut self, env: Env, err: Error) -> Result { + reject_adbc(env, &mut self.adbc_err, err) + } +} + +// --- Statement --- + +#[napi] +pub struct _NativeAdbcStatement { + inner: Option>>, +} + +#[napi] +impl _NativeAdbcStatement { + #[napi] + pub fn set_sql_query(&self, env: Env, query: String) -> Result<()> { + let mutex = self.inner.as_ref().ok_or_else(closed_err)?; + let mut stmt = mutex + .lock() + .map_err(|e| Error::from_reason(e.to_string()))?; + stmt + .set_sql_query(&query) + .map_err(|e| sync_adbc_err(e, env)) + } + + #[napi] + pub fn set_option(&self, env: Env, key: String, value: String) -> Result<()> { + let mutex = self.inner.as_ref().ok_or_else(closed_err)?; + let mut stmt = mutex + .lock() + .map_err(|e| Error::from_reason(e.to_string()))?; + stmt + .set_option(&key, &value) + .map_err(|e| sync_adbc_err(e, env)) + } + + #[napi] + pub fn execute_query(&self) -> Result> { + let mutex = self.inner.as_ref().ok_or_else(closed_err)?; + Ok(AsyncTask::new(ExecuteQueryTask { + statement: mutex.clone(), + adbc_err: None, + })) + } + + #[napi] + pub fn execute_update(&self) -> Result> { + let mutex = self.inner.as_ref().ok_or_else(closed_err)?; + Ok(AsyncTask::new(ExecuteUpdateTask { + statement: mutex.clone(), + adbc_err: None, + })) + } + + #[napi] + pub fn bind(&self, data: Buffer) -> Result> { + let mutex = self.inner.as_ref().ok_or_else(closed_err)?; + Ok(AsyncTask::new(BindTask { + statement: mutex.clone(), + data: data.to_vec(), + adbc_err: None, + })) + } + + #[napi] + pub fn close(&mut self) -> Result<()> { + self.inner.take(); + Ok(()) + } +} + +pub struct ExecuteQueryTask { + statement: Arc>, + adbc_err: Option, +} + +impl Task for ExecuteQueryTask { + type Output = CoreResultIterator; + type JsValue = _NativeAdbcResultIterator; + + fn compute(&mut self) -> Result { + let mut stmt = self + .statement + .lock() + .map_err(|e| Error::from_reason(e.to_string()))?; + capture_adbc_err(stmt.execute_query(), &mut self.adbc_err) + } + + fn resolve(&mut self, _env: Env, output: Self::Output) -> Result { + Ok(_NativeAdbcResultIterator { + inner: Some(Arc::new(Mutex::new(output))), + }) + } + + fn reject(&mut self, env: Env, err: Error) -> Result { + reject_adbc(env, &mut self.adbc_err, err) + } +} + +pub struct ExecuteUpdateTask { + statement: Arc>, + adbc_err: Option, +} + +impl Task for ExecuteUpdateTask { + type Output = i64; + type JsValue = i64; + + fn compute(&mut self) -> Result { + let mut stmt = self + .statement + .lock() + .map_err(|e| Error::from_reason(e.to_string()))?; + capture_adbc_err(stmt.execute_update(), &mut self.adbc_err) + } + + fn resolve(&mut self, _env: Env, output: Self::Output) -> Result { + Ok(output) + } + + fn reject(&mut self, env: Env, err: Error) -> Result { + reject_adbc(env, &mut self.adbc_err, err) + } +} + +pub struct BindTask { + statement: Arc>, + data: Vec, + adbc_err: Option, +} + +impl Task for BindTask { + type Output = (); + type JsValue = (); + + fn compute(&mut self) -> Result { + let mut stmt = self + .statement + .lock() + .map_err(|e| Error::from_reason(e.to_string()))?; + capture_adbc_err( + stmt.bind(std::mem::take(&mut self.data)), + &mut self.adbc_err, + ) + } + + fn resolve(&mut self, _env: Env, _output: Self::Output) -> Result { + Ok(()) + } + + fn reject(&mut self, env: Env, err: Error) -> Result { + reject_adbc(env, &mut self.adbc_err, err) + } +} + +// --- Iterators --- + +pub struct IteratorNextTask { + iterator: Arc>, + adbc_err: Option, +} + +impl Task for IteratorNextTask { + type Output = Option>; + type JsValue = Option; + + fn compute(&mut self) -> Result { + let mut iterator = self + .iterator + .lock() + .map_err(|e| Error::from_reason(e.to_string()))?; + capture_adbc_err(iterator.next(), &mut self.adbc_err) + } + + fn resolve(&mut self, _env: Env, output: Self::Output) -> Result { + Ok(output.map(Buffer::from)) + } + + fn reject(&mut self, env: Env, err: Error) -> Result { + reject_adbc(env, &mut self.adbc_err, err) + } +} + +#[napi] +pub struct _NativeAdbcResultIterator { + inner: Option>>, +} + +#[napi] +impl _NativeAdbcResultIterator { + #[napi] + pub fn next(&self) -> Result> { + let iterator = self.inner.as_ref().ok_or_else(closed_err)?; + Ok(AsyncTask::new(IteratorNextTask { + iterator: iterator.clone(), + adbc_err: None, + })) + } + + #[napi] + pub fn close(&mut self) -> Result<()> { + self.inner.take(); + Ok(()) + } +} diff --git a/javascript/tsconfig.json b/javascript/tsconfig.json new file mode 100644 index 0000000000..a0900962f7 --- /dev/null +++ b/javascript/tsconfig.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "target": "ES2020", + "strict": true, + "moduleResolution": "node", + "module": "CommonJS", + "noUnusedLocals": true, + "noUnusedParameters": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "rootDir": "lib", + "outDir": "./dist", + "declaration": true, + "paths": { + "apache-arrow": ["./node_modules/apache-arrow"] + } + }, + "include": ["lib"], + "exclude": ["node_modules", "bench", "__test__", "src"] +}