@volter/twin-upstashvector 0.1.0 → 0.1.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.
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
// STRINGS below are twin-authored except the dimension mismatch, which is quoted from the vendor's
|
|
46
46
|
// own upsert doc. What IS faithful and asserted: the `{result}` / `{error,status}` envelope, the
|
|
47
47
|
// status codes, the routing table, and every response body shape.
|
|
48
|
+
import { worldNow } from '@volter/world-core';
|
|
48
49
|
import { DEFAULT_NAMESPACE, IndexSpace, ReadOnlyError, VectorApiError, UPSTASHVECTOR_RESOURCE_TYPES, } from "./upstashvector-store.js";
|
|
49
50
|
/** Response headers. `content-type` is what the SDK's `res.json()` requires. */
|
|
50
51
|
const BASE_HEADERS = {
|
|
@@ -125,7 +126,7 @@ export async function handleUpstashVectorTwinRequest(req) {
|
|
|
125
126
|
const [rawPath, rawQuery] = req.path.split('?');
|
|
126
127
|
const query = new URLSearchParams(rawQuery ?? '');
|
|
127
128
|
const headers = lowerHeaders(req.headers);
|
|
128
|
-
const occurredAt = req.occurredAt ??
|
|
129
|
+
const occurredAt = req.occurredAt ?? worldNow();
|
|
129
130
|
// CORS preflight. Answered before auth — a browser preflight carries no Authorization header by
|
|
130
131
|
// definition, so 401ing it would make the twin unusable from any browser client.
|
|
131
132
|
if (method === 'OPTIONS') {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volter/twin-upstashvector",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Local Upstash Vector (REST API) twin: a real stateful vector index served over Upstash Vector's per-index REST protocol — POST /upsert, /query, /fetch, /range, /delete, /update, /reset, /info, /list-namespaces, /delete-namespace, each with its /{namespace} path form — with Bearer-token auth, the {result}/{error,status} envelope, and REAL similarity math (cosine/euclidean/dot-product scores computed from the stored vectors and normalized with Upstash's own published formulas, never faked) plus a real metadata-filter parser/evaluator. Built on @volter/world-core.",
|
|
5
5
|
"author": "Volter (https://github.com/volter-ai)",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -35,12 +35,12 @@
|
|
|
35
35
|
"postpack": "node ../../../scripts/publish/prepare-publish.mjs postpack"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
|
-
"@volter/world-core": "2.0.
|
|
38
|
+
"@volter/world-core": "2.0.2"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@types/bun": "^1.2.20",
|
|
42
42
|
"@types/node": "^24.0.0",
|
|
43
|
-
"@volter/world-core": "2.0.
|
|
43
|
+
"@volter/world-core": "2.0.2",
|
|
44
44
|
"@volter/world-tooling": "0.1.0",
|
|
45
45
|
"@upstash/vector": "1.2.3",
|
|
46
46
|
"typescript": "^5.9.0"
|
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
// STRINGS below are twin-authored except the dimension mismatch, which is quoted from the vendor's
|
|
46
46
|
// own upsert doc. What IS faithful and asserted: the `{result}` / `{error,status}` envelope, the
|
|
47
47
|
// status codes, the routing table, and every response body shape.
|
|
48
|
+
import { worldNow } from '@volter/world-core';
|
|
48
49
|
import {
|
|
49
50
|
DEFAULT_NAMESPACE,
|
|
50
51
|
IndexSpace,
|
|
@@ -169,7 +170,7 @@ export async function handleUpstashVectorTwinRequest(req: UpstashVectorRequest):
|
|
|
169
170
|
const [rawPath, rawQuery] = req.path.split('?');
|
|
170
171
|
const query = new URLSearchParams(rawQuery ?? '');
|
|
171
172
|
const headers = lowerHeaders(req.headers);
|
|
172
|
-
const occurredAt = req.occurredAt ??
|
|
173
|
+
const occurredAt = req.occurredAt ?? worldNow();
|
|
173
174
|
|
|
174
175
|
// CORS preflight. Answered before auth — a browser preflight carries no Authorization header by
|
|
175
176
|
// definition, so 401ing it would make the twin unusable from any browser client.
|