diff --git a/.bumpversion.toml b/.bumpversion.toml index 05364b111..21b676b32 100644 --- a/.bumpversion.toml +++ b/.bumpversion.toml @@ -93,4 +93,30 @@ replace = 'lance-namespace-urllib3-client=={new_version}' [[tool.bumpversion.files]] filename = "java/lance-namespace-core/pom.xml" search = "{current_version}" -replace = "{new_version}" \ No newline at end of file +replace = "{new_version}" + +# TypeScript workspace and package versions +[[tool.bumpversion.files]] +filename = "typescript/Makefile" +search = "VERSION = {current_version}" +replace = "VERSION = {new_version}" + +[[tool.bumpversion.files]] +filename = "typescript/package.json" +search = '"version": "{current_version}"' +replace = '"version": "{new_version}"' + +[[tool.bumpversion.files]] +filename = "typescript/lance-namespace/package.json" +search = '"version": "{current_version}"' +replace = '"version": "{new_version}"' + +[[tool.bumpversion.files]] +filename = "typescript/lance-namespace-fetch-client/package.json" +search = '"version": "{current_version}"' +replace = '"version": "{new_version}"' + +[[tool.bumpversion.files]] +filename = "typescript/lance-namespace-rest/package.json" +search = '"version": "{current_version}"' +replace = '"version": "{new_version}"' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1841478cf..0bc913c03 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -53,9 +53,17 @@ jobs: java-version: 17 cache: "maven" + - name: Set up Node + uses: actions/setup-node@v4 + with: + node-version: 22 + - name: Install uv uses: astral-sh/setup-uv@v4 + - name: Enable corepack + run: corepack enable + - name: Install dependencies run: uv sync --all-packages @@ -217,9 +225,9 @@ jobs: echo "3. Publish the release to:" >> $GITHUB_STEP_SUMMARY if [ "${{ inputs.release_channel }}" == "stable" ]; then echo " - Create the official release" >> $GITHUB_STEP_SUMMARY - echo " - Trigger automatic publishing to Maven Central, PyPI, and crates.io" >> $GITHUB_STEP_SUMMARY + echo " - Trigger automatic publishing to Maven Central, PyPI, crates.io, and npm" >> $GITHUB_STEP_SUMMARY else echo " - Create a preview/beta release" >> $GITHUB_STEP_SUMMARY - echo " - Trigger automatic publishing to Maven Central, PyPI, and crates.io (as pre-release version)" >> $GITHUB_STEP_SUMMARY + echo " - Trigger automatic publishing to Maven Central, PyPI, crates.io, and npm (as pre-release version)" >> $GITHUB_STEP_SUMMARY fi fi diff --git a/.github/workflows/spec.yml b/.github/workflows/spec.yml index 98d294d59..f35da1340 100644 --- a/.github/workflows/spec.yml +++ b/.github/workflows/spec.yml @@ -44,8 +44,14 @@ jobs: distribution: temurin java-version: 17 cache: "maven" + - name: Set up Node + uses: actions/setup-node@v4 + with: + node-version: 22 - name: Install uv uses: astral-sh/setup-uv@v4 + - name: Enable corepack + run: corepack enable - name: Install dependencies run: uv sync --all-packages - name: Codegen diff --git a/.github/workflows/typescript-publish.yml b/.github/workflows/typescript-publish.yml new file mode 100644 index 000000000..a0e1c35ec --- /dev/null +++ b/.github/workflows/typescript-publish.yml @@ -0,0 +1,81 @@ +# 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. + +name: TypeScript Publish + +on: + release: + types: + - released + pull_request: + paths: + - .github/workflows/typescript-publish.yml + workflow_dispatch: + inputs: + mode: + description: "Release mode" + required: true + type: choice + default: dry_run + options: + - dry_run + - release + ref: + description: "The branch, tag or SHA to checkout" + required: false + type: string + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + ref: ${{ github.event.release.tag_name || inputs.ref || '' }} + + - name: Install uv + uses: astral-sh/setup-uv@v4 + + - name: Set up pnpm + uses: pnpm/action-setup@v4 + with: + version: 10 + run_install: false + + - name: Set up Node + uses: actions/setup-node@v4 + with: + node-version: 22 + registry-url: https://registry.npmjs.org/ + cache: pnpm + cache-dependency-path: typescript/pnpm-lock.yaml + + - name: Build TypeScript modules + working-directory: typescript + run: make build + + - name: Dry run publish + if: | + github.event_name == 'pull_request' || + (github.event_name == 'workflow_dispatch' && github.event.inputs.mode == 'dry_run') + working-directory: typescript + run: make publish PUBLISH_FLAGS="--dry-run --no-git-checks --access public" + + - name: Publish to npm + if: | + (github.event_name == 'release' && github.event.action == 'released') || + (github.event_name == 'workflow_dispatch' && github.event.inputs.mode == 'release') + working-directory: typescript + run: make publish PUBLISH_FLAGS="--no-git-checks --access public" + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/typescript.yml b/.github/workflows/typescript.yml new file mode 100644 index 000000000..e4df05395 --- /dev/null +++ b/.github/workflows/typescript.yml @@ -0,0 +1,72 @@ +# 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. + +name: TypeScript + +on: + push: + branches: + - main + pull_request: + types: + - opened + - synchronize + - ready_for_review + - reopened + paths: + - docs/src/rest.yaml + - typescript/** + - Makefile + - .github/workflows/typescript.yml + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + +jobs: + linux-build: + runs-on: ubuntu-24.04 + timeout-minutes: 60 + steps: + - name: Checkout lance-namespace repo + uses: actions/checkout@v4 + - name: Install uv + uses: astral-sh/setup-uv@v4 + - name: Set up pnpm + uses: pnpm/action-setup@v4 + with: + version: 10 + run_install: false + - name: Set up Node + uses: actions/setup-node@v4 + with: + node-version: 22 + cache: pnpm + cache-dependency-path: typescript/pnpm-lock.yaml + - name: Regenerate TypeScript code + run: make gen-typescript + - name: Check no difference in TypeScript codegen + run: | + output=$(git diff) + if [ -z "$output" ]; then + echo "There is no difference in TypeScript codegen" + else + echo "Detected difference in TypeScript codegen" + echo "$output" + exit 1 + fi + - name: Lint TypeScript modules + run: make -C typescript lint + - name: Test TypeScript modules + run: make -C typescript test + - name: Build TypeScript modules + run: make build-typescript diff --git a/.gitignore b/.gitignore index f01b9263b..a322b129e 100644 --- a/.gitignore +++ b/.gitignore @@ -57,6 +57,7 @@ dist/ cmake-build-* .vscode .DS_Store +node_modules/ python/lance/_*.cpp @@ -117,4 +118,4 @@ env.bak/ venv.bak/ # Docs -docs/site \ No newline at end of file +docs/site diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1a86e217b..fc2cc7c51 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -107,6 +107,9 @@ This repository currently contains the following components: | Java Apache Client | Java | java/lance-namespace-apache-client | Generated Java Apache HTTP client for Lance REST Namespace | | Java SpringBoot Server| Java | java/lance-namespace-springboot-server | Generated Java SpringBoot server for Lance REST Namespace | | Rust Reqwest Client | Rust | rust/lance-namespace-reqwest-client | Generated Rust reqwest client for Lance REST Namespace | +| TypeScript Core | TypeScript | typescript/lance-namespace | Core LanceNamespace interface and connect functionality | +| TypeScript REST Impl | TypeScript | typescript/lance-namespace-rest | REST namespace implementation for TypeScript core interface | +| TypeScript Fetch Client | TypeScript | typescript/lance-namespace-fetch-client | Generated TypeScript fetch client for Lance REST Namespace | ## Install uv @@ -138,11 +141,15 @@ You can also run `make -` to only run the command in the spec - `make gen-python`: codegen and lint all Python modules - `make build-rust`: build all Rust modules +- `make gen-typescript`: codegen TypeScript fetch client module +- `make build-typescript`: build all TypeScript modules You can also run `make --` inside a language folder to run the command against a specific module, for example: - `make gen-rust-reqwest-client`: codegen and lint the Rust reqwest client module - `make build-java-springboot-server`: build the Java Spring Boot server module +- `make gen-fetch-client` (inside `typescript`): codegen TypeScript fetch client module +- `make build` (inside `typescript`): build TypeScript fetch client and core module ## Documentation @@ -200,5 +207,5 @@ This section describes the CI/CD workflows for automated version management, rel - Go to the [Releases page](../../releases) to review the draft - Edit release notes if needed - Click "Publish release" to: - - For stable releases: Trigger automatic publishing for Java, Python, Rust - - For preview releases: Create a beta release (not published) + - For stable releases: Trigger automatic publishing for Java, Python, Rust, and TypeScript (npm) + - For preview releases: Create a beta release and trigger preview package publishing diff --git a/Makefile b/Makefile index 50e0cf08e..573c97804 100644 --- a/Makefile +++ b/Makefile @@ -18,14 +18,26 @@ lint: clean-rust: cd rust; make clean +.PHONY: clean-typescript +clean-typescript: + cd typescript; make clean + .PHONY: sync gen-rust gen-rust: cd rust; make gen +.PHONY: gen-typescript +gen-typescript: + cd typescript; make gen + .PHONY: build-rust build-rust: cd rust; make build +.PHONY: build-typescript +build-typescript: + cd typescript; make build + .PHONY: clean-python clean-python: cd python; make clean @@ -63,10 +75,10 @@ sync: uv sync --all-packages .PHONY: clean -clean: clean-rust clean-python clean-java +clean: clean-rust clean-python clean-java clean-typescript .PHONY: gen -gen: lint gen-rust gen-python gen-java +gen: lint gen-rust gen-python gen-java gen-typescript .PHONY: build -build: lint build-docs build-rust build-python build-java +build: lint build-docs build-rust build-python build-java build-typescript diff --git a/README.md b/README.md index a52996bea..0d4918497 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,7 @@ that compute engines can integrate against: | Python | `lance-namespace` | Core interface and connect functionality | | Java | `org.lance:lance-namespace-core` | Core interface for Spark, Flink, Kafka, Trino, Presto | | Rust | `lance-namespace` | Core interface (in [lance-format/lance](https://github.com/lance-format/lance)) | +| TypeScript | `@lance/lance-namespace` | Core interface and connect functionality for TypeScript | ## Resources diff --git a/typescript/Makefile b/typescript/Makefile new file mode 100644 index 000000000..58c3a8c76 --- /dev/null +++ b/typescript/Makefile @@ -0,0 +1,76 @@ +# 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. + +VERSION = 0.5.2 +PUBLISH_FLAGS ?= --no-git-checks --access public + +.PHONY: clean-fetch-client +clean-fetch-client: + rm -rf lance-namespace-fetch-client/** + +.PHONY: gen-fetch-client +gen-fetch-client: clean-fetch-client + uv run openapi-generator-cli generate \ + -i ../docs/src/rest.yaml \ + -g typescript-fetch \ + -o lance-namespace-fetch-client \ + --additional-properties=npmName=@lance/namespace-fetch-client,npmVersion=$(VERSION),supportsES6=true,typescriptThreePlus=true,modelPropertyNaming=original,stringEnums=true + rm -rf lance-namespace-fetch-client/.openapi-generator + rm -f lance-namespace-fetch-client/.openapi-generator-ignore + rm -f lance-namespace-fetch-client/git_push.sh + node scripts/patch-fetch-client.mjs $(VERSION) + +.PHONY: build-fetch-client +build-fetch-client: gen-fetch-client + pnpm install --frozen-lockfile=false + pnpm --filter @lance/namespace-fetch-client run build + +.PHONY: clean +clean: clean-fetch-client + rm -rf lance-namespace/dist + rm -rf lance-namespace-rest/dist + +.PHONY: gen +gen: gen-fetch-client + +.PHONY: build +build: gen + pnpm install --frozen-lockfile=false + pnpm --filter @lance/namespace-fetch-client run build + pnpm --filter @lance/lance-namespace run build + pnpm --filter @lance/lance-namespace-rest run build + pnpm --filter @lance/namespace-fetch-client run test + pnpm --filter @lance/lance-namespace run test + pnpm --filter @lance/lance-namespace-rest run test + +.PHONY: test +test: + pnpm install --frozen-lockfile=false + pnpm --filter @lance/namespace-fetch-client run test + pnpm --filter @lance/lance-namespace run test + pnpm --filter @lance/lance-namespace-rest run test + +.PHONY: lint +lint: + pnpm install --frozen-lockfile=false + pnpm --filter @lance/namespace-fetch-client run build + pnpm --filter @lance/lance-namespace run build + pnpm --filter @lance/namespace-fetch-client run lint + pnpm --filter @lance/lance-namespace run lint + pnpm --filter @lance/lance-namespace-rest run lint + +.PHONY: publish +publish: + pnpm install --frozen-lockfile=false + pnpm --filter @lance/namespace-fetch-client publish $(PUBLISH_FLAGS) + pnpm --filter @lance/lance-namespace publish $(PUBLISH_FLAGS) + pnpm --filter @lance/lance-namespace-rest publish $(PUBLISH_FLAGS) diff --git a/typescript/README.md b/typescript/README.md new file mode 100644 index 000000000..29e9ef666 --- /dev/null +++ b/typescript/README.md @@ -0,0 +1,105 @@ +# TypeScript Modules + +This folder contains the TypeScript modules for Lance Namespace: + +- `@lance/namespace-fetch-client`: generated fetch client from `docs/src/rest.yaml` +- `@lance/lance-namespace`: hand-written core interface, error model, and class-path registry +- `@lance/lance-namespace-rest`: REST implementation package for `@lance/lance-namespace` + +## Build + +```bash +cd typescript +make build +``` + +## Test + +```bash +cd typescript +make test +``` + +## Regenerate OpenAPI client + +```bash +cd typescript +make gen-fetch-client +``` + +After regeneration, always run: + +```bash +cd typescript +make build +``` + +For codegen reproducibility checks: + +```bash +make clean-typescript +make gen-typescript +git diff --exit-code +``` + +## Usage + +```ts +import { + connect, + registerNamespaceImpl, + LanceNamespace, + type ListNamespacesRequest, +} from "@lance/lance-namespace"; + +const ns = await connect("rest", { + uri: "http://localhost:2333", + "headers.X-Request-ID": "req-1", +}); + +const listRequest: ListNamespacesRequest = { id: [] }; +const listResp = await ns.listNamespaces(listRequest); +console.log(listResp.namespaces); + +class MockNamespace extends LanceNamespace { + namespaceId(): string { + return "MockNamespace"; + } +} + +registerNamespaceImpl("mock", "my-namespace-package#MockNamespace"); +const mock = await connect("mock", {}); +console.log(mock.namespaceId()); +``` + +### Error handling + +```ts +import { + ErrorCode, + LanceNamespaceError, +} from "@lance/lance-namespace"; + +try { + await ns.describeTable({ id: ["ns", "missing"] }); +} catch (error) { + if (error instanceof LanceNamespaceError) { + if (error.code === ErrorCode.TABLE_NOT_FOUND) { + console.log("table not found"); + } else { + console.log(`namespace error: ${error.message}`); + } + } else { + throw error; + } +} +``` + +## Release notes for maintainers + +- Versions are managed through `.bumpversion.toml`. +- Keep `typescript/Makefile` `VERSION` aligned with workspace version. +- The publish workflow is `.github/workflows/typescript-publish.yml`. +- Release channel is aligned with repo tags: + - stable tag (`vX.Y.Z`) publishes stable npm packages. + - preview tag (`vX.Y.Z-beta.N`) publishes prerelease npm packages. diff --git a/typescript/lance-namespace-fetch-client/.gitignore b/typescript/lance-namespace-fetch-client/.gitignore new file mode 100644 index 000000000..149b57654 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/.gitignore @@ -0,0 +1,4 @@ +wwwroot/*.js +node_modules +typings +dist diff --git a/typescript/lance-namespace-fetch-client/.npmignore b/typescript/lance-namespace-fetch-client/.npmignore new file mode 100644 index 000000000..42061c01a --- /dev/null +++ b/typescript/lance-namespace-fetch-client/.npmignore @@ -0,0 +1 @@ +README.md \ No newline at end of file diff --git a/typescript/lance-namespace-fetch-client/README.md b/typescript/lance-namespace-fetch-client/README.md new file mode 100644 index 000000000..f1e1ad88b --- /dev/null +++ b/typescript/lance-namespace-fetch-client/README.md @@ -0,0 +1,46 @@ +## @lance/namespace-fetch-client@0.5.2 + +This generator creates TypeScript/JavaScript client that utilizes [Fetch API](https://fetch.spec.whatwg.org/). The generated Node module can be used in the following environments: + +Environment +* Node.js +* Webpack +* Browserify + +Language level +* ES5 - you must have a Promises/A+ library installed +* ES6 + +Module system +* CommonJS +* ES6 module system + +It can be used in both TypeScript and JavaScript. In TypeScript, the definition will be automatically resolved via `package.json`. ([Reference](https://www.typescriptlang.org/docs/handbook/declaration-files/consumption.html)) + +### Building + +To build and compile the typescript sources to javascript use: +``` +npm install +npm run build +``` + +### Publishing + +First build the package then run `npm publish` + +### Consuming + +navigate to the folder of your consuming project and run one of the following commands. + +_published:_ + +``` +npm install @lance/namespace-fetch-client@0.5.2 --save +``` + +_unPublished (not recommended):_ + +``` +npm install PATH_TO_GENERATED_PACKAGE --save +``` diff --git a/typescript/lance-namespace-fetch-client/package.json b/typescript/lance-namespace-fetch-client/package.json new file mode 100644 index 000000000..6512f36c7 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/package.json @@ -0,0 +1,24 @@ +{ + "name": "@lance/namespace-fetch-client", + "version": "0.5.2", + "description": "OpenAPI client for @lance/namespace-fetch-client", + "author": "OpenAPI-Generator", + "repository": { + "type": "git", + "url": "https://github.com/lance-format/lance-namespace" + }, + "main": "./dist/index.js", + "typings": "./dist/index.d.ts", + "module": "./dist/esm/index.js", + "sideEffects": false, + "scripts": { + "build": "tsc && tsc -p tsconfig.esm.json", + "lint": "tsc --noEmit && tsc -p tsconfig.esm.json --noEmit", + "test": "vitest run" + }, + "devDependencies": { + "typescript": "^5.8.3", + "vitest": "^2.1.9" + }, + "license": "Apache-2.0" +} diff --git a/typescript/lance-namespace-fetch-client/src/apis/DataApi.ts b/typescript/lance-namespace-fetch-client/src/apis/DataApi.ts new file mode 100644 index 000000000..404166eea --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/apis/DataApi.ts @@ -0,0 +1,858 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + AlterTableAddColumnsRequest, + AlterTableAddColumnsResponse, + AnalyzeTableQueryPlanRequest, + CountTableRowsRequest, + CreateTableResponse, + DeleteFromTableRequest, + DeleteFromTableResponse, + ErrorResponse, + ExplainTableQueryPlanRequest, + InsertIntoTableResponse, + MergeInsertIntoTableResponse, + QueryTableRequest, + UpdateTableRequest, + UpdateTableResponse, +} from '../models/index'; +import { + AlterTableAddColumnsRequestFromJSON, + AlterTableAddColumnsRequestToJSON, + AlterTableAddColumnsResponseFromJSON, + AlterTableAddColumnsResponseToJSON, + AnalyzeTableQueryPlanRequestFromJSON, + AnalyzeTableQueryPlanRequestToJSON, + CountTableRowsRequestFromJSON, + CountTableRowsRequestToJSON, + CreateTableResponseFromJSON, + CreateTableResponseToJSON, + DeleteFromTableRequestFromJSON, + DeleteFromTableRequestToJSON, + DeleteFromTableResponseFromJSON, + DeleteFromTableResponseToJSON, + ErrorResponseFromJSON, + ErrorResponseToJSON, + ExplainTableQueryPlanRequestFromJSON, + ExplainTableQueryPlanRequestToJSON, + InsertIntoTableResponseFromJSON, + InsertIntoTableResponseToJSON, + MergeInsertIntoTableResponseFromJSON, + MergeInsertIntoTableResponseToJSON, + QueryTableRequestFromJSON, + QueryTableRequestToJSON, + UpdateTableRequestFromJSON, + UpdateTableRequestToJSON, + UpdateTableResponseFromJSON, + UpdateTableResponseToJSON, +} from '../models/index'; + +export interface AlterTableAddColumnsOperationRequest { + id: string; + alterTableAddColumnsRequest: AlterTableAddColumnsRequest; + delimiter?: string; +} + +export interface AnalyzeTableQueryPlanOperationRequest { + id: string; + analyzeTableQueryPlanRequest: AnalyzeTableQueryPlanRequest; + delimiter?: string; +} + +export interface CountTableRowsOperationRequest { + id: string; + countTableRowsRequest: CountTableRowsRequest; + delimiter?: string; +} + +export interface CreateTableRequest { + id: string; + body: Blob; + delimiter?: string; + mode?: string; +} + +export interface DeleteFromTableOperationRequest { + id: string; + deleteFromTableRequest: DeleteFromTableRequest; + delimiter?: string; +} + +export interface ExplainTableQueryPlanOperationRequest { + id: string; + explainTableQueryPlanRequest: ExplainTableQueryPlanRequest; + delimiter?: string; +} + +export interface InsertIntoTableRequest { + id: string; + body: Blob; + delimiter?: string; + mode?: string; +} + +export interface MergeInsertIntoTableRequest { + id: string; + on: string; + body: Blob; + delimiter?: string; + whenMatchedUpdateAll?: boolean; + whenMatchedUpdateAllFilt?: string; + whenNotMatchedInsertAll?: boolean; + whenNotMatchedBySourceDelete?: boolean; + whenNotMatchedBySourceDeleteFilt?: string; + timeout?: string; + useIndex?: boolean; +} + +export interface QueryTableOperationRequest { + id: string; + queryTableRequest: QueryTableRequest; + delimiter?: string; +} + +export interface UpdateTableOperationRequest { + id: string; + updateTableRequest: UpdateTableRequest; + delimiter?: string; +} + +/** + * + */ +export class DataApi extends runtime.BaseAPI { + + /** + * Add new columns to table `id` using SQL expressions or default values. + * Add new columns to table schema + */ + async alterTableAddColumnsRaw(requestParameters: AlterTableAddColumnsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling alterTableAddColumns().' + ); + } + + if (requestParameters['alterTableAddColumnsRequest'] == null) { + throw new runtime.RequiredError( + 'alterTableAddColumnsRequest', + 'Required parameter "alterTableAddColumnsRequest" was null or undefined when calling alterTableAddColumns().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/add_columns`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: AlterTableAddColumnsRequestToJSON(requestParameters['alterTableAddColumnsRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => AlterTableAddColumnsResponseFromJSON(jsonValue)); + } + + /** + * Add new columns to table `id` using SQL expressions or default values. + * Add new columns to table schema + */ + async alterTableAddColumns(requestParameters: AlterTableAddColumnsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.alterTableAddColumnsRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Analyze the query execution plan for a query against table `id`. Returns detailed statistics and analysis of the query execution plan. REST NAMESPACE ONLY REST namespace returns the response as a plain string instead of the `AnalyzeTableQueryPlanResponse` JSON object. + * Analyze query execution plan + */ + async analyzeTableQueryPlanRaw(requestParameters: AnalyzeTableQueryPlanOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling analyzeTableQueryPlan().' + ); + } + + if (requestParameters['analyzeTableQueryPlanRequest'] == null) { + throw new runtime.RequiredError( + 'analyzeTableQueryPlanRequest', + 'Required parameter "analyzeTableQueryPlanRequest" was null or undefined when calling analyzeTableQueryPlan().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/analyze_plan`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: AnalyzeTableQueryPlanRequestToJSON(requestParameters['analyzeTableQueryPlanRequest']), + }, initOverrides); + + if (this.isJsonMime(response.headers.get('content-type'))) { + return new runtime.JSONApiResponse(response); + } else { + return new runtime.TextApiResponse(response) as any; + } + } + + /** + * Analyze the query execution plan for a query against table `id`. Returns detailed statistics and analysis of the query execution plan. REST NAMESPACE ONLY REST namespace returns the response as a plain string instead of the `AnalyzeTableQueryPlanResponse` JSON object. + * Analyze query execution plan + */ + async analyzeTableQueryPlan(requestParameters: AnalyzeTableQueryPlanOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.analyzeTableQueryPlanRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Count the number of rows in table `id` REST NAMESPACE ONLY REST namespace returns the response as a plain integer instead of the `CountTableRowsResponse` JSON object. + * Count rows in a table + */ + async countTableRowsRaw(requestParameters: CountTableRowsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling countTableRows().' + ); + } + + if (requestParameters['countTableRowsRequest'] == null) { + throw new runtime.RequiredError( + 'countTableRowsRequest', + 'Required parameter "countTableRowsRequest" was null or undefined when calling countTableRows().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/count_rows`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: CountTableRowsRequestToJSON(requestParameters['countTableRowsRequest']), + }, initOverrides); + + if (this.isJsonMime(response.headers.get('content-type'))) { + return new runtime.JSONApiResponse(response); + } else { + return new runtime.TextApiResponse(response) as any; + } + } + + /** + * Count the number of rows in table `id` REST NAMESPACE ONLY REST namespace returns the response as a plain integer instead of the `CountTableRowsResponse` JSON object. + * Count rows in a table + */ + async countTableRows(requestParameters: CountTableRowsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.countTableRowsRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Create table `id` in the namespace with the given data in Arrow IPC stream. The schema of the Arrow IPC stream is used as the table schema. If the stream is empty, the API creates a new empty table. REST NAMESPACE ONLY REST namespace uses Arrow IPC stream as the request body. It passes in the `CreateTableRequest` information in the following way: - `id`: pass through path parameter of the same name - `mode`: pass through query parameter of the same name + * Create a table with the given name + */ + async createTableRaw(requestParameters: CreateTableRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling createTable().' + ); + } + + if (requestParameters['body'] == null) { + throw new runtime.RequiredError( + 'body', + 'Required parameter "body" was null or undefined when calling createTable().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + if (requestParameters['mode'] != null) { + queryParameters['mode'] = requestParameters['mode']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/vnd.apache.arrow.stream'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/create`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters['body'] as any, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CreateTableResponseFromJSON(jsonValue)); + } + + /** + * Create table `id` in the namespace with the given data in Arrow IPC stream. The schema of the Arrow IPC stream is used as the table schema. If the stream is empty, the API creates a new empty table. REST NAMESPACE ONLY REST namespace uses Arrow IPC stream as the request body. It passes in the `CreateTableRequest` information in the following way: - `id`: pass through path parameter of the same name - `mode`: pass through query parameter of the same name + * Create a table with the given name + */ + async createTable(requestParameters: CreateTableRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.createTableRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Delete rows from table `id`. + * Delete rows from a table + */ + async deleteFromTableRaw(requestParameters: DeleteFromTableOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling deleteFromTable().' + ); + } + + if (requestParameters['deleteFromTableRequest'] == null) { + throw new runtime.RequiredError( + 'deleteFromTableRequest', + 'Required parameter "deleteFromTableRequest" was null or undefined when calling deleteFromTable().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/delete`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: DeleteFromTableRequestToJSON(requestParameters['deleteFromTableRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => DeleteFromTableResponseFromJSON(jsonValue)); + } + + /** + * Delete rows from table `id`. + * Delete rows from a table + */ + async deleteFromTable(requestParameters: DeleteFromTableOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.deleteFromTableRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Get the query execution plan for a query against table `id`. Returns a human-readable explanation of how the query will be executed. REST NAMESPACE ONLY REST namespace returns the response as a plain string instead of the `ExplainTableQueryPlanResponse` JSON object. + * Get query execution plan explanation + */ + async explainTableQueryPlanRaw(requestParameters: ExplainTableQueryPlanOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling explainTableQueryPlan().' + ); + } + + if (requestParameters['explainTableQueryPlanRequest'] == null) { + throw new runtime.RequiredError( + 'explainTableQueryPlanRequest', + 'Required parameter "explainTableQueryPlanRequest" was null or undefined when calling explainTableQueryPlan().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/explain_plan`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: ExplainTableQueryPlanRequestToJSON(requestParameters['explainTableQueryPlanRequest']), + }, initOverrides); + + if (this.isJsonMime(response.headers.get('content-type'))) { + return new runtime.JSONApiResponse(response); + } else { + return new runtime.TextApiResponse(response) as any; + } + } + + /** + * Get the query execution plan for a query against table `id`. Returns a human-readable explanation of how the query will be executed. REST NAMESPACE ONLY REST namespace returns the response as a plain string instead of the `ExplainTableQueryPlanResponse` JSON object. + * Get query execution plan explanation + */ + async explainTableQueryPlan(requestParameters: ExplainTableQueryPlanOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.explainTableQueryPlanRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Insert new records into table `id`. REST NAMESPACE ONLY REST namespace uses Arrow IPC stream as the request body. It passes in the `InsertIntoTableRequest` information in the following way: - `id`: pass through path parameter of the same name - `mode`: pass through query parameter of the same name + * Insert records into a table + */ + async insertIntoTableRaw(requestParameters: InsertIntoTableRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling insertIntoTable().' + ); + } + + if (requestParameters['body'] == null) { + throw new runtime.RequiredError( + 'body', + 'Required parameter "body" was null or undefined when calling insertIntoTable().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + if (requestParameters['mode'] != null) { + queryParameters['mode'] = requestParameters['mode']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/vnd.apache.arrow.stream'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/insert`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters['body'] as any, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => InsertIntoTableResponseFromJSON(jsonValue)); + } + + /** + * Insert new records into table `id`. REST NAMESPACE ONLY REST namespace uses Arrow IPC stream as the request body. It passes in the `InsertIntoTableRequest` information in the following way: - `id`: pass through path parameter of the same name - `mode`: pass through query parameter of the same name + * Insert records into a table + */ + async insertIntoTable(requestParameters: InsertIntoTableRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.insertIntoTableRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Performs a merge insert (upsert) operation on table `id`. This operation updates existing rows based on a matching column and inserts new rows that don\'t match. It returns the number of rows inserted and updated. REST NAMESPACE ONLY REST namespace uses Arrow IPC stream as the request body. It passes in the `MergeInsertIntoTableRequest` information in the following way: - `id`: pass through path parameter of the same name - `on`: pass through query parameter of the same name - `when_matched_update_all`: pass through query parameter of the same name - `when_matched_update_all_filt`: pass through query parameter of the same name - `when_not_matched_insert_all`: pass through query parameter of the same name - `when_not_matched_by_source_delete`: pass through query parameter of the same name - `when_not_matched_by_source_delete_filt`: pass through query parameter of the same name + * Merge insert (upsert) records into a table + */ + async mergeInsertIntoTableRaw(requestParameters: MergeInsertIntoTableRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling mergeInsertIntoTable().' + ); + } + + if (requestParameters['on'] == null) { + throw new runtime.RequiredError( + 'on', + 'Required parameter "on" was null or undefined when calling mergeInsertIntoTable().' + ); + } + + if (requestParameters['body'] == null) { + throw new runtime.RequiredError( + 'body', + 'Required parameter "body" was null or undefined when calling mergeInsertIntoTable().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + if (requestParameters['on'] != null) { + queryParameters['on'] = requestParameters['on']; + } + + if (requestParameters['whenMatchedUpdateAll'] != null) { + queryParameters['when_matched_update_all'] = requestParameters['whenMatchedUpdateAll']; + } + + if (requestParameters['whenMatchedUpdateAllFilt'] != null) { + queryParameters['when_matched_update_all_filt'] = requestParameters['whenMatchedUpdateAllFilt']; + } + + if (requestParameters['whenNotMatchedInsertAll'] != null) { + queryParameters['when_not_matched_insert_all'] = requestParameters['whenNotMatchedInsertAll']; + } + + if (requestParameters['whenNotMatchedBySourceDelete'] != null) { + queryParameters['when_not_matched_by_source_delete'] = requestParameters['whenNotMatchedBySourceDelete']; + } + + if (requestParameters['whenNotMatchedBySourceDeleteFilt'] != null) { + queryParameters['when_not_matched_by_source_delete_filt'] = requestParameters['whenNotMatchedBySourceDeleteFilt']; + } + + if (requestParameters['timeout'] != null) { + queryParameters['timeout'] = requestParameters['timeout']; + } + + if (requestParameters['useIndex'] != null) { + queryParameters['use_index'] = requestParameters['useIndex']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/vnd.apache.arrow.stream'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/merge_insert`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters['body'] as any, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => MergeInsertIntoTableResponseFromJSON(jsonValue)); + } + + /** + * Performs a merge insert (upsert) operation on table `id`. This operation updates existing rows based on a matching column and inserts new rows that don\'t match. It returns the number of rows inserted and updated. REST NAMESPACE ONLY REST namespace uses Arrow IPC stream as the request body. It passes in the `MergeInsertIntoTableRequest` information in the following way: - `id`: pass through path parameter of the same name - `on`: pass through query parameter of the same name - `when_matched_update_all`: pass through query parameter of the same name - `when_matched_update_all_filt`: pass through query parameter of the same name - `when_not_matched_insert_all`: pass through query parameter of the same name - `when_not_matched_by_source_delete`: pass through query parameter of the same name - `when_not_matched_by_source_delete_filt`: pass through query parameter of the same name + * Merge insert (upsert) records into a table + */ + async mergeInsertIntoTable(requestParameters: MergeInsertIntoTableRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.mergeInsertIntoTableRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Query table `id` with vector search, full text search and optional SQL filtering. Returns results in Arrow IPC file or stream format. REST NAMESPACE ONLY REST namespace returns the response as Arrow IPC file binary data instead of the `QueryTableResponse` JSON object. + * Query a table + */ + async queryTableRaw(requestParameters: QueryTableOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling queryTable().' + ); + } + + if (requestParameters['queryTableRequest'] == null) { + throw new runtime.RequiredError( + 'queryTableRequest', + 'Required parameter "queryTableRequest" was null or undefined when calling queryTable().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/query`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: QueryTableRequestToJSON(requestParameters['queryTableRequest']), + }, initOverrides); + + return new runtime.BlobApiResponse(response); + } + + /** + * Query table `id` with vector search, full text search and optional SQL filtering. Returns results in Arrow IPC file or stream format. REST NAMESPACE ONLY REST namespace returns the response as Arrow IPC file binary data instead of the `QueryTableResponse` JSON object. + * Query a table + */ + async queryTable(requestParameters: QueryTableOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.queryTableRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Update existing rows in table `id`. + * Update rows in a table + */ + async updateTableRaw(requestParameters: UpdateTableOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling updateTable().' + ); + } + + if (requestParameters['updateTableRequest'] == null) { + throw new runtime.RequiredError( + 'updateTableRequest', + 'Required parameter "updateTableRequest" was null or undefined when calling updateTable().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/update`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: UpdateTableRequestToJSON(requestParameters['updateTableRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => UpdateTableResponseFromJSON(jsonValue)); + } + + /** + * Update existing rows in table `id`. + * Update rows in a table + */ + async updateTable(requestParameters: UpdateTableOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.updateTableRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/typescript/lance-namespace-fetch-client/src/apis/IndexApi.ts b/typescript/lance-namespace-fetch-client/src/apis/IndexApi.ts new file mode 100644 index 000000000..a6f24e04e --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/apis/IndexApi.ts @@ -0,0 +1,419 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + CreateTableIndexRequest, + CreateTableIndexResponse, + CreateTableScalarIndexResponse, + DescribeTableIndexStatsRequest, + DescribeTableIndexStatsResponse, + DropTableIndexResponse, + ErrorResponse, + ListTableIndicesRequest, + ListTableIndicesResponse, +} from '../models/index'; +import { + CreateTableIndexRequestFromJSON, + CreateTableIndexRequestToJSON, + CreateTableIndexResponseFromJSON, + CreateTableIndexResponseToJSON, + CreateTableScalarIndexResponseFromJSON, + CreateTableScalarIndexResponseToJSON, + DescribeTableIndexStatsRequestFromJSON, + DescribeTableIndexStatsRequestToJSON, + DescribeTableIndexStatsResponseFromJSON, + DescribeTableIndexStatsResponseToJSON, + DropTableIndexResponseFromJSON, + DropTableIndexResponseToJSON, + ErrorResponseFromJSON, + ErrorResponseToJSON, + ListTableIndicesRequestFromJSON, + ListTableIndicesRequestToJSON, + ListTableIndicesResponseFromJSON, + ListTableIndicesResponseToJSON, +} from '../models/index'; + +export interface CreateTableIndexOperationRequest { + id: string; + createTableIndexRequest: CreateTableIndexRequest; + delimiter?: string; +} + +export interface CreateTableScalarIndexRequest { + id: string; + createTableIndexRequest: CreateTableIndexRequest; + delimiter?: string; +} + +export interface DescribeTableIndexStatsOperationRequest { + id: string; + indexName: string; + describeTableIndexStatsRequest: DescribeTableIndexStatsRequest; + delimiter?: string; +} + +export interface DropTableIndexRequest { + id: string; + indexName: string; + delimiter?: string; +} + +export interface ListTableIndicesOperationRequest { + id: string; + listTableIndicesRequest: ListTableIndicesRequest; + delimiter?: string; +} + +/** + * + */ +export class IndexApi extends runtime.BaseAPI { + + /** + * Create an index on a table column for faster search operations. Supports vector indexes (IVF_FLAT, IVF_HNSW_SQ, IVF_PQ, etc.) and scalar indexes (BTREE, BITMAP, FTS, etc.). Index creation is handled asynchronously. Use the `ListTableIndices` and `DescribeTableIndexStats` operations to monitor index creation progress. + * Create an index on a table + */ + async createTableIndexRaw(requestParameters: CreateTableIndexOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling createTableIndex().' + ); + } + + if (requestParameters['createTableIndexRequest'] == null) { + throw new runtime.RequiredError( + 'createTableIndexRequest', + 'Required parameter "createTableIndexRequest" was null or undefined when calling createTableIndex().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/create_index`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: CreateTableIndexRequestToJSON(requestParameters['createTableIndexRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CreateTableIndexResponseFromJSON(jsonValue)); + } + + /** + * Create an index on a table column for faster search operations. Supports vector indexes (IVF_FLAT, IVF_HNSW_SQ, IVF_PQ, etc.) and scalar indexes (BTREE, BITMAP, FTS, etc.). Index creation is handled asynchronously. Use the `ListTableIndices` and `DescribeTableIndexStats` operations to monitor index creation progress. + * Create an index on a table + */ + async createTableIndex(requestParameters: CreateTableIndexOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.createTableIndexRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Create a scalar index on a table column for faster filtering operations. Supports scalar indexes (BTREE, BITMAP, LABEL_LIST, FTS, etc.). This is an alias for CreateTableIndex specifically for scalar indexes. Index creation is handled asynchronously. Use the `ListTableIndices` and `DescribeTableIndexStats` operations to monitor index creation progress. + * Create a scalar index on a table + */ + async createTableScalarIndexRaw(requestParameters: CreateTableScalarIndexRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling createTableScalarIndex().' + ); + } + + if (requestParameters['createTableIndexRequest'] == null) { + throw new runtime.RequiredError( + 'createTableIndexRequest', + 'Required parameter "createTableIndexRequest" was null or undefined when calling createTableScalarIndex().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/create_scalar_index`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: CreateTableIndexRequestToJSON(requestParameters['createTableIndexRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CreateTableScalarIndexResponseFromJSON(jsonValue)); + } + + /** + * Create a scalar index on a table column for faster filtering operations. Supports scalar indexes (BTREE, BITMAP, LABEL_LIST, FTS, etc.). This is an alias for CreateTableIndex specifically for scalar indexes. Index creation is handled asynchronously. Use the `ListTableIndices` and `DescribeTableIndexStats` operations to monitor index creation progress. + * Create a scalar index on a table + */ + async createTableScalarIndex(requestParameters: CreateTableScalarIndexRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.createTableScalarIndexRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Get statistics for a specific index on a table. Returns information about the index type, distance type (for vector indices), and row counts. + * Get table index statistics + */ + async describeTableIndexStatsRaw(requestParameters: DescribeTableIndexStatsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling describeTableIndexStats().' + ); + } + + if (requestParameters['indexName'] == null) { + throw new runtime.RequiredError( + 'indexName', + 'Required parameter "indexName" was null or undefined when calling describeTableIndexStats().' + ); + } + + if (requestParameters['describeTableIndexStatsRequest'] == null) { + throw new runtime.RequiredError( + 'describeTableIndexStatsRequest', + 'Required parameter "describeTableIndexStatsRequest" was null or undefined when calling describeTableIndexStats().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/index/{index_name}/stats`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))).replace(`{${"index_name"}}`, encodeURIComponent(String(requestParameters['indexName']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: DescribeTableIndexStatsRequestToJSON(requestParameters['describeTableIndexStatsRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => DescribeTableIndexStatsResponseFromJSON(jsonValue)); + } + + /** + * Get statistics for a specific index on a table. Returns information about the index type, distance type (for vector indices), and row counts. + * Get table index statistics + */ + async describeTableIndexStats(requestParameters: DescribeTableIndexStatsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.describeTableIndexStatsRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Drop the specified index from table `id`. REST NAMESPACE ONLY REST namespace does not use a request body for this operation. The `DropTableIndexRequest` information is passed in the following way: - `id`: pass through path parameter of the same name - `index_name`: pass through path parameter of the same name + * Drop a specific index + */ + async dropTableIndexRaw(requestParameters: DropTableIndexRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling dropTableIndex().' + ); + } + + if (requestParameters['indexName'] == null) { + throw new runtime.RequiredError( + 'indexName', + 'Required parameter "indexName" was null or undefined when calling dropTableIndex().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/index/{index_name}/drop`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))).replace(`{${"index_name"}}`, encodeURIComponent(String(requestParameters['indexName']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => DropTableIndexResponseFromJSON(jsonValue)); + } + + /** + * Drop the specified index from table `id`. REST NAMESPACE ONLY REST namespace does not use a request body for this operation. The `DropTableIndexRequest` information is passed in the following way: - `id`: pass through path parameter of the same name - `index_name`: pass through path parameter of the same name + * Drop a specific index + */ + async dropTableIndex(requestParameters: DropTableIndexRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.dropTableIndexRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * List all indices created on a table. Returns information about each index including name, columns, status, and UUID. + * List indexes on a table + */ + async listTableIndicesRaw(requestParameters: ListTableIndicesOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling listTableIndices().' + ); + } + + if (requestParameters['listTableIndicesRequest'] == null) { + throw new runtime.RequiredError( + 'listTableIndicesRequest', + 'Required parameter "listTableIndicesRequest" was null or undefined when calling listTableIndices().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/index/list`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: ListTableIndicesRequestToJSON(requestParameters['listTableIndicesRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => ListTableIndicesResponseFromJSON(jsonValue)); + } + + /** + * List all indices created on a table. Returns information about each index including name, columns, status, and UUID. + * List indexes on a table + */ + async listTableIndices(requestParameters: ListTableIndicesOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listTableIndicesRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/typescript/lance-namespace-fetch-client/src/apis/MetadataApi.ts b/typescript/lance-namespace-fetch-client/src/apis/MetadataApi.ts new file mode 100644 index 000000000..a572e264b --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/apis/MetadataApi.ts @@ -0,0 +1,2802 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + AlterTableAlterColumnsRequest, + AlterTableAlterColumnsResponse, + AlterTableDropColumnsRequest, + AlterTableDropColumnsResponse, + AlterTransactionRequest, + AlterTransactionResponse, + BatchCreateTableVersionsRequest, + BatchCreateTableVersionsResponse, + BatchDeleteTableVersionsRequest, + BatchDeleteTableVersionsResponse, + CreateEmptyTableRequest, + CreateEmptyTableResponse, + CreateNamespaceRequest, + CreateNamespaceResponse, + CreateTableIndexRequest, + CreateTableIndexResponse, + CreateTableScalarIndexResponse, + CreateTableTagRequest, + CreateTableTagResponse, + CreateTableVersionRequest, + CreateTableVersionResponse, + DeclareTableRequest, + DeclareTableResponse, + DeleteTableTagRequest, + DeleteTableTagResponse, + DeregisterTableRequest, + DeregisterTableResponse, + DescribeNamespaceRequest, + DescribeNamespaceResponse, + DescribeTableIndexStatsRequest, + DescribeTableIndexStatsResponse, + DescribeTableRequest, + DescribeTableResponse, + DescribeTableVersionRequest, + DescribeTableVersionResponse, + DescribeTransactionRequest, + DescribeTransactionResponse, + DropNamespaceRequest, + DropNamespaceResponse, + DropTableIndexResponse, + DropTableResponse, + ErrorResponse, + GetTableStatsRequest, + GetTableStatsResponse, + GetTableTagVersionRequest, + GetTableTagVersionResponse, + ListNamespacesResponse, + ListTableIndicesRequest, + ListTableIndicesResponse, + ListTableTagsResponse, + ListTableVersionsResponse, + ListTablesResponse, + NamespaceExistsRequest, + RegisterTableRequest, + RegisterTableResponse, + RenameTableRequest, + RenameTableResponse, + RestoreTableRequest, + RestoreTableResponse, + TableExistsRequest, + UpdateTableTagRequest, + UpdateTableTagResponse, +} from '../models/index'; +import { + AlterTableAlterColumnsRequestFromJSON, + AlterTableAlterColumnsRequestToJSON, + AlterTableAlterColumnsResponseFromJSON, + AlterTableAlterColumnsResponseToJSON, + AlterTableDropColumnsRequestFromJSON, + AlterTableDropColumnsRequestToJSON, + AlterTableDropColumnsResponseFromJSON, + AlterTableDropColumnsResponseToJSON, + AlterTransactionRequestFromJSON, + AlterTransactionRequestToJSON, + AlterTransactionResponseFromJSON, + AlterTransactionResponseToJSON, + BatchCreateTableVersionsRequestFromJSON, + BatchCreateTableVersionsRequestToJSON, + BatchCreateTableVersionsResponseFromJSON, + BatchCreateTableVersionsResponseToJSON, + BatchDeleteTableVersionsRequestFromJSON, + BatchDeleteTableVersionsRequestToJSON, + BatchDeleteTableVersionsResponseFromJSON, + BatchDeleteTableVersionsResponseToJSON, + CreateEmptyTableRequestFromJSON, + CreateEmptyTableRequestToJSON, + CreateEmptyTableResponseFromJSON, + CreateEmptyTableResponseToJSON, + CreateNamespaceRequestFromJSON, + CreateNamespaceRequestToJSON, + CreateNamespaceResponseFromJSON, + CreateNamespaceResponseToJSON, + CreateTableIndexRequestFromJSON, + CreateTableIndexRequestToJSON, + CreateTableIndexResponseFromJSON, + CreateTableIndexResponseToJSON, + CreateTableScalarIndexResponseFromJSON, + CreateTableScalarIndexResponseToJSON, + CreateTableTagRequestFromJSON, + CreateTableTagRequestToJSON, + CreateTableTagResponseFromJSON, + CreateTableTagResponseToJSON, + CreateTableVersionRequestFromJSON, + CreateTableVersionRequestToJSON, + CreateTableVersionResponseFromJSON, + CreateTableVersionResponseToJSON, + DeclareTableRequestFromJSON, + DeclareTableRequestToJSON, + DeclareTableResponseFromJSON, + DeclareTableResponseToJSON, + DeleteTableTagRequestFromJSON, + DeleteTableTagRequestToJSON, + DeleteTableTagResponseFromJSON, + DeleteTableTagResponseToJSON, + DeregisterTableRequestFromJSON, + DeregisterTableRequestToJSON, + DeregisterTableResponseFromJSON, + DeregisterTableResponseToJSON, + DescribeNamespaceRequestFromJSON, + DescribeNamespaceRequestToJSON, + DescribeNamespaceResponseFromJSON, + DescribeNamespaceResponseToJSON, + DescribeTableIndexStatsRequestFromJSON, + DescribeTableIndexStatsRequestToJSON, + DescribeTableIndexStatsResponseFromJSON, + DescribeTableIndexStatsResponseToJSON, + DescribeTableRequestFromJSON, + DescribeTableRequestToJSON, + DescribeTableResponseFromJSON, + DescribeTableResponseToJSON, + DescribeTableVersionRequestFromJSON, + DescribeTableVersionRequestToJSON, + DescribeTableVersionResponseFromJSON, + DescribeTableVersionResponseToJSON, + DescribeTransactionRequestFromJSON, + DescribeTransactionRequestToJSON, + DescribeTransactionResponseFromJSON, + DescribeTransactionResponseToJSON, + DropNamespaceRequestFromJSON, + DropNamespaceRequestToJSON, + DropNamespaceResponseFromJSON, + DropNamespaceResponseToJSON, + DropTableIndexResponseFromJSON, + DropTableIndexResponseToJSON, + DropTableResponseFromJSON, + DropTableResponseToJSON, + ErrorResponseFromJSON, + ErrorResponseToJSON, + GetTableStatsRequestFromJSON, + GetTableStatsRequestToJSON, + GetTableStatsResponseFromJSON, + GetTableStatsResponseToJSON, + GetTableTagVersionRequestFromJSON, + GetTableTagVersionRequestToJSON, + GetTableTagVersionResponseFromJSON, + GetTableTagVersionResponseToJSON, + ListNamespacesResponseFromJSON, + ListNamespacesResponseToJSON, + ListTableIndicesRequestFromJSON, + ListTableIndicesRequestToJSON, + ListTableIndicesResponseFromJSON, + ListTableIndicesResponseToJSON, + ListTableTagsResponseFromJSON, + ListTableTagsResponseToJSON, + ListTableVersionsResponseFromJSON, + ListTableVersionsResponseToJSON, + ListTablesResponseFromJSON, + ListTablesResponseToJSON, + NamespaceExistsRequestFromJSON, + NamespaceExistsRequestToJSON, + RegisterTableRequestFromJSON, + RegisterTableRequestToJSON, + RegisterTableResponseFromJSON, + RegisterTableResponseToJSON, + RenameTableRequestFromJSON, + RenameTableRequestToJSON, + RenameTableResponseFromJSON, + RenameTableResponseToJSON, + RestoreTableRequestFromJSON, + RestoreTableRequestToJSON, + RestoreTableResponseFromJSON, + RestoreTableResponseToJSON, + TableExistsRequestFromJSON, + TableExistsRequestToJSON, + UpdateTableTagRequestFromJSON, + UpdateTableTagRequestToJSON, + UpdateTableTagResponseFromJSON, + UpdateTableTagResponseToJSON, +} from '../models/index'; + +export interface AlterTableAlterColumnsOperationRequest { + id: string; + alterTableAlterColumnsRequest: AlterTableAlterColumnsRequest; + delimiter?: string; +} + +export interface AlterTableDropColumnsOperationRequest { + id: string; + alterTableDropColumnsRequest: AlterTableDropColumnsRequest; + delimiter?: string; +} + +export interface AlterTransactionOperationRequest { + id: string; + alterTransactionRequest: AlterTransactionRequest; + delimiter?: string; +} + +export interface BatchCreateTableVersionsOperationRequest { + batchCreateTableVersionsRequest: BatchCreateTableVersionsRequest; + delimiter?: string; +} + +export interface BatchDeleteTableVersionsOperationRequest { + id: string; + batchDeleteTableVersionsRequest: BatchDeleteTableVersionsRequest; + delimiter?: string; +} + +export interface CreateEmptyTableOperationRequest { + id: string; + createEmptyTableRequest: CreateEmptyTableRequest; + delimiter?: string; +} + +export interface CreateNamespaceOperationRequest { + id: string; + createNamespaceRequest: CreateNamespaceRequest; + delimiter?: string; +} + +export interface CreateTableIndexOperationRequest { + id: string; + createTableIndexRequest: CreateTableIndexRequest; + delimiter?: string; +} + +export interface CreateTableScalarIndexRequest { + id: string; + createTableIndexRequest: CreateTableIndexRequest; + delimiter?: string; +} + +export interface CreateTableTagOperationRequest { + id: string; + createTableTagRequest: CreateTableTagRequest; + delimiter?: string; +} + +export interface CreateTableVersionOperationRequest { + id: string; + createTableVersionRequest: CreateTableVersionRequest; + delimiter?: string; +} + +export interface DeclareTableOperationRequest { + id: string; + declareTableRequest: DeclareTableRequest; + delimiter?: string; +} + +export interface DeleteTableTagOperationRequest { + id: string; + deleteTableTagRequest: DeleteTableTagRequest; + delimiter?: string; +} + +export interface DeregisterTableOperationRequest { + id: string; + deregisterTableRequest: DeregisterTableRequest; + delimiter?: string; +} + +export interface DescribeNamespaceOperationRequest { + id: string; + describeNamespaceRequest: DescribeNamespaceRequest; + delimiter?: string; +} + +export interface DescribeTableOperationRequest { + id: string; + describeTableRequest: DescribeTableRequest; + delimiter?: string; + withTableUri?: boolean; + loadDetailedMetadata?: boolean; +} + +export interface DescribeTableIndexStatsOperationRequest { + id: string; + indexName: string; + describeTableIndexStatsRequest: DescribeTableIndexStatsRequest; + delimiter?: string; +} + +export interface DescribeTableVersionOperationRequest { + id: string; + describeTableVersionRequest: DescribeTableVersionRequest; + delimiter?: string; +} + +export interface DescribeTransactionOperationRequest { + id: string; + describeTransactionRequest: DescribeTransactionRequest; + delimiter?: string; +} + +export interface DropNamespaceOperationRequest { + id: string; + dropNamespaceRequest: DropNamespaceRequest; + delimiter?: string; +} + +export interface DropTableRequest { + id: string; + delimiter?: string; +} + +export interface DropTableIndexRequest { + id: string; + indexName: string; + delimiter?: string; +} + +export interface GetTableStatsOperationRequest { + id: string; + getTableStatsRequest: GetTableStatsRequest; + delimiter?: string; +} + +export interface GetTableTagVersionOperationRequest { + id: string; + getTableTagVersionRequest: GetTableTagVersionRequest; + delimiter?: string; +} + +export interface ListNamespacesRequest { + id: string; + delimiter?: string; + pageToken?: string; + limit?: number; +} + +export interface ListTableIndicesOperationRequest { + id: string; + listTableIndicesRequest: ListTableIndicesRequest; + delimiter?: string; +} + +export interface ListTableTagsRequest { + id: string; + delimiter?: string; + pageToken?: string; + limit?: number; +} + +export interface ListTableVersionsRequest { + id: string; + delimiter?: string; + pageToken?: string; + limit?: number; + descending?: boolean; +} + +export interface ListTablesRequest { + id: string; + delimiter?: string; + pageToken?: string; + limit?: number; +} + +export interface NamespaceExistsOperationRequest { + id: string; + namespaceExistsRequest: NamespaceExistsRequest; + delimiter?: string; +} + +export interface RegisterTableOperationRequest { + id: string; + registerTableRequest: RegisterTableRequest; + delimiter?: string; +} + +export interface RenameTableOperationRequest { + id: string; + renameTableRequest: RenameTableRequest; + delimiter?: string; +} + +export interface RestoreTableOperationRequest { + id: string; + restoreTableRequest: RestoreTableRequest; + delimiter?: string; +} + +export interface TableExistsOperationRequest { + id: string; + tableExistsRequest: TableExistsRequest; + delimiter?: string; +} + +export interface UpdateTableSchemaMetadataRequest { + id: string; + requestBody: { [key: string]: string; }; + delimiter?: string; +} + +export interface UpdateTableTagOperationRequest { + id: string; + updateTableTagRequest: UpdateTableTagRequest; + delimiter?: string; +} + +/** + * + */ +export class MetadataApi extends runtime.BaseAPI { + + /** + * Modify existing columns in table `id`, such as renaming or changing data types. + * Modify existing columns + */ + async alterTableAlterColumnsRaw(requestParameters: AlterTableAlterColumnsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling alterTableAlterColumns().' + ); + } + + if (requestParameters['alterTableAlterColumnsRequest'] == null) { + throw new runtime.RequiredError( + 'alterTableAlterColumnsRequest', + 'Required parameter "alterTableAlterColumnsRequest" was null or undefined when calling alterTableAlterColumns().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/alter_columns`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: AlterTableAlterColumnsRequestToJSON(requestParameters['alterTableAlterColumnsRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => AlterTableAlterColumnsResponseFromJSON(jsonValue)); + } + + /** + * Modify existing columns in table `id`, such as renaming or changing data types. + * Modify existing columns + */ + async alterTableAlterColumns(requestParameters: AlterTableAlterColumnsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.alterTableAlterColumnsRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Remove specified columns from table `id`. + * Remove columns from table + */ + async alterTableDropColumnsRaw(requestParameters: AlterTableDropColumnsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling alterTableDropColumns().' + ); + } + + if (requestParameters['alterTableDropColumnsRequest'] == null) { + throw new runtime.RequiredError( + 'alterTableDropColumnsRequest', + 'Required parameter "alterTableDropColumnsRequest" was null or undefined when calling alterTableDropColumns().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/drop_columns`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: AlterTableDropColumnsRequestToJSON(requestParameters['alterTableDropColumnsRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => AlterTableDropColumnsResponseFromJSON(jsonValue)); + } + + /** + * Remove specified columns from table `id`. + * Remove columns from table + */ + async alterTableDropColumns(requestParameters: AlterTableDropColumnsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.alterTableDropColumnsRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Alter a transaction with a list of actions such as setting status or properties. The server should either succeed and apply all actions, or fail and apply no action. + * Alter information of a transaction. + */ + async alterTransactionRaw(requestParameters: AlterTransactionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling alterTransaction().' + ); + } + + if (requestParameters['alterTransactionRequest'] == null) { + throw new runtime.RequiredError( + 'alterTransactionRequest', + 'Required parameter "alterTransactionRequest" was null or undefined when calling alterTransaction().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/transaction/{id}/alter`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: AlterTransactionRequestToJSON(requestParameters['alterTransactionRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => AlterTransactionResponseFromJSON(jsonValue)); + } + + /** + * Alter a transaction with a list of actions such as setting status or properties. The server should either succeed and apply all actions, or fail and apply no action. + * Alter information of a transaction. + */ + async alterTransaction(requestParameters: AlterTransactionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.alterTransactionRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Atomically create new version entries for multiple tables. This operation is atomic: either all table versions are created successfully, or none are created. If any version creation fails (e.g., due to conflict), the entire batch operation fails. Each entry in the request specifies the table identifier and version details. This supports `put_if_not_exists` semantics for each version entry. + * Atomically create versions for multiple tables + */ + async batchCreateTableVersionsRaw(requestParameters: BatchCreateTableVersionsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['batchCreateTableVersionsRequest'] == null) { + throw new runtime.RequiredError( + 'batchCreateTableVersionsRequest', + 'Required parameter "batchCreateTableVersionsRequest" was null or undefined when calling batchCreateTableVersions().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/version/batch-create`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: BatchCreateTableVersionsRequestToJSON(requestParameters['batchCreateTableVersionsRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => BatchCreateTableVersionsResponseFromJSON(jsonValue)); + } + + /** + * Atomically create new version entries for multiple tables. This operation is atomic: either all table versions are created successfully, or none are created. If any version creation fails (e.g., due to conflict), the entire batch operation fails. Each entry in the request specifies the table identifier and version details. This supports `put_if_not_exists` semantics for each version entry. + * Atomically create versions for multiple tables + */ + async batchCreateTableVersions(requestParameters: BatchCreateTableVersionsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.batchCreateTableVersionsRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Delete version metadata records for table `id`. This operation deletes version tracking records, NOT the actual table data. It supports deleting ranges of versions for efficient bulk cleanup. Special range values: - `start_version: 0` with `end_version: -1` means delete ALL version records + * Delete table version records + */ + async batchDeleteTableVersionsRaw(requestParameters: BatchDeleteTableVersionsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling batchDeleteTableVersions().' + ); + } + + if (requestParameters['batchDeleteTableVersionsRequest'] == null) { + throw new runtime.RequiredError( + 'batchDeleteTableVersionsRequest', + 'Required parameter "batchDeleteTableVersionsRequest" was null or undefined when calling batchDeleteTableVersions().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/version/delete`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: BatchDeleteTableVersionsRequestToJSON(requestParameters['batchDeleteTableVersionsRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => BatchDeleteTableVersionsResponseFromJSON(jsonValue)); + } + + /** + * Delete version metadata records for table `id`. This operation deletes version tracking records, NOT the actual table data. It supports deleting ranges of versions for efficient bulk cleanup. Special range values: - `start_version: 0` with `end_version: -1` means delete ALL version records + * Delete table version records + */ + async batchDeleteTableVersions(requestParameters: BatchDeleteTableVersionsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.batchDeleteTableVersionsRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Create an empty table with the given name without touching storage. This is a metadata-only operation that records the table existence and sets up aspects like access control. For DirectoryNamespace implementation, this creates a `.lance-reserved` file in the table directory to mark the table\'s existence without creating actual Lance data files. **Deprecated**: Use `DeclareTable` instead. + * Create an empty table + * @deprecated + */ + async createEmptyTableRaw(requestParameters: CreateEmptyTableOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling createEmptyTable().' + ); + } + + if (requestParameters['createEmptyTableRequest'] == null) { + throw new runtime.RequiredError( + 'createEmptyTableRequest', + 'Required parameter "createEmptyTableRequest" was null or undefined when calling createEmptyTable().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/create-empty`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: CreateEmptyTableRequestToJSON(requestParameters['createEmptyTableRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CreateEmptyTableResponseFromJSON(jsonValue)); + } + + /** + * Create an empty table with the given name without touching storage. This is a metadata-only operation that records the table existence and sets up aspects like access control. For DirectoryNamespace implementation, this creates a `.lance-reserved` file in the table directory to mark the table\'s existence without creating actual Lance data files. **Deprecated**: Use `DeclareTable` instead. + * Create an empty table + * @deprecated + */ + async createEmptyTable(requestParameters: CreateEmptyTableOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.createEmptyTableRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Create new namespace `id`. During the creation process, the implementation may modify user-provided `properties`, such as adding additional properties like `created_at` to user-provided properties, omitting any specific property, or performing actions based on any property value. + * Create a new namespace + */ + async createNamespaceRaw(requestParameters: CreateNamespaceOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling createNamespace().' + ); + } + + if (requestParameters['createNamespaceRequest'] == null) { + throw new runtime.RequiredError( + 'createNamespaceRequest', + 'Required parameter "createNamespaceRequest" was null or undefined when calling createNamespace().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/namespace/{id}/create`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: CreateNamespaceRequestToJSON(requestParameters['createNamespaceRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CreateNamespaceResponseFromJSON(jsonValue)); + } + + /** + * Create new namespace `id`. During the creation process, the implementation may modify user-provided `properties`, such as adding additional properties like `created_at` to user-provided properties, omitting any specific property, or performing actions based on any property value. + * Create a new namespace + */ + async createNamespace(requestParameters: CreateNamespaceOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.createNamespaceRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Create an index on a table column for faster search operations. Supports vector indexes (IVF_FLAT, IVF_HNSW_SQ, IVF_PQ, etc.) and scalar indexes (BTREE, BITMAP, FTS, etc.). Index creation is handled asynchronously. Use the `ListTableIndices` and `DescribeTableIndexStats` operations to monitor index creation progress. + * Create an index on a table + */ + async createTableIndexRaw(requestParameters: CreateTableIndexOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling createTableIndex().' + ); + } + + if (requestParameters['createTableIndexRequest'] == null) { + throw new runtime.RequiredError( + 'createTableIndexRequest', + 'Required parameter "createTableIndexRequest" was null or undefined when calling createTableIndex().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/create_index`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: CreateTableIndexRequestToJSON(requestParameters['createTableIndexRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CreateTableIndexResponseFromJSON(jsonValue)); + } + + /** + * Create an index on a table column for faster search operations. Supports vector indexes (IVF_FLAT, IVF_HNSW_SQ, IVF_PQ, etc.) and scalar indexes (BTREE, BITMAP, FTS, etc.). Index creation is handled asynchronously. Use the `ListTableIndices` and `DescribeTableIndexStats` operations to monitor index creation progress. + * Create an index on a table + */ + async createTableIndex(requestParameters: CreateTableIndexOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.createTableIndexRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Create a scalar index on a table column for faster filtering operations. Supports scalar indexes (BTREE, BITMAP, LABEL_LIST, FTS, etc.). This is an alias for CreateTableIndex specifically for scalar indexes. Index creation is handled asynchronously. Use the `ListTableIndices` and `DescribeTableIndexStats` operations to monitor index creation progress. + * Create a scalar index on a table + */ + async createTableScalarIndexRaw(requestParameters: CreateTableScalarIndexRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling createTableScalarIndex().' + ); + } + + if (requestParameters['createTableIndexRequest'] == null) { + throw new runtime.RequiredError( + 'createTableIndexRequest', + 'Required parameter "createTableIndexRequest" was null or undefined when calling createTableScalarIndex().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/create_scalar_index`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: CreateTableIndexRequestToJSON(requestParameters['createTableIndexRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CreateTableScalarIndexResponseFromJSON(jsonValue)); + } + + /** + * Create a scalar index on a table column for faster filtering operations. Supports scalar indexes (BTREE, BITMAP, LABEL_LIST, FTS, etc.). This is an alias for CreateTableIndex specifically for scalar indexes. Index creation is handled asynchronously. Use the `ListTableIndices` and `DescribeTableIndexStats` operations to monitor index creation progress. + * Create a scalar index on a table + */ + async createTableScalarIndex(requestParameters: CreateTableScalarIndexRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.createTableScalarIndexRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Create a new tag for table `id` that points to a specific version. + * Create a new tag + */ + async createTableTagRaw(requestParameters: CreateTableTagOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling createTableTag().' + ); + } + + if (requestParameters['createTableTagRequest'] == null) { + throw new runtime.RequiredError( + 'createTableTagRequest', + 'Required parameter "createTableTagRequest" was null or undefined when calling createTableTag().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/tags/create`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: CreateTableTagRequestToJSON(requestParameters['createTableTagRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CreateTableTagResponseFromJSON(jsonValue)); + } + + /** + * Create a new tag for table `id` that points to a specific version. + * Create a new tag + */ + async createTableTag(requestParameters: CreateTableTagOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.createTableTagRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Create a new version entry for table `id`. This operation supports `put_if_not_exists` semantics. The operation will fail with 409 Conflict if the version already exists. + * Create a new table version + */ + async createTableVersionRaw(requestParameters: CreateTableVersionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling createTableVersion().' + ); + } + + if (requestParameters['createTableVersionRequest'] == null) { + throw new runtime.RequiredError( + 'createTableVersionRequest', + 'Required parameter "createTableVersionRequest" was null or undefined when calling createTableVersion().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/version/create`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: CreateTableVersionRequestToJSON(requestParameters['createTableVersionRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CreateTableVersionResponseFromJSON(jsonValue)); + } + + /** + * Create a new version entry for table `id`. This operation supports `put_if_not_exists` semantics. The operation will fail with 409 Conflict if the version already exists. + * Create a new table version + */ + async createTableVersion(requestParameters: CreateTableVersionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.createTableVersionRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Declare a table with the given name without touching storage. This is a metadata-only operation that records the table existence and sets up aspects like access control. For DirectoryNamespace implementation, this creates a `.lance-reserved` file in the table directory to mark the table\'s existence without creating actual Lance data files. + * Declare a table + */ + async declareTableRaw(requestParameters: DeclareTableOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling declareTable().' + ); + } + + if (requestParameters['declareTableRequest'] == null) { + throw new runtime.RequiredError( + 'declareTableRequest', + 'Required parameter "declareTableRequest" was null or undefined when calling declareTable().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/declare`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: DeclareTableRequestToJSON(requestParameters['declareTableRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => DeclareTableResponseFromJSON(jsonValue)); + } + + /** + * Declare a table with the given name without touching storage. This is a metadata-only operation that records the table existence and sets up aspects like access control. For DirectoryNamespace implementation, this creates a `.lance-reserved` file in the table directory to mark the table\'s existence without creating actual Lance data files. + * Declare a table + */ + async declareTable(requestParameters: DeclareTableOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.declareTableRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Delete an existing tag from table `id`. + * Delete a tag + */ + async deleteTableTagRaw(requestParameters: DeleteTableTagOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling deleteTableTag().' + ); + } + + if (requestParameters['deleteTableTagRequest'] == null) { + throw new runtime.RequiredError( + 'deleteTableTagRequest', + 'Required parameter "deleteTableTagRequest" was null or undefined when calling deleteTableTag().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/tags/delete`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: DeleteTableTagRequestToJSON(requestParameters['deleteTableTagRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => DeleteTableTagResponseFromJSON(jsonValue)); + } + + /** + * Delete an existing tag from table `id`. + * Delete a tag + */ + async deleteTableTag(requestParameters: DeleteTableTagOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.deleteTableTagRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Deregister table `id` from its namespace. + * Deregister a table + */ + async deregisterTableRaw(requestParameters: DeregisterTableOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling deregisterTable().' + ); + } + + if (requestParameters['deregisterTableRequest'] == null) { + throw new runtime.RequiredError( + 'deregisterTableRequest', + 'Required parameter "deregisterTableRequest" was null or undefined when calling deregisterTable().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/deregister`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: DeregisterTableRequestToJSON(requestParameters['deregisterTableRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => DeregisterTableResponseFromJSON(jsonValue)); + } + + /** + * Deregister table `id` from its namespace. + * Deregister a table + */ + async deregisterTable(requestParameters: DeregisterTableOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.deregisterTableRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Describe the detailed information for namespace `id`. + * Describe a namespace + */ + async describeNamespaceRaw(requestParameters: DescribeNamespaceOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling describeNamespace().' + ); + } + + if (requestParameters['describeNamespaceRequest'] == null) { + throw new runtime.RequiredError( + 'describeNamespaceRequest', + 'Required parameter "describeNamespaceRequest" was null or undefined when calling describeNamespace().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/namespace/{id}/describe`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: DescribeNamespaceRequestToJSON(requestParameters['describeNamespaceRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => DescribeNamespaceResponseFromJSON(jsonValue)); + } + + /** + * Describe the detailed information for namespace `id`. + * Describe a namespace + */ + async describeNamespace(requestParameters: DescribeNamespaceOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.describeNamespaceRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Describe the detailed information for table `id`. REST NAMESPACE ONLY REST namespace passes `with_table_uri` and `load_detailed_metadata` as query parameters instead of in the request body. + * Describe information of a table + */ + async describeTableRaw(requestParameters: DescribeTableOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling describeTable().' + ); + } + + if (requestParameters['describeTableRequest'] == null) { + throw new runtime.RequiredError( + 'describeTableRequest', + 'Required parameter "describeTableRequest" was null or undefined when calling describeTable().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + if (requestParameters['withTableUri'] != null) { + queryParameters['with_table_uri'] = requestParameters['withTableUri']; + } + + if (requestParameters['loadDetailedMetadata'] != null) { + queryParameters['load_detailed_metadata'] = requestParameters['loadDetailedMetadata']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/describe`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: DescribeTableRequestToJSON(requestParameters['describeTableRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => DescribeTableResponseFromJSON(jsonValue)); + } + + /** + * Describe the detailed information for table `id`. REST NAMESPACE ONLY REST namespace passes `with_table_uri` and `load_detailed_metadata` as query parameters instead of in the request body. + * Describe information of a table + */ + async describeTable(requestParameters: DescribeTableOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.describeTableRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Get statistics for a specific index on a table. Returns information about the index type, distance type (for vector indices), and row counts. + * Get table index statistics + */ + async describeTableIndexStatsRaw(requestParameters: DescribeTableIndexStatsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling describeTableIndexStats().' + ); + } + + if (requestParameters['indexName'] == null) { + throw new runtime.RequiredError( + 'indexName', + 'Required parameter "indexName" was null or undefined when calling describeTableIndexStats().' + ); + } + + if (requestParameters['describeTableIndexStatsRequest'] == null) { + throw new runtime.RequiredError( + 'describeTableIndexStatsRequest', + 'Required parameter "describeTableIndexStatsRequest" was null or undefined when calling describeTableIndexStats().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/index/{index_name}/stats`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))).replace(`{${"index_name"}}`, encodeURIComponent(String(requestParameters['indexName']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: DescribeTableIndexStatsRequestToJSON(requestParameters['describeTableIndexStatsRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => DescribeTableIndexStatsResponseFromJSON(jsonValue)); + } + + /** + * Get statistics for a specific index on a table. Returns information about the index type, distance type (for vector indices), and row counts. + * Get table index statistics + */ + async describeTableIndexStats(requestParameters: DescribeTableIndexStatsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.describeTableIndexStatsRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Describe the detailed information for a specific version of table `id`. Returns the manifest path and metadata for the specified version. + * Describe a specific table version + */ + async describeTableVersionRaw(requestParameters: DescribeTableVersionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling describeTableVersion().' + ); + } + + if (requestParameters['describeTableVersionRequest'] == null) { + throw new runtime.RequiredError( + 'describeTableVersionRequest', + 'Required parameter "describeTableVersionRequest" was null or undefined when calling describeTableVersion().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/version/describe`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: DescribeTableVersionRequestToJSON(requestParameters['describeTableVersionRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => DescribeTableVersionResponseFromJSON(jsonValue)); + } + + /** + * Describe the detailed information for a specific version of table `id`. Returns the manifest path and metadata for the specified version. + * Describe a specific table version + */ + async describeTableVersion(requestParameters: DescribeTableVersionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.describeTableVersionRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Return a detailed information for a given transaction + * Describe information about a transaction + */ + async describeTransactionRaw(requestParameters: DescribeTransactionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling describeTransaction().' + ); + } + + if (requestParameters['describeTransactionRequest'] == null) { + throw new runtime.RequiredError( + 'describeTransactionRequest', + 'Required parameter "describeTransactionRequest" was null or undefined when calling describeTransaction().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/transaction/{id}/describe`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: DescribeTransactionRequestToJSON(requestParameters['describeTransactionRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => DescribeTransactionResponseFromJSON(jsonValue)); + } + + /** + * Return a detailed information for a given transaction + * Describe information about a transaction + */ + async describeTransaction(requestParameters: DescribeTransactionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.describeTransactionRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Drop namespace `id` from its parent namespace. + * Drop a namespace + */ + async dropNamespaceRaw(requestParameters: DropNamespaceOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling dropNamespace().' + ); + } + + if (requestParameters['dropNamespaceRequest'] == null) { + throw new runtime.RequiredError( + 'dropNamespaceRequest', + 'Required parameter "dropNamespaceRequest" was null or undefined when calling dropNamespace().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/namespace/{id}/drop`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: DropNamespaceRequestToJSON(requestParameters['dropNamespaceRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => DropNamespaceResponseFromJSON(jsonValue)); + } + + /** + * Drop namespace `id` from its parent namespace. + * Drop a namespace + */ + async dropNamespace(requestParameters: DropNamespaceOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.dropNamespaceRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Drop table `id` and delete its data. REST NAMESPACE ONLY REST namespace does not use a request body for this operation. The `DropTableRequest` information is passed in the following way: - `id`: pass through path parameter of the same name + * Drop a table + */ + async dropTableRaw(requestParameters: DropTableRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling dropTable().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/drop`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => DropTableResponseFromJSON(jsonValue)); + } + + /** + * Drop table `id` and delete its data. REST NAMESPACE ONLY REST namespace does not use a request body for this operation. The `DropTableRequest` information is passed in the following way: - `id`: pass through path parameter of the same name + * Drop a table + */ + async dropTable(requestParameters: DropTableRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.dropTableRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Drop the specified index from table `id`. REST NAMESPACE ONLY REST namespace does not use a request body for this operation. The `DropTableIndexRequest` information is passed in the following way: - `id`: pass through path parameter of the same name - `index_name`: pass through path parameter of the same name + * Drop a specific index + */ + async dropTableIndexRaw(requestParameters: DropTableIndexRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling dropTableIndex().' + ); + } + + if (requestParameters['indexName'] == null) { + throw new runtime.RequiredError( + 'indexName', + 'Required parameter "indexName" was null or undefined when calling dropTableIndex().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/index/{index_name}/drop`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))).replace(`{${"index_name"}}`, encodeURIComponent(String(requestParameters['indexName']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => DropTableIndexResponseFromJSON(jsonValue)); + } + + /** + * Drop the specified index from table `id`. REST NAMESPACE ONLY REST namespace does not use a request body for this operation. The `DropTableIndexRequest` information is passed in the following way: - `id`: pass through path parameter of the same name - `index_name`: pass through path parameter of the same name + * Drop a specific index + */ + async dropTableIndex(requestParameters: DropTableIndexRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.dropTableIndexRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Get statistics for table `id`, including row counts, data sizes, and column statistics. + * Get table statistics + */ + async getTableStatsRaw(requestParameters: GetTableStatsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling getTableStats().' + ); + } + + if (requestParameters['getTableStatsRequest'] == null) { + throw new runtime.RequiredError( + 'getTableStatsRequest', + 'Required parameter "getTableStatsRequest" was null or undefined when calling getTableStats().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/stats`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: GetTableStatsRequestToJSON(requestParameters['getTableStatsRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => GetTableStatsResponseFromJSON(jsonValue)); + } + + /** + * Get statistics for table `id`, including row counts, data sizes, and column statistics. + * Get table statistics + */ + async getTableStats(requestParameters: GetTableStatsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getTableStatsRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Get the version number that a specific tag points to for table `id`. + * Get version for a specific tag + */ + async getTableTagVersionRaw(requestParameters: GetTableTagVersionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling getTableTagVersion().' + ); + } + + if (requestParameters['getTableTagVersionRequest'] == null) { + throw new runtime.RequiredError( + 'getTableTagVersionRequest', + 'Required parameter "getTableTagVersionRequest" was null or undefined when calling getTableTagVersion().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/tags/version`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: GetTableTagVersionRequestToJSON(requestParameters['getTableTagVersionRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => GetTableTagVersionResponseFromJSON(jsonValue)); + } + + /** + * Get the version number that a specific tag points to for table `id`. + * Get version for a specific tag + */ + async getTableTagVersion(requestParameters: GetTableTagVersionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getTableTagVersionRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * List all child namespace names of the parent namespace `id`. REST NAMESPACE ONLY REST namespace uses GET to perform this operation without a request body. It passes in the `ListNamespacesRequest` information in the following way: - `id`: pass through path parameter of the same name - `page_token`: pass through query parameter of the same name - `limit`: pass through query parameter of the same name + * List namespaces + */ + async listNamespacesRaw(requestParameters: ListNamespacesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling listNamespaces().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + if (requestParameters['pageToken'] != null) { + queryParameters['page_token'] = requestParameters['pageToken']; + } + + if (requestParameters['limit'] != null) { + queryParameters['limit'] = requestParameters['limit']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/namespace/{id}/list`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => ListNamespacesResponseFromJSON(jsonValue)); + } + + /** + * List all child namespace names of the parent namespace `id`. REST NAMESPACE ONLY REST namespace uses GET to perform this operation without a request body. It passes in the `ListNamespacesRequest` information in the following way: - `id`: pass through path parameter of the same name - `page_token`: pass through query parameter of the same name - `limit`: pass through query parameter of the same name + * List namespaces + */ + async listNamespaces(requestParameters: ListNamespacesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listNamespacesRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * List all indices created on a table. Returns information about each index including name, columns, status, and UUID. + * List indexes on a table + */ + async listTableIndicesRaw(requestParameters: ListTableIndicesOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling listTableIndices().' + ); + } + + if (requestParameters['listTableIndicesRequest'] == null) { + throw new runtime.RequiredError( + 'listTableIndicesRequest', + 'Required parameter "listTableIndicesRequest" was null or undefined when calling listTableIndices().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/index/list`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: ListTableIndicesRequestToJSON(requestParameters['listTableIndicesRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => ListTableIndicesResponseFromJSON(jsonValue)); + } + + /** + * List all indices created on a table. Returns information about each index including name, columns, status, and UUID. + * List indexes on a table + */ + async listTableIndices(requestParameters: ListTableIndicesOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listTableIndicesRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * List all tags that have been created for table `id`. Returns a map of tag names to their corresponding version numbers and metadata. REST NAMESPACE ONLY REST namespace does not use a request body for this operation. The `ListTableTagsRequest` information is passed in the following way: - `id`: pass through path parameter of the same name - `page_token`: pass through query parameter of the same name - `limit`: pass through query parameter of the same name + * List all tags for a table + */ + async listTableTagsRaw(requestParameters: ListTableTagsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling listTableTags().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + if (requestParameters['pageToken'] != null) { + queryParameters['page_token'] = requestParameters['pageToken']; + } + + if (requestParameters['limit'] != null) { + queryParameters['limit'] = requestParameters['limit']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/tags/list`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => ListTableTagsResponseFromJSON(jsonValue)); + } + + /** + * List all tags that have been created for table `id`. Returns a map of tag names to their corresponding version numbers and metadata. REST NAMESPACE ONLY REST namespace does not use a request body for this operation. The `ListTableTagsRequest` information is passed in the following way: - `id`: pass through path parameter of the same name - `page_token`: pass through query parameter of the same name - `limit`: pass through query parameter of the same name + * List all tags for a table + */ + async listTableTags(requestParameters: ListTableTagsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listTableTagsRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * List all versions (commits) of table `id` with their metadata. Use `descending=true` to guarantee versions are returned in descending order (latest to oldest). Otherwise, the ordering is implementation-defined. REST NAMESPACE ONLY REST namespace does not use a request body for this operation. The `ListTableVersionsRequest` information is passed in the following way: - `id`: pass through path parameter of the same name - `page_token`: pass through query parameter of the same name - `limit`: pass through query parameter of the same name - `descending`: pass through query parameter of the same name + * List all versions of a table + */ + async listTableVersionsRaw(requestParameters: ListTableVersionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling listTableVersions().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + if (requestParameters['pageToken'] != null) { + queryParameters['page_token'] = requestParameters['pageToken']; + } + + if (requestParameters['limit'] != null) { + queryParameters['limit'] = requestParameters['limit']; + } + + if (requestParameters['descending'] != null) { + queryParameters['descending'] = requestParameters['descending']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/version/list`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => ListTableVersionsResponseFromJSON(jsonValue)); + } + + /** + * List all versions (commits) of table `id` with their metadata. Use `descending=true` to guarantee versions are returned in descending order (latest to oldest). Otherwise, the ordering is implementation-defined. REST NAMESPACE ONLY REST namespace does not use a request body for this operation. The `ListTableVersionsRequest` information is passed in the following way: - `id`: pass through path parameter of the same name - `page_token`: pass through query parameter of the same name - `limit`: pass through query parameter of the same name - `descending`: pass through query parameter of the same name + * List all versions of a table + */ + async listTableVersions(requestParameters: ListTableVersionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listTableVersionsRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * List all child table names of the parent namespace `id`. REST NAMESPACE ONLY REST namespace uses GET to perform this operation without a request body. It passes in the `ListTablesRequest` information in the following way: - `id`: pass through path parameter of the same name - `page_token`: pass through query parameter of the same name - `limit`: pass through query parameter of the same name + * List tables in a namespace + */ + async listTablesRaw(requestParameters: ListTablesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling listTables().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + if (requestParameters['pageToken'] != null) { + queryParameters['page_token'] = requestParameters['pageToken']; + } + + if (requestParameters['limit'] != null) { + queryParameters['limit'] = requestParameters['limit']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/namespace/{id}/table/list`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => ListTablesResponseFromJSON(jsonValue)); + } + + /** + * List all child table names of the parent namespace `id`. REST NAMESPACE ONLY REST namespace uses GET to perform this operation without a request body. It passes in the `ListTablesRequest` information in the following way: - `id`: pass through path parameter of the same name - `page_token`: pass through query parameter of the same name - `limit`: pass through query parameter of the same name + * List tables in a namespace + */ + async listTables(requestParameters: ListTablesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listTablesRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Check if namespace `id` exists. This operation must behave exactly like the DescribeNamespace API, except it does not contain a response body. + * Check if a namespace exists + */ + async namespaceExistsRaw(requestParameters: NamespaceExistsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling namespaceExists().' + ); + } + + if (requestParameters['namespaceExistsRequest'] == null) { + throw new runtime.RequiredError( + 'namespaceExistsRequest', + 'Required parameter "namespaceExistsRequest" was null or undefined when calling namespaceExists().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/namespace/{id}/exists`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: NamespaceExistsRequestToJSON(requestParameters['namespaceExistsRequest']), + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Check if namespace `id` exists. This operation must behave exactly like the DescribeNamespace API, except it does not contain a response body. + * Check if a namespace exists + */ + async namespaceExists(requestParameters: NamespaceExistsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.namespaceExistsRaw(requestParameters, initOverrides); + } + + /** + * Register an existing table at a given storage location as `id`. + * Register a table to a namespace + */ + async registerTableRaw(requestParameters: RegisterTableOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling registerTable().' + ); + } + + if (requestParameters['registerTableRequest'] == null) { + throw new runtime.RequiredError( + 'registerTableRequest', + 'Required parameter "registerTableRequest" was null or undefined when calling registerTable().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/register`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: RegisterTableRequestToJSON(requestParameters['registerTableRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => RegisterTableResponseFromJSON(jsonValue)); + } + + /** + * Register an existing table at a given storage location as `id`. + * Register a table to a namespace + */ + async registerTable(requestParameters: RegisterTableOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.registerTableRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Rename table `id` to a new name. + * Rename a table + */ + async renameTableRaw(requestParameters: RenameTableOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling renameTable().' + ); + } + + if (requestParameters['renameTableRequest'] == null) { + throw new runtime.RequiredError( + 'renameTableRequest', + 'Required parameter "renameTableRequest" was null or undefined when calling renameTable().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/rename`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: RenameTableRequestToJSON(requestParameters['renameTableRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => RenameTableResponseFromJSON(jsonValue)); + } + + /** + * Rename table `id` to a new name. + * Rename a table + */ + async renameTable(requestParameters: RenameTableOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.renameTableRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Restore table `id` to a specific version. + * Restore table to a specific version + */ + async restoreTableRaw(requestParameters: RestoreTableOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling restoreTable().' + ); + } + + if (requestParameters['restoreTableRequest'] == null) { + throw new runtime.RequiredError( + 'restoreTableRequest', + 'Required parameter "restoreTableRequest" was null or undefined when calling restoreTable().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/restore`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: RestoreTableRequestToJSON(requestParameters['restoreTableRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => RestoreTableResponseFromJSON(jsonValue)); + } + + /** + * Restore table `id` to a specific version. + * Restore table to a specific version + */ + async restoreTable(requestParameters: RestoreTableOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.restoreTableRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Check if table `id` exists. This operation should behave exactly like DescribeTable, except it does not contain a response body. For DirectoryNamespace implementation, a table exists if either: - The table has Lance data versions (regular table created with CreateTable) - A `.lance-reserved` file exists in the table directory (declared table created with DeclareTable) + * Check if a table exists + */ + async tableExistsRaw(requestParameters: TableExistsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling tableExists().' + ); + } + + if (requestParameters['tableExistsRequest'] == null) { + throw new runtime.RequiredError( + 'tableExistsRequest', + 'Required parameter "tableExistsRequest" was null or undefined when calling tableExists().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/exists`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: TableExistsRequestToJSON(requestParameters['tableExistsRequest']), + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Check if table `id` exists. This operation should behave exactly like DescribeTable, except it does not contain a response body. For DirectoryNamespace implementation, a table exists if either: - The table has Lance data versions (regular table created with CreateTable) - A `.lance-reserved` file exists in the table directory (declared table created with DeclareTable) + * Check if a table exists + */ + async tableExists(requestParameters: TableExistsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.tableExistsRaw(requestParameters, initOverrides); + } + + /** + * Replace the schema metadata for table `id` with the provided key-value pairs. REST NAMESPACE ONLY REST namespace uses a direct object (map of string to string) as both request and response body instead of the wrapped `UpdateTableSchemaMetadataRequest` and `UpdateTableSchemaMetadataResponse`. + * Update table schema metadata + */ + async updateTableSchemaMetadataRaw(requestParameters: UpdateTableSchemaMetadataRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling updateTableSchemaMetadata().' + ); + } + + if (requestParameters['requestBody'] == null) { + throw new runtime.RequiredError( + 'requestBody', + 'Required parameter "requestBody" was null or undefined when calling updateTableSchemaMetadata().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/schema_metadata/update`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters['requestBody'], + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Replace the schema metadata for table `id` with the provided key-value pairs. REST NAMESPACE ONLY REST namespace uses a direct object (map of string to string) as both request and response body instead of the wrapped `UpdateTableSchemaMetadataRequest` and `UpdateTableSchemaMetadataResponse`. + * Update table schema metadata + */ + async updateTableSchemaMetadata(requestParameters: UpdateTableSchemaMetadataRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<{ [key: string]: string; }> { + const response = await this.updateTableSchemaMetadataRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Update an existing tag for table `id` to point to a different version. + * Update a tag to point to a different version + */ + async updateTableTagRaw(requestParameters: UpdateTableTagOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling updateTableTag().' + ); + } + + if (requestParameters['updateTableTagRequest'] == null) { + throw new runtime.RequiredError( + 'updateTableTagRequest', + 'Required parameter "updateTableTagRequest" was null or undefined when calling updateTableTag().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/tags/update`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: UpdateTableTagRequestToJSON(requestParameters['updateTableTagRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => UpdateTableTagResponseFromJSON(jsonValue)); + } + + /** + * Update an existing tag for table `id` to point to a different version. + * Update a tag to point to a different version + */ + async updateTableTag(requestParameters: UpdateTableTagOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.updateTableTagRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/typescript/lance-namespace-fetch-client/src/apis/NamespaceApi.ts b/typescript/lance-namespace-fetch-client/src/apis/NamespaceApi.ts new file mode 100644 index 000000000..bb347e4fe --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/apis/NamespaceApi.ts @@ -0,0 +1,486 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + CreateNamespaceRequest, + CreateNamespaceResponse, + DescribeNamespaceRequest, + DescribeNamespaceResponse, + DropNamespaceRequest, + DropNamespaceResponse, + ErrorResponse, + ListNamespacesResponse, + ListTablesResponse, + NamespaceExistsRequest, +} from '../models/index'; +import { + CreateNamespaceRequestFromJSON, + CreateNamespaceRequestToJSON, + CreateNamespaceResponseFromJSON, + CreateNamespaceResponseToJSON, + DescribeNamespaceRequestFromJSON, + DescribeNamespaceRequestToJSON, + DescribeNamespaceResponseFromJSON, + DescribeNamespaceResponseToJSON, + DropNamespaceRequestFromJSON, + DropNamespaceRequestToJSON, + DropNamespaceResponseFromJSON, + DropNamespaceResponseToJSON, + ErrorResponseFromJSON, + ErrorResponseToJSON, + ListNamespacesResponseFromJSON, + ListNamespacesResponseToJSON, + ListTablesResponseFromJSON, + ListTablesResponseToJSON, + NamespaceExistsRequestFromJSON, + NamespaceExistsRequestToJSON, +} from '../models/index'; + +export interface CreateNamespaceOperationRequest { + id: string; + createNamespaceRequest: CreateNamespaceRequest; + delimiter?: string; +} + +export interface DescribeNamespaceOperationRequest { + id: string; + describeNamespaceRequest: DescribeNamespaceRequest; + delimiter?: string; +} + +export interface DropNamespaceOperationRequest { + id: string; + dropNamespaceRequest: DropNamespaceRequest; + delimiter?: string; +} + +export interface ListNamespacesRequest { + id: string; + delimiter?: string; + pageToken?: string; + limit?: number; +} + +export interface ListTablesRequest { + id: string; + delimiter?: string; + pageToken?: string; + limit?: number; +} + +export interface NamespaceExistsOperationRequest { + id: string; + namespaceExistsRequest: NamespaceExistsRequest; + delimiter?: string; +} + +/** + * + */ +export class NamespaceApi extends runtime.BaseAPI { + + /** + * Create new namespace `id`. During the creation process, the implementation may modify user-provided `properties`, such as adding additional properties like `created_at` to user-provided properties, omitting any specific property, or performing actions based on any property value. + * Create a new namespace + */ + async createNamespaceRaw(requestParameters: CreateNamespaceOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling createNamespace().' + ); + } + + if (requestParameters['createNamespaceRequest'] == null) { + throw new runtime.RequiredError( + 'createNamespaceRequest', + 'Required parameter "createNamespaceRequest" was null or undefined when calling createNamespace().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/namespace/{id}/create`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: CreateNamespaceRequestToJSON(requestParameters['createNamespaceRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CreateNamespaceResponseFromJSON(jsonValue)); + } + + /** + * Create new namespace `id`. During the creation process, the implementation may modify user-provided `properties`, such as adding additional properties like `created_at` to user-provided properties, omitting any specific property, or performing actions based on any property value. + * Create a new namespace + */ + async createNamespace(requestParameters: CreateNamespaceOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.createNamespaceRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Describe the detailed information for namespace `id`. + * Describe a namespace + */ + async describeNamespaceRaw(requestParameters: DescribeNamespaceOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling describeNamespace().' + ); + } + + if (requestParameters['describeNamespaceRequest'] == null) { + throw new runtime.RequiredError( + 'describeNamespaceRequest', + 'Required parameter "describeNamespaceRequest" was null or undefined when calling describeNamespace().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/namespace/{id}/describe`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: DescribeNamespaceRequestToJSON(requestParameters['describeNamespaceRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => DescribeNamespaceResponseFromJSON(jsonValue)); + } + + /** + * Describe the detailed information for namespace `id`. + * Describe a namespace + */ + async describeNamespace(requestParameters: DescribeNamespaceOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.describeNamespaceRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Drop namespace `id` from its parent namespace. + * Drop a namespace + */ + async dropNamespaceRaw(requestParameters: DropNamespaceOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling dropNamespace().' + ); + } + + if (requestParameters['dropNamespaceRequest'] == null) { + throw new runtime.RequiredError( + 'dropNamespaceRequest', + 'Required parameter "dropNamespaceRequest" was null or undefined when calling dropNamespace().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/namespace/{id}/drop`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: DropNamespaceRequestToJSON(requestParameters['dropNamespaceRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => DropNamespaceResponseFromJSON(jsonValue)); + } + + /** + * Drop namespace `id` from its parent namespace. + * Drop a namespace + */ + async dropNamespace(requestParameters: DropNamespaceOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.dropNamespaceRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * List all child namespace names of the parent namespace `id`. REST NAMESPACE ONLY REST namespace uses GET to perform this operation without a request body. It passes in the `ListNamespacesRequest` information in the following way: - `id`: pass through path parameter of the same name - `page_token`: pass through query parameter of the same name - `limit`: pass through query parameter of the same name + * List namespaces + */ + async listNamespacesRaw(requestParameters: ListNamespacesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling listNamespaces().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + if (requestParameters['pageToken'] != null) { + queryParameters['page_token'] = requestParameters['pageToken']; + } + + if (requestParameters['limit'] != null) { + queryParameters['limit'] = requestParameters['limit']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/namespace/{id}/list`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => ListNamespacesResponseFromJSON(jsonValue)); + } + + /** + * List all child namespace names of the parent namespace `id`. REST NAMESPACE ONLY REST namespace uses GET to perform this operation without a request body. It passes in the `ListNamespacesRequest` information in the following way: - `id`: pass through path parameter of the same name - `page_token`: pass through query parameter of the same name - `limit`: pass through query parameter of the same name + * List namespaces + */ + async listNamespaces(requestParameters: ListNamespacesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listNamespacesRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * List all child table names of the parent namespace `id`. REST NAMESPACE ONLY REST namespace uses GET to perform this operation without a request body. It passes in the `ListTablesRequest` information in the following way: - `id`: pass through path parameter of the same name - `page_token`: pass through query parameter of the same name - `limit`: pass through query parameter of the same name + * List tables in a namespace + */ + async listTablesRaw(requestParameters: ListTablesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling listTables().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + if (requestParameters['pageToken'] != null) { + queryParameters['page_token'] = requestParameters['pageToken']; + } + + if (requestParameters['limit'] != null) { + queryParameters['limit'] = requestParameters['limit']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/namespace/{id}/table/list`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => ListTablesResponseFromJSON(jsonValue)); + } + + /** + * List all child table names of the parent namespace `id`. REST NAMESPACE ONLY REST namespace uses GET to perform this operation without a request body. It passes in the `ListTablesRequest` information in the following way: - `id`: pass through path parameter of the same name - `page_token`: pass through query parameter of the same name - `limit`: pass through query parameter of the same name + * List tables in a namespace + */ + async listTables(requestParameters: ListTablesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listTablesRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Check if namespace `id` exists. This operation must behave exactly like the DescribeNamespace API, except it does not contain a response body. + * Check if a namespace exists + */ + async namespaceExistsRaw(requestParameters: NamespaceExistsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling namespaceExists().' + ); + } + + if (requestParameters['namespaceExistsRequest'] == null) { + throw new runtime.RequiredError( + 'namespaceExistsRequest', + 'Required parameter "namespaceExistsRequest" was null or undefined when calling namespaceExists().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/namespace/{id}/exists`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: NamespaceExistsRequestToJSON(requestParameters['namespaceExistsRequest']), + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Check if namespace `id` exists. This operation must behave exactly like the DescribeNamespace API, except it does not contain a response body. + * Check if a namespace exists + */ + async namespaceExists(requestParameters: NamespaceExistsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.namespaceExistsRaw(requestParameters, initOverrides); + } + +} diff --git a/typescript/lance-namespace-fetch-client/src/apis/TableApi.ts b/typescript/lance-namespace-fetch-client/src/apis/TableApi.ts new file mode 100644 index 000000000..57bbe8f0d --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/apis/TableApi.ts @@ -0,0 +1,3155 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + AlterTableAddColumnsRequest, + AlterTableAddColumnsResponse, + AlterTableAlterColumnsRequest, + AlterTableAlterColumnsResponse, + AlterTableDropColumnsRequest, + AlterTableDropColumnsResponse, + AnalyzeTableQueryPlanRequest, + BatchCreateTableVersionsRequest, + BatchCreateTableVersionsResponse, + BatchDeleteTableVersionsRequest, + BatchDeleteTableVersionsResponse, + CountTableRowsRequest, + CreateEmptyTableRequest, + CreateEmptyTableResponse, + CreateTableIndexRequest, + CreateTableIndexResponse, + CreateTableResponse, + CreateTableScalarIndexResponse, + CreateTableTagRequest, + CreateTableTagResponse, + CreateTableVersionRequest, + CreateTableVersionResponse, + DeclareTableRequest, + DeclareTableResponse, + DeleteFromTableRequest, + DeleteFromTableResponse, + DeleteTableTagRequest, + DeleteTableTagResponse, + DeregisterTableRequest, + DeregisterTableResponse, + DescribeTableIndexStatsRequest, + DescribeTableIndexStatsResponse, + DescribeTableRequest, + DescribeTableResponse, + DescribeTableVersionRequest, + DescribeTableVersionResponse, + DropTableIndexResponse, + DropTableResponse, + ErrorResponse, + ExplainTableQueryPlanRequest, + GetTableStatsRequest, + GetTableStatsResponse, + GetTableTagVersionRequest, + GetTableTagVersionResponse, + InsertIntoTableResponse, + ListTableIndicesRequest, + ListTableIndicesResponse, + ListTableTagsResponse, + ListTableVersionsResponse, + ListTablesResponse, + MergeInsertIntoTableResponse, + QueryTableRequest, + RegisterTableRequest, + RegisterTableResponse, + RenameTableRequest, + RenameTableResponse, + RestoreTableRequest, + RestoreTableResponse, + TableExistsRequest, + UpdateTableRequest, + UpdateTableResponse, + UpdateTableTagRequest, + UpdateTableTagResponse, +} from '../models/index'; +import { + AlterTableAddColumnsRequestFromJSON, + AlterTableAddColumnsRequestToJSON, + AlterTableAddColumnsResponseFromJSON, + AlterTableAddColumnsResponseToJSON, + AlterTableAlterColumnsRequestFromJSON, + AlterTableAlterColumnsRequestToJSON, + AlterTableAlterColumnsResponseFromJSON, + AlterTableAlterColumnsResponseToJSON, + AlterTableDropColumnsRequestFromJSON, + AlterTableDropColumnsRequestToJSON, + AlterTableDropColumnsResponseFromJSON, + AlterTableDropColumnsResponseToJSON, + AnalyzeTableQueryPlanRequestFromJSON, + AnalyzeTableQueryPlanRequestToJSON, + BatchCreateTableVersionsRequestFromJSON, + BatchCreateTableVersionsRequestToJSON, + BatchCreateTableVersionsResponseFromJSON, + BatchCreateTableVersionsResponseToJSON, + BatchDeleteTableVersionsRequestFromJSON, + BatchDeleteTableVersionsRequestToJSON, + BatchDeleteTableVersionsResponseFromJSON, + BatchDeleteTableVersionsResponseToJSON, + CountTableRowsRequestFromJSON, + CountTableRowsRequestToJSON, + CreateEmptyTableRequestFromJSON, + CreateEmptyTableRequestToJSON, + CreateEmptyTableResponseFromJSON, + CreateEmptyTableResponseToJSON, + CreateTableIndexRequestFromJSON, + CreateTableIndexRequestToJSON, + CreateTableIndexResponseFromJSON, + CreateTableIndexResponseToJSON, + CreateTableResponseFromJSON, + CreateTableResponseToJSON, + CreateTableScalarIndexResponseFromJSON, + CreateTableScalarIndexResponseToJSON, + CreateTableTagRequestFromJSON, + CreateTableTagRequestToJSON, + CreateTableTagResponseFromJSON, + CreateTableTagResponseToJSON, + CreateTableVersionRequestFromJSON, + CreateTableVersionRequestToJSON, + CreateTableVersionResponseFromJSON, + CreateTableVersionResponseToJSON, + DeclareTableRequestFromJSON, + DeclareTableRequestToJSON, + DeclareTableResponseFromJSON, + DeclareTableResponseToJSON, + DeleteFromTableRequestFromJSON, + DeleteFromTableRequestToJSON, + DeleteFromTableResponseFromJSON, + DeleteFromTableResponseToJSON, + DeleteTableTagRequestFromJSON, + DeleteTableTagRequestToJSON, + DeleteTableTagResponseFromJSON, + DeleteTableTagResponseToJSON, + DeregisterTableRequestFromJSON, + DeregisterTableRequestToJSON, + DeregisterTableResponseFromJSON, + DeregisterTableResponseToJSON, + DescribeTableIndexStatsRequestFromJSON, + DescribeTableIndexStatsRequestToJSON, + DescribeTableIndexStatsResponseFromJSON, + DescribeTableIndexStatsResponseToJSON, + DescribeTableRequestFromJSON, + DescribeTableRequestToJSON, + DescribeTableResponseFromJSON, + DescribeTableResponseToJSON, + DescribeTableVersionRequestFromJSON, + DescribeTableVersionRequestToJSON, + DescribeTableVersionResponseFromJSON, + DescribeTableVersionResponseToJSON, + DropTableIndexResponseFromJSON, + DropTableIndexResponseToJSON, + DropTableResponseFromJSON, + DropTableResponseToJSON, + ErrorResponseFromJSON, + ErrorResponseToJSON, + ExplainTableQueryPlanRequestFromJSON, + ExplainTableQueryPlanRequestToJSON, + GetTableStatsRequestFromJSON, + GetTableStatsRequestToJSON, + GetTableStatsResponseFromJSON, + GetTableStatsResponseToJSON, + GetTableTagVersionRequestFromJSON, + GetTableTagVersionRequestToJSON, + GetTableTagVersionResponseFromJSON, + GetTableTagVersionResponseToJSON, + InsertIntoTableResponseFromJSON, + InsertIntoTableResponseToJSON, + ListTableIndicesRequestFromJSON, + ListTableIndicesRequestToJSON, + ListTableIndicesResponseFromJSON, + ListTableIndicesResponseToJSON, + ListTableTagsResponseFromJSON, + ListTableTagsResponseToJSON, + ListTableVersionsResponseFromJSON, + ListTableVersionsResponseToJSON, + ListTablesResponseFromJSON, + ListTablesResponseToJSON, + MergeInsertIntoTableResponseFromJSON, + MergeInsertIntoTableResponseToJSON, + QueryTableRequestFromJSON, + QueryTableRequestToJSON, + RegisterTableRequestFromJSON, + RegisterTableRequestToJSON, + RegisterTableResponseFromJSON, + RegisterTableResponseToJSON, + RenameTableRequestFromJSON, + RenameTableRequestToJSON, + RenameTableResponseFromJSON, + RenameTableResponseToJSON, + RestoreTableRequestFromJSON, + RestoreTableRequestToJSON, + RestoreTableResponseFromJSON, + RestoreTableResponseToJSON, + TableExistsRequestFromJSON, + TableExistsRequestToJSON, + UpdateTableRequestFromJSON, + UpdateTableRequestToJSON, + UpdateTableResponseFromJSON, + UpdateTableResponseToJSON, + UpdateTableTagRequestFromJSON, + UpdateTableTagRequestToJSON, + UpdateTableTagResponseFromJSON, + UpdateTableTagResponseToJSON, +} from '../models/index'; + +export interface AlterTableAddColumnsOperationRequest { + id: string; + alterTableAddColumnsRequest: AlterTableAddColumnsRequest; + delimiter?: string; +} + +export interface AlterTableAlterColumnsOperationRequest { + id: string; + alterTableAlterColumnsRequest: AlterTableAlterColumnsRequest; + delimiter?: string; +} + +export interface AlterTableDropColumnsOperationRequest { + id: string; + alterTableDropColumnsRequest: AlterTableDropColumnsRequest; + delimiter?: string; +} + +export interface AnalyzeTableQueryPlanOperationRequest { + id: string; + analyzeTableQueryPlanRequest: AnalyzeTableQueryPlanRequest; + delimiter?: string; +} + +export interface BatchCreateTableVersionsOperationRequest { + batchCreateTableVersionsRequest: BatchCreateTableVersionsRequest; + delimiter?: string; +} + +export interface BatchDeleteTableVersionsOperationRequest { + id: string; + batchDeleteTableVersionsRequest: BatchDeleteTableVersionsRequest; + delimiter?: string; +} + +export interface CountTableRowsOperationRequest { + id: string; + countTableRowsRequest: CountTableRowsRequest; + delimiter?: string; +} + +export interface CreateEmptyTableOperationRequest { + id: string; + createEmptyTableRequest: CreateEmptyTableRequest; + delimiter?: string; +} + +export interface CreateTableRequest { + id: string; + body: Blob; + delimiter?: string; + mode?: string; +} + +export interface CreateTableIndexOperationRequest { + id: string; + createTableIndexRequest: CreateTableIndexRequest; + delimiter?: string; +} + +export interface CreateTableScalarIndexRequest { + id: string; + createTableIndexRequest: CreateTableIndexRequest; + delimiter?: string; +} + +export interface CreateTableTagOperationRequest { + id: string; + createTableTagRequest: CreateTableTagRequest; + delimiter?: string; +} + +export interface CreateTableVersionOperationRequest { + id: string; + createTableVersionRequest: CreateTableVersionRequest; + delimiter?: string; +} + +export interface DeclareTableOperationRequest { + id: string; + declareTableRequest: DeclareTableRequest; + delimiter?: string; +} + +export interface DeleteFromTableOperationRequest { + id: string; + deleteFromTableRequest: DeleteFromTableRequest; + delimiter?: string; +} + +export interface DeleteTableTagOperationRequest { + id: string; + deleteTableTagRequest: DeleteTableTagRequest; + delimiter?: string; +} + +export interface DeregisterTableOperationRequest { + id: string; + deregisterTableRequest: DeregisterTableRequest; + delimiter?: string; +} + +export interface DescribeTableOperationRequest { + id: string; + describeTableRequest: DescribeTableRequest; + delimiter?: string; + withTableUri?: boolean; + loadDetailedMetadata?: boolean; +} + +export interface DescribeTableIndexStatsOperationRequest { + id: string; + indexName: string; + describeTableIndexStatsRequest: DescribeTableIndexStatsRequest; + delimiter?: string; +} + +export interface DescribeTableVersionOperationRequest { + id: string; + describeTableVersionRequest: DescribeTableVersionRequest; + delimiter?: string; +} + +export interface DropTableRequest { + id: string; + delimiter?: string; +} + +export interface DropTableIndexRequest { + id: string; + indexName: string; + delimiter?: string; +} + +export interface ExplainTableQueryPlanOperationRequest { + id: string; + explainTableQueryPlanRequest: ExplainTableQueryPlanRequest; + delimiter?: string; +} + +export interface GetTableStatsOperationRequest { + id: string; + getTableStatsRequest: GetTableStatsRequest; + delimiter?: string; +} + +export interface GetTableTagVersionOperationRequest { + id: string; + getTableTagVersionRequest: GetTableTagVersionRequest; + delimiter?: string; +} + +export interface InsertIntoTableRequest { + id: string; + body: Blob; + delimiter?: string; + mode?: string; +} + +export interface ListAllTablesRequest { + delimiter?: string; + pageToken?: string; + limit?: number; +} + +export interface ListTableIndicesOperationRequest { + id: string; + listTableIndicesRequest: ListTableIndicesRequest; + delimiter?: string; +} + +export interface ListTableTagsRequest { + id: string; + delimiter?: string; + pageToken?: string; + limit?: number; +} + +export interface ListTableVersionsRequest { + id: string; + delimiter?: string; + pageToken?: string; + limit?: number; + descending?: boolean; +} + +export interface ListTablesRequest { + id: string; + delimiter?: string; + pageToken?: string; + limit?: number; +} + +export interface MergeInsertIntoTableRequest { + id: string; + on: string; + body: Blob; + delimiter?: string; + whenMatchedUpdateAll?: boolean; + whenMatchedUpdateAllFilt?: string; + whenNotMatchedInsertAll?: boolean; + whenNotMatchedBySourceDelete?: boolean; + whenNotMatchedBySourceDeleteFilt?: string; + timeout?: string; + useIndex?: boolean; +} + +export interface QueryTableOperationRequest { + id: string; + queryTableRequest: QueryTableRequest; + delimiter?: string; +} + +export interface RegisterTableOperationRequest { + id: string; + registerTableRequest: RegisterTableRequest; + delimiter?: string; +} + +export interface RenameTableOperationRequest { + id: string; + renameTableRequest: RenameTableRequest; + delimiter?: string; +} + +export interface RestoreTableOperationRequest { + id: string; + restoreTableRequest: RestoreTableRequest; + delimiter?: string; +} + +export interface TableExistsOperationRequest { + id: string; + tableExistsRequest: TableExistsRequest; + delimiter?: string; +} + +export interface UpdateTableOperationRequest { + id: string; + updateTableRequest: UpdateTableRequest; + delimiter?: string; +} + +export interface UpdateTableSchemaMetadataRequest { + id: string; + requestBody: { [key: string]: string; }; + delimiter?: string; +} + +export interface UpdateTableTagOperationRequest { + id: string; + updateTableTagRequest: UpdateTableTagRequest; + delimiter?: string; +} + +/** + * + */ +export class TableApi extends runtime.BaseAPI { + + /** + * Add new columns to table `id` using SQL expressions or default values. + * Add new columns to table schema + */ + async alterTableAddColumnsRaw(requestParameters: AlterTableAddColumnsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling alterTableAddColumns().' + ); + } + + if (requestParameters['alterTableAddColumnsRequest'] == null) { + throw new runtime.RequiredError( + 'alterTableAddColumnsRequest', + 'Required parameter "alterTableAddColumnsRequest" was null or undefined when calling alterTableAddColumns().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/add_columns`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: AlterTableAddColumnsRequestToJSON(requestParameters['alterTableAddColumnsRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => AlterTableAddColumnsResponseFromJSON(jsonValue)); + } + + /** + * Add new columns to table `id` using SQL expressions or default values. + * Add new columns to table schema + */ + async alterTableAddColumns(requestParameters: AlterTableAddColumnsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.alterTableAddColumnsRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Modify existing columns in table `id`, such as renaming or changing data types. + * Modify existing columns + */ + async alterTableAlterColumnsRaw(requestParameters: AlterTableAlterColumnsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling alterTableAlterColumns().' + ); + } + + if (requestParameters['alterTableAlterColumnsRequest'] == null) { + throw new runtime.RequiredError( + 'alterTableAlterColumnsRequest', + 'Required parameter "alterTableAlterColumnsRequest" was null or undefined when calling alterTableAlterColumns().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/alter_columns`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: AlterTableAlterColumnsRequestToJSON(requestParameters['alterTableAlterColumnsRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => AlterTableAlterColumnsResponseFromJSON(jsonValue)); + } + + /** + * Modify existing columns in table `id`, such as renaming or changing data types. + * Modify existing columns + */ + async alterTableAlterColumns(requestParameters: AlterTableAlterColumnsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.alterTableAlterColumnsRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Remove specified columns from table `id`. + * Remove columns from table + */ + async alterTableDropColumnsRaw(requestParameters: AlterTableDropColumnsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling alterTableDropColumns().' + ); + } + + if (requestParameters['alterTableDropColumnsRequest'] == null) { + throw new runtime.RequiredError( + 'alterTableDropColumnsRequest', + 'Required parameter "alterTableDropColumnsRequest" was null or undefined when calling alterTableDropColumns().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/drop_columns`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: AlterTableDropColumnsRequestToJSON(requestParameters['alterTableDropColumnsRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => AlterTableDropColumnsResponseFromJSON(jsonValue)); + } + + /** + * Remove specified columns from table `id`. + * Remove columns from table + */ + async alterTableDropColumns(requestParameters: AlterTableDropColumnsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.alterTableDropColumnsRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Analyze the query execution plan for a query against table `id`. Returns detailed statistics and analysis of the query execution plan. REST NAMESPACE ONLY REST namespace returns the response as a plain string instead of the `AnalyzeTableQueryPlanResponse` JSON object. + * Analyze query execution plan + */ + async analyzeTableQueryPlanRaw(requestParameters: AnalyzeTableQueryPlanOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling analyzeTableQueryPlan().' + ); + } + + if (requestParameters['analyzeTableQueryPlanRequest'] == null) { + throw new runtime.RequiredError( + 'analyzeTableQueryPlanRequest', + 'Required parameter "analyzeTableQueryPlanRequest" was null or undefined when calling analyzeTableQueryPlan().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/analyze_plan`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: AnalyzeTableQueryPlanRequestToJSON(requestParameters['analyzeTableQueryPlanRequest']), + }, initOverrides); + + if (this.isJsonMime(response.headers.get('content-type'))) { + return new runtime.JSONApiResponse(response); + } else { + return new runtime.TextApiResponse(response) as any; + } + } + + /** + * Analyze the query execution plan for a query against table `id`. Returns detailed statistics and analysis of the query execution plan. REST NAMESPACE ONLY REST namespace returns the response as a plain string instead of the `AnalyzeTableQueryPlanResponse` JSON object. + * Analyze query execution plan + */ + async analyzeTableQueryPlan(requestParameters: AnalyzeTableQueryPlanOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.analyzeTableQueryPlanRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Atomically create new version entries for multiple tables. This operation is atomic: either all table versions are created successfully, or none are created. If any version creation fails (e.g., due to conflict), the entire batch operation fails. Each entry in the request specifies the table identifier and version details. This supports `put_if_not_exists` semantics for each version entry. + * Atomically create versions for multiple tables + */ + async batchCreateTableVersionsRaw(requestParameters: BatchCreateTableVersionsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['batchCreateTableVersionsRequest'] == null) { + throw new runtime.RequiredError( + 'batchCreateTableVersionsRequest', + 'Required parameter "batchCreateTableVersionsRequest" was null or undefined when calling batchCreateTableVersions().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/version/batch-create`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: BatchCreateTableVersionsRequestToJSON(requestParameters['batchCreateTableVersionsRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => BatchCreateTableVersionsResponseFromJSON(jsonValue)); + } + + /** + * Atomically create new version entries for multiple tables. This operation is atomic: either all table versions are created successfully, or none are created. If any version creation fails (e.g., due to conflict), the entire batch operation fails. Each entry in the request specifies the table identifier and version details. This supports `put_if_not_exists` semantics for each version entry. + * Atomically create versions for multiple tables + */ + async batchCreateTableVersions(requestParameters: BatchCreateTableVersionsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.batchCreateTableVersionsRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Delete version metadata records for table `id`. This operation deletes version tracking records, NOT the actual table data. It supports deleting ranges of versions for efficient bulk cleanup. Special range values: - `start_version: 0` with `end_version: -1` means delete ALL version records + * Delete table version records + */ + async batchDeleteTableVersionsRaw(requestParameters: BatchDeleteTableVersionsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling batchDeleteTableVersions().' + ); + } + + if (requestParameters['batchDeleteTableVersionsRequest'] == null) { + throw new runtime.RequiredError( + 'batchDeleteTableVersionsRequest', + 'Required parameter "batchDeleteTableVersionsRequest" was null or undefined when calling batchDeleteTableVersions().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/version/delete`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: BatchDeleteTableVersionsRequestToJSON(requestParameters['batchDeleteTableVersionsRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => BatchDeleteTableVersionsResponseFromJSON(jsonValue)); + } + + /** + * Delete version metadata records for table `id`. This operation deletes version tracking records, NOT the actual table data. It supports deleting ranges of versions for efficient bulk cleanup. Special range values: - `start_version: 0` with `end_version: -1` means delete ALL version records + * Delete table version records + */ + async batchDeleteTableVersions(requestParameters: BatchDeleteTableVersionsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.batchDeleteTableVersionsRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Count the number of rows in table `id` REST NAMESPACE ONLY REST namespace returns the response as a plain integer instead of the `CountTableRowsResponse` JSON object. + * Count rows in a table + */ + async countTableRowsRaw(requestParameters: CountTableRowsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling countTableRows().' + ); + } + + if (requestParameters['countTableRowsRequest'] == null) { + throw new runtime.RequiredError( + 'countTableRowsRequest', + 'Required parameter "countTableRowsRequest" was null or undefined when calling countTableRows().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/count_rows`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: CountTableRowsRequestToJSON(requestParameters['countTableRowsRequest']), + }, initOverrides); + + if (this.isJsonMime(response.headers.get('content-type'))) { + return new runtime.JSONApiResponse(response); + } else { + return new runtime.TextApiResponse(response) as any; + } + } + + /** + * Count the number of rows in table `id` REST NAMESPACE ONLY REST namespace returns the response as a plain integer instead of the `CountTableRowsResponse` JSON object. + * Count rows in a table + */ + async countTableRows(requestParameters: CountTableRowsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.countTableRowsRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Create an empty table with the given name without touching storage. This is a metadata-only operation that records the table existence and sets up aspects like access control. For DirectoryNamespace implementation, this creates a `.lance-reserved` file in the table directory to mark the table\'s existence without creating actual Lance data files. **Deprecated**: Use `DeclareTable` instead. + * Create an empty table + * @deprecated + */ + async createEmptyTableRaw(requestParameters: CreateEmptyTableOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling createEmptyTable().' + ); + } + + if (requestParameters['createEmptyTableRequest'] == null) { + throw new runtime.RequiredError( + 'createEmptyTableRequest', + 'Required parameter "createEmptyTableRequest" was null or undefined when calling createEmptyTable().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/create-empty`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: CreateEmptyTableRequestToJSON(requestParameters['createEmptyTableRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CreateEmptyTableResponseFromJSON(jsonValue)); + } + + /** + * Create an empty table with the given name without touching storage. This is a metadata-only operation that records the table existence and sets up aspects like access control. For DirectoryNamespace implementation, this creates a `.lance-reserved` file in the table directory to mark the table\'s existence without creating actual Lance data files. **Deprecated**: Use `DeclareTable` instead. + * Create an empty table + * @deprecated + */ + async createEmptyTable(requestParameters: CreateEmptyTableOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.createEmptyTableRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Create table `id` in the namespace with the given data in Arrow IPC stream. The schema of the Arrow IPC stream is used as the table schema. If the stream is empty, the API creates a new empty table. REST NAMESPACE ONLY REST namespace uses Arrow IPC stream as the request body. It passes in the `CreateTableRequest` information in the following way: - `id`: pass through path parameter of the same name - `mode`: pass through query parameter of the same name + * Create a table with the given name + */ + async createTableRaw(requestParameters: CreateTableRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling createTable().' + ); + } + + if (requestParameters['body'] == null) { + throw new runtime.RequiredError( + 'body', + 'Required parameter "body" was null or undefined when calling createTable().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + if (requestParameters['mode'] != null) { + queryParameters['mode'] = requestParameters['mode']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/vnd.apache.arrow.stream'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/create`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters['body'] as any, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CreateTableResponseFromJSON(jsonValue)); + } + + /** + * Create table `id` in the namespace with the given data in Arrow IPC stream. The schema of the Arrow IPC stream is used as the table schema. If the stream is empty, the API creates a new empty table. REST NAMESPACE ONLY REST namespace uses Arrow IPC stream as the request body. It passes in the `CreateTableRequest` information in the following way: - `id`: pass through path parameter of the same name - `mode`: pass through query parameter of the same name + * Create a table with the given name + */ + async createTable(requestParameters: CreateTableRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.createTableRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Create an index on a table column for faster search operations. Supports vector indexes (IVF_FLAT, IVF_HNSW_SQ, IVF_PQ, etc.) and scalar indexes (BTREE, BITMAP, FTS, etc.). Index creation is handled asynchronously. Use the `ListTableIndices` and `DescribeTableIndexStats` operations to monitor index creation progress. + * Create an index on a table + */ + async createTableIndexRaw(requestParameters: CreateTableIndexOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling createTableIndex().' + ); + } + + if (requestParameters['createTableIndexRequest'] == null) { + throw new runtime.RequiredError( + 'createTableIndexRequest', + 'Required parameter "createTableIndexRequest" was null or undefined when calling createTableIndex().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/create_index`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: CreateTableIndexRequestToJSON(requestParameters['createTableIndexRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CreateTableIndexResponseFromJSON(jsonValue)); + } + + /** + * Create an index on a table column for faster search operations. Supports vector indexes (IVF_FLAT, IVF_HNSW_SQ, IVF_PQ, etc.) and scalar indexes (BTREE, BITMAP, FTS, etc.). Index creation is handled asynchronously. Use the `ListTableIndices` and `DescribeTableIndexStats` operations to monitor index creation progress. + * Create an index on a table + */ + async createTableIndex(requestParameters: CreateTableIndexOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.createTableIndexRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Create a scalar index on a table column for faster filtering operations. Supports scalar indexes (BTREE, BITMAP, LABEL_LIST, FTS, etc.). This is an alias for CreateTableIndex specifically for scalar indexes. Index creation is handled asynchronously. Use the `ListTableIndices` and `DescribeTableIndexStats` operations to monitor index creation progress. + * Create a scalar index on a table + */ + async createTableScalarIndexRaw(requestParameters: CreateTableScalarIndexRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling createTableScalarIndex().' + ); + } + + if (requestParameters['createTableIndexRequest'] == null) { + throw new runtime.RequiredError( + 'createTableIndexRequest', + 'Required parameter "createTableIndexRequest" was null or undefined when calling createTableScalarIndex().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/create_scalar_index`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: CreateTableIndexRequestToJSON(requestParameters['createTableIndexRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CreateTableScalarIndexResponseFromJSON(jsonValue)); + } + + /** + * Create a scalar index on a table column for faster filtering operations. Supports scalar indexes (BTREE, BITMAP, LABEL_LIST, FTS, etc.). This is an alias for CreateTableIndex specifically for scalar indexes. Index creation is handled asynchronously. Use the `ListTableIndices` and `DescribeTableIndexStats` operations to monitor index creation progress. + * Create a scalar index on a table + */ + async createTableScalarIndex(requestParameters: CreateTableScalarIndexRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.createTableScalarIndexRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Create a new tag for table `id` that points to a specific version. + * Create a new tag + */ + async createTableTagRaw(requestParameters: CreateTableTagOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling createTableTag().' + ); + } + + if (requestParameters['createTableTagRequest'] == null) { + throw new runtime.RequiredError( + 'createTableTagRequest', + 'Required parameter "createTableTagRequest" was null or undefined when calling createTableTag().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/tags/create`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: CreateTableTagRequestToJSON(requestParameters['createTableTagRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CreateTableTagResponseFromJSON(jsonValue)); + } + + /** + * Create a new tag for table `id` that points to a specific version. + * Create a new tag + */ + async createTableTag(requestParameters: CreateTableTagOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.createTableTagRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Create a new version entry for table `id`. This operation supports `put_if_not_exists` semantics. The operation will fail with 409 Conflict if the version already exists. + * Create a new table version + */ + async createTableVersionRaw(requestParameters: CreateTableVersionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling createTableVersion().' + ); + } + + if (requestParameters['createTableVersionRequest'] == null) { + throw new runtime.RequiredError( + 'createTableVersionRequest', + 'Required parameter "createTableVersionRequest" was null or undefined when calling createTableVersion().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/version/create`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: CreateTableVersionRequestToJSON(requestParameters['createTableVersionRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CreateTableVersionResponseFromJSON(jsonValue)); + } + + /** + * Create a new version entry for table `id`. This operation supports `put_if_not_exists` semantics. The operation will fail with 409 Conflict if the version already exists. + * Create a new table version + */ + async createTableVersion(requestParameters: CreateTableVersionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.createTableVersionRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Declare a table with the given name without touching storage. This is a metadata-only operation that records the table existence and sets up aspects like access control. For DirectoryNamespace implementation, this creates a `.lance-reserved` file in the table directory to mark the table\'s existence without creating actual Lance data files. + * Declare a table + */ + async declareTableRaw(requestParameters: DeclareTableOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling declareTable().' + ); + } + + if (requestParameters['declareTableRequest'] == null) { + throw new runtime.RequiredError( + 'declareTableRequest', + 'Required parameter "declareTableRequest" was null or undefined when calling declareTable().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/declare`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: DeclareTableRequestToJSON(requestParameters['declareTableRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => DeclareTableResponseFromJSON(jsonValue)); + } + + /** + * Declare a table with the given name without touching storage. This is a metadata-only operation that records the table existence and sets up aspects like access control. For DirectoryNamespace implementation, this creates a `.lance-reserved` file in the table directory to mark the table\'s existence without creating actual Lance data files. + * Declare a table + */ + async declareTable(requestParameters: DeclareTableOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.declareTableRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Delete rows from table `id`. + * Delete rows from a table + */ + async deleteFromTableRaw(requestParameters: DeleteFromTableOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling deleteFromTable().' + ); + } + + if (requestParameters['deleteFromTableRequest'] == null) { + throw new runtime.RequiredError( + 'deleteFromTableRequest', + 'Required parameter "deleteFromTableRequest" was null or undefined when calling deleteFromTable().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/delete`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: DeleteFromTableRequestToJSON(requestParameters['deleteFromTableRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => DeleteFromTableResponseFromJSON(jsonValue)); + } + + /** + * Delete rows from table `id`. + * Delete rows from a table + */ + async deleteFromTable(requestParameters: DeleteFromTableOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.deleteFromTableRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Delete an existing tag from table `id`. + * Delete a tag + */ + async deleteTableTagRaw(requestParameters: DeleteTableTagOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling deleteTableTag().' + ); + } + + if (requestParameters['deleteTableTagRequest'] == null) { + throw new runtime.RequiredError( + 'deleteTableTagRequest', + 'Required parameter "deleteTableTagRequest" was null or undefined when calling deleteTableTag().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/tags/delete`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: DeleteTableTagRequestToJSON(requestParameters['deleteTableTagRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => DeleteTableTagResponseFromJSON(jsonValue)); + } + + /** + * Delete an existing tag from table `id`. + * Delete a tag + */ + async deleteTableTag(requestParameters: DeleteTableTagOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.deleteTableTagRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Deregister table `id` from its namespace. + * Deregister a table + */ + async deregisterTableRaw(requestParameters: DeregisterTableOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling deregisterTable().' + ); + } + + if (requestParameters['deregisterTableRequest'] == null) { + throw new runtime.RequiredError( + 'deregisterTableRequest', + 'Required parameter "deregisterTableRequest" was null or undefined when calling deregisterTable().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/deregister`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: DeregisterTableRequestToJSON(requestParameters['deregisterTableRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => DeregisterTableResponseFromJSON(jsonValue)); + } + + /** + * Deregister table `id` from its namespace. + * Deregister a table + */ + async deregisterTable(requestParameters: DeregisterTableOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.deregisterTableRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Describe the detailed information for table `id`. REST NAMESPACE ONLY REST namespace passes `with_table_uri` and `load_detailed_metadata` as query parameters instead of in the request body. + * Describe information of a table + */ + async describeTableRaw(requestParameters: DescribeTableOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling describeTable().' + ); + } + + if (requestParameters['describeTableRequest'] == null) { + throw new runtime.RequiredError( + 'describeTableRequest', + 'Required parameter "describeTableRequest" was null or undefined when calling describeTable().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + if (requestParameters['withTableUri'] != null) { + queryParameters['with_table_uri'] = requestParameters['withTableUri']; + } + + if (requestParameters['loadDetailedMetadata'] != null) { + queryParameters['load_detailed_metadata'] = requestParameters['loadDetailedMetadata']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/describe`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: DescribeTableRequestToJSON(requestParameters['describeTableRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => DescribeTableResponseFromJSON(jsonValue)); + } + + /** + * Describe the detailed information for table `id`. REST NAMESPACE ONLY REST namespace passes `with_table_uri` and `load_detailed_metadata` as query parameters instead of in the request body. + * Describe information of a table + */ + async describeTable(requestParameters: DescribeTableOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.describeTableRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Get statistics for a specific index on a table. Returns information about the index type, distance type (for vector indices), and row counts. + * Get table index statistics + */ + async describeTableIndexStatsRaw(requestParameters: DescribeTableIndexStatsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling describeTableIndexStats().' + ); + } + + if (requestParameters['indexName'] == null) { + throw new runtime.RequiredError( + 'indexName', + 'Required parameter "indexName" was null or undefined when calling describeTableIndexStats().' + ); + } + + if (requestParameters['describeTableIndexStatsRequest'] == null) { + throw new runtime.RequiredError( + 'describeTableIndexStatsRequest', + 'Required parameter "describeTableIndexStatsRequest" was null or undefined when calling describeTableIndexStats().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/index/{index_name}/stats`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))).replace(`{${"index_name"}}`, encodeURIComponent(String(requestParameters['indexName']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: DescribeTableIndexStatsRequestToJSON(requestParameters['describeTableIndexStatsRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => DescribeTableIndexStatsResponseFromJSON(jsonValue)); + } + + /** + * Get statistics for a specific index on a table. Returns information about the index type, distance type (for vector indices), and row counts. + * Get table index statistics + */ + async describeTableIndexStats(requestParameters: DescribeTableIndexStatsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.describeTableIndexStatsRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Describe the detailed information for a specific version of table `id`. Returns the manifest path and metadata for the specified version. + * Describe a specific table version + */ + async describeTableVersionRaw(requestParameters: DescribeTableVersionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling describeTableVersion().' + ); + } + + if (requestParameters['describeTableVersionRequest'] == null) { + throw new runtime.RequiredError( + 'describeTableVersionRequest', + 'Required parameter "describeTableVersionRequest" was null or undefined when calling describeTableVersion().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/version/describe`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: DescribeTableVersionRequestToJSON(requestParameters['describeTableVersionRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => DescribeTableVersionResponseFromJSON(jsonValue)); + } + + /** + * Describe the detailed information for a specific version of table `id`. Returns the manifest path and metadata for the specified version. + * Describe a specific table version + */ + async describeTableVersion(requestParameters: DescribeTableVersionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.describeTableVersionRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Drop table `id` and delete its data. REST NAMESPACE ONLY REST namespace does not use a request body for this operation. The `DropTableRequest` information is passed in the following way: - `id`: pass through path parameter of the same name + * Drop a table + */ + async dropTableRaw(requestParameters: DropTableRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling dropTable().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/drop`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => DropTableResponseFromJSON(jsonValue)); + } + + /** + * Drop table `id` and delete its data. REST NAMESPACE ONLY REST namespace does not use a request body for this operation. The `DropTableRequest` information is passed in the following way: - `id`: pass through path parameter of the same name + * Drop a table + */ + async dropTable(requestParameters: DropTableRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.dropTableRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Drop the specified index from table `id`. REST NAMESPACE ONLY REST namespace does not use a request body for this operation. The `DropTableIndexRequest` information is passed in the following way: - `id`: pass through path parameter of the same name - `index_name`: pass through path parameter of the same name + * Drop a specific index + */ + async dropTableIndexRaw(requestParameters: DropTableIndexRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling dropTableIndex().' + ); + } + + if (requestParameters['indexName'] == null) { + throw new runtime.RequiredError( + 'indexName', + 'Required parameter "indexName" was null or undefined when calling dropTableIndex().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/index/{index_name}/drop`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))).replace(`{${"index_name"}}`, encodeURIComponent(String(requestParameters['indexName']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => DropTableIndexResponseFromJSON(jsonValue)); + } + + /** + * Drop the specified index from table `id`. REST NAMESPACE ONLY REST namespace does not use a request body for this operation. The `DropTableIndexRequest` information is passed in the following way: - `id`: pass through path parameter of the same name - `index_name`: pass through path parameter of the same name + * Drop a specific index + */ + async dropTableIndex(requestParameters: DropTableIndexRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.dropTableIndexRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Get the query execution plan for a query against table `id`. Returns a human-readable explanation of how the query will be executed. REST NAMESPACE ONLY REST namespace returns the response as a plain string instead of the `ExplainTableQueryPlanResponse` JSON object. + * Get query execution plan explanation + */ + async explainTableQueryPlanRaw(requestParameters: ExplainTableQueryPlanOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling explainTableQueryPlan().' + ); + } + + if (requestParameters['explainTableQueryPlanRequest'] == null) { + throw new runtime.RequiredError( + 'explainTableQueryPlanRequest', + 'Required parameter "explainTableQueryPlanRequest" was null or undefined when calling explainTableQueryPlan().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/explain_plan`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: ExplainTableQueryPlanRequestToJSON(requestParameters['explainTableQueryPlanRequest']), + }, initOverrides); + + if (this.isJsonMime(response.headers.get('content-type'))) { + return new runtime.JSONApiResponse(response); + } else { + return new runtime.TextApiResponse(response) as any; + } + } + + /** + * Get the query execution plan for a query against table `id`. Returns a human-readable explanation of how the query will be executed. REST NAMESPACE ONLY REST namespace returns the response as a plain string instead of the `ExplainTableQueryPlanResponse` JSON object. + * Get query execution plan explanation + */ + async explainTableQueryPlan(requestParameters: ExplainTableQueryPlanOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.explainTableQueryPlanRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Get statistics for table `id`, including row counts, data sizes, and column statistics. + * Get table statistics + */ + async getTableStatsRaw(requestParameters: GetTableStatsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling getTableStats().' + ); + } + + if (requestParameters['getTableStatsRequest'] == null) { + throw new runtime.RequiredError( + 'getTableStatsRequest', + 'Required parameter "getTableStatsRequest" was null or undefined when calling getTableStats().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/stats`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: GetTableStatsRequestToJSON(requestParameters['getTableStatsRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => GetTableStatsResponseFromJSON(jsonValue)); + } + + /** + * Get statistics for table `id`, including row counts, data sizes, and column statistics. + * Get table statistics + */ + async getTableStats(requestParameters: GetTableStatsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getTableStatsRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Get the version number that a specific tag points to for table `id`. + * Get version for a specific tag + */ + async getTableTagVersionRaw(requestParameters: GetTableTagVersionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling getTableTagVersion().' + ); + } + + if (requestParameters['getTableTagVersionRequest'] == null) { + throw new runtime.RequiredError( + 'getTableTagVersionRequest', + 'Required parameter "getTableTagVersionRequest" was null or undefined when calling getTableTagVersion().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/tags/version`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: GetTableTagVersionRequestToJSON(requestParameters['getTableTagVersionRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => GetTableTagVersionResponseFromJSON(jsonValue)); + } + + /** + * Get the version number that a specific tag points to for table `id`. + * Get version for a specific tag + */ + async getTableTagVersion(requestParameters: GetTableTagVersionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getTableTagVersionRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Insert new records into table `id`. REST NAMESPACE ONLY REST namespace uses Arrow IPC stream as the request body. It passes in the `InsertIntoTableRequest` information in the following way: - `id`: pass through path parameter of the same name - `mode`: pass through query parameter of the same name + * Insert records into a table + */ + async insertIntoTableRaw(requestParameters: InsertIntoTableRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling insertIntoTable().' + ); + } + + if (requestParameters['body'] == null) { + throw new runtime.RequiredError( + 'body', + 'Required parameter "body" was null or undefined when calling insertIntoTable().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + if (requestParameters['mode'] != null) { + queryParameters['mode'] = requestParameters['mode']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/vnd.apache.arrow.stream'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/insert`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters['body'] as any, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => InsertIntoTableResponseFromJSON(jsonValue)); + } + + /** + * Insert new records into table `id`. REST NAMESPACE ONLY REST namespace uses Arrow IPC stream as the request body. It passes in the `InsertIntoTableRequest` information in the following way: - `id`: pass through path parameter of the same name - `mode`: pass through query parameter of the same name + * Insert records into a table + */ + async insertIntoTable(requestParameters: InsertIntoTableRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.insertIntoTableRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * List all tables across all namespaces. REST NAMESPACE ONLY REST namespace uses GET to perform this operation without a request body. It passes in the `ListAllTablesRequest` information in the following way: - `page_token`: pass through query parameter of the same name - `limit`: pass through query parameter of the same name - `delimiter`: pass through query parameter of the same name + * List all tables + */ + async listAllTablesRaw(requestParameters: ListAllTablesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + if (requestParameters['pageToken'] != null) { + queryParameters['page_token'] = requestParameters['pageToken']; + } + + if (requestParameters['limit'] != null) { + queryParameters['limit'] = requestParameters['limit']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => ListTablesResponseFromJSON(jsonValue)); + } + + /** + * List all tables across all namespaces. REST NAMESPACE ONLY REST namespace uses GET to perform this operation without a request body. It passes in the `ListAllTablesRequest` information in the following way: - `page_token`: pass through query parameter of the same name - `limit`: pass through query parameter of the same name - `delimiter`: pass through query parameter of the same name + * List all tables + */ + async listAllTables(requestParameters: ListAllTablesRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listAllTablesRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * List all indices created on a table. Returns information about each index including name, columns, status, and UUID. + * List indexes on a table + */ + async listTableIndicesRaw(requestParameters: ListTableIndicesOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling listTableIndices().' + ); + } + + if (requestParameters['listTableIndicesRequest'] == null) { + throw new runtime.RequiredError( + 'listTableIndicesRequest', + 'Required parameter "listTableIndicesRequest" was null or undefined when calling listTableIndices().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/index/list`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: ListTableIndicesRequestToJSON(requestParameters['listTableIndicesRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => ListTableIndicesResponseFromJSON(jsonValue)); + } + + /** + * List all indices created on a table. Returns information about each index including name, columns, status, and UUID. + * List indexes on a table + */ + async listTableIndices(requestParameters: ListTableIndicesOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listTableIndicesRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * List all tags that have been created for table `id`. Returns a map of tag names to their corresponding version numbers and metadata. REST NAMESPACE ONLY REST namespace does not use a request body for this operation. The `ListTableTagsRequest` information is passed in the following way: - `id`: pass through path parameter of the same name - `page_token`: pass through query parameter of the same name - `limit`: pass through query parameter of the same name + * List all tags for a table + */ + async listTableTagsRaw(requestParameters: ListTableTagsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling listTableTags().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + if (requestParameters['pageToken'] != null) { + queryParameters['page_token'] = requestParameters['pageToken']; + } + + if (requestParameters['limit'] != null) { + queryParameters['limit'] = requestParameters['limit']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/tags/list`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => ListTableTagsResponseFromJSON(jsonValue)); + } + + /** + * List all tags that have been created for table `id`. Returns a map of tag names to their corresponding version numbers and metadata. REST NAMESPACE ONLY REST namespace does not use a request body for this operation. The `ListTableTagsRequest` information is passed in the following way: - `id`: pass through path parameter of the same name - `page_token`: pass through query parameter of the same name - `limit`: pass through query parameter of the same name + * List all tags for a table + */ + async listTableTags(requestParameters: ListTableTagsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listTableTagsRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * List all versions (commits) of table `id` with their metadata. Use `descending=true` to guarantee versions are returned in descending order (latest to oldest). Otherwise, the ordering is implementation-defined. REST NAMESPACE ONLY REST namespace does not use a request body for this operation. The `ListTableVersionsRequest` information is passed in the following way: - `id`: pass through path parameter of the same name - `page_token`: pass through query parameter of the same name - `limit`: pass through query parameter of the same name - `descending`: pass through query parameter of the same name + * List all versions of a table + */ + async listTableVersionsRaw(requestParameters: ListTableVersionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling listTableVersions().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + if (requestParameters['pageToken'] != null) { + queryParameters['page_token'] = requestParameters['pageToken']; + } + + if (requestParameters['limit'] != null) { + queryParameters['limit'] = requestParameters['limit']; + } + + if (requestParameters['descending'] != null) { + queryParameters['descending'] = requestParameters['descending']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/version/list`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => ListTableVersionsResponseFromJSON(jsonValue)); + } + + /** + * List all versions (commits) of table `id` with their metadata. Use `descending=true` to guarantee versions are returned in descending order (latest to oldest). Otherwise, the ordering is implementation-defined. REST NAMESPACE ONLY REST namespace does not use a request body for this operation. The `ListTableVersionsRequest` information is passed in the following way: - `id`: pass through path parameter of the same name - `page_token`: pass through query parameter of the same name - `limit`: pass through query parameter of the same name - `descending`: pass through query parameter of the same name + * List all versions of a table + */ + async listTableVersions(requestParameters: ListTableVersionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listTableVersionsRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * List all child table names of the parent namespace `id`. REST NAMESPACE ONLY REST namespace uses GET to perform this operation without a request body. It passes in the `ListTablesRequest` information in the following way: - `id`: pass through path parameter of the same name - `page_token`: pass through query parameter of the same name - `limit`: pass through query parameter of the same name + * List tables in a namespace + */ + async listTablesRaw(requestParameters: ListTablesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling listTables().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + if (requestParameters['pageToken'] != null) { + queryParameters['page_token'] = requestParameters['pageToken']; + } + + if (requestParameters['limit'] != null) { + queryParameters['limit'] = requestParameters['limit']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/namespace/{id}/table/list`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => ListTablesResponseFromJSON(jsonValue)); + } + + /** + * List all child table names of the parent namespace `id`. REST NAMESPACE ONLY REST namespace uses GET to perform this operation without a request body. It passes in the `ListTablesRequest` information in the following way: - `id`: pass through path parameter of the same name - `page_token`: pass through query parameter of the same name - `limit`: pass through query parameter of the same name + * List tables in a namespace + */ + async listTables(requestParameters: ListTablesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listTablesRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Performs a merge insert (upsert) operation on table `id`. This operation updates existing rows based on a matching column and inserts new rows that don\'t match. It returns the number of rows inserted and updated. REST NAMESPACE ONLY REST namespace uses Arrow IPC stream as the request body. It passes in the `MergeInsertIntoTableRequest` information in the following way: - `id`: pass through path parameter of the same name - `on`: pass through query parameter of the same name - `when_matched_update_all`: pass through query parameter of the same name - `when_matched_update_all_filt`: pass through query parameter of the same name - `when_not_matched_insert_all`: pass through query parameter of the same name - `when_not_matched_by_source_delete`: pass through query parameter of the same name - `when_not_matched_by_source_delete_filt`: pass through query parameter of the same name + * Merge insert (upsert) records into a table + */ + async mergeInsertIntoTableRaw(requestParameters: MergeInsertIntoTableRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling mergeInsertIntoTable().' + ); + } + + if (requestParameters['on'] == null) { + throw new runtime.RequiredError( + 'on', + 'Required parameter "on" was null or undefined when calling mergeInsertIntoTable().' + ); + } + + if (requestParameters['body'] == null) { + throw new runtime.RequiredError( + 'body', + 'Required parameter "body" was null or undefined when calling mergeInsertIntoTable().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + if (requestParameters['on'] != null) { + queryParameters['on'] = requestParameters['on']; + } + + if (requestParameters['whenMatchedUpdateAll'] != null) { + queryParameters['when_matched_update_all'] = requestParameters['whenMatchedUpdateAll']; + } + + if (requestParameters['whenMatchedUpdateAllFilt'] != null) { + queryParameters['when_matched_update_all_filt'] = requestParameters['whenMatchedUpdateAllFilt']; + } + + if (requestParameters['whenNotMatchedInsertAll'] != null) { + queryParameters['when_not_matched_insert_all'] = requestParameters['whenNotMatchedInsertAll']; + } + + if (requestParameters['whenNotMatchedBySourceDelete'] != null) { + queryParameters['when_not_matched_by_source_delete'] = requestParameters['whenNotMatchedBySourceDelete']; + } + + if (requestParameters['whenNotMatchedBySourceDeleteFilt'] != null) { + queryParameters['when_not_matched_by_source_delete_filt'] = requestParameters['whenNotMatchedBySourceDeleteFilt']; + } + + if (requestParameters['timeout'] != null) { + queryParameters['timeout'] = requestParameters['timeout']; + } + + if (requestParameters['useIndex'] != null) { + queryParameters['use_index'] = requestParameters['useIndex']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/vnd.apache.arrow.stream'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/merge_insert`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters['body'] as any, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => MergeInsertIntoTableResponseFromJSON(jsonValue)); + } + + /** + * Performs a merge insert (upsert) operation on table `id`. This operation updates existing rows based on a matching column and inserts new rows that don\'t match. It returns the number of rows inserted and updated. REST NAMESPACE ONLY REST namespace uses Arrow IPC stream as the request body. It passes in the `MergeInsertIntoTableRequest` information in the following way: - `id`: pass through path parameter of the same name - `on`: pass through query parameter of the same name - `when_matched_update_all`: pass through query parameter of the same name - `when_matched_update_all_filt`: pass through query parameter of the same name - `when_not_matched_insert_all`: pass through query parameter of the same name - `when_not_matched_by_source_delete`: pass through query parameter of the same name - `when_not_matched_by_source_delete_filt`: pass through query parameter of the same name + * Merge insert (upsert) records into a table + */ + async mergeInsertIntoTable(requestParameters: MergeInsertIntoTableRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.mergeInsertIntoTableRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Query table `id` with vector search, full text search and optional SQL filtering. Returns results in Arrow IPC file or stream format. REST NAMESPACE ONLY REST namespace returns the response as Arrow IPC file binary data instead of the `QueryTableResponse` JSON object. + * Query a table + */ + async queryTableRaw(requestParameters: QueryTableOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling queryTable().' + ); + } + + if (requestParameters['queryTableRequest'] == null) { + throw new runtime.RequiredError( + 'queryTableRequest', + 'Required parameter "queryTableRequest" was null or undefined when calling queryTable().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/query`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: QueryTableRequestToJSON(requestParameters['queryTableRequest']), + }, initOverrides); + + return new runtime.BlobApiResponse(response); + } + + /** + * Query table `id` with vector search, full text search and optional SQL filtering. Returns results in Arrow IPC file or stream format. REST NAMESPACE ONLY REST namespace returns the response as Arrow IPC file binary data instead of the `QueryTableResponse` JSON object. + * Query a table + */ + async queryTable(requestParameters: QueryTableOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.queryTableRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Register an existing table at a given storage location as `id`. + * Register a table to a namespace + */ + async registerTableRaw(requestParameters: RegisterTableOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling registerTable().' + ); + } + + if (requestParameters['registerTableRequest'] == null) { + throw new runtime.RequiredError( + 'registerTableRequest', + 'Required parameter "registerTableRequest" was null or undefined when calling registerTable().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/register`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: RegisterTableRequestToJSON(requestParameters['registerTableRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => RegisterTableResponseFromJSON(jsonValue)); + } + + /** + * Register an existing table at a given storage location as `id`. + * Register a table to a namespace + */ + async registerTable(requestParameters: RegisterTableOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.registerTableRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Rename table `id` to a new name. + * Rename a table + */ + async renameTableRaw(requestParameters: RenameTableOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling renameTable().' + ); + } + + if (requestParameters['renameTableRequest'] == null) { + throw new runtime.RequiredError( + 'renameTableRequest', + 'Required parameter "renameTableRequest" was null or undefined when calling renameTable().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/rename`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: RenameTableRequestToJSON(requestParameters['renameTableRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => RenameTableResponseFromJSON(jsonValue)); + } + + /** + * Rename table `id` to a new name. + * Rename a table + */ + async renameTable(requestParameters: RenameTableOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.renameTableRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Restore table `id` to a specific version. + * Restore table to a specific version + */ + async restoreTableRaw(requestParameters: RestoreTableOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling restoreTable().' + ); + } + + if (requestParameters['restoreTableRequest'] == null) { + throw new runtime.RequiredError( + 'restoreTableRequest', + 'Required parameter "restoreTableRequest" was null or undefined when calling restoreTable().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/restore`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: RestoreTableRequestToJSON(requestParameters['restoreTableRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => RestoreTableResponseFromJSON(jsonValue)); + } + + /** + * Restore table `id` to a specific version. + * Restore table to a specific version + */ + async restoreTable(requestParameters: RestoreTableOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.restoreTableRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Check if table `id` exists. This operation should behave exactly like DescribeTable, except it does not contain a response body. For DirectoryNamespace implementation, a table exists if either: - The table has Lance data versions (regular table created with CreateTable) - A `.lance-reserved` file exists in the table directory (declared table created with DeclareTable) + * Check if a table exists + */ + async tableExistsRaw(requestParameters: TableExistsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling tableExists().' + ); + } + + if (requestParameters['tableExistsRequest'] == null) { + throw new runtime.RequiredError( + 'tableExistsRequest', + 'Required parameter "tableExistsRequest" was null or undefined when calling tableExists().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/exists`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: TableExistsRequestToJSON(requestParameters['tableExistsRequest']), + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Check if table `id` exists. This operation should behave exactly like DescribeTable, except it does not contain a response body. For DirectoryNamespace implementation, a table exists if either: - The table has Lance data versions (regular table created with CreateTable) - A `.lance-reserved` file exists in the table directory (declared table created with DeclareTable) + * Check if a table exists + */ + async tableExists(requestParameters: TableExistsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.tableExistsRaw(requestParameters, initOverrides); + } + + /** + * Update existing rows in table `id`. + * Update rows in a table + */ + async updateTableRaw(requestParameters: UpdateTableOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling updateTable().' + ); + } + + if (requestParameters['updateTableRequest'] == null) { + throw new runtime.RequiredError( + 'updateTableRequest', + 'Required parameter "updateTableRequest" was null or undefined when calling updateTable().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/update`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: UpdateTableRequestToJSON(requestParameters['updateTableRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => UpdateTableResponseFromJSON(jsonValue)); + } + + /** + * Update existing rows in table `id`. + * Update rows in a table + */ + async updateTable(requestParameters: UpdateTableOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.updateTableRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Replace the schema metadata for table `id` with the provided key-value pairs. REST NAMESPACE ONLY REST namespace uses a direct object (map of string to string) as both request and response body instead of the wrapped `UpdateTableSchemaMetadataRequest` and `UpdateTableSchemaMetadataResponse`. + * Update table schema metadata + */ + async updateTableSchemaMetadataRaw(requestParameters: UpdateTableSchemaMetadataRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling updateTableSchemaMetadata().' + ); + } + + if (requestParameters['requestBody'] == null) { + throw new runtime.RequiredError( + 'requestBody', + 'Required parameter "requestBody" was null or undefined when calling updateTableSchemaMetadata().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/schema_metadata/update`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters['requestBody'], + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Replace the schema metadata for table `id` with the provided key-value pairs. REST NAMESPACE ONLY REST namespace uses a direct object (map of string to string) as both request and response body instead of the wrapped `UpdateTableSchemaMetadataRequest` and `UpdateTableSchemaMetadataResponse`. + * Update table schema metadata + */ + async updateTableSchemaMetadata(requestParameters: UpdateTableSchemaMetadataRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<{ [key: string]: string; }> { + const response = await this.updateTableSchemaMetadataRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Update an existing tag for table `id` to point to a different version. + * Update a tag to point to a different version + */ + async updateTableTagRaw(requestParameters: UpdateTableTagOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling updateTableTag().' + ); + } + + if (requestParameters['updateTableTagRequest'] == null) { + throw new runtime.RequiredError( + 'updateTableTagRequest', + 'Required parameter "updateTableTagRequest" was null or undefined when calling updateTableTag().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/tags/update`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: UpdateTableTagRequestToJSON(requestParameters['updateTableTagRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => UpdateTableTagResponseFromJSON(jsonValue)); + } + + /** + * Update an existing tag for table `id` to point to a different version. + * Update a tag to point to a different version + */ + async updateTableTag(requestParameters: UpdateTableTagOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.updateTableTagRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/typescript/lance-namespace-fetch-client/src/apis/TagApi.ts b/typescript/lance-namespace-fetch-client/src/apis/TagApi.ts new file mode 100644 index 000000000..95cde89eb --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/apis/TagApi.ts @@ -0,0 +1,416 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + CreateTableTagRequest, + CreateTableTagResponse, + DeleteTableTagRequest, + DeleteTableTagResponse, + ErrorResponse, + GetTableTagVersionRequest, + GetTableTagVersionResponse, + ListTableTagsResponse, + UpdateTableTagRequest, + UpdateTableTagResponse, +} from '../models/index'; +import { + CreateTableTagRequestFromJSON, + CreateTableTagRequestToJSON, + CreateTableTagResponseFromJSON, + CreateTableTagResponseToJSON, + DeleteTableTagRequestFromJSON, + DeleteTableTagRequestToJSON, + DeleteTableTagResponseFromJSON, + DeleteTableTagResponseToJSON, + ErrorResponseFromJSON, + ErrorResponseToJSON, + GetTableTagVersionRequestFromJSON, + GetTableTagVersionRequestToJSON, + GetTableTagVersionResponseFromJSON, + GetTableTagVersionResponseToJSON, + ListTableTagsResponseFromJSON, + ListTableTagsResponseToJSON, + UpdateTableTagRequestFromJSON, + UpdateTableTagRequestToJSON, + UpdateTableTagResponseFromJSON, + UpdateTableTagResponseToJSON, +} from '../models/index'; + +export interface CreateTableTagOperationRequest { + id: string; + createTableTagRequest: CreateTableTagRequest; + delimiter?: string; +} + +export interface DeleteTableTagOperationRequest { + id: string; + deleteTableTagRequest: DeleteTableTagRequest; + delimiter?: string; +} + +export interface GetTableTagVersionOperationRequest { + id: string; + getTableTagVersionRequest: GetTableTagVersionRequest; + delimiter?: string; +} + +export interface ListTableTagsRequest { + id: string; + delimiter?: string; + pageToken?: string; + limit?: number; +} + +export interface UpdateTableTagOperationRequest { + id: string; + updateTableTagRequest: UpdateTableTagRequest; + delimiter?: string; +} + +/** + * + */ +export class TagApi extends runtime.BaseAPI { + + /** + * Create a new tag for table `id` that points to a specific version. + * Create a new tag + */ + async createTableTagRaw(requestParameters: CreateTableTagOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling createTableTag().' + ); + } + + if (requestParameters['createTableTagRequest'] == null) { + throw new runtime.RequiredError( + 'createTableTagRequest', + 'Required parameter "createTableTagRequest" was null or undefined when calling createTableTag().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/tags/create`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: CreateTableTagRequestToJSON(requestParameters['createTableTagRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CreateTableTagResponseFromJSON(jsonValue)); + } + + /** + * Create a new tag for table `id` that points to a specific version. + * Create a new tag + */ + async createTableTag(requestParameters: CreateTableTagOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.createTableTagRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Delete an existing tag from table `id`. + * Delete a tag + */ + async deleteTableTagRaw(requestParameters: DeleteTableTagOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling deleteTableTag().' + ); + } + + if (requestParameters['deleteTableTagRequest'] == null) { + throw new runtime.RequiredError( + 'deleteTableTagRequest', + 'Required parameter "deleteTableTagRequest" was null or undefined when calling deleteTableTag().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/tags/delete`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: DeleteTableTagRequestToJSON(requestParameters['deleteTableTagRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => DeleteTableTagResponseFromJSON(jsonValue)); + } + + /** + * Delete an existing tag from table `id`. + * Delete a tag + */ + async deleteTableTag(requestParameters: DeleteTableTagOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.deleteTableTagRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Get the version number that a specific tag points to for table `id`. + * Get version for a specific tag + */ + async getTableTagVersionRaw(requestParameters: GetTableTagVersionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling getTableTagVersion().' + ); + } + + if (requestParameters['getTableTagVersionRequest'] == null) { + throw new runtime.RequiredError( + 'getTableTagVersionRequest', + 'Required parameter "getTableTagVersionRequest" was null or undefined when calling getTableTagVersion().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/tags/version`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: GetTableTagVersionRequestToJSON(requestParameters['getTableTagVersionRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => GetTableTagVersionResponseFromJSON(jsonValue)); + } + + /** + * Get the version number that a specific tag points to for table `id`. + * Get version for a specific tag + */ + async getTableTagVersion(requestParameters: GetTableTagVersionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getTableTagVersionRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * List all tags that have been created for table `id`. Returns a map of tag names to their corresponding version numbers and metadata. REST NAMESPACE ONLY REST namespace does not use a request body for this operation. The `ListTableTagsRequest` information is passed in the following way: - `id`: pass through path parameter of the same name - `page_token`: pass through query parameter of the same name - `limit`: pass through query parameter of the same name + * List all tags for a table + */ + async listTableTagsRaw(requestParameters: ListTableTagsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling listTableTags().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + if (requestParameters['pageToken'] != null) { + queryParameters['page_token'] = requestParameters['pageToken']; + } + + if (requestParameters['limit'] != null) { + queryParameters['limit'] = requestParameters['limit']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/tags/list`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => ListTableTagsResponseFromJSON(jsonValue)); + } + + /** + * List all tags that have been created for table `id`. Returns a map of tag names to their corresponding version numbers and metadata. REST NAMESPACE ONLY REST namespace does not use a request body for this operation. The `ListTableTagsRequest` information is passed in the following way: - `id`: pass through path parameter of the same name - `page_token`: pass through query parameter of the same name - `limit`: pass through query parameter of the same name + * List all tags for a table + */ + async listTableTags(requestParameters: ListTableTagsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listTableTagsRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Update an existing tag for table `id` to point to a different version. + * Update a tag to point to a different version + */ + async updateTableTagRaw(requestParameters: UpdateTableTagOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling updateTableTag().' + ); + } + + if (requestParameters['updateTableTagRequest'] == null) { + throw new runtime.RequiredError( + 'updateTableTagRequest', + 'Required parameter "updateTableTagRequest" was null or undefined when calling updateTableTag().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/table/{id}/tags/update`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: UpdateTableTagRequestToJSON(requestParameters['updateTableTagRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => UpdateTableTagResponseFromJSON(jsonValue)); + } + + /** + * Update an existing tag for table `id` to point to a different version. + * Update a tag to point to a different version + */ + async updateTableTag(requestParameters: UpdateTableTagOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.updateTableTagRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/typescript/lance-namespace-fetch-client/src/apis/TransactionApi.ts b/typescript/lance-namespace-fetch-client/src/apis/TransactionApi.ts new file mode 100644 index 000000000..13c8f864e --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/apis/TransactionApi.ts @@ -0,0 +1,186 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + AlterTransactionRequest, + AlterTransactionResponse, + DescribeTransactionRequest, + DescribeTransactionResponse, + ErrorResponse, +} from '../models/index'; +import { + AlterTransactionRequestFromJSON, + AlterTransactionRequestToJSON, + AlterTransactionResponseFromJSON, + AlterTransactionResponseToJSON, + DescribeTransactionRequestFromJSON, + DescribeTransactionRequestToJSON, + DescribeTransactionResponseFromJSON, + DescribeTransactionResponseToJSON, + ErrorResponseFromJSON, + ErrorResponseToJSON, +} from '../models/index'; + +export interface AlterTransactionOperationRequest { + id: string; + alterTransactionRequest: AlterTransactionRequest; + delimiter?: string; +} + +export interface DescribeTransactionOperationRequest { + id: string; + describeTransactionRequest: DescribeTransactionRequest; + delimiter?: string; +} + +/** + * + */ +export class TransactionApi extends runtime.BaseAPI { + + /** + * Alter a transaction with a list of actions such as setting status or properties. The server should either succeed and apply all actions, or fail and apply no action. + * Alter information of a transaction. + */ + async alterTransactionRaw(requestParameters: AlterTransactionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling alterTransaction().' + ); + } + + if (requestParameters['alterTransactionRequest'] == null) { + throw new runtime.RequiredError( + 'alterTransactionRequest', + 'Required parameter "alterTransactionRequest" was null or undefined when calling alterTransaction().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/transaction/{id}/alter`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: AlterTransactionRequestToJSON(requestParameters['alterTransactionRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => AlterTransactionResponseFromJSON(jsonValue)); + } + + /** + * Alter a transaction with a list of actions such as setting status or properties. The server should either succeed and apply all actions, or fail and apply no action. + * Alter information of a transaction. + */ + async alterTransaction(requestParameters: AlterTransactionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.alterTransactionRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Return a detailed information for a given transaction + * Describe information about a transaction + */ + async describeTransactionRaw(requestParameters: DescribeTransactionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling describeTransaction().' + ); + } + + if (requestParameters['describeTransactionRequest'] == null) { + throw new runtime.RequiredError( + 'describeTransactionRequest', + 'Required parameter "describeTransactionRequest" was null or undefined when calling describeTransaction().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['delimiter'] != null) { + queryParameters['delimiter'] = requestParameters['delimiter']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // ApiKeyAuth authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/transaction/{id}/describe`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: DescribeTransactionRequestToJSON(requestParameters['describeTransactionRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => DescribeTransactionResponseFromJSON(jsonValue)); + } + + /** + * Return a detailed information for a given transaction + * Describe information about a transaction + */ + async describeTransaction(requestParameters: DescribeTransactionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.describeTransactionRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/typescript/lance-namespace-fetch-client/src/apis/index.ts b/typescript/lance-namespace-fetch-client/src/apis/index.ts new file mode 100644 index 000000000..f4b5454a4 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/apis/index.ts @@ -0,0 +1,9 @@ +/* tslint:disable */ +/* eslint-disable */ +export { DataApi } from "./DataApi"; +export { IndexApi } from "./IndexApi"; +export { MetadataApi } from "./MetadataApi"; +export { NamespaceApi } from "./NamespaceApi"; +export { TableApi } from "./TableApi"; +export { TagApi } from "./TagApi"; +export { TransactionApi } from "./TransactionApi"; diff --git a/typescript/lance-namespace-fetch-client/src/index.ts b/typescript/lance-namespace-fetch-client/src/index.ts new file mode 100644 index 000000000..f3f4f9f3c --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/index.ts @@ -0,0 +1,5 @@ +/* tslint:disable */ +/* eslint-disable */ +export * from "./runtime"; +export { DataApi, IndexApi, MetadataApi, NamespaceApi, TableApi, TagApi, TransactionApi } from "./apis/index"; +export * from "./models/index"; diff --git a/typescript/lance-namespace-fetch-client/src/models/AddVirtualColumnEntry.ts b/typescript/lance-namespace-fetch-client/src/models/AddVirtualColumnEntry.ts new file mode 100644 index 000000000..eff41ce5e --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/AddVirtualColumnEntry.ts @@ -0,0 +1,111 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface AddVirtualColumnEntry + */ +export interface AddVirtualColumnEntry { + /** + * List of input column names for the virtual column + * @type {Array} + * @memberof AddVirtualColumnEntry + */ + input_columns: Array; + /** + * Data type of the virtual column using JSON representation + * @type {object} + * @memberof AddVirtualColumnEntry + */ + data_type: object; + /** + * Docker image to use for the UDF + * @type {string} + * @memberof AddVirtualColumnEntry + */ + image: string; + /** + * Base64 encoded pickled UDF + * @type {string} + * @memberof AddVirtualColumnEntry + */ + udf: string; + /** + * Name of the UDF + * @type {string} + * @memberof AddVirtualColumnEntry + */ + udf_name: string; + /** + * Version of the UDF + * @type {string} + * @memberof AddVirtualColumnEntry + */ + udf_version: string; +} + +/** + * Check if a given object implements the AddVirtualColumnEntry interface. + */ +export function instanceOfAddVirtualColumnEntry(value: object): value is AddVirtualColumnEntry { + if (!('input_columns' in value) || value['input_columns'] === undefined) return false; + if (!('data_type' in value) || value['data_type'] === undefined) return false; + if (!('image' in value) || value['image'] === undefined) return false; + if (!('udf' in value) || value['udf'] === undefined) return false; + if (!('udf_name' in value) || value['udf_name'] === undefined) return false; + if (!('udf_version' in value) || value['udf_version'] === undefined) return false; + return true; +} + +export function AddVirtualColumnEntryFromJSON(json: any): AddVirtualColumnEntry { + return AddVirtualColumnEntryFromJSONTyped(json, false); +} + +export function AddVirtualColumnEntryFromJSONTyped(json: any, ignoreDiscriminator: boolean): AddVirtualColumnEntry { + if (json == null) { + return json; + } + return { + + 'input_columns': json['input_columns'], + 'data_type': json['data_type'], + 'image': json['image'], + 'udf': json['udf'], + 'udf_name': json['udf_name'], + 'udf_version': json['udf_version'], + }; +} + +export function AddVirtualColumnEntryToJSON(json: any): AddVirtualColumnEntry { + return AddVirtualColumnEntryToJSONTyped(json, false); +} + +export function AddVirtualColumnEntryToJSONTyped(value?: AddVirtualColumnEntry | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'input_columns': value['input_columns'], + 'data_type': value['data_type'], + 'image': value['image'], + 'udf': value['udf'], + 'udf_name': value['udf_name'], + 'udf_version': value['udf_version'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/AlterColumnsEntry.ts b/typescript/lance-namespace-fetch-client/src/models/AlterColumnsEntry.ts new file mode 100644 index 000000000..cd74427cc --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/AlterColumnsEntry.ts @@ -0,0 +1,107 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { AlterVirtualColumnEntry } from './AlterVirtualColumnEntry'; +import { + AlterVirtualColumnEntryFromJSON, + AlterVirtualColumnEntryFromJSONTyped, + AlterVirtualColumnEntryToJSON, + AlterVirtualColumnEntryToJSONTyped, +} from './AlterVirtualColumnEntry'; + +/** + * + * @export + * @interface AlterColumnsEntry + */ +export interface AlterColumnsEntry { + /** + * Column path to alter + * @type {string} + * @memberof AlterColumnsEntry + */ + path: string; + /** + * New data type for the column using JSON representation (optional) + * @type {object} + * @memberof AlterColumnsEntry + */ + data_type: object; + /** + * New name for the column (optional) + * @type {string} + * @memberof AlterColumnsEntry + */ + rename?: string; + /** + * Whether the column should be nullable (optional) + * @type {boolean} + * @memberof AlterColumnsEntry + */ + nullable?: boolean; + /** + * Virtual column alterations (optional) + * @type {AlterVirtualColumnEntry} + * @memberof AlterColumnsEntry + */ + virtual_column?: AlterVirtualColumnEntry; +} + +/** + * Check if a given object implements the AlterColumnsEntry interface. + */ +export function instanceOfAlterColumnsEntry(value: object): value is AlterColumnsEntry { + if (!('path' in value) || value['path'] === undefined) return false; + if (!('data_type' in value) || value['data_type'] === undefined) return false; + return true; +} + +export function AlterColumnsEntryFromJSON(json: any): AlterColumnsEntry { + return AlterColumnsEntryFromJSONTyped(json, false); +} + +export function AlterColumnsEntryFromJSONTyped(json: any, ignoreDiscriminator: boolean): AlterColumnsEntry { + if (json == null) { + return json; + } + return { + + 'path': json['path'], + 'data_type': json['data_type'], + 'rename': json['rename'] == null ? undefined : json['rename'], + 'nullable': json['nullable'] == null ? undefined : json['nullable'], + 'virtual_column': json['virtual_column'] == null ? undefined : AlterVirtualColumnEntryFromJSON(json['virtual_column']), + }; +} + +export function AlterColumnsEntryToJSON(json: any): AlterColumnsEntry { + return AlterColumnsEntryToJSONTyped(json, false); +} + +export function AlterColumnsEntryToJSONTyped(value?: AlterColumnsEntry | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'path': value['path'], + 'data_type': value['data_type'], + 'rename': value['rename'], + 'nullable': value['nullable'], + 'virtual_column': AlterVirtualColumnEntryToJSON(value['virtual_column']), + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/AlterTableAddColumnsRequest.ts b/typescript/lance-namespace-fetch-client/src/models/AlterTableAddColumnsRequest.ts new file mode 100644 index 000000000..d9b3a1047 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/AlterTableAddColumnsRequest.ts @@ -0,0 +1,112 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { NewColumnTransform } from './NewColumnTransform'; +import { + NewColumnTransformFromJSON, + NewColumnTransformFromJSONTyped, + NewColumnTransformToJSON, + NewColumnTransformToJSONTyped, +} from './NewColumnTransform'; +import type { Identity } from './Identity'; +import { + IdentityFromJSON, + IdentityFromJSONTyped, + IdentityToJSON, + IdentityToJSONTyped, +} from './Identity'; + +/** + * + * @export + * @interface AlterTableAddColumnsRequest + */ +export interface AlterTableAddColumnsRequest { + /** + * + * @type {Identity} + * @memberof AlterTableAddColumnsRequest + */ + identity?: Identity; + /** + * Arbitrary context for a request as key-value pairs. + * How to use the context is custom to the specific implementation. + * + * REST NAMESPACE ONLY + * Context entries are passed via HTTP headers using the naming convention + * `x-lance-ctx-: `. For example, a context entry + * `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + * + * @type {{ [key: string]: string; }} + * @memberof AlterTableAddColumnsRequest + */ + context?: { [key: string]: string; }; + /** + * + * @type {Array} + * @memberof AlterTableAddColumnsRequest + */ + id?: Array; + /** + * List of new columns to add + * @type {Array} + * @memberof AlterTableAddColumnsRequest + */ + new_columns: Array; +} + +/** + * Check if a given object implements the AlterTableAddColumnsRequest interface. + */ +export function instanceOfAlterTableAddColumnsRequest(value: object): value is AlterTableAddColumnsRequest { + if (!('new_columns' in value) || value['new_columns'] === undefined) return false; + return true; +} + +export function AlterTableAddColumnsRequestFromJSON(json: any): AlterTableAddColumnsRequest { + return AlterTableAddColumnsRequestFromJSONTyped(json, false); +} + +export function AlterTableAddColumnsRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): AlterTableAddColumnsRequest { + if (json == null) { + return json; + } + return { + + 'identity': json['identity'] == null ? undefined : IdentityFromJSON(json['identity']), + 'context': json['context'] == null ? undefined : json['context'], + 'id': json['id'] == null ? undefined : json['id'], + 'new_columns': ((json['new_columns'] as Array).map(NewColumnTransformFromJSON)), + }; +} + +export function AlterTableAddColumnsRequestToJSON(json: any): AlterTableAddColumnsRequest { + return AlterTableAddColumnsRequestToJSONTyped(json, false); +} + +export function AlterTableAddColumnsRequestToJSONTyped(value?: AlterTableAddColumnsRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'identity': IdentityToJSON(value['identity']), + 'context': value['context'], + 'id': value['id'], + 'new_columns': ((value['new_columns'] as Array).map(NewColumnTransformToJSON)), + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/AlterTableAddColumnsResponse.ts b/typescript/lance-namespace-fetch-client/src/models/AlterTableAddColumnsResponse.ts new file mode 100644 index 000000000..7f3324969 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/AlterTableAddColumnsResponse.ts @@ -0,0 +1,74 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface AlterTableAddColumnsResponse + */ +export interface AlterTableAddColumnsResponse { + /** + * Optional transaction identifier + * @type {string} + * @memberof AlterTableAddColumnsResponse + */ + transaction_id?: string; + /** + * Version of the table after adding columns + * @type {number} + * @memberof AlterTableAddColumnsResponse + */ + version: number; +} + +/** + * Check if a given object implements the AlterTableAddColumnsResponse interface. + */ +export function instanceOfAlterTableAddColumnsResponse(value: object): value is AlterTableAddColumnsResponse { + if (!('version' in value) || value['version'] === undefined) return false; + return true; +} + +export function AlterTableAddColumnsResponseFromJSON(json: any): AlterTableAddColumnsResponse { + return AlterTableAddColumnsResponseFromJSONTyped(json, false); +} + +export function AlterTableAddColumnsResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): AlterTableAddColumnsResponse { + if (json == null) { + return json; + } + return { + + 'transaction_id': json['transaction_id'] == null ? undefined : json['transaction_id'], + 'version': json['version'], + }; +} + +export function AlterTableAddColumnsResponseToJSON(json: any): AlterTableAddColumnsResponse { + return AlterTableAddColumnsResponseToJSONTyped(json, false); +} + +export function AlterTableAddColumnsResponseToJSONTyped(value?: AlterTableAddColumnsResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'transaction_id': value['transaction_id'], + 'version': value['version'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/AlterTableAlterColumnsRequest.ts b/typescript/lance-namespace-fetch-client/src/models/AlterTableAlterColumnsRequest.ts new file mode 100644 index 000000000..d2cad2ff1 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/AlterTableAlterColumnsRequest.ts @@ -0,0 +1,112 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Identity } from './Identity'; +import { + IdentityFromJSON, + IdentityFromJSONTyped, + IdentityToJSON, + IdentityToJSONTyped, +} from './Identity'; +import type { AlterColumnsEntry } from './AlterColumnsEntry'; +import { + AlterColumnsEntryFromJSON, + AlterColumnsEntryFromJSONTyped, + AlterColumnsEntryToJSON, + AlterColumnsEntryToJSONTyped, +} from './AlterColumnsEntry'; + +/** + * + * @export + * @interface AlterTableAlterColumnsRequest + */ +export interface AlterTableAlterColumnsRequest { + /** + * + * @type {Identity} + * @memberof AlterTableAlterColumnsRequest + */ + identity?: Identity; + /** + * Arbitrary context for a request as key-value pairs. + * How to use the context is custom to the specific implementation. + * + * REST NAMESPACE ONLY + * Context entries are passed via HTTP headers using the naming convention + * `x-lance-ctx-: `. For example, a context entry + * `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + * + * @type {{ [key: string]: string; }} + * @memberof AlterTableAlterColumnsRequest + */ + context?: { [key: string]: string; }; + /** + * + * @type {Array} + * @memberof AlterTableAlterColumnsRequest + */ + id?: Array; + /** + * List of column alterations to perform + * @type {Array} + * @memberof AlterTableAlterColumnsRequest + */ + alterations: Array; +} + +/** + * Check if a given object implements the AlterTableAlterColumnsRequest interface. + */ +export function instanceOfAlterTableAlterColumnsRequest(value: object): value is AlterTableAlterColumnsRequest { + if (!('alterations' in value) || value['alterations'] === undefined) return false; + return true; +} + +export function AlterTableAlterColumnsRequestFromJSON(json: any): AlterTableAlterColumnsRequest { + return AlterTableAlterColumnsRequestFromJSONTyped(json, false); +} + +export function AlterTableAlterColumnsRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): AlterTableAlterColumnsRequest { + if (json == null) { + return json; + } + return { + + 'identity': json['identity'] == null ? undefined : IdentityFromJSON(json['identity']), + 'context': json['context'] == null ? undefined : json['context'], + 'id': json['id'] == null ? undefined : json['id'], + 'alterations': ((json['alterations'] as Array).map(AlterColumnsEntryFromJSON)), + }; +} + +export function AlterTableAlterColumnsRequestToJSON(json: any): AlterTableAlterColumnsRequest { + return AlterTableAlterColumnsRequestToJSONTyped(json, false); +} + +export function AlterTableAlterColumnsRequestToJSONTyped(value?: AlterTableAlterColumnsRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'identity': IdentityToJSON(value['identity']), + 'context': value['context'], + 'id': value['id'], + 'alterations': ((value['alterations'] as Array).map(AlterColumnsEntryToJSON)), + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/AlterTableAlterColumnsResponse.ts b/typescript/lance-namespace-fetch-client/src/models/AlterTableAlterColumnsResponse.ts new file mode 100644 index 000000000..2bded56f7 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/AlterTableAlterColumnsResponse.ts @@ -0,0 +1,74 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface AlterTableAlterColumnsResponse + */ +export interface AlterTableAlterColumnsResponse { + /** + * Optional transaction identifier + * @type {string} + * @memberof AlterTableAlterColumnsResponse + */ + transaction_id?: string; + /** + * Version of the table after altering columns + * @type {number} + * @memberof AlterTableAlterColumnsResponse + */ + version: number; +} + +/** + * Check if a given object implements the AlterTableAlterColumnsResponse interface. + */ +export function instanceOfAlterTableAlterColumnsResponse(value: object): value is AlterTableAlterColumnsResponse { + if (!('version' in value) || value['version'] === undefined) return false; + return true; +} + +export function AlterTableAlterColumnsResponseFromJSON(json: any): AlterTableAlterColumnsResponse { + return AlterTableAlterColumnsResponseFromJSONTyped(json, false); +} + +export function AlterTableAlterColumnsResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): AlterTableAlterColumnsResponse { + if (json == null) { + return json; + } + return { + + 'transaction_id': json['transaction_id'] == null ? undefined : json['transaction_id'], + 'version': json['version'], + }; +} + +export function AlterTableAlterColumnsResponseToJSON(json: any): AlterTableAlterColumnsResponse { + return AlterTableAlterColumnsResponseToJSONTyped(json, false); +} + +export function AlterTableAlterColumnsResponseToJSONTyped(value?: AlterTableAlterColumnsResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'transaction_id': value['transaction_id'], + 'version': value['version'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/AlterTableDropColumnsRequest.ts b/typescript/lance-namespace-fetch-client/src/models/AlterTableDropColumnsRequest.ts new file mode 100644 index 000000000..e40488fcb --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/AlterTableDropColumnsRequest.ts @@ -0,0 +1,105 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Identity } from './Identity'; +import { + IdentityFromJSON, + IdentityFromJSONTyped, + IdentityToJSON, + IdentityToJSONTyped, +} from './Identity'; + +/** + * + * @export + * @interface AlterTableDropColumnsRequest + */ +export interface AlterTableDropColumnsRequest { + /** + * + * @type {Identity} + * @memberof AlterTableDropColumnsRequest + */ + identity?: Identity; + /** + * Arbitrary context for a request as key-value pairs. + * How to use the context is custom to the specific implementation. + * + * REST NAMESPACE ONLY + * Context entries are passed via HTTP headers using the naming convention + * `x-lance-ctx-: `. For example, a context entry + * `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + * + * @type {{ [key: string]: string; }} + * @memberof AlterTableDropColumnsRequest + */ + context?: { [key: string]: string; }; + /** + * + * @type {Array} + * @memberof AlterTableDropColumnsRequest + */ + id?: Array; + /** + * Names of columns to drop + * @type {Array} + * @memberof AlterTableDropColumnsRequest + */ + columns: Array; +} + +/** + * Check if a given object implements the AlterTableDropColumnsRequest interface. + */ +export function instanceOfAlterTableDropColumnsRequest(value: object): value is AlterTableDropColumnsRequest { + if (!('columns' in value) || value['columns'] === undefined) return false; + return true; +} + +export function AlterTableDropColumnsRequestFromJSON(json: any): AlterTableDropColumnsRequest { + return AlterTableDropColumnsRequestFromJSONTyped(json, false); +} + +export function AlterTableDropColumnsRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): AlterTableDropColumnsRequest { + if (json == null) { + return json; + } + return { + + 'identity': json['identity'] == null ? undefined : IdentityFromJSON(json['identity']), + 'context': json['context'] == null ? undefined : json['context'], + 'id': json['id'] == null ? undefined : json['id'], + 'columns': json['columns'], + }; +} + +export function AlterTableDropColumnsRequestToJSON(json: any): AlterTableDropColumnsRequest { + return AlterTableDropColumnsRequestToJSONTyped(json, false); +} + +export function AlterTableDropColumnsRequestToJSONTyped(value?: AlterTableDropColumnsRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'identity': IdentityToJSON(value['identity']), + 'context': value['context'], + 'id': value['id'], + 'columns': value['columns'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/AlterTableDropColumnsResponse.ts b/typescript/lance-namespace-fetch-client/src/models/AlterTableDropColumnsResponse.ts new file mode 100644 index 000000000..037ed6b57 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/AlterTableDropColumnsResponse.ts @@ -0,0 +1,74 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface AlterTableDropColumnsResponse + */ +export interface AlterTableDropColumnsResponse { + /** + * Optional transaction identifier + * @type {string} + * @memberof AlterTableDropColumnsResponse + */ + transaction_id?: string; + /** + * Version of the table after dropping columns + * @type {number} + * @memberof AlterTableDropColumnsResponse + */ + version: number; +} + +/** + * Check if a given object implements the AlterTableDropColumnsResponse interface. + */ +export function instanceOfAlterTableDropColumnsResponse(value: object): value is AlterTableDropColumnsResponse { + if (!('version' in value) || value['version'] === undefined) return false; + return true; +} + +export function AlterTableDropColumnsResponseFromJSON(json: any): AlterTableDropColumnsResponse { + return AlterTableDropColumnsResponseFromJSONTyped(json, false); +} + +export function AlterTableDropColumnsResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): AlterTableDropColumnsResponse { + if (json == null) { + return json; + } + return { + + 'transaction_id': json['transaction_id'] == null ? undefined : json['transaction_id'], + 'version': json['version'], + }; +} + +export function AlterTableDropColumnsResponseToJSON(json: any): AlterTableDropColumnsResponse { + return AlterTableDropColumnsResponseToJSONTyped(json, false); +} + +export function AlterTableDropColumnsResponseToJSONTyped(value?: AlterTableDropColumnsResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'transaction_id': value['transaction_id'], + 'version': value['version'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/AlterTransactionAction.ts b/typescript/lance-namespace-fetch-client/src/models/AlterTransactionAction.ts new file mode 100644 index 000000000..a46e7c46a --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/AlterTransactionAction.ts @@ -0,0 +1,108 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { AlterTransactionUnsetProperty } from './AlterTransactionUnsetProperty'; +import { + AlterTransactionUnsetPropertyFromJSON, + AlterTransactionUnsetPropertyFromJSONTyped, + AlterTransactionUnsetPropertyToJSON, + AlterTransactionUnsetPropertyToJSONTyped, +} from './AlterTransactionUnsetProperty'; +import type { AlterTransactionSetProperty } from './AlterTransactionSetProperty'; +import { + AlterTransactionSetPropertyFromJSON, + AlterTransactionSetPropertyFromJSONTyped, + AlterTransactionSetPropertyToJSON, + AlterTransactionSetPropertyToJSONTyped, +} from './AlterTransactionSetProperty'; +import type { AlterTransactionSetStatus } from './AlterTransactionSetStatus'; +import { + AlterTransactionSetStatusFromJSON, + AlterTransactionSetStatusFromJSONTyped, + AlterTransactionSetStatusToJSON, + AlterTransactionSetStatusToJSONTyped, +} from './AlterTransactionSetStatus'; + +/** + * A single action that could be performed to alter a transaction. + * This action holds the model definition for all types of specific actions models, + * this is to minimize difference and compatibility issue across codegen in different languages. + * When used, only one of the actions should be non-null for each action. + * If you would like to perform multiple actions, set a list of actions in the AlterTransactionRequest. + * + * @export + * @interface AlterTransactionAction + */ +export interface AlterTransactionAction { + /** + * + * @type {AlterTransactionSetStatus} + * @memberof AlterTransactionAction + */ + setStatusAction?: AlterTransactionSetStatus; + /** + * + * @type {AlterTransactionSetProperty} + * @memberof AlterTransactionAction + */ + setPropertyAction?: AlterTransactionSetProperty; + /** + * + * @type {AlterTransactionUnsetProperty} + * @memberof AlterTransactionAction + */ + unsetPropertyAction?: AlterTransactionUnsetProperty; +} + +/** + * Check if a given object implements the AlterTransactionAction interface. + */ +export function instanceOfAlterTransactionAction(value: object): value is AlterTransactionAction { + return true; +} + +export function AlterTransactionActionFromJSON(json: any): AlterTransactionAction { + return AlterTransactionActionFromJSONTyped(json, false); +} + +export function AlterTransactionActionFromJSONTyped(json: any, ignoreDiscriminator: boolean): AlterTransactionAction { + if (json == null) { + return json; + } + return { + + 'setStatusAction': json['setStatusAction'] == null ? undefined : AlterTransactionSetStatusFromJSON(json['setStatusAction']), + 'setPropertyAction': json['setPropertyAction'] == null ? undefined : AlterTransactionSetPropertyFromJSON(json['setPropertyAction']), + 'unsetPropertyAction': json['unsetPropertyAction'] == null ? undefined : AlterTransactionUnsetPropertyFromJSON(json['unsetPropertyAction']), + }; +} + +export function AlterTransactionActionToJSON(json: any): AlterTransactionAction { + return AlterTransactionActionToJSONTyped(json, false); +} + +export function AlterTransactionActionToJSONTyped(value?: AlterTransactionAction | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'setStatusAction': AlterTransactionSetStatusToJSON(value['setStatusAction']), + 'setPropertyAction': AlterTransactionSetPropertyToJSON(value['setPropertyAction']), + 'unsetPropertyAction': AlterTransactionUnsetPropertyToJSON(value['unsetPropertyAction']), + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/AlterTransactionRequest.ts b/typescript/lance-namespace-fetch-client/src/models/AlterTransactionRequest.ts new file mode 100644 index 000000000..f7692cba2 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/AlterTransactionRequest.ts @@ -0,0 +1,114 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { AlterTransactionAction } from './AlterTransactionAction'; +import { + AlterTransactionActionFromJSON, + AlterTransactionActionFromJSONTyped, + AlterTransactionActionToJSON, + AlterTransactionActionToJSONTyped, +} from './AlterTransactionAction'; +import type { Identity } from './Identity'; +import { + IdentityFromJSON, + IdentityFromJSONTyped, + IdentityToJSON, + IdentityToJSONTyped, +} from './Identity'; + +/** + * Alter a transaction with a list of actions. + * The server should either succeed and apply all actions, or fail and apply no action. + * + * @export + * @interface AlterTransactionRequest + */ +export interface AlterTransactionRequest { + /** + * + * @type {Identity} + * @memberof AlterTransactionRequest + */ + identity?: Identity; + /** + * Arbitrary context for a request as key-value pairs. + * How to use the context is custom to the specific implementation. + * + * REST NAMESPACE ONLY + * Context entries are passed via HTTP headers using the naming convention + * `x-lance-ctx-: `. For example, a context entry + * `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + * + * @type {{ [key: string]: string; }} + * @memberof AlterTransactionRequest + */ + context?: { [key: string]: string; }; + /** + * + * @type {Array} + * @memberof AlterTransactionRequest + */ + id?: Array; + /** + * + * @type {Array} + * @memberof AlterTransactionRequest + */ + actions: Array; +} + +/** + * Check if a given object implements the AlterTransactionRequest interface. + */ +export function instanceOfAlterTransactionRequest(value: object): value is AlterTransactionRequest { + if (!('actions' in value) || value['actions'] === undefined) return false; + return true; +} + +export function AlterTransactionRequestFromJSON(json: any): AlterTransactionRequest { + return AlterTransactionRequestFromJSONTyped(json, false); +} + +export function AlterTransactionRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): AlterTransactionRequest { + if (json == null) { + return json; + } + return { + + 'identity': json['identity'] == null ? undefined : IdentityFromJSON(json['identity']), + 'context': json['context'] == null ? undefined : json['context'], + 'id': json['id'] == null ? undefined : json['id'], + 'actions': ((json['actions'] as Array).map(AlterTransactionActionFromJSON)), + }; +} + +export function AlterTransactionRequestToJSON(json: any): AlterTransactionRequest { + return AlterTransactionRequestToJSONTyped(json, false); +} + +export function AlterTransactionRequestToJSONTyped(value?: AlterTransactionRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'identity': IdentityToJSON(value['identity']), + 'context': value['context'], + 'id': value['id'], + 'actions': ((value['actions'] as Array).map(AlterTransactionActionToJSON)), + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/AlterTransactionResponse.ts b/typescript/lance-namespace-fetch-client/src/models/AlterTransactionResponse.ts new file mode 100644 index 000000000..57568dabd --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/AlterTransactionResponse.ts @@ -0,0 +1,81 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface AlterTransactionResponse + */ +export interface AlterTransactionResponse { + /** + * The status of a transaction. + * Case insensitive, supports both PascalCase and snake_case. Valid values are: + * - Queued: the transaction is queued and not yet started + * - Running: the transaction is currently running + * - Succeeded: the transaction has completed successfully + * - Failed: the transaction has failed + * - Canceled: the transaction was canceled + * + * @type {string} + * @memberof AlterTransactionResponse + */ + status: string; + /** + * + * @type {{ [key: string]: string; }} + * @memberof AlterTransactionResponse + */ + properties?: { [key: string]: string; }; +} + +/** + * Check if a given object implements the AlterTransactionResponse interface. + */ +export function instanceOfAlterTransactionResponse(value: object): value is AlterTransactionResponse { + if (!('status' in value) || value['status'] === undefined) return false; + return true; +} + +export function AlterTransactionResponseFromJSON(json: any): AlterTransactionResponse { + return AlterTransactionResponseFromJSONTyped(json, false); +} + +export function AlterTransactionResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): AlterTransactionResponse { + if (json == null) { + return json; + } + return { + + 'status': json['status'], + 'properties': json['properties'] == null ? undefined : json['properties'], + }; +} + +export function AlterTransactionResponseToJSON(json: any): AlterTransactionResponse { + return AlterTransactionResponseToJSONTyped(json, false); +} + +export function AlterTransactionResponseToJSONTyped(value?: AlterTransactionResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'status': value['status'], + 'properties': value['properties'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/AlterTransactionSetProperty.ts b/typescript/lance-namespace-fetch-client/src/models/AlterTransactionSetProperty.ts new file mode 100644 index 000000000..f2b827a0e --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/AlterTransactionSetProperty.ts @@ -0,0 +1,86 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface AlterTransactionSetProperty + */ +export interface AlterTransactionSetProperty { + /** + * + * @type {string} + * @memberof AlterTransactionSetProperty + */ + key?: string; + /** + * + * @type {string} + * @memberof AlterTransactionSetProperty + */ + value?: string; + /** + * The behavior if the property key already exists. + * Case insensitive, supports both PascalCase and snake_case. Valid values are: + * - Overwrite (default): overwrite the existing value with the provided value + * - Fail: fail the entire operation + * - Skip: keep the existing value and skip setting the provided value + * + * @type {string} + * @memberof AlterTransactionSetProperty + */ + mode?: string; +} + +/** + * Check if a given object implements the AlterTransactionSetProperty interface. + */ +export function instanceOfAlterTransactionSetProperty(value: object): value is AlterTransactionSetProperty { + return true; +} + +export function AlterTransactionSetPropertyFromJSON(json: any): AlterTransactionSetProperty { + return AlterTransactionSetPropertyFromJSONTyped(json, false); +} + +export function AlterTransactionSetPropertyFromJSONTyped(json: any, ignoreDiscriminator: boolean): AlterTransactionSetProperty { + if (json == null) { + return json; + } + return { + + 'key': json['key'] == null ? undefined : json['key'], + 'value': json['value'] == null ? undefined : json['value'], + 'mode': json['mode'] == null ? undefined : json['mode'], + }; +} + +export function AlterTransactionSetPropertyToJSON(json: any): AlterTransactionSetProperty { + return AlterTransactionSetPropertyToJSONTyped(json, false); +} + +export function AlterTransactionSetPropertyToJSONTyped(value?: AlterTransactionSetProperty | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'key': value['key'], + 'value': value['value'], + 'mode': value['mode'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/AlterTransactionSetStatus.ts b/typescript/lance-namespace-fetch-client/src/models/AlterTransactionSetStatus.ts new file mode 100644 index 000000000..61d88e577 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/AlterTransactionSetStatus.ts @@ -0,0 +1,72 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface AlterTransactionSetStatus + */ +export interface AlterTransactionSetStatus { + /** + * The status of a transaction. + * Case insensitive, supports both PascalCase and snake_case. Valid values are: + * - Queued: the transaction is queued and not yet started + * - Running: the transaction is currently running + * - Succeeded: the transaction has completed successfully + * - Failed: the transaction has failed + * - Canceled: the transaction was canceled + * + * @type {string} + * @memberof AlterTransactionSetStatus + */ + status?: string; +} + +/** + * Check if a given object implements the AlterTransactionSetStatus interface. + */ +export function instanceOfAlterTransactionSetStatus(value: object): value is AlterTransactionSetStatus { + return true; +} + +export function AlterTransactionSetStatusFromJSON(json: any): AlterTransactionSetStatus { + return AlterTransactionSetStatusFromJSONTyped(json, false); +} + +export function AlterTransactionSetStatusFromJSONTyped(json: any, ignoreDiscriminator: boolean): AlterTransactionSetStatus { + if (json == null) { + return json; + } + return { + + 'status': json['status'] == null ? undefined : json['status'], + }; +} + +export function AlterTransactionSetStatusToJSON(json: any): AlterTransactionSetStatus { + return AlterTransactionSetStatusToJSONTyped(json, false); +} + +export function AlterTransactionSetStatusToJSONTyped(value?: AlterTransactionSetStatus | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'status': value['status'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/AlterTransactionUnsetProperty.ts b/typescript/lance-namespace-fetch-client/src/models/AlterTransactionUnsetProperty.ts new file mode 100644 index 000000000..80f92489f --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/AlterTransactionUnsetProperty.ts @@ -0,0 +1,77 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface AlterTransactionUnsetProperty + */ +export interface AlterTransactionUnsetProperty { + /** + * + * @type {string} + * @memberof AlterTransactionUnsetProperty + */ + key?: string; + /** + * The behavior if the property key to unset does not exist. + * Case insensitive, supports both PascalCase and snake_case. Valid values are: + * - Skip (default): skip the property to unset + * - Fail: fail the entire operation + * + * @type {string} + * @memberof AlterTransactionUnsetProperty + */ + mode?: string; +} + +/** + * Check if a given object implements the AlterTransactionUnsetProperty interface. + */ +export function instanceOfAlterTransactionUnsetProperty(value: object): value is AlterTransactionUnsetProperty { + return true; +} + +export function AlterTransactionUnsetPropertyFromJSON(json: any): AlterTransactionUnsetProperty { + return AlterTransactionUnsetPropertyFromJSONTyped(json, false); +} + +export function AlterTransactionUnsetPropertyFromJSONTyped(json: any, ignoreDiscriminator: boolean): AlterTransactionUnsetProperty { + if (json == null) { + return json; + } + return { + + 'key': json['key'] == null ? undefined : json['key'], + 'mode': json['mode'] == null ? undefined : json['mode'], + }; +} + +export function AlterTransactionUnsetPropertyToJSON(json: any): AlterTransactionUnsetProperty { + return AlterTransactionUnsetPropertyToJSONTyped(json, false); +} + +export function AlterTransactionUnsetPropertyToJSONTyped(value?: AlterTransactionUnsetProperty | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'key': value['key'], + 'mode': value['mode'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/AlterVirtualColumnEntry.ts b/typescript/lance-namespace-fetch-client/src/models/AlterVirtualColumnEntry.ts new file mode 100644 index 000000000..1e4a6abfd --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/AlterVirtualColumnEntry.ts @@ -0,0 +1,97 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface AlterVirtualColumnEntry + */ +export interface AlterVirtualColumnEntry { + /** + * List of input column names for the virtual column (optional) + * @type {Array} + * @memberof AlterVirtualColumnEntry + */ + input_columns?: Array; + /** + * Docker image to use for the UDF (optional) + * @type {string} + * @memberof AlterVirtualColumnEntry + */ + image?: string; + /** + * Base64 encoded pickled UDF (optional) + * @type {string} + * @memberof AlterVirtualColumnEntry + */ + udf?: string; + /** + * Name of the UDF (optional) + * @type {string} + * @memberof AlterVirtualColumnEntry + */ + udf_name?: string; + /** + * Version of the UDF (optional) + * @type {string} + * @memberof AlterVirtualColumnEntry + */ + udf_version?: string; +} + +/** + * Check if a given object implements the AlterVirtualColumnEntry interface. + */ +export function instanceOfAlterVirtualColumnEntry(value: object): value is AlterVirtualColumnEntry { + return true; +} + +export function AlterVirtualColumnEntryFromJSON(json: any): AlterVirtualColumnEntry { + return AlterVirtualColumnEntryFromJSONTyped(json, false); +} + +export function AlterVirtualColumnEntryFromJSONTyped(json: any, ignoreDiscriminator: boolean): AlterVirtualColumnEntry { + if (json == null) { + return json; + } + return { + + 'input_columns': json['input_columns'] == null ? undefined : json['input_columns'], + 'image': json['image'] == null ? undefined : json['image'], + 'udf': json['udf'] == null ? undefined : json['udf'], + 'udf_name': json['udf_name'] == null ? undefined : json['udf_name'], + 'udf_version': json['udf_version'] == null ? undefined : json['udf_version'], + }; +} + +export function AlterVirtualColumnEntryToJSON(json: any): AlterVirtualColumnEntry { + return AlterVirtualColumnEntryToJSONTyped(json, false); +} + +export function AlterVirtualColumnEntryToJSONTyped(value?: AlterVirtualColumnEntry | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'input_columns': value['input_columns'], + 'image': value['image'], + 'udf': value['udf'], + 'udf_name': value['udf_name'], + 'udf_version': value['udf_version'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/AnalyzeTableQueryPlanRequest.ts b/typescript/lance-namespace-fetch-client/src/models/AnalyzeTableQueryPlanRequest.ts new file mode 100644 index 000000000..6ed748a1a --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/AnalyzeTableQueryPlanRequest.ts @@ -0,0 +1,263 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { QueryTableRequestFullTextQuery } from './QueryTableRequestFullTextQuery'; +import { + QueryTableRequestFullTextQueryFromJSON, + QueryTableRequestFullTextQueryFromJSONTyped, + QueryTableRequestFullTextQueryToJSON, + QueryTableRequestFullTextQueryToJSONTyped, +} from './QueryTableRequestFullTextQuery'; +import type { QueryTableRequestColumns } from './QueryTableRequestColumns'; +import { + QueryTableRequestColumnsFromJSON, + QueryTableRequestColumnsFromJSONTyped, + QueryTableRequestColumnsToJSON, + QueryTableRequestColumnsToJSONTyped, +} from './QueryTableRequestColumns'; +import type { Identity } from './Identity'; +import { + IdentityFromJSON, + IdentityFromJSONTyped, + IdentityToJSON, + IdentityToJSONTyped, +} from './Identity'; +import type { QueryTableRequestVector } from './QueryTableRequestVector'; +import { + QueryTableRequestVectorFromJSON, + QueryTableRequestVectorFromJSONTyped, + QueryTableRequestVectorToJSON, + QueryTableRequestVectorToJSONTyped, +} from './QueryTableRequestVector'; + +/** + * + * @export + * @interface AnalyzeTableQueryPlanRequest + */ +export interface AnalyzeTableQueryPlanRequest { + /** + * + * @type {Identity} + * @memberof AnalyzeTableQueryPlanRequest + */ + identity?: Identity; + /** + * Arbitrary context for a request as key-value pairs. + * How to use the context is custom to the specific implementation. + * + * REST NAMESPACE ONLY + * Context entries are passed via HTTP headers using the naming convention + * `x-lance-ctx-: `. For example, a context entry + * `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + * + * @type {{ [key: string]: string; }} + * @memberof AnalyzeTableQueryPlanRequest + */ + context?: { [key: string]: string; }; + /** + * + * @type {Array} + * @memberof AnalyzeTableQueryPlanRequest + */ + id?: Array; + /** + * Whether to bypass vector index + * @type {boolean} + * @memberof AnalyzeTableQueryPlanRequest + */ + bypass_vector_index?: boolean; + /** + * + * @type {QueryTableRequestColumns} + * @memberof AnalyzeTableQueryPlanRequest + */ + columns?: QueryTableRequestColumns; + /** + * Distance metric to use + * @type {string} + * @memberof AnalyzeTableQueryPlanRequest + */ + distance_type?: string; + /** + * Search effort parameter for HNSW index + * @type {number} + * @memberof AnalyzeTableQueryPlanRequest + */ + ef?: number; + /** + * Whether to use fast search + * @type {boolean} + * @memberof AnalyzeTableQueryPlanRequest + */ + fast_search?: boolean; + /** + * Optional SQL filter expression + * @type {string} + * @memberof AnalyzeTableQueryPlanRequest + */ + filter?: string; + /** + * + * @type {QueryTableRequestFullTextQuery} + * @memberof AnalyzeTableQueryPlanRequest + */ + full_text_query?: QueryTableRequestFullTextQuery; + /** + * Number of results to return + * @type {number} + * @memberof AnalyzeTableQueryPlanRequest + */ + k: number; + /** + * Lower bound for search + * @type {number} + * @memberof AnalyzeTableQueryPlanRequest + */ + lower_bound?: number; + /** + * Number of probes for IVF index + * @type {number} + * @memberof AnalyzeTableQueryPlanRequest + */ + nprobes?: number; + /** + * Number of results to skip + * @type {number} + * @memberof AnalyzeTableQueryPlanRequest + */ + offset?: number; + /** + * Whether to apply filtering before vector search + * @type {boolean} + * @memberof AnalyzeTableQueryPlanRequest + */ + prefilter?: boolean; + /** + * Refine factor for search + * @type {number} + * @memberof AnalyzeTableQueryPlanRequest + */ + refine_factor?: number; + /** + * Upper bound for search + * @type {number} + * @memberof AnalyzeTableQueryPlanRequest + */ + upper_bound?: number; + /** + * + * @type {QueryTableRequestVector} + * @memberof AnalyzeTableQueryPlanRequest + */ + vector: QueryTableRequestVector; + /** + * Name of the vector column to search + * @type {string} + * @memberof AnalyzeTableQueryPlanRequest + */ + vector_column?: string; + /** + * Table version to query + * @type {number} + * @memberof AnalyzeTableQueryPlanRequest + */ + version?: number; + /** + * If true, return the row id as a column called `_rowid` + * @type {boolean} + * @memberof AnalyzeTableQueryPlanRequest + */ + with_row_id?: boolean; +} + +/** + * Check if a given object implements the AnalyzeTableQueryPlanRequest interface. + */ +export function instanceOfAnalyzeTableQueryPlanRequest(value: object): value is AnalyzeTableQueryPlanRequest { + if (!('k' in value) || value['k'] === undefined) return false; + if (!('vector' in value) || value['vector'] === undefined) return false; + return true; +} + +export function AnalyzeTableQueryPlanRequestFromJSON(json: any): AnalyzeTableQueryPlanRequest { + return AnalyzeTableQueryPlanRequestFromJSONTyped(json, false); +} + +export function AnalyzeTableQueryPlanRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): AnalyzeTableQueryPlanRequest { + if (json == null) { + return json; + } + return { + + 'identity': json['identity'] == null ? undefined : IdentityFromJSON(json['identity']), + 'context': json['context'] == null ? undefined : json['context'], + 'id': json['id'] == null ? undefined : json['id'], + 'bypass_vector_index': json['bypass_vector_index'] == null ? undefined : json['bypass_vector_index'], + 'columns': json['columns'] == null ? undefined : QueryTableRequestColumnsFromJSON(json['columns']), + 'distance_type': json['distance_type'] == null ? undefined : json['distance_type'], + 'ef': json['ef'] == null ? undefined : json['ef'], + 'fast_search': json['fast_search'] == null ? undefined : json['fast_search'], + 'filter': json['filter'] == null ? undefined : json['filter'], + 'full_text_query': json['full_text_query'] == null ? undefined : QueryTableRequestFullTextQueryFromJSON(json['full_text_query']), + 'k': json['k'], + 'lower_bound': json['lower_bound'] == null ? undefined : json['lower_bound'], + 'nprobes': json['nprobes'] == null ? undefined : json['nprobes'], + 'offset': json['offset'] == null ? undefined : json['offset'], + 'prefilter': json['prefilter'] == null ? undefined : json['prefilter'], + 'refine_factor': json['refine_factor'] == null ? undefined : json['refine_factor'], + 'upper_bound': json['upper_bound'] == null ? undefined : json['upper_bound'], + 'vector': QueryTableRequestVectorFromJSON(json['vector']), + 'vector_column': json['vector_column'] == null ? undefined : json['vector_column'], + 'version': json['version'] == null ? undefined : json['version'], + 'with_row_id': json['with_row_id'] == null ? undefined : json['with_row_id'], + }; +} + +export function AnalyzeTableQueryPlanRequestToJSON(json: any): AnalyzeTableQueryPlanRequest { + return AnalyzeTableQueryPlanRequestToJSONTyped(json, false); +} + +export function AnalyzeTableQueryPlanRequestToJSONTyped(value?: AnalyzeTableQueryPlanRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'identity': IdentityToJSON(value['identity']), + 'context': value['context'], + 'id': value['id'], + 'bypass_vector_index': value['bypass_vector_index'], + 'columns': QueryTableRequestColumnsToJSON(value['columns']), + 'distance_type': value['distance_type'], + 'ef': value['ef'], + 'fast_search': value['fast_search'], + 'filter': value['filter'], + 'full_text_query': QueryTableRequestFullTextQueryToJSON(value['full_text_query']), + 'k': value['k'], + 'lower_bound': value['lower_bound'], + 'nprobes': value['nprobes'], + 'offset': value['offset'], + 'prefilter': value['prefilter'], + 'refine_factor': value['refine_factor'], + 'upper_bound': value['upper_bound'], + 'vector': QueryTableRequestVectorToJSON(value['vector']), + 'vector_column': value['vector_column'], + 'version': value['version'], + 'with_row_id': value['with_row_id'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/AnalyzeTableQueryPlanResponse.ts b/typescript/lance-namespace-fetch-client/src/models/AnalyzeTableQueryPlanResponse.ts new file mode 100644 index 000000000..7981adeed --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/AnalyzeTableQueryPlanResponse.ts @@ -0,0 +1,66 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface AnalyzeTableQueryPlanResponse + */ +export interface AnalyzeTableQueryPlanResponse { + /** + * Detailed analysis of the query execution plan + * @type {string} + * @memberof AnalyzeTableQueryPlanResponse + */ + analysis: string; +} + +/** + * Check if a given object implements the AnalyzeTableQueryPlanResponse interface. + */ +export function instanceOfAnalyzeTableQueryPlanResponse(value: object): value is AnalyzeTableQueryPlanResponse { + if (!('analysis' in value) || value['analysis'] === undefined) return false; + return true; +} + +export function AnalyzeTableQueryPlanResponseFromJSON(json: any): AnalyzeTableQueryPlanResponse { + return AnalyzeTableQueryPlanResponseFromJSONTyped(json, false); +} + +export function AnalyzeTableQueryPlanResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): AnalyzeTableQueryPlanResponse { + if (json == null) { + return json; + } + return { + + 'analysis': json['analysis'], + }; +} + +export function AnalyzeTableQueryPlanResponseToJSON(json: any): AnalyzeTableQueryPlanResponse { + return AnalyzeTableQueryPlanResponseToJSONTyped(json, false); +} + +export function AnalyzeTableQueryPlanResponseToJSONTyped(value?: AnalyzeTableQueryPlanResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'analysis': value['analysis'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/BatchCreateTableVersionsRequest.ts b/typescript/lance-namespace-fetch-client/src/models/BatchCreateTableVersionsRequest.ts new file mode 100644 index 000000000..f8981a06f --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/BatchCreateTableVersionsRequest.ts @@ -0,0 +1,106 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { CreateTableVersionEntry } from './CreateTableVersionEntry'; +import { + CreateTableVersionEntryFromJSON, + CreateTableVersionEntryFromJSONTyped, + CreateTableVersionEntryToJSON, + CreateTableVersionEntryToJSONTyped, +} from './CreateTableVersionEntry'; +import type { Identity } from './Identity'; +import { + IdentityFromJSON, + IdentityFromJSONTyped, + IdentityToJSON, + IdentityToJSONTyped, +} from './Identity'; + +/** + * Request to atomically create new version entries for multiple tables. + * The operation is atomic: all versions are created or none are. + * + * @export + * @interface BatchCreateTableVersionsRequest + */ +export interface BatchCreateTableVersionsRequest { + /** + * + * @type {Identity} + * @memberof BatchCreateTableVersionsRequest + */ + identity?: Identity; + /** + * Arbitrary context for a request as key-value pairs. + * How to use the context is custom to the specific implementation. + * + * REST NAMESPACE ONLY + * Context entries are passed via HTTP headers using the naming convention + * `x-lance-ctx-: `. For example, a context entry + * `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + * + * @type {{ [key: string]: string; }} + * @memberof BatchCreateTableVersionsRequest + */ + context?: { [key: string]: string; }; + /** + * List of table version entries to create atomically + * @type {Array} + * @memberof BatchCreateTableVersionsRequest + */ + entries: Array; +} + +/** + * Check if a given object implements the BatchCreateTableVersionsRequest interface. + */ +export function instanceOfBatchCreateTableVersionsRequest(value: object): value is BatchCreateTableVersionsRequest { + if (!('entries' in value) || value['entries'] === undefined) return false; + return true; +} + +export function BatchCreateTableVersionsRequestFromJSON(json: any): BatchCreateTableVersionsRequest { + return BatchCreateTableVersionsRequestFromJSONTyped(json, false); +} + +export function BatchCreateTableVersionsRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): BatchCreateTableVersionsRequest { + if (json == null) { + return json; + } + return { + + 'identity': json['identity'] == null ? undefined : IdentityFromJSON(json['identity']), + 'context': json['context'] == null ? undefined : json['context'], + 'entries': ((json['entries'] as Array).map(CreateTableVersionEntryFromJSON)), + }; +} + +export function BatchCreateTableVersionsRequestToJSON(json: any): BatchCreateTableVersionsRequest { + return BatchCreateTableVersionsRequestToJSONTyped(json, false); +} + +export function BatchCreateTableVersionsRequestToJSONTyped(value?: BatchCreateTableVersionsRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'identity': IdentityToJSON(value['identity']), + 'context': value['context'], + 'entries': ((value['entries'] as Array).map(CreateTableVersionEntryToJSON)), + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/BatchCreateTableVersionsResponse.ts b/typescript/lance-namespace-fetch-client/src/models/BatchCreateTableVersionsResponse.ts new file mode 100644 index 000000000..5dc189499 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/BatchCreateTableVersionsResponse.ts @@ -0,0 +1,84 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { TableVersion } from './TableVersion'; +import { + TableVersionFromJSON, + TableVersionFromJSONTyped, + TableVersionToJSON, + TableVersionToJSONTyped, +} from './TableVersion'; + +/** + * Response for batch creating table versions. + * Contains the created versions for each table in the same order as the request. + * + * @export + * @interface BatchCreateTableVersionsResponse + */ +export interface BatchCreateTableVersionsResponse { + /** + * Optional transaction identifier + * @type {string} + * @memberof BatchCreateTableVersionsResponse + */ + transaction_id?: string; + /** + * List of created table versions in the same order as the request entries + * @type {Array} + * @memberof BatchCreateTableVersionsResponse + */ + versions: Array; +} + +/** + * Check if a given object implements the BatchCreateTableVersionsResponse interface. + */ +export function instanceOfBatchCreateTableVersionsResponse(value: object): value is BatchCreateTableVersionsResponse { + if (!('versions' in value) || value['versions'] === undefined) return false; + return true; +} + +export function BatchCreateTableVersionsResponseFromJSON(json: any): BatchCreateTableVersionsResponse { + return BatchCreateTableVersionsResponseFromJSONTyped(json, false); +} + +export function BatchCreateTableVersionsResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): BatchCreateTableVersionsResponse { + if (json == null) { + return json; + } + return { + + 'transaction_id': json['transaction_id'] == null ? undefined : json['transaction_id'], + 'versions': ((json['versions'] as Array).map(TableVersionFromJSON)), + }; +} + +export function BatchCreateTableVersionsResponseToJSON(json: any): BatchCreateTableVersionsResponse { + return BatchCreateTableVersionsResponseToJSONTyped(json, false); +} + +export function BatchCreateTableVersionsResponseToJSONTyped(value?: BatchCreateTableVersionsResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'transaction_id': value['transaction_id'], + 'versions': ((value['versions'] as Array).map(TableVersionToJSON)), + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/BatchDeleteTableVersionsRequest.ts b/typescript/lance-namespace-fetch-client/src/models/BatchDeleteTableVersionsRequest.ts new file mode 100644 index 000000000..2f3654cb3 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/BatchDeleteTableVersionsRequest.ts @@ -0,0 +1,116 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { VersionRange } from './VersionRange'; +import { + VersionRangeFromJSON, + VersionRangeFromJSONTyped, + VersionRangeToJSON, + VersionRangeToJSONTyped, +} from './VersionRange'; +import type { Identity } from './Identity'; +import { + IdentityFromJSON, + IdentityFromJSONTyped, + IdentityToJSON, + IdentityToJSONTyped, +} from './Identity'; + +/** + * Request to delete table version records. + * Supports deleting ranges of versions for efficient bulk cleanup. + * + * @export + * @interface BatchDeleteTableVersionsRequest + */ +export interface BatchDeleteTableVersionsRequest { + /** + * + * @type {Identity} + * @memberof BatchDeleteTableVersionsRequest + */ + identity?: Identity; + /** + * Arbitrary context for a request as key-value pairs. + * How to use the context is custom to the specific implementation. + * + * REST NAMESPACE ONLY + * Context entries are passed via HTTP headers using the naming convention + * `x-lance-ctx-: `. For example, a context entry + * `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + * + * @type {{ [key: string]: string; }} + * @memberof BatchDeleteTableVersionsRequest + */ + context?: { [key: string]: string; }; + /** + * The table identifier + * @type {Array} + * @memberof BatchDeleteTableVersionsRequest + */ + id?: Array; + /** + * List of version ranges to delete. + * Each range specifies start (inclusive) and end (exclusive) versions. + * + * @type {Array} + * @memberof BatchDeleteTableVersionsRequest + */ + ranges: Array; +} + +/** + * Check if a given object implements the BatchDeleteTableVersionsRequest interface. + */ +export function instanceOfBatchDeleteTableVersionsRequest(value: object): value is BatchDeleteTableVersionsRequest { + if (!('ranges' in value) || value['ranges'] === undefined) return false; + return true; +} + +export function BatchDeleteTableVersionsRequestFromJSON(json: any): BatchDeleteTableVersionsRequest { + return BatchDeleteTableVersionsRequestFromJSONTyped(json, false); +} + +export function BatchDeleteTableVersionsRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): BatchDeleteTableVersionsRequest { + if (json == null) { + return json; + } + return { + + 'identity': json['identity'] == null ? undefined : IdentityFromJSON(json['identity']), + 'context': json['context'] == null ? undefined : json['context'], + 'id': json['id'] == null ? undefined : json['id'], + 'ranges': ((json['ranges'] as Array).map(VersionRangeFromJSON)), + }; +} + +export function BatchDeleteTableVersionsRequestToJSON(json: any): BatchDeleteTableVersionsRequest { + return BatchDeleteTableVersionsRequestToJSONTyped(json, false); +} + +export function BatchDeleteTableVersionsRequestToJSONTyped(value?: BatchDeleteTableVersionsRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'identity': IdentityToJSON(value['identity']), + 'context': value['context'], + 'id': value['id'], + 'ranges': ((value['ranges'] as Array).map(VersionRangeToJSON)), + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/BatchDeleteTableVersionsResponse.ts b/typescript/lance-namespace-fetch-client/src/models/BatchDeleteTableVersionsResponse.ts new file mode 100644 index 000000000..1895025a5 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/BatchDeleteTableVersionsResponse.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * Response for deleting table version records + * @export + * @interface BatchDeleteTableVersionsResponse + */ +export interface BatchDeleteTableVersionsResponse { + /** + * Number of version records deleted + * @type {number} + * @memberof BatchDeleteTableVersionsResponse + */ + deleted_count?: number; + /** + * Optional transaction identifier + * @type {string} + * @memberof BatchDeleteTableVersionsResponse + */ + transaction_id?: string; +} + +/** + * Check if a given object implements the BatchDeleteTableVersionsResponse interface. + */ +export function instanceOfBatchDeleteTableVersionsResponse(value: object): value is BatchDeleteTableVersionsResponse { + return true; +} + +export function BatchDeleteTableVersionsResponseFromJSON(json: any): BatchDeleteTableVersionsResponse { + return BatchDeleteTableVersionsResponseFromJSONTyped(json, false); +} + +export function BatchDeleteTableVersionsResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): BatchDeleteTableVersionsResponse { + if (json == null) { + return json; + } + return { + + 'deleted_count': json['deleted_count'] == null ? undefined : json['deleted_count'], + 'transaction_id': json['transaction_id'] == null ? undefined : json['transaction_id'], + }; +} + +export function BatchDeleteTableVersionsResponseToJSON(json: any): BatchDeleteTableVersionsResponse { + return BatchDeleteTableVersionsResponseToJSONTyped(json, false); +} + +export function BatchDeleteTableVersionsResponseToJSONTyped(value?: BatchDeleteTableVersionsResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'deleted_count': value['deleted_count'], + 'transaction_id': value['transaction_id'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/BooleanQuery.ts b/typescript/lance-namespace-fetch-client/src/models/BooleanQuery.ts new file mode 100644 index 000000000..e94f1dfc2 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/BooleanQuery.ts @@ -0,0 +1,92 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { FtsQuery } from './FtsQuery'; +import { + FtsQueryFromJSON, + FtsQueryFromJSONTyped, + FtsQueryToJSON, + FtsQueryToJSONTyped, +} from './FtsQuery'; + +/** + * Boolean query with must, should, and must_not clauses + * @export + * @interface BooleanQuery + */ +export interface BooleanQuery { + /** + * Queries that must match (AND) + * @type {Array} + * @memberof BooleanQuery + */ + must: Array; + /** + * Queries that must not match (NOT) + * @type {Array} + * @memberof BooleanQuery + */ + must_not: Array; + /** + * Queries that should match (OR) + * @type {Array} + * @memberof BooleanQuery + */ + should: Array; +} + +/** + * Check if a given object implements the BooleanQuery interface. + */ +export function instanceOfBooleanQuery(value: object): value is BooleanQuery { + if (!('must' in value) || value['must'] === undefined) return false; + if (!('must_not' in value) || value['must_not'] === undefined) return false; + if (!('should' in value) || value['should'] === undefined) return false; + return true; +} + +export function BooleanQueryFromJSON(json: any): BooleanQuery { + return BooleanQueryFromJSONTyped(json, false); +} + +export function BooleanQueryFromJSONTyped(json: any, ignoreDiscriminator: boolean): BooleanQuery { + if (json == null) { + return json; + } + return { + + 'must': ((json['must'] as Array).map(FtsQueryFromJSON)), + 'must_not': ((json['must_not'] as Array).map(FtsQueryFromJSON)), + 'should': ((json['should'] as Array).map(FtsQueryFromJSON)), + }; +} + +export function BooleanQueryToJSON(json: any): BooleanQuery { + return BooleanQueryToJSONTyped(json, false); +} + +export function BooleanQueryToJSONTyped(value?: BooleanQuery | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'must': ((value['must'] as Array).map(FtsQueryToJSON)), + 'must_not': ((value['must_not'] as Array).map(FtsQueryToJSON)), + 'should': ((value['should'] as Array).map(FtsQueryToJSON)), + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/BoostQuery.ts b/typescript/lance-namespace-fetch-client/src/models/BoostQuery.ts new file mode 100644 index 000000000..6a87450f7 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/BoostQuery.ts @@ -0,0 +1,91 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { FtsQuery } from './FtsQuery'; +import { + FtsQueryFromJSON, + FtsQueryFromJSONTyped, + FtsQueryToJSON, + FtsQueryToJSONTyped, +} from './FtsQuery'; + +/** + * Boost query that scores documents matching positive query higher and negative query lower + * @export + * @interface BoostQuery + */ +export interface BoostQuery { + /** + * + * @type {FtsQuery} + * @memberof BoostQuery + */ + positive: FtsQuery; + /** + * + * @type {FtsQuery} + * @memberof BoostQuery + */ + negative: FtsQuery; + /** + * Boost factor for negative query (default: 0.5) + * @type {number} + * @memberof BoostQuery + */ + negative_boost?: number; +} + +/** + * Check if a given object implements the BoostQuery interface. + */ +export function instanceOfBoostQuery(value: object): value is BoostQuery { + if (!('positive' in value) || value['positive'] === undefined) return false; + if (!('negative' in value) || value['negative'] === undefined) return false; + return true; +} + +export function BoostQueryFromJSON(json: any): BoostQuery { + return BoostQueryFromJSONTyped(json, false); +} + +export function BoostQueryFromJSONTyped(json: any, ignoreDiscriminator: boolean): BoostQuery { + if (json == null) { + return json; + } + return { + + 'positive': FtsQueryFromJSON(json['positive']), + 'negative': FtsQueryFromJSON(json['negative']), + 'negative_boost': json['negative_boost'] == null ? undefined : json['negative_boost'], + }; +} + +export function BoostQueryToJSON(json: any): BoostQuery { + return BoostQueryToJSONTyped(json, false); +} + +export function BoostQueryToJSONTyped(value?: BoostQuery | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'positive': FtsQueryToJSON(value['positive']), + 'negative': FtsQueryToJSON(value['negative']), + 'negative_boost': value['negative_boost'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/CountTableRowsRequest.ts b/typescript/lance-namespace-fetch-client/src/models/CountTableRowsRequest.ts new file mode 100644 index 000000000..f8d77b15b --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/CountTableRowsRequest.ts @@ -0,0 +1,115 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Identity } from './Identity'; +import { + IdentityFromJSON, + IdentityFromJSONTyped, + IdentityToJSON, + IdentityToJSONTyped, +} from './Identity'; + +/** + * + * @export + * @interface CountTableRowsRequest + */ +export interface CountTableRowsRequest { + /** + * + * @type {Identity} + * @memberof CountTableRowsRequest + */ + identity?: Identity; + /** + * Arbitrary context for a request as key-value pairs. + * How to use the context is custom to the specific implementation. + * + * REST NAMESPACE ONLY + * Context entries are passed via HTTP headers using the naming convention + * `x-lance-ctx-: `. For example, a context entry + * `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + * + * @type {{ [key: string]: string; }} + * @memberof CountTableRowsRequest + */ + context?: { [key: string]: string; }; + /** + * + * @type {Array} + * @memberof CountTableRowsRequest + */ + id?: Array; + /** + * Version of the table to describe. + * If not specified, server should resolve it to the latest version. + * + * @type {number} + * @memberof CountTableRowsRequest + */ + version?: number; + /** + * Optional SQL predicate to filter rows for counting + * + * @type {string} + * @memberof CountTableRowsRequest + */ + predicate?: string; +} + +/** + * Check if a given object implements the CountTableRowsRequest interface. + */ +export function instanceOfCountTableRowsRequest(value: object): value is CountTableRowsRequest { + return true; +} + +export function CountTableRowsRequestFromJSON(json: any): CountTableRowsRequest { + return CountTableRowsRequestFromJSONTyped(json, false); +} + +export function CountTableRowsRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CountTableRowsRequest { + if (json == null) { + return json; + } + return { + + 'identity': json['identity'] == null ? undefined : IdentityFromJSON(json['identity']), + 'context': json['context'] == null ? undefined : json['context'], + 'id': json['id'] == null ? undefined : json['id'], + 'version': json['version'] == null ? undefined : json['version'], + 'predicate': json['predicate'] == null ? undefined : json['predicate'], + }; +} + +export function CountTableRowsRequestToJSON(json: any): CountTableRowsRequest { + return CountTableRowsRequestToJSONTyped(json, false); +} + +export function CountTableRowsRequestToJSONTyped(value?: CountTableRowsRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'identity': IdentityToJSON(value['identity']), + 'context': value['context'], + 'id': value['id'], + 'version': value['version'], + 'predicate': value['predicate'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/CreateEmptyTableRequest.ts b/typescript/lance-namespace-fetch-client/src/models/CreateEmptyTableRequest.ts new file mode 100644 index 000000000..a2029b5e7 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/CreateEmptyTableRequest.ts @@ -0,0 +1,129 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Identity } from './Identity'; +import { + IdentityFromJSON, + IdentityFromJSONTyped, + IdentityToJSON, + IdentityToJSONTyped, +} from './Identity'; + +/** + * Request for creating an empty table. + * + * **Deprecated**: Use `DeclareTableRequest` instead. + * + * @export + * @interface CreateEmptyTableRequest + */ +export interface CreateEmptyTableRequest { + /** + * + * @type {Identity} + * @memberof CreateEmptyTableRequest + */ + identity?: Identity; + /** + * Arbitrary context for a request as key-value pairs. + * How to use the context is custom to the specific implementation. + * + * REST NAMESPACE ONLY + * Context entries are passed via HTTP headers using the naming convention + * `x-lance-ctx-: `. For example, a context entry + * `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + * + * @type {{ [key: string]: string; }} + * @memberof CreateEmptyTableRequest + */ + context?: { [key: string]: string; }; + /** + * + * @type {Array} + * @memberof CreateEmptyTableRequest + */ + id?: Array; + /** + * Optional storage location for the table. + * If not provided, the namespace implementation should determine the table location. + * + * @type {string} + * @memberof CreateEmptyTableRequest + */ + location?: string; + /** + * Whether to include vended credentials in the response `storage_options`. + * When true, the implementation should provide vended credentials for accessing storage. + * When not set, the implementation can decide whether to return vended credentials. + * + * @type {boolean} + * @memberof CreateEmptyTableRequest + */ + vend_credentials?: boolean; + /** + * Properties stored on the table, if supported by the server. + * + * @type {{ [key: string]: string; }} + * @memberof CreateEmptyTableRequest + */ + properties?: { [key: string]: string; }; +} + +/** + * Check if a given object implements the CreateEmptyTableRequest interface. + */ +export function instanceOfCreateEmptyTableRequest(value: object): value is CreateEmptyTableRequest { + return true; +} + +export function CreateEmptyTableRequestFromJSON(json: any): CreateEmptyTableRequest { + return CreateEmptyTableRequestFromJSONTyped(json, false); +} + +export function CreateEmptyTableRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateEmptyTableRequest { + if (json == null) { + return json; + } + return { + + 'identity': json['identity'] == null ? undefined : IdentityFromJSON(json['identity']), + 'context': json['context'] == null ? undefined : json['context'], + 'id': json['id'] == null ? undefined : json['id'], + 'location': json['location'] == null ? undefined : json['location'], + 'vend_credentials': json['vend_credentials'] == null ? undefined : json['vend_credentials'], + 'properties': json['properties'] == null ? undefined : json['properties'], + }; +} + +export function CreateEmptyTableRequestToJSON(json: any): CreateEmptyTableRequest { + return CreateEmptyTableRequestToJSONTyped(json, false); +} + +export function CreateEmptyTableRequestToJSONTyped(value?: CreateEmptyTableRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'identity': IdentityToJSON(value['identity']), + 'context': value['context'], + 'id': value['id'], + 'location': value['location'], + 'vend_credentials': value['vend_credentials'], + 'properties': value['properties'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/CreateEmptyTableResponse.ts b/typescript/lance-namespace-fetch-client/src/models/CreateEmptyTableResponse.ts new file mode 100644 index 000000000..0f2288012 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/CreateEmptyTableResponse.ts @@ -0,0 +1,96 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * Response for creating an empty table. + * + * **Deprecated**: Use `DeclareTableResponse` instead. + * + * @export + * @interface CreateEmptyTableResponse + */ +export interface CreateEmptyTableResponse { + /** + * Optional transaction identifier + * @type {string} + * @memberof CreateEmptyTableResponse + */ + transaction_id?: string; + /** + * + * @type {string} + * @memberof CreateEmptyTableResponse + */ + location?: string; + /** + * Configuration options to be used to access storage. The available + * options depend on the type of storage in use. These will be + * passed directly to Lance to initialize storage access. + * + * @type {{ [key: string]: string; }} + * @memberof CreateEmptyTableResponse + */ + storage_options?: { [key: string]: string; }; + /** + * If the implementation does not support table properties, it should return null for this field. Otherwise it should return the properties. + * + * @type {{ [key: string]: string; }} + * @memberof CreateEmptyTableResponse + */ + properties?: { [key: string]: string; }; +} + +/** + * Check if a given object implements the CreateEmptyTableResponse interface. + */ +export function instanceOfCreateEmptyTableResponse(value: object): value is CreateEmptyTableResponse { + return true; +} + +export function CreateEmptyTableResponseFromJSON(json: any): CreateEmptyTableResponse { + return CreateEmptyTableResponseFromJSONTyped(json, false); +} + +export function CreateEmptyTableResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateEmptyTableResponse { + if (json == null) { + return json; + } + return { + + 'transaction_id': json['transaction_id'] == null ? undefined : json['transaction_id'], + 'location': json['location'] == null ? undefined : json['location'], + 'storage_options': json['storage_options'] == null ? undefined : json['storage_options'], + 'properties': json['properties'] == null ? undefined : json['properties'], + }; +} + +export function CreateEmptyTableResponseToJSON(json: any): CreateEmptyTableResponse { + return CreateEmptyTableResponseToJSONTyped(json, false); +} + +export function CreateEmptyTableResponseToJSONTyped(value?: CreateEmptyTableResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'transaction_id': value['transaction_id'], + 'location': value['location'], + 'storage_options': value['storage_options'], + 'properties': value['properties'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/CreateNamespaceRequest.ts b/typescript/lance-namespace-fetch-client/src/models/CreateNamespaceRequest.ts new file mode 100644 index 000000000..e1114118e --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/CreateNamespaceRequest.ts @@ -0,0 +1,119 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Identity } from './Identity'; +import { + IdentityFromJSON, + IdentityFromJSONTyped, + IdentityToJSON, + IdentityToJSONTyped, +} from './Identity'; + +/** + * + * @export + * @interface CreateNamespaceRequest + */ +export interface CreateNamespaceRequest { + /** + * + * @type {Identity} + * @memberof CreateNamespaceRequest + */ + identity?: Identity; + /** + * Arbitrary context for a request as key-value pairs. + * How to use the context is custom to the specific implementation. + * + * REST NAMESPACE ONLY + * Context entries are passed via HTTP headers using the naming convention + * `x-lance-ctx-: `. For example, a context entry + * `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + * + * @type {{ [key: string]: string; }} + * @memberof CreateNamespaceRequest + */ + context?: { [key: string]: string; }; + /** + * + * @type {Array} + * @memberof CreateNamespaceRequest + */ + id?: Array; + /** + * There are three modes when trying to create a namespace, + * to differentiate the behavior when a namespace of the same name already exists. + * Case insensitive, supports both PascalCase and snake_case. Valid values are: + * * Create: the operation fails with 409. + * * ExistOk: the operation succeeds and the existing namespace is kept. + * * Overwrite: the existing namespace is dropped and a new empty namespace with this name is created. + * + * @type {string} + * @memberof CreateNamespaceRequest + */ + mode?: string; + /** + * Properties stored on the namespace, if supported by the implementation. + * + * @type {{ [key: string]: string; }} + * @memberof CreateNamespaceRequest + */ + properties?: { [key: string]: string; }; +} + +/** + * Check if a given object implements the CreateNamespaceRequest interface. + */ +export function instanceOfCreateNamespaceRequest(value: object): value is CreateNamespaceRequest { + return true; +} + +export function CreateNamespaceRequestFromJSON(json: any): CreateNamespaceRequest { + return CreateNamespaceRequestFromJSONTyped(json, false); +} + +export function CreateNamespaceRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateNamespaceRequest { + if (json == null) { + return json; + } + return { + + 'identity': json['identity'] == null ? undefined : IdentityFromJSON(json['identity']), + 'context': json['context'] == null ? undefined : json['context'], + 'id': json['id'] == null ? undefined : json['id'], + 'mode': json['mode'] == null ? undefined : json['mode'], + 'properties': json['properties'] == null ? undefined : json['properties'], + }; +} + +export function CreateNamespaceRequestToJSON(json: any): CreateNamespaceRequest { + return CreateNamespaceRequestToJSONTyped(json, false); +} + +export function CreateNamespaceRequestToJSONTyped(value?: CreateNamespaceRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'identity': IdentityToJSON(value['identity']), + 'context': value['context'], + 'id': value['id'], + 'mode': value['mode'], + 'properties': value['properties'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/CreateNamespaceResponse.ts b/typescript/lance-namespace-fetch-client/src/models/CreateNamespaceResponse.ts new file mode 100644 index 000000000..2da365da9 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/CreateNamespaceResponse.ts @@ -0,0 +1,77 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface CreateNamespaceResponse + */ +export interface CreateNamespaceResponse { + /** + * Optional transaction identifier + * @type {string} + * @memberof CreateNamespaceResponse + */ + transaction_id?: string; + /** + * Properties after the namespace is created. + * + * If the server does not support namespace properties, it should return null for this field. + * If namespace properties are supported, but none are set, it should return an empty object. + * + * @type {{ [key: string]: string; }} + * @memberof CreateNamespaceResponse + */ + properties?: { [key: string]: string; }; +} + +/** + * Check if a given object implements the CreateNamespaceResponse interface. + */ +export function instanceOfCreateNamespaceResponse(value: object): value is CreateNamespaceResponse { + return true; +} + +export function CreateNamespaceResponseFromJSON(json: any): CreateNamespaceResponse { + return CreateNamespaceResponseFromJSONTyped(json, false); +} + +export function CreateNamespaceResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateNamespaceResponse { + if (json == null) { + return json; + } + return { + + 'transaction_id': json['transaction_id'] == null ? undefined : json['transaction_id'], + 'properties': json['properties'] == null ? undefined : json['properties'], + }; +} + +export function CreateNamespaceResponseToJSON(json: any): CreateNamespaceResponse { + return CreateNamespaceResponseToJSONTyped(json, false); +} + +export function CreateNamespaceResponseToJSONTyped(value?: CreateNamespaceResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'transaction_id': value['transaction_id'], + 'properties': value['properties'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/CreateTableIndexRequest.ts b/typescript/lance-namespace-fetch-client/src/models/CreateTableIndexRequest.ts new file mode 100644 index 000000000..00056f953 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/CreateTableIndexRequest.ts @@ -0,0 +1,194 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Identity } from './Identity'; +import { + IdentityFromJSON, + IdentityFromJSONTyped, + IdentityToJSON, + IdentityToJSONTyped, +} from './Identity'; + +/** + * + * @export + * @interface CreateTableIndexRequest + */ +export interface CreateTableIndexRequest { + /** + * + * @type {Identity} + * @memberof CreateTableIndexRequest + */ + identity?: Identity; + /** + * Arbitrary context for a request as key-value pairs. + * How to use the context is custom to the specific implementation. + * + * REST NAMESPACE ONLY + * Context entries are passed via HTTP headers using the naming convention + * `x-lance-ctx-: `. For example, a context entry + * `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + * + * @type {{ [key: string]: string; }} + * @memberof CreateTableIndexRequest + */ + context?: { [key: string]: string; }; + /** + * + * @type {Array} + * @memberof CreateTableIndexRequest + */ + id?: Array; + /** + * Name of the column to create index on + * @type {string} + * @memberof CreateTableIndexRequest + */ + column: string; + /** + * Type of index to create (e.g., BTREE, BITMAP, LABEL_LIST, IVF_FLAT, IVF_PQ, IVF_HNSW_SQ, FTS) + * @type {string} + * @memberof CreateTableIndexRequest + */ + index_type: string; + /** + * Optional name for the index. If not provided, a name will be auto-generated. + * @type {string} + * @memberof CreateTableIndexRequest + */ + name?: string; + /** + * Distance metric type for vector indexes (e.g., l2, cosine, dot) + * @type {string} + * @memberof CreateTableIndexRequest + */ + distance_type?: string; + /** + * Optional FTS parameter for position tracking + * @type {boolean} + * @memberof CreateTableIndexRequest + */ + with_position?: boolean; + /** + * Optional FTS parameter for base tokenizer + * @type {string} + * @memberof CreateTableIndexRequest + */ + base_tokenizer?: string; + /** + * Optional FTS parameter for language + * @type {string} + * @memberof CreateTableIndexRequest + */ + language?: string; + /** + * Optional FTS parameter for maximum token length + * @type {number} + * @memberof CreateTableIndexRequest + */ + max_token_length?: number; + /** + * Optional FTS parameter for lowercase conversion + * @type {boolean} + * @memberof CreateTableIndexRequest + */ + lower_case?: boolean; + /** + * Optional FTS parameter for stemming + * @type {boolean} + * @memberof CreateTableIndexRequest + */ + stem?: boolean; + /** + * Optional FTS parameter for stop word removal + * @type {boolean} + * @memberof CreateTableIndexRequest + */ + remove_stop_words?: boolean; + /** + * Optional FTS parameter for ASCII folding + * @type {boolean} + * @memberof CreateTableIndexRequest + */ + ascii_folding?: boolean; +} + +/** + * Check if a given object implements the CreateTableIndexRequest interface. + */ +export function instanceOfCreateTableIndexRequest(value: object): value is CreateTableIndexRequest { + if (!('column' in value) || value['column'] === undefined) return false; + if (!('index_type' in value) || value['index_type'] === undefined) return false; + return true; +} + +export function CreateTableIndexRequestFromJSON(json: any): CreateTableIndexRequest { + return CreateTableIndexRequestFromJSONTyped(json, false); +} + +export function CreateTableIndexRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateTableIndexRequest { + if (json == null) { + return json; + } + return { + + 'identity': json['identity'] == null ? undefined : IdentityFromJSON(json['identity']), + 'context': json['context'] == null ? undefined : json['context'], + 'id': json['id'] == null ? undefined : json['id'], + 'column': json['column'], + 'index_type': json['index_type'], + 'name': json['name'] == null ? undefined : json['name'], + 'distance_type': json['distance_type'] == null ? undefined : json['distance_type'], + 'with_position': json['with_position'] == null ? undefined : json['with_position'], + 'base_tokenizer': json['base_tokenizer'] == null ? undefined : json['base_tokenizer'], + 'language': json['language'] == null ? undefined : json['language'], + 'max_token_length': json['max_token_length'] == null ? undefined : json['max_token_length'], + 'lower_case': json['lower_case'] == null ? undefined : json['lower_case'], + 'stem': json['stem'] == null ? undefined : json['stem'], + 'remove_stop_words': json['remove_stop_words'] == null ? undefined : json['remove_stop_words'], + 'ascii_folding': json['ascii_folding'] == null ? undefined : json['ascii_folding'], + }; +} + +export function CreateTableIndexRequestToJSON(json: any): CreateTableIndexRequest { + return CreateTableIndexRequestToJSONTyped(json, false); +} + +export function CreateTableIndexRequestToJSONTyped(value?: CreateTableIndexRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'identity': IdentityToJSON(value['identity']), + 'context': value['context'], + 'id': value['id'], + 'column': value['column'], + 'index_type': value['index_type'], + 'name': value['name'], + 'distance_type': value['distance_type'], + 'with_position': value['with_position'], + 'base_tokenizer': value['base_tokenizer'], + 'language': value['language'], + 'max_token_length': value['max_token_length'], + 'lower_case': value['lower_case'], + 'stem': value['stem'], + 'remove_stop_words': value['remove_stop_words'], + 'ascii_folding': value['ascii_folding'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/CreateTableIndexResponse.ts b/typescript/lance-namespace-fetch-client/src/models/CreateTableIndexResponse.ts new file mode 100644 index 000000000..2af2c8b57 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/CreateTableIndexResponse.ts @@ -0,0 +1,65 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * Response for create index operation + * @export + * @interface CreateTableIndexResponse + */ +export interface CreateTableIndexResponse { + /** + * Optional transaction identifier + * @type {string} + * @memberof CreateTableIndexResponse + */ + transaction_id?: string; +} + +/** + * Check if a given object implements the CreateTableIndexResponse interface. + */ +export function instanceOfCreateTableIndexResponse(value: object): value is CreateTableIndexResponse { + return true; +} + +export function CreateTableIndexResponseFromJSON(json: any): CreateTableIndexResponse { + return CreateTableIndexResponseFromJSONTyped(json, false); +} + +export function CreateTableIndexResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateTableIndexResponse { + if (json == null) { + return json; + } + return { + + 'transaction_id': json['transaction_id'] == null ? undefined : json['transaction_id'], + }; +} + +export function CreateTableIndexResponseToJSON(json: any): CreateTableIndexResponse { + return CreateTableIndexResponseToJSONTyped(json, false); +} + +export function CreateTableIndexResponseToJSONTyped(value?: CreateTableIndexResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'transaction_id': value['transaction_id'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/CreateTableRequest.ts b/typescript/lance-namespace-fetch-client/src/models/CreateTableRequest.ts new file mode 100644 index 000000000..2cea6f7b5 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/CreateTableRequest.ts @@ -0,0 +1,120 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Identity } from './Identity'; +import { + IdentityFromJSON, + IdentityFromJSONTyped, + IdentityToJSON, + IdentityToJSONTyped, +} from './Identity'; + +/** + * Request for creating a table, excluding the Arrow IPC stream. + * + * @export + * @interface CreateTableRequest + */ +export interface CreateTableRequest { + /** + * + * @type {Identity} + * @memberof CreateTableRequest + */ + identity?: Identity; + /** + * Arbitrary context for a request as key-value pairs. + * How to use the context is custom to the specific implementation. + * + * REST NAMESPACE ONLY + * Context entries are passed via HTTP headers using the naming convention + * `x-lance-ctx-: `. For example, a context entry + * `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + * + * @type {{ [key: string]: string; }} + * @memberof CreateTableRequest + */ + context?: { [key: string]: string; }; + /** + * + * @type {Array} + * @memberof CreateTableRequest + */ + id?: Array; + /** + * There are three modes when trying to create a table, + * to differentiate the behavior when a table of the same name already exists. + * Case insensitive, supports both PascalCase and snake_case. Valid values are: + * * Create: the operation fails with 409. + * * ExistOk: the operation succeeds and the existing table is kept. + * * Overwrite: the existing table is dropped and a new table with this name is created. + * + * @type {string} + * @memberof CreateTableRequest + */ + mode?: string; + /** + * Properties stored on the table, if supported by the implementation. + * + * @type {{ [key: string]: string; }} + * @memberof CreateTableRequest + */ + properties?: { [key: string]: string; }; +} + +/** + * Check if a given object implements the CreateTableRequest interface. + */ +export function instanceOfCreateTableRequest(value: object): value is CreateTableRequest { + return true; +} + +export function CreateTableRequestFromJSON(json: any): CreateTableRequest { + return CreateTableRequestFromJSONTyped(json, false); +} + +export function CreateTableRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateTableRequest { + if (json == null) { + return json; + } + return { + + 'identity': json['identity'] == null ? undefined : IdentityFromJSON(json['identity']), + 'context': json['context'] == null ? undefined : json['context'], + 'id': json['id'] == null ? undefined : json['id'], + 'mode': json['mode'] == null ? undefined : json['mode'], + 'properties': json['properties'] == null ? undefined : json['properties'], + }; +} + +export function CreateTableRequestToJSON(json: any): CreateTableRequest { + return CreateTableRequestToJSONTyped(json, false); +} + +export function CreateTableRequestToJSONTyped(value?: CreateTableRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'identity': IdentityToJSON(value['identity']), + 'context': value['context'], + 'id': value['id'], + 'mode': value['mode'], + 'properties': value['properties'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/CreateTableResponse.ts b/typescript/lance-namespace-fetch-client/src/models/CreateTableResponse.ts new file mode 100644 index 000000000..6bf4ed447 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/CreateTableResponse.ts @@ -0,0 +1,101 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface CreateTableResponse + */ +export interface CreateTableResponse { + /** + * Optional transaction identifier + * @type {string} + * @memberof CreateTableResponse + */ + transaction_id?: string; + /** + * + * @type {string} + * @memberof CreateTableResponse + */ + location?: string; + /** + * + * @type {number} + * @memberof CreateTableResponse + */ + version?: number; + /** + * Configuration options to be used to access storage. The available + * options depend on the type of storage in use. These will be + * passed directly to Lance to initialize storage access. + * + * @type {{ [key: string]: string; }} + * @memberof CreateTableResponse + */ + storage_options?: { [key: string]: string; }; + /** + * If the implementation does not support table properties, it should return null for this field. Otherwise it should return the properties. + * + * @type {{ [key: string]: string; }} + * @memberof CreateTableResponse + */ + properties?: { [key: string]: string; }; +} + +/** + * Check if a given object implements the CreateTableResponse interface. + */ +export function instanceOfCreateTableResponse(value: object): value is CreateTableResponse { + return true; +} + +export function CreateTableResponseFromJSON(json: any): CreateTableResponse { + return CreateTableResponseFromJSONTyped(json, false); +} + +export function CreateTableResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateTableResponse { + if (json == null) { + return json; + } + return { + + 'transaction_id': json['transaction_id'] == null ? undefined : json['transaction_id'], + 'location': json['location'] == null ? undefined : json['location'], + 'version': json['version'] == null ? undefined : json['version'], + 'storage_options': json['storage_options'] == null ? undefined : json['storage_options'], + 'properties': json['properties'] == null ? undefined : json['properties'], + }; +} + +export function CreateTableResponseToJSON(json: any): CreateTableResponse { + return CreateTableResponseToJSONTyped(json, false); +} + +export function CreateTableResponseToJSONTyped(value?: CreateTableResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'transaction_id': value['transaction_id'], + 'location': value['location'], + 'version': value['version'], + 'storage_options': value['storage_options'], + 'properties': value['properties'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/CreateTableScalarIndexResponse.ts b/typescript/lance-namespace-fetch-client/src/models/CreateTableScalarIndexResponse.ts new file mode 100644 index 000000000..7ebaf849a --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/CreateTableScalarIndexResponse.ts @@ -0,0 +1,65 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * Response for create scalar index operation + * @export + * @interface CreateTableScalarIndexResponse + */ +export interface CreateTableScalarIndexResponse { + /** + * Optional transaction identifier + * @type {string} + * @memberof CreateTableScalarIndexResponse + */ + transaction_id?: string; +} + +/** + * Check if a given object implements the CreateTableScalarIndexResponse interface. + */ +export function instanceOfCreateTableScalarIndexResponse(value: object): value is CreateTableScalarIndexResponse { + return true; +} + +export function CreateTableScalarIndexResponseFromJSON(json: any): CreateTableScalarIndexResponse { + return CreateTableScalarIndexResponseFromJSONTyped(json, false); +} + +export function CreateTableScalarIndexResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateTableScalarIndexResponse { + if (json == null) { + return json; + } + return { + + 'transaction_id': json['transaction_id'] == null ? undefined : json['transaction_id'], + }; +} + +export function CreateTableScalarIndexResponseToJSON(json: any): CreateTableScalarIndexResponse { + return CreateTableScalarIndexResponseToJSONTyped(json, false); +} + +export function CreateTableScalarIndexResponseToJSONTyped(value?: CreateTableScalarIndexResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'transaction_id': value['transaction_id'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/CreateTableTagRequest.ts b/typescript/lance-namespace-fetch-client/src/models/CreateTableTagRequest.ts new file mode 100644 index 000000000..0b6a30298 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/CreateTableTagRequest.ts @@ -0,0 +1,114 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Identity } from './Identity'; +import { + IdentityFromJSON, + IdentityFromJSONTyped, + IdentityToJSON, + IdentityToJSONTyped, +} from './Identity'; + +/** + * + * @export + * @interface CreateTableTagRequest + */ +export interface CreateTableTagRequest { + /** + * + * @type {Identity} + * @memberof CreateTableTagRequest + */ + identity?: Identity; + /** + * Arbitrary context for a request as key-value pairs. + * How to use the context is custom to the specific implementation. + * + * REST NAMESPACE ONLY + * Context entries are passed via HTTP headers using the naming convention + * `x-lance-ctx-: `. For example, a context entry + * `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + * + * @type {{ [key: string]: string; }} + * @memberof CreateTableTagRequest + */ + context?: { [key: string]: string; }; + /** + * + * @type {Array} + * @memberof CreateTableTagRequest + */ + id?: Array; + /** + * Name of the tag to create + * @type {string} + * @memberof CreateTableTagRequest + */ + tag: string; + /** + * Version number for the tag to point to + * @type {number} + * @memberof CreateTableTagRequest + */ + version: number; +} + +/** + * Check if a given object implements the CreateTableTagRequest interface. + */ +export function instanceOfCreateTableTagRequest(value: object): value is CreateTableTagRequest { + if (!('tag' in value) || value['tag'] === undefined) return false; + if (!('version' in value) || value['version'] === undefined) return false; + return true; +} + +export function CreateTableTagRequestFromJSON(json: any): CreateTableTagRequest { + return CreateTableTagRequestFromJSONTyped(json, false); +} + +export function CreateTableTagRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateTableTagRequest { + if (json == null) { + return json; + } + return { + + 'identity': json['identity'] == null ? undefined : IdentityFromJSON(json['identity']), + 'context': json['context'] == null ? undefined : json['context'], + 'id': json['id'] == null ? undefined : json['id'], + 'tag': json['tag'], + 'version': json['version'], + }; +} + +export function CreateTableTagRequestToJSON(json: any): CreateTableTagRequest { + return CreateTableTagRequestToJSONTyped(json, false); +} + +export function CreateTableTagRequestToJSONTyped(value?: CreateTableTagRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'identity': IdentityToJSON(value['identity']), + 'context': value['context'], + 'id': value['id'], + 'tag': value['tag'], + 'version': value['version'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/CreateTableTagResponse.ts b/typescript/lance-namespace-fetch-client/src/models/CreateTableTagResponse.ts new file mode 100644 index 000000000..867750268 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/CreateTableTagResponse.ts @@ -0,0 +1,65 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * Response for create tag operation + * @export + * @interface CreateTableTagResponse + */ +export interface CreateTableTagResponse { + /** + * Optional transaction identifier + * @type {string} + * @memberof CreateTableTagResponse + */ + transaction_id?: string; +} + +/** + * Check if a given object implements the CreateTableTagResponse interface. + */ +export function instanceOfCreateTableTagResponse(value: object): value is CreateTableTagResponse { + return true; +} + +export function CreateTableTagResponseFromJSON(json: any): CreateTableTagResponse { + return CreateTableTagResponseFromJSONTyped(json, false); +} + +export function CreateTableTagResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateTableTagResponse { + if (json == null) { + return json; + } + return { + + 'transaction_id': json['transaction_id'] == null ? undefined : json['transaction_id'], + }; +} + +export function CreateTableTagResponseToJSON(json: any): CreateTableTagResponse { + return CreateTableTagResponseToJSONTyped(json, false); +} + +export function CreateTableTagResponseToJSONTyped(value?: CreateTableTagResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'transaction_id': value['transaction_id'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/CreateTableVersionEntry.ts b/typescript/lance-namespace-fetch-client/src/models/CreateTableVersionEntry.ts new file mode 100644 index 000000000..4ac5496b6 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/CreateTableVersionEntry.ts @@ -0,0 +1,128 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * An entry for creating a new table version in a batch operation. + * This supports `put_if_not_exists` semantics, + * where the operation fails if the version already exists. + * + * @export + * @interface CreateTableVersionEntry + */ +export interface CreateTableVersionEntry { + /** + * The table identifier + * @type {Array} + * @memberof CreateTableVersionEntry + */ + id: Array; + /** + * Version number to create + * @type {number} + * @memberof CreateTableVersionEntry + */ + version: number; + /** + * Path to the manifest file for this version + * @type {string} + * @memberof CreateTableVersionEntry + */ + manifest_path: string; + /** + * Size of the manifest file in bytes + * @type {number} + * @memberof CreateTableVersionEntry + */ + manifest_size?: number; + /** + * Optional ETag for the manifest file + * @type {string} + * @memberof CreateTableVersionEntry + */ + e_tag?: string; + /** + * Optional metadata for the version + * @type {{ [key: string]: string; }} + * @memberof CreateTableVersionEntry + */ + metadata?: { [key: string]: string; }; + /** + * The naming scheme used for manifest files in the `_versions/` directory. + * + * Known values: + * - `V1`: `_versions/{version}.manifest` - Simple version-based naming + * - `V2`: `_versions/{inverted_version}.manifest` - Zero-padded, reversed version number + * (uses `u64::MAX - version`) for O(1) lookup of latest version on object stores + * + * V2 is preferred for new tables as it enables efficient latest-version discovery + * without needing to list all versions. + * + * @type {string} + * @memberof CreateTableVersionEntry + */ + naming_scheme?: string; +} + +/** + * Check if a given object implements the CreateTableVersionEntry interface. + */ +export function instanceOfCreateTableVersionEntry(value: object): value is CreateTableVersionEntry { + if (!('id' in value) || value['id'] === undefined) return false; + if (!('version' in value) || value['version'] === undefined) return false; + if (!('manifest_path' in value) || value['manifest_path'] === undefined) return false; + return true; +} + +export function CreateTableVersionEntryFromJSON(json: any): CreateTableVersionEntry { + return CreateTableVersionEntryFromJSONTyped(json, false); +} + +export function CreateTableVersionEntryFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateTableVersionEntry { + if (json == null) { + return json; + } + return { + + 'id': json['id'], + 'version': json['version'], + 'manifest_path': json['manifest_path'], + 'manifest_size': json['manifest_size'] == null ? undefined : json['manifest_size'], + 'e_tag': json['e_tag'] == null ? undefined : json['e_tag'], + 'metadata': json['metadata'] == null ? undefined : json['metadata'], + 'naming_scheme': json['naming_scheme'] == null ? undefined : json['naming_scheme'], + }; +} + +export function CreateTableVersionEntryToJSON(json: any): CreateTableVersionEntry { + return CreateTableVersionEntryToJSONTyped(json, false); +} + +export function CreateTableVersionEntryToJSONTyped(value?: CreateTableVersionEntry | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'version': value['version'], + 'manifest_path': value['manifest_path'], + 'manifest_size': value['manifest_size'], + 'e_tag': value['e_tag'], + 'metadata': value['metadata'], + 'naming_scheme': value['naming_scheme'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/CreateTableVersionRequest.ts b/typescript/lance-namespace-fetch-client/src/models/CreateTableVersionRequest.ts new file mode 100644 index 000000000..2306835ec --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/CreateTableVersionRequest.ts @@ -0,0 +1,158 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Identity } from './Identity'; +import { + IdentityFromJSON, + IdentityFromJSONTyped, + IdentityToJSON, + IdentityToJSONTyped, +} from './Identity'; + +/** + * Request to create a new table version entry. + * This supports `put_if_not_exists` semantics, + * where the operation fails if the version already exists. + * + * @export + * @interface CreateTableVersionRequest + */ +export interface CreateTableVersionRequest { + /** + * + * @type {Identity} + * @memberof CreateTableVersionRequest + */ + identity?: Identity; + /** + * Arbitrary context for a request as key-value pairs. + * How to use the context is custom to the specific implementation. + * + * REST NAMESPACE ONLY + * Context entries are passed via HTTP headers using the naming convention + * `x-lance-ctx-: `. For example, a context entry + * `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + * + * @type {{ [key: string]: string; }} + * @memberof CreateTableVersionRequest + */ + context?: { [key: string]: string; }; + /** + * The table identifier + * @type {Array} + * @memberof CreateTableVersionRequest + */ + id?: Array; + /** + * Version number to create + * @type {number} + * @memberof CreateTableVersionRequest + */ + version: number; + /** + * Path to the manifest file for this version + * @type {string} + * @memberof CreateTableVersionRequest + */ + manifest_path: string; + /** + * Size of the manifest file in bytes + * @type {number} + * @memberof CreateTableVersionRequest + */ + manifest_size?: number; + /** + * Optional ETag for the manifest file + * @type {string} + * @memberof CreateTableVersionRequest + */ + e_tag?: string; + /** + * Optional metadata for the version + * @type {{ [key: string]: string; }} + * @memberof CreateTableVersionRequest + */ + metadata?: { [key: string]: string; }; + /** + * The naming scheme used for manifest files in the `_versions/` directory. + * + * Known values: + * - `V1`: `_versions/{version}.manifest` - Simple version-based naming + * - `V2`: `_versions/{inverted_version}.manifest` - Zero-padded, reversed version number + * (uses `u64::MAX - version`) for O(1) lookup of latest version on object stores + * + * V2 is preferred for new tables as it enables efficient latest-version discovery + * without needing to list all versions. + * + * @type {string} + * @memberof CreateTableVersionRequest + */ + naming_scheme?: string; +} + +/** + * Check if a given object implements the CreateTableVersionRequest interface. + */ +export function instanceOfCreateTableVersionRequest(value: object): value is CreateTableVersionRequest { + if (!('version' in value) || value['version'] === undefined) return false; + if (!('manifest_path' in value) || value['manifest_path'] === undefined) return false; + return true; +} + +export function CreateTableVersionRequestFromJSON(json: any): CreateTableVersionRequest { + return CreateTableVersionRequestFromJSONTyped(json, false); +} + +export function CreateTableVersionRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateTableVersionRequest { + if (json == null) { + return json; + } + return { + + 'identity': json['identity'] == null ? undefined : IdentityFromJSON(json['identity']), + 'context': json['context'] == null ? undefined : json['context'], + 'id': json['id'] == null ? undefined : json['id'], + 'version': json['version'], + 'manifest_path': json['manifest_path'], + 'manifest_size': json['manifest_size'] == null ? undefined : json['manifest_size'], + 'e_tag': json['e_tag'] == null ? undefined : json['e_tag'], + 'metadata': json['metadata'] == null ? undefined : json['metadata'], + 'naming_scheme': json['naming_scheme'] == null ? undefined : json['naming_scheme'], + }; +} + +export function CreateTableVersionRequestToJSON(json: any): CreateTableVersionRequest { + return CreateTableVersionRequestToJSONTyped(json, false); +} + +export function CreateTableVersionRequestToJSONTyped(value?: CreateTableVersionRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'identity': IdentityToJSON(value['identity']), + 'context': value['context'], + 'id': value['id'], + 'version': value['version'], + 'manifest_path': value['manifest_path'], + 'manifest_size': value['manifest_size'], + 'e_tag': value['e_tag'], + 'metadata': value['metadata'], + 'naming_scheme': value['naming_scheme'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/CreateTableVersionResponse.ts b/typescript/lance-namespace-fetch-client/src/models/CreateTableVersionResponse.ts new file mode 100644 index 000000000..c3ba42dd9 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/CreateTableVersionResponse.ts @@ -0,0 +1,81 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { TableVersion } from './TableVersion'; +import { + TableVersionFromJSON, + TableVersionFromJSONTyped, + TableVersionToJSON, + TableVersionToJSONTyped, +} from './TableVersion'; + +/** + * Response for creating a table version + * @export + * @interface CreateTableVersionResponse + */ +export interface CreateTableVersionResponse { + /** + * Optional transaction identifier + * @type {string} + * @memberof CreateTableVersionResponse + */ + transaction_id?: string; + /** + * + * @type {TableVersion} + * @memberof CreateTableVersionResponse + */ + version?: TableVersion; +} + +/** + * Check if a given object implements the CreateTableVersionResponse interface. + */ +export function instanceOfCreateTableVersionResponse(value: object): value is CreateTableVersionResponse { + return true; +} + +export function CreateTableVersionResponseFromJSON(json: any): CreateTableVersionResponse { + return CreateTableVersionResponseFromJSONTyped(json, false); +} + +export function CreateTableVersionResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateTableVersionResponse { + if (json == null) { + return json; + } + return { + + 'transaction_id': json['transaction_id'] == null ? undefined : json['transaction_id'], + 'version': json['version'] == null ? undefined : TableVersionFromJSON(json['version']), + }; +} + +export function CreateTableVersionResponseToJSON(json: any): CreateTableVersionResponse { + return CreateTableVersionResponseToJSONTyped(json, false); +} + +export function CreateTableVersionResponseToJSONTyped(value?: CreateTableVersionResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'transaction_id': value['transaction_id'], + 'version': TableVersionToJSON(value['version']), + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/DeclareTableRequest.ts b/typescript/lance-namespace-fetch-client/src/models/DeclareTableRequest.ts new file mode 100644 index 000000000..f7aa0c990 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/DeclareTableRequest.ts @@ -0,0 +1,127 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Identity } from './Identity'; +import { + IdentityFromJSON, + IdentityFromJSONTyped, + IdentityToJSON, + IdentityToJSONTyped, +} from './Identity'; + +/** + * Request for declaring a table. + * + * @export + * @interface DeclareTableRequest + */ +export interface DeclareTableRequest { + /** + * + * @type {Identity} + * @memberof DeclareTableRequest + */ + identity?: Identity; + /** + * Arbitrary context for a request as key-value pairs. + * How to use the context is custom to the specific implementation. + * + * REST NAMESPACE ONLY + * Context entries are passed via HTTP headers using the naming convention + * `x-lance-ctx-: `. For example, a context entry + * `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + * + * @type {{ [key: string]: string; }} + * @memberof DeclareTableRequest + */ + context?: { [key: string]: string; }; + /** + * + * @type {Array} + * @memberof DeclareTableRequest + */ + id?: Array; + /** + * Optional storage location for the table. + * If not provided, the namespace implementation should determine the table location. + * + * @type {string} + * @memberof DeclareTableRequest + */ + location?: string; + /** + * Whether to include vended credentials in the response `storage_options`. + * When true, the implementation should provide vended credentials for accessing storage. + * When not set, the implementation can decide whether to return vended credentials. + * + * @type {boolean} + * @memberof DeclareTableRequest + */ + vend_credentials?: boolean; + /** + * Properties stored on the table, if supported by the server. + * + * @type {{ [key: string]: string; }} + * @memberof DeclareTableRequest + */ + properties?: { [key: string]: string; }; +} + +/** + * Check if a given object implements the DeclareTableRequest interface. + */ +export function instanceOfDeclareTableRequest(value: object): value is DeclareTableRequest { + return true; +} + +export function DeclareTableRequestFromJSON(json: any): DeclareTableRequest { + return DeclareTableRequestFromJSONTyped(json, false); +} + +export function DeclareTableRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DeclareTableRequest { + if (json == null) { + return json; + } + return { + + 'identity': json['identity'] == null ? undefined : IdentityFromJSON(json['identity']), + 'context': json['context'] == null ? undefined : json['context'], + 'id': json['id'] == null ? undefined : json['id'], + 'location': json['location'] == null ? undefined : json['location'], + 'vend_credentials': json['vend_credentials'] == null ? undefined : json['vend_credentials'], + 'properties': json['properties'] == null ? undefined : json['properties'], + }; +} + +export function DeclareTableRequestToJSON(json: any): DeclareTableRequest { + return DeclareTableRequestToJSONTyped(json, false); +} + +export function DeclareTableRequestToJSONTyped(value?: DeclareTableRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'identity': IdentityToJSON(value['identity']), + 'context': value['context'], + 'id': value['id'], + 'location': value['location'], + 'vend_credentials': value['vend_credentials'], + 'properties': value['properties'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/DeclareTableResponse.ts b/typescript/lance-namespace-fetch-client/src/models/DeclareTableResponse.ts new file mode 100644 index 000000000..9e151c89d --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/DeclareTableResponse.ts @@ -0,0 +1,105 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * Response for declaring a table. + * + * @export + * @interface DeclareTableResponse + */ +export interface DeclareTableResponse { + /** + * Optional transaction identifier + * @type {string} + * @memberof DeclareTableResponse + */ + transaction_id?: string; + /** + * + * @type {string} + * @memberof DeclareTableResponse + */ + location?: string; + /** + * Configuration options to be used to access storage. The available + * options depend on the type of storage in use. These will be + * passed directly to Lance to initialize storage access. + * + * @type {{ [key: string]: string; }} + * @memberof DeclareTableResponse + */ + storage_options?: { [key: string]: string; }; + /** + * If the implementation does not support table properties, it should return null for this field. Otherwise it should return the properties. + * + * @type {{ [key: string]: string; }} + * @memberof DeclareTableResponse + */ + properties?: { [key: string]: string; }; + /** + * When true, the caller should use namespace table version operations + * (CreateTableVersion, BatchCreateTableVersions, DescribeTableVersion, ListTableVersions, BatchDeleteTableVersions) + * to manage table versions instead of relying on Lance's native version management. + * + * @type {boolean} + * @memberof DeclareTableResponse + */ + managed_versioning?: boolean; +} + +/** + * Check if a given object implements the DeclareTableResponse interface. + */ +export function instanceOfDeclareTableResponse(value: object): value is DeclareTableResponse { + return true; +} + +export function DeclareTableResponseFromJSON(json: any): DeclareTableResponse { + return DeclareTableResponseFromJSONTyped(json, false); +} + +export function DeclareTableResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): DeclareTableResponse { + if (json == null) { + return json; + } + return { + + 'transaction_id': json['transaction_id'] == null ? undefined : json['transaction_id'], + 'location': json['location'] == null ? undefined : json['location'], + 'storage_options': json['storage_options'] == null ? undefined : json['storage_options'], + 'properties': json['properties'] == null ? undefined : json['properties'], + 'managed_versioning': json['managed_versioning'] == null ? undefined : json['managed_versioning'], + }; +} + +export function DeclareTableResponseToJSON(json: any): DeclareTableResponse { + return DeclareTableResponseToJSONTyped(json, false); +} + +export function DeclareTableResponseToJSONTyped(value?: DeclareTableResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'transaction_id': value['transaction_id'], + 'location': value['location'], + 'storage_options': value['storage_options'], + 'properties': value['properties'], + 'managed_versioning': value['managed_versioning'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/DeleteFromTableRequest.ts b/typescript/lance-namespace-fetch-client/src/models/DeleteFromTableRequest.ts new file mode 100644 index 000000000..cf4320cde --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/DeleteFromTableRequest.ts @@ -0,0 +1,107 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Identity } from './Identity'; +import { + IdentityFromJSON, + IdentityFromJSONTyped, + IdentityToJSON, + IdentityToJSONTyped, +} from './Identity'; + +/** + * Delete data from table based on a SQL predicate. + * Returns the number of rows that were deleted. + * + * @export + * @interface DeleteFromTableRequest + */ +export interface DeleteFromTableRequest { + /** + * + * @type {Identity} + * @memberof DeleteFromTableRequest + */ + identity?: Identity; + /** + * Arbitrary context for a request as key-value pairs. + * How to use the context is custom to the specific implementation. + * + * REST NAMESPACE ONLY + * Context entries are passed via HTTP headers using the naming convention + * `x-lance-ctx-: `. For example, a context entry + * `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + * + * @type {{ [key: string]: string; }} + * @memberof DeleteFromTableRequest + */ + context?: { [key: string]: string; }; + /** + * The namespace identifier + * @type {Array} + * @memberof DeleteFromTableRequest + */ + id?: Array; + /** + * SQL predicate to filter rows for deletion + * @type {string} + * @memberof DeleteFromTableRequest + */ + predicate: string; +} + +/** + * Check if a given object implements the DeleteFromTableRequest interface. + */ +export function instanceOfDeleteFromTableRequest(value: object): value is DeleteFromTableRequest { + if (!('predicate' in value) || value['predicate'] === undefined) return false; + return true; +} + +export function DeleteFromTableRequestFromJSON(json: any): DeleteFromTableRequest { + return DeleteFromTableRequestFromJSONTyped(json, false); +} + +export function DeleteFromTableRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DeleteFromTableRequest { + if (json == null) { + return json; + } + return { + + 'identity': json['identity'] == null ? undefined : IdentityFromJSON(json['identity']), + 'context': json['context'] == null ? undefined : json['context'], + 'id': json['id'] == null ? undefined : json['id'], + 'predicate': json['predicate'], + }; +} + +export function DeleteFromTableRequestToJSON(json: any): DeleteFromTableRequest { + return DeleteFromTableRequestToJSONTyped(json, false); +} + +export function DeleteFromTableRequestToJSONTyped(value?: DeleteFromTableRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'identity': IdentityToJSON(value['identity']), + 'context': value['context'], + 'id': value['id'], + 'predicate': value['predicate'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/DeleteFromTableResponse.ts b/typescript/lance-namespace-fetch-client/src/models/DeleteFromTableResponse.ts new file mode 100644 index 000000000..dd2dc5e7a --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/DeleteFromTableResponse.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface DeleteFromTableResponse + */ +export interface DeleteFromTableResponse { + /** + * Optional transaction identifier + * @type {string} + * @memberof DeleteFromTableResponse + */ + transaction_id?: string; + /** + * The commit version associated with the operation + * @type {number} + * @memberof DeleteFromTableResponse + */ + version?: number; +} + +/** + * Check if a given object implements the DeleteFromTableResponse interface. + */ +export function instanceOfDeleteFromTableResponse(value: object): value is DeleteFromTableResponse { + return true; +} + +export function DeleteFromTableResponseFromJSON(json: any): DeleteFromTableResponse { + return DeleteFromTableResponseFromJSONTyped(json, false); +} + +export function DeleteFromTableResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): DeleteFromTableResponse { + if (json == null) { + return json; + } + return { + + 'transaction_id': json['transaction_id'] == null ? undefined : json['transaction_id'], + 'version': json['version'] == null ? undefined : json['version'], + }; +} + +export function DeleteFromTableResponseToJSON(json: any): DeleteFromTableResponse { + return DeleteFromTableResponseToJSONTyped(json, false); +} + +export function DeleteFromTableResponseToJSONTyped(value?: DeleteFromTableResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'transaction_id': value['transaction_id'], + 'version': value['version'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/DeleteTableTagRequest.ts b/typescript/lance-namespace-fetch-client/src/models/DeleteTableTagRequest.ts new file mode 100644 index 000000000..4c237ac24 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/DeleteTableTagRequest.ts @@ -0,0 +1,105 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Identity } from './Identity'; +import { + IdentityFromJSON, + IdentityFromJSONTyped, + IdentityToJSON, + IdentityToJSONTyped, +} from './Identity'; + +/** + * + * @export + * @interface DeleteTableTagRequest + */ +export interface DeleteTableTagRequest { + /** + * + * @type {Identity} + * @memberof DeleteTableTagRequest + */ + identity?: Identity; + /** + * Arbitrary context for a request as key-value pairs. + * How to use the context is custom to the specific implementation. + * + * REST NAMESPACE ONLY + * Context entries are passed via HTTP headers using the naming convention + * `x-lance-ctx-: `. For example, a context entry + * `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + * + * @type {{ [key: string]: string; }} + * @memberof DeleteTableTagRequest + */ + context?: { [key: string]: string; }; + /** + * + * @type {Array} + * @memberof DeleteTableTagRequest + */ + id?: Array; + /** + * Name of the tag to delete + * @type {string} + * @memberof DeleteTableTagRequest + */ + tag: string; +} + +/** + * Check if a given object implements the DeleteTableTagRequest interface. + */ +export function instanceOfDeleteTableTagRequest(value: object): value is DeleteTableTagRequest { + if (!('tag' in value) || value['tag'] === undefined) return false; + return true; +} + +export function DeleteTableTagRequestFromJSON(json: any): DeleteTableTagRequest { + return DeleteTableTagRequestFromJSONTyped(json, false); +} + +export function DeleteTableTagRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DeleteTableTagRequest { + if (json == null) { + return json; + } + return { + + 'identity': json['identity'] == null ? undefined : IdentityFromJSON(json['identity']), + 'context': json['context'] == null ? undefined : json['context'], + 'id': json['id'] == null ? undefined : json['id'], + 'tag': json['tag'], + }; +} + +export function DeleteTableTagRequestToJSON(json: any): DeleteTableTagRequest { + return DeleteTableTagRequestToJSONTyped(json, false); +} + +export function DeleteTableTagRequestToJSONTyped(value?: DeleteTableTagRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'identity': IdentityToJSON(value['identity']), + 'context': value['context'], + 'id': value['id'], + 'tag': value['tag'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/DeleteTableTagResponse.ts b/typescript/lance-namespace-fetch-client/src/models/DeleteTableTagResponse.ts new file mode 100644 index 000000000..ca91e7a9d --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/DeleteTableTagResponse.ts @@ -0,0 +1,65 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * Response for delete tag operation + * @export + * @interface DeleteTableTagResponse + */ +export interface DeleteTableTagResponse { + /** + * Optional transaction identifier + * @type {string} + * @memberof DeleteTableTagResponse + */ + transaction_id?: string; +} + +/** + * Check if a given object implements the DeleteTableTagResponse interface. + */ +export function instanceOfDeleteTableTagResponse(value: object): value is DeleteTableTagResponse { + return true; +} + +export function DeleteTableTagResponseFromJSON(json: any): DeleteTableTagResponse { + return DeleteTableTagResponseFromJSONTyped(json, false); +} + +export function DeleteTableTagResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): DeleteTableTagResponse { + if (json == null) { + return json; + } + return { + + 'transaction_id': json['transaction_id'] == null ? undefined : json['transaction_id'], + }; +} + +export function DeleteTableTagResponseToJSON(json: any): DeleteTableTagResponse { + return DeleteTableTagResponseToJSONTyped(json, false); +} + +export function DeleteTableTagResponseToJSONTyped(value?: DeleteTableTagResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'transaction_id': value['transaction_id'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/DeregisterTableRequest.ts b/typescript/lance-namespace-fetch-client/src/models/DeregisterTableRequest.ts new file mode 100644 index 000000000..c908ef647 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/DeregisterTableRequest.ts @@ -0,0 +1,97 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Identity } from './Identity'; +import { + IdentityFromJSON, + IdentityFromJSONTyped, + IdentityToJSON, + IdentityToJSONTyped, +} from './Identity'; + +/** + * The table content remains available in the storage. + * + * @export + * @interface DeregisterTableRequest + */ +export interface DeregisterTableRequest { + /** + * + * @type {Identity} + * @memberof DeregisterTableRequest + */ + identity?: Identity; + /** + * Arbitrary context for a request as key-value pairs. + * How to use the context is custom to the specific implementation. + * + * REST NAMESPACE ONLY + * Context entries are passed via HTTP headers using the naming convention + * `x-lance-ctx-: `. For example, a context entry + * `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + * + * @type {{ [key: string]: string; }} + * @memberof DeregisterTableRequest + */ + context?: { [key: string]: string; }; + /** + * + * @type {Array} + * @memberof DeregisterTableRequest + */ + id?: Array; +} + +/** + * Check if a given object implements the DeregisterTableRequest interface. + */ +export function instanceOfDeregisterTableRequest(value: object): value is DeregisterTableRequest { + return true; +} + +export function DeregisterTableRequestFromJSON(json: any): DeregisterTableRequest { + return DeregisterTableRequestFromJSONTyped(json, false); +} + +export function DeregisterTableRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DeregisterTableRequest { + if (json == null) { + return json; + } + return { + + 'identity': json['identity'] == null ? undefined : IdentityFromJSON(json['identity']), + 'context': json['context'] == null ? undefined : json['context'], + 'id': json['id'] == null ? undefined : json['id'], + }; +} + +export function DeregisterTableRequestToJSON(json: any): DeregisterTableRequest { + return DeregisterTableRequestToJSONTyped(json, false); +} + +export function DeregisterTableRequestToJSONTyped(value?: DeregisterTableRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'identity': IdentityToJSON(value['identity']), + 'context': value['context'], + 'id': value['id'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/DeregisterTableResponse.ts b/typescript/lance-namespace-fetch-client/src/models/DeregisterTableResponse.ts new file mode 100644 index 000000000..6188a8aed --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/DeregisterTableResponse.ts @@ -0,0 +1,90 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface DeregisterTableResponse + */ +export interface DeregisterTableResponse { + /** + * Optional transaction identifier + * @type {string} + * @memberof DeregisterTableResponse + */ + transaction_id?: string; + /** + * + * @type {Array} + * @memberof DeregisterTableResponse + */ + id?: Array; + /** + * + * @type {string} + * @memberof DeregisterTableResponse + */ + location?: string; + /** + * If the implementation does not support table properties, it should return null for this field. Otherwise it should return the properties. + * + * @type {{ [key: string]: string; }} + * @memberof DeregisterTableResponse + */ + properties?: { [key: string]: string; }; +} + +/** + * Check if a given object implements the DeregisterTableResponse interface. + */ +export function instanceOfDeregisterTableResponse(value: object): value is DeregisterTableResponse { + return true; +} + +export function DeregisterTableResponseFromJSON(json: any): DeregisterTableResponse { + return DeregisterTableResponseFromJSONTyped(json, false); +} + +export function DeregisterTableResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): DeregisterTableResponse { + if (json == null) { + return json; + } + return { + + 'transaction_id': json['transaction_id'] == null ? undefined : json['transaction_id'], + 'id': json['id'] == null ? undefined : json['id'], + 'location': json['location'] == null ? undefined : json['location'], + 'properties': json['properties'] == null ? undefined : json['properties'], + }; +} + +export function DeregisterTableResponseToJSON(json: any): DeregisterTableResponse { + return DeregisterTableResponseToJSONTyped(json, false); +} + +export function DeregisterTableResponseToJSONTyped(value?: DeregisterTableResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'transaction_id': value['transaction_id'], + 'id': value['id'], + 'location': value['location'], + 'properties': value['properties'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/DescribeNamespaceRequest.ts b/typescript/lance-namespace-fetch-client/src/models/DescribeNamespaceRequest.ts new file mode 100644 index 000000000..147f4dd11 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/DescribeNamespaceRequest.ts @@ -0,0 +1,96 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Identity } from './Identity'; +import { + IdentityFromJSON, + IdentityFromJSONTyped, + IdentityToJSON, + IdentityToJSONTyped, +} from './Identity'; + +/** + * + * @export + * @interface DescribeNamespaceRequest + */ +export interface DescribeNamespaceRequest { + /** + * + * @type {Identity} + * @memberof DescribeNamespaceRequest + */ + identity?: Identity; + /** + * Arbitrary context for a request as key-value pairs. + * How to use the context is custom to the specific implementation. + * + * REST NAMESPACE ONLY + * Context entries are passed via HTTP headers using the naming convention + * `x-lance-ctx-: `. For example, a context entry + * `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + * + * @type {{ [key: string]: string; }} + * @memberof DescribeNamespaceRequest + */ + context?: { [key: string]: string; }; + /** + * + * @type {Array} + * @memberof DescribeNamespaceRequest + */ + id?: Array; +} + +/** + * Check if a given object implements the DescribeNamespaceRequest interface. + */ +export function instanceOfDescribeNamespaceRequest(value: object): value is DescribeNamespaceRequest { + return true; +} + +export function DescribeNamespaceRequestFromJSON(json: any): DescribeNamespaceRequest { + return DescribeNamespaceRequestFromJSONTyped(json, false); +} + +export function DescribeNamespaceRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DescribeNamespaceRequest { + if (json == null) { + return json; + } + return { + + 'identity': json['identity'] == null ? undefined : IdentityFromJSON(json['identity']), + 'context': json['context'] == null ? undefined : json['context'], + 'id': json['id'] == null ? undefined : json['id'], + }; +} + +export function DescribeNamespaceRequestToJSON(json: any): DescribeNamespaceRequest { + return DescribeNamespaceRequestToJSONTyped(json, false); +} + +export function DescribeNamespaceRequestToJSONTyped(value?: DescribeNamespaceRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'identity': IdentityToJSON(value['identity']), + 'context': value['context'], + 'id': value['id'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/DescribeNamespaceResponse.ts b/typescript/lance-namespace-fetch-client/src/models/DescribeNamespaceResponse.ts new file mode 100644 index 000000000..dab5ef4c3 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/DescribeNamespaceResponse.ts @@ -0,0 +1,65 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface DescribeNamespaceResponse + */ +export interface DescribeNamespaceResponse { + /** + * Properties stored on the namespace, if supported by the server. If the server does not support namespace properties, it should return null for this field. If namespace properties are supported, but none are set, it should return an empty object. + * @type {{ [key: string]: string; }} + * @memberof DescribeNamespaceResponse + */ + properties?: { [key: string]: string; }; +} + +/** + * Check if a given object implements the DescribeNamespaceResponse interface. + */ +export function instanceOfDescribeNamespaceResponse(value: object): value is DescribeNamespaceResponse { + return true; +} + +export function DescribeNamespaceResponseFromJSON(json: any): DescribeNamespaceResponse { + return DescribeNamespaceResponseFromJSONTyped(json, false); +} + +export function DescribeNamespaceResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): DescribeNamespaceResponse { + if (json == null) { + return json; + } + return { + + 'properties': json['properties'] == null ? undefined : json['properties'], + }; +} + +export function DescribeNamespaceResponseToJSON(json: any): DescribeNamespaceResponse { + return DescribeNamespaceResponseToJSONTyped(json, false); +} + +export function DescribeNamespaceResponseToJSONTyped(value?: DescribeNamespaceResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'properties': value['properties'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/DescribeTableIndexStatsRequest.ts b/typescript/lance-namespace-fetch-client/src/models/DescribeTableIndexStatsRequest.ts new file mode 100644 index 000000000..9e267a622 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/DescribeTableIndexStatsRequest.ts @@ -0,0 +1,112 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Identity } from './Identity'; +import { + IdentityFromJSON, + IdentityFromJSONTyped, + IdentityToJSON, + IdentityToJSONTyped, +} from './Identity'; + +/** + * + * @export + * @interface DescribeTableIndexStatsRequest + */ +export interface DescribeTableIndexStatsRequest { + /** + * + * @type {Identity} + * @memberof DescribeTableIndexStatsRequest + */ + identity?: Identity; + /** + * Arbitrary context for a request as key-value pairs. + * How to use the context is custom to the specific implementation. + * + * REST NAMESPACE ONLY + * Context entries are passed via HTTP headers using the naming convention + * `x-lance-ctx-: `. For example, a context entry + * `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + * + * @type {{ [key: string]: string; }} + * @memberof DescribeTableIndexStatsRequest + */ + context?: { [key: string]: string; }; + /** + * + * @type {Array} + * @memberof DescribeTableIndexStatsRequest + */ + id?: Array; + /** + * Optional table version to get stats for + * @type {number} + * @memberof DescribeTableIndexStatsRequest + */ + version?: number; + /** + * Name of the index + * @type {string} + * @memberof DescribeTableIndexStatsRequest + */ + index_name?: string; +} + +/** + * Check if a given object implements the DescribeTableIndexStatsRequest interface. + */ +export function instanceOfDescribeTableIndexStatsRequest(value: object): value is DescribeTableIndexStatsRequest { + return true; +} + +export function DescribeTableIndexStatsRequestFromJSON(json: any): DescribeTableIndexStatsRequest { + return DescribeTableIndexStatsRequestFromJSONTyped(json, false); +} + +export function DescribeTableIndexStatsRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DescribeTableIndexStatsRequest { + if (json == null) { + return json; + } + return { + + 'identity': json['identity'] == null ? undefined : IdentityFromJSON(json['identity']), + 'context': json['context'] == null ? undefined : json['context'], + 'id': json['id'] == null ? undefined : json['id'], + 'version': json['version'] == null ? undefined : json['version'], + 'index_name': json['index_name'] == null ? undefined : json['index_name'], + }; +} + +export function DescribeTableIndexStatsRequestToJSON(json: any): DescribeTableIndexStatsRequest { + return DescribeTableIndexStatsRequestToJSONTyped(json, false); +} + +export function DescribeTableIndexStatsRequestToJSONTyped(value?: DescribeTableIndexStatsRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'identity': IdentityToJSON(value['identity']), + 'context': value['context'], + 'id': value['id'], + 'version': value['version'], + 'index_name': value['index_name'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/DescribeTableIndexStatsResponse.ts b/typescript/lance-namespace-fetch-client/src/models/DescribeTableIndexStatsResponse.ts new file mode 100644 index 000000000..0a1f116d4 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/DescribeTableIndexStatsResponse.ts @@ -0,0 +1,97 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface DescribeTableIndexStatsResponse + */ +export interface DescribeTableIndexStatsResponse { + /** + * Distance type for vector indexes + * @type {string} + * @memberof DescribeTableIndexStatsResponse + */ + distance_type?: string; + /** + * Type of the index + * @type {string} + * @memberof DescribeTableIndexStatsResponse + */ + index_type?: string; + /** + * Number of indexed rows + * @type {number} + * @memberof DescribeTableIndexStatsResponse + */ + num_indexed_rows?: number; + /** + * Number of unindexed rows + * @type {number} + * @memberof DescribeTableIndexStatsResponse + */ + num_unindexed_rows?: number; + /** + * Number of indices + * @type {number} + * @memberof DescribeTableIndexStatsResponse + */ + num_indices?: number; +} + +/** + * Check if a given object implements the DescribeTableIndexStatsResponse interface. + */ +export function instanceOfDescribeTableIndexStatsResponse(value: object): value is DescribeTableIndexStatsResponse { + return true; +} + +export function DescribeTableIndexStatsResponseFromJSON(json: any): DescribeTableIndexStatsResponse { + return DescribeTableIndexStatsResponseFromJSONTyped(json, false); +} + +export function DescribeTableIndexStatsResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): DescribeTableIndexStatsResponse { + if (json == null) { + return json; + } + return { + + 'distance_type': json['distance_type'] == null ? undefined : json['distance_type'], + 'index_type': json['index_type'] == null ? undefined : json['index_type'], + 'num_indexed_rows': json['num_indexed_rows'] == null ? undefined : json['num_indexed_rows'], + 'num_unindexed_rows': json['num_unindexed_rows'] == null ? undefined : json['num_unindexed_rows'], + 'num_indices': json['num_indices'] == null ? undefined : json['num_indices'], + }; +} + +export function DescribeTableIndexStatsResponseToJSON(json: any): DescribeTableIndexStatsResponse { + return DescribeTableIndexStatsResponseToJSONTyped(json, false); +} + +export function DescribeTableIndexStatsResponseToJSONTyped(value?: DescribeTableIndexStatsResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'distance_type': value['distance_type'], + 'index_type': value['index_type'], + 'num_indexed_rows': value['num_indexed_rows'], + 'num_unindexed_rows': value['num_unindexed_rows'], + 'num_indices': value['num_indices'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/DescribeTableRequest.ts b/typescript/lance-namespace-fetch-client/src/models/DescribeTableRequest.ts new file mode 100644 index 000000000..33786198a --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/DescribeTableRequest.ts @@ -0,0 +1,140 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Identity } from './Identity'; +import { + IdentityFromJSON, + IdentityFromJSONTyped, + IdentityToJSON, + IdentityToJSONTyped, +} from './Identity'; + +/** + * + * @export + * @interface DescribeTableRequest + */ +export interface DescribeTableRequest { + /** + * + * @type {Identity} + * @memberof DescribeTableRequest + */ + identity?: Identity; + /** + * Arbitrary context for a request as key-value pairs. + * How to use the context is custom to the specific implementation. + * + * REST NAMESPACE ONLY + * Context entries are passed via HTTP headers using the naming convention + * `x-lance-ctx-: `. For example, a context entry + * `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + * + * @type {{ [key: string]: string; }} + * @memberof DescribeTableRequest + */ + context?: { [key: string]: string; }; + /** + * + * @type {Array} + * @memberof DescribeTableRequest + */ + id?: Array; + /** + * Version of the table to describe. + * If not specified, server should resolve it to the latest version. + * + * @type {number} + * @memberof DescribeTableRequest + */ + version?: number; + /** + * Whether to include the table URI in the response. + * Default is false. + * + * @type {boolean} + * @memberof DescribeTableRequest + */ + with_table_uri?: boolean; + /** + * Whether to load detailed metadata that requires opening the dataset. + * When true, the response must include all detailed metadata such as `version`, `schema`, and `stats` + * which require reading the dataset. + * When not set, the implementation can decide whether to return detailed metadata + * and which parts of detailed metadata to return. + * + * @type {boolean} + * @memberof DescribeTableRequest + */ + load_detailed_metadata?: boolean; + /** + * Whether to include vended credentials in the response `storage_options`. + * When true, the implementation should provide vended credentials for accessing storage. + * When not set, the implementation can decide whether to return vended credentials. + * + * @type {boolean} + * @memberof DescribeTableRequest + */ + vend_credentials?: boolean; +} + +/** + * Check if a given object implements the DescribeTableRequest interface. + */ +export function instanceOfDescribeTableRequest(value: object): value is DescribeTableRequest { + return true; +} + +export function DescribeTableRequestFromJSON(json: any): DescribeTableRequest { + return DescribeTableRequestFromJSONTyped(json, false); +} + +export function DescribeTableRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DescribeTableRequest { + if (json == null) { + return json; + } + return { + + 'identity': json['identity'] == null ? undefined : IdentityFromJSON(json['identity']), + 'context': json['context'] == null ? undefined : json['context'], + 'id': json['id'] == null ? undefined : json['id'], + 'version': json['version'] == null ? undefined : json['version'], + 'with_table_uri': json['with_table_uri'] == null ? undefined : json['with_table_uri'], + 'load_detailed_metadata': json['load_detailed_metadata'] == null ? undefined : json['load_detailed_metadata'], + 'vend_credentials': json['vend_credentials'] == null ? undefined : json['vend_credentials'], + }; +} + +export function DescribeTableRequestToJSON(json: any): DescribeTableRequest { + return DescribeTableRequestToJSONTyped(json, false); +} + +export function DescribeTableRequestToJSONTyped(value?: DescribeTableRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'identity': IdentityToJSON(value['identity']), + 'context': value['context'], + 'id': value['id'], + 'version': value['version'], + 'with_table_uri': value['with_table_uri'], + 'load_detailed_metadata': value['load_detailed_metadata'], + 'vend_credentials': value['vend_credentials'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/DescribeTableResponse.ts b/typescript/lance-namespace-fetch-client/src/models/DescribeTableResponse.ts new file mode 100644 index 000000000..8d107b00f --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/DescribeTableResponse.ts @@ -0,0 +1,185 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { JsonArrowSchema } from './JsonArrowSchema'; +import { + JsonArrowSchemaFromJSON, + JsonArrowSchemaFromJSONTyped, + JsonArrowSchemaToJSON, + JsonArrowSchemaToJSONTyped, +} from './JsonArrowSchema'; +import type { TableBasicStats } from './TableBasicStats'; +import { + TableBasicStatsFromJSON, + TableBasicStatsFromJSONTyped, + TableBasicStatsToJSON, + TableBasicStatsToJSONTyped, +} from './TableBasicStats'; + +/** + * + * @export + * @interface DescribeTableResponse + */ +export interface DescribeTableResponse { + /** + * Table name. + * Only populated when `load_detailed_metadata` is true. + * + * @type {string} + * @memberof DescribeTableResponse + */ + table?: string; + /** + * The namespace identifier as a list of parts. + * Only populated when `load_detailed_metadata` is true. + * + * @type {Array} + * @memberof DescribeTableResponse + */ + namespace?: Array; + /** + * Table version number. + * Only populated when `load_detailed_metadata` is true. + * + * @type {number} + * @memberof DescribeTableResponse + */ + version?: number; + /** + * Table storage location (e.g., S3/GCS path). + * + * @type {string} + * @memberof DescribeTableResponse + */ + location?: string; + /** + * Table URI. Unlike location, this field must be a complete and valid URI. + * Only returned when `with_table_uri` is true. + * + * @type {string} + * @memberof DescribeTableResponse + */ + table_uri?: string; + /** + * Table schema in JSON Arrow format. + * Only populated when `load_detailed_metadata` is true. + * + * @type {JsonArrowSchema} + * @memberof DescribeTableResponse + */ + schema?: JsonArrowSchema; + /** + * Configuration options to be used to access storage. The available + * options depend on the type of storage in use. These will be + * passed directly to Lance to initialize storage access. + * When `vend_credentials` is true, this field may include vended credentials. + * If the vended credentials are temporary, the `expires_at_millis` key should be + * included to indicate the millisecond timestamp when the credentials expire. + * + * @type {{ [key: string]: string; }} + * @memberof DescribeTableResponse + */ + storage_options?: { [key: string]: string; }; + /** + * Table statistics. + * Only populated when `load_detailed_metadata` is true. + * + * @type {TableBasicStats} + * @memberof DescribeTableResponse + */ + stats?: TableBasicStats; + /** + * Optional table metadata as key-value pairs. This records the information of the table + * and requires loading the table. + * It is only populated when `load_detailed_metadata` is true. + * + * @type {{ [key: string]: string; }} + * @memberof DescribeTableResponse + */ + metadata?: { [key: string]: string; }; + /** + * Properties stored on the table, if supported by the server. This records the information managed by the namespace. If the server does not support table properties, it should return null for this field. If table properties are supported, but none are set, it should return an empty object. + * @type {{ [key: string]: string; }} + * @memberof DescribeTableResponse + */ + properties?: { [key: string]: string; }; + /** + * When true, the caller should use namespace table version operations + * (CreateTableVersion, BatchCreateTableVersions, DescribeTableVersion, ListTableVersions, BatchDeleteTableVersions) + * to manage table versions instead of relying on Lance's native version management. + * + * @type {boolean} + * @memberof DescribeTableResponse + */ + managed_versioning?: boolean; +} + +/** + * Check if a given object implements the DescribeTableResponse interface. + */ +export function instanceOfDescribeTableResponse(value: object): value is DescribeTableResponse { + return true; +} + +export function DescribeTableResponseFromJSON(json: any): DescribeTableResponse { + return DescribeTableResponseFromJSONTyped(json, false); +} + +export function DescribeTableResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): DescribeTableResponse { + if (json == null) { + return json; + } + return { + + 'table': json['table'] == null ? undefined : json['table'], + 'namespace': json['namespace'] == null ? undefined : json['namespace'], + 'version': json['version'] == null ? undefined : json['version'], + 'location': json['location'] == null ? undefined : json['location'], + 'table_uri': json['table_uri'] == null ? undefined : json['table_uri'], + 'schema': json['schema'] == null ? undefined : JsonArrowSchemaFromJSON(json['schema']), + 'storage_options': json['storage_options'] == null ? undefined : json['storage_options'], + 'stats': json['stats'] == null ? undefined : TableBasicStatsFromJSON(json['stats']), + 'metadata': json['metadata'] == null ? undefined : json['metadata'], + 'properties': json['properties'] == null ? undefined : json['properties'], + 'managed_versioning': json['managed_versioning'] == null ? undefined : json['managed_versioning'], + }; +} + +export function DescribeTableResponseToJSON(json: any): DescribeTableResponse { + return DescribeTableResponseToJSONTyped(json, false); +} + +export function DescribeTableResponseToJSONTyped(value?: DescribeTableResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'table': value['table'], + 'namespace': value['namespace'], + 'version': value['version'], + 'location': value['location'], + 'table_uri': value['table_uri'], + 'schema': JsonArrowSchemaToJSON(value['schema']), + 'storage_options': value['storage_options'], + 'stats': TableBasicStatsToJSON(value['stats']), + 'metadata': value['metadata'], + 'properties': value['properties'], + 'managed_versioning': value['managed_versioning'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/DescribeTableVersionRequest.ts b/typescript/lance-namespace-fetch-client/src/models/DescribeTableVersionRequest.ts new file mode 100644 index 000000000..9dfa19e4f --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/DescribeTableVersionRequest.ts @@ -0,0 +1,104 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Identity } from './Identity'; +import { + IdentityFromJSON, + IdentityFromJSONTyped, + IdentityToJSON, + IdentityToJSONTyped, +} from './Identity'; + +/** + * Request to describe a specific table version + * @export + * @interface DescribeTableVersionRequest + */ +export interface DescribeTableVersionRequest { + /** + * + * @type {Identity} + * @memberof DescribeTableVersionRequest + */ + identity?: Identity; + /** + * Arbitrary context for a request as key-value pairs. + * How to use the context is custom to the specific implementation. + * + * REST NAMESPACE ONLY + * Context entries are passed via HTTP headers using the naming convention + * `x-lance-ctx-: `. For example, a context entry + * `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + * + * @type {{ [key: string]: string; }} + * @memberof DescribeTableVersionRequest + */ + context?: { [key: string]: string; }; + /** + * The table identifier + * @type {Array} + * @memberof DescribeTableVersionRequest + */ + id?: Array; + /** + * Version number to describe + * @type {number} + * @memberof DescribeTableVersionRequest + */ + version?: number; +} + +/** + * Check if a given object implements the DescribeTableVersionRequest interface. + */ +export function instanceOfDescribeTableVersionRequest(value: object): value is DescribeTableVersionRequest { + return true; +} + +export function DescribeTableVersionRequestFromJSON(json: any): DescribeTableVersionRequest { + return DescribeTableVersionRequestFromJSONTyped(json, false); +} + +export function DescribeTableVersionRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DescribeTableVersionRequest { + if (json == null) { + return json; + } + return { + + 'identity': json['identity'] == null ? undefined : IdentityFromJSON(json['identity']), + 'context': json['context'] == null ? undefined : json['context'], + 'id': json['id'] == null ? undefined : json['id'], + 'version': json['version'] == null ? undefined : json['version'], + }; +} + +export function DescribeTableVersionRequestToJSON(json: any): DescribeTableVersionRequest { + return DescribeTableVersionRequestToJSONTyped(json, false); +} + +export function DescribeTableVersionRequestToJSONTyped(value?: DescribeTableVersionRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'identity': IdentityToJSON(value['identity']), + 'context': value['context'], + 'id': value['id'], + 'version': value['version'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/DescribeTableVersionResponse.ts b/typescript/lance-namespace-fetch-client/src/models/DescribeTableVersionResponse.ts new file mode 100644 index 000000000..9f66cdf88 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/DescribeTableVersionResponse.ts @@ -0,0 +1,74 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { TableVersion } from './TableVersion'; +import { + TableVersionFromJSON, + TableVersionFromJSONTyped, + TableVersionToJSON, + TableVersionToJSONTyped, +} from './TableVersion'; + +/** + * Response containing the table version information + * @export + * @interface DescribeTableVersionResponse + */ +export interface DescribeTableVersionResponse { + /** + * The table version information + * @type {TableVersion} + * @memberof DescribeTableVersionResponse + */ + version: TableVersion; +} + +/** + * Check if a given object implements the DescribeTableVersionResponse interface. + */ +export function instanceOfDescribeTableVersionResponse(value: object): value is DescribeTableVersionResponse { + if (!('version' in value) || value['version'] === undefined) return false; + return true; +} + +export function DescribeTableVersionResponseFromJSON(json: any): DescribeTableVersionResponse { + return DescribeTableVersionResponseFromJSONTyped(json, false); +} + +export function DescribeTableVersionResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): DescribeTableVersionResponse { + if (json == null) { + return json; + } + return { + + 'version': TableVersionFromJSON(json['version']), + }; +} + +export function DescribeTableVersionResponseToJSON(json: any): DescribeTableVersionResponse { + return DescribeTableVersionResponseToJSONTyped(json, false); +} + +export function DescribeTableVersionResponseToJSONTyped(value?: DescribeTableVersionResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'version': TableVersionToJSON(value['version']), + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/DescribeTransactionRequest.ts b/typescript/lance-namespace-fetch-client/src/models/DescribeTransactionRequest.ts new file mode 100644 index 000000000..e7841b192 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/DescribeTransactionRequest.ts @@ -0,0 +1,96 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Identity } from './Identity'; +import { + IdentityFromJSON, + IdentityFromJSONTyped, + IdentityToJSON, + IdentityToJSONTyped, +} from './Identity'; + +/** + * + * @export + * @interface DescribeTransactionRequest + */ +export interface DescribeTransactionRequest { + /** + * + * @type {Identity} + * @memberof DescribeTransactionRequest + */ + identity?: Identity; + /** + * Arbitrary context for a request as key-value pairs. + * How to use the context is custom to the specific implementation. + * + * REST NAMESPACE ONLY + * Context entries are passed via HTTP headers using the naming convention + * `x-lance-ctx-: `. For example, a context entry + * `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + * + * @type {{ [key: string]: string; }} + * @memberof DescribeTransactionRequest + */ + context?: { [key: string]: string; }; + /** + * + * @type {Array} + * @memberof DescribeTransactionRequest + */ + id?: Array; +} + +/** + * Check if a given object implements the DescribeTransactionRequest interface. + */ +export function instanceOfDescribeTransactionRequest(value: object): value is DescribeTransactionRequest { + return true; +} + +export function DescribeTransactionRequestFromJSON(json: any): DescribeTransactionRequest { + return DescribeTransactionRequestFromJSONTyped(json, false); +} + +export function DescribeTransactionRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DescribeTransactionRequest { + if (json == null) { + return json; + } + return { + + 'identity': json['identity'] == null ? undefined : IdentityFromJSON(json['identity']), + 'context': json['context'] == null ? undefined : json['context'], + 'id': json['id'] == null ? undefined : json['id'], + }; +} + +export function DescribeTransactionRequestToJSON(json: any): DescribeTransactionRequest { + return DescribeTransactionRequestToJSONTyped(json, false); +} + +export function DescribeTransactionRequestToJSONTyped(value?: DescribeTransactionRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'identity': IdentityToJSON(value['identity']), + 'context': value['context'], + 'id': value['id'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/DescribeTransactionResponse.ts b/typescript/lance-namespace-fetch-client/src/models/DescribeTransactionResponse.ts new file mode 100644 index 000000000..99cb6f701 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/DescribeTransactionResponse.ts @@ -0,0 +1,81 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface DescribeTransactionResponse + */ +export interface DescribeTransactionResponse { + /** + * The status of a transaction. + * Case insensitive, supports both PascalCase and snake_case. Valid values are: + * - Queued: the transaction is queued and not yet started + * - Running: the transaction is currently running + * - Succeeded: the transaction has completed successfully + * - Failed: the transaction has failed + * - Canceled: the transaction was canceled + * + * @type {string} + * @memberof DescribeTransactionResponse + */ + status: string; + /** + * + * @type {{ [key: string]: string; }} + * @memberof DescribeTransactionResponse + */ + properties?: { [key: string]: string; }; +} + +/** + * Check if a given object implements the DescribeTransactionResponse interface. + */ +export function instanceOfDescribeTransactionResponse(value: object): value is DescribeTransactionResponse { + if (!('status' in value) || value['status'] === undefined) return false; + return true; +} + +export function DescribeTransactionResponseFromJSON(json: any): DescribeTransactionResponse { + return DescribeTransactionResponseFromJSONTyped(json, false); +} + +export function DescribeTransactionResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): DescribeTransactionResponse { + if (json == null) { + return json; + } + return { + + 'status': json['status'], + 'properties': json['properties'] == null ? undefined : json['properties'], + }; +} + +export function DescribeTransactionResponseToJSON(json: any): DescribeTransactionResponse { + return DescribeTransactionResponseToJSONTyped(json, false); +} + +export function DescribeTransactionResponseToJSONTyped(value?: DescribeTransactionResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'status': value['status'], + 'properties': value['properties'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/DropNamespaceRequest.ts b/typescript/lance-namespace-fetch-client/src/models/DropNamespaceRequest.ts new file mode 100644 index 000000000..09f449cda --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/DropNamespaceRequest.ts @@ -0,0 +1,121 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Identity } from './Identity'; +import { + IdentityFromJSON, + IdentityFromJSONTyped, + IdentityToJSON, + IdentityToJSONTyped, +} from './Identity'; + +/** + * + * @export + * @interface DropNamespaceRequest + */ +export interface DropNamespaceRequest { + /** + * + * @type {Identity} + * @memberof DropNamespaceRequest + */ + identity?: Identity; + /** + * Arbitrary context for a request as key-value pairs. + * How to use the context is custom to the specific implementation. + * + * REST NAMESPACE ONLY + * Context entries are passed via HTTP headers using the naming convention + * `x-lance-ctx-: `. For example, a context entry + * `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + * + * @type {{ [key: string]: string; }} + * @memberof DropNamespaceRequest + */ + context?: { [key: string]: string; }; + /** + * + * @type {Array} + * @memberof DropNamespaceRequest + */ + id?: Array; + /** + * The mode for dropping a namespace, deciding the server behavior when the namespace to drop is not found. + * Case insensitive, supports both PascalCase and snake_case. Valid values are: + * - Fail (default): the server must return 400 indicating the namespace to drop does not exist. + * - Skip: the server must return 204 indicating the drop operation has succeeded. + * + * @type {string} + * @memberof DropNamespaceRequest + */ + mode?: string; + /** + * The behavior for dropping a namespace. + * Case insensitive, supports both PascalCase and snake_case. Valid values are: + * - Restrict (default): the namespace should not contain any table or child namespace when drop is initiated. + * If tables are found, the server should return error and not drop the namespace. + * - Cascade: all tables and child namespaces in the namespace are dropped before the namespace is dropped. + * + * @type {string} + * @memberof DropNamespaceRequest + */ + behavior?: string; +} + +/** + * Check if a given object implements the DropNamespaceRequest interface. + */ +export function instanceOfDropNamespaceRequest(value: object): value is DropNamespaceRequest { + return true; +} + +export function DropNamespaceRequestFromJSON(json: any): DropNamespaceRequest { + return DropNamespaceRequestFromJSONTyped(json, false); +} + +export function DropNamespaceRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DropNamespaceRequest { + if (json == null) { + return json; + } + return { + + 'identity': json['identity'] == null ? undefined : IdentityFromJSON(json['identity']), + 'context': json['context'] == null ? undefined : json['context'], + 'id': json['id'] == null ? undefined : json['id'], + 'mode': json['mode'] == null ? undefined : json['mode'], + 'behavior': json['behavior'] == null ? undefined : json['behavior'], + }; +} + +export function DropNamespaceRequestToJSON(json: any): DropNamespaceRequest { + return DropNamespaceRequestToJSONTyped(json, false); +} + +export function DropNamespaceRequestToJSONTyped(value?: DropNamespaceRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'identity': IdentityToJSON(value['identity']), + 'context': value['context'], + 'id': value['id'], + 'mode': value['mode'], + 'behavior': value['behavior'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/DropNamespaceResponse.ts b/typescript/lance-namespace-fetch-client/src/models/DropNamespaceResponse.ts new file mode 100644 index 000000000..0e4bf86a3 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/DropNamespaceResponse.ts @@ -0,0 +1,75 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface DropNamespaceResponse + */ +export interface DropNamespaceResponse { + /** + * If the implementation does not support namespace properties, it should return null for this field. Otherwise it should return the properties. + * + * @type {{ [key: string]: string; }} + * @memberof DropNamespaceResponse + */ + properties?: { [key: string]: string; }; + /** + * If present, indicating the operation is long running and should be tracked using DescribeTransaction + * + * @type {Array} + * @memberof DropNamespaceResponse + */ + transaction_id?: Array; +} + +/** + * Check if a given object implements the DropNamespaceResponse interface. + */ +export function instanceOfDropNamespaceResponse(value: object): value is DropNamespaceResponse { + return true; +} + +export function DropNamespaceResponseFromJSON(json: any): DropNamespaceResponse { + return DropNamespaceResponseFromJSONTyped(json, false); +} + +export function DropNamespaceResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): DropNamespaceResponse { + if (json == null) { + return json; + } + return { + + 'properties': json['properties'] == null ? undefined : json['properties'], + 'transaction_id': json['transaction_id'] == null ? undefined : json['transaction_id'], + }; +} + +export function DropNamespaceResponseToJSON(json: any): DropNamespaceResponse { + return DropNamespaceResponseToJSONTyped(json, false); +} + +export function DropNamespaceResponseToJSONTyped(value?: DropNamespaceResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'properties': value['properties'], + 'transaction_id': value['transaction_id'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/DropTableIndexRequest.ts b/typescript/lance-namespace-fetch-client/src/models/DropTableIndexRequest.ts new file mode 100644 index 000000000..e266e2057 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/DropTableIndexRequest.ts @@ -0,0 +1,104 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Identity } from './Identity'; +import { + IdentityFromJSON, + IdentityFromJSONTyped, + IdentityToJSON, + IdentityToJSONTyped, +} from './Identity'; + +/** + * + * @export + * @interface DropTableIndexRequest + */ +export interface DropTableIndexRequest { + /** + * + * @type {Identity} + * @memberof DropTableIndexRequest + */ + identity?: Identity; + /** + * Arbitrary context for a request as key-value pairs. + * How to use the context is custom to the specific implementation. + * + * REST NAMESPACE ONLY + * Context entries are passed via HTTP headers using the naming convention + * `x-lance-ctx-: `. For example, a context entry + * `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + * + * @type {{ [key: string]: string; }} + * @memberof DropTableIndexRequest + */ + context?: { [key: string]: string; }; + /** + * + * @type {Array} + * @memberof DropTableIndexRequest + */ + id?: Array; + /** + * Name of the index to drop + * @type {string} + * @memberof DropTableIndexRequest + */ + index_name?: string; +} + +/** + * Check if a given object implements the DropTableIndexRequest interface. + */ +export function instanceOfDropTableIndexRequest(value: object): value is DropTableIndexRequest { + return true; +} + +export function DropTableIndexRequestFromJSON(json: any): DropTableIndexRequest { + return DropTableIndexRequestFromJSONTyped(json, false); +} + +export function DropTableIndexRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DropTableIndexRequest { + if (json == null) { + return json; + } + return { + + 'identity': json['identity'] == null ? undefined : IdentityFromJSON(json['identity']), + 'context': json['context'] == null ? undefined : json['context'], + 'id': json['id'] == null ? undefined : json['id'], + 'index_name': json['index_name'] == null ? undefined : json['index_name'], + }; +} + +export function DropTableIndexRequestToJSON(json: any): DropTableIndexRequest { + return DropTableIndexRequestToJSONTyped(json, false); +} + +export function DropTableIndexRequestToJSONTyped(value?: DropTableIndexRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'identity': IdentityToJSON(value['identity']), + 'context': value['context'], + 'id': value['id'], + 'index_name': value['index_name'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/DropTableIndexResponse.ts b/typescript/lance-namespace-fetch-client/src/models/DropTableIndexResponse.ts new file mode 100644 index 000000000..470bf4fdb --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/DropTableIndexResponse.ts @@ -0,0 +1,65 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * Response for drop index operation + * @export + * @interface DropTableIndexResponse + */ +export interface DropTableIndexResponse { + /** + * Optional transaction identifier + * @type {string} + * @memberof DropTableIndexResponse + */ + transaction_id?: string; +} + +/** + * Check if a given object implements the DropTableIndexResponse interface. + */ +export function instanceOfDropTableIndexResponse(value: object): value is DropTableIndexResponse { + return true; +} + +export function DropTableIndexResponseFromJSON(json: any): DropTableIndexResponse { + return DropTableIndexResponseFromJSONTyped(json, false); +} + +export function DropTableIndexResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): DropTableIndexResponse { + if (json == null) { + return json; + } + return { + + 'transaction_id': json['transaction_id'] == null ? undefined : json['transaction_id'], + }; +} + +export function DropTableIndexResponseToJSON(json: any): DropTableIndexResponse { + return DropTableIndexResponseToJSONTyped(json, false); +} + +export function DropTableIndexResponseToJSONTyped(value?: DropTableIndexResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'transaction_id': value['transaction_id'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/DropTableRequest.ts b/typescript/lance-namespace-fetch-client/src/models/DropTableRequest.ts new file mode 100644 index 000000000..cd31f5e13 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/DropTableRequest.ts @@ -0,0 +1,98 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Identity } from './Identity'; +import { + IdentityFromJSON, + IdentityFromJSONTyped, + IdentityToJSON, + IdentityToJSONTyped, +} from './Identity'; + +/** + * If the table and its data can be immediately deleted, return information of the deleted table. + * Otherwise, return a transaction ID that client can use to track deletion progress. + * + * @export + * @interface DropTableRequest + */ +export interface DropTableRequest { + /** + * + * @type {Identity} + * @memberof DropTableRequest + */ + identity?: Identity; + /** + * Arbitrary context for a request as key-value pairs. + * How to use the context is custom to the specific implementation. + * + * REST NAMESPACE ONLY + * Context entries are passed via HTTP headers using the naming convention + * `x-lance-ctx-: `. For example, a context entry + * `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + * + * @type {{ [key: string]: string; }} + * @memberof DropTableRequest + */ + context?: { [key: string]: string; }; + /** + * + * @type {Array} + * @memberof DropTableRequest + */ + id?: Array; +} + +/** + * Check if a given object implements the DropTableRequest interface. + */ +export function instanceOfDropTableRequest(value: object): value is DropTableRequest { + return true; +} + +export function DropTableRequestFromJSON(json: any): DropTableRequest { + return DropTableRequestFromJSONTyped(json, false); +} + +export function DropTableRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DropTableRequest { + if (json == null) { + return json; + } + return { + + 'identity': json['identity'] == null ? undefined : IdentityFromJSON(json['identity']), + 'context': json['context'] == null ? undefined : json['context'], + 'id': json['id'] == null ? undefined : json['id'], + }; +} + +export function DropTableRequestToJSON(json: any): DropTableRequest { + return DropTableRequestToJSONTyped(json, false); +} + +export function DropTableRequestToJSONTyped(value?: DropTableRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'identity': IdentityToJSON(value['identity']), + 'context': value['context'], + 'id': value['id'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/DropTableResponse.ts b/typescript/lance-namespace-fetch-client/src/models/DropTableResponse.ts new file mode 100644 index 000000000..810a8dd61 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/DropTableResponse.ts @@ -0,0 +1,90 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface DropTableResponse + */ +export interface DropTableResponse { + /** + * Optional transaction identifier + * @type {string} + * @memberof DropTableResponse + */ + transaction_id?: string; + /** + * + * @type {Array} + * @memberof DropTableResponse + */ + id?: Array; + /** + * + * @type {string} + * @memberof DropTableResponse + */ + location?: string; + /** + * If the implementation does not support table properties, it should return null for this field. Otherwise it should return the properties. + * + * @type {{ [key: string]: string; }} + * @memberof DropTableResponse + */ + properties?: { [key: string]: string; }; +} + +/** + * Check if a given object implements the DropTableResponse interface. + */ +export function instanceOfDropTableResponse(value: object): value is DropTableResponse { + return true; +} + +export function DropTableResponseFromJSON(json: any): DropTableResponse { + return DropTableResponseFromJSONTyped(json, false); +} + +export function DropTableResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): DropTableResponse { + if (json == null) { + return json; + } + return { + + 'transaction_id': json['transaction_id'] == null ? undefined : json['transaction_id'], + 'id': json['id'] == null ? undefined : json['id'], + 'location': json['location'] == null ? undefined : json['location'], + 'properties': json['properties'] == null ? undefined : json['properties'], + }; +} + +export function DropTableResponseToJSON(json: any): DropTableResponse { + return DropTableResponseToJSONTyped(json, false); +} + +export function DropTableResponseToJSONTyped(value?: DropTableResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'transaction_id': value['transaction_id'], + 'id': value['id'], + 'location': value['location'], + 'properties': value['properties'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/ErrorResponse.ts b/typescript/lance-namespace-fetch-client/src/models/ErrorResponse.ts new file mode 100644 index 000000000..f6ca78f31 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/ErrorResponse.ts @@ -0,0 +1,119 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * Common JSON error response model + * @export + * @interface ErrorResponse + */ +export interface ErrorResponse { + /** + * A brief, human-readable message about the error. + * @type {string} + * @memberof ErrorResponse + */ + error?: string; + /** + * Lance Namespace error code identifying the error type. + * + * Error codes: + * 0 - Unsupported: Operation not supported by this backend + * 1 - NamespaceNotFound: The specified namespace does not exist + * 2 - NamespaceAlreadyExists: A namespace with this name already exists + * 3 - NamespaceNotEmpty: Namespace contains tables or child namespaces + * 4 - TableNotFound: The specified table does not exist + * 5 - TableAlreadyExists: A table with this name already exists + * 6 - TableIndexNotFound: The specified table index does not exist + * 7 - TableIndexAlreadyExists: A table index with this name already exists + * 8 - TableTagNotFound: The specified table tag does not exist + * 9 - TableTagAlreadyExists: A table tag with this name already exists + * 10 - TransactionNotFound: The specified transaction does not exist + * 11 - TableVersionNotFound: The specified table version does not exist + * 12 - TableColumnNotFound: The specified table column does not exist + * 13 - InvalidInput: Malformed request or invalid parameters + * 14 - ConcurrentModification: Optimistic concurrency conflict + * 15 - PermissionDenied: User lacks permission for this operation + * 16 - Unauthenticated: Authentication credentials are missing or invalid + * 17 - ServiceUnavailable: Service is temporarily unavailable + * 18 - Internal: Unexpected server/implementation error + * 19 - InvalidTableState: Table is in an invalid state for the operation + * 20 - TableSchemaValidationError: Table schema validation failed + * + * @type {number} + * @memberof ErrorResponse + */ + code: number; + /** + * An optional human-readable explanation of the error. + * This can be used to record additional information such as stack trace. + * + * @type {string} + * @memberof ErrorResponse + */ + detail?: string; + /** + * A string that identifies the specific occurrence of the error. + * This can be a URI, a request or response ID, + * or anything that the implementation can recognize to trace specific occurrence of the error. + * + * @type {string} + * @memberof ErrorResponse + */ + instance?: string; +} + +/** + * Check if a given object implements the ErrorResponse interface. + */ +export function instanceOfErrorResponse(value: object): value is ErrorResponse { + if (!('code' in value) || value['code'] === undefined) return false; + return true; +} + +export function ErrorResponseFromJSON(json: any): ErrorResponse { + return ErrorResponseFromJSONTyped(json, false); +} + +export function ErrorResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ErrorResponse { + if (json == null) { + return json; + } + return { + + 'error': json['error'] == null ? undefined : json['error'], + 'code': json['code'], + 'detail': json['detail'] == null ? undefined : json['detail'], + 'instance': json['instance'] == null ? undefined : json['instance'], + }; +} + +export function ErrorResponseToJSON(json: any): ErrorResponse { + return ErrorResponseToJSONTyped(json, false); +} + +export function ErrorResponseToJSONTyped(value?: ErrorResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'error': value['error'], + 'code': value['code'], + 'detail': value['detail'], + 'instance': value['instance'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/ExplainTableQueryPlanRequest.ts b/typescript/lance-namespace-fetch-client/src/models/ExplainTableQueryPlanRequest.ts new file mode 100644 index 000000000..76cebf1ae --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/ExplainTableQueryPlanRequest.ts @@ -0,0 +1,120 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { QueryTableRequest } from './QueryTableRequest'; +import { + QueryTableRequestFromJSON, + QueryTableRequestFromJSONTyped, + QueryTableRequestToJSON, + QueryTableRequestToJSONTyped, +} from './QueryTableRequest'; +import type { Identity } from './Identity'; +import { + IdentityFromJSON, + IdentityFromJSONTyped, + IdentityToJSON, + IdentityToJSONTyped, +} from './Identity'; + +/** + * + * @export + * @interface ExplainTableQueryPlanRequest + */ +export interface ExplainTableQueryPlanRequest { + /** + * + * @type {Identity} + * @memberof ExplainTableQueryPlanRequest + */ + identity?: Identity; + /** + * Arbitrary context for a request as key-value pairs. + * How to use the context is custom to the specific implementation. + * + * REST NAMESPACE ONLY + * Context entries are passed via HTTP headers using the naming convention + * `x-lance-ctx-: `. For example, a context entry + * `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + * + * @type {{ [key: string]: string; }} + * @memberof ExplainTableQueryPlanRequest + */ + context?: { [key: string]: string; }; + /** + * + * @type {Array} + * @memberof ExplainTableQueryPlanRequest + */ + id?: Array; + /** + * + * @type {QueryTableRequest} + * @memberof ExplainTableQueryPlanRequest + */ + query: QueryTableRequest; + /** + * Whether to return verbose explanation + * @type {boolean} + * @memberof ExplainTableQueryPlanRequest + */ + verbose?: boolean; +} + +/** + * Check if a given object implements the ExplainTableQueryPlanRequest interface. + */ +export function instanceOfExplainTableQueryPlanRequest(value: object): value is ExplainTableQueryPlanRequest { + if (!('query' in value) || value['query'] === undefined) return false; + return true; +} + +export function ExplainTableQueryPlanRequestFromJSON(json: any): ExplainTableQueryPlanRequest { + return ExplainTableQueryPlanRequestFromJSONTyped(json, false); +} + +export function ExplainTableQueryPlanRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): ExplainTableQueryPlanRequest { + if (json == null) { + return json; + } + return { + + 'identity': json['identity'] == null ? undefined : IdentityFromJSON(json['identity']), + 'context': json['context'] == null ? undefined : json['context'], + 'id': json['id'] == null ? undefined : json['id'], + 'query': QueryTableRequestFromJSON(json['query']), + 'verbose': json['verbose'] == null ? undefined : json['verbose'], + }; +} + +export function ExplainTableQueryPlanRequestToJSON(json: any): ExplainTableQueryPlanRequest { + return ExplainTableQueryPlanRequestToJSONTyped(json, false); +} + +export function ExplainTableQueryPlanRequestToJSONTyped(value?: ExplainTableQueryPlanRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'identity': IdentityToJSON(value['identity']), + 'context': value['context'], + 'id': value['id'], + 'query': QueryTableRequestToJSON(value['query']), + 'verbose': value['verbose'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/ExplainTableQueryPlanResponse.ts b/typescript/lance-namespace-fetch-client/src/models/ExplainTableQueryPlanResponse.ts new file mode 100644 index 000000000..468caba39 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/ExplainTableQueryPlanResponse.ts @@ -0,0 +1,66 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface ExplainTableQueryPlanResponse + */ +export interface ExplainTableQueryPlanResponse { + /** + * Human-readable query execution plan + * @type {string} + * @memberof ExplainTableQueryPlanResponse + */ + plan: string; +} + +/** + * Check if a given object implements the ExplainTableQueryPlanResponse interface. + */ +export function instanceOfExplainTableQueryPlanResponse(value: object): value is ExplainTableQueryPlanResponse { + if (!('plan' in value) || value['plan'] === undefined) return false; + return true; +} + +export function ExplainTableQueryPlanResponseFromJSON(json: any): ExplainTableQueryPlanResponse { + return ExplainTableQueryPlanResponseFromJSONTyped(json, false); +} + +export function ExplainTableQueryPlanResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ExplainTableQueryPlanResponse { + if (json == null) { + return json; + } + return { + + 'plan': json['plan'], + }; +} + +export function ExplainTableQueryPlanResponseToJSON(json: any): ExplainTableQueryPlanResponse { + return ExplainTableQueryPlanResponseToJSONTyped(json, false); +} + +export function ExplainTableQueryPlanResponseToJSONTyped(value?: ExplainTableQueryPlanResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'plan': value['plan'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/FragmentStats.ts b/typescript/lance-namespace-fetch-client/src/models/FragmentStats.ts new file mode 100644 index 000000000..aa10395c4 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/FragmentStats.ts @@ -0,0 +1,92 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { FragmentSummary } from './FragmentSummary'; +import { + FragmentSummaryFromJSON, + FragmentSummaryFromJSONTyped, + FragmentSummaryToJSON, + FragmentSummaryToJSONTyped, +} from './FragmentSummary'; + +/** + * + * @export + * @interface FragmentStats + */ +export interface FragmentStats { + /** + * The number of fragments in the table + * @type {number} + * @memberof FragmentStats + */ + num_fragments: number; + /** + * The number of uncompacted fragments in the table + * @type {number} + * @memberof FragmentStats + */ + num_small_fragments: number; + /** + * Statistics on the number of rows in the table fragments + * @type {FragmentSummary} + * @memberof FragmentStats + */ + lengths: FragmentSummary; +} + +/** + * Check if a given object implements the FragmentStats interface. + */ +export function instanceOfFragmentStats(value: object): value is FragmentStats { + if (!('num_fragments' in value) || value['num_fragments'] === undefined) return false; + if (!('num_small_fragments' in value) || value['num_small_fragments'] === undefined) return false; + if (!('lengths' in value) || value['lengths'] === undefined) return false; + return true; +} + +export function FragmentStatsFromJSON(json: any): FragmentStats { + return FragmentStatsFromJSONTyped(json, false); +} + +export function FragmentStatsFromJSONTyped(json: any, ignoreDiscriminator: boolean): FragmentStats { + if (json == null) { + return json; + } + return { + + 'num_fragments': json['num_fragments'], + 'num_small_fragments': json['num_small_fragments'], + 'lengths': FragmentSummaryFromJSON(json['lengths']), + }; +} + +export function FragmentStatsToJSON(json: any): FragmentStats { + return FragmentStatsToJSONTyped(json, false); +} + +export function FragmentStatsToJSONTyped(value?: FragmentStats | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'num_fragments': value['num_fragments'], + 'num_small_fragments': value['num_small_fragments'], + 'lengths': FragmentSummaryToJSON(value['lengths']), + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/FragmentSummary.ts b/typescript/lance-namespace-fetch-client/src/models/FragmentSummary.ts new file mode 100644 index 000000000..b1bf24db0 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/FragmentSummary.ts @@ -0,0 +1,120 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface FragmentSummary + */ +export interface FragmentSummary { + /** + * + * @type {number} + * @memberof FragmentSummary + */ + min: number; + /** + * + * @type {number} + * @memberof FragmentSummary + */ + max: number; + /** + * + * @type {number} + * @memberof FragmentSummary + */ + mean: number; + /** + * + * @type {number} + * @memberof FragmentSummary + */ + p25: number; + /** + * + * @type {number} + * @memberof FragmentSummary + */ + p50: number; + /** + * + * @type {number} + * @memberof FragmentSummary + */ + p75: number; + /** + * + * @type {number} + * @memberof FragmentSummary + */ + p99: number; +} + +/** + * Check if a given object implements the FragmentSummary interface. + */ +export function instanceOfFragmentSummary(value: object): value is FragmentSummary { + if (!('min' in value) || value['min'] === undefined) return false; + if (!('max' in value) || value['max'] === undefined) return false; + if (!('mean' in value) || value['mean'] === undefined) return false; + if (!('p25' in value) || value['p25'] === undefined) return false; + if (!('p50' in value) || value['p50'] === undefined) return false; + if (!('p75' in value) || value['p75'] === undefined) return false; + if (!('p99' in value) || value['p99'] === undefined) return false; + return true; +} + +export function FragmentSummaryFromJSON(json: any): FragmentSummary { + return FragmentSummaryFromJSONTyped(json, false); +} + +export function FragmentSummaryFromJSONTyped(json: any, ignoreDiscriminator: boolean): FragmentSummary { + if (json == null) { + return json; + } + return { + + 'min': json['min'], + 'max': json['max'], + 'mean': json['mean'], + 'p25': json['p25'], + 'p50': json['p50'], + 'p75': json['p75'], + 'p99': json['p99'], + }; +} + +export function FragmentSummaryToJSON(json: any): FragmentSummary { + return FragmentSummaryToJSONTyped(json, false); +} + +export function FragmentSummaryToJSONTyped(value?: FragmentSummary | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'min': value['min'], + 'max': value['max'], + 'mean': value['mean'], + 'p25': value['p25'], + 'p50': value['p50'], + 'p75': value['p75'], + 'p99': value['p99'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/FtsQuery.ts b/typescript/lance-namespace-fetch-client/src/models/FtsQuery.ts new file mode 100644 index 000000000..1fcb0e1f7 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/FtsQuery.ts @@ -0,0 +1,136 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { BooleanQuery } from './BooleanQuery'; +import { + BooleanQueryFromJSON, + BooleanQueryFromJSONTyped, + BooleanQueryToJSON, + BooleanQueryToJSONTyped, +} from './BooleanQuery'; +import type { PhraseQuery } from './PhraseQuery'; +import { + PhraseQueryFromJSON, + PhraseQueryFromJSONTyped, + PhraseQueryToJSON, + PhraseQueryToJSONTyped, +} from './PhraseQuery'; +import type { MultiMatchQuery } from './MultiMatchQuery'; +import { + MultiMatchQueryFromJSON, + MultiMatchQueryFromJSONTyped, + MultiMatchQueryToJSON, + MultiMatchQueryToJSONTyped, +} from './MultiMatchQuery'; +import type { MatchQuery } from './MatchQuery'; +import { + MatchQueryFromJSON, + MatchQueryFromJSONTyped, + MatchQueryToJSON, + MatchQueryToJSONTyped, +} from './MatchQuery'; +import type { BoostQuery } from './BoostQuery'; +import { + BoostQueryFromJSON, + BoostQueryFromJSONTyped, + BoostQueryToJSON, + BoostQueryToJSONTyped, +} from './BoostQuery'; + +/** + * Full-text search query. Exactly one query type field must be provided. + * This structure follows the same pattern as AlterTransactionAction to minimize + * differences and compatibility issues across codegen in different languages. + * + * @export + * @interface FtsQuery + */ +export interface FtsQuery { + /** + * + * @type {MatchQuery} + * @memberof FtsQuery + */ + match?: MatchQuery; + /** + * + * @type {PhraseQuery} + * @memberof FtsQuery + */ + phrase?: PhraseQuery; + /** + * + * @type {BoostQuery} + * @memberof FtsQuery + */ + boost?: BoostQuery; + /** + * + * @type {MultiMatchQuery} + * @memberof FtsQuery + */ + multi_match?: MultiMatchQuery; + /** + * + * @type {BooleanQuery} + * @memberof FtsQuery + */ + _boolean?: BooleanQuery; +} + +/** + * Check if a given object implements the FtsQuery interface. + */ +export function instanceOfFtsQuery(value: object): value is FtsQuery { + return true; +} + +export function FtsQueryFromJSON(json: any): FtsQuery { + return FtsQueryFromJSONTyped(json, false); +} + +export function FtsQueryFromJSONTyped(json: any, ignoreDiscriminator: boolean): FtsQuery { + if (json == null) { + return json; + } + return { + + 'match': json['match'] == null ? undefined : MatchQueryFromJSON(json['match']), + 'phrase': json['phrase'] == null ? undefined : PhraseQueryFromJSON(json['phrase']), + 'boost': json['boost'] == null ? undefined : BoostQueryFromJSON(json['boost']), + 'multi_match': json['multi_match'] == null ? undefined : MultiMatchQueryFromJSON(json['multi_match']), + '_boolean': json['boolean'] == null ? undefined : BooleanQueryFromJSON(json['boolean']), + }; +} + +export function FtsQueryToJSON(json: any): FtsQuery { + return FtsQueryToJSONTyped(json, false); +} + +export function FtsQueryToJSONTyped(value?: FtsQuery | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'match': MatchQueryToJSON(value['match']), + 'phrase': PhraseQueryToJSON(value['phrase']), + 'boost': BoostQueryToJSON(value['boost']), + 'multi_match': MultiMatchQueryToJSON(value['multi_match']), + 'boolean': BooleanQueryToJSON(value['_boolean']), + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/GetTableStatsRequest.ts b/typescript/lance-namespace-fetch-client/src/models/GetTableStatsRequest.ts new file mode 100644 index 000000000..5d6e342b4 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/GetTableStatsRequest.ts @@ -0,0 +1,96 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Identity } from './Identity'; +import { + IdentityFromJSON, + IdentityFromJSONTyped, + IdentityToJSON, + IdentityToJSONTyped, +} from './Identity'; + +/** + * + * @export + * @interface GetTableStatsRequest + */ +export interface GetTableStatsRequest { + /** + * + * @type {Identity} + * @memberof GetTableStatsRequest + */ + identity?: Identity; + /** + * Arbitrary context for a request as key-value pairs. + * How to use the context is custom to the specific implementation. + * + * REST NAMESPACE ONLY + * Context entries are passed via HTTP headers using the naming convention + * `x-lance-ctx-: `. For example, a context entry + * `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + * + * @type {{ [key: string]: string; }} + * @memberof GetTableStatsRequest + */ + context?: { [key: string]: string; }; + /** + * + * @type {Array} + * @memberof GetTableStatsRequest + */ + id?: Array; +} + +/** + * Check if a given object implements the GetTableStatsRequest interface. + */ +export function instanceOfGetTableStatsRequest(value: object): value is GetTableStatsRequest { + return true; +} + +export function GetTableStatsRequestFromJSON(json: any): GetTableStatsRequest { + return GetTableStatsRequestFromJSONTyped(json, false); +} + +export function GetTableStatsRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetTableStatsRequest { + if (json == null) { + return json; + } + return { + + 'identity': json['identity'] == null ? undefined : IdentityFromJSON(json['identity']), + 'context': json['context'] == null ? undefined : json['context'], + 'id': json['id'] == null ? undefined : json['id'], + }; +} + +export function GetTableStatsRequestToJSON(json: any): GetTableStatsRequest { + return GetTableStatsRequestToJSONTyped(json, false); +} + +export function GetTableStatsRequestToJSONTyped(value?: GetTableStatsRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'identity': IdentityToJSON(value['identity']), + 'context': value['context'], + 'id': value['id'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/GetTableStatsResponse.ts b/typescript/lance-namespace-fetch-client/src/models/GetTableStatsResponse.ts new file mode 100644 index 000000000..c4315787e --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/GetTableStatsResponse.ts @@ -0,0 +1,101 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { FragmentStats } from './FragmentStats'; +import { + FragmentStatsFromJSON, + FragmentStatsFromJSONTyped, + FragmentStatsToJSON, + FragmentStatsToJSONTyped, +} from './FragmentStats'; + +/** + * + * @export + * @interface GetTableStatsResponse + */ +export interface GetTableStatsResponse { + /** + * The total number of bytes in the table + * @type {number} + * @memberof GetTableStatsResponse + */ + total_bytes: number; + /** + * The number of rows in the table + * @type {number} + * @memberof GetTableStatsResponse + */ + num_rows: number; + /** + * The number of indices in the table + * @type {number} + * @memberof GetTableStatsResponse + */ + num_indices: number; + /** + * Statistics on table fragments + * @type {FragmentStats} + * @memberof GetTableStatsResponse + */ + fragment_stats: FragmentStats; +} + +/** + * Check if a given object implements the GetTableStatsResponse interface. + */ +export function instanceOfGetTableStatsResponse(value: object): value is GetTableStatsResponse { + if (!('total_bytes' in value) || value['total_bytes'] === undefined) return false; + if (!('num_rows' in value) || value['num_rows'] === undefined) return false; + if (!('num_indices' in value) || value['num_indices'] === undefined) return false; + if (!('fragment_stats' in value) || value['fragment_stats'] === undefined) return false; + return true; +} + +export function GetTableStatsResponseFromJSON(json: any): GetTableStatsResponse { + return GetTableStatsResponseFromJSONTyped(json, false); +} + +export function GetTableStatsResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetTableStatsResponse { + if (json == null) { + return json; + } + return { + + 'total_bytes': json['total_bytes'], + 'num_rows': json['num_rows'], + 'num_indices': json['num_indices'], + 'fragment_stats': FragmentStatsFromJSON(json['fragment_stats']), + }; +} + +export function GetTableStatsResponseToJSON(json: any): GetTableStatsResponse { + return GetTableStatsResponseToJSONTyped(json, false); +} + +export function GetTableStatsResponseToJSONTyped(value?: GetTableStatsResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'total_bytes': value['total_bytes'], + 'num_rows': value['num_rows'], + 'num_indices': value['num_indices'], + 'fragment_stats': FragmentStatsToJSON(value['fragment_stats']), + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/GetTableTagVersionRequest.ts b/typescript/lance-namespace-fetch-client/src/models/GetTableTagVersionRequest.ts new file mode 100644 index 000000000..6c1598f92 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/GetTableTagVersionRequest.ts @@ -0,0 +1,105 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Identity } from './Identity'; +import { + IdentityFromJSON, + IdentityFromJSONTyped, + IdentityToJSON, + IdentityToJSONTyped, +} from './Identity'; + +/** + * + * @export + * @interface GetTableTagVersionRequest + */ +export interface GetTableTagVersionRequest { + /** + * + * @type {Identity} + * @memberof GetTableTagVersionRequest + */ + identity?: Identity; + /** + * Arbitrary context for a request as key-value pairs. + * How to use the context is custom to the specific implementation. + * + * REST NAMESPACE ONLY + * Context entries are passed via HTTP headers using the naming convention + * `x-lance-ctx-: `. For example, a context entry + * `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + * + * @type {{ [key: string]: string; }} + * @memberof GetTableTagVersionRequest + */ + context?: { [key: string]: string; }; + /** + * + * @type {Array} + * @memberof GetTableTagVersionRequest + */ + id?: Array; + /** + * Name of the tag to get version for + * @type {string} + * @memberof GetTableTagVersionRequest + */ + tag: string; +} + +/** + * Check if a given object implements the GetTableTagVersionRequest interface. + */ +export function instanceOfGetTableTagVersionRequest(value: object): value is GetTableTagVersionRequest { + if (!('tag' in value) || value['tag'] === undefined) return false; + return true; +} + +export function GetTableTagVersionRequestFromJSON(json: any): GetTableTagVersionRequest { + return GetTableTagVersionRequestFromJSONTyped(json, false); +} + +export function GetTableTagVersionRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetTableTagVersionRequest { + if (json == null) { + return json; + } + return { + + 'identity': json['identity'] == null ? undefined : IdentityFromJSON(json['identity']), + 'context': json['context'] == null ? undefined : json['context'], + 'id': json['id'] == null ? undefined : json['id'], + 'tag': json['tag'], + }; +} + +export function GetTableTagVersionRequestToJSON(json: any): GetTableTagVersionRequest { + return GetTableTagVersionRequestToJSONTyped(json, false); +} + +export function GetTableTagVersionRequestToJSONTyped(value?: GetTableTagVersionRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'identity': IdentityToJSON(value['identity']), + 'context': value['context'], + 'id': value['id'], + 'tag': value['tag'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/GetTableTagVersionResponse.ts b/typescript/lance-namespace-fetch-client/src/models/GetTableTagVersionResponse.ts new file mode 100644 index 000000000..5025e29a4 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/GetTableTagVersionResponse.ts @@ -0,0 +1,66 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface GetTableTagVersionResponse + */ +export interface GetTableTagVersionResponse { + /** + * version number that the tag points to + * @type {number} + * @memberof GetTableTagVersionResponse + */ + version: number; +} + +/** + * Check if a given object implements the GetTableTagVersionResponse interface. + */ +export function instanceOfGetTableTagVersionResponse(value: object): value is GetTableTagVersionResponse { + if (!('version' in value) || value['version'] === undefined) return false; + return true; +} + +export function GetTableTagVersionResponseFromJSON(json: any): GetTableTagVersionResponse { + return GetTableTagVersionResponseFromJSONTyped(json, false); +} + +export function GetTableTagVersionResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetTableTagVersionResponse { + if (json == null) { + return json; + } + return { + + 'version': json['version'], + }; +} + +export function GetTableTagVersionResponseToJSON(json: any): GetTableTagVersionResponse { + return GetTableTagVersionResponseToJSONTyped(json, false); +} + +export function GetTableTagVersionResponseToJSONTyped(value?: GetTableTagVersionResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'version': value['version'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/Identity.ts b/typescript/lance-namespace-fetch-client/src/models/Identity.ts new file mode 100644 index 000000000..3f1af5f38 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/Identity.ts @@ -0,0 +1,83 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * Identity information of a request. + * + * @export + * @interface Identity + */ +export interface Identity { + /** + * API key for authentication. + * + * REST NAMESPACE ONLY + * This is passed via the `x-api-key` header. + * + * @type {string} + * @memberof Identity + */ + api_key?: string; + /** + * Bearer token for authentication. + * + * REST NAMESPACE ONLY + * This is passed via the `Authorization` header + * with the Bearer scheme (e.g., `Bearer `). + * + * @type {string} + * @memberof Identity + */ + auth_token?: string; +} + +/** + * Check if a given object implements the Identity interface. + */ +export function instanceOfIdentity(value: object): value is Identity { + return true; +} + +export function IdentityFromJSON(json: any): Identity { + return IdentityFromJSONTyped(json, false); +} + +export function IdentityFromJSONTyped(json: any, ignoreDiscriminator: boolean): Identity { + if (json == null) { + return json; + } + return { + + 'api_key': json['api_key'] == null ? undefined : json['api_key'], + 'auth_token': json['auth_token'] == null ? undefined : json['auth_token'], + }; +} + +export function IdentityToJSON(json: any): Identity { + return IdentityToJSONTyped(json, false); +} + +export function IdentityToJSONTyped(value?: Identity | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'api_key': value['api_key'], + 'auth_token': value['auth_token'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/IndexContent.ts b/typescript/lance-namespace-fetch-client/src/models/IndexContent.ts new file mode 100644 index 000000000..ad8178680 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/IndexContent.ts @@ -0,0 +1,93 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface IndexContent + */ +export interface IndexContent { + /** + * Name of the index + * @type {string} + * @memberof IndexContent + */ + index_name: string; + /** + * Unique identifier for the index + * @type {string} + * @memberof IndexContent + */ + index_uuid: string; + /** + * Columns covered by this index + * @type {Array} + * @memberof IndexContent + */ + columns: Array; + /** + * Current status of the index + * @type {string} + * @memberof IndexContent + */ + status: string; +} + +/** + * Check if a given object implements the IndexContent interface. + */ +export function instanceOfIndexContent(value: object): value is IndexContent { + if (!('index_name' in value) || value['index_name'] === undefined) return false; + if (!('index_uuid' in value) || value['index_uuid'] === undefined) return false; + if (!('columns' in value) || value['columns'] === undefined) return false; + if (!('status' in value) || value['status'] === undefined) return false; + return true; +} + +export function IndexContentFromJSON(json: any): IndexContent { + return IndexContentFromJSONTyped(json, false); +} + +export function IndexContentFromJSONTyped(json: any, ignoreDiscriminator: boolean): IndexContent { + if (json == null) { + return json; + } + return { + + 'index_name': json['index_name'], + 'index_uuid': json['index_uuid'], + 'columns': json['columns'], + 'status': json['status'], + }; +} + +export function IndexContentToJSON(json: any): IndexContent { + return IndexContentToJSONTyped(json, false); +} + +export function IndexContentToJSONTyped(value?: IndexContent | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'index_name': value['index_name'], + 'index_uuid': value['index_uuid'], + 'columns': value['columns'], + 'status': value['status'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/InsertIntoTableRequest.ts b/typescript/lance-namespace-fetch-client/src/models/InsertIntoTableRequest.ts new file mode 100644 index 000000000..71b62546c --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/InsertIntoTableRequest.ts @@ -0,0 +1,108 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Identity } from './Identity'; +import { + IdentityFromJSON, + IdentityFromJSONTyped, + IdentityToJSON, + IdentityToJSONTyped, +} from './Identity'; + +/** + * Request for inserting records into a table, excluding the Arrow IPC stream. + * + * @export + * @interface InsertIntoTableRequest + */ +export interface InsertIntoTableRequest { + /** + * + * @type {Identity} + * @memberof InsertIntoTableRequest + */ + identity?: Identity; + /** + * Arbitrary context for a request as key-value pairs. + * How to use the context is custom to the specific implementation. + * + * REST NAMESPACE ONLY + * Context entries are passed via HTTP headers using the naming convention + * `x-lance-ctx-: `. For example, a context entry + * `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + * + * @type {{ [key: string]: string; }} + * @memberof InsertIntoTableRequest + */ + context?: { [key: string]: string; }; + /** + * + * @type {Array} + * @memberof InsertIntoTableRequest + */ + id?: Array; + /** + * How the insert should behave. Case insensitive, supports both PascalCase and snake_case. Valid values are: + * - Append (default): insert data to the existing table + * - Overwrite: remove all data in the table and then insert data to it + * + * @type {string} + * @memberof InsertIntoTableRequest + */ + mode?: string; +} + +/** + * Check if a given object implements the InsertIntoTableRequest interface. + */ +export function instanceOfInsertIntoTableRequest(value: object): value is InsertIntoTableRequest { + return true; +} + +export function InsertIntoTableRequestFromJSON(json: any): InsertIntoTableRequest { + return InsertIntoTableRequestFromJSONTyped(json, false); +} + +export function InsertIntoTableRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): InsertIntoTableRequest { + if (json == null) { + return json; + } + return { + + 'identity': json['identity'] == null ? undefined : IdentityFromJSON(json['identity']), + 'context': json['context'] == null ? undefined : json['context'], + 'id': json['id'] == null ? undefined : json['id'], + 'mode': json['mode'] == null ? undefined : json['mode'], + }; +} + +export function InsertIntoTableRequestToJSON(json: any): InsertIntoTableRequest { + return InsertIntoTableRequestToJSONTyped(json, false); +} + +export function InsertIntoTableRequestToJSONTyped(value?: InsertIntoTableRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'identity': IdentityToJSON(value['identity']), + 'context': value['context'], + 'id': value['id'], + 'mode': value['mode'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/InsertIntoTableResponse.ts b/typescript/lance-namespace-fetch-client/src/models/InsertIntoTableResponse.ts new file mode 100644 index 000000000..85d896d7f --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/InsertIntoTableResponse.ts @@ -0,0 +1,65 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * Response from inserting records into a table + * @export + * @interface InsertIntoTableResponse + */ +export interface InsertIntoTableResponse { + /** + * Optional transaction identifier + * @type {string} + * @memberof InsertIntoTableResponse + */ + transaction_id?: string; +} + +/** + * Check if a given object implements the InsertIntoTableResponse interface. + */ +export function instanceOfInsertIntoTableResponse(value: object): value is InsertIntoTableResponse { + return true; +} + +export function InsertIntoTableResponseFromJSON(json: any): InsertIntoTableResponse { + return InsertIntoTableResponseFromJSONTyped(json, false); +} + +export function InsertIntoTableResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): InsertIntoTableResponse { + if (json == null) { + return json; + } + return { + + 'transaction_id': json['transaction_id'] == null ? undefined : json['transaction_id'], + }; +} + +export function InsertIntoTableResponseToJSON(json: any): InsertIntoTableResponse { + return InsertIntoTableResponseToJSONTyped(json, false); +} + +export function InsertIntoTableResponseToJSONTyped(value?: InsertIntoTableResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'transaction_id': value['transaction_id'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/JsonArrowDataType.ts b/typescript/lance-namespace-fetch-client/src/models/JsonArrowDataType.ts new file mode 100644 index 000000000..abc0a4538 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/JsonArrowDataType.ts @@ -0,0 +1,90 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { JsonArrowField } from './JsonArrowField'; +import { + JsonArrowFieldFromJSON, + JsonArrowFieldFromJSONTyped, + JsonArrowFieldToJSON, + JsonArrowFieldToJSONTyped, +} from './JsonArrowField'; + +/** + * JSON representation of an Apache Arrow DataType + * @export + * @interface JsonArrowDataType + */ +export interface JsonArrowDataType { + /** + * Fields for complex types like Struct, Union, etc. + * @type {Array} + * @memberof JsonArrowDataType + */ + fields?: Array; + /** + * Length for fixed-size types + * @type {number} + * @memberof JsonArrowDataType + */ + length?: number; + /** + * The data type name + * @type {string} + * @memberof JsonArrowDataType + */ + type: string; +} + +/** + * Check if a given object implements the JsonArrowDataType interface. + */ +export function instanceOfJsonArrowDataType(value: object): value is JsonArrowDataType { + if (!('type' in value) || value['type'] === undefined) return false; + return true; +} + +export function JsonArrowDataTypeFromJSON(json: any): JsonArrowDataType { + return JsonArrowDataTypeFromJSONTyped(json, false); +} + +export function JsonArrowDataTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): JsonArrowDataType { + if (json == null) { + return json; + } + return { + + 'fields': json['fields'] == null ? undefined : ((json['fields'] as Array).map(JsonArrowFieldFromJSON)), + 'length': json['length'] == null ? undefined : json['length'], + 'type': json['type'], + }; +} + +export function JsonArrowDataTypeToJSON(json: any): JsonArrowDataType { + return JsonArrowDataTypeToJSONTyped(json, false); +} + +export function JsonArrowDataTypeToJSONTyped(value?: JsonArrowDataType | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'fields': value['fields'] == null ? undefined : ((value['fields'] as Array).map(JsonArrowFieldToJSON)), + 'length': value['length'], + 'type': value['type'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/JsonArrowField.ts b/typescript/lance-namespace-fetch-client/src/models/JsonArrowField.ts new file mode 100644 index 000000000..21926f1f8 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/JsonArrowField.ts @@ -0,0 +1,101 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { JsonArrowDataType } from './JsonArrowDataType'; +import { + JsonArrowDataTypeFromJSON, + JsonArrowDataTypeFromJSONTyped, + JsonArrowDataTypeToJSON, + JsonArrowDataTypeToJSONTyped, +} from './JsonArrowDataType'; + +/** + * JSON representation of an Apache Arrow field. + * + * @export + * @interface JsonArrowField + */ +export interface JsonArrowField { + /** + * + * @type {{ [key: string]: string; }} + * @memberof JsonArrowField + */ + metadata?: { [key: string]: string; }; + /** + * + * @type {string} + * @memberof JsonArrowField + */ + name: string; + /** + * + * @type {boolean} + * @memberof JsonArrowField + */ + nullable: boolean; + /** + * + * @type {JsonArrowDataType} + * @memberof JsonArrowField + */ + type: JsonArrowDataType; +} + +/** + * Check if a given object implements the JsonArrowField interface. + */ +export function instanceOfJsonArrowField(value: object): value is JsonArrowField { + if (!('name' in value) || value['name'] === undefined) return false; + if (!('nullable' in value) || value['nullable'] === undefined) return false; + if (!('type' in value) || value['type'] === undefined) return false; + return true; +} + +export function JsonArrowFieldFromJSON(json: any): JsonArrowField { + return JsonArrowFieldFromJSONTyped(json, false); +} + +export function JsonArrowFieldFromJSONTyped(json: any, ignoreDiscriminator: boolean): JsonArrowField { + if (json == null) { + return json; + } + return { + + 'metadata': json['metadata'] == null ? undefined : json['metadata'], + 'name': json['name'], + 'nullable': json['nullable'], + 'type': JsonArrowDataTypeFromJSON(json['type']), + }; +} + +export function JsonArrowFieldToJSON(json: any): JsonArrowField { + return JsonArrowFieldToJSONTyped(json, false); +} + +export function JsonArrowFieldToJSONTyped(value?: JsonArrowField | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'metadata': value['metadata'], + 'name': value['name'], + 'nullable': value['nullable'], + 'type': JsonArrowDataTypeToJSON(value['type']), + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/JsonArrowSchema.ts b/typescript/lance-namespace-fetch-client/src/models/JsonArrowSchema.ts new file mode 100644 index 000000000..9564e2b05 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/JsonArrowSchema.ts @@ -0,0 +1,83 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { JsonArrowField } from './JsonArrowField'; +import { + JsonArrowFieldFromJSON, + JsonArrowFieldFromJSONTyped, + JsonArrowFieldToJSON, + JsonArrowFieldToJSONTyped, +} from './JsonArrowField'; + +/** + * JSON representation of a Apache Arrow schema. + * + * @export + * @interface JsonArrowSchema + */ +export interface JsonArrowSchema { + /** + * + * @type {Array} + * @memberof JsonArrowSchema + */ + fields: Array; + /** + * + * @type {{ [key: string]: string; }} + * @memberof JsonArrowSchema + */ + metadata?: { [key: string]: string; }; +} + +/** + * Check if a given object implements the JsonArrowSchema interface. + */ +export function instanceOfJsonArrowSchema(value: object): value is JsonArrowSchema { + if (!('fields' in value) || value['fields'] === undefined) return false; + return true; +} + +export function JsonArrowSchemaFromJSON(json: any): JsonArrowSchema { + return JsonArrowSchemaFromJSONTyped(json, false); +} + +export function JsonArrowSchemaFromJSONTyped(json: any, ignoreDiscriminator: boolean): JsonArrowSchema { + if (json == null) { + return json; + } + return { + + 'fields': ((json['fields'] as Array).map(JsonArrowFieldFromJSON)), + 'metadata': json['metadata'] == null ? undefined : json['metadata'], + }; +} + +export function JsonArrowSchemaToJSON(json: any): JsonArrowSchema { + return JsonArrowSchemaToJSONTyped(json, false); +} + +export function JsonArrowSchemaToJSONTyped(value?: JsonArrowSchema | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'fields': ((value['fields'] as Array).map(JsonArrowFieldToJSON)), + 'metadata': value['metadata'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/ListNamespacesRequest.ts b/typescript/lance-namespace-fetch-client/src/models/ListNamespacesRequest.ts new file mode 100644 index 000000000..fff56aced --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/ListNamespacesRequest.ts @@ -0,0 +1,129 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Identity } from './Identity'; +import { + IdentityFromJSON, + IdentityFromJSONTyped, + IdentityToJSON, + IdentityToJSONTyped, +} from './Identity'; + +/** + * + * @export + * @interface ListNamespacesRequest + */ +export interface ListNamespacesRequest { + /** + * + * @type {Identity} + * @memberof ListNamespacesRequest + */ + identity?: Identity; + /** + * Arbitrary context for a request as key-value pairs. + * How to use the context is custom to the specific implementation. + * + * REST NAMESPACE ONLY + * Context entries are passed via HTTP headers using the naming convention + * `x-lance-ctx-: `. For example, a context entry + * `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + * + * @type {{ [key: string]: string; }} + * @memberof ListNamespacesRequest + */ + context?: { [key: string]: string; }; + /** + * + * @type {Array} + * @memberof ListNamespacesRequest + */ + id?: Array; + /** + * An opaque token that allows pagination for list operations (e.g. ListNamespaces). + * + * For an initial request of a list operation, + * if the implementation cannot return all items in one response, + * or if there are more items than the page limit specified in the request, + * the implementation must return a page token in the response, + * indicating there are more results available. + * + * After the initial request, + * the value of the page token from each response must be used + * as the page token value for the next request. + * + * Caller must interpret either `null`, + * missing value or empty string value of the page token from + * the implementation's response as the end of the listing results. + * + * @type {string} + * @memberof ListNamespacesRequest + */ + page_token?: string; + /** + * An inclusive upper bound of the + * number of results that a caller will receive. + * + * @type {number} + * @memberof ListNamespacesRequest + */ + limit?: number; +} + +/** + * Check if a given object implements the ListNamespacesRequest interface. + */ +export function instanceOfListNamespacesRequest(value: object): value is ListNamespacesRequest { + return true; +} + +export function ListNamespacesRequestFromJSON(json: any): ListNamespacesRequest { + return ListNamespacesRequestFromJSONTyped(json, false); +} + +export function ListNamespacesRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): ListNamespacesRequest { + if (json == null) { + return json; + } + return { + + 'identity': json['identity'] == null ? undefined : IdentityFromJSON(json['identity']), + 'context': json['context'] == null ? undefined : json['context'], + 'id': json['id'] == null ? undefined : json['id'], + 'page_token': json['page_token'] == null ? undefined : json['page_token'], + 'limit': json['limit'] == null ? undefined : json['limit'], + }; +} + +export function ListNamespacesRequestToJSON(json: any): ListNamespacesRequest { + return ListNamespacesRequestToJSONTyped(json, false); +} + +export function ListNamespacesRequestToJSONTyped(value?: ListNamespacesRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'identity': IdentityToJSON(value['identity']), + 'context': value['context'], + 'id': value['id'], + 'page_token': value['page_token'], + 'limit': value['limit'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/ListNamespacesResponse.ts b/typescript/lance-namespace-fetch-client/src/models/ListNamespacesResponse.ts new file mode 100644 index 000000000..db8c6cfdf --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/ListNamespacesResponse.ts @@ -0,0 +1,90 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface ListNamespacesResponse + */ +export interface ListNamespacesResponse { + /** + * The list of names of the child namespaces relative to the parent namespace `id` in the request. + * + * @type {Set} + * @memberof ListNamespacesResponse + */ + namespaces: Set; + /** + * An opaque token that allows pagination for list operations (e.g. ListNamespaces). + * + * For an initial request of a list operation, + * if the implementation cannot return all items in one response, + * or if there are more items than the page limit specified in the request, + * the implementation must return a page token in the response, + * indicating there are more results available. + * + * After the initial request, + * the value of the page token from each response must be used + * as the page token value for the next request. + * + * Caller must interpret either `null`, + * missing value or empty string value of the page token from + * the implementation's response as the end of the listing results. + * + * @type {string} + * @memberof ListNamespacesResponse + */ + page_token?: string; +} + +/** + * Check if a given object implements the ListNamespacesResponse interface. + */ +export function instanceOfListNamespacesResponse(value: object): value is ListNamespacesResponse { + if (!('namespaces' in value) || value['namespaces'] === undefined) return false; + return true; +} + +export function ListNamespacesResponseFromJSON(json: any): ListNamespacesResponse { + return ListNamespacesResponseFromJSONTyped(json, false); +} + +export function ListNamespacesResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ListNamespacesResponse { + if (json == null) { + return json; + } + return { + + 'namespaces': new Set(json['namespaces']), + 'page_token': json['page_token'] == null ? undefined : json['page_token'], + }; +} + +export function ListNamespacesResponseToJSON(json: any): ListNamespacesResponse { + return ListNamespacesResponseToJSONTyped(json, false); +} + +export function ListNamespacesResponseToJSONTyped(value?: ListNamespacesResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'namespaces': Array.from(value['namespaces'] as Set), + 'page_token': value['page_token'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/ListTableIndicesRequest.ts b/typescript/lance-namespace-fetch-client/src/models/ListTableIndicesRequest.ts new file mode 100644 index 000000000..13ac01e4c --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/ListTableIndicesRequest.ts @@ -0,0 +1,137 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Identity } from './Identity'; +import { + IdentityFromJSON, + IdentityFromJSONTyped, + IdentityToJSON, + IdentityToJSONTyped, +} from './Identity'; + +/** + * + * @export + * @interface ListTableIndicesRequest + */ +export interface ListTableIndicesRequest { + /** + * + * @type {Identity} + * @memberof ListTableIndicesRequest + */ + identity?: Identity; + /** + * Arbitrary context for a request as key-value pairs. + * How to use the context is custom to the specific implementation. + * + * REST NAMESPACE ONLY + * Context entries are passed via HTTP headers using the naming convention + * `x-lance-ctx-: `. For example, a context entry + * `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + * + * @type {{ [key: string]: string; }} + * @memberof ListTableIndicesRequest + */ + context?: { [key: string]: string; }; + /** + * The namespace identifier + * @type {Array} + * @memberof ListTableIndicesRequest + */ + id?: Array; + /** + * Optional table version to list indexes from + * @type {number} + * @memberof ListTableIndicesRequest + */ + version?: number; + /** + * An opaque token that allows pagination for list operations (e.g. ListNamespaces). + * + * For an initial request of a list operation, + * if the implementation cannot return all items in one response, + * or if there are more items than the page limit specified in the request, + * the implementation must return a page token in the response, + * indicating there are more results available. + * + * After the initial request, + * the value of the page token from each response must be used + * as the page token value for the next request. + * + * Caller must interpret either `null`, + * missing value or empty string value of the page token from + * the implementation's response as the end of the listing results. + * + * @type {string} + * @memberof ListTableIndicesRequest + */ + page_token?: string; + /** + * An inclusive upper bound of the + * number of results that a caller will receive. + * + * @type {number} + * @memberof ListTableIndicesRequest + */ + limit?: number; +} + +/** + * Check if a given object implements the ListTableIndicesRequest interface. + */ +export function instanceOfListTableIndicesRequest(value: object): value is ListTableIndicesRequest { + return true; +} + +export function ListTableIndicesRequestFromJSON(json: any): ListTableIndicesRequest { + return ListTableIndicesRequestFromJSONTyped(json, false); +} + +export function ListTableIndicesRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): ListTableIndicesRequest { + if (json == null) { + return json; + } + return { + + 'identity': json['identity'] == null ? undefined : IdentityFromJSON(json['identity']), + 'context': json['context'] == null ? undefined : json['context'], + 'id': json['id'] == null ? undefined : json['id'], + 'version': json['version'] == null ? undefined : json['version'], + 'page_token': json['page_token'] == null ? undefined : json['page_token'], + 'limit': json['limit'] == null ? undefined : json['limit'], + }; +} + +export function ListTableIndicesRequestToJSON(json: any): ListTableIndicesRequest { + return ListTableIndicesRequestToJSONTyped(json, false); +} + +export function ListTableIndicesRequestToJSONTyped(value?: ListTableIndicesRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'identity': IdentityToJSON(value['identity']), + 'context': value['context'], + 'id': value['id'], + 'version': value['version'], + 'page_token': value['page_token'], + 'limit': value['limit'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/ListTableIndicesResponse.ts b/typescript/lance-namespace-fetch-client/src/models/ListTableIndicesResponse.ts new file mode 100644 index 000000000..a5f01a350 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/ListTableIndicesResponse.ts @@ -0,0 +1,97 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { IndexContent } from './IndexContent'; +import { + IndexContentFromJSON, + IndexContentFromJSONTyped, + IndexContentToJSON, + IndexContentToJSONTyped, +} from './IndexContent'; + +/** + * + * @export + * @interface ListTableIndicesResponse + */ +export interface ListTableIndicesResponse { + /** + * List of indexes on the table + * @type {Array} + * @memberof ListTableIndicesResponse + */ + indexes: Array; + /** + * An opaque token that allows pagination for list operations (e.g. ListNamespaces). + * + * For an initial request of a list operation, + * if the implementation cannot return all items in one response, + * or if there are more items than the page limit specified in the request, + * the implementation must return a page token in the response, + * indicating there are more results available. + * + * After the initial request, + * the value of the page token from each response must be used + * as the page token value for the next request. + * + * Caller must interpret either `null`, + * missing value or empty string value of the page token from + * the implementation's response as the end of the listing results. + * + * @type {string} + * @memberof ListTableIndicesResponse + */ + page_token?: string; +} + +/** + * Check if a given object implements the ListTableIndicesResponse interface. + */ +export function instanceOfListTableIndicesResponse(value: object): value is ListTableIndicesResponse { + if (!('indexes' in value) || value['indexes'] === undefined) return false; + return true; +} + +export function ListTableIndicesResponseFromJSON(json: any): ListTableIndicesResponse { + return ListTableIndicesResponseFromJSONTyped(json, false); +} + +export function ListTableIndicesResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ListTableIndicesResponse { + if (json == null) { + return json; + } + return { + + 'indexes': ((json['indexes'] as Array).map(IndexContentFromJSON)), + 'page_token': json['page_token'] == null ? undefined : json['page_token'], + }; +} + +export function ListTableIndicesResponseToJSON(json: any): ListTableIndicesResponse { + return ListTableIndicesResponseToJSONTyped(json, false); +} + +export function ListTableIndicesResponseToJSONTyped(value?: ListTableIndicesResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'indexes': ((value['indexes'] as Array).map(IndexContentToJSON)), + 'page_token': value['page_token'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/ListTableTagsRequest.ts b/typescript/lance-namespace-fetch-client/src/models/ListTableTagsRequest.ts new file mode 100644 index 000000000..8fa2c19c1 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/ListTableTagsRequest.ts @@ -0,0 +1,129 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Identity } from './Identity'; +import { + IdentityFromJSON, + IdentityFromJSONTyped, + IdentityToJSON, + IdentityToJSONTyped, +} from './Identity'; + +/** + * + * @export + * @interface ListTableTagsRequest + */ +export interface ListTableTagsRequest { + /** + * + * @type {Identity} + * @memberof ListTableTagsRequest + */ + identity?: Identity; + /** + * Arbitrary context for a request as key-value pairs. + * How to use the context is custom to the specific implementation. + * + * REST NAMESPACE ONLY + * Context entries are passed via HTTP headers using the naming convention + * `x-lance-ctx-: `. For example, a context entry + * `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + * + * @type {{ [key: string]: string; }} + * @memberof ListTableTagsRequest + */ + context?: { [key: string]: string; }; + /** + * The table identifier + * @type {Array} + * @memberof ListTableTagsRequest + */ + id?: Array; + /** + * An opaque token that allows pagination for list operations (e.g. ListNamespaces). + * + * For an initial request of a list operation, + * if the implementation cannot return all items in one response, + * or if there are more items than the page limit specified in the request, + * the implementation must return a page token in the response, + * indicating there are more results available. + * + * After the initial request, + * the value of the page token from each response must be used + * as the page token value for the next request. + * + * Caller must interpret either `null`, + * missing value or empty string value of the page token from + * the implementation's response as the end of the listing results. + * + * @type {string} + * @memberof ListTableTagsRequest + */ + page_token?: string; + /** + * An inclusive upper bound of the + * number of results that a caller will receive. + * + * @type {number} + * @memberof ListTableTagsRequest + */ + limit?: number; +} + +/** + * Check if a given object implements the ListTableTagsRequest interface. + */ +export function instanceOfListTableTagsRequest(value: object): value is ListTableTagsRequest { + return true; +} + +export function ListTableTagsRequestFromJSON(json: any): ListTableTagsRequest { + return ListTableTagsRequestFromJSONTyped(json, false); +} + +export function ListTableTagsRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): ListTableTagsRequest { + if (json == null) { + return json; + } + return { + + 'identity': json['identity'] == null ? undefined : IdentityFromJSON(json['identity']), + 'context': json['context'] == null ? undefined : json['context'], + 'id': json['id'] == null ? undefined : json['id'], + 'page_token': json['page_token'] == null ? undefined : json['page_token'], + 'limit': json['limit'] == null ? undefined : json['limit'], + }; +} + +export function ListTableTagsRequestToJSON(json: any): ListTableTagsRequest { + return ListTableTagsRequestToJSONTyped(json, false); +} + +export function ListTableTagsRequestToJSONTyped(value?: ListTableTagsRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'identity': IdentityToJSON(value['identity']), + 'context': value['context'], + 'id': value['id'], + 'page_token': value['page_token'], + 'limit': value['limit'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/ListTableTagsResponse.ts b/typescript/lance-namespace-fetch-client/src/models/ListTableTagsResponse.ts new file mode 100644 index 000000000..b450df271 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/ListTableTagsResponse.ts @@ -0,0 +1,97 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { TagContents } from './TagContents'; +import { + TagContentsFromJSON, + TagContentsFromJSONTyped, + TagContentsToJSON, + TagContentsToJSONTyped, +} from './TagContents'; + +/** + * Response containing table tags + * @export + * @interface ListTableTagsResponse + */ +export interface ListTableTagsResponse { + /** + * Map of tag names to their contents + * @type {{ [key: string]: TagContents; }} + * @memberof ListTableTagsResponse + */ + tags: { [key: string]: TagContents; }; + /** + * An opaque token that allows pagination for list operations (e.g. ListNamespaces). + * + * For an initial request of a list operation, + * if the implementation cannot return all items in one response, + * or if there are more items than the page limit specified in the request, + * the implementation must return a page token in the response, + * indicating there are more results available. + * + * After the initial request, + * the value of the page token from each response must be used + * as the page token value for the next request. + * + * Caller must interpret either `null`, + * missing value or empty string value of the page token from + * the implementation's response as the end of the listing results. + * + * @type {string} + * @memberof ListTableTagsResponse + */ + page_token?: string; +} + +/** + * Check if a given object implements the ListTableTagsResponse interface. + */ +export function instanceOfListTableTagsResponse(value: object): value is ListTableTagsResponse { + if (!('tags' in value) || value['tags'] === undefined) return false; + return true; +} + +export function ListTableTagsResponseFromJSON(json: any): ListTableTagsResponse { + return ListTableTagsResponseFromJSONTyped(json, false); +} + +export function ListTableTagsResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ListTableTagsResponse { + if (json == null) { + return json; + } + return { + + 'tags': (mapValues(json['tags'], TagContentsFromJSON)), + 'page_token': json['page_token'] == null ? undefined : json['page_token'], + }; +} + +export function ListTableTagsResponseToJSON(json: any): ListTableTagsResponse { + return ListTableTagsResponseToJSONTyped(json, false); +} + +export function ListTableTagsResponseToJSONTyped(value?: ListTableTagsResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'tags': (mapValues(value['tags'], TagContentsToJSON)), + 'page_token': value['page_token'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/ListTableVersionsRequest.ts b/typescript/lance-namespace-fetch-client/src/models/ListTableVersionsRequest.ts new file mode 100644 index 000000000..8f387a3bd --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/ListTableVersionsRequest.ts @@ -0,0 +1,139 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Identity } from './Identity'; +import { + IdentityFromJSON, + IdentityFromJSONTyped, + IdentityToJSON, + IdentityToJSONTyped, +} from './Identity'; + +/** + * + * @export + * @interface ListTableVersionsRequest + */ +export interface ListTableVersionsRequest { + /** + * + * @type {Identity} + * @memberof ListTableVersionsRequest + */ + identity?: Identity; + /** + * Arbitrary context for a request as key-value pairs. + * How to use the context is custom to the specific implementation. + * + * REST NAMESPACE ONLY + * Context entries are passed via HTTP headers using the naming convention + * `x-lance-ctx-: `. For example, a context entry + * `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + * + * @type {{ [key: string]: string; }} + * @memberof ListTableVersionsRequest + */ + context?: { [key: string]: string; }; + /** + * + * @type {Array} + * @memberof ListTableVersionsRequest + */ + id?: Array; + /** + * An opaque token that allows pagination for list operations (e.g. ListNamespaces). + * + * For an initial request of a list operation, + * if the implementation cannot return all items in one response, + * or if there are more items than the page limit specified in the request, + * the implementation must return a page token in the response, + * indicating there are more results available. + * + * After the initial request, + * the value of the page token from each response must be used + * as the page token value for the next request. + * + * Caller must interpret either `null`, + * missing value or empty string value of the page token from + * the implementation's response as the end of the listing results. + * + * @type {string} + * @memberof ListTableVersionsRequest + */ + page_token?: string; + /** + * An inclusive upper bound of the + * number of results that a caller will receive. + * + * @type {number} + * @memberof ListTableVersionsRequest + */ + limit?: number; + /** + * When true, versions are guaranteed to be returned in descending order (latest to oldest). + * When false or not specified, the ordering is implementation-defined. + * + * @type {boolean} + * @memberof ListTableVersionsRequest + */ + descending?: boolean; +} + +/** + * Check if a given object implements the ListTableVersionsRequest interface. + */ +export function instanceOfListTableVersionsRequest(value: object): value is ListTableVersionsRequest { + return true; +} + +export function ListTableVersionsRequestFromJSON(json: any): ListTableVersionsRequest { + return ListTableVersionsRequestFromJSONTyped(json, false); +} + +export function ListTableVersionsRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): ListTableVersionsRequest { + if (json == null) { + return json; + } + return { + + 'identity': json['identity'] == null ? undefined : IdentityFromJSON(json['identity']), + 'context': json['context'] == null ? undefined : json['context'], + 'id': json['id'] == null ? undefined : json['id'], + 'page_token': json['page_token'] == null ? undefined : json['page_token'], + 'limit': json['limit'] == null ? undefined : json['limit'], + 'descending': json['descending'] == null ? undefined : json['descending'], + }; +} + +export function ListTableVersionsRequestToJSON(json: any): ListTableVersionsRequest { + return ListTableVersionsRequestToJSONTyped(json, false); +} + +export function ListTableVersionsRequestToJSONTyped(value?: ListTableVersionsRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'identity': IdentityToJSON(value['identity']), + 'context': value['context'], + 'id': value['id'], + 'page_token': value['page_token'], + 'limit': value['limit'], + 'descending': value['descending'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/ListTableVersionsResponse.ts b/typescript/lance-namespace-fetch-client/src/models/ListTableVersionsResponse.ts new file mode 100644 index 000000000..eb44d35f2 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/ListTableVersionsResponse.ts @@ -0,0 +1,99 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { TableVersion } from './TableVersion'; +import { + TableVersionFromJSON, + TableVersionFromJSONTyped, + TableVersionToJSON, + TableVersionToJSONTyped, +} from './TableVersion'; + +/** + * + * @export + * @interface ListTableVersionsResponse + */ +export interface ListTableVersionsResponse { + /** + * List of table versions. When `descending=true`, guaranteed to be ordered from latest to oldest. + * Otherwise, ordering is implementation-defined. + * + * @type {Array} + * @memberof ListTableVersionsResponse + */ + versions: Array; + /** + * An opaque token that allows pagination for list operations (e.g. ListNamespaces). + * + * For an initial request of a list operation, + * if the implementation cannot return all items in one response, + * or if there are more items than the page limit specified in the request, + * the implementation must return a page token in the response, + * indicating there are more results available. + * + * After the initial request, + * the value of the page token from each response must be used + * as the page token value for the next request. + * + * Caller must interpret either `null`, + * missing value or empty string value of the page token from + * the implementation's response as the end of the listing results. + * + * @type {string} + * @memberof ListTableVersionsResponse + */ + page_token?: string; +} + +/** + * Check if a given object implements the ListTableVersionsResponse interface. + */ +export function instanceOfListTableVersionsResponse(value: object): value is ListTableVersionsResponse { + if (!('versions' in value) || value['versions'] === undefined) return false; + return true; +} + +export function ListTableVersionsResponseFromJSON(json: any): ListTableVersionsResponse { + return ListTableVersionsResponseFromJSONTyped(json, false); +} + +export function ListTableVersionsResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ListTableVersionsResponse { + if (json == null) { + return json; + } + return { + + 'versions': ((json['versions'] as Array).map(TableVersionFromJSON)), + 'page_token': json['page_token'] == null ? undefined : json['page_token'], + }; +} + +export function ListTableVersionsResponseToJSON(json: any): ListTableVersionsResponse { + return ListTableVersionsResponseToJSONTyped(json, false); +} + +export function ListTableVersionsResponseToJSONTyped(value?: ListTableVersionsResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'versions': ((value['versions'] as Array).map(TableVersionToJSON)), + 'page_token': value['page_token'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/ListTablesRequest.ts b/typescript/lance-namespace-fetch-client/src/models/ListTablesRequest.ts new file mode 100644 index 000000000..c7e901f3b --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/ListTablesRequest.ts @@ -0,0 +1,129 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Identity } from './Identity'; +import { + IdentityFromJSON, + IdentityFromJSONTyped, + IdentityToJSON, + IdentityToJSONTyped, +} from './Identity'; + +/** + * + * @export + * @interface ListTablesRequest + */ +export interface ListTablesRequest { + /** + * + * @type {Identity} + * @memberof ListTablesRequest + */ + identity?: Identity; + /** + * Arbitrary context for a request as key-value pairs. + * How to use the context is custom to the specific implementation. + * + * REST NAMESPACE ONLY + * Context entries are passed via HTTP headers using the naming convention + * `x-lance-ctx-: `. For example, a context entry + * `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + * + * @type {{ [key: string]: string; }} + * @memberof ListTablesRequest + */ + context?: { [key: string]: string; }; + /** + * + * @type {Array} + * @memberof ListTablesRequest + */ + id?: Array; + /** + * An opaque token that allows pagination for list operations (e.g. ListNamespaces). + * + * For an initial request of a list operation, + * if the implementation cannot return all items in one response, + * or if there are more items than the page limit specified in the request, + * the implementation must return a page token in the response, + * indicating there are more results available. + * + * After the initial request, + * the value of the page token from each response must be used + * as the page token value for the next request. + * + * Caller must interpret either `null`, + * missing value or empty string value of the page token from + * the implementation's response as the end of the listing results. + * + * @type {string} + * @memberof ListTablesRequest + */ + page_token?: string; + /** + * An inclusive upper bound of the + * number of results that a caller will receive. + * + * @type {number} + * @memberof ListTablesRequest + */ + limit?: number; +} + +/** + * Check if a given object implements the ListTablesRequest interface. + */ +export function instanceOfListTablesRequest(value: object): value is ListTablesRequest { + return true; +} + +export function ListTablesRequestFromJSON(json: any): ListTablesRequest { + return ListTablesRequestFromJSONTyped(json, false); +} + +export function ListTablesRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): ListTablesRequest { + if (json == null) { + return json; + } + return { + + 'identity': json['identity'] == null ? undefined : IdentityFromJSON(json['identity']), + 'context': json['context'] == null ? undefined : json['context'], + 'id': json['id'] == null ? undefined : json['id'], + 'page_token': json['page_token'] == null ? undefined : json['page_token'], + 'limit': json['limit'] == null ? undefined : json['limit'], + }; +} + +export function ListTablesRequestToJSON(json: any): ListTablesRequest { + return ListTablesRequestToJSONTyped(json, false); +} + +export function ListTablesRequestToJSONTyped(value?: ListTablesRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'identity': IdentityToJSON(value['identity']), + 'context': value['context'], + 'id': value['id'], + 'page_token': value['page_token'], + 'limit': value['limit'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/ListTablesResponse.ts b/typescript/lance-namespace-fetch-client/src/models/ListTablesResponse.ts new file mode 100644 index 000000000..833b1bd58 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/ListTablesResponse.ts @@ -0,0 +1,92 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface ListTablesResponse + */ +export interface ListTablesResponse { + /** + * The list of names of all the tables under the connected namespace implementation. + * This should recursively list all the tables in all child namespaces. + * Each string in the list is the full identifier in string form. + * + * @type {Set} + * @memberof ListTablesResponse + */ + tables: Set; + /** + * An opaque token that allows pagination for list operations (e.g. ListNamespaces). + * + * For an initial request of a list operation, + * if the implementation cannot return all items in one response, + * or if there are more items than the page limit specified in the request, + * the implementation must return a page token in the response, + * indicating there are more results available. + * + * After the initial request, + * the value of the page token from each response must be used + * as the page token value for the next request. + * + * Caller must interpret either `null`, + * missing value or empty string value of the page token from + * the implementation's response as the end of the listing results. + * + * @type {string} + * @memberof ListTablesResponse + */ + page_token?: string; +} + +/** + * Check if a given object implements the ListTablesResponse interface. + */ +export function instanceOfListTablesResponse(value: object): value is ListTablesResponse { + if (!('tables' in value) || value['tables'] === undefined) return false; + return true; +} + +export function ListTablesResponseFromJSON(json: any): ListTablesResponse { + return ListTablesResponseFromJSONTyped(json, false); +} + +export function ListTablesResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ListTablesResponse { + if (json == null) { + return json; + } + return { + + 'tables': new Set(json['tables']), + 'page_token': json['page_token'] == null ? undefined : json['page_token'], + }; +} + +export function ListTablesResponseToJSON(json: any): ListTablesResponse { + return ListTablesResponseToJSONTyped(json, false); +} + +export function ListTablesResponseToJSONTyped(value?: ListTablesResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'tables': Array.from(value['tables'] as Set), + 'page_token': value['page_token'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/MatchQuery.ts b/typescript/lance-namespace-fetch-client/src/models/MatchQuery.ts new file mode 100644 index 000000000..a2698a259 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/MatchQuery.ts @@ -0,0 +1,120 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface MatchQuery + */ +export interface MatchQuery { + /** + * + * @type {number} + * @memberof MatchQuery + */ + boost?: number; + /** + * + * @type {string} + * @memberof MatchQuery + */ + column?: string; + /** + * + * @type {number} + * @memberof MatchQuery + */ + fuzziness?: number; + /** + * The maximum number of terms to expand for fuzzy matching. + * Default to 50. + * @type {number} + * @memberof MatchQuery + */ + max_expansions?: number; + /** + * The operator to use for combining terms. + * Case insensitive, supports both PascalCase and snake_case. Valid values are: + * - And: All terms must match. + * - Or: At least one term must match. + * + * @type {string} + * @memberof MatchQuery + */ + operator?: string; + /** + * The number of beginning characters being unchanged for fuzzy matching. + * Default to 0. + * @type {number} + * @memberof MatchQuery + */ + prefix_length?: number; + /** + * + * @type {string} + * @memberof MatchQuery + */ + terms: string; +} + +/** + * Check if a given object implements the MatchQuery interface. + */ +export function instanceOfMatchQuery(value: object): value is MatchQuery { + if (!('terms' in value) || value['terms'] === undefined) return false; + return true; +} + +export function MatchQueryFromJSON(json: any): MatchQuery { + return MatchQueryFromJSONTyped(json, false); +} + +export function MatchQueryFromJSONTyped(json: any, ignoreDiscriminator: boolean): MatchQuery { + if (json == null) { + return json; + } + return { + + 'boost': json['boost'] == null ? undefined : json['boost'], + 'column': json['column'] == null ? undefined : json['column'], + 'fuzziness': json['fuzziness'] == null ? undefined : json['fuzziness'], + 'max_expansions': json['max_expansions'] == null ? undefined : json['max_expansions'], + 'operator': json['operator'] == null ? undefined : json['operator'], + 'prefix_length': json['prefix_length'] == null ? undefined : json['prefix_length'], + 'terms': json['terms'], + }; +} + +export function MatchQueryToJSON(json: any): MatchQuery { + return MatchQueryToJSONTyped(json, false); +} + +export function MatchQueryToJSONTyped(value?: MatchQuery | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'boost': value['boost'], + 'column': value['column'], + 'fuzziness': value['fuzziness'], + 'max_expansions': value['max_expansions'], + 'operator': value['operator'], + 'prefix_length': value['prefix_length'], + 'terms': value['terms'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/MergeInsertIntoTableRequest.ts b/typescript/lance-namespace-fetch-client/src/models/MergeInsertIntoTableRequest.ts new file mode 100644 index 000000000..ce5db248e --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/MergeInsertIntoTableRequest.ts @@ -0,0 +1,161 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Identity } from './Identity'; +import { + IdentityFromJSON, + IdentityFromJSONTyped, + IdentityToJSON, + IdentityToJSONTyped, +} from './Identity'; + +/** + * Request for merging or inserting records into a table, excluding the Arrow IPC stream. + * + * @export + * @interface MergeInsertIntoTableRequest + */ +export interface MergeInsertIntoTableRequest { + /** + * + * @type {Identity} + * @memberof MergeInsertIntoTableRequest + */ + identity?: Identity; + /** + * Arbitrary context for a request as key-value pairs. + * How to use the context is custom to the specific implementation. + * + * REST NAMESPACE ONLY + * Context entries are passed via HTTP headers using the naming convention + * `x-lance-ctx-: `. For example, a context entry + * `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + * + * @type {{ [key: string]: string; }} + * @memberof MergeInsertIntoTableRequest + */ + context?: { [key: string]: string; }; + /** + * + * @type {Array} + * @memberof MergeInsertIntoTableRequest + */ + id?: Array; + /** + * Column name to use for matching rows (required) + * @type {string} + * @memberof MergeInsertIntoTableRequest + */ + on?: string; + /** + * Update all columns when rows match + * @type {boolean} + * @memberof MergeInsertIntoTableRequest + */ + when_matched_update_all?: boolean; + /** + * The row is updated (similar to UpdateAll) only for rows where the SQL expression evaluates to true + * @type {string} + * @memberof MergeInsertIntoTableRequest + */ + when_matched_update_all_filt?: string; + /** + * Insert all columns when rows don't match + * @type {boolean} + * @memberof MergeInsertIntoTableRequest + */ + when_not_matched_insert_all?: boolean; + /** + * Delete all rows from target table that don't match a row in the source table + * @type {boolean} + * @memberof MergeInsertIntoTableRequest + */ + when_not_matched_by_source_delete?: boolean; + /** + * Delete rows from the target table if there is no match AND the SQL expression evaluates to true + * @type {string} + * @memberof MergeInsertIntoTableRequest + */ + when_not_matched_by_source_delete_filt?: string; + /** + * Timeout for the operation (e.g., "30s", "5m") + * @type {string} + * @memberof MergeInsertIntoTableRequest + */ + timeout?: string; + /** + * Whether to use index for matching rows + * @type {boolean} + * @memberof MergeInsertIntoTableRequest + */ + use_index?: boolean; +} + +/** + * Check if a given object implements the MergeInsertIntoTableRequest interface. + */ +export function instanceOfMergeInsertIntoTableRequest(value: object): value is MergeInsertIntoTableRequest { + return true; +} + +export function MergeInsertIntoTableRequestFromJSON(json: any): MergeInsertIntoTableRequest { + return MergeInsertIntoTableRequestFromJSONTyped(json, false); +} + +export function MergeInsertIntoTableRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): MergeInsertIntoTableRequest { + if (json == null) { + return json; + } + return { + + 'identity': json['identity'] == null ? undefined : IdentityFromJSON(json['identity']), + 'context': json['context'] == null ? undefined : json['context'], + 'id': json['id'] == null ? undefined : json['id'], + 'on': json['on'] == null ? undefined : json['on'], + 'when_matched_update_all': json['when_matched_update_all'] == null ? undefined : json['when_matched_update_all'], + 'when_matched_update_all_filt': json['when_matched_update_all_filt'] == null ? undefined : json['when_matched_update_all_filt'], + 'when_not_matched_insert_all': json['when_not_matched_insert_all'] == null ? undefined : json['when_not_matched_insert_all'], + 'when_not_matched_by_source_delete': json['when_not_matched_by_source_delete'] == null ? undefined : json['when_not_matched_by_source_delete'], + 'when_not_matched_by_source_delete_filt': json['when_not_matched_by_source_delete_filt'] == null ? undefined : json['when_not_matched_by_source_delete_filt'], + 'timeout': json['timeout'] == null ? undefined : json['timeout'], + 'use_index': json['use_index'] == null ? undefined : json['use_index'], + }; +} + +export function MergeInsertIntoTableRequestToJSON(json: any): MergeInsertIntoTableRequest { + return MergeInsertIntoTableRequestToJSONTyped(json, false); +} + +export function MergeInsertIntoTableRequestToJSONTyped(value?: MergeInsertIntoTableRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'identity': IdentityToJSON(value['identity']), + 'context': value['context'], + 'id': value['id'], + 'on': value['on'], + 'when_matched_update_all': value['when_matched_update_all'], + 'when_matched_update_all_filt': value['when_matched_update_all_filt'], + 'when_not_matched_insert_all': value['when_not_matched_insert_all'], + 'when_not_matched_by_source_delete': value['when_not_matched_by_source_delete'], + 'when_not_matched_by_source_delete_filt': value['when_not_matched_by_source_delete_filt'], + 'timeout': value['timeout'], + 'use_index': value['use_index'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/MergeInsertIntoTableResponse.ts b/typescript/lance-namespace-fetch-client/src/models/MergeInsertIntoTableResponse.ts new file mode 100644 index 000000000..f8471d100 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/MergeInsertIntoTableResponse.ts @@ -0,0 +1,97 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * Response from merge insert operation + * @export + * @interface MergeInsertIntoTableResponse + */ +export interface MergeInsertIntoTableResponse { + /** + * Optional transaction identifier + * @type {string} + * @memberof MergeInsertIntoTableResponse + */ + transaction_id?: string; + /** + * Number of rows updated + * @type {number} + * @memberof MergeInsertIntoTableResponse + */ + num_updated_rows?: number; + /** + * Number of rows inserted + * @type {number} + * @memberof MergeInsertIntoTableResponse + */ + num_inserted_rows?: number; + /** + * Number of rows deleted (typically 0 for merge insert) + * @type {number} + * @memberof MergeInsertIntoTableResponse + */ + num_deleted_rows?: number; + /** + * The commit version associated with the operation + * @type {number} + * @memberof MergeInsertIntoTableResponse + */ + version?: number; +} + +/** + * Check if a given object implements the MergeInsertIntoTableResponse interface. + */ +export function instanceOfMergeInsertIntoTableResponse(value: object): value is MergeInsertIntoTableResponse { + return true; +} + +export function MergeInsertIntoTableResponseFromJSON(json: any): MergeInsertIntoTableResponse { + return MergeInsertIntoTableResponseFromJSONTyped(json, false); +} + +export function MergeInsertIntoTableResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): MergeInsertIntoTableResponse { + if (json == null) { + return json; + } + return { + + 'transaction_id': json['transaction_id'] == null ? undefined : json['transaction_id'], + 'num_updated_rows': json['num_updated_rows'] == null ? undefined : json['num_updated_rows'], + 'num_inserted_rows': json['num_inserted_rows'] == null ? undefined : json['num_inserted_rows'], + 'num_deleted_rows': json['num_deleted_rows'] == null ? undefined : json['num_deleted_rows'], + 'version': json['version'] == null ? undefined : json['version'], + }; +} + +export function MergeInsertIntoTableResponseToJSON(json: any): MergeInsertIntoTableResponse { + return MergeInsertIntoTableResponseToJSONTyped(json, false); +} + +export function MergeInsertIntoTableResponseToJSONTyped(value?: MergeInsertIntoTableResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'transaction_id': value['transaction_id'], + 'num_updated_rows': value['num_updated_rows'], + 'num_inserted_rows': value['num_inserted_rows'], + 'num_deleted_rows': value['num_deleted_rows'], + 'version': value['version'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/MultiMatchQuery.ts b/typescript/lance-namespace-fetch-client/src/models/MultiMatchQuery.ts new file mode 100644 index 000000000..04d864694 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/MultiMatchQuery.ts @@ -0,0 +1,74 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { MatchQuery } from './MatchQuery'; +import { + MatchQueryFromJSON, + MatchQueryFromJSONTyped, + MatchQueryToJSON, + MatchQueryToJSONTyped, +} from './MatchQuery'; + +/** + * + * @export + * @interface MultiMatchQuery + */ +export interface MultiMatchQuery { + /** + * + * @type {Array} + * @memberof MultiMatchQuery + */ + match_queries: Array; +} + +/** + * Check if a given object implements the MultiMatchQuery interface. + */ +export function instanceOfMultiMatchQuery(value: object): value is MultiMatchQuery { + if (!('match_queries' in value) || value['match_queries'] === undefined) return false; + return true; +} + +export function MultiMatchQueryFromJSON(json: any): MultiMatchQuery { + return MultiMatchQueryFromJSONTyped(json, false); +} + +export function MultiMatchQueryFromJSONTyped(json: any, ignoreDiscriminator: boolean): MultiMatchQuery { + if (json == null) { + return json; + } + return { + + 'match_queries': ((json['match_queries'] as Array).map(MatchQueryFromJSON)), + }; +} + +export function MultiMatchQueryToJSON(json: any): MultiMatchQuery { + return MultiMatchQueryToJSONTyped(json, false); +} + +export function MultiMatchQueryToJSONTyped(value?: MultiMatchQuery | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'match_queries': ((value['match_queries'] as Array).map(MatchQueryToJSON)), + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/NamespaceExistsRequest.ts b/typescript/lance-namespace-fetch-client/src/models/NamespaceExistsRequest.ts new file mode 100644 index 000000000..0fdedf74a --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/NamespaceExistsRequest.ts @@ -0,0 +1,96 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Identity } from './Identity'; +import { + IdentityFromJSON, + IdentityFromJSONTyped, + IdentityToJSON, + IdentityToJSONTyped, +} from './Identity'; + +/** + * + * @export + * @interface NamespaceExistsRequest + */ +export interface NamespaceExistsRequest { + /** + * + * @type {Identity} + * @memberof NamespaceExistsRequest + */ + identity?: Identity; + /** + * Arbitrary context for a request as key-value pairs. + * How to use the context is custom to the specific implementation. + * + * REST NAMESPACE ONLY + * Context entries are passed via HTTP headers using the naming convention + * `x-lance-ctx-: `. For example, a context entry + * `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + * + * @type {{ [key: string]: string; }} + * @memberof NamespaceExistsRequest + */ + context?: { [key: string]: string; }; + /** + * + * @type {Array} + * @memberof NamespaceExistsRequest + */ + id?: Array; +} + +/** + * Check if a given object implements the NamespaceExistsRequest interface. + */ +export function instanceOfNamespaceExistsRequest(value: object): value is NamespaceExistsRequest { + return true; +} + +export function NamespaceExistsRequestFromJSON(json: any): NamespaceExistsRequest { + return NamespaceExistsRequestFromJSONTyped(json, false); +} + +export function NamespaceExistsRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): NamespaceExistsRequest { + if (json == null) { + return json; + } + return { + + 'identity': json['identity'] == null ? undefined : IdentityFromJSON(json['identity']), + 'context': json['context'] == null ? undefined : json['context'], + 'id': json['id'] == null ? undefined : json['id'], + }; +} + +export function NamespaceExistsRequestToJSON(json: any): NamespaceExistsRequest { + return NamespaceExistsRequestToJSONTyped(json, false); +} + +export function NamespaceExistsRequestToJSONTyped(value?: NamespaceExistsRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'identity': IdentityToJSON(value['identity']), + 'context': value['context'], + 'id': value['id'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/NewColumnTransform.ts b/typescript/lance-namespace-fetch-client/src/models/NewColumnTransform.ts new file mode 100644 index 000000000..f69425d5e --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/NewColumnTransform.ts @@ -0,0 +1,90 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { AddVirtualColumnEntry } from './AddVirtualColumnEntry'; +import { + AddVirtualColumnEntryFromJSON, + AddVirtualColumnEntryFromJSONTyped, + AddVirtualColumnEntryToJSON, + AddVirtualColumnEntryToJSONTyped, +} from './AddVirtualColumnEntry'; + +/** + * + * @export + * @interface NewColumnTransform + */ +export interface NewColumnTransform { + /** + * Name of the new column + * @type {string} + * @memberof NewColumnTransform + */ + name: string; + /** + * SQL expression to compute the column value (optional if virtual_column is specified) + * @type {string} + * @memberof NewColumnTransform + */ + expression?: string; + /** + * Virtual column definition (optional if expression is specified) + * @type {AddVirtualColumnEntry} + * @memberof NewColumnTransform + */ + virtual_column?: AddVirtualColumnEntry; +} + +/** + * Check if a given object implements the NewColumnTransform interface. + */ +export function instanceOfNewColumnTransform(value: object): value is NewColumnTransform { + if (!('name' in value) || value['name'] === undefined) return false; + return true; +} + +export function NewColumnTransformFromJSON(json: any): NewColumnTransform { + return NewColumnTransformFromJSONTyped(json, false); +} + +export function NewColumnTransformFromJSONTyped(json: any, ignoreDiscriminator: boolean): NewColumnTransform { + if (json == null) { + return json; + } + return { + + 'name': json['name'], + 'expression': json['expression'] == null ? undefined : json['expression'], + 'virtual_column': json['virtual_column'] == null ? undefined : AddVirtualColumnEntryFromJSON(json['virtual_column']), + }; +} + +export function NewColumnTransformToJSON(json: any): NewColumnTransform { + return NewColumnTransformToJSONTyped(json, false); +} + +export function NewColumnTransformToJSONTyped(value?: NewColumnTransform | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'name': value['name'], + 'expression': value['expression'], + 'virtual_column': AddVirtualColumnEntryToJSON(value['virtual_column']), + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/PartitionField.ts b/typescript/lance-namespace-fetch-client/src/models/PartitionField.ts new file mode 100644 index 000000000..5917dc8ee --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/PartitionField.ts @@ -0,0 +1,115 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { PartitionTransform } from './PartitionTransform'; +import { + PartitionTransformFromJSON, + PartitionTransformFromJSONTyped, + PartitionTransformToJSON, + PartitionTransformToJSONTyped, +} from './PartitionTransform'; +import type { JsonArrowDataType } from './JsonArrowDataType'; +import { + JsonArrowDataTypeFromJSON, + JsonArrowDataTypeFromJSONTyped, + JsonArrowDataTypeToJSON, + JsonArrowDataTypeToJSONTyped, +} from './JsonArrowDataType'; + +/** + * Partition field definition + * @export + * @interface PartitionField + */ +export interface PartitionField { + /** + * Unique identifier for this partition field (must not be renamed) + * @type {string} + * @memberof PartitionField + */ + field_id: string; + /** + * Field IDs of the source columns in the schema + * @type {Array} + * @memberof PartitionField + */ + source_ids: Array; + /** + * Well-known partition transform. Exactly one of transform or expression must be specified. + * @type {PartitionTransform} + * @memberof PartitionField + */ + transform?: PartitionTransform; + /** + * DataFusion SQL expression using col0, col1, ... as column references. Exactly one of transform or expression must be specified. + * @type {string} + * @memberof PartitionField + */ + expression?: string; + /** + * The output type of the partition value (JsonArrowDataType format) + * @type {JsonArrowDataType} + * @memberof PartitionField + */ + result_type: JsonArrowDataType; +} + +/** + * Check if a given object implements the PartitionField interface. + */ +export function instanceOfPartitionField(value: object): value is PartitionField { + if (!('field_id' in value) || value['field_id'] === undefined) return false; + if (!('source_ids' in value) || value['source_ids'] === undefined) return false; + if (!('result_type' in value) || value['result_type'] === undefined) return false; + return true; +} + +export function PartitionFieldFromJSON(json: any): PartitionField { + return PartitionFieldFromJSONTyped(json, false); +} + +export function PartitionFieldFromJSONTyped(json: any, ignoreDiscriminator: boolean): PartitionField { + if (json == null) { + return json; + } + return { + + 'field_id': json['field_id'], + 'source_ids': json['source_ids'], + 'transform': json['transform'] == null ? undefined : PartitionTransformFromJSON(json['transform']), + 'expression': json['expression'] == null ? undefined : json['expression'], + 'result_type': JsonArrowDataTypeFromJSON(json['result_type']), + }; +} + +export function PartitionFieldToJSON(json: any): PartitionField { + return PartitionFieldToJSONTyped(json, false); +} + +export function PartitionFieldToJSONTyped(value?: PartitionField | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'field_id': value['field_id'], + 'source_ids': value['source_ids'], + 'transform': PartitionTransformToJSON(value['transform']), + 'expression': value['expression'], + 'result_type': JsonArrowDataTypeToJSON(value['result_type']), + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/PartitionSpec.ts b/typescript/lance-namespace-fetch-client/src/models/PartitionSpec.ts new file mode 100644 index 000000000..683e8822b --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/PartitionSpec.ts @@ -0,0 +1,83 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { PartitionField } from './PartitionField'; +import { + PartitionFieldFromJSON, + PartitionFieldFromJSONTyped, + PartitionFieldToJSON, + PartitionFieldToJSONTyped, +} from './PartitionField'; + +/** + * Partition spec definition + * @export + * @interface PartitionSpec + */ +export interface PartitionSpec { + /** + * The spec version ID + * @type {number} + * @memberof PartitionSpec + */ + id: number; + /** + * Array of partition field definitions + * @type {Array} + * @memberof PartitionSpec + */ + fields: Array; +} + +/** + * Check if a given object implements the PartitionSpec interface. + */ +export function instanceOfPartitionSpec(value: object): value is PartitionSpec { + if (!('id' in value) || value['id'] === undefined) return false; + if (!('fields' in value) || value['fields'] === undefined) return false; + return true; +} + +export function PartitionSpecFromJSON(json: any): PartitionSpec { + return PartitionSpecFromJSONTyped(json, false); +} + +export function PartitionSpecFromJSONTyped(json: any, ignoreDiscriminator: boolean): PartitionSpec { + if (json == null) { + return json; + } + return { + + 'id': json['id'], + 'fields': ((json['fields'] as Array).map(PartitionFieldFromJSON)), + }; +} + +export function PartitionSpecToJSON(json: any): PartitionSpec { + return PartitionSpecToJSONTyped(json, false); +} + +export function PartitionSpecToJSONTyped(value?: PartitionSpec | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'fields': ((value['fields'] as Array).map(PartitionFieldToJSON)), + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/PartitionTransform.ts b/typescript/lance-namespace-fetch-client/src/models/PartitionTransform.ts new file mode 100644 index 000000000..7a9e7a1a8 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/PartitionTransform.ts @@ -0,0 +1,82 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * Well-known partition transform + * @export + * @interface PartitionTransform + */ +export interface PartitionTransform { + /** + * Transform type (identity, year, month, day, hour, bucket, multi_bucket, truncate) + * @type {string} + * @memberof PartitionTransform + */ + type: string; + /** + * Number of buckets for bucket transforms + * @type {number} + * @memberof PartitionTransform + */ + num_buckets?: number; + /** + * Truncation width for truncate transforms + * @type {number} + * @memberof PartitionTransform + */ + width?: number; +} + +/** + * Check if a given object implements the PartitionTransform interface. + */ +export function instanceOfPartitionTransform(value: object): value is PartitionTransform { + if (!('type' in value) || value['type'] === undefined) return false; + return true; +} + +export function PartitionTransformFromJSON(json: any): PartitionTransform { + return PartitionTransformFromJSONTyped(json, false); +} + +export function PartitionTransformFromJSONTyped(json: any, ignoreDiscriminator: boolean): PartitionTransform { + if (json == null) { + return json; + } + return { + + 'type': json['type'], + 'num_buckets': json['num_buckets'] == null ? undefined : json['num_buckets'], + 'width': json['width'] == null ? undefined : json['width'], + }; +} + +export function PartitionTransformToJSON(json: any): PartitionTransform { + return PartitionTransformToJSONTyped(json, false); +} + +export function PartitionTransformToJSONTyped(value?: PartitionTransform | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'type': value['type'], + 'num_buckets': value['num_buckets'], + 'width': value['width'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/PhraseQuery.ts b/typescript/lance-namespace-fetch-client/src/models/PhraseQuery.ts new file mode 100644 index 000000000..b2fa5cf57 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/PhraseQuery.ts @@ -0,0 +1,82 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface PhraseQuery + */ +export interface PhraseQuery { + /** + * + * @type {string} + * @memberof PhraseQuery + */ + column?: string; + /** + * + * @type {number} + * @memberof PhraseQuery + */ + slop?: number; + /** + * + * @type {string} + * @memberof PhraseQuery + */ + terms: string; +} + +/** + * Check if a given object implements the PhraseQuery interface. + */ +export function instanceOfPhraseQuery(value: object): value is PhraseQuery { + if (!('terms' in value) || value['terms'] === undefined) return false; + return true; +} + +export function PhraseQueryFromJSON(json: any): PhraseQuery { + return PhraseQueryFromJSONTyped(json, false); +} + +export function PhraseQueryFromJSONTyped(json: any, ignoreDiscriminator: boolean): PhraseQuery { + if (json == null) { + return json; + } + return { + + 'column': json['column'] == null ? undefined : json['column'], + 'slop': json['slop'] == null ? undefined : json['slop'], + 'terms': json['terms'], + }; +} + +export function PhraseQueryToJSON(json: any): PhraseQuery { + return PhraseQueryToJSONTyped(json, false); +} + +export function PhraseQueryToJSONTyped(value?: PhraseQuery | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'column': value['column'], + 'slop': value['slop'], + 'terms': value['terms'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/QueryTableRequest.ts b/typescript/lance-namespace-fetch-client/src/models/QueryTableRequest.ts new file mode 100644 index 000000000..868ed34be --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/QueryTableRequest.ts @@ -0,0 +1,263 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { QueryTableRequestFullTextQuery } from './QueryTableRequestFullTextQuery'; +import { + QueryTableRequestFullTextQueryFromJSON, + QueryTableRequestFullTextQueryFromJSONTyped, + QueryTableRequestFullTextQueryToJSON, + QueryTableRequestFullTextQueryToJSONTyped, +} from './QueryTableRequestFullTextQuery'; +import type { QueryTableRequestColumns } from './QueryTableRequestColumns'; +import { + QueryTableRequestColumnsFromJSON, + QueryTableRequestColumnsFromJSONTyped, + QueryTableRequestColumnsToJSON, + QueryTableRequestColumnsToJSONTyped, +} from './QueryTableRequestColumns'; +import type { Identity } from './Identity'; +import { + IdentityFromJSON, + IdentityFromJSONTyped, + IdentityToJSON, + IdentityToJSONTyped, +} from './Identity'; +import type { QueryTableRequestVector } from './QueryTableRequestVector'; +import { + QueryTableRequestVectorFromJSON, + QueryTableRequestVectorFromJSONTyped, + QueryTableRequestVectorToJSON, + QueryTableRequestVectorToJSONTyped, +} from './QueryTableRequestVector'; + +/** + * + * @export + * @interface QueryTableRequest + */ +export interface QueryTableRequest { + /** + * + * @type {Identity} + * @memberof QueryTableRequest + */ + identity?: Identity; + /** + * Arbitrary context for a request as key-value pairs. + * How to use the context is custom to the specific implementation. + * + * REST NAMESPACE ONLY + * Context entries are passed via HTTP headers using the naming convention + * `x-lance-ctx-: `. For example, a context entry + * `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + * + * @type {{ [key: string]: string; }} + * @memberof QueryTableRequest + */ + context?: { [key: string]: string; }; + /** + * + * @type {Array} + * @memberof QueryTableRequest + */ + id?: Array; + /** + * Whether to bypass vector index + * @type {boolean} + * @memberof QueryTableRequest + */ + bypass_vector_index?: boolean; + /** + * + * @type {QueryTableRequestColumns} + * @memberof QueryTableRequest + */ + columns?: QueryTableRequestColumns; + /** + * Distance metric to use + * @type {string} + * @memberof QueryTableRequest + */ + distance_type?: string; + /** + * Search effort parameter for HNSW index + * @type {number} + * @memberof QueryTableRequest + */ + ef?: number; + /** + * Whether to use fast search + * @type {boolean} + * @memberof QueryTableRequest + */ + fast_search?: boolean; + /** + * Optional SQL filter expression + * @type {string} + * @memberof QueryTableRequest + */ + filter?: string; + /** + * + * @type {QueryTableRequestFullTextQuery} + * @memberof QueryTableRequest + */ + full_text_query?: QueryTableRequestFullTextQuery; + /** + * Number of results to return + * @type {number} + * @memberof QueryTableRequest + */ + k: number; + /** + * Lower bound for search + * @type {number} + * @memberof QueryTableRequest + */ + lower_bound?: number; + /** + * Number of probes for IVF index + * @type {number} + * @memberof QueryTableRequest + */ + nprobes?: number; + /** + * Number of results to skip + * @type {number} + * @memberof QueryTableRequest + */ + offset?: number; + /** + * Whether to apply filtering before vector search + * @type {boolean} + * @memberof QueryTableRequest + */ + prefilter?: boolean; + /** + * Refine factor for search + * @type {number} + * @memberof QueryTableRequest + */ + refine_factor?: number; + /** + * Upper bound for search + * @type {number} + * @memberof QueryTableRequest + */ + upper_bound?: number; + /** + * + * @type {QueryTableRequestVector} + * @memberof QueryTableRequest + */ + vector: QueryTableRequestVector; + /** + * Name of the vector column to search + * @type {string} + * @memberof QueryTableRequest + */ + vector_column?: string; + /** + * Table version to query + * @type {number} + * @memberof QueryTableRequest + */ + version?: number; + /** + * If true, return the row id as a column called `_rowid` + * @type {boolean} + * @memberof QueryTableRequest + */ + with_row_id?: boolean; +} + +/** + * Check if a given object implements the QueryTableRequest interface. + */ +export function instanceOfQueryTableRequest(value: object): value is QueryTableRequest { + if (!('k' in value) || value['k'] === undefined) return false; + if (!('vector' in value) || value['vector'] === undefined) return false; + return true; +} + +export function QueryTableRequestFromJSON(json: any): QueryTableRequest { + return QueryTableRequestFromJSONTyped(json, false); +} + +export function QueryTableRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): QueryTableRequest { + if (json == null) { + return json; + } + return { + + 'identity': json['identity'] == null ? undefined : IdentityFromJSON(json['identity']), + 'context': json['context'] == null ? undefined : json['context'], + 'id': json['id'] == null ? undefined : json['id'], + 'bypass_vector_index': json['bypass_vector_index'] == null ? undefined : json['bypass_vector_index'], + 'columns': json['columns'] == null ? undefined : QueryTableRequestColumnsFromJSON(json['columns']), + 'distance_type': json['distance_type'] == null ? undefined : json['distance_type'], + 'ef': json['ef'] == null ? undefined : json['ef'], + 'fast_search': json['fast_search'] == null ? undefined : json['fast_search'], + 'filter': json['filter'] == null ? undefined : json['filter'], + 'full_text_query': json['full_text_query'] == null ? undefined : QueryTableRequestFullTextQueryFromJSON(json['full_text_query']), + 'k': json['k'], + 'lower_bound': json['lower_bound'] == null ? undefined : json['lower_bound'], + 'nprobes': json['nprobes'] == null ? undefined : json['nprobes'], + 'offset': json['offset'] == null ? undefined : json['offset'], + 'prefilter': json['prefilter'] == null ? undefined : json['prefilter'], + 'refine_factor': json['refine_factor'] == null ? undefined : json['refine_factor'], + 'upper_bound': json['upper_bound'] == null ? undefined : json['upper_bound'], + 'vector': QueryTableRequestVectorFromJSON(json['vector']), + 'vector_column': json['vector_column'] == null ? undefined : json['vector_column'], + 'version': json['version'] == null ? undefined : json['version'], + 'with_row_id': json['with_row_id'] == null ? undefined : json['with_row_id'], + }; +} + +export function QueryTableRequestToJSON(json: any): QueryTableRequest { + return QueryTableRequestToJSONTyped(json, false); +} + +export function QueryTableRequestToJSONTyped(value?: QueryTableRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'identity': IdentityToJSON(value['identity']), + 'context': value['context'], + 'id': value['id'], + 'bypass_vector_index': value['bypass_vector_index'], + 'columns': QueryTableRequestColumnsToJSON(value['columns']), + 'distance_type': value['distance_type'], + 'ef': value['ef'], + 'fast_search': value['fast_search'], + 'filter': value['filter'], + 'full_text_query': QueryTableRequestFullTextQueryToJSON(value['full_text_query']), + 'k': value['k'], + 'lower_bound': value['lower_bound'], + 'nprobes': value['nprobes'], + 'offset': value['offset'], + 'prefilter': value['prefilter'], + 'refine_factor': value['refine_factor'], + 'upper_bound': value['upper_bound'], + 'vector': QueryTableRequestVectorToJSON(value['vector']), + 'vector_column': value['vector_column'], + 'version': value['version'], + 'with_row_id': value['with_row_id'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/QueryTableRequestColumns.ts b/typescript/lance-namespace-fetch-client/src/models/QueryTableRequestColumns.ts new file mode 100644 index 000000000..8a1b5d9fa --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/QueryTableRequestColumns.ts @@ -0,0 +1,74 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * Optional columns to return. Provide either column_names or column_aliases, not both. + * + * @export + * @interface QueryTableRequestColumns + */ +export interface QueryTableRequestColumns { + /** + * List of column names to return + * @type {Array} + * @memberof QueryTableRequestColumns + */ + column_names?: Array; + /** + * Object mapping output aliases to source column names + * @type {{ [key: string]: string; }} + * @memberof QueryTableRequestColumns + */ + column_aliases?: { [key: string]: string; }; +} + +/** + * Check if a given object implements the QueryTableRequestColumns interface. + */ +export function instanceOfQueryTableRequestColumns(value: object): value is QueryTableRequestColumns { + return true; +} + +export function QueryTableRequestColumnsFromJSON(json: any): QueryTableRequestColumns { + return QueryTableRequestColumnsFromJSONTyped(json, false); +} + +export function QueryTableRequestColumnsFromJSONTyped(json: any, ignoreDiscriminator: boolean): QueryTableRequestColumns { + if (json == null) { + return json; + } + return { + + 'column_names': json['column_names'] == null ? undefined : json['column_names'], + 'column_aliases': json['column_aliases'] == null ? undefined : json['column_aliases'], + }; +} + +export function QueryTableRequestColumnsToJSON(json: any): QueryTableRequestColumns { + return QueryTableRequestColumnsToJSONTyped(json, false); +} + +export function QueryTableRequestColumnsToJSONTyped(value?: QueryTableRequestColumns | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'column_names': value['column_names'], + 'column_aliases': value['column_aliases'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/QueryTableRequestFullTextQuery.ts b/typescript/lance-namespace-fetch-client/src/models/QueryTableRequestFullTextQuery.ts new file mode 100644 index 000000000..d4e764626 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/QueryTableRequestFullTextQuery.ts @@ -0,0 +1,88 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { StringFtsQuery } from './StringFtsQuery'; +import { + StringFtsQueryFromJSON, + StringFtsQueryFromJSONTyped, + StringFtsQueryToJSON, + StringFtsQueryToJSONTyped, +} from './StringFtsQuery'; +import type { StructuredFtsQuery } from './StructuredFtsQuery'; +import { + StructuredFtsQueryFromJSON, + StructuredFtsQueryFromJSONTyped, + StructuredFtsQueryToJSON, + StructuredFtsQueryToJSONTyped, +} from './StructuredFtsQuery'; + +/** + * Optional full-text search query. Provide either string_query or structured_query, not both. + * @export + * @interface QueryTableRequestFullTextQuery + */ +export interface QueryTableRequestFullTextQuery { + /** + * + * @type {StringFtsQuery} + * @memberof QueryTableRequestFullTextQuery + */ + string_query?: StringFtsQuery; + /** + * + * @type {StructuredFtsQuery} + * @memberof QueryTableRequestFullTextQuery + */ + structured_query?: StructuredFtsQuery; +} + +/** + * Check if a given object implements the QueryTableRequestFullTextQuery interface. + */ +export function instanceOfQueryTableRequestFullTextQuery(value: object): value is QueryTableRequestFullTextQuery { + return true; +} + +export function QueryTableRequestFullTextQueryFromJSON(json: any): QueryTableRequestFullTextQuery { + return QueryTableRequestFullTextQueryFromJSONTyped(json, false); +} + +export function QueryTableRequestFullTextQueryFromJSONTyped(json: any, ignoreDiscriminator: boolean): QueryTableRequestFullTextQuery { + if (json == null) { + return json; + } + return { + + 'string_query': json['string_query'] == null ? undefined : StringFtsQueryFromJSON(json['string_query']), + 'structured_query': json['structured_query'] == null ? undefined : StructuredFtsQueryFromJSON(json['structured_query']), + }; +} + +export function QueryTableRequestFullTextQueryToJSON(json: any): QueryTableRequestFullTextQuery { + return QueryTableRequestFullTextQueryToJSONTyped(json, false); +} + +export function QueryTableRequestFullTextQueryToJSONTyped(value?: QueryTableRequestFullTextQuery | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'string_query': StringFtsQueryToJSON(value['string_query']), + 'structured_query': StructuredFtsQueryToJSON(value['structured_query']), + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/QueryTableRequestVector.ts b/typescript/lance-namespace-fetch-client/src/models/QueryTableRequestVector.ts new file mode 100644 index 000000000..e4afc94d4 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/QueryTableRequestVector.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * Query vector(s) for similarity search. Provide either single_vector or multi_vector, not both. + * @export + * @interface QueryTableRequestVector + */ +export interface QueryTableRequestVector { + /** + * Single query vector + * @type {Array} + * @memberof QueryTableRequestVector + */ + single_vector?: Array; + /** + * Multiple query vectors for batch search + * @type {Array>} + * @memberof QueryTableRequestVector + */ + multi_vector?: Array>; +} + +/** + * Check if a given object implements the QueryTableRequestVector interface. + */ +export function instanceOfQueryTableRequestVector(value: object): value is QueryTableRequestVector { + return true; +} + +export function QueryTableRequestVectorFromJSON(json: any): QueryTableRequestVector { + return QueryTableRequestVectorFromJSONTyped(json, false); +} + +export function QueryTableRequestVectorFromJSONTyped(json: any, ignoreDiscriminator: boolean): QueryTableRequestVector { + if (json == null) { + return json; + } + return { + + 'single_vector': json['single_vector'] == null ? undefined : json['single_vector'], + 'multi_vector': json['multi_vector'] == null ? undefined : json['multi_vector'], + }; +} + +export function QueryTableRequestVectorToJSON(json: any): QueryTableRequestVector { + return QueryTableRequestVectorToJSONTyped(json, false); +} + +export function QueryTableRequestVectorToJSONTyped(value?: QueryTableRequestVector | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'single_vector': value['single_vector'], + 'multi_vector': value['multi_vector'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/RegisterTableRequest.ts b/typescript/lance-namespace-fetch-client/src/models/RegisterTableRequest.ts new file mode 100644 index 000000000..a1e2cf6bc --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/RegisterTableRequest.ts @@ -0,0 +1,127 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Identity } from './Identity'; +import { + IdentityFromJSON, + IdentityFromJSONTyped, + IdentityToJSON, + IdentityToJSONTyped, +} from './Identity'; + +/** + * + * @export + * @interface RegisterTableRequest + */ +export interface RegisterTableRequest { + /** + * + * @type {Identity} + * @memberof RegisterTableRequest + */ + identity?: Identity; + /** + * Arbitrary context for a request as key-value pairs. + * How to use the context is custom to the specific implementation. + * + * REST NAMESPACE ONLY + * Context entries are passed via HTTP headers using the naming convention + * `x-lance-ctx-: `. For example, a context entry + * `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + * + * @type {{ [key: string]: string; }} + * @memberof RegisterTableRequest + */ + context?: { [key: string]: string; }; + /** + * + * @type {Array} + * @memberof RegisterTableRequest + */ + id?: Array; + /** + * + * @type {string} + * @memberof RegisterTableRequest + */ + location: string; + /** + * There are two modes when trying to register a table, + * to differentiate the behavior when a table of the same name already exists. + * Case insensitive, supports both PascalCase and snake_case. Valid values are: + * * Create (default): the operation fails with 409. + * * Overwrite: the existing table registration is replaced with the new registration. + * + * @type {string} + * @memberof RegisterTableRequest + */ + mode?: string; + /** + * Properties stored on the table, if supported by the implementation. + * + * @type {{ [key: string]: string; }} + * @memberof RegisterTableRequest + */ + properties?: { [key: string]: string; }; +} + +/** + * Check if a given object implements the RegisterTableRequest interface. + */ +export function instanceOfRegisterTableRequest(value: object): value is RegisterTableRequest { + if (!('location' in value) || value['location'] === undefined) return false; + return true; +} + +export function RegisterTableRequestFromJSON(json: any): RegisterTableRequest { + return RegisterTableRequestFromJSONTyped(json, false); +} + +export function RegisterTableRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): RegisterTableRequest { + if (json == null) { + return json; + } + return { + + 'identity': json['identity'] == null ? undefined : IdentityFromJSON(json['identity']), + 'context': json['context'] == null ? undefined : json['context'], + 'id': json['id'] == null ? undefined : json['id'], + 'location': json['location'], + 'mode': json['mode'] == null ? undefined : json['mode'], + 'properties': json['properties'] == null ? undefined : json['properties'], + }; +} + +export function RegisterTableRequestToJSON(json: any): RegisterTableRequest { + return RegisterTableRequestToJSONTyped(json, false); +} + +export function RegisterTableRequestToJSONTyped(value?: RegisterTableRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'identity': IdentityToJSON(value['identity']), + 'context': value['context'], + 'id': value['id'], + 'location': value['location'], + 'mode': value['mode'], + 'properties': value['properties'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/RegisterTableResponse.ts b/typescript/lance-namespace-fetch-client/src/models/RegisterTableResponse.ts new file mode 100644 index 000000000..76113f5ec --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/RegisterTableResponse.ts @@ -0,0 +1,82 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface RegisterTableResponse + */ +export interface RegisterTableResponse { + /** + * Optional transaction identifier + * @type {string} + * @memberof RegisterTableResponse + */ + transaction_id?: string; + /** + * + * @type {string} + * @memberof RegisterTableResponse + */ + location?: string; + /** + * If the implementation does not support table properties, it should return null for this field. Otherwise, it should return the properties. + * + * @type {{ [key: string]: string; }} + * @memberof RegisterTableResponse + */ + properties?: { [key: string]: string; }; +} + +/** + * Check if a given object implements the RegisterTableResponse interface. + */ +export function instanceOfRegisterTableResponse(value: object): value is RegisterTableResponse { + return true; +} + +export function RegisterTableResponseFromJSON(json: any): RegisterTableResponse { + return RegisterTableResponseFromJSONTyped(json, false); +} + +export function RegisterTableResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): RegisterTableResponse { + if (json == null) { + return json; + } + return { + + 'transaction_id': json['transaction_id'] == null ? undefined : json['transaction_id'], + 'location': json['location'] == null ? undefined : json['location'], + 'properties': json['properties'] == null ? undefined : json['properties'], + }; +} + +export function RegisterTableResponseToJSON(json: any): RegisterTableResponse { + return RegisterTableResponseToJSONTyped(json, false); +} + +export function RegisterTableResponseToJSONTyped(value?: RegisterTableResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'transaction_id': value['transaction_id'], + 'location': value['location'], + 'properties': value['properties'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/RenameTableRequest.ts b/typescript/lance-namespace-fetch-client/src/models/RenameTableRequest.ts new file mode 100644 index 000000000..054b5695e --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/RenameTableRequest.ts @@ -0,0 +1,113 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Identity } from './Identity'; +import { + IdentityFromJSON, + IdentityFromJSONTyped, + IdentityToJSON, + IdentityToJSONTyped, +} from './Identity'; + +/** + * + * @export + * @interface RenameTableRequest + */ +export interface RenameTableRequest { + /** + * + * @type {Identity} + * @memberof RenameTableRequest + */ + identity?: Identity; + /** + * Arbitrary context for a request as key-value pairs. + * How to use the context is custom to the specific implementation. + * + * REST NAMESPACE ONLY + * Context entries are passed via HTTP headers using the naming convention + * `x-lance-ctx-: `. For example, a context entry + * `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + * + * @type {{ [key: string]: string; }} + * @memberof RenameTableRequest + */ + context?: { [key: string]: string; }; + /** + * The table identifier + * @type {Array} + * @memberof RenameTableRequest + */ + id?: Array; + /** + * New name for the table + * @type {string} + * @memberof RenameTableRequest + */ + new_table_name: string; + /** + * New namespace identifier to move the table to (optional, if not specified the table stays in the same namespace) + * @type {Array} + * @memberof RenameTableRequest + */ + new_namespace_id?: Array; +} + +/** + * Check if a given object implements the RenameTableRequest interface. + */ +export function instanceOfRenameTableRequest(value: object): value is RenameTableRequest { + if (!('new_table_name' in value) || value['new_table_name'] === undefined) return false; + return true; +} + +export function RenameTableRequestFromJSON(json: any): RenameTableRequest { + return RenameTableRequestFromJSONTyped(json, false); +} + +export function RenameTableRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): RenameTableRequest { + if (json == null) { + return json; + } + return { + + 'identity': json['identity'] == null ? undefined : IdentityFromJSON(json['identity']), + 'context': json['context'] == null ? undefined : json['context'], + 'id': json['id'] == null ? undefined : json['id'], + 'new_table_name': json['new_table_name'], + 'new_namespace_id': json['new_namespace_id'] == null ? undefined : json['new_namespace_id'], + }; +} + +export function RenameTableRequestToJSON(json: any): RenameTableRequest { + return RenameTableRequestToJSONTyped(json, false); +} + +export function RenameTableRequestToJSONTyped(value?: RenameTableRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'identity': IdentityToJSON(value['identity']), + 'context': value['context'], + 'id': value['id'], + 'new_table_name': value['new_table_name'], + 'new_namespace_id': value['new_namespace_id'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/RenameTableResponse.ts b/typescript/lance-namespace-fetch-client/src/models/RenameTableResponse.ts new file mode 100644 index 000000000..2ea4d0b0c --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/RenameTableResponse.ts @@ -0,0 +1,65 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface RenameTableResponse + */ +export interface RenameTableResponse { + /** + * Optional transaction identifier + * @type {string} + * @memberof RenameTableResponse + */ + transaction_id?: string; +} + +/** + * Check if a given object implements the RenameTableResponse interface. + */ +export function instanceOfRenameTableResponse(value: object): value is RenameTableResponse { + return true; +} + +export function RenameTableResponseFromJSON(json: any): RenameTableResponse { + return RenameTableResponseFromJSONTyped(json, false); +} + +export function RenameTableResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): RenameTableResponse { + if (json == null) { + return json; + } + return { + + 'transaction_id': json['transaction_id'] == null ? undefined : json['transaction_id'], + }; +} + +export function RenameTableResponseToJSON(json: any): RenameTableResponse { + return RenameTableResponseToJSONTyped(json, false); +} + +export function RenameTableResponseToJSONTyped(value?: RenameTableResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'transaction_id': value['transaction_id'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/RestoreTableRequest.ts b/typescript/lance-namespace-fetch-client/src/models/RestoreTableRequest.ts new file mode 100644 index 000000000..19b541f36 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/RestoreTableRequest.ts @@ -0,0 +1,105 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Identity } from './Identity'; +import { + IdentityFromJSON, + IdentityFromJSONTyped, + IdentityToJSON, + IdentityToJSONTyped, +} from './Identity'; + +/** + * + * @export + * @interface RestoreTableRequest + */ +export interface RestoreTableRequest { + /** + * + * @type {Identity} + * @memberof RestoreTableRequest + */ + identity?: Identity; + /** + * Arbitrary context for a request as key-value pairs. + * How to use the context is custom to the specific implementation. + * + * REST NAMESPACE ONLY + * Context entries are passed via HTTP headers using the naming convention + * `x-lance-ctx-: `. For example, a context entry + * `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + * + * @type {{ [key: string]: string; }} + * @memberof RestoreTableRequest + */ + context?: { [key: string]: string; }; + /** + * + * @type {Array} + * @memberof RestoreTableRequest + */ + id?: Array; + /** + * Version to restore to + * @type {number} + * @memberof RestoreTableRequest + */ + version: number; +} + +/** + * Check if a given object implements the RestoreTableRequest interface. + */ +export function instanceOfRestoreTableRequest(value: object): value is RestoreTableRequest { + if (!('version' in value) || value['version'] === undefined) return false; + return true; +} + +export function RestoreTableRequestFromJSON(json: any): RestoreTableRequest { + return RestoreTableRequestFromJSONTyped(json, false); +} + +export function RestoreTableRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): RestoreTableRequest { + if (json == null) { + return json; + } + return { + + 'identity': json['identity'] == null ? undefined : IdentityFromJSON(json['identity']), + 'context': json['context'] == null ? undefined : json['context'], + 'id': json['id'] == null ? undefined : json['id'], + 'version': json['version'], + }; +} + +export function RestoreTableRequestToJSON(json: any): RestoreTableRequest { + return RestoreTableRequestToJSONTyped(json, false); +} + +export function RestoreTableRequestToJSONTyped(value?: RestoreTableRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'identity': IdentityToJSON(value['identity']), + 'context': value['context'], + 'id': value['id'], + 'version': value['version'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/RestoreTableResponse.ts b/typescript/lance-namespace-fetch-client/src/models/RestoreTableResponse.ts new file mode 100644 index 000000000..d54f23cb1 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/RestoreTableResponse.ts @@ -0,0 +1,65 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * Response for restore table operation + * @export + * @interface RestoreTableResponse + */ +export interface RestoreTableResponse { + /** + * Optional transaction identifier + * @type {string} + * @memberof RestoreTableResponse + */ + transaction_id?: string; +} + +/** + * Check if a given object implements the RestoreTableResponse interface. + */ +export function instanceOfRestoreTableResponse(value: object): value is RestoreTableResponse { + return true; +} + +export function RestoreTableResponseFromJSON(json: any): RestoreTableResponse { + return RestoreTableResponseFromJSONTyped(json, false); +} + +export function RestoreTableResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): RestoreTableResponse { + if (json == null) { + return json; + } + return { + + 'transaction_id': json['transaction_id'] == null ? undefined : json['transaction_id'], + }; +} + +export function RestoreTableResponseToJSON(json: any): RestoreTableResponse { + return RestoreTableResponseToJSONTyped(json, false); +} + +export function RestoreTableResponseToJSONTyped(value?: RestoreTableResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'transaction_id': value['transaction_id'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/StringFtsQuery.ts b/typescript/lance-namespace-fetch-client/src/models/StringFtsQuery.ts new file mode 100644 index 000000000..26b3d3d44 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/StringFtsQuery.ts @@ -0,0 +1,74 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface StringFtsQuery + */ +export interface StringFtsQuery { + /** + * + * @type {Array} + * @memberof StringFtsQuery + */ + columns?: Array; + /** + * + * @type {string} + * @memberof StringFtsQuery + */ + query: string; +} + +/** + * Check if a given object implements the StringFtsQuery interface. + */ +export function instanceOfStringFtsQuery(value: object): value is StringFtsQuery { + if (!('query' in value) || value['query'] === undefined) return false; + return true; +} + +export function StringFtsQueryFromJSON(json: any): StringFtsQuery { + return StringFtsQueryFromJSONTyped(json, false); +} + +export function StringFtsQueryFromJSONTyped(json: any, ignoreDiscriminator: boolean): StringFtsQuery { + if (json == null) { + return json; + } + return { + + 'columns': json['columns'] == null ? undefined : json['columns'], + 'query': json['query'], + }; +} + +export function StringFtsQueryToJSON(json: any): StringFtsQuery { + return StringFtsQueryToJSONTyped(json, false); +} + +export function StringFtsQueryToJSONTyped(value?: StringFtsQuery | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'columns': value['columns'], + 'query': value['query'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/StructuredFtsQuery.ts b/typescript/lance-namespace-fetch-client/src/models/StructuredFtsQuery.ts new file mode 100644 index 000000000..54193fda7 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/StructuredFtsQuery.ts @@ -0,0 +1,74 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { FtsQuery } from './FtsQuery'; +import { + FtsQueryFromJSON, + FtsQueryFromJSONTyped, + FtsQueryToJSON, + FtsQueryToJSONTyped, +} from './FtsQuery'; + +/** + * + * @export + * @interface StructuredFtsQuery + */ +export interface StructuredFtsQuery { + /** + * + * @type {FtsQuery} + * @memberof StructuredFtsQuery + */ + query: FtsQuery; +} + +/** + * Check if a given object implements the StructuredFtsQuery interface. + */ +export function instanceOfStructuredFtsQuery(value: object): value is StructuredFtsQuery { + if (!('query' in value) || value['query'] === undefined) return false; + return true; +} + +export function StructuredFtsQueryFromJSON(json: any): StructuredFtsQuery { + return StructuredFtsQueryFromJSONTyped(json, false); +} + +export function StructuredFtsQueryFromJSONTyped(json: any, ignoreDiscriminator: boolean): StructuredFtsQuery { + if (json == null) { + return json; + } + return { + + 'query': FtsQueryFromJSON(json['query']), + }; +} + +export function StructuredFtsQueryToJSON(json: any): StructuredFtsQuery { + return StructuredFtsQueryToJSONTyped(json, false); +} + +export function StructuredFtsQueryToJSONTyped(value?: StructuredFtsQuery | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'query': FtsQueryToJSON(value['query']), + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/TableBasicStats.ts b/typescript/lance-namespace-fetch-client/src/models/TableBasicStats.ts new file mode 100644 index 000000000..fa26a3837 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/TableBasicStats.ts @@ -0,0 +1,75 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface TableBasicStats + */ +export interface TableBasicStats { + /** + * Number of deleted rows in the table + * @type {number} + * @memberof TableBasicStats + */ + num_deleted_rows: number; + /** + * Number of fragments in the table + * @type {number} + * @memberof TableBasicStats + */ + num_fragments: number; +} + +/** + * Check if a given object implements the TableBasicStats interface. + */ +export function instanceOfTableBasicStats(value: object): value is TableBasicStats { + if (!('num_deleted_rows' in value) || value['num_deleted_rows'] === undefined) return false; + if (!('num_fragments' in value) || value['num_fragments'] === undefined) return false; + return true; +} + +export function TableBasicStatsFromJSON(json: any): TableBasicStats { + return TableBasicStatsFromJSONTyped(json, false); +} + +export function TableBasicStatsFromJSONTyped(json: any, ignoreDiscriminator: boolean): TableBasicStats { + if (json == null) { + return json; + } + return { + + 'num_deleted_rows': json['num_deleted_rows'], + 'num_fragments': json['num_fragments'], + }; +} + +export function TableBasicStatsToJSON(json: any): TableBasicStats { + return TableBasicStatsToJSONTyped(json, false); +} + +export function TableBasicStatsToJSONTyped(value?: TableBasicStats | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'num_deleted_rows': value['num_deleted_rows'], + 'num_fragments': value['num_fragments'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/TableExistsRequest.ts b/typescript/lance-namespace-fetch-client/src/models/TableExistsRequest.ts new file mode 100644 index 000000000..76df41c88 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/TableExistsRequest.ts @@ -0,0 +1,106 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Identity } from './Identity'; +import { + IdentityFromJSON, + IdentityFromJSONTyped, + IdentityToJSON, + IdentityToJSONTyped, +} from './Identity'; + +/** + * + * @export + * @interface TableExistsRequest + */ +export interface TableExistsRequest { + /** + * + * @type {Identity} + * @memberof TableExistsRequest + */ + identity?: Identity; + /** + * Arbitrary context for a request as key-value pairs. + * How to use the context is custom to the specific implementation. + * + * REST NAMESPACE ONLY + * Context entries are passed via HTTP headers using the naming convention + * `x-lance-ctx-: `. For example, a context entry + * `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + * + * @type {{ [key: string]: string; }} + * @memberof TableExistsRequest + */ + context?: { [key: string]: string; }; + /** + * + * @type {Array} + * @memberof TableExistsRequest + */ + id?: Array; + /** + * Version of the table to check existence. + * If not specified, server should resolve it to the latest version. + * + * @type {number} + * @memberof TableExistsRequest + */ + version?: number; +} + +/** + * Check if a given object implements the TableExistsRequest interface. + */ +export function instanceOfTableExistsRequest(value: object): value is TableExistsRequest { + return true; +} + +export function TableExistsRequestFromJSON(json: any): TableExistsRequest { + return TableExistsRequestFromJSONTyped(json, false); +} + +export function TableExistsRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): TableExistsRequest { + if (json == null) { + return json; + } + return { + + 'identity': json['identity'] == null ? undefined : IdentityFromJSON(json['identity']), + 'context': json['context'] == null ? undefined : json['context'], + 'id': json['id'] == null ? undefined : json['id'], + 'version': json['version'] == null ? undefined : json['version'], + }; +} + +export function TableExistsRequestToJSON(json: any): TableExistsRequest { + return TableExistsRequestToJSONTyped(json, false); +} + +export function TableExistsRequestToJSONTyped(value?: TableExistsRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'identity': IdentityToJSON(value['identity']), + 'context': value['context'], + 'id': value['id'], + 'version': value['version'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/TableVersion.ts b/typescript/lance-namespace-fetch-client/src/models/TableVersion.ts new file mode 100644 index 000000000..b37b01c20 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/TableVersion.ts @@ -0,0 +1,109 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface TableVersion + */ +export interface TableVersion { + /** + * Version number + * @type {number} + * @memberof TableVersion + */ + version: number; + /** + * Path to the manifest file for this version. + * @type {string} + * @memberof TableVersion + */ + manifest_path: string; + /** + * Size of the manifest file in bytes + * @type {number} + * @memberof TableVersion + */ + manifest_size?: number; + /** + * Optional ETag for optimistic concurrency control. + * Useful for S3 and similar object stores. + * + * @type {string} + * @memberof TableVersion + */ + e_tag?: string; + /** + * Timestamp when the version was created, in milliseconds since epoch (Unix time) + * @type {number} + * @memberof TableVersion + */ + timestamp_millis?: number; + /** + * Optional key-value pairs of metadata + * @type {{ [key: string]: string; }} + * @memberof TableVersion + */ + metadata?: { [key: string]: string; }; +} + +/** + * Check if a given object implements the TableVersion interface. + */ +export function instanceOfTableVersion(value: object): value is TableVersion { + if (!('version' in value) || value['version'] === undefined) return false; + if (!('manifest_path' in value) || value['manifest_path'] === undefined) return false; + return true; +} + +export function TableVersionFromJSON(json: any): TableVersion { + return TableVersionFromJSONTyped(json, false); +} + +export function TableVersionFromJSONTyped(json: any, ignoreDiscriminator: boolean): TableVersion { + if (json == null) { + return json; + } + return { + + 'version': json['version'], + 'manifest_path': json['manifest_path'], + 'manifest_size': json['manifest_size'] == null ? undefined : json['manifest_size'], + 'e_tag': json['e_tag'] == null ? undefined : json['e_tag'], + 'timestamp_millis': json['timestamp_millis'] == null ? undefined : json['timestamp_millis'], + 'metadata': json['metadata'] == null ? undefined : json['metadata'], + }; +} + +export function TableVersionToJSON(json: any): TableVersion { + return TableVersionToJSONTyped(json, false); +} + +export function TableVersionToJSONTyped(value?: TableVersion | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'version': value['version'], + 'manifest_path': value['manifest_path'], + 'manifest_size': value['manifest_size'], + 'e_tag': value['e_tag'], + 'timestamp_millis': value['timestamp_millis'], + 'metadata': value['metadata'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/TagContents.ts b/typescript/lance-namespace-fetch-client/src/models/TagContents.ts new file mode 100644 index 000000000..f3ec14772 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/TagContents.ts @@ -0,0 +1,83 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface TagContents + */ +export interface TagContents { + /** + * Branch name that the tag was created on (if any) + * @type {string} + * @memberof TagContents + */ + branch?: string; + /** + * Version number that the tag points to + * @type {number} + * @memberof TagContents + */ + version: number; + /** + * Size of the manifest file in bytes + * @type {number} + * @memberof TagContents + */ + manifestSize: number; +} + +/** + * Check if a given object implements the TagContents interface. + */ +export function instanceOfTagContents(value: object): value is TagContents { + if (!('version' in value) || value['version'] === undefined) return false; + if (!('manifestSize' in value) || value['manifestSize'] === undefined) return false; + return true; +} + +export function TagContentsFromJSON(json: any): TagContents { + return TagContentsFromJSONTyped(json, false); +} + +export function TagContentsFromJSONTyped(json: any, ignoreDiscriminator: boolean): TagContents { + if (json == null) { + return json; + } + return { + + 'branch': json['branch'] == null ? undefined : json['branch'], + 'version': json['version'], + 'manifestSize': json['manifestSize'], + }; +} + +export function TagContentsToJSON(json: any): TagContents { + return TagContentsToJSONTyped(json, false); +} + +export function TagContentsToJSONTyped(value?: TagContents | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'branch': value['branch'], + 'version': value['version'], + 'manifestSize': value['manifestSize'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/UpdateTableRequest.ts b/typescript/lance-namespace-fetch-client/src/models/UpdateTableRequest.ts new file mode 100644 index 000000000..c5ea234c2 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/UpdateTableRequest.ts @@ -0,0 +1,125 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Identity } from './Identity'; +import { + IdentityFromJSON, + IdentityFromJSONTyped, + IdentityToJSON, + IdentityToJSONTyped, +} from './Identity'; + +/** + * Each update consists of a column name and an SQL expression that will be + * evaluated against the current row's value. Optionally, a predicate can be + * provided to filter which rows to update. + * + * @export + * @interface UpdateTableRequest + */ +export interface UpdateTableRequest { + /** + * + * @type {Identity} + * @memberof UpdateTableRequest + */ + identity?: Identity; + /** + * Arbitrary context for a request as key-value pairs. + * How to use the context is custom to the specific implementation. + * + * REST NAMESPACE ONLY + * Context entries are passed via HTTP headers using the naming convention + * `x-lance-ctx-: `. For example, a context entry + * `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + * + * @type {{ [key: string]: string; }} + * @memberof UpdateTableRequest + */ + context?: { [key: string]: string; }; + /** + * + * @type {Array} + * @memberof UpdateTableRequest + */ + id?: Array; + /** + * Optional SQL predicate to filter rows for update + * @type {string} + * @memberof UpdateTableRequest + */ + predicate?: string; + /** + * List of column updates as [column_name, expression] pairs + * @type {Array>} + * @memberof UpdateTableRequest + */ + updates: Array>; + /** + * Properties stored on the table, if supported by the implementation. + * + * @type {{ [key: string]: string; }} + * @memberof UpdateTableRequest + */ + properties?: { [key: string]: string; }; +} + +/** + * Check if a given object implements the UpdateTableRequest interface. + */ +export function instanceOfUpdateTableRequest(value: object): value is UpdateTableRequest { + if (!('updates' in value) || value['updates'] === undefined) return false; + return true; +} + +export function UpdateTableRequestFromJSON(json: any): UpdateTableRequest { + return UpdateTableRequestFromJSONTyped(json, false); +} + +export function UpdateTableRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): UpdateTableRequest { + if (json == null) { + return json; + } + return { + + 'identity': json['identity'] == null ? undefined : IdentityFromJSON(json['identity']), + 'context': json['context'] == null ? undefined : json['context'], + 'id': json['id'] == null ? undefined : json['id'], + 'predicate': json['predicate'] == null ? undefined : json['predicate'], + 'updates': json['updates'], + 'properties': json['properties'] == null ? undefined : json['properties'], + }; +} + +export function UpdateTableRequestToJSON(json: any): UpdateTableRequest { + return UpdateTableRequestToJSONTyped(json, false); +} + +export function UpdateTableRequestToJSONTyped(value?: UpdateTableRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'identity': IdentityToJSON(value['identity']), + 'context': value['context'], + 'id': value['id'], + 'predicate': value['predicate'], + 'updates': value['updates'], + 'properties': value['properties'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/UpdateTableResponse.ts b/typescript/lance-namespace-fetch-client/src/models/UpdateTableResponse.ts new file mode 100644 index 000000000..06ee9e6dc --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/UpdateTableResponse.ts @@ -0,0 +1,92 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface UpdateTableResponse + */ +export interface UpdateTableResponse { + /** + * Optional transaction identifier + * @type {string} + * @memberof UpdateTableResponse + */ + transaction_id?: string; + /** + * Number of rows updated + * @type {number} + * @memberof UpdateTableResponse + */ + updated_rows: number; + /** + * The commit version associated with the operation + * @type {number} + * @memberof UpdateTableResponse + */ + version: number; + /** + * If the implementation does not support table properties, it should return null for this field. Otherwise, it should return the properties. + * + * @type {{ [key: string]: string; }} + * @memberof UpdateTableResponse + */ + properties?: { [key: string]: string; }; +} + +/** + * Check if a given object implements the UpdateTableResponse interface. + */ +export function instanceOfUpdateTableResponse(value: object): value is UpdateTableResponse { + if (!('updated_rows' in value) || value['updated_rows'] === undefined) return false; + if (!('version' in value) || value['version'] === undefined) return false; + return true; +} + +export function UpdateTableResponseFromJSON(json: any): UpdateTableResponse { + return UpdateTableResponseFromJSONTyped(json, false); +} + +export function UpdateTableResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): UpdateTableResponse { + if (json == null) { + return json; + } + return { + + 'transaction_id': json['transaction_id'] == null ? undefined : json['transaction_id'], + 'updated_rows': json['updated_rows'], + 'version': json['version'], + 'properties': json['properties'] == null ? undefined : json['properties'], + }; +} + +export function UpdateTableResponseToJSON(json: any): UpdateTableResponse { + return UpdateTableResponseToJSONTyped(json, false); +} + +export function UpdateTableResponseToJSONTyped(value?: UpdateTableResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'transaction_id': value['transaction_id'], + 'updated_rows': value['updated_rows'], + 'version': value['version'], + 'properties': value['properties'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/UpdateTableSchemaMetadataRequest.ts b/typescript/lance-namespace-fetch-client/src/models/UpdateTableSchemaMetadataRequest.ts new file mode 100644 index 000000000..b0c80cb22 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/UpdateTableSchemaMetadataRequest.ts @@ -0,0 +1,104 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Identity } from './Identity'; +import { + IdentityFromJSON, + IdentityFromJSONTyped, + IdentityToJSON, + IdentityToJSONTyped, +} from './Identity'; + +/** + * + * @export + * @interface UpdateTableSchemaMetadataRequest + */ +export interface UpdateTableSchemaMetadataRequest { + /** + * + * @type {Identity} + * @memberof UpdateTableSchemaMetadataRequest + */ + identity?: Identity; + /** + * Arbitrary context for a request as key-value pairs. + * How to use the context is custom to the specific implementation. + * + * REST NAMESPACE ONLY + * Context entries are passed via HTTP headers using the naming convention + * `x-lance-ctx-: `. For example, a context entry + * `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + * + * @type {{ [key: string]: string; }} + * @memberof UpdateTableSchemaMetadataRequest + */ + context?: { [key: string]: string; }; + /** + * The table identifier + * @type {Array} + * @memberof UpdateTableSchemaMetadataRequest + */ + id?: Array; + /** + * Schema metadata key-value pairs to set + * @type {{ [key: string]: string; }} + * @memberof UpdateTableSchemaMetadataRequest + */ + metadata?: { [key: string]: string; }; +} + +/** + * Check if a given object implements the UpdateTableSchemaMetadataRequest interface. + */ +export function instanceOfUpdateTableSchemaMetadataRequest(value: object): value is UpdateTableSchemaMetadataRequest { + return true; +} + +export function UpdateTableSchemaMetadataRequestFromJSON(json: any): UpdateTableSchemaMetadataRequest { + return UpdateTableSchemaMetadataRequestFromJSONTyped(json, false); +} + +export function UpdateTableSchemaMetadataRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): UpdateTableSchemaMetadataRequest { + if (json == null) { + return json; + } + return { + + 'identity': json['identity'] == null ? undefined : IdentityFromJSON(json['identity']), + 'context': json['context'] == null ? undefined : json['context'], + 'id': json['id'] == null ? undefined : json['id'], + 'metadata': json['metadata'] == null ? undefined : json['metadata'], + }; +} + +export function UpdateTableSchemaMetadataRequestToJSON(json: any): UpdateTableSchemaMetadataRequest { + return UpdateTableSchemaMetadataRequestToJSONTyped(json, false); +} + +export function UpdateTableSchemaMetadataRequestToJSONTyped(value?: UpdateTableSchemaMetadataRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'identity': IdentityToJSON(value['identity']), + 'context': value['context'], + 'id': value['id'], + 'metadata': value['metadata'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/UpdateTableSchemaMetadataResponse.ts b/typescript/lance-namespace-fetch-client/src/models/UpdateTableSchemaMetadataResponse.ts new file mode 100644 index 000000000..23ada7e30 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/UpdateTableSchemaMetadataResponse.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface UpdateTableSchemaMetadataResponse + */ +export interface UpdateTableSchemaMetadataResponse { + /** + * The updated schema metadata + * @type {{ [key: string]: string; }} + * @memberof UpdateTableSchemaMetadataResponse + */ + metadata?: { [key: string]: string; }; + /** + * Optional transaction identifier + * @type {string} + * @memberof UpdateTableSchemaMetadataResponse + */ + transaction_id?: string; +} + +/** + * Check if a given object implements the UpdateTableSchemaMetadataResponse interface. + */ +export function instanceOfUpdateTableSchemaMetadataResponse(value: object): value is UpdateTableSchemaMetadataResponse { + return true; +} + +export function UpdateTableSchemaMetadataResponseFromJSON(json: any): UpdateTableSchemaMetadataResponse { + return UpdateTableSchemaMetadataResponseFromJSONTyped(json, false); +} + +export function UpdateTableSchemaMetadataResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): UpdateTableSchemaMetadataResponse { + if (json == null) { + return json; + } + return { + + 'metadata': json['metadata'] == null ? undefined : json['metadata'], + 'transaction_id': json['transaction_id'] == null ? undefined : json['transaction_id'], + }; +} + +export function UpdateTableSchemaMetadataResponseToJSON(json: any): UpdateTableSchemaMetadataResponse { + return UpdateTableSchemaMetadataResponseToJSONTyped(json, false); +} + +export function UpdateTableSchemaMetadataResponseToJSONTyped(value?: UpdateTableSchemaMetadataResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'metadata': value['metadata'], + 'transaction_id': value['transaction_id'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/UpdateTableTagRequest.ts b/typescript/lance-namespace-fetch-client/src/models/UpdateTableTagRequest.ts new file mode 100644 index 000000000..4601ad6cc --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/UpdateTableTagRequest.ts @@ -0,0 +1,114 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Identity } from './Identity'; +import { + IdentityFromJSON, + IdentityFromJSONTyped, + IdentityToJSON, + IdentityToJSONTyped, +} from './Identity'; + +/** + * + * @export + * @interface UpdateTableTagRequest + */ +export interface UpdateTableTagRequest { + /** + * + * @type {Identity} + * @memberof UpdateTableTagRequest + */ + identity?: Identity; + /** + * Arbitrary context for a request as key-value pairs. + * How to use the context is custom to the specific implementation. + * + * REST NAMESPACE ONLY + * Context entries are passed via HTTP headers using the naming convention + * `x-lance-ctx-: `. For example, a context entry + * `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. + * + * @type {{ [key: string]: string; }} + * @memberof UpdateTableTagRequest + */ + context?: { [key: string]: string; }; + /** + * + * @type {Array} + * @memberof UpdateTableTagRequest + */ + id?: Array; + /** + * Name of the tag to update + * @type {string} + * @memberof UpdateTableTagRequest + */ + tag: string; + /** + * New version number for the tag to point to + * @type {number} + * @memberof UpdateTableTagRequest + */ + version: number; +} + +/** + * Check if a given object implements the UpdateTableTagRequest interface. + */ +export function instanceOfUpdateTableTagRequest(value: object): value is UpdateTableTagRequest { + if (!('tag' in value) || value['tag'] === undefined) return false; + if (!('version' in value) || value['version'] === undefined) return false; + return true; +} + +export function UpdateTableTagRequestFromJSON(json: any): UpdateTableTagRequest { + return UpdateTableTagRequestFromJSONTyped(json, false); +} + +export function UpdateTableTagRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): UpdateTableTagRequest { + if (json == null) { + return json; + } + return { + + 'identity': json['identity'] == null ? undefined : IdentityFromJSON(json['identity']), + 'context': json['context'] == null ? undefined : json['context'], + 'id': json['id'] == null ? undefined : json['id'], + 'tag': json['tag'], + 'version': json['version'], + }; +} + +export function UpdateTableTagRequestToJSON(json: any): UpdateTableTagRequest { + return UpdateTableTagRequestToJSONTyped(json, false); +} + +export function UpdateTableTagRequestToJSONTyped(value?: UpdateTableTagRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'identity': IdentityToJSON(value['identity']), + 'context': value['context'], + 'id': value['id'], + 'tag': value['tag'], + 'version': value['version'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/UpdateTableTagResponse.ts b/typescript/lance-namespace-fetch-client/src/models/UpdateTableTagResponse.ts new file mode 100644 index 000000000..99a37be3e --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/UpdateTableTagResponse.ts @@ -0,0 +1,65 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * Response for update tag operation + * @export + * @interface UpdateTableTagResponse + */ +export interface UpdateTableTagResponse { + /** + * Optional transaction identifier + * @type {string} + * @memberof UpdateTableTagResponse + */ + transaction_id?: string; +} + +/** + * Check if a given object implements the UpdateTableTagResponse interface. + */ +export function instanceOfUpdateTableTagResponse(value: object): value is UpdateTableTagResponse { + return true; +} + +export function UpdateTableTagResponseFromJSON(json: any): UpdateTableTagResponse { + return UpdateTableTagResponseFromJSONTyped(json, false); +} + +export function UpdateTableTagResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): UpdateTableTagResponse { + if (json == null) { + return json; + } + return { + + 'transaction_id': json['transaction_id'] == null ? undefined : json['transaction_id'], + }; +} + +export function UpdateTableTagResponseToJSON(json: any): UpdateTableTagResponse { + return UpdateTableTagResponseToJSONTyped(json, false); +} + +export function UpdateTableTagResponseToJSONTyped(value?: UpdateTableTagResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'transaction_id': value['transaction_id'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/VersionRange.ts b/typescript/lance-namespace-fetch-client/src/models/VersionRange.ts new file mode 100644 index 000000000..bb8b20ade --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/VersionRange.ts @@ -0,0 +1,82 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * A range of versions to delete (start inclusive, end exclusive). + * Special values: + * - `start_version: 0` with `end_version: -1` means ALL versions + * + * @export + * @interface VersionRange + */ +export interface VersionRange { + /** + * Start version of the range (inclusive). + * Use 0 to start from the first version. + * + * @type {number} + * @memberof VersionRange + */ + start_version: number; + /** + * End version of the range (exclusive). + * Use -1 to indicate all versions up to and including the latest. + * + * @type {number} + * @memberof VersionRange + */ + end_version: number; +} + +/** + * Check if a given object implements the VersionRange interface. + */ +export function instanceOfVersionRange(value: object): value is VersionRange { + if (!('start_version' in value) || value['start_version'] === undefined) return false; + if (!('end_version' in value) || value['end_version'] === undefined) return false; + return true; +} + +export function VersionRangeFromJSON(json: any): VersionRange { + return VersionRangeFromJSONTyped(json, false); +} + +export function VersionRangeFromJSONTyped(json: any, ignoreDiscriminator: boolean): VersionRange { + if (json == null) { + return json; + } + return { + + 'start_version': json['start_version'], + 'end_version': json['end_version'], + }; +} + +export function VersionRangeToJSON(json: any): VersionRange { + return VersionRangeToJSONTyped(json, false); +} + +export function VersionRangeToJSONTyped(value?: VersionRange | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'start_version': value['start_version'], + 'end_version': value['end_version'], + }; +} + diff --git a/typescript/lance-namespace-fetch-client/src/models/index.ts b/typescript/lance-namespace-fetch-client/src/models/index.ts new file mode 100644 index 000000000..c5b7e7447 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/models/index.ts @@ -0,0 +1,124 @@ +/* tslint:disable */ +/* eslint-disable */ +export * from './AddVirtualColumnEntry'; +export * from './AlterColumnsEntry'; +export * from './AlterTableAddColumnsRequest'; +export * from './AlterTableAddColumnsResponse'; +export * from './AlterTableAlterColumnsRequest'; +export * from './AlterTableAlterColumnsResponse'; +export * from './AlterTableDropColumnsRequest'; +export * from './AlterTableDropColumnsResponse'; +export * from './AlterTransactionAction'; +export * from './AlterTransactionRequest'; +export * from './AlterTransactionResponse'; +export * from './AlterTransactionSetProperty'; +export * from './AlterTransactionSetStatus'; +export * from './AlterTransactionUnsetProperty'; +export * from './AlterVirtualColumnEntry'; +export * from './AnalyzeTableQueryPlanRequest'; +export * from './AnalyzeTableQueryPlanResponse'; +export * from './BatchCreateTableVersionsRequest'; +export * from './BatchCreateTableVersionsResponse'; +export * from './BatchDeleteTableVersionsRequest'; +export * from './BatchDeleteTableVersionsResponse'; +export * from './BooleanQuery'; +export * from './BoostQuery'; +export * from './CountTableRowsRequest'; +export * from './CreateEmptyTableRequest'; +export * from './CreateEmptyTableResponse'; +export * from './CreateNamespaceRequest'; +export * from './CreateNamespaceResponse'; +export * from './CreateTableIndexRequest'; +export * from './CreateTableIndexResponse'; +export * from './CreateTableRequest'; +export * from './CreateTableResponse'; +export * from './CreateTableScalarIndexResponse'; +export * from './CreateTableTagRequest'; +export * from './CreateTableTagResponse'; +export * from './CreateTableVersionEntry'; +export * from './CreateTableVersionRequest'; +export * from './CreateTableVersionResponse'; +export * from './DeclareTableRequest'; +export * from './DeclareTableResponse'; +export * from './DeleteFromTableRequest'; +export * from './DeleteFromTableResponse'; +export * from './DeleteTableTagRequest'; +export * from './DeleteTableTagResponse'; +export * from './DeregisterTableRequest'; +export * from './DeregisterTableResponse'; +export * from './DescribeNamespaceRequest'; +export * from './DescribeNamespaceResponse'; +export * from './DescribeTableIndexStatsRequest'; +export * from './DescribeTableIndexStatsResponse'; +export * from './DescribeTableRequest'; +export * from './DescribeTableResponse'; +export * from './DescribeTableVersionRequest'; +export * from './DescribeTableVersionResponse'; +export * from './DescribeTransactionRequest'; +export * from './DescribeTransactionResponse'; +export * from './DropNamespaceRequest'; +export * from './DropNamespaceResponse'; +export * from './DropTableIndexRequest'; +export * from './DropTableIndexResponse'; +export * from './DropTableRequest'; +export * from './DropTableResponse'; +export * from './ErrorResponse'; +export * from './ExplainTableQueryPlanRequest'; +export * from './ExplainTableQueryPlanResponse'; +export * from './FragmentStats'; +export * from './FragmentSummary'; +export * from './FtsQuery'; +export * from './GetTableStatsRequest'; +export * from './GetTableStatsResponse'; +export * from './GetTableTagVersionRequest'; +export * from './GetTableTagVersionResponse'; +export * from './Identity'; +export * from './IndexContent'; +export * from './InsertIntoTableRequest'; +export * from './InsertIntoTableResponse'; +export * from './JsonArrowDataType'; +export * from './JsonArrowField'; +export * from './JsonArrowSchema'; +export * from './ListNamespacesRequest'; +export * from './ListNamespacesResponse'; +export * from './ListTableIndicesRequest'; +export * from './ListTableIndicesResponse'; +export * from './ListTableTagsRequest'; +export * from './ListTableTagsResponse'; +export * from './ListTableVersionsRequest'; +export * from './ListTableVersionsResponse'; +export * from './ListTablesRequest'; +export * from './ListTablesResponse'; +export * from './MatchQuery'; +export * from './MergeInsertIntoTableRequest'; +export * from './MergeInsertIntoTableResponse'; +export * from './MultiMatchQuery'; +export * from './NamespaceExistsRequest'; +export * from './NewColumnTransform'; +export * from './PartitionField'; +export * from './PartitionSpec'; +export * from './PartitionTransform'; +export * from './PhraseQuery'; +export * from './QueryTableRequest'; +export * from './QueryTableRequestColumns'; +export * from './QueryTableRequestFullTextQuery'; +export * from './QueryTableRequestVector'; +export * from './RegisterTableRequest'; +export * from './RegisterTableResponse'; +export * from './RenameTableRequest'; +export * from './RenameTableResponse'; +export * from './RestoreTableRequest'; +export * from './RestoreTableResponse'; +export * from './StringFtsQuery'; +export * from './StructuredFtsQuery'; +export * from './TableBasicStats'; +export * from './TableExistsRequest'; +export * from './TableVersion'; +export * from './TagContents'; +export * from './UpdateTableRequest'; +export * from './UpdateTableResponse'; +export * from './UpdateTableSchemaMetadataRequest'; +export * from './UpdateTableSchemaMetadataResponse'; +export * from './UpdateTableTagRequest'; +export * from './UpdateTableTagResponse'; +export * from './VersionRange'; diff --git a/typescript/lance-namespace-fetch-client/src/runtime.ts b/typescript/lance-namespace-fetch-client/src/runtime.ts new file mode 100644 index 000000000..079795d6a --- /dev/null +++ b/typescript/lance-namespace-fetch-client/src/runtime.ts @@ -0,0 +1,431 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Lance Namespace Specification + * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export const BASE_PATH = "http://localhost:2333".replace(/\/+$/, ""); + +export interface ConfigurationParameters { + basePath?: string; // override base path + fetchApi?: FetchAPI; // override for fetch implementation + middleware?: Middleware[]; // middleware to apply before/after fetch requests + queryParamsStringify?: (params: HTTPQuery) => string; // stringify function for query strings + username?: string; // parameter for basic security + password?: string; // parameter for basic security + apiKey?: string | Promise | ((name: string) => string | Promise); // parameter for apiKey security + accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string | Promise); // parameter for oauth2 security + headers?: HTTPHeaders; //header params we want to use on every request + credentials?: RequestCredentials; //value for the credentials param we want to use on each request +} + +export class Configuration { + constructor(private configuration: ConfigurationParameters = {}) {} + + set config(configuration: Configuration) { + this.configuration = configuration; + } + + get basePath(): string { + return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH; + } + + get fetchApi(): FetchAPI | undefined { + return this.configuration.fetchApi; + } + + get middleware(): Middleware[] { + return this.configuration.middleware || []; + } + + get queryParamsStringify(): (params: HTTPQuery) => string { + return this.configuration.queryParamsStringify || querystring; + } + + get username(): string | undefined { + return this.configuration.username; + } + + get password(): string | undefined { + return this.configuration.password; + } + + get apiKey(): ((name: string) => string | Promise) | undefined { + const apiKey = this.configuration.apiKey; + if (apiKey) { + return typeof apiKey === 'function' ? apiKey : () => apiKey; + } + return undefined; + } + + get accessToken(): ((name?: string, scopes?: string[]) => string | Promise) | undefined { + const accessToken = this.configuration.accessToken; + if (accessToken) { + return typeof accessToken === 'function' ? accessToken : async () => accessToken; + } + return undefined; + } + + get headers(): HTTPHeaders | undefined { + return this.configuration.headers; + } + + get credentials(): RequestCredentials | undefined { + return this.configuration.credentials; + } +} + +export const DefaultConfig = new Configuration(); + +/** + * This is the base class for all generated API classes. + */ +export class BaseAPI { + + private static readonly jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i'); + private middleware: Middleware[]; + + constructor(protected configuration = DefaultConfig) { + this.middleware = configuration.middleware; + } + + withMiddleware(this: T, ...middlewares: Middleware[]) { + const next = this.clone(); + next.middleware = next.middleware.concat(...middlewares); + return next; + } + + withPreMiddleware(this: T, ...preMiddlewares: Array) { + const middlewares = preMiddlewares.map((pre) => ({ pre })); + return this.withMiddleware(...middlewares); + } + + withPostMiddleware(this: T, ...postMiddlewares: Array) { + const middlewares = postMiddlewares.map((post) => ({ post })); + return this.withMiddleware(...middlewares); + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime - MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + protected isJsonMime(mime: string | null | undefined): boolean { + if (!mime) { + return false; + } + return BaseAPI.jsonRegex.test(mime); + } + + protected async request(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction): Promise { + const { url, init } = await this.createFetchParams(context, initOverrides); + const response = await this.fetchApi(url, init); + if (response && (response.status >= 200 && response.status < 300)) { + return response; + } + throw new ResponseError(response, 'Response returned an error code'); + } + + private async createFetchParams(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction) { + let url = this.configuration.basePath + context.path; + if (context.query !== undefined && Object.keys(context.query).length !== 0) { + // only add the querystring to the URL if there are query parameters. + // this is done to avoid urls ending with a "?" character which buggy webservers + // do not handle correctly sometimes. + url += '?' + this.configuration.queryParamsStringify(context.query); + } + + const headers = Object.assign({}, this.configuration.headers, context.headers); + Object.keys(headers).forEach(key => headers[key] === undefined ? delete headers[key] : {}); + + const initOverrideFn = + typeof initOverrides === "function" + ? initOverrides + : async () => initOverrides; + + const initParams = { + method: context.method, + headers, + body: context.body, + credentials: this.configuration.credentials, + }; + + const overriddenInit: RequestInit = { + ...initParams, + ...(await initOverrideFn({ + init: initParams, + context, + })) + }; + + let body: any; + if (isFormData(overriddenInit.body) + || (overriddenInit.body instanceof URLSearchParams) + || isBlob(overriddenInit.body)) { + body = overriddenInit.body; + } else if (this.isJsonMime(headers['Content-Type'])) { + body = JSON.stringify(overriddenInit.body); + } else { + body = overriddenInit.body; + } + + const init: RequestInit = { + ...overriddenInit, + body + }; + + return { url, init }; + } + + private fetchApi = async (url: string, init: RequestInit) => { + let fetchParams = { url, init }; + for (const middleware of this.middleware) { + if (middleware.pre) { + fetchParams = await middleware.pre({ + fetch: this.fetchApi, + ...fetchParams, + }) || fetchParams; + } + } + let response: Response | undefined = undefined; + try { + response = await (this.configuration.fetchApi || fetch)(fetchParams.url, fetchParams.init); + } catch (e) { + for (const middleware of this.middleware) { + if (middleware.onError) { + response = await middleware.onError({ + fetch: this.fetchApi, + url: fetchParams.url, + init: fetchParams.init, + error: e, + response: response ? response.clone() : undefined, + }) || response; + } + } + if (response === undefined) { + if (e instanceof Error) { + throw new FetchError(e, 'The request failed and the interceptors did not return an alternative response'); + } else { + throw e; + } + } + } + for (const middleware of this.middleware) { + if (middleware.post) { + response = await middleware.post({ + fetch: this.fetchApi, + url: fetchParams.url, + init: fetchParams.init, + response: response.clone(), + }) || response; + } + } + return response; + } + + /** + * Create a shallow clone of `this` by constructing a new instance + * and then shallow cloning data members. + */ + private clone(this: T): T { + const constructor = this.constructor as any; + const next = new constructor(this.configuration); + next.middleware = this.middleware.slice(); + return next; + } +}; + +function isBlob(value: any): value is Blob { + return typeof Blob !== 'undefined' && value instanceof Blob; +} + +function isFormData(value: any): value is FormData { + return typeof FormData !== "undefined" && value instanceof FormData; +} + +export class ResponseError extends Error { + override name: "ResponseError" = "ResponseError"; + constructor(public response: Response, msg?: string) { + super(msg); + } +} + +export class FetchError extends Error { + override name: "FetchError" = "FetchError"; + constructor(public cause: Error, msg?: string) { + super(msg); + } +} + +export class RequiredError extends Error { + override name: "RequiredError" = "RequiredError"; + constructor(public field: string, msg?: string) { + super(msg); + } +} + +export const COLLECTION_FORMATS = { + csv: ",", + ssv: " ", + tsv: "\t", + pipes: "|", +}; + +export type FetchAPI = WindowOrWorkerGlobalScope['fetch']; + +export type Json = any; +export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD'; +export type HTTPHeaders = { [key: string]: string }; +export type HTTPQuery = { [key: string]: string | number | null | boolean | Array | Set | HTTPQuery }; +export type HTTPBody = Json | FormData | URLSearchParams; +export type HTTPRequestInit = { headers?: HTTPHeaders; method: HTTPMethod; credentials?: RequestCredentials; body?: HTTPBody }; +export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original'; + +export type InitOverrideFunction = (requestContext: { init: HTTPRequestInit, context: RequestOpts }) => Promise + +export interface FetchParams { + url: string; + init: RequestInit; +} + +export interface RequestOpts { + path: string; + method: HTTPMethod; + headers: HTTPHeaders; + query?: HTTPQuery; + body?: HTTPBody; +} + +export function querystring(params: HTTPQuery, prefix: string = ''): string { + return Object.keys(params) + .map(key => querystringSingleKey(key, params[key], prefix)) + .filter(part => part.length > 0) + .join('&'); +} + +function querystringSingleKey(key: string, value: string | number | null | undefined | boolean | Array | Set | HTTPQuery, keyPrefix: string = ''): string { + const fullKey = keyPrefix + (keyPrefix.length ? `[${key}]` : key); + if (value instanceof Array) { + const multiValue = value.map(singleValue => encodeURIComponent(String(singleValue))) + .join(`&${encodeURIComponent(fullKey)}=`); + return `${encodeURIComponent(fullKey)}=${multiValue}`; + } + if (value instanceof Set) { + const valueAsArray = Array.from(value); + return querystringSingleKey(key, valueAsArray, keyPrefix); + } + if (value instanceof Date) { + return `${encodeURIComponent(fullKey)}=${encodeURIComponent(value.toISOString())}`; + } + if (value instanceof Object) { + return querystring(value as HTTPQuery, fullKey); + } + return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`; +} + +export function exists(json: any, key: string) { + const value = json[key]; + return value !== null && value !== undefined; +} + +export function mapValues(data: any, fn: (item: any) => any) { + return Object.keys(data).reduce( + (acc, key) => ({ ...acc, [key]: fn(data[key]) }), + {} + ); +} + +export function canConsumeForm(consumes: Consume[]): boolean { + for (const consume of consumes) { + if ('multipart/form-data' === consume.contentType) { + return true; + } + } + return false; +} + +export interface Consume { + contentType: string; +} + +export interface RequestContext { + fetch: FetchAPI; + url: string; + init: RequestInit; +} + +export interface ResponseContext { + fetch: FetchAPI; + url: string; + init: RequestInit; + response: Response; +} + +export interface ErrorContext { + fetch: FetchAPI; + url: string; + init: RequestInit; + error: unknown; + response?: Response; +} + +export interface Middleware { + pre?(context: RequestContext): Promise; + post?(context: ResponseContext): Promise; + onError?(context: ErrorContext): Promise; +} + +export interface ApiResponse { + raw: Response; + value(): Promise; +} + +export interface ResponseTransformer { + (json: any): T; +} + +export class JSONApiResponse { + constructor(public raw: Response, private transformer: ResponseTransformer = (jsonValue: any) => jsonValue) {} + + async value(): Promise { + return this.transformer(await this.raw.json()); + } +} + +export class VoidApiResponse { + constructor(public raw: Response) {} + + async value(): Promise { + return undefined; + } +} + +export class BlobApiResponse { + constructor(public raw: Response) {} + + async value(): Promise { + return await this.raw.blob(); + }; +} + +export class TextApiResponse { + constructor(public raw: Response) {} + + async value(): Promise { + return await this.raw.text(); + }; +} diff --git a/typescript/lance-namespace-fetch-client/test/smoke.test.ts b/typescript/lance-namespace-fetch-client/test/smoke.test.ts new file mode 100644 index 000000000..8d77c2534 --- /dev/null +++ b/typescript/lance-namespace-fetch-client/test/smoke.test.ts @@ -0,0 +1,10 @@ +import { describe, expect, it } from "vitest"; + +import { NamespaceApi } from "../src/apis/NamespaceApi"; + +describe("fetch-client smoke", () => { + it("constructs api instance", () => { + const api = new NamespaceApi(); + expect(api).toBeDefined(); + }); +}); diff --git a/typescript/lance-namespace-fetch-client/tsconfig.esm.json b/typescript/lance-namespace-fetch-client/tsconfig.esm.json new file mode 100644 index 000000000..2c0331cce --- /dev/null +++ b/typescript/lance-namespace-fetch-client/tsconfig.esm.json @@ -0,0 +1,7 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "esnext", + "outDir": "dist/esm" + } +} diff --git a/typescript/lance-namespace-fetch-client/tsconfig.json b/typescript/lance-namespace-fetch-client/tsconfig.json new file mode 100644 index 000000000..b38b0554f --- /dev/null +++ b/typescript/lance-namespace-fetch-client/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "declaration": true, + "target": "es2022", + "module": "commonjs", + "moduleResolution": "node", + "outDir": "dist", + "lib": [ + "es2022", + "dom" + ], + "skipLibCheck": true + }, + "include": [ + "src/**/*.ts" + ], + "exclude": [ + "dist", + "node_modules", + "test", + "vitest.config.ts" + ] +} diff --git a/typescript/lance-namespace-fetch-client/vitest.config.ts b/typescript/lance-namespace-fetch-client/vitest.config.ts new file mode 100644 index 000000000..8b5840aca --- /dev/null +++ b/typescript/lance-namespace-fetch-client/vitest.config.ts @@ -0,0 +1,7 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + include: ["test/**/*.test.ts"], + }, +}); diff --git a/typescript/lance-namespace-rest/README.md b/typescript/lance-namespace-rest/README.md new file mode 100644 index 000000000..c6965c2bc --- /dev/null +++ b/typescript/lance-namespace-rest/README.md @@ -0,0 +1,3 @@ +# @lance/lance-namespace-rest + +REST implementation for `@lance/lance-namespace`. diff --git a/typescript/lance-namespace-rest/package.json b/typescript/lance-namespace-rest/package.json new file mode 100644 index 000000000..a8b62769a --- /dev/null +++ b/typescript/lance-namespace-rest/package.json @@ -0,0 +1,31 @@ +{ + "name": "@lance/lance-namespace-rest", + "version": "0.5.2", + "description": "REST namespace implementation for Lance Namespace TypeScript", + "type": "module", + "main": "./dist/index.js", + "types": "./dist/index.d.ts", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "import": "./dist/index.js" + } + }, + "files": [ + "dist" + ], + "scripts": { + "build": "rm -rf dist && tsc -p tsconfig.json", + "lint": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.test.json --noEmit", + "test": "vitest run" + }, + "dependencies": { + "@lance/lance-namespace": "workspace:*", + "@lance/namespace-fetch-client": "workspace:*" + }, + "devDependencies": { + "typescript": "^5.8.3", + "vitest": "^2.1.9" + }, + "license": "Apache-2.0" +} diff --git a/typescript/lance-namespace-rest/src/index.ts b/typescript/lance-namespace-rest/src/index.ts new file mode 100644 index 000000000..c94808a1d --- /dev/null +++ b/typescript/lance-namespace-rest/src/index.ts @@ -0,0 +1,14 @@ +// 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. + +export { RestNamespace } from "./rest_namespace"; +export type { RestNamespaceProperties } from "./rest_namespace"; diff --git a/typescript/lance-namespace-rest/src/rest_namespace.ts b/typescript/lance-namespace-rest/src/rest_namespace.ts new file mode 100644 index 000000000..9b2f28a02 --- /dev/null +++ b/typescript/lance-namespace-rest/src/rest_namespace.ts @@ -0,0 +1,1190 @@ +// 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. + +import { + Configuration, + FetchError, + NamespaceApi, + RequiredError, + ResponseError, + TableApi, + TransactionApi, +} from "@lance/namespace-fetch-client"; +import type * as Models from "@lance/namespace-fetch-client"; + +import { + fromErrorCode, + fromErrorResponse, + InternalError, + InvalidInputError, + LanceNamespace, + LanceNamespaceError, + ServiceUnavailableError, +} from "@lance/lance-namespace"; + +interface HasIdentityAndContext { + identity?: { + api_key?: string; + auth_token?: string; + }; + context?: Record; +} + +export interface RestNamespaceProperties { + uri: string; + delimiter?: string; + [key: string]: string | undefined; +} + +export class RestNamespace extends LanceNamespace { + private readonly properties: Record; + private readonly delimiter: string; + private readonly namespaceApi: NamespaceApi; + private readonly tableApi: TableApi; + private readonly transactionApi: TransactionApi; + + public constructor(properties: Record) { + super(); + + const uri = properties.uri; + if (uri === undefined || uri.trim() === "") { + throw new InvalidInputError("Missing required rest namespace property: uri"); + } + + this.properties = properties; + this.delimiter = properties.delimiter ?? "$"; + + const headers: Record = {}; + for (const [key, value] of Object.entries(properties)) { + if (value !== undefined && key.startsWith("headers.")) { + headers[key.slice("headers.".length)] = value; + } + } + + const config = new Configuration({ + basePath: uri.replace(/\/+$/, ""), + headers, + }); + + this.namespaceApi = new NamespaceApi(config); + this.tableApi = new TableApi(config); + this.transactionApi = new TransactionApi(config); + } + + public namespaceId(): string { + return `RestNamespace { uri: '${this.properties.uri}', delimiter: '${this.delimiter}' }`; + } + + public async createNamespace( + request: Models.CreateNamespaceRequest, + ): Promise { + const id = this.requireNamespaceIdentifier(request.id); + const normalized = this.canonicalizeId(request, id, "createNamespace"); + + return this.withErrorMapping(() => + this.namespaceApi.createNamespace( + { + id: this.toRouteIdentifier(id, true), + delimiter: this.delimiter, + createNamespaceRequest: normalized, + }, + this.requestInitOverride(normalized), + ), + ); + } + + public async listNamespaces( + request: Models.ListNamespacesRequest, + ): Promise { + const id = this.optionalNamespaceIdentifier(request.id); + + return this.withErrorMapping(() => + this.namespaceApi.listNamespaces( + { + id: this.toRouteIdentifier(id, true), + delimiter: this.delimiter, + pageToken: request.page_token, + limit: request.limit, + }, + this.requestInitOverride(request), + ), + ); + } + + public async describeNamespace( + request: Models.DescribeNamespaceRequest, + ): Promise { + const id = this.requireNamespaceIdentifier(request.id); + const normalized = this.canonicalizeId(request, id, "describeNamespace"); + + return this.withErrorMapping(() => + this.namespaceApi.describeNamespace( + { + id: this.toRouteIdentifier(id, true), + delimiter: this.delimiter, + describeNamespaceRequest: normalized, + }, + this.requestInitOverride(normalized), + ), + ); + } + + public async dropNamespace( + request: Models.DropNamespaceRequest, + ): Promise { + const id = this.requireNamespaceIdentifier(request.id); + const normalized = this.normalizeDropNamespaceRequest( + this.canonicalizeId(request, id, "dropNamespace"), + ); + + return this.withErrorMapping(() => + this.namespaceApi.dropNamespace( + { + id: this.toRouteIdentifier(id, true), + delimiter: this.delimiter, + dropNamespaceRequest: normalized, + }, + this.requestInitOverride(normalized), + ), + ); + } + + public async namespaceExists(request: Models.NamespaceExistsRequest): Promise { + const id = this.requireNamespaceIdentifier(request.id); + const normalized = this.canonicalizeId(request, id, "namespaceExists"); + + await this.withErrorMapping(() => + this.namespaceApi.namespaceExists( + { + id: this.toRouteIdentifier(id, true), + delimiter: this.delimiter, + namespaceExistsRequest: normalized, + }, + this.requestInitOverride(normalized), + ), + ); + } + + public async listTables( + request: Models.ListTablesRequest, + ): Promise { + const id = this.optionalNamespaceIdentifier(request.id); + + return this.withErrorMapping(() => + this.namespaceApi.listTables( + { + id: this.toRouteIdentifier(id, true), + delimiter: this.delimiter, + pageToken: request.page_token, + limit: request.limit, + }, + this.requestInitOverride(request), + ), + ); + } + + public async listAllTables( + request: Models.ListTablesRequest, + ): Promise { + return this.withErrorMapping(() => + this.tableApi.listAllTables( + { + delimiter: this.delimiter, + pageToken: request.page_token, + limit: request.limit, + }, + this.requestInitOverride(request), + ), + ); + } + + public async describeTable( + request: Models.DescribeTableRequest, + ): Promise { + const id = this.requireTableIdentifier(request.id, "describeTable"); + const normalized = this.canonicalizeId(request, id, "describeTable"); + + return this.withErrorMapping(() => + this.tableApi.describeTable( + { + id: this.toRouteIdentifier(id), + delimiter: this.delimiter, + withTableUri: request.with_table_uri, + loadDetailedMetadata: request.load_detailed_metadata ?? false, + describeTableRequest: normalized, + }, + this.requestInitOverride(normalized), + ), + ); + } + + public async registerTable( + request: Models.RegisterTableRequest, + ): Promise { + const id = this.requireTableIdentifier(request.id, "registerTable"); + const normalized = this.canonicalizeId(request, id, "registerTable"); + + return this.withErrorMapping(() => + this.tableApi.registerTable( + { + id: this.toRouteIdentifier(id), + delimiter: this.delimiter, + registerTableRequest: normalized, + }, + this.requestInitOverride(normalized), + ), + ); + } + + public async tableExists(request: Models.TableExistsRequest): Promise { + const id = this.requireTableIdentifier(request.id, "tableExists"); + const normalized = this.canonicalizeId(request, id, "tableExists"); + + await this.withErrorMapping(() => + this.tableApi.tableExists( + { + id: this.toRouteIdentifier(id), + delimiter: this.delimiter, + tableExistsRequest: normalized, + }, + this.requestInitOverride(normalized), + ), + ); + } + + public async dropTable( + request: Models.DropTableRequest, + ): Promise { + const id = this.requireTableIdentifier(request.id, "dropTable"); + + return this.withErrorMapping(() => + this.tableApi.dropTable( + { + id: this.toRouteIdentifier(id), + delimiter: this.delimiter, + }, + this.requestInitOverride(request), + ), + ); + } + + public async deregisterTable( + request: Models.DeregisterTableRequest, + ): Promise { + const id = this.requireTableIdentifier(request.id, "deregisterTable"); + const normalized = this.canonicalizeId(request, id, "deregisterTable"); + + return this.withErrorMapping(() => + this.tableApi.deregisterTable( + { + id: this.toRouteIdentifier(id), + delimiter: this.delimiter, + deregisterTableRequest: normalized, + }, + this.requestInitOverride(normalized), + ), + ); + } + + public async createTable( + request: Models.CreateTableRequest, + requestData: Uint8Array, + ): Promise { + const id = this.requireTableIdentifier(request.id, "createTable"); + const normalized = this.canonicalizeId(request, id, "createTable"); + + const extraHeaders: Record = {}; + if (request.properties !== undefined) { + extraHeaders["x-lance-table-properties"] = JSON.stringify(request.properties); + } + + return this.withErrorMapping(() => + this.tableApi.createTable( + { + id: this.toRouteIdentifier(id), + delimiter: this.delimiter, + mode: normalized.mode, + body: this.toBlob(requestData), + }, + this.requestInitOverride(normalized, extraHeaders), + ), + ); + } + + public async declareTable( + request: Models.DeclareTableRequest, + ): Promise { + const id = this.requireTableIdentifier(request.id, "declareTable"); + const normalized = this.canonicalizeId(request, id, "declareTable"); + + return this.withErrorMapping(() => + this.tableApi.declareTable( + { + id: this.toRouteIdentifier(id), + delimiter: this.delimiter, + declareTableRequest: normalized, + }, + this.requestInitOverride(normalized), + ), + ); + } + + public async createEmptyTable( + request: Models.CreateEmptyTableRequest, + ): Promise { + const id = this.requireTableIdentifier(request.id, "createEmptyTable"); + const normalized = this.canonicalizeId(request, id, "createEmptyTable"); + + return this.withErrorMapping(() => + this.tableApi.createEmptyTable( + { + id: this.toRouteIdentifier(id), + delimiter: this.delimiter, + createEmptyTableRequest: normalized, + }, + this.requestInitOverride(normalized), + ), + ); + } + + public async insertIntoTable( + request: Models.InsertIntoTableRequest, + requestData: Uint8Array, + ): Promise { + const id = this.requireTableIdentifier(request.id, "insertIntoTable"); + const normalized = this.canonicalizeId(request, id, "insertIntoTable"); + + return this.withErrorMapping(() => + this.tableApi.insertIntoTable( + { + id: this.toRouteIdentifier(id), + delimiter: this.delimiter, + mode: normalized.mode, + body: this.toBlob(requestData), + }, + this.requestInitOverride(normalized), + ), + ); + } + + public async mergeInsertIntoTable( + request: Models.MergeInsertIntoTableRequest, + requestData: Uint8Array, + ): Promise { + const id = this.requireTableIdentifier(request.id, "mergeInsertIntoTable"); + const normalized = this.canonicalizeId(request, id, "mergeInsertIntoTable"); + const on = normalized.on; + if (on === undefined || on.length === 0) { + throw new InvalidInputError("MergeInsertIntoTable request requires non-empty `on`"); + } + + return this.withErrorMapping(() => + this.tableApi.mergeInsertIntoTable( + { + id: this.toRouteIdentifier(id), + delimiter: this.delimiter, + on, + whenMatchedUpdateAll: normalized.when_matched_update_all, + whenMatchedUpdateAllFilt: normalized.when_matched_update_all_filt, + whenNotMatchedInsertAll: normalized.when_not_matched_insert_all, + whenNotMatchedBySourceDelete: normalized.when_not_matched_by_source_delete, + whenNotMatchedBySourceDeleteFilt: + normalized.when_not_matched_by_source_delete_filt, + timeout: normalized.timeout, + useIndex: normalized.use_index, + body: this.toBlob(requestData), + }, + this.requestInitOverride(normalized), + ), + ); + } + + public async updateTable( + request: Models.UpdateTableRequest, + ): Promise { + const id = this.requireTableIdentifier(request.id, "updateTable"); + const normalized = this.canonicalizeId(request, id, "updateTable"); + + return this.withErrorMapping(() => + this.tableApi.updateTable( + { + id: this.toRouteIdentifier(id), + delimiter: this.delimiter, + updateTableRequest: normalized, + }, + this.requestInitOverride(normalized), + ), + ); + } + + public async deleteFromTable( + request: Models.DeleteFromTableRequest, + ): Promise { + const id = this.requireTableIdentifier(request.id, "deleteFromTable"); + const normalized = this.canonicalizeId(request, id, "deleteFromTable"); + + return this.withErrorMapping(() => + this.tableApi.deleteFromTable( + { + id: this.toRouteIdentifier(id), + delimiter: this.delimiter, + deleteFromTableRequest: normalized, + }, + this.requestInitOverride(normalized), + ), + ); + } + + public async queryTable(request: Models.QueryTableRequest): Promise { + const id = this.requireTableIdentifier(request.id, "queryTable"); + const normalized = this.canonicalizeId(request, id, "queryTable"); + + const blob = await this.withErrorMapping(() => + this.tableApi.queryTable( + { + id: this.toRouteIdentifier(id), + delimiter: this.delimiter, + queryTableRequest: normalized, + }, + this.requestInitOverride(normalized), + ), + ); + + return this.toUint8Array(blob); + } + + public async countTableRows(request: Models.CountTableRowsRequest): Promise { + const id = this.requireTableIdentifier(request.id, "countTableRows"); + const normalized = this.canonicalizeId(request, id, "countTableRows"); + + return this.withErrorMapping(() => + this.tableApi.countTableRows( + { + id: this.toRouteIdentifier(id), + delimiter: this.delimiter, + countTableRowsRequest: normalized, + }, + this.requestInitOverride(normalized), + ), + ); + } + + public async createTableIndex( + request: Models.CreateTableIndexRequest, + ): Promise { + const id = this.requireTableIdentifier(request.id, "createTableIndex"); + const normalized = this.canonicalizeId(request, id, "createTableIndex"); + + return this.withErrorMapping(() => + this.tableApi.createTableIndex( + { + id: this.toRouteIdentifier(id), + delimiter: this.delimiter, + createTableIndexRequest: normalized, + }, + this.requestInitOverride(normalized), + ), + ); + } + + public async createTableScalarIndex( + request: Models.CreateTableIndexRequest, + ): Promise { + const id = this.requireTableIdentifier(request.id, "createTableScalarIndex"); + const normalized = this.canonicalizeId(request, id, "createTableScalarIndex"); + + return this.withErrorMapping(() => + this.tableApi.createTableScalarIndex( + { + id: this.toRouteIdentifier(id), + delimiter: this.delimiter, + createTableIndexRequest: normalized, + }, + this.requestInitOverride(normalized), + ), + ); + } + + public async listTableIndices( + request: Models.ListTableIndicesRequest, + ): Promise { + const id = this.requireTableIdentifier(request.id, "listTableIndices"); + const normalized = this.canonicalizeId(request, id, "listTableIndices"); + + return this.withErrorMapping(() => + this.tableApi.listTableIndices( + { + id: this.toRouteIdentifier(id), + delimiter: this.delimiter, + listTableIndicesRequest: normalized, + }, + this.requestInitOverride(normalized), + ), + ); + } + + public async describeTableIndexStats( + request: Models.DescribeTableIndexStatsRequest, + ): Promise { + const id = this.requireTableIdentifier(request.id, "describeTableIndexStats"); + const indexName = this.requireIndexName( + request.index_name, + "describeTableIndexStats", + ); + const normalized = this.canonicalizeIndexName( + this.canonicalizeId(request, id, "describeTableIndexStats"), + indexName, + "describeTableIndexStats", + ); + + return this.withErrorMapping(() => + this.tableApi.describeTableIndexStats( + { + id: this.toRouteIdentifier(id), + indexName, + delimiter: this.delimiter, + describeTableIndexStatsRequest: normalized, + }, + this.requestInitOverride(normalized), + ), + ); + } + + public async dropTableIndex( + request: Models.DropTableIndexRequest, + ): Promise { + const id = this.requireTableIdentifier(request.id, "dropTableIndex"); + const indexName = this.requireIndexName(request.index_name, "dropTableIndex"); + + return this.withErrorMapping(() => + this.tableApi.dropTableIndex( + { + id: this.toRouteIdentifier(id), + indexName, + delimiter: this.delimiter, + }, + this.requestInitOverride(request), + ), + ); + } + + public async restoreTable( + request: Models.RestoreTableRequest, + ): Promise { + const id = this.requireTableIdentifier(request.id, "restoreTable"); + const normalized = this.canonicalizeId(request, id, "restoreTable"); + + return this.withErrorMapping(() => + this.tableApi.restoreTable( + { + id: this.toRouteIdentifier(id), + delimiter: this.delimiter, + restoreTableRequest: normalized, + }, + this.requestInitOverride(normalized), + ), + ); + } + + public async renameTable( + request: Models.RenameTableRequest, + ): Promise { + const id = this.requireTableIdentifier(request.id, "renameTable"); + const normalized = this.canonicalizeId(request, id, "renameTable"); + + return this.withErrorMapping(() => + this.tableApi.renameTable( + { + id: this.toRouteIdentifier(id), + delimiter: this.delimiter, + renameTableRequest: normalized, + }, + this.requestInitOverride(normalized), + ), + ); + } + + public async listTableVersions( + request: Models.ListTableVersionsRequest, + ): Promise { + const id = this.requireTableIdentifier(request.id, "listTableVersions"); + + return this.withErrorMapping(() => + this.tableApi.listTableVersions( + { + id: this.toRouteIdentifier(id), + delimiter: this.delimiter, + pageToken: request.page_token, + limit: request.limit, + descending: request.descending, + }, + this.requestInitOverride(request), + ), + ); + } + + public async createTableVersion( + request: Models.CreateTableVersionRequest, + ): Promise { + const id = this.requireTableIdentifier(request.id, "createTableVersion"); + const normalized = this.canonicalizeId(request, id, "createTableVersion"); + + return this.withErrorMapping(() => + this.tableApi.createTableVersion( + { + id: this.toRouteIdentifier(id), + delimiter: this.delimiter, + createTableVersionRequest: normalized, + }, + this.requestInitOverride(normalized), + ), + ); + } + + public async describeTableVersion( + request: Models.DescribeTableVersionRequest, + ): Promise { + const id = this.requireTableIdentifier(request.id, "describeTableVersion"); + const normalized = this.canonicalizeId(request, id, "describeTableVersion"); + + return this.withErrorMapping(() => + this.tableApi.describeTableVersion( + { + id: this.toRouteIdentifier(id), + delimiter: this.delimiter, + describeTableVersionRequest: normalized, + }, + this.requestInitOverride(normalized), + ), + ); + } + + public async batchDeleteTableVersions( + request: Models.BatchDeleteTableVersionsRequest, + ): Promise { + const id = this.requireTableIdentifier(request.id, "batchDeleteTableVersions"); + const normalized = this.canonicalizeId( + request, + id, + "batchDeleteTableVersions", + ); + + return this.withErrorMapping(() => + this.tableApi.batchDeleteTableVersions( + { + id: this.toRouteIdentifier(id), + delimiter: this.delimiter, + batchDeleteTableVersionsRequest: normalized, + }, + this.requestInitOverride(normalized), + ), + ); + } + + public async batchCreateTableVersions( + request: Models.BatchCreateTableVersionsRequest, + ): Promise { + return this.withErrorMapping(() => + this.tableApi.batchCreateTableVersions( + { + delimiter: this.delimiter, + batchCreateTableVersionsRequest: request, + }, + this.requestInitOverride(request), + ), + ); + } + + public async updateTableSchemaMetadata( + request: Models.UpdateTableSchemaMetadataRequest, + ): Promise { + const id = this.requireTableIdentifier(request.id, "updateTableSchemaMetadata"); + const normalized = this.canonicalizeId( + request, + id, + "updateTableSchemaMetadata", + ); + + const metadataMap = await this.withErrorMapping(() => + this.tableApi.updateTableSchemaMetadata( + { + id: this.toRouteIdentifier(id), + delimiter: this.delimiter, + requestBody: normalized.metadata ?? {}, + }, + this.requestInitOverride(normalized), + ), + ); + + return { metadata: metadataMap }; + } + + public async getTableStats( + request: Models.GetTableStatsRequest, + ): Promise { + const id = this.requireTableIdentifier(request.id, "getTableStats"); + const normalized = this.canonicalizeId(request, id, "getTableStats"); + + return this.withErrorMapping(() => + this.tableApi.getTableStats( + { + id: this.toRouteIdentifier(id), + delimiter: this.delimiter, + getTableStatsRequest: normalized, + }, + this.requestInitOverride(normalized), + ), + ); + } + + public async explainTableQueryPlan( + request: Models.ExplainTableQueryPlanRequest, + ): Promise { + const id = this.requireTableIdentifier(request.id, "explainTableQueryPlan"); + const normalized = this.canonicalizeId(request, id, "explainTableQueryPlan"); + + return this.withErrorMapping(() => + this.tableApi.explainTableQueryPlan( + { + id: this.toRouteIdentifier(id), + delimiter: this.delimiter, + explainTableQueryPlanRequest: normalized, + }, + this.requestInitOverride(normalized), + ), + ); + } + + public async analyzeTableQueryPlan( + request: Models.AnalyzeTableQueryPlanRequest, + ): Promise { + const id = this.requireTableIdentifier(request.id, "analyzeTableQueryPlan"); + const normalized = this.canonicalizeId(request, id, "analyzeTableQueryPlan"); + + return this.withErrorMapping(() => + this.tableApi.analyzeTableQueryPlan( + { + id: this.toRouteIdentifier(id), + delimiter: this.delimiter, + analyzeTableQueryPlanRequest: normalized, + }, + this.requestInitOverride(normalized), + ), + ); + } + + public async alterTableAddColumns( + request: Models.AlterTableAddColumnsRequest, + ): Promise { + const id = this.requireTableIdentifier(request.id, "alterTableAddColumns"); + const normalized = this.canonicalizeId(request, id, "alterTableAddColumns"); + + return this.withErrorMapping(() => + this.tableApi.alterTableAddColumns( + { + id: this.toRouteIdentifier(id), + delimiter: this.delimiter, + alterTableAddColumnsRequest: normalized, + }, + this.requestInitOverride(normalized), + ), + ); + } + + public async alterTableAlterColumns( + request: Models.AlterTableAlterColumnsRequest, + ): Promise { + const id = this.requireTableIdentifier(request.id, "alterTableAlterColumns"); + const normalized = this.canonicalizeId(request, id, "alterTableAlterColumns"); + + return this.withErrorMapping(() => + this.tableApi.alterTableAlterColumns( + { + id: this.toRouteIdentifier(id), + delimiter: this.delimiter, + alterTableAlterColumnsRequest: normalized, + }, + this.requestInitOverride(normalized), + ), + ); + } + + public async alterTableDropColumns( + request: Models.AlterTableDropColumnsRequest, + ): Promise { + const id = this.requireTableIdentifier(request.id, "alterTableDropColumns"); + const normalized = this.canonicalizeId(request, id, "alterTableDropColumns"); + + return this.withErrorMapping(() => + this.tableApi.alterTableDropColumns( + { + id: this.toRouteIdentifier(id), + delimiter: this.delimiter, + alterTableDropColumnsRequest: normalized, + }, + this.requestInitOverride(normalized), + ), + ); + } + + public async listTableTags( + request: Models.ListTableTagsRequest, + ): Promise { + const id = this.requireTableIdentifier(request.id, "listTableTags"); + + return this.withErrorMapping(() => + this.tableApi.listTableTags( + { + id: this.toRouteIdentifier(id), + delimiter: this.delimiter, + pageToken: request.page_token, + limit: request.limit, + }, + this.requestInitOverride(request), + ), + ); + } + + public async getTableTagVersion( + request: Models.GetTableTagVersionRequest, + ): Promise { + const id = this.requireTableIdentifier(request.id, "getTableTagVersion"); + const normalized = this.canonicalizeId(request, id, "getTableTagVersion"); + + return this.withErrorMapping(() => + this.tableApi.getTableTagVersion( + { + id: this.toRouteIdentifier(id), + delimiter: this.delimiter, + getTableTagVersionRequest: normalized, + }, + this.requestInitOverride(normalized), + ), + ); + } + + public async createTableTag( + request: Models.CreateTableTagRequest, + ): Promise { + const id = this.requireTableIdentifier(request.id, "createTableTag"); + const normalized = this.canonicalizeId(request, id, "createTableTag"); + + return this.withErrorMapping(() => + this.tableApi.createTableTag( + { + id: this.toRouteIdentifier(id), + delimiter: this.delimiter, + createTableTagRequest: normalized, + }, + this.requestInitOverride(normalized), + ), + ); + } + + public async deleteTableTag( + request: Models.DeleteTableTagRequest, + ): Promise { + const id = this.requireTableIdentifier(request.id, "deleteTableTag"); + const normalized = this.canonicalizeId(request, id, "deleteTableTag"); + + return this.withErrorMapping(() => + this.tableApi.deleteTableTag( + { + id: this.toRouteIdentifier(id), + delimiter: this.delimiter, + deleteTableTagRequest: normalized, + }, + this.requestInitOverride(normalized), + ), + ); + } + + public async updateTableTag( + request: Models.UpdateTableTagRequest, + ): Promise { + const id = this.requireTableIdentifier(request.id, "updateTableTag"); + const normalized = this.canonicalizeId(request, id, "updateTableTag"); + + return this.withErrorMapping(() => + this.tableApi.updateTableTag( + { + id: this.toRouteIdentifier(id), + delimiter: this.delimiter, + updateTableTagRequest: normalized, + }, + this.requestInitOverride(normalized), + ), + ); + } + + public async describeTransaction( + request: Models.DescribeTransactionRequest, + ): Promise { + const id = this.requireTransactionIdentifier(request.id, "describeTransaction"); + const normalized = this.canonicalizeId(request, id, "describeTransaction"); + + return this.withErrorMapping(() => + this.transactionApi.describeTransaction( + { + id: this.toRouteIdentifier(id), + delimiter: this.delimiter, + describeTransactionRequest: normalized, + }, + this.requestInitOverride(normalized), + ), + ); + } + + public async alterTransaction( + request: Models.AlterTransactionRequest, + ): Promise { + const id = this.requireTransactionIdentifier(request.id, "alterTransaction"); + const normalized = this.canonicalizeId(request, id, "alterTransaction"); + + return this.withErrorMapping(() => + this.transactionApi.alterTransaction( + { + id: this.toRouteIdentifier(id), + delimiter: this.delimiter, + alterTransactionRequest: normalized, + }, + this.requestInitOverride(normalized), + ), + ); + } + + private async withErrorMapping(fn: () => Promise): Promise { + try { + return await fn(); + } catch (error) { + throw await this.mapError(error); + } + } + + private async mapError(error: unknown): Promise { + if (error instanceof LanceNamespaceError) { + return error; + } + + if (error instanceof RequiredError) { + return new InvalidInputError(error.message, { cause: error }); + } + + if (error instanceof FetchError) { + return new ServiceUnavailableError(error.message, { cause: error }); + } + + if (error instanceof ResponseError) { + let payload: unknown; + try { + payload = await error.response.clone().json(); + } catch { + payload = undefined; + } + + if ( + payload !== undefined && + payload !== null && + typeof payload === "object" && + "code" in payload + ) { + return fromErrorResponse( + payload as { + code?: number; + error?: string; + detail?: string; + instance?: string; + }, + `HTTP ${error.response.status}`, + { + cause: error, + status: error.response.status, + }, + ); + } + + const responseText = await error.response.clone().text(); + const message = responseText.length > 0 ? responseText : error.message; + return fromErrorCode(18, message, { + cause: error, + status: error.response.status, + }); + } + + const message = + error instanceof Error ? error.message : "Unknown error from rest namespace"; + return new InternalError(message, { cause: error }); + } + + private requestInitOverride( + request: HasIdentityAndContext, + additionalHeaders: Record = {}, + ): (ctx: { init: RequestInit }) => Promise { + return async ({ init }) => { + const headers = new Headers(init.headers ?? {}); + + for (const [key, value] of Object.entries(additionalHeaders)) { + headers.set(key, value); + } + + if (request.identity?.api_key !== undefined) { + headers.set("x-api-key", request.identity.api_key); + } + + if (request.identity?.auth_token !== undefined) { + const authToken = request.identity.auth_token; + const headerValue = authToken.startsWith("Bearer ") + ? authToken + : `Bearer ${authToken}`; + headers.set("Authorization", headerValue); + } + + if (request.context !== undefined) { + for (const [key, value] of Object.entries(request.context)) { + headers.set(`x-lance-ctx-${key}`, value); + } + } + + return { ...init, headers }; + }; + } + + private toBlob(data: Uint8Array): Blob { + const copied = Uint8Array.from(data); + return new Blob([copied], { type: "application/vnd.apache.arrow.stream" }); + } + + private async toUint8Array(blob: Blob): Promise { + const arrayBuffer = await blob.arrayBuffer(); + return new Uint8Array(arrayBuffer); + } + + private canonicalizeId( + request: T, + pathId: string[], + operation: string, + ): T { + if (request.id !== undefined && !this.idsEqual(pathId, request.id)) { + throw new InvalidInputError( + `Request id does not match route id for ${operation}`, + ); + } + + return { + ...request, + id: [...pathId], + }; + } + + private canonicalizeIndexName( + request: T, + indexName: string, + operation: string, + ): T { + if ( + request.index_name !== undefined && + request.index_name.trim() !== indexName + ) { + throw new InvalidInputError( + `Request index_name does not match route index_name for ${operation}`, + ); + } + + return { + ...request, + index_name: indexName, + }; + } + + private normalizeDropNamespaceRequest( + request: Models.DropNamespaceRequest, + ): Models.DropNamespaceRequest { + const behavior = request.behavior; + if (behavior !== undefined && !this.isRestrictBehavior(behavior)) { + throw new InvalidInputError( + "DropNamespace only supports behavior=Restrict in this implementation", + ); + } + + return { + ...request, + behavior: behavior ?? "Restrict", + }; + } + + private isRestrictBehavior(value: string): boolean { + const normalized = value.trim().toLowerCase(); + return normalized === "restrict"; + } + + private optionalNamespaceIdentifier(id?: string[]): string[] { + if (id === undefined || id.length === 0) { + return []; + } + return [...id]; + } + + private requireNamespaceIdentifier(id?: string[]): string[] { + if (id === undefined) { + throw new InvalidInputError("Request id is required"); + } + return [...id]; + } + + private requireTableIdentifier(id: string[] | undefined, op: string): string[] { + if (id === undefined || id.length === 0) { + throw new InvalidInputError(`Table id is required for ${op}`); + } + return [...id]; + } + + private requireTransactionIdentifier( + id: string[] | undefined, + op: string, + ): string[] { + if (id === undefined || id.length === 0) { + throw new InvalidInputError(`Transaction id is required for ${op}`); + } + return [...id]; + } + + private requireIndexName(value: string | undefined, op: string): string { + if (value === undefined || value.trim().length === 0) { + throw new InvalidInputError(`index_name is required for ${op}`); + } + return value.trim(); + } + + private toRouteIdentifier(id: string[], allowRoot = false): string { + if (id.length === 0) { + if (!allowRoot) { + throw new InvalidInputError("Root identifier is not allowed here"); + } + return this.delimiter; + } + return id.join(this.delimiter); + } + + private idsEqual(left: string[], right: string[]): boolean { + if (left.length !== right.length) { + return false; + } + + for (let index = 0; index < left.length; index += 1) { + if (left[index] !== right[index]) { + return false; + } + } + + return true; + } +} diff --git a/typescript/lance-namespace-rest/test/rest_namespace.test.ts b/typescript/lance-namespace-rest/test/rest_namespace.test.ts new file mode 100644 index 000000000..c62e91357 --- /dev/null +++ b/typescript/lance-namespace-rest/test/rest_namespace.test.ts @@ -0,0 +1,275 @@ +import { afterEach, describe, expect, it, vi } from "vitest"; + +import type { + AlterTransactionRequest, + AnalyzeTableQueryPlanRequest, + CountTableRowsRequest, + CreateTableRequest, + DropNamespaceRequest, + DescribeTableRequest, + ExplainTableQueryPlanRequest, + QueryTableRequest, + UpdateTableSchemaMetadataRequest, +} from "@lance/namespace-fetch-client"; + +import { + ErrorCode, + LanceNamespace, + TableNotFoundError, +} from "@lance/lance-namespace"; + +import { RestNamespace } from "../src/index"; + +function jsonResponse(data: unknown, status = 200): Response { + return new Response(JSON.stringify(data), { + status, + headers: { + "Content-Type": "application/json", + }, + }); +} + +afterEach(() => { + vi.unstubAllGlobals(); +}); + +describe("rest namespace", () => { + it("overrides all LanceNamespace operations", () => { + const parentMethods = Object.getOwnPropertyNames(LanceNamespace.prototype).filter( + (name) => + name !== "constructor" && + name !== "namespaceId" && + name !== "unsupported" && + typeof (LanceNamespace.prototype as Record)[name] === + "function", + ); + + for (const method of parentMethods) { + expect( + Object.prototype.hasOwnProperty.call(RestNamespace.prototype, method), + ).toBe(true); + } + }); + + it("maps identity/context and root namespace correctly", async () => { + const fetchMock = vi.fn(async () => jsonResponse({ namespaces: ["child"] })); + vi.stubGlobal("fetch", fetchMock); + + const ns = new RestNamespace({ uri: "http://localhost:2333" }); + const response = await ns.listNamespaces({ + id: [], + identity: { auth_token: "token-a" }, + context: { trace_id: "trace-1" }, + }); + + expect(Array.from(response.namespaces)).toEqual(["child"]); + + const [url, init] = fetchMock.mock.calls[0] as [string, RequestInit]; + expect(url).toContain("/v1/namespace/%24/list"); + expect(url).toContain("delimiter=%24"); + + const headers = new Headers(init.headers); + expect(headers.get("Authorization")).toBe("Bearer token-a"); + expect(headers.get("x-lance-ctx-trace_id")).toBe("trace-1"); + }); + + it("uses configured delimiter in route serialization", async () => { + const fetchMock = vi.fn(async () => jsonResponse({ namespaces: [] })); + vi.stubGlobal("fetch", fetchMock); + + const ns = new RestNamespace({ + uri: "http://localhost:2333", + delimiter: ".", + }); + await ns.listNamespaces({ id: ["a", "b"] }); + + const [url] = fetchMock.mock.calls[0] as [string, RequestInit]; + expect(url).toContain("/v1/namespace/a.b/list"); + expect(url).toContain("delimiter=."); + }); + + it("gives identity/context headers higher priority than configured defaults", async () => { + const fetchMock = vi.fn(async () => jsonResponse({ namespaces: [] })); + vi.stubGlobal("fetch", fetchMock); + + const ns = new RestNamespace({ + uri: "http://localhost:2333", + "headers.Authorization": "Bearer static-token", + "headers.x-lance-ctx-trace_id": "static-trace", + }); + await ns.listNamespaces({ + id: [], + identity: { auth_token: "dynamic-token" }, + context: { trace_id: "dynamic-trace" }, + }); + + const [, init] = fetchMock.mock.calls[0] as [string, RequestInit]; + const headers = new Headers(init.headers); + expect(headers.get("Authorization")).toBe("Bearer dynamic-token"); + expect(headers.get("x-lance-ctx-trace_id")).toBe("dynamic-trace"); + }); + + it("handles arrow stream request for createTable", async () => { + const fetchMock = vi.fn(async () => + jsonResponse({ location: "s3://bucket/table.lance", version: 1 }), + ); + vi.stubGlobal("fetch", fetchMock); + + const ns = new RestNamespace({ uri: "http://localhost:2333" }); + const request: CreateTableRequest = { + id: ["ns", "tbl"], + mode: "Overwrite", + properties: { owner: "dev" }, + identity: { api_key: "key-1" }, + }; + + const response = await ns.createTable(request, new Uint8Array([1, 2, 3])); + expect(response.version).toBe(1); + + const [url, init] = fetchMock.mock.calls[0] as [string, RequestInit]; + expect(url).toContain("/v1/table/ns%24tbl/create"); + expect(url).toContain("mode=Overwrite"); + + const headers = new Headers(init.headers); + expect(headers.get("Content-Type")).toBe("application/vnd.apache.arrow.stream"); + expect(headers.get("x-api-key")).toBe("key-1"); + expect(headers.get("x-lance-table-properties")).toBe('{"owner":"dev"}'); + + expect(init.body).toBeInstanceOf(Blob); + }); + + it("returns binary bytes for queryTable", async () => { + const fetchMock = vi.fn(async () => + new Response(new Uint8Array([3, 4, 5]), { + status: 200, + headers: { + "Content-Type": "application/vnd.apache.arrow.file", + }, + }), + ); + vi.stubGlobal("fetch", fetchMock); + + const ns = new RestNamespace({ uri: "http://localhost:2333" }); + const request: QueryTableRequest = { + id: ["ns", "tbl"], + k: 1, + vector: { single_vector: [0.1] }, + }; + + const response = await ns.queryTable(request); + expect([...response]).toEqual([3, 4, 5]); + }); + + it("supports plain integer and plain string responses", async () => { + const fetchMock = vi + .fn() + .mockResolvedValueOnce(jsonResponse(42)) + .mockResolvedValueOnce(jsonResponse("plan")) + .mockResolvedValueOnce(jsonResponse("analysis")); + vi.stubGlobal("fetch", fetchMock); + + const ns = new RestNamespace({ uri: "http://localhost:2333" }); + + const countReq: CountTableRowsRequest = { + id: ["ns", "tbl"], + }; + const explainReq: ExplainTableQueryPlanRequest = { + id: ["ns", "tbl"], + query: { + id: ["ns", "tbl"], + k: 1, + vector: { single_vector: [0.1] }, + }, + }; + const analyzeReq: AnalyzeTableQueryPlanRequest = { + id: ["ns", "tbl"], + k: 1, + vector: { single_vector: [0.1] }, + }; + + expect(await ns.countTableRows(countReq)).toBe(42); + expect(await ns.explainTableQueryPlan(explainReq)).toBe("plan"); + expect(await ns.analyzeTableQueryPlan(analyzeReq)).toBe("analysis"); + }); + + it("uses direct metadata map for updateTableSchemaMetadata", async () => { + const fetchMock = vi.fn(async (_input: string, init?: RequestInit) => { + const body = JSON.parse(String(init?.body ?? "{}")); + expect(body).toEqual({ key: "value" }); + return jsonResponse({ key: "value" }); + }); + vi.stubGlobal("fetch", fetchMock); + + const ns = new RestNamespace({ uri: "http://localhost:2333" }); + const request: UpdateTableSchemaMetadataRequest = { + id: ["ns", "tbl"], + metadata: { key: "value" }, + }; + + const response = await ns.updateTableSchemaMetadata(request); + expect(response.metadata).toEqual({ key: "value" }); + }); + + it("maps error code to typed error", async () => { + const fetchMock = vi.fn(async () => + jsonResponse({ code: 4, error: "not found" }, 404), + ); + vi.stubGlobal("fetch", fetchMock); + + const ns = new RestNamespace({ uri: "http://localhost:2333" }); + const request: DescribeTableRequest = { + id: ["ns", "tbl"], + }; + + const promise = ns.describeTable(request); + await expect(promise).rejects.toBeInstanceOf(TableNotFoundError); + await expect(promise).rejects.toMatchObject({ + code: ErrorCode.TABLE_NOT_FOUND, + }); + }); + + it("only supports Restrict behavior for dropNamespace", async () => { + const fetchMock = vi.fn(async () => jsonResponse({})); + vi.stubGlobal("fetch", fetchMock); + const ns = new RestNamespace({ uri: "http://localhost:2333" }); + + const request: DropNamespaceRequest = { + id: ["ns"], + behavior: "Cascade", + }; + + await expect(ns.dropNamespace(request)).rejects.toMatchObject({ + code: ErrorCode.INVALID_INPUT, + }); + expect(fetchMock).not.toHaveBeenCalled(); + }); + + it("sends loadDetailedMetadata=false by default for describeTable", async () => { + const fetchMock = vi.fn(async () => jsonResponse({})); + vi.stubGlobal("fetch", fetchMock); + const ns = new RestNamespace({ uri: "http://localhost:2333" }); + await ns.describeTable({ id: ["ns", "tbl"] }); + + const [url] = fetchMock.mock.calls[0] as [string, RequestInit]; + expect(url).toContain("load_detailed_metadata=false"); + }); + + it("supports extra metadata operations", async () => { + const fetchMock = vi + .fn() + .mockResolvedValueOnce(jsonResponse({ id: ["ns", "tbl"], versions: [] })) + .mockResolvedValueOnce(jsonResponse({ id: ["ns", "txn"] })); + vi.stubGlobal("fetch", fetchMock); + + const ns = new RestNamespace({ uri: "http://localhost:2333" }); + await ns.listTableVersions({ id: ["ns", "tbl"], descending: true }); + + const alterRequest: AlterTransactionRequest = { + id: ["ns", "txn"], + actions: [{ setStatusAction: { status: "Canceled" } }], + }; + await ns.alterTransaction(alterRequest); + + expect(fetchMock).toHaveBeenCalledTimes(2); + }); +}); diff --git a/typescript/lance-namespace-rest/tsconfig.json b/typescript/lance-namespace-rest/tsconfig.json new file mode 100644 index 000000000..b7d3763ff --- /dev/null +++ b/typescript/lance-namespace-rest/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "target": "ES2022", + "module": "ESNext", + "moduleResolution": "Bundler", + "lib": ["ES2022", "DOM"], + "strict": true, + "declaration": true, + "declarationMap": true, + "sourceMap": true, + "outDir": "dist", + "skipLibCheck": true + }, + "include": ["src/**/*.ts"], + "exclude": ["dist", "node_modules", "test", "vitest.config.ts"] +} diff --git a/typescript/lance-namespace-rest/tsconfig.test.json b/typescript/lance-namespace-rest/tsconfig.test.json new file mode 100644 index 000000000..e9c639a23 --- /dev/null +++ b/typescript/lance-namespace-rest/tsconfig.test.json @@ -0,0 +1,8 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "noEmit": true, + "types": ["vitest/globals"] + }, + "include": ["src/**/*.ts", "test/**/*.ts", "vitest.config.ts"] +} diff --git a/typescript/lance-namespace-rest/vitest.config.ts b/typescript/lance-namespace-rest/vitest.config.ts new file mode 100644 index 000000000..8b5840aca --- /dev/null +++ b/typescript/lance-namespace-rest/vitest.config.ts @@ -0,0 +1,7 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + include: ["test/**/*.test.ts"], + }, +}); diff --git a/typescript/lance-namespace/README.md b/typescript/lance-namespace/README.md new file mode 100644 index 000000000..1145b19cd --- /dev/null +++ b/typescript/lance-namespace/README.md @@ -0,0 +1,3 @@ +# @lance/lance-namespace + +TypeScript Lance Namespace interface and plugin registry. diff --git a/typescript/lance-namespace/package.json b/typescript/lance-namespace/package.json new file mode 100644 index 000000000..267e54044 --- /dev/null +++ b/typescript/lance-namespace/package.json @@ -0,0 +1,30 @@ +{ + "name": "@lance/lance-namespace", + "version": "0.5.2", + "description": "Lance Namespace interface and plugin registry for TypeScript", + "type": "module", + "main": "./dist/index.js", + "types": "./dist/index.d.ts", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "import": "./dist/index.js" + } + }, + "files": [ + "dist" + ], + "scripts": { + "build": "rm -rf dist && tsc -p tsconfig.json", + "lint": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.test.json --noEmit", + "test": "vitest run" + }, + "dependencies": { + "@lance/namespace-fetch-client": "workspace:*" + }, + "devDependencies": { + "typescript": "^5.8.3", + "vitest": "^2.1.9" + }, + "license": "Apache-2.0" +} diff --git a/typescript/lance-namespace/src/errors.ts b/typescript/lance-namespace/src/errors.ts new file mode 100644 index 000000000..eb37bcfa2 --- /dev/null +++ b/typescript/lance-namespace/src/errors.ts @@ -0,0 +1,278 @@ +// 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. + +import type { ErrorResponse } from "@lance/namespace-fetch-client"; + +export enum ErrorCode { + UNSUPPORTED = 0, + NAMESPACE_NOT_FOUND = 1, + NAMESPACE_ALREADY_EXISTS = 2, + NAMESPACE_NOT_EMPTY = 3, + TABLE_NOT_FOUND = 4, + TABLE_ALREADY_EXISTS = 5, + TABLE_INDEX_NOT_FOUND = 6, + TABLE_INDEX_ALREADY_EXISTS = 7, + TABLE_TAG_NOT_FOUND = 8, + TABLE_TAG_ALREADY_EXISTS = 9, + TRANSACTION_NOT_FOUND = 10, + TABLE_VERSION_NOT_FOUND = 11, + TABLE_COLUMN_NOT_FOUND = 12, + INVALID_INPUT = 13, + CONCURRENT_MODIFICATION = 14, + PERMISSION_DENIED = 15, + UNAUTHENTICATED = 16, + SERVICE_UNAVAILABLE = 17, + INTERNAL = 18, + INVALID_TABLE_STATE = 19, + TABLE_SCHEMA_VALIDATION_ERROR = 20, + THROTTLING = 21, +} + +export interface LanceNamespaceErrorOptions { + cause?: unknown; + status?: number; + detail?: string; + instance?: string; +} + +export class LanceNamespaceError extends Error { + public readonly code: ErrorCode; + public readonly status?: number; + public readonly detail?: string; + public readonly instance?: string; + + public constructor( + code: ErrorCode, + message: string, + options: LanceNamespaceErrorOptions = {}, + ) { + super(message); + this.name = this.constructor.name; + this.code = code; + this.status = options.status; + this.detail = options.detail; + this.instance = options.instance; + if (options.cause !== undefined) { + (this as Error & { cause?: unknown }).cause = options.cause; + } + } +} + +export class UnsupportedOperationError extends LanceNamespaceError { + public constructor(message: string, options: LanceNamespaceErrorOptions = {}) { + super(ErrorCode.UNSUPPORTED, message, options); + } +} + +export class NamespaceNotFoundError extends LanceNamespaceError { + public constructor(message: string, options: LanceNamespaceErrorOptions = {}) { + super(ErrorCode.NAMESPACE_NOT_FOUND, message, options); + } +} + +export class NamespaceAlreadyExistsError extends LanceNamespaceError { + public constructor(message: string, options: LanceNamespaceErrorOptions = {}) { + super(ErrorCode.NAMESPACE_ALREADY_EXISTS, message, options); + } +} + +export class NamespaceNotEmptyError extends LanceNamespaceError { + public constructor(message: string, options: LanceNamespaceErrorOptions = {}) { + super(ErrorCode.NAMESPACE_NOT_EMPTY, message, options); + } +} + +export class TableNotFoundError extends LanceNamespaceError { + public constructor(message: string, options: LanceNamespaceErrorOptions = {}) { + super(ErrorCode.TABLE_NOT_FOUND, message, options); + } +} + +export class TableAlreadyExistsError extends LanceNamespaceError { + public constructor(message: string, options: LanceNamespaceErrorOptions = {}) { + super(ErrorCode.TABLE_ALREADY_EXISTS, message, options); + } +} + +export class TableIndexNotFoundError extends LanceNamespaceError { + public constructor(message: string, options: LanceNamespaceErrorOptions = {}) { + super(ErrorCode.TABLE_INDEX_NOT_FOUND, message, options); + } +} + +export class TableIndexAlreadyExistsError extends LanceNamespaceError { + public constructor(message: string, options: LanceNamespaceErrorOptions = {}) { + super(ErrorCode.TABLE_INDEX_ALREADY_EXISTS, message, options); + } +} + +export class TableTagNotFoundError extends LanceNamespaceError { + public constructor(message: string, options: LanceNamespaceErrorOptions = {}) { + super(ErrorCode.TABLE_TAG_NOT_FOUND, message, options); + } +} + +export class TableTagAlreadyExistsError extends LanceNamespaceError { + public constructor(message: string, options: LanceNamespaceErrorOptions = {}) { + super(ErrorCode.TABLE_TAG_ALREADY_EXISTS, message, options); + } +} + +export class TransactionNotFoundError extends LanceNamespaceError { + public constructor(message: string, options: LanceNamespaceErrorOptions = {}) { + super(ErrorCode.TRANSACTION_NOT_FOUND, message, options); + } +} + +export class TableVersionNotFoundError extends LanceNamespaceError { + public constructor(message: string, options: LanceNamespaceErrorOptions = {}) { + super(ErrorCode.TABLE_VERSION_NOT_FOUND, message, options); + } +} + +export class TableColumnNotFoundError extends LanceNamespaceError { + public constructor(message: string, options: LanceNamespaceErrorOptions = {}) { + super(ErrorCode.TABLE_COLUMN_NOT_FOUND, message, options); + } +} + +export class InvalidInputError extends LanceNamespaceError { + public constructor(message: string, options: LanceNamespaceErrorOptions = {}) { + super(ErrorCode.INVALID_INPUT, message, options); + } +} + +export class ConcurrentModificationError extends LanceNamespaceError { + public constructor(message: string, options: LanceNamespaceErrorOptions = {}) { + super(ErrorCode.CONCURRENT_MODIFICATION, message, options); + } +} + +export class PermissionDeniedError extends LanceNamespaceError { + public constructor(message: string, options: LanceNamespaceErrorOptions = {}) { + super(ErrorCode.PERMISSION_DENIED, message, options); + } +} + +export class UnauthenticatedError extends LanceNamespaceError { + public constructor(message: string, options: LanceNamespaceErrorOptions = {}) { + super(ErrorCode.UNAUTHENTICATED, message, options); + } +} + +export class ServiceUnavailableError extends LanceNamespaceError { + public constructor(message: string, options: LanceNamespaceErrorOptions = {}) { + super(ErrorCode.SERVICE_UNAVAILABLE, message, options); + } +} + +export class InternalError extends LanceNamespaceError { + public constructor(message: string, options: LanceNamespaceErrorOptions = {}) { + super(ErrorCode.INTERNAL, message, options); + } +} + +export class InvalidTableStateError extends LanceNamespaceError { + public constructor(message: string, options: LanceNamespaceErrorOptions = {}) { + super(ErrorCode.INVALID_TABLE_STATE, message, options); + } +} + +export class TableSchemaValidationError extends LanceNamespaceError { + public constructor(message: string, options: LanceNamespaceErrorOptions = {}) { + super(ErrorCode.TABLE_SCHEMA_VALIDATION_ERROR, message, options); + } +} + +export class ThrottlingError extends LanceNamespaceError { + public constructor(message: string, options: LanceNamespaceErrorOptions = {}) { + super(ErrorCode.THROTTLING, message, options); + } +} + +const ERROR_CODE_TO_CONSTRUCTOR: Record< + number, + (message: string, options?: LanceNamespaceErrorOptions) => LanceNamespaceError +> = { + [ErrorCode.UNSUPPORTED]: (message, options) => + new UnsupportedOperationError(message, options), + [ErrorCode.NAMESPACE_NOT_FOUND]: (message, options) => + new NamespaceNotFoundError(message, options), + [ErrorCode.NAMESPACE_ALREADY_EXISTS]: (message, options) => + new NamespaceAlreadyExistsError(message, options), + [ErrorCode.NAMESPACE_NOT_EMPTY]: (message, options) => + new NamespaceNotEmptyError(message, options), + [ErrorCode.TABLE_NOT_FOUND]: (message, options) => + new TableNotFoundError(message, options), + [ErrorCode.TABLE_ALREADY_EXISTS]: (message, options) => + new TableAlreadyExistsError(message, options), + [ErrorCode.TABLE_INDEX_NOT_FOUND]: (message, options) => + new TableIndexNotFoundError(message, options), + [ErrorCode.TABLE_INDEX_ALREADY_EXISTS]: (message, options) => + new TableIndexAlreadyExistsError(message, options), + [ErrorCode.TABLE_TAG_NOT_FOUND]: (message, options) => + new TableTagNotFoundError(message, options), + [ErrorCode.TABLE_TAG_ALREADY_EXISTS]: (message, options) => + new TableTagAlreadyExistsError(message, options), + [ErrorCode.TRANSACTION_NOT_FOUND]: (message, options) => + new TransactionNotFoundError(message, options), + [ErrorCode.TABLE_VERSION_NOT_FOUND]: (message, options) => + new TableVersionNotFoundError(message, options), + [ErrorCode.TABLE_COLUMN_NOT_FOUND]: (message, options) => + new TableColumnNotFoundError(message, options), + [ErrorCode.INVALID_INPUT]: (message, options) => + new InvalidInputError(message, options), + [ErrorCode.CONCURRENT_MODIFICATION]: (message, options) => + new ConcurrentModificationError(message, options), + [ErrorCode.PERMISSION_DENIED]: (message, options) => + new PermissionDeniedError(message, options), + [ErrorCode.UNAUTHENTICATED]: (message, options) => + new UnauthenticatedError(message, options), + [ErrorCode.SERVICE_UNAVAILABLE]: (message, options) => + new ServiceUnavailableError(message, options), + [ErrorCode.INTERNAL]: (message, options) => new InternalError(message, options), + [ErrorCode.INVALID_TABLE_STATE]: (message, options) => + new InvalidTableStateError(message, options), + [ErrorCode.TABLE_SCHEMA_VALIDATION_ERROR]: (message, options) => + new TableSchemaValidationError(message, options), + [ErrorCode.THROTTLING]: (message, options) => + new ThrottlingError(message, options), +}; + +export function fromErrorCode( + code: number, + message: string, + options: LanceNamespaceErrorOptions = {}, +): LanceNamespaceError { + const ctor = ERROR_CODE_TO_CONSTRUCTOR[code]; + if (ctor !== undefined) { + return ctor(message, options); + } + return new InternalError(message, options); +} + +export function fromErrorResponse( + response: Partial & { code?: number }, + fallbackMessage: string, + options: LanceNamespaceErrorOptions = {}, +): LanceNamespaceError { + const message = response.error ?? response.detail ?? fallbackMessage; + const merged: LanceNamespaceErrorOptions = { + ...options, + detail: response.detail ?? options.detail, + instance: response.instance ?? options.instance, + }; + if (typeof response.code === "number") { + return fromErrorCode(response.code, message, merged); + } + return new InternalError(message, merged); +} diff --git a/typescript/lance-namespace/src/index.ts b/typescript/lance-namespace/src/index.ts new file mode 100644 index 000000000..59745d7bc --- /dev/null +++ b/typescript/lance-namespace/src/index.ts @@ -0,0 +1,120 @@ +// 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. + +import { InvalidInputError } from "./errors"; +import { LanceNamespace } from "./namespace"; + +export * from "@lance/namespace-fetch-client"; +export * from "./errors"; +export { LanceNamespace } from "./namespace"; + +export type NamespaceProperties = Record; +export type NamespaceClassPath = string; +type NamespaceConstructor = new ( + properties: NamespaceProperties, +) => LanceNamespace; + +export const NATIVE_IMPLS: Readonly> = { + rest: "@lance/lance-namespace-rest#RestNamespace", + dir: "@lance/lance-namespace-dir#DirectoryNamespace", +}; + +const REGISTERED_IMPLS: Map = new Map(); + +export function registerNamespaceImpl( + name: string, + classPath: NamespaceClassPath, +): void { + REGISTERED_IMPLS.set(name, classPath); +} + +export function clearRegisteredNamespaceImplsForTest(): void { + REGISTERED_IMPLS.clear(); +} + +export async function connect( + implementation: string, + properties: NamespaceProperties, +): Promise { + const classPath = + NATIVE_IMPLS[implementation] ?? + REGISTERED_IMPLS.get(implementation) ?? + implementation; + + return loadImplementation(classPath, properties); +} + +async function loadImplementation( + classPath: NamespaceClassPath, + properties: NamespaceProperties, +): Promise { + const [modulePath, exportName] = parseClassPath(classPath); + + try { + const moduleExports: Record = await import(modulePath); + const maybeClass = moduleExports[exportName]; + + if (!isNamespaceConstructor(maybeClass)) { + throw new InvalidInputError( + `Class ${classPath} does not implement LanceNamespace interface`, + ); + } + return new maybeClass(properties); + } catch (error) { + if (error instanceof InvalidInputError) { + throw error; + } + const detail = + error instanceof Error ? error.message : "Unknown loading failure"; + throw new InvalidInputError( + `Failed to construct namespace impl ${classPath}: ${detail}`, + { cause: error }, + ); + } +} + +function parseClassPath(classPath: string): [string, string] { + if (classPath.includes("#")) { + const [modulePath, exportName] = classPath.split("#", 2); + if (modulePath === undefined || modulePath.length === 0) { + throw new InvalidInputError(`Invalid class path: ${classPath}`); + } + return [modulePath, exportName === undefined || exportName.length === 0 ? "default" : exportName]; + } + + if ( + classPath.includes(".") && + !classPath.includes("/") && + !classPath.startsWith("@") + ) { + const splitIndex = classPath.lastIndexOf("."); + const modulePath = classPath.slice(0, splitIndex); + const exportName = classPath.slice(splitIndex + 1); + if (modulePath.length === 0 || exportName.length === 0) { + throw new InvalidInputError(`Invalid class path: ${classPath}`); + } + return [modulePath, exportName]; + } + + return [classPath, "default"]; +} + +function isNamespaceConstructor( + value: unknown, +): value is NamespaceConstructor { + if (typeof value !== "function") { + return false; + } + + const prototype = (value as { prototype?: unknown }).prototype; + return prototype instanceof LanceNamespace; +} diff --git a/typescript/lance-namespace/src/namespace.ts b/typescript/lance-namespace/src/namespace.ts new file mode 100644 index 000000000..60931cf3c --- /dev/null +++ b/typescript/lance-namespace/src/namespace.ts @@ -0,0 +1,306 @@ +// 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. + +import type * as Models from "@lance/namespace-fetch-client"; + +import { UnsupportedOperationError } from "./errors"; + +export abstract class LanceNamespace { + public abstract namespaceId(): string; + + protected unsupported(name: string): never { + throw new UnsupportedOperationError(`Not supported: ${name}`); + } + + public async listNamespaces( + _request: Models.ListNamespacesRequest, + ): Promise { + return this.unsupported("listNamespaces"); + } + + public async describeNamespace( + _request: Models.DescribeNamespaceRequest, + ): Promise { + return this.unsupported("describeNamespace"); + } + + public async createNamespace( + _request: Models.CreateNamespaceRequest, + ): Promise { + return this.unsupported("createNamespace"); + } + + public async dropNamespace( + _request: Models.DropNamespaceRequest, + ): Promise { + return this.unsupported("dropNamespace"); + } + + public async namespaceExists( + _request: Models.NamespaceExistsRequest, + ): Promise { + return this.unsupported("namespaceExists"); + } + + public async listTables( + _request: Models.ListTablesRequest, + ): Promise { + return this.unsupported("listTables"); + } + + public async listAllTables( + _request: Models.ListTablesRequest, + ): Promise { + return this.unsupported("listAllTables"); + } + + public async describeTable( + _request: Models.DescribeTableRequest, + ): Promise { + return this.unsupported("describeTable"); + } + + public async registerTable( + _request: Models.RegisterTableRequest, + ): Promise { + return this.unsupported("registerTable"); + } + + public async tableExists(_request: Models.TableExistsRequest): Promise { + return this.unsupported("tableExists"); + } + + public async dropTable( + _request: Models.DropTableRequest, + ): Promise { + return this.unsupported("dropTable"); + } + + public async deregisterTable( + _request: Models.DeregisterTableRequest, + ): Promise { + return this.unsupported("deregisterTable"); + } + + public async createTable( + _request: Models.CreateTableRequest, + _requestData: Uint8Array, + ): Promise { + return this.unsupported("createTable"); + } + + public async declareTable( + _request: Models.DeclareTableRequest, + ): Promise { + return this.unsupported("declareTable"); + } + + public async createEmptyTable( + _request: Models.CreateEmptyTableRequest, + ): Promise { + return this.unsupported("createEmptyTable"); + } + + public async insertIntoTable( + _request: Models.InsertIntoTableRequest, + _requestData: Uint8Array, + ): Promise { + return this.unsupported("insertIntoTable"); + } + + public async mergeInsertIntoTable( + _request: Models.MergeInsertIntoTableRequest, + _requestData: Uint8Array, + ): Promise { + return this.unsupported("mergeInsertIntoTable"); + } + + public async updateTable( + _request: Models.UpdateTableRequest, + ): Promise { + return this.unsupported("updateTable"); + } + + public async deleteFromTable( + _request: Models.DeleteFromTableRequest, + ): Promise { + return this.unsupported("deleteFromTable"); + } + + public async queryTable( + _request: Models.QueryTableRequest, + ): Promise { + return this.unsupported("queryTable"); + } + + public async countTableRows( + _request: Models.CountTableRowsRequest, + ): Promise { + return this.unsupported("countTableRows"); + } + + public async createTableIndex( + _request: Models.CreateTableIndexRequest, + ): Promise { + return this.unsupported("createTableIndex"); + } + + public async createTableScalarIndex( + _request: Models.CreateTableIndexRequest, + ): Promise { + return this.unsupported("createTableScalarIndex"); + } + + public async listTableIndices( + _request: Models.ListTableIndicesRequest, + ): Promise { + return this.unsupported("listTableIndices"); + } + + public async describeTableIndexStats( + _request: Models.DescribeTableIndexStatsRequest, + ): Promise { + return this.unsupported("describeTableIndexStats"); + } + + public async dropTableIndex( + _request: Models.DropTableIndexRequest, + ): Promise { + return this.unsupported("dropTableIndex"); + } + + public async restoreTable( + _request: Models.RestoreTableRequest, + ): Promise { + return this.unsupported("restoreTable"); + } + + public async renameTable( + _request: Models.RenameTableRequest, + ): Promise { + return this.unsupported("renameTable"); + } + + public async listTableVersions( + _request: Models.ListTableVersionsRequest, + ): Promise { + return this.unsupported("listTableVersions"); + } + + public async createTableVersion( + _request: Models.CreateTableVersionRequest, + ): Promise { + return this.unsupported("createTableVersion"); + } + + public async describeTableVersion( + _request: Models.DescribeTableVersionRequest, + ): Promise { + return this.unsupported("describeTableVersion"); + } + + public async batchDeleteTableVersions( + _request: Models.BatchDeleteTableVersionsRequest, + ): Promise { + return this.unsupported("batchDeleteTableVersions"); + } + + public async batchCreateTableVersions( + _request: Models.BatchCreateTableVersionsRequest, + ): Promise { + return this.unsupported("batchCreateTableVersions"); + } + + public async updateTableSchemaMetadata( + _request: Models.UpdateTableSchemaMetadataRequest, + ): Promise { + return this.unsupported("updateTableSchemaMetadata"); + } + + public async getTableStats( + _request: Models.GetTableStatsRequest, + ): Promise { + return this.unsupported("getTableStats"); + } + + public async explainTableQueryPlan( + _request: Models.ExplainTableQueryPlanRequest, + ): Promise { + return this.unsupported("explainTableQueryPlan"); + } + + public async analyzeTableQueryPlan( + _request: Models.AnalyzeTableQueryPlanRequest, + ): Promise { + return this.unsupported("analyzeTableQueryPlan"); + } + + public async alterTableAddColumns( + _request: Models.AlterTableAddColumnsRequest, + ): Promise { + return this.unsupported("alterTableAddColumns"); + } + + public async alterTableAlterColumns( + _request: Models.AlterTableAlterColumnsRequest, + ): Promise { + return this.unsupported("alterTableAlterColumns"); + } + + public async alterTableDropColumns( + _request: Models.AlterTableDropColumnsRequest, + ): Promise { + return this.unsupported("alterTableDropColumns"); + } + + public async listTableTags( + _request: Models.ListTableTagsRequest, + ): Promise { + return this.unsupported("listTableTags"); + } + + public async getTableTagVersion( + _request: Models.GetTableTagVersionRequest, + ): Promise { + return this.unsupported("getTableTagVersion"); + } + + public async createTableTag( + _request: Models.CreateTableTagRequest, + ): Promise { + return this.unsupported("createTableTag"); + } + + public async deleteTableTag( + _request: Models.DeleteTableTagRequest, + ): Promise { + return this.unsupported("deleteTableTag"); + } + + public async updateTableTag( + _request: Models.UpdateTableTagRequest, + ): Promise { + return this.unsupported("updateTableTag"); + } + + public async describeTransaction( + _request: Models.DescribeTransactionRequest, + ): Promise { + return this.unsupported("describeTransaction"); + } + + public async alterTransaction( + _request: Models.AlterTransactionRequest, + ): Promise { + return this.unsupported("alterTransaction"); + } +} diff --git a/typescript/lance-namespace/test/errors.test.ts b/typescript/lance-namespace/test/errors.test.ts new file mode 100644 index 000000000..551770eb7 --- /dev/null +++ b/typescript/lance-namespace/test/errors.test.ts @@ -0,0 +1,40 @@ +import { describe, expect, it } from "vitest"; + +import { + ErrorCode, + InternalError, + TableNotFoundError, + fromErrorCode, + fromErrorResponse, +} from "../src/errors"; + +describe("errors", () => { + it("maps known code to typed error", () => { + const err = fromErrorCode(4, "missing"); + expect(err).toBeInstanceOf(TableNotFoundError); + expect(err.code).toBe(ErrorCode.TABLE_NOT_FOUND); + }); + + it("maps unknown code to internal error", () => { + const err = fromErrorCode(999, "unknown"); + expect(err).toBeInstanceOf(InternalError); + expect(err.code).toBe(ErrorCode.INTERNAL); + }); + + it("builds from error response", () => { + const err = fromErrorResponse( + { + code: 4, + error: "table not found", + detail: "detail", + instance: "req-1", + }, + "fallback", + ); + + expect(err).toBeInstanceOf(TableNotFoundError); + expect(err.message).toBe("table not found"); + expect(err.detail).toBe("detail"); + expect(err.instance).toBe("req-1"); + }); +}); diff --git a/typescript/lance-namespace/test/fixtures/mock_namespace.ts b/typescript/lance-namespace/test/fixtures/mock_namespace.ts new file mode 100644 index 000000000..bf5adf9ab --- /dev/null +++ b/typescript/lance-namespace/test/fixtures/mock_namespace.ts @@ -0,0 +1,16 @@ +import { LanceNamespace } from "../../src/index"; + +export class MockNamespace extends LanceNamespace { + public readonly properties: Record; + + public constructor(properties: Record) { + super(); + this.properties = properties; + } + + public namespaceId(): string { + return `MockNamespace { id: '${this.properties.id ?? "mock"}' }`; + } +} + +export default MockNamespace; diff --git a/typescript/lance-namespace/test/namespace.test.ts b/typescript/lance-namespace/test/namespace.test.ts new file mode 100644 index 000000000..6148cf8c7 --- /dev/null +++ b/typescript/lance-namespace/test/namespace.test.ts @@ -0,0 +1,61 @@ +import { describe, expect, it } from "vitest"; + +import type { ListNamespacesRequest } from "@lance/namespace-fetch-client"; + +import { + LanceNamespace, + NATIVE_IMPLS, + UnsupportedOperationError, + clearRegisteredNamespaceImplsForTest, + connect, + registerNamespaceImpl, +} from "../src/index"; + +class MockNamespace extends LanceNamespace { + public readonly properties: Record; + + public constructor(properties: Record) { + super(); + this.properties = properties; + } + + public namespaceId(): string { + return `MockNamespace { id: '${this.properties.id ?? "mock"}' }`; + } +} + +describe("namespace interface and registry", () => { + it("default methods throw unsupported", async () => { + const ns = new MockNamespace({}); + + await expect( + ns.listNamespaces({ id: [] } as ListNamespacesRequest), + ).rejects.toBeInstanceOf(UnsupportedOperationError); + }); + + it("connects with class path", async () => { + const ns = await connect("../test/fixtures/mock_namespace#MockNamespace", { + id: "class-path", + }); + expect(ns.namespaceId()).toContain("class-path"); + }); + + it("connects with registered alias", async () => { + clearRegisteredNamespaceImplsForTest(); + registerNamespaceImpl("mock", "../test/fixtures/mock_namespace#default"); + + const ns = await connect("mock", { id: "registered" }); + expect(ns.namespaceId()).toContain("registered"); + }); + + it("rejects invalid class path", async () => { + await expect(connect("non-existent-module", {})).rejects.toThrow( + "Failed to construct namespace impl", + ); + }); + + it("defines python-style native aliases", () => { + expect(NATIVE_IMPLS.rest).toBe("@lance/lance-namespace-rest#RestNamespace"); + expect(NATIVE_IMPLS.dir).toBe("@lance/lance-namespace-dir#DirectoryNamespace"); + }); +}); diff --git a/typescript/lance-namespace/tsconfig.json b/typescript/lance-namespace/tsconfig.json new file mode 100644 index 000000000..8297aac9b --- /dev/null +++ b/typescript/lance-namespace/tsconfig.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "target": "ES2022", + "module": "ESNext", + "moduleResolution": "Bundler", + "lib": ["ES2022", "DOM"], + "strict": true, + "declaration": true, + "declarationMap": true, + "sourceMap": true, + "outDir": "dist", + "rootDir": "src", + "esModuleInterop": true, + "skipLibCheck": true, + "noUncheckedIndexedAccess": true + }, + "include": ["src/**/*.ts"] +} diff --git a/typescript/lance-namespace/tsconfig.test.json b/typescript/lance-namespace/tsconfig.test.json new file mode 100644 index 000000000..a8dc5aef5 --- /dev/null +++ b/typescript/lance-namespace/tsconfig.test.json @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "noEmit": true, + "rootDir": ".", + "types": ["vitest/globals"] + }, + "include": ["src/**/*.ts", "test/**/*.ts", "vitest.config.ts"] +} diff --git a/typescript/lance-namespace/vitest.config.ts b/typescript/lance-namespace/vitest.config.ts new file mode 100644 index 000000000..8b5840aca --- /dev/null +++ b/typescript/lance-namespace/vitest.config.ts @@ -0,0 +1,7 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + include: ["test/**/*.test.ts"], + }, +}); diff --git a/typescript/package.json b/typescript/package.json new file mode 100644 index 000000000..672f02efb --- /dev/null +++ b/typescript/package.json @@ -0,0 +1,11 @@ +{ + "name": "lance-namespace-typescript-workspace", + "private": true, + "version": "0.5.2", + "packageManager": "pnpm@10.17.1", + "scripts": { + "build": "pnpm -r run build", + "test": "pnpm -r run test", + "lint": "pnpm -r run lint" + } +} diff --git a/typescript/pnpm-lock.yaml b/typescript/pnpm-lock.yaml new file mode 100644 index 000000000..ba3e2f635 --- /dev/null +++ b/typescript/pnpm-lock.yaml @@ -0,0 +1,915 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: {} + + lance-namespace: + dependencies: + '@lance/namespace-fetch-client': + specifier: workspace:* + version: link:../lance-namespace-fetch-client + devDependencies: + typescript: + specifier: ^5.8.3 + version: 5.9.3 + vitest: + specifier: ^2.1.9 + version: 2.1.9 + + lance-namespace-fetch-client: + devDependencies: + typescript: + specifier: ^5.8.3 + version: 5.9.3 + vitest: + specifier: ^2.1.9 + version: 2.1.9 + + lance-namespace-rest: + dependencies: + '@lance/lance-namespace': + specifier: workspace:* + version: link:../lance-namespace + '@lance/namespace-fetch-client': + specifier: workspace:* + version: link:../lance-namespace-fetch-client + devDependencies: + typescript: + specifier: ^5.8.3 + version: 5.9.3 + vitest: + specifier: ^2.1.9 + version: 2.1.9 + +packages: + + '@esbuild/aix-ppc64@0.21.5': + resolution: {integrity: sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==} + engines: {node: '>=12'} + cpu: [ppc64] + os: [aix] + + '@esbuild/android-arm64@0.21.5': + resolution: {integrity: sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==} + engines: {node: '>=12'} + cpu: [arm64] + os: [android] + + '@esbuild/android-arm@0.21.5': + resolution: {integrity: sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==} + engines: {node: '>=12'} + cpu: [arm] + os: [android] + + '@esbuild/android-x64@0.21.5': + resolution: {integrity: sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==} + engines: {node: '>=12'} + cpu: [x64] + os: [android] + + '@esbuild/darwin-arm64@0.21.5': + resolution: {integrity: sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==} + engines: {node: '>=12'} + cpu: [arm64] + os: [darwin] + + '@esbuild/darwin-x64@0.21.5': + resolution: {integrity: sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==} + engines: {node: '>=12'} + cpu: [x64] + os: [darwin] + + '@esbuild/freebsd-arm64@0.21.5': + resolution: {integrity: sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==} + engines: {node: '>=12'} + cpu: [arm64] + os: [freebsd] + + '@esbuild/freebsd-x64@0.21.5': + resolution: {integrity: sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [freebsd] + + '@esbuild/linux-arm64@0.21.5': + resolution: {integrity: sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==} + engines: {node: '>=12'} + cpu: [arm64] + os: [linux] + + '@esbuild/linux-arm@0.21.5': + resolution: {integrity: sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==} + engines: {node: '>=12'} + cpu: [arm] + os: [linux] + + '@esbuild/linux-ia32@0.21.5': + resolution: {integrity: sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==} + engines: {node: '>=12'} + cpu: [ia32] + os: [linux] + + '@esbuild/linux-loong64@0.21.5': + resolution: {integrity: sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==} + engines: {node: '>=12'} + cpu: [loong64] + os: [linux] + + '@esbuild/linux-mips64el@0.21.5': + resolution: {integrity: sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==} + engines: {node: '>=12'} + cpu: [mips64el] + os: [linux] + + '@esbuild/linux-ppc64@0.21.5': + resolution: {integrity: sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==} + engines: {node: '>=12'} + cpu: [ppc64] + os: [linux] + + '@esbuild/linux-riscv64@0.21.5': + resolution: {integrity: sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==} + engines: {node: '>=12'} + cpu: [riscv64] + os: [linux] + + '@esbuild/linux-s390x@0.21.5': + resolution: {integrity: sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==} + engines: {node: '>=12'} + cpu: [s390x] + os: [linux] + + '@esbuild/linux-x64@0.21.5': + resolution: {integrity: sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [linux] + + '@esbuild/netbsd-x64@0.21.5': + resolution: {integrity: sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==} + engines: {node: '>=12'} + cpu: [x64] + os: [netbsd] + + '@esbuild/openbsd-x64@0.21.5': + resolution: {integrity: sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==} + engines: {node: '>=12'} + cpu: [x64] + os: [openbsd] + + '@esbuild/sunos-x64@0.21.5': + resolution: {integrity: sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==} + engines: {node: '>=12'} + cpu: [x64] + os: [sunos] + + '@esbuild/win32-arm64@0.21.5': + resolution: {integrity: sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==} + engines: {node: '>=12'} + cpu: [arm64] + os: [win32] + + '@esbuild/win32-ia32@0.21.5': + resolution: {integrity: sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==} + engines: {node: '>=12'} + cpu: [ia32] + os: [win32] + + '@esbuild/win32-x64@0.21.5': + resolution: {integrity: sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==} + engines: {node: '>=12'} + cpu: [x64] + os: [win32] + + '@jridgewell/sourcemap-codec@1.5.5': + resolution: {integrity: sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==} + + '@rollup/rollup-android-arm-eabi@4.59.0': + resolution: {integrity: sha512-upnNBkA6ZH2VKGcBj9Fyl9IGNPULcjXRlg0LLeaioQWueH30p6IXtJEbKAgvyv+mJaMxSm1l6xwDXYjpEMiLMg==} + cpu: [arm] + os: [android] + + '@rollup/rollup-android-arm64@4.59.0': + resolution: {integrity: sha512-hZ+Zxj3SySm4A/DylsDKZAeVg0mvi++0PYVceVyX7hemkw7OreKdCvW2oQ3T1FMZvCaQXqOTHb8qmBShoqk69Q==} + cpu: [arm64] + os: [android] + + '@rollup/rollup-darwin-arm64@4.59.0': + resolution: {integrity: sha512-W2Psnbh1J8ZJw0xKAd8zdNgF9HRLkdWwwdWqubSVk0pUuQkoHnv7rx4GiF9rT4t5DIZGAsConRE3AxCdJ4m8rg==} + cpu: [arm64] + os: [darwin] + + '@rollup/rollup-darwin-x64@4.59.0': + resolution: {integrity: sha512-ZW2KkwlS4lwTv7ZVsYDiARfFCnSGhzYPdiOU4IM2fDbL+QGlyAbjgSFuqNRbSthybLbIJ915UtZBtmuLrQAT/w==} + cpu: [x64] + os: [darwin] + + '@rollup/rollup-freebsd-arm64@4.59.0': + resolution: {integrity: sha512-EsKaJ5ytAu9jI3lonzn3BgG8iRBjV4LxZexygcQbpiU0wU0ATxhNVEpXKfUa0pS05gTcSDMKpn3Sx+QB9RlTTA==} + cpu: [arm64] + os: [freebsd] + + '@rollup/rollup-freebsd-x64@4.59.0': + resolution: {integrity: sha512-d3DuZi2KzTMjImrxoHIAODUZYoUUMsuUiY4SRRcJy6NJoZ6iIqWnJu9IScV9jXysyGMVuW+KNzZvBLOcpdl3Vg==} + cpu: [x64] + os: [freebsd] + + '@rollup/rollup-linux-arm-gnueabihf@4.59.0': + resolution: {integrity: sha512-t4ONHboXi/3E0rT6OZl1pKbl2Vgxf9vJfWgmUoCEVQVxhW6Cw/c8I6hbbu7DAvgp82RKiH7TpLwxnJeKv2pbsw==} + cpu: [arm] + os: [linux] + + '@rollup/rollup-linux-arm-musleabihf@4.59.0': + resolution: {integrity: sha512-CikFT7aYPA2ufMD086cVORBYGHffBo4K8MQ4uPS/ZnY54GKj36i196u8U+aDVT2LX4eSMbyHtyOh7D7Zvk2VvA==} + cpu: [arm] + os: [linux] + + '@rollup/rollup-linux-arm64-gnu@4.59.0': + resolution: {integrity: sha512-jYgUGk5aLd1nUb1CtQ8E+t5JhLc9x5WdBKew9ZgAXg7DBk0ZHErLHdXM24rfX+bKrFe+Xp5YuJo54I5HFjGDAA==} + cpu: [arm64] + os: [linux] + + '@rollup/rollup-linux-arm64-musl@4.59.0': + resolution: {integrity: sha512-peZRVEdnFWZ5Bh2KeumKG9ty7aCXzzEsHShOZEFiCQlDEepP1dpUl/SrUNXNg13UmZl+gzVDPsiCwnV1uI0RUA==} + cpu: [arm64] + os: [linux] + + '@rollup/rollup-linux-loong64-gnu@4.59.0': + resolution: {integrity: sha512-gbUSW/97f7+r4gHy3Jlup8zDG190AuodsWnNiXErp9mT90iCy9NKKU0Xwx5k8VlRAIV2uU9CsMnEFg/xXaOfXg==} + cpu: [loong64] + os: [linux] + + '@rollup/rollup-linux-loong64-musl@4.59.0': + resolution: {integrity: sha512-yTRONe79E+o0FWFijasoTjtzG9EBedFXJMl888NBEDCDV9I2wGbFFfJQQe63OijbFCUZqxpHz1GzpbtSFikJ4Q==} + cpu: [loong64] + os: [linux] + + '@rollup/rollup-linux-ppc64-gnu@4.59.0': + resolution: {integrity: sha512-sw1o3tfyk12k3OEpRddF68a1unZ5VCN7zoTNtSn2KndUE+ea3m3ROOKRCZxEpmT9nsGnogpFP9x6mnLTCaoLkA==} + cpu: [ppc64] + os: [linux] + + '@rollup/rollup-linux-ppc64-musl@4.59.0': + resolution: {integrity: sha512-+2kLtQ4xT3AiIxkzFVFXfsmlZiG5FXYW7ZyIIvGA7Bdeuh9Z0aN4hVyXS/G1E9bTP/vqszNIN/pUKCk/BTHsKA==} + cpu: [ppc64] + os: [linux] + + '@rollup/rollup-linux-riscv64-gnu@4.59.0': + resolution: {integrity: sha512-NDYMpsXYJJaj+I7UdwIuHHNxXZ/b/N2hR15NyH3m2qAtb/hHPA4g4SuuvrdxetTdndfj9b1WOmy73kcPRoERUg==} + cpu: [riscv64] + os: [linux] + + '@rollup/rollup-linux-riscv64-musl@4.59.0': + resolution: {integrity: sha512-nLckB8WOqHIf1bhymk+oHxvM9D3tyPndZH8i8+35p/1YiVoVswPid2yLzgX7ZJP0KQvnkhM4H6QZ5m0LzbyIAg==} + cpu: [riscv64] + os: [linux] + + '@rollup/rollup-linux-s390x-gnu@4.59.0': + resolution: {integrity: sha512-oF87Ie3uAIvORFBpwnCvUzdeYUqi2wY6jRFWJAy1qus/udHFYIkplYRW+wo+GRUP4sKzYdmE1Y3+rY5Gc4ZO+w==} + cpu: [s390x] + os: [linux] + + '@rollup/rollup-linux-x64-gnu@4.59.0': + resolution: {integrity: sha512-3AHmtQq/ppNuUspKAlvA8HtLybkDflkMuLK4DPo77DfthRb71V84/c4MlWJXixZz4uruIH4uaa07IqoAkG64fg==} + cpu: [x64] + os: [linux] + + '@rollup/rollup-linux-x64-musl@4.59.0': + resolution: {integrity: sha512-2UdiwS/9cTAx7qIUZB/fWtToJwvt0Vbo0zmnYt7ED35KPg13Q0ym1g442THLC7VyI6JfYTP4PiSOWyoMdV2/xg==} + cpu: [x64] + os: [linux] + + '@rollup/rollup-openbsd-x64@4.59.0': + resolution: {integrity: sha512-M3bLRAVk6GOwFlPTIxVBSYKUaqfLrn8l0psKinkCFxl4lQvOSz8ZrKDz2gxcBwHFpci0B6rttydI4IpS4IS/jQ==} + cpu: [x64] + os: [openbsd] + + '@rollup/rollup-openharmony-arm64@4.59.0': + resolution: {integrity: sha512-tt9KBJqaqp5i5HUZzoafHZX8b5Q2Fe7UjYERADll83O4fGqJ49O1FsL6LpdzVFQcpwvnyd0i+K/VSwu/o/nWlA==} + cpu: [arm64] + os: [openharmony] + + '@rollup/rollup-win32-arm64-msvc@4.59.0': + resolution: {integrity: sha512-V5B6mG7OrGTwnxaNUzZTDTjDS7F75PO1ae6MJYdiMu60sq0CqN5CVeVsbhPxalupvTX8gXVSU9gq+Rx1/hvu6A==} + cpu: [arm64] + os: [win32] + + '@rollup/rollup-win32-ia32-msvc@4.59.0': + resolution: {integrity: sha512-UKFMHPuM9R0iBegwzKF4y0C4J9u8C6MEJgFuXTBerMk7EJ92GFVFYBfOZaSGLu6COf7FxpQNqhNS4c4icUPqxA==} + cpu: [ia32] + os: [win32] + + '@rollup/rollup-win32-x64-gnu@4.59.0': + resolution: {integrity: sha512-laBkYlSS1n2L8fSo1thDNGrCTQMmxjYY5G0WFWjFFYZkKPjsMBsgJfGf4TLxXrF6RyhI60L8TMOjBMvXiTcxeA==} + cpu: [x64] + os: [win32] + + '@rollup/rollup-win32-x64-msvc@4.59.0': + resolution: {integrity: sha512-2HRCml6OztYXyJXAvdDXPKcawukWY2GpR5/nxKp4iBgiO3wcoEGkAaqctIbZcNB6KlUQBIqt8VYkNSj2397EfA==} + cpu: [x64] + os: [win32] + + '@types/estree@1.0.8': + resolution: {integrity: sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==} + + '@vitest/expect@2.1.9': + resolution: {integrity: sha512-UJCIkTBenHeKT1TTlKMJWy1laZewsRIzYighyYiJKZreqtdxSos/S1t+ktRMQWu2CKqaarrkeszJx1cgC5tGZw==} + + '@vitest/mocker@2.1.9': + resolution: {integrity: sha512-tVL6uJgoUdi6icpxmdrn5YNo3g3Dxv+IHJBr0GXHaEdTcw3F+cPKnsXFhli6nO+f/6SDKPHEK1UN+k+TQv0Ehg==} + peerDependencies: + msw: ^2.4.9 + vite: ^5.0.0 + peerDependenciesMeta: + msw: + optional: true + vite: + optional: true + + '@vitest/pretty-format@2.1.9': + resolution: {integrity: sha512-KhRIdGV2U9HOUzxfiHmY8IFHTdqtOhIzCpd8WRdJiE7D/HUcZVD0EgQCVjm+Q9gkUXWgBvMmTtZgIG48wq7sOQ==} + + '@vitest/runner@2.1.9': + resolution: {integrity: sha512-ZXSSqTFIrzduD63btIfEyOmNcBmQvgOVsPNPe0jYtESiXkhd8u2erDLnMxmGrDCwHCCHE7hxwRDCT3pt0esT4g==} + + '@vitest/snapshot@2.1.9': + resolution: {integrity: sha512-oBO82rEjsxLNJincVhLhaxxZdEtV0EFHMK5Kmx5sJ6H9L183dHECjiefOAdnqpIgT5eZwT04PoggUnW88vOBNQ==} + + '@vitest/spy@2.1.9': + resolution: {integrity: sha512-E1B35FwzXXTs9FHNK6bDszs7mtydNi5MIfUWpceJ8Xbfb1gBMscAnwLbEu+B44ed6W3XjL9/ehLPHR1fkf1KLQ==} + + '@vitest/utils@2.1.9': + resolution: {integrity: sha512-v0psaMSkNJ3A2NMrUEHFRzJtDPFn+/VWZ5WxImB21T9fjucJRmS7xCS3ppEnARb9y11OAzaD+P2Ps+b+BGX5iQ==} + + assertion-error@2.0.1: + resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==} + engines: {node: '>=12'} + + cac@6.7.14: + resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==} + engines: {node: '>=8'} + + chai@5.3.3: + resolution: {integrity: sha512-4zNhdJD/iOjSH0A05ea+Ke6MU5mmpQcbQsSOkgdaUMJ9zTlDTD/GYlwohmIE2u0gaxHYiVHEn1Fw9mZ/ktJWgw==} + engines: {node: '>=18'} + + check-error@2.1.3: + resolution: {integrity: sha512-PAJdDJusoxnwm1VwW07VWwUN1sl7smmC3OKggvndJFadxxDRyFJBX/ggnu/KE4kQAB7a3Dp8f/YXC1FlUprWmA==} + engines: {node: '>= 16'} + + debug@4.4.3: + resolution: {integrity: sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + + deep-eql@5.0.2: + resolution: {integrity: sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==} + engines: {node: '>=6'} + + es-module-lexer@1.7.0: + resolution: {integrity: sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==} + + esbuild@0.21.5: + resolution: {integrity: sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==} + engines: {node: '>=12'} + hasBin: true + + estree-walker@3.0.3: + resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==} + + expect-type@1.3.0: + resolution: {integrity: sha512-knvyeauYhqjOYvQ66MznSMs83wmHrCycNEN6Ao+2AeYEfxUIkuiVxdEa1qlGEPK+We3n0THiDciYSsCcgW/DoA==} + engines: {node: '>=12.0.0'} + + fsevents@2.3.3: + resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} + engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} + os: [darwin] + + loupe@3.2.1: + resolution: {integrity: sha512-CdzqowRJCeLU72bHvWqwRBBlLcMEtIvGrlvef74kMnV2AolS9Y8xUv1I0U/MNAWMhBlKIoyuEgoJ0t/bbwHbLQ==} + + magic-string@0.30.21: + resolution: {integrity: sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==} + + ms@2.1.3: + resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} + + nanoid@3.3.11: + resolution: {integrity: sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==} + engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} + hasBin: true + + pathe@1.1.2: + resolution: {integrity: sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==} + + pathval@2.0.1: + resolution: {integrity: sha512-//nshmD55c46FuFw26xV/xFAaB5HF9Xdap7HJBBnrKdAd6/GxDBaNA1870O79+9ueg61cZLSVc+OaFlfmObYVQ==} + engines: {node: '>= 14.16'} + + picocolors@1.1.1: + resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} + + postcss@8.5.6: + resolution: {integrity: sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==} + engines: {node: ^10 || ^12 || >=14} + + rollup@4.59.0: + resolution: {integrity: sha512-2oMpl67a3zCH9H79LeMcbDhXW/UmWG/y2zuqnF2jQq5uq9TbM9TVyXvA4+t+ne2IIkBdrLpAaRQAvo7YI/Yyeg==} + engines: {node: '>=18.0.0', npm: '>=8.0.0'} + hasBin: true + + siginfo@2.0.0: + resolution: {integrity: sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==} + + source-map-js@1.2.1: + resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} + engines: {node: '>=0.10.0'} + + stackback@0.0.2: + resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==} + + std-env@3.10.0: + resolution: {integrity: sha512-5GS12FdOZNliM5mAOxFRg7Ir0pWz8MdpYm6AY6VPkGpbA7ZzmbzNcBJQ0GPvvyWgcY7QAhCgf9Uy89I03faLkg==} + + tinybench@2.9.0: + resolution: {integrity: sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==} + + tinyexec@0.3.2: + resolution: {integrity: sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==} + + tinypool@1.1.1: + resolution: {integrity: sha512-Zba82s87IFq9A9XmjiX5uZA/ARWDrB03OHlq+Vw1fSdt0I+4/Kutwy8BP4Y/y/aORMo61FQ0vIb5j44vSo5Pkg==} + engines: {node: ^18.0.0 || >=20.0.0} + + tinyrainbow@1.2.0: + resolution: {integrity: sha512-weEDEq7Z5eTHPDh4xjX789+fHfF+P8boiFB+0vbWzpbnbsEr/GRaohi/uMKxg8RZMXnl1ItAi/IUHWMsjDV7kQ==} + engines: {node: '>=14.0.0'} + + tinyspy@3.0.2: + resolution: {integrity: sha512-n1cw8k1k0x4pgA2+9XrOkFydTerNcJ1zWCO5Nn9scWHTD+5tp8dghT2x1uduQePZTZgd3Tupf+x9BxJjeJi77Q==} + engines: {node: '>=14.0.0'} + + typescript@5.9.3: + resolution: {integrity: sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==} + engines: {node: '>=14.17'} + hasBin: true + + vite-node@2.1.9: + resolution: {integrity: sha512-AM9aQ/IPrW/6ENLQg3AGY4K1N2TGZdR5e4gu/MmmR2xR3Ll1+dib+nook92g4TV3PXVyeyxdWwtaCAiUL0hMxA==} + engines: {node: ^18.0.0 || >=20.0.0} + hasBin: true + + vite@5.4.21: + resolution: {integrity: sha512-o5a9xKjbtuhY6Bi5S3+HvbRERmouabWbyUcpXXUA1u+GNUKoROi9byOJ8M0nHbHYHkYICiMlqxkg1KkYmm25Sw==} + engines: {node: ^18.0.0 || >=20.0.0} + hasBin: true + peerDependencies: + '@types/node': ^18.0.0 || >=20.0.0 + less: '*' + lightningcss: ^1.21.0 + sass: '*' + sass-embedded: '*' + stylus: '*' + sugarss: '*' + terser: ^5.4.0 + peerDependenciesMeta: + '@types/node': + optional: true + less: + optional: true + lightningcss: + optional: true + sass: + optional: true + sass-embedded: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + + vitest@2.1.9: + resolution: {integrity: sha512-MSmPM9REYqDGBI8439mA4mWhV5sKmDlBKWIYbA3lRb2PTHACE0mgKwA8yQ2xq9vxDTuk4iPrECBAEW2aoFXY0Q==} + engines: {node: ^18.0.0 || >=20.0.0} + hasBin: true + peerDependencies: + '@edge-runtime/vm': '*' + '@types/node': ^18.0.0 || >=20.0.0 + '@vitest/browser': 2.1.9 + '@vitest/ui': 2.1.9 + happy-dom: '*' + jsdom: '*' + peerDependenciesMeta: + '@edge-runtime/vm': + optional: true + '@types/node': + optional: true + '@vitest/browser': + optional: true + '@vitest/ui': + optional: true + happy-dom: + optional: true + jsdom: + optional: true + + why-is-node-running@2.3.0: + resolution: {integrity: sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==} + engines: {node: '>=8'} + hasBin: true + +snapshots: + + '@esbuild/aix-ppc64@0.21.5': + optional: true + + '@esbuild/android-arm64@0.21.5': + optional: true + + '@esbuild/android-arm@0.21.5': + optional: true + + '@esbuild/android-x64@0.21.5': + optional: true + + '@esbuild/darwin-arm64@0.21.5': + optional: true + + '@esbuild/darwin-x64@0.21.5': + optional: true + + '@esbuild/freebsd-arm64@0.21.5': + optional: true + + '@esbuild/freebsd-x64@0.21.5': + optional: true + + '@esbuild/linux-arm64@0.21.5': + optional: true + + '@esbuild/linux-arm@0.21.5': + optional: true + + '@esbuild/linux-ia32@0.21.5': + optional: true + + '@esbuild/linux-loong64@0.21.5': + optional: true + + '@esbuild/linux-mips64el@0.21.5': + optional: true + + '@esbuild/linux-ppc64@0.21.5': + optional: true + + '@esbuild/linux-riscv64@0.21.5': + optional: true + + '@esbuild/linux-s390x@0.21.5': + optional: true + + '@esbuild/linux-x64@0.21.5': + optional: true + + '@esbuild/netbsd-x64@0.21.5': + optional: true + + '@esbuild/openbsd-x64@0.21.5': + optional: true + + '@esbuild/sunos-x64@0.21.5': + optional: true + + '@esbuild/win32-arm64@0.21.5': + optional: true + + '@esbuild/win32-ia32@0.21.5': + optional: true + + '@esbuild/win32-x64@0.21.5': + optional: true + + '@jridgewell/sourcemap-codec@1.5.5': {} + + '@rollup/rollup-android-arm-eabi@4.59.0': + optional: true + + '@rollup/rollup-android-arm64@4.59.0': + optional: true + + '@rollup/rollup-darwin-arm64@4.59.0': + optional: true + + '@rollup/rollup-darwin-x64@4.59.0': + optional: true + + '@rollup/rollup-freebsd-arm64@4.59.0': + optional: true + + '@rollup/rollup-freebsd-x64@4.59.0': + optional: true + + '@rollup/rollup-linux-arm-gnueabihf@4.59.0': + optional: true + + '@rollup/rollup-linux-arm-musleabihf@4.59.0': + optional: true + + '@rollup/rollup-linux-arm64-gnu@4.59.0': + optional: true + + '@rollup/rollup-linux-arm64-musl@4.59.0': + optional: true + + '@rollup/rollup-linux-loong64-gnu@4.59.0': + optional: true + + '@rollup/rollup-linux-loong64-musl@4.59.0': + optional: true + + '@rollup/rollup-linux-ppc64-gnu@4.59.0': + optional: true + + '@rollup/rollup-linux-ppc64-musl@4.59.0': + optional: true + + '@rollup/rollup-linux-riscv64-gnu@4.59.0': + optional: true + + '@rollup/rollup-linux-riscv64-musl@4.59.0': + optional: true + + '@rollup/rollup-linux-s390x-gnu@4.59.0': + optional: true + + '@rollup/rollup-linux-x64-gnu@4.59.0': + optional: true + + '@rollup/rollup-linux-x64-musl@4.59.0': + optional: true + + '@rollup/rollup-openbsd-x64@4.59.0': + optional: true + + '@rollup/rollup-openharmony-arm64@4.59.0': + optional: true + + '@rollup/rollup-win32-arm64-msvc@4.59.0': + optional: true + + '@rollup/rollup-win32-ia32-msvc@4.59.0': + optional: true + + '@rollup/rollup-win32-x64-gnu@4.59.0': + optional: true + + '@rollup/rollup-win32-x64-msvc@4.59.0': + optional: true + + '@types/estree@1.0.8': {} + + '@vitest/expect@2.1.9': + dependencies: + '@vitest/spy': 2.1.9 + '@vitest/utils': 2.1.9 + chai: 5.3.3 + tinyrainbow: 1.2.0 + + '@vitest/mocker@2.1.9(vite@5.4.21)': + dependencies: + '@vitest/spy': 2.1.9 + estree-walker: 3.0.3 + magic-string: 0.30.21 + optionalDependencies: + vite: 5.4.21 + + '@vitest/pretty-format@2.1.9': + dependencies: + tinyrainbow: 1.2.0 + + '@vitest/runner@2.1.9': + dependencies: + '@vitest/utils': 2.1.9 + pathe: 1.1.2 + + '@vitest/snapshot@2.1.9': + dependencies: + '@vitest/pretty-format': 2.1.9 + magic-string: 0.30.21 + pathe: 1.1.2 + + '@vitest/spy@2.1.9': + dependencies: + tinyspy: 3.0.2 + + '@vitest/utils@2.1.9': + dependencies: + '@vitest/pretty-format': 2.1.9 + loupe: 3.2.1 + tinyrainbow: 1.2.0 + + assertion-error@2.0.1: {} + + cac@6.7.14: {} + + chai@5.3.3: + dependencies: + assertion-error: 2.0.1 + check-error: 2.1.3 + deep-eql: 5.0.2 + loupe: 3.2.1 + pathval: 2.0.1 + + check-error@2.1.3: {} + + debug@4.4.3: + dependencies: + ms: 2.1.3 + + deep-eql@5.0.2: {} + + es-module-lexer@1.7.0: {} + + esbuild@0.21.5: + optionalDependencies: + '@esbuild/aix-ppc64': 0.21.5 + '@esbuild/android-arm': 0.21.5 + '@esbuild/android-arm64': 0.21.5 + '@esbuild/android-x64': 0.21.5 + '@esbuild/darwin-arm64': 0.21.5 + '@esbuild/darwin-x64': 0.21.5 + '@esbuild/freebsd-arm64': 0.21.5 + '@esbuild/freebsd-x64': 0.21.5 + '@esbuild/linux-arm': 0.21.5 + '@esbuild/linux-arm64': 0.21.5 + '@esbuild/linux-ia32': 0.21.5 + '@esbuild/linux-loong64': 0.21.5 + '@esbuild/linux-mips64el': 0.21.5 + '@esbuild/linux-ppc64': 0.21.5 + '@esbuild/linux-riscv64': 0.21.5 + '@esbuild/linux-s390x': 0.21.5 + '@esbuild/linux-x64': 0.21.5 + '@esbuild/netbsd-x64': 0.21.5 + '@esbuild/openbsd-x64': 0.21.5 + '@esbuild/sunos-x64': 0.21.5 + '@esbuild/win32-arm64': 0.21.5 + '@esbuild/win32-ia32': 0.21.5 + '@esbuild/win32-x64': 0.21.5 + + estree-walker@3.0.3: + dependencies: + '@types/estree': 1.0.8 + + expect-type@1.3.0: {} + + fsevents@2.3.3: + optional: true + + loupe@3.2.1: {} + + magic-string@0.30.21: + dependencies: + '@jridgewell/sourcemap-codec': 1.5.5 + + ms@2.1.3: {} + + nanoid@3.3.11: {} + + pathe@1.1.2: {} + + pathval@2.0.1: {} + + picocolors@1.1.1: {} + + postcss@8.5.6: + dependencies: + nanoid: 3.3.11 + picocolors: 1.1.1 + source-map-js: 1.2.1 + + rollup@4.59.0: + dependencies: + '@types/estree': 1.0.8 + optionalDependencies: + '@rollup/rollup-android-arm-eabi': 4.59.0 + '@rollup/rollup-android-arm64': 4.59.0 + '@rollup/rollup-darwin-arm64': 4.59.0 + '@rollup/rollup-darwin-x64': 4.59.0 + '@rollup/rollup-freebsd-arm64': 4.59.0 + '@rollup/rollup-freebsd-x64': 4.59.0 + '@rollup/rollup-linux-arm-gnueabihf': 4.59.0 + '@rollup/rollup-linux-arm-musleabihf': 4.59.0 + '@rollup/rollup-linux-arm64-gnu': 4.59.0 + '@rollup/rollup-linux-arm64-musl': 4.59.0 + '@rollup/rollup-linux-loong64-gnu': 4.59.0 + '@rollup/rollup-linux-loong64-musl': 4.59.0 + '@rollup/rollup-linux-ppc64-gnu': 4.59.0 + '@rollup/rollup-linux-ppc64-musl': 4.59.0 + '@rollup/rollup-linux-riscv64-gnu': 4.59.0 + '@rollup/rollup-linux-riscv64-musl': 4.59.0 + '@rollup/rollup-linux-s390x-gnu': 4.59.0 + '@rollup/rollup-linux-x64-gnu': 4.59.0 + '@rollup/rollup-linux-x64-musl': 4.59.0 + '@rollup/rollup-openbsd-x64': 4.59.0 + '@rollup/rollup-openharmony-arm64': 4.59.0 + '@rollup/rollup-win32-arm64-msvc': 4.59.0 + '@rollup/rollup-win32-ia32-msvc': 4.59.0 + '@rollup/rollup-win32-x64-gnu': 4.59.0 + '@rollup/rollup-win32-x64-msvc': 4.59.0 + fsevents: 2.3.3 + + siginfo@2.0.0: {} + + source-map-js@1.2.1: {} + + stackback@0.0.2: {} + + std-env@3.10.0: {} + + tinybench@2.9.0: {} + + tinyexec@0.3.2: {} + + tinypool@1.1.1: {} + + tinyrainbow@1.2.0: {} + + tinyspy@3.0.2: {} + + typescript@5.9.3: {} + + vite-node@2.1.9: + dependencies: + cac: 6.7.14 + debug: 4.4.3 + es-module-lexer: 1.7.0 + pathe: 1.1.2 + vite: 5.4.21 + transitivePeerDependencies: + - '@types/node' + - less + - lightningcss + - sass + - sass-embedded + - stylus + - sugarss + - supports-color + - terser + + vite@5.4.21: + dependencies: + esbuild: 0.21.5 + postcss: 8.5.6 + rollup: 4.59.0 + optionalDependencies: + fsevents: 2.3.3 + + vitest@2.1.9: + dependencies: + '@vitest/expect': 2.1.9 + '@vitest/mocker': 2.1.9(vite@5.4.21) + '@vitest/pretty-format': 2.1.9 + '@vitest/runner': 2.1.9 + '@vitest/snapshot': 2.1.9 + '@vitest/spy': 2.1.9 + '@vitest/utils': 2.1.9 + chai: 5.3.3 + debug: 4.4.3 + expect-type: 1.3.0 + magic-string: 0.30.21 + pathe: 1.1.2 + std-env: 3.10.0 + tinybench: 2.9.0 + tinyexec: 0.3.2 + tinypool: 1.1.1 + tinyrainbow: 1.2.0 + vite: 5.4.21 + vite-node: 2.1.9 + why-is-node-running: 2.3.0 + transitivePeerDependencies: + - less + - lightningcss + - msw + - sass + - sass-embedded + - stylus + - sugarss + - supports-color + - terser + + why-is-node-running@2.3.0: + dependencies: + siginfo: 2.0.0 + stackback: 0.0.2 diff --git a/typescript/pnpm-workspace.yaml b/typescript/pnpm-workspace.yaml new file mode 100644 index 000000000..174ff3f17 --- /dev/null +++ b/typescript/pnpm-workspace.yaml @@ -0,0 +1,4 @@ +packages: + - lance-namespace-fetch-client + - lance-namespace + - lance-namespace-rest diff --git a/typescript/scripts/patch-fetch-client.mjs b/typescript/scripts/patch-fetch-client.mjs new file mode 100644 index 000000000..d756ce13a --- /dev/null +++ b/typescript/scripts/patch-fetch-client.mjs @@ -0,0 +1,92 @@ +#!/usr/bin/env node + +import { mkdir, readFile, writeFile } from "node:fs/promises"; +import { join } from "node:path"; +import { fileURLToPath } from "node:url"; + +const version = process.argv[2] ?? "0.0.0"; +const scriptDir = fileURLToPath(new URL(".", import.meta.url)); +const rootDir = join(scriptDir, ".."); +const packageDir = join(rootDir, "lance-namespace-fetch-client"); + +const packageJsonPath = join(packageDir, "package.json"); +const packageJson = JSON.parse(await readFile(packageJsonPath, "utf8")); +packageJson.version = version; +packageJson.repository = { + type: "git", + url: "https://github.com/lance-format/lance-namespace", +}; +packageJson.license = "Apache-2.0"; +packageJson.scripts = { + build: "tsc && tsc -p tsconfig.esm.json", + lint: "tsc --noEmit && tsc -p tsconfig.esm.json --noEmit", + test: "vitest run", +}; +packageJson.devDependencies = { + ...packageJson.devDependencies, + typescript: "^5.8.3", + vitest: "^2.1.9", +}; + +await writeFile(packageJsonPath, `${JSON.stringify(packageJson, null, 2)}\n`); + +const tsconfig = { + compilerOptions: { + declaration: true, + target: "es2022", + module: "commonjs", + moduleResolution: "node", + outDir: "dist", + lib: ["es2022", "dom"], + skipLibCheck: true, + }, + include: ["src/**/*.ts"], + exclude: ["dist", "node_modules", "test", "vitest.config.ts"], +}; + +await writeFile(join(packageDir, "tsconfig.json"), `${JSON.stringify(tsconfig, null, 2)}\n`); + +const tsconfigEsm = { + extends: "./tsconfig.json", + compilerOptions: { + module: "esnext", + outDir: "dist/esm", + }, +}; + +await writeFile( + join(packageDir, "tsconfig.esm.json"), + `${JSON.stringify(tsconfigEsm, null, 2)}\n`, +); + +const apisIndex = `/* tslint:disable */\n/* eslint-disable */\nexport { DataApi } from "./DataApi";\nexport { IndexApi } from "./IndexApi";\nexport { MetadataApi } from "./MetadataApi";\nexport { NamespaceApi } from "./NamespaceApi";\nexport { TableApi } from "./TableApi";\nexport { TagApi } from "./TagApi";\nexport { TransactionApi } from "./TransactionApi";\n`; +await writeFile(join(packageDir, "src", "apis", "index.ts"), apisIndex); + +const rootIndex = `/* tslint:disable */\n/* eslint-disable */\nexport * from "./runtime";\nexport { DataApi, IndexApi, MetadataApi, NamespaceApi, TableApi, TagApi, TransactionApi } from "./apis/index";\nexport * from "./models/index";\n`; +await writeFile(join(packageDir, "src", "index.ts"), rootIndex); + +const vitestConfig = `import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + include: ["test/**/*.test.ts"], + }, +}); +`; + +await writeFile(join(packageDir, "vitest.config.ts"), vitestConfig); +await mkdir(join(packageDir, "test"), { recursive: true }); + +const smokeTest = `import { describe, expect, it } from "vitest"; + +import { NamespaceApi } from "../src/apis/NamespaceApi"; + +describe("fetch-client smoke", () => { + it("constructs api instance", () => { + const api = new NamespaceApi(); + expect(api).toBeDefined(); + }); +}); +`; + +await writeFile(join(packageDir, "test", "smoke.test.ts"), smokeTest);