@antfly/sdk 0.0.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,1725 @@
1
+ import { Client } from 'openapi-fetch';
2
+
3
+ /**
4
+ * This file was auto-generated by openapi-typescript.
5
+ * Do not make direct changes to the file.
6
+ */
7
+
8
+ interface paths {
9
+ "/query": {
10
+ parameters: {
11
+ query?: never;
12
+ header?: never;
13
+ path?: never;
14
+ cookie?: never;
15
+ };
16
+ get?: never;
17
+ put?: never;
18
+ /**
19
+ * Perform a global query
20
+ * @description Executes a query across all relevant tables and shards based on the query content.
21
+ */
22
+ post: operations["globalQuery"];
23
+ delete?: never;
24
+ options?: never;
25
+ head?: never;
26
+ patch?: never;
27
+ trace?: never;
28
+ };
29
+ "/table": {
30
+ parameters: {
31
+ query?: never;
32
+ header?: never;
33
+ path?: never;
34
+ cookie?: never;
35
+ };
36
+ /** List all tables */
37
+ get: operations["listTables"];
38
+ put?: never;
39
+ post?: never;
40
+ delete?: never;
41
+ options?: never;
42
+ head?: never;
43
+ patch?: never;
44
+ trace?: never;
45
+ };
46
+ "/table/{tableName}": {
47
+ parameters: {
48
+ query?: never;
49
+ header?: never;
50
+ path: {
51
+ /** @description Name of the table */
52
+ tableName: string;
53
+ };
54
+ cookie?: never;
55
+ };
56
+ /** Get table details */
57
+ get: operations["getTable"];
58
+ put?: never;
59
+ /** Create a new table */
60
+ post: operations["createTable"];
61
+ /** Drop a table */
62
+ delete: operations["dropTable"];
63
+ options?: never;
64
+ head?: never;
65
+ patch?: never;
66
+ trace?: never;
67
+ };
68
+ "/table/{tableName}/query": {
69
+ parameters: {
70
+ query?: never;
71
+ header?: never;
72
+ path: {
73
+ /** @description Name of the table to query */
74
+ tableName: string;
75
+ };
76
+ cookie?: never;
77
+ };
78
+ get?: never;
79
+ put?: never;
80
+ /** Query a specific table */
81
+ post: operations["queryTable"];
82
+ delete?: never;
83
+ options?: never;
84
+ head?: never;
85
+ patch?: never;
86
+ trace?: never;
87
+ };
88
+ "/table/{tableName}/batch": {
89
+ parameters: {
90
+ query?: never;
91
+ header?: never;
92
+ path: {
93
+ /** @description Name of the table for batch operation */
94
+ tableName: string;
95
+ };
96
+ cookie?: never;
97
+ };
98
+ get?: never;
99
+ put?: never;
100
+ /** Perform batch inserts and deletes on a table */
101
+ post: operations["batchTableOperations"];
102
+ delete?: never;
103
+ options?: never;
104
+ head?: never;
105
+ patch?: never;
106
+ trace?: never;
107
+ };
108
+ "/table/{tableName}/backup": {
109
+ parameters: {
110
+ query?: never;
111
+ header?: never;
112
+ path: {
113
+ /** @description Name of the table to backup */
114
+ tableName: string;
115
+ };
116
+ cookie?: never;
117
+ };
118
+ get?: never;
119
+ put?: never;
120
+ /** Backup a table */
121
+ post: operations["backupTable"];
122
+ delete?: never;
123
+ options?: never;
124
+ head?: never;
125
+ patch?: never;
126
+ trace?: never;
127
+ };
128
+ "/table/{tableName}/restore": {
129
+ parameters: {
130
+ query?: never;
131
+ header?: never;
132
+ path: {
133
+ /** @description Name of the table to restore into */
134
+ tableName: string;
135
+ };
136
+ cookie?: never;
137
+ };
138
+ get?: never;
139
+ put?: never;
140
+ /** Restore a table from backup */
141
+ post: operations["restoreTable"];
142
+ delete?: never;
143
+ options?: never;
144
+ head?: never;
145
+ patch?: never;
146
+ trace?: never;
147
+ };
148
+ "/table/{tableName}/key/{key}": {
149
+ parameters: {
150
+ query?: never;
151
+ header?: never;
152
+ path: {
153
+ /** @description Name of the table */
154
+ tableName: string;
155
+ /** @description Key of the record to lookup */
156
+ key: string;
157
+ };
158
+ cookie?: never;
159
+ };
160
+ /** Lookup a key in a table */
161
+ get: operations["lookupKey"];
162
+ put?: never;
163
+ post?: never;
164
+ delete?: never;
165
+ options?: never;
166
+ head?: never;
167
+ patch?: never;
168
+ trace?: never;
169
+ };
170
+ "/table/{tableName}/index": {
171
+ parameters: {
172
+ query?: never;
173
+ header?: never;
174
+ path: {
175
+ /** @description Name of the table */
176
+ tableName: string;
177
+ };
178
+ cookie?: never;
179
+ };
180
+ /** List all indexes for a table */
181
+ get: operations["listIndexes"];
182
+ put?: never;
183
+ post?: never;
184
+ delete?: never;
185
+ options?: never;
186
+ head?: never;
187
+ patch?: never;
188
+ trace?: never;
189
+ };
190
+ "/table/{tableName}/index/{indexName}": {
191
+ parameters: {
192
+ query?: never;
193
+ header?: never;
194
+ path: {
195
+ /** @description Name of the table */
196
+ tableName: string;
197
+ /** @description Name of the index */
198
+ indexName: string;
199
+ };
200
+ cookie?: never;
201
+ };
202
+ /** Get index details */
203
+ get: operations["getIndex"];
204
+ put?: never;
205
+ /** Add an index to a table */
206
+ post: operations["createIndex"];
207
+ /** Drop an index from a table */
208
+ delete: operations["dropIndex"];
209
+ options?: never;
210
+ head?: never;
211
+ patch?: never;
212
+ trace?: never;
213
+ };
214
+ "/user/{userName}": {
215
+ parameters: {
216
+ query?: never;
217
+ header?: never;
218
+ path: {
219
+ /** @description The username. */
220
+ userName: components["parameters"]["UserNamePathParameter"];
221
+ };
222
+ cookie?: never;
223
+ };
224
+ /**
225
+ * Get user details
226
+ * @description Retrieves details for a specific user.
227
+ */
228
+ get: operations["getUserByName"];
229
+ put?: never;
230
+ /**
231
+ * Create a new user
232
+ * @description Creates a new user with the given username and password. Username in path takes precedence.
233
+ */
234
+ post: operations["createUser"];
235
+ /**
236
+ * Delete a user
237
+ * @description Deletes a specific user.
238
+ */
239
+ delete: operations["deleteUser"];
240
+ options?: never;
241
+ head?: never;
242
+ patch?: never;
243
+ trace?: never;
244
+ };
245
+ "/user/{userName}/password": {
246
+ parameters: {
247
+ query?: never;
248
+ header?: never;
249
+ path: {
250
+ /** @description The username. */
251
+ userName: components["parameters"]["UserNamePathParameter"];
252
+ };
253
+ cookie?: never;
254
+ };
255
+ get?: never;
256
+ /**
257
+ * Update user password
258
+ * @description Updates the password for a specific user.
259
+ */
260
+ put: operations["updateUserPassword"];
261
+ post?: never;
262
+ delete?: never;
263
+ options?: never;
264
+ head?: never;
265
+ patch?: never;
266
+ trace?: never;
267
+ };
268
+ "/user/{userName}/permission": {
269
+ parameters: {
270
+ query?: never;
271
+ header?: never;
272
+ path: {
273
+ /** @description The username. */
274
+ userName: components["parameters"]["UserNamePathParameter"];
275
+ };
276
+ cookie?: never;
277
+ };
278
+ /**
279
+ * Get user permissions
280
+ * @description Retrieves all permissions for a specific user.
281
+ */
282
+ get: operations["getUserPermissions"];
283
+ put?: never;
284
+ /**
285
+ * Add permission to user
286
+ * @description Adds a new permission to a specific user.
287
+ */
288
+ post: operations["addPermissionToUser"];
289
+ /**
290
+ * Remove permission from user
291
+ * @description Removes a specific permission rule from a user based on resource name and type.
292
+ */
293
+ delete: operations["removePermissionFromUser"];
294
+ options?: never;
295
+ head?: never;
296
+ patch?: never;
297
+ trace?: never;
298
+ };
299
+ }
300
+ interface components {
301
+ schemas: {
302
+ Error: {
303
+ /** @example An error message */
304
+ error: string;
305
+ };
306
+ ByteRange: string[];
307
+ ShardConfig: {
308
+ byte_range: components["schemas"]["ByteRange"];
309
+ };
310
+ CreateTableRequest: {
311
+ /** Format: uint */
312
+ num_shards?: number;
313
+ indexes?: {
314
+ [key: string]: components["schemas"]["CreateIndexRequest"];
315
+ };
316
+ schema?: components["schemas"]["TableSchema"];
317
+ };
318
+ Table: {
319
+ name: string;
320
+ indexes: {
321
+ [key: string]: components["schemas"]["IndexConfig"];
322
+ };
323
+ shards: {
324
+ [key: string]: components["schemas"]["ShardConfig"];
325
+ };
326
+ schema?: components["schemas"]["TableSchema"];
327
+ };
328
+ ValueSchema: {
329
+ type: components["schemas"]["ValueType"];
330
+ /** @description For object types, this schema defines the structure of the content.
331
+ * For other types, this field is ignored.
332
+ * */
333
+ schema?: components["schemas"]["DocumentSchema"];
334
+ };
335
+ DocumentSchema: {
336
+ /** @description A map of field names to their value schema (type, defaults, configuration etc.).
337
+ * This allows for flexible content types per field.
338
+ * The key is the field name, and the value is the value type schema.
339
+ * */
340
+ fields?: {
341
+ [key: string]: components["schemas"]["ValueSchema"];
342
+ };
343
+ };
344
+ TableSchema: {
345
+ key?: string;
346
+ /** @description Default type to use from the document_types.
347
+ * */
348
+ default_type?: string;
349
+ document_types?: {
350
+ [key: string]: components["schemas"]["DocumentSchema"];
351
+ };
352
+ };
353
+ DateRange: {
354
+ name: string;
355
+ from?: string;
356
+ to?: string;
357
+ };
358
+ NumericRange: {
359
+ name: string;
360
+ /** Format: float */
361
+ from?: number;
362
+ /** Format: float */
363
+ to?: number;
364
+ };
365
+ TermFacetResult: {
366
+ term: string;
367
+ count: number;
368
+ };
369
+ DateRangeResult: unknown;
370
+ NumericRangeResult: unknown;
371
+ FacetOption: {
372
+ field?: string;
373
+ size?: number;
374
+ date_ranges?: components["schemas"]["DateRange"][];
375
+ numeric_ranges?: components["schemas"]["NumericRange"][];
376
+ };
377
+ FacetResult: {
378
+ field?: string;
379
+ total?: number;
380
+ missing?: number;
381
+ terms?: components["schemas"]["TermFacetResult"][];
382
+ date_ranges?: components["schemas"]["DateRangeResult"][];
383
+ numeric_ranges?: components["schemas"]["NumericRangeResult"][];
384
+ };
385
+ /**
386
+ * @description Field type (e.g., string, int, float)
387
+ * @enum {string}
388
+ */
389
+ ValueType: "float" | "uint" | "int" | "bool" | "time" | "geopoint" | "geoshape" | "string" | "keyword" | "array" | "object" | "embedding" | "link" | "blob";
390
+ IndexConfig: {
391
+ name: string;
392
+ type: string;
393
+ config: {
394
+ [key: string]: unknown;
395
+ };
396
+ };
397
+ IndexStatus: unknown;
398
+ StorageStatus: {
399
+ /**
400
+ * Format: uint64
401
+ * @description Disk usage in bytes.
402
+ */
403
+ disk_usage?: number;
404
+ /** @description Whether the table has received data. */
405
+ empty?: boolean;
406
+ };
407
+ TableStatus: unknown;
408
+ EmbedderConfig: {
409
+ provider: string;
410
+ model: string;
411
+ model_provider?: string;
412
+ /** Format: uri */
413
+ url?: string;
414
+ };
415
+ SummarizerConfig: {
416
+ provider: string;
417
+ model: string;
418
+ model_provider?: string;
419
+ /** Format: uri */
420
+ url?: string;
421
+ };
422
+ CreateIndexRequest: {
423
+ field?: string;
424
+ template?: string;
425
+ mem_only?: boolean;
426
+ dimension: number;
427
+ summarizer_config?: components["schemas"]["SummarizerConfig"];
428
+ embedder_config: components["schemas"]["EmbedderConfig"];
429
+ };
430
+ /** @example {
431
+ * "inserts": {
432
+ * "user:123": {
433
+ * "name": "John Doe",
434
+ * "email": "john@example.com",
435
+ * "age": 30,
436
+ * "tags": [
437
+ * "customer",
438
+ * "premium"
439
+ * ]
440
+ * },
441
+ * "user:456": {
442
+ * "name": "Jane Smith",
443
+ * "email": "jane@example.com",
444
+ * "age": 25,
445
+ * "tags": [
446
+ * "customer"
447
+ * ]
448
+ * }
449
+ * },
450
+ * "deletes": [
451
+ * "user:789",
452
+ * "user:old_account"
453
+ * ]
454
+ * } */
455
+ BatchRequest: {
456
+ inserts?: {
457
+ [key: string]: Record<string, never>;
458
+ };
459
+ /** @description List of keys to delete. */
460
+ deletes?: string[];
461
+ };
462
+ BackupRequest: {
463
+ backup_id: string;
464
+ /** @description Location for the backup (e.g., file:///path/to/backup, s3://bucket/path) */
465
+ location: string;
466
+ };
467
+ RestoreRequest: components["schemas"]["BackupRequest"];
468
+ QueryRequest: {
469
+ table?: string;
470
+ /** @description Full JSON Bleve search queries */
471
+ full_text_search?: {
472
+ [key: string]: unknown;
473
+ };
474
+ semantic_search?: string;
475
+ indexes?: string[];
476
+ /** Format: byte */
477
+ filter_prefix?: string;
478
+ /** @description Full JSON Bleve search queries */
479
+ filter_query?: {
480
+ [key: string]: unknown;
481
+ };
482
+ /** @description Full JSON Bleve search queries */
483
+ exclusion_query?: {
484
+ [key: string]: unknown;
485
+ };
486
+ facets?: {
487
+ [key: string]: components["schemas"]["FacetOption"];
488
+ };
489
+ embeddings?: {
490
+ [key: string]: number[];
491
+ };
492
+ fields?: string[];
493
+ /** @description Maximum number of results to return or topk for semantic_search. */
494
+ limit?: number;
495
+ /** @description Number of results to skip for pagination, only available for full_text_search queries. */
496
+ offset?: number;
497
+ order_by?: {
498
+ [key: string]: boolean;
499
+ };
500
+ /**
501
+ * Format: float
502
+ * @description Maximum distance for semantic similarity search.
503
+ */
504
+ distance_under?: number;
505
+ /**
506
+ * Format: float
507
+ * @description Minimum distance for semantic similarity search.
508
+ */
509
+ distance_over?: number;
510
+ count?: boolean;
511
+ reranker?: components["schemas"]["Reranker"];
512
+ };
513
+ Reranker: {
514
+ field?: string;
515
+ template?: string;
516
+ model: string;
517
+ provider: string;
518
+ model_provider?: string;
519
+ /** Format: uri */
520
+ url?: string;
521
+ };
522
+ QueryHit: {
523
+ /** @description ID of the record. */
524
+ _id?: string;
525
+ /**
526
+ * Format: float
527
+ * @description Relevance score of the hit.
528
+ */
529
+ _score?: number;
530
+ /** @description Scores partitioned by index when using RRF search. */
531
+ _index_scores?: {
532
+ [key: string]: unknown;
533
+ };
534
+ _source?: {
535
+ [key: string]: unknown;
536
+ };
537
+ };
538
+ /** @description A list of query hits. */
539
+ QueryHits: {
540
+ /**
541
+ * Format: uint64
542
+ * @description Total number of hits available.
543
+ */
544
+ total?: number;
545
+ hits?: components["schemas"]["QueryHit"][];
546
+ /**
547
+ * Format: float
548
+ * @description Maximum score of the results.
549
+ */
550
+ max_score?: number;
551
+ };
552
+ /** @description Responses from multiple query operations. */
553
+ QueryResponses: {
554
+ responses?: components["schemas"]["QueryResult"][];
555
+ };
556
+ /** @description Result of a query operation as an array of results and a count. */
557
+ QueryResult: {
558
+ hits?: components["schemas"]["QueryHits"];
559
+ facets?: {
560
+ [key: string]: components["schemas"]["FacetResult"];
561
+ };
562
+ /**
563
+ * Format: int64
564
+ * @description Duration of the query in milliseconds.
565
+ */
566
+ took: number;
567
+ /**
568
+ * Format: int32
569
+ * @description HTTP status code of the query operation.
570
+ */
571
+ status: number;
572
+ /** @description Error message if the query failed. */
573
+ error?: string;
574
+ };
575
+ User: {
576
+ /** @example johndoe */
577
+ username: string;
578
+ /**
579
+ * Format: byte
580
+ * @description Base64 encoded password hash. Exposing this is a security risk.
581
+ * @example JGFyZ29uMm...
582
+ */
583
+ password_hash: string;
584
+ };
585
+ /**
586
+ * @description Type of the resource, e.g., table, user, or global ('*').
587
+ * @example table
588
+ * @enum {string}
589
+ */
590
+ ResourceType: "table" | "user" | "*";
591
+ /**
592
+ * @description Type of permission.
593
+ * @example read
594
+ * @enum {string}
595
+ */
596
+ PermissionType: "read" | "write" | "admin";
597
+ Permission: {
598
+ /**
599
+ * @description Resource name (e.g., table name, target username, or '*' for global).
600
+ * @example orders_table
601
+ */
602
+ resource: string;
603
+ resource_type: components["schemas"]["ResourceType"];
604
+ type: components["schemas"]["PermissionType"];
605
+ };
606
+ CreateUserRequest: {
607
+ /**
608
+ * @description Username for the new user. If provided in the path, this field can be omitted or must match the path parameter.
609
+ * @example johndoe
610
+ */
611
+ username?: string;
612
+ /**
613
+ * Format: password
614
+ * @example s3cr3tP@sswOrd
615
+ */
616
+ password: string;
617
+ /** @description Optional list of initial permissions for the user. */
618
+ initial_policies?: components["schemas"]["Permission"][] | null;
619
+ };
620
+ UpdatePasswordRequest: {
621
+ /**
622
+ * Format: password
623
+ * @example newS3cr3tP@sswOrd
624
+ */
625
+ new_password: string;
626
+ };
627
+ SuccessMessage: {
628
+ /** @example Operation completed successfully */
629
+ message?: string;
630
+ };
631
+ };
632
+ responses: {
633
+ /** @description Bad request */
634
+ BadRequest: {
635
+ headers: {
636
+ [name: string]: unknown;
637
+ };
638
+ content: {
639
+ "application/json": components["schemas"]["Error"];
640
+ };
641
+ };
642
+ /** @description Resource not found */
643
+ NotFound: {
644
+ headers: {
645
+ [name: string]: unknown;
646
+ };
647
+ content: {
648
+ "application/json": components["schemas"]["Error"];
649
+ };
650
+ };
651
+ /** @description Internal server error */
652
+ InternalServerError: {
653
+ headers: {
654
+ [name: string]: unknown;
655
+ };
656
+ content: {
657
+ "application/json": components["schemas"]["Error"];
658
+ };
659
+ };
660
+ /** @description Unauthorized */
661
+ Unauthorized: {
662
+ headers: {
663
+ [name: string]: unknown;
664
+ };
665
+ content: {
666
+ "application/json": components["schemas"]["Error"];
667
+ };
668
+ };
669
+ /** @description Forbidden */
670
+ Forbidden: {
671
+ headers: {
672
+ [name: string]: unknown;
673
+ };
674
+ content: {
675
+ "application/json": components["schemas"]["Error"];
676
+ };
677
+ };
678
+ };
679
+ parameters: {
680
+ /** @description The username. */
681
+ UserNamePathParameter: string;
682
+ };
683
+ requestBodies: never;
684
+ headers: never;
685
+ pathItems: never;
686
+ }
687
+ interface operations {
688
+ globalQuery: {
689
+ parameters: {
690
+ query?: never;
691
+ header?: never;
692
+ path?: never;
693
+ cookie?: never;
694
+ };
695
+ requestBody: {
696
+ content: {
697
+ "application/json": components["schemas"]["QueryRequest"];
698
+ /** @description IMPORTANT: The final line of data must end with a newline character \n.
699
+ * Each newline character may be preceded by a carriage return \r.
700
+ * When sending requests to this endpoint the Content-Type header should be set to application/x-ndjson.
701
+ * */
702
+ "application/x-ndjson": components["schemas"]["QueryRequest"];
703
+ };
704
+ };
705
+ responses: {
706
+ /** @description Query successful */
707
+ 200: {
708
+ headers: {
709
+ [name: string]: unknown;
710
+ };
711
+ content: {
712
+ "application/json": components["schemas"]["QueryResponses"];
713
+ };
714
+ };
715
+ /** @description Invalid query request */
716
+ 400: {
717
+ headers: {
718
+ [name: string]: unknown;
719
+ };
720
+ content: {
721
+ "application/json": components["schemas"]["Error"];
722
+ };
723
+ };
724
+ /** @description Internal server error */
725
+ 500: {
726
+ headers: {
727
+ [name: string]: unknown;
728
+ };
729
+ content: {
730
+ "application/json": components["schemas"]["Error"];
731
+ };
732
+ };
733
+ };
734
+ };
735
+ listTables: {
736
+ parameters: {
737
+ query?: never;
738
+ header?: never;
739
+ path?: never;
740
+ cookie?: never;
741
+ };
742
+ requestBody?: never;
743
+ responses: {
744
+ /** @description A list of tables */
745
+ 200: {
746
+ headers: {
747
+ [name: string]: unknown;
748
+ };
749
+ content: {
750
+ "application/json": components["schemas"]["Table"][];
751
+ };
752
+ };
753
+ 500: components["responses"]["InternalServerError"];
754
+ };
755
+ };
756
+ getTable: {
757
+ parameters: {
758
+ query?: never;
759
+ header?: never;
760
+ path: {
761
+ /** @description Name of the table */
762
+ tableName: string;
763
+ };
764
+ cookie?: never;
765
+ };
766
+ requestBody?: never;
767
+ responses: {
768
+ /** @description Table details */
769
+ 200: {
770
+ headers: {
771
+ [name: string]: unknown;
772
+ };
773
+ content: {
774
+ "application/json": components["schemas"]["TableStatus"];
775
+ };
776
+ };
777
+ 404: components["responses"]["NotFound"];
778
+ };
779
+ };
780
+ createTable: {
781
+ parameters: {
782
+ query?: never;
783
+ header?: never;
784
+ path: {
785
+ /** @description Name of the table */
786
+ tableName: string;
787
+ };
788
+ cookie?: never;
789
+ };
790
+ requestBody: {
791
+ content: {
792
+ "application/json": components["schemas"]["CreateTableRequest"];
793
+ };
794
+ };
795
+ responses: {
796
+ /** @description Table created successfully */
797
+ 200: {
798
+ headers: {
799
+ [name: string]: unknown;
800
+ };
801
+ content: {
802
+ "application/json": components["schemas"]["Table"];
803
+ };
804
+ };
805
+ 400: components["responses"]["BadRequest"];
806
+ };
807
+ };
808
+ dropTable: {
809
+ parameters: {
810
+ query?: never;
811
+ header?: never;
812
+ path: {
813
+ /** @description Name of the table */
814
+ tableName: string;
815
+ };
816
+ cookie?: never;
817
+ };
818
+ requestBody?: never;
819
+ responses: {
820
+ /** @description Table dropped successfully */
821
+ 204: {
822
+ headers: {
823
+ [name: string]: unknown;
824
+ };
825
+ content?: never;
826
+ };
827
+ 400: components["responses"]["BadRequest"];
828
+ 500: components["responses"]["InternalServerError"];
829
+ };
830
+ };
831
+ queryTable: {
832
+ parameters: {
833
+ query?: never;
834
+ header?: never;
835
+ path: {
836
+ /** @description Name of the table to query */
837
+ tableName: string;
838
+ };
839
+ cookie?: never;
840
+ };
841
+ requestBody: {
842
+ content: {
843
+ "application/json": components["schemas"]["QueryRequest"];
844
+ };
845
+ };
846
+ responses: {
847
+ /** @description Query successful */
848
+ 200: {
849
+ headers: {
850
+ [name: string]: unknown;
851
+ };
852
+ content: {
853
+ "application/json": components["schemas"]["QueryResult"];
854
+ };
855
+ };
856
+ 400: components["responses"]["BadRequest"];
857
+ 404: components["responses"]["NotFound"];
858
+ 500: components["responses"]["InternalServerError"];
859
+ };
860
+ };
861
+ batchTableOperations: {
862
+ parameters: {
863
+ query?: never;
864
+ header?: never;
865
+ path: {
866
+ /** @description Name of the table for batch operation */
867
+ tableName: string;
868
+ };
869
+ cookie?: never;
870
+ };
871
+ requestBody: {
872
+ content: {
873
+ "application/json": components["schemas"]["BatchRequest"];
874
+ };
875
+ };
876
+ responses: {
877
+ /** @description Batch operation successful */
878
+ 201: {
879
+ headers: {
880
+ [name: string]: unknown;
881
+ };
882
+ content: {
883
+ "application/json": {
884
+ /** @example successful */
885
+ batch?: string;
886
+ };
887
+ };
888
+ };
889
+ 400: components["responses"]["BadRequest"];
890
+ 404: components["responses"]["NotFound"];
891
+ 500: components["responses"]["InternalServerError"];
892
+ };
893
+ };
894
+ backupTable: {
895
+ parameters: {
896
+ query?: never;
897
+ header?: never;
898
+ path: {
899
+ /** @description Name of the table to backup */
900
+ tableName: string;
901
+ };
902
+ cookie?: never;
903
+ };
904
+ requestBody: {
905
+ content: {
906
+ "application/json": components["schemas"]["BackupRequest"];
907
+ };
908
+ };
909
+ responses: {
910
+ /** @description Backup process initiated successfully */
911
+ 201: {
912
+ headers: {
913
+ [name: string]: unknown;
914
+ };
915
+ content: {
916
+ "application/json": {
917
+ /** @example successful */
918
+ backup?: string;
919
+ };
920
+ };
921
+ };
922
+ 400: components["responses"]["BadRequest"];
923
+ 404: components["responses"]["NotFound"];
924
+ 500: components["responses"]["InternalServerError"];
925
+ };
926
+ };
927
+ restoreTable: {
928
+ parameters: {
929
+ query?: never;
930
+ header?: never;
931
+ path: {
932
+ /** @description Name of the table to restore into */
933
+ tableName: string;
934
+ };
935
+ cookie?: never;
936
+ };
937
+ requestBody: {
938
+ content: {
939
+ "application/json": components["schemas"]["RestoreRequest"];
940
+ };
941
+ };
942
+ responses: {
943
+ /** @description Restore process triggered successfully */
944
+ 202: {
945
+ headers: {
946
+ [name: string]: unknown;
947
+ };
948
+ content: {
949
+ "application/json": {
950
+ /** @example triggered */
951
+ restore?: string;
952
+ };
953
+ };
954
+ };
955
+ 400: components["responses"]["BadRequest"];
956
+ 500: components["responses"]["InternalServerError"];
957
+ };
958
+ };
959
+ lookupKey: {
960
+ parameters: {
961
+ query?: never;
962
+ header?: never;
963
+ path: {
964
+ /** @description Name of the table */
965
+ tableName: string;
966
+ /** @description Key of the record to lookup */
967
+ key: string;
968
+ };
969
+ cookie?: never;
970
+ };
971
+ requestBody?: never;
972
+ responses: {
973
+ /** @description Record found */
974
+ 200: {
975
+ headers: {
976
+ [name: string]: unknown;
977
+ };
978
+ content: {
979
+ "application/json": {
980
+ [key: string]: unknown;
981
+ };
982
+ };
983
+ };
984
+ 400: components["responses"]["BadRequest"];
985
+ 404: components["responses"]["NotFound"];
986
+ 500: components["responses"]["InternalServerError"];
987
+ };
988
+ };
989
+ listIndexes: {
990
+ parameters: {
991
+ query?: never;
992
+ header?: never;
993
+ path: {
994
+ /** @description Name of the table */
995
+ tableName: string;
996
+ };
997
+ cookie?: never;
998
+ };
999
+ requestBody?: never;
1000
+ responses: {
1001
+ /** @description A list of indexes for the table */
1002
+ 200: {
1003
+ headers: {
1004
+ [name: string]: unknown;
1005
+ };
1006
+ content: {
1007
+ "application/json": components["schemas"]["IndexStatus"][];
1008
+ };
1009
+ };
1010
+ 500: components["responses"]["InternalServerError"];
1011
+ };
1012
+ };
1013
+ getIndex: {
1014
+ parameters: {
1015
+ query?: never;
1016
+ header?: never;
1017
+ path: {
1018
+ /** @description Name of the table */
1019
+ tableName: string;
1020
+ /** @description Name of the index */
1021
+ indexName: string;
1022
+ };
1023
+ cookie?: never;
1024
+ };
1025
+ requestBody?: never;
1026
+ responses: {
1027
+ /** @description Index details */
1028
+ 200: {
1029
+ headers: {
1030
+ [name: string]: unknown;
1031
+ };
1032
+ content: {
1033
+ "application/json": components["schemas"]["IndexStatus"];
1034
+ };
1035
+ };
1036
+ 404: components["responses"]["NotFound"];
1037
+ 500: components["responses"]["InternalServerError"];
1038
+ };
1039
+ };
1040
+ createIndex: {
1041
+ parameters: {
1042
+ query?: never;
1043
+ header?: never;
1044
+ path: {
1045
+ /** @description Name of the table */
1046
+ tableName: string;
1047
+ /** @description Name of the index */
1048
+ indexName: string;
1049
+ };
1050
+ cookie?: never;
1051
+ };
1052
+ requestBody: {
1053
+ content: {
1054
+ "application/json": components["schemas"]["CreateIndexRequest"];
1055
+ };
1056
+ };
1057
+ responses: {
1058
+ /** @description Index added successfully */
1059
+ 201: {
1060
+ headers: {
1061
+ [name: string]: unknown;
1062
+ };
1063
+ content?: never;
1064
+ };
1065
+ 400: components["responses"]["BadRequest"];
1066
+ 500: components["responses"]["InternalServerError"];
1067
+ };
1068
+ };
1069
+ dropIndex: {
1070
+ parameters: {
1071
+ query?: never;
1072
+ header?: never;
1073
+ path: {
1074
+ /** @description Name of the table */
1075
+ tableName: string;
1076
+ /** @description Name of the index */
1077
+ indexName: string;
1078
+ };
1079
+ cookie?: never;
1080
+ };
1081
+ requestBody?: never;
1082
+ responses: {
1083
+ /** @description Index dropped successfully */
1084
+ 201: {
1085
+ headers: {
1086
+ [name: string]: unknown;
1087
+ };
1088
+ content?: never;
1089
+ };
1090
+ 500: components["responses"]["InternalServerError"];
1091
+ };
1092
+ };
1093
+ getUserByName: {
1094
+ parameters: {
1095
+ query?: never;
1096
+ header?: never;
1097
+ path: {
1098
+ /** @description The username. */
1099
+ userName: components["parameters"]["UserNamePathParameter"];
1100
+ };
1101
+ cookie?: never;
1102
+ };
1103
+ requestBody?: never;
1104
+ responses: {
1105
+ /** @description Successful operation */
1106
+ 200: {
1107
+ headers: {
1108
+ [name: string]: unknown;
1109
+ };
1110
+ content: {
1111
+ "application/json": components["schemas"]["User"];
1112
+ };
1113
+ };
1114
+ /** @description Bad Request (e.g., username is required) */
1115
+ 400: {
1116
+ headers: {
1117
+ [name: string]: unknown;
1118
+ };
1119
+ content: {
1120
+ "application/json": components["schemas"]["Error"];
1121
+ };
1122
+ };
1123
+ /** @description User not found */
1124
+ 404: {
1125
+ headers: {
1126
+ [name: string]: unknown;
1127
+ };
1128
+ content: {
1129
+ "application/json": components["schemas"]["Error"];
1130
+ };
1131
+ };
1132
+ /** @description Internal Server Error */
1133
+ 500: {
1134
+ headers: {
1135
+ [name: string]: unknown;
1136
+ };
1137
+ content: {
1138
+ "application/json": components["schemas"]["Error"];
1139
+ };
1140
+ };
1141
+ };
1142
+ };
1143
+ createUser: {
1144
+ parameters: {
1145
+ query?: never;
1146
+ header?: never;
1147
+ path: {
1148
+ /** @description The username. */
1149
+ userName: components["parameters"]["UserNamePathParameter"];
1150
+ };
1151
+ cookie?: never;
1152
+ };
1153
+ /** @description User creation details */
1154
+ requestBody: {
1155
+ content: {
1156
+ "application/json": components["schemas"]["CreateUserRequest"];
1157
+ };
1158
+ };
1159
+ responses: {
1160
+ /** @description User created successfully */
1161
+ 201: {
1162
+ headers: {
1163
+ [name: string]: unknown;
1164
+ };
1165
+ content: {
1166
+ "application/json": components["schemas"]["User"];
1167
+ };
1168
+ };
1169
+ /** @description Bad Request (e.g., invalid input, username/password mismatch) */
1170
+ 400: {
1171
+ headers: {
1172
+ [name: string]: unknown;
1173
+ };
1174
+ content: {
1175
+ "application/json": components["schemas"]["Error"];
1176
+ };
1177
+ };
1178
+ /** @description Conflict (e.g., user already exists) */
1179
+ 409: {
1180
+ headers: {
1181
+ [name: string]: unknown;
1182
+ };
1183
+ content: {
1184
+ "application/json": components["schemas"]["Error"];
1185
+ };
1186
+ };
1187
+ /** @description Internal Server Error */
1188
+ 500: {
1189
+ headers: {
1190
+ [name: string]: unknown;
1191
+ };
1192
+ content: {
1193
+ "application/json": components["schemas"]["Error"];
1194
+ };
1195
+ };
1196
+ };
1197
+ };
1198
+ deleteUser: {
1199
+ parameters: {
1200
+ query?: never;
1201
+ header?: never;
1202
+ path: {
1203
+ /** @description The username. */
1204
+ userName: components["parameters"]["UserNamePathParameter"];
1205
+ };
1206
+ cookie?: never;
1207
+ };
1208
+ requestBody?: never;
1209
+ responses: {
1210
+ /** @description User deleted successfully */
1211
+ 204: {
1212
+ headers: {
1213
+ [name: string]: unknown;
1214
+ };
1215
+ content?: never;
1216
+ };
1217
+ /** @description Bad Request (e.g., username is required) */
1218
+ 400: {
1219
+ headers: {
1220
+ [name: string]: unknown;
1221
+ };
1222
+ content: {
1223
+ "application/json": components["schemas"]["Error"];
1224
+ };
1225
+ };
1226
+ /** @description User not found */
1227
+ 404: {
1228
+ headers: {
1229
+ [name: string]: unknown;
1230
+ };
1231
+ content: {
1232
+ "application/json": components["schemas"]["Error"];
1233
+ };
1234
+ };
1235
+ /** @description Internal Server Error */
1236
+ 500: {
1237
+ headers: {
1238
+ [name: string]: unknown;
1239
+ };
1240
+ content: {
1241
+ "application/json": components["schemas"]["Error"];
1242
+ };
1243
+ };
1244
+ };
1245
+ };
1246
+ updateUserPassword: {
1247
+ parameters: {
1248
+ query?: never;
1249
+ header?: never;
1250
+ path: {
1251
+ /** @description The username. */
1252
+ userName: components["parameters"]["UserNamePathParameter"];
1253
+ };
1254
+ cookie?: never;
1255
+ };
1256
+ /** @description New password details */
1257
+ requestBody: {
1258
+ content: {
1259
+ "application/json": components["schemas"]["UpdatePasswordRequest"];
1260
+ };
1261
+ };
1262
+ responses: {
1263
+ /** @description Password updated successfully */
1264
+ 200: {
1265
+ headers: {
1266
+ [name: string]: unknown;
1267
+ };
1268
+ content: {
1269
+ "application/json": components["schemas"]["SuccessMessage"];
1270
+ };
1271
+ };
1272
+ /** @description Bad Request (e.g., new password empty, username required) */
1273
+ 400: {
1274
+ headers: {
1275
+ [name: string]: unknown;
1276
+ };
1277
+ content: {
1278
+ "application/json": components["schemas"]["Error"];
1279
+ };
1280
+ };
1281
+ /** @description User not found */
1282
+ 404: {
1283
+ headers: {
1284
+ [name: string]: unknown;
1285
+ };
1286
+ content: {
1287
+ "application/json": components["schemas"]["Error"];
1288
+ };
1289
+ };
1290
+ /** @description Internal Server Error */
1291
+ 500: {
1292
+ headers: {
1293
+ [name: string]: unknown;
1294
+ };
1295
+ content: {
1296
+ "application/json": components["schemas"]["Error"];
1297
+ };
1298
+ };
1299
+ };
1300
+ };
1301
+ getUserPermissions: {
1302
+ parameters: {
1303
+ query?: never;
1304
+ header?: never;
1305
+ path: {
1306
+ /** @description The username. */
1307
+ userName: components["parameters"]["UserNamePathParameter"];
1308
+ };
1309
+ cookie?: never;
1310
+ };
1311
+ requestBody?: never;
1312
+ responses: {
1313
+ /** @description Successful operation */
1314
+ 200: {
1315
+ headers: {
1316
+ [name: string]: unknown;
1317
+ };
1318
+ content: {
1319
+ "application/json": components["schemas"]["Permission"][];
1320
+ };
1321
+ };
1322
+ /** @description Bad Request (e.g., username is required) */
1323
+ 400: {
1324
+ headers: {
1325
+ [name: string]: unknown;
1326
+ };
1327
+ content: {
1328
+ "application/json": components["schemas"]["Error"];
1329
+ };
1330
+ };
1331
+ /** @description User not found */
1332
+ 404: {
1333
+ headers: {
1334
+ [name: string]: unknown;
1335
+ };
1336
+ content: {
1337
+ "application/json": components["schemas"]["Error"];
1338
+ };
1339
+ };
1340
+ /** @description Internal Server Error */
1341
+ 500: {
1342
+ headers: {
1343
+ [name: string]: unknown;
1344
+ };
1345
+ content: {
1346
+ "application/json": components["schemas"]["Error"];
1347
+ };
1348
+ };
1349
+ };
1350
+ };
1351
+ addPermissionToUser: {
1352
+ parameters: {
1353
+ query?: never;
1354
+ header?: never;
1355
+ path: {
1356
+ /** @description The username. */
1357
+ userName: components["parameters"]["UserNamePathParameter"];
1358
+ };
1359
+ cookie?: never;
1360
+ };
1361
+ /** @description Permission details to add */
1362
+ requestBody: {
1363
+ content: {
1364
+ "application/json": components["schemas"]["Permission"];
1365
+ };
1366
+ };
1367
+ responses: {
1368
+ /** @description Permission added successfully */
1369
+ 201: {
1370
+ headers: {
1371
+ [name: string]: unknown;
1372
+ };
1373
+ content: {
1374
+ "application/json": components["schemas"]["SuccessMessage"];
1375
+ };
1376
+ };
1377
+ /** @description Bad Request (e.g., invalid input, username required) */
1378
+ 400: {
1379
+ headers: {
1380
+ [name: string]: unknown;
1381
+ };
1382
+ content: {
1383
+ "application/json": components["schemas"]["Error"];
1384
+ };
1385
+ };
1386
+ /** @description User not found */
1387
+ 404: {
1388
+ headers: {
1389
+ [name: string]: unknown;
1390
+ };
1391
+ content: {
1392
+ "application/json": components["schemas"]["Error"];
1393
+ };
1394
+ };
1395
+ /** @description Internal Server Error */
1396
+ 500: {
1397
+ headers: {
1398
+ [name: string]: unknown;
1399
+ };
1400
+ content: {
1401
+ "application/json": components["schemas"]["Error"];
1402
+ };
1403
+ };
1404
+ };
1405
+ };
1406
+ removePermissionFromUser: {
1407
+ parameters: {
1408
+ query: {
1409
+ /** @description The name of the resource for the permission to be removed. */
1410
+ resource: string;
1411
+ /** @description The type of the resource for the permission to be removed. */
1412
+ resourceType: components["schemas"]["ResourceType"];
1413
+ };
1414
+ header?: never;
1415
+ path: {
1416
+ /** @description The username. */
1417
+ userName: components["parameters"]["UserNamePathParameter"];
1418
+ };
1419
+ cookie?: never;
1420
+ };
1421
+ requestBody?: never;
1422
+ responses: {
1423
+ /** @description Permission removed successfully */
1424
+ 204: {
1425
+ headers: {
1426
+ [name: string]: unknown;
1427
+ };
1428
+ content?: never;
1429
+ };
1430
+ /** @description Bad Request (e.g., missing query parameters, invalid resourceType, username required) */
1431
+ 400: {
1432
+ headers: {
1433
+ [name: string]: unknown;
1434
+ };
1435
+ content: {
1436
+ "application/json": components["schemas"]["Error"];
1437
+ };
1438
+ };
1439
+ /** @description User not found or Role not found for the given resource */
1440
+ 404: {
1441
+ headers: {
1442
+ [name: string]: unknown;
1443
+ };
1444
+ content: {
1445
+ "application/json": components["schemas"]["Error"];
1446
+ };
1447
+ };
1448
+ /** @description Internal Server Error */
1449
+ 500: {
1450
+ headers: {
1451
+ [name: string]: unknown;
1452
+ };
1453
+ content: {
1454
+ "application/json": components["schemas"]["Error"];
1455
+ };
1456
+ };
1457
+ };
1458
+ };
1459
+ }
1460
+
1461
+ /**
1462
+ * Type exports and utilities for the Antfly SDK
1463
+ * Re-exports commonly used types from the generated OpenAPI types
1464
+ */
1465
+
1466
+ type QueryRequest = components["schemas"]["QueryRequest"];
1467
+ type QueryResult = components["schemas"]["QueryResult"];
1468
+ type QueryHit = components["schemas"]["QueryHit"];
1469
+ interface BatchRequest {
1470
+ inserts?: Record<string, unknown>;
1471
+ deletes?: string[];
1472
+ }
1473
+ type Table = components["schemas"]["Table"];
1474
+ type CreateTableRequest = components["schemas"]["CreateTableRequest"];
1475
+ type TableSchema = components["schemas"]["TableSchema"];
1476
+ type TableStatus = components["schemas"]["TableStatus"];
1477
+ type IndexConfig = components["schemas"]["IndexConfig"];
1478
+ type IndexStatus = components["schemas"]["IndexStatus"];
1479
+ type CreateIndexRequest = components["schemas"]["CreateIndexRequest"];
1480
+ type User = components["schemas"]["User"];
1481
+ type CreateUserRequest = components["schemas"]["CreateUserRequest"];
1482
+ type UpdatePasswordRequest = components["schemas"]["UpdatePasswordRequest"];
1483
+ type Permission = components["schemas"]["Permission"];
1484
+ type ResourceType = components["schemas"]["ResourceType"];
1485
+ type PermissionType = components["schemas"]["PermissionType"];
1486
+ type BackupRequest = components["schemas"]["BackupRequest"];
1487
+ type RestoreRequest = components["schemas"]["RestoreRequest"];
1488
+ type ValueType = components["schemas"]["ValueType"];
1489
+ type ValueSchema = components["schemas"]["ValueSchema"];
1490
+ type DocumentSchema = components["schemas"]["DocumentSchema"];
1491
+ type FacetOption = components["schemas"]["FacetOption"];
1492
+ type FacetResult = components["schemas"]["FacetResult"];
1493
+ type Reranker = components["schemas"]["Reranker"];
1494
+ type AntflyError = components["schemas"]["Error"];
1495
+ type ResponseData<T extends keyof operations> = operations[T]["responses"] extends {
1496
+ 200: infer R;
1497
+ } ? R extends {
1498
+ content: {
1499
+ "application/json": infer D;
1500
+ };
1501
+ } ? D : never : never;
1502
+ interface AntflyConfig {
1503
+ baseUrl: string;
1504
+ headers?: Record<string, string>;
1505
+ auth?: {
1506
+ username: string;
1507
+ password: string;
1508
+ };
1509
+ }
1510
+ interface QueryOptions {
1511
+ table?: string;
1512
+ fullTextSearch?: Record<string, unknown>;
1513
+ semanticSearch?: string;
1514
+ limit?: number;
1515
+ offset?: number;
1516
+ fields?: string[];
1517
+ orderBy?: Record<string, boolean>;
1518
+ facets?: Record<string, FacetOption>;
1519
+ }
1520
+
1521
+ declare class AntflyClient {
1522
+ private client;
1523
+ private config;
1524
+ constructor(config: AntflyConfig);
1525
+ /**
1526
+ * Update authentication credentials
1527
+ */
1528
+ setAuth(username: string, password: string): void;
1529
+ /**
1530
+ * Global query operations
1531
+ */
1532
+ query(request: QueryRequest): Promise<QueryResult | undefined>;
1533
+ /**
1534
+ * Table operations
1535
+ */
1536
+ tables: {
1537
+ /**
1538
+ * List all tables
1539
+ */
1540
+ list: () => Promise<{
1541
+ name: string;
1542
+ indexes: {
1543
+ [key: string]: components["schemas"]["IndexConfig"];
1544
+ };
1545
+ shards: {
1546
+ [key: string]:
1547
+ /**
1548
+ * Get the underlying OpenAPI client for advanced use cases
1549
+ */
1550
+ components["schemas"]["ShardConfig"];
1551
+ };
1552
+ schema?: components["schemas"]["TableSchema"];
1553
+ }[]>;
1554
+ /**
1555
+ * Get table details and status
1556
+ */
1557
+ get: (tableName: string) => Promise<unknown>;
1558
+ /**
1559
+ * Create a new table
1560
+ */
1561
+ create: (tableName: string, config?: CreateTableRequest) => Promise<{
1562
+ name: string;
1563
+ indexes: {
1564
+ [key: string]: components["schemas"]["IndexConfig"];
1565
+ };
1566
+ shards: {
1567
+ [key: string]:
1568
+ /**
1569
+ * Get the underlying OpenAPI client for advanced use cases
1570
+ */
1571
+ components["schemas"]["ShardConfig"];
1572
+ };
1573
+ schema?: components["schemas"]["TableSchema"];
1574
+ }>;
1575
+ /**
1576
+ * Drop a table
1577
+ */
1578
+ drop: (tableName: string) => Promise<boolean>;
1579
+ /**
1580
+ * Query a specific table
1581
+ */
1582
+ query: (tableName: string, request: QueryRequest) => Promise<{
1583
+ hits?: components["schemas"]["QueryHits"];
1584
+ facets?: {
1585
+ [key: string]: components["schemas"]["FacetResult"];
1586
+ };
1587
+ took: number;
1588
+ status: number;
1589
+ error?: string;
1590
+ }>;
1591
+ /**
1592
+ * Perform batch operations on a table
1593
+ */
1594
+ batch: (tableName: string, request: BatchRequest) => Promise<{
1595
+ batch?: string;
1596
+ }>;
1597
+ /**
1598
+ * Backup a table
1599
+ */
1600
+ backup: (tableName: string, request: BackupRequest) => Promise<{
1601
+ backup?: string;
1602
+ }>;
1603
+ /**
1604
+ * Restore a table from backup
1605
+ */
1606
+ restore: (tableName: string, request: RestoreRequest) => Promise<{
1607
+ restore?: string;
1608
+ }>;
1609
+ /**
1610
+ * Lookup a specific key in a table
1611
+ */
1612
+ lookup: (tableName: string, key: string) => Promise<{
1613
+ [key: string]: unknown;
1614
+ }>;
1615
+ };
1616
+ /**
1617
+ * Index operations
1618
+ */
1619
+ indexes: {
1620
+ /**
1621
+ * List all indexes for a table
1622
+ */
1623
+ list: (tableName: string) => Promise<unknown[]>;
1624
+ /**
1625
+ * Get index details
1626
+ */
1627
+ get: (tableName: string, indexName: string) => Promise<unknown>;
1628
+ /**
1629
+ * Create a new index
1630
+ */
1631
+ create: (tableName: string, indexName: string, config: CreateIndexRequest) => Promise<boolean>;
1632
+ /**
1633
+ * Drop an index
1634
+ */
1635
+ drop: (tableName: string, indexName: string) => Promise<boolean>;
1636
+ };
1637
+ /**
1638
+ * User management operations
1639
+ */
1640
+ users: {
1641
+ /**
1642
+ * Get user details
1643
+ */
1644
+ get: (userName: string) => Promise<{
1645
+ username: string;
1646
+ password_hash: string;
1647
+ }>;
1648
+ /**
1649
+ * Create a new user
1650
+ */
1651
+ create: (userName: string, request: CreateUserRequest) => Promise<{
1652
+ username: string;
1653
+ password_hash: string;
1654
+ }>;
1655
+ /**
1656
+ * Delete a user
1657
+ */
1658
+ delete: (userName: string) => Promise<boolean>;
1659
+ /**
1660
+ * Update user password
1661
+ */
1662
+ updatePassword: (userName: string, newPassword: string) => Promise<{
1663
+ message?: string;
1664
+ }>;
1665
+ /**
1666
+ * Get user permissions
1667
+ */
1668
+ getPermissions: (userName: string) => Promise<{
1669
+ resource: string;
1670
+ resource_type: components["schemas"]["ResourceType"];
1671
+ type: components["schemas"]["PermissionType"];
1672
+ }[]>;
1673
+ /**
1674
+ * Add permission to user
1675
+ */
1676
+ addPermission: (userName: string, permission: Permission) => Promise<{
1677
+ message?: string;
1678
+ }>;
1679
+ /**
1680
+ * Remove permission from user
1681
+ */
1682
+ removePermission: (userName: string, resource: string, resourceType: ResourceType) => Promise<boolean>;
1683
+ };
1684
+ /**
1685
+ * Get the underlying OpenAPI client for advanced use cases
1686
+ */
1687
+ getRawClient(): Client<paths, `${string}/${string}`>;
1688
+ }
1689
+
1690
+ /**
1691
+ * Antfly SDK for TypeScript
1692
+ *
1693
+ * A TypeScript SDK for interacting with the Antfly API, suitable for both
1694
+ * frontend and backend applications.
1695
+ *
1696
+ * @example
1697
+ * ```typescript
1698
+ * import { AntflyClient } from '@antfly/sdk';
1699
+ *
1700
+ * const client = new AntflyClient({
1701
+ * baseUrl: 'http://localhost:8080',
1702
+ * auth: {
1703
+ * username: 'admin',
1704
+ * password: 'password'
1705
+ * }
1706
+ * });
1707
+ *
1708
+ * // Query data
1709
+ * const results = await client.query({
1710
+ * table: 'products',
1711
+ * limit: 10
1712
+ * });
1713
+ *
1714
+ * // Create a table
1715
+ * await client.tables.create('products', {
1716
+ * num_shards: 3,
1717
+ * schema: {
1718
+ * key: 'id',
1719
+ * default_type: 'product'
1720
+ * }
1721
+ * });
1722
+ * ```
1723
+ */
1724
+
1725
+ export { AntflyClient, type AntflyConfig, type AntflyError, type BackupRequest, type BatchRequest, type CreateIndexRequest, type CreateTableRequest, type CreateUserRequest, type DocumentSchema, type FacetOption, type FacetResult, type IndexConfig, type IndexStatus, type Permission, type PermissionType, type QueryHit, type QueryOptions, type QueryRequest, type QueryResult, type Reranker, type ResourceType, type ResponseData, type RestoreRequest, type Table, type TableSchema, type TableStatus, type UpdatePasswordRequest, type User, type ValueSchema, type ValueType, type components, AntflyClient as default, type operations, type paths };