Skip to content

Commit

Permalink
remove v0 code paths and references
Browse files Browse the repository at this point in the history
  • Loading branch information
austin-denoble committed Jan 8, 2024
1 parent f7d49d8 commit 6a58199
Show file tree
Hide file tree
Showing 52 changed files with 9 additions and 5,204 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"es2021": true,
"node": true
},
"ignorePatterns": ["dist", "src/pinecone-generated-ts-fetch", "src/v0"],
"ignorePatterns": ["dist", "src/pinecone-generated-ts-fetch"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
Expand Down
3 changes: 1 addition & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
dist
node_modules
src/pinecone-generated-ts-fetch
src/v0
src/pinecone-generated-ts-fetch
5 changes: 0 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ This is the official Node.js client for [Pinecone](https://www.pinecone.io), wri
## Documentation

- [**Reference Documentation**](https://sdk.pinecone.io/typescript/classes/Pinecone.html)
- If you are upgrading from a `v0.x` beta client, check out the [**v1 Migration Guide**](https://github.com/pinecone-io/pinecone-ts-client/blob/main/v1-migration.md).

### Example code

Expand Down Expand Up @@ -629,7 +628,3 @@ If you do not specify a namespace, the records in the default namespace `''` wil
If you are ready to take a JavaScript application to production where raw performance is the overriding concern, you can set the environment variable `PINECONE_DISABLE_RUNTIME_VALIDATIONS="true"` to disable runtime argument validation in the Pinecone client. Runtime validations are used to provide feedback when incorrect method options are provided, for example if you attempt to create an index without specifying a required dimension property.

These runtime validations are most helpful for users who are not developing with Typescript or who are experimenting in a REPL or notebook-type setting. But once you've tested an application and have gained confidence things are working as expected, you can disable these checks to gain a small improvement in performance. This will have the most impact if your workload is upserting very large amounts of data.

## Legacy exports

For information about the legacy `PineconeClient` export, see the [old README](https://github.com/pinecone-io/pinecone-ts-client/blob/main/README.v0.md).
276 changes: 0 additions & 276 deletions README.v0.md

This file was deleted.

1 change: 0 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ module.exports = {
collectCoverageFrom: [
'<rootDir>/src/**/*.ts',
'!**/src/pinecone-generated-ts-fetch/**',
'!**/src/v0/**',
'!**/node_modules/**',
'!**/vendor/**',
],
Expand Down
2 changes: 1 addition & 1 deletion src/control/indexOperationsBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const indexOperationsBuilder = (
apiKey,
queryParamsStringify,
headers: {
'User-Agent': buildUserAgent(false),
'User-Agent': buildUserAgent(),
...headers,
},
fetchApi: getFetch(config),
Expand Down
2 changes: 1 addition & 1 deletion src/data/vectorOperationsProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export class VectorOperationsProvider {
apiKey: this.config.apiKey,
queryParamsStringify,
headers: {
'User-Agent': buildUserAgent(false),
'User-Agent': buildUserAgent(),
},
fetchApi: getFetch(this.config),
middleware,
Expand Down
16 changes: 0 additions & 16 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,3 @@ export type {
IndexList,
IndexModel,
} from './pinecone-generated-ts-fetch';

// Legacy exports for backwards compatibility
export { PineconeClient } from './v0';
export { utils } from './v0/utils';
export {
CreateCollectionRequest as CreateCollectionRequestV0,
CreateRequest,
DeleteRequest,
PatchRequest,
QueryRequest,
QueryVector,
ScoredVector,
UpdateRequest,
UpsertRequest,
Vector,
} from './v0/pinecone-generated-ts-fetch';
6 changes: 1 addition & 5 deletions src/utils/user-agent.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { isEdge } from './environment';
import * as packageInfo from '../version.json';

export const buildUserAgent = (isLegacy: boolean) => {
export const buildUserAgent = () => {
// We always want to include the package name and version
// along with the langauge name to help distinguish these
// requests from those emitted by other clients
Expand All @@ -24,9 +24,5 @@ export const buildUserAgent = (isLegacy: boolean) => {
userAgentParts.push(`node ${process.version}`);
}

// Use this flag to identify whether they are using the v0 legacy
// client export called PineconeClient
userAgentParts.push(`legacyExport=${isLegacy}`);

return userAgentParts.join('; ');
};
Loading

0 comments on commit 6a58199

Please sign in to comment.