@antfly/sdk 0.0.7 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -26,6 +26,97 @@ interface paths {
26
26
  patch?: never;
27
27
  trace?: never;
28
28
  };
29
+ "/backup": {
30
+ parameters: {
31
+ query?: never;
32
+ header?: never;
33
+ path?: never;
34
+ cookie?: never;
35
+ };
36
+ get?: never;
37
+ put?: never;
38
+ /**
39
+ * Backup all tables or selected tables
40
+ * @description Creates a backup of all tables or specified tables. Each table's backup includes:
41
+ * - Table metadata (schema, indexes, shard configuration)
42
+ * - All shard data (compressed with zstd)
43
+ *
44
+ * The backup creates a cluster-level manifest that tracks all included tables
45
+ * and their individual backup locations.
46
+ *
47
+ * **Storage Locations:**
48
+ * - Local filesystem: `file:///path/to/backup`
49
+ * - Amazon S3: `s3://bucket-name/path/to/backup`
50
+ *
51
+ * **Backup Structure:**
52
+ * ```
53
+ * {location}/
54
+ * ├── {backup_id}-cluster-metadata.json (cluster manifest)
55
+ * ├── {table1}-{backup_id}-metadata.json (table metadata)
56
+ * ├── shard-1-{table1}-{backup_id}.tar.zst
57
+ * ├── shard-2-{table1}-{backup_id}.tar.zst
58
+ * ├── {table2}-{backup_id}-metadata.json
59
+ * └── ...
60
+ * ```
61
+ */
62
+ post: operations["backup"];
63
+ delete?: never;
64
+ options?: never;
65
+ head?: never;
66
+ patch?: never;
67
+ trace?: never;
68
+ };
69
+ "/restore": {
70
+ parameters: {
71
+ query?: never;
72
+ header?: never;
73
+ path?: never;
74
+ cookie?: never;
75
+ };
76
+ get?: never;
77
+ put?: never;
78
+ /**
79
+ * Restore multiple tables from a backup
80
+ * @description Restores tables from a cluster backup. Can restore all tables or a subset.
81
+ *
82
+ * **Restore Modes:**
83
+ * - `fail_if_exists`: Abort if any target table already exists (default)
84
+ * - `skip_if_exists`: Skip existing tables and restore the rest
85
+ * - `overwrite`: Drop existing tables and restore from backup
86
+ *
87
+ * The restore is asynchronous - this endpoint triggers the restore process
88
+ * and returns immediately. The actual data restoration happens via the
89
+ * reconciliation loop as shards are started.
90
+ */
91
+ post: operations["restore"];
92
+ delete?: never;
93
+ options?: never;
94
+ head?: never;
95
+ patch?: never;
96
+ trace?: never;
97
+ };
98
+ "/backups": {
99
+ parameters: {
100
+ query?: never;
101
+ header?: never;
102
+ path?: never;
103
+ cookie?: never;
104
+ };
105
+ /**
106
+ * List available backups
107
+ * @description Lists all cluster-level backups available at the specified location.
108
+ * Returns metadata about each backup including the tables included,
109
+ * timestamp, and Antfly version.
110
+ */
111
+ get: operations["listBackups"];
112
+ put?: never;
113
+ post?: never;
114
+ delete?: never;
115
+ options?: never;
116
+ head?: never;
117
+ patch?: never;
118
+ trace?: never;
119
+ };
29
120
  "/query": {
30
121
  parameters: {
31
122
  query?: never;
@@ -435,7 +526,7 @@ interface paths {
435
526
  get?: never;
436
527
  put?: never;
437
528
  /** Perform batch inserts and deletes on a table */
438
- post: operations["batch"];
529
+ post: operations["batchWrite"];
439
530
  delete?: never;
440
531
  options?: never;
441
532
  head?: never;
@@ -1208,6 +1299,14 @@ interface components$1 {
1208
1299
  transforms?: components$1["schemas"]["Transform"][];
1209
1300
  sync_level?: components$1["schemas"]["SyncLevel"];
1210
1301
  };
1302
+ BatchResponse: {
1303
+ /** @description Number of documents successfully inserted */
1304
+ inserted?: number;
1305
+ /** @description Number of documents successfully deleted */
1306
+ deleted?: number;
1307
+ /** @description Number of documents successfully transformed */
1308
+ transformed?: number;
1309
+ };
1211
1310
  BackupRequest: {
1212
1311
  /**
1213
1312
  * @description Unique identifier for this backup. Used to reference the backup for restore operations.
@@ -1226,6 +1325,151 @@ interface components$1 {
1226
1325
  location: string;
1227
1326
  };
1228
1327
  RestoreRequest: components$1["schemas"]["BackupRequest"];
1328
+ ClusterBackupRequest: {
1329
+ /**
1330
+ * @description Unique identifier for this backup. Used to reference the backup for restore operations.
1331
+ * Choose a meaningful name that includes date/version information.
1332
+ * @example cluster-backup-2025-01-15
1333
+ */
1334
+ backup_id: string;
1335
+ /**
1336
+ * @description Storage location for the backup. Supports multiple backends:
1337
+ * - Local filesystem: `file:///path/to/backup`
1338
+ * - Amazon S3: `s3://bucket-name/path/to/backup`
1339
+ *
1340
+ * The backup includes all table data, indexes, and metadata.
1341
+ * @example s3://mybucket/antfly-backups/cluster/2025-01-15
1342
+ */
1343
+ location: string;
1344
+ /**
1345
+ * @description Optional list of tables to backup. If omitted, all tables are backed up.
1346
+ * @example [
1347
+ * "users",
1348
+ * "products"
1349
+ * ]
1350
+ */
1351
+ table_names?: string[];
1352
+ };
1353
+ ClusterBackupResponse: {
1354
+ /**
1355
+ * @description The backup identifier
1356
+ * @example cluster-backup-2025-01-15
1357
+ */
1358
+ backup_id: string;
1359
+ /** @description Status of each table backup */
1360
+ tables: components$1["schemas"]["TableBackupStatus"][];
1361
+ /**
1362
+ * @description Overall backup status
1363
+ * @example completed
1364
+ * @enum {string}
1365
+ */
1366
+ status: "completed" | "partial" | "failed";
1367
+ };
1368
+ TableBackupStatus: {
1369
+ /**
1370
+ * @description Table name
1371
+ * @example users
1372
+ */
1373
+ name: string;
1374
+ /**
1375
+ * @description Backup status for this table
1376
+ * @example completed
1377
+ * @enum {string}
1378
+ */
1379
+ status: "completed" | "failed" | "skipped";
1380
+ /** @description Error message if backup failed */
1381
+ error?: string;
1382
+ };
1383
+ ClusterRestoreRequest: {
1384
+ /**
1385
+ * @description Unique identifier of the backup to restore from.
1386
+ * @example cluster-backup-2025-01-15
1387
+ */
1388
+ backup_id: string;
1389
+ /**
1390
+ * @description Storage location where the backup is stored.
1391
+ * @example s3://mybucket/antfly-backups/cluster/2025-01-15
1392
+ */
1393
+ location: string;
1394
+ /**
1395
+ * @description Optional list of tables to restore. If omitted, all tables in the backup are restored.
1396
+ * @example [
1397
+ * "users",
1398
+ * "products"
1399
+ * ]
1400
+ */
1401
+ table_names?: string[];
1402
+ /**
1403
+ * @description How to handle existing tables:
1404
+ * - `fail_if_exists`: Abort if any table already exists (default)
1405
+ * - `skip_if_exists`: Skip existing tables, restore others
1406
+ * - `overwrite`: Drop and recreate existing tables
1407
+ * @default fail_if_exists
1408
+ * @example skip_if_exists
1409
+ * @enum {string}
1410
+ */
1411
+ restore_mode?: "fail_if_exists" | "skip_if_exists" | "overwrite";
1412
+ };
1413
+ ClusterRestoreResponse: {
1414
+ /** @description Status of each table restore */
1415
+ tables: components$1["schemas"]["TableRestoreStatus"][];
1416
+ /**
1417
+ * @description Overall restore status
1418
+ * @example triggered
1419
+ * @enum {string}
1420
+ */
1421
+ status: "triggered" | "partial" | "failed";
1422
+ };
1423
+ TableRestoreStatus: {
1424
+ /**
1425
+ * @description Table name
1426
+ * @example users
1427
+ */
1428
+ name: string;
1429
+ /**
1430
+ * @description Restore status for this table
1431
+ * @example triggered
1432
+ * @enum {string}
1433
+ */
1434
+ status: "triggered" | "skipped" | "failed";
1435
+ /** @description Error message if restore failed */
1436
+ error?: string;
1437
+ };
1438
+ BackupInfo: {
1439
+ /**
1440
+ * @description The backup identifier
1441
+ * @example cluster-backup-2025-01-15
1442
+ */
1443
+ backup_id: string;
1444
+ /**
1445
+ * Format: date-time
1446
+ * @description When the backup was created
1447
+ * @example 2025-01-15T10:30:00Z
1448
+ */
1449
+ timestamp: string;
1450
+ /**
1451
+ * @description Tables included in the backup
1452
+ * @example [
1453
+ * "users",
1454
+ * "products"
1455
+ * ]
1456
+ */
1457
+ tables: string[];
1458
+ /**
1459
+ * @description Storage location of the backup
1460
+ * @example s3://mybucket/antfly-backups/cluster/2025-01-15
1461
+ */
1462
+ location: string;
1463
+ /**
1464
+ * @description Antfly version that created the backup
1465
+ * @example v1.0.0
1466
+ */
1467
+ antfly_version?: string;
1468
+ };
1469
+ BackupListResponse: {
1470
+ /** @description List of available backups */
1471
+ backups: components$1["schemas"]["BackupInfo"][];
1472
+ };
1229
1473
  RAGRequest: {
1230
1474
  /**
1231
1475
  * @description Array of retrieval queries to execute. Each query must specify a table and can specify its own limit and document_renderer.
@@ -1290,11 +1534,11 @@ interface components$1 {
1290
1534
  */
1291
1535
  eval?: components$1["schemas"]["EvalConfig"];
1292
1536
  };
1293
- /** @description RAG result with individual query results and summary */
1537
+ /** @description RAG result with individual query results and generation/evaluation outcome */
1294
1538
  RAGResult: {
1295
1539
  /** @description Results from each query. Check each result's status and error fields for failures. */
1296
1540
  query_results?: components$1["schemas"]["QueryResult"][];
1297
- summary_result?: components$1["schemas"]["SummarizeResult"];
1541
+ generate_result?: components$1["schemas"]["GenerateResult"];
1298
1542
  /** @description Evaluation results when eval config was provided in the request */
1299
1543
  eval_result?: components$1["schemas"]["EvalResult"];
1300
1544
  };
@@ -2927,6 +3171,68 @@ interface components$1 {
2927
3171
  */
2928
3172
  presence_penalty?: number;
2929
3173
  };
3174
+ /**
3175
+ * @description Configuration for the OpenRouter generative AI provider.
3176
+ *
3177
+ * OpenRouter provides a unified API for multiple LLM providers with automatic fallback routing.
3178
+ * API key via `api_key` field or `OPENROUTER_API_KEY` environment variable.
3179
+ *
3180
+ * **Model Selection:**
3181
+ * - Use `model` for a single model (e.g., "openai/gpt-4.1", "anthropic/claude-sonnet-4-5-20250929")
3182
+ * - Use `models` array for fallback routing - OpenRouter tries models in order until one succeeds
3183
+ *
3184
+ * **Example Models:** openai/gpt-4.1, anthropic/claude-sonnet-4-5-20250929, google/gemini-2.5-flash,
3185
+ * meta-llama/llama-3.3-70b-instruct
3186
+ *
3187
+ * **Docs:** https://openrouter.ai/docs/api/api-reference/chat/send-chat-completion-request
3188
+ * @example {
3189
+ * "provider": "openrouter",
3190
+ * "model": "openai/gpt-4.1",
3191
+ * "temperature": 0.7,
3192
+ * "max_tokens": 4096
3193
+ * }
3194
+ */
3195
+ OpenRouterGeneratorConfig: {
3196
+ /**
3197
+ * @description Single model identifier (e.g., 'openai/gpt-4.1'). Either model or models must be provided.
3198
+ * @example openai/gpt-4.1
3199
+ */
3200
+ model?: string;
3201
+ /**
3202
+ * @description Array of model identifiers for fallback routing. OpenRouter tries each model in order
3203
+ * until one succeeds. Either model or models must be provided.
3204
+ * @example [
3205
+ * "openai/gpt-4.1",
3206
+ * "anthropic/claude-sonnet-4-5-20250929",
3207
+ * "google/gemini-2.5-flash"
3208
+ * ]
3209
+ */
3210
+ models?: string[];
3211
+ /** @description The OpenRouter API key. Can also be set via OPENROUTER_API_KEY environment variable. */
3212
+ api_key?: string;
3213
+ /**
3214
+ * Format: float
3215
+ * @description Controls randomness in generation (0.0-2.0). Higher values make output more random.
3216
+ */
3217
+ temperature?: number;
3218
+ /** @description Maximum number of tokens to generate in the response. */
3219
+ max_tokens?: number;
3220
+ /**
3221
+ * Format: float
3222
+ * @description Nucleus sampling parameter (0.0-1.0). Alternative to temperature.
3223
+ */
3224
+ top_p?: number;
3225
+ /**
3226
+ * Format: float
3227
+ * @description Penalty for token frequency (-2.0 to 2.0).
3228
+ */
3229
+ frequency_penalty?: number;
3230
+ /**
3231
+ * Format: float
3232
+ * @description Penalty for token presence (-2.0 to 2.0).
3233
+ */
3234
+ presence_penalty?: number;
3235
+ };
2930
3236
  /**
2931
3237
  * @description Configuration for the AWS Bedrock generative AI provider.
2932
3238
  *
@@ -3056,7 +3362,7 @@ interface components$1 {
3056
3362
  * @description The generative AI provider to use.
3057
3363
  * @enum {string}
3058
3364
  */
3059
- GeneratorProvider: "gemini" | "vertex" | "ollama" | "openai" | "bedrock" | "anthropic" | "cohere" | "mock";
3365
+ GeneratorProvider: "gemini" | "vertex" | "ollama" | "openai" | "openrouter" | "bedrock" | "anthropic" | "cohere" | "mock";
3060
3366
  /**
3061
3367
  * @description A unified configuration for a generative AI provider.
3062
3368
  *
@@ -3226,7 +3532,7 @@ interface components$1 {
3226
3532
  * "max_tokens": 2048
3227
3533
  * }
3228
3534
  */
3229
- GeneratorConfig: (components$1["schemas"]["GoogleGeneratorConfig"] | components$1["schemas"]["VertexGeneratorConfig"] | components$1["schemas"]["OllamaGeneratorConfig"] | components$1["schemas"]["OpenAIGeneratorConfig"] | components$1["schemas"]["BedrockGeneratorConfig"] | components$1["schemas"]["AnthropicGeneratorConfig"] | components$1["schemas"]["CohereGeneratorConfig"]) & {
3535
+ GeneratorConfig: (components$1["schemas"]["GoogleGeneratorConfig"] | components$1["schemas"]["VertexGeneratorConfig"] | components$1["schemas"]["OllamaGeneratorConfig"] | components$1["schemas"]["OpenAIGeneratorConfig"] | components$1["schemas"]["OpenRouterGeneratorConfig"] | components$1["schemas"]["BedrockGeneratorConfig"] | components$1["schemas"]["AnthropicGeneratorConfig"] | components$1["schemas"]["CohereGeneratorConfig"]) & {
3230
3536
  provider: components$1["schemas"]["GeneratorProvider"];
3231
3537
  };
3232
3538
  /** @description Retry configuration for generator calls */
@@ -3339,10 +3645,10 @@ interface components$1 {
3339
3645
  /** @description Evaluation options (k, thresholds, etc.) */
3340
3646
  options?: components$1["schemas"]["EvalOptions"];
3341
3647
  };
3342
- /** @description Result of a summarization operation. The summary is formatted as markdown with inline resource references using [resource_id <id>] or [resource_id <id1>, <id2>] format. */
3343
- SummarizeResult: {
3344
- /** @description The generated summary text in markdown format with inline resource references like [resource_id res1] or [resource_id res1, res2] */
3345
- summary: string;
3648
+ /** @description Result of a generate operation. Formatted as markdown by default with inline resource references using [resource_id <id>] or [resource_id <id1>, <id2>] format. */
3649
+ GenerateResult: {
3650
+ /** @description The generated text in markdown format with inline resource references like [resource_id res1] or [resource_id res1, res2] */
3651
+ text: string;
3346
3652
  };
3347
3653
  /** @description Result from a single evaluator */
3348
3654
  EvaluatorScore: {
@@ -3848,6 +4154,33 @@ interface components$1 {
3848
4154
  * @enum {string}
3849
4155
  */
3850
4156
  WebSearchProvider: "google" | "bing" | "serper" | "tavily" | "brave" | "duckduckgo";
4157
+ Credentials: {
4158
+ /**
4159
+ * @description S3-compatible endpoint (e.g., 's3.amazonaws.com' or 'localhost:9000' for MinIO)
4160
+ * @example s3.amazonaws.com
4161
+ */
4162
+ endpoint?: string;
4163
+ /**
4164
+ * @description Enable SSL/TLS for S3 connections (default: true for AWS, false for local MinIO)
4165
+ * @default true
4166
+ */
4167
+ use_ssl?: boolean;
4168
+ /**
4169
+ * @description AWS access key ID. Supports keystore syntax for secret lookup. Falls back to AWS_ACCESS_KEY_ID environment variable if not set.
4170
+ * @example your-access-key-id
4171
+ */
4172
+ access_key_id?: string;
4173
+ /**
4174
+ * @description AWS secret access key. Supports keystore syntax for secret lookup. Falls back to AWS_SECRET_ACCESS_KEY environment variable if not set.
4175
+ * @example your-secret-access-key
4176
+ */
4177
+ secret_access_key?: string;
4178
+ /**
4179
+ * @description Optional AWS session token for temporary credentials. Supports keystore syntax for secret lookup.
4180
+ * @example your-session-token
4181
+ */
4182
+ session_token?: string;
4183
+ };
3851
4184
  /**
3852
4185
  * @description Configuration for URL content fetching.
3853
4186
  *
@@ -3857,6 +4190,7 @@ interface components$1 {
3857
4190
  * - PDF files (extracts text)
3858
4191
  * - Images (returns as data URIs)
3859
4192
  * - Plain text files
4193
+ * - S3 URLs (requires s3_credentials)
3860
4194
  *
3861
4195
  * Security features (from lib/scraping.ContentSecurityConfig):
3862
4196
  * - Allowed host whitelist
@@ -3865,6 +4199,8 @@ interface components$1 {
3865
4199
  * - Timeout controls
3866
4200
  */
3867
4201
  FetchConfig: {
4202
+ /** @description S3 credentials for fetching S3 URLs. If not set, uses package-level defaults. */
4203
+ s3_credentials?: components$1["schemas"]["Credentials"];
3868
4204
  /**
3869
4205
  * @description Maximum content length in characters (truncated if exceeded)
3870
4206
  * @default 50000
@@ -4162,6 +4498,34 @@ interface components$1 {
4162
4498
  /** @description Output dimension for the embedding (uses MRL for dimension reduction). Recommended: 256, 512, 1024, 1536, or 3072. */
4163
4499
  dimensions?: number;
4164
4500
  };
4501
+ /**
4502
+ * @description Configuration for the OpenRouter embedding provider.
4503
+ *
4504
+ * OpenRouter provides a unified API for multiple embedding models from different providers.
4505
+ * API key via `api_key` field or `OPENROUTER_API_KEY` environment variable.
4506
+ *
4507
+ * **Example Models:** openai/text-embedding-3-small (default), openai/text-embedding-3-large,
4508
+ * google/gemini-embedding-001, qwen/qwen3-embedding-8b
4509
+ *
4510
+ * **Docs:** https://openrouter.ai/docs/api/reference/embeddings
4511
+ * @example {
4512
+ * "provider": "openrouter",
4513
+ * "model": "openai/text-embedding-3-small",
4514
+ * "api_key": "sk-or-..."
4515
+ * }
4516
+ */
4517
+ OpenRouterEmbedderConfig: {
4518
+ /**
4519
+ * @description The OpenRouter model identifier (e.g., 'openai/text-embedding-3-small', 'google/gemini-embedding-001').
4520
+ * @default openai/text-embedding-3-small
4521
+ * @example openai/text-embedding-3-small
4522
+ */
4523
+ model: string;
4524
+ /** @description The OpenRouter API key. Can also be set via OPENROUTER_API_KEY environment variable. */
4525
+ api_key?: string;
4526
+ /** @description Output dimension for the embedding (if supported by the model). */
4527
+ dimensions?: number;
4528
+ };
4165
4529
  /**
4166
4530
  * @description Configuration for the AWS Bedrock embedding provider.
4167
4531
  *
@@ -4234,11 +4598,45 @@ interface components$1 {
4234
4598
  */
4235
4599
  truncate?: "NONE" | "START" | "END";
4236
4600
  };
4601
+ /**
4602
+ * @description Configuration for the Termite embedding provider.
4603
+ *
4604
+ * Termite is Antfly's built-in ML service for local embeddings using ONNX models.
4605
+ * It provides embedding generation with multi-tier caching (memory + persistent).
4606
+ *
4607
+ * **Features:**
4608
+ * - Local ONNX-based embedding generation
4609
+ * - L1 memory cache with configurable TTL
4610
+ * - L2 persistent Pebble database cache
4611
+ * - Singleflight deduplication for concurrent identical requests
4612
+ *
4613
+ * **Example Models:** bge-base-en-v1.5 (768 dims), all-MiniLM-L6-v2 (384 dims)
4614
+ *
4615
+ * Models are loaded from the `models/embedders/{name}/` directory.
4616
+ * @example {
4617
+ * "provider": "termite",
4618
+ * "model": "bge-base-en-v1.5",
4619
+ * "api_url": "http://localhost:8082"
4620
+ * }
4621
+ */
4622
+ TermiteEmbedderConfig: {
4623
+ /**
4624
+ * @description The embedding model name (maps to models/embedders/{name}/ directory).
4625
+ * @example bge-base-en-v1.5
4626
+ */
4627
+ model: string;
4628
+ /**
4629
+ * Format: uri
4630
+ * @description The URL of the Termite API endpoint. Can also be set via ANTFLY_TERMITE_URL environment variable.
4631
+ * @example http://localhost:8082
4632
+ */
4633
+ api_url?: string;
4634
+ };
4237
4635
  /**
4238
4636
  * @description The embedding provider to use.
4239
4637
  * @enum {string}
4240
4638
  */
4241
- EmbedderProvider: "gemini" | "vertex" | "ollama" | "openai" | "bedrock" | "cohere" | "mock";
4639
+ EmbedderProvider: "gemini" | "vertex" | "ollama" | "openai" | "openrouter" | "bedrock" | "cohere" | "mock" | "termite";
4242
4640
  /**
4243
4641
  * @description A unified configuration for an embedding provider.
4244
4642
  *
@@ -4412,7 +4810,7 @@ interface components$1 {
4412
4810
  * "model": "text-embedding-3-small"
4413
4811
  * }
4414
4812
  */
4415
- EmbedderConfig: (components$1["schemas"]["GoogleEmbedderConfig"] | components$1["schemas"]["VertexEmbedderConfig"] | components$1["schemas"]["OllamaEmbedderConfig"] | components$1["schemas"]["OpenAIEmbedderConfig"] | components$1["schemas"]["BedrockEmbedderConfig"] | components$1["schemas"]["CohereEmbedderConfig"]) & {
4813
+ EmbedderConfig: (components$1["schemas"]["GoogleEmbedderConfig"] | components$1["schemas"]["VertexEmbedderConfig"] | components$1["schemas"]["OllamaEmbedderConfig"] | components$1["schemas"]["OpenAIEmbedderConfig"] | components$1["schemas"]["OpenRouterEmbedderConfig"] | components$1["schemas"]["BedrockEmbedderConfig"] | components$1["schemas"]["CohereEmbedderConfig"] | components$1["schemas"]["TermiteEmbedderConfig"]) & {
4416
4814
  provider: components$1["schemas"]["EmbedderProvider"];
4417
4815
  };
4418
4816
  /** @description Per-request configuration for chunking. All fields are optional - zero/omitted values use chunker defaults. */
@@ -4821,6 +5219,88 @@ interface operations {
4821
5219
  500: components$1["responses"]["InternalServerError"];
4822
5220
  };
4823
5221
  };
5222
+ backup: {
5223
+ parameters: {
5224
+ query?: never;
5225
+ header?: never;
5226
+ path?: never;
5227
+ cookie?: never;
5228
+ };
5229
+ requestBody: {
5230
+ content: {
5231
+ "application/json": components$1["schemas"]["ClusterBackupRequest"];
5232
+ };
5233
+ };
5234
+ responses: {
5235
+ /** @description Backup completed successfully */
5236
+ 200: {
5237
+ headers: {
5238
+ [name: string]: unknown;
5239
+ };
5240
+ content: {
5241
+ "application/json": components$1["schemas"]["ClusterBackupResponse"];
5242
+ };
5243
+ };
5244
+ 400: components$1["responses"]["BadRequest"];
5245
+ 500: components$1["responses"]["InternalServerError"];
5246
+ };
5247
+ };
5248
+ restore: {
5249
+ parameters: {
5250
+ query?: never;
5251
+ header?: never;
5252
+ path?: never;
5253
+ cookie?: never;
5254
+ };
5255
+ requestBody: {
5256
+ content: {
5257
+ "application/json": components$1["schemas"]["ClusterRestoreRequest"];
5258
+ };
5259
+ };
5260
+ responses: {
5261
+ /** @description Restore triggered successfully */
5262
+ 202: {
5263
+ headers: {
5264
+ [name: string]: unknown;
5265
+ };
5266
+ content: {
5267
+ "application/json": components$1["schemas"]["ClusterRestoreResponse"];
5268
+ };
5269
+ };
5270
+ 400: components$1["responses"]["BadRequest"];
5271
+ 500: components$1["responses"]["InternalServerError"];
5272
+ };
5273
+ };
5274
+ listBackups: {
5275
+ parameters: {
5276
+ query: {
5277
+ /**
5278
+ * @description Storage location to search for backups.
5279
+ * - Local filesystem: `file:///path/to/backup`
5280
+ * - Amazon S3: `s3://bucket-name/path/to/backup`
5281
+ * @example s3://mybucket/antfly-backups/
5282
+ */
5283
+ location: string;
5284
+ };
5285
+ header?: never;
5286
+ path?: never;
5287
+ cookie?: never;
5288
+ };
5289
+ requestBody?: never;
5290
+ responses: {
5291
+ /** @description List of available backups */
5292
+ 200: {
5293
+ headers: {
5294
+ [name: string]: unknown;
5295
+ };
5296
+ content: {
5297
+ "application/json": components$1["schemas"]["BackupListResponse"];
5298
+ };
5299
+ };
5300
+ 400: components$1["responses"]["BadRequest"];
5301
+ 500: components$1["responses"]["InternalServerError"];
5302
+ };
5303
+ };
4824
5304
  globalQuery: {
4825
5305
  parameters: {
4826
5306
  query?: never;
@@ -5272,7 +5752,7 @@ interface operations {
5272
5752
  };
5273
5753
  };
5274
5754
  };
5275
- batch: {
5755
+ batchWrite: {
5276
5756
  parameters: {
5277
5757
  query?: never;
5278
5758
  header?: never;
@@ -5294,19 +5774,7 @@ interface operations {
5294
5774
  [name: string]: unknown;
5295
5775
  };
5296
5776
  content: {
5297
- "application/json": {
5298
- /** @description Number of documents successfully inserted */
5299
- inserted?: number;
5300
- /** @description Number of documents successfully deleted */
5301
- deleted?: number;
5302
- /** @description List of failed operations with error details */
5303
- failed?: {
5304
- /** @description The document ID that failed */
5305
- id?: string;
5306
- /** @description Error message for this failure */
5307
- error?: string;
5308
- }[];
5309
- };
5777
+ "application/json": components$1["schemas"]["BatchResponse"];
5310
5778
  };
5311
5779
  };
5312
5780
  400: components$1["responses"]["BadRequest"];
@@ -6306,6 +6774,10 @@ type ResourceType = components$1["schemas"]["ResourceType"];
6306
6774
  type PermissionType = components$1["schemas"]["PermissionType"];
6307
6775
  type BackupRequest = components$1["schemas"]["BackupRequest"];
6308
6776
  type RestoreRequest = components$1["schemas"]["RestoreRequest"];
6777
+ type ScanKeysRequest = Omit<components$1["schemas"]["ScanKeysRequest"], "filter_query"> & {
6778
+ /** Full JSON Bleve filter query with proper type checking */
6779
+ filter_query?: BleveQuery;
6780
+ };
6309
6781
  type DocumentSchema = components$1["schemas"]["DocumentSchema"];
6310
6782
  type FacetOption = components$1["schemas"]["FacetOption"];
6311
6783
  type FacetResult = components$1["schemas"]["FacetResult"];
@@ -6318,7 +6790,7 @@ type EmbedderProvider = components$1["schemas"]["EmbedderProvider"];
6318
6790
  declare const embedderProviders: components$1["schemas"]["EmbedderProvider"][];
6319
6791
  type GeneratorProvider = components$1["schemas"]["GeneratorProvider"];
6320
6792
  declare const generatorProviders: components$1["schemas"]["GeneratorProvider"][];
6321
- type SummarizeResult = components$1["schemas"]["SummarizeResult"];
6793
+ type GenerateResult = components$1["schemas"]["GenerateResult"];
6322
6794
  type RAGResult = components$1["schemas"]["RAGResult"];
6323
6795
  type AnswerAgentRequest = components$1["schemas"]["AnswerAgentRequest"];
6324
6796
  type AnswerAgentResult = components$1["schemas"]["AnswerAgentResult"];
@@ -6604,10 +7076,7 @@ declare class AntflyClient {
6604
7076
  batch: (tableName: string, request: BatchRequest) => Promise<{
6605
7077
  inserted?: number;
6606
7078
  deleted?: number;
6607
- failed?: {
6608
- id?: string;
6609
- error?: string;
6610
- }[];
7079
+ transformed?: number;
6611
7080
  }>;
6612
7081
  /**
6613
7082
  * Backup a table
@@ -6623,10 +7092,38 @@ declare class AntflyClient {
6623
7092
  }>;
6624
7093
  /**
6625
7094
  * Lookup a specific key in a table
7095
+ * @param tableName - Name of the table
7096
+ * @param key - Key of the record to lookup
7097
+ * @param options - Optional parameters
7098
+ * @param options.fields - Comma-separated list of fields to include (e.g., "title,author,metadata.tags")
6626
7099
  */
6627
- lookup: (tableName: string, key: string) => Promise<{
7100
+ lookup: (tableName: string, key: string, options?: {
7101
+ fields?: string;
7102
+ }) => Promise<{
6628
7103
  [key: string]: unknown;
6629
7104
  }>;
7105
+ /**
7106
+ * Scan keys in a table within a key range
7107
+ * Returns documents as an async iterable, streaming results as NDJSON.
7108
+ * @param tableName - Name of the table
7109
+ * @param request - Scan request with optional key range, field projection, and filtering
7110
+ * @returns AsyncGenerator yielding documents with their keys
7111
+ */
7112
+ scan: (tableName: string, request?: ScanKeysRequest) => AsyncGenerator<{
7113
+ _key: string;
7114
+ [key: string]: unknown;
7115
+ }>;
7116
+ /**
7117
+ * Scan keys in a table and collect all results into an array
7118
+ * Convenience method that consumes the scan AsyncGenerator
7119
+ * @param tableName - Name of the table
7120
+ * @param request - Scan request with optional key range, field projection, and filtering
7121
+ * @returns Promise with array of all matching documents
7122
+ */
7123
+ scanAll: (tableName: string, request?: ScanKeysRequest) => Promise<Array<{
7124
+ _key: string;
7125
+ [key: string]: unknown;
7126
+ }>>;
6630
7127
  /**
6631
7128
  * RAG (Retrieval-Augmented Generation) query on a specific table with streaming or citations
6632
7129
  * @param tableName - Name of the table to query
@@ -6968,4 +7465,4 @@ declare function geoBoundingBox(field: string, bounds: {
6968
7465
  * ```
6969
7466
  */
6970
7467
 
6971
- export { type AnswerAgentRequest, type AnswerAgentResult, type AnswerAgentStreamCallbacks, type AnswerConfidence, AntflyClient, type AntflyConfig, type AntflyError, type AntflyType, type BackupRequest, type BatchRequest, type ChatAgentRequest, type ChatAgentResult, type ChatAgentSteps, type ChatAgentStreamCallbacks, type ChatMessage, type ChatMessageRole, type ChatToolCall, type ChatToolName, type ChatToolResult, type ChatToolsConfig, type ClarificationRequest, type ClassificationTransformationResult, type CreateTableRequest, type CreateUserRequest, type DocumentSchema, type EmbedderConfig, type EmbedderProvider, type FacetOption, type FacetResult, type FetchConfig, type FilterSpec, type GeneratorConfig, type GeneratorProvider, type IndexConfig, type IndexStatus, type Permission, type PermissionType, type QueryBuilderRequest, type QueryBuilderResult, type QueryHit, type QueryOptions, type QueryRequest, type QueryResponses, type QueryResult, type QueryStrategy, type RAGRequest, type RAGResult, type RAGStreamCallbacks, type RerankerConfig, type ResourceType, type ResponseData, type RestoreRequest, type RouteType, type SemanticQueryMode, type SummarizeResult, type Table, type TableSchema, type TableStatus, type TermFacetResult, type UpdatePasswordRequest, type User, type WebSearchConfig, type WebSearchResultItem, type components as bleve_components, boolean, type components$1 as components, conjunction, dateRange, AntflyClient as default, disjunction, docIds, embedderProviders, fuzzy, generatorProviders, geoBoundingBox, geoDistance, match, matchAll, matchNone, matchPhrase, numericRange, type operations, type paths, prefix, queryString, term };
7468
+ export { type AnswerAgentRequest, type AnswerAgentResult, type AnswerAgentStreamCallbacks, type AnswerConfidence, AntflyClient, type AntflyConfig, type AntflyError, type AntflyType, type BackupRequest, type BatchRequest, type ChatAgentRequest, type ChatAgentResult, type ChatAgentSteps, type ChatAgentStreamCallbacks, type ChatMessage, type ChatMessageRole, type ChatToolCall, type ChatToolName, type ChatToolResult, type ChatToolsConfig, type ClarificationRequest, type ClassificationTransformationResult, type CreateTableRequest, type CreateUserRequest, type DocumentSchema, type EmbedderConfig, type EmbedderProvider, type FacetOption, type FacetResult, type FetchConfig, type FilterSpec, type GenerateResult, type GeneratorConfig, type GeneratorProvider, type IndexConfig, type IndexStatus, type Permission, type PermissionType, type QueryBuilderRequest, type QueryBuilderResult, type QueryHit, type QueryOptions, type QueryRequest, type QueryResponses, type QueryResult, type QueryStrategy, type RAGRequest, type RAGResult, type RAGStreamCallbacks, type RerankerConfig, type ResourceType, type ResponseData, type RestoreRequest, type RouteType, type SemanticQueryMode, type Table, type TableSchema, type TableStatus, type TermFacetResult, type UpdatePasswordRequest, type User, type WebSearchConfig, type WebSearchResultItem, type components as bleve_components, boolean, type components$1 as components, conjunction, dateRange, AntflyClient as default, disjunction, docIds, embedderProviders, fuzzy, generatorProviders, geoBoundingBox, geoDistance, match, matchAll, matchNone, matchPhrase, numericRange, type operations, type paths, prefix, queryString, term };