@lunora/bindings 1.0.0-alpha.6 → 1.0.0-alpha.7
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/images/index.mjs +2 -2
- package/dist/kv/index.mjs +2 -2
- package/dist/packem_shared/{R2SqlError-Boygg3S0.mjs → R2SqlError-drPKSCZ3.mjs} +2 -2
- package/dist/packem_shared/{SelectBuilder-DHaXZwn_.mjs → SelectBuilder-BOqJQHEv.mjs} +4 -3
- package/dist/packem_shared/{SetOperation-RDHcxccj.mjs → SetOperation-DmPgUL8W.mjs} +3 -2
- package/dist/packem_shared/{Sql-DceGtcUd.mjs → Sql-B3zq2YGx.mjs} +7 -1
- package/dist/packem_shared/{WindowExpression-Cg9s2xcr.mjs → WindowExpression-BT_uA6g1.mjs} +1 -1
- package/dist/packem_shared/{WindowFunction-DA3pGC3N.mjs → WindowFunction-DrnuZUF6.mjs} +3 -3
- package/dist/packem_shared/{asc-Cur-xO8v.mjs → asc-DZbQCxh1.mjs} +1 -1
- package/dist/packem_shared/{buildImageDeliveryUrl-B6_QU91n.mjs → buildImageDeliveryUrl-qZ7XbqTL.mjs} +4 -2
- package/dist/packem_shared/{buildSignedImageUrl-6iibA9v1.mjs → buildSignedImageUrl-DNUFfyGP.mjs} +46 -29
- package/dist/packem_shared/{concurrent-Dj5sOibv.mjs → concurrent-CkCEVwqP.mjs} +17 -1
- package/dist/packem_shared/{createContextVectors-BSizpmu5.mjs → createContextVectors-DwZtnPeC.mjs} +1 -1
- package/dist/packem_shared/{createKv-7lNrS1W2.mjs → createKv-C8Iyu5hD.mjs} +5 -3
- package/dist/packem_shared/{createKvIntrospector-CrAgQp1w.mjs → createKvIntrospector-Byk4GfsY.mjs} +1 -1
- package/dist/packem_shared/{createVectorAdminIntrospector-C-qTDWA1.mjs → createVectorAdminIntrospector-DuSvcBa5.mjs} +2 -2
- package/dist/packem_shared/{createVectors-DqxgEPQb.mjs → createVectors-CTSrctiK.mjs} +2 -2
- package/dist/r2sql/index.mjs +7 -7
- package/dist/vectors/index.mjs +3 -3
- package/package.json +2 -2
package/dist/images/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { createImages } from '../packem_shared/createImages-BzRnsz3H.mjs';
|
|
2
|
-
export { buildImageDeliveryUrl } from '../packem_shared/buildImageDeliveryUrl-
|
|
3
|
-
export { buildSignedImageUrl, verifySignedImageUrl } from '../packem_shared/buildSignedImageUrl-
|
|
2
|
+
export { buildImageDeliveryUrl } from '../packem_shared/buildImageDeliveryUrl-qZ7XbqTL.mjs';
|
|
3
|
+
export { buildSignedImageUrl, verifySignedImageUrl } from '../packem_shared/buildSignedImageUrl-DNUFfyGP.mjs';
|
package/dist/kv/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { createKv, scopeKey } from '../packem_shared/createKv-
|
|
2
|
-
export { createKvIntrospector, createKvIntrospectorFromEnv } from '../packem_shared/createKvIntrospector-
|
|
1
|
+
export { createKv, scopeKey } from '../packem_shared/createKv-C8Iyu5hD.mjs';
|
|
2
|
+
export { createKvIntrospector, createKvIntrospectorFromEnv } from '../packem_shared/createKvIntrospector-Byk4GfsY.mjs';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LunoraError } from '@lunora/errors';
|
|
2
|
-
import SelectBuilder from './SelectBuilder-
|
|
3
|
-
import { ident, toText } from './Sql-
|
|
2
|
+
import SelectBuilder from './SelectBuilder-BOqJQHEv.mjs';
|
|
3
|
+
import { ident, toText } from './Sql-B3zq2YGx.mjs';
|
|
4
4
|
|
|
5
5
|
const API_BASE = "https://api.sql.cloudflarestorage.com/api/v1/accounts";
|
|
6
6
|
const inferColumns = (rows) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { renderOrderTerm } from './asc-
|
|
2
|
-
import SetOperation from './SetOperation-
|
|
3
|
-
import { tableRef, toText, lit } from './Sql-
|
|
1
|
+
import { renderOrderTerm } from './asc-DZbQCxh1.mjs';
|
|
2
|
+
import SetOperation from './SetOperation-DmPgUL8W.mjs';
|
|
3
|
+
import { tableRef, toText, assertLimit, lit } from './Sql-B3zq2YGx.mjs';
|
|
4
4
|
|
|
5
5
|
const JOIN_KEYWORDS = {
|
|
6
6
|
cross: "CROSS JOIN",
|
|
@@ -91,6 +91,7 @@ class SelectBuilder {
|
|
|
91
91
|
}
|
|
92
92
|
/** `LIMIT n` (R2 SQL: 1–10,000, default 500). */
|
|
93
93
|
limit(n) {
|
|
94
|
+
assertLimit(n);
|
|
94
95
|
this.limitValue = n;
|
|
95
96
|
return this;
|
|
96
97
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { renderOrderTerm } from './asc-
|
|
2
|
-
import { lit } from './Sql-
|
|
1
|
+
import { renderOrderTerm } from './asc-DZbQCxh1.mjs';
|
|
2
|
+
import { assertLimit, lit } from './Sql-B3zq2YGx.mjs';
|
|
3
3
|
|
|
4
4
|
const renderMember = (query) => {
|
|
5
5
|
const text = query.toSQL();
|
|
@@ -44,6 +44,7 @@ class SetOperation {
|
|
|
44
44
|
}
|
|
45
45
|
/** `LIMIT` applied to the combined result. */
|
|
46
46
|
limit(n) {
|
|
47
|
+
assertLimit(n);
|
|
47
48
|
this.limitValue = n;
|
|
48
49
|
return this;
|
|
49
50
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
const quoteString = (value) => `'${value.replaceAll("'", "''")}'`;
|
|
2
2
|
const IDENTIFIER_RE = /^\w+(?:\.\w+)*$/;
|
|
3
3
|
const TABLE_REF_RE = /^\w+(?:\.\w+)*(?:\s+(?:as\s+)?\w+)?$/i;
|
|
4
|
+
const MAX_LIMIT = 1e4;
|
|
4
5
|
class Sql {
|
|
5
6
|
text;
|
|
6
7
|
constructor(text) {
|
|
@@ -64,5 +65,10 @@ const sql = (strings, ...values) => {
|
|
|
64
65
|
return new Sql(out);
|
|
65
66
|
};
|
|
66
67
|
const joinSql = (parts, separator) => new Sql(parts.map((part) => toText(part)).join(separator));
|
|
68
|
+
const assertLimit = (n) => {
|
|
69
|
+
if (!Number.isInteger(n) || n < 1 || n > MAX_LIMIT) {
|
|
70
|
+
throw new RangeError(`r2sql: limit must be an integer between 1 and ${String(MAX_LIMIT)} (got ${String(n)}).`);
|
|
71
|
+
}
|
|
72
|
+
};
|
|
67
73
|
|
|
68
|
-
export { Sql, ident, isSql, joinSql, lit, raw, sql, tableRef, toText };
|
|
74
|
+
export { Sql, assertLimit, ident, isSql, joinSql, lit, raw, sql, tableRef, toText };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { renderOrderTerm } from './asc-
|
|
2
|
-
import { lit, toText } from './Sql-
|
|
3
|
-
import WindowExpression from './WindowExpression-
|
|
1
|
+
import { renderOrderTerm } from './asc-DZbQCxh1.mjs';
|
|
2
|
+
import { lit, toText } from './Sql-B3zq2YGx.mjs';
|
|
3
|
+
import WindowExpression from './WindowExpression-BT_uA6g1.mjs';
|
|
4
4
|
|
|
5
5
|
const toArray = (value) => {
|
|
6
6
|
if (value === void 0) {
|
package/dist/packem_shared/{buildImageDeliveryUrl-B6_QU91n.mjs → buildImageDeliveryUrl-qZ7XbqTL.mjs}
RENAMED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { LunoraError } from '@lunora/errors';
|
|
2
2
|
|
|
3
3
|
const ABSOLUTE_URL_RE = /^[a-z][a-z\d+\-.]*:\/\//i;
|
|
4
|
+
const FORBIDDEN_VALUE_CHARS = [",", "=", "#", "?", "/"];
|
|
4
5
|
const stripTrailingSlash = (value) => value.endsWith("/") ? value.slice(0, -1) : value;
|
|
5
6
|
const stripLeadingSlash = (value) => value.startsWith("/") ? value.slice(1) : value;
|
|
6
7
|
const serializeTransform = (transform) => Object.entries(transform).filter(([, value]) => value !== void 0 && (typeof value === "string" || typeof value === "number")).map(([key, value]) => {
|
|
7
8
|
const serialized = String(value);
|
|
8
|
-
|
|
9
|
+
const offendingChar = FORBIDDEN_VALUE_CHARS.find((char) => serialized.includes(char));
|
|
10
|
+
if (offendingChar !== void 0) {
|
|
9
11
|
throw new LunoraError(
|
|
10
12
|
"INTERNAL",
|
|
11
|
-
`@lunora/bindings/images: transform option \`${key}\` value \`${serialized}\` contains a
|
|
13
|
+
`@lunora/bindings/images: transform option \`${key}\` value \`${serialized}\` contains a \`${offendingChar}\`, which the /cdn-cgi/image/ option path cannot represent (\`,\`/\`=\` are the option/key-value separators; \`#\`/\`?\`/\`/\` are URL-structural). Percent-encode the value — for colors use \`%23RRGGBB\`, not \`#RRGGBB\` or \`rgb(r,g,b)\`.`
|
|
12
14
|
);
|
|
13
15
|
}
|
|
14
16
|
return `${key}=${serialized}`;
|
package/dist/packem_shared/{buildSignedImageUrl-6iibA9v1.mjs → buildSignedImageUrl-DNUFfyGP.mjs}
RENAMED
|
@@ -1,7 +1,16 @@
|
|
|
1
|
+
const evictOldestEntry = (map, capacity) => {
|
|
2
|
+
if (map.size < capacity) {
|
|
3
|
+
return;
|
|
4
|
+
}
|
|
5
|
+
const oldest = map.keys().next().value;
|
|
6
|
+
if (oldest !== void 0) {
|
|
7
|
+
map.delete(oldest);
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
|
|
1
11
|
const textEncoder = new TextEncoder();
|
|
2
|
-
const
|
|
3
|
-
const SCHEME_PREFIX_RE = /^[a-z][a-
|
|
4
|
-
const LEADING_SLASH_RE = /^\//;
|
|
12
|
+
const MAX_SIGNED_URL_TTL_SECONDS = 7 * 24 * 60 * 60;
|
|
13
|
+
const SCHEME_PREFIX_RE = /^[a-z][a-z0-9+\-.]*:\/\//i;
|
|
5
14
|
const toBase64Url = (bytes) => {
|
|
6
15
|
const binary = String.fromCodePoint(...bytes);
|
|
7
16
|
return btoa(binary).replaceAll("+", "-").replaceAll("/", "_").replaceAll("=", "");
|
|
@@ -22,16 +31,30 @@ const importHmacKey = async (secret) => {
|
|
|
22
31
|
if (cached) {
|
|
23
32
|
return cached;
|
|
24
33
|
}
|
|
25
|
-
|
|
26
|
-
const oldest = keyCache.keys().next().value;
|
|
27
|
-
if (oldest !== void 0) {
|
|
28
|
-
keyCache.delete(oldest);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
34
|
+
evictOldestEntry(keyCache, KEY_CACHE_MAX);
|
|
31
35
|
const keyPromise = crypto.subtle.importKey("raw", textEncoder.encode(secret), { hash: "SHA-256", name: "HMAC" }, false, ["sign", "verify"]);
|
|
32
36
|
keyCache.set(secret, keyPromise);
|
|
33
37
|
return keyPromise;
|
|
34
38
|
};
|
|
39
|
+
const extractHost = (input) => {
|
|
40
|
+
try {
|
|
41
|
+
return new URL(input).host;
|
|
42
|
+
} catch {
|
|
43
|
+
const noScheme = input.replace(SCHEME_PREFIX_RE, "");
|
|
44
|
+
return noScheme.split("/")[0] ?? "";
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
const signCanonical = async (secret, canonical) => {
|
|
48
|
+
const cryptoKey = await importHmacKey(secret);
|
|
49
|
+
const signature = await crypto.subtle.sign("HMAC", cryptoKey, textEncoder.encode(canonical));
|
|
50
|
+
return toBase64Url(new Uint8Array(signature));
|
|
51
|
+
};
|
|
52
|
+
const verifyCanonical = async (secret, canonical, sigBytes) => {
|
|
53
|
+
const cryptoKey = await importHmacKey(secret);
|
|
54
|
+
return crypto.subtle.verify("HMAC", cryptoKey, sigBytes, textEncoder.encode(canonical));
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const LEADING_SLASH_RE = /^\//;
|
|
35
58
|
const serializeTransform = (transform) => {
|
|
36
59
|
if (transform === void 0) {
|
|
37
60
|
return "";
|
|
@@ -42,30 +65,30 @@ const canonicalize = (host, key, exp, transform) => `${host.toLowerCase()}
|
|
|
42
65
|
${key}
|
|
43
66
|
${String(exp)}
|
|
44
67
|
${transform}`;
|
|
45
|
-
const extractHost = (input) => {
|
|
46
|
-
try {
|
|
47
|
-
return new URL(input).host;
|
|
48
|
-
} catch {
|
|
49
|
-
const noScheme = input.replace(SCHEME_PREFIX_RE, "");
|
|
50
|
-
return noScheme.split("/")[0] ?? "";
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
68
|
const encodeKey = (key) => key.split("/").map((segment) => encodeURIComponent(segment)).join("/");
|
|
54
69
|
const buildSignedImageUrl = async (options) => {
|
|
55
70
|
const expiresInSeconds = options.expiresInSeconds ?? 60 * 60;
|
|
56
71
|
if (!Number.isFinite(expiresInSeconds) || expiresInSeconds <= 0) {
|
|
57
72
|
throw new TypeError("@lunora/bindings/images: expiresInSeconds must be a positive finite number");
|
|
58
73
|
}
|
|
59
|
-
if (expiresInSeconds >
|
|
60
|
-
throw new TypeError(`@lunora/bindings/images: expiresInSeconds must not exceed ${String(
|
|
74
|
+
if (expiresInSeconds > MAX_SIGNED_URL_TTL_SECONDS) {
|
|
75
|
+
throw new TypeError(`@lunora/bindings/images: expiresInSeconds must not exceed ${String(MAX_SIGNED_URL_TTL_SECONDS)} (7 days)`);
|
|
76
|
+
}
|
|
77
|
+
let basePath = "";
|
|
78
|
+
try {
|
|
79
|
+
basePath = new URL(options.baseUrl).pathname;
|
|
80
|
+
} catch {
|
|
81
|
+
}
|
|
82
|
+
if (basePath !== "" && basePath !== "/") {
|
|
83
|
+
throw new TypeError(
|
|
84
|
+
`@lunora/bindings/images: baseUrl must not carry a path ("${basePath}") — the key is verified from the full URL pathname, so a subpath base would make every signed URL fail verification`
|
|
85
|
+
);
|
|
61
86
|
}
|
|
62
87
|
const exp = Math.floor(Date.now() / 1e3) + expiresInSeconds;
|
|
63
88
|
const host = extractHost(options.baseUrl);
|
|
64
89
|
const transform = serializeTransform(options.transform);
|
|
65
90
|
const normalizedKey = options.key.replace(LEADING_SLASH_RE, "");
|
|
66
|
-
const
|
|
67
|
-
const signature = await crypto.subtle.sign("HMAC", cryptoKey, textEncoder.encode(canonicalize(host, normalizedKey, exp, transform)));
|
|
68
|
-
const sig = toBase64Url(new Uint8Array(signature));
|
|
91
|
+
const sig = await signCanonical(options.secret, canonicalize(host, normalizedKey, exp, transform));
|
|
69
92
|
const base = options.baseUrl.endsWith("/") ? options.baseUrl.slice(0, -1) : options.baseUrl;
|
|
70
93
|
const safeKey = encodeKey(normalizedKey);
|
|
71
94
|
const tParameter = transform === "" ? "" : `&t=${encodeURIComponent(transform)}`;
|
|
@@ -97,13 +120,7 @@ const verifySignedImageUrl = async (input, secret, options) => {
|
|
|
97
120
|
return { reason: "malformed", valid: false };
|
|
98
121
|
}
|
|
99
122
|
const host = options?.expectedHost === void 0 ? url.host : extractHost(options.expectedHost);
|
|
100
|
-
const
|
|
101
|
-
const valid = await crypto.subtle.verify(
|
|
102
|
-
"HMAC",
|
|
103
|
-
cryptoKey,
|
|
104
|
-
sigBytes,
|
|
105
|
-
textEncoder.encode(canonicalize(host, key, exp, transform))
|
|
106
|
-
);
|
|
123
|
+
const valid = await verifyCanonical(secret, canonicalize(host, key, exp, transform), sigBytes);
|
|
107
124
|
if (!valid) {
|
|
108
125
|
return { reason: "bad_signature", valid: false };
|
|
109
126
|
}
|
|
@@ -6,17 +6,33 @@ const concurrentMap = async (items, limit, function_) => {
|
|
|
6
6
|
const effectiveLimit = Math.max(1, Math.min(limit, items.length));
|
|
7
7
|
const results = Array.from({ length: items.length });
|
|
8
8
|
let cursor = 0;
|
|
9
|
+
let failed = false;
|
|
10
|
+
let firstError;
|
|
9
11
|
const workers = Array.from({ length: effectiveLimit }, async () => {
|
|
10
12
|
for (; ; ) {
|
|
13
|
+
if (failed) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
11
16
|
const index = cursor;
|
|
12
17
|
cursor += 1;
|
|
13
18
|
if (index >= items.length) {
|
|
14
19
|
return;
|
|
15
20
|
}
|
|
16
|
-
|
|
21
|
+
try {
|
|
22
|
+
results[index] = await function_(items[index], index);
|
|
23
|
+
} catch (error) {
|
|
24
|
+
if (!failed) {
|
|
25
|
+
failed = true;
|
|
26
|
+
firstError = error;
|
|
27
|
+
}
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
17
30
|
}
|
|
18
31
|
});
|
|
19
32
|
await Promise.all(workers);
|
|
33
|
+
if (failed) {
|
|
34
|
+
throw firstError;
|
|
35
|
+
}
|
|
20
36
|
return results;
|
|
21
37
|
};
|
|
22
38
|
|
package/dist/packem_shared/{createContextVectors-BSizpmu5.mjs → createContextVectors-DwZtnPeC.mjs}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as concurrentMap, U as UPSERT_EMBED_CONCURRENCY } from './concurrent-
|
|
1
|
+
import { c as concurrentMap, U as UPSERT_EMBED_CONCURRENCY } from './concurrent-CkCEVwqP.mjs';
|
|
2
2
|
|
|
3
3
|
const createContextVectors = (lunora) => {
|
|
4
4
|
const upsert = async (indexName, input) => {
|
|
@@ -2,11 +2,13 @@ import { LunoraError } from '@lunora/errors';
|
|
|
2
2
|
|
|
3
3
|
const MAX_KEY_LENGTH = 512;
|
|
4
4
|
const MAX_LIST_LIMIT = 1e3;
|
|
5
|
+
const TEXT_ENCODER = new TextEncoder();
|
|
6
|
+
const byteLength = (value) => TEXT_ENCODER.encode(value).length;
|
|
5
7
|
const validateKey = (key) => {
|
|
6
8
|
if (typeof key !== "string" || key.length === 0) {
|
|
7
9
|
throw new TypeError("@lunora/bindings/kv: key must be a non-empty string");
|
|
8
10
|
}
|
|
9
|
-
if (key
|
|
11
|
+
if (byteLength(key) > MAX_KEY_LENGTH) {
|
|
10
12
|
throw new LunoraError("INTERNAL", `@lunora/bindings/kv: key exceeds ${String(MAX_KEY_LENGTH)}-byte limit`);
|
|
11
13
|
}
|
|
12
14
|
if (key.includes("\0")) {
|
|
@@ -23,7 +25,7 @@ const validatePrefix = (prefix) => {
|
|
|
23
25
|
if (prefix.length === 0) {
|
|
24
26
|
return;
|
|
25
27
|
}
|
|
26
|
-
if (prefix
|
|
28
|
+
if (byteLength(prefix) > MAX_KEY_LENGTH) {
|
|
27
29
|
throw new LunoraError("INTERNAL", `@lunora/bindings/kv: prefix exceeds ${String(MAX_KEY_LENGTH)}-byte limit`);
|
|
28
30
|
}
|
|
29
31
|
if (prefix.includes("\0")) {
|
|
@@ -41,7 +43,7 @@ const scopeKey = (prefix, key) => {
|
|
|
41
43
|
validateKey(key);
|
|
42
44
|
const trimmedPrefix = prefix.endsWith("/") ? prefix.slice(0, -1) : prefix;
|
|
43
45
|
const composed = `${trimmedPrefix}/${key}`;
|
|
44
|
-
if (composed
|
|
46
|
+
if (byteLength(composed) > MAX_KEY_LENGTH) {
|
|
45
47
|
throw new LunoraError("INTERNAL", `@lunora/bindings/kv: scoped key exceeds ${String(MAX_KEY_LENGTH)}-byte limit`);
|
|
46
48
|
}
|
|
47
49
|
return composed;
|
package/dist/packem_shared/{createKvIntrospector-CrAgQp1w.mjs → createKvIntrospector-Byk4GfsY.mjs}
RENAMED
|
@@ -4,7 +4,7 @@ const createKvIntrospector = (options) => {
|
|
|
4
4
|
const { namespaces } = options;
|
|
5
5
|
const resolveNamespace = (binding) => {
|
|
6
6
|
const ns = namespaces[binding];
|
|
7
|
-
if (ns === void 0) {
|
|
7
|
+
if (!Object.hasOwn(namespaces, binding) || ns === void 0) {
|
|
8
8
|
throw new LunoraError("BAD_REQUEST", `@lunora/bindings/kv: no namespace registered under binding "${binding}"`);
|
|
9
9
|
}
|
|
10
10
|
return ns;
|
|
@@ -29,11 +29,11 @@ const createVectorAdminIntrospector = (options) => {
|
|
|
29
29
|
}
|
|
30
30
|
const queryIndex = async ({ name, text, topK }) => {
|
|
31
31
|
const binding = indexes[name];
|
|
32
|
-
if (binding === void 0) {
|
|
32
|
+
if (!Object.hasOwn(indexes, name) || binding === void 0) {
|
|
33
33
|
throw new LunoraError("INTERNAL", `@lunora/bindings/vectors: no Vectorize binding registered for index "${name}"`);
|
|
34
34
|
}
|
|
35
35
|
const embed = embedders[name];
|
|
36
|
-
if (embed === void 0) {
|
|
36
|
+
if (!Object.hasOwn(embedders, name) || embed === void 0) {
|
|
37
37
|
throw new LunoraError("INTERNAL", `@lunora/bindings/vectors: no embedder registered for index "${name}" — it lists read-only`);
|
|
38
38
|
}
|
|
39
39
|
const vector = await embed(text);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { LunoraError } from '@lunora/errors';
|
|
2
|
-
import { c as concurrentMap, U as UPSERT_EMBED_CONCURRENCY } from './concurrent-
|
|
2
|
+
import { c as concurrentMap, U as UPSERT_EMBED_CONCURRENCY } from './concurrent-CkCEVwqP.mjs';
|
|
3
3
|
|
|
4
4
|
const resolveIndex = (indexes, name) => {
|
|
5
5
|
const index = indexes[name];
|
|
6
|
-
if (!index) {
|
|
6
|
+
if (!Object.hasOwn(indexes, name) || index === void 0) {
|
|
7
7
|
throw new LunoraError(
|
|
8
8
|
"INTERNAL",
|
|
9
9
|
`@lunora/bindings/vectors: no index registered for "${name}". Known indexes: ${Object.keys(indexes).join(", ") || "(none)"}`
|
package/dist/r2sql/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { default as SelectBuilder } from '../packem_shared/SelectBuilder-
|
|
2
|
-
export { R2SqlError, createR2Sql } from '../packem_shared/R2SqlError-
|
|
3
|
-
export { asc, desc, renderOrderTerm } from '../packem_shared/asc-
|
|
4
|
-
export { default as SetOperation } from '../packem_shared/SetOperation-
|
|
5
|
-
export { Sql, isSql, joinSql, lit, raw, sql, toText } from '../packem_shared/Sql-
|
|
6
|
-
export { WindowFunction, fn } from '../packem_shared/WindowFunction-
|
|
7
|
-
export { default as WindowExpression } from '../packem_shared/WindowExpression-
|
|
1
|
+
export { default as SelectBuilder } from '../packem_shared/SelectBuilder-BOqJQHEv.mjs';
|
|
2
|
+
export { R2SqlError, createR2Sql } from '../packem_shared/R2SqlError-drPKSCZ3.mjs';
|
|
3
|
+
export { asc, desc, renderOrderTerm } from '../packem_shared/asc-DZbQCxh1.mjs';
|
|
4
|
+
export { default as SetOperation } from '../packem_shared/SetOperation-DmPgUL8W.mjs';
|
|
5
|
+
export { Sql, isSql, joinSql, lit, raw, sql, toText } from '../packem_shared/Sql-B3zq2YGx.mjs';
|
|
6
|
+
export { WindowFunction, fn } from '../packem_shared/WindowFunction-DrnuZUF6.mjs';
|
|
7
|
+
export { default as WindowExpression } from '../packem_shared/WindowExpression-BT_uA6g1.mjs';
|
package/dist/vectors/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { createContextVectors, createVectorSyncHook } from '../packem_shared/createContextVectors-
|
|
2
|
-
export { createVectorAdminIntrospector } from '../packem_shared/createVectorAdminIntrospector-
|
|
3
|
-
export { default as createVectors } from '../packem_shared/createVectors-
|
|
1
|
+
export { createContextVectors, createVectorSyncHook } from '../packem_shared/createContextVectors-DwZtnPeC.mjs';
|
|
2
|
+
export { createVectorAdminIntrospector } from '../packem_shared/createVectorAdminIntrospector-DuSvcBa5.mjs';
|
|
3
|
+
export { default as createVectors } from '../packem_shared/createVectors-CTSrctiK.mjs';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lunora/bindings",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.7",
|
|
4
4
|
"description": "Lightweight Cloudflare binding helpers for Lunora — ctx.kv, ctx.images, ctx.analytics, ctx.pipelines, ctx.vectors, ctx.r2sql — one install, per-binding subpaths",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"analytics",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"access": "public"
|
|
65
65
|
},
|
|
66
66
|
"dependencies": {
|
|
67
|
-
"@lunora/errors": "1.0.0-alpha.
|
|
67
|
+
"@lunora/errors": "1.0.0-alpha.4"
|
|
68
68
|
},
|
|
69
69
|
"engines": {
|
|
70
70
|
"node": "^22.15.0 || >=24.11.0"
|