@upstash/vector 1.1.2 → 1.1.3-canary.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{index.mjs → chunk-HLW45HVB.mjs} +1 -1
- package/dist/cloudflare.d.mts +60 -0
- package/dist/cloudflare.d.ts +60 -0
- package/dist/cloudflare.js +1 -0
- package/dist/cloudflare.mjs +1 -0
- package/dist/nodejs.d.mts +78 -0
- package/dist/nodejs.d.ts +78 -0
- package/dist/{index.js → nodejs.js} +1 -1
- package/dist/nodejs.mjs +1 -0
- package/dist/{index.d.mts → vector-fCHAzBG_.d.mts} +2 -72
- package/dist/{index.d.ts → vector-fCHAzBG_.d.ts} +2 -72
- package/package.json +66 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
var i=class extends Error{constructor(e){super(e),this.name="UpstashError"}};var
|
|
1
|
+
var i=class extends Error{constructor(e){super(e),this.name="UpstashError"}};var M=class{baseUrl;headers;options;retry;constructor(e){this.options={cache:e.cache,signal:e.signal},this.baseUrl=e.baseUrl.replace(/\/$/,""),this.headers={"Content-Type":"application/json",...e.headers},typeof e?.retry=="boolean"&&e?.retry===!1?this.retry={attempts:1,backoff:()=>0}:this.retry={attempts:e?.retry?.retries??5,backoff:e?.retry?.backoff??(t=>Math.exp(t)*50)}}async request(e){let t={cache:this.options.cache,method:"POST",headers:this.headers,body:JSON.stringify(e.body),keepalive:!0,signal:this.options.signal},a=null,o=null;for(let g=0;g<=this.retry.attempts;g++)try{a=await fetch([this.baseUrl,...e.path??[]].join("/"),t);break}catch(b){if(this.options.signal?.aborted){let T=new Blob([JSON.stringify({result:this.options.signal.reason??"Aborted"})]),R={status:200,statusText:this.options.signal.reason??"Aborted"};a=new Response(T,R);break}o=b,await new Promise(T=>setTimeout(T,this.retry.backoff(g)))}if(!a)throw o??new Error("Exhausted all retries");let s=await a.json();if(!a.ok)throw new i(`${s.error}`);return{result:s.result,error:s.error}}};var n=class{payload;endpoint;constructor(e,t){this.payload=e,this.endpoint=t}async exec(e){let{result:t,error:a}=await e.request({body:this.payload,path:[this.endpoint]});if(a)throw new i(a);if(typeof t>"u")throw new Error("Request did not return a result");return t}};var p=class extends n{constructor(e,t){let a="delete";t?.namespace&&(a=`${a}/${t.namespace}`);let o=[];Array.isArray(e)?o.push(...e):o.push(e),super(o,a)}};var d=class extends n{constructor(e,t){let a="query";"data"in e&&(a="query-data"),t?.namespace&&(a=`${a}/${t.namespace}`),super(e,a)}};var m=class extends n{constructor(e,t){let a="upsert";if(Array.isArray(e)){if(e.some(s=>"data"in s&&s.data)){a="upsert-data";for(let s of e)!("metadata"in s)&&"data"in s&&(s.metadata={data:s.data})}}else"data"in e&&(a="upsert-data","metadata"in e||(e.metadata={data:e.data}));t?.namespace&&(a=`${a}/${t.namespace}`),super(e,a)}};var c=class extends n{constructor([e,t]){let a="fetch";t?.namespace&&(a=`${a}/${t.namespace}`,delete t.namespace),super({ids:e,...t},a)}};var l=class extends n{constructor(e,t){let a="range";t?.namespace&&(a=`${a}/${t.namespace}`),super(e,a)}};var u=class extends n{constructor(e){let t="reset";e?.namespace&&(t=`${t}/${e.namespace}`),super([],t)}};var f=class extends n{constructor(){super([],"info")}};var h=class{client;namespace;constructor(e,t){this.client=e,this.namespace=t}upsert=e=>new m(e,{namespace:this.namespace}).exec(this.client);update=e=>new y(e,{namespace:this.namespace}).exec(this.client);fetch=(...e)=>(e[1]?e[1].namespace=this.namespace:e[1]={namespace:this.namespace},new c(e).exec(this.client));query=e=>new d(e,{namespace:this.namespace}).exec(this.client);delete=e=>new p(e,{namespace:this.namespace}).exec(this.client);range=e=>new l(e,{namespace:this.namespace}).exec(this.client);reset=()=>new u({namespace:this.namespace}).exec(this.client)};var y=class extends n{constructor(e,t){let a="update";t?.namespace&&(a=`${a}/${t.namespace}`),super(e,a)}};var C=class extends n{constructor(){super([],"list-namespaces")}};var x=class extends n{constructor(e){let t=`delete-namespace/${e}`;super([],t)}};var E=class{client;constructor(e){this.client=e}namespace=e=>new h(this.client,e);delete=(e,t)=>new p(e,t).exec(this.client);query=(e,t)=>new d(e,t).exec(this.client);upsert=(e,t)=>new m(e,t).exec(this.client);update=(e,t)=>new y(e,t).exec(this.client);fetch=(...e)=>new c(e).exec(this.client);reset=e=>new u(e).exec(this.client);range=(e,t)=>new l(e,t).exec(this.client);info=()=>new f().exec(this.client);listNamespaces=()=>new C().exec(this.client);deleteNamespace=e=>new x(e).exec(this.client)};export{M as a,E as b};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { R as RequesterConfig, D as Dict, I as Index$1 } from './vector-fCHAzBG_.mjs';
|
|
2
|
+
export { F as FetchResult, d as InfoResult, Q as QueryResult, c as RangeResult, a as Requester, U as UpstashRequest, b as UpstashResponse, V as Vector } from './vector-fCHAzBG_.mjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Connection credentials for upstash vector.
|
|
6
|
+
* Get them from https://console.upstash.com/vector/<uuid>
|
|
7
|
+
*/
|
|
8
|
+
type IndexConfig = {
|
|
9
|
+
/**
|
|
10
|
+
* UPSTASH_VECTOR_REST_URL
|
|
11
|
+
*/
|
|
12
|
+
url?: string;
|
|
13
|
+
/**
|
|
14
|
+
* UPSTASH_VECTOR_REST_TOKEN
|
|
15
|
+
*/
|
|
16
|
+
token?: string;
|
|
17
|
+
/**
|
|
18
|
+
* The signal will allow aborting requests on the fly.
|
|
19
|
+
* For more check: https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal
|
|
20
|
+
*/
|
|
21
|
+
signal?: AbortSignal;
|
|
22
|
+
} & RequesterConfig;
|
|
23
|
+
/**
|
|
24
|
+
* Serverless vector client for upstash.
|
|
25
|
+
*/
|
|
26
|
+
declare class Index<TIndexMetadata extends Dict = Dict> extends Index$1<TIndexMetadata> {
|
|
27
|
+
/**
|
|
28
|
+
* Create a new vector client by providing the url and token
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```typescript
|
|
32
|
+
* const index = new Index({
|
|
33
|
+
* url: "<UPSTASH_VECTOR_REST_URL>",
|
|
34
|
+
* token: "<UPSTASH_VECTOR_REST_TOKEN>",
|
|
35
|
+
* });
|
|
36
|
+
* ```
|
|
37
|
+
* OR
|
|
38
|
+
* This will automatically get environment variables from .env file
|
|
39
|
+
* ```typescript
|
|
40
|
+
* const index = new Index();
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
constructor(config?: IndexConfig);
|
|
44
|
+
/**
|
|
45
|
+
* Create a new Upstash Vector instance from environment variables.
|
|
46
|
+
*
|
|
47
|
+
* Use this to automatically load connection secrets from your environment
|
|
48
|
+
* variables. For instance when using the Vercel integration.
|
|
49
|
+
*
|
|
50
|
+
* When used on the Cloudflare Workers, you can just pass the "env" context provided by Cloudflare.
|
|
51
|
+
* Else, this tries to load `UPSTASH_VECTOR_REST_URL` and `UPSTASH_VECTOR_REST_TOKEN` from
|
|
52
|
+
* your environment using `process.env`.
|
|
53
|
+
*/
|
|
54
|
+
static fromEnv(env?: {
|
|
55
|
+
UPSTASH_VECTOR_REST_URL: string;
|
|
56
|
+
UPSTASH_VECTOR_REST_TOKEN: string;
|
|
57
|
+
}, config?: Omit<IndexConfig, "url" | "token">): Index;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export { Index, type IndexConfig };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { R as RequesterConfig, D as Dict, I as Index$1 } from './vector-fCHAzBG_.js';
|
|
2
|
+
export { F as FetchResult, d as InfoResult, Q as QueryResult, c as RangeResult, a as Requester, U as UpstashRequest, b as UpstashResponse, V as Vector } from './vector-fCHAzBG_.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Connection credentials for upstash vector.
|
|
6
|
+
* Get them from https://console.upstash.com/vector/<uuid>
|
|
7
|
+
*/
|
|
8
|
+
type IndexConfig = {
|
|
9
|
+
/**
|
|
10
|
+
* UPSTASH_VECTOR_REST_URL
|
|
11
|
+
*/
|
|
12
|
+
url?: string;
|
|
13
|
+
/**
|
|
14
|
+
* UPSTASH_VECTOR_REST_TOKEN
|
|
15
|
+
*/
|
|
16
|
+
token?: string;
|
|
17
|
+
/**
|
|
18
|
+
* The signal will allow aborting requests on the fly.
|
|
19
|
+
* For more check: https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal
|
|
20
|
+
*/
|
|
21
|
+
signal?: AbortSignal;
|
|
22
|
+
} & RequesterConfig;
|
|
23
|
+
/**
|
|
24
|
+
* Serverless vector client for upstash.
|
|
25
|
+
*/
|
|
26
|
+
declare class Index<TIndexMetadata extends Dict = Dict> extends Index$1<TIndexMetadata> {
|
|
27
|
+
/**
|
|
28
|
+
* Create a new vector client by providing the url and token
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```typescript
|
|
32
|
+
* const index = new Index({
|
|
33
|
+
* url: "<UPSTASH_VECTOR_REST_URL>",
|
|
34
|
+
* token: "<UPSTASH_VECTOR_REST_TOKEN>",
|
|
35
|
+
* });
|
|
36
|
+
* ```
|
|
37
|
+
* OR
|
|
38
|
+
* This will automatically get environment variables from .env file
|
|
39
|
+
* ```typescript
|
|
40
|
+
* const index = new Index();
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
constructor(config?: IndexConfig);
|
|
44
|
+
/**
|
|
45
|
+
* Create a new Upstash Vector instance from environment variables.
|
|
46
|
+
*
|
|
47
|
+
* Use this to automatically load connection secrets from your environment
|
|
48
|
+
* variables. For instance when using the Vercel integration.
|
|
49
|
+
*
|
|
50
|
+
* When used on the Cloudflare Workers, you can just pass the "env" context provided by Cloudflare.
|
|
51
|
+
* Else, this tries to load `UPSTASH_VECTOR_REST_URL` and `UPSTASH_VECTOR_REST_TOKEN` from
|
|
52
|
+
* your environment using `process.env`.
|
|
53
|
+
*/
|
|
54
|
+
static fromEnv(env?: {
|
|
55
|
+
UPSTASH_VECTOR_REST_URL: string;
|
|
56
|
+
UPSTASH_VECTOR_REST_TOKEN: string;
|
|
57
|
+
}, config?: Omit<IndexConfig, "url" | "token">): Index;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export { Index, type IndexConfig };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var M=Object.defineProperty;var U=Object.getOwnPropertyDescriptor;var P=Object.getOwnPropertyNames;var w=Object.prototype.hasOwnProperty;var _=(n,e)=>{for(var t in e)M(n,t,{get:e[t],enumerable:!0})},N=(n,e,t,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of P(e))!w.call(n,s)&&s!==t&&M(n,s,{get:()=>e[s],enumerable:!(a=U(e,s))||a.enumerable});return n};var V=n=>N(M({},"__esModule",{value:!0}),n);var D={};_(D,{Index:()=>S});module.exports=V(D);var i=class extends Error{constructor(e){super(e),this.name="UpstashError"}};var f=class{baseUrl;headers;options;retry;constructor(e){this.options={cache:e.cache,signal:e.signal},this.baseUrl=e.baseUrl.replace(/\/$/,""),this.headers={"Content-Type":"application/json",...e.headers},typeof e?.retry=="boolean"&&e?.retry===!1?this.retry={attempts:1,backoff:()=>0}:this.retry={attempts:e?.retry?.retries??5,backoff:e?.retry?.backoff??(t=>Math.exp(t)*50)}}async request(e){let t={cache:this.options.cache,method:"POST",headers:this.headers,body:JSON.stringify(e.body),keepalive:!0,signal:this.options.signal},a=null,s=null;for(let g=0;g<=this.retry.attempts;g++)try{a=await fetch([this.baseUrl,...e.path??[]].join("/"),t);break}catch(b){if(this.options.signal?.aborted){let x=new Blob([JSON.stringify({result:this.options.signal.reason??"Aborted"})]),A={status:200,statusText:this.options.signal.reason??"Aborted"};a=new Response(x,A);break}s=b,await new Promise(x=>setTimeout(x,this.retry.backoff(g)))}if(!a)throw s??new Error("Exhausted all retries");let o=await a.json();if(!a.ok)throw new i(`${o.error}`);return{result:o.result,error:o.error}}};var r=class{payload;endpoint;constructor(e,t){this.payload=e,this.endpoint=t}async exec(e){let{result:t,error:a}=await e.request({body:this.payload,path:[this.endpoint]});if(a)throw new i(a);if(typeof t>"u")throw new Error("Request did not return a result");return t}};var p=class extends r{constructor(e,t){let a="delete";t?.namespace&&(a=`${a}/${t.namespace}`);let s=[];Array.isArray(e)?s.push(...e):s.push(e),super(s,a)}};var d=class extends r{constructor(e,t){let a="query";"data"in e&&(a="query-data"),t?.namespace&&(a=`${a}/${t.namespace}`),super(e,a)}};var m=class extends r{constructor(e,t){let a="upsert";if(Array.isArray(e)){if(e.some(o=>"data"in o&&o.data)){a="upsert-data";for(let o of e)!("metadata"in o)&&"data"in o&&(o.metadata={data:o.data})}}else"data"in e&&(a="upsert-data","metadata"in e||(e.metadata={data:e.data}));t?.namespace&&(a=`${a}/${t.namespace}`),super(e,a)}};var c=class extends r{constructor([e,t]){let a="fetch";t?.namespace&&(a=`${a}/${t.namespace}`,delete t.namespace),super({ids:e,...t},a)}};var l=class extends r{constructor(e,t){let a="range";t?.namespace&&(a=`${a}/${t.namespace}`),super(e,a)}};var u=class extends r{constructor(e){let t="reset";e?.namespace&&(t=`${t}/${e.namespace}`),super([],t)}};var y=class extends r{constructor(){super([],"info")}};var C=class{client;namespace;constructor(e,t){this.client=e,this.namespace=t}upsert=e=>new m(e,{namespace:this.namespace}).exec(this.client);update=e=>new T(e,{namespace:this.namespace}).exec(this.client);fetch=(...e)=>(e[1]?e[1].namespace=this.namespace:e[1]={namespace:this.namespace},new c(e).exec(this.client));query=e=>new d(e,{namespace:this.namespace}).exec(this.client);delete=e=>new p(e,{namespace:this.namespace}).exec(this.client);range=e=>new l(e,{namespace:this.namespace}).exec(this.client);reset=()=>new u({namespace:this.namespace}).exec(this.client)};var T=class extends r{constructor(e,t){let a="update";t?.namespace&&(a=`${a}/${t.namespace}`),super(e,a)}};var E=class extends r{constructor(){super([],"list-namespaces")}};var h=class extends r{constructor(e){let t=`delete-namespace/${e}`;super([],t)}};var R=class{client;constructor(e){this.client=e}namespace=e=>new C(this.client,e);delete=(e,t)=>new p(e,t).exec(this.client);query=(e,t)=>new d(e,t).exec(this.client);upsert=(e,t)=>new m(e,t).exec(this.client);update=(e,t)=>new T(e,t).exec(this.client);fetch=(...e)=>new c(e).exec(this.client);reset=e=>new u(e).exec(this.client);range=(e,t)=>new l(e,t).exec(this.client);info=()=>new y().exec(this.client);listNamespaces=()=>new E().exec(this.client);deleteNamespace=e=>new h(e).exec(this.client)};var S=class n extends R{constructor(e){let t=e?.token??process.env.NEXT_PUBLIC_UPSTASH_VECTOR_REST_TOKEN??process.env.UPSTASH_VECTOR_REST_TOKEN,a=e?.url??process.env.NEXT_PUBLIC_UPSTASH_VECTOR_REST_URL??process.env.UPSTASH_VECTOR_REST_URL;if(!t)throw new Error("UPSTASH_VECTOR_REST_TOKEN is missing!");if(!a)throw new Error("UPSTASH_VECTOR_REST_URL is missing!");(a.startsWith(" ")||a.endsWith(" ")||/\r|\n/.test(a))&&console.warn("The vector url contains whitespace or newline, which can cause errors!"),(t.startsWith(" ")||t.endsWith(" ")||/\r|\n/.test(t))&&console.warn("The vector token contains whitespace or newline, which can cause errors!");let s=new f({baseUrl:a,retry:e?.retry,headers:{authorization:`Bearer ${t}`},signal:e?.signal});super(s)}static fromEnv(e,t){let a,s;if(e){if(a=e.UPSTASH_VECTOR_REST_URL,!a)throw new Error("Unable to find environment variable: `UPSTASH_VECTOR_REST_URL`. Please add it via `wrangler secret put UPSTASH_VECTOR_REST_URL`");if(s=e.UPSTASH_VECTOR_REST_TOKEN,!s)throw new Error("Unable to find environment variable: `UPSTASH_VECTOR_REST_TOKEN`. Please add it via `wrangler secret put UPSTASH_VECTOR_REST_TOKEN`")}else{if(a=process?.env.UPSTASH_VECTOR_REST_URL,!a)throw new Error("Unable to find environment variable: `UPSTASH_VECTOR_REST_URL`");if(s=process?.env.UPSTASH_VECTOR_REST_TOKEN,!s)throw new Error("Unable to find environment variable: `UPSTASH_VECTOR_REST_TOKEN`")}return new n({...t,url:a,token:s})}};0&&(module.exports={Index});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as s,b as o}from"./chunk-HLW45HVB.mjs";var i=class T extends o{constructor(r){let t=r?.token??process.env.NEXT_PUBLIC_UPSTASH_VECTOR_REST_TOKEN??process.env.UPSTASH_VECTOR_REST_TOKEN,e=r?.url??process.env.NEXT_PUBLIC_UPSTASH_VECTOR_REST_URL??process.env.UPSTASH_VECTOR_REST_URL;if(!t)throw new Error("UPSTASH_VECTOR_REST_TOKEN is missing!");if(!e)throw new Error("UPSTASH_VECTOR_REST_URL is missing!");(e.startsWith(" ")||e.endsWith(" ")||/\r|\n/.test(e))&&console.warn("The vector url contains whitespace or newline, which can cause errors!"),(t.startsWith(" ")||t.endsWith(" ")||/\r|\n/.test(t))&&console.warn("The vector token contains whitespace or newline, which can cause errors!");let n=new s({baseUrl:e,retry:r?.retry,headers:{authorization:`Bearer ${t}`},signal:r?.signal});super(n)}static fromEnv(r,t){let e,n;if(r){if(e=r.UPSTASH_VECTOR_REST_URL,!e)throw new Error("Unable to find environment variable: `UPSTASH_VECTOR_REST_URL`. Please add it via `wrangler secret put UPSTASH_VECTOR_REST_URL`");if(n=r.UPSTASH_VECTOR_REST_TOKEN,!n)throw new Error("Unable to find environment variable: `UPSTASH_VECTOR_REST_TOKEN`. Please add it via `wrangler secret put UPSTASH_VECTOR_REST_TOKEN`")}else{if(e=process?.env.UPSTASH_VECTOR_REST_URL,!e)throw new Error("Unable to find environment variable: `UPSTASH_VECTOR_REST_URL`");if(n=process?.env.UPSTASH_VECTOR_REST_TOKEN,!n)throw new Error("Unable to find environment variable: `UPSTASH_VECTOR_REST_TOKEN`")}return new T({...t,url:e,token:n})}};export{i as Index};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { R as RequesterConfig, D as Dict, I as Index$1, a as Requester } from './vector-fCHAzBG_.mjs';
|
|
2
|
+
export { F as FetchResult, d as InfoResult, Q as QueryResult, c as RangeResult, U as UpstashRequest, b as UpstashResponse, V as Vector } from './vector-fCHAzBG_.mjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Connection credentials for upstash vector.
|
|
6
|
+
* Get them from https://console.upstash.com/vector/<uuid>
|
|
7
|
+
*/
|
|
8
|
+
type IndexConfig = {
|
|
9
|
+
/**
|
|
10
|
+
* UPSTASH_VECTOR_REST_URL
|
|
11
|
+
*/
|
|
12
|
+
url?: string;
|
|
13
|
+
/**
|
|
14
|
+
* UPSTASH_VECTOR_REST_TOKEN
|
|
15
|
+
*/
|
|
16
|
+
token?: string;
|
|
17
|
+
/**
|
|
18
|
+
* The signal will allow aborting requests on the fly.
|
|
19
|
+
* For more check: https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal
|
|
20
|
+
*/
|
|
21
|
+
signal?: AbortSignal;
|
|
22
|
+
} & RequesterConfig;
|
|
23
|
+
/**
|
|
24
|
+
* Serverless vector client for upstash.
|
|
25
|
+
*/
|
|
26
|
+
declare class Index<TIndexMetadata extends Dict = Dict> extends Index$1<TIndexMetadata> {
|
|
27
|
+
/**
|
|
28
|
+
* Create a new vector client by providing the url and token
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```typescript
|
|
32
|
+
* const index = new Index({
|
|
33
|
+
* url: "<UPSTASH_VECTOR_REST_URL>",
|
|
34
|
+
* token: "<UPSTASH_VECTOR_REST_TOKEN>",
|
|
35
|
+
* });
|
|
36
|
+
* ```
|
|
37
|
+
* OR
|
|
38
|
+
* This will automatically get environment variables from .env file
|
|
39
|
+
* ```typescript
|
|
40
|
+
* const index = new Index();
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
constructor(config?: IndexConfig);
|
|
44
|
+
/**
|
|
45
|
+
* Create a new vector client by providing a custom `Requester` implementation
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```ts
|
|
49
|
+
*
|
|
50
|
+
* import { UpstashRequest, Requester, UpstashResponse, vector } from "@upstash/vector"
|
|
51
|
+
*
|
|
52
|
+
* const requester: Requester = {
|
|
53
|
+
* request: <TResult>(req: UpstashRequest): Promise<UpstashResponse<TResult>> => {
|
|
54
|
+
* // ...
|
|
55
|
+
* }
|
|
56
|
+
* }
|
|
57
|
+
*
|
|
58
|
+
* const vector = new vector(requester)
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
constructor(requesters?: Requester);
|
|
62
|
+
/**
|
|
63
|
+
* Create a new Upstash Vector instance from environment variables.
|
|
64
|
+
*
|
|
65
|
+
* Use this to automatically load connection secrets from your environment
|
|
66
|
+
* variables. For instance when using the Vercel integration.
|
|
67
|
+
*
|
|
68
|
+
* When used on the Cloudflare Workers, you can just pass the "env" context provided by Cloudflare.
|
|
69
|
+
* Else, this tries to load `UPSTASH_VECTOR_REST_URL` and `UPSTASH_VECTOR_REST_TOKEN` from
|
|
70
|
+
* your environment using `process.env`.
|
|
71
|
+
*/
|
|
72
|
+
static fromEnv(env?: {
|
|
73
|
+
UPSTASH_VECTOR_REST_URL: string;
|
|
74
|
+
UPSTASH_VECTOR_REST_TOKEN: string;
|
|
75
|
+
}, config?: Omit<IndexConfig, "url" | "token">): Index;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export { Index, type IndexConfig, Requester };
|
package/dist/nodejs.d.ts
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { R as RequesterConfig, D as Dict, I as Index$1, a as Requester } from './vector-fCHAzBG_.js';
|
|
2
|
+
export { F as FetchResult, d as InfoResult, Q as QueryResult, c as RangeResult, U as UpstashRequest, b as UpstashResponse, V as Vector } from './vector-fCHAzBG_.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Connection credentials for upstash vector.
|
|
6
|
+
* Get them from https://console.upstash.com/vector/<uuid>
|
|
7
|
+
*/
|
|
8
|
+
type IndexConfig = {
|
|
9
|
+
/**
|
|
10
|
+
* UPSTASH_VECTOR_REST_URL
|
|
11
|
+
*/
|
|
12
|
+
url?: string;
|
|
13
|
+
/**
|
|
14
|
+
* UPSTASH_VECTOR_REST_TOKEN
|
|
15
|
+
*/
|
|
16
|
+
token?: string;
|
|
17
|
+
/**
|
|
18
|
+
* The signal will allow aborting requests on the fly.
|
|
19
|
+
* For more check: https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal
|
|
20
|
+
*/
|
|
21
|
+
signal?: AbortSignal;
|
|
22
|
+
} & RequesterConfig;
|
|
23
|
+
/**
|
|
24
|
+
* Serverless vector client for upstash.
|
|
25
|
+
*/
|
|
26
|
+
declare class Index<TIndexMetadata extends Dict = Dict> extends Index$1<TIndexMetadata> {
|
|
27
|
+
/**
|
|
28
|
+
* Create a new vector client by providing the url and token
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```typescript
|
|
32
|
+
* const index = new Index({
|
|
33
|
+
* url: "<UPSTASH_VECTOR_REST_URL>",
|
|
34
|
+
* token: "<UPSTASH_VECTOR_REST_TOKEN>",
|
|
35
|
+
* });
|
|
36
|
+
* ```
|
|
37
|
+
* OR
|
|
38
|
+
* This will automatically get environment variables from .env file
|
|
39
|
+
* ```typescript
|
|
40
|
+
* const index = new Index();
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
constructor(config?: IndexConfig);
|
|
44
|
+
/**
|
|
45
|
+
* Create a new vector client by providing a custom `Requester` implementation
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```ts
|
|
49
|
+
*
|
|
50
|
+
* import { UpstashRequest, Requester, UpstashResponse, vector } from "@upstash/vector"
|
|
51
|
+
*
|
|
52
|
+
* const requester: Requester = {
|
|
53
|
+
* request: <TResult>(req: UpstashRequest): Promise<UpstashResponse<TResult>> => {
|
|
54
|
+
* // ...
|
|
55
|
+
* }
|
|
56
|
+
* }
|
|
57
|
+
*
|
|
58
|
+
* const vector = new vector(requester)
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
constructor(requesters?: Requester);
|
|
62
|
+
/**
|
|
63
|
+
* Create a new Upstash Vector instance from environment variables.
|
|
64
|
+
*
|
|
65
|
+
* Use this to automatically load connection secrets from your environment
|
|
66
|
+
* variables. For instance when using the Vercel integration.
|
|
67
|
+
*
|
|
68
|
+
* When used on the Cloudflare Workers, you can just pass the "env" context provided by Cloudflare.
|
|
69
|
+
* Else, this tries to load `UPSTASH_VECTOR_REST_URL` and `UPSTASH_VECTOR_REST_TOKEN` from
|
|
70
|
+
* your environment using `process.env`.
|
|
71
|
+
*/
|
|
72
|
+
static fromEnv(env?: {
|
|
73
|
+
UPSTASH_VECTOR_REST_URL: string;
|
|
74
|
+
UPSTASH_VECTOR_REST_TOKEN: string;
|
|
75
|
+
}, config?: Omit<IndexConfig, "url" | "token">): Index;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export { Index, type IndexConfig, Requester };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var M=Object.defineProperty;var U=Object.getOwnPropertyDescriptor;var P=Object.getOwnPropertyNames;var w=Object.prototype.hasOwnProperty;var _=(n,e)=>{for(var t in e)M(n,t,{get:e[t],enumerable:!0})},N=(n,e,t,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of P(e))!w.call(n,s)&&s!==t&&M(n,s,{get:()=>e[s],enumerable:!(a=U(e,s))||a.enumerable});return n};var V=n=>N(M({},"__esModule",{value:!0}),n);var O={};_(O,{Index:()=>S});module.exports=V(O);var i=class extends Error{constructor(e){super(e),this.name="UpstashError"}};var f=class{baseUrl;headers;options;retry;constructor(e){this.options={cache:e.cache,signal:e.signal},this.baseUrl=e.baseUrl.replace(/\/$/,""),this.headers={"Content-Type":"application/json",...e.headers},typeof e?.retry=="boolean"&&e?.retry===!1?this.retry={attempts:1,backoff:()=>0}:this.retry={attempts:e?.retry?.retries??5,backoff:e?.retry?.backoff??(t=>Math.exp(t)*50)}}async request(e){let t={cache:this.options.cache,method:"POST",headers:this.headers,body:JSON.stringify(e.body),keepalive:!0,signal:this.options.signal},a=null,s=null;for(let R=0;R<=this.retry.attempts;R++)try{a=await fetch([this.baseUrl,...e.path??[]].join("/"),t);break}catch(b){if(this.options.signal?.aborted){let g=new Blob([JSON.stringify({result:this.options.signal.reason??"Aborted"})]),A={status:200,statusText:this.options.signal.reason??"Aborted"};a=new Response(g,A);break}s=b,await new Promise(g=>setTimeout(g,this.retry.backoff(R)))}if(!a)throw s??new Error("Exhausted all retries");let o=await a.json();if(!a.ok)throw new i(`${o.error}`);return{result:o.result,error:o.error}}};var r=class{payload;endpoint;constructor(e,t){this.payload=e,this.endpoint=t}async exec(e){let{result:t,error:a}=await e.request({body:this.payload,path:[this.endpoint]});if(a)throw new i(a);if(typeof t>"u")throw new Error("Request did not return a result");return t}};var p=class extends r{constructor(e,t){let a="delete";t?.namespace&&(a=`${a}/${t.namespace}`);let s=[];Array.isArray(e)?s.push(...e):s.push(e),super(s,a)}};var d=class extends r{constructor(e,t){let a="query";"data"in e&&(a="query-data"),t?.namespace&&(a=`${a}/${t.namespace}`),super(e,a)}};var m=class extends r{constructor(e,t){let a="upsert";if(Array.isArray(e)){if(e.some(o=>"data"in o&&o.data)){a="upsert-data";for(let o of e)!("metadata"in o)&&"data"in o&&(o.metadata={data:o.data})}}else"data"in e&&(a="upsert-data","metadata"in e||(e.metadata={data:e.data}));t?.namespace&&(a=`${a}/${t.namespace}`),super(e,a)}};var c=class extends r{constructor([e,t]){let a="fetch";t?.namespace&&(a=`${a}/${t.namespace}`,delete t.namespace),super({ids:e,...t},a)}};var l=class extends r{constructor(e,t){let a="range";t?.namespace&&(a=`${a}/${t.namespace}`),super(e,a)}};var u=class extends r{constructor(e){let t="reset";e?.namespace&&(t=`${t}/${e.namespace}`),super([],t)}};var y=class extends r{constructor(){super([],"info")}};var h=class{client;namespace;constructor(e,t){this.client=e,this.namespace=t}upsert=e=>new m(e,{namespace:this.namespace}).exec(this.client);update=e=>new T(e,{namespace:this.namespace}).exec(this.client);fetch=(...e)=>(e[1]?e[1].namespace=this.namespace:e[1]={namespace:this.namespace},new c(e).exec(this.client));query=e=>new d(e,{namespace:this.namespace}).exec(this.client);delete=e=>new p(e,{namespace:this.namespace}).exec(this.client);range=e=>new l(e,{namespace:this.namespace}).exec(this.client);reset=()=>new u({namespace:this.namespace}).exec(this.client)};var T=class extends r{constructor(e,t){let a="update";t?.namespace&&(a=`${a}/${t.namespace}`),super(e,a)}};var C=class extends r{constructor(){super([],"list-namespaces")}};var E=class extends r{constructor(e){let t=`delete-namespace/${e}`;super([],t)}};var x=class{client;constructor(e){this.client=e}namespace=e=>new h(this.client,e);delete=(e,t)=>new p(e,t).exec(this.client);query=(e,t)=>new d(e,t).exec(this.client);upsert=(e,t)=>new m(e,t).exec(this.client);update=(e,t)=>new T(e,t).exec(this.client);fetch=(...e)=>new c(e).exec(this.client);reset=e=>new u(e).exec(this.client);range=(e,t)=>new l(e,t).exec(this.client);info=()=>new y().exec(this.client);listNamespaces=()=>new C().exec(this.client);deleteNamespace=e=>new E(e).exec(this.client)};var S=class n extends x{constructor(e){if(typeof e<"u"&&"request"in e){super(e);return}let t=e?.token??process.env.NEXT_PUBLIC_UPSTASH_VECTOR_REST_TOKEN??process.env.UPSTASH_VECTOR_REST_TOKEN,a=e?.url??process.env.NEXT_PUBLIC_UPSTASH_VECTOR_REST_URL??process.env.UPSTASH_VECTOR_REST_URL;if(!t)throw new Error("UPSTASH_VECTOR_REST_TOKEN is missing!");if(!a)throw new Error("UPSTASH_VECTOR_REST_URL is missing!");(a.startsWith(" ")||a.endsWith(" ")||/\r|\n/.test(a))&&console.warn("The vector url contains whitespace or newline, which can cause errors!"),(t.startsWith(" ")||t.endsWith(" ")||/\r|\n/.test(t))&&console.warn("The vector token contains whitespace or newline, which can cause errors!");let s=new f({baseUrl:a,retry:e?.retry,headers:{authorization:`Bearer ${t}`},cache:e?.cache===!1?void 0:e?.cache||"no-store",signal:e?.signal});super(s)}static fromEnv(e,t){let a,s;if(e){if(a=e.UPSTASH_VECTOR_REST_URL,!a)throw new Error("Unable to find environment variable: `UPSTASH_VECTOR_REST_URL`. Please add it via `wrangler secret put UPSTASH_VECTOR_REST_URL`");if(s=e.UPSTASH_VECTOR_REST_TOKEN,!s)throw new Error("Unable to find environment variable: `UPSTASH_VECTOR_REST_TOKEN`. Please add it via `wrangler secret put UPSTASH_VECTOR_REST_TOKEN`")}else{if(a=process?.env.UPSTASH_VECTOR_REST_URL,!a)throw new Error("Unable to find environment variable: `UPSTASH_VECTOR_REST_URL`");if(s=process?.env.UPSTASH_VECTOR_REST_TOKEN,!s)throw new Error("Unable to find environment variable: `UPSTASH_VECTOR_REST_TOKEN`")}return new n({...t,url:a,token:s})}};0&&(module.exports={Index});
|
package/dist/nodejs.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as s,b as o}from"./chunk-HLW45HVB.mjs";var i=class T extends o{constructor(e){if(typeof e<"u"&&"request"in e){super(e);return}let t=e?.token??process.env.NEXT_PUBLIC_UPSTASH_VECTOR_REST_TOKEN??process.env.UPSTASH_VECTOR_REST_TOKEN,n=e?.url??process.env.NEXT_PUBLIC_UPSTASH_VECTOR_REST_URL??process.env.UPSTASH_VECTOR_REST_URL;if(!t)throw new Error("UPSTASH_VECTOR_REST_TOKEN is missing!");if(!n)throw new Error("UPSTASH_VECTOR_REST_URL is missing!");(n.startsWith(" ")||n.endsWith(" ")||/\r|\n/.test(n))&&console.warn("The vector url contains whitespace or newline, which can cause errors!"),(t.startsWith(" ")||t.endsWith(" ")||/\r|\n/.test(t))&&console.warn("The vector token contains whitespace or newline, which can cause errors!");let r=new s({baseUrl:n,retry:e?.retry,headers:{authorization:`Bearer ${t}`},cache:e?.cache===!1?void 0:e?.cache||"no-store",signal:e?.signal});super(r)}static fromEnv(e,t){let n,r;if(e){if(n=e.UPSTASH_VECTOR_REST_URL,!n)throw new Error("Unable to find environment variable: `UPSTASH_VECTOR_REST_URL`. Please add it via `wrangler secret put UPSTASH_VECTOR_REST_URL`");if(r=e.UPSTASH_VECTOR_REST_TOKEN,!r)throw new Error("Unable to find environment variable: `UPSTASH_VECTOR_REST_TOKEN`. Please add it via `wrangler secret put UPSTASH_VECTOR_REST_TOKEN`")}else{if(n=process?.env.UPSTASH_VECTOR_REST_URL,!n)throw new Error("Unable to find environment variable: `UPSTASH_VECTOR_REST_URL`");if(r=process?.env.UPSTASH_VECTOR_REST_TOKEN,!r)throw new Error("Unable to find environment variable: `UPSTASH_VECTOR_REST_TOKEN`")}return new T({...t,url:n,token:r})}};export{i as Index};
|
|
@@ -305,7 +305,7 @@ type CommandArgs<TCommand extends new (_args: any) => any> = ConstructorParamete
|
|
|
305
305
|
/**
|
|
306
306
|
* Serverless vector client for upstash vector db.
|
|
307
307
|
*/
|
|
308
|
-
declare class Index
|
|
308
|
+
declare class Index<TIndexMetadata extends Dict = Dict> {
|
|
309
309
|
protected client: Requester;
|
|
310
310
|
/**
|
|
311
311
|
* Create a new vector db client
|
|
@@ -521,74 +521,4 @@ declare class Index$1<TIndexMetadata extends Dict = Dict> {
|
|
|
521
521
|
deleteNamespace: (namespace: string) => Promise<string>;
|
|
522
522
|
}
|
|
523
523
|
|
|
524
|
-
|
|
525
|
-
* Connection credentials for upstash vector.
|
|
526
|
-
* Get them from https://console.upstash.com/vector/<uuid>
|
|
527
|
-
*/
|
|
528
|
-
type IndexConfig = {
|
|
529
|
-
/**
|
|
530
|
-
* UPSTASH_VECTOR_REST_URL
|
|
531
|
-
*/
|
|
532
|
-
url?: string;
|
|
533
|
-
/**
|
|
534
|
-
* UPSTASH_VECTOR_REST_TOKEN
|
|
535
|
-
*/
|
|
536
|
-
token?: string;
|
|
537
|
-
/**
|
|
538
|
-
* The signal will allow aborting requests on the fly.
|
|
539
|
-
* For more check: https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal
|
|
540
|
-
*/
|
|
541
|
-
signal?: AbortSignal;
|
|
542
|
-
} & RequesterConfig;
|
|
543
|
-
/**
|
|
544
|
-
* Serverless vector client for upstash.
|
|
545
|
-
*/
|
|
546
|
-
declare class Index<TIndexMetadata extends Dict = Dict> extends Index$1<TIndexMetadata> {
|
|
547
|
-
/**
|
|
548
|
-
* Create a new vector client by providing the url and token
|
|
549
|
-
*
|
|
550
|
-
* @example
|
|
551
|
-
* ```typescript
|
|
552
|
-
* const index = new Index({
|
|
553
|
-
* url: "<UPSTASH_VECTOR_REST_URL>",
|
|
554
|
-
* token: "<UPSTASH_VECTOR_REST_TOKEN>",
|
|
555
|
-
* });
|
|
556
|
-
* ```
|
|
557
|
-
* OR
|
|
558
|
-
* This will automatically get environment variables from .env file
|
|
559
|
-
* ```typescript
|
|
560
|
-
* const index = new Index();
|
|
561
|
-
* ```
|
|
562
|
-
*/
|
|
563
|
-
constructor(config?: IndexConfig);
|
|
564
|
-
/**
|
|
565
|
-
* Create a new vector client by providing a custom `Requester` implementation
|
|
566
|
-
*
|
|
567
|
-
* @example
|
|
568
|
-
* ```ts
|
|
569
|
-
*
|
|
570
|
-
* import { UpstashRequest, Requester, UpstashResponse, vector } from "@upstash/vector"
|
|
571
|
-
*
|
|
572
|
-
* const requester: Requester = {
|
|
573
|
-
* request: <TResult>(req: UpstashRequest): Promise<UpstashResponse<TResult>> => {
|
|
574
|
-
* // ...
|
|
575
|
-
* }
|
|
576
|
-
* }
|
|
577
|
-
*
|
|
578
|
-
* const vector = new vector(requester)
|
|
579
|
-
* ```
|
|
580
|
-
*/
|
|
581
|
-
constructor(requesters?: Requester);
|
|
582
|
-
/**
|
|
583
|
-
* Create a new Upstash Vector instance from environment variables.
|
|
584
|
-
*
|
|
585
|
-
* Use this to automatically load connection secrets from your environment
|
|
586
|
-
* variables. For instance when using the Vercel integration.
|
|
587
|
-
*
|
|
588
|
-
* This tries to load `UPSTASH_VECTOR_REST_URL` and `UPSTASH_VECTOR_REST_TOKEN` from
|
|
589
|
-
* your environment using `process.env`.
|
|
590
|
-
*/
|
|
591
|
-
static fromEnv(config?: Omit<IndexConfig, "url" | "token">): Index;
|
|
592
|
-
}
|
|
593
|
-
|
|
594
|
-
export { type FetchResult, Index, type IndexConfig, type InfoResult, type QueryResult, type RangeResult, type Requester, type UpstashRequest, type UpstashResponse, type Vector };
|
|
524
|
+
export { type Dict as D, type FetchResult as F, Index as I, type QueryResult as Q, type RequesterConfig as R, type UpstashRequest as U, type Vector as V, type Requester as a, type UpstashResponse as b, type RangeResult as c, type InfoResult as d };
|
|
@@ -305,7 +305,7 @@ type CommandArgs<TCommand extends new (_args: any) => any> = ConstructorParamete
|
|
|
305
305
|
/**
|
|
306
306
|
* Serverless vector client for upstash vector db.
|
|
307
307
|
*/
|
|
308
|
-
declare class Index
|
|
308
|
+
declare class Index<TIndexMetadata extends Dict = Dict> {
|
|
309
309
|
protected client: Requester;
|
|
310
310
|
/**
|
|
311
311
|
* Create a new vector db client
|
|
@@ -521,74 +521,4 @@ declare class Index$1<TIndexMetadata extends Dict = Dict> {
|
|
|
521
521
|
deleteNamespace: (namespace: string) => Promise<string>;
|
|
522
522
|
}
|
|
523
523
|
|
|
524
|
-
|
|
525
|
-
* Connection credentials for upstash vector.
|
|
526
|
-
* Get them from https://console.upstash.com/vector/<uuid>
|
|
527
|
-
*/
|
|
528
|
-
type IndexConfig = {
|
|
529
|
-
/**
|
|
530
|
-
* UPSTASH_VECTOR_REST_URL
|
|
531
|
-
*/
|
|
532
|
-
url?: string;
|
|
533
|
-
/**
|
|
534
|
-
* UPSTASH_VECTOR_REST_TOKEN
|
|
535
|
-
*/
|
|
536
|
-
token?: string;
|
|
537
|
-
/**
|
|
538
|
-
* The signal will allow aborting requests on the fly.
|
|
539
|
-
* For more check: https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal
|
|
540
|
-
*/
|
|
541
|
-
signal?: AbortSignal;
|
|
542
|
-
} & RequesterConfig;
|
|
543
|
-
/**
|
|
544
|
-
* Serverless vector client for upstash.
|
|
545
|
-
*/
|
|
546
|
-
declare class Index<TIndexMetadata extends Dict = Dict> extends Index$1<TIndexMetadata> {
|
|
547
|
-
/**
|
|
548
|
-
* Create a new vector client by providing the url and token
|
|
549
|
-
*
|
|
550
|
-
* @example
|
|
551
|
-
* ```typescript
|
|
552
|
-
* const index = new Index({
|
|
553
|
-
* url: "<UPSTASH_VECTOR_REST_URL>",
|
|
554
|
-
* token: "<UPSTASH_VECTOR_REST_TOKEN>",
|
|
555
|
-
* });
|
|
556
|
-
* ```
|
|
557
|
-
* OR
|
|
558
|
-
* This will automatically get environment variables from .env file
|
|
559
|
-
* ```typescript
|
|
560
|
-
* const index = new Index();
|
|
561
|
-
* ```
|
|
562
|
-
*/
|
|
563
|
-
constructor(config?: IndexConfig);
|
|
564
|
-
/**
|
|
565
|
-
* Create a new vector client by providing a custom `Requester` implementation
|
|
566
|
-
*
|
|
567
|
-
* @example
|
|
568
|
-
* ```ts
|
|
569
|
-
*
|
|
570
|
-
* import { UpstashRequest, Requester, UpstashResponse, vector } from "@upstash/vector"
|
|
571
|
-
*
|
|
572
|
-
* const requester: Requester = {
|
|
573
|
-
* request: <TResult>(req: UpstashRequest): Promise<UpstashResponse<TResult>> => {
|
|
574
|
-
* // ...
|
|
575
|
-
* }
|
|
576
|
-
* }
|
|
577
|
-
*
|
|
578
|
-
* const vector = new vector(requester)
|
|
579
|
-
* ```
|
|
580
|
-
*/
|
|
581
|
-
constructor(requesters?: Requester);
|
|
582
|
-
/**
|
|
583
|
-
* Create a new Upstash Vector instance from environment variables.
|
|
584
|
-
*
|
|
585
|
-
* Use this to automatically load connection secrets from your environment
|
|
586
|
-
* variables. For instance when using the Vercel integration.
|
|
587
|
-
*
|
|
588
|
-
* This tries to load `UPSTASH_VECTOR_REST_URL` and `UPSTASH_VECTOR_REST_TOKEN` from
|
|
589
|
-
* your environment using `process.env`.
|
|
590
|
-
*/
|
|
591
|
-
static fromEnv(config?: Omit<IndexConfig, "url" | "token">): Index;
|
|
592
|
-
}
|
|
593
|
-
|
|
594
|
-
export { type FetchResult, Index, type IndexConfig, type InfoResult, type QueryResult, type RangeResult, type Requester, type UpstashRequest, type UpstashResponse, type Vector };
|
|
524
|
+
export { type Dict as D, type FetchResult as F, Index as I, type QueryResult as Q, type RequesterConfig as R, type UpstashRequest as U, type Vector as V, type Requester as a, type UpstashResponse as b, type RangeResult as c, type InfoResult as d };
|
package/package.json
CHANGED
|
@@ -1 +1,66 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"name": "@upstash/vector",
|
|
3
|
+
"version": "1.1.3-canary.2",
|
|
4
|
+
"author": "Oguzhan Olguncu <oguzhan@upstash.com>",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/upstash/vector-js"
|
|
8
|
+
},
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": "./dist/nodejs.mjs",
|
|
12
|
+
"require": "./dist/nodejs.js",
|
|
13
|
+
"types": "./dist/nodejs.d.ts",
|
|
14
|
+
"browser": "./dist/nodejs.mjs",
|
|
15
|
+
"bun": "./dist/nodejs.mjs",
|
|
16
|
+
"deno": "./dist/nodejs.mjs",
|
|
17
|
+
"edge-light": "./dist/nodejs.mjs",
|
|
18
|
+
"edge-routine": "./dist/nodejs.mjs",
|
|
19
|
+
"netlify": "./dist/nodejs.mjs",
|
|
20
|
+
"react-native": "./dist/nodejs.mjs",
|
|
21
|
+
"wintercg": "./dist/nodejs.mjs",
|
|
22
|
+
"worker": {
|
|
23
|
+
"import": "./dist/cloudflare.mjs",
|
|
24
|
+
"types": "./dist/cloudflare.d.ts"
|
|
25
|
+
},
|
|
26
|
+
"workerd": {
|
|
27
|
+
"import": "./dist/cloudflare.mjs",
|
|
28
|
+
"types": "./dist/cloudflare.d.ts"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"main": "./dist/nodejs.js",
|
|
33
|
+
"module": "./dist/nodejs.mjs",
|
|
34
|
+
"browser": "./dist/nodejs.mjs",
|
|
35
|
+
"types": "./dist/nodejs.d.ts",
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@biomejs/biome": "^1.4.1",
|
|
38
|
+
"@commitlint/cli": "^18.6.0",
|
|
39
|
+
"@commitlint/config-conventional": "^18.6.0",
|
|
40
|
+
"bun-types": "latest",
|
|
41
|
+
"husky": "^8.0.3",
|
|
42
|
+
"tsup": "latest",
|
|
43
|
+
"typescript": "^5.0.0",
|
|
44
|
+
"vitest": "^1.2.2"
|
|
45
|
+
},
|
|
46
|
+
"bugs": {
|
|
47
|
+
"url": "https://github.com/upstash/vector/issues"
|
|
48
|
+
},
|
|
49
|
+
"description": "An HTTP/REST based Vector DB client built on top of Upstash REST API.",
|
|
50
|
+
"files": [
|
|
51
|
+
"dist"
|
|
52
|
+
],
|
|
53
|
+
"homepage": "https://upstash.com/vector",
|
|
54
|
+
"keywords": [
|
|
55
|
+
"vector",
|
|
56
|
+
"upstash",
|
|
57
|
+
"db"
|
|
58
|
+
],
|
|
59
|
+
"license": "MIT",
|
|
60
|
+
"scripts": {
|
|
61
|
+
"test": "bun test src --coverage --bail --coverageSkipTestFiles=[test-utils.ts] --timeout 20000 && vitest run --typecheck",
|
|
62
|
+
"fmt": "bunx biome check --apply ./src",
|
|
63
|
+
"build": "tsup",
|
|
64
|
+
"prepare": "husky install"
|
|
65
|
+
}
|
|
66
|
+
}
|