@lunora/bindings 1.0.0-alpha.12 → 1.0.0-alpha.14
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/analytics/index.d.mts +3 -24
- package/dist/analytics/index.d.ts +3 -24
- package/dist/kv/index.d.mts +3 -80
- package/dist/kv/index.d.ts +3 -80
- package/dist/vectors/index.d.mts +3 -53
- package/dist/vectors/index.d.ts +3 -53
- package/package.json +3 -2
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { AnalyticsEngineDataPoint, AnalyticsEngineDatasetLike } from '@lunora/platform';
|
|
2
|
+
export type { AnalyticsEngineDataPoint, AnalyticsEngineDatasetLike } from '@lunora/platform';
|
|
1
3
|
import { LunoraError } from '@lunora/errors';
|
|
2
4
|
/**
|
|
3
5
|
* Structural types for the Analytics Engine write path.
|
|
@@ -8,29 +10,6 @@ import { LunoraError } from '@lunora/errors';
|
|
|
8
10
|
* approach `@lunora/d1` takes with `D1DatabaseLike`
|
|
9
11
|
* (`packages/d1/src/d1-client.ts`).
|
|
10
12
|
*/
|
|
11
|
-
/**
|
|
12
|
-
* One Analytics Engine data point, mirroring the positional shape
|
|
13
|
-
* `writeDataPoint` accepts. AE stores up to 20 string `blobs`, up to 20 numeric
|
|
14
|
-
* `doubles`, and exactly **one** `index` (the high-cardinality sampling key) per
|
|
15
|
-
* data point — the SQL API later exposes them as `blob1..blob20`,
|
|
16
|
-
* `double1..double20`, and `index1`.
|
|
17
|
-
*/
|
|
18
|
-
interface AnalyticsEngineDataPoint {
|
|
19
|
-
/** String columns, mapped positionally to `blob1..blob20`. */
|
|
20
|
-
blobs?: (ArrayBuffer | null | string)[];
|
|
21
|
-
/** Numeric columns, mapped positionally to `double1..double20`. */
|
|
22
|
-
doubles?: number[];
|
|
23
|
-
/** Sampling key, exposed as `index1`. AE accepts at most one. */
|
|
24
|
-
indexes?: (ArrayBuffer | string)[];
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Minimal structural projection of workers-types' `AnalyticsEngineDataset`,
|
|
28
|
-
* kept loose enough for a plain-object fake in unit tests. `writeDataPoint` is
|
|
29
|
-
* fire-and-forget: it returns `void` and never throws on the hot path.
|
|
30
|
-
*/
|
|
31
|
-
interface AnalyticsEngineDatasetLike {
|
|
32
|
-
writeDataPoint: (event: AnalyticsEngineDataPoint) => void;
|
|
33
|
-
}
|
|
34
13
|
/**
|
|
35
14
|
* Named-field event handed to {@link AnalyticsClient.track}. Each field is
|
|
36
15
|
* mapped to a positional AE column and the mapping recorded in a returned
|
|
@@ -145,4 +124,4 @@ interface AnalyticsSqlClient {
|
|
|
145
124
|
* normalises AE's `{ meta, data, rows }` body into {@link AnalyticsSqlResult}.
|
|
146
125
|
*/
|
|
147
126
|
declare const createAnalyticsSqlClient: (config: AnalyticsSqlConfig) => AnalyticsSqlClient;
|
|
148
|
-
export { type AnalyticsClient, type
|
|
127
|
+
export { type AnalyticsClient, type AnalyticsSqlClient, type AnalyticsSqlColumnMeta, type AnalyticsSqlConfig, AnalyticsSqlError, type AnalyticsSqlResult, type TrackColumn, type TrackEvent, type TrackSchema, createAnalytics, createAnalyticsSqlClient };
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { AnalyticsEngineDataPoint, AnalyticsEngineDatasetLike } from '@lunora/platform';
|
|
2
|
+
export type { AnalyticsEngineDataPoint, AnalyticsEngineDatasetLike } from '@lunora/platform';
|
|
1
3
|
import { LunoraError } from '@lunora/errors';
|
|
2
4
|
/**
|
|
3
5
|
* Structural types for the Analytics Engine write path.
|
|
@@ -8,29 +10,6 @@ import { LunoraError } from '@lunora/errors';
|
|
|
8
10
|
* approach `@lunora/d1` takes with `D1DatabaseLike`
|
|
9
11
|
* (`packages/d1/src/d1-client.ts`).
|
|
10
12
|
*/
|
|
11
|
-
/**
|
|
12
|
-
* One Analytics Engine data point, mirroring the positional shape
|
|
13
|
-
* `writeDataPoint` accepts. AE stores up to 20 string `blobs`, up to 20 numeric
|
|
14
|
-
* `doubles`, and exactly **one** `index` (the high-cardinality sampling key) per
|
|
15
|
-
* data point — the SQL API later exposes them as `blob1..blob20`,
|
|
16
|
-
* `double1..double20`, and `index1`.
|
|
17
|
-
*/
|
|
18
|
-
interface AnalyticsEngineDataPoint {
|
|
19
|
-
/** String columns, mapped positionally to `blob1..blob20`. */
|
|
20
|
-
blobs?: (ArrayBuffer | null | string)[];
|
|
21
|
-
/** Numeric columns, mapped positionally to `double1..double20`. */
|
|
22
|
-
doubles?: number[];
|
|
23
|
-
/** Sampling key, exposed as `index1`. AE accepts at most one. */
|
|
24
|
-
indexes?: (ArrayBuffer | string)[];
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Minimal structural projection of workers-types' `AnalyticsEngineDataset`,
|
|
28
|
-
* kept loose enough for a plain-object fake in unit tests. `writeDataPoint` is
|
|
29
|
-
* fire-and-forget: it returns `void` and never throws on the hot path.
|
|
30
|
-
*/
|
|
31
|
-
interface AnalyticsEngineDatasetLike {
|
|
32
|
-
writeDataPoint: (event: AnalyticsEngineDataPoint) => void;
|
|
33
|
-
}
|
|
34
13
|
/**
|
|
35
14
|
* Named-field event handed to {@link AnalyticsClient.track}. Each field is
|
|
36
15
|
* mapped to a positional AE column and the mapping recorded in a returned
|
|
@@ -145,4 +124,4 @@ interface AnalyticsSqlClient {
|
|
|
145
124
|
* normalises AE's `{ meta, data, rows }` body into {@link AnalyticsSqlResult}.
|
|
146
125
|
*/
|
|
147
126
|
declare const createAnalyticsSqlClient: (config: AnalyticsSqlConfig) => AnalyticsSqlClient;
|
|
148
|
-
export { type AnalyticsClient, type
|
|
127
|
+
export { type AnalyticsClient, type AnalyticsSqlClient, type AnalyticsSqlColumnMeta, type AnalyticsSqlConfig, AnalyticsSqlError, type AnalyticsSqlResult, type TrackColumn, type TrackEvent, type TrackSchema, createAnalytics, createAnalyticsSqlClient };
|
package/dist/kv/index.d.mts
CHANGED
|
@@ -1,82 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* `KVNamespace` `get`/`put` body unions; declared here so the package stays
|
|
4
|
-
* runtime-agnostic and the `*Like` interfaces don't pull in
|
|
5
|
-
* `@cloudflare/workers-types` at runtime.
|
|
6
|
-
*/
|
|
7
|
-
type KvValue = ReadableStream | ArrayBuffer | ArrayBufferView | string;
|
|
8
|
-
/** How a raw KV read should decode the stored value. Mirrors KV's `type` option. */
|
|
9
|
-
type KvValueType = "text" | "json" | "arrayBuffer" | "stream";
|
|
10
|
-
/**
|
|
11
|
-
* Per-read options forwarded to the binding. `cacheTtl` is KV's edge-cache TTL
|
|
12
|
-
* (seconds, min 60); `type` selects the decode mode for {@link Kv.getRaw}.
|
|
13
|
-
*/
|
|
14
|
-
interface KvGetOptions {
|
|
15
|
-
/** KV edge-cache TTL in seconds (minimum 60). Forwarded verbatim. */
|
|
16
|
-
cacheTtl?: number;
|
|
17
|
-
/** Decode mode for a raw read. {@link Kv.get} always uses `"json"`. */
|
|
18
|
-
type?: KvValueType;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Minimal projection of Cloudflare's `KVNamespace`. Declared structurally so
|
|
22
|
-
* unit tests can pass a plain `Map`-backed double; the real binding satisfies
|
|
23
|
-
* the same shape. Mirrors `R2BucketLike` in `@lunora/storage`.
|
|
24
|
-
*/
|
|
25
|
-
interface KVNamespaceLike {
|
|
26
|
-
/** Delete a key. No-op if the key is absent. */
|
|
27
|
-
delete: (key: string) => Promise<void>;
|
|
28
|
-
/**
|
|
29
|
-
* Read a value. The real binding overloads on `options.type`; declared here
|
|
30
|
-
* as the broad union so a structural double need only return the value (or
|
|
31
|
-
* `null` when absent).
|
|
32
|
-
*/
|
|
33
|
-
get: (key: string, options?: KvGetOptions | KvValueType) => Promise<unknown>;
|
|
34
|
-
/**
|
|
35
|
-
* Read a value together with its associated metadata. Returns
|
|
36
|
-
* `{ value: null, metadata: null }` when the key is absent.
|
|
37
|
-
*/
|
|
38
|
-
getWithMetadata: (key: string, options?: KvGetOptions | KvValueType) => Promise<{
|
|
39
|
-
metadata: unknown;
|
|
40
|
-
value: unknown;
|
|
41
|
-
}>;
|
|
42
|
-
/** List keys, optionally filtered by `prefix` and paginated via `cursor`. */
|
|
43
|
-
list: (options?: {
|
|
44
|
-
cursor?: string;
|
|
45
|
-
limit?: number;
|
|
46
|
-
prefix?: string;
|
|
47
|
-
}) => Promise<KvNamespaceListResult>;
|
|
48
|
-
/** Write a value, optionally with TTL/expiration and metadata. */
|
|
49
|
-
put: (key: string, value: KvValue, options?: KvNamespacePutOptions) => Promise<void>;
|
|
50
|
-
}
|
|
51
|
-
/** The raw put options the KV binding accepts (mirrors `KVNamespacePutOptions`). */
|
|
52
|
-
interface KvNamespacePutOptions {
|
|
53
|
-
/** Absolute expiration as a Unix timestamp (seconds). Mutually exclusive with `expirationTtl`. */
|
|
54
|
-
expiration?: number;
|
|
55
|
-
/** Relative expiration in seconds from now (minimum 60). Mutually exclusive with `expiration`. */
|
|
56
|
-
expirationTtl?: number;
|
|
57
|
-
/** Arbitrary JSON metadata stored alongside the value, returned by `getWithMetadata`/`list`. */
|
|
58
|
-
metadata?: unknown;
|
|
59
|
-
}
|
|
60
|
-
/** One key entry as returned by the KV binding's `list`. */
|
|
61
|
-
interface KvListKey<Metadata = unknown> {
|
|
62
|
-
/** Absolute expiration (Unix seconds), when the key has one. */
|
|
63
|
-
expiration?: number;
|
|
64
|
-
/** The key's metadata, when set at write time. */
|
|
65
|
-
metadata?: Metadata;
|
|
66
|
-
/** The key name. */
|
|
67
|
-
name: string;
|
|
68
|
-
}
|
|
69
|
-
/** The raw `list` result shape returned by the KV binding. */
|
|
70
|
-
type KvNamespaceListResult<Metadata = unknown> = {
|
|
71
|
-
cacheStatus?: string | null;
|
|
72
|
-
cursor: string;
|
|
73
|
-
keys: KvListKey<Metadata>[];
|
|
74
|
-
list_complete: false;
|
|
75
|
-
} | {
|
|
76
|
-
cacheStatus?: string | null;
|
|
77
|
-
keys: KvListKey<Metadata>[];
|
|
78
|
-
list_complete: true;
|
|
79
|
-
};
|
|
1
|
+
import { KvGetOptions, KvListKey, KVNamespaceLike } from '@lunora/platform';
|
|
2
|
+
export type { KVNamespaceLike, KvGetOptions, KvListKey, KvNamespaceListResult, KvNamespacePutOptions, KvValue, KvValueType } from '@lunora/platform';
|
|
80
3
|
/** Construction options for the `createKv` factory. */
|
|
81
4
|
interface LunoraKvOptions {
|
|
82
5
|
/**
|
|
@@ -268,4 +191,4 @@ declare const createKvIntrospector: (options: CreateKvIntrospectorOptions) => Kv
|
|
|
268
191
|
* ```
|
|
269
192
|
*/
|
|
270
193
|
declare const createKvIntrospectorFromEnv: (env: unknown) => KvIntrospectorLike;
|
|
271
|
-
export { type CreateKvIntrospectorOptions, type
|
|
194
|
+
export { type CreateKvIntrospectorOptions, type Kv, type KvIntrospectorLike, type KvListOptions, type KvListResult, type KvPutOptions, type KvValueWithMetadata, type LunoraKvOptions, createKv, createKvIntrospector, createKvIntrospectorFromEnv, scopeKey };
|
package/dist/kv/index.d.ts
CHANGED
|
@@ -1,82 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* `KVNamespace` `get`/`put` body unions; declared here so the package stays
|
|
4
|
-
* runtime-agnostic and the `*Like` interfaces don't pull in
|
|
5
|
-
* `@cloudflare/workers-types` at runtime.
|
|
6
|
-
*/
|
|
7
|
-
type KvValue = ReadableStream | ArrayBuffer | ArrayBufferView | string;
|
|
8
|
-
/** How a raw KV read should decode the stored value. Mirrors KV's `type` option. */
|
|
9
|
-
type KvValueType = "text" | "json" | "arrayBuffer" | "stream";
|
|
10
|
-
/**
|
|
11
|
-
* Per-read options forwarded to the binding. `cacheTtl` is KV's edge-cache TTL
|
|
12
|
-
* (seconds, min 60); `type` selects the decode mode for {@link Kv.getRaw}.
|
|
13
|
-
*/
|
|
14
|
-
interface KvGetOptions {
|
|
15
|
-
/** KV edge-cache TTL in seconds (minimum 60). Forwarded verbatim. */
|
|
16
|
-
cacheTtl?: number;
|
|
17
|
-
/** Decode mode for a raw read. {@link Kv.get} always uses `"json"`. */
|
|
18
|
-
type?: KvValueType;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Minimal projection of Cloudflare's `KVNamespace`. Declared structurally so
|
|
22
|
-
* unit tests can pass a plain `Map`-backed double; the real binding satisfies
|
|
23
|
-
* the same shape. Mirrors `R2BucketLike` in `@lunora/storage`.
|
|
24
|
-
*/
|
|
25
|
-
interface KVNamespaceLike {
|
|
26
|
-
/** Delete a key. No-op if the key is absent. */
|
|
27
|
-
delete: (key: string) => Promise<void>;
|
|
28
|
-
/**
|
|
29
|
-
* Read a value. The real binding overloads on `options.type`; declared here
|
|
30
|
-
* as the broad union so a structural double need only return the value (or
|
|
31
|
-
* `null` when absent).
|
|
32
|
-
*/
|
|
33
|
-
get: (key: string, options?: KvGetOptions | KvValueType) => Promise<unknown>;
|
|
34
|
-
/**
|
|
35
|
-
* Read a value together with its associated metadata. Returns
|
|
36
|
-
* `{ value: null, metadata: null }` when the key is absent.
|
|
37
|
-
*/
|
|
38
|
-
getWithMetadata: (key: string, options?: KvGetOptions | KvValueType) => Promise<{
|
|
39
|
-
metadata: unknown;
|
|
40
|
-
value: unknown;
|
|
41
|
-
}>;
|
|
42
|
-
/** List keys, optionally filtered by `prefix` and paginated via `cursor`. */
|
|
43
|
-
list: (options?: {
|
|
44
|
-
cursor?: string;
|
|
45
|
-
limit?: number;
|
|
46
|
-
prefix?: string;
|
|
47
|
-
}) => Promise<KvNamespaceListResult>;
|
|
48
|
-
/** Write a value, optionally with TTL/expiration and metadata. */
|
|
49
|
-
put: (key: string, value: KvValue, options?: KvNamespacePutOptions) => Promise<void>;
|
|
50
|
-
}
|
|
51
|
-
/** The raw put options the KV binding accepts (mirrors `KVNamespacePutOptions`). */
|
|
52
|
-
interface KvNamespacePutOptions {
|
|
53
|
-
/** Absolute expiration as a Unix timestamp (seconds). Mutually exclusive with `expirationTtl`. */
|
|
54
|
-
expiration?: number;
|
|
55
|
-
/** Relative expiration in seconds from now (minimum 60). Mutually exclusive with `expiration`. */
|
|
56
|
-
expirationTtl?: number;
|
|
57
|
-
/** Arbitrary JSON metadata stored alongside the value, returned by `getWithMetadata`/`list`. */
|
|
58
|
-
metadata?: unknown;
|
|
59
|
-
}
|
|
60
|
-
/** One key entry as returned by the KV binding's `list`. */
|
|
61
|
-
interface KvListKey<Metadata = unknown> {
|
|
62
|
-
/** Absolute expiration (Unix seconds), when the key has one. */
|
|
63
|
-
expiration?: number;
|
|
64
|
-
/** The key's metadata, when set at write time. */
|
|
65
|
-
metadata?: Metadata;
|
|
66
|
-
/** The key name. */
|
|
67
|
-
name: string;
|
|
68
|
-
}
|
|
69
|
-
/** The raw `list` result shape returned by the KV binding. */
|
|
70
|
-
type KvNamespaceListResult<Metadata = unknown> = {
|
|
71
|
-
cacheStatus?: string | null;
|
|
72
|
-
cursor: string;
|
|
73
|
-
keys: KvListKey<Metadata>[];
|
|
74
|
-
list_complete: false;
|
|
75
|
-
} | {
|
|
76
|
-
cacheStatus?: string | null;
|
|
77
|
-
keys: KvListKey<Metadata>[];
|
|
78
|
-
list_complete: true;
|
|
79
|
-
};
|
|
1
|
+
import { KvGetOptions, KvListKey, KVNamespaceLike } from '@lunora/platform';
|
|
2
|
+
export type { KVNamespaceLike, KvGetOptions, KvListKey, KvNamespaceListResult, KvNamespacePutOptions, KvValue, KvValueType } from '@lunora/platform';
|
|
80
3
|
/** Construction options for the `createKv` factory. */
|
|
81
4
|
interface LunoraKvOptions {
|
|
82
5
|
/**
|
|
@@ -268,4 +191,4 @@ declare const createKvIntrospector: (options: CreateKvIntrospectorOptions) => Kv
|
|
|
268
191
|
* ```
|
|
269
192
|
*/
|
|
270
193
|
declare const createKvIntrospectorFromEnv: (env: unknown) => KvIntrospectorLike;
|
|
271
|
-
export { type CreateKvIntrospectorOptions, type
|
|
194
|
+
export { type CreateKvIntrospectorOptions, type Kv, type KvIntrospectorLike, type KvListOptions, type KvListResult, type KvPutOptions, type KvValueWithMetadata, type LunoraKvOptions, createKv, createKvIntrospector, createKvIntrospectorFromEnv, scopeKey };
|
package/dist/vectors/index.d.mts
CHANGED
|
@@ -1,55 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* plain-object double and the real Cloudflare binding satisfies the same shape.
|
|
4
|
-
* Mirrors the surface documented at
|
|
5
|
-
* https://developers.cloudflare.com/vectorize/reference/client-api/.
|
|
6
|
-
*/
|
|
7
|
-
interface VectorizeIndexLike {
|
|
8
|
-
deleteByIds: (ids: ReadonlyArray<string>) => Promise<VectorizeDeleteMutation>;
|
|
9
|
-
describe?: () => Promise<VectorizeIndexDetails>;
|
|
10
|
-
getByIds: (ids: ReadonlyArray<string>) => Promise<ReadonlyArray<VectorizeVector>>;
|
|
11
|
-
insert: (vectors: ReadonlyArray<VectorizeVector>) => Promise<VectorizeUpsertMutation>;
|
|
12
|
-
query: (vector: ReadonlyArray<number>, options?: VectorizeQueryOptions) => Promise<VectorizeMatches>;
|
|
13
|
-
upsert: (vectors: ReadonlyArray<VectorizeVector>) => Promise<VectorizeUpsertMutation>;
|
|
14
|
-
}
|
|
15
|
-
type VectorMetric = "cosine" | "euclidean" | "dot-product";
|
|
16
|
-
interface VectorizeVector {
|
|
17
|
-
id: string;
|
|
18
|
-
metadata?: Record<string, unknown>;
|
|
19
|
-
namespace?: string;
|
|
20
|
-
values: ReadonlyArray<number>;
|
|
21
|
-
}
|
|
22
|
-
interface VectorizeQueryOptions {
|
|
23
|
-
filter?: Record<string, unknown>;
|
|
24
|
-
namespace?: string;
|
|
25
|
-
returnMetadata?: "none" | "indexed" | "all";
|
|
26
|
-
returnValues?: boolean;
|
|
27
|
-
topK?: number;
|
|
28
|
-
}
|
|
29
|
-
interface VectorizeMatch {
|
|
30
|
-
id: string;
|
|
31
|
-
metadata?: Record<string, unknown>;
|
|
32
|
-
namespace?: string;
|
|
33
|
-
score: number;
|
|
34
|
-
values?: ReadonlyArray<number>;
|
|
35
|
-
}
|
|
36
|
-
interface VectorizeMatches {
|
|
37
|
-
count: number;
|
|
38
|
-
matches: ReadonlyArray<VectorizeMatch>;
|
|
39
|
-
}
|
|
40
|
-
interface VectorizeUpsertMutation {
|
|
41
|
-
mutationId: string;
|
|
42
|
-
}
|
|
43
|
-
interface VectorizeDeleteMutation {
|
|
44
|
-
count?: number;
|
|
45
|
-
mutationId: string;
|
|
46
|
-
}
|
|
47
|
-
interface VectorizeIndexDetails {
|
|
48
|
-
dimensions: number;
|
|
49
|
-
processedUpToDatetime?: string;
|
|
50
|
-
processedUpToMutation?: string;
|
|
51
|
-
vectorsCount: number;
|
|
52
|
-
}
|
|
1
|
+
import { VectorizeDeleteMutation, VectorizeIndexDetails, VectorizeVector, VectorizeMatches, VectorizeUpsertMutation, VectorizeIndexLike, VectorMetric } from '@lunora/platform';
|
|
2
|
+
export type { VectorMetric, VectorizeDeleteMutation, VectorizeIndexDetails, VectorizeIndexLike, VectorizeMatch, VectorizeMatches, VectorizeQueryOptions, VectorizeUpsertMutation, VectorizeVector } from '@lunora/platform';
|
|
53
3
|
/**
|
|
54
4
|
* Bring-your-own-embedder: a user-supplied async fn that converts a single
|
|
55
5
|
* source value (a row, a chunk, an arbitrary string) into a numeric vector.
|
|
@@ -282,4 +232,4 @@ interface VectorAdminIntrospectorOptions {
|
|
|
282
232
|
*/
|
|
283
233
|
declare const createVectorAdminIntrospector: (options: VectorAdminIntrospectorOptions) => VectorAdminIntrospector;
|
|
284
234
|
declare const createVectors: (options: LunoraVectorsOptions) => LunoraVectors;
|
|
285
|
-
export { type EmbedFunction, type LunoraVectors, type LunoraVectorsOptions, type QueryInput, type SchemaLike, type TableDefinitionLike, type TableVectorIndexLike, type UpsertInput, type VectorAdminIndexSummary, type VectorAdminIntrospector, type VectorAdminIntrospectorOptions, type VectorAdminQueryMatch, type VectorEmbedderLike, type VectorIndexDefinitionLike, type VectorIndexRegistryEntry, type VectorMatchLike, type VectorMatchesLike, type
|
|
235
|
+
export { type EmbedFunction, type LunoraVectors, type LunoraVectorsOptions, type QueryInput, type SchemaLike, type TableDefinitionLike, type TableVectorIndexLike, type UpsertInput, type VectorAdminIndexSummary, type VectorAdminIntrospector, type VectorAdminIntrospectorOptions, type VectorAdminQueryMatch, type VectorEmbedderLike, type VectorIndexDefinitionLike, type VectorIndexRegistryEntry, type VectorMatchLike, type VectorMatchesLike, type VectorQueryInputLike, type VectorRecordLike, type VectorSearchLike, type VectorUpsertInputLike, type WriteEvent, type WriteHook, createContextVectors, createVectorAdminIntrospector, createVectorSyncHook, createVectors };
|
package/dist/vectors/index.d.ts
CHANGED
|
@@ -1,55 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* plain-object double and the real Cloudflare binding satisfies the same shape.
|
|
4
|
-
* Mirrors the surface documented at
|
|
5
|
-
* https://developers.cloudflare.com/vectorize/reference/client-api/.
|
|
6
|
-
*/
|
|
7
|
-
interface VectorizeIndexLike {
|
|
8
|
-
deleteByIds: (ids: ReadonlyArray<string>) => Promise<VectorizeDeleteMutation>;
|
|
9
|
-
describe?: () => Promise<VectorizeIndexDetails>;
|
|
10
|
-
getByIds: (ids: ReadonlyArray<string>) => Promise<ReadonlyArray<VectorizeVector>>;
|
|
11
|
-
insert: (vectors: ReadonlyArray<VectorizeVector>) => Promise<VectorizeUpsertMutation>;
|
|
12
|
-
query: (vector: ReadonlyArray<number>, options?: VectorizeQueryOptions) => Promise<VectorizeMatches>;
|
|
13
|
-
upsert: (vectors: ReadonlyArray<VectorizeVector>) => Promise<VectorizeUpsertMutation>;
|
|
14
|
-
}
|
|
15
|
-
type VectorMetric = "cosine" | "euclidean" | "dot-product";
|
|
16
|
-
interface VectorizeVector {
|
|
17
|
-
id: string;
|
|
18
|
-
metadata?: Record<string, unknown>;
|
|
19
|
-
namespace?: string;
|
|
20
|
-
values: ReadonlyArray<number>;
|
|
21
|
-
}
|
|
22
|
-
interface VectorizeQueryOptions {
|
|
23
|
-
filter?: Record<string, unknown>;
|
|
24
|
-
namespace?: string;
|
|
25
|
-
returnMetadata?: "none" | "indexed" | "all";
|
|
26
|
-
returnValues?: boolean;
|
|
27
|
-
topK?: number;
|
|
28
|
-
}
|
|
29
|
-
interface VectorizeMatch {
|
|
30
|
-
id: string;
|
|
31
|
-
metadata?: Record<string, unknown>;
|
|
32
|
-
namespace?: string;
|
|
33
|
-
score: number;
|
|
34
|
-
values?: ReadonlyArray<number>;
|
|
35
|
-
}
|
|
36
|
-
interface VectorizeMatches {
|
|
37
|
-
count: number;
|
|
38
|
-
matches: ReadonlyArray<VectorizeMatch>;
|
|
39
|
-
}
|
|
40
|
-
interface VectorizeUpsertMutation {
|
|
41
|
-
mutationId: string;
|
|
42
|
-
}
|
|
43
|
-
interface VectorizeDeleteMutation {
|
|
44
|
-
count?: number;
|
|
45
|
-
mutationId: string;
|
|
46
|
-
}
|
|
47
|
-
interface VectorizeIndexDetails {
|
|
48
|
-
dimensions: number;
|
|
49
|
-
processedUpToDatetime?: string;
|
|
50
|
-
processedUpToMutation?: string;
|
|
51
|
-
vectorsCount: number;
|
|
52
|
-
}
|
|
1
|
+
import { VectorizeDeleteMutation, VectorizeIndexDetails, VectorizeVector, VectorizeMatches, VectorizeUpsertMutation, VectorizeIndexLike, VectorMetric } from '@lunora/platform';
|
|
2
|
+
export type { VectorMetric, VectorizeDeleteMutation, VectorizeIndexDetails, VectorizeIndexLike, VectorizeMatch, VectorizeMatches, VectorizeQueryOptions, VectorizeUpsertMutation, VectorizeVector } from '@lunora/platform';
|
|
53
3
|
/**
|
|
54
4
|
* Bring-your-own-embedder: a user-supplied async fn that converts a single
|
|
55
5
|
* source value (a row, a chunk, an arbitrary string) into a numeric vector.
|
|
@@ -282,4 +232,4 @@ interface VectorAdminIntrospectorOptions {
|
|
|
282
232
|
*/
|
|
283
233
|
declare const createVectorAdminIntrospector: (options: VectorAdminIntrospectorOptions) => VectorAdminIntrospector;
|
|
284
234
|
declare const createVectors: (options: LunoraVectorsOptions) => LunoraVectors;
|
|
285
|
-
export { type EmbedFunction, type LunoraVectors, type LunoraVectorsOptions, type QueryInput, type SchemaLike, type TableDefinitionLike, type TableVectorIndexLike, type UpsertInput, type VectorAdminIndexSummary, type VectorAdminIntrospector, type VectorAdminIntrospectorOptions, type VectorAdminQueryMatch, type VectorEmbedderLike, type VectorIndexDefinitionLike, type VectorIndexRegistryEntry, type VectorMatchLike, type VectorMatchesLike, type
|
|
235
|
+
export { type EmbedFunction, type LunoraVectors, type LunoraVectorsOptions, type QueryInput, type SchemaLike, type TableDefinitionLike, type TableVectorIndexLike, type UpsertInput, type VectorAdminIndexSummary, type VectorAdminIntrospector, type VectorAdminIntrospectorOptions, type VectorAdminQueryMatch, type VectorEmbedderLike, type VectorIndexDefinitionLike, type VectorIndexRegistryEntry, type VectorMatchLike, type VectorMatchesLike, type VectorQueryInputLike, type VectorRecordLike, type VectorSearchLike, type VectorUpsertInputLike, type WriteEvent, type WriteHook, createContextVectors, createVectorAdminIntrospector, createVectorSyncHook, createVectors };
|
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.14",
|
|
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,8 @@
|
|
|
64
64
|
"access": "public"
|
|
65
65
|
},
|
|
66
66
|
"dependencies": {
|
|
67
|
-
"@lunora/errors": "1.0.0-alpha.
|
|
67
|
+
"@lunora/errors": "1.0.0-alpha.9",
|
|
68
|
+
"@lunora/platform": "1.0.0-alpha.1"
|
|
68
69
|
},
|
|
69
70
|
"engines": {
|
|
70
71
|
"node": "^22.15.0 || >=24.11.0"
|