@permute/sdk 0.1.0

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,1757 @@
1
+ // This file is generated by scripts/generate-contract.ts. Do not edit.
2
+ export const publicApiRoutes = {
3
+ workspacesList: {
4
+ operationId: 'workspacesList',
5
+ method: 'GET',
6
+ path: '/v1/workspaces',
7
+ scope: 'organization',
8
+ bodySchema: null,
9
+ querySchema: null,
10
+ responseSchema: {
11
+ type: 'object',
12
+ properties: {
13
+ items: {
14
+ type: 'array',
15
+ items: {
16
+ type: 'object',
17
+ properties: {
18
+ id: {
19
+ type: 'string',
20
+ },
21
+ organizationId: {
22
+ type: 'string',
23
+ },
24
+ name: {
25
+ type: 'string',
26
+ },
27
+ context: {
28
+ type: 'string',
29
+ },
30
+ visibility: {
31
+ type: 'string',
32
+ enum: ['private', 'internal', 'public', 'unlisted'],
33
+ },
34
+ createdAt: {
35
+ type: 'string',
36
+ format: 'date-time',
37
+ },
38
+ updatedAt: {
39
+ type: 'string',
40
+ format: 'date-time',
41
+ },
42
+ },
43
+ required: ['id', 'organizationId', 'name', 'context', 'visibility', 'createdAt', 'updatedAt'],
44
+ additionalProperties: false,
45
+ },
46
+ },
47
+ },
48
+ required: ['items'],
49
+ additionalProperties: false,
50
+ },
51
+ },
52
+ workspacesCreate: {
53
+ operationId: 'workspacesCreate',
54
+ method: 'POST',
55
+ path: '/v1/workspaces',
56
+ scope: 'organization',
57
+ bodySchema: {
58
+ type: 'object',
59
+ properties: {
60
+ name: {
61
+ type: 'string',
62
+ minLength: 1,
63
+ maxLength: 255,
64
+ },
65
+ context: {
66
+ type: 'string',
67
+ maxLength: 10000,
68
+ },
69
+ },
70
+ required: ['name'],
71
+ additionalProperties: false,
72
+ },
73
+ querySchema: null,
74
+ responseSchema: {
75
+ type: 'object',
76
+ properties: {
77
+ id: {
78
+ type: 'string',
79
+ },
80
+ organizationId: {
81
+ type: 'string',
82
+ },
83
+ name: {
84
+ type: 'string',
85
+ },
86
+ context: {
87
+ type: 'string',
88
+ },
89
+ visibility: {
90
+ type: 'string',
91
+ enum: ['private', 'internal', 'public', 'unlisted'],
92
+ },
93
+ createdAt: {
94
+ type: 'string',
95
+ format: 'date-time',
96
+ },
97
+ updatedAt: {
98
+ type: 'string',
99
+ format: 'date-time',
100
+ },
101
+ },
102
+ required: ['id', 'organizationId', 'name', 'context', 'visibility', 'createdAt', 'updatedAt'],
103
+ additionalProperties: false,
104
+ },
105
+ },
106
+ workspacesGet: {
107
+ operationId: 'workspacesGet',
108
+ method: 'GET',
109
+ path: '/v1/workspaces/{workspaceId}',
110
+ scope: 'organization',
111
+ bodySchema: null,
112
+ querySchema: null,
113
+ responseSchema: {
114
+ type: 'object',
115
+ properties: {
116
+ id: {
117
+ type: 'string',
118
+ },
119
+ organizationId: {
120
+ type: 'string',
121
+ },
122
+ name: {
123
+ type: 'string',
124
+ },
125
+ context: {
126
+ type: 'string',
127
+ },
128
+ visibility: {
129
+ type: 'string',
130
+ enum: ['private', 'internal', 'public', 'unlisted'],
131
+ },
132
+ createdAt: {
133
+ type: 'string',
134
+ format: 'date-time',
135
+ },
136
+ updatedAt: {
137
+ type: 'string',
138
+ format: 'date-time',
139
+ },
140
+ },
141
+ required: ['id', 'organizationId', 'name', 'context', 'visibility', 'createdAt', 'updatedAt'],
142
+ additionalProperties: false,
143
+ },
144
+ },
145
+ workspacesUpdate: {
146
+ operationId: 'workspacesUpdate',
147
+ method: 'PATCH',
148
+ path: '/v1/workspaces/{workspaceId}',
149
+ scope: 'organization',
150
+ bodySchema: {
151
+ type: 'object',
152
+ properties: {
153
+ name: {
154
+ type: 'string',
155
+ minLength: 1,
156
+ maxLength: 255,
157
+ },
158
+ context: {
159
+ type: 'string',
160
+ maxLength: 10000,
161
+ },
162
+ },
163
+ additionalProperties: false,
164
+ },
165
+ querySchema: null,
166
+ responseSchema: {
167
+ type: 'object',
168
+ properties: {
169
+ id: {
170
+ type: 'string',
171
+ },
172
+ organizationId: {
173
+ type: 'string',
174
+ },
175
+ name: {
176
+ type: 'string',
177
+ },
178
+ context: {
179
+ type: 'string',
180
+ },
181
+ visibility: {
182
+ type: 'string',
183
+ enum: ['private', 'internal', 'public', 'unlisted'],
184
+ },
185
+ createdAt: {
186
+ type: 'string',
187
+ format: 'date-time',
188
+ },
189
+ updatedAt: {
190
+ type: 'string',
191
+ format: 'date-time',
192
+ },
193
+ },
194
+ required: ['id', 'organizationId', 'name', 'context', 'visibility', 'createdAt', 'updatedAt'],
195
+ additionalProperties: false,
196
+ },
197
+ },
198
+ workspacesDelete: {
199
+ operationId: 'workspacesDelete',
200
+ method: 'DELETE',
201
+ path: '/v1/workspaces/{workspaceId}',
202
+ scope: 'organization',
203
+ bodySchema: null,
204
+ querySchema: null,
205
+ responseSchema: {
206
+ type: 'object',
207
+ properties: {
208
+ id: {
209
+ type: 'string',
210
+ },
211
+ deleted: {
212
+ type: 'boolean',
213
+ enum: [true],
214
+ },
215
+ },
216
+ required: ['id', 'deleted'],
217
+ additionalProperties: false,
218
+ },
219
+ },
220
+ sourcesList: {
221
+ operationId: 'sourcesList',
222
+ method: 'GET',
223
+ path: '/v1/sources',
224
+ scope: 'workspace',
225
+ bodySchema: null,
226
+ querySchema: null,
227
+ responseSchema: {
228
+ type: 'object',
229
+ properties: {
230
+ items: {
231
+ type: 'array',
232
+ items: {
233
+ type: 'object',
234
+ properties: {
235
+ id: {
236
+ type: 'string',
237
+ },
238
+ type: {
239
+ type: 'string',
240
+ enum: ['dataset', 'connector'],
241
+ },
242
+ name: {
243
+ type: 'string',
244
+ },
245
+ provider: {
246
+ type: 'string',
247
+ },
248
+ context: {
249
+ type: 'array',
250
+ items: {
251
+ type: 'string',
252
+ },
253
+ },
254
+ summary: {
255
+ type: 'string',
256
+ nullable: true,
257
+ },
258
+ fileType: {
259
+ type: 'string',
260
+ },
261
+ },
262
+ required: ['id', 'type', 'name'],
263
+ additionalProperties: false,
264
+ },
265
+ },
266
+ },
267
+ required: ['items'],
268
+ additionalProperties: false,
269
+ },
270
+ },
271
+ sourcesGet: {
272
+ operationId: 'sourcesGet',
273
+ method: 'GET',
274
+ path: '/v1/sources/{sourceId}',
275
+ scope: 'workspace',
276
+ bodySchema: null,
277
+ querySchema: null,
278
+ responseSchema: {
279
+ type: 'object',
280
+ properties: {
281
+ source: {
282
+ type: 'object',
283
+ properties: {
284
+ id: {
285
+ type: 'string',
286
+ },
287
+ type: {
288
+ type: 'string',
289
+ enum: ['dataset', 'connector'],
290
+ },
291
+ name: {
292
+ type: 'string',
293
+ },
294
+ provider: {
295
+ type: 'string',
296
+ },
297
+ context: {
298
+ type: 'array',
299
+ items: {
300
+ type: 'string',
301
+ },
302
+ },
303
+ summary: {
304
+ type: 'string',
305
+ nullable: true,
306
+ },
307
+ fileType: {
308
+ type: 'string',
309
+ },
310
+ },
311
+ required: ['id', 'type', 'name'],
312
+ additionalProperties: false,
313
+ },
314
+ metadata: {
315
+ type: 'object',
316
+ additionalProperties: {},
317
+ },
318
+ tables: {
319
+ type: 'array',
320
+ items: {
321
+ type: 'object',
322
+ properties: {
323
+ id: {
324
+ type: 'string',
325
+ },
326
+ name: {
327
+ type: 'string',
328
+ },
329
+ label: {
330
+ type: 'string',
331
+ },
332
+ provider: {
333
+ type: 'string',
334
+ },
335
+ fieldCount: {
336
+ type: 'integer',
337
+ minimum: 0,
338
+ },
339
+ fields: {
340
+ type: 'array',
341
+ items: {
342
+ type: 'object',
343
+ properties: {
344
+ name: {
345
+ type: 'string',
346
+ },
347
+ type: {
348
+ type: 'string',
349
+ nullable: true,
350
+ },
351
+ description: {
352
+ type: 'string',
353
+ nullable: true,
354
+ },
355
+ nullable: {
356
+ type: 'boolean',
357
+ nullable: true,
358
+ },
359
+ isPrimaryKey: {
360
+ type: 'boolean',
361
+ nullable: true,
362
+ },
363
+ },
364
+ required: ['name'],
365
+ additionalProperties: false,
366
+ },
367
+ },
368
+ },
369
+ required: ['id', 'name'],
370
+ additionalProperties: false,
371
+ },
372
+ },
373
+ },
374
+ required: ['source', 'tables'],
375
+ additionalProperties: false,
376
+ },
377
+ },
378
+ datasetsCreate: {
379
+ operationId: 'datasetsCreate',
380
+ method: 'POST',
381
+ path: '/v1/datasets',
382
+ scope: 'workspace',
383
+ bodySchema: {
384
+ anyOf: [
385
+ {
386
+ type: 'object',
387
+ properties: {
388
+ type: {
389
+ type: 'string',
390
+ enum: ['custom'],
391
+ },
392
+ key: {
393
+ type: 'string',
394
+ minLength: 1,
395
+ maxLength: 128,
396
+ pattern: '^[a-zA-Z0-9][a-zA-Z0-9._:-]*$',
397
+ },
398
+ name: {
399
+ type: 'string',
400
+ minLength: 1,
401
+ maxLength: 1024,
402
+ },
403
+ context: {
404
+ type: 'array',
405
+ items: {
406
+ type: 'string',
407
+ minLength: 1,
408
+ maxLength: 64,
409
+ },
410
+ maxItems: 20,
411
+ },
412
+ },
413
+ required: ['type', 'key'],
414
+ additionalProperties: false,
415
+ },
416
+ {
417
+ type: 'object',
418
+ properties: {
419
+ type: {
420
+ type: 'string',
421
+ enum: ['file'],
422
+ },
423
+ fileName: {
424
+ type: 'string',
425
+ minLength: 1,
426
+ maxLength: 1024,
427
+ },
428
+ contentType: {
429
+ type: 'string',
430
+ minLength: 1,
431
+ maxLength: 1024,
432
+ },
433
+ sizeBytes: {
434
+ type: 'integer',
435
+ exclusiveMinimum: 0,
436
+ },
437
+ },
438
+ required: ['type', 'fileName', 'contentType', 'sizeBytes'],
439
+ additionalProperties: false,
440
+ },
441
+ ],
442
+ },
443
+ querySchema: null,
444
+ responseSchema: {
445
+ anyOf: [
446
+ {
447
+ type: 'object',
448
+ properties: {
449
+ type: {
450
+ type: 'string',
451
+ enum: ['custom'],
452
+ },
453
+ id: {
454
+ type: 'string',
455
+ },
456
+ sourceId: {
457
+ type: 'string',
458
+ },
459
+ key: {
460
+ type: 'string',
461
+ },
462
+ name: {
463
+ type: 'string',
464
+ },
465
+ context: {
466
+ type: 'array',
467
+ items: {
468
+ type: 'string',
469
+ },
470
+ },
471
+ status: {
472
+ type: 'string',
473
+ enum: ['pending', 'uploaded', 'processing', 'completed', 'failed'],
474
+ },
475
+ version: {
476
+ type: 'integer',
477
+ minimum: 0,
478
+ },
479
+ tables: {
480
+ type: 'array',
481
+ items: {
482
+ type: 'object',
483
+ properties: {
484
+ name: {
485
+ type: 'string',
486
+ },
487
+ rowCount: {
488
+ type: 'integer',
489
+ minimum: 0,
490
+ },
491
+ columnCount: {
492
+ type: 'integer',
493
+ minimum: 0,
494
+ },
495
+ },
496
+ required: ['name', 'rowCount', 'columnCount'],
497
+ additionalProperties: false,
498
+ },
499
+ },
500
+ write: {
501
+ type: 'object',
502
+ properties: {
503
+ id: {
504
+ type: 'string',
505
+ },
506
+ status: {
507
+ type: 'string',
508
+ enum: ['pending', 'processing', 'completed', 'failed'],
509
+ },
510
+ error: {
511
+ type: 'string',
512
+ },
513
+ },
514
+ required: ['id', 'status'],
515
+ additionalProperties: false,
516
+ },
517
+ createdAt: {
518
+ type: 'string',
519
+ format: 'date-time',
520
+ },
521
+ updatedAt: {
522
+ type: 'string',
523
+ format: 'date-time',
524
+ },
525
+ },
526
+ required: [
527
+ 'type',
528
+ 'id',
529
+ 'sourceId',
530
+ 'key',
531
+ 'name',
532
+ 'context',
533
+ 'status',
534
+ 'version',
535
+ 'tables',
536
+ 'createdAt',
537
+ 'updatedAt',
538
+ ],
539
+ additionalProperties: false,
540
+ },
541
+ {
542
+ type: 'object',
543
+ properties: {
544
+ type: {
545
+ type: 'string',
546
+ enum: ['file'],
547
+ },
548
+ id: {
549
+ type: 'string',
550
+ },
551
+ sourceId: {
552
+ type: 'string',
553
+ },
554
+ name: {
555
+ type: 'string',
556
+ },
557
+ status: {
558
+ type: 'string',
559
+ enum: ['pending', 'uploaded', 'processing', 'completed', 'failed'],
560
+ },
561
+ contentType: {
562
+ type: 'string',
563
+ },
564
+ sizeBytes: {
565
+ type: 'integer',
566
+ exclusiveMinimum: 0,
567
+ },
568
+ createdAt: {
569
+ type: 'string',
570
+ format: 'date-time',
571
+ },
572
+ updatedAt: {
573
+ type: 'string',
574
+ format: 'date-time',
575
+ },
576
+ progress: {
577
+ type: 'object',
578
+ properties: {
579
+ percent: {
580
+ type: 'number',
581
+ minimum: 0,
582
+ maximum: 100,
583
+ },
584
+ step: {
585
+ type: 'string',
586
+ },
587
+ stepLabel: {
588
+ type: 'string',
589
+ },
590
+ details: {
591
+ type: 'string',
592
+ },
593
+ },
594
+ required: ['percent'],
595
+ additionalProperties: false,
596
+ },
597
+ error: {
598
+ type: 'string',
599
+ },
600
+ upload: {
601
+ type: 'object',
602
+ properties: {
603
+ method: {
604
+ type: 'string',
605
+ enum: ['PUT'],
606
+ },
607
+ url: {
608
+ type: 'string',
609
+ format: 'uri',
610
+ },
611
+ headers: {
612
+ type: 'object',
613
+ additionalProperties: {
614
+ type: 'string',
615
+ },
616
+ },
617
+ expiresAt: {
618
+ type: 'string',
619
+ format: 'date-time',
620
+ },
621
+ },
622
+ required: ['method', 'url', 'headers', 'expiresAt'],
623
+ additionalProperties: false,
624
+ },
625
+ },
626
+ required: ['type', 'id', 'sourceId', 'name', 'status', 'contentType', 'sizeBytes', 'createdAt', 'updatedAt'],
627
+ additionalProperties: false,
628
+ },
629
+ ],
630
+ },
631
+ },
632
+ datasetsGetByKey: {
633
+ operationId: 'datasetsGetByKey',
634
+ method: 'GET',
635
+ path: '/v1/datasets',
636
+ scope: 'workspace',
637
+ bodySchema: null,
638
+ querySchema: {
639
+ type: 'object',
640
+ properties: {
641
+ key: {
642
+ type: 'string',
643
+ minLength: 1,
644
+ maxLength: 128,
645
+ pattern: '^[a-zA-Z0-9][a-zA-Z0-9._:-]*$',
646
+ },
647
+ },
648
+ required: ['key'],
649
+ additionalProperties: false,
650
+ },
651
+ responseSchema: {
652
+ anyOf: [
653
+ {
654
+ type: 'object',
655
+ properties: {
656
+ type: {
657
+ type: 'string',
658
+ enum: ['custom'],
659
+ },
660
+ id: {
661
+ type: 'string',
662
+ },
663
+ sourceId: {
664
+ type: 'string',
665
+ },
666
+ key: {
667
+ type: 'string',
668
+ },
669
+ name: {
670
+ type: 'string',
671
+ },
672
+ context: {
673
+ type: 'array',
674
+ items: {
675
+ type: 'string',
676
+ },
677
+ },
678
+ status: {
679
+ type: 'string',
680
+ enum: ['pending', 'uploaded', 'processing', 'completed', 'failed'],
681
+ },
682
+ version: {
683
+ type: 'integer',
684
+ minimum: 0,
685
+ },
686
+ tables: {
687
+ type: 'array',
688
+ items: {
689
+ type: 'object',
690
+ properties: {
691
+ name: {
692
+ type: 'string',
693
+ },
694
+ rowCount: {
695
+ type: 'integer',
696
+ minimum: 0,
697
+ },
698
+ columnCount: {
699
+ type: 'integer',
700
+ minimum: 0,
701
+ },
702
+ },
703
+ required: ['name', 'rowCount', 'columnCount'],
704
+ additionalProperties: false,
705
+ },
706
+ },
707
+ write: {
708
+ type: 'object',
709
+ properties: {
710
+ id: {
711
+ type: 'string',
712
+ },
713
+ status: {
714
+ type: 'string',
715
+ enum: ['pending', 'processing', 'completed', 'failed'],
716
+ },
717
+ error: {
718
+ type: 'string',
719
+ },
720
+ },
721
+ required: ['id', 'status'],
722
+ additionalProperties: false,
723
+ },
724
+ createdAt: {
725
+ type: 'string',
726
+ format: 'date-time',
727
+ },
728
+ updatedAt: {
729
+ type: 'string',
730
+ format: 'date-time',
731
+ },
732
+ },
733
+ required: [
734
+ 'type',
735
+ 'id',
736
+ 'sourceId',
737
+ 'key',
738
+ 'name',
739
+ 'context',
740
+ 'status',
741
+ 'version',
742
+ 'tables',
743
+ 'createdAt',
744
+ 'updatedAt',
745
+ ],
746
+ additionalProperties: false,
747
+ },
748
+ {
749
+ type: 'object',
750
+ properties: {
751
+ type: {
752
+ type: 'string',
753
+ enum: ['file'],
754
+ },
755
+ id: {
756
+ type: 'string',
757
+ },
758
+ sourceId: {
759
+ type: 'string',
760
+ },
761
+ name: {
762
+ type: 'string',
763
+ },
764
+ status: {
765
+ type: 'string',
766
+ enum: ['pending', 'uploaded', 'processing', 'completed', 'failed'],
767
+ },
768
+ contentType: {
769
+ type: 'string',
770
+ },
771
+ sizeBytes: {
772
+ type: 'integer',
773
+ exclusiveMinimum: 0,
774
+ },
775
+ createdAt: {
776
+ type: 'string',
777
+ format: 'date-time',
778
+ },
779
+ updatedAt: {
780
+ type: 'string',
781
+ format: 'date-time',
782
+ },
783
+ progress: {
784
+ type: 'object',
785
+ properties: {
786
+ percent: {
787
+ type: 'number',
788
+ minimum: 0,
789
+ maximum: 100,
790
+ },
791
+ step: {
792
+ type: 'string',
793
+ },
794
+ stepLabel: {
795
+ type: 'string',
796
+ },
797
+ details: {
798
+ type: 'string',
799
+ },
800
+ },
801
+ required: ['percent'],
802
+ additionalProperties: false,
803
+ },
804
+ error: {
805
+ type: 'string',
806
+ },
807
+ upload: {
808
+ type: 'object',
809
+ properties: {
810
+ method: {
811
+ type: 'string',
812
+ enum: ['PUT'],
813
+ },
814
+ url: {
815
+ type: 'string',
816
+ format: 'uri',
817
+ },
818
+ headers: {
819
+ type: 'object',
820
+ additionalProperties: {
821
+ type: 'string',
822
+ },
823
+ },
824
+ expiresAt: {
825
+ type: 'string',
826
+ format: 'date-time',
827
+ },
828
+ },
829
+ required: ['method', 'url', 'headers', 'expiresAt'],
830
+ additionalProperties: false,
831
+ },
832
+ },
833
+ required: ['type', 'id', 'sourceId', 'name', 'status', 'contentType', 'sizeBytes', 'createdAt', 'updatedAt'],
834
+ additionalProperties: false,
835
+ },
836
+ ],
837
+ },
838
+ },
839
+ datasetsGet: {
840
+ operationId: 'datasetsGet',
841
+ method: 'GET',
842
+ path: '/v1/datasets/{datasetId}',
843
+ scope: 'workspace',
844
+ bodySchema: null,
845
+ querySchema: null,
846
+ responseSchema: {
847
+ anyOf: [
848
+ {
849
+ type: 'object',
850
+ properties: {
851
+ type: {
852
+ type: 'string',
853
+ enum: ['custom'],
854
+ },
855
+ id: {
856
+ type: 'string',
857
+ },
858
+ sourceId: {
859
+ type: 'string',
860
+ },
861
+ key: {
862
+ type: 'string',
863
+ },
864
+ name: {
865
+ type: 'string',
866
+ },
867
+ context: {
868
+ type: 'array',
869
+ items: {
870
+ type: 'string',
871
+ },
872
+ },
873
+ status: {
874
+ type: 'string',
875
+ enum: ['pending', 'uploaded', 'processing', 'completed', 'failed'],
876
+ },
877
+ version: {
878
+ type: 'integer',
879
+ minimum: 0,
880
+ },
881
+ tables: {
882
+ type: 'array',
883
+ items: {
884
+ type: 'object',
885
+ properties: {
886
+ name: {
887
+ type: 'string',
888
+ },
889
+ rowCount: {
890
+ type: 'integer',
891
+ minimum: 0,
892
+ },
893
+ columnCount: {
894
+ type: 'integer',
895
+ minimum: 0,
896
+ },
897
+ },
898
+ required: ['name', 'rowCount', 'columnCount'],
899
+ additionalProperties: false,
900
+ },
901
+ },
902
+ write: {
903
+ type: 'object',
904
+ properties: {
905
+ id: {
906
+ type: 'string',
907
+ },
908
+ status: {
909
+ type: 'string',
910
+ enum: ['pending', 'processing', 'completed', 'failed'],
911
+ },
912
+ error: {
913
+ type: 'string',
914
+ },
915
+ },
916
+ required: ['id', 'status'],
917
+ additionalProperties: false,
918
+ },
919
+ createdAt: {
920
+ type: 'string',
921
+ format: 'date-time',
922
+ },
923
+ updatedAt: {
924
+ type: 'string',
925
+ format: 'date-time',
926
+ },
927
+ },
928
+ required: [
929
+ 'type',
930
+ 'id',
931
+ 'sourceId',
932
+ 'key',
933
+ 'name',
934
+ 'context',
935
+ 'status',
936
+ 'version',
937
+ 'tables',
938
+ 'createdAt',
939
+ 'updatedAt',
940
+ ],
941
+ additionalProperties: false,
942
+ },
943
+ {
944
+ type: 'object',
945
+ properties: {
946
+ type: {
947
+ type: 'string',
948
+ enum: ['file'],
949
+ },
950
+ id: {
951
+ type: 'string',
952
+ },
953
+ sourceId: {
954
+ type: 'string',
955
+ },
956
+ name: {
957
+ type: 'string',
958
+ },
959
+ status: {
960
+ type: 'string',
961
+ enum: ['pending', 'uploaded', 'processing', 'completed', 'failed'],
962
+ },
963
+ contentType: {
964
+ type: 'string',
965
+ },
966
+ sizeBytes: {
967
+ type: 'integer',
968
+ exclusiveMinimum: 0,
969
+ },
970
+ createdAt: {
971
+ type: 'string',
972
+ format: 'date-time',
973
+ },
974
+ updatedAt: {
975
+ type: 'string',
976
+ format: 'date-time',
977
+ },
978
+ progress: {
979
+ type: 'object',
980
+ properties: {
981
+ percent: {
982
+ type: 'number',
983
+ minimum: 0,
984
+ maximum: 100,
985
+ },
986
+ step: {
987
+ type: 'string',
988
+ },
989
+ stepLabel: {
990
+ type: 'string',
991
+ },
992
+ details: {
993
+ type: 'string',
994
+ },
995
+ },
996
+ required: ['percent'],
997
+ additionalProperties: false,
998
+ },
999
+ error: {
1000
+ type: 'string',
1001
+ },
1002
+ upload: {
1003
+ type: 'object',
1004
+ properties: {
1005
+ method: {
1006
+ type: 'string',
1007
+ enum: ['PUT'],
1008
+ },
1009
+ url: {
1010
+ type: 'string',
1011
+ format: 'uri',
1012
+ },
1013
+ headers: {
1014
+ type: 'object',
1015
+ additionalProperties: {
1016
+ type: 'string',
1017
+ },
1018
+ },
1019
+ expiresAt: {
1020
+ type: 'string',
1021
+ format: 'date-time',
1022
+ },
1023
+ },
1024
+ required: ['method', 'url', 'headers', 'expiresAt'],
1025
+ additionalProperties: false,
1026
+ },
1027
+ },
1028
+ required: ['type', 'id', 'sourceId', 'name', 'status', 'contentType', 'sizeBytes', 'createdAt', 'updatedAt'],
1029
+ additionalProperties: false,
1030
+ },
1031
+ ],
1032
+ },
1033
+ },
1034
+ datasetsWriteTables: {
1035
+ operationId: 'datasetsWriteTables',
1036
+ method: 'POST',
1037
+ path: '/v1/datasets/{datasetId}/tables',
1038
+ scope: 'workspace',
1039
+ bodySchema: {
1040
+ anyOf: [
1041
+ {
1042
+ type: 'object',
1043
+ properties: {
1044
+ tables: {
1045
+ type: 'array',
1046
+ items: {
1047
+ type: 'object',
1048
+ properties: {
1049
+ name: {
1050
+ type: 'string',
1051
+ minLength: 1,
1052
+ maxLength: 128,
1053
+ },
1054
+ rowCount: {
1055
+ type: 'integer',
1056
+ minimum: 0,
1057
+ maximum: 10000000,
1058
+ },
1059
+ },
1060
+ required: ['name', 'rowCount'],
1061
+ additionalProperties: false,
1062
+ },
1063
+ maxItems: 50,
1064
+ },
1065
+ sizeBytes: {
1066
+ type: 'integer',
1067
+ minimum: 0,
1068
+ maximum: 1073741824,
1069
+ },
1070
+ contentHash: {
1071
+ type: 'string',
1072
+ pattern: '^[a-f0-9]{64}$',
1073
+ },
1074
+ mode: {
1075
+ type: 'string',
1076
+ enum: ['replace'],
1077
+ },
1078
+ },
1079
+ required: ['tables', 'sizeBytes', 'contentHash', 'mode'],
1080
+ additionalProperties: false,
1081
+ },
1082
+ {
1083
+ type: 'object',
1084
+ properties: {
1085
+ tableName: {
1086
+ type: 'string',
1087
+ minLength: 1,
1088
+ maxLength: 128,
1089
+ },
1090
+ rowCount: {
1091
+ type: 'integer',
1092
+ minimum: 0,
1093
+ maximum: 10000000,
1094
+ },
1095
+ sizeBytes: {
1096
+ type: 'integer',
1097
+ minimum: 0,
1098
+ maximum: 1073741824,
1099
+ },
1100
+ contentHash: {
1101
+ type: 'string',
1102
+ pattern: '^[a-f0-9]{64}$',
1103
+ },
1104
+ mode: {
1105
+ type: 'string',
1106
+ enum: ['replaceTable'],
1107
+ },
1108
+ },
1109
+ required: ['tableName', 'rowCount', 'sizeBytes', 'contentHash', 'mode'],
1110
+ additionalProperties: false,
1111
+ },
1112
+ {
1113
+ type: 'object',
1114
+ properties: {
1115
+ tableName: {
1116
+ type: 'string',
1117
+ minLength: 1,
1118
+ maxLength: 128,
1119
+ },
1120
+ rowCount: {
1121
+ type: 'integer',
1122
+ minimum: 1,
1123
+ maximum: 10000,
1124
+ },
1125
+ batchId: {
1126
+ type: 'string',
1127
+ minLength: 1,
1128
+ maxLength: 128,
1129
+ },
1130
+ sizeBytes: {
1131
+ type: 'integer',
1132
+ minimum: 0,
1133
+ maximum: 1073741824,
1134
+ },
1135
+ contentHash: {
1136
+ type: 'string',
1137
+ pattern: '^[a-f0-9]{64}$',
1138
+ },
1139
+ mode: {
1140
+ type: 'string',
1141
+ enum: ['appendTable'],
1142
+ },
1143
+ },
1144
+ required: ['tableName', 'rowCount', 'batchId', 'sizeBytes', 'contentHash', 'mode'],
1145
+ additionalProperties: false,
1146
+ },
1147
+ ],
1148
+ },
1149
+ querySchema: null,
1150
+ responseSchema: {
1151
+ type: 'object',
1152
+ properties: {
1153
+ dataset: {
1154
+ type: 'object',
1155
+ properties: {
1156
+ type: {
1157
+ type: 'string',
1158
+ enum: ['custom'],
1159
+ },
1160
+ id: {
1161
+ type: 'string',
1162
+ },
1163
+ sourceId: {
1164
+ type: 'string',
1165
+ },
1166
+ key: {
1167
+ type: 'string',
1168
+ },
1169
+ name: {
1170
+ type: 'string',
1171
+ },
1172
+ context: {
1173
+ type: 'array',
1174
+ items: {
1175
+ type: 'string',
1176
+ },
1177
+ },
1178
+ status: {
1179
+ type: 'string',
1180
+ enum: ['pending', 'uploaded', 'processing', 'completed', 'failed'],
1181
+ },
1182
+ version: {
1183
+ type: 'integer',
1184
+ minimum: 0,
1185
+ },
1186
+ tables: {
1187
+ type: 'array',
1188
+ items: {
1189
+ type: 'object',
1190
+ properties: {
1191
+ name: {
1192
+ type: 'string',
1193
+ },
1194
+ rowCount: {
1195
+ type: 'integer',
1196
+ minimum: 0,
1197
+ },
1198
+ columnCount: {
1199
+ type: 'integer',
1200
+ minimum: 0,
1201
+ },
1202
+ },
1203
+ required: ['name', 'rowCount', 'columnCount'],
1204
+ additionalProperties: false,
1205
+ },
1206
+ },
1207
+ write: {
1208
+ type: 'object',
1209
+ properties: {
1210
+ id: {
1211
+ type: 'string',
1212
+ },
1213
+ status: {
1214
+ type: 'string',
1215
+ enum: ['pending', 'processing', 'completed', 'failed'],
1216
+ },
1217
+ error: {
1218
+ type: 'string',
1219
+ },
1220
+ },
1221
+ required: ['id', 'status'],
1222
+ additionalProperties: false,
1223
+ },
1224
+ createdAt: {
1225
+ type: 'string',
1226
+ format: 'date-time',
1227
+ },
1228
+ updatedAt: {
1229
+ type: 'string',
1230
+ format: 'date-time',
1231
+ },
1232
+ },
1233
+ required: [
1234
+ 'type',
1235
+ 'id',
1236
+ 'sourceId',
1237
+ 'key',
1238
+ 'name',
1239
+ 'context',
1240
+ 'status',
1241
+ 'version',
1242
+ 'tables',
1243
+ 'createdAt',
1244
+ 'updatedAt',
1245
+ ],
1246
+ additionalProperties: false,
1247
+ },
1248
+ write: {
1249
+ type: 'object',
1250
+ properties: {
1251
+ id: {
1252
+ type: 'string',
1253
+ },
1254
+ status: {
1255
+ type: 'string',
1256
+ enum: ['pending', 'processing', 'completed', 'failed'],
1257
+ },
1258
+ error: {
1259
+ type: 'string',
1260
+ },
1261
+ },
1262
+ required: ['id', 'status'],
1263
+ additionalProperties: false,
1264
+ },
1265
+ upload: {
1266
+ type: 'object',
1267
+ properties: {
1268
+ method: {
1269
+ type: 'string',
1270
+ enum: ['PUT'],
1271
+ },
1272
+ url: {
1273
+ type: 'string',
1274
+ format: 'uri',
1275
+ },
1276
+ headers: {
1277
+ type: 'object',
1278
+ additionalProperties: {
1279
+ type: 'string',
1280
+ },
1281
+ },
1282
+ expiresAt: {
1283
+ type: 'string',
1284
+ format: 'date-time',
1285
+ },
1286
+ },
1287
+ required: ['method', 'url', 'headers', 'expiresAt'],
1288
+ additionalProperties: false,
1289
+ },
1290
+ pollAfterMs: {
1291
+ type: 'integer',
1292
+ exclusiveMinimum: 0,
1293
+ },
1294
+ },
1295
+ required: ['dataset', 'write', 'pollAfterMs'],
1296
+ additionalProperties: false,
1297
+ },
1298
+ },
1299
+ searchCreate: {
1300
+ operationId: 'searchCreate',
1301
+ method: 'POST',
1302
+ path: '/v1/search',
1303
+ scope: 'workspace',
1304
+ bodySchema: {
1305
+ type: 'object',
1306
+ properties: {
1307
+ query: {
1308
+ type: 'string',
1309
+ minLength: 1,
1310
+ },
1311
+ sourceIds: {
1312
+ type: 'array',
1313
+ items: {
1314
+ type: 'string',
1315
+ minLength: 1,
1316
+ },
1317
+ minItems: 1,
1318
+ },
1319
+ types: {
1320
+ type: 'array',
1321
+ items: {
1322
+ type: 'string',
1323
+ enum: ['records', 'documents', 'tables', 'text_blocks'],
1324
+ },
1325
+ },
1326
+ limit: {
1327
+ type: 'integer',
1328
+ minimum: 1,
1329
+ maximum: 50,
1330
+ },
1331
+ rerank: {
1332
+ type: 'boolean',
1333
+ },
1334
+ },
1335
+ required: ['query'],
1336
+ additionalProperties: false,
1337
+ },
1338
+ querySchema: null,
1339
+ responseSchema: {
1340
+ type: 'object',
1341
+ properties: {
1342
+ items: {
1343
+ type: 'array',
1344
+ items: {
1345
+ type: 'object',
1346
+ properties: {
1347
+ type: {
1348
+ type: 'string',
1349
+ enum: ['record', 'document', 'table', 'text_block', 'unknown'],
1350
+ },
1351
+ sourceId: {
1352
+ type: 'string',
1353
+ },
1354
+ title: {
1355
+ type: 'string',
1356
+ },
1357
+ content: {
1358
+ type: 'string',
1359
+ },
1360
+ score: {
1361
+ type: 'number',
1362
+ },
1363
+ citation: {
1364
+ type: 'object',
1365
+ additionalProperties: {},
1366
+ },
1367
+ metadata: {
1368
+ type: 'object',
1369
+ additionalProperties: {},
1370
+ },
1371
+ },
1372
+ required: ['type', 'content'],
1373
+ additionalProperties: false,
1374
+ },
1375
+ },
1376
+ meta: {
1377
+ type: 'object',
1378
+ properties: {
1379
+ strategy: {
1380
+ type: 'string',
1381
+ enum: ['semantic'],
1382
+ },
1383
+ reranked: {
1384
+ type: 'boolean',
1385
+ },
1386
+ candidateCount: {
1387
+ type: 'integer',
1388
+ minimum: 0,
1389
+ },
1390
+ totalMs: {
1391
+ type: 'number',
1392
+ minimum: 0,
1393
+ },
1394
+ },
1395
+ required: ['strategy', 'reranked'],
1396
+ additionalProperties: false,
1397
+ },
1398
+ },
1399
+ required: ['items', 'meta'],
1400
+ additionalProperties: false,
1401
+ },
1402
+ },
1403
+ answerJobsCreate: {
1404
+ operationId: 'answerJobsCreate',
1405
+ method: 'POST',
1406
+ path: '/v1/answer-jobs',
1407
+ scope: 'workspace',
1408
+ bodySchema: {
1409
+ type: 'object',
1410
+ properties: {
1411
+ question: {
1412
+ type: 'string',
1413
+ minLength: 1,
1414
+ },
1415
+ sourceIds: {
1416
+ type: 'array',
1417
+ items: {
1418
+ type: 'string',
1419
+ minLength: 1,
1420
+ },
1421
+ minItems: 1,
1422
+ },
1423
+ },
1424
+ required: ['question'],
1425
+ additionalProperties: false,
1426
+ },
1427
+ querySchema: null,
1428
+ responseSchema: {
1429
+ type: 'object',
1430
+ properties: {
1431
+ answerJobId: {
1432
+ type: 'string',
1433
+ },
1434
+ status: {
1435
+ type: 'string',
1436
+ enum: ['queued', 'running', 'completed', 'failed', 'cancelled'],
1437
+ },
1438
+ result: {
1439
+ type: 'object',
1440
+ properties: {
1441
+ answer: {
1442
+ type: 'string',
1443
+ },
1444
+ citations: {
1445
+ type: 'array',
1446
+ items: {
1447
+ type: 'object',
1448
+ properties: {
1449
+ type: {
1450
+ type: 'string',
1451
+ enum: ['text', 'table', 'web'],
1452
+ },
1453
+ sourceId: {
1454
+ type: 'string',
1455
+ },
1456
+ ref: {
1457
+ type: 'string',
1458
+ },
1459
+ title: {
1460
+ type: 'string',
1461
+ },
1462
+ url: {
1463
+ type: 'string',
1464
+ },
1465
+ metadata: {
1466
+ type: 'object',
1467
+ additionalProperties: {},
1468
+ },
1469
+ },
1470
+ required: ['type'],
1471
+ additionalProperties: false,
1472
+ },
1473
+ },
1474
+ assumptions: {
1475
+ type: 'array',
1476
+ items: {
1477
+ type: 'object',
1478
+ additionalProperties: {},
1479
+ },
1480
+ },
1481
+ charts: {
1482
+ type: 'array',
1483
+ items: {
1484
+ type: 'object',
1485
+ additionalProperties: {},
1486
+ },
1487
+ },
1488
+ followUps: {
1489
+ type: 'array',
1490
+ items: {
1491
+ type: 'string',
1492
+ },
1493
+ },
1494
+ confidence: {
1495
+ type: 'object',
1496
+ properties: {
1497
+ score: {
1498
+ type: 'number',
1499
+ minimum: 0,
1500
+ maximum: 100,
1501
+ },
1502
+ queryComplexity: {
1503
+ type: 'string',
1504
+ enum: ['high', 'medium', 'low'],
1505
+ },
1506
+ reason: {
1507
+ type: 'string',
1508
+ },
1509
+ },
1510
+ required: ['score', 'queryComplexity', 'reason'],
1511
+ additionalProperties: false,
1512
+ },
1513
+ },
1514
+ required: ['answer', 'citations'],
1515
+ additionalProperties: false,
1516
+ },
1517
+ error: {
1518
+ type: 'string',
1519
+ },
1520
+ pollAfterMs: {
1521
+ type: 'integer',
1522
+ exclusiveMinimum: 0,
1523
+ },
1524
+ createdAt: {
1525
+ type: 'string',
1526
+ format: 'date-time',
1527
+ },
1528
+ updatedAt: {
1529
+ type: 'string',
1530
+ format: 'date-time',
1531
+ },
1532
+ startedAt: {
1533
+ type: 'string',
1534
+ format: 'date-time',
1535
+ nullable: true,
1536
+ },
1537
+ completedAt: {
1538
+ type: 'string',
1539
+ format: 'date-time',
1540
+ nullable: true,
1541
+ },
1542
+ },
1543
+ required: ['answerJobId', 'status'],
1544
+ additionalProperties: false,
1545
+ },
1546
+ },
1547
+ answerJobsGet: {
1548
+ operationId: 'answerJobsGet',
1549
+ method: 'GET',
1550
+ path: '/v1/answer-jobs/{answerJobId}',
1551
+ scope: 'workspace',
1552
+ bodySchema: null,
1553
+ querySchema: null,
1554
+ responseSchema: {
1555
+ type: 'object',
1556
+ properties: {
1557
+ answerJobId: {
1558
+ type: 'string',
1559
+ },
1560
+ status: {
1561
+ type: 'string',
1562
+ enum: ['queued', 'running', 'completed', 'failed', 'cancelled'],
1563
+ },
1564
+ result: {
1565
+ type: 'object',
1566
+ properties: {
1567
+ answer: {
1568
+ type: 'string',
1569
+ },
1570
+ citations: {
1571
+ type: 'array',
1572
+ items: {
1573
+ type: 'object',
1574
+ properties: {
1575
+ type: {
1576
+ type: 'string',
1577
+ enum: ['text', 'table', 'web'],
1578
+ },
1579
+ sourceId: {
1580
+ type: 'string',
1581
+ },
1582
+ ref: {
1583
+ type: 'string',
1584
+ },
1585
+ title: {
1586
+ type: 'string',
1587
+ },
1588
+ url: {
1589
+ type: 'string',
1590
+ },
1591
+ metadata: {
1592
+ type: 'object',
1593
+ additionalProperties: {},
1594
+ },
1595
+ },
1596
+ required: ['type'],
1597
+ additionalProperties: false,
1598
+ },
1599
+ },
1600
+ assumptions: {
1601
+ type: 'array',
1602
+ items: {
1603
+ type: 'object',
1604
+ additionalProperties: {},
1605
+ },
1606
+ },
1607
+ charts: {
1608
+ type: 'array',
1609
+ items: {
1610
+ type: 'object',
1611
+ additionalProperties: {},
1612
+ },
1613
+ },
1614
+ followUps: {
1615
+ type: 'array',
1616
+ items: {
1617
+ type: 'string',
1618
+ },
1619
+ },
1620
+ confidence: {
1621
+ type: 'object',
1622
+ properties: {
1623
+ score: {
1624
+ type: 'number',
1625
+ minimum: 0,
1626
+ maximum: 100,
1627
+ },
1628
+ queryComplexity: {
1629
+ type: 'string',
1630
+ enum: ['high', 'medium', 'low'],
1631
+ },
1632
+ reason: {
1633
+ type: 'string',
1634
+ },
1635
+ },
1636
+ required: ['score', 'queryComplexity', 'reason'],
1637
+ additionalProperties: false,
1638
+ },
1639
+ },
1640
+ required: ['answer', 'citations'],
1641
+ additionalProperties: false,
1642
+ },
1643
+ error: {
1644
+ type: 'string',
1645
+ },
1646
+ pollAfterMs: {
1647
+ type: 'integer',
1648
+ exclusiveMinimum: 0,
1649
+ },
1650
+ createdAt: {
1651
+ type: 'string',
1652
+ format: 'date-time',
1653
+ },
1654
+ updatedAt: {
1655
+ type: 'string',
1656
+ format: 'date-time',
1657
+ },
1658
+ startedAt: {
1659
+ type: 'string',
1660
+ format: 'date-time',
1661
+ nullable: true,
1662
+ },
1663
+ completedAt: {
1664
+ type: 'string',
1665
+ format: 'date-time',
1666
+ nullable: true,
1667
+ },
1668
+ },
1669
+ required: ['answerJobId', 'status'],
1670
+ additionalProperties: false,
1671
+ },
1672
+ },
1673
+ queriesCreate: {
1674
+ operationId: 'queriesCreate',
1675
+ method: 'POST',
1676
+ path: '/v1/queries',
1677
+ scope: 'workspace',
1678
+ bodySchema: {
1679
+ type: 'object',
1680
+ properties: {
1681
+ sourceIds: {
1682
+ type: 'array',
1683
+ items: {
1684
+ type: 'string',
1685
+ minLength: 1,
1686
+ },
1687
+ minItems: 1,
1688
+ },
1689
+ sql: {
1690
+ type: 'string',
1691
+ minLength: 1,
1692
+ },
1693
+ limit: {
1694
+ type: 'integer',
1695
+ minimum: 1,
1696
+ maximum: 1000,
1697
+ },
1698
+ },
1699
+ required: ['sourceIds', 'sql'],
1700
+ additionalProperties: false,
1701
+ },
1702
+ querySchema: null,
1703
+ responseSchema: {
1704
+ type: 'object',
1705
+ properties: {
1706
+ queryId: {
1707
+ type: 'string',
1708
+ },
1709
+ sourceIds: {
1710
+ type: 'array',
1711
+ items: {
1712
+ type: 'string',
1713
+ },
1714
+ },
1715
+ sql: {
1716
+ type: 'string',
1717
+ },
1718
+ columns: {
1719
+ type: 'array',
1720
+ items: {
1721
+ type: 'object',
1722
+ properties: {
1723
+ name: {
1724
+ type: 'string',
1725
+ },
1726
+ type: {
1727
+ type: 'string',
1728
+ },
1729
+ },
1730
+ required: ['name'],
1731
+ additionalProperties: false,
1732
+ },
1733
+ },
1734
+ rows: {
1735
+ type: 'array',
1736
+ items: {
1737
+ type: 'object',
1738
+ additionalProperties: {},
1739
+ },
1740
+ },
1741
+ rowCount: {
1742
+ type: 'integer',
1743
+ minimum: 0,
1744
+ },
1745
+ truncated: {
1746
+ type: 'boolean',
1747
+ },
1748
+ executionMs: {
1749
+ type: 'number',
1750
+ minimum: 0,
1751
+ },
1752
+ },
1753
+ required: ['queryId', 'sourceIds', 'sql', 'columns', 'rows', 'rowCount', 'truncated', 'executionMs'],
1754
+ additionalProperties: false,
1755
+ },
1756
+ },
1757
+ };