@retab/node 1.0.98 → 1.0.113

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.
Files changed (77) hide show
  1. package/README.md +39 -42
  2. package/dist/api/client.d.ts +4 -0
  3. package/dist/api/client.d.ts.map +1 -1
  4. package/dist/api/client.js +4 -0
  5. package/dist/api/documents/client.d.ts +17 -11
  6. package/dist/api/documents/client.d.ts.map +1 -1
  7. package/dist/api/documents/client.js +81 -34
  8. package/dist/api/edit/client.d.ts +1 -1
  9. package/dist/api/edit/client.js +1 -1
  10. package/dist/api/edit/templates/client.d.ts +1 -75
  11. package/dist/api/edit/templates/client.d.ts.map +1 -1
  12. package/dist/api/edit/templates/client.js +1 -128
  13. package/dist/api/evals/classify/client.d.ts +20 -0
  14. package/dist/api/evals/classify/client.d.ts.map +1 -0
  15. package/dist/api/evals/classify/client.js +25 -0
  16. package/dist/api/evals/client.d.ts +11 -0
  17. package/dist/api/evals/client.d.ts.map +1 -0
  18. package/dist/api/evals/client.js +12 -0
  19. package/dist/api/evals/extract/client.d.ts +289 -0
  20. package/dist/api/evals/extract/client.d.ts.map +1 -0
  21. package/dist/api/evals/extract/client.js +56 -0
  22. package/dist/api/evals/helpers.d.ts +30 -0
  23. package/dist/api/evals/helpers.d.ts.map +1 -0
  24. package/dist/api/evals/helpers.js +46 -0
  25. package/dist/api/evals/schemas.d.ts +6522 -0
  26. package/dist/api/evals/schemas.d.ts.map +1 -0
  27. package/dist/api/evals/schemas.js +219 -0
  28. package/dist/api/evals/split/client.d.ts +107 -0
  29. package/dist/api/evals/split/client.d.ts.map +1 -0
  30. package/dist/api/evals/split/client.js +28 -0
  31. package/dist/api/extractions/client.d.ts +3 -43
  32. package/dist/api/extractions/client.d.ts.map +1 -1
  33. package/dist/api/extractions/client.js +3 -64
  34. package/dist/api/files/client.d.ts +9 -1
  35. package/dist/api/files/client.d.ts.map +1 -1
  36. package/dist/api/files/client.js +7 -1
  37. package/dist/api/jobs/client.d.ts +11 -9
  38. package/dist/api/jobs/client.d.ts.map +1 -1
  39. package/dist/api/jobs/client.js +7 -11
  40. package/dist/api/models/client.d.ts +3 -10
  41. package/dist/api/models/client.d.ts.map +1 -1
  42. package/dist/api/models/client.js +9 -8
  43. package/dist/api/projects/client.d.ts +1640 -4
  44. package/dist/api/projects/client.d.ts.map +1 -1
  45. package/dist/api/projects/client.js +451 -22
  46. package/dist/api/schemas/client.d.ts +3 -0
  47. package/dist/api/schemas/client.d.ts.map +1 -1
  48. package/dist/api/workflows/blocks/client.d.ts +67 -0
  49. package/dist/api/workflows/blocks/client.d.ts.map +1 -0
  50. package/dist/api/workflows/blocks/client.js +132 -0
  51. package/dist/api/workflows/client.d.ts +73 -1
  52. package/dist/api/workflows/client.d.ts.map +1 -1
  53. package/dist/api/workflows/client.js +121 -1
  54. package/dist/api/workflows/edges/client.d.ts +66 -0
  55. package/dist/api/workflows/edges/client.d.ts.map +1 -0
  56. package/dist/api/workflows/edges/client.js +120 -0
  57. package/dist/api/workflows/runs/client.d.ts +57 -113
  58. package/dist/api/workflows/runs/client.d.ts.map +1 -1
  59. package/dist/api/workflows/runs/client.js +111 -112
  60. package/dist/api/workflows/runs/steps/client.d.ts +35 -13
  61. package/dist/api/workflows/runs/steps/client.d.ts.map +1 -1
  62. package/dist/api/workflows/runs/steps/client.js +61 -13
  63. package/dist/client.d.ts +4 -2
  64. package/dist/client.d.ts.map +1 -1
  65. package/dist/client.js +78 -4
  66. package/dist/generated_types.d.ts +7751 -2718
  67. package/dist/generated_types.d.ts.map +1 -1
  68. package/dist/generated_types.js +709 -68
  69. package/dist/mime.d.ts.map +1 -1
  70. package/dist/mime.js +11 -1
  71. package/dist/schema_types.d.ts +2 -2
  72. package/dist/schema_types.d.ts.map +1 -1
  73. package/dist/schema_types.js +2 -2
  74. package/dist/types.d.ts +1465 -107
  75. package/dist/types.d.ts.map +1 -1
  76. package/dist/types.js +75 -14
  77. package/package.json +1 -1
package/dist/types.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { Readable } from "stream";
2
+ import * as generated from "./generated_types";
2
3
  import { ZFieldItem, ZRefObject, ZRowList } from "./generated_types";
3
4
  export * from "./generated_types";
4
5
  import * as z from "zod";
@@ -245,10 +246,10 @@ export declare const ZDocumentExtractRequest: z.ZodObject<{
245
246
  }>>, "many">>>;
246
247
  }, "strip", z.ZodTypeAny, {
247
248
  metadata: Record<string, string>;
248
- json_schema: Record<string, any>;
249
249
  model: string;
250
250
  image_resolution_dpi: number;
251
251
  n_consensus: number;
252
+ json_schema: Record<string, any>;
252
253
  chunking_keys?: Record<string, string> | null | undefined;
253
254
  extraction_id?: string | null | undefined;
254
255
  document?: any;
@@ -288,8 +289,8 @@ export declare const ZDocumentExtractRequest: z.ZodObject<{
288
289
  }[] | null | undefined;
289
290
  }[] | null | undefined;
290
291
  }, {
291
- json_schema: string | Record<string, any> | z.ZodType<unknown, z.ZodTypeDef, unknown>;
292
292
  model: string;
293
+ json_schema: string | Record<string, any> | z.ZodType<unknown, z.ZodTypeDef, unknown>;
293
294
  document: string | Buffer<ArrayBufferLike> | Readable | {
294
295
  filename: string;
295
296
  url: string;
@@ -336,68 +337,860 @@ export declare const ZDocumentExtractRequest: z.ZodObject<{
336
337
  }[] | null | undefined;
337
338
  }>;
338
339
  export type DocumentExtractRequest = z.input<typeof ZDocumentExtractRequest>;
339
- export declare const ZParseRequest: z.ZodObject<{
340
- document: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>, z.ZodType<Readable, z.ZodTypeDef, Readable>, z.ZodLazy<z.ZodObject<{
341
- filename: z.ZodString;
342
- url: z.ZodString;
340
+ export declare const ZRetabParsedChatCompletion: z.ZodEffects<z.ZodLazy<z.ZodObject<{
341
+ id: z.ZodString;
342
+ created: z.ZodNumber;
343
+ model: z.ZodString;
344
+ object: z.ZodLiteral<"chat.completion">;
345
+ service_tier: z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodLiteral<"auto">, z.ZodLiteral<"default">, z.ZodLiteral<"flex">, z.ZodLiteral<"scale">, z.ZodLiteral<"priority">]>>>;
346
+ system_fingerprint: z.ZodOptional<z.ZodNullable<z.ZodString>>;
347
+ } & {
348
+ choices: z.ZodArray<z.ZodLazy<z.ZodObject<{
349
+ index: z.ZodNumber;
350
+ logprobs: z.ZodOptional<z.ZodNullable<z.ZodLazy<z.ZodObject<{
351
+ content: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodLazy<z.ZodObject<{
352
+ token: z.ZodString;
353
+ bytes: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber, "many">>>;
354
+ logprob: z.ZodNumber;
355
+ top_logprobs: z.ZodArray<z.ZodLazy<z.ZodObject<{
356
+ token: z.ZodString;
357
+ bytes: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber, "many">>>;
358
+ logprob: z.ZodNumber;
359
+ }, "strip", z.ZodTypeAny, {
360
+ token: string;
361
+ logprob: number;
362
+ bytes?: number[] | null | undefined;
363
+ }, {
364
+ token: string;
365
+ logprob: number;
366
+ bytes?: number[] | null | undefined;
367
+ }>>, "many">;
368
+ }, "strip", z.ZodTypeAny, {
369
+ token: string;
370
+ logprob: number;
371
+ top_logprobs: {
372
+ token: string;
373
+ logprob: number;
374
+ bytes?: number[] | null | undefined;
375
+ }[];
376
+ bytes?: number[] | null | undefined;
377
+ }, {
378
+ token: string;
379
+ logprob: number;
380
+ top_logprobs: {
381
+ token: string;
382
+ logprob: number;
383
+ bytes?: number[] | null | undefined;
384
+ }[];
385
+ bytes?: number[] | null | undefined;
386
+ }>>, "many">>>;
387
+ refusal: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodLazy<z.ZodObject<{
388
+ token: z.ZodString;
389
+ bytes: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber, "many">>>;
390
+ logprob: z.ZodNumber;
391
+ top_logprobs: z.ZodArray<z.ZodLazy<z.ZodObject<{
392
+ token: z.ZodString;
393
+ bytes: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber, "many">>>;
394
+ logprob: z.ZodNumber;
395
+ }, "strip", z.ZodTypeAny, {
396
+ token: string;
397
+ logprob: number;
398
+ bytes?: number[] | null | undefined;
399
+ }, {
400
+ token: string;
401
+ logprob: number;
402
+ bytes?: number[] | null | undefined;
403
+ }>>, "many">;
404
+ }, "strip", z.ZodTypeAny, {
405
+ token: string;
406
+ logprob: number;
407
+ top_logprobs: {
408
+ token: string;
409
+ logprob: number;
410
+ bytes?: number[] | null | undefined;
411
+ }[];
412
+ bytes?: number[] | null | undefined;
413
+ }, {
414
+ token: string;
415
+ logprob: number;
416
+ top_logprobs: {
417
+ token: string;
418
+ logprob: number;
419
+ bytes?: number[] | null | undefined;
420
+ }[];
421
+ bytes?: number[] | null | undefined;
422
+ }>>, "many">>>;
423
+ }, "strip", z.ZodTypeAny, {
424
+ content?: {
425
+ token: string;
426
+ logprob: number;
427
+ top_logprobs: {
428
+ token: string;
429
+ logprob: number;
430
+ bytes?: number[] | null | undefined;
431
+ }[];
432
+ bytes?: number[] | null | undefined;
433
+ }[] | null | undefined;
434
+ refusal?: {
435
+ token: string;
436
+ logprob: number;
437
+ top_logprobs: {
438
+ token: string;
439
+ logprob: number;
440
+ bytes?: number[] | null | undefined;
441
+ }[];
442
+ bytes?: number[] | null | undefined;
443
+ }[] | null | undefined;
444
+ }, {
445
+ content?: {
446
+ token: string;
447
+ logprob: number;
448
+ top_logprobs: {
449
+ token: string;
450
+ logprob: number;
451
+ bytes?: number[] | null | undefined;
452
+ }[];
453
+ bytes?: number[] | null | undefined;
454
+ }[] | null | undefined;
455
+ refusal?: {
456
+ token: string;
457
+ logprob: number;
458
+ top_logprobs: {
459
+ token: string;
460
+ logprob: number;
461
+ bytes?: number[] | null | undefined;
462
+ }[];
463
+ bytes?: number[] | null | undefined;
464
+ }[] | null | undefined;
465
+ }>>>>;
466
+ message: z.ZodLazy<z.ZodObject<{
467
+ content: z.ZodOptional<z.ZodNullable<z.ZodString>>;
468
+ refusal: z.ZodOptional<z.ZodNullable<z.ZodString>>;
469
+ role: z.ZodLiteral<"assistant">;
470
+ annotations: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodLazy<z.ZodObject<{
471
+ type: z.ZodLiteral<"url_citation">;
472
+ url_citation: z.ZodLazy<z.ZodObject<{
473
+ end_index: z.ZodNumber;
474
+ start_index: z.ZodNumber;
475
+ title: z.ZodString;
476
+ url: z.ZodString;
477
+ }, "strip", z.ZodTypeAny, {
478
+ url: string;
479
+ title: string;
480
+ end_index: number;
481
+ start_index: number;
482
+ }, {
483
+ url: string;
484
+ title: string;
485
+ end_index: number;
486
+ start_index: number;
487
+ }>>;
488
+ }, "strip", z.ZodTypeAny, {
489
+ type: "url_citation";
490
+ url_citation: {
491
+ url: string;
492
+ title: string;
493
+ end_index: number;
494
+ start_index: number;
495
+ };
496
+ }, {
497
+ type: "url_citation";
498
+ url_citation: {
499
+ url: string;
500
+ title: string;
501
+ end_index: number;
502
+ start_index: number;
503
+ };
504
+ }>>, "many">>>;
505
+ audio: z.ZodOptional<z.ZodNullable<z.ZodLazy<z.ZodObject<{
506
+ id: z.ZodString;
507
+ data: z.ZodString;
508
+ expires_at: z.ZodNumber;
509
+ transcript: z.ZodString;
510
+ }, "strip", z.ZodTypeAny, {
511
+ id: string;
512
+ data: string;
513
+ expires_at: number;
514
+ transcript: string;
515
+ }, {
516
+ id: string;
517
+ data: string;
518
+ expires_at: number;
519
+ transcript: string;
520
+ }>>>>;
521
+ function_call: z.ZodOptional<z.ZodNullable<z.ZodLazy<z.ZodObject<{
522
+ arguments: z.ZodString;
523
+ name: z.ZodString;
524
+ }, "strip", z.ZodTypeAny, {
525
+ arguments: string;
526
+ name: string;
527
+ }, {
528
+ arguments: string;
529
+ name: string;
530
+ }>>>>;
531
+ } & {
532
+ tool_calls: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodLazy<z.ZodObject<{
533
+ id: z.ZodString;
534
+ type: z.ZodLiteral<"function">;
535
+ } & {
536
+ function: z.ZodLazy<z.ZodObject<{
537
+ arguments: z.ZodString;
538
+ name: z.ZodString;
539
+ } & {
540
+ parsed_arguments: z.ZodOptional<z.ZodNullable<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>>;
541
+ }, "strip", z.ZodTypeAny, {
542
+ arguments: string;
543
+ name: string;
544
+ parsed_arguments?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | null | undefined;
545
+ }, {
546
+ arguments: string;
547
+ name: string;
548
+ parsed_arguments?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | null | undefined;
549
+ }>>;
550
+ }, "strip", z.ZodTypeAny, {
551
+ function: {
552
+ arguments: string;
553
+ name: string;
554
+ parsed_arguments?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | null | undefined;
555
+ };
556
+ type: "function";
557
+ id: string;
558
+ }, {
559
+ function: {
560
+ arguments: string;
561
+ name: string;
562
+ parsed_arguments?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | null | undefined;
563
+ };
564
+ type: "function";
565
+ id: string;
566
+ }>>, "many">>>;
567
+ parsed: z.ZodOptional<z.ZodNullable<z.ZodAny>>;
568
+ }, "strip", z.ZodTypeAny, {
569
+ role: "assistant";
570
+ content?: string | null | undefined;
571
+ tool_calls?: {
572
+ function: {
573
+ arguments: string;
574
+ name: string;
575
+ parsed_arguments?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | null | undefined;
576
+ };
577
+ type: "function";
578
+ id: string;
579
+ }[] | null | undefined;
580
+ function_call?: {
581
+ arguments: string;
582
+ name: string;
583
+ } | null | undefined;
584
+ refusal?: string | null | undefined;
585
+ annotations?: {
586
+ type: "url_citation";
587
+ url_citation: {
588
+ url: string;
589
+ title: string;
590
+ end_index: number;
591
+ start_index: number;
592
+ };
593
+ }[] | null | undefined;
594
+ audio?: {
595
+ id: string;
596
+ data: string;
597
+ expires_at: number;
598
+ transcript: string;
599
+ } | null | undefined;
600
+ parsed?: any;
601
+ }, {
602
+ role: "assistant";
603
+ content?: string | null | undefined;
604
+ tool_calls?: {
605
+ function: {
606
+ arguments: string;
607
+ name: string;
608
+ parsed_arguments?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | null | undefined;
609
+ };
610
+ type: "function";
611
+ id: string;
612
+ }[] | null | undefined;
613
+ function_call?: {
614
+ arguments: string;
615
+ name: string;
616
+ } | null | undefined;
617
+ refusal?: string | null | undefined;
618
+ annotations?: {
619
+ type: "url_citation";
620
+ url_citation: {
621
+ url: string;
622
+ title: string;
623
+ end_index: number;
624
+ start_index: number;
625
+ };
626
+ }[] | null | undefined;
627
+ audio?: {
628
+ id: string;
629
+ data: string;
630
+ expires_at: number;
631
+ transcript: string;
632
+ } | null | undefined;
633
+ parsed?: any;
634
+ }>>;
635
+ } & {
636
+ finish_reason: z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodLiteral<"stop">, z.ZodLiteral<"length">, z.ZodLiteral<"tool_calls">, z.ZodLiteral<"content_filter">, z.ZodLiteral<"function_call">]>>>;
637
+ key_mapping: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodNullable<z.ZodString>>>>>;
343
638
  }, "strip", z.ZodTypeAny, {
344
- filename: string;
345
- url: string;
639
+ message: {
640
+ role: "assistant";
641
+ content?: string | null | undefined;
642
+ tool_calls?: {
643
+ function: {
644
+ arguments: string;
645
+ name: string;
646
+ parsed_arguments?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | null | undefined;
647
+ };
648
+ type: "function";
649
+ id: string;
650
+ }[] | null | undefined;
651
+ function_call?: {
652
+ arguments: string;
653
+ name: string;
654
+ } | null | undefined;
655
+ refusal?: string | null | undefined;
656
+ annotations?: {
657
+ type: "url_citation";
658
+ url_citation: {
659
+ url: string;
660
+ title: string;
661
+ end_index: number;
662
+ start_index: number;
663
+ };
664
+ }[] | null | undefined;
665
+ audio?: {
666
+ id: string;
667
+ data: string;
668
+ expires_at: number;
669
+ transcript: string;
670
+ } | null | undefined;
671
+ parsed?: any;
672
+ };
673
+ index: number;
674
+ logprobs?: {
675
+ content?: {
676
+ token: string;
677
+ logprob: number;
678
+ top_logprobs: {
679
+ token: string;
680
+ logprob: number;
681
+ bytes?: number[] | null | undefined;
682
+ }[];
683
+ bytes?: number[] | null | undefined;
684
+ }[] | null | undefined;
685
+ refusal?: {
686
+ token: string;
687
+ logprob: number;
688
+ top_logprobs: {
689
+ token: string;
690
+ logprob: number;
691
+ bytes?: number[] | null | undefined;
692
+ }[];
693
+ bytes?: number[] | null | undefined;
694
+ }[] | null | undefined;
695
+ } | null | undefined;
696
+ finish_reason?: "length" | "tool_calls" | "function_call" | "content_filter" | "stop" | null | undefined;
697
+ key_mapping?: Record<string, string | null | undefined> | null | undefined;
346
698
  }, {
347
- filename: string;
348
- url: string;
349
- }>>]>, any, string | Buffer<ArrayBufferLike> | Readable | {
350
- filename: string;
351
- url: string;
352
- }>;
353
- model: z.ZodDefault<z.ZodString>;
354
- table_parsing_format: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"markdown">, z.ZodLiteral<"yaml">, z.ZodLiteral<"html">, z.ZodLiteral<"json">]>>;
355
- image_resolution_dpi: z.ZodDefault<z.ZodNumber>;
356
- }, "strip", z.ZodTypeAny, {
357
- model: string;
358
- image_resolution_dpi: number;
359
- table_parsing_format: "json" | "markdown" | "yaml" | "html";
360
- document?: any;
361
- }, {
362
- document: string | Buffer<ArrayBufferLike> | Readable | {
363
- filename: string;
364
- url: string;
365
- };
366
- model?: string | undefined;
367
- image_resolution_dpi?: number | undefined;
368
- table_parsing_format?: "json" | "markdown" | "yaml" | "html" | undefined;
369
- }>;
370
- export type ParseRequest = z.input<typeof ZParseRequest>;
371
- export declare const ZDocumentCreateMessageRequest: z.ZodObject<{
372
- document: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>, z.ZodType<Readable, z.ZodTypeDef, Readable>, z.ZodLazy<z.ZodObject<{
373
- filename: z.ZodString;
374
- url: z.ZodString;
699
+ message: {
700
+ role: "assistant";
701
+ content?: string | null | undefined;
702
+ tool_calls?: {
703
+ function: {
704
+ arguments: string;
705
+ name: string;
706
+ parsed_arguments?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | null | undefined;
707
+ };
708
+ type: "function";
709
+ id: string;
710
+ }[] | null | undefined;
711
+ function_call?: {
712
+ arguments: string;
713
+ name: string;
714
+ } | null | undefined;
715
+ refusal?: string | null | undefined;
716
+ annotations?: {
717
+ type: "url_citation";
718
+ url_citation: {
719
+ url: string;
720
+ title: string;
721
+ end_index: number;
722
+ start_index: number;
723
+ };
724
+ }[] | null | undefined;
725
+ audio?: {
726
+ id: string;
727
+ data: string;
728
+ expires_at: number;
729
+ transcript: string;
730
+ } | null | undefined;
731
+ parsed?: any;
732
+ };
733
+ index: number;
734
+ logprobs?: {
735
+ content?: {
736
+ token: string;
737
+ logprob: number;
738
+ top_logprobs: {
739
+ token: string;
740
+ logprob: number;
741
+ bytes?: number[] | null | undefined;
742
+ }[];
743
+ bytes?: number[] | null | undefined;
744
+ }[] | null | undefined;
745
+ refusal?: {
746
+ token: string;
747
+ logprob: number;
748
+ top_logprobs: {
749
+ token: string;
750
+ logprob: number;
751
+ bytes?: number[] | null | undefined;
752
+ }[];
753
+ bytes?: number[] | null | undefined;
754
+ }[] | null | undefined;
755
+ } | null | undefined;
756
+ finish_reason?: "length" | "tool_calls" | "function_call" | "content_filter" | "stop" | null | undefined;
757
+ key_mapping?: Record<string, string | null | undefined> | null | undefined;
758
+ }>>, "many">;
759
+ usage: z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodLazy<z.ZodObject<{
760
+ completion_tokens: z.ZodNumber;
761
+ prompt_tokens: z.ZodNumber;
762
+ total_tokens: z.ZodNumber;
763
+ completion_tokens_details: z.ZodOptional<z.ZodNullable<z.ZodLazy<z.ZodObject<{
764
+ accepted_prediction_tokens: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
765
+ audio_tokens: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
766
+ reasoning_tokens: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
767
+ rejected_prediction_tokens: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
768
+ }, "strip", z.ZodTypeAny, {
769
+ accepted_prediction_tokens?: number | null | undefined;
770
+ audio_tokens?: number | null | undefined;
771
+ reasoning_tokens?: number | null | undefined;
772
+ rejected_prediction_tokens?: number | null | undefined;
773
+ }, {
774
+ accepted_prediction_tokens?: number | null | undefined;
775
+ audio_tokens?: number | null | undefined;
776
+ reasoning_tokens?: number | null | undefined;
777
+ rejected_prediction_tokens?: number | null | undefined;
778
+ }>>>>;
779
+ prompt_tokens_details: z.ZodOptional<z.ZodNullable<z.ZodLazy<z.ZodObject<{
780
+ audio_tokens: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
781
+ cached_tokens: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
782
+ }, "strip", z.ZodTypeAny, {
783
+ audio_tokens?: number | null | undefined;
784
+ cached_tokens?: number | null | undefined;
785
+ }, {
786
+ audio_tokens?: number | null | undefined;
787
+ cached_tokens?: number | null | undefined;
788
+ }>>>>;
375
789
  }, "strip", z.ZodTypeAny, {
376
- filename: string;
377
- url: string;
790
+ completion_tokens: number;
791
+ prompt_tokens: number;
792
+ total_tokens: number;
793
+ completion_tokens_details?: {
794
+ accepted_prediction_tokens?: number | null | undefined;
795
+ audio_tokens?: number | null | undefined;
796
+ reasoning_tokens?: number | null | undefined;
797
+ rejected_prediction_tokens?: number | null | undefined;
798
+ } | null | undefined;
799
+ prompt_tokens_details?: {
800
+ audio_tokens?: number | null | undefined;
801
+ cached_tokens?: number | null | undefined;
802
+ } | null | undefined;
378
803
  }, {
379
- filename: string;
380
- url: string;
381
- }>>]>, any, string | Buffer<ArrayBufferLike> | Readable | {
382
- filename: string;
383
- url: string;
384
- }>;
385
- image_resolution_dpi: z.ZodDefault<z.ZodNumber>;
386
- model: z.ZodDefault<z.ZodString>;
804
+ completion_tokens: number;
805
+ prompt_tokens: number;
806
+ total_tokens: number;
807
+ completion_tokens_details?: {
808
+ accepted_prediction_tokens?: number | null | undefined;
809
+ audio_tokens?: number | null | undefined;
810
+ reasoning_tokens?: number | null | undefined;
811
+ rejected_prediction_tokens?: number | null | undefined;
812
+ } | null | undefined;
813
+ prompt_tokens_details?: {
814
+ audio_tokens?: number | null | undefined;
815
+ cached_tokens?: number | null | undefined;
816
+ } | null | undefined;
817
+ }>>, z.ZodLazy<z.ZodObject<{
818
+ credits: z.ZodNumber;
819
+ }, "strip", z.ZodTypeAny, {
820
+ credits: number;
821
+ }, {
822
+ credits: number;
823
+ }>>]>>>;
824
+ extraction_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
825
+ likelihoods: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
826
+ request_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
827
+ first_token_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
828
+ last_token_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
387
829
  }, "strip", z.ZodTypeAny, {
830
+ object: "chat.completion";
831
+ id: string;
388
832
  model: string;
389
- image_resolution_dpi: number;
390
- document?: any;
833
+ choices: {
834
+ message: {
835
+ role: "assistant";
836
+ content?: string | null | undefined;
837
+ tool_calls?: {
838
+ function: {
839
+ arguments: string;
840
+ name: string;
841
+ parsed_arguments?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | null | undefined;
842
+ };
843
+ type: "function";
844
+ id: string;
845
+ }[] | null | undefined;
846
+ function_call?: {
847
+ arguments: string;
848
+ name: string;
849
+ } | null | undefined;
850
+ refusal?: string | null | undefined;
851
+ annotations?: {
852
+ type: "url_citation";
853
+ url_citation: {
854
+ url: string;
855
+ title: string;
856
+ end_index: number;
857
+ start_index: number;
858
+ };
859
+ }[] | null | undefined;
860
+ audio?: {
861
+ id: string;
862
+ data: string;
863
+ expires_at: number;
864
+ transcript: string;
865
+ } | null | undefined;
866
+ parsed?: any;
867
+ };
868
+ index: number;
869
+ logprobs?: {
870
+ content?: {
871
+ token: string;
872
+ logprob: number;
873
+ top_logprobs: {
874
+ token: string;
875
+ logprob: number;
876
+ bytes?: number[] | null | undefined;
877
+ }[];
878
+ bytes?: number[] | null | undefined;
879
+ }[] | null | undefined;
880
+ refusal?: {
881
+ token: string;
882
+ logprob: number;
883
+ top_logprobs: {
884
+ token: string;
885
+ logprob: number;
886
+ bytes?: number[] | null | undefined;
887
+ }[];
888
+ bytes?: number[] | null | undefined;
889
+ }[] | null | undefined;
890
+ } | null | undefined;
891
+ finish_reason?: "length" | "tool_calls" | "function_call" | "content_filter" | "stop" | null | undefined;
892
+ key_mapping?: Record<string, string | null | undefined> | null | undefined;
893
+ }[];
894
+ created: number;
895
+ likelihoods?: Record<string, any> | null | undefined;
896
+ extraction_id?: string | null | undefined;
897
+ usage?: {
898
+ credits: number;
899
+ } | {
900
+ completion_tokens: number;
901
+ prompt_tokens: number;
902
+ total_tokens: number;
903
+ completion_tokens_details?: {
904
+ accepted_prediction_tokens?: number | null | undefined;
905
+ audio_tokens?: number | null | undefined;
906
+ reasoning_tokens?: number | null | undefined;
907
+ rejected_prediction_tokens?: number | null | undefined;
908
+ } | null | undefined;
909
+ prompt_tokens_details?: {
910
+ audio_tokens?: number | null | undefined;
911
+ cached_tokens?: number | null | undefined;
912
+ } | null | undefined;
913
+ } | null | undefined;
914
+ service_tier?: "default" | "auto" | "flex" | "scale" | "priority" | null | undefined;
915
+ system_fingerprint?: string | null | undefined;
916
+ request_at?: string | null | undefined;
917
+ first_token_at?: string | null | undefined;
918
+ last_token_at?: string | null | undefined;
391
919
  }, {
392
- document: string | Buffer<ArrayBufferLike> | Readable | {
393
- filename: string;
394
- url: string;
395
- };
396
- model?: string | undefined;
397
- image_resolution_dpi?: number | undefined;
920
+ object: "chat.completion";
921
+ id: string;
922
+ model: string;
923
+ choices: {
924
+ message: {
925
+ role: "assistant";
926
+ content?: string | null | undefined;
927
+ tool_calls?: {
928
+ function: {
929
+ arguments: string;
930
+ name: string;
931
+ parsed_arguments?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | null | undefined;
932
+ };
933
+ type: "function";
934
+ id: string;
935
+ }[] | null | undefined;
936
+ function_call?: {
937
+ arguments: string;
938
+ name: string;
939
+ } | null | undefined;
940
+ refusal?: string | null | undefined;
941
+ annotations?: {
942
+ type: "url_citation";
943
+ url_citation: {
944
+ url: string;
945
+ title: string;
946
+ end_index: number;
947
+ start_index: number;
948
+ };
949
+ }[] | null | undefined;
950
+ audio?: {
951
+ id: string;
952
+ data: string;
953
+ expires_at: number;
954
+ transcript: string;
955
+ } | null | undefined;
956
+ parsed?: any;
957
+ };
958
+ index: number;
959
+ logprobs?: {
960
+ content?: {
961
+ token: string;
962
+ logprob: number;
963
+ top_logprobs: {
964
+ token: string;
965
+ logprob: number;
966
+ bytes?: number[] | null | undefined;
967
+ }[];
968
+ bytes?: number[] | null | undefined;
969
+ }[] | null | undefined;
970
+ refusal?: {
971
+ token: string;
972
+ logprob: number;
973
+ top_logprobs: {
974
+ token: string;
975
+ logprob: number;
976
+ bytes?: number[] | null | undefined;
977
+ }[];
978
+ bytes?: number[] | null | undefined;
979
+ }[] | null | undefined;
980
+ } | null | undefined;
981
+ finish_reason?: "length" | "tool_calls" | "function_call" | "content_filter" | "stop" | null | undefined;
982
+ key_mapping?: Record<string, string | null | undefined> | null | undefined;
983
+ }[];
984
+ created: number;
985
+ likelihoods?: Record<string, any> | null | undefined;
986
+ extraction_id?: string | null | undefined;
987
+ usage?: {
988
+ credits: number;
989
+ } | {
990
+ completion_tokens: number;
991
+ prompt_tokens: number;
992
+ total_tokens: number;
993
+ completion_tokens_details?: {
994
+ accepted_prediction_tokens?: number | null | undefined;
995
+ audio_tokens?: number | null | undefined;
996
+ reasoning_tokens?: number | null | undefined;
997
+ rejected_prediction_tokens?: number | null | undefined;
998
+ } | null | undefined;
999
+ prompt_tokens_details?: {
1000
+ audio_tokens?: number | null | undefined;
1001
+ cached_tokens?: number | null | undefined;
1002
+ } | null | undefined;
1003
+ } | null | undefined;
1004
+ service_tier?: "default" | "auto" | "flex" | "scale" | "priority" | null | undefined;
1005
+ system_fingerprint?: string | null | undefined;
1006
+ request_at?: string | null | undefined;
1007
+ first_token_at?: string | null | undefined;
1008
+ last_token_at?: string | null | undefined;
1009
+ }>>, {
1010
+ data: any;
1011
+ text: string | null;
1012
+ object: "chat.completion";
1013
+ id: string;
1014
+ model: string;
1015
+ choices: {
1016
+ message: {
1017
+ role: "assistant";
1018
+ content?: string | null | undefined;
1019
+ tool_calls?: {
1020
+ function: {
1021
+ arguments: string;
1022
+ name: string;
1023
+ parsed_arguments?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | null | undefined;
1024
+ };
1025
+ type: "function";
1026
+ id: string;
1027
+ }[] | null | undefined;
1028
+ function_call?: {
1029
+ arguments: string;
1030
+ name: string;
1031
+ } | null | undefined;
1032
+ refusal?: string | null | undefined;
1033
+ annotations?: {
1034
+ type: "url_citation";
1035
+ url_citation: {
1036
+ url: string;
1037
+ title: string;
1038
+ end_index: number;
1039
+ start_index: number;
1040
+ };
1041
+ }[] | null | undefined;
1042
+ audio?: {
1043
+ id: string;
1044
+ data: string;
1045
+ expires_at: number;
1046
+ transcript: string;
1047
+ } | null | undefined;
1048
+ parsed?: any;
1049
+ };
1050
+ index: number;
1051
+ logprobs?: {
1052
+ content?: {
1053
+ token: string;
1054
+ logprob: number;
1055
+ top_logprobs: {
1056
+ token: string;
1057
+ logprob: number;
1058
+ bytes?: number[] | null | undefined;
1059
+ }[];
1060
+ bytes?: number[] | null | undefined;
1061
+ }[] | null | undefined;
1062
+ refusal?: {
1063
+ token: string;
1064
+ logprob: number;
1065
+ top_logprobs: {
1066
+ token: string;
1067
+ logprob: number;
1068
+ bytes?: number[] | null | undefined;
1069
+ }[];
1070
+ bytes?: number[] | null | undefined;
1071
+ }[] | null | undefined;
1072
+ } | null | undefined;
1073
+ finish_reason?: "length" | "tool_calls" | "function_call" | "content_filter" | "stop" | null | undefined;
1074
+ key_mapping?: Record<string, string | null | undefined> | null | undefined;
1075
+ }[];
1076
+ created: number;
1077
+ likelihoods?: Record<string, any> | null | undefined;
1078
+ extraction_id?: string | null | undefined;
1079
+ usage?: {
1080
+ credits: number;
1081
+ } | {
1082
+ completion_tokens: number;
1083
+ prompt_tokens: number;
1084
+ total_tokens: number;
1085
+ completion_tokens_details?: {
1086
+ accepted_prediction_tokens?: number | null | undefined;
1087
+ audio_tokens?: number | null | undefined;
1088
+ reasoning_tokens?: number | null | undefined;
1089
+ rejected_prediction_tokens?: number | null | undefined;
1090
+ } | null | undefined;
1091
+ prompt_tokens_details?: {
1092
+ audio_tokens?: number | null | undefined;
1093
+ cached_tokens?: number | null | undefined;
1094
+ } | null | undefined;
1095
+ } | null | undefined;
1096
+ service_tier?: "default" | "auto" | "flex" | "scale" | "priority" | null | undefined;
1097
+ system_fingerprint?: string | null | undefined;
1098
+ request_at?: string | null | undefined;
1099
+ first_token_at?: string | null | undefined;
1100
+ last_token_at?: string | null | undefined;
1101
+ }, {
1102
+ object: "chat.completion";
1103
+ id: string;
1104
+ model: string;
1105
+ choices: {
1106
+ message: {
1107
+ role: "assistant";
1108
+ content?: string | null | undefined;
1109
+ tool_calls?: {
1110
+ function: {
1111
+ arguments: string;
1112
+ name: string;
1113
+ parsed_arguments?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | null | undefined;
1114
+ };
1115
+ type: "function";
1116
+ id: string;
1117
+ }[] | null | undefined;
1118
+ function_call?: {
1119
+ arguments: string;
1120
+ name: string;
1121
+ } | null | undefined;
1122
+ refusal?: string | null | undefined;
1123
+ annotations?: {
1124
+ type: "url_citation";
1125
+ url_citation: {
1126
+ url: string;
1127
+ title: string;
1128
+ end_index: number;
1129
+ start_index: number;
1130
+ };
1131
+ }[] | null | undefined;
1132
+ audio?: {
1133
+ id: string;
1134
+ data: string;
1135
+ expires_at: number;
1136
+ transcript: string;
1137
+ } | null | undefined;
1138
+ parsed?: any;
1139
+ };
1140
+ index: number;
1141
+ logprobs?: {
1142
+ content?: {
1143
+ token: string;
1144
+ logprob: number;
1145
+ top_logprobs: {
1146
+ token: string;
1147
+ logprob: number;
1148
+ bytes?: number[] | null | undefined;
1149
+ }[];
1150
+ bytes?: number[] | null | undefined;
1151
+ }[] | null | undefined;
1152
+ refusal?: {
1153
+ token: string;
1154
+ logprob: number;
1155
+ top_logprobs: {
1156
+ token: string;
1157
+ logprob: number;
1158
+ bytes?: number[] | null | undefined;
1159
+ }[];
1160
+ bytes?: number[] | null | undefined;
1161
+ }[] | null | undefined;
1162
+ } | null | undefined;
1163
+ finish_reason?: "length" | "tool_calls" | "function_call" | "content_filter" | "stop" | null | undefined;
1164
+ key_mapping?: Record<string, string | null | undefined> | null | undefined;
1165
+ }[];
1166
+ created: number;
1167
+ likelihoods?: Record<string, any> | null | undefined;
1168
+ extraction_id?: string | null | undefined;
1169
+ usage?: {
1170
+ credits: number;
1171
+ } | {
1172
+ completion_tokens: number;
1173
+ prompt_tokens: number;
1174
+ total_tokens: number;
1175
+ completion_tokens_details?: {
1176
+ accepted_prediction_tokens?: number | null | undefined;
1177
+ audio_tokens?: number | null | undefined;
1178
+ reasoning_tokens?: number | null | undefined;
1179
+ rejected_prediction_tokens?: number | null | undefined;
1180
+ } | null | undefined;
1181
+ prompt_tokens_details?: {
1182
+ audio_tokens?: number | null | undefined;
1183
+ cached_tokens?: number | null | undefined;
1184
+ } | null | undefined;
1185
+ } | null | undefined;
1186
+ service_tier?: "default" | "auto" | "flex" | "scale" | "priority" | null | undefined;
1187
+ system_fingerprint?: string | null | undefined;
1188
+ request_at?: string | null | undefined;
1189
+ first_token_at?: string | null | undefined;
1190
+ last_token_at?: string | null | undefined;
398
1191
  }>;
399
- export type DocumentCreateMessageRequest = z.input<typeof ZDocumentCreateMessageRequest>;
400
- export declare const ZDocumentCreateInputRequest: z.ZodObject<{
1192
+ export type RetabParsedChatCompletion = z.output<typeof ZRetabParsedChatCompletion>;
1193
+ export declare const ZParseRequest: z.ZodObject<{
401
1194
  document: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>, z.ZodType<Readable, z.ZodTypeDef, Readable>, z.ZodLazy<z.ZodObject<{
402
1195
  filename: z.ZodString;
403
1196
  url: z.ZodString;
@@ -411,24 +1204,24 @@ export declare const ZDocumentCreateInputRequest: z.ZodObject<{
411
1204
  filename: string;
412
1205
  url: string;
413
1206
  }>;
414
- json_schema: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodType<z.ZodType<unknown, z.ZodTypeDef, unknown>, z.ZodTypeDef, z.ZodType<unknown, z.ZodTypeDef, unknown>>]>, Record<string, any>, string | Record<string, any> | z.ZodType<unknown, z.ZodTypeDef, unknown>>;
415
- image_resolution_dpi: z.ZodDefault<z.ZodNumber>;
416
1207
  model: z.ZodDefault<z.ZodString>;
1208
+ table_parsing_format: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"markdown">, z.ZodLiteral<"yaml">, z.ZodLiteral<"html">, z.ZodLiteral<"json">]>>;
1209
+ image_resolution_dpi: z.ZodDefault<z.ZodNumber>;
417
1210
  }, "strip", z.ZodTypeAny, {
418
- json_schema: Record<string, any>;
419
1211
  model: string;
420
1212
  image_resolution_dpi: number;
1213
+ table_parsing_format: "json" | "markdown" | "yaml" | "html";
421
1214
  document?: any;
422
1215
  }, {
423
- json_schema: string | Record<string, any> | z.ZodType<unknown, z.ZodTypeDef, unknown>;
424
1216
  document: string | Buffer<ArrayBufferLike> | Readable | {
425
1217
  filename: string;
426
1218
  url: string;
427
1219
  };
428
1220
  model?: string | undefined;
429
1221
  image_resolution_dpi?: number | undefined;
1222
+ table_parsing_format?: "json" | "markdown" | "yaml" | "html" | undefined;
430
1223
  }>;
431
- export type DocumentCreateInputRequest = z.input<typeof ZDocumentCreateInputRequest>;
1224
+ export type ParseRequest = z.input<typeof ZParseRequest>;
432
1225
  export declare const ZGenerateSchemaRequest: z.ZodObject<{
433
1226
  documents: z.ZodArray<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>, z.ZodType<Readable, z.ZodTypeDef, Readable>, z.ZodLazy<z.ZodObject<{
434
1227
  filename: z.ZodString;
@@ -451,9 +1244,9 @@ export declare const ZGenerateSchemaRequest: z.ZodObject<{
451
1244
  }, "strip", z.ZodTypeAny, {
452
1245
  stream: boolean;
453
1246
  model: string;
454
- reasoning_effort: "low" | "high" | "none" | "minimal" | "medium" | "xhigh" | null;
455
1247
  image_resolution_dpi: number;
456
1248
  documents: any[];
1249
+ reasoning_effort: "low" | "high" | "none" | "minimal" | "medium" | "xhigh" | null;
457
1250
  instructions?: string | null | undefined;
458
1251
  }, {
459
1252
  documents: (string | Buffer<ArrayBufferLike> | Readable | {
@@ -462,8 +1255,8 @@ export declare const ZGenerateSchemaRequest: z.ZodObject<{
462
1255
  })[];
463
1256
  stream?: boolean | undefined;
464
1257
  model?: string | undefined;
465
- reasoning_effort?: "low" | "high" | "none" | "minimal" | "medium" | "xhigh" | null | undefined;
466
1258
  image_resolution_dpi?: number | undefined;
1259
+ reasoning_effort?: "low" | "high" | "none" | "minimal" | "medium" | "xhigh" | null | undefined;
467
1260
  instructions?: string | null | undefined;
468
1261
  }>;
469
1262
  export type GenerateSchemaRequest = z.input<typeof ZGenerateSchemaRequest>;
@@ -494,7 +1287,7 @@ export declare const ZSplitRequest: z.ZodObject<{
494
1287
  }>;
495
1288
  subdocuments: z.ZodArray<z.ZodLazy<z.ZodObject<{
496
1289
  name: z.ZodString;
497
- description: z.ZodString;
1290
+ description: z.ZodDefault<z.ZodString>;
498
1291
  partition_key: z.ZodOptional<z.ZodNullable<z.ZodString>>;
499
1292
  }, "strip", z.ZodTypeAny, {
500
1293
  name: string;
@@ -502,7 +1295,7 @@ export declare const ZSplitRequest: z.ZodObject<{
502
1295
  partition_key?: string | null | undefined;
503
1296
  }, {
504
1297
  name: string;
505
- description: string;
1298
+ description?: string | undefined;
506
1299
  partition_key?: string | null | undefined;
507
1300
  }>>, "many">;
508
1301
  model: z.ZodDefault<z.ZodString>;
@@ -519,15 +1312,15 @@ export declare const ZSplitRequest: z.ZodObject<{
519
1312
  document?: any;
520
1313
  context?: string | null | undefined;
521
1314
  }, {
522
- document: string | Buffer<ArrayBufferLike> | Readable | {
523
- filename: string;
524
- url: string;
525
- };
526
1315
  subdocuments: {
527
1316
  name: string;
528
- description: string;
1317
+ description?: string | undefined;
529
1318
  partition_key?: string | null | undefined;
530
1319
  }[];
1320
+ document: string | Buffer<ArrayBufferLike> | Readable | {
1321
+ filename: string;
1322
+ url: string;
1323
+ };
531
1324
  model?: string | undefined;
532
1325
  n_consensus?: number | undefined;
533
1326
  context?: string | null | undefined;
@@ -549,13 +1342,13 @@ export declare const ZClassifyRequest: z.ZodObject<{
549
1342
  }>;
550
1343
  categories: z.ZodArray<z.ZodLazy<z.ZodObject<{
551
1344
  name: z.ZodString;
552
- description: z.ZodString;
1345
+ description: z.ZodDefault<z.ZodString>;
553
1346
  }, "strip", z.ZodTypeAny, {
554
1347
  name: string;
555
1348
  description: string;
556
1349
  }, {
557
1350
  name: string;
558
- description: string;
1351
+ description?: string | undefined;
559
1352
  }>>, "many">;
560
1353
  model: z.ZodDefault<z.ZodString>;
561
1354
  first_n_pages: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
@@ -570,45 +1363,19 @@ export declare const ZClassifyRequest: z.ZodObject<{
570
1363
  context?: string | null | undefined;
571
1364
  first_n_pages?: number | null | undefined;
572
1365
  }, {
573
- document: string | Buffer<ArrayBufferLike> | Readable | {
574
- filename: string;
575
- url: string;
576
- };
577
1366
  categories: {
578
1367
  name: string;
579
- description: string;
1368
+ description?: string | undefined;
580
1369
  }[];
581
- model?: string | undefined;
582
- context?: string | null | undefined;
583
- first_n_pages?: number | null | undefined;
584
- }>;
585
- export type ClassifyRequest = z.input<typeof ZClassifyRequest>;
586
- export declare const ZGenerateSplitConfigRequest: z.ZodObject<{
587
- document: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>, z.ZodType<Readable, z.ZodTypeDef, Readable>, z.ZodLazy<z.ZodObject<{
588
- filename: z.ZodString;
589
- url: z.ZodString;
590
- }, "strip", z.ZodTypeAny, {
591
- filename: string;
592
- url: string;
593
- }, {
594
- filename: string;
595
- url: string;
596
- }>>]>, any, string | Buffer<ArrayBufferLike> | Readable | {
597
- filename: string;
598
- url: string;
599
- }>;
600
- model: z.ZodDefault<z.ZodString>;
601
- }, "strip", z.ZodTypeAny, {
602
- model: string;
603
- document?: any;
604
- }, {
605
1370
  document: string | Buffer<ArrayBufferLike> | Readable | {
606
1371
  filename: string;
607
1372
  url: string;
608
1373
  };
609
1374
  model?: string | undefined;
1375
+ context?: string | null | undefined;
1376
+ first_n_pages?: number | null | undefined;
610
1377
  }>;
611
- export type GenerateSplitConfigRequest = z.input<typeof ZGenerateSplitConfigRequest>;
1378
+ export type ClassifyRequest = z.input<typeof ZClassifyRequest>;
612
1379
  export declare const ZEditRequest: z.ZodObject<{
613
1380
  document: z.ZodOptional<z.ZodNullable<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>, z.ZodType<Readable, z.ZodTypeDef, Readable>, z.ZodLazy<z.ZodObject<{
614
1381
  filename: z.ZodString;
@@ -635,10 +1402,10 @@ export declare const ZEditRequest: z.ZodObject<{
635
1402
  template_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
636
1403
  }, "strip", z.ZodTypeAny, {
637
1404
  model: string;
638
- instructions: string;
639
1405
  config: {
640
1406
  color: string;
641
1407
  };
1408
+ instructions: string;
642
1409
  document?: any;
643
1410
  template_id?: string | null | undefined;
644
1411
  }, {
@@ -648,10 +1415,10 @@ export declare const ZEditRequest: z.ZodObject<{
648
1415
  filename: string;
649
1416
  url: string;
650
1417
  } | null | undefined;
651
- template_id?: string | null | undefined;
652
1418
  config?: {
653
1419
  color?: string | undefined;
654
1420
  } | undefined;
1421
+ template_id?: string | null | undefined;
655
1422
  }>;
656
1423
  export type EditRequest = z.input<typeof ZEditRequest>;
657
1424
  export declare const ZEditResponse: z.ZodLazy<z.ZodObject<{
@@ -715,6 +1482,13 @@ export declare const ZEditResponse: z.ZodLazy<z.ZodObject<{
715
1482
  filename: string;
716
1483
  url: string;
717
1484
  }>>;
1485
+ usage: z.ZodLazy<z.ZodObject<{
1486
+ credits: z.ZodNumber;
1487
+ }, "strip", z.ZodTypeAny, {
1488
+ credits: number;
1489
+ }, {
1490
+ credits: number;
1491
+ }>>;
718
1492
  }, "strip", z.ZodTypeAny, {
719
1493
  form_data: {
720
1494
  description: string;
@@ -729,6 +1503,9 @@ export declare const ZEditResponse: z.ZodLazy<z.ZodObject<{
729
1503
  type?: any;
730
1504
  value?: string | null | undefined;
731
1505
  }[];
1506
+ usage: {
1507
+ credits: number;
1508
+ };
732
1509
  filled_document: {
733
1510
  filename: string;
734
1511
  url: string;
@@ -747,6 +1524,9 @@ export declare const ZEditResponse: z.ZodLazy<z.ZodObject<{
747
1524
  type?: any;
748
1525
  value?: string | null | undefined;
749
1526
  }[];
1527
+ usage: {
1528
+ credits: number;
1529
+ };
750
1530
  filled_document: {
751
1531
  filename: string;
752
1532
  url: string;
@@ -927,7 +1707,6 @@ export declare const ZWorkflowRunStep: z.ZodObject<{
927
1707
  completed_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
928
1708
  duration_ms: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
929
1709
  error: z.ZodOptional<z.ZodNullable<z.ZodString>>;
930
- output: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
931
1710
  handle_outputs: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
932
1711
  handle_inputs: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
933
1712
  input_document: z.ZodOptional<z.ZodNullable<z.ZodLazy<z.ZodObject<{
@@ -989,7 +1768,6 @@ export declare const ZWorkflowRunStep: z.ZodObject<{
989
1768
  completed_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
990
1769
  duration_ms: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
991
1770
  error: z.ZodOptional<z.ZodNullable<z.ZodString>>;
992
- output: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
993
1771
  handle_outputs: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
994
1772
  handle_inputs: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
995
1773
  input_document: z.ZodOptional<z.ZodNullable<z.ZodLazy<z.ZodObject<{
@@ -1051,7 +1829,6 @@ export declare const ZWorkflowRunStep: z.ZodObject<{
1051
1829
  completed_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1052
1830
  duration_ms: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1053
1831
  error: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1054
- output: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
1055
1832
  handle_outputs: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
1056
1833
  handle_inputs: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
1057
1834
  input_document: z.ZodOptional<z.ZodNullable<z.ZodLazy<z.ZodObject<{
@@ -1144,6 +1921,587 @@ export declare const ZWorkflow: z.ZodObject<{
1144
1921
  updated_at: z.ZodString;
1145
1922
  }, z.ZodTypeAny, "passthrough">>;
1146
1923
  export type Workflow = z.infer<typeof ZWorkflow>;
1924
+ export declare const ZWorkflowBlock: z.ZodObject<{
1925
+ id: z.ZodString;
1926
+ workflow_id: z.ZodString;
1927
+ type: z.ZodString;
1928
+ label: z.ZodDefault<z.ZodString>;
1929
+ position_x: z.ZodDefault<z.ZodNumber>;
1930
+ position_y: z.ZodDefault<z.ZodNumber>;
1931
+ width: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1932
+ height: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1933
+ config: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
1934
+ subflow_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1935
+ parent_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1936
+ updated_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1937
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1938
+ id: z.ZodString;
1939
+ workflow_id: z.ZodString;
1940
+ type: z.ZodString;
1941
+ label: z.ZodDefault<z.ZodString>;
1942
+ position_x: z.ZodDefault<z.ZodNumber>;
1943
+ position_y: z.ZodDefault<z.ZodNumber>;
1944
+ width: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1945
+ height: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1946
+ config: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
1947
+ subflow_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1948
+ parent_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1949
+ updated_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1950
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1951
+ id: z.ZodString;
1952
+ workflow_id: z.ZodString;
1953
+ type: z.ZodString;
1954
+ label: z.ZodDefault<z.ZodString>;
1955
+ position_x: z.ZodDefault<z.ZodNumber>;
1956
+ position_y: z.ZodDefault<z.ZodNumber>;
1957
+ width: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1958
+ height: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1959
+ config: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
1960
+ subflow_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1961
+ parent_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1962
+ updated_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1963
+ }, z.ZodTypeAny, "passthrough">>;
1964
+ export type WorkflowBlock = z.infer<typeof ZWorkflowBlock>;
1965
+ export declare const ZWorkflowEdge: z.ZodObject<{
1966
+ id: z.ZodString;
1967
+ workflow_id: z.ZodString;
1968
+ source_block: z.ZodString;
1969
+ target_block: z.ZodString;
1970
+ source_handle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1971
+ target_handle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1972
+ updated_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1973
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1974
+ id: z.ZodString;
1975
+ workflow_id: z.ZodString;
1976
+ source_block: z.ZodString;
1977
+ target_block: z.ZodString;
1978
+ source_handle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1979
+ target_handle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1980
+ updated_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1981
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1982
+ id: z.ZodString;
1983
+ workflow_id: z.ZodString;
1984
+ source_block: z.ZodString;
1985
+ target_block: z.ZodString;
1986
+ source_handle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1987
+ target_handle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1988
+ updated_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1989
+ }, z.ZodTypeAny, "passthrough">>;
1990
+ export type WorkflowEdge = z.infer<typeof ZWorkflowEdge>;
1991
+ export declare const ZWorkflowSubflow: z.ZodObject<{
1992
+ id: z.ZodString;
1993
+ workflow_id: z.ZodString;
1994
+ type: z.ZodString;
1995
+ label: z.ZodDefault<z.ZodString>;
1996
+ position_x: z.ZodDefault<z.ZodNumber>;
1997
+ position_y: z.ZodDefault<z.ZodNumber>;
1998
+ width: z.ZodDefault<z.ZodNumber>;
1999
+ height: z.ZodDefault<z.ZodNumber>;
2000
+ config: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
2001
+ child_block_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2002
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
2003
+ id: z.ZodString;
2004
+ workflow_id: z.ZodString;
2005
+ type: z.ZodString;
2006
+ label: z.ZodDefault<z.ZodString>;
2007
+ position_x: z.ZodDefault<z.ZodNumber>;
2008
+ position_y: z.ZodDefault<z.ZodNumber>;
2009
+ width: z.ZodDefault<z.ZodNumber>;
2010
+ height: z.ZodDefault<z.ZodNumber>;
2011
+ config: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
2012
+ child_block_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2013
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
2014
+ id: z.ZodString;
2015
+ workflow_id: z.ZodString;
2016
+ type: z.ZodString;
2017
+ label: z.ZodDefault<z.ZodString>;
2018
+ position_x: z.ZodDefault<z.ZodNumber>;
2019
+ position_y: z.ZodDefault<z.ZodNumber>;
2020
+ width: z.ZodDefault<z.ZodNumber>;
2021
+ height: z.ZodDefault<z.ZodNumber>;
2022
+ config: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
2023
+ child_block_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2024
+ }, z.ZodTypeAny, "passthrough">>;
2025
+ export type WorkflowSubflow = z.infer<typeof ZWorkflowSubflow>;
2026
+ export declare const ZWorkflowWithEntities: z.ZodObject<{
2027
+ workflow: z.ZodObject<{
2028
+ id: z.ZodString;
2029
+ name: z.ZodDefault<z.ZodString>;
2030
+ description: z.ZodDefault<z.ZodString>;
2031
+ is_published: z.ZodDefault<z.ZodBoolean>;
2032
+ published_snapshot_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2033
+ published_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2034
+ draft_version: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2035
+ organization_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2036
+ email_senders_whitelist: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2037
+ email_domains_whitelist: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2038
+ created_at: z.ZodString;
2039
+ updated_at: z.ZodString;
2040
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
2041
+ id: z.ZodString;
2042
+ name: z.ZodDefault<z.ZodString>;
2043
+ description: z.ZodDefault<z.ZodString>;
2044
+ is_published: z.ZodDefault<z.ZodBoolean>;
2045
+ published_snapshot_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2046
+ published_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2047
+ draft_version: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2048
+ organization_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2049
+ email_senders_whitelist: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2050
+ email_domains_whitelist: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2051
+ created_at: z.ZodString;
2052
+ updated_at: z.ZodString;
2053
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
2054
+ id: z.ZodString;
2055
+ name: z.ZodDefault<z.ZodString>;
2056
+ description: z.ZodDefault<z.ZodString>;
2057
+ is_published: z.ZodDefault<z.ZodBoolean>;
2058
+ published_snapshot_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2059
+ published_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2060
+ draft_version: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2061
+ organization_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2062
+ email_senders_whitelist: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2063
+ email_domains_whitelist: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2064
+ created_at: z.ZodString;
2065
+ updated_at: z.ZodString;
2066
+ }, z.ZodTypeAny, "passthrough">>;
2067
+ blocks: z.ZodDefault<z.ZodArray<z.ZodObject<{
2068
+ id: z.ZodString;
2069
+ workflow_id: z.ZodString;
2070
+ type: z.ZodString;
2071
+ label: z.ZodDefault<z.ZodString>;
2072
+ position_x: z.ZodDefault<z.ZodNumber>;
2073
+ position_y: z.ZodDefault<z.ZodNumber>;
2074
+ width: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
2075
+ height: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
2076
+ config: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
2077
+ subflow_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2078
+ parent_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2079
+ updated_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2080
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
2081
+ id: z.ZodString;
2082
+ workflow_id: z.ZodString;
2083
+ type: z.ZodString;
2084
+ label: z.ZodDefault<z.ZodString>;
2085
+ position_x: z.ZodDefault<z.ZodNumber>;
2086
+ position_y: z.ZodDefault<z.ZodNumber>;
2087
+ width: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
2088
+ height: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
2089
+ config: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
2090
+ subflow_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2091
+ parent_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2092
+ updated_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2093
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
2094
+ id: z.ZodString;
2095
+ workflow_id: z.ZodString;
2096
+ type: z.ZodString;
2097
+ label: z.ZodDefault<z.ZodString>;
2098
+ position_x: z.ZodDefault<z.ZodNumber>;
2099
+ position_y: z.ZodDefault<z.ZodNumber>;
2100
+ width: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
2101
+ height: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
2102
+ config: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
2103
+ subflow_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2104
+ parent_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2105
+ updated_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2106
+ }, z.ZodTypeAny, "passthrough">>, "many">>;
2107
+ edges: z.ZodDefault<z.ZodArray<z.ZodObject<{
2108
+ id: z.ZodString;
2109
+ workflow_id: z.ZodString;
2110
+ source_block: z.ZodString;
2111
+ target_block: z.ZodString;
2112
+ source_handle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2113
+ target_handle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2114
+ updated_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2115
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
2116
+ id: z.ZodString;
2117
+ workflow_id: z.ZodString;
2118
+ source_block: z.ZodString;
2119
+ target_block: z.ZodString;
2120
+ source_handle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2121
+ target_handle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2122
+ updated_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2123
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
2124
+ id: z.ZodString;
2125
+ workflow_id: z.ZodString;
2126
+ source_block: z.ZodString;
2127
+ target_block: z.ZodString;
2128
+ source_handle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2129
+ target_handle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2130
+ updated_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2131
+ }, z.ZodTypeAny, "passthrough">>, "many">>;
2132
+ subflows: z.ZodDefault<z.ZodArray<z.ZodObject<{
2133
+ id: z.ZodString;
2134
+ workflow_id: z.ZodString;
2135
+ type: z.ZodString;
2136
+ label: z.ZodDefault<z.ZodString>;
2137
+ position_x: z.ZodDefault<z.ZodNumber>;
2138
+ position_y: z.ZodDefault<z.ZodNumber>;
2139
+ width: z.ZodDefault<z.ZodNumber>;
2140
+ height: z.ZodDefault<z.ZodNumber>;
2141
+ config: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
2142
+ child_block_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2143
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
2144
+ id: z.ZodString;
2145
+ workflow_id: z.ZodString;
2146
+ type: z.ZodString;
2147
+ label: z.ZodDefault<z.ZodString>;
2148
+ position_x: z.ZodDefault<z.ZodNumber>;
2149
+ position_y: z.ZodDefault<z.ZodNumber>;
2150
+ width: z.ZodDefault<z.ZodNumber>;
2151
+ height: z.ZodDefault<z.ZodNumber>;
2152
+ config: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
2153
+ child_block_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2154
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
2155
+ id: z.ZodString;
2156
+ workflow_id: z.ZodString;
2157
+ type: z.ZodString;
2158
+ label: z.ZodDefault<z.ZodString>;
2159
+ position_x: z.ZodDefault<z.ZodNumber>;
2160
+ position_y: z.ZodDefault<z.ZodNumber>;
2161
+ width: z.ZodDefault<z.ZodNumber>;
2162
+ height: z.ZodDefault<z.ZodNumber>;
2163
+ config: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
2164
+ child_block_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2165
+ }, z.ZodTypeAny, "passthrough">>, "many">>;
2166
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
2167
+ workflow: z.ZodObject<{
2168
+ id: z.ZodString;
2169
+ name: z.ZodDefault<z.ZodString>;
2170
+ description: z.ZodDefault<z.ZodString>;
2171
+ is_published: z.ZodDefault<z.ZodBoolean>;
2172
+ published_snapshot_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2173
+ published_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2174
+ draft_version: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2175
+ organization_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2176
+ email_senders_whitelist: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2177
+ email_domains_whitelist: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2178
+ created_at: z.ZodString;
2179
+ updated_at: z.ZodString;
2180
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
2181
+ id: z.ZodString;
2182
+ name: z.ZodDefault<z.ZodString>;
2183
+ description: z.ZodDefault<z.ZodString>;
2184
+ is_published: z.ZodDefault<z.ZodBoolean>;
2185
+ published_snapshot_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2186
+ published_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2187
+ draft_version: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2188
+ organization_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2189
+ email_senders_whitelist: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2190
+ email_domains_whitelist: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2191
+ created_at: z.ZodString;
2192
+ updated_at: z.ZodString;
2193
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
2194
+ id: z.ZodString;
2195
+ name: z.ZodDefault<z.ZodString>;
2196
+ description: z.ZodDefault<z.ZodString>;
2197
+ is_published: z.ZodDefault<z.ZodBoolean>;
2198
+ published_snapshot_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2199
+ published_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2200
+ draft_version: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2201
+ organization_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2202
+ email_senders_whitelist: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2203
+ email_domains_whitelist: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2204
+ created_at: z.ZodString;
2205
+ updated_at: z.ZodString;
2206
+ }, z.ZodTypeAny, "passthrough">>;
2207
+ blocks: z.ZodDefault<z.ZodArray<z.ZodObject<{
2208
+ id: z.ZodString;
2209
+ workflow_id: z.ZodString;
2210
+ type: z.ZodString;
2211
+ label: z.ZodDefault<z.ZodString>;
2212
+ position_x: z.ZodDefault<z.ZodNumber>;
2213
+ position_y: z.ZodDefault<z.ZodNumber>;
2214
+ width: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
2215
+ height: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
2216
+ config: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
2217
+ subflow_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2218
+ parent_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2219
+ updated_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2220
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
2221
+ id: z.ZodString;
2222
+ workflow_id: z.ZodString;
2223
+ type: z.ZodString;
2224
+ label: z.ZodDefault<z.ZodString>;
2225
+ position_x: z.ZodDefault<z.ZodNumber>;
2226
+ position_y: z.ZodDefault<z.ZodNumber>;
2227
+ width: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
2228
+ height: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
2229
+ config: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
2230
+ subflow_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2231
+ parent_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2232
+ updated_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2233
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
2234
+ id: z.ZodString;
2235
+ workflow_id: z.ZodString;
2236
+ type: z.ZodString;
2237
+ label: z.ZodDefault<z.ZodString>;
2238
+ position_x: z.ZodDefault<z.ZodNumber>;
2239
+ position_y: z.ZodDefault<z.ZodNumber>;
2240
+ width: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
2241
+ height: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
2242
+ config: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
2243
+ subflow_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2244
+ parent_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2245
+ updated_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2246
+ }, z.ZodTypeAny, "passthrough">>, "many">>;
2247
+ edges: z.ZodDefault<z.ZodArray<z.ZodObject<{
2248
+ id: z.ZodString;
2249
+ workflow_id: z.ZodString;
2250
+ source_block: z.ZodString;
2251
+ target_block: z.ZodString;
2252
+ source_handle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2253
+ target_handle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2254
+ updated_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2255
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
2256
+ id: z.ZodString;
2257
+ workflow_id: z.ZodString;
2258
+ source_block: z.ZodString;
2259
+ target_block: z.ZodString;
2260
+ source_handle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2261
+ target_handle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2262
+ updated_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2263
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
2264
+ id: z.ZodString;
2265
+ workflow_id: z.ZodString;
2266
+ source_block: z.ZodString;
2267
+ target_block: z.ZodString;
2268
+ source_handle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2269
+ target_handle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2270
+ updated_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2271
+ }, z.ZodTypeAny, "passthrough">>, "many">>;
2272
+ subflows: z.ZodDefault<z.ZodArray<z.ZodObject<{
2273
+ id: z.ZodString;
2274
+ workflow_id: z.ZodString;
2275
+ type: z.ZodString;
2276
+ label: z.ZodDefault<z.ZodString>;
2277
+ position_x: z.ZodDefault<z.ZodNumber>;
2278
+ position_y: z.ZodDefault<z.ZodNumber>;
2279
+ width: z.ZodDefault<z.ZodNumber>;
2280
+ height: z.ZodDefault<z.ZodNumber>;
2281
+ config: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
2282
+ child_block_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2283
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
2284
+ id: z.ZodString;
2285
+ workflow_id: z.ZodString;
2286
+ type: z.ZodString;
2287
+ label: z.ZodDefault<z.ZodString>;
2288
+ position_x: z.ZodDefault<z.ZodNumber>;
2289
+ position_y: z.ZodDefault<z.ZodNumber>;
2290
+ width: z.ZodDefault<z.ZodNumber>;
2291
+ height: z.ZodDefault<z.ZodNumber>;
2292
+ config: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
2293
+ child_block_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2294
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
2295
+ id: z.ZodString;
2296
+ workflow_id: z.ZodString;
2297
+ type: z.ZodString;
2298
+ label: z.ZodDefault<z.ZodString>;
2299
+ position_x: z.ZodDefault<z.ZodNumber>;
2300
+ position_y: z.ZodDefault<z.ZodNumber>;
2301
+ width: z.ZodDefault<z.ZodNumber>;
2302
+ height: z.ZodDefault<z.ZodNumber>;
2303
+ config: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
2304
+ child_block_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2305
+ }, z.ZodTypeAny, "passthrough">>, "many">>;
2306
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
2307
+ workflow: z.ZodObject<{
2308
+ id: z.ZodString;
2309
+ name: z.ZodDefault<z.ZodString>;
2310
+ description: z.ZodDefault<z.ZodString>;
2311
+ is_published: z.ZodDefault<z.ZodBoolean>;
2312
+ published_snapshot_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2313
+ published_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2314
+ draft_version: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2315
+ organization_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2316
+ email_senders_whitelist: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2317
+ email_domains_whitelist: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2318
+ created_at: z.ZodString;
2319
+ updated_at: z.ZodString;
2320
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
2321
+ id: z.ZodString;
2322
+ name: z.ZodDefault<z.ZodString>;
2323
+ description: z.ZodDefault<z.ZodString>;
2324
+ is_published: z.ZodDefault<z.ZodBoolean>;
2325
+ published_snapshot_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2326
+ published_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2327
+ draft_version: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2328
+ organization_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2329
+ email_senders_whitelist: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2330
+ email_domains_whitelist: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2331
+ created_at: z.ZodString;
2332
+ updated_at: z.ZodString;
2333
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
2334
+ id: z.ZodString;
2335
+ name: z.ZodDefault<z.ZodString>;
2336
+ description: z.ZodDefault<z.ZodString>;
2337
+ is_published: z.ZodDefault<z.ZodBoolean>;
2338
+ published_snapshot_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2339
+ published_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2340
+ draft_version: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2341
+ organization_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2342
+ email_senders_whitelist: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2343
+ email_domains_whitelist: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2344
+ created_at: z.ZodString;
2345
+ updated_at: z.ZodString;
2346
+ }, z.ZodTypeAny, "passthrough">>;
2347
+ blocks: z.ZodDefault<z.ZodArray<z.ZodObject<{
2348
+ id: z.ZodString;
2349
+ workflow_id: z.ZodString;
2350
+ type: z.ZodString;
2351
+ label: z.ZodDefault<z.ZodString>;
2352
+ position_x: z.ZodDefault<z.ZodNumber>;
2353
+ position_y: z.ZodDefault<z.ZodNumber>;
2354
+ width: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
2355
+ height: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
2356
+ config: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
2357
+ subflow_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2358
+ parent_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2359
+ updated_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2360
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
2361
+ id: z.ZodString;
2362
+ workflow_id: z.ZodString;
2363
+ type: z.ZodString;
2364
+ label: z.ZodDefault<z.ZodString>;
2365
+ position_x: z.ZodDefault<z.ZodNumber>;
2366
+ position_y: z.ZodDefault<z.ZodNumber>;
2367
+ width: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
2368
+ height: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
2369
+ config: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
2370
+ subflow_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2371
+ parent_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2372
+ updated_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2373
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
2374
+ id: z.ZodString;
2375
+ workflow_id: z.ZodString;
2376
+ type: z.ZodString;
2377
+ label: z.ZodDefault<z.ZodString>;
2378
+ position_x: z.ZodDefault<z.ZodNumber>;
2379
+ position_y: z.ZodDefault<z.ZodNumber>;
2380
+ width: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
2381
+ height: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
2382
+ config: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
2383
+ subflow_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2384
+ parent_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2385
+ updated_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2386
+ }, z.ZodTypeAny, "passthrough">>, "many">>;
2387
+ edges: z.ZodDefault<z.ZodArray<z.ZodObject<{
2388
+ id: z.ZodString;
2389
+ workflow_id: z.ZodString;
2390
+ source_block: z.ZodString;
2391
+ target_block: z.ZodString;
2392
+ source_handle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2393
+ target_handle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2394
+ updated_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2395
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
2396
+ id: z.ZodString;
2397
+ workflow_id: z.ZodString;
2398
+ source_block: z.ZodString;
2399
+ target_block: z.ZodString;
2400
+ source_handle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2401
+ target_handle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2402
+ updated_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2403
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
2404
+ id: z.ZodString;
2405
+ workflow_id: z.ZodString;
2406
+ source_block: z.ZodString;
2407
+ target_block: z.ZodString;
2408
+ source_handle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2409
+ target_handle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2410
+ updated_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2411
+ }, z.ZodTypeAny, "passthrough">>, "many">>;
2412
+ subflows: z.ZodDefault<z.ZodArray<z.ZodObject<{
2413
+ id: z.ZodString;
2414
+ workflow_id: z.ZodString;
2415
+ type: z.ZodString;
2416
+ label: z.ZodDefault<z.ZodString>;
2417
+ position_x: z.ZodDefault<z.ZodNumber>;
2418
+ position_y: z.ZodDefault<z.ZodNumber>;
2419
+ width: z.ZodDefault<z.ZodNumber>;
2420
+ height: z.ZodDefault<z.ZodNumber>;
2421
+ config: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
2422
+ child_block_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2423
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
2424
+ id: z.ZodString;
2425
+ workflow_id: z.ZodString;
2426
+ type: z.ZodString;
2427
+ label: z.ZodDefault<z.ZodString>;
2428
+ position_x: z.ZodDefault<z.ZodNumber>;
2429
+ position_y: z.ZodDefault<z.ZodNumber>;
2430
+ width: z.ZodDefault<z.ZodNumber>;
2431
+ height: z.ZodDefault<z.ZodNumber>;
2432
+ config: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
2433
+ child_block_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2434
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
2435
+ id: z.ZodString;
2436
+ workflow_id: z.ZodString;
2437
+ type: z.ZodString;
2438
+ label: z.ZodDefault<z.ZodString>;
2439
+ position_x: z.ZodDefault<z.ZodNumber>;
2440
+ position_y: z.ZodDefault<z.ZodNumber>;
2441
+ width: z.ZodDefault<z.ZodNumber>;
2442
+ height: z.ZodDefault<z.ZodNumber>;
2443
+ config: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
2444
+ child_block_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2445
+ }, z.ZodTypeAny, "passthrough">>, "many">>;
2446
+ }, z.ZodTypeAny, "passthrough">>;
2447
+ export type WorkflowWithEntities = z.infer<typeof ZWorkflowWithEntities>;
2448
+ export type WorkflowRunStatus = "pending" | "running" | "completed" | "error" | "waiting_for_human" | "cancelled";
2449
+ export type WorkflowRunTriggerType = "manual" | "api" | "schedule" | "webhook" | "email" | "restart";
2450
+ export type WorkflowBlockCreateRequest = {
2451
+ id: string;
2452
+ type: string;
2453
+ label?: string;
2454
+ positionX?: number;
2455
+ positionY?: number;
2456
+ width?: number;
2457
+ height?: number;
2458
+ config?: Record<string, unknown>;
2459
+ subflowId?: string;
2460
+ parentId?: string;
2461
+ };
2462
+ export type WorkflowBlockUpdateRequest = {
2463
+ label?: string;
2464
+ positionX?: number;
2465
+ positionY?: number;
2466
+ width?: number;
2467
+ height?: number;
2468
+ config?: Record<string, unknown>;
2469
+ subflowId?: string;
2470
+ parentId?: string;
2471
+ };
2472
+ export type WorkflowEdgeCreateRequest = {
2473
+ id: string;
2474
+ sourceBlock: string;
2475
+ targetBlock: string;
2476
+ sourceHandle?: string;
2477
+ targetHandle?: string;
2478
+ };
2479
+ export declare const ZWorkflowRunExportResponse: z.ZodObject<{
2480
+ csv_data: z.ZodString;
2481
+ rows: z.ZodNumber;
2482
+ columns: z.ZodNumber;
2483
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
2484
+ csv_data: z.ZodString;
2485
+ rows: z.ZodNumber;
2486
+ columns: z.ZodNumber;
2487
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
2488
+ csv_data: z.ZodString;
2489
+ rows: z.ZodNumber;
2490
+ columns: z.ZodNumber;
2491
+ }, z.ZodTypeAny, "passthrough">>;
2492
+ export type WorkflowRunExportResponse = z.infer<typeof ZWorkflowRunExportResponse>;
2493
+ /**
2494
+ * Error thrown by {@link raiseForStatus} when a workflow run has failed.
2495
+ */
2496
+ export declare class WorkflowRunError extends Error {
2497
+ readonly run: generated.WorkflowRun;
2498
+ constructor(run: generated.WorkflowRun);
2499
+ }
2500
+ /**
2501
+ * Throw a {@link WorkflowRunError} if the run did not succeed.
2502
+ * Modelled after `httpx.Response.raise_for_status()`.
2503
+ */
2504
+ export declare function raiseForStatus(run: generated.WorkflowRun): void;
1147
2505
  export declare const ZModel: z.ZodLazy<z.ZodObject<{
1148
2506
  id: z.ZodString;
1149
2507
  created: z.ZodNumber;