@scenario-labs/sdk 2.3.0 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +32 -0
- package/README.md +26 -0
- package/client.d.mts.map +1 -1
- package/client.d.ts.map +1 -1
- package/client.js +9 -1
- package/client.js.map +1 -1
- package/client.mjs +9 -1
- package/client.mjs.map +1 -1
- package/lib/cel/environment.d.mts +38 -0
- package/lib/cel/environment.d.mts.map +1 -0
- package/lib/cel/environment.d.ts +38 -0
- package/lib/cel/environment.d.ts.map +1 -0
- package/lib/cel/environment.js +52 -0
- package/lib/cel/environment.js.map +1 -0
- package/lib/cel/environment.mjs +48 -0
- package/lib/cel/environment.mjs.map +1 -0
- package/lib/cel/functions.d.mts +4 -0
- package/lib/cel/functions.d.mts.map +1 -0
- package/lib/cel/functions.d.ts +4 -0
- package/lib/cel/functions.d.ts.map +1 -0
- package/lib/cel/functions.js +67 -0
- package/lib/cel/functions.js.map +1 -0
- package/lib/cel/functions.mjs +64 -0
- package/lib/cel/functions.mjs.map +1 -0
- package/lib/cel/index.d.mts +3 -0
- package/lib/cel/index.d.mts.map +1 -0
- package/lib/cel/index.d.ts +3 -0
- package/lib/cel/index.d.ts.map +1 -0
- package/lib/cel/index.js +9 -0
- package/lib/cel/index.js.map +1 -0
- package/lib/cel/index.mjs +3 -0
- package/lib/cel/index.mjs.map +1 -0
- package/lib/cel/prng.d.mts +28 -0
- package/lib/cel/prng.d.mts.map +1 -0
- package/lib/cel/prng.d.ts +28 -0
- package/lib/cel/prng.d.ts.map +1 -0
- package/lib/cel/prng.js +64 -0
- package/lib/cel/prng.js.map +1 -0
- package/lib/cel/prng.mjs +58 -0
- package/lib/cel/prng.mjs.map +1 -0
- package/lib/workflow_converter.d.mts +9 -0
- package/lib/workflow_converter.d.mts.map +1 -1
- package/lib/workflow_converter.d.ts +9 -0
- package/lib/workflow_converter.d.ts.map +1 -1
- package/lib/workflow_converter.js +64 -18
- package/lib/workflow_converter.js.map +1 -1
- package/lib/workflow_converter.mjs +64 -18
- package/lib/workflow_converter.mjs.map +1 -1
- package/lib/workflow_import_validator.d.mts +1 -1
- package/lib/workflow_import_validator.d.mts.map +1 -1
- package/lib/workflow_import_validator.d.ts +1 -1
- package/lib/workflow_import_validator.d.ts.map +1 -1
- package/lib/workflow_import_validator.js +1 -0
- package/lib/workflow_import_validator.js.map +1 -1
- package/lib/workflow_import_validator.mjs +1 -0
- package/lib/workflow_import_validator.mjs.map +1 -1
- package/package.json +25 -4
- package/resources/generate.d.mts +586 -2
- package/resources/generate.d.mts.map +1 -1
- package/resources/generate.d.ts +586 -2
- package/resources/generate.d.ts.map +1 -1
- package/resources/generate.js +2 -2
- package/resources/generate.js.map +1 -1
- package/resources/generate.mjs +2 -2
- package/resources/generate.mjs.map +1 -1
- package/resources/models/train.d.mts +69 -0
- package/resources/models/train.d.mts.map +1 -1
- package/resources/models/train.d.ts +69 -0
- package/resources/models/train.d.ts.map +1 -1
- package/resources/usages.d.mts +22 -2
- package/resources/usages.d.mts.map +1 -1
- package/resources/usages.d.ts +22 -2
- package/resources/usages.d.ts.map +1 -1
- package/src/client.ts +9 -1
- package/src/lib/cel/environment.ts +81 -0
- package/src/lib/cel/functions.ts +109 -0
- package/src/lib/cel/index.ts +8 -0
- package/src/lib/cel/prng.ts +62 -0
- package/src/lib/workflow_converter.ts +104 -17
- package/src/lib/workflow_import_validator.ts +3 -1
- package/src/resources/generate.ts +705 -4
- package/src/resources/models/train.ts +83 -0
- package/src/resources/usages.ts +26 -0
- package/src/tools/cel.ts +4 -0
- package/src/version.ts +1 -1
- package/tools/cel.d.mts +2 -0
- package/tools/cel.d.mts.map +1 -0
- package/tools/cel.d.ts +2 -0
- package/tools/cel.d.ts.map +1 -0
- package/tools/cel.js +8 -0
- package/tools/cel.js.map +1 -0
- package/tools/cel.mjs +5 -0
- package/tools/cel.mjs.map +1 -0
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +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 {
|
package/src/resources/usages.ts
CHANGED
|
@@ -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/tools/cel.ts
ADDED
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '2.
|
|
1
|
+
export const VERSION = '2.4.0'; // x-release-please-version
|
package/tools/cel.d.mts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cel.d.mts","sourceRoot":"","sources":["../src/tools/cel.ts"],"names":[],"mappings":"AAGA,qCAAiC"}
|
package/tools/cel.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cel.d.ts","sourceRoot":"","sources":["../src/tools/cel.ts"],"names":[],"mappings":"AAGA,oCAAiC"}
|
package/tools/cel.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("../internal/tslib.js");
|
|
4
|
+
// Public "tools" namespace: import from '@scenario-labs/sdk/tools/cel'.
|
|
5
|
+
// Implementation lives in src/lib/cel/ (the Stainless generator never
|
|
6
|
+
// modifies src/lib/); this shim only defines the public import path.
|
|
7
|
+
tslib_1.__exportStar(require("../lib/cel/index.js"), exports);
|
|
8
|
+
//# sourceMappingURL=cel.js.map
|
package/tools/cel.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cel.js","sourceRoot":"","sources":["../src/tools/cel.ts"],"names":[],"mappings":";;;AAAA,wEAAwE;AACxE,sEAAsE;AACtE,qEAAqE;AACrE,8DAAiC"}
|
package/tools/cel.mjs
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// Public "tools" namespace: import from '@scenario-labs/sdk/tools/cel'.
|
|
2
|
+
// Implementation lives in src/lib/cel/ (the Stainless generator never
|
|
3
|
+
// modifies src/lib/); this shim only defines the public import path.
|
|
4
|
+
export * from "../lib/cel/index.mjs";
|
|
5
|
+
//# sourceMappingURL=cel.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cel.mjs","sourceRoot":"","sources":["../src/tools/cel.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,sEAAsE;AACtE,qEAAqE;AACrE,qCAAiC"}
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "2.
|
|
1
|
+
export declare const VERSION = "2.4.0";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "2.
|
|
1
|
+
export declare const VERSION = "2.4.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '2.
|
|
1
|
+
export const VERSION = '2.4.0'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|