Skip to content

Commit 6e97b17

Browse files
authored
Merge pull request #3 from pinecone-io/initial-updates
Initial updates
2 parents 2c2088a + b33023b commit 6e97b17

File tree

3,510 files changed

+2562
-999719
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,510 files changed

+2562
-999719
lines changed

.gitignore

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Node modules
2+
node_modules/
3+
4+
# Logs
5+
logs
6+
*.log
7+
npm-debug.log*
8+
yarn-debug.log*
9+
yarn-error.log*
10+
pnpm-debug.log*
11+
12+
# Runtime data
13+
pids
14+
*.pid
15+
*.seed
16+
*.pid.lock
17+
18+
# Directory for instrumented libs generated by jscoverage/JSCover
19+
lib-cov
20+
21+
# Coverage directory used by tools like istanbul
22+
coverage/
23+
24+
# nyc test coverage
25+
.nyc_output/
26+
27+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
28+
.grunt/
29+
30+
# Bower dependency directory (https://bower.io/)
31+
bower_components/
32+
33+
# Compiled binary addons (https://nodejs.org/api/addons.html)
34+
build/Release
35+
build/
36+
37+
# Dependency directories
38+
dist/
39+
.tmp/
40+
41+
tmp/
42+
temp/
43+
44+
# Optional npm cache directory
45+
.npm
46+
47+
# Optional eslint cache
48+
.eslintcache
49+
50+
# dotenv environment variables file
51+
.env
52+
.env.test
53+
.env.*.local
54+
55+
# Mac system files
56+
.DS_Store
57+
58+
# VSCode settings
59+
.vscode/
60+
61+
# TypeScript cache
62+
*.tsbuildinfo
63+
64+
# Jest coverage
65+
jest-coverage/
66+
67+
# Zapier platform cache
68+
.zapier-platform-cache/

README.md

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,25 @@
1-
# Pinecone
1+
# Pinecone Zapier Integration
22

33
## Prerequisites
44

55
- Set up your environment as described in the [root level README](../../README.md#setup).
6-
- Zapier staff only: Add yourself as a collaborator [here](https://zapier.com/app/developer/app/226171/team), and accept the email invitation. This will grant you write access to the app.
6+
- Pinecone personnel: Ensure you have access to this repository and the necessary credentials for local development.
77

88
## Development
99

10-
1. From the root of the repository, navigate to your app directory `cd apps/pinecone`
11-
2. `npm install` to install dependencies from npm (don't forget to commit the generated `package-lock.json`).
12-
3. Make your app changes.
13-
4. `zapier test` to run unit tests. Note: These should not make live API calls.
14-
5. Bump the version in package.json. Use [SemVer](http://semver.org/) for versioning.
15-
6. Fill in a [changelog](CHANGELOG.md) entry for your new version.
16-
7. Open an MR on gitlab and follow the [test and deploy instructions](../../README.md#testing-and-deploying)
10+
1. From the root of the repository, navigate to your app directory: `cd apps/pinecone` (or the appropriate path).
11+
2. Run `npm install` to install dependencies (commit the generated `package-lock.json`).
12+
3. Make your app changes as needed.
13+
4. Run `npm test` (or `vitest`) to execute unit tests. These tests use mocks and do not make live API calls.
14+
5. Bump the version in `package.json` using [SemVer](http://semver.org/) for versioning.
15+
6. Add a [changelog](CHANGELOG.md) entry for your new version.
16+
7. Open a pull request and follow the [test and deploy instructions](../../README.md#testing-and-deploying).
1717

18-
## Test Accounts
18+
## Local Testing
1919

20-
- When testing in the Zap Editor, use API key found in 1Password (linked to `[email protected]` username)
21-
22-
<!-- Include any API links that would be useful -->
20+
- When running or developing locally, use your own Pinecone API key for any manual API tests. Do not commit or share API keys.
21+
- All automated tests are fully mocked and do not require a live Pinecone account.
2322

2423
## API Links
2524

26-
- https://docs.pinecone.io/reference/api/introduction
25+
- [Pinecone API Reference](https://docs.pinecone.io/reference/api/introduction)

SECURITY.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Security Policy
2+
3+
## Known Vulnerabilities
4+
5+
This project currently has known vulnerabilities in transitive dependencies, as reported by automated tools (e.g., Dependabot, npm audit). These vulnerabilities are present due to requirements of upstream dependencies and cannot be resolved directly within this project at this time.
6+
7+
### 1. `crypto-js` (Critical)
8+
9+
- **Advisories:**
10+
- [GHSA-xwcq-pm8m-c4vf](https://github.com/advisories/GHSA-xwcq-pm8m-c4vf) (PBKDF2 much weaker than standard)
11+
- [GHSA-3w3w-pxmm-2w2j](https://github.com/advisories/GHSA-3w3w-pxmm-2w2j) (Insecure random numbers)
12+
- **Origin:**
13+
- `crypto-js` is a transitive dependency of `zapier-platform-core` via `fernet`.
14+
- This project does **not** use `crypto-js` directly.
15+
- **Mitigation:**
16+
- Do not use `crypto-js` directly in your own code.
17+
- Monitor for updates to `zapier-platform-core` and `fernet` that address these vulnerabilities.
18+
- If you are forking or extending this project, avoid introducing direct usage of `crypto-js`.
19+
20+
### 2. `esbuild` (Moderate, Development)
21+
22+
- **Advisory:**
23+
- [GHSA-67mh-4wv8-2f99](https://github.com/advisories/GHSA-67mh-4wv8-2f99)
24+
- **Origin:**
25+
- `esbuild` is a transitive dependency of dev tools such as `vite` and `vitest`.
26+
- This project does **not** use `esbuild` directly in production code.
27+
- **Mitigation:**
28+
- Only affects development environments. Do not expose dev servers to untrusted networks.
29+
- Monitor for updates to `vite`, `vitest`, and related tools.
30+
31+
### 3. `brace-expansion` (Low, Development)
32+
33+
- **Advisory:**
34+
- [GHSA-xg9f-g7g7-2323](https://github.com/advisories/GHSA-xg9f-g7g7-2323)
35+
- **Origin:**
36+
- Used by dev dependencies only.
37+
- **Mitigation:**
38+
- Only affects development environments. Monitor for updates to dev tools.
39+
40+
## General Guidance
41+
42+
- **Do not use vulnerable packages directly** in your own code.
43+
- **Monitor upstream dependencies** (`zapier-platform-core`, `fernet`, `vite`, `vitest`, etc.) for security updates.
44+
- **Update this project** as soon as upstream fixes are available.
45+
- **Document these issues** for your team and users.
46+
47+
## Reporting a Vulnerability
48+
49+
If you discover a security issue in this project, please open an issue or contact the maintainers. If the issue is in an upstream dependency, consider reporting it to the relevant project as well.
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
import { vi } from 'vitest';
2+
3+
type PineconeMockState = {
4+
inference: {
5+
embed: ReturnType<typeof vi.fn>;
6+
getModel: ReturnType<typeof vi.fn>;
7+
listModels: ReturnType<typeof vi.fn>;
8+
rerank: ReturnType<typeof vi.fn>;
9+
};
10+
describeIndex: ReturnType<typeof vi.fn>;
11+
listIndexes: ReturnType<typeof vi.fn>;
12+
index: ReturnType<typeof vi.fn>;
13+
configureIndex: ReturnType<typeof vi.fn>;
14+
};
15+
16+
const pineconeMockState: PineconeMockState = {
17+
inference: {
18+
embed: vi.fn(),
19+
getModel: vi.fn(),
20+
listModels: vi.fn(),
21+
rerank: vi.fn(),
22+
},
23+
describeIndex: vi.fn(),
24+
listIndexes: vi.fn(),
25+
index: vi.fn(),
26+
configureIndex: vi.fn(),
27+
};
28+
29+
// Helper: always return an object with namespace() for index()
30+
function createIndexMock(namespaceImpl?: any) {
31+
return vi.fn().mockImplementation(() => ({
32+
namespace: namespaceImpl || vi.fn()
33+
}));
34+
}
35+
36+
export class Pinecone {
37+
constructor() {}
38+
get inference() {
39+
return {
40+
embed: pineconeMockState.inference.embed,
41+
getModel: pineconeMockState.inference.getModel,
42+
listModels: pineconeMockState.inference.listModels,
43+
rerank: pineconeMockState.inference.rerank,
44+
};
45+
}
46+
describeIndex = pineconeMockState.describeIndex;
47+
listIndexes = pineconeMockState.listIndexes;
48+
index = (...args: any[]) => {
49+
// If the test set a custom index mock, use it
50+
if (typeof pineconeMockState.index === 'function') {
51+
const result = pineconeMockState.index(...args);
52+
// If the result has a namespace function, return as is
53+
if (result && typeof result.namespace === 'function') return result;
54+
}
55+
// Default: return an object with a namespace function that returns an object with upsert/update/deleteOne mocks
56+
return {
57+
namespace: vi.fn().mockReturnValue({
58+
upsert: vi.fn(),
59+
upsertRecords: vi.fn(),
60+
update: vi.fn(),
61+
deleteOne: vi.fn(),
62+
})
63+
};
64+
};
65+
configureIndex = pineconeMockState.configureIndex;
66+
}
67+
68+
export function __setPineconeMockState(newState: Partial<PineconeMockState>) {
69+
Object.assign(pineconeMockState, newState);
70+
}
71+
export function __getPineconeMockState() {
72+
return pineconeMockState;
73+
}

node_modules/.bin/esbuild

Lines changed: 0 additions & 1 deletion
This file was deleted.

node_modules/.bin/glob

Lines changed: 0 additions & 1 deletion
This file was deleted.

node_modules/.bin/nanoid

Lines changed: 0 additions & 1 deletion
This file was deleted.

node_modules/.bin/node-which

Lines changed: 0 additions & 1 deletion
This file was deleted.

node_modules/.bin/rimraf

Lines changed: 0 additions & 1 deletion
This file was deleted.

node_modules/.bin/rollup

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)