@nodaro/sdk 2.22.0 → 2.25.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/dist/index.js CHANGED
@@ -1027,10 +1027,14 @@ var CharactersResource = class {
1027
1027
  /**
1028
1028
  * Fetch a single character including in-flight portrait / asset job state.
1029
1029
  * Soft-deleted (archived) rows are returned by id intentionally so canvas
1030
- * nodes that hold a stale `characterDbId` keep loading.
1030
+ * nodes that hold a stale `characterDbId` keep loading. Pass
1031
+ * `{ candidates: "all" }` to also get the current portrait's own take in
1032
+ * `previousCandidates` (flagged `isPortrait: true`).
1031
1033
  */
1032
- get(id) {
1033
- return this.client.request("GET", `/v1/characters/${encodeURIComponent(id)}`);
1034
+ get(id, options = {}) {
1035
+ const query = {};
1036
+ if (options.candidates) query.candidates = options.candidates;
1037
+ return this.client.request("GET", `/v1/characters/${encodeURIComponent(id)}`, { query });
1034
1038
  }
1035
1039
  /**
1036
1040
  * Create or update a character. Omit `id` to create; supply it to update
@@ -1101,8 +1105,8 @@ var CharactersResource = class {
1101
1105
  * is enqueued — mid-batch failures roll back atomically.
1102
1106
  *
1103
1107
  * When `attachToCharacterId` is set, the worker writes the result directly
1104
- * to the row's `source_image_url`; otherwise you must call
1105
- * `approvePortrait()` after picking a candidate.
1108
+ * to the row's `source_image_url` (unless `attachPortrait: false`);
1109
+ * otherwise you must call `approvePortrait()` after picking a candidate.
1106
1110
  */
1107
1111
  generate(input) {
1108
1112
  return this.client.request("POST", "/v1/generate-character", { body: input });
@@ -2425,6 +2429,32 @@ var MediaResource = class {
2425
2429
  videoOverlay(input) {
2426
2430
  return this.client.request("POST", "/v1/video-overlay", { body: input });
2427
2431
  }
2432
+ /**
2433
+ * Track a subject described in plain text through a video and get a
2434
+ * black-and-white MASK VIDEO back (`POST /v1/video-mask`, SAM 3.1 by default,
2435
+ * or `provider: "sam-3"` at half the price) — white = the subject. Clips up
2436
+ * to 5 minutes at 30 fps (a faster clip counts
2437
+ * proportionally longer), priced by the clip's length. Poll
2438
+ * `jobs.get(jobId)`: the output carries `videoUrl` (the mask), `width`,
2439
+ * `height`, `frames` and `coverage` (the fraction of pixels selected). Feed
2440
+ * the mask to {@link MediaResource.maskComposite}.
2441
+ */
2442
+ videoMask(input) {
2443
+ return this.client.request("POST", "/v1/video-mask", { body: input });
2444
+ }
2445
+ /**
2446
+ * Place a foreground video over a background video through a mask video
2447
+ * (`POST /v1/mask-composite`; white = foreground) — local FFmpeg, no AI.
2448
+ * The result follows the foreground's size, frame rate and length; the
2449
+ * background is fitted (`backgroundFit`, default cover) and loops when
2450
+ * shorter; the mask holds its last frame when shorter. Optional
2451
+ * `invertMask`, `feather` (0–20 px), `grow` (−10–10 px) and `audioSource`
2452
+ * (foreground / background / mix / none). Priced per started 5 seconds of
2453
+ * the result (foreground up to 300 s). Poll `jobs.get(jobId)` for `videoUrl`.
2454
+ */
2455
+ maskComposite(input) {
2456
+ return this.client.request("POST", "/v1/mask-composite", { body: input });
2457
+ }
2428
2458
  /**
2429
2459
  * Probe a social video's metadata (`POST /v1/video-metadata`) — duration,
2430
2460
  * dimensions, title, live status — WITHOUT downloading it. A direct read, not a
@@ -2496,6 +2526,16 @@ var AudioResource = class {
2496
2526
  adjustVolume(input) {
2497
2527
  return this.client.request("POST", "/v1/adjust-volume", { body: input });
2498
2528
  }
2529
+ /**
2530
+ * Shift pitch and/or change tempo with Rubber Band (`POST /v1/pitch-tempo`):
2531
+ * `semitones` −12…+12 (default 0), `tempo` 0.5…2 with the pitch kept
2532
+ * (default 1; fixed at 1 for a video), `preserveFormants` (default true).
2533
+ * Provide exactly one of `audioUrl` or `videoUrl` — a video keeps its picture.
2534
+ * Input up to 30 minutes, priced per started minute.
2535
+ */
2536
+ pitchTempo(input) {
2537
+ return this.client.request("POST", "/v1/pitch-tempo", { body: input });
2538
+ }
2499
2539
  /**
2500
2540
  * Concatenate audio segments end-to-end (`POST /v1/combine-audio`). Each
2501
2541
  * segment is a `url` with an optional `[startTime, endTime]` sub-range.
@@ -4014,7 +4054,7 @@ var EditResource = class {
4014
4054
  return remapTranscriptThroughEdl(edl, transcript);
4015
4055
  }
4016
4056
  };
4017
- var SDK_VERSION = "2.22.0" ;
4057
+ var SDK_VERSION = "2.25.0" ;
4018
4058
  var CLIENT_HEADER = "X-Nodaro-Client";
4019
4059
  var isBrowser = () => typeof window !== "undefined" && typeof window.document !== "undefined";
4020
4060
  var NodaroClient = class _NodaroClient {