@ekodb/ekodb-client 0.16.0 → 0.17.0
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/functions.d.ts +182 -4
- package/dist/functions.js +117 -0
- package/dist/functions.test.d.ts +9 -0
- package/dist/functions.test.js +327 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/package.json +1 -1
- package/src/functions.test.ts +444 -0
- package/src/functions.ts +265 -4
- package/src/index.ts +2 -1
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Unit tests for the stored-function builder helpers (Stage + parameterRef).
|
|
4
|
+
*
|
|
5
|
+
* These tests cover the pure-data construction helpers and the structural
|
|
6
|
+
* parameter placeholder. They don't hit a running ekoDB — server-side
|
|
7
|
+
* behavior is covered by the Rust integration tests in
|
|
8
|
+
* `ekodb/ekodb_server/tests/function_parameters_tests.rs`.
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
const vitest_1 = require("vitest");
|
|
12
|
+
const functions_1 = require("./functions");
|
|
13
|
+
(0, vitest_1.describe)("parameterRef", () => {
|
|
14
|
+
(0, vitest_1.it)("produces the structural placeholder shape ekoDB's resolver expects", () => {
|
|
15
|
+
(0, vitest_1.expect)((0, functions_1.parameterRef)("record")).toEqual({
|
|
16
|
+
type: "Parameter",
|
|
17
|
+
name: "record",
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
(0, vitest_1.it)("preserves an arbitrary parameter name verbatim", () => {
|
|
21
|
+
(0, vitest_1.expect)((0, functions_1.parameterRef)("user_id").name).toBe("user_id");
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
(0, vitest_1.describe)("Stage.param", () => {
|
|
25
|
+
(0, vitest_1.it)("is an alias for parameterRef(name)", () => {
|
|
26
|
+
(0, vitest_1.expect)(functions_1.Stage.param("x")).toEqual((0, functions_1.parameterRef)("x"));
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
(0, vitest_1.describe)("Stage.insert with a structural parameter placeholder", () => {
|
|
30
|
+
(0, vitest_1.it)("embeds the whole-record placeholder into Insert.record", () => {
|
|
31
|
+
const stage = functions_1.Stage.insert("users", functions_1.Stage.param("record"));
|
|
32
|
+
(0, vitest_1.expect)(stage.type).toBe("Insert");
|
|
33
|
+
(0, vitest_1.expect)(stage.collection).toBe("users");
|
|
34
|
+
(0, vitest_1.expect)(stage.record).toEqual({ type: "Parameter", name: "record" });
|
|
35
|
+
});
|
|
36
|
+
(0, vitest_1.it)("also accepts per-field placeholders mixed with literal values", () => {
|
|
37
|
+
const stage = functions_1.Stage.insert("items", {
|
|
38
|
+
label: "{{label}}",
|
|
39
|
+
parent_id: functions_1.Stage.param("parent_id"),
|
|
40
|
+
kind: "item",
|
|
41
|
+
tags: functions_1.Stage.param("tags"),
|
|
42
|
+
});
|
|
43
|
+
(0, vitest_1.expect)(stage.record.label).toBe("{{label}}");
|
|
44
|
+
(0, vitest_1.expect)(stage.record.parent_id).toEqual({
|
|
45
|
+
type: "Parameter",
|
|
46
|
+
name: "parent_id",
|
|
47
|
+
});
|
|
48
|
+
(0, vitest_1.expect)(stage.record.kind).toBe("item");
|
|
49
|
+
(0, vitest_1.expect)(stage.record.tags).toEqual({ type: "Parameter", name: "tags" });
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
(0, vitest_1.describe)("Stage.updateById with a structural parameter placeholder", () => {
|
|
53
|
+
(0, vitest_1.it)("embeds the whole-updates placeholder into UpdateById.updates", () => {
|
|
54
|
+
const stage = functions_1.Stage.updateById("items", "{{id}}", functions_1.Stage.param("updates"));
|
|
55
|
+
(0, vitest_1.expect)(stage.type).toBe("UpdateById");
|
|
56
|
+
(0, vitest_1.expect)(stage.collection).toBe("items");
|
|
57
|
+
(0, vitest_1.expect)(stage.record_id).toBe("{{id}}");
|
|
58
|
+
(0, vitest_1.expect)(stage.updates).toEqual({ type: "Parameter", name: "updates" });
|
|
59
|
+
});
|
|
60
|
+
(0, vitest_1.it)("accepts per-field placeholders for partial fine-grained updates", () => {
|
|
61
|
+
const stage = functions_1.Stage.updateById("items", "{{id}}", {
|
|
62
|
+
label: "{{label}}",
|
|
63
|
+
updated_at: "{{updated_at}}",
|
|
64
|
+
});
|
|
65
|
+
(0, vitest_1.expect)(stage.updates.label).toBe("{{label}}");
|
|
66
|
+
(0, vitest_1.expect)(stage.updates.updated_at).toBe("{{updated_at}}");
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
(0, vitest_1.describe)("Stage.update (filter-based) with structural updates", () => {
|
|
70
|
+
(0, vitest_1.it)("accepts a Parameter placeholder in both filter values and the updates body", () => {
|
|
71
|
+
const stage = functions_1.Stage.update("items", {
|
|
72
|
+
type: "Condition",
|
|
73
|
+
content: {
|
|
74
|
+
field: "id",
|
|
75
|
+
operator: "Eq",
|
|
76
|
+
value: functions_1.Stage.param("id"),
|
|
77
|
+
},
|
|
78
|
+
}, functions_1.Stage.param("updates"));
|
|
79
|
+
(0, vitest_1.expect)(stage.type).toBe("Update");
|
|
80
|
+
(0, vitest_1.expect)(stage.filter).toEqual({
|
|
81
|
+
type: "Condition",
|
|
82
|
+
content: {
|
|
83
|
+
field: "id",
|
|
84
|
+
operator: "Eq",
|
|
85
|
+
value: { type: "Parameter", name: "id" },
|
|
86
|
+
},
|
|
87
|
+
});
|
|
88
|
+
(0, vitest_1.expect)(stage.updates).toEqual({ type: "Parameter", name: "updates" });
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
(0, vitest_1.describe)("Stage.batchInsert with structural placeholders inside each record", () => {
|
|
92
|
+
(0, vitest_1.it)("lets callers template each record's record-body from params", () => {
|
|
93
|
+
const stage = functions_1.Stage.batchInsert("audit_log", [
|
|
94
|
+
{ actor: functions_1.Stage.param("user_id"), at: "{{now}}", message: "created" },
|
|
95
|
+
{ actor: functions_1.Stage.param("user_id"), at: "{{now}}", message: "initialized" },
|
|
96
|
+
]);
|
|
97
|
+
(0, vitest_1.expect)(stage.type).toBe("BatchInsert");
|
|
98
|
+
(0, vitest_1.expect)(stage.records).toHaveLength(2);
|
|
99
|
+
(0, vitest_1.expect)(stage.records[0].actor).toEqual({
|
|
100
|
+
type: "Parameter",
|
|
101
|
+
name: "user_id",
|
|
102
|
+
});
|
|
103
|
+
(0, vitest_1.expect)(stage.records[0].at).toBe("{{now}}");
|
|
104
|
+
(0, vitest_1.expect)(stage.records[1].message).toBe("initialized");
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
(0, vitest_1.describe)("JSON serialization round-trip (what actually goes on the wire)", () => {
|
|
108
|
+
(0, vitest_1.it)("serializes a structural placeholder exactly as ekoDB expects", () => {
|
|
109
|
+
const stage = functions_1.Stage.insert("users", functions_1.Stage.param("record"));
|
|
110
|
+
const wire = JSON.parse(JSON.stringify(stage));
|
|
111
|
+
(0, vitest_1.expect)(stage.ttl).toBeUndefined();
|
|
112
|
+
(0, vitest_1.expect)("ttl" in wire).toBe(false);
|
|
113
|
+
(0, vitest_1.expect)(wire).toEqual({
|
|
114
|
+
type: "Insert",
|
|
115
|
+
collection: "users",
|
|
116
|
+
record: { type: "Parameter", name: "record" },
|
|
117
|
+
bypass_ripple: false,
|
|
118
|
+
});
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
// ============================================================================
|
|
122
|
+
// Crypto primitives: BcryptHash, BcryptVerify, RandomToken (ekoDB >= 0.41.0)
|
|
123
|
+
// ============================================================================
|
|
124
|
+
(0, vitest_1.describe)("Stage.bcryptHash", () => {
|
|
125
|
+
(0, vitest_1.it)("produces a BcryptHash stage with text placeholder + explicit cost", () => {
|
|
126
|
+
const stage = functions_1.Stage.bcryptHash("{{password}}", "password_hash", 12);
|
|
127
|
+
(0, vitest_1.expect)(stage.type).toBe("BcryptHash");
|
|
128
|
+
(0, vitest_1.expect)(stage.plain).toBe("{{password}}");
|
|
129
|
+
(0, vitest_1.expect)(stage.cost).toBe(12);
|
|
130
|
+
(0, vitest_1.expect)(stage.output_field).toBe("password_hash");
|
|
131
|
+
});
|
|
132
|
+
(0, vitest_1.it)("leaves cost undefined when the caller omits it", () => {
|
|
133
|
+
const stage = functions_1.Stage.bcryptHash("{{password}}", "pw_hash");
|
|
134
|
+
(0, vitest_1.expect)(stage.cost).toBeUndefined();
|
|
135
|
+
});
|
|
136
|
+
});
|
|
137
|
+
(0, vitest_1.describe)("Stage.bcryptVerify", () => {
|
|
138
|
+
(0, vitest_1.it)("produces a BcryptVerify stage wiring hash_field and output_field", () => {
|
|
139
|
+
const stage = functions_1.Stage.bcryptVerify("{{password}}", "password_hash", "valid");
|
|
140
|
+
(0, vitest_1.expect)(stage.type).toBe("BcryptVerify");
|
|
141
|
+
(0, vitest_1.expect)(stage.plain).toBe("{{password}}");
|
|
142
|
+
(0, vitest_1.expect)(stage.hash_field).toBe("password_hash");
|
|
143
|
+
(0, vitest_1.expect)(stage.output_field).toBe("valid");
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
(0, vitest_1.describe)("Stage.randomToken", () => {
|
|
147
|
+
(0, vitest_1.it)("produces a RandomToken stage with explicit encoding", () => {
|
|
148
|
+
const stage = functions_1.Stage.randomToken(32, "session_token", "hex");
|
|
149
|
+
(0, vitest_1.expect)(stage.type).toBe("RandomToken");
|
|
150
|
+
(0, vitest_1.expect)(stage.bytes).toBe(32);
|
|
151
|
+
(0, vitest_1.expect)(stage.encoding).toBe("hex");
|
|
152
|
+
(0, vitest_1.expect)(stage.output_field).toBe("session_token");
|
|
153
|
+
});
|
|
154
|
+
(0, vitest_1.it)("leaves encoding undefined by default (server treats as hex)", () => {
|
|
155
|
+
const stage = functions_1.Stage.randomToken(16, "token");
|
|
156
|
+
(0, vitest_1.expect)(stage.encoding).toBeUndefined();
|
|
157
|
+
});
|
|
158
|
+
(0, vitest_1.it)("accepts base64 and base64url encodings", () => {
|
|
159
|
+
const a = functions_1.Stage.randomToken(16, "t", "base64");
|
|
160
|
+
const b = functions_1.Stage.randomToken(16, "t", "base64url");
|
|
161
|
+
(0, vitest_1.expect)(a.encoding).toBe("base64");
|
|
162
|
+
(0, vitest_1.expect)(b.encoding).toBe("base64url");
|
|
163
|
+
});
|
|
164
|
+
});
|
|
165
|
+
(0, vitest_1.describe)("Crypto stages JSON wire format", () => {
|
|
166
|
+
(0, vitest_1.it)("BcryptHash round-trips through JSON unchanged", () => {
|
|
167
|
+
const stage = functions_1.Stage.bcryptHash("{{password}}", "password_hash", 12);
|
|
168
|
+
const wire = JSON.parse(JSON.stringify(stage));
|
|
169
|
+
(0, vitest_1.expect)(wire).toEqual({
|
|
170
|
+
type: "BcryptHash",
|
|
171
|
+
plain: "{{password}}",
|
|
172
|
+
cost: 12,
|
|
173
|
+
output_field: "password_hash",
|
|
174
|
+
});
|
|
175
|
+
});
|
|
176
|
+
(0, vitest_1.it)("BcryptVerify round-trips through JSON unchanged", () => {
|
|
177
|
+
const stage = functions_1.Stage.bcryptVerify("{{password}}", "password_hash", "valid");
|
|
178
|
+
const wire = JSON.parse(JSON.stringify(stage));
|
|
179
|
+
(0, vitest_1.expect)(wire).toEqual({
|
|
180
|
+
type: "BcryptVerify",
|
|
181
|
+
plain: "{{password}}",
|
|
182
|
+
hash_field: "password_hash",
|
|
183
|
+
output_field: "valid",
|
|
184
|
+
});
|
|
185
|
+
});
|
|
186
|
+
(0, vitest_1.it)("RandomToken round-trips through JSON unchanged", () => {
|
|
187
|
+
const stage = functions_1.Stage.randomToken(32, "token", "hex");
|
|
188
|
+
const wire = JSON.parse(JSON.stringify(stage));
|
|
189
|
+
(0, vitest_1.expect)(wire).toEqual({
|
|
190
|
+
type: "RandomToken",
|
|
191
|
+
bytes: 32,
|
|
192
|
+
encoding: "hex",
|
|
193
|
+
output_field: "token",
|
|
194
|
+
});
|
|
195
|
+
});
|
|
196
|
+
});
|
|
197
|
+
// ============================================================================
|
|
198
|
+
// Error Handling & Control Flow: TryCatch, Parallel, Sleep (ekoDB >= 0.42.0)
|
|
199
|
+
// ============================================================================
|
|
200
|
+
(0, vitest_1.describe)("Stage.tryCatch", () => {
|
|
201
|
+
(0, vitest_1.it)("produces a TryCatch stage with try/catch function lists", () => {
|
|
202
|
+
const stage = functions_1.Stage.tryCatch([functions_1.Stage.httpRequest("https://api.example.com/data")], [functions_1.Stage.insert("fallback_log", { error: "{{error}}" })], "api_error");
|
|
203
|
+
(0, vitest_1.expect)(stage.type).toBe("TryCatch");
|
|
204
|
+
(0, vitest_1.expect)(stage.try_functions).toHaveLength(1);
|
|
205
|
+
(0, vitest_1.expect)(stage.catch_functions).toHaveLength(1);
|
|
206
|
+
(0, vitest_1.expect)(stage.output_error_field).toBe("api_error");
|
|
207
|
+
});
|
|
208
|
+
(0, vitest_1.it)("leaves output_error_field undefined when omitted", () => {
|
|
209
|
+
const stage = functions_1.Stage.tryCatch([functions_1.Stage.findAll("users")], [functions_1.Stage.insert("errors", { msg: "failed" })]);
|
|
210
|
+
(0, vitest_1.expect)(stage.output_error_field).toBeUndefined();
|
|
211
|
+
});
|
|
212
|
+
});
|
|
213
|
+
(0, vitest_1.describe)("Stage.parallel", () => {
|
|
214
|
+
(0, vitest_1.it)("produces a Parallel stage with functions and wait_for_all", () => {
|
|
215
|
+
const stage = functions_1.Stage.parallel([functions_1.Stage.findAll("users"), functions_1.Stage.findAll("orders")], true);
|
|
216
|
+
(0, vitest_1.expect)(stage.type).toBe("Parallel");
|
|
217
|
+
(0, vitest_1.expect)(stage.functions).toHaveLength(2);
|
|
218
|
+
(0, vitest_1.expect)(stage.wait_for_all).toBe(true);
|
|
219
|
+
});
|
|
220
|
+
(0, vitest_1.it)("defaults wait_for_all to true", () => {
|
|
221
|
+
const stage = functions_1.Stage.parallel([functions_1.Stage.findAll("users")]);
|
|
222
|
+
(0, vitest_1.expect)(stage.wait_for_all).toBe(true);
|
|
223
|
+
});
|
|
224
|
+
(0, vitest_1.it)("accepts wait_for_all = false for race semantics", () => {
|
|
225
|
+
const stage = functions_1.Stage.parallel([functions_1.Stage.findAll("users"), functions_1.Stage.findAll("cache")], false);
|
|
226
|
+
(0, vitest_1.expect)(stage.wait_for_all).toBe(false);
|
|
227
|
+
});
|
|
228
|
+
});
|
|
229
|
+
(0, vitest_1.describe)("Stage.sleep", () => {
|
|
230
|
+
(0, vitest_1.it)("produces a Sleep stage with numeric duration", () => {
|
|
231
|
+
const stage = functions_1.Stage.sleep(1000);
|
|
232
|
+
(0, vitest_1.expect)(stage.type).toBe("Sleep");
|
|
233
|
+
(0, vitest_1.expect)(stage.duration_ms).toBe(1000);
|
|
234
|
+
});
|
|
235
|
+
(0, vitest_1.it)("accepts a text placeholder for parameter substitution", () => {
|
|
236
|
+
const stage = functions_1.Stage.sleep("{{delay}}");
|
|
237
|
+
(0, vitest_1.expect)(stage.duration_ms).toBe("{{delay}}");
|
|
238
|
+
});
|
|
239
|
+
});
|
|
240
|
+
// ============================================================================
|
|
241
|
+
// Response Formatting: Return (ekoDB >= 0.42.0)
|
|
242
|
+
// ============================================================================
|
|
243
|
+
(0, vitest_1.describe)("Stage.returnResponse", () => {
|
|
244
|
+
(0, vitest_1.it)("produces a Return stage with fields and status_code", () => {
|
|
245
|
+
const stage = functions_1.Stage.returnResponse({ message: "ok", user_id: "{{id}}" }, 201);
|
|
246
|
+
(0, vitest_1.expect)(stage.type).toBe("Return");
|
|
247
|
+
(0, vitest_1.expect)(stage.fields).toEqual({ message: "ok", user_id: "{{id}}" });
|
|
248
|
+
(0, vitest_1.expect)(stage.status_code).toBe(201);
|
|
249
|
+
});
|
|
250
|
+
(0, vitest_1.it)("leaves status_code undefined when omitted (server defaults to 200)", () => {
|
|
251
|
+
const stage = functions_1.Stage.returnResponse({ success: true });
|
|
252
|
+
(0, vitest_1.expect)(stage.status_code).toBeUndefined();
|
|
253
|
+
});
|
|
254
|
+
});
|
|
255
|
+
// ============================================================================
|
|
256
|
+
// Data Validation: Validate (ekoDB >= 0.42.0)
|
|
257
|
+
// ============================================================================
|
|
258
|
+
(0, vitest_1.describe)("Stage.validate", () => {
|
|
259
|
+
(0, vitest_1.it)("produces a Validate stage with schema, data_field, and on_error", () => {
|
|
260
|
+
const schema = {
|
|
261
|
+
type: "object",
|
|
262
|
+
required: ["name", "email"],
|
|
263
|
+
properties: {
|
|
264
|
+
name: { type: "string" },
|
|
265
|
+
email: { type: "string", format: "email" },
|
|
266
|
+
},
|
|
267
|
+
};
|
|
268
|
+
const stage = functions_1.Stage.validate(schema, "{{input}}", [
|
|
269
|
+
functions_1.Stage.returnResponse({ error: "validation failed" }, 400),
|
|
270
|
+
]);
|
|
271
|
+
(0, vitest_1.expect)(stage.type).toBe("Validate");
|
|
272
|
+
(0, vitest_1.expect)(stage.schema).toEqual(schema);
|
|
273
|
+
(0, vitest_1.expect)(stage.data_field).toBe("{{input}}");
|
|
274
|
+
(0, vitest_1.expect)(stage.on_error).toHaveLength(1);
|
|
275
|
+
});
|
|
276
|
+
(0, vitest_1.it)("leaves on_error undefined when omitted", () => {
|
|
277
|
+
const stage = functions_1.Stage.validate({ type: "object" }, "record");
|
|
278
|
+
(0, vitest_1.expect)(stage.on_error).toBeUndefined();
|
|
279
|
+
});
|
|
280
|
+
});
|
|
281
|
+
// ============================================================================
|
|
282
|
+
// New stages JSON wire format
|
|
283
|
+
// ============================================================================
|
|
284
|
+
(0, vitest_1.describe)("New stages JSON wire format", () => {
|
|
285
|
+
(0, vitest_1.it)("TryCatch round-trips through JSON unchanged", () => {
|
|
286
|
+
const stage = functions_1.Stage.tryCatch([functions_1.Stage.findAll("users")], [functions_1.Stage.insert("errors", { msg: "failed" })], "err");
|
|
287
|
+
const wire = JSON.parse(JSON.stringify(stage));
|
|
288
|
+
(0, vitest_1.expect)(wire.type).toBe("TryCatch");
|
|
289
|
+
(0, vitest_1.expect)(wire.try_functions).toHaveLength(1);
|
|
290
|
+
(0, vitest_1.expect)(wire.catch_functions).toHaveLength(1);
|
|
291
|
+
(0, vitest_1.expect)(wire.output_error_field).toBe("err");
|
|
292
|
+
});
|
|
293
|
+
(0, vitest_1.it)("Parallel round-trips through JSON unchanged", () => {
|
|
294
|
+
const stage = functions_1.Stage.parallel([functions_1.Stage.findAll("a"), functions_1.Stage.findAll("b")], false);
|
|
295
|
+
const wire = JSON.parse(JSON.stringify(stage));
|
|
296
|
+
(0, vitest_1.expect)(wire).toEqual({
|
|
297
|
+
type: "Parallel",
|
|
298
|
+
functions: [
|
|
299
|
+
{ type: "FindAll", collection: "a" },
|
|
300
|
+
{ type: "FindAll", collection: "b" },
|
|
301
|
+
],
|
|
302
|
+
wait_for_all: false,
|
|
303
|
+
});
|
|
304
|
+
});
|
|
305
|
+
(0, vitest_1.it)("Sleep round-trips through JSON unchanged", () => {
|
|
306
|
+
const wire = JSON.parse(JSON.stringify(functions_1.Stage.sleep(500)));
|
|
307
|
+
(0, vitest_1.expect)(wire).toEqual({ type: "Sleep", duration_ms: 500 });
|
|
308
|
+
});
|
|
309
|
+
(0, vitest_1.it)("Return round-trips through JSON unchanged", () => {
|
|
310
|
+
const stage = functions_1.Stage.returnResponse({ ok: true }, 201);
|
|
311
|
+
const wire = JSON.parse(JSON.stringify(stage));
|
|
312
|
+
(0, vitest_1.expect)(wire).toEqual({
|
|
313
|
+
type: "Return",
|
|
314
|
+
fields: { ok: true },
|
|
315
|
+
status_code: 201,
|
|
316
|
+
});
|
|
317
|
+
});
|
|
318
|
+
(0, vitest_1.it)("Validate round-trips through JSON unchanged", () => {
|
|
319
|
+
const stage = functions_1.Stage.validate({ type: "object" }, "data");
|
|
320
|
+
const wire = JSON.parse(JSON.stringify(stage));
|
|
321
|
+
(0, vitest_1.expect)(wire).toEqual({
|
|
322
|
+
type: "Validate",
|
|
323
|
+
schema: { type: "object" },
|
|
324
|
+
data_field: "data",
|
|
325
|
+
});
|
|
326
|
+
});
|
|
327
|
+
});
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,8 @@ export { QueryBuilder, SortOrder } from "./query-builder";
|
|
|
3
3
|
export { SearchQueryBuilder } from "./search";
|
|
4
4
|
export { SchemaBuilder, FieldTypeSchemaBuilder, VectorIndexAlgorithm, DistanceMetric, } from "./schema";
|
|
5
5
|
export { JoinBuilder } from "./join";
|
|
6
|
-
export { Stage, ChatMessage } from "./functions";
|
|
6
|
+
export { Stage, ChatMessage, parameterRef } from "./functions";
|
|
7
|
+
export type { ParameterRef } from "./functions";
|
|
7
8
|
export { getValue, getValues, extractRecord, getDateTimeValue, getUUIDValue, getDecimalValue, getDurationValue, getBytesValue, getBinaryValue, getArrayValue, getSetValue, getVectorValue, getObjectValue, Field, } from "./utils";
|
|
8
9
|
export type { WrappedFieldValue } from "./utils";
|
|
9
10
|
export type { SearchQuery, SearchResult, SearchResponse } from "./search";
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Field = exports.getObjectValue = exports.getVectorValue = exports.getSetValue = exports.getArrayValue = exports.getBinaryValue = exports.getBytesValue = exports.getDurationValue = exports.getDecimalValue = exports.getUUIDValue = exports.getDateTimeValue = exports.extractRecord = exports.getValues = exports.getValue = exports.ChatMessage = exports.Stage = exports.JoinBuilder = exports.DistanceMetric = exports.VectorIndexAlgorithm = exports.FieldTypeSchemaBuilder = exports.SchemaBuilder = exports.SearchQueryBuilder = exports.SortOrder = exports.QueryBuilder = exports.extractRecordId = exports.SchemaCache = exports.RateLimitError = exports.MergeStrategy = exports.SerializationFormat = exports.EventStream = exports.WebSocketClient = exports.EkoDBClient = void 0;
|
|
3
|
+
exports.Field = exports.getObjectValue = exports.getVectorValue = exports.getSetValue = exports.getArrayValue = exports.getBinaryValue = exports.getBytesValue = exports.getDurationValue = exports.getDecimalValue = exports.getUUIDValue = exports.getDateTimeValue = exports.extractRecord = exports.getValues = exports.getValue = exports.parameterRef = exports.ChatMessage = exports.Stage = exports.JoinBuilder = exports.DistanceMetric = exports.VectorIndexAlgorithm = exports.FieldTypeSchemaBuilder = exports.SchemaBuilder = exports.SearchQueryBuilder = exports.SortOrder = exports.QueryBuilder = exports.extractRecordId = exports.SchemaCache = exports.RateLimitError = exports.MergeStrategy = exports.SerializationFormat = exports.EventStream = exports.WebSocketClient = exports.EkoDBClient = void 0;
|
|
4
4
|
var client_1 = require("./client");
|
|
5
5
|
Object.defineProperty(exports, "EkoDBClient", { enumerable: true, get: function () { return client_1.EkoDBClient; } });
|
|
6
6
|
Object.defineProperty(exports, "WebSocketClient", { enumerable: true, get: function () { return client_1.WebSocketClient; } });
|
|
@@ -25,6 +25,7 @@ Object.defineProperty(exports, "JoinBuilder", { enumerable: true, get: function
|
|
|
25
25
|
var functions_1 = require("./functions");
|
|
26
26
|
Object.defineProperty(exports, "Stage", { enumerable: true, get: function () { return functions_1.Stage; } });
|
|
27
27
|
Object.defineProperty(exports, "ChatMessage", { enumerable: true, get: function () { return functions_1.ChatMessage; } });
|
|
28
|
+
Object.defineProperty(exports, "parameterRef", { enumerable: true, get: function () { return functions_1.parameterRef; } });
|
|
28
29
|
var utils_1 = require("./utils");
|
|
29
30
|
Object.defineProperty(exports, "getValue", { enumerable: true, get: function () { return utils_1.getValue; } });
|
|
30
31
|
Object.defineProperty(exports, "getValues", { enumerable: true, get: function () { return utils_1.getValues; } });
|