UNPKG

@pinecone-database/pinecone

Version:

This is the official Node.js SDK for [Pinecone](https://www.pinecone.io), written in TypeScript.

138 lines 7.25 kB
"use strict"; /* tslint:disable */ /* eslint-disable */ /** * Pinecone Data Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.NamespaceOperationsApi = void 0; const runtime = __importStar(require("../runtime")); const index_1 = require("../models/index"); /** * */ class NamespaceOperationsApi extends runtime.BaseAPI { /** * Delete a namespace from an index. * Delete a namespace */ async deleteNamespaceRaw(requestParameters, initOverrides) { if (requestParameters.namespace === null || requestParameters.namespace === undefined) { throw new runtime.RequiredError('namespace', 'Required parameter requestParameters.namespace was null or undefined when calling deleteNamespace.'); } const queryParameters = {}; const headerParameters = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["Api-Key"] = this.configuration.apiKey("Api-Key"); // ApiKeyAuth authentication } const response = await this.request({ path: `/namespaces/{namespace}`.replace(`{${"namespace"}}`, encodeURIComponent(String(requestParameters.namespace))), method: 'DELETE', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response); } /** * Delete a namespace from an index. * Delete a namespace */ async deleteNamespace(requestParameters, initOverrides) { const response = await this.deleteNamespaceRaw(requestParameters, initOverrides); return await response.value(); } /** * Describe a [namespace](https://docs.pinecone.io/guides/index-data/indexing-overview#namespaces) in a serverless index, including the total number of vectors in the namespace. * Describe a namespace */ async describeNamespaceRaw(requestParameters, initOverrides) { if (requestParameters.namespace === null || requestParameters.namespace === undefined) { throw new runtime.RequiredError('namespace', 'Required parameter requestParameters.namespace was null or undefined when calling describeNamespace.'); } const queryParameters = {}; const headerParameters = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["Api-Key"] = this.configuration.apiKey("Api-Key"); // ApiKeyAuth authentication } const response = await this.request({ path: `/namespaces/{namespace}`.replace(`{${"namespace"}}`, encodeURIComponent(String(requestParameters.namespace))), method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.NamespaceDescriptionFromJSON)(jsonValue)); } /** * Describe a [namespace](https://docs.pinecone.io/guides/index-data/indexing-overview#namespaces) in a serverless index, including the total number of vectors in the namespace. * Describe a namespace */ async describeNamespace(requestParameters, initOverrides) { const response = await this.describeNamespaceRaw(requestParameters, initOverrides); return await response.value(); } /** * Get a list of all [namespaces](https://docs.pinecone.io/guides/index-data/indexing-overview#namespaces) in a serverless index. Up to 100 namespaces are returned at a time by default, in sorted order (bitwise “C” collation). If the `limit` parameter is set, up to that number of namespaces are returned instead. Whenever there are additional namespaces to return, the response also includes a `pagination_token` that you can use to get the next batch of namespaces. When the response does not include a `pagination_token`, there are no more namespaces to return. * List namespaces */ async listNamespacesOperationRaw(requestParameters, initOverrides) { const queryParameters = {}; if (requestParameters.limit !== undefined) { queryParameters['limit'] = requestParameters.limit; } if (requestParameters.paginationToken !== undefined) { queryParameters['paginationToken'] = requestParameters.paginationToken; } const headerParameters = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["Api-Key"] = this.configuration.apiKey("Api-Key"); // ApiKeyAuth authentication } const response = await this.request({ path: `/namespaces`, method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.ListNamespacesResponseFromJSON)(jsonValue)); } /** * Get a list of all [namespaces](https://docs.pinecone.io/guides/index-data/indexing-overview#namespaces) in a serverless index. Up to 100 namespaces are returned at a time by default, in sorted order (bitwise “C” collation). If the `limit` parameter is set, up to that number of namespaces are returned instead. Whenever there are additional namespaces to return, the response also includes a `pagination_token` that you can use to get the next batch of namespaces. When the response does not include a `pagination_token`, there are no more namespaces to return. * List namespaces */ async listNamespacesOperation(requestParameters = {}, initOverrides) { const response = await this.listNamespacesOperationRaw(requestParameters, initOverrides); return await response.value(); } } exports.NamespaceOperationsApi = NamespaceOperationsApi; //# sourceMappingURL=NamespaceOperationsApi.js.map