endee 1.7.1-dev.3 → 1.8.0-dev.1

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.
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Reranking utilities for the Endee client.
3
+ *
4
+ * Ports the Python client's `apply_rrf`. Each reranker accepts the per-field
5
+ * ranked hits from the server SearchResult and returns a fused, ranked list of
6
+ * `[intId, score]` tuples truncated to `limit`.
7
+ */
8
+ import type { RerankOptions, RerankResponse, SearchResponse } from './types/index.js';
9
+ /** `{ fieldName: [[intId, score], ...] }` from the server SearchResult. */
10
+ export type ResultsMap = Map<string, Array<[number, number]>> | Record<string, Array<[number, number]>>;
11
+ /**
12
+ * Reciprocal Rank Fusion across named fields.
13
+ *
14
+ * For each field, a hit at rank `r` (1-based) contributes `weight / (k + r)` to
15
+ * that object's score. Scores are summed across fields and the top `limit`
16
+ * objects are returned, sorted by score descending.
17
+ */
18
+ export declare function applyRrf(resultsMap: ResultsMap, fieldWeights: Record<string, number>, limit: number, k?: number): Array<[number, number]>;
19
+ /**
20
+ * Fuse the per-field results from `search()` into a single ranked list.
21
+ *
22
+ * Uses Reciprocal Rank Fusion over each field's decoded `SearchHit[]`: a hit at
23
+ * rank `r` (1-based) in field `f` contributes `fieldWeights[f] / (rrfK + r)` to
24
+ * that object's score. Scores are summed across fields (deduped by `id`) and the
25
+ * top `limit` hits are returned, sorted by fused score descending.
26
+ *
27
+ * @example
28
+ * const res = await col.search({ fields: { embedding: { query: v }, keywords: { query: s } }, limit: 10 });
29
+ * const fused = rerank(res, { name: 'rrf', limit: 10, fieldWeights: { embedding: 0.6, keywords: 0.4 } });
30
+ */
31
+ export declare function rerank(searchResults: SearchResponse, options: RerankOptions): RerankResponse;
32
+ //# sourceMappingURL=reranker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reranker.d.ts","sourceRoot":"","sources":["../src/reranker.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAa,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEjG,2EAA2E;AAC3E,MAAM,MAAM,UAAU,GAClB,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,GACpC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;AAO5C;;;;;;GAMG;AACH,wBAAgB,QAAQ,CACtB,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACpC,KAAK,EAAE,MAAM,EACb,CAAC,SAAK,GACL,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAgBzB;AAsBD;;;;;;;;;;;GAWG;AACH,wBAAgB,MAAM,CAAC,aAAa,EAAE,cAAc,EAAE,OAAO,EAAE,aAAa,GAAG,cAAc,CAmC5F"}
@@ -0,0 +1,96 @@
1
+ /**
2
+ * Reranking utilities for the Endee client.
3
+ *
4
+ * Ports the Python client's `apply_rrf`. Each reranker accepts the per-field
5
+ * ranked hits from the server SearchResult and returns a fused, ranked list of
6
+ * `[intId, score]` tuples truncated to `limit`.
7
+ */
8
+ import { DEFAULT_RRF_RANK_CONSTANT, DEFAULT_TOP_K } from './constants.js';
9
+ function entries(map) {
10
+ if (map instanceof Map)
11
+ return Array.from(map.entries());
12
+ return Object.entries(map);
13
+ }
14
+ /**
15
+ * Reciprocal Rank Fusion across named fields.
16
+ *
17
+ * For each field, a hit at rank `r` (1-based) contributes `weight / (k + r)` to
18
+ * that object's score. Scores are summed across fields and the top `limit`
19
+ * objects are returned, sorted by score descending.
20
+ */
21
+ export function applyRrf(resultsMap, fieldWeights, limit, k = 60) {
22
+ const rrfScores = new Map();
23
+ for (const [fieldName, hits] of entries(resultsMap)) {
24
+ const weight = fieldWeights[fieldName] ?? 0.0;
25
+ let rank = 1;
26
+ for (const hit of hits || []) {
27
+ const intId = hit[0];
28
+ rrfScores.set(intId, (rrfScores.get(intId) ?? 0.0) + weight / (k + rank));
29
+ rank += 1;
30
+ }
31
+ }
32
+ return Array.from(rrfScores.entries())
33
+ .sort((a, b) => b[1] - a[1])
34
+ .slice(0, limit);
35
+ }
36
+ /** Resolve and validate per-field weights against the fields present. */
37
+ function resolveFieldWeights(fieldNames, fieldWeights) {
38
+ if (fieldWeights === null || fieldWeights === undefined) {
39
+ const n = fieldNames.length;
40
+ return Object.fromEntries(fieldNames.map((f) => [f, 1.0 / n]));
41
+ }
42
+ const missing = fieldNames.filter((f) => !(f in fieldWeights));
43
+ if (missing.length > 0) {
44
+ throw new Error(`fieldWeights missing entries for: ${missing.sort().join(', ')}`);
45
+ }
46
+ const total = fieldNames.reduce((s, f) => s + fieldWeights[f], 0);
47
+ if (Math.abs(total - 1.0) > 1e-6) {
48
+ throw new Error(`fieldWeights must sum to 1.0 (got ${total})`);
49
+ }
50
+ return fieldWeights;
51
+ }
52
+ /**
53
+ * Fuse the per-field results from `search()` into a single ranked list.
54
+ *
55
+ * Uses Reciprocal Rank Fusion over each field's decoded `SearchHit[]`: a hit at
56
+ * rank `r` (1-based) in field `f` contributes `fieldWeights[f] / (rrfK + r)` to
57
+ * that object's score. Scores are summed across fields (deduped by `id`) and the
58
+ * top `limit` hits are returned, sorted by fused score descending.
59
+ *
60
+ * @example
61
+ * const res = await col.search({ fields: { embedding: { query: v }, keywords: { query: s } }, limit: 10 });
62
+ * const fused = rerank(res, { name: 'rrf', limit: 10, fieldWeights: { embedding: 0.6, keywords: 0.4 } });
63
+ */
64
+ export function rerank(searchResults, options) {
65
+ const { name, limit = DEFAULT_TOP_K, rrfK = DEFAULT_RRF_RANK_CONSTANT } = options;
66
+ if (name !== 'rrf') {
67
+ throw new Error("rerank: name must be 'rrf'");
68
+ }
69
+ const perField = searchResults?.results;
70
+ if (perField === null || typeof perField !== 'object' || Array.isArray(perField)) {
71
+ throw new Error('rerank: expected search results to be a per-field map of hits');
72
+ }
73
+ const fieldNames = Object.keys(perField);
74
+ if (fieldNames.length === 0)
75
+ throw new Error('rerank: no fields to fuse');
76
+ const weights = resolveFieldWeights(fieldNames, options.fieldWeights);
77
+ const scores = new Map();
78
+ const hitById = new Map();
79
+ for (const fname of fieldNames) {
80
+ const weight = weights[fname] ?? 0.0;
81
+ let rank = 1;
82
+ for (const hit of perField[fname] ?? []) {
83
+ const id = hit.id;
84
+ scores.set(id, (scores.get(id) ?? 0.0) + weight / (rrfK + rank));
85
+ if (!hitById.has(id))
86
+ hitById.set(id, hit);
87
+ rank += 1;
88
+ }
89
+ }
90
+ const results = Array.from(scores.entries())
91
+ .sort((a, b) => b[1] - a[1])
92
+ .slice(0, limit)
93
+ .map(([id, score]) => ({ ...hitById.get(id), similarity: score }));
94
+ return { results };
95
+ }
96
+ //# sourceMappingURL=reranker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reranker.js","sourceRoot":"","sources":["../src/reranker.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,yBAAyB,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAQ1E,SAAS,OAAO,CAAC,GAAe;IAC9B,IAAI,GAAG,YAAY,GAAG;QAAE,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;IACzD,OAAO,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;AAC7B,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,QAAQ,CACtB,UAAsB,EACtB,YAAoC,EACpC,KAAa,EACb,CAAC,GAAG,EAAE;IAEN,MAAM,SAAS,GAAG,IAAI,GAAG,EAAkB,CAAC;IAE5C,KAAK,MAAM,CAAC,SAAS,EAAE,IAAI,CAAC,IAAI,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;QACpD,MAAM,MAAM,GAAG,YAAY,CAAC,SAAS,CAAC,IAAI,G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C,KAAK,MAAM,KAAK,IAAI,UAAU,EAAE,CAAC;QAC/B,MAAM,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC;QACrC,IAAI,IAAI,GAAG,CAAC,CAAC;QACb,KAAK,MAAM,GAAG,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC;YACxC,MAAM,EAAE,GAAG,GAAG,CAAC,EAAE,CAAC;YAClB,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,GAAG,CAAC,GAAG,MAAM,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC;YACjE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;gBAAE,OAAO,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;YAC3C,IAAI,IAAI,CAAC,CAAC;QACZ,CAAC;IACH,CAAC;IAED,MAAM,OAAO,GAAgB,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;SACtD,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;SAC3B,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC;SACf,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,GAAI,OAAO,CAAC,GAAG,CAAC,EAAE,CAAe,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;IAEpF,OAAO,EAAE,OAAO,EAAE,CAAC;AACrB,CAAC"}
@@ -1,115 +1,156 @@
1
1
  /**
2
- * Type definitions for Endee-DB
2
+ * Type definitions for the Endee client (v2 Collections API).
3
3
  */
4
4
  export type SpaceType = 'cosine' | 'l2' | 'ip';
5
5
  export declare enum Precision {
6
6
  BINARY = "binary",
7
7
  INT8 = "int8",
8
+ INT8E = "int8e",
8
9
  INT16 = "int16",
9
10
  FLOAT16 = "float16",
10
11
  FLOAT32 = "float32"
11
12
  }
12
- export interface CreateIndexOptions {
13
- name: string;
14
- dimension: number;
15
- spaceType?: SpaceType;
13
+ export type FieldType = 'vector' | 'sparse' | 'multi_vector';
14
+ /** HNSW / quantization params for a `vector` or `multi_vector` field. */
15
+ export interface FieldParams {
16
+ dimension?: number;
17
+ space_type?: SpaceType;
18
+ precision?: Precision | string;
19
+ /** Required for multi_vector fields. */
20
+ pooling?: 'mean' | 'max';
21
+ /** Optional HNSW build params. */
16
22
  M?: number;
17
- precision?: Precision;
18
- efCon?: number;
19
- version?: number;
20
- sparseModel?: string | null;
23
+ ef_con?: number;
24
+ [key: string]: unknown;
25
+ }
26
+ /**
27
+ * A field definition sent to the server as-is on `createCollection`.
28
+ *
29
+ * - `vector` → requires `params` ({ dimension, space_type, precision, ... }).
30
+ * - `sparse` → requires top-level `sparse_model` ("default" | "endee_bm25").
31
+ * - `multi_vector` → requires `params` including `pooling`.
32
+ */
33
+ export interface FieldDefinition {
34
+ name: string;
35
+ type: FieldType;
36
+ params?: FieldParams;
37
+ sparse_model?: string;
38
+ [key: string]: unknown;
39
+ }
40
+ /** Sparse vector value: parallel `indices` / `values` arrays. */
41
+ export interface SparseValue {
42
+ indices?: number[];
43
+ values?: number[];
44
+ /** Aliases also accepted on input (mirrors the Python client). */
45
+ sparse_indices?: number[];
46
+ sparse_values?: number[];
47
+ position?: number[];
21
48
  }
22
- export interface VectorItem {
49
+ /** A per-object field value: dense vector, sparse, or multi-vector. */
50
+ export type FieldValue = number[] | number[][] | SparseValue;
51
+ /** One object to upsert. */
52
+ export interface ObjectInput {
23
53
  id: string;
24
- vector: number[];
25
- sparseIndices?: number[];
26
- sparseValues?: number[];
27
- meta?: Record<string, unknown>;
28
- filter?: Record<string, unknown>;
29
- }
30
- export interface QueryOptions {
31
- vector?: number[];
32
- topK: number;
54
+ meta?: Record<string, unknown> | null;
55
+ filter?: Record<string, unknown> | string | null;
56
+ fields?: Record<string, FieldValue>;
57
+ }
58
+ /**
59
+ * Per-field search config. The query value is required; `weight` is the
60
+ * fraction of the request `limit` to draw from this field (effective per-field
61
+ * limit = ceil(weight * limit)). Omit `weight` to use the full `limit`.
62
+ */
63
+ export interface FieldQueryConfig {
64
+ query: FieldValue;
65
+ /** Fraction of the request `limit` to take from this field (0 < weight <= 1). */
66
+ weight?: number;
67
+ ef_search?: number;
68
+ [key: string]: unknown;
69
+ }
70
+ /** A field's query in a search request: always the config-dict form. */
71
+ export type SearchFieldValue = FieldQueryConfig;
72
+ export interface SearchOptions {
73
+ fields: Record<string, SearchFieldValue>;
74
+ limit?: number;
33
75
  filter?: Array<Record<string, unknown>> | null;
34
- ef?: number;
35
- includeVectors?: boolean;
36
- sparseIndices?: number[];
37
- sparseValues?: number[];
38
- prefilterCardinalityThreshold?: number;
39
- filterBoostPercentage?: number;
40
- denseRrfWeight?: number;
41
- rrfRankConstant?: number;
42
- }
43
- export interface QueryResult {
76
+ efSearch?: number;
77
+ }
78
+ /** Options for the standalone `rerank()` fusion of per-field search results. */
79
+ export interface RerankOptions {
80
+ /** Reranker algorithm. Only `'rrf'` is supported. */
81
+ name: 'rrf';
82
+ /** Max number of fused hits to return. */
83
+ limit?: number;
84
+ /** Per-field RRF weights; must sum to 1.0. Defaults to uniform. */
85
+ fieldWeights?: Record<string, number> | null;
86
+ /** RRF rank constant. */
87
+ rrfK?: number;
88
+ }
89
+ /** A single search result hit. */
90
+ export interface SearchHit {
44
91
  id: string;
45
92
  similarity: number;
46
- distance: number;
47
- meta?: Record<string, unknown>;
48
- filter?: Record<string, unknown>;
49
- norm?: number;
50
- vector?: number[];
93
+ meta: Record<string, unknown>;
94
+ filter: Record<string, unknown>;
51
95
  }
52
- export interface IndexInfo {
53
- name: string;
54
- spaceType: SpaceType;
55
- dimension: number;
56
- total_elements?: number;
57
- precision: Precision;
58
- M?: number;
59
- efCon?: number;
60
- checksum?: number;
61
- libToken?: string;
62
- version?: number;
63
- sparseDimension?: number;
64
- sparseModel?: string | null;
96
+ /**
97
+ * `search()` always returns one ranked list per queried field, keyed by field
98
+ * name. Use `rerank()` to fuse these into a single ranked list.
99
+ */
100
+ export type SearchResults = Record<string, SearchHit[]>;
101
+ export interface SearchResponse {
102
+ results: SearchResults;
65
103
  }
66
- export interface IndexDescription {
67
- name: string;
68
- spaceType: SpaceType;
69
- dimension: number;
70
- isHybrid: boolean;
71
- count: number;
72
- precision: Precision;
73
- M: number;
74
- efCon: number;
75
- sparseModel: string | null;
76
- }
77
- export interface VectorInfo {
104
+ /** A fused, single-list result as returned by `rerank()`. */
105
+ export interface RerankResponse {
106
+ results: SearchHit[];
107
+ }
108
+ /** A full object as returned by `getObjects`. */
109
+ export interface FullObject {
78
110
  id: string;
79
111
  meta: Record<string, unknown>;
80
112
  filter: Record<string, unknown>;
81
- norm: number;
82
- vector: number[];
83
- sparseIndices?: number[];
84
- sparseValues?: number[];
113
+ vectors: Record<string, number[]>;
114
+ sparses: Record<string, {
115
+ indices: number[];
116
+ values: number[];
117
+ }>;
118
+ multi_vectors: Record<string, number[][]>;
119
+ }
120
+ /** Collection metadata returned by `describe()` / `getCollection`. */
121
+ export interface CollectionMetadata {
122
+ name?: string;
123
+ fields: FieldDefinition[];
124
+ created_at?: number | string;
125
+ layout_version?: number;
126
+ [key: string]: unknown;
85
127
  }
86
- export interface UpdateFilterParams {
128
+ export interface UpdateFilterEntry {
87
129
  id: string;
88
130
  filter: Record<string, unknown>;
89
131
  }
90
132
  export interface RebuildOptions {
91
- M?: number;
133
+ field: string;
134
+ m?: number;
92
135
  efCon?: number;
93
136
  }
94
- export interface RebuildResult {
95
- status: string;
96
- previous_config: {
97
- M: number;
98
- ef_con: number;
99
- };
100
- new_config: {
101
- M: number;
102
- ef_con: number;
103
- };
104
- total_vectors: number;
105
- }
106
- export interface RebuildStatus {
107
- status: 'idle' | 'in_progress' | 'completed' | 'failed';
108
- vectors_processed?: number;
109
- total_vectors?: number;
110
- percent_complete?: number;
111
- started_at?: string;
112
- completed_at?: string;
113
- error?: string;
137
+ /** Database tier for admin database operations. */
138
+ export type DbType = 'starter' | 'pro' | 'scale' | 'enterprise';
139
+ /** Token type: read-write (`rw`) or read-only (`r`). */
140
+ export type TokenType = 'rw' | 'r';
141
+ /** A database entry as returned by `listDatabases()`. */
142
+ export interface DatabaseInfo {
143
+ db_name: string;
144
+ db_type?: DbType | string;
145
+ is_active?: boolean;
146
+ created_at?: number | string;
147
+ [key: string]: unknown;
148
+ }
149
+ /** A token entry as returned by `listTokens()` / `listMyTokens()` (no secret). */
150
+ export interface TokenInfo {
151
+ name: string;
152
+ token_type?: TokenType | string;
153
+ created_at?: number | string;
154
+ [key: string]: unknown;
114
155
  }
115
156
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,IAAI,GAAG,IAAI,CAAC;AAE/C,oBAAY,SAAS;IACnB,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,KAAK,UAAU;IACf,OAAO,YAAY;IACnB,OAAO,YAAY;CACpB;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,aAAa,CAAC,EAAE,M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AC7B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB"}
@@ -1,10 +1,11 @@
1
1
  /**
2
- * Type definitions for Endee-DB
2
+ * Type definitions for the Endee client (v2 Collections API).
3
3
  */
4
4
  export var Precision;
5
5
  (function (Precision) {
6
6
  Precision["BINARY"] = "binary";
7
7
  Precision["INT8"] = "int8";
8
+ Precision["INT8E"] = "int8e";
8
9
  Precision["INT16"] = "int16";
9
10
  Precision["FLOAT16"] = "float16";
10
11
  Precision["FLOAT32"] = "float32";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,MAAM,CAAN,IAAY,SAMX;AAND,WAAY,SAAS;IACnB,8BAAiB,CAAA;IACjB,0BAAa,CAAA;IACb,4BAAe,CAAA;IACf,gCAAmB,CAAA;IACnB,gCAAmB,CAAA;AACrB,CAAC,EANW,SAAS,KAAT,SAAS,QAMpB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,MAAM,CAAN,IAAY,SAOX;AAPD,WAAY,SAAS;IACnB,8BAAiB,CAAA;IACjB,0BAAa,CAAA;IACb,4BAAe,CAAA;IACf,4BAAe,CAAA;IACf,gCAAmB,CAAA;IACnB,gCAAmB,CAAA;AACrB,CAAC,EAPW,SAAS,KAAT,SAAS,QAOpB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "endee",
3
- "version": "1.7.1-dev.3",
3
+ "version": "1.8.0-dev.1",
4
4
  "description": "TypeScript client for encrypted vector database with maximum security and speed",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,18 +0,0 @@
1
- import { Index } from './index.class.js';
2
- import { type CreateIndexOptions } from './types/index.js';
3
- export declare class Endee {
4
- private token;
5
- private baseUrl;
6
- private version;
7
- constructor(token?: string | null);
8
- setBaseUrl(url: string): string;
9
- createCollection(options: CreateIndexOptions): Promise<string>;
10
- createIndex(options: CreateIndexOptions): Promise<string>;
11
- listCollections(): Promise<unknown>;
12
- listIndexes(): Promise<unknown>;
13
- deleteCollection(name: string): Promise<string>;
14
- deleteIndex(name: string): Promise<string>;
15
- getCollection(name: string): Promise<Index>;
16
- getIndex(name: string): Promise<Index>;
17
- }
18
- //# sourceMappingURL=endee.class.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"endee.class.d.ts","sourceRoot":"","sources":["../src/endee.class.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAEzC,OAAO,EAAa,KAAK,kBAAkB,EAAkB,MAAM,kBAAkB,CAAC;AAEtF,qBAAa,KAAK;IAChB,OAAO,CAAC,KAAK,CAAgB;IAC7B,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,OAAO,CAAS;gBAEZ,KAAK,GAAE,MAAM,GAAG,IAAW;IAavC,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IAKzB,gBAAgB,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC;IAgE9D,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC;IAiEzD,eAAe,IAAI,OAAO,CAAC,OAAO,CAAC;IAgBnC,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAgB/B,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAuB/C,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAuB1C,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC;IAoC3C,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC;CAmC7C"}