@byte_fluffy/nexra-sdk 0.1.0-alpha.17 → 0.1.0-alpha.18

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/dist/catalog.js CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  getModelSpec,
7
7
  listModelSpecs,
8
8
  projectMediaGeometry
9
- } from "./chunk-ZDFPKKHQ.js";
9
+ } from "./chunk-VFIIDWIH.js";
10
10
  export {
11
11
  CatalogClient,
12
12
  applyMediaGeometry,
@@ -3779,8 +3779,10 @@ var image_generated_default = [
3779
3779
  default: false,
3780
3780
  "x-ui": {
3781
3781
  order: 4,
3782
- control: "switch"
3783
- }
3782
+ control: "switch",
3783
+ hidden: true
3784
+ },
3785
+ const: false
3784
3786
  },
3785
3787
  seed: {
3786
3788
  type: "integer",
@@ -4259,8 +4261,10 @@ var image_generated_default = [
4259
4261
  default: false,
4260
4262
  "x-ui": {
4261
4263
  order: 4,
4262
- control: "switch"
4263
- }
4264
+ control: "switch",
4265
+ hidden: true
4266
+ },
4267
+ const: false
4264
4268
  },
4265
4269
  seed: {
4266
4270
  type: "integer",
@@ -4846,8 +4850,10 @@ var image_generated_default = [
4846
4850
  title: "\u6C34\u5370",
4847
4851
  description: "\u662F\u5426\u6DFB\u52A0\u6C34\u5370\u3002",
4848
4852
  "x-ui": {
4849
- order: 5
4850
- }
4853
+ order: 5,
4854
+ hidden: true
4855
+ },
4856
+ const: false
4851
4857
  }
4852
4858
  },
4853
4859
  required: [
@@ -5085,8 +5091,10 @@ var image_generated_default = [
5085
5091
  title: "\u6C34\u5370",
5086
5092
  description: "\u662F\u5426\u6DFB\u52A0\u6C34\u5370\u3002",
5087
5093
  "x-ui": {
5088
- order: 5
5089
- }
5094
+ order: 5,
5095
+ hidden: true
5096
+ },
5097
+ const: false
5090
5098
  },
5091
5099
  layer_decomposition: {
5092
5100
  type: "boolean",
@@ -21669,9 +21677,11 @@ var video_generated_default = [
21669
21677
  description: "Whether to add an AI Generated watermark to the output.",
21670
21678
  "x-ui": {
21671
21679
  order: 10,
21672
- control: "switch"
21680
+ control: "switch",
21681
+ hidden: true
21673
21682
  },
21674
- default: false
21683
+ default: false,
21684
+ const: false
21675
21685
  },
21676
21686
  seed: {
21677
21687
  type: "integer",
@@ -22153,6 +22163,11 @@ var video_generated_default = [
22153
22163
  {
22154
22164
  metric: "output_video_seconds",
22155
22165
  requirement: "required"
22166
+ },
22167
+ {
22168
+ metric: "input_video_seconds",
22169
+ requirement: "conditional",
22170
+ whenFeature: "task_input_video_v1"
22156
22171
  }
22157
22172
  ]
22158
22173
  }
@@ -22759,8 +22774,10 @@ var video_generated_default = [
22759
22774
  title: "\u89C6\u9891\u6C34\u5370",
22760
22775
  default: false,
22761
22776
  "x-ui": {
22762
- order: 5
22763
- }
22777
+ order: 5,
22778
+ hidden: true
22779
+ },
22780
+ const: false
22764
22781
  },
22765
22782
  return_last_frame: {
22766
22783
  type: "boolean",
@@ -23492,8 +23509,10 @@ var video_generated_default = [
23492
23509
  title: "\u89C6\u9891\u6C34\u5370",
23493
23510
  default: false,
23494
23511
  "x-ui": {
23495
- order: 5
23496
- }
23512
+ order: 5,
23513
+ hidden: true
23514
+ },
23515
+ const: false
23497
23516
  },
23498
23517
  return_last_frame: {
23499
23518
  type: "boolean",
@@ -24225,8 +24244,10 @@ var video_generated_default = [
24225
24244
  title: "\u89C6\u9891\u6C34\u5370",
24226
24245
  default: false,
24227
24246
  "x-ui": {
24228
- order: 5
24229
- }
24247
+ order: 5,
24248
+ hidden: true
24249
+ },
24250
+ const: false
24230
24251
  },
24231
24252
  return_last_frame: {
24232
24253
  type: "boolean",
@@ -25213,8 +25234,10 @@ var video_generated_default = [
25213
25234
  title: "\u89C6\u9891\u6C34\u5370",
25214
25235
  default: false,
25215
25236
  "x-ui": {
25216
- order: 5
25217
- }
25237
+ order: 5,
25238
+ hidden: true
25239
+ },
25240
+ const: false
25218
25241
  },
25219
25242
  return_last_frame: {
25220
25243
  type: "boolean",
@@ -26159,8 +26182,10 @@ var video_generated_default = [
26159
26182
  title: "\u89C6\u9891\u6C34\u5370",
26160
26183
  default: false,
26161
26184
  "x-ui": {
26162
- order: 5
26163
- }
26185
+ order: 5,
26186
+ hidden: true
26187
+ },
26188
+ const: false
26164
26189
  },
26165
26190
  return_last_frame: {
26166
26191
  type: "boolean",
@@ -26920,8 +26945,10 @@ var video_generated_default = [
26920
26945
  title: "\u89C6\u9891\u6C34\u5370",
26921
26946
  default: false,
26922
26947
  "x-ui": {
26923
- order: 5
26924
- }
26948
+ order: 5,
26949
+ hidden: true
26950
+ },
26951
+ const: false
26925
26952
  },
26926
26953
  return_last_frame: {
26927
26954
  type: "boolean",
@@ -27678,8 +27705,10 @@ var video_generated_default = [
27678
27705
  title: "\u89C6\u9891\u6C34\u5370",
27679
27706
  default: false,
27680
27707
  "x-ui": {
27681
- order: 7
27682
- }
27708
+ order: 7,
27709
+ hidden: true
27710
+ },
27711
+ const: false
27683
27712
  },
27684
27713
  return_last_frame: {
27685
27714
  type: "boolean",
@@ -34311,6 +34340,24 @@ function applyMediaGeometry(inputSchema, input) {
34311
34340
  return next;
34312
34341
  }
34313
34342
 
34343
+ // src/catalog/watermark.ts
34344
+ function isObject2(value) {
34345
+ return value !== null && typeof value === "object" && !Array.isArray(value);
34346
+ }
34347
+ function isFixedOff(field) {
34348
+ return isObject2(field) && field.type === "boolean" && field.const === false;
34349
+ }
34350
+ function applyNoWatermark(inputSchema, input) {
34351
+ const properties = isObject2(inputSchema.properties) ? inputSchema.properties : {};
34352
+ if (isFixedOff(properties.watermark)) return { ...input, watermark: false };
34353
+ const parametersSchema = isObject2(properties.parameters) ? properties.parameters : {};
34354
+ const parameterProperties = isObject2(parametersSchema.properties) ? parametersSchema.properties : {};
34355
+ if (isFixedOff(parameterProperties.watermark)) {
34356
+ return { ...input, parameters: { ...isObject2(input.parameters) ? input.parameters : {}, watermark: false } };
34357
+ }
34358
+ return input;
34359
+ }
34360
+
34314
34361
  // src/errors.ts
34315
34362
  var NexraApiError = class extends Error {
34316
34363
  status;
@@ -34348,7 +34395,7 @@ var NexraWaitTimeoutError = class extends Error {
34348
34395
  };
34349
34396
 
34350
34397
  // src/generated/version.generated.ts
34351
- var SDK_VERSION = "0.1.0-alpha.17";
34398
+ var SDK_VERSION = "0.1.0-alpha.18";
34352
34399
 
34353
34400
  // src/transport.ts
34354
34401
  var DEFAULT_BASE_URL = "https://api.nexra-ai.com/v1";
@@ -34494,7 +34541,7 @@ var CatalogClient = class {
34494
34541
  quote(request, signal) {
34495
34542
  const spec = getModelSpec(request.modelId);
34496
34543
  const schema = spec?.operations.find((operation) => operation.operation === request.operation)?.inputSchema ?? spec?.operations[0]?.inputSchema;
34497
- const input = schema ? applyMediaGeometry(schema, request.input) : request.input;
34544
+ const input = schema ? applyNoWatermark(schema, applyMediaGeometry(schema, request.input)) : request.input;
34498
34545
  return this.transport.json(
34499
34546
  "/catalog/quotes",
34500
34547
  { method: "POST", ...jsonBody({ ...request, input }), signal },
@@ -34504,7 +34551,7 @@ var CatalogClient = class {
34504
34551
  quoteBatch(request, signal) {
34505
34552
  const spec = getModelSpec(request.modelId);
34506
34553
  const schema = spec?.operations.find((operation) => operation.operation === request.operation)?.inputSchema ?? spec?.operations[0]?.inputSchema;
34507
- const entries = schema ? request.entries.map((entry) => ({ ...entry, input: applyMediaGeometry(schema, entry.input) })) : request.entries;
34554
+ const entries = schema ? request.entries.map((entry) => ({ ...entry, input: applyNoWatermark(schema, applyMediaGeometry(schema, entry.input)) })) : request.entries;
34508
34555
  return this.transport.json(
34509
34556
  "/catalog/quotes/batch",
34510
34557
  { method: "POST", ...jsonBody({ ...request, entries }), signal },
@@ -34550,6 +34597,7 @@ export {
34550
34597
  encodeMediaGeometry,
34551
34598
  decodeMediaGeometry,
34552
34599
  applyMediaGeometry,
34600
+ applyNoWatermark,
34553
34601
  CatalogClient,
34554
34602
  getModelSpec,
34555
34603
  listModelSpecs
package/dist/index.js CHANGED
@@ -7,6 +7,7 @@ import {
7
7
  NexraWaitTimeoutError,
8
8
  TASK_STATUSES,
9
9
  applyMediaGeometry,
10
+ applyNoWatermark,
10
11
  decodeMediaGeometry,
11
12
  encodeMediaGeometry,
12
13
  getModelSpec,
@@ -16,7 +17,7 @@ import {
16
17
  projectMediaGeometry,
17
18
  queryString,
18
19
  sleep
19
- } from "./chunk-ZDFPKKHQ.js";
20
+ } from "./chunk-VFIIDWIH.js";
20
21
  import {
21
22
  ceilDecimal,
22
23
  multiplyDecimal
@@ -280,7 +281,7 @@ var TasksClient = class {
280
281
  assets;
281
282
  async create(model, options) {
282
283
  const schema = getModelSpec(model)?.operations[0]?.inputSchema;
283
- const mapped = schema && options.input && typeof options.input === "object" && !Array.isArray(options.input) ? applyMediaGeometry(schema, options.input) : options.input;
284
+ const mapped = schema && options.input && typeof options.input === "object" && !Array.isArray(options.input) ? applyNoWatermark(schema, applyMediaGeometry(schema, options.input)) : options.input;
284
285
  const input = await normalizeTaskInput(mapped, this.assets, options.signal);
285
286
  const body = {
286
287
  model,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@byte_fluffy/nexra-sdk",
3
- "version": "0.1.0-alpha.17",
3
+ "version": "0.1.0-alpha.18",
4
4
  "type": "module",
5
5
  "types": "./dist/index.d.ts",
6
6
  "sideEffects": false,