@upstash/vector 0.1.0-alpha-7 → 0.1.0-alpha-8
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.d.mts +8 -8
- package/dist/index.d.ts +8 -8
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -69,13 +69,13 @@ type QueryCommandPayload = {
|
|
|
69
69
|
includeVectors?: boolean;
|
|
70
70
|
includeMetadata?: boolean;
|
|
71
71
|
};
|
|
72
|
-
type QueryResult<TMetadata
|
|
72
|
+
type QueryResult<TMetadata = Record<string, unknown>> = {
|
|
73
73
|
id: number | string;
|
|
74
74
|
score: number;
|
|
75
75
|
vector: number[];
|
|
76
76
|
metadata?: TMetadata;
|
|
77
77
|
};
|
|
78
|
-
declare class QueryCommand<TMetadata
|
|
78
|
+
declare class QueryCommand<TMetadata> extends Command<QueryResult<TMetadata>[]> {
|
|
79
79
|
constructor(payload: QueryCommandPayload);
|
|
80
80
|
}
|
|
81
81
|
|
|
@@ -94,7 +94,7 @@ type Vector<TMetadata> = {
|
|
|
94
94
|
metadata?: TMetadata;
|
|
95
95
|
};
|
|
96
96
|
|
|
97
|
-
type FetchResult<TMetadata
|
|
97
|
+
type FetchResult<TMetadata = Record<string, unknown>> = Vector<TMetadata> | null;
|
|
98
98
|
|
|
99
99
|
type RangeCommandPayload = {
|
|
100
100
|
cursor: number | string;
|
|
@@ -102,11 +102,11 @@ type RangeCommandPayload = {
|
|
|
102
102
|
includeVectors?: boolean;
|
|
103
103
|
includeMetadata?: boolean;
|
|
104
104
|
};
|
|
105
|
-
type RangeResult<TMetadata
|
|
105
|
+
type RangeResult<TMetadata = Record<string, unknown>> = {
|
|
106
106
|
nextCursor: string;
|
|
107
107
|
vectors: Vector<TMetadata>[];
|
|
108
108
|
};
|
|
109
|
-
declare class RangeCommand<TMetadata
|
|
109
|
+
declare class RangeCommand<TMetadata> extends Command<RangeResult<TMetadata>> {
|
|
110
110
|
constructor(payload: RangeCommandPayload);
|
|
111
111
|
}
|
|
112
112
|
|
|
@@ -160,7 +160,7 @@ declare class Index$1 {
|
|
|
160
160
|
*
|
|
161
161
|
* @returns A promise that resolves with an array of query result objects when the request to query the index is completed.
|
|
162
162
|
*/
|
|
163
|
-
query: (args: CommandArgs<typeof QueryCommand>) => Promise<QueryResult<
|
|
163
|
+
query: (args: CommandArgs<typeof QueryCommand>) => Promise<QueryResult<unknown>[]>;
|
|
164
164
|
/**
|
|
165
165
|
* Upserts (Updates and Inserts) specific items into the index.
|
|
166
166
|
* It's used for adding new items to the index or updating existing ones.
|
|
@@ -207,7 +207,7 @@ declare class Index$1 {
|
|
|
207
207
|
fetch: (ids: string[] | number[], opts: {
|
|
208
208
|
includeMetadata?: boolean | undefined;
|
|
209
209
|
includeVectors?: boolean | undefined;
|
|
210
|
-
}) => Promise<FetchResult<
|
|
210
|
+
}) => Promise<FetchResult<unknown>[]>;
|
|
211
211
|
/**
|
|
212
212
|
* It's used for wiping an entire index.
|
|
213
213
|
*
|
|
@@ -243,7 +243,7 @@ declare class Index$1 {
|
|
|
243
243
|
*
|
|
244
244
|
* @returns {Promise<RangeReturnResponse<TMetadata>>} A promise that resolves with the response containing the next cursor and an array of vectors, after the command is executed.
|
|
245
245
|
*/
|
|
246
|
-
range: (args: CommandArgs<typeof RangeCommand>) => Promise<RangeResult<
|
|
246
|
+
range: (args: CommandArgs<typeof RangeCommand>) => Promise<RangeResult<unknown>>;
|
|
247
247
|
}
|
|
248
248
|
|
|
249
249
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -69,13 +69,13 @@ type QueryCommandPayload = {
|
|
|
69
69
|
includeVectors?: boolean;
|
|
70
70
|
includeMetadata?: boolean;
|
|
71
71
|
};
|
|
72
|
-
type QueryResult<TMetadata
|
|
72
|
+
type QueryResult<TMetadata = Record<string, unknown>> = {
|
|
73
73
|
id: number | string;
|
|
74
74
|
score: number;
|
|
75
75
|
vector: number[];
|
|
76
76
|
metadata?: TMetadata;
|
|
77
77
|
};
|
|
78
|
-
declare class QueryCommand<TMetadata
|
|
78
|
+
declare class QueryCommand<TMetadata> extends Command<QueryResult<TMetadata>[]> {
|
|
79
79
|
constructor(payload: QueryCommandPayload);
|
|
80
80
|
}
|
|
81
81
|
|
|
@@ -94,7 +94,7 @@ type Vector<TMetadata> = {
|
|
|
94
94
|
metadata?: TMetadata;
|
|
95
95
|
};
|
|
96
96
|
|
|
97
|
-
type FetchResult<TMetadata
|
|
97
|
+
type FetchResult<TMetadata = Record<string, unknown>> = Vector<TMetadata> | null;
|
|
98
98
|
|
|
99
99
|
type RangeCommandPayload = {
|
|
100
100
|
cursor: number | string;
|
|
@@ -102,11 +102,11 @@ type RangeCommandPayload = {
|
|
|
102
102
|
includeVectors?: boolean;
|
|
103
103
|
includeMetadata?: boolean;
|
|
104
104
|
};
|
|
105
|
-
type RangeResult<TMetadata
|
|
105
|
+
type RangeResult<TMetadata = Record<string, unknown>> = {
|
|
106
106
|
nextCursor: string;
|
|
107
107
|
vectors: Vector<TMetadata>[];
|
|
108
108
|
};
|
|
109
|
-
declare class RangeCommand<TMetadata
|
|
109
|
+
declare class RangeCommand<TMetadata> extends Command<RangeResult<TMetadata>> {
|
|
110
110
|
constructor(payload: RangeCommandPayload);
|
|
111
111
|
}
|
|
112
112
|
|
|
@@ -160,7 +160,7 @@ declare class Index$1 {
|
|
|
160
160
|
*
|
|
161
161
|
* @returns A promise that resolves with an array of query result objects when the request to query the index is completed.
|
|
162
162
|
*/
|
|
163
|
-
query: (args: CommandArgs<typeof QueryCommand>) => Promise<QueryResult<
|
|
163
|
+
query: (args: CommandArgs<typeof QueryCommand>) => Promise<QueryResult<unknown>[]>;
|
|
164
164
|
/**
|
|
165
165
|
* Upserts (Updates and Inserts) specific items into the index.
|
|
166
166
|
* It's used for adding new items to the index or updating existing ones.
|
|
@@ -207,7 +207,7 @@ declare class Index$1 {
|
|
|
207
207
|
fetch: (ids: string[] | number[], opts: {
|
|
208
208
|
includeMetadata?: boolean | undefined;
|
|
209
209
|
includeVectors?: boolean | undefined;
|
|
210
|
-
}) => Promise<FetchResult<
|
|
210
|
+
}) => Promise<FetchResult<unknown>[]>;
|
|
211
211
|
/**
|
|
212
212
|
* It's used for wiping an entire index.
|
|
213
213
|
*
|
|
@@ -243,7 +243,7 @@ declare class Index$1 {
|
|
|
243
243
|
*
|
|
244
244
|
* @returns {Promise<RangeReturnResponse<TMetadata>>} A promise that resolves with the response containing the next cursor and an array of vectors, after the command is executed.
|
|
245
245
|
*/
|
|
246
|
-
range: (args: CommandArgs<typeof RangeCommand>) => Promise<RangeResult<
|
|
246
|
+
range: (args: CommandArgs<typeof RangeCommand>) => Promise<RangeResult<unknown>>;
|
|
247
247
|
}
|
|
248
248
|
|
|
249
249
|
/**
|