@nodaro/sdk 1.4.0 → 1.5.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/README.md CHANGED
@@ -270,7 +270,7 @@ try {
270
270
  | `client.locations` | Location Studio: CRUD, assets, atmosphere motion |
271
271
  | `client.objects` | Object Studio: CRUD, assets, motion |
272
272
  | `client.creatures` | Creature Studio: CRUD, assets, motion |
273
- | `client.voices` | Voice design, clone, remix, recast |
273
+ | `client.voices` | Voice catalog + clones (from URL or file), voice changer, multi-speaker recast + the interactive `analyze`/stems/`exportMix` flow, design, remix, dubbing |
274
274
  | `client.pipelines` | Showrunner pipelines: stages, approvals, chat, branch |
275
275
  | `client.reduce` | Fan-in reducer (pick-best, concat, vote, merge…) |
276
276
  | `client.promptHelper` | Prompt enhancement / wizard |
package/dist/index.cjs CHANGED
@@ -1584,6 +1584,152 @@ var VoicesResource = class {
1584
1584
  exportMix(input) {
1585
1585
  return this.client.request("POST", "/v1/voice-changer-pro/export", { body: input });
1586
1586
  }
1587
+ /**
1588
+ * Design a brand-new synthetic voice from a text description
1589
+ * (`POST /v1/voice-design`) — ElevenLabs text-to-voice. `text` (100–1000 chars)
1590
+ * is a preview line spoken in the designed voice; `voiceDescription` describes
1591
+ * the voice to create. Costs credits and runs async — poll `jobs.get(jobId)`
1592
+ * for the preview + the reusable voice id.
1593
+ */
1594
+ design(input) {
1595
+ return this.client.request("POST", "/v1/voice-design", { body: input });
1596
+ }
1597
+ /**
1598
+ * Generate speech in a voice described in natural language, without cloning
1599
+ * (`POST /v1/voice-remix`). `text` (1–5000 chars) is spoken in a voice matching
1600
+ * `voiceDescription`. Costs credits and runs async — poll `jobs.get(jobId)`.
1601
+ */
1602
+ remix(input) {
1603
+ return this.client.request("POST", "/v1/voice-remix", { body: input });
1604
+ }
1605
+ /**
1606
+ * Dub an audio clip into another language while preserving each speaker's voice
1607
+ * (`POST /v1/dubbing`). `targetLanguage` is an ISO code (e.g. `"es"`, `"fr"`);
1608
+ * `sourceLanguage` is auto-detected when omitted. Costs credits and runs async
1609
+ * — poll `jobs.get(jobId)`.
1610
+ */
1611
+ dub(input) {
1612
+ return this.client.request("POST", "/v1/dubbing", { body: input });
1613
+ }
1614
+ /**
1615
+ * Clone a voice from an audio FILE you hold in memory
1616
+ * (`POST /v1/voice-clones`, multipart) — the counterpart to
1617
+ * {@link VoicesResource.createClone}, which clones from an already-uploaded
1618
+ * URL. Pass the raw audio `file` (a `Blob`/`File` in the browser, or a
1619
+ * `Uint8Array`/`Buffer` in Node) plus a `name`. Costs credits. Returns the new
1620
+ * {@link VoiceClone} (`elevenlabsVoiceId` is the id to recast/synthesize with).
1621
+ */
1622
+ createCloneFromFile(input) {
1623
+ const form = new FormData();
1624
+ form.append("name", input.name);
1625
+ const blob = input.file instanceof Blob ? input.file : new Blob([input.file], { type: input.contentType ?? "audio/mpeg" });
1626
+ form.append("file", blob, input.filename ?? "sample");
1627
+ return this.client.request("POST", "/v1/voice-clones", { body: form });
1628
+ }
1629
+ };
1630
+
1631
+ // src/resources/media.ts
1632
+ var MediaResource = class {
1633
+ constructor(client) {
1634
+ this.client = client;
1635
+ }
1636
+ client;
1637
+ /**
1638
+ * Download a social video (YouTube / TikTok / Instagram / X / Facebook) into
1639
+ * your storage (`POST /v1/download-video`). `maxHeight` caps the resolution
1640
+ * (default "best"); `sectionStartSec` + `sectionEndSec` (both-or-neither) fetch
1641
+ * ONLY that time range instead of the whole video. Returns a `downloadId`;
1642
+ * progress streams from `GET /v1/download-video/progress/:downloadId`
1643
+ * (server-sent events) and the finished file lands in your library.
1644
+ */
1645
+ downloadVideo(input) {
1646
+ return this.client.request("POST", "/v1/download-video", { body: input });
1647
+ }
1648
+ /**
1649
+ * Copy an external media URL into your Nodaro storage (`POST /v1/save-to-storage`)
1650
+ * — a server-side fetch, so nothing round-trips through the client. Poll
1651
+ * `jobs.get(jobId)`.
1652
+ */
1653
+ saveToStorage(input) {
1654
+ return this.client.request("POST", "/v1/save-to-storage", { body: input });
1655
+ }
1656
+ /**
1657
+ * Trim a video to a range (`POST /v1/trim-video`). Give the range in whichever
1658
+ * unit fits: `startTime`/`endTime` seconds, `trim*Frames`, `trim*Seconds`, or
1659
+ * `keepFirst`/`keepLastSeconds`. Poll `jobs.get(jobId)`.
1660
+ */
1661
+ trimVideo(input) {
1662
+ return this.client.request("POST", "/v1/trim-video", { body: input });
1663
+ }
1664
+ /**
1665
+ * Trim (and extract) audio from a video or audio source
1666
+ * (`POST /v1/trim-audio`) to `[startTime, endTime]` seconds, in `audioFormat`
1667
+ * (`mp3` default / `wav` / `aac`). Poll `jobs.get(jobId)`.
1668
+ */
1669
+ trimAudio(input) {
1670
+ return this.client.request("POST", "/v1/trim-audio", { body: input });
1671
+ }
1672
+ /**
1673
+ * Probe a social video's metadata (`POST /v1/video-metadata`) — duration,
1674
+ * dimensions, title, live status — WITHOUT downloading it. A direct read, not a
1675
+ * job. Use it to decide whether to trim before importing.
1676
+ */
1677
+ videoMetadata(input) {
1678
+ return this.client.request("POST", "/v1/video-metadata", { body: input });
1679
+ }
1680
+ };
1681
+
1682
+ // src/resources/audio.ts
1683
+ var AudioResource = class {
1684
+ constructor(client) {
1685
+ this.client = client;
1686
+ }
1687
+ client;
1688
+ /**
1689
+ * Separate an audio track into stems (`POST /v1/audio-separation`, Demucs).
1690
+ * `mode` `"vocal_instrumental"` (default) splits voice from music/SFX;
1691
+ * `"stems"` returns the full drums/bass/other/… breakdown. `quality`
1692
+ * `auto` (default) / `fast` / `best`.
1693
+ */
1694
+ separate(input) {
1695
+ return this.client.request("POST", "/v1/audio-separation", { body: input });
1696
+ }
1697
+ /** Isolate the primary voice and strip background noise (`POST /v1/audio-isolation`, ElevenLabs). */
1698
+ isolate(input) {
1699
+ return this.client.request("POST", "/v1/audio-isolation", { body: input });
1700
+ }
1701
+ /**
1702
+ * Apply a reverb / echo / telephone / megaphone effect to an audio track
1703
+ * (`POST /v1/audio-fx`) — the same presets VCP's `voiceFx` uses, standalone.
1704
+ * `mix` (0–100) is the reverb wet/dry; `delayMs` + `decay` drive `echo`/`custom`;
1705
+ * `eqLow`/`eqHigh` (dB) shape telephone/megaphone.
1706
+ */
1707
+ applyFx(input) {
1708
+ return this.client.request("POST", "/v1/audio-fx", { body: input });
1709
+ }
1710
+ /**
1711
+ * Layer multiple audio tracks into one (`POST /v1/mix-audio`). `audioUrls`
1712
+ * (2–20) are summed; optional `trackVolumes` (0–200% each, positionally) set
1713
+ * per-track level.
1714
+ */
1715
+ mix(input) {
1716
+ return this.client.request("POST", "/v1/mix-audio", { body: input });
1717
+ }
1718
+ /**
1719
+ * Adjust an audio (or a video's audio) level (`POST /v1/adjust-volume`):
1720
+ * `volume` % (default 100), `normalize` to loudnorm, and `fadeIn`/`fadeOut`
1721
+ * seconds. Provide `audioUrl` or `videoUrl`.
1722
+ */
1723
+ adjustVolume(input) {
1724
+ return this.client.request("POST", "/v1/adjust-volume", { body: input });
1725
+ }
1726
+ /**
1727
+ * Concatenate audio segments end-to-end (`POST /v1/combine-audio`). Each
1728
+ * segment is a `url` with an optional `[startTime, endTime]` sub-range.
1729
+ */
1730
+ combine(input) {
1731
+ return this.client.request("POST", "/v1/combine-audio", { body: input });
1732
+ }
1587
1733
  };
1588
1734
 
1589
1735
  // src/resources/credits.ts
@@ -1886,6 +2032,8 @@ var NodaroClient = class {
1886
2032
  reduce;
1887
2033
  promptHelper;
1888
2034
  voices;
2035
+ media;
2036
+ audio;
1889
2037
  credits;
1890
2038
  uploads;
1891
2039
  library;
@@ -1913,6 +2061,8 @@ var NodaroClient = class {
1913
2061
  this.reduce = new ReduceResource(this);
1914
2062
  this.promptHelper = new PromptHelperResource(this);
1915
2063
  this.voices = new VoicesResource(this);
2064
+ this.media = new MediaResource(this);
2065
+ this.audio = new AudioResource(this);
1916
2066
  this.credits = new CreditsResource(this);
1917
2067
  this.uploads = new UploadsResource(this);
1918
2068
  this.library = new LibraryResource(this);
@@ -2079,6 +2229,7 @@ Object.defineProperty(exports, "SURROUND_DIRECTIONS", {
2079
2229
  get: function () { return shared.SURROUND_DIRECTIONS; }
2080
2230
  });
2081
2231
  exports.AppsResource = AppsResource;
2232
+ exports.AudioResource = AudioResource;
2082
2233
  exports.CREATURE_ASSET_TYPES = CREATURE_ASSET_TYPES;
2083
2234
  exports.CallbackAuth = CallbackAuth;
2084
2235
  exports.CharactersResource = CharactersResource;
@@ -2095,6 +2246,7 @@ exports.JobTimeoutError = JobTimeoutError;
2095
2246
  exports.JobsResource = JobsResource;
2096
2247
  exports.LibraryResource = LibraryResource;
2097
2248
  exports.LocationsResource = LocationsResource;
2249
+ exports.MediaResource = MediaResource;
2098
2250
  exports.NodaroClient = NodaroClient;
2099
2251
  exports.NodaroError = NodaroError;
2100
2252
  exports.NodesResource = NodesResource;