Files
chroma/clients/js/package.json
Trayan Azarov 2b434b8266 [ENH]: JS Client Static Token support (#1114)
Refs: #1083

## Description of changes

*Summarize the changes made by this PR.*
 - New functionality
- JS Client now supports Authorization, and X-Chroma-Token auths
supported
         - Tests and integration tests updated

## Test plan
*How are these changes tested?*

- [x] Tests pass locally `yarn test` for js

## Documentation Changes
TBD
2023-09-18 11:30:25 -07:00

92 lines
4.7 KiB
JSON

{
"name": "chromadb",
"version": "1.5.9",
"description": "A JavaScript interface for chroma",
"keywords": [],
"author": "",
"license": "Apache-2.0",
"devDependencies": {
"@openapi-generator-plus/typescript-fetch-client-generator": "^1.5.0",
"@types/jest": "^29.5.0",
"jest": "^29.5.0",
"npm-run-all": "^4.1.5",
"openapi-generator-plus": "^2.6.0",
"prettier": "2.8.7",
"rimraf": "^5.0.0",
"ts-jest": "^29.1.0",
"ts-node": "^10.9.1",
"tsd": "^0.28.1",
"typescript": "^5.0.4"
},
"main": "dist/main/index.js",
"module": "dist/module/index.js",
"exports": {
"require": "./dist/main/index.js",
"import": "./dist/module/index.js"
},
"files": [
"src",
"dist"
],
"scripts": {
"test": "run-s db:clean db:cleanauth db:run test:runfull db:clean db:run-auth test:runfull-authonly db:cleanauth",
"testnoauth": "run-s db:clean db:run test:runfull db:clean",
"testauth": "run-s db:cleanauth db:run-auth test:runfull-authonly db:cleanauth",
"test:set-port": "cross-env URL=localhost:8001",
"test:run": "jest --runInBand --testPathIgnorePatterns=test/auth.*.test.ts",
"test:run-auth-basic": "jest --runInBand --testPathPattern=test/auth.basic.test.ts",
"test:run-auth-token": "jest --runInBand --testPathPattern=test/auth.token.test.ts",
"test:run-auth-xtoken": "XTOKEN_TEST=true jest --runInBand --testPathPattern=test/auth.token.test.ts",
"test:runfull": "PORT=8001 jest --runInBand --testPathIgnorePatterns=test/auth.*.test.ts",
"test:runfull-authonly": "run-s db:run-auth-basic test:runfull-authonly-basic db:clean db:run-auth-token test:runfull-authonly-token db:clean db:run-auth-xtoken test:runfull-authonly-xtoken db:clean",
"test:runfull-authonly-basic": "PORT=8001 jest --runInBand --testPathPattern=test/auth.basic.test.ts",
"test:runfull-authonly-token": "PORT=8001 jest --runInBand --testPathPattern=test/auth.token.test.ts",
"test:runfull-authonly-xtoken": "PORT=8001 XTOKEN_TEST=true jest --runInBand --testPathPattern=test/auth.token.test.ts",
"test:update": "run-s db:clean db:run && jest --runInBand --updateSnapshot && run-s db:clean",
"db:clean": "cd ../.. && CHROMA_PORT=8001 docker-compose -f docker-compose.test.yml down --volumes",
"db:cleanauth": "cd ../.. && CHROMA_PORT=8001 docker-compose -f docker-compose.test-auth.yml down --volumes",
"db:run": "cd ../.. && CHROMA_PORT=8001 docker-compose -f docker-compose.test.yml up --detach && sleep 5",
"db:run-auth-basic": "cd ../.. && docker run --rm --entrypoint htpasswd httpd:2 -Bbn admin admin > server.htpasswd && echo \"CHROMA_SERVER_AUTH_CREDENTIALS_FILE=/chroma/server.htpasswd\\nCHROMA_SERVER_AUTH_CREDENTIALS_PROVIDER=chromadb.auth.providers.HtpasswdFileServerAuthCredentialsProvider\\nCHROMA_SERVER_AUTH_PROVIDER=chromadb.auth.basic.BasicAuthServerProvider\\nCHROMA_PORT=8001\" > .chroma_env && docker-compose -f docker-compose.test-auth.yml --env-file ./.chroma_env up --detach && sleep 5",
"db:run-auth-token": "cd ../.. && echo \"CHROMA_SERVER_AUTH_CREDENTIALS=test-token\nCHROMA_SERVER_AUTH_CREDENTIALS_PROVIDER=chromadb.auth.token.TokenConfigServerAuthCredentialsProvider\nCHROMA_SERVER_AUTH_PROVIDER=chromadb.auth.token.TokenAuthServerProvider\\nCHROMA_PORT=8001\" > .chroma_env && docker-compose -f docker-compose.test-auth.yml --env-file ./.chroma_env up --detach && sleep 5",
"db:run-auth-xtoken": "cd ../.. && echo \"CHROMA_SERVER_AUTH_TOKEN_TRANSPORT_HEADER=X_CHROMA_TOKEN\nCHROMA_SERVER_AUTH_CREDENTIALS=test-token\nCHROMA_SERVER_AUTH_CREDENTIALS_PROVIDER=chromadb.auth.token.TokenConfigServerAuthCredentialsProvider\nCHROMA_SERVER_AUTH_PROVIDER=chromadb.auth.token.TokenAuthServerProvider\\nCHROMA_PORT=8001\" > .chroma_env && docker-compose -f docker-compose.test-auth.yml --env-file ./.chroma_env up --detach && sleep 5",
"clean": "rimraf dist",
"build": "run-s clean build:*",
"build:main": "tsc -p tsconfig.json",
"build:module": "tsc -p tsconfig.module.json",
"genapi": "./genapi.sh",
"prettier": "prettier --write .",
"release": "run-s build test:run && npm publish",
"release_alpha": "run-s build test:run && npm publish --tag alpha"
},
"engines": {
"node": ">=14.17.0"
},
"dependencies": {
"isomorphic-fetch": "^3.0.0"
},
"peerDependencies": {
"@visheratin/web-ai": "^1.0.0",
"@visheratin/web-ai-node": "^1.0.0",
"@xenova/transformers": "^2.0.0",
"cohere-ai": "^6.0.0",
"openai": "^3.0.0 || ^4.0.0"
},
"peerDependenciesMeta": {
"@visheratin/web-ai": {
"optional": true
},
"@visheratin/web-ai-node": {
"optional": true
},
"@xenova/transformers": {
"optional": true
},
"cohere-ai": {
"optional": true
},
"openai": {
"optional": true
}
}
}