@skravets/eapi 0.0.36 → 0.0.37

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.
@@ -192,7 +192,7 @@ interface components {
192
192
  channel_id: number;
193
193
  /**
194
194
  * Format: date-time
195
- * @example 2025-12-10T16:40:34.921Z
195
+ * @example 2025-12-16T15:43:00.619Z
196
196
  */
197
197
  message_created_at: string;
198
198
  /** @example 123 */
@@ -313,105 +313,95 @@ interface components {
313
313
  */
314
314
  accountId: number;
315
315
  };
316
- ISearchChatsReq: {
317
- /** @description chats usernames to rank */
318
- chats?: string[];
319
- /** @description search query */
320
- query?: string;
321
- /** @description search embedding */
322
- embedding?: number[];
323
- /** @description search limit */
324
- limit?: number;
325
- /** @description search offset */
326
- offset?: number;
327
- };
328
- SemanticSearchMeta: {
316
+ CatalogSearchFilters: {
329
317
  /**
330
- * @description Search type
331
- * @example semantic | hybrid
332
- */
333
- type: string;
334
- /**
335
- * @description Similarity score
336
- * @example 0.1
318
+ * @description Filter by chat type
319
+ * @enum {string}
337
320
  */
338
- similarity: number;
339
- };
340
- HybridSearchMeta: {
321
+ chatType?: "group" | "channel";
322
+ /** @description Minimum participants count */
323
+ minParticipants?: number;
324
+ /** @description Maximum participants count */
325
+ maxParticipants?: number;
326
+ /** @description Filter by language (ISO 639-1) */
327
+ language?: string;
328
+ /** @description Filter by keywords (any match) */
329
+ keywords?: string[];
330
+ };
331
+ CatalogSearchRequest: {
332
+ /** @description Search query text */
333
+ query?: string;
334
+ /** @description Search embedding vector (1536 dimensions) */
335
+ embedding?: number[];
341
336
  /**
342
337
  * @description Search type
343
- * @example hybrid
344
- */
345
- type: string;
346
- /** @description r1 */
347
- r1: string;
348
- /** @description r2 */
349
- r2: string;
350
- /** @description bm25_score */
351
- bm25_score: number;
352
- /** @description vec_score */
353
- vec_score: number;
354
- /** @description source */
355
- source: string;
356
- /** @description rrf */
357
- rrf: string;
358
- };
359
- SearchResult: {
360
- /** @description Meta */
361
- meta: components["schemas"]["SemanticSearchMeta"] | components["schemas"]["HybridSearchMeta"];
362
- /**
363
- * @description Channel id
364
- * @example 123
365
- */
366
- channel_id: string;
367
- /**
368
- * @description Channel name
369
- * @example channel_name
370
- */
371
- channel_name: string;
372
- /**
373
- * @description Topic
374
- * @example topic
375
- */
376
- topic: string;
377
- /**
378
- * @description Tone
379
- * @example tone
380
- */
381
- tone: string;
382
- /**
383
- * @description Language
384
- * @example language
385
- */
386
- language: string;
387
- /**
388
- * @description Audience
389
- * @example audience
390
- */
391
- audience: string;
392
- /**
393
- * @description Tags
394
- * @example [
395
- * "tag1",
396
- * "tag2"
397
- * ]
338
+ * @default hybrid
339
+ * @enum {string}
398
340
  */
399
- tags: string[];
341
+ type: "hybrid" | "semantic" | "bm25";
400
342
  /**
401
- * @description Density per day
402
- * @example 0.1
343
+ * @description Results limit
344
+ * @default 50
403
345
  */
404
- density_per_day: number;
346
+ limit: number;
405
347
  /**
406
- * @description Last message at
407
- * @example 2023-01-01T00:00:00.000Z
348
+ * @description Results offset
349
+ * @default 0
408
350
  */
409
- last_message_at: number;
351
+ offset: number;
352
+ /** @description Search filters */
353
+ filters?: components["schemas"]["CatalogSearchFilters"];
410
354
  /**
411
- * @description Summary
412
- * @example summary
355
+ * @description BM25 weight for hybrid search (0-1, default 0.5)
356
+ * @default 0.5
413
357
  */
414
- summary: string;
358
+ bm25Weight: number;
359
+ };
360
+ CatalogSearchScore: {
361
+ /** @description Total/combined score (RRF for hybrid, similarity for semantic, bm25 for bm25-only) */
362
+ total: number;
363
+ /** @description Vector similarity score (0 if not used) */
364
+ vector: number;
365
+ /** @description BM25 score (0 if not used) */
366
+ bm25: number;
367
+ };
368
+ CatalogSearchMeta: {
369
+ /** @description Search type used */
370
+ type: string;
371
+ /** @description Search scores */
372
+ score: components["schemas"]["CatalogSearchScore"];
373
+ /** @description BM25 rank (hybrid only) */
374
+ rankBm25?: number;
375
+ /** @description Vector rank (hybrid only) */
376
+ rankVector?: number;
377
+ /** @description Result source (hybrid only) */
378
+ source?: string;
379
+ };
380
+ CatalogSearchResult: {
381
+ /** @description Catalog state ID */
382
+ id: number;
383
+ /** @description Peer ID */
384
+ peerId?: number;
385
+ /** @description Username */
386
+ username: string;
387
+ /** @description Chat type */
388
+ chatType?: string;
389
+ /** @description Title */
390
+ title?: string;
391
+ /** @description About/description */
392
+ about?: string;
393
+ /** @description Participants count */
394
+ participantsCount?: number;
395
+ /** @description Language */
396
+ language?: string;
397
+ /** @description Keywords */
398
+ keywords?: string[];
399
+ /** @description Summary */
400
+ summary?: string;
401
+ /** @description Average messages per day */
402
+ avgMessagesPerDay?: number;
403
+ /** @description Search metadata */
404
+ meta: components["schemas"]["CatalogSearchMeta"];
415
405
  };
416
406
  RelatedLinkDto: {
417
407
  /** @enum {string} */
@@ -926,17 +916,17 @@ interface operations {
926
916
  };
927
917
  requestBody: {
928
918
  content: {
929
- "application/json": components["schemas"]["ISearchChatsReq"];
919
+ "application/json": components["schemas"]["CatalogSearchRequest"];
930
920
  };
931
921
  };
932
922
  responses: {
933
- /** @description Search */
923
+ /** @description Hybrid search across catalog */
934
924
  200: {
935
925
  headers: {
936
926
  [name: string]: unknown;
937
927
  };
938
928
  content: {
939
- "application/json": components["schemas"]["SearchResult"][];
929
+ "application/json": components["schemas"]["CatalogSearchResult"][];
940
930
  };
941
931
  };
942
932
  /** @description Unauthorized */
@@ -192,7 +192,7 @@ interface components {
192
192
  channel_id: number;
193
193
  /**
194
194
  * Format: date-time
195
- * @example 2025-12-10T16:40:34.921Z
195
+ * @example 2025-12-16T15:43:00.619Z
196
196
  */
197
197
  message_created_at: string;
198
198
  /** @example 123 */
@@ -313,105 +313,95 @@ interface components {
313
313
  */
314
314
  accountId: number;
315
315
  };
316
- ISearchChatsReq: {
317
- /** @description chats usernames to rank */
318
- chats?: string[];
319
- /** @description search query */
320
- query?: string;
321
- /** @description search embedding */
322
- embedding?: number[];
323
- /** @description search limit */
324
- limit?: number;
325
- /** @description search offset */
326
- offset?: number;
327
- };
328
- SemanticSearchMeta: {
316
+ CatalogSearchFilters: {
329
317
  /**
330
- * @description Search type
331
- * @example semantic | hybrid
332
- */
333
- type: string;
334
- /**
335
- * @description Similarity score
336
- * @example 0.1
318
+ * @description Filter by chat type
319
+ * @enum {string}
337
320
  */
338
- similarity: number;
339
- };
340
- HybridSearchMeta: {
321
+ chatType?: "group" | "channel";
322
+ /** @description Minimum participants count */
323
+ minParticipants?: number;
324
+ /** @description Maximum participants count */
325
+ maxParticipants?: number;
326
+ /** @description Filter by language (ISO 639-1) */
327
+ language?: string;
328
+ /** @description Filter by keywords (any match) */
329
+ keywords?: string[];
330
+ };
331
+ CatalogSearchRequest: {
332
+ /** @description Search query text */
333
+ query?: string;
334
+ /** @description Search embedding vector (1536 dimensions) */
335
+ embedding?: number[];
341
336
  /**
342
337
  * @description Search type
343
- * @example hybrid
344
- */
345
- type: string;
346
- /** @description r1 */
347
- r1: string;
348
- /** @description r2 */
349
- r2: string;
350
- /** @description bm25_score */
351
- bm25_score: number;
352
- /** @description vec_score */
353
- vec_score: number;
354
- /** @description source */
355
- source: string;
356
- /** @description rrf */
357
- rrf: string;
358
- };
359
- SearchResult: {
360
- /** @description Meta */
361
- meta: components["schemas"]["SemanticSearchMeta"] | components["schemas"]["HybridSearchMeta"];
362
- /**
363
- * @description Channel id
364
- * @example 123
365
- */
366
- channel_id: string;
367
- /**
368
- * @description Channel name
369
- * @example channel_name
370
- */
371
- channel_name: string;
372
- /**
373
- * @description Topic
374
- * @example topic
375
- */
376
- topic: string;
377
- /**
378
- * @description Tone
379
- * @example tone
380
- */
381
- tone: string;
382
- /**
383
- * @description Language
384
- * @example language
385
- */
386
- language: string;
387
- /**
388
- * @description Audience
389
- * @example audience
390
- */
391
- audience: string;
392
- /**
393
- * @description Tags
394
- * @example [
395
- * "tag1",
396
- * "tag2"
397
- * ]
338
+ * @default hybrid
339
+ * @enum {string}
398
340
  */
399
- tags: string[];
341
+ type: "hybrid" | "semantic" | "bm25";
400
342
  /**
401
- * @description Density per day
402
- * @example 0.1
343
+ * @description Results limit
344
+ * @default 50
403
345
  */
404
- density_per_day: number;
346
+ limit: number;
405
347
  /**
406
- * @description Last message at
407
- * @example 2023-01-01T00:00:00.000Z
348
+ * @description Results offset
349
+ * @default 0
408
350
  */
409
- last_message_at: number;
351
+ offset: number;
352
+ /** @description Search filters */
353
+ filters?: components["schemas"]["CatalogSearchFilters"];
410
354
  /**
411
- * @description Summary
412
- * @example summary
355
+ * @description BM25 weight for hybrid search (0-1, default 0.5)
356
+ * @default 0.5
413
357
  */
414
- summary: string;
358
+ bm25Weight: number;
359
+ };
360
+ CatalogSearchScore: {
361
+ /** @description Total/combined score (RRF for hybrid, similarity for semantic, bm25 for bm25-only) */
362
+ total: number;
363
+ /** @description Vector similarity score (0 if not used) */
364
+ vector: number;
365
+ /** @description BM25 score (0 if not used) */
366
+ bm25: number;
367
+ };
368
+ CatalogSearchMeta: {
369
+ /** @description Search type used */
370
+ type: string;
371
+ /** @description Search scores */
372
+ score: components["schemas"]["CatalogSearchScore"];
373
+ /** @description BM25 rank (hybrid only) */
374
+ rankBm25?: number;
375
+ /** @description Vector rank (hybrid only) */
376
+ rankVector?: number;
377
+ /** @description Result source (hybrid only) */
378
+ source?: string;
379
+ };
380
+ CatalogSearchResult: {
381
+ /** @description Catalog state ID */
382
+ id: number;
383
+ /** @description Peer ID */
384
+ peerId?: number;
385
+ /** @description Username */
386
+ username: string;
387
+ /** @description Chat type */
388
+ chatType?: string;
389
+ /** @description Title */
390
+ title?: string;
391
+ /** @description About/description */
392
+ about?: string;
393
+ /** @description Participants count */
394
+ participantsCount?: number;
395
+ /** @description Language */
396
+ language?: string;
397
+ /** @description Keywords */
398
+ keywords?: string[];
399
+ /** @description Summary */
400
+ summary?: string;
401
+ /** @description Average messages per day */
402
+ avgMessagesPerDay?: number;
403
+ /** @description Search metadata */
404
+ meta: components["schemas"]["CatalogSearchMeta"];
415
405
  };
416
406
  RelatedLinkDto: {
417
407
  /** @enum {string} */
@@ -926,17 +916,17 @@ interface operations {
926
916
  };
927
917
  requestBody: {
928
918
  content: {
929
- "application/json": components["schemas"]["ISearchChatsReq"];
919
+ "application/json": components["schemas"]["CatalogSearchRequest"];
930
920
  };
931
921
  };
932
922
  responses: {
933
- /** @description Search */
923
+ /** @description Hybrid search across catalog */
934
924
  200: {
935
925
  headers: {
936
926
  [name: string]: unknown;
937
927
  };
938
928
  content: {
939
- "application/json": components["schemas"]["SearchResult"][];
929
+ "application/json": components["schemas"]["CatalogSearchResult"][];
940
930
  };
941
931
  };
942
932
  /** @description Unauthorized */
package/package.json CHANGED
@@ -1,13 +1,16 @@
1
1
  {
2
2
  "name": "@skravets/eapi",
3
- "version": "0.0.36",
3
+ "version": "0.0.37",
4
4
  "module": "./dist/index.js",
5
5
  "main": "./dist/index.cjs",
6
6
  "types": "./dist/index.d.ts",
7
7
  "scripts": {
8
8
  "generate": "bun scripts/generate.ts",
9
9
  "build": "bunx pkgroll",
10
- "prepublishOnly": "bunx pkgroll"
10
+ "prepublishOnly": "bunx pkgroll",
11
+ "example:search:bm25": "bun examples/search/bm25/run.ts",
12
+ "example:search:vector": "bun examples/search/vector/run.ts",
13
+ "example:search:hybrid": "bun examples/search/hybrid/run.ts"
11
14
  },
12
15
  "exports": {
13
16
  ".": {