@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
@@ -72,9 +72,9 @@ export class Generate extends APIResource {
72
72
  params: GenerateRunModelParams,
73
73
  options?: RequestOptions,
74
74
  ): APIPromise<GenerateRunModelResponse> {
75
- const { body, dryRun } = params;
75
+ const { body, dryRun, ipDetection } = params;
76
76
  return this._client.post(path`/generate/custom/${modelID}`, {
77
- query: { dryRun },
77
+ query: { dryRun, ipDetection },
78
78
  body: body,
79
79
  ...options,
80
80
  });
@@ -117,6 +117,11 @@ export interface GenerateCaptionResponse {
117
117
  * ignored.
118
118
  */
119
119
  detailsLevel?: 'action' | 'action+style';
120
+
121
+ /**
122
+ * IP detection findings, when detection ran for this request.
123
+ */
124
+ ipDetection?: GenerateCaptionResponse.IPDetection;
120
125
  }
121
126
 
122
127
  export namespace GenerateCaptionResponse {
@@ -288,7 +293,7 @@ export namespace GenerateCaptionResponse {
288
293
  /**
289
294
  * The status of the node. Only available for WorkflowJob nodes.
290
295
  */
291
- status: 'failure' | 'pending' | 'processing' | 'skipped' | 'success';
296
+ status: 'failure' | 'pending' | 'processing' | 'rejected' | 'skipped' | 'success';
292
297
 
293
298
  /**
294
299
  * The type of the job for the node.
@@ -1079,6 +1084,84 @@ export namespace GenerateCaptionResponse {
1079
1084
  cuDiscount: number;
1080
1085
  }
1081
1086
  }
1087
+
1088
+ /**
1089
+ * IP detection findings, when detection ran for this request.
1090
+ */
1091
+ export interface IPDetection {
1092
+ /**
1093
+ * Whether and how detection affected the request.
1094
+ */
1095
+ action: 'allowed' | 'blocked' | 'flagged';
1096
+
1097
+ /**
1098
+ * IP-detection CU fee, separate from creativeUnitsCost: a fixed base fee plus a
1099
+ * per-image fee for each analyzed input image.
1100
+ */
1101
+ creativeUnitsCharged: number;
1102
+
1103
+ /**
1104
+ * Number of enabled filters evaluated for this request.
1105
+ */
1106
+ evaluatedFilters: number;
1107
+
1108
+ /**
1109
+ * Per-filter verdicts gathered for this request.
1110
+ */
1111
+ findings: Array<IPDetection.Finding>;
1112
+
1113
+ /**
1114
+ * Convenience flag; always true when action is not 'allowed'.
1115
+ */
1116
+ flagged: boolean;
1117
+
1118
+ /**
1119
+ * True if one or more detectors errored while evaluating this request.
1120
+ */
1121
+ hasDetectorError?: boolean;
1122
+ }
1123
+
1124
+ export namespace IPDetection {
1125
+ /**
1126
+ * A single filter's verdict.
1127
+ */
1128
+ export interface Finding {
1129
+ /**
1130
+ * Category of the filter that produced this verdict.
1131
+ */
1132
+ category: 'artist-style' | 'brand-trademark' | 'celebrity-likeness' | 'custom' | 'fictional-character';
1133
+
1134
+ /**
1135
+ * Confidence score from 0 (low) to 1 (high).
1136
+ */
1137
+ confidence: number;
1138
+
1139
+ /**
1140
+ * Identifier of the filter that produced this verdict.
1141
+ */
1142
+ filterId: string;
1143
+
1144
+ /**
1145
+ * Display name of the filter that produced this verdict.
1146
+ */
1147
+ filterName: string;
1148
+
1149
+ /**
1150
+ * Whether this filter considered the request an IP risk.
1151
+ */
1152
+ flagged: boolean;
1153
+
1154
+ /**
1155
+ * Short, user-facing explanation of the verdict.
1156
+ */
1157
+ reason: string;
1158
+
1159
+ /**
1160
+ * Named entities the filter recognized (e.g. characters, brands, people).
1161
+ */
1162
+ entities?: Array<string>;
1163
+ }
1164
+ }
1082
1165
  }
1083
1166
 
1084
1167
  export interface GenerateDescribeStyleResponse {
@@ -1103,6 +1186,11 @@ export interface GenerateDescribeStyleResponse {
1103
1186
  * The Creative Units discount for the request billed
1104
1187
  */
1105
1188
  creativeUnitsDiscount?: number;
1189
+
1190
+ /**
1191
+ * IP detection findings, when detection ran for this request.
1192
+ */
1193
+ ipDetection?: GenerateDescribeStyleResponse.IPDetection;
1106
1194
  }
1107
1195
 
1108
1196
  export namespace GenerateDescribeStyleResponse {
@@ -1274,7 +1362,7 @@ export namespace GenerateDescribeStyleResponse {
1274
1362
  /**
1275
1363
  * The status of the node. Only available for WorkflowJob nodes.
1276
1364
  */
1277
- status: 'failure' | 'pending' | 'processing' | 'skipped' | 'success';
1365
+ status: 'failure' | 'pending' | 'processing' | 'rejected' | 'skipped' | 'success';
1278
1366
 
1279
1367
  /**
1280
1368
  * The type of the job for the node.
@@ -2065,6 +2153,84 @@ export namespace GenerateDescribeStyleResponse {
2065
2153
  cuDiscount: number;
2066
2154
  }
2067
2155
  }
2156
+
2157
+ /**
2158
+ * IP detection findings, when detection ran for this request.
2159
+ */
2160
+ export interface IPDetection {
2161
+ /**
2162
+ * Whether and how detection affected the request.
2163
+ */
2164
+ action: 'allowed' | 'blocked' | 'flagged';
2165
+
2166
+ /**
2167
+ * IP-detection CU fee, separate from creativeUnitsCost: a fixed base fee plus a
2168
+ * per-image fee for each analyzed input image.
2169
+ */
2170
+ creativeUnitsCharged: number;
2171
+
2172
+ /**
2173
+ * Number of enabled filters evaluated for this request.
2174
+ */
2175
+ evaluatedFilters: number;
2176
+
2177
+ /**
2178
+ * Per-filter verdicts gathered for this request.
2179
+ */
2180
+ findings: Array<IPDetection.Finding>;
2181
+
2182
+ /**
2183
+ * Convenience flag; always true when action is not 'allowed'.
2184
+ */
2185
+ flagged: boolean;
2186
+
2187
+ /**
2188
+ * True if one or more detectors errored while evaluating this request.
2189
+ */
2190
+ hasDetectorError?: boolean;
2191
+ }
2192
+
2193
+ export namespace IPDetection {
2194
+ /**
2195
+ * A single filter's verdict.
2196
+ */
2197
+ export interface Finding {
2198
+ /**
2199
+ * Category of the filter that produced this verdict.
2200
+ */
2201
+ category: 'artist-style' | 'brand-trademark' | 'celebrity-likeness' | 'custom' | 'fictional-character';
2202
+
2203
+ /**
2204
+ * Confidence score from 0 (low) to 1 (high).
2205
+ */
2206
+ confidence: number;
2207
+
2208
+ /**
2209
+ * Identifier of the filter that produced this verdict.
2210
+ */
2211
+ filterId: string;
2212
+
2213
+ /**
2214
+ * Display name of the filter that produced this verdict.
2215
+ */
2216
+ filterName: string;
2217
+
2218
+ /**
2219
+ * Whether this filter considered the request an IP risk.
2220
+ */
2221
+ flagged: boolean;
2222
+
2223
+ /**
2224
+ * Short, user-facing explanation of the verdict.
2225
+ */
2226
+ reason: string;
2227
+
2228
+ /**
2229
+ * Named entities the filter recognized (e.g. characters, brands, people).
2230
+ */
2231
+ entities?: Array<string>;
2232
+ }
2233
+ }
2068
2234
  }
2069
2235
 
2070
2236
  export interface GenerateDetectResponse {
@@ -2081,6 +2247,11 @@ export interface GenerateDetectResponse {
2081
2247
  * The Creative Units discount for the request billed
2082
2248
  */
2083
2249
  creativeUnitsDiscount?: number;
2250
+
2251
+ /**
2252
+ * IP detection findings, when detection ran for this request.
2253
+ */
2254
+ ipDetection?: GenerateDetectResponse.IPDetection;
2084
2255
  }
2085
2256
 
2086
2257
  export namespace GenerateDetectResponse {
@@ -2252,7 +2423,7 @@ export namespace GenerateDetectResponse {
2252
2423
  /**
2253
2424
  * The status of the node. Only available for WorkflowJob nodes.
2254
2425
  */
2255
- status: 'failure' | 'pending' | 'processing' | 'skipped' | 'success';
2426
+ status: 'failure' | 'pending' | 'processing' | 'rejected' | 'skipped' | 'success';
2256
2427
 
2257
2428
  /**
2258
2429
  * The type of the job for the node.
@@ -4184,6 +4355,84 @@ export namespace GenerateDetectResponse {
4184
4355
  url: string;
4185
4356
  }
4186
4357
  }
4358
+
4359
+ /**
4360
+ * IP detection findings, when detection ran for this request.
4361
+ */
4362
+ export interface IPDetection {
4363
+ /**
4364
+ * Whether and how detection affected the request.
4365
+ */
4366
+ action: 'allowed' | 'blocked' | 'flagged';
4367
+
4368
+ /**
4369
+ * IP-detection CU fee, separate from creativeUnitsCost: a fixed base fee plus a
4370
+ * per-image fee for each analyzed input image.
4371
+ */
4372
+ creativeUnitsCharged: number;
4373
+
4374
+ /**
4375
+ * Number of enabled filters evaluated for this request.
4376
+ */
4377
+ evaluatedFilters: number;
4378
+
4379
+ /**
4380
+ * Per-filter verdicts gathered for this request.
4381
+ */
4382
+ findings: Array<IPDetection.Finding>;
4383
+
4384
+ /**
4385
+ * Convenience flag; always true when action is not 'allowed'.
4386
+ */
4387
+ flagged: boolean;
4388
+
4389
+ /**
4390
+ * True if one or more detectors errored while evaluating this request.
4391
+ */
4392
+ hasDetectorError?: boolean;
4393
+ }
4394
+
4395
+ export namespace IPDetection {
4396
+ /**
4397
+ * A single filter's verdict.
4398
+ */
4399
+ export interface Finding {
4400
+ /**
4401
+ * Category of the filter that produced this verdict.
4402
+ */
4403
+ category: 'artist-style' | 'brand-trademark' | 'celebrity-likeness' | 'custom' | 'fictional-character';
4404
+
4405
+ /**
4406
+ * Confidence score from 0 (low) to 1 (high).
4407
+ */
4408
+ confidence: number;
4409
+
4410
+ /**
4411
+ * Identifier of the filter that produced this verdict.
4412
+ */
4413
+ filterId: string;
4414
+
4415
+ /**
4416
+ * Display name of the filter that produced this verdict.
4417
+ */
4418
+ filterName: string;
4419
+
4420
+ /**
4421
+ * Whether this filter considered the request an IP risk.
4422
+ */
4423
+ flagged: boolean;
4424
+
4425
+ /**
4426
+ * Short, user-facing explanation of the verdict.
4427
+ */
4428
+ reason: string;
4429
+
4430
+ /**
4431
+ * Named entities the filter recognized (e.g. characters, brands, people).
4432
+ */
4433
+ entities?: Array<string>;
4434
+ }
4435
+ }
4187
4436
  }
4188
4437
 
4189
4438
  export interface GenerateEmbedResponse {
@@ -4205,6 +4454,11 @@ export interface GenerateEmbedResponse {
4205
4454
  * The Creative Units discount for the request billed
4206
4455
  */
4207
4456
  creativeUnitsDiscount?: number;
4457
+
4458
+ /**
4459
+ * IP detection findings, when detection ran for this request.
4460
+ */
4461
+ ipDetection?: GenerateEmbedResponse.IPDetection;
4208
4462
  }
4209
4463
 
4210
4464
  export namespace GenerateEmbedResponse {
@@ -4376,7 +4630,7 @@ export namespace GenerateEmbedResponse {
4376
4630
  /**
4377
4631
  * The status of the node. Only available for WorkflowJob nodes.
4378
4632
  */
4379
- status: 'failure' | 'pending' | 'processing' | 'skipped' | 'success';
4633
+ status: 'failure' | 'pending' | 'processing' | 'rejected' | 'skipped' | 'success';
4380
4634
 
4381
4635
  /**
4382
4636
  * The type of the job for the node.
@@ -5167,6 +5421,84 @@ export namespace GenerateEmbedResponse {
5167
5421
  cuDiscount: number;
5168
5422
  }
5169
5423
  }
5424
+
5425
+ /**
5426
+ * IP detection findings, when detection ran for this request.
5427
+ */
5428
+ export interface IPDetection {
5429
+ /**
5430
+ * Whether and how detection affected the request.
5431
+ */
5432
+ action: 'allowed' | 'blocked' | 'flagged';
5433
+
5434
+ /**
5435
+ * IP-detection CU fee, separate from creativeUnitsCost: a fixed base fee plus a
5436
+ * per-image fee for each analyzed input image.
5437
+ */
5438
+ creativeUnitsCharged: number;
5439
+
5440
+ /**
5441
+ * Number of enabled filters evaluated for this request.
5442
+ */
5443
+ evaluatedFilters: number;
5444
+
5445
+ /**
5446
+ * Per-filter verdicts gathered for this request.
5447
+ */
5448
+ findings: Array<IPDetection.Finding>;
5449
+
5450
+ /**
5451
+ * Convenience flag; always true when action is not 'allowed'.
5452
+ */
5453
+ flagged: boolean;
5454
+
5455
+ /**
5456
+ * True if one or more detectors errored while evaluating this request.
5457
+ */
5458
+ hasDetectorError?: boolean;
5459
+ }
5460
+
5461
+ export namespace IPDetection {
5462
+ /**
5463
+ * A single filter's verdict.
5464
+ */
5465
+ export interface Finding {
5466
+ /**
5467
+ * Category of the filter that produced this verdict.
5468
+ */
5469
+ category: 'artist-style' | 'brand-trademark' | 'celebrity-likeness' | 'custom' | 'fictional-character';
5470
+
5471
+ /**
5472
+ * Confidence score from 0 (low) to 1 (high).
5473
+ */
5474
+ confidence: number;
5475
+
5476
+ /**
5477
+ * Identifier of the filter that produced this verdict.
5478
+ */
5479
+ filterId: string;
5480
+
5481
+ /**
5482
+ * Display name of the filter that produced this verdict.
5483
+ */
5484
+ filterName: string;
5485
+
5486
+ /**
5487
+ * Whether this filter considered the request an IP risk.
5488
+ */
5489
+ flagged: boolean;
5490
+
5491
+ /**
5492
+ * Short, user-facing explanation of the verdict.
5493
+ */
5494
+ reason: string;
5495
+
5496
+ /**
5497
+ * Named entities the filter recognized (e.g. characters, brands, people).
5498
+ */
5499
+ entities?: Array<string>;
5500
+ }
5501
+ }
5170
5502
  }
5171
5503
 
5172
5504
  export interface GeneratePatchResponse {
@@ -5183,6 +5515,11 @@ export interface GeneratePatchResponse {
5183
5515
  * The Creative Units discount for the request billed
5184
5516
  */
5185
5517
  creativeUnitsDiscount?: number;
5518
+
5519
+ /**
5520
+ * IP detection findings, when detection ran for this request.
5521
+ */
5522
+ ipDetection?: GeneratePatchResponse.IPDetection;
5186
5523
  }
5187
5524
 
5188
5525
  export namespace GeneratePatchResponse {
@@ -5354,7 +5691,7 @@ export namespace GeneratePatchResponse {
5354
5691
  /**
5355
5692
  * The status of the node. Only available for WorkflowJob nodes.
5356
5693
  */
5357
- status: 'failure' | 'pending' | 'processing' | 'skipped' | 'success';
5694
+ status: 'failure' | 'pending' | 'processing' | 'rejected' | 'skipped' | 'success';
5358
5695
 
5359
5696
  /**
5360
5697
  * The type of the job for the node.
@@ -7286,6 +7623,84 @@ export namespace GeneratePatchResponse {
7286
7623
  url: string;
7287
7624
  }
7288
7625
  }
7626
+
7627
+ /**
7628
+ * IP detection findings, when detection ran for this request.
7629
+ */
7630
+ export interface IPDetection {
7631
+ /**
7632
+ * Whether and how detection affected the request.
7633
+ */
7634
+ action: 'allowed' | 'blocked' | 'flagged';
7635
+
7636
+ /**
7637
+ * IP-detection CU fee, separate from creativeUnitsCost: a fixed base fee plus a
7638
+ * per-image fee for each analyzed input image.
7639
+ */
7640
+ creativeUnitsCharged: number;
7641
+
7642
+ /**
7643
+ * Number of enabled filters evaluated for this request.
7644
+ */
7645
+ evaluatedFilters: number;
7646
+
7647
+ /**
7648
+ * Per-filter verdicts gathered for this request.
7649
+ */
7650
+ findings: Array<IPDetection.Finding>;
7651
+
7652
+ /**
7653
+ * Convenience flag; always true when action is not 'allowed'.
7654
+ */
7655
+ flagged: boolean;
7656
+
7657
+ /**
7658
+ * True if one or more detectors errored while evaluating this request.
7659
+ */
7660
+ hasDetectorError?: boolean;
7661
+ }
7662
+
7663
+ export namespace IPDetection {
7664
+ /**
7665
+ * A single filter's verdict.
7666
+ */
7667
+ export interface Finding {
7668
+ /**
7669
+ * Category of the filter that produced this verdict.
7670
+ */
7671
+ category: 'artist-style' | 'brand-trademark' | 'celebrity-likeness' | 'custom' | 'fictional-character';
7672
+
7673
+ /**
7674
+ * Confidence score from 0 (low) to 1 (high).
7675
+ */
7676
+ confidence: number;
7677
+
7678
+ /**
7679
+ * Identifier of the filter that produced this verdict.
7680
+ */
7681
+ filterId: string;
7682
+
7683
+ /**
7684
+ * Display name of the filter that produced this verdict.
7685
+ */
7686
+ filterName: string;
7687
+
7688
+ /**
7689
+ * Whether this filter considered the request an IP risk.
7690
+ */
7691
+ flagged: boolean;
7692
+
7693
+ /**
7694
+ * Short, user-facing explanation of the verdict.
7695
+ */
7696
+ reason: string;
7697
+
7698
+ /**
7699
+ * Named entities the filter recognized (e.g. characters, brands, people).
7700
+ */
7701
+ entities?: Array<string>;
7702
+ }
7703
+ }
7289
7704
  }
7290
7705
 
7291
7706
  export interface GeneratePromptResponse {
@@ -7296,6 +7711,12 @@ export interface GeneratePromptResponse {
7296
7711
  */
7297
7712
  prompts: Array<string>;
7298
7713
 
7714
+ /**
7715
+ * The full ready-to-run model calls, index-aligned with `prompts`: `prompts[i]` is
7716
+ * the prompt text of `calls[i]`.
7717
+ */
7718
+ calls?: Array<GeneratePromptResponse.Call>;
7719
+
7299
7720
  /**
7300
7721
  * The Creative Units cost for the request billed
7301
7722
  */
@@ -7306,10 +7727,15 @@ export interface GeneratePromptResponse {
7306
7727
  */
7307
7728
  creativeUnitsDiscount?: number;
7308
7729
 
7730
+ /**
7731
+ * IP detection findings, when detection ran for this request.
7732
+ */
7733
+ ipDetection?: GeneratePromptResponse.IPDetection;
7734
+
7309
7735
  /**
7310
7736
  * The mode used to generate new prompt(s).
7311
7737
  */
7312
- mode?: 'completion' | 'contextual' | 'image-editing' | 'inventive' | 'structured';
7738
+ mode?: 'completion' | 'contextual' | 'contextual-v2' | 'image-editing' | 'inventive' | 'structured';
7313
7739
  }
7314
7740
 
7315
7741
  export namespace GeneratePromptResponse {
@@ -7481,7 +7907,7 @@ export namespace GeneratePromptResponse {
7481
7907
  /**
7482
7908
  * The status of the node. Only available for WorkflowJob nodes.
7483
7909
  */
7484
- status: 'failure' | 'pending' | 'processing' | 'skipped' | 'success';
7910
+ status: 'failure' | 'pending' | 'processing' | 'rejected' | 'skipped' | 'success';
7485
7911
 
7486
7912
  /**
7487
7913
  * The type of the job for the node.
@@ -8272,6 +8698,108 @@ export namespace GeneratePromptResponse {
8272
8698
  cuDiscount: number;
8273
8699
  }
8274
8700
  }
8701
+
8702
+ /**
8703
+ * A complete, ready-to-run model call proposed by Prompt Spark v3.
8704
+ *
8705
+ * The prompt text is carried inside `parameters` under the target model's prompt
8706
+ * input (when the model defines one). For models without a prompt input, the text
8707
+ * is only available in the index-aligned `prompts` array.
8708
+ */
8709
+ export interface Call {
8710
+ /**
8711
+ * The target model the call is for.
8712
+ */
8713
+ modelId: string;
8714
+
8715
+ /**
8716
+ * Schema-valid dynamic parameters for the target model, prompt included.
8717
+ */
8718
+ parameters: unknown;
8719
+
8720
+ /**
8721
+ * Optional rationale for the proposed call.
8722
+ */
8723
+ rationale?: string;
8724
+ }
8725
+
8726
+ /**
8727
+ * IP detection findings, when detection ran for this request.
8728
+ */
8729
+ export interface IPDetection {
8730
+ /**
8731
+ * Whether and how detection affected the request.
8732
+ */
8733
+ action: 'allowed' | 'blocked' | 'flagged';
8734
+
8735
+ /**
8736
+ * IP-detection CU fee, separate from creativeUnitsCost: a fixed base fee plus a
8737
+ * per-image fee for each analyzed input image.
8738
+ */
8739
+ creativeUnitsCharged: number;
8740
+
8741
+ /**
8742
+ * Number of enabled filters evaluated for this request.
8743
+ */
8744
+ evaluatedFilters: number;
8745
+
8746
+ /**
8747
+ * Per-filter verdicts gathered for this request.
8748
+ */
8749
+ findings: Array<IPDetection.Finding>;
8750
+
8751
+ /**
8752
+ * Convenience flag; always true when action is not 'allowed'.
8753
+ */
8754
+ flagged: boolean;
8755
+
8756
+ /**
8757
+ * True if one or more detectors errored while evaluating this request.
8758
+ */
8759
+ hasDetectorError?: boolean;
8760
+ }
8761
+
8762
+ export namespace IPDetection {
8763
+ /**
8764
+ * A single filter's verdict.
8765
+ */
8766
+ export interface Finding {
8767
+ /**
8768
+ * Category of the filter that produced this verdict.
8769
+ */
8770
+ category: 'artist-style' | 'brand-trademark' | 'celebrity-likeness' | 'custom' | 'fictional-character';
8771
+
8772
+ /**
8773
+ * Confidence score from 0 (low) to 1 (high).
8774
+ */
8775
+ confidence: number;
8776
+
8777
+ /**
8778
+ * Identifier of the filter that produced this verdict.
8779
+ */
8780
+ filterId: string;
8781
+
8782
+ /**
8783
+ * Display name of the filter that produced this verdict.
8784
+ */
8785
+ filterName: string;
8786
+
8787
+ /**
8788
+ * Whether this filter considered the request an IP risk.
8789
+ */
8790
+ flagged: boolean;
8791
+
8792
+ /**
8793
+ * Short, user-facing explanation of the verdict.
8794
+ */
8795
+ reason: string;
8796
+
8797
+ /**
8798
+ * Named entities the filter recognized (e.g. characters, brands, people).
8799
+ */
8800
+ entities?: Array<string>;
8801
+ }
8802
+ }
8275
8803
  }
8276
8804
 
8277
8805
  export interface GenerateRunModelResponse {
@@ -8286,6 +8814,11 @@ export interface GenerateRunModelResponse {
8286
8814
  * The Creative Units discount for the request billed
8287
8815
  */
8288
8816
  creativeUnitsDiscount?: number;
8817
+
8818
+ /**
8819
+ * IP detection findings, when detection ran for this request.
8820
+ */
8821
+ ipDetection?: GenerateRunModelResponse.IPDetection;
8289
8822
  }
8290
8823
 
8291
8824
  export namespace GenerateRunModelResponse {
@@ -8457,7 +8990,7 @@ export namespace GenerateRunModelResponse {
8457
8990
  /**
8458
8991
  * The status of the node. Only available for WorkflowJob nodes.
8459
8992
  */
8460
- status: 'failure' | 'pending' | 'processing' | 'skipped' | 'success';
8993
+ status: 'failure' | 'pending' | 'processing' | 'rejected' | 'skipped' | 'success';
8461
8994
 
8462
8995
  /**
8463
8996
  * The type of the job for the node.
@@ -9248,6 +9781,84 @@ export namespace GenerateRunModelResponse {
9248
9781
  cuDiscount: number;
9249
9782
  }
9250
9783
  }
9784
+
9785
+ /**
9786
+ * IP detection findings, when detection ran for this request.
9787
+ */
9788
+ export interface IPDetection {
9789
+ /**
9790
+ * Whether and how detection affected the request.
9791
+ */
9792
+ action: 'allowed' | 'blocked' | 'flagged';
9793
+
9794
+ /**
9795
+ * IP-detection CU fee, separate from creativeUnitsCost: a fixed base fee plus a
9796
+ * per-image fee for each analyzed input image.
9797
+ */
9798
+ creativeUnitsCharged: number;
9799
+
9800
+ /**
9801
+ * Number of enabled filters evaluated for this request.
9802
+ */
9803
+ evaluatedFilters: number;
9804
+
9805
+ /**
9806
+ * Per-filter verdicts gathered for this request.
9807
+ */
9808
+ findings: Array<IPDetection.Finding>;
9809
+
9810
+ /**
9811
+ * Convenience flag; always true when action is not 'allowed'.
9812
+ */
9813
+ flagged: boolean;
9814
+
9815
+ /**
9816
+ * True if one or more detectors errored while evaluating this request.
9817
+ */
9818
+ hasDetectorError?: boolean;
9819
+ }
9820
+
9821
+ export namespace IPDetection {
9822
+ /**
9823
+ * A single filter's verdict.
9824
+ */
9825
+ export interface Finding {
9826
+ /**
9827
+ * Category of the filter that produced this verdict.
9828
+ */
9829
+ category: 'artist-style' | 'brand-trademark' | 'celebrity-likeness' | 'custom' | 'fictional-character';
9830
+
9831
+ /**
9832
+ * Confidence score from 0 (low) to 1 (high).
9833
+ */
9834
+ confidence: number;
9835
+
9836
+ /**
9837
+ * Identifier of the filter that produced this verdict.
9838
+ */
9839
+ filterId: string;
9840
+
9841
+ /**
9842
+ * Display name of the filter that produced this verdict.
9843
+ */
9844
+ filterName: string;
9845
+
9846
+ /**
9847
+ * Whether this filter considered the request an IP risk.
9848
+ */
9849
+ flagged: boolean;
9850
+
9851
+ /**
9852
+ * Short, user-facing explanation of the verdict.
9853
+ */
9854
+ reason: string;
9855
+
9856
+ /**
9857
+ * Named entities the filter recognized (e.g. characters, brands, people).
9858
+ */
9859
+ entities?: Array<string>;
9860
+ }
9861
+ }
9251
9862
  }
9252
9863
 
9253
9864
  export interface GenerateTranslateResponse {
@@ -9272,6 +9883,11 @@ export interface GenerateTranslateResponse {
9272
9883
  * The Creative Units discount for the request billed
9273
9884
  */
9274
9885
  creativeUnitsDiscount?: number;
9886
+
9887
+ /**
9888
+ * IP detection findings, when detection ran for this request.
9889
+ */
9890
+ ipDetection?: GenerateTranslateResponse.IPDetection;
9275
9891
  }
9276
9892
 
9277
9893
  export namespace GenerateTranslateResponse {
@@ -9443,7 +10059,7 @@ export namespace GenerateTranslateResponse {
9443
10059
  /**
9444
10060
  * The status of the node. Only available for WorkflowJob nodes.
9445
10061
  */
9446
- status: 'failure' | 'pending' | 'processing' | 'skipped' | 'success';
10062
+ status: 'failure' | 'pending' | 'processing' | 'rejected' | 'skipped' | 'success';
9447
10063
 
9448
10064
  /**
9449
10065
  * The type of the job for the node.
@@ -10234,6 +10850,84 @@ export namespace GenerateTranslateResponse {
10234
10850
  cuDiscount: number;
10235
10851
  }
10236
10852
  }
10853
+
10854
+ /**
10855
+ * IP detection findings, when detection ran for this request.
10856
+ */
10857
+ export interface IPDetection {
10858
+ /**
10859
+ * Whether and how detection affected the request.
10860
+ */
10861
+ action: 'allowed' | 'blocked' | 'flagged';
10862
+
10863
+ /**
10864
+ * IP-detection CU fee, separate from creativeUnitsCost: a fixed base fee plus a
10865
+ * per-image fee for each analyzed input image.
10866
+ */
10867
+ creativeUnitsCharged: number;
10868
+
10869
+ /**
10870
+ * Number of enabled filters evaluated for this request.
10871
+ */
10872
+ evaluatedFilters: number;
10873
+
10874
+ /**
10875
+ * Per-filter verdicts gathered for this request.
10876
+ */
10877
+ findings: Array<IPDetection.Finding>;
10878
+
10879
+ /**
10880
+ * Convenience flag; always true when action is not 'allowed'.
10881
+ */
10882
+ flagged: boolean;
10883
+
10884
+ /**
10885
+ * True if one or more detectors errored while evaluating this request.
10886
+ */
10887
+ hasDetectorError?: boolean;
10888
+ }
10889
+
10890
+ export namespace IPDetection {
10891
+ /**
10892
+ * A single filter's verdict.
10893
+ */
10894
+ export interface Finding {
10895
+ /**
10896
+ * Category of the filter that produced this verdict.
10897
+ */
10898
+ category: 'artist-style' | 'brand-trademark' | 'celebrity-likeness' | 'custom' | 'fictional-character';
10899
+
10900
+ /**
10901
+ * Confidence score from 0 (low) to 1 (high).
10902
+ */
10903
+ confidence: number;
10904
+
10905
+ /**
10906
+ * Identifier of the filter that produced this verdict.
10907
+ */
10908
+ filterId: string;
10909
+
10910
+ /**
10911
+ * Display name of the filter that produced this verdict.
10912
+ */
10913
+ filterName: string;
10914
+
10915
+ /**
10916
+ * Whether this filter considered the request an IP risk.
10917
+ */
10918
+ flagged: boolean;
10919
+
10920
+ /**
10921
+ * Short, user-facing explanation of the verdict.
10922
+ */
10923
+ reason: string;
10924
+
10925
+ /**
10926
+ * Named entities the filter recognized (e.g. characters, brands, people).
10927
+ */
10928
+ entities?: Array<string>;
10929
+ }
10930
+ }
10237
10931
  }
10238
10932
 
10239
10933
  export interface GenerateCaptionParams {
@@ -10589,7 +11283,7 @@ export interface GeneratePromptParams {
10589
11283
  /**
10590
11284
  * Body param: The mode used to generate new prompt(s).
10591
11285
  */
10592
- mode: 'completion' | 'contextual' | 'image-editing' | 'inventive' | 'structured';
11286
+ mode: 'completion' | 'contextual' | 'contextual-v2' | 'image-editing' | 'inventive' | 'structured';
10593
11287
 
10594
11288
  /**
10595
11289
  * Query param
@@ -10697,6 +11391,13 @@ export interface GenerateRunModelParams {
10697
11391
  * Query param
10698
11392
  */
10699
11393
  dryRun?: unknown;
11394
+
11395
+ /**
11396
+ * Query param: Set to "true" to run an IP-detection preflight on this request.
11397
+ * Combine with ?dryRun=true for an advisory check that returns findings without
11398
+ * generating.
11399
+ */
11400
+ ipDetection?: boolean;
10700
11401
  }
10701
11402
 
10702
11403
  export interface GenerateTranslateParams {