@delali/narsil 0.3.1-next.89 → 0.3.1-next.91

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.
Files changed (70) hide show
  1. package/dist/browser/{chunk-JACCR3BJ.mjs → chunk-66KYAOIK.mjs} +1 -1
  2. package/dist/browser/{chunk-3GZQKGVQ.mjs → chunk-B6XE7KXY.mjs} +11 -3
  3. package/dist/browser/{chunk-RAHUQOJL.mjs → chunk-NOUZ6RH3.mjs} +2219 -2005
  4. package/dist/browser/{durability-wiring-VSUBLUDK.mjs → durability-wiring-F4OGQUSU.mjs} +3 -3
  5. package/dist/browser/{snapshot-5MXBEDXF.mjs → snapshot-5EJ7I7QY.mjs} +12 -6
  6. package/dist/browser/{write-6SBYTS62.mjs → write-K5V4XQ72.mjs} +2 -2
  7. package/dist/{capabilities-SJPttcgQ.d.ts → capabilities-CvExBThq.d.ts} +11 -3
  8. package/dist/{chunk-MWJIAREY.mjs → chunk-3RDS4UHC.mjs} +2 -2
  9. package/dist/{chunk-QAMUC2BJ.mjs → chunk-3TTYK5A7.mjs} +7 -6
  10. package/dist/{chunk-URGLSNKR.mjs → chunk-43ORORN6.mjs} +201 -15
  11. package/dist/{chunk-A3UB2MXL.mjs → chunk-5ER245FI.mjs} +2 -505
  12. package/dist/{chunk-VY4DXZ5P.mjs → chunk-67Z2V6TC.mjs} +1 -1
  13. package/dist/{chunk-EMXAYPTQ.mjs → chunk-6VZ3Q73N.mjs} +2265 -3461
  14. package/dist/{chunk-S4LQDSUL.mjs → chunk-7OQHSDK6.mjs} +3 -3
  15. package/dist/chunk-7X5JST5L.mjs +114 -0
  16. package/dist/{chunk-R6BMMQXH.mjs → chunk-A4G7JSYO.mjs} +106 -41
  17. package/dist/{chunk-DCK4P5BI.mjs → chunk-BJ2YKRNX.mjs} +16 -7
  18. package/dist/{chunk-J2BPXTD7.mjs → chunk-CO4MRKST.mjs} +1 -1
  19. package/dist/{chunk-CL4OM7GB.mjs → chunk-EONIHG3V.mjs} +8 -4
  20. package/dist/chunk-MKWUXWQH.mjs +35 -0
  21. package/dist/chunk-NVL4ZR3K.mjs +426 -0
  22. package/dist/{chunk-GCM3JFVA.mjs → chunk-OHP7QR33.mjs} +2 -1
  23. package/dist/{chunk-YRX6XMOQ.mjs → chunk-R6PR4WYZ.mjs} +1 -0
  24. package/dist/{chunk-OOSIDHA3.mjs → chunk-RSRVGAIQ.mjs} +1 -1
  25. package/dist/{chunk-V7YUSKKZ.mjs → chunk-T4DB5YFB.mjs} +7 -3
  26. package/dist/{chunk-XSZVS4S3.mjs → chunk-UXQE2ROB.mjs} +6 -2
  27. package/dist/chunk-X5CV2E2B.mjs +1 -0
  28. package/dist/chunk-XLJ2S2BH.mjs +3572 -0
  29. package/dist/chunk-ZIJ63TBT.mjs +507 -0
  30. package/dist/{client-BMK53IR2.d.ts → client-Cc42b42j.d.ts} +27 -3
  31. package/dist/client.d.ts +9 -8
  32. package/dist/client.mjs +15 -2
  33. package/dist/{config-BUR-7eVQ.d.ts → config-BYne-yCI.d.ts} +2 -2
  34. package/dist/{config-UJx1dyX1.d.ts → config-DyRowvVP.d.ts} +2 -2
  35. package/dist/{direct-executor-EGESD26S.mjs → direct-executor-CHXVCBN7.mjs} +9 -5
  36. package/dist/distribution/coordinator/etcd.d.ts +3 -2
  37. package/dist/distribution/coordinator/etcd.mjs +4 -0
  38. package/dist/distribution/coordinator/in-memory.d.ts +3 -2
  39. package/dist/distribution/coordinator/in-memory.mjs +4 -0
  40. package/dist/distribution/transport/grpc.mjs +2 -2
  41. package/dist/distribution/transport/in-memory.mjs +1 -1
  42. package/dist/distribution/transport/tcp.mjs +2 -2
  43. package/dist/distribution.d.ts +43 -9
  44. package/dist/distribution.mjs +4590 -4263
  45. package/dist/{durability-wiring-ZLRQU6FG.mjs → durability-wiring-6AN4QTT3.mjs} +20 -16
  46. package/dist/{engine-9X6W5naj.d.ts → engine-96_kLtSY.d.ts} +43 -7
  47. package/dist/{index-vCMu8OeQ.d.ts → index-ONAEaqtx.d.ts} +8 -1
  48. package/dist/index.browser.mjs +1 -1
  49. package/dist/index.d.ts +44 -25
  50. package/dist/index.mjs +13 -9
  51. package/dist/{memory-CV9NAxLY.d.ts → memory-dd3GESdc.d.ts} +3 -3
  52. package/dist/partial-words.mjs +2 -1
  53. package/dist/persistence/durability/checkpoint-worker.d.ts +60 -58
  54. package/dist/persistence/durability/checkpoint-worker.mjs +18 -14
  55. package/dist/react.d.ts +8 -7
  56. package/dist/{schema-DtsgmNfU.d.ts → schema-DttzM-ln.d.ts} +12 -0
  57. package/dist/server.d.ts +11 -10
  58. package/dist/server.mjs +33 -6
  59. package/dist/{snapshot-22CUEYYW.mjs → snapshot-JFZVOGZV.mjs} +28 -18
  60. package/dist/synonyms-CpOAHPa-.d.ts +52 -0
  61. package/dist/synonyms.d.ts +22 -0
  62. package/dist/synonyms.mjs +12 -0
  63. package/dist/{tasks-BGaZJyoY.d.ts → tasks-DA1Ff0G4.d.ts} +4 -1
  64. package/dist/{thread-ZP3UMIZT.mjs → thread-VTDLLYXC.mjs} +7 -5
  65. package/dist/vector/search-worker.d.ts +2 -1
  66. package/dist/workers/entry.mjs +4 -4
  67. package/dist/{write-PXDKPG2R.mjs → write-OJR3H4BI.mjs} +14 -10
  68. package/package.json +15 -7
  69. package/dist/chunk-PR4O7CAP.mjs +0 -18
  70. package/dist/chunk-X4SEXL4U.mjs +0 -2310
@@ -329,6 +329,10 @@ function storedValueMethods(context) {
329
329
  return txn.succeeded;
330
330
  });
331
331
  },
332
+ async delete(key) {
333
+ assertNotShutdown();
334
+ await client.delete().key(keys.generic(key)).exec();
335
+ },
332
336
  async getSchema(indexName) {
333
337
  assertNotShutdown();
334
338
  const key = keys.schema(indexName);
@@ -1,6 +1,7 @@
1
- import { C as ClusterCoordinator } from '../../index-vCMu8OeQ.js';
2
- import '../../schema-DtsgmNfU.js';
1
+ import { C as ClusterCoordinator } from '../../index-ONAEaqtx.js';
2
+ import '../../schema-DttzM-ln.js';
3
3
  import '../../adapters-79OIa4xm.js';
4
+ import '../../synonyms-CpOAHPa-.js';
4
5
 
5
6
  /**
6
7
  * Builds a coordinator that holds the cluster's shared state in one process's
@@ -230,6 +230,10 @@ function createInMemoryCoordinator() {
230
230
  kvStore.set(key, new Uint8Array(value));
231
231
  return true;
232
232
  },
233
+ async delete(key) {
234
+ assertNotShutdown();
235
+ kvStore.delete(key);
236
+ },
233
237
  async getSchema(indexName) {
234
238
  assertNotShutdown();
235
239
  return schemas.get(indexName) ?? null;
@@ -1,6 +1,6 @@
1
- import { decodeTransportMessage, encodeTransportMessage } from '../../chunk-OOSIDHA3.mjs';
1
+ import { decodeTransportMessage, encodeTransportMessage } from '../../chunk-RSRVGAIQ.mjs';
2
2
  import { MAX_MESSAGE_SIZE_BYTES, GRPC_KEEPALIVE_TIMEOUT_MS, GRPC_KEEPALIVE_TIME_MS, GRPC_ENVELOPE_OVERHEAD_BYTES } from '../../chunk-UNEEFTEU.mjs';
3
- import { TransportError, TransportErrorCodes } from '../../chunk-GCM3JFVA.mjs';
3
+ import { TransportError, TransportErrorCodes } from '../../chunk-OHP7QR33.mjs';
4
4
  import { NarsilError, ErrorCodes } from '../../chunk-TPJU7NDJ.mjs';
5
5
 
6
6
  // src/distribution/transport/grpc/codec.ts
@@ -1,5 +1,5 @@
1
1
  import { MAX_MESSAGE_SIZE_BYTES } from '../../chunk-UNEEFTEU.mjs';
2
- import { DEFAULT_TRANSPORT_CONFIG, TransportError, TransportErrorCodes } from '../../chunk-GCM3JFVA.mjs';
2
+ import { DEFAULT_TRANSPORT_CONFIG, TransportError, TransportErrorCodes } from '../../chunk-OHP7QR33.mjs';
3
3
 
4
4
  // src/distribution/transport/in-memory.ts
5
5
  function createInMemoryNetwork() {
@@ -1,6 +1,6 @@
1
- import { DEFAULT_TCP_CONFIG, encodeTransportMessage, encodeFrame, FRAME_TYPE_REQUEST, FrameParser, FRAME_TYPE_RESPONSE, decodeTransportMessage, FRAME_TYPE_STREAM_CHUNK, FRAME_TYPE_STREAM_END } from '../../chunk-OOSIDHA3.mjs';
1
+ import { DEFAULT_TCP_CONFIG, encodeTransportMessage, encodeFrame, FRAME_TYPE_REQUEST, FrameParser, FRAME_TYPE_RESPONSE, decodeTransportMessage, FRAME_TYPE_STREAM_CHUNK, FRAME_TYPE_STREAM_END } from '../../chunk-RSRVGAIQ.mjs';
2
2
  import { MAX_MESSAGE_SIZE_BYTES } from '../../chunk-UNEEFTEU.mjs';
3
- import { TransportError, TransportErrorCodes } from '../../chunk-GCM3JFVA.mjs';
3
+ import { TransportError, TransportErrorCodes } from '../../chunk-OHP7QR33.mjs';
4
4
  import { connect as connect$1, createServer as createServer$1 } from 'net';
5
5
  import { connect, createServer } from 'tls';
6
6
 
@@ -1,12 +1,13 @@
1
- import { a as CreateIndexOptions, C as ClusterNamespace, b as ClusterNodeConfig } from './config-UJx1dyX1.js';
2
- export { c as ClusterControllerConfig, d as ClusterMemoryConfig, e as ClusterNodeInfo, f as ClusterQueryConfig, N as NodeReadiness, R as ReplicationConfig } from './config-UJx1dyX1.js';
3
- import { B as BatchResult, L as ListParams, h as ListResult, k as SuggestParams, l as SuggestResult, Q as QueryParams, j as PreflightResult, g as IndexStats, P as PartitionStatsResult, M as MemoryStats, m as NarsilEventMap, e as QueryResult } from './memory-CV9NAxLY.js';
4
- import { I as IndexConfig, A as AnyDocument, a as InsertOptions } from './schema-DtsgmNfU.js';
5
- import { b as NodeCapacity, N as NodeRole } from './index-vCMu8OeQ.js';
6
- export { c as AllocationConstraints, d as AllocationEvent, A as AllocationTable, C as ClusterCoordinator, I as IndexPartitionBytes, e as NodeEvent, f as NodeMemoryReport, a as NodeRegistration, P as PartitionAssignment, g as PartitionState, S as SchemaEvent, U as UnassignedReason } from './index-vCMu8OeQ.js';
7
- import { N as Narsil } from './engine-9X6W5naj.js';
1
+ import { a as CreateIndexOptions, C as ClusterNamespace, b as ClusterNodeConfig } from './config-DyRowvVP.js';
2
+ export { c as ClusterControllerConfig, d as ClusterMemoryConfig, e as ClusterNodeInfo, f as ClusterQueryConfig, N as NodeReadiness, R as ReplicationConfig } from './config-DyRowvVP.js';
3
+ import { B as BatchResult, L as ListParams, h as ListResult, k as SuggestParams, l as SuggestResult, Q as QueryParams, j as PreflightResult, g as IndexStats, P as PartitionStatsResult, M as MemoryStats, m as NarsilEventMap, e as QueryResult } from './memory-dd3GESdc.js';
4
+ import { I as IndexConfig, A as AnyDocument, a as InsertOptions } from './schema-DttzM-ln.js';
5
+ import { a as SynonymRule } from './synonyms-CpOAHPa-.js';
6
+ import { b as NodeCapacity, N as NodeRole } from './index-ONAEaqtx.js';
7
+ export { c as AllocationConstraints, d as AllocationEvent, A as AllocationTable, C as ClusterCoordinator, I as IndexPartitionBytes, e as NodeEvent, f as NodeMemoryReport, a as NodeRegistration, P as PartitionAssignment, g as PartitionState, S as SchemaEvent, U as UnassignedReason } from './index-ONAEaqtx.js';
8
+ import { N as Narsil } from './engine-96_kLtSY.js';
8
9
  export { L as ListenHandler, N as NodeTransport, R as RespondFn, T as TransportConfig, a as TransportMessage } from './types-Cb9kiY5P.js';
9
- import './config-BUR-7eVQ.js';
10
+ import './config-BYne-yCI.js';
10
11
  import './adapters-79OIa4xm.js';
11
12
 
12
13
  /**
@@ -146,6 +147,39 @@ interface ClusterNode {
146
147
  * @param name - The index to drop.
147
148
  */
148
149
  dropIndex(name: string): Promise<void>;
150
+ /**
151
+ * Replaces the synonym set of an index across the cluster, so that every
152
+ * search that starts after the promise resolves expands its words with the
153
+ * new set.
154
+ *
155
+ * The node stores the set in the coordinator before it asks each node that
156
+ * holds a partition of the index to apply the set. The promise resolves
157
+ * once every one of those nodes answers. Pass an empty list to remove the
158
+ * set.
159
+ *
160
+ * @param indexName - The index whose set the cluster replaces.
161
+ * @param synonyms - The new set, in the shape that {@link SynonymRule}
162
+ * describes.
163
+ * @throws A `NarsilError` with `CONFIG_INVALID` when a rule breaks that
164
+ * shape, when a word analyses to no token or to more than one, or when the
165
+ * set passes 100,000 rules, 500,000 words, or 4,194,304 bytes of words in
166
+ * UTF-8. It throws `CLUSTER_WRITE_BLOCKED` when the index metadata changes
167
+ * between the node's read and its write on every one of its tries, and
168
+ * `QUERY_NODE_TIMEOUT` when a node holding a partition gives no answer.
169
+ * After a timeout, the coordinator keeps the new set, so a retry of the
170
+ * same call can finish applying it.
171
+ */
172
+ updateSynonyms(indexName: string, synonyms: SynonymRule[]): Promise<void>;
173
+ /**
174
+ * Returns the synonym set that the coordinator holds for an index, with
175
+ * every word as the caller wrote it, or an empty list when the index holds
176
+ * no set.
177
+ *
178
+ * @param indexName - The index whose set the node returns.
179
+ * @throws A `NarsilError` with `INDEX_NOT_FOUND` when the cluster holds no
180
+ * index under that name.
181
+ */
182
+ getSynonyms(indexName: string): Promise<SynonymRule[]>;
149
183
  /**
150
184
  * Removes every document from an index across the cluster and keeps the
151
185
  * index itself, along with its schema and allocation.
@@ -338,7 +372,7 @@ interface ClusterEngineOptions {
338
372
  * serves a single engine.
339
373
  *
340
374
  * Writes, updates, searches, suggestions, listings, counts, index creation,
341
- * index removal, and document reads route through the cluster. Checkpointing,
375
+ * index removal, synonym sets, and document reads route through the cluster. Checkpointing,
342
376
  * memory statistics, index opens, index closes, and engine events reach this
343
377
  * node's local engine, because each covers a per-node fact. Every other operation fails with
344
378
  * `CLUSTER_OPERATION_UNSUPPORTED`, which the HTTP server answers with status