@scenario-labs/sdk 2.2.1 → 2.4.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (163) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/client.d.mts.map +1 -1
  3. package/client.d.ts.map +1 -1
  4. package/client.js +9 -1
  5. package/client.js.map +1 -1
  6. package/client.mjs +9 -1
  7. package/client.mjs.map +1 -1
  8. package/index.d.mts +1 -0
  9. package/index.d.mts.map +1 -1
  10. package/index.d.ts +1 -0
  11. package/index.d.ts.map +1 -1
  12. package/index.js +3 -1
  13. package/index.js.map +1 -1
  14. package/index.mjs +1 -0
  15. package/index.mjs.map +1 -1
  16. package/lib/auth-refresh.d.mts +52 -0
  17. package/lib/auth-refresh.d.mts.map +1 -0
  18. package/lib/auth-refresh.d.ts +52 -0
  19. package/lib/auth-refresh.d.ts.map +1 -0
  20. package/lib/auth-refresh.js +81 -0
  21. package/lib/auth-refresh.js.map +1 -0
  22. package/lib/auth-refresh.mjs +78 -0
  23. package/lib/auth-refresh.mjs.map +1 -0
  24. package/lib/generate.js +7 -7
  25. package/lib/generate.js.map +1 -1
  26. package/lib/generate.mjs +7 -7
  27. package/lib/generate.mjs.map +1 -1
  28. package/lib/job.d.mts +15 -3
  29. package/lib/job.d.mts.map +1 -1
  30. package/lib/job.d.ts +15 -3
  31. package/lib/job.d.ts.map +1 -1
  32. package/lib/job.js +22 -8
  33. package/lib/job.js.map +1 -1
  34. package/lib/job.mjs +22 -8
  35. package/lib/job.mjs.map +1 -1
  36. package/lib/models.d.mts +8 -2
  37. package/lib/models.d.mts.map +1 -1
  38. package/lib/models.d.ts +8 -2
  39. package/lib/models.d.ts.map +1 -1
  40. package/lib/models.js +13 -5
  41. package/lib/models.js.map +1 -1
  42. package/lib/models.mjs +13 -5
  43. package/lib/models.mjs.map +1 -1
  44. package/lib/scenario.d.mts +28 -13
  45. package/lib/scenario.d.mts.map +1 -1
  46. package/lib/scenario.d.ts +28 -13
  47. package/lib/scenario.d.ts.map +1 -1
  48. package/lib/scenario.js +31 -12
  49. package/lib/scenario.js.map +1 -1
  50. package/lib/scenario.mjs +31 -12
  51. package/lib/scenario.mjs.map +1 -1
  52. package/lib/scope.d.mts +41 -0
  53. package/lib/scope.d.mts.map +1 -0
  54. package/lib/scope.d.ts +41 -0
  55. package/lib/scope.d.ts.map +1 -0
  56. package/lib/scope.js +55 -0
  57. package/lib/scope.js.map +1 -0
  58. package/lib/scope.mjs +49 -0
  59. package/lib/scope.mjs.map +1 -0
  60. package/lib/upload.d.mts +15 -3
  61. package/lib/upload.d.mts.map +1 -1
  62. package/lib/upload.d.ts +15 -3
  63. package/lib/upload.d.ts.map +1 -1
  64. package/lib/upload.js +29 -12
  65. package/lib/upload.js.map +1 -1
  66. package/lib/upload.mjs +29 -12
  67. package/lib/upload.mjs.map +1 -1
  68. package/lib/workflow.d.mts +8 -2
  69. package/lib/workflow.d.mts.map +1 -1
  70. package/lib/workflow.d.ts +8 -2
  71. package/lib/workflow.d.ts.map +1 -1
  72. package/lib/workflow.js +14 -6
  73. package/lib/workflow.js.map +1 -1
  74. package/lib/workflow.mjs +14 -6
  75. package/lib/workflow.mjs.map +1 -1
  76. package/lib/workflow_converter.d.mts +8 -2
  77. package/lib/workflow_converter.d.mts.map +1 -1
  78. package/lib/workflow_converter.d.ts +8 -2
  79. package/lib/workflow_converter.d.ts.map +1 -1
  80. package/lib/workflow_converter.js +83 -19
  81. package/lib/workflow_converter.js.map +1 -1
  82. package/lib/workflow_converter.mjs +83 -19
  83. package/lib/workflow_converter.mjs.map +1 -1
  84. package/lib/workflow_import_validator.d.mts +1 -1
  85. package/lib/workflow_import_validator.d.mts.map +1 -1
  86. package/lib/workflow_import_validator.d.ts +1 -1
  87. package/lib/workflow_import_validator.d.ts.map +1 -1
  88. package/lib/workflow_import_validator.js +1 -0
  89. package/lib/workflow_import_validator.js.map +1 -1
  90. package/lib/workflow_import_validator.mjs +1 -0
  91. package/lib/workflow_import_validator.mjs.map +1 -1
  92. package/package.json +9 -3
  93. package/resources/assets/assets.d.mts +1 -1
  94. package/resources/assets/assets.d.mts.map +1 -1
  95. package/resources/assets/assets.d.ts +1 -1
  96. package/resources/assets/assets.d.ts.map +1 -1
  97. package/resources/generate.d.mts +594 -10
  98. package/resources/generate.d.mts.map +1 -1
  99. package/resources/generate.d.ts +594 -10
  100. package/resources/generate.d.ts.map +1 -1
  101. package/resources/generate.js +2 -2
  102. package/resources/generate.js.map +1 -1
  103. package/resources/generate.mjs +2 -2
  104. package/resources/generate.mjs.map +1 -1
  105. package/resources/jobs.d.mts +3 -3
  106. package/resources/jobs.d.mts.map +1 -1
  107. package/resources/jobs.d.ts +3 -3
  108. package/resources/jobs.d.ts.map +1 -1
  109. package/resources/models/examples.d.mts +2 -2
  110. package/resources/models/examples.d.mts.map +1 -1
  111. package/resources/models/examples.d.ts +2 -2
  112. package/resources/models/examples.d.ts.map +1 -1
  113. package/resources/models/models.d.mts +126 -7
  114. package/resources/models/models.d.mts.map +1 -1
  115. package/resources/models/models.d.ts +126 -7
  116. package/resources/models/models.d.ts.map +1 -1
  117. package/resources/models/models.js.map +1 -1
  118. package/resources/models/models.mjs.map +1 -1
  119. package/resources/models/train.d.mts +106 -3
  120. package/resources/models/train.d.mts.map +1 -1
  121. package/resources/models/train.d.ts +106 -3
  122. package/resources/models/train.d.ts.map +1 -1
  123. package/resources/usages.d.mts +23 -3
  124. package/resources/usages.d.mts.map +1 -1
  125. package/resources/usages.d.ts +23 -3
  126. package/resources/usages.d.ts.map +1 -1
  127. package/resources/workflows.d.mts +22 -5
  128. package/resources/workflows.d.mts.map +1 -1
  129. package/resources/workflows.d.ts +22 -5
  130. package/resources/workflows.d.ts.map +1 -1
  131. package/resources/workflows.js +4 -1
  132. package/resources/workflows.js.map +1 -1
  133. package/resources/workflows.mjs +4 -1
  134. package/resources/workflows.mjs.map +1 -1
  135. package/src/client.ts +9 -1
  136. package/src/index.ts +1 -0
  137. package/src/lib/auth-refresh.ts +98 -0
  138. package/src/lib/generate.ts +7 -7
  139. package/src/lib/job.ts +29 -7
  140. package/src/lib/models.ts +14 -4
  141. package/src/lib/scenario.ts +51 -13
  142. package/src/lib/scope.ts +68 -0
  143. package/src/lib/upload.ts +36 -11
  144. package/src/lib/workflow.ts +15 -5
  145. package/src/lib/workflow_converter.ts +128 -19
  146. package/src/lib/workflow_import_validator.ts +3 -1
  147. package/src/resources/assets/assets.ts +1 -1
  148. package/src/resources/generate.ts +713 -12
  149. package/src/resources/jobs.ts +3 -3
  150. package/src/resources/models/examples.ts +2 -2
  151. package/src/resources/models/models.ts +189 -7
  152. package/src/resources/models/train.ts +138 -3
  153. package/src/resources/usages.ts +27 -1
  154. package/src/resources/workflows.ts +24 -5
  155. package/src/version.ts +1 -1
  156. package/version.d.mts +1 -1
  157. package/version.d.mts.map +1 -1
  158. package/version.d.ts +1 -1
  159. package/version.d.ts.map +1 -1
  160. package/version.js +1 -1
  161. package/version.js.map +1 -1
  162. package/version.mjs +1 -1
  163. package/version.mjs.map +1 -1
@@ -63,6 +63,10 @@ export interface GenerateCaptionResponse {
63
63
  * ignored.
64
64
  */
65
65
  detailsLevel?: 'action' | 'action+style';
66
+ /**
67
+ * IP detection findings, when detection ran for this request.
68
+ */
69
+ ipDetection?: GenerateCaptionResponse.IPDetection;
66
70
  }
67
71
  export declare namespace GenerateCaptionResponse {
68
72
  interface Job {
@@ -169,7 +173,7 @@ export declare namespace GenerateCaptionResponse {
169
173
  /**
170
174
  * The status of the node. Only available for WorkflowJob nodes.
171
175
  */
172
- status: 'failure' | 'pending' | 'processing' | 'skipped' | 'success';
176
+ status: 'failure' | 'pending' | 'processing' | 'rejected' | 'skipped' | 'success';
173
177
  /**
174
178
  * The type of the job for the node.
175
179
  */
@@ -748,6 +752,71 @@ export declare namespace GenerateCaptionResponse {
748
752
  cuDiscount: number;
749
753
  }
750
754
  }
755
+ /**
756
+ * IP detection findings, when detection ran for this request.
757
+ */
758
+ interface IPDetection {
759
+ /**
760
+ * Whether and how detection affected the request.
761
+ */
762
+ action: 'allowed' | 'blocked' | 'flagged';
763
+ /**
764
+ * IP-detection CU fee, separate from creativeUnitsCost: a fixed base fee plus a
765
+ * per-image fee for each analyzed input image.
766
+ */
767
+ creativeUnitsCharged: number;
768
+ /**
769
+ * Number of enabled filters evaluated for this request.
770
+ */
771
+ evaluatedFilters: number;
772
+ /**
773
+ * Per-filter verdicts gathered for this request.
774
+ */
775
+ findings: Array<IPDetection.Finding>;
776
+ /**
777
+ * Convenience flag; always true when action is not 'allowed'.
778
+ */
779
+ flagged: boolean;
780
+ /**
781
+ * True if one or more detectors errored while evaluating this request.
782
+ */
783
+ hasDetectorError?: boolean;
784
+ }
785
+ namespace IPDetection {
786
+ /**
787
+ * A single filter's verdict.
788
+ */
789
+ interface Finding {
790
+ /**
791
+ * Category of the filter that produced this verdict.
792
+ */
793
+ category: 'artist-style' | 'brand-trademark' | 'celebrity-likeness' | 'custom' | 'fictional-character';
794
+ /**
795
+ * Confidence score from 0 (low) to 1 (high).
796
+ */
797
+ confidence: number;
798
+ /**
799
+ * Identifier of the filter that produced this verdict.
800
+ */
801
+ filterId: string;
802
+ /**
803
+ * Display name of the filter that produced this verdict.
804
+ */
805
+ filterName: string;
806
+ /**
807
+ * Whether this filter considered the request an IP risk.
808
+ */
809
+ flagged: boolean;
810
+ /**
811
+ * Short, user-facing explanation of the verdict.
812
+ */
813
+ reason: string;
814
+ /**
815
+ * Named entities the filter recognized (e.g. characters, brands, people).
816
+ */
817
+ entities?: Array<string>;
818
+ }
819
+ }
751
820
  }
752
821
  export interface GenerateDescribeStyleResponse {
753
822
  /**
@@ -767,6 +836,10 @@ export interface GenerateDescribeStyleResponse {
767
836
  * The Creative Units discount for the request billed
768
837
  */
769
838
  creativeUnitsDiscount?: number;
839
+ /**
840
+ * IP detection findings, when detection ran for this request.
841
+ */
842
+ ipDetection?: GenerateDescribeStyleResponse.IPDetection;
770
843
  }
771
844
  export declare namespace GenerateDescribeStyleResponse {
772
845
  interface Job {
@@ -873,7 +946,7 @@ export declare namespace GenerateDescribeStyleResponse {
873
946
  /**
874
947
  * The status of the node. Only available for WorkflowJob nodes.
875
948
  */
876
- status: 'failure' | 'pending' | 'processing' | 'skipped' | 'success';
949
+ status: 'failure' | 'pending' | 'processing' | 'rejected' | 'skipped' | 'success';
877
950
  /**
878
951
  * The type of the job for the node.
879
952
  */
@@ -1452,6 +1525,71 @@ export declare namespace GenerateDescribeStyleResponse {
1452
1525
  cuDiscount: number;
1453
1526
  }
1454
1527
  }
1528
+ /**
1529
+ * IP detection findings, when detection ran for this request.
1530
+ */
1531
+ interface IPDetection {
1532
+ /**
1533
+ * Whether and how detection affected the request.
1534
+ */
1535
+ action: 'allowed' | 'blocked' | 'flagged';
1536
+ /**
1537
+ * IP-detection CU fee, separate from creativeUnitsCost: a fixed base fee plus a
1538
+ * per-image fee for each analyzed input image.
1539
+ */
1540
+ creativeUnitsCharged: number;
1541
+ /**
1542
+ * Number of enabled filters evaluated for this request.
1543
+ */
1544
+ evaluatedFilters: number;
1545
+ /**
1546
+ * Per-filter verdicts gathered for this request.
1547
+ */
1548
+ findings: Array<IPDetection.Finding>;
1549
+ /**
1550
+ * Convenience flag; always true when action is not 'allowed'.
1551
+ */
1552
+ flagged: boolean;
1553
+ /**
1554
+ * True if one or more detectors errored while evaluating this request.
1555
+ */
1556
+ hasDetectorError?: boolean;
1557
+ }
1558
+ namespace IPDetection {
1559
+ /**
1560
+ * A single filter's verdict.
1561
+ */
1562
+ interface Finding {
1563
+ /**
1564
+ * Category of the filter that produced this verdict.
1565
+ */
1566
+ category: 'artist-style' | 'brand-trademark' | 'celebrity-likeness' | 'custom' | 'fictional-character';
1567
+ /**
1568
+ * Confidence score from 0 (low) to 1 (high).
1569
+ */
1570
+ confidence: number;
1571
+ /**
1572
+ * Identifier of the filter that produced this verdict.
1573
+ */
1574
+ filterId: string;
1575
+ /**
1576
+ * Display name of the filter that produced this verdict.
1577
+ */
1578
+ filterName: string;
1579
+ /**
1580
+ * Whether this filter considered the request an IP risk.
1581
+ */
1582
+ flagged: boolean;
1583
+ /**
1584
+ * Short, user-facing explanation of the verdict.
1585
+ */
1586
+ reason: string;
1587
+ /**
1588
+ * Named entities the filter recognized (e.g. characters, brands, people).
1589
+ */
1590
+ entities?: Array<string>;
1591
+ }
1592
+ }
1455
1593
  }
1456
1594
  export interface GenerateDetectResponse {
1457
1595
  job: GenerateDetectResponse.Job;
@@ -1464,6 +1602,10 @@ export interface GenerateDetectResponse {
1464
1602
  * The Creative Units discount for the request billed
1465
1603
  */
1466
1604
  creativeUnitsDiscount?: number;
1605
+ /**
1606
+ * IP detection findings, when detection ran for this request.
1607
+ */
1608
+ ipDetection?: GenerateDetectResponse.IPDetection;
1467
1609
  }
1468
1610
  export declare namespace GenerateDetectResponse {
1469
1611
  interface Job {
@@ -1570,7 +1712,7 @@ export declare namespace GenerateDetectResponse {
1570
1712
  /**
1571
1713
  * The status of the node. Only available for WorkflowJob nodes.
1572
1714
  */
1573
- status: 'failure' | 'pending' | 'processing' | 'skipped' | 'success';
1715
+ status: 'failure' | 'pending' | 'processing' | 'rejected' | 'skipped' | 'success';
1574
1716
  /**
1575
1717
  * The type of the job for the node.
1576
1718
  */
@@ -2870,6 +3012,71 @@ export declare namespace GenerateDetectResponse {
2870
3012
  url: string;
2871
3013
  }
2872
3014
  }
3015
+ /**
3016
+ * IP detection findings, when detection ran for this request.
3017
+ */
3018
+ interface IPDetection {
3019
+ /**
3020
+ * Whether and how detection affected the request.
3021
+ */
3022
+ action: 'allowed' | 'blocked' | 'flagged';
3023
+ /**
3024
+ * IP-detection CU fee, separate from creativeUnitsCost: a fixed base fee plus a
3025
+ * per-image fee for each analyzed input image.
3026
+ */
3027
+ creativeUnitsCharged: number;
3028
+ /**
3029
+ * Number of enabled filters evaluated for this request.
3030
+ */
3031
+ evaluatedFilters: number;
3032
+ /**
3033
+ * Per-filter verdicts gathered for this request.
3034
+ */
3035
+ findings: Array<IPDetection.Finding>;
3036
+ /**
3037
+ * Convenience flag; always true when action is not 'allowed'.
3038
+ */
3039
+ flagged: boolean;
3040
+ /**
3041
+ * True if one or more detectors errored while evaluating this request.
3042
+ */
3043
+ hasDetectorError?: boolean;
3044
+ }
3045
+ namespace IPDetection {
3046
+ /**
3047
+ * A single filter's verdict.
3048
+ */
3049
+ interface Finding {
3050
+ /**
3051
+ * Category of the filter that produced this verdict.
3052
+ */
3053
+ category: 'artist-style' | 'brand-trademark' | 'celebrity-likeness' | 'custom' | 'fictional-character';
3054
+ /**
3055
+ * Confidence score from 0 (low) to 1 (high).
3056
+ */
3057
+ confidence: number;
3058
+ /**
3059
+ * Identifier of the filter that produced this verdict.
3060
+ */
3061
+ filterId: string;
3062
+ /**
3063
+ * Display name of the filter that produced this verdict.
3064
+ */
3065
+ filterName: string;
3066
+ /**
3067
+ * Whether this filter considered the request an IP risk.
3068
+ */
3069
+ flagged: boolean;
3070
+ /**
3071
+ * Short, user-facing explanation of the verdict.
3072
+ */
3073
+ reason: string;
3074
+ /**
3075
+ * Named entities the filter recognized (e.g. characters, brands, people).
3076
+ */
3077
+ entities?: Array<string>;
3078
+ }
3079
+ }
2873
3080
  }
2874
3081
  export interface GenerateEmbedResponse {
2875
3082
  /**
@@ -2887,6 +3094,10 @@ export interface GenerateEmbedResponse {
2887
3094
  * The Creative Units discount for the request billed
2888
3095
  */
2889
3096
  creativeUnitsDiscount?: number;
3097
+ /**
3098
+ * IP detection findings, when detection ran for this request.
3099
+ */
3100
+ ipDetection?: GenerateEmbedResponse.IPDetection;
2890
3101
  }
2891
3102
  export declare namespace GenerateEmbedResponse {
2892
3103
  interface Job {
@@ -2993,7 +3204,7 @@ export declare namespace GenerateEmbedResponse {
2993
3204
  /**
2994
3205
  * The status of the node. Only available for WorkflowJob nodes.
2995
3206
  */
2996
- status: 'failure' | 'pending' | 'processing' | 'skipped' | 'success';
3207
+ status: 'failure' | 'pending' | 'processing' | 'rejected' | 'skipped' | 'success';
2997
3208
  /**
2998
3209
  * The type of the job for the node.
2999
3210
  */
@@ -3572,6 +3783,71 @@ export declare namespace GenerateEmbedResponse {
3572
3783
  cuDiscount: number;
3573
3784
  }
3574
3785
  }
3786
+ /**
3787
+ * IP detection findings, when detection ran for this request.
3788
+ */
3789
+ interface IPDetection {
3790
+ /**
3791
+ * Whether and how detection affected the request.
3792
+ */
3793
+ action: 'allowed' | 'blocked' | 'flagged';
3794
+ /**
3795
+ * IP-detection CU fee, separate from creativeUnitsCost: a fixed base fee plus a
3796
+ * per-image fee for each analyzed input image.
3797
+ */
3798
+ creativeUnitsCharged: number;
3799
+ /**
3800
+ * Number of enabled filters evaluated for this request.
3801
+ */
3802
+ evaluatedFilters: number;
3803
+ /**
3804
+ * Per-filter verdicts gathered for this request.
3805
+ */
3806
+ findings: Array<IPDetection.Finding>;
3807
+ /**
3808
+ * Convenience flag; always true when action is not 'allowed'.
3809
+ */
3810
+ flagged: boolean;
3811
+ /**
3812
+ * True if one or more detectors errored while evaluating this request.
3813
+ */
3814
+ hasDetectorError?: boolean;
3815
+ }
3816
+ namespace IPDetection {
3817
+ /**
3818
+ * A single filter's verdict.
3819
+ */
3820
+ interface Finding {
3821
+ /**
3822
+ * Category of the filter that produced this verdict.
3823
+ */
3824
+ category: 'artist-style' | 'brand-trademark' | 'celebrity-likeness' | 'custom' | 'fictional-character';
3825
+ /**
3826
+ * Confidence score from 0 (low) to 1 (high).
3827
+ */
3828
+ confidence: number;
3829
+ /**
3830
+ * Identifier of the filter that produced this verdict.
3831
+ */
3832
+ filterId: string;
3833
+ /**
3834
+ * Display name of the filter that produced this verdict.
3835
+ */
3836
+ filterName: string;
3837
+ /**
3838
+ * Whether this filter considered the request an IP risk.
3839
+ */
3840
+ flagged: boolean;
3841
+ /**
3842
+ * Short, user-facing explanation of the verdict.
3843
+ */
3844
+ reason: string;
3845
+ /**
3846
+ * Named entities the filter recognized (e.g. characters, brands, people).
3847
+ */
3848
+ entities?: Array<string>;
3849
+ }
3850
+ }
3575
3851
  }
3576
3852
  export interface GeneratePatchResponse {
3577
3853
  job: GeneratePatchResponse.Job;
@@ -3584,6 +3860,10 @@ export interface GeneratePatchResponse {
3584
3860
  * The Creative Units discount for the request billed
3585
3861
  */
3586
3862
  creativeUnitsDiscount?: number;
3863
+ /**
3864
+ * IP detection findings, when detection ran for this request.
3865
+ */
3866
+ ipDetection?: GeneratePatchResponse.IPDetection;
3587
3867
  }
3588
3868
  export declare namespace GeneratePatchResponse {
3589
3869
  interface Job {
@@ -3690,7 +3970,7 @@ export declare namespace GeneratePatchResponse {
3690
3970
  /**
3691
3971
  * The status of the node. Only available for WorkflowJob nodes.
3692
3972
  */
3693
- status: 'failure' | 'pending' | 'processing' | 'skipped' | 'success';
3973
+ status: 'failure' | 'pending' | 'processing' | 'rejected' | 'skipped' | 'success';
3694
3974
  /**
3695
3975
  * The type of the job for the node.
3696
3976
  */
@@ -4990,6 +5270,71 @@ export declare namespace GeneratePatchResponse {
4990
5270
  url: string;
4991
5271
  }
4992
5272
  }
5273
+ /**
5274
+ * IP detection findings, when detection ran for this request.
5275
+ */
5276
+ interface IPDetection {
5277
+ /**
5278
+ * Whether and how detection affected the request.
5279
+ */
5280
+ action: 'allowed' | 'blocked' | 'flagged';
5281
+ /**
5282
+ * IP-detection CU fee, separate from creativeUnitsCost: a fixed base fee plus a
5283
+ * per-image fee for each analyzed input image.
5284
+ */
5285
+ creativeUnitsCharged: number;
5286
+ /**
5287
+ * Number of enabled filters evaluated for this request.
5288
+ */
5289
+ evaluatedFilters: number;
5290
+ /**
5291
+ * Per-filter verdicts gathered for this request.
5292
+ */
5293
+ findings: Array<IPDetection.Finding>;
5294
+ /**
5295
+ * Convenience flag; always true when action is not 'allowed'.
5296
+ */
5297
+ flagged: boolean;
5298
+ /**
5299
+ * True if one or more detectors errored while evaluating this request.
5300
+ */
5301
+ hasDetectorError?: boolean;
5302
+ }
5303
+ namespace IPDetection {
5304
+ /**
5305
+ * A single filter's verdict.
5306
+ */
5307
+ interface Finding {
5308
+ /**
5309
+ * Category of the filter that produced this verdict.
5310
+ */
5311
+ category: 'artist-style' | 'brand-trademark' | 'celebrity-likeness' | 'custom' | 'fictional-character';
5312
+ /**
5313
+ * Confidence score from 0 (low) to 1 (high).
5314
+ */
5315
+ confidence: number;
5316
+ /**
5317
+ * Identifier of the filter that produced this verdict.
5318
+ */
5319
+ filterId: string;
5320
+ /**
5321
+ * Display name of the filter that produced this verdict.
5322
+ */
5323
+ filterName: string;
5324
+ /**
5325
+ * Whether this filter considered the request an IP risk.
5326
+ */
5327
+ flagged: boolean;
5328
+ /**
5329
+ * Short, user-facing explanation of the verdict.
5330
+ */
5331
+ reason: string;
5332
+ /**
5333
+ * Named entities the filter recognized (e.g. characters, brands, people).
5334
+ */
5335
+ entities?: Array<string>;
5336
+ }
5337
+ }
4993
5338
  }
4994
5339
  export interface GeneratePromptResponse {
4995
5340
  job: GeneratePromptResponse.Job;
@@ -4997,6 +5342,11 @@ export interface GeneratePromptResponse {
4997
5342
  * The generated prompts.
4998
5343
  */
4999
5344
  prompts: Array<string>;
5345
+ /**
5346
+ * The full ready-to-run model calls, index-aligned with `prompts`: `prompts[i]` is
5347
+ * the prompt text of `calls[i]`.
5348
+ */
5349
+ calls?: Array<GeneratePromptResponse.Call>;
5000
5350
  /**
5001
5351
  * The Creative Units cost for the request billed
5002
5352
  */
@@ -5005,10 +5355,14 @@ export interface GeneratePromptResponse {
5005
5355
  * The Creative Units discount for the request billed
5006
5356
  */
5007
5357
  creativeUnitsDiscount?: number;
5358
+ /**
5359
+ * IP detection findings, when detection ran for this request.
5360
+ */
5361
+ ipDetection?: GeneratePromptResponse.IPDetection;
5008
5362
  /**
5009
5363
  * The mode used to generate new prompt(s).
5010
5364
  */
5011
- mode?: 'completion' | 'contextual' | 'image-editing' | 'inventive' | 'structured';
5365
+ mode?: 'completion' | 'contextual' | 'contextual-v2' | 'image-editing' | 'inventive' | 'structured';
5012
5366
  }
5013
5367
  export declare namespace GeneratePromptResponse {
5014
5368
  interface Job {
@@ -5115,7 +5469,7 @@ export declare namespace GeneratePromptResponse {
5115
5469
  /**
5116
5470
  * The status of the node. Only available for WorkflowJob nodes.
5117
5471
  */
5118
- status: 'failure' | 'pending' | 'processing' | 'skipped' | 'success';
5472
+ status: 'failure' | 'pending' | 'processing' | 'rejected' | 'skipped' | 'success';
5119
5473
  /**
5120
5474
  * The type of the job for the node.
5121
5475
  */
@@ -5694,6 +6048,92 @@ export declare namespace GeneratePromptResponse {
5694
6048
  cuDiscount: number;
5695
6049
  }
5696
6050
  }
6051
+ /**
6052
+ * A complete, ready-to-run model call proposed by Prompt Spark v3.
6053
+ *
6054
+ * The prompt text is carried inside `parameters` under the target model's prompt
6055
+ * input (when the model defines one). For models without a prompt input, the text
6056
+ * is only available in the index-aligned `prompts` array.
6057
+ */
6058
+ interface Call {
6059
+ /**
6060
+ * The target model the call is for.
6061
+ */
6062
+ modelId: string;
6063
+ /**
6064
+ * Schema-valid dynamic parameters for the target model, prompt included.
6065
+ */
6066
+ parameters: unknown;
6067
+ /**
6068
+ * Optional rationale for the proposed call.
6069
+ */
6070
+ rationale?: string;
6071
+ }
6072
+ /**
6073
+ * IP detection findings, when detection ran for this request.
6074
+ */
6075
+ interface IPDetection {
6076
+ /**
6077
+ * Whether and how detection affected the request.
6078
+ */
6079
+ action: 'allowed' | 'blocked' | 'flagged';
6080
+ /**
6081
+ * IP-detection CU fee, separate from creativeUnitsCost: a fixed base fee plus a
6082
+ * per-image fee for each analyzed input image.
6083
+ */
6084
+ creativeUnitsCharged: number;
6085
+ /**
6086
+ * Number of enabled filters evaluated for this request.
6087
+ */
6088
+ evaluatedFilters: number;
6089
+ /**
6090
+ * Per-filter verdicts gathered for this request.
6091
+ */
6092
+ findings: Array<IPDetection.Finding>;
6093
+ /**
6094
+ * Convenience flag; always true when action is not 'allowed'.
6095
+ */
6096
+ flagged: boolean;
6097
+ /**
6098
+ * True if one or more detectors errored while evaluating this request.
6099
+ */
6100
+ hasDetectorError?: boolean;
6101
+ }
6102
+ namespace IPDetection {
6103
+ /**
6104
+ * A single filter's verdict.
6105
+ */
6106
+ interface Finding {
6107
+ /**
6108
+ * Category of the filter that produced this verdict.
6109
+ */
6110
+ category: 'artist-style' | 'brand-trademark' | 'celebrity-likeness' | 'custom' | 'fictional-character';
6111
+ /**
6112
+ * Confidence score from 0 (low) to 1 (high).
6113
+ */
6114
+ confidence: number;
6115
+ /**
6116
+ * Identifier of the filter that produced this verdict.
6117
+ */
6118
+ filterId: string;
6119
+ /**
6120
+ * Display name of the filter that produced this verdict.
6121
+ */
6122
+ filterName: string;
6123
+ /**
6124
+ * Whether this filter considered the request an IP risk.
6125
+ */
6126
+ flagged: boolean;
6127
+ /**
6128
+ * Short, user-facing explanation of the verdict.
6129
+ */
6130
+ reason: string;
6131
+ /**
6132
+ * Named entities the filter recognized (e.g. characters, brands, people).
6133
+ */
6134
+ entities?: Array<string>;
6135
+ }
6136
+ }
5697
6137
  }
5698
6138
  export interface GenerateRunModelResponse {
5699
6139
  job: GenerateRunModelResponse.Job;
@@ -5705,6 +6145,10 @@ export interface GenerateRunModelResponse {
5705
6145
  * The Creative Units discount for the request billed
5706
6146
  */
5707
6147
  creativeUnitsDiscount?: number;
6148
+ /**
6149
+ * IP detection findings, when detection ran for this request.
6150
+ */
6151
+ ipDetection?: GenerateRunModelResponse.IPDetection;
5708
6152
  }
5709
6153
  export declare namespace GenerateRunModelResponse {
5710
6154
  interface Job {
@@ -5811,7 +6255,7 @@ export declare namespace GenerateRunModelResponse {
5811
6255
  /**
5812
6256
  * The status of the node. Only available for WorkflowJob nodes.
5813
6257
  */
5814
- status: 'failure' | 'pending' | 'processing' | 'skipped' | 'success';
6258
+ status: 'failure' | 'pending' | 'processing' | 'rejected' | 'skipped' | 'success';
5815
6259
  /**
5816
6260
  * The type of the job for the node.
5817
6261
  */
@@ -6390,6 +6834,71 @@ export declare namespace GenerateRunModelResponse {
6390
6834
  cuDiscount: number;
6391
6835
  }
6392
6836
  }
6837
+ /**
6838
+ * IP detection findings, when detection ran for this request.
6839
+ */
6840
+ interface IPDetection {
6841
+ /**
6842
+ * Whether and how detection affected the request.
6843
+ */
6844
+ action: 'allowed' | 'blocked' | 'flagged';
6845
+ /**
6846
+ * IP-detection CU fee, separate from creativeUnitsCost: a fixed base fee plus a
6847
+ * per-image fee for each analyzed input image.
6848
+ */
6849
+ creativeUnitsCharged: number;
6850
+ /**
6851
+ * Number of enabled filters evaluated for this request.
6852
+ */
6853
+ evaluatedFilters: number;
6854
+ /**
6855
+ * Per-filter verdicts gathered for this request.
6856
+ */
6857
+ findings: Array<IPDetection.Finding>;
6858
+ /**
6859
+ * Convenience flag; always true when action is not 'allowed'.
6860
+ */
6861
+ flagged: boolean;
6862
+ /**
6863
+ * True if one or more detectors errored while evaluating this request.
6864
+ */
6865
+ hasDetectorError?: boolean;
6866
+ }
6867
+ namespace IPDetection {
6868
+ /**
6869
+ * A single filter's verdict.
6870
+ */
6871
+ interface Finding {
6872
+ /**
6873
+ * Category of the filter that produced this verdict.
6874
+ */
6875
+ category: 'artist-style' | 'brand-trademark' | 'celebrity-likeness' | 'custom' | 'fictional-character';
6876
+ /**
6877
+ * Confidence score from 0 (low) to 1 (high).
6878
+ */
6879
+ confidence: number;
6880
+ /**
6881
+ * Identifier of the filter that produced this verdict.
6882
+ */
6883
+ filterId: string;
6884
+ /**
6885
+ * Display name of the filter that produced this verdict.
6886
+ */
6887
+ filterName: string;
6888
+ /**
6889
+ * Whether this filter considered the request an IP risk.
6890
+ */
6891
+ flagged: boolean;
6892
+ /**
6893
+ * Short, user-facing explanation of the verdict.
6894
+ */
6895
+ reason: string;
6896
+ /**
6897
+ * Named entities the filter recognized (e.g. characters, brands, people).
6898
+ */
6899
+ entities?: Array<string>;
6900
+ }
6901
+ }
6393
6902
  }
6394
6903
  export interface GenerateTranslateResponse {
6395
6904
  /**
@@ -6409,6 +6918,10 @@ export interface GenerateTranslateResponse {
6409
6918
  * The Creative Units discount for the request billed
6410
6919
  */
6411
6920
  creativeUnitsDiscount?: number;
6921
+ /**
6922
+ * IP detection findings, when detection ran for this request.
6923
+ */
6924
+ ipDetection?: GenerateTranslateResponse.IPDetection;
6412
6925
  }
6413
6926
  export declare namespace GenerateTranslateResponse {
6414
6927
  interface Job {
@@ -6515,7 +7028,7 @@ export declare namespace GenerateTranslateResponse {
6515
7028
  /**
6516
7029
  * The status of the node. Only available for WorkflowJob nodes.
6517
7030
  */
6518
- status: 'failure' | 'pending' | 'processing' | 'skipped' | 'success';
7031
+ status: 'failure' | 'pending' | 'processing' | 'rejected' | 'skipped' | 'success';
6519
7032
  /**
6520
7033
  * The type of the job for the node.
6521
7034
  */
@@ -7094,6 +7607,71 @@ export declare namespace GenerateTranslateResponse {
7094
7607
  cuDiscount: number;
7095
7608
  }
7096
7609
  }
7610
+ /**
7611
+ * IP detection findings, when detection ran for this request.
7612
+ */
7613
+ interface IPDetection {
7614
+ /**
7615
+ * Whether and how detection affected the request.
7616
+ */
7617
+ action: 'allowed' | 'blocked' | 'flagged';
7618
+ /**
7619
+ * IP-detection CU fee, separate from creativeUnitsCost: a fixed base fee plus a
7620
+ * per-image fee for each analyzed input image.
7621
+ */
7622
+ creativeUnitsCharged: number;
7623
+ /**
7624
+ * Number of enabled filters evaluated for this request.
7625
+ */
7626
+ evaluatedFilters: number;
7627
+ /**
7628
+ * Per-filter verdicts gathered for this request.
7629
+ */
7630
+ findings: Array<IPDetection.Finding>;
7631
+ /**
7632
+ * Convenience flag; always true when action is not 'allowed'.
7633
+ */
7634
+ flagged: boolean;
7635
+ /**
7636
+ * True if one or more detectors errored while evaluating this request.
7637
+ */
7638
+ hasDetectorError?: boolean;
7639
+ }
7640
+ namespace IPDetection {
7641
+ /**
7642
+ * A single filter's verdict.
7643
+ */
7644
+ interface Finding {
7645
+ /**
7646
+ * Category of the filter that produced this verdict.
7647
+ */
7648
+ category: 'artist-style' | 'brand-trademark' | 'celebrity-likeness' | 'custom' | 'fictional-character';
7649
+ /**
7650
+ * Confidence score from 0 (low) to 1 (high).
7651
+ */
7652
+ confidence: number;
7653
+ /**
7654
+ * Identifier of the filter that produced this verdict.
7655
+ */
7656
+ filterId: string;
7657
+ /**
7658
+ * Display name of the filter that produced this verdict.
7659
+ */
7660
+ filterName: string;
7661
+ /**
7662
+ * Whether this filter considered the request an IP risk.
7663
+ */
7664
+ flagged: boolean;
7665
+ /**
7666
+ * Short, user-facing explanation of the verdict.
7667
+ */
7668
+ reason: string;
7669
+ /**
7670
+ * Named entities the filter recognized (e.g. characters, brands, people).
7671
+ */
7672
+ entities?: Array<string>;
7673
+ }
7674
+ }
7097
7675
  }
7098
7676
  export interface GenerateCaptionParams {
7099
7677
  /**
@@ -7387,7 +7965,7 @@ export interface GeneratePromptParams {
7387
7965
  /**
7388
7966
  * Body param: The mode used to generate new prompt(s).
7389
7967
  */
7390
- mode: 'completion' | 'contextual' | 'image-editing' | 'inventive' | 'structured';
7968
+ mode: 'completion' | 'contextual' | 'contextual-v2' | 'image-editing' | 'inventive' | 'structured';
7391
7969
  /**
7392
7970
  * Query param
7393
7971
  */
@@ -7482,6 +8060,12 @@ export interface GenerateRunModelParams {
7482
8060
  * Query param
7483
8061
  */
7484
8062
  dryRun?: unknown;
8063
+ /**
8064
+ * Query param: Set to "true" to run an IP-detection preflight on this request.
8065
+ * Combine with ?dryRun=true for an advisory check that returns findings without
8066
+ * generating.
8067
+ */
8068
+ ipDetection?: boolean;
7485
8069
  }
7486
8070
  export interface GenerateTranslateParams {
7487
8071
  /**