@scenario-labs/sdk 2.3.0 → 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 (55) hide show
  1. package/CHANGELOG.md +24 -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/lib/workflow_converter.d.mts +9 -0
  9. package/lib/workflow_converter.d.mts.map +1 -1
  10. package/lib/workflow_converter.d.ts +9 -0
  11. package/lib/workflow_converter.d.ts.map +1 -1
  12. package/lib/workflow_converter.js +64 -18
  13. package/lib/workflow_converter.js.map +1 -1
  14. package/lib/workflow_converter.mjs +64 -18
  15. package/lib/workflow_converter.mjs.map +1 -1
  16. package/lib/workflow_import_validator.d.mts +1 -1
  17. package/lib/workflow_import_validator.d.mts.map +1 -1
  18. package/lib/workflow_import_validator.d.ts +1 -1
  19. package/lib/workflow_import_validator.d.ts.map +1 -1
  20. package/lib/workflow_import_validator.js +1 -0
  21. package/lib/workflow_import_validator.js.map +1 -1
  22. package/lib/workflow_import_validator.mjs +1 -0
  23. package/lib/workflow_import_validator.mjs.map +1 -1
  24. package/package.json +9 -3
  25. package/resources/generate.d.mts +586 -2
  26. package/resources/generate.d.mts.map +1 -1
  27. package/resources/generate.d.ts +586 -2
  28. package/resources/generate.d.ts.map +1 -1
  29. package/resources/generate.js +2 -2
  30. package/resources/generate.js.map +1 -1
  31. package/resources/generate.mjs +2 -2
  32. package/resources/generate.mjs.map +1 -1
  33. package/resources/models/train.d.mts +69 -0
  34. package/resources/models/train.d.mts.map +1 -1
  35. package/resources/models/train.d.ts +69 -0
  36. package/resources/models/train.d.ts.map +1 -1
  37. package/resources/usages.d.mts +22 -2
  38. package/resources/usages.d.mts.map +1 -1
  39. package/resources/usages.d.ts +22 -2
  40. package/resources/usages.d.ts.map +1 -1
  41. package/src/client.ts +9 -1
  42. package/src/lib/workflow_converter.ts +104 -17
  43. package/src/lib/workflow_import_validator.ts +3 -1
  44. package/src/resources/generate.ts +705 -4
  45. package/src/resources/models/train.ts +83 -0
  46. package/src/resources/usages.ts +26 -0
  47. package/src/version.ts +1 -1
  48. package/version.d.mts +1 -1
  49. package/version.d.mts.map +1 -1
  50. package/version.d.ts +1 -1
  51. package/version.d.ts.map +1 -1
  52. package/version.js +1 -1
  53. package/version.js.map +1 -1
  54. package/version.mjs +1 -1
  55. package/version.mjs.map +1 -1
@@ -1385,6 +1385,11 @@ export interface TrainTriggerResponse {
1385
1385
  * The Creative Units discount for the request billed
1386
1386
  */
1387
1387
  creativeUnitsDiscount?: number;
1388
+
1389
+ /**
1390
+ * IP detection findings, when detection ran for this request.
1391
+ */
1392
+ ipDetection?: TrainTriggerResponse.IPDetection;
1388
1393
  }
1389
1394
 
1390
1395
  export namespace TrainTriggerResponse {
@@ -3673,6 +3678,84 @@ export namespace TrainTriggerResponse {
3673
3678
  }
3674
3679
  }
3675
3680
  }
3681
+
3682
+ /**
3683
+ * IP detection findings, when detection ran for this request.
3684
+ */
3685
+ export interface IPDetection {
3686
+ /**
3687
+ * Whether and how detection affected the request.
3688
+ */
3689
+ action: 'allowed' | 'blocked' | 'flagged';
3690
+
3691
+ /**
3692
+ * IP-detection CU fee, separate from creativeUnitsCost: a fixed base fee plus a
3693
+ * per-image fee for each analyzed input image.
3694
+ */
3695
+ creativeUnitsCharged: number;
3696
+
3697
+ /**
3698
+ * Number of enabled filters evaluated for this request.
3699
+ */
3700
+ evaluatedFilters: number;
3701
+
3702
+ /**
3703
+ * Per-filter verdicts gathered for this request.
3704
+ */
3705
+ findings: Array<IPDetection.Finding>;
3706
+
3707
+ /**
3708
+ * Convenience flag; always true when action is not 'allowed'.
3709
+ */
3710
+ flagged: boolean;
3711
+
3712
+ /**
3713
+ * True if one or more detectors errored while evaluating this request.
3714
+ */
3715
+ hasDetectorError?: boolean;
3716
+ }
3717
+
3718
+ export namespace IPDetection {
3719
+ /**
3720
+ * A single filter's verdict.
3721
+ */
3722
+ export interface Finding {
3723
+ /**
3724
+ * Category of the filter that produced this verdict.
3725
+ */
3726
+ category: 'artist-style' | 'brand-trademark' | 'celebrity-likeness' | 'custom' | 'fictional-character';
3727
+
3728
+ /**
3729
+ * Confidence score from 0 (low) to 1 (high).
3730
+ */
3731
+ confidence: number;
3732
+
3733
+ /**
3734
+ * Identifier of the filter that produced this verdict.
3735
+ */
3736
+ filterId: string;
3737
+
3738
+ /**
3739
+ * Display name of the filter that produced this verdict.
3740
+ */
3741
+ filterName: string;
3742
+
3743
+ /**
3744
+ * Whether this filter considered the request an IP risk.
3745
+ */
3746
+ flagged: boolean;
3747
+
3748
+ /**
3749
+ * Short, user-facing explanation of the verdict.
3750
+ */
3751
+ reason: string;
3752
+
3753
+ /**
3754
+ * Named entities the filter recognized (e.g. characters, brands, people).
3755
+ */
3756
+ entities?: Array<string>;
3757
+ }
3758
+ }
3676
3759
  }
3677
3760
 
3678
3761
  export interface TrainActionParams {
@@ -112,6 +112,7 @@ export namespace UsageListResponse {
112
112
  | 'project'
113
113
  | 'project-member'
114
114
  | 'reframe'
115
+ | 'refunds'
115
116
  | 'repaint'
116
117
  | 'restyle'
117
118
  | 'segmentation'
@@ -1748,6 +1749,7 @@ export namespace UsageListResponse {
1748
1749
  | 'models-training'
1749
1750
  | 'patch'
1750
1751
  | 'pixelate'
1752
+ | 'refunds'
1751
1753
  | 'repaint'
1752
1754
  | 'restyle'
1753
1755
  | 'segmentation'
@@ -1774,6 +1776,30 @@ export namespace UsageListResponse {
1774
1776
  * Value of the point
1775
1777
  */
1776
1778
  value: string;
1779
+
1780
+ /**
1781
+ * Cost in Creative Units for the point restricted to API-key calls (mirrors the
1782
+ * `apiKey` value field but on the cost axis).
1783
+ */
1784
+ apiKeyCost?: number;
1785
+
1786
+ /**
1787
+ * Discount in Creative Units for the point restricted to API-key calls.
1788
+ */
1789
+ apiKeyDiscount?: number;
1790
+
1791
+ /**
1792
+ * Cost in Creative Units (sum of `creativeUnitsCost`) for the point. Only
1793
+ * populated for usage actions that carry a CU cost (generations, trainings, etc.).
1794
+ * Free actions like `delete-asset` or `tag-asset` will report `0`.
1795
+ */
1796
+ cost?: number;
1797
+
1798
+ /**
1799
+ * Discount applied in Creative Units (sum of `creativeUnitsDiscount`) for the
1800
+ * point. Only populated for usage actions that carry a CU discount.
1801
+ */
1802
+ discount?: number;
1777
1803
  }
1778
1804
  }
1779
1805
  }
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '2.3.0'; // x-release-please-version
1
+ export const VERSION = '2.4.0-alpha.1'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "2.3.0";
1
+ export declare const VERSION = "2.4.0-alpha.1";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.mts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"version.d.mts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,UAAU,CAAC"}
1
+ {"version":3,"file":"version.d.mts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,kBAAkB,CAAC"}
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "2.3.0";
1
+ export declare const VERSION = "2.4.0-alpha.1";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,UAAU,CAAC"}
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,kBAAkB,CAAC"}
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '2.3.0'; // x-release-please-version
4
+ exports.VERSION = '2.4.0-alpha.1'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,OAAO,GAAG,OAAO,CAAC,CAAC,2BAA2B"}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,OAAO,GAAG,eAAe,CAAC,CAAC,2BAA2B"}
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '2.3.0'; // x-release-please-version
1
+ export const VERSION = '2.4.0-alpha.1'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map
package/version.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"version.mjs","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC,CAAC,2BAA2B"}
1
+ {"version":3,"file":"version.mjs","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,eAAe,CAAC,CAAC,2BAA2B"}