@delali/narsil 0.3.1-next.185 → 0.3.1-next.193
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/README.md +1 -0
- package/dist/adapters/filesystem.mjs +2 -2
- package/dist/adapters/gcs.mjs +2 -2
- package/dist/adapters/indexeddb.mjs +1 -1
- package/dist/adapters/s3.mjs +2 -2
- package/dist/browser/chunk-4E5APHTM.mjs +1459 -0
- package/dist/browser/{chunk-4ZICWS4V.mjs → chunk-QAOVAYAG.mjs} +1 -1
- package/dist/browser/{chunk-CPSHS46N.mjs → chunk-UQG4HUGQ.mjs} +82 -50
- package/dist/browser/{chunk-2Q45HI5H.mjs → chunk-YINZFPLT.mjs} +7 -0
- package/dist/browser/{module-XVLHJ7T7.mjs → module-ZZTNG5JZ.mjs} +26 -3
- package/dist/browser/{optional-writes-ZTBHYQMN.mjs → optional-writes-J5BHKEQL.mjs} +21 -8
- package/dist/browser/{storage-leaf-4XMCITJ6.mjs → storage-leaf-N3JMQ6CF.mjs} +14569 -13747
- package/dist/{capabilities-DAHXphRn.d.ts → capabilities-CLnQHIqV.d.ts} +51 -9
- package/dist/{chunk-KLVMK3R5.mjs → chunk-2CKDCC65.mjs} +1 -1
- package/dist/{chunk-CODGHJVW.mjs → chunk-2HVQYOOD.mjs} +40 -12
- package/dist/{chunk-M5I64AQW.mjs → chunk-3N5GUXBI.mjs} +33 -33
- package/dist/{chunk-DU23J5JG.mjs → chunk-5CIHQIA4.mjs} +6 -6
- package/dist/{react-native/chunks/chunk-ZUFOYZ5P.mjs → chunk-62X472AC.mjs} +1 -1
- package/dist/{chunk-QJGDB3WR.mjs → chunk-6GHX35ZM.mjs} +2 -2
- package/dist/{chunk-G3XRHAJA.mjs → chunk-6MC6BCXK.mjs} +3 -3
- package/dist/{chunk-X5NHWOXT.mjs → chunk-7P5YWDRQ.mjs} +2 -2
- package/dist/{chunk-MHBG33R5.mjs → chunk-7X4IIREW.mjs} +76 -46
- package/dist/{chunk-F4OOBPKA.mjs → chunk-AOYQTX6W.mjs} +1 -1
- package/dist/{chunk-D6FYUTFN.mjs → chunk-ASZLNVWW.mjs} +1 -1
- package/dist/{chunk-LR6JJVML.mjs → chunk-D2EJUM4A.mjs} +764 -699
- package/dist/{chunk-FETZYCH7.mjs → chunk-F6F4G322.mjs} +26 -1
- package/dist/{chunk-2YWWHMVC.mjs → chunk-FGOGT273.mjs} +2 -2
- package/dist/{chunk-5BUEBIXR.mjs → chunk-GLXLSPLO.mjs} +18 -5
- package/dist/{chunk-IE3Q62QD.mjs → chunk-GR5GMFJJ.mjs} +1 -1
- package/dist/{chunk-Y7QUFIGV.mjs → chunk-GXED6R3Q.mjs} +2 -2
- package/dist/{chunk-BVZWWMOU.mjs → chunk-HHYQMGPW.mjs} +2 -2
- package/dist/{chunk-SL53DHVE.mjs → chunk-HSA3H3VW.mjs} +121 -68
- package/dist/{chunk-YM2HI5N5.mjs → chunk-IL5DRCNU.mjs} +2 -2
- package/dist/{chunk-JDG6CCXM.mjs → chunk-JENWA4WX.mjs} +2 -2
- package/dist/{chunk-2GONI5HL.mjs → chunk-JXINPXRS.mjs} +5 -4
- package/dist/chunk-K5GNK5GE.mjs +602 -0
- package/dist/{chunk-WLFOLAQI.mjs → chunk-KBU3ZFJN.mjs} +2 -2
- package/dist/{chunk-EDEE7ETQ.mjs → chunk-KOA6T2IC.mjs} +3 -3
- package/dist/{chunk-N3M4NPML.mjs → chunk-M2Z5WVWW.mjs} +1 -1
- package/dist/{chunk-EWGIF6FQ.mjs → chunk-NJJN4FMM.mjs} +1 -1
- package/dist/{chunk-C7YQHCSO.mjs → chunk-P4F4UWLC.mjs} +1 -1
- package/dist/{chunk-VYSWVQCE.mjs → chunk-PAPQGC6I.mjs} +2 -2
- package/dist/{chunk-I2WJCRIH.mjs → chunk-R2PJKSNL.mjs} +1 -1
- package/dist/{chunk-6SZQETSC.mjs → chunk-RORNUNXW.mjs} +5 -2
- package/dist/{chunk-FBQYC5OX.mjs → chunk-SB5HCIIO.mjs} +16 -13
- package/dist/{chunk-CYCVPTTR.mjs → chunk-SCZI7COG.mjs} +2 -2
- package/dist/{chunk-O337MDRJ.mjs → chunk-SHES4VP5.mjs} +38 -13
- package/dist/{chunk-H4QYQ5DE.mjs → chunk-SIIDIGKI.mjs} +2 -2
- package/dist/{chunk-A3OAFUZI.mjs → chunk-SM2SYVIX.mjs} +2 -2
- package/dist/{chunk-II6XF6M4.mjs → chunk-SMLUZGSI.mjs} +9 -8
- package/dist/{chunk-2KCCQK4R.mjs → chunk-TSE2VWPX.mjs} +2 -2
- package/dist/{chunk-WSIU6YXQ.mjs → chunk-YPEJ6ODL.mjs} +1732 -743
- package/dist/{chunk-7WXGUTWK.mjs → chunk-Z6SIJH5O.mjs} +17 -6
- package/dist/{chunk-Q3ZZH5Z7.mjs → chunk-ZKOQR7EA.mjs} +7 -0
- package/dist/{chunk-CKEOTSF5.mjs → chunk-ZS2YUB2L.mjs} +6 -3
- package/dist/{chunk-FCQMZDRI.mjs → chunk-ZVZYJIIP.mjs} +3 -3
- package/dist/{client-DpqtT2XG.d.ts → client-uB0kp2yT.d.ts} +88 -5
- package/dist/client.d.ts +7 -7
- package/dist/client.mjs +3 -1265
- package/dist/{config-D9WR3MhO.d.ts → config-BvHQ-C7U.d.ts} +3 -3
- package/dist/{config-C687-reW.d.ts → config-PqgNY1H7.d.ts} +1 -1
- package/dist/{core-leaf-NEUM7PU3.mjs → core-leaf-TAR3GJVE.mjs} +3 -3
- package/dist/{direct-executor-37IH3ISS.mjs → direct-executor-WSZALYCV.mjs} +8 -8
- package/dist/distribution/coordinator/etcd.d.ts +1 -1
- package/dist/distribution/coordinator/etcd.mjs +35 -15
- package/dist/distribution/coordinator/in-memory.d.ts +1 -1
- package/dist/distribution/coordinator/in-memory.mjs +16 -6
- package/dist/distribution/transport/grpc.mjs +2 -2
- package/dist/distribution/transport/tcp.mjs +2 -2
- package/dist/distribution.d.ts +70 -9
- package/dist/distribution.mjs +1695 -680
- package/dist/{durability-config-NWU2G2SJ.mjs → durability-config-VWS2K24E.mjs} +1 -1
- package/dist/{react-native/chunks/embed-4LBSQD7U.mjs → embed-4PHHKGBK.mjs} +1 -1
- package/dist/embeddings/openai.mjs +2 -2
- package/dist/{engine-De6JzTW8.d.ts → engine-qjAxJSKk.d.ts} +206 -7
- package/dist/{index-CBUl4z3E.d.ts → index-BaQIAnk0.d.ts} +137 -111
- package/dist/index.browser.mjs +3 -3
- package/dist/index.d.ts +4 -4
- package/dist/index.mjs +8 -8
- package/dist/index.react-native.mjs +9 -9
- package/dist/{long-query-thread-DIPJBMV7.mjs → long-query-thread-N2DNPEA3.mjs} +21 -21
- package/dist/{module-Z3CL4GJ4.mjs → module-UQFIJQMG.mjs} +33 -13
- package/dist/{msgpack-leaf-7KBYOVTF.mjs → msgpack-leaf-H5ZYW7S7.mjs} +4 -4
- package/dist/{optional-reads-ENKMVQ4Q.mjs → optional-reads-5HFMF2QZ.mjs} +2 -2
- package/dist/{optional-writes-YIVJMQ4D.mjs → optional-writes-CGDBJBHQ.mjs} +31 -18
- package/dist/{paged-partition-archive-IZ6U7DVN.mjs → paged-partition-archive-UK44CVXG.mjs} +20 -20
- package/dist/partial-words.browser.mjs +3 -3
- package/dist/partial-words.mjs +8 -8
- package/dist/pattern.browser.mjs +2 -2
- package/dist/pattern.mjs +3 -3
- package/dist/persistence/durability/checkpoint-worker.d.ts +7 -0
- package/dist/persistence/durability/checkpoint-worker.mjs +18 -18
- package/dist/{phrase-module-ZY3TLTQA.mjs → phrase-module-EFESWOCR.mjs} +2 -2
- package/dist/{query-actions-7EOKT3WD.mjs → query-actions-7BL3YZDW.mjs} +8 -8
- package/dist/query-suggestions/merge-worker.mjs +11 -11
- package/dist/query-suggestions.browser.mjs +3 -3
- package/dist/query-suggestions.d.ts +1 -1
- package/dist/query-suggestions.mjs +9 -9
- package/dist/react-native/chunks/{chunk-TQ26BKBH.mjs → chunk-43R4GCM7.mjs} +7 -0
- package/dist/react-native/chunks/{chunk-CBU4M3EU.mjs → chunk-63DZ26X5.mjs} +277 -75
- package/dist/react-native/chunks/{chunk-BN6FUB7N.mjs → chunk-AN4HKLB4.mjs} +1 -1
- package/dist/react-native/chunks/{chunk-T5HF3FW3.mjs → chunk-BNFGA7TY.mjs} +3 -3
- package/dist/react-native/chunks/{chunk-PVMEHBQO.mjs → chunk-CW2ZFXSE.mjs} +1 -1
- package/dist/react-native/chunks/{chunk-NLEFMPY3.mjs → chunk-G434H5WG.mjs} +15 -4
- package/dist/react-native/chunks/{chunk-SK3DPAI4.mjs → chunk-HTBY4GON.mjs} +2 -2
- package/dist/react-native/chunks/{chunk-ZQPSXN6C.mjs → chunk-IP3QLETQ.mjs} +5 -5
- package/dist/react-native/chunks/{chunk-7TPO4FLE.mjs → chunk-LOKGE4OQ.mjs} +3 -3
- package/dist/react-native/chunks/{chunk-ZDDJVR7X.mjs → chunk-MRH36RN3.mjs} +2 -2
- package/dist/react-native/chunks/{chunk-YOTP2FPE.mjs → chunk-UO44MA5M.mjs} +1 -1
- package/dist/{chunk-4JBTALUC.mjs → react-native/chunks/chunk-UYAZLGEM.mjs} +1 -1
- package/dist/react-native/chunks/{chunk-WFQ6YQZA.mjs → chunk-UYKIV2KT.mjs} +1 -1
- package/dist/react-native/chunks/{chunk-IEY4DARA.mjs → chunk-XHYOQ4K4.mjs} +2 -2
- package/dist/react-native/chunks/{chunk-OZ3XEM6D.mjs → chunk-ZUJCUPVS.mjs} +1 -1
- package/dist/react-native/chunks/{core-leaf-TPBRRWVN.mjs → core-leaf-5PVST5PR.mjs} +4 -4
- package/dist/react-native/chunks/{durability-config-RVTWSXPH.mjs → durability-config-FCSD4MXY.mjs} +1 -1
- package/dist/{embed-2QMYCD2Q.mjs → react-native/chunks/embed-HA2I7RCF.mjs} +1 -1
- package/dist/react-native/chunks/{gzip.react-native-DLO4WW27.mjs → gzip.react-native-CVM4NQG2.mjs} +2 -2
- package/dist/react-native/chunks/{module-COLNJNML.mjs → module-QRCYB7QV.mjs} +32 -9
- package/dist/react-native/chunks/msgpack-leaf-JMNGSTRW.mjs +7 -0
- package/dist/react-native/chunks/{optional-reads-74HYI4DO.mjs → optional-reads-AFPO2FEB.mjs} +3 -3
- package/dist/react-native/chunks/{optional-writes-QETIM6BI.mjs → optional-writes-GC6JWMAF.mjs} +31 -18
- package/dist/react-native/chunks/{phrase-module-UC4YGEBB.mjs → phrase-module-IGYBK7XH.mjs} +3 -3
- package/dist/react-native/chunks/{resolve-vector-text-FU7D4QP5.mjs → resolve-vector-text-GE2CRJKI.mjs} +1 -1
- package/dist/react-native/chunks/{restore-queue-3E2MJIJS.mjs → restore-queue-2ACONS4W.mjs} +12 -12
- package/dist/react-native/chunks/{segment-codec-leaf-IE4DXUZV.mjs → segment-codec-leaf-SSIWXVUG.mjs} +10 -10
- package/dist/react-native/chunks/{segment-merge-leaf-62LQ5WZB.mjs → segment-merge-leaf-I2WDFE6O.mjs} +11 -11
- package/dist/react-native/chunks/{storage-leaf-LNOLKWZB.mjs → storage-leaf-YXXMG4VR.mjs} +14727 -13915
- package/dist/react-native/chunks/{store-leaf-Y7CBOPFZ.mjs → store-leaf-FS7A4PZA.mjs} +11 -11
- package/dist/react-native/chunks/{suggestions-leaf-PSUGL6MI.mjs → suggestions-leaf-PSFCT5EX.mjs} +11 -11
- package/dist/react-native/chunks/{worker-copies-MW5O5U3D.mjs → worker-copies-QRMISMEL.mjs} +10 -10
- package/dist/react-native/partial-words.mjs +9 -9
- package/dist/react-native/pattern.mjs +5 -5
- package/dist/react-native/query-suggestions.mjs +9 -9
- package/dist/react-native/sync.mjs +433 -51
- package/dist/react-native/synonyms.mjs +9 -9
- package/dist/react.d.ts +8 -8
- package/dist/react.mjs +7 -0
- package/dist/{rerank-KTV5L7MZ.mjs → rerank-4GFC26FD.mjs} +8 -8
- package/dist/rerankers/http.mjs +2 -2
- package/dist/{resolve-vector-text-SD6BEMKZ.mjs → resolve-vector-text-OD4J3WHF.mjs} +2 -2
- package/dist/{restore-queue-ES7TDJ5V.mjs → restore-queue-E4EIUYVV.mjs} +11 -11
- package/dist/{segment-codec-leaf-DO75VKEV.mjs → segment-codec-leaf-MP6DILVE.mjs} +9 -9
- package/dist/{segment-merge-leaf-JGND6LG5.mjs → segment-merge-leaf-ED2NMUC5.mjs} +9 -9
- package/dist/server.d.ts +13 -9
- package/dist/server.mjs +875 -348
- package/dist/{storage-leaf-ZI3H2WJY.mjs → storage-leaf-HQFO37W7.mjs} +5234 -5835
- package/dist/{store-leaf-YIH36Y5J.mjs → store-leaf-PL2G7RM5.mjs} +10 -10
- package/dist/{suggestions-leaf-FP5HSTFP.mjs → suggestions-leaf-I3MEHACP.mjs} +12 -12
- package/dist/sync/filesystem.d.ts +2 -2
- package/dist/sync/filesystem.mjs +16 -16
- package/dist/sync/indexeddb.browser.mjs +1 -1
- package/dist/sync/indexeddb.d.ts +2 -2
- package/dist/sync/indexeddb.mjs +3 -3
- package/dist/sync.browser.mjs +35 -1108
- package/dist/sync.d.ts +3 -3
- package/dist/sync.mjs +430 -51
- package/dist/synonyms.browser.mjs +3 -3
- package/dist/synonyms.mjs +8 -8
- package/dist/{tasks-X2IJQc8J.d.ts → tasks-C65V7lIr.d.ts} +3 -3
- package/dist/thread-LTFI3RK5.mjs +31 -0
- package/dist/{types-D0YasjoX.d.ts → types-CpCg-Gq-.d.ts} +1 -1
- package/dist/vector/search-worker.mjs +5 -5
- package/dist/{worker-copies-WYPRCNB7.mjs → worker-copies-P7YWXEP5.mjs} +11 -11
- package/dist/workers/entry.mjs +14 -14
- package/openapi.json +144 -0
- package/package.json +5 -7
- package/dist/chunk-URVH6BLO.mjs +0 -217
- package/dist/react-native/chunks/msgpack-leaf-GTKLF6GJ.mjs +0 -7
- package/dist/thread-NQRNW3IH.mjs +0 -31
- /package/dist/{chunk-CV3Q2EKO.mjs → chunk-S5QMWECL.mjs} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MAX_FILE_BYTES } from './chunk-4PY4JYMY.mjs';
|
|
2
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
2
|
+
import { NarsilError, ErrorCodes } from './chunk-ZKOQR7EA.mjs';
|
|
3
3
|
|
|
4
4
|
// src/engine/durability-config-host.ts
|
|
5
5
|
function bindDurabilityConfigHost(_host) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { resolveApiKey, buildSignal, postJsonWithRetry } from '../chunk-
|
|
2
|
-
import { NarsilError, ErrorCodes } from '../chunk-
|
|
1
|
+
import { resolveApiKey, buildSignal, postJsonWithRetry } from '../chunk-P4F4UWLC.mjs';
|
|
2
|
+
import { NarsilError, ErrorCodes } from '../chunk-ZKOQR7EA.mjs';
|
|
3
3
|
|
|
4
4
|
// src/embeddings/constants.ts
|
|
5
5
|
var DEFAULT_REQUEST_TIMEOUT_MS = 3e4;
|
|
@@ -912,6 +912,13 @@ declare const ErrorCodes: {
|
|
|
912
912
|
readonly SYNC_NOT_READY: "SYNC_NOT_READY";
|
|
913
913
|
readonly SYNC_NOT_ENABLED: "SYNC_NOT_ENABLED";
|
|
914
914
|
readonly SYNC_SNAPSHOT_PREPARING: "SYNC_SNAPSHOT_PREPARING";
|
|
915
|
+
readonly CHANGES_DURABILITY_REQUIRED: "CHANGES_DURABILITY_REQUIRED";
|
|
916
|
+
readonly CHANGES_BACKUP_STORE_REQUIRED: "CHANGES_BACKUP_STORE_REQUIRED";
|
|
917
|
+
readonly CHANGES_NOT_READY: "CHANGES_NOT_READY";
|
|
918
|
+
readonly CHANGES_NOT_ENABLED: "CHANGES_NOT_ENABLED";
|
|
919
|
+
readonly CHANGES_PREVIOUS_DOCUMENT_REQUIRED: "CHANGES_PREVIOUS_DOCUMENT_REQUIRED";
|
|
920
|
+
readonly CHANGES_EXPORT_PREPARING: "CHANGES_EXPORT_PREPARING";
|
|
921
|
+
readonly CHANGES_INVALID_POSITIONS: "CHANGES_INVALID_POSITIONS";
|
|
915
922
|
readonly QUERY_SUGGESTIONS_NOT_ENABLED: "QUERY_SUGGESTIONS_NOT_ENABLED";
|
|
916
923
|
readonly SEARCH_INVALID_FIELD: "SEARCH_INVALID_FIELD";
|
|
917
924
|
readonly VECTOR_DIMENSION_MISMATCH: "VECTOR_DIMENSION_MISMATCH";
|
|
@@ -1564,6 +1571,198 @@ interface ListResult<T = AnyDocument> {
|
|
|
1564
1571
|
elapsed: number;
|
|
1565
1572
|
}
|
|
1566
1573
|
|
|
1574
|
+
/**
|
|
1575
|
+
* The change capture setting of one index, which {@link ChangesOperations.updateChanges} takes.
|
|
1576
|
+
*
|
|
1577
|
+
* A subscriber receives the documents of the whole index, so decide which callers may follow an index before you turn
|
|
1578
|
+
* capture on. A filter only chooses which changes a subscriber receives, and it grants no access.
|
|
1579
|
+
*
|
|
1580
|
+
* @public
|
|
1581
|
+
*/
|
|
1582
|
+
interface ChangesSetting {
|
|
1583
|
+
/** This turns change capture on or off. Turning it on gives the index a new epoch unless device sync is on. */
|
|
1584
|
+
enabled: boolean;
|
|
1585
|
+
/**
|
|
1586
|
+
* Set this to write into each log entry the document that the entry replaces or removes. A change then holds the
|
|
1587
|
+
* document before the write, and a subscription can hold a filter. It defaults to false, because the engine then
|
|
1588
|
+
* reads the stored document and writes it to the log again on every update and removal.
|
|
1589
|
+
*/
|
|
1590
|
+
previousDocument?: boolean;
|
|
1591
|
+
/** This is the age in milliseconds after which the engine deletes a log segment from history. It defaults to 30
|
|
1592
|
+
* days. */
|
|
1593
|
+
historyMaxAgeMs?: number;
|
|
1594
|
+
/** This is the byte count above which the engine deletes the oldest log segment from history. It defaults to the
|
|
1595
|
+
* larger of the checkpoint's length and 1 GiB. */
|
|
1596
|
+
historyMaxBytes?: number;
|
|
1597
|
+
}
|
|
1598
|
+
/**
|
|
1599
|
+
* The change capture state of one index, which {@link ChangesOperations.getChanges} returns.
|
|
1600
|
+
*
|
|
1601
|
+
* @public
|
|
1602
|
+
*/
|
|
1603
|
+
interface ChangesStatus extends ChangesSetting {
|
|
1604
|
+
/** This is true when the engine writes the document before the write into each log entry. */
|
|
1605
|
+
previousDocument: boolean;
|
|
1606
|
+
/** This is the index epoch, 32 lowercase hexadecimal digits, or `null` while capture is off. */
|
|
1607
|
+
epoch: string | null;
|
|
1608
|
+
}
|
|
1609
|
+
/**
|
|
1610
|
+
* A subscriber's place in one partition of an index: the highest `seqNo` whose change it has applied.
|
|
1611
|
+
*
|
|
1612
|
+
* @public
|
|
1613
|
+
*/
|
|
1614
|
+
interface ChangePosition {
|
|
1615
|
+
/** This is the partition that the position belongs to. */
|
|
1616
|
+
partitionId: number;
|
|
1617
|
+
/** This is the sequence number of the last entry that the subscriber has examined in that partition. */
|
|
1618
|
+
seqNo: number;
|
|
1619
|
+
}
|
|
1620
|
+
/**
|
|
1621
|
+
* What a write did to a document. A `put` comes from an entry that the engine wrote while `previousDocument` was off,
|
|
1622
|
+
* so it can be an insert or an update.
|
|
1623
|
+
*
|
|
1624
|
+
* @public
|
|
1625
|
+
*/
|
|
1626
|
+
type ChangeType = 'put' | 'insert' | 'update' | 'remove';
|
|
1627
|
+
/**
|
|
1628
|
+
* One write to an index, as {@link ChangesOperations.followChanges} returns it.
|
|
1629
|
+
*
|
|
1630
|
+
* @public
|
|
1631
|
+
*/
|
|
1632
|
+
interface Change {
|
|
1633
|
+
/** This is the sequence number of the log entry within its partition. */
|
|
1634
|
+
seqNo: number;
|
|
1635
|
+
/** This is what the write did to the document. */
|
|
1636
|
+
type: ChangeType;
|
|
1637
|
+
/** This is the ID of the document that the write touched. */
|
|
1638
|
+
documentId: string;
|
|
1639
|
+
/** This is the document after the write, with every field and every computed vector, and absent after a removal. */
|
|
1640
|
+
document?: AnyDocument;
|
|
1641
|
+
/** This is the document before the write, present only for an update or a removal with `previousDocument` on. */
|
|
1642
|
+
previousDocument?: AnyDocument;
|
|
1643
|
+
}
|
|
1644
|
+
/**
|
|
1645
|
+
* Where {@link ChangesOperations.followChanges} starts and which changes it returns.
|
|
1646
|
+
*
|
|
1647
|
+
* @public
|
|
1648
|
+
*/
|
|
1649
|
+
interface FollowChangesOptions {
|
|
1650
|
+
/** This is the epoch that the positions belong to. Pass it together with `positions`, or leave both out. */
|
|
1651
|
+
epoch?: string;
|
|
1652
|
+
/** This holds one position for each partition. Leave it out, with `epoch`, to start at the index's current heads. */
|
|
1653
|
+
positions?: ChangePosition[];
|
|
1654
|
+
/**
|
|
1655
|
+
* This keeps only the changes whose document before or after the write matches it, in the syntax of a query's
|
|
1656
|
+
* filters. It needs `previousDocument` on.
|
|
1657
|
+
*/
|
|
1658
|
+
filter?: FilterExpression;
|
|
1659
|
+
/** This ends the iteration when it aborts. */
|
|
1660
|
+
signal?: AbortSignal;
|
|
1661
|
+
}
|
|
1662
|
+
/**
|
|
1663
|
+
* The first event of {@link ChangesOperations.followChanges}, which gives the positions that the changes follow.
|
|
1664
|
+
*
|
|
1665
|
+
* @public
|
|
1666
|
+
*/
|
|
1667
|
+
interface ChangesSubscribed {
|
|
1668
|
+
/** This marks the event. */
|
|
1669
|
+
type: 'subscribed';
|
|
1670
|
+
/** This is the index's epoch. Save it with the positions. */
|
|
1671
|
+
epoch: string;
|
|
1672
|
+
/** This is the number of partitions, each of which has a position. */
|
|
1673
|
+
partitionCount: number;
|
|
1674
|
+
/** These are the positions that the changes follow. */
|
|
1675
|
+
positions: ChangePosition[];
|
|
1676
|
+
/** These are the heads of the partitions when the subscription started. */
|
|
1677
|
+
heads: ChangePosition[];
|
|
1678
|
+
/** This is the length in bytes of the history and log between the positions and the heads. */
|
|
1679
|
+
bytesBehind: number;
|
|
1680
|
+
/** This is true when a change can hold the document before the write. */
|
|
1681
|
+
previousDocument: boolean;
|
|
1682
|
+
}
|
|
1683
|
+
/**
|
|
1684
|
+
* A group of changes from one partition. Apply the changes, then save `scannedSeqNo` as the partition's position.
|
|
1685
|
+
*
|
|
1686
|
+
* @public
|
|
1687
|
+
*/
|
|
1688
|
+
interface ChangesBatch {
|
|
1689
|
+
/** This marks the event. */
|
|
1690
|
+
type: 'changes';
|
|
1691
|
+
/** This is the partition that the changes come from. */
|
|
1692
|
+
partitionId: number;
|
|
1693
|
+
/** These are the changes in `seqNo` order, which can be empty under a filter. */
|
|
1694
|
+
changes: Change[];
|
|
1695
|
+
/** This is the highest `seqNo` of the partition that the engine examined, which is the next position to save. */
|
|
1696
|
+
scannedSeqNo: number;
|
|
1697
|
+
}
|
|
1698
|
+
/**
|
|
1699
|
+
* The last event of {@link ChangesOperations.followChanges} when the positions no longer lead to the index's changes.
|
|
1700
|
+
* Export the index, replace your copy with the export's documents, and follow again from the export's header.
|
|
1701
|
+
*
|
|
1702
|
+
* @public
|
|
1703
|
+
*/
|
|
1704
|
+
interface ChangesResync {
|
|
1705
|
+
/** This marks the event. */
|
|
1706
|
+
type: 'resync';
|
|
1707
|
+
/**
|
|
1708
|
+
* This is `epoch` when the index has a new epoch, `history` when the history no longer holds the entries above a
|
|
1709
|
+
* position, and `ahead` when a position lies above every entry of its partition.
|
|
1710
|
+
*/
|
|
1711
|
+
reason: 'epoch' | 'history' | 'ahead';
|
|
1712
|
+
}
|
|
1713
|
+
/**
|
|
1714
|
+
* One event of {@link ChangesOperations.followChanges}.
|
|
1715
|
+
*
|
|
1716
|
+
* @public
|
|
1717
|
+
*/
|
|
1718
|
+
type ChangesEvent = ChangesSubscribed | ChangesBatch | ChangesResync;
|
|
1719
|
+
/**
|
|
1720
|
+
* The methods that turn change capture on and off for an index and follow its changes.
|
|
1721
|
+
*
|
|
1722
|
+
* @public
|
|
1723
|
+
*/
|
|
1724
|
+
interface ChangesOperations {
|
|
1725
|
+
/**
|
|
1726
|
+
* Replaces the change capture setting of an index.
|
|
1727
|
+
*
|
|
1728
|
+
* Turning capture on gives the index a new epoch unless device sync is on, and the engine keeps the log segments
|
|
1729
|
+
* that a checkpoint covers as history from then on. Turning it off ends every follower of the index and deletes the
|
|
1730
|
+
* history unless a device has asked for the index's sync snapshot. The engine saves the setting with the index, and
|
|
1731
|
+
* no snapshot of the index includes it.
|
|
1732
|
+
*
|
|
1733
|
+
* @param indexName - The index whose setting the engine replaces.
|
|
1734
|
+
* @param setting - The new setting.
|
|
1735
|
+
* @throws A `NarsilError` with `CHANGES_DURABILITY_REQUIRED` when the engine has no write-ahead log durability, and
|
|
1736
|
+
* with `CONFIG_INVALID` when a field has the wrong type or a history limit is not a positive whole number.
|
|
1737
|
+
*/
|
|
1738
|
+
updateChanges(indexName: string, setting: ChangesSetting): Promise<void>;
|
|
1739
|
+
/**
|
|
1740
|
+
* Returns the change capture state of an index.
|
|
1741
|
+
*
|
|
1742
|
+
* @param indexName - The index whose state the engine returns.
|
|
1743
|
+
* @returns The setting and the epoch.
|
|
1744
|
+
* @throws A `NarsilError` with `INDEX_NOT_FOUND` when no index has that name.
|
|
1745
|
+
*/
|
|
1746
|
+
getChanges(indexName: string): Promise<ChangesStatus>;
|
|
1747
|
+
/**
|
|
1748
|
+
* Returns the changes of an index above a list of positions, and then each later change as the log makes it
|
|
1749
|
+
* durable, until the signal aborts or the caller stops iterating.
|
|
1750
|
+
*
|
|
1751
|
+
* The first event gives the epoch and the positions. Each later event holds the changes of one partition in `seqNo`
|
|
1752
|
+
* order. Where the positions no longer lead to the index's changes, the last event is a resync.
|
|
1753
|
+
*
|
|
1754
|
+
* @param indexName - The index whose changes the engine returns.
|
|
1755
|
+
* @param options - The epoch and positions to start from, a filter, and a signal.
|
|
1756
|
+
* @returns The events, one at a time.
|
|
1757
|
+
* @throws A `NarsilError` with `CHANGES_NOT_ENABLED` when capture is off or turns off, with
|
|
1758
|
+
* `CHANGES_INVALID_POSITIONS` for a malformed epoch or list of positions, with `SEARCH_INVALID_FILTER` for a filter
|
|
1759
|
+
* that breaks the shape or the limits of a query's filters, with `SEARCH_INVALID_FIELD` for a filter that tests a
|
|
1760
|
+
* field which the schema leaves out, and with `CHANGES_PREVIOUS_DOCUMENT_REQUIRED` for a filter while
|
|
1761
|
+
* `previousDocument` is off.
|
|
1762
|
+
*/
|
|
1763
|
+
followChanges(indexName: string, options?: FollowChangesOptions): AsyncIterable<ChangesEvent>;
|
|
1764
|
+
}
|
|
1765
|
+
|
|
1567
1766
|
/**
|
|
1568
1767
|
* Snapshot of V8 heap usage as reported by `process.memoryUsage()`, with the
|
|
1569
1768
|
* limit the heap may grow to. All values are bytes. `null` in environments
|
|
@@ -2291,16 +2490,16 @@ interface SnapshotOptions {
|
|
|
2291
2490
|
* One instance holds every index you create, so an application usually keeps a
|
|
2292
2491
|
* single engine for its lifetime and reaches each index by name. Build one
|
|
2293
2492
|
* with {@link createNarsil}. Its write, open and close, synonym, analysis, BM25,
|
|
2294
|
-
* device sync, vector maintenance, and adapter registration
|
|
2295
|
-
*
|
|
2296
|
-
* {@link
|
|
2297
|
-
* {@link BM25Operations}, {@link SyncOperations},
|
|
2298
|
-
* {@link VectorMaintenanceOperations}, and
|
|
2493
|
+
* device sync, change capture, vector maintenance, and adapter registration
|
|
2494
|
+
* methods come from {@link DocumentWriteOperations},
|
|
2495
|
+
* {@link IndexLifecycleOperations}, {@link SynonymOperations},
|
|
2496
|
+
* {@link AnalysisOperations}, {@link BM25Operations}, {@link SyncOperations},
|
|
2497
|
+
* {@link ChangesOperations}, {@link VectorMaintenanceOperations}, and
|
|
2299
2498
|
* {@link AdapterRegistrationOperations}.
|
|
2300
2499
|
*
|
|
2301
2500
|
* @public
|
|
2302
2501
|
*/
|
|
2303
|
-
interface Narsil extends IndexLifecycleOperations, DocumentWriteOperations, SynonymOperations, AnalysisOperations, BM25Operations, SyncOperations, VectorMaintenanceOperations, AdapterRegistrationOperations {
|
|
2502
|
+
interface Narsil extends IndexLifecycleOperations, DocumentWriteOperations, SynonymOperations, AnalysisOperations, BM25Operations, SyncOperations, ChangesOperations, VectorMaintenanceOperations, AdapterRegistrationOperations {
|
|
2304
2503
|
/**
|
|
2305
2504
|
* Creates an index you can insert documents into and query.
|
|
2306
2505
|
*
|
|
@@ -2631,4 +2830,4 @@ interface Narsil extends IndexLifecycleOperations, DocumentWriteOperations, Syno
|
|
|
2631
2830
|
shutdown(): Promise<void>;
|
|
2632
2831
|
}
|
|
2633
2832
|
|
|
2634
|
-
export { type
|
|
2833
|
+
export { type FacetResult as $, type SuggestResult as A, type BatchResult as B, type Change as C, type AnalysisChange as D, type ErrorCode as E, type FollowChangesOptions as F, type GroupResult as G, type Hit as H, type IndexInfo as I, type NarsilEventMap as J, type AdapterRegistrationOperations as K, type ListParams as L, type MemoryStats as M, NarsilError as N, type AnalysisOperations as O, type PartitionStatsResult as P, type QueryParams as Q, type ArrayFilter as R, type ServerErrorCode as S, type BM25Operations as T, type ByteSource as U, type VectorMaintenanceResult as V, type ComparisonFilter as W, type DocumentImportResult as X, type DocumentProjection as Y, type DocumentWriteOperations as Z, type FacetConfig as _, type ChangePosition as a, type FieldFilter as a0, type FilterExpression as a1, type GeoFilter as a2, type GeoPolygonFilter as a3, type GeoRadiusFilter as a4, type GroupReducer as a5, type HeldCheckpointReport as a6, type HighlightConfig as a7, type HighlightMatch as a8, type HybridConfig as a9, type IndexLifecycleOperations as aa, type ListedDocument as ab, type PresenceFilter as ac, type ProcessMemoryReport as ad, type QueryCoverage as ae, type RerankConfig as af, type ScoreComponents as ag, type SearchMode as ah, type SortField as ai, type SortSpec as aj, type StringFilter as ak, type SyncOperations as al, type SynonymOperations as am, type TermMatchPolicy as an, type VectorMaintenanceOperations as ao, type VectorQueryConfig as ap, type WorkerCopyReport as aq, type ChangeType as b, type ChangesBatch as c, type ChangesEvent as d, type ChangesOperations as e, type ChangesResync as f, type ChangesSetting as g, type ChangesStatus as h, type ChangesSubscribed as i, type ClientErrorCode as j, ClientErrorCodes as k, ErrorCodes as l, type NarsilErrorCode as m, ServerErrorCodes as n, type SnapshotOptions as o, type SyncSetting as p, type SyncStatus as q, isNarsilError as r, type Narsil as s, type QueryResult as t, type NarsilEventHandlers as u, type GroupConfig as v, type SuggestParams as w, type IndexStats as x, type ListResult as y, type PreflightResult as z };
|
|
@@ -1,5 +1,133 @@
|
|
|
1
1
|
import { S as SchemaDefinition } from './schema-CzG9OUw5.js';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Where one partition stands in its move between nodes.
|
|
5
|
+
*
|
|
6
|
+
* `ACTIVE` is the steady state. `INITIALISING` means a node is still filling
|
|
7
|
+
* it, `MIGRATING` means it is moving, `DECOMMISSIONING` means it is being
|
|
8
|
+
* drained, and `UNASSIGNED` means no node holds it.
|
|
9
|
+
*
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
type PartitionState = 'UNASSIGNED' | 'INITIALISING' | 'ACTIVE' | 'MIGRATING' | 'DECOMMISSIONING';
|
|
13
|
+
/**
|
|
14
|
+
* Why a partition stays `UNASSIGNED` after the controller has asked its last holders for a copy.
|
|
15
|
+
*
|
|
16
|
+
* `HOLDER_OFFLINE` means a last holder has yet to register again, so the controller is still waiting for it.
|
|
17
|
+
* `HOLDER_UNREACHABLE` means a registered holder left the request unanswered or answered with a payload the
|
|
18
|
+
* controller could not read. `HOLDER_IDENTITY_MISMATCH` means a holder answered under a different index identity,
|
|
19
|
+
* so its copy holds the documents of an earlier index of the same name, or it keeps no copy of that name at all.
|
|
20
|
+
* `HOLDER_WITHOUT_DATA` means every holder answered under the coordinator's identity with a list that left the
|
|
21
|
+
* partition out.
|
|
22
|
+
*
|
|
23
|
+
* @public
|
|
24
|
+
*/
|
|
25
|
+
type UnassignedReason = 'HOLDER_OFFLINE' | 'HOLDER_UNREACHABLE' | 'HOLDER_IDENTITY_MISMATCH' | 'HOLDER_WITHOUT_DATA';
|
|
26
|
+
/**
|
|
27
|
+
* Which nodes hold one partition, and where that partition stands.
|
|
28
|
+
*
|
|
29
|
+
* @public
|
|
30
|
+
*/
|
|
31
|
+
interface PartitionAssignment {
|
|
32
|
+
/** This node accepts writes, and it is `null` while no node holds the partition. */
|
|
33
|
+
primary: string | null;
|
|
34
|
+
/** These nodes each hold a copy, including the primary. */
|
|
35
|
+
replicas: string[];
|
|
36
|
+
/** These replicas are current enough to be promoted, which is the set a failover picks from. */
|
|
37
|
+
inSyncSet: string[];
|
|
38
|
+
/**
|
|
39
|
+
* The controller raises this by 1 in every table write that changes `inSyncSet`, that accepts an in-sync removal, or
|
|
40
|
+
* that removes a node from `replicas`, and by 1 once where a write makes more than one of those changes. It refuses
|
|
41
|
+
* an admission that carries any other value, so an admission that a primary asked for before a removal, or before
|
|
42
|
+
* the replica left the assignment and dropped its copy, never adds the replica back. A table that an earlier release
|
|
43
|
+
* wrote leaves it absent, and every reader counts an absent value as 0.
|
|
44
|
+
*/
|
|
45
|
+
inSyncVersion?: number;
|
|
46
|
+
/**
|
|
47
|
+
* The controller is moving the copies on these nodes elsewhere, and each one stays in `replicas` and in `inSyncSet`
|
|
48
|
+
* until the copies outside this list reach the replication factor in sync. The field is absent while no move is
|
|
49
|
+
* under way.
|
|
50
|
+
*/
|
|
51
|
+
removingReplicas?: string[];
|
|
52
|
+
/** These nodes still hold a copy of a partition no node serves, and the field stays until the partition is `ACTIVE`. */
|
|
53
|
+
lastHolders?: string[];
|
|
54
|
+
/** This says where the partition stands in its move between nodes. */
|
|
55
|
+
state: PartitionState;
|
|
56
|
+
/** This rises each time the primary changes, which is what makes a stale primary's writes detectable. */
|
|
57
|
+
primaryTerm: number;
|
|
58
|
+
/** The primary has acknowledged every sequence number up to here, so every in-sync replica holds them. */
|
|
59
|
+
commitPoint: number;
|
|
60
|
+
/** Why the partition stays `UNASSIGNED`, which the controller records each time it asks the last holders. */
|
|
61
|
+
unassignedReason?: UnassignedReason;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* How one index's partitions are spread across the cluster.
|
|
65
|
+
*
|
|
66
|
+
* @public
|
|
67
|
+
*/
|
|
68
|
+
interface AllocationTable {
|
|
69
|
+
/** The table covers this index. */
|
|
70
|
+
indexName: string;
|
|
71
|
+
/** This rises on every change, so a writer detects that another controller got there first. */
|
|
72
|
+
version: number;
|
|
73
|
+
/** The cluster keeps this many copies of each partition. */
|
|
74
|
+
replicationFactor: number;
|
|
75
|
+
/** These assignments are keyed by partition id. */
|
|
76
|
+
assignments: Map<number, PartitionAssignment>;
|
|
77
|
+
/**
|
|
78
|
+
* The name of the index that serves this index name since a partition count change finished. A table that carries
|
|
79
|
+
* it holds no assignments, and every read, write, and metadata lookup for this name goes to that index. The field
|
|
80
|
+
* is absent until the first change of the partition count.
|
|
81
|
+
*/
|
|
82
|
+
generation?: string;
|
|
83
|
+
/**
|
|
84
|
+
* The identity of the index that this table allocates, which the controller copies from the index metadata. When a
|
|
85
|
+
* node holds a table for a name and receives one with a different uuid, it takes the received table whatever the two
|
|
86
|
+
* versions are, because the name then refers to another index. The field is absent from a table that an earlier
|
|
87
|
+
* release wrote.
|
|
88
|
+
*/
|
|
89
|
+
indexUuid?: string;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* The registration that an allocation write expects a replica to hold when the write takes effect, which is how the
|
|
93
|
+
* controller keeps a replica that restarted after the primary proved its position out of the in-sync set.
|
|
94
|
+
*
|
|
95
|
+
* @public
|
|
96
|
+
*/
|
|
97
|
+
interface ExpectedReplicaRegistration {
|
|
98
|
+
/** The replica's node. */
|
|
99
|
+
nodeId: string;
|
|
100
|
+
/** The `startedAt` that the replica's registration must carry, which a node writes anew on every start. */
|
|
101
|
+
startedAt: string;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Tells watchers that an index's allocation changed.
|
|
105
|
+
*
|
|
106
|
+
* @public
|
|
107
|
+
*/
|
|
108
|
+
interface AllocationEvent {
|
|
109
|
+
/** This index's allocation changed. */
|
|
110
|
+
indexName: string;
|
|
111
|
+
/** The allocation now stands like this. */
|
|
112
|
+
table: AllocationTable;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* The rules the allocator respects when it places partitions.
|
|
116
|
+
*
|
|
117
|
+
* The controller stores these with each index's metadata, so every node
|
|
118
|
+
* allocating that index applies the same rules.
|
|
119
|
+
*
|
|
120
|
+
* @public
|
|
121
|
+
*/
|
|
122
|
+
interface AllocationConstraints {
|
|
123
|
+
/** Setting this spreads an index's replicas across zones, so losing one zone never costs every copy. */
|
|
124
|
+
zoneAwareness: boolean;
|
|
125
|
+
/** This names the key in a node's `metadata` that carries its zone. */
|
|
126
|
+
zoneAttribute: string;
|
|
127
|
+
/** One node may hold this many partitions of an index, and `null` lifts the ceiling. */
|
|
128
|
+
maxShardsPerNode: number | null;
|
|
129
|
+
}
|
|
130
|
+
|
|
3
131
|
/**
|
|
4
132
|
* Tells watchers that the stored metadata of an index changed.
|
|
5
133
|
*
|
|
@@ -163,97 +291,6 @@ interface NodeEvent {
|
|
|
163
291
|
registration: NodeRegistration | null;
|
|
164
292
|
}
|
|
165
293
|
|
|
166
|
-
/**
|
|
167
|
-
* Where one partition stands in its move between nodes.
|
|
168
|
-
*
|
|
169
|
-
* `ACTIVE` is the steady state. `INITIALISING` means a node is still filling
|
|
170
|
-
* it, `MIGRATING` means it is moving, `DECOMMISSIONING` means it is being
|
|
171
|
-
* drained, and `UNASSIGNED` means no node holds it.
|
|
172
|
-
*
|
|
173
|
-
* @public
|
|
174
|
-
*/
|
|
175
|
-
type PartitionState = 'UNASSIGNED' | 'INITIALISING' | 'ACTIVE' | 'MIGRATING' | 'DECOMMISSIONING';
|
|
176
|
-
/**
|
|
177
|
-
* Why a partition stays `UNASSIGNED` after the controller has asked its last holders for a copy.
|
|
178
|
-
*
|
|
179
|
-
* `HOLDER_OFFLINE` means a last holder has yet to register again, so the controller is still waiting for it.
|
|
180
|
-
* `HOLDER_UNREACHABLE` means a registered holder left the request unanswered or answered with a payload the
|
|
181
|
-
* controller could not read. `HOLDER_IDENTITY_MISMATCH` means a holder answered under a different index identity,
|
|
182
|
-
* so its copy holds the documents of an earlier index of the same name, or it keeps no copy of that name at all.
|
|
183
|
-
* `HOLDER_WITHOUT_DATA` means every holder answered under the coordinator's identity with a list that left the
|
|
184
|
-
* partition out.
|
|
185
|
-
*
|
|
186
|
-
* @public
|
|
187
|
-
*/
|
|
188
|
-
type UnassignedReason = 'HOLDER_OFFLINE' | 'HOLDER_UNREACHABLE' | 'HOLDER_IDENTITY_MISMATCH' | 'HOLDER_WITHOUT_DATA';
|
|
189
|
-
/**
|
|
190
|
-
* Which nodes hold one partition, and where that partition stands.
|
|
191
|
-
*
|
|
192
|
-
* @public
|
|
193
|
-
*/
|
|
194
|
-
interface PartitionAssignment {
|
|
195
|
-
/** This node accepts writes, and it is `null` while no node holds the partition. */
|
|
196
|
-
primary: string | null;
|
|
197
|
-
/** These nodes each hold a copy, including the primary. */
|
|
198
|
-
replicas: string[];
|
|
199
|
-
/** These replicas are current enough to be promoted, which is the set a failover picks from. */
|
|
200
|
-
inSyncSet: string[];
|
|
201
|
-
/**
|
|
202
|
-
* The controller is moving the copies on these nodes elsewhere, and each one stays in `replicas` and in `inSyncSet`
|
|
203
|
-
* until the copies outside this list reach the replication factor in sync. The field is absent while no move is
|
|
204
|
-
* under way.
|
|
205
|
-
*/
|
|
206
|
-
removingReplicas?: string[];
|
|
207
|
-
/** These nodes still hold a copy of a partition no node serves, and the field stays until the partition is `ACTIVE`. */
|
|
208
|
-
lastHolders?: string[];
|
|
209
|
-
/** This says where the partition stands in its move between nodes. */
|
|
210
|
-
state: PartitionState;
|
|
211
|
-
/** This rises each time the primary changes, which is what makes a stale primary's writes detectable. */
|
|
212
|
-
primaryTerm: number;
|
|
213
|
-
/** The primary has acknowledged every sequence number up to here, so every in-sync replica holds them. */
|
|
214
|
-
commitPoint: number;
|
|
215
|
-
/** Why the partition stays `UNASSIGNED`, which the controller records each time it asks the last holders. */
|
|
216
|
-
unassignedReason?: UnassignedReason;
|
|
217
|
-
}
|
|
218
|
-
/**
|
|
219
|
-
* How one index's partitions are spread across the cluster.
|
|
220
|
-
*
|
|
221
|
-
* @public
|
|
222
|
-
*/
|
|
223
|
-
interface AllocationTable {
|
|
224
|
-
/** The table covers this index. */
|
|
225
|
-
indexName: string;
|
|
226
|
-
/** This rises on every change, so a writer detects that another controller got there first. */
|
|
227
|
-
version: number;
|
|
228
|
-
/** The cluster keeps this many copies of each partition. */
|
|
229
|
-
replicationFactor: number;
|
|
230
|
-
/** These assignments are keyed by partition id. */
|
|
231
|
-
assignments: Map<number, PartitionAssignment>;
|
|
232
|
-
/**
|
|
233
|
-
* The name of the index that serves this index name since a partition count change finished. A table that carries
|
|
234
|
-
* it holds no assignments, and every read, write, and metadata lookup for this name goes to that index. The field
|
|
235
|
-
* is absent until the first change of the partition count.
|
|
236
|
-
*/
|
|
237
|
-
generation?: string;
|
|
238
|
-
/**
|
|
239
|
-
* The identity of the index that this table allocates, which the controller copies from the index metadata. When a
|
|
240
|
-
* node holds a table for a name and receives one with a different uuid, it takes the received table whatever the two
|
|
241
|
-
* versions are, because the name then refers to another index. The field is absent from a table that an earlier
|
|
242
|
-
* release wrote.
|
|
243
|
-
*/
|
|
244
|
-
indexUuid?: string;
|
|
245
|
-
}
|
|
246
|
-
/**
|
|
247
|
-
* Tells watchers that an index's allocation changed.
|
|
248
|
-
*
|
|
249
|
-
* @public
|
|
250
|
-
*/
|
|
251
|
-
interface AllocationEvent {
|
|
252
|
-
/** This index's allocation changed. */
|
|
253
|
-
indexName: string;
|
|
254
|
-
/** The allocation now stands like this. */
|
|
255
|
-
table: AllocationTable;
|
|
256
|
-
}
|
|
257
294
|
/**
|
|
258
295
|
* Tells watchers that an index's schema was published or dropped.
|
|
259
296
|
*
|
|
@@ -267,22 +304,6 @@ interface SchemaEvent {
|
|
|
267
304
|
/** This is the schema, and it is `null` when the index was dropped. */
|
|
268
305
|
schema: SchemaDefinition | null;
|
|
269
306
|
}
|
|
270
|
-
/**
|
|
271
|
-
* The rules the allocator respects when it places partitions.
|
|
272
|
-
*
|
|
273
|
-
* The controller stores these with each index's metadata, so every node
|
|
274
|
-
* allocating that index applies the same rules.
|
|
275
|
-
*
|
|
276
|
-
* @public
|
|
277
|
-
*/
|
|
278
|
-
interface AllocationConstraints {
|
|
279
|
-
/** Setting this spreads an index's replicas across zones, so losing one zone never costs every copy. */
|
|
280
|
-
zoneAwareness: boolean;
|
|
281
|
-
/** This names the key in a node's `metadata` that carries its zone. */
|
|
282
|
-
zoneAttribute: string;
|
|
283
|
-
/** One node may hold this many partitions of an index, and `null` lifts the ceiling. */
|
|
284
|
-
maxShardsPerNode: number | null;
|
|
285
|
-
}
|
|
286
307
|
/**
|
|
287
308
|
* The shared state every cluster node reads and writes: which nodes exist,
|
|
288
309
|
* which node holds each partition, who holds which lease, and what each
|
|
@@ -375,7 +396,8 @@ interface ClusterCoordinator extends IndexMetadataWatch {
|
|
|
375
396
|
/**
|
|
376
397
|
* Writes one index's allocation while the stored table still carries the
|
|
377
398
|
* version that the caller read and the writer still holds the controller
|
|
378
|
-
* lease, checking
|
|
399
|
+
* lease, checking those two and any replica registration that the caller
|
|
400
|
+
* gives in one atomic operation.
|
|
379
401
|
*
|
|
380
402
|
* @param indexName - The index to write.
|
|
381
403
|
* @param table - The allocation to store.
|
|
@@ -383,10 +405,14 @@ interface ClusterCoordinator extends IndexMetadataWatch {
|
|
|
383
405
|
* write only while the index has no allocation yet.
|
|
384
406
|
* @param writerNodeId - The node that writes the table, which must hold the
|
|
385
407
|
* `_narsil/controller` lease when the write takes effect.
|
|
408
|
+
* @param replicaRegistration - A replica whose registration must carry the
|
|
409
|
+
* given `startedAt` when the write takes effect, which the controller
|
|
410
|
+
* passes when the write admits that replica to the in-sync set.
|
|
386
411
|
* @returns True when the write went through, and false when the stored
|
|
387
|
-
* version no longer matched
|
|
412
|
+
* version no longer matched, the writer did not hold the controller lease,
|
|
413
|
+
* or the replica was not registered with that `startedAt`.
|
|
388
414
|
*/
|
|
389
|
-
putAllocation(indexName: string, table: AllocationTable, expectedVersion: number | null, writerNodeId: string): Promise<boolean>;
|
|
415
|
+
putAllocation(indexName: string, table: AllocationTable, expectedVersion: number | null, writerNodeId: string, replicaRegistration?: ExpectedReplicaRegistration): Promise<boolean>;
|
|
390
416
|
/**
|
|
391
417
|
* Removes one index's allocation, which is the last step of dropping the
|
|
392
418
|
* index. Deleting an allocation that does not exist does nothing.
|
|
@@ -516,4 +542,4 @@ interface ClusterCoordinator extends IndexMetadataWatch {
|
|
|
516
542
|
shutdown(): Promise<void>;
|
|
517
543
|
}
|
|
518
544
|
|
|
519
|
-
export type { AllocationConstraints as A, ClusterCoordinator as C, IndexMetadataEvent as I, NodeRole as N, PartitionAssignment as P, RegistrationLease as R, SchemaEvent as S, UnassignedReason as U, AllocationTable as a, NodeRegistration as b, NodeCapacity as c, NodeMemoryReport as d, AllocationEvent as e, IndexMetadataWatch as f, IndexPartitionBytes as g, NodeEvent as h, PartitionState as i };
|
|
545
|
+
export type { AllocationConstraints as A, ClusterCoordinator as C, ExpectedReplicaRegistration as E, IndexMetadataEvent as I, NodeRole as N, PartitionAssignment as P, RegistrationLease as R, SchemaEvent as S, UnassignedReason as U, AllocationTable as a, NodeRegistration as b, NodeCapacity as c, NodeMemoryReport as d, AllocationEvent as e, IndexMetadataWatch as f, IndexPartitionBytes as g, NodeEvent as h, PartitionState as i };
|
package/dist/index.browser.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { VERSION, clearNormalizationCache, configureNormalizationCache, createNarsil, getLanguage, getNormalizationCacheSize, getStopWords, getTokenizer, hasStopWords, hasTokenizer, isSimdAvailable, registerLanguage, registerPartialWordSearch, registerPatternSearch, registerStopWords, registerSynonyms, registerTokenizer, resetNormalizationCache } from './browser/chunk-
|
|
2
|
-
import './browser/chunk-
|
|
1
|
+
export { VERSION, clearNormalizationCache, configureNormalizationCache, createNarsil, getLanguage, getNormalizationCacheSize, getStopWords, getTokenizer, hasStopWords, hasTokenizer, isSimdAvailable, registerLanguage, registerPartialWordSearch, registerPatternSearch, registerStopWords, registerSynonyms, registerTokenizer, resetNormalizationCache } from './browser/chunk-UQG4HUGQ.mjs';
|
|
2
|
+
import './browser/chunk-QAOVAYAG.mjs';
|
|
3
3
|
import './browser/chunk-YJHGOJAC.mjs';
|
|
4
|
-
export { ClientErrorCodes, ErrorCodes, NarsilError, ServerErrorCodes, isNarsilError } from './browser/chunk-
|
|
4
|
+
export { ClientErrorCodes, ErrorCodes, NarsilError, ServerErrorCodes, isNarsilError } from './browser/chunk-YINZFPLT.mjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -6,10 +6,10 @@ import { S as SynonymSearch } from './synonyms-CpOAHPa-.js';
|
|
|
6
6
|
export { O as OneWaySynonymRule, a as SynonymRule, T as TwoWaySynonymRule } from './synonyms-CpOAHPa-.js';
|
|
7
7
|
import { L as LanguageModule } from './language-DB8KG1z5.js';
|
|
8
8
|
export { T as TokenizerConfig } from './language-DB8KG1z5.js';
|
|
9
|
-
import {
|
|
10
|
-
export {
|
|
11
|
-
import { N as NarsilConfig } from './config-
|
|
12
|
-
export { A as AnalysisConfig, D as DurabilityConfig, I as IndexContext, a as IndexLifecycleConfig, b as InsertContext, M as MainCopyQueries, c as MemoryConfig, d as NarsilPlugin, P as PartitionContext, Q as QuerySuggestionsConfig, R as RemoveContext, S as SearchContext, e as StaleAnalysis, U as UpdateContext, W as WorkerConfig, f as WorkerContext } from './config-
|
|
9
|
+
import { s as Narsil } from './engine-qjAxJSKk.js';
|
|
10
|
+
export { K as AdapterRegistrationOperations, D as AnalysisChange, O as AnalysisOperations, R as ArrayFilter, T as BM25Operations, B as BatchResult, U as ByteSource, C as Change, a as ChangePosition, b as ChangeType, c as ChangesBatch, d as ChangesEvent, e as ChangesOperations, f as ChangesResync, g as ChangesSetting, h as ChangesStatus, i as ChangesSubscribed, j as ClientErrorCode, k as ClientErrorCodes, W as ComparisonFilter, X as DocumentImportResult, Y as DocumentProjection, Z as DocumentWriteOperations, E as ErrorCode, l as ErrorCodes, _ as FacetConfig, $ as FacetResult, a0 as FieldFilter, a1 as FilterExpression, F as FollowChangesOptions, a2 as GeoFilter, a3 as GeoPolygonFilter, a4 as GeoRadiusFilter, v as GroupConfig, a5 as GroupReducer, G as GroupResult, a6 as HeldCheckpointReport, a7 as HighlightConfig, a8 as HighlightMatch, H as Hit, a9 as HybridConfig, I as IndexInfo, aa as IndexLifecycleOperations, x as IndexStats, L as ListParams, y as ListResult, ab as ListedDocument, M as MemoryStats, N as NarsilError, m as NarsilErrorCode, u as NarsilEventHandlers, J as NarsilEventMap, P as PartitionStatsResult, z as PreflightResult, ac as PresenceFilter, ad as ProcessMemoryReport, ae as QueryCoverage, Q as QueryParams, t as QueryResult, af as RerankConfig, ag as ScoreComponents, ah as SearchMode, S as ServerErrorCode, n as ServerErrorCodes, o as SnapshotOptions, ai as SortField, aj as SortSpec, ak as StringFilter, w as SuggestParams, A as SuggestResult, al as SyncOperations, p as SyncSetting, q as SyncStatus, am as SynonymOperations, an as TermMatchPolicy, ao as VectorMaintenanceOperations, V as VectorMaintenanceResult, ap as VectorQueryConfig, aq as WorkerCopyReport, r as isNarsilError } from './engine-qjAxJSKk.js';
|
|
11
|
+
import { N as NarsilConfig } from './config-PqgNY1H7.js';
|
|
12
|
+
export { A as AnalysisConfig, D as DurabilityConfig, I as IndexContext, a as IndexLifecycleConfig, b as InsertContext, M as MainCopyQueries, c as MemoryConfig, d as NarsilPlugin, P as PartitionContext, Q as QuerySuggestionsConfig, R as RemoveContext, S as SearchContext, e as StaleAnalysis, U as UpdateContext, W as WorkerConfig, f as WorkerContext } from './config-PqgNY1H7.js';
|
|
13
13
|
import { N as NativeStoredValues } from './stored-values-BWIMpiT_.js';
|
|
14
14
|
export { E as EmbeddingAdapter, I as InvalidationAdapter, a as InvalidationEvent, b as PartitionStatistics, P as PersistenceAdapter, R as RerankAdapter } from './adapters-pljAqmrC.js';
|
|
15
15
|
export { h as QuerySuggestionsBuildEvent, j as QuerySuggestionsWarningEvent } from './query-suggestions-CBYkrQ5T.js';
|
package/dist/index.mjs
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
export { VERSION, clearNormalizationCache, configureNormalizationCache, createNarsil, getLanguage, getNormalizationCacheSize, getStopWords, getTokenizer, hasStopWords, hasTokenizer, isSimdAvailable, registerLanguage, registerPartialWordSearch, registerPatternSearch, registerStopWords, registerSynonyms, registerTokenizer, resetNormalizationCache } from './chunk-
|
|
2
|
-
import './chunk-
|
|
3
|
-
import './chunk-
|
|
1
|
+
export { VERSION, clearNormalizationCache, configureNormalizationCache, createNarsil, getLanguage, getNormalizationCacheSize, getStopWords, getTokenizer, hasStopWords, hasTokenizer, isSimdAvailable, registerLanguage, registerPartialWordSearch, registerPatternSearch, registerStopWords, registerSynonyms, registerTokenizer, resetNormalizationCache } from './chunk-HSA3H3VW.mjs';
|
|
2
|
+
import './chunk-2CKDCC65.mjs';
|
|
3
|
+
import './chunk-AOYQTX6W.mjs';
|
|
4
4
|
import './chunk-GXCDWLQI.mjs';
|
|
5
5
|
import './chunk-BUMREPLU.mjs';
|
|
6
6
|
import './chunk-7T4LAYT4.mjs';
|
|
7
|
-
import './chunk-
|
|
8
|
-
import './chunk-
|
|
7
|
+
import './chunk-IL5DRCNU.mjs';
|
|
8
|
+
import './chunk-7P5YWDRQ.mjs';
|
|
9
9
|
import './chunk-U2BKYEC7.mjs';
|
|
10
|
-
import './chunk-
|
|
10
|
+
import './chunk-RORNUNXW.mjs';
|
|
11
11
|
import './chunk-UPDNNOTG.mjs';
|
|
12
12
|
import './chunk-3ECIRFS5.mjs';
|
|
13
|
-
import './chunk-
|
|
13
|
+
import './chunk-ASZLNVWW.mjs';
|
|
14
14
|
import './chunk-ZXX5GZEX.mjs';
|
|
15
15
|
import './chunk-4PY4JYMY.mjs';
|
|
16
|
-
export { ClientErrorCodes, ErrorCodes, NarsilError, ServerErrorCodes, isNarsilError } from './chunk-
|
|
16
|
+
export { ClientErrorCodes, ErrorCodes, NarsilError, ServerErrorCodes, isNarsilError } from './chunk-ZKOQR7EA.mjs';
|
|
17
17
|
import './chunk-TGPKS2UM.mjs';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export { VERSION, clearNormalizationCache, configureNormalizationCache, createNarsil, getLanguage, getNormalizationCacheSize, getStopWords, getTokenizer, hasStopWords, hasTokenizer, isSimdAvailable, registerLanguage, registerPartialWordSearch, registerPatternSearch, registerStopWords, registerSynonyms, registerTokenizer, resetNormalizationCache } from './react-native/chunks/chunk-
|
|
2
|
-
import './react-native/chunks/chunk-
|
|
3
|
-
import './react-native/chunks/chunk-
|
|
1
|
+
export { VERSION, clearNormalizationCache, configureNormalizationCache, createNarsil, getLanguage, getNormalizationCacheSize, getStopWords, getTokenizer, hasStopWords, hasTokenizer, isSimdAvailable, registerLanguage, registerPartialWordSearch, registerPatternSearch, registerStopWords, registerSynonyms, registerTokenizer, resetNormalizationCache } from './react-native/chunks/chunk-63DZ26X5.mjs';
|
|
2
|
+
import './react-native/chunks/chunk-AN4HKLB4.mjs';
|
|
3
|
+
import './react-native/chunks/chunk-G434H5WG.mjs';
|
|
4
4
|
import './react-native/chunks/chunk-LX62Y4B5.mjs';
|
|
5
|
-
import './react-native/chunks/chunk-
|
|
6
|
-
import './react-native/chunks/chunk-
|
|
7
|
-
import './react-native/chunks/chunk-
|
|
8
|
-
import './react-native/chunks/chunk-
|
|
9
|
-
import './react-native/chunks/chunk-
|
|
5
|
+
import './react-native/chunks/chunk-HTBY4GON.mjs';
|
|
6
|
+
import './react-native/chunks/chunk-UYKIV2KT.mjs';
|
|
7
|
+
import './react-native/chunks/chunk-CW2ZFXSE.mjs';
|
|
8
|
+
import './react-native/chunks/chunk-UO44MA5M.mjs';
|
|
9
|
+
import './react-native/chunks/chunk-MRH36RN3.mjs';
|
|
10
10
|
import './react-native/chunks/chunk-HRDMIQ63.mjs';
|
|
11
11
|
import './react-native/chunks/chunk-VUJCSQG5.mjs';
|
|
12
|
-
export { ClientErrorCodes, ErrorCodes, NarsilError, ServerErrorCodes, isNarsilError } from './react-native/chunks/chunk-
|
|
12
|
+
export { ClientErrorCodes, ErrorCodes, NarsilError, ServerErrorCodes, isNarsilError } from './react-native/chunks/chunk-43R4GCM7.mjs';
|