@nodaro/sdk 2.74.0 → 2.76.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.
Files changed (153) hide show
  1. package/dist/chunk-3WQ4UW3C.js +3 -0
  2. package/dist/chunk-3WQ4UW3C.js.map +1 -0
  3. package/dist/{chunk-IJAJTVEW.js → chunk-4Q3XZE5O.js} +17 -3
  4. package/dist/chunk-4Q3XZE5O.js.map +1 -0
  5. package/dist/{chunk-INRVOUKE.js → chunk-66IQZPPW.js} +47 -3
  6. package/dist/chunk-66IQZPPW.js.map +1 -0
  7. package/dist/{chunk-MQQA2E6J.cjs → chunk-6NIKAVI3.cjs} +2 -2
  8. package/dist/chunk-6NIKAVI3.cjs.map +1 -0
  9. package/dist/{chunk-YE6X5BQ2.js → chunk-6TR7QXSX.js} +3 -3
  10. package/dist/{chunk-YE6X5BQ2.js.map → chunk-6TR7QXSX.js.map} +1 -1
  11. package/dist/chunk-6YWXKDAY.cjs +190 -0
  12. package/dist/chunk-6YWXKDAY.cjs.map +1 -0
  13. package/dist/chunk-7NTMMIPC.cjs +4 -0
  14. package/dist/chunk-7NTMMIPC.cjs.map +1 -0
  15. package/dist/{chunk-CLBLAWH3.cjs → chunk-7PMOXQEO.cjs} +9 -9
  16. package/dist/{chunk-CLBLAWH3.cjs.map → chunk-7PMOXQEO.cjs.map} +1 -1
  17. package/dist/{chunk-BETFYVOR.cjs → chunk-7XKVBFKM.cjs} +5 -5
  18. package/dist/{chunk-BETFYVOR.cjs.map → chunk-7XKVBFKM.cjs.map} +1 -1
  19. package/dist/{chunk-HNUCPUIX.js → chunk-AOHDYZSZ.js} +3 -3
  20. package/dist/{chunk-HNUCPUIX.js.map → chunk-AOHDYZSZ.js.map} +1 -1
  21. package/dist/{chunk-TKSQCF2X.js → chunk-CSNYBGHP.js} +2 -2
  22. package/dist/chunk-CSNYBGHP.js.map +1 -0
  23. package/dist/{chunk-4AD3CBDK.cjs → chunk-E2NMFQNY.cjs} +18 -2
  24. package/dist/chunk-E2NMFQNY.cjs.map +1 -0
  25. package/dist/{chunk-NJ5ZFUWJ.js → chunk-FOC4VPGK.js} +4 -4
  26. package/dist/{chunk-NJ5ZFUWJ.js.map → chunk-FOC4VPGK.js.map} +1 -1
  27. package/dist/{chunk-KKQKJD7K.js → chunk-GWL4O3J2.js} +3 -3
  28. package/dist/chunk-GWL4O3J2.js.map +1 -0
  29. package/dist/{chunk-BNJUMQQ3.cjs → chunk-IKZIXM5C.cjs} +24 -8
  30. package/dist/{chunk-BNJUMQQ3.cjs.map → chunk-IKZIXM5C.cjs.map} +1 -1
  31. package/dist/{chunk-GU3YOOCK.cjs → chunk-IO7NEEZZ.cjs} +20 -18
  32. package/dist/chunk-IO7NEEZZ.cjs.map +1 -0
  33. package/dist/chunk-K53JD2ZC.js +187 -0
  34. package/dist/chunk-K53JD2ZC.js.map +1 -0
  35. package/dist/{chunk-6RH2SICN.cjs → chunk-KNBZFWVO.cjs} +22 -22
  36. package/dist/chunk-KNBZFWVO.cjs.map +1 -0
  37. package/dist/{chunk-UDRP64FX.js → chunk-NEGNTQLF.js} +24 -8
  38. package/dist/{chunk-UDRP64FX.js.map → chunk-NEGNTQLF.js.map} +1 -1
  39. package/dist/{chunk-VGY3WBNY.js → chunk-OO4AKYUN.js} +3 -3
  40. package/dist/{chunk-VGY3WBNY.js.map → chunk-OO4AKYUN.js.map} +1 -1
  41. package/dist/{chunk-CCXY4ZJM.js → chunk-SA7VTT7C.js} +3 -3
  42. package/dist/{chunk-CCXY4ZJM.js.map → chunk-SA7VTT7C.js.map} +1 -1
  43. package/dist/{chunk-SRL555ST.cjs → chunk-SGVJUVFD.cjs} +5 -5
  44. package/dist/{chunk-SRL555ST.cjs.map → chunk-SGVJUVFD.cjs.map} +1 -1
  45. package/dist/{chunk-VVVJW4DD.cjs → chunk-SGVTZ2J5.cjs} +31 -28
  46. package/dist/chunk-SGVTZ2J5.cjs.map +1 -0
  47. package/dist/{chunk-YUY56PT7.js → chunk-TZFZDEWI.js} +20 -19
  48. package/dist/chunk-TZFZDEWI.js.map +1 -0
  49. package/dist/{chunk-IKJNFENZ.js → chunk-U2F6IHHY.js} +20 -17
  50. package/dist/chunk-U2F6IHHY.js.map +1 -0
  51. package/dist/{chunk-C5GFDCK2.cjs → chunk-UKITRPXF.cjs} +2 -2
  52. package/dist/{chunk-C5GFDCK2.cjs.map → chunk-UKITRPXF.cjs.map} +1 -1
  53. package/dist/{chunk-VTHHSO2K.cjs → chunk-UPWAODYT.cjs} +4 -4
  54. package/dist/{chunk-VTHHSO2K.cjs.map → chunk-UPWAODYT.cjs.map} +1 -1
  55. package/dist/{chunk-YDRNPIUC.cjs → chunk-VMV5JH4U.cjs} +47 -3
  56. package/dist/chunk-VMV5JH4U.cjs.map +1 -0
  57. package/dist/{chunk-R5DTFY73.js → chunk-WY5QIOO4.js} +2 -2
  58. package/dist/{chunk-R5DTFY73.js.map → chunk-WY5QIOO4.js.map} +1 -1
  59. package/dist/{chunk-EJJIA765.cjs → chunk-XWPYN2VX.cjs} +5 -5
  60. package/dist/{chunk-EJJIA765.cjs.map → chunk-XWPYN2VX.cjs.map} +1 -1
  61. package/dist/{chunk-SZ67PDKE.js → chunk-YQ2Q4OM3.js} +3 -3
  62. package/dist/{chunk-SZ67PDKE.js.map → chunk-YQ2Q4OM3.js.map} +1 -1
  63. package/dist/{chunk-TQLOD7OL.cjs → chunk-ZJM5YBXY.cjs} +4 -4
  64. package/dist/{chunk-TQLOD7OL.cjs.map → chunk-ZJM5YBXY.cjs.map} +1 -1
  65. package/dist/entries/billing.cjs +2 -2
  66. package/dist/entries/billing.d.cts +93 -5
  67. package/dist/entries/billing.d.ts +93 -5
  68. package/dist/entries/billing.js +1 -1
  69. package/dist/entries/cast-swap.cjs +2 -2
  70. package/dist/entries/cast-swap.d.cts +2 -623
  71. package/dist/entries/cast-swap.d.ts +2 -623
  72. package/dist/entries/cast-swap.js +1 -1
  73. package/dist/entries/characters.d.cts +1 -1
  74. package/dist/entries/characters.d.ts +1 -1
  75. package/dist/entries/client.cjs +20 -20
  76. package/dist/entries/client.d.cts +7 -5
  77. package/dist/entries/client.d.ts +7 -5
  78. package/dist/entries/client.js +15 -15
  79. package/dist/entries/copilot.cjs +4 -4
  80. package/dist/entries/copilot.js +3 -3
  81. package/dist/entries/core.cjs +6 -6
  82. package/dist/entries/core.js +2 -2
  83. package/dist/entries/creatures.d.cts +1 -1
  84. package/dist/entries/creatures.d.ts +1 -1
  85. package/dist/entries/credits.cjs +2 -2
  86. package/dist/entries/credits.d.cts +49 -9
  87. package/dist/entries/credits.d.ts +49 -9
  88. package/dist/entries/credits.js +1 -1
  89. package/dist/entries/edit.cjs +7 -7
  90. package/dist/entries/edit.js +2 -2
  91. package/dist/entries/errors.cjs +36 -28
  92. package/dist/entries/errors.d.cts +24 -1
  93. package/dist/entries/errors.d.ts +24 -1
  94. package/dist/entries/errors.js +1 -1
  95. package/dist/entries/jobs.cjs +2 -2
  96. package/dist/entries/jobs.d.cts +4 -4
  97. package/dist/entries/jobs.d.ts +4 -4
  98. package/dist/entries/jobs.js +1 -1
  99. package/dist/entries/locations.d.cts +1 -1
  100. package/dist/entries/locations.d.ts +1 -1
  101. package/dist/entries/media.cjs +4 -4
  102. package/dist/entries/media.d.cts +1 -1
  103. package/dist/entries/media.d.ts +1 -1
  104. package/dist/entries/media.js +3 -3
  105. package/dist/entries/nodes.cjs +3 -3
  106. package/dist/entries/nodes.d.cts +1 -1
  107. package/dist/entries/nodes.d.ts +1 -1
  108. package/dist/entries/nodes.js +2 -2
  109. package/dist/entries/objects.d.cts +1 -1
  110. package/dist/entries/objects.d.ts +1 -1
  111. package/dist/entries/scene3d.d.cts +2 -2
  112. package/dist/entries/scene3d.d.ts +2 -2
  113. package/dist/entries/studio.cjs +5 -5
  114. package/dist/entries/studio.js +2 -2
  115. package/dist/entries/trends.cjs +2 -2
  116. package/dist/entries/trends.d.cts +26 -18
  117. package/dist/entries/trends.d.ts +26 -18
  118. package/dist/entries/trends.js +1 -1
  119. package/dist/entries/uploads.cjs +7 -2
  120. package/dist/entries/uploads.d.cts +60 -1
  121. package/dist/entries/uploads.d.ts +60 -1
  122. package/dist/entries/uploads.js +2 -1
  123. package/dist/entries/video-remake.cjs +13 -0
  124. package/dist/entries/video-remake.cjs.map +1 -0
  125. package/dist/entries/video-remake.d.cts +4 -0
  126. package/dist/entries/video-remake.d.ts +4 -0
  127. package/dist/entries/video-remake.js +4 -0
  128. package/dist/entries/video-remake.js.map +1 -0
  129. package/dist/index.cjs +82 -65
  130. package/dist/index.d.cts +6 -6
  131. package/dist/index.d.ts +6 -6
  132. package/dist/index.js +16 -15
  133. package/dist/{nodes-DEGPmZ9a.d.cts → nodes-BHtjh6gl.d.cts} +8 -5
  134. package/dist/{nodes-CHXTwiWW.d.ts → nodes-BaRqRB2Z.d.ts} +8 -5
  135. package/dist/video-remake-C-KR7YtT.d.ts +676 -0
  136. package/dist/video-remake-DTuCyhd9.d.cts +676 -0
  137. package/package.json +8 -3
  138. package/dist/chunk-4AD3CBDK.cjs.map +0 -1
  139. package/dist/chunk-6RH2SICN.cjs.map +0 -1
  140. package/dist/chunk-F6KAMECM.cjs +0 -72
  141. package/dist/chunk-F6KAMECM.cjs.map +0 -1
  142. package/dist/chunk-GU3YOOCK.cjs.map +0 -1
  143. package/dist/chunk-IJAJTVEW.js.map +0 -1
  144. package/dist/chunk-IKJNFENZ.js.map +0 -1
  145. package/dist/chunk-INRVOUKE.js.map +0 -1
  146. package/dist/chunk-KKQKJD7K.js.map +0 -1
  147. package/dist/chunk-MQQA2E6J.cjs.map +0 -1
  148. package/dist/chunk-TKSQCF2X.js.map +0 -1
  149. package/dist/chunk-VVVJW4DD.cjs.map +0 -1
  150. package/dist/chunk-YDRNPIUC.cjs.map +0 -1
  151. package/dist/chunk-YEOK5A5H.js +0 -70
  152. package/dist/chunk-YEOK5A5H.js.map +0 -1
  153. package/dist/chunk-YUY56PT7.js.map +0 -1
@@ -1,625 +1,4 @@
1
- import { N as NodaroClientCore } from '../developer-apps-D59GfAnO.cjs';
1
+ export { C as CastSwapEngine, a as CastSwapEngineLegacyId, b as CastSwapEstimate, c as CastSwapFaceMasking, d as CastSwapFaceMaskingZone, e as CastSwapFullQualityEstimate, f as CastSwapFullQualityKind, g as CastSwapFullQualityParams, h as CastSwapFullQualityRefusalCode, i as CastSwapFullQualityResult, j as CastSwapKlingLength, k as CastSwapLocationRole, l as CastSwapMotionLength, m as CastSwapParams, n as CastSwapPersonRole, o as CastSwapPetRole, p as CastSwapProductRole, q as CastSwapReference, r as CastSwapResource, s as CastSwapRole, t as CastSwapRolePreviewSettings, u as CastSwapRunOptions, v as CastSwapStyle, w as CastSwapStyleChoice, x as CastSwapStyleChoiceOption, y as CastSwapTraitSource } from '../video-remake-DTuCyhd9.cjs';
2
+ import '../developer-apps-D59GfAnO.cjs';
2
3
  import '@nodaro/shared/apps';
3
4
  import '@nodaro/shared/organizations';
4
-
5
- /**
6
- * Nodaro Motion (the `castSwap` resource; routes `/v1/cast-swap`) — replace
7
- * the people, pets, products and/or the location in a short video with your
8
- * own references, keeping its motion, framing, timing and sound (the clip's
9
- * audio is kept, and the result is the clip's length).
10
- *
11
- * Before the video, each person, pet and product role's photos are turned
12
- * into one clean reference picture by an image model. This costs extra
13
- * credits (`breakdown.references` in the estimate), charged when it runs, even
14
- * if the video then fails; it adds about a minute, falls back to your own
15
- * photos if it fails, and is turned off with `prepareReferences: false`.
16
- * Locations are not prepared.
17
- *
18
- * Engines: a run is made on Nodaro Motion Prism (`engine` left out, or
19
- * `"motion-prism"`) or Nodaro Motion Pulse (`"motion-pulse"`). Prism renders
20
- * 480p (the default; plain unless `draft: true`), 720p or 1080p. Pulse renders
21
- * 720p (its default) or 1080p and makes a new take guided by the clip and
22
- * pictures; it has no draft, so no Full Quality: run it again at 1080p instead.
23
- *
24
- * How the clip is prepared for the video model (for one, whether faces are
25
- * hidden first, and whether a refused clip is retried) is set by Nodaro for
26
- * each engine; a run cannot change it. `faceMasking` is no longer read
27
- * (deprecated: accepted and ignored).
28
- *
29
- * Cloud edition only: `/v1/cast-swap` is served by the cloud plugin and 404s
30
- * on self-hosted installs. `run()` answers 202 with a job id; follow it with
31
- * `client.jobs.get(jobId)` / `client.jobs.getStatus(jobId)` like any other job.
32
- *
33
- * Repeats: pass `{ idempotencyKey }` to `run()` and it is sent as the
34
- * `Idempotency-Key` header. A repeat with the same key within the credit
35
- * guard's dedup window (about 10 s) answers 200 `{ jobId, deduped: true }` with
36
- * an `X-Dedup-Hit` header; a later one answers 202 with the first run's
37
- * `jobId`. Nothing new is started or charged.
38
- *
39
- * Refusals (thrown as a `NodaroError` subclass; body `{ error: { code, message } }`), before
40
- * anything is charged: 400 `validation_error` (the body: no role with images,
41
- * no reference, no `prePrompt` or `postPrompt` and no art style (Flex on
42
- * Nodaro Motion Prism), more roles of a kind
43
- * than allowed, more than 30 images in all, `draft: true` above 480p, a
44
- * `prePrompt` or `postPrompt` over 4,000 characters); on Nodaro Motion Pulse,
45
- * `draft_unsupported` (`draft: true`), `resolution_unsupported` (480p),
46
- * `output_format_unsupported` (a MOV edit output) and `too_many_images` (more
47
- * than 10 images in the run, across every role and fixed reference);
48
- * `raw_reference_token` (also in a reference's `line`),
49
- * `invalid_role_mention` (also any `{role:N}` in a reference's `line`),
50
- * `unsafe_url`, `video_unreadable`, `clip_out_of_range` (4–30 s),
51
- * `preview_out_of_range`, `unnamed_role_needs_picture` (a role with no name
52
- * and no image), `no_roles_in_preview` (a preview that would change nothing,
53
- * judged on what it sends: no role kept in it with images, no fixed
54
- * reference, no `prePrompt` or `postPrompt` and no art style), `prompt_too_long`
55
- * (the prompt would build too long: a `{role:N}` reads as the role's name when
56
- * it sends no images; Nodaro Motion Pulse's cap is 8,000 characters); 401; 402 `insufficient_credits` (`run()` only); 404
57
- * (a `sessionId` you may not use, `run()` only); 422 `job_blocked` (`run()`
58
- * only); 503 `host_too_old` (both); 503 `estimate_unavailable` (`estimate()`
59
- * only).
60
- */
61
- /**
62
- * The engine a Nodaro Motion run is made on, by its public id. Left out =
63
- * `"motion-prism"`.
64
- *
65
- * - `"motion-prism"` (Nodaro Motion Prism): 480p (the default; plain unless
66
- * `draft: true`), 720p or 1080p; Full Quality finishes a draft's own take at
67
- * 1080p.
68
- * - `"motion-pulse"` (Nodaro Motion Pulse): 720p (the default) or 1080p, never a
69
- * draft (`draft: true` answers 400 `draft_unsupported`), so no Full Quality:
70
- * run it again at 1080p instead. A preview is still 4 s from `previewStart`.
71
- */
72
- type CastSwapEngine = "motion-prism" | "motion-pulse";
73
- /**
74
- * The engine ids an older client sent: the earlier public ids (`"motion-pro"`
75
- * = `"motion-prism"`, `"motion-lite"` = `"motion-pulse"`) and the internal
76
- * ones (`"seedance-2-5"`, `"kling-4"`). Still accepted in a request; never
77
- * returned.
78
- * @deprecated use {@link CastSwapEngine}.
79
- */
80
- type CastSwapEngineLegacyId = "motion-pro" | "motion-lite" | "seedance-2-5" | "kling-4";
81
- /**
82
- * How a run follows its clip. Left out = `"precise"`.
83
- *
84
- * - `"precise"`: follows the clip exactly.
85
- * - `"motion"`: follows the clip's movement and takes the looks from your
86
- * photos, more freely than `"precise"`. Its price may differ from
87
- * `"precise"`'s: the estimate shows the exact price.
88
- */
89
- type CastSwapStyle = "precise" | "motion";
90
- /**
91
- * Where a Nodaro Motion Pulse run cuts the clip to whole seconds (Pulse renders
92
- * whole seconds; asked for more than the clip, it would stretch the motion):
93
- * - `"cut-end"` (the default): drop the fraction of a second at its end;
94
- * - `"cut-start"`: drop it at its start.
95
- */
96
- type CastSwapMotionLength = "cut-end" | "cut-start";
97
- /** @deprecated use {@link CastSwapMotionLength}. */
98
- type CastSwapKlingLength = CastSwapMotionLength;
99
- /** Whether a swapped subject takes this trait from the references (`"new"`) or keeps the video's (`"original"`). */
100
- type CastSwapTraitSource = "new" | "original";
101
- /**
102
- * Preview-only settings, on every role kind; a full run (`preview` not `true`)
103
- * ignores both.
104
- */
105
- interface CastSwapRolePreviewSettings {
106
- /** The name used instead of `name` in a preview. Same rules as `name` (1–200 characters). */
107
- previewName?: string;
108
- /**
109
- * `false` leaves this role out of the preview: its reference images are not
110
- * sent, not prepared and not charged, and a `{role:N}` naming it reads as its
111
- * `previewName`, else its `name`. Default `true`. A preview that would
112
- * change nothing (no role kept in it with images, no fixed reference, no pre
113
- * or post prompt and no art style) answers 400 `no_roles_in_preview`.
114
- */
115
- inPreview?: boolean;
116
- }
117
- /** A person in the video to recast. */
118
- interface CastSwapPersonRole extends CastSwapRolePreviewSettings {
119
- kind: "person";
120
- /** How the person is told apart in the video, e.g. `"the woman that attacks"`.
121
- *
122
- * Direct runs only: omit it (or leave it empty) and the role is named by its
123
- * first picture — matched to the subject in the video it fits best; such a
124
- * role needs at least one image (else 400 `unnamed_role_needs_picture`). A
125
- * trend run's roles are always named (400 `role_name_required`).
126
- */
127
- name?: string;
128
- /** 0–3 images of ONE person. Empty or `null` keeps the original person. */
129
- images: string[] | null;
130
- /** Body from the references or the video. Default `"new"`. */
131
- body?: CastSwapTraitSource;
132
- /** Outfit from the references or the video. Default `"new"`. */
133
- outfit?: CastSwapTraitSource;
134
- /** Hairstyle and haircut from the references or the video. Default `"new"`. */
135
- hair?: CastSwapTraitSource;
136
- }
137
- /** The place the video happens in. */
138
- interface CastSwapLocationRole extends CastSwapRolePreviewSettings {
139
- kind: "location";
140
- /** How the place is named. Default `"the setting"`. */
141
- name?: string;
142
- /** 0–3 images of ONE place. Empty or `null` keeps the original place. */
143
- images: string[] | null;
144
- }
145
- /** An animal in the video to recast. */
146
- interface CastSwapPetRole extends CastSwapRolePreviewSettings {
147
- kind: "pet";
148
- /** How the animal is told apart in the video, e.g. `"the dog"`.
149
- *
150
- * Direct runs only: omit it (or leave it empty) and the role is named by its
151
- * first picture — matched to the subject in the video it fits best; such a
152
- * role needs at least one image (else 400 `unnamed_role_needs_picture`). A
153
- * trend run's roles are always named (400 `role_name_required`).
154
- */
155
- name?: string;
156
- /** 0–3 images of ONE animal. Empty or `null` keeps the original animal. */
157
- images: string[] | null;
158
- /** Body (shape, size and build) from the references or the video. Default `"new"`. */
159
- body?: CastSwapTraitSource;
160
- /** Coat (fur, colors and markings) from the references or the video. Default `"new"`. */
161
- coat?: CastSwapTraitSource;
162
- }
163
- /** An object in the video to recast. */
164
- interface CastSwapProductRole extends CastSwapRolePreviewSettings {
165
- kind: "product";
166
- /** How the object is told apart in the video, e.g. `"the can"`.
167
- *
168
- * Direct runs only: omit it (or leave it empty) and the role is named by its
169
- * first picture — matched to the subject in the video it fits best; such a
170
- * role needs at least one image (else 400 `unnamed_role_needs_picture`). A
171
- * trend run's roles are always named (400 `role_name_required`).
172
- */
173
- name?: string;
174
- /** 0–3 images of ONE product. Empty or `null` keeps the original object. */
175
- images: string[] | null;
176
- /** Shape and proportions from the references or the video. Default `"new"`. */
177
- shape?: CastSwapTraitSource;
178
- /** Finish (colors, materials, label and markings) from the references or the video. Default `"new"`. */
179
- finish?: CastSwapTraitSource;
180
- }
181
- type CastSwapRole = CastSwapPersonRole | CastSwapLocationRole | CastSwapPetRole | CastSwapProductRole;
182
- /**
183
- * A fixed reference: 1–3 images of ONE thing that no role replaces, and the
184
- * line that says what it is (`"the glass she drinks from"`). Sent as given,
185
- * never prepared; its images count toward the 30.
186
- */
187
- interface CastSwapReference {
188
- /** 1–3 http(s) image URLs of one thing. */
189
- images: string[];
190
- /**
191
- * What it is, 1–500 characters. `{image}` in the line stands for this
192
- * reference's first image (`"Use {image} for the sky"`); a line without it
193
- * gets it appended. A `{role:N}` or a raw `{image:` / `{video:` / `{audio:`
194
- * token answers 400.
195
- */
196
- line: string;
197
- }
198
- /**
199
- * @deprecated Nodaro sets this per engine; a run's `faceMasking` is ignored.
200
- */
201
- interface CastSwapFaceMaskingZone {
202
- leftPct?: number;
203
- rightPct?: number;
204
- topPct?: number;
205
- bottomPct?: number;
206
- }
207
- /**
208
- * @deprecated Nodaro sets how the clip is prepared for the video model, per
209
- * engine; a run cannot change it. A `faceMasking` sent is accepted and
210
- * ignored (no error), so older code keeps working unchanged.
211
- */
212
- interface CastSwapFaceMasking {
213
- mode: "off" | "always" | "auto";
214
- fill?: "blur" | "depth";
215
- minFaceHeightPct?: number;
216
- maxFaceHeightPct?: number;
217
- zone?: CastSwapFaceMaskingZone | null;
218
- blurStrengthPct?: number;
219
- threshold?: number;
220
- }
221
- /** The body of `POST /v1/cast-swap` and `POST /v1/cast-swap/estimate`. */
222
- interface CastSwapParams {
223
- /** The source clip, 4–30 seconds. */
224
- videoUrl: string;
225
- /**
226
- * Who and what to swap: at most 6 person roles, 1 location role, 3 pet roles
227
- * and 3 product roles, with at most 30 images in all. A role with no images
228
- * is skipped (that subject or place stays as in the video). At least one role
229
- * with images, a fixed reference, a `prePrompt` or `postPrompt`, or an art
230
- * style (`direction`, Flex on Nodaro Motion Prism) is required. With an art
231
- * style and nothing to swap, a run restyles the whole clip (see `direction`).
232
- */
233
- roles: CastSwapRole[];
234
- /**
235
- * Fixed references (at most 5): things the video should show that no role
236
- * replaces, each with the line that names it. Their images count toward the
237
- * 30. A reference alone is enough for a run (no role needs images).
238
- */
239
- references?: CastSwapReference[];
240
- /**
241
- * Your own words placed at the start of the prompt, before the role
242
- * instructions; at most 4,000 characters. Mention a role as `{role:N}`, as in
243
- * `postPrompt`; the same 400 refusals apply (an N outside 1..`roles.length`,
244
- * a raw `{image:` / `{video:` / `{audio:` token).
245
- */
246
- prePrompt?: string;
247
- /**
248
- * Extra instructions in your own words, at most 4,000 characters. Mention a
249
- * role as `{role:N}`, where N is its 1-based position in `roles`
250
- * (`{role:1}` is `roles[0]`; empty roles count).
251
- *
252
- * The route answers 400, before charging, for an N outside 1..`roles.length`,
253
- * for a raw `{image:` / `{video:` / `{audio:` token in the pre or post prompt
254
- * or a role's `name`, for a clip outside 4–30 s, and for a preview past the clip's
255
- * end (`previewStart + 4` > its length).
256
- */
257
- postPrompt?: string;
258
- /** `true` runs on 4 seconds of the clip, starting at `previewStart`: a cheap check of the roles and choices. */
259
- preview?: boolean;
260
- /** Where the preview starts, in seconds. Default 0. */
261
- previewStart?: number;
262
- /**
263
- * The engine (see {@link CastSwapEngine}). Default `"motion-prism"`. The job
264
- * records it in `input_data.engine`, and a completed job's output in its
265
- * `engine`. The ids an older client sent ({@link CastSwapEngineLegacyId})
266
- * are still accepted.
267
- */
268
- engine?: CastSwapEngine | CastSwapEngineLegacyId;
269
- /**
270
- * How the run follows the clip (see {@link CastSwapStyle}). Default
271
- * `"precise"`; the job records it in `input_data.style`.
272
- */
273
- style?: CastSwapStyle;
274
- /**
275
- * A direct run on Nodaro Motion Prism: an art style that restyles the whole
276
- * video, as a `direction.style` id of the platform's `style` picker catalog
277
- * (the same ids an image's `direction.style` takes); the platform words it.
278
- * A Flex run (`style: "motion"`) takes one, and so does a Precise run where
279
- * {@link CastSwapResource.styleChoice} answers `preciseArtStyle` true for the
280
- * engine. Nodaro may make such a Precise request the way a Flex run is made
281
- * (its engine does by default, unless Nodaro turns that off): its estimate,
282
- * price and Full Quality are then a Flex run's, while the job still records
283
- * the style sent (`input_data.style` absent, or `"precise"`; jobs made so
284
- * before the style was kept record `"motion"`). Otherwise it is Precise's edit
285
- * of the clip, drawn in the art style. Refused with
286
- * 400 `unknown_art_style` (not in the catalog), `art_style_not_supported` (a
287
- * saved moodboard, `moodboard:…`) or `art_style_needs_flex` (a trend run, a
288
- * Flex run whose prompt is made Precise by Nodaro's setting for how Flex
289
- * runs are prepared, or a Precise request on an engine from before Precise
290
- * runs took one), and on Nodaro Motion Pulse with `art_style_needs_prism`.
291
- * The estimate (sent with the same `direction`) shows the price: it changes
292
- * only where Nodaro's setting for such runs first redraws the role pictures
293
- * in the art style.
294
- *
295
- * Style only: with no role with images and no fixed reference, the art style
296
- * alone is the run's change (a pre or post prompt is still added). It
297
- * restyles the whole clip, keeping the people, places, motion and sound, and
298
- * is charged for what it runs (the estimate shows it; no clip-preparation
299
- * `privacy` part). By default a black-and-white art style comes out
300
- * monochrome. Nodaro may run it the way other art-style runs run instead,
301
- * priced as those are and not made monochrome.
302
- * A preview takes its full run's path. Runs this way only on a Flex run, and
303
- * only where {@link CastSwapResource.styleChoice} answers `styleOnly` true
304
- * for the engine; elsewhere on Nodaro Motion Prism an art style alone is
305
- * refused (on a Precise run that stays Precise too, unless
306
- * {@link CastSwapResource.styleChoice} answers `preciseArtStyleAlone` true for
307
- * the engine, where it is that run's change), and one with a pre or post prompt
308
- * runs as any other art-style run. The job records it in
309
- * `input_data.direction`.
310
- */
311
- direction?: {
312
- style: string;
313
- };
314
- /**
315
- * Nodaro Motion Pulse only (Prism ignores it): which end of the clip is cut to
316
- * whole seconds (see {@link CastSwapMotionLength}). Default `"cut-end"`.
317
- */
318
- motionLength?: CastSwapMotionLength;
319
- /** @deprecated use {@link motionLength} (still accepted). */
320
- klingLength?: CastSwapKlingLength;
321
- /**
322
- * The output resolution. Nodaro Motion Prism: `"480p"` (default), `"720p"` or
323
- * `"1080p"`. Nodaro Motion Pulse: `"720p"` (default) or `"1080p"`; `"480p"`
324
- * answers 400.
325
- */
326
- resolution?: "480p" | "720p" | "1080p";
327
- /**
328
- * `true` makes a draft: a 480p run whose same take Full Quality can finish
329
- * at 1080p (Nodaro Motion Prism only). Default `false`: a plain run, at 480p
330
- * too, which Full Quality cannot finish. `true` with `"720p"` or `"1080p"`
331
- * answers 400 (draft is 480p only). Nodaro Motion Pulse has no draft: `true`
332
- * answers 400 `draft_unsupported`.
333
- */
334
- draft?: boolean;
335
- /**
336
- * Turn each person, pet and product role's photos into one clean reference
337
- * picture before the video (extra credits, shown in `breakdown.references`;
338
- * about a minute longer; falls back to your own photos if it fails).
339
- * Default `true`.
340
- */
341
- prepareReferences?: boolean;
342
- /**
343
- * Ignored: Nodaro sets how the clip is prepared, per engine. Accepted (no
344
- * error) so older code keeps working.
345
- * @deprecated leave it out.
346
- */
347
- faceMasking?: CastSwapFaceMasking;
348
- /**
349
- * `"draft"` means 480p draft.
350
- * @deprecated use `resolution` + `draft`.
351
- */
352
- quality?: "draft";
353
- /** A generation session to file the result in. */
354
- sessionId?: string;
355
- /** The client app that sent the run (stored on the job as `input_data.origin`). */
356
- origin?: string;
357
- }
358
- /** What a run would cost, in credits. */
359
- interface CastSwapEstimate {
360
- /**
361
- * The engine the run would use, by its public id (absent from an older
362
- * server = `"motion-prism"`). An id an older server answers is read as the
363
- * public id it names.
364
- */
365
- engine?: CastSwapEngine;
366
- /**
367
- * What is held when the run starts. The run is charged what it actually
368
- * costs, which is expected to be `expectedCredits`.
369
- */
370
- totalCredits: number;
371
- /**
372
- * The charge the run is expected to come to. Never above `totalCredits`
373
- * (on Nodaro Motion Pulse it equals it: Pulse renders exactly the length
374
- * asked for, so the hold is what it settles at). Absent from an older
375
- * server: read `totalCredits` then.
376
- */
377
- expectedCredits?: number;
378
- /**
379
- * The parts of the quote, by name, for display only:
380
- * - `base`: the run itself (its base fee). A server before Cast Swap 0.396.0
381
- * names it `castSwap` instead: read `base`, else `castSwap`;
382
- * - `references`: preparing the reference pictures (0 when
383
- * `prepareReferences` is off or there is nothing to prepare);
384
- * - `motion`: what the video holds (on Nodaro Motion Pulse, what it costs);
385
- * - `motionExpected`: what the video is expected to be charged, never above
386
- * `motion` (Nodaro Motion Prism);
387
- * - `privacy`: preparing the clip, when the engine's setting does. In both
388
- * totals when it always runs; outside both when it is the retry
389
- * (`privacyCredits`).
390
- * - `prompt`: the prompt written for the run by a language model, when
391
- * Nodaro's setting for the engine does so (absent otherwise).
392
- * - `referenceAudio`: preparing the clip's sound for the video model, when
393
- * Nodaro's setting for the engine runs that step (absent otherwise).
394
- *
395
- * `motion` and `motionExpected` are alternatives, so the parts sum to more
396
- * than either total: read `totalCredits` and `expectedCredits`, never the
397
- * sum. Other parts may appear.
398
- */
399
- breakdown: {
400
- base?: number;
401
- /** @deprecated read {@link base} (an older server answered this name for the same part). */
402
- castSwap?: number;
403
- references: number;
404
- motion?: number;
405
- motionExpected?: number;
406
- privacy?: number;
407
- prompt?: number;
408
- referenceAudio?: number;
409
- } & Record<string, number>;
410
- /**
411
- * The extra credits charged only if the video model refuses the clip and
412
- * the run is retried (Nodaro's setting for the engine decides whether it
413
- * does). Not in `totalCredits` or `expectedCredits`; `run()` needs credits
414
- * for both the hold and this (else 402).
415
- */
416
- privacyCredits?: number;
417
- /** @deprecated read {@link privacyCredits} (an older server answered this name). */
418
- maskingCredits?: number;
419
- /**
420
- * `true` when the video is made at Auto length (every Nodaro Motion Prism
421
- * run): the final charge is expected to come out lower than `totalCredits`,
422
- * at about `expectedCredits`. `false` on Nodaro Motion Pulse.
423
- */
424
- settlesLower: boolean;
425
- }
426
- /** Per-call options for {@link CastSwapResource.run}. */
427
- interface CastSwapRunOptions {
428
- /**
429
- * Sent as the `Idempotency-Key` header, unchanged (the SDK checks nothing;
430
- * an empty string sends no header, like no key).
431
- * The server takes 8–200 characters and answers 400 for any other length.
432
- * Reuse the same value when retrying the same run: within about 10 s the
433
- * repeat answers 200 `{ jobId, deduped: true }`, later 202 with the first
434
- * run's `jobId`. Nothing new is started or charged.
435
- */
436
- idempotencyKey?: string;
437
- }
438
- /**
439
- * What a Full Quality version would be: `"same-take"` finishes a Nodaro Motion
440
- * Prism draft's own take at 1080p, and the draft stays. `"new-take"` was a new
441
- * Nodaro Motion Pulse take at 1080p from a 720p run's inputs; Pulse no longer
442
- * has Full Quality, so a quote no longer answers it (kept so code that reads
443
- * it still compiles).
444
- */
445
- type CastSwapFullQualityKind = "same-take" | "new-take";
446
- /**
447
- * What a Full Quality version of a run would cost
448
- * (`POST /v1/cast-swap/:jobId/full-quality/estimate`): a Nodaro Motion Prism
449
- * draft (a 480p run made with `draft: true`).
450
- */
451
- interface CastSwapFullQualityEstimate {
452
- /**
453
- * Which Full Quality this is ({@link CastSwapFullQualityKind}), so it can
454
- * be worded right. Absent from an older server: `"same-take"`.
455
- */
456
- kind?: CastSwapFullQualityKind;
457
- /** The quote in credits: `breakdown.base` plus the 1080p render (same take) or the new take. */
458
- totalCredits: number;
459
- /**
460
- * The parts of the quote, by name, for display only: `base` (the Full
461
- * Quality job's own steps; a server before Cast Swap 0.396.0 names it
462
- * `castSwap` instead: read `base`, else `castSwap`), and `motionHd` (a same
463
- * take: the 1080p render, 0 when an earlier try of this draft already
464
- * finished that render, which is then reused) or `motion` (a new take).
465
- */
466
- breakdown: {
467
- base?: number;
468
- /** @deprecated read {@link base} (an older server answered this name for the same part). */
469
- castSwap?: number;
470
- motionHd?: number;
471
- motion?: number;
472
- } & Record<string, number>;
473
- /** ISO time until which the run can be finished at Full Quality (7 days after it completed). */
474
- availableUntil: string;
475
- }
476
- /** Options for {@link CastSwapResource.fullQuality}. */
477
- interface CastSwapFullQualityParams {
478
- /** A generation session to file the Full Quality result in. */
479
- sessionId?: string;
480
- }
481
- /** The Full Quality job (`POST /v1/cast-swap/:jobId/full-quality`). */
482
- interface CastSwapFullQualityResult {
483
- jobId: string;
484
- /** `true` when this run's Full Quality was already running or done: that job is answered, nothing new is started or charged. */
485
- existing?: boolean;
486
- }
487
- /**
488
- * The `code` of a Full Quality refusal (`NodaroError.code`), all before
489
- * anything is charged:
490
- * - `unauthorized` (401): no authenticated user;
491
- * - `not_found` (404): not your job, or not a Nodaro Motion run; also a
492
- * `sessionId` you may not use;
493
- * - `not_completed` (409): the run has not finished;
494
- * - `not_a_draft` (409): the run is not a Nodaro Motion Prism draft: a plain
495
- * run (480p made without `draft: true` included; make a draft with
496
- * `draft: true`), or any Nodaro Motion Pulse run (Pulse makes no drafts: run
497
- * it again at 1080p);
498
- * - `draft_expired` (410): more than 7 days after the draft completed, or
499
- * the draft can no longer be finished at Full Quality;
500
- * - `full_quality_pending` (409, `details.retryable: true`): not final — an
501
- * earlier try's 1080p render of this draft is being reviewed, or has not
502
- * started yet; try again later (once the review ends). The only refusal
503
- * that ends on its own;
504
- * - `full_quality_unavailable` (409): final — nothing kept to re-render, no
505
- * readable completion time, or the 1080p finalize refuses this draft; on
506
- * the start only, also "failed too many times" (every try failed) or no
507
- * try can be started for this run;
508
- * - `insufficient_credits` (402), or in a workspace `budget_exceeded`,
509
- * `member_cap_exceeded` or `user_allowance_exceeded`;
510
- * - `job_blocked` (422): the request was blocked by the job policy;
511
- * - `job_read_failed` (503, retryable), `estimate_unavailable` (503, try
512
- * again shortly), `host_too_old` (503).
513
- *
514
- * Open-ended: a code not listed here may still arrive.
515
- */
516
- type CastSwapFullQualityRefusalCode = "unauthorized" | "not_found" | "not_completed" | "not_a_draft" | "draft_expired" | "full_quality_pending" | "full_quality_unavailable" | "insufficient_credits" | "budget_exceeded" | "member_cap_exceeded" | "user_allowance_exceeded" | "job_blocked" | "job_read_failed" | "estimate_unavailable" | "host_too_old" | (string & {});
517
- /**
518
- * Who decides a direct run's style on one engine:
519
- * - `"user"`: the person (the request's `style`, left out = `"precise"`);
520
- * show a Style control;
521
- * - `"precise"`: Nodaro's own apps run Precise on that engine and show no
522
- * Style control; it changes no request: a direct run and quote take the
523
- * request's `style`, as on `"user"`;
524
- * - `"flex"`: an admin forced it — every direct run and quote of that engine
525
- * runs Flex (`style: "motion"`) whatever the request's `style` says; show
526
- * no Style control.
527
- *
528
- * A trend run keeps its own trend's style.
529
- */
530
- type CastSwapStyleChoiceOption = "user" | "precise" | "flex";
531
- /** What {@link CastSwapResource.styleChoice} answers: every engine's choice, by its public id. */
532
- interface CastSwapStyleChoice {
533
- engines: Record<CastSwapEngine, CastSwapStyleChoiceOption>;
534
- /**
535
- * Per engine, whether the engine takes style-only runs: a Flex run
536
- * (`style: "motion"`) with an art style (`direction`) and nothing to swap
537
- * (no role with images, no fixed reference). It follows the engine alone, so
538
- * read it with {@link engines}: an engine answered `"flex"` makes a Precise
539
- * request Flex too, and one answered `"precise"` changes no request, so a
540
- * Flex request there runs as on `"user"`. Nodaro Motion Pulse is always
541
- * `false` (it takes no art style). Absent from an older server, and
542
- * an engine missing from it: `false`.
543
- */
544
- styleOnly?: Partial<Record<CastSwapEngine, boolean>>;
545
- /**
546
- * Per engine, whether a Precise run (no `style`, or `"precise"`) takes an
547
- * art style (`direction`), as a Flex run does. Nodaro may run such a request as
548
- * a Flex run (see {@link CastSwapParams}'s `direction`), which this does not
549
- * say; otherwise it is Precise's edit of the clip, drawn in the art style, and,
550
- * where {@link CastSwapStyleChoice.preciseArtStyleAlone} is not true for the
551
- * engine, not on its own: a Precise run with nothing else to change is then refused.
552
- * Nodaro Motion Pulse is always `false` (it takes no art style). Absent from
553
- * an older server, and an engine missing from it: `false` (offer an art style
554
- * on Flex runs alone).
555
- */
556
- preciseArtStyle?: Partial<Record<CastSwapEngine, boolean>>;
557
- /**
558
- * Per engine, whether an art style (`direction`) alone is a Precise run's
559
- * change there, so the run needs no role, reference or prompt. Nodaro may run
560
- * such a request as a Flex run (see {@link CastSwapParams}'s `direction`), which
561
- * this does not say. It answers
562
- * `false` until the engine takes such runs. Nodaro Motion Pulse is always
563
- * `false` (it takes no art style). Absent from an older server, and an engine
564
- * missing from it: `false`.
565
- */
566
- preciseArtStyleAlone?: Partial<Record<CastSwapEngine, boolean>>;
567
- }
568
- declare class CastSwapResource {
569
- private client;
570
- constructor(client: NodaroClientCore);
571
- /**
572
- * Start a Nodaro Motion run (`POST /v1/cast-swap`, 202 `{ jobId }`). Returns the
573
- * job to follow. With `options.idempotencyKey` (sent as the
574
- * `Idempotency-Key` header; 8–200 characters, else 400) a repeat with the
575
- * same key within about 10 s answers 200 `{ jobId, deduped: true }`, a later
576
- * one 202 with the first run's `jobId`; nothing new starts.
577
- */
578
- run(params: CastSwapParams, options?: CastSwapRunOptions): Promise<{
579
- jobId: string;
580
- deduped?: boolean;
581
- }>;
582
- /**
583
- * Whether people choose a direct run's style, per engine
584
- * (`GET /v1/cast-swap/style-choice`): `"user"` = show a Style control;
585
- * `"precise"` = Nodaro's own apps run Precise on that engine and hide the
586
- * control, while a run's `style` is still taken as sent; `"flex"` = an admin
587
- * forced Flex for the engine, so a run's `style` is overridden and the
588
- * control is best hidden. Its
589
- * `styleOnly` says, per engine, whether a Flex run with an art style and
590
- * nothing to swap restyles the whole clip there. Where it is not `true`
591
- * (absent, or an engine missing from it, included) on Nodaro Motion Prism, an
592
- * art style alone is refused, and one with a pre or post prompt runs as any
593
- * other art-style run. Its `preciseArtStyle` says, per engine, whether a
594
- * Precise run takes an art style there too, and its `preciseArtStyleAlone`
595
- * whether that art style alone is the run's change.
596
- * Public (no sign-in needed); the answer may be up to a minute old.
597
- */
598
- styleChoice(): Promise<CastSwapStyleChoice>;
599
- /** Quote a run before starting it (`POST /v1/cast-swap/estimate`); spends nothing. */
600
- estimate(params: CastSwapParams): Promise<CastSwapEstimate>;
601
- /**
602
- * Quote finishing a run at Full Quality (`POST
603
- * /v1/cast-swap/:jobId/full-quality/estimate`); spends nothing. `jobId` is a
604
- * finished Nodaro Motion Prism DRAFT run (a Nodaro Motion or trend run made
605
- * with `draft: true`), whose same take Full Quality finishes at 1080p. The
606
- * quote does not look for a Full Quality already running: when one is,
607
- * {@link fullQuality} answers it (`existing: true`) and charges nothing.
608
- * Refusals: {@link CastSwapFullQualityRefusalCode}.
609
- */
610
- fullQualityEstimate(jobId: string): Promise<CastSwapFullQualityEstimate>;
611
- /**
612
- * Finish a run at Full Quality (`POST /v1/cast-swap/:jobId/full-quality`):
613
- * at 1080p, with the clip's audio, as a new job linked to the run — a
614
- * Nodaro Motion Prism draft's own take re-rendered. SPENDS CREDITS: quote it first with
615
- * {@link fullQualityEstimate}. Answers 202 `{ jobId }`, or 200
616
- * `{ jobId, existing: true }` when this run's Full Quality is already
617
- * running or done (one per run; a failed one may be asked again). Follow
618
- * the job with `client.jobs.get(jobId)`. No `Idempotency-Key` is taken: the
619
- * server keys the job by the draft. The new job keeps the draft's origin.
620
- * Refusals: {@link CastSwapFullQualityRefusalCode}.
621
- */
622
- fullQuality(jobId: string, params?: CastSwapFullQualityParams): Promise<CastSwapFullQualityResult>;
623
- }
624
-
625
- export { type CastSwapEngine, type CastSwapEngineLegacyId, type CastSwapEstimate, type CastSwapFaceMasking, type CastSwapFaceMaskingZone, type CastSwapFullQualityEstimate, type CastSwapFullQualityKind, type CastSwapFullQualityParams, type CastSwapFullQualityRefusalCode, type CastSwapFullQualityResult, type CastSwapKlingLength, type CastSwapLocationRole, type CastSwapMotionLength, type CastSwapParams, type CastSwapPersonRole, type CastSwapPetRole, type CastSwapProductRole, type CastSwapReference, CastSwapResource, type CastSwapRole, type CastSwapRolePreviewSettings, type CastSwapRunOptions, type CastSwapStyle, type CastSwapStyleChoice, type CastSwapStyleChoiceOption, type CastSwapTraitSource };