@nodaro/sdk 2.68.2 → 2.70.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 (126) hide show
  1. package/dist/{chunk-KG4R454Z.js → chunk-25IKUIM3.js} +4 -3
  2. package/dist/chunk-25IKUIM3.js.map +1 -0
  3. package/dist/{chunk-PTH6ZUW3.cjs → chunk-4RPUONS5.cjs} +22 -22
  4. package/dist/{chunk-PTH6ZUW3.cjs.map → chunk-4RPUONS5.cjs.map} +1 -1
  5. package/dist/{chunk-3G65RIZS.cjs → chunk-5W4OCRFX.cjs} +66 -16
  6. package/dist/chunk-5W4OCRFX.cjs.map +1 -0
  7. package/dist/{chunk-FFT2YPB4.js → chunk-6SWRJJQE.js} +66 -16
  8. package/dist/chunk-6SWRJJQE.js.map +1 -0
  9. package/dist/{chunk-7CK6I4CT.cjs → chunk-7WS3VTUG.cjs} +2 -2
  10. package/dist/{chunk-7CK6I4CT.cjs.map → chunk-7WS3VTUG.cjs.map} +1 -1
  11. package/dist/{chunk-7FLTDTHR.cjs → chunk-BNJUMQQ3.cjs} +2 -2
  12. package/dist/chunk-BNJUMQQ3.cjs.map +1 -0
  13. package/dist/{chunk-QAVLYMGM.js → chunk-BY3XIXWC.js} +2 -2
  14. package/dist/chunk-BY3XIXWC.js.map +1 -0
  15. package/dist/{chunk-BPWUWUZ3.cjs → chunk-C4LXPSSF.cjs} +4 -3
  16. package/dist/chunk-C4LXPSSF.cjs.map +1 -0
  17. package/dist/{chunk-PUD5U3EN.cjs → chunk-C5GFDCK2.cjs} +2 -2
  18. package/dist/chunk-C5GFDCK2.cjs.map +1 -0
  19. package/dist/{chunk-PGT4BXR2.cjs → chunk-CAM74LQ2.cjs} +15 -4
  20. package/dist/chunk-CAM74LQ2.cjs.map +1 -0
  21. package/dist/{chunk-7UOEEYJ2.js → chunk-CGRH5UFG.js} +3 -3
  22. package/dist/{chunk-7UOEEYJ2.js.map → chunk-CGRH5UFG.js.map} +1 -1
  23. package/dist/{chunk-52V2G7SL.js → chunk-GKETMNEM.js} +12 -12
  24. package/dist/{chunk-52V2G7SL.js.map → chunk-GKETMNEM.js.map} +1 -1
  25. package/dist/{chunk-QXRV2IMW.cjs → chunk-HRFLEHSS.cjs} +2 -2
  26. package/dist/chunk-HRFLEHSS.cjs.map +1 -0
  27. package/dist/{chunk-5ZLGXVYV.js → chunk-HRW5IGJ2.js} +2 -2
  28. package/dist/chunk-HRW5IGJ2.js.map +1 -0
  29. package/dist/chunk-IWASCR2O.js +3 -0
  30. package/dist/{chunk-ZYPH2FPT.js.map → chunk-IWASCR2O.js.map} +1 -1
  31. package/dist/{chunk-OHC4JIUP.js → chunk-JAGTW35C.js} +15 -4
  32. package/dist/chunk-JAGTW35C.js.map +1 -0
  33. package/dist/{chunk-EP4J3TLQ.cjs → chunk-O4UXEIV6.cjs} +2 -2
  34. package/dist/chunk-O4UXEIV6.cjs.map +1 -0
  35. package/dist/{chunk-76YMDYMT.cjs → chunk-P7UT2YH4.cjs} +2 -2
  36. package/dist/chunk-P7UT2YH4.cjs.map +1 -0
  37. package/dist/{chunk-U6LEZT5B.js → chunk-R5DTFY73.js} +2 -2
  38. package/dist/chunk-R5DTFY73.js.map +1 -0
  39. package/dist/{chunk-CGSDEKJL.cjs → chunk-REXDUXL3.cjs} +3 -3
  40. package/dist/{chunk-CGSDEKJL.cjs.map → chunk-REXDUXL3.cjs.map} +1 -1
  41. package/dist/{chunk-AEUPH7EE.js → chunk-ROUCXQU3.js} +17 -2
  42. package/dist/chunk-ROUCXQU3.js.map +1 -0
  43. package/dist/{chunk-F3AV3TC7.js → chunk-UDRP64FX.js} +2 -2
  44. package/dist/chunk-UDRP64FX.js.map +1 -0
  45. package/dist/{chunk-Q45PC4YD.cjs → chunk-Z3RI7CSA.cjs} +17 -2
  46. package/dist/chunk-Z3RI7CSA.cjs.map +1 -0
  47. package/dist/{chunk-VS5JTLWE.js → chunk-ZMSGJC7L.js} +2 -2
  48. package/dist/chunk-ZMSGJC7L.js.map +1 -0
  49. package/dist/entries/audio.cjs +2 -2
  50. package/dist/entries/audio.d.cts +16 -3
  51. package/dist/entries/audio.d.ts +16 -3
  52. package/dist/entries/audio.js +1 -1
  53. package/dist/entries/catalogs.cjs +2 -2
  54. package/dist/entries/catalogs.d.cts +15 -4
  55. package/dist/entries/catalogs.d.ts +15 -4
  56. package/dist/entries/catalogs.js +1 -1
  57. package/dist/entries/characters.d.cts +1 -1
  58. package/dist/entries/characters.d.ts +1 -1
  59. package/dist/entries/client.cjs +16 -16
  60. package/dist/entries/client.d.cts +1 -1
  61. package/dist/entries/client.d.ts +1 -1
  62. package/dist/entries/client.js +11 -11
  63. package/dist/entries/core.cjs +5 -5
  64. package/dist/entries/core.js +1 -1
  65. package/dist/entries/creatures.d.cts +1 -1
  66. package/dist/entries/creatures.d.ts +1 -1
  67. package/dist/entries/credits.cjs +2 -2
  68. package/dist/entries/credits.d.cts +1 -1
  69. package/dist/entries/credits.d.ts +1 -1
  70. package/dist/entries/credits.js +1 -1
  71. package/dist/entries/jobs.cjs +2 -2
  72. package/dist/entries/jobs.d.cts +3 -1
  73. package/dist/entries/jobs.d.ts +3 -1
  74. package/dist/entries/jobs.js +1 -1
  75. package/dist/entries/locations.d.cts +1 -1
  76. package/dist/entries/locations.d.ts +1 -1
  77. package/dist/entries/media.cjs +2 -2
  78. package/dist/entries/media.d.cts +147 -18
  79. package/dist/entries/media.d.ts +147 -18
  80. package/dist/entries/media.js +1 -1
  81. package/dist/entries/models.cjs +2 -2
  82. package/dist/entries/models.d.cts +13 -4
  83. package/dist/entries/models.d.ts +13 -4
  84. package/dist/entries/models.js +1 -1
  85. package/dist/entries/node-presets.cjs +2 -2
  86. package/dist/entries/node-presets.d.cts +38 -1
  87. package/dist/entries/node-presets.d.ts +38 -1
  88. package/dist/entries/node-presets.js +1 -1
  89. package/dist/entries/nodes.cjs +5 -5
  90. package/dist/entries/nodes.d.cts +2 -2
  91. package/dist/entries/nodes.d.ts +2 -2
  92. package/dist/entries/nodes.js +2 -2
  93. package/dist/entries/objects.d.cts +1 -1
  94. package/dist/entries/objects.d.ts +1 -1
  95. package/dist/entries/picker-catalogs.cjs +2 -2
  96. package/dist/entries/picker-catalogs.d.cts +8 -0
  97. package/dist/entries/picker-catalogs.d.ts +8 -0
  98. package/dist/entries/picker-catalogs.js +1 -1
  99. package/dist/entries/scene3d.d.cts +2 -2
  100. package/dist/entries/scene3d.d.ts +2 -2
  101. package/dist/index.cjs +29 -29
  102. package/dist/index.d.cts +5 -5
  103. package/dist/index.d.ts +5 -5
  104. package/dist/index.js +12 -12
  105. package/dist/{nodes-BYgAjPlF.d.cts → nodes-BHl7gwUn.d.cts} +95 -20
  106. package/dist/{nodes-DC80OcWe.d.ts → nodes-C1pqCwkS.d.ts} +95 -20
  107. package/package.json +3 -3
  108. package/dist/chunk-3G65RIZS.cjs.map +0 -1
  109. package/dist/chunk-5ZLGXVYV.js.map +0 -1
  110. package/dist/chunk-76YMDYMT.cjs.map +0 -1
  111. package/dist/chunk-7FLTDTHR.cjs.map +0 -1
  112. package/dist/chunk-AEUPH7EE.js.map +0 -1
  113. package/dist/chunk-BPWUWUZ3.cjs.map +0 -1
  114. package/dist/chunk-EP4J3TLQ.cjs.map +0 -1
  115. package/dist/chunk-F3AV3TC7.js.map +0 -1
  116. package/dist/chunk-FFT2YPB4.js.map +0 -1
  117. package/dist/chunk-KG4R454Z.js.map +0 -1
  118. package/dist/chunk-OHC4JIUP.js.map +0 -1
  119. package/dist/chunk-PGT4BXR2.cjs.map +0 -1
  120. package/dist/chunk-PUD5U3EN.cjs.map +0 -1
  121. package/dist/chunk-Q45PC4YD.cjs.map +0 -1
  122. package/dist/chunk-QAVLYMGM.js.map +0 -1
  123. package/dist/chunk-QXRV2IMW.cjs.map +0 -1
  124. package/dist/chunk-U6LEZT5B.js.map +0 -1
  125. package/dist/chunk-VS5JTLWE.js.map +0 -1
  126. package/dist/chunk-ZYPH2FPT.js +0 -3
@@ -6,7 +6,8 @@ var CatalogsResource = class {
6
6
  client;
7
7
  /** Every catalog, projected & pack-composed (honors the deployment's
8
8
  * registered vendored packs). Cached publicly 5 min. `data` is absent
9
- * when the deployment registered no packs (`curated: false`). */
9
+ * when the deployment registered no packs and shows none of its own
10
+ * picker pictures. */
10
11
  list(opts = {}) {
11
12
  const qs = opts.detail ? `?detail=${opts.detail}` : "";
12
13
  return this.client.request("GET", `/v1/catalogs${qs}`);
@@ -14,5 +15,5 @@ var CatalogsResource = class {
14
15
  };
15
16
 
16
17
  export { CatalogsResource };
17
- //# sourceMappingURL=chunk-KG4R454Z.js.map
18
- //# sourceMappingURL=chunk-KG4R454Z.js.map
18
+ //# sourceMappingURL=chunk-25IKUIM3.js.map
19
+ //# sourceMappingURL=chunk-25IKUIM3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/resources/catalogs.ts"],"names":[],"mappings":";AAiFO,IAAM,mBAAN,MAAuB;AAAA,EAC5B,YAAoB,MAAA,EAA0B;AAA1B,IAAA,IAAA,CAAA,MAAA,GAAA,MAAA;AAAA,EAA2B;AAAA,EAA3B,MAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMpB,IAAA,CAAK,IAAA,GAAwC,EAAC,EAAkC;AAC9E,IAAA,MAAM,KAAK,IAAA,CAAK,MAAA,GAAS,CAAA,QAAA,EAAW,IAAA,CAAK,MAAM,CAAA,CAAA,GAAK,EAAA;AACpD,IAAA,OAAO,KAAK,MAAA,CAAO,OAAA,CAAQ,KAAA,EAAO,CAAA,YAAA,EAAe,EAAE,CAAA,CAAE,CAAA;AAAA,EACvD;AACF","file":"chunk-25IKUIM3.js","sourcesContent":["import type { NodaroClientCore } from \"../core.js\"\n\n/**\n * Catalog projection types. Mirror `@nodaro/shared`'s `ProjectedCatalog` so the\n * SDK stays dependency-free (same convention as `picker-catalogs.ts`). Tag-free\n * by design — the deferred `CatalogPolicy` never crosses the wire.\n */\nexport interface ProjectedCatalogOption {\n id: string\n label: string\n description?: string\n category?: string\n /** The prompt fragment this id injects downstream. Present only when detail=\"full\". */\n promptHint?: string\n /**\n * Short professional term injected by compact hint mode; `label` is for\n * display. Present at BOTH detail levels — a thin client renders `label`\n * and injects `term`. Empty for a no-op (\"auto\"/\"none\") entry that injects\n * nothing.\n */\n term?: string\n icon?: string\n /**\n * Absolute URL of the option's picture — a photo, 3D emoji, flag or (Nodaro\n * Cloud only) rendered look preview — on the installation's own host, or the\n * Nodaro CDN for look previews. Absent when the option has no picture. Use it\n * as given: file names carry a content hash, so it can be cached for good.\n */\n imageUrl?: string\n /**\n * Absolute URL of the option's enlarged picture: the larger version to show\n * where your picker shows the option big (hover, zoom, a detail view).\n * Present only on a deployment that shows its own pictures (its surface\n * profile's `catalogs.images: \"own\"`) and gave one for this option; absent\n * everywhere else, so draw `imageUrl` there instead.\n */\n imageLargeUrl?: string\n}\nexport interface ProjectedCatalogDimension {\n field: string\n label: string\n options: ProjectedCatalogOption[]\n}\nexport interface ProjectedCatalog {\n nodeType: string\n label: string\n catalogId: string\n kind: \"single\" | \"multi\"\n valueField?: string\n defaultValue?: string\n categoryOrder?: string[]\n categoryLabels?: Record<string, string>\n detail: \"compact\" | \"full\"\n options?: ProjectedCatalogOption[]\n fields?: string[]\n dimensions?: ProjectedCatalogDimension[]\n /** person and styling: the topics their settings are grouped under, in order, each with its picture. */\n sections?: ProjectedCatalogSection[]\n}\n\n/** A topic a multi-dim catalog's settings are grouped under in the editor (person, styling). */\nexport interface ProjectedCatalogSection {\n label: string\n fields: string[]\n imageUrl?: string\n}\n\n/**\n * `GET /v1/catalogs`. `data` is present when the deployment registered\n * catalog packs (`curated: true`), and when it shows its own picker pictures\n * (`curated: false`: the catalogs are the bundled ones, the pictures in them\n * are the deployment's). Otherwise it is absent and the catalogs are the\n * bundled ones — read them per picker with `client.pickerCatalogs.get(nodeType)`.\n */\nexport interface CatalogsListResponse {\n curated: boolean\n packs: number\n version: number\n data?: ProjectedCatalog[]\n}\n\nexport class CatalogsResource {\n constructor(private client: NodaroClientCore) {}\n\n /** Every catalog, projected & pack-composed (honors the deployment's\n * registered vendored packs). Cached publicly 5 min. `data` is absent\n * when the deployment registered no packs and shows none of its own\n * picker pictures. */\n list(opts: { detail?: \"compact\" | \"full\" } = {}): Promise<CatalogsListResponse> {\n const qs = opts.detail ? `?detail=${opts.detail}` : \"\"\n return this.client.request(\"GET\", `/v1/catalogs${qs}`)\n }\n}\n"]}
@@ -22,24 +22,24 @@ var chunkUIBYZNDR_cjs = require('./chunk-UIBYZNDR.cjs');
22
22
  var chunk57GANTLV_cjs = require('./chunk-57GANTLV.cjs');
23
23
  var chunkJ5LGGCAS_cjs = require('./chunk-J5LGGCAS.cjs');
24
24
  var chunkNBVARNVA_cjs = require('./chunk-NBVARNVA.cjs');
25
- var chunkEP4J3TLQ_cjs = require('./chunk-EP4J3TLQ.cjs');
25
+ var chunkO4UXEIV6_cjs = require('./chunk-O4UXEIV6.cjs');
26
26
  var chunkG4AFHCNA_cjs = require('./chunk-G4AFHCNA.cjs');
27
27
  var chunkLAWYFC4G_cjs = require('./chunk-LAWYFC4G.cjs');
28
28
  var chunkTCLNSVYA_cjs = require('./chunk-TCLNSVYA.cjs');
29
29
  var chunkKXEWTYS4_cjs = require('./chunk-KXEWTYS4.cjs');
30
30
  var chunkITQB5ADE_cjs = require('./chunk-ITQB5ADE.cjs');
31
31
  var chunkMIXRL6I2_cjs = require('./chunk-MIXRL6I2.cjs');
32
- var chunk3G65RIZS_cjs = require('./chunk-3G65RIZS.cjs');
33
- var chunk76YMDYMT_cjs = require('./chunk-76YMDYMT.cjs');
32
+ var chunk5W4OCRFX_cjs = require('./chunk-5W4OCRFX.cjs');
33
+ var chunkP7UT2YH4_cjs = require('./chunk-P7UT2YH4.cjs');
34
34
  var chunkZCWKX4V6_cjs = require('./chunk-ZCWKX4V6.cjs');
35
- var chunkQ45PC4YD_cjs = require('./chunk-Q45PC4YD.cjs');
36
- var chunkQXRV2IMW_cjs = require('./chunk-QXRV2IMW.cjs');
35
+ var chunkZ3RI7CSA_cjs = require('./chunk-Z3RI7CSA.cjs');
36
+ var chunkHRFLEHSS_cjs = require('./chunk-HRFLEHSS.cjs');
37
37
  var chunkGVIFLUYZ_cjs = require('./chunk-GVIFLUYZ.cjs');
38
38
  var chunkA3S55XGF_cjs = require('./chunk-A3S55XGF.cjs');
39
39
  var chunkCLBLAWH3_cjs = require('./chunk-CLBLAWH3.cjs');
40
40
  var chunkVUTNNRDW_cjs = require('./chunk-VUTNNRDW.cjs');
41
41
  var chunkW63ZKKYT_cjs = require('./chunk-W63ZKKYT.cjs');
42
- var chunkPUD5U3EN_cjs = require('./chunk-PUD5U3EN.cjs');
42
+ var chunkC5GFDCK2_cjs = require('./chunk-C5GFDCK2.cjs');
43
43
  var chunkRR45WBME_cjs = require('./chunk-RR45WBME.cjs');
44
44
  var chunkOI4RCW2J_cjs = require('./chunk-OI4RCW2J.cjs');
45
45
  var chunkWK4VXPPZ_cjs = require('./chunk-WK4VXPPZ.cjs');
@@ -47,18 +47,18 @@ var chunk43FVH6LJ_cjs = require('./chunk-43FVH6LJ.cjs');
47
47
  var chunkYFS2LMG4_cjs = require('./chunk-YFS2LMG4.cjs');
48
48
  var chunk4DCXJ77J_cjs = require('./chunk-4DCXJ77J.cjs');
49
49
  var chunkTQLOD7OL_cjs = require('./chunk-TQLOD7OL.cjs');
50
- var chunkCGSDEKJL_cjs = require('./chunk-CGSDEKJL.cjs');
50
+ var chunkREXDUXL3_cjs = require('./chunk-REXDUXL3.cjs');
51
51
  var chunkA3XA6UNM_cjs = require('./chunk-A3XA6UNM.cjs');
52
- var chunk7FLTDTHR_cjs = require('./chunk-7FLTDTHR.cjs');
52
+ var chunkBNJUMQQ3_cjs = require('./chunk-BNJUMQQ3.cjs');
53
53
  var chunk7BMKQ36V_cjs = require('./chunk-7BMKQ36V.cjs');
54
- var chunkPGT4BXR2_cjs = require('./chunk-PGT4BXR2.cjs');
54
+ var chunkCAM74LQ2_cjs = require('./chunk-CAM74LQ2.cjs');
55
55
  var chunkXSYNVD3X_cjs = require('./chunk-XSYNVD3X.cjs');
56
56
  var chunkGU3YOOCK_cjs = require('./chunk-GU3YOOCK.cjs');
57
- var chunkBPWUWUZ3_cjs = require('./chunk-BPWUWUZ3.cjs');
57
+ var chunkC4LXPSSF_cjs = require('./chunk-C4LXPSSF.cjs');
58
58
  var chunkXZQ6Z4T6_cjs = require('./chunk-XZQ6Z4T6.cjs');
59
59
 
60
60
  // src/client.ts
61
- var NodaroClient = class _NodaroClient extends chunkCGSDEKJL_cjs.NodaroClientCore {
61
+ var NodaroClient = class _NodaroClient extends chunkREXDUXL3_cjs.NodaroClientCore {
62
62
  workflows;
63
63
  projects;
64
64
  /** Generation sessions inside projects (Create Image / Video / Music). */
@@ -134,10 +134,10 @@ var NodaroClient = class _NodaroClient extends chunkCGSDEKJL_cjs.NodaroClientCor
134
134
  this.projects = new chunkLAWYFC4G_cjs.ProjectsResource(this);
135
135
  this.sessions = new chunkWMT7HEBZ_cjs.SessionsResource(this);
136
136
  this.trash = new chunkLTZKNAXM_cjs.TrashResource(this);
137
- this.jobs = new chunkPUD5U3EN_cjs.JobsResource(this);
137
+ this.jobs = new chunkC5GFDCK2_cjs.JobsResource(this);
138
138
  this.videoPro = new chunkW5VHATSR_cjs.VideoProResource(this);
139
139
  this.executions = new chunkVUTNNRDW_cjs.ExecutionsResource(this);
140
- this.nodes = new chunkQXRV2IMW_cjs.NodesResource(this);
140
+ this.nodes = new chunkHRFLEHSS_cjs.NodesResource(this);
141
141
  this.scene3d = new chunkYDRXBRW2_cjs.Scene3DResource(this);
142
142
  this.developerApps = new chunkA3S55XGF_cjs.DeveloperAppsResource(this);
143
143
  this.oauth = new chunkGVIFLUYZ_cjs.OAuthResource(this);
@@ -153,25 +153,25 @@ var NodaroClient = class _NodaroClient extends chunkCGSDEKJL_cjs.NodaroClientCor
153
153
  this.promptHelper = new chunkTCLNSVYA_cjs.PromptHelperResource(this);
154
154
  this.voices = new chunkS5VSDJAM_cjs.VoicesResource(this);
155
155
  this.llm = new chunkITQB5ADE_cjs.LlmResource(this);
156
- this.media = new chunk3G65RIZS_cjs.MediaResource(this);
156
+ this.media = new chunk5W4OCRFX_cjs.MediaResource(this);
157
157
  this.contentRights = new chunk4DCXJ77J_cjs.ContentRightsResource(this);
158
- this.audio = new chunkPGT4BXR2_cjs.AudioResource(this);
159
- this.credits = new chunk7FLTDTHR_cjs.CreditsResource(this);
158
+ this.audio = new chunkCAM74LQ2_cjs.AudioResource(this);
159
+ this.credits = new chunkBNJUMQQ3_cjs.CreditsResource(this);
160
160
  this.userSettings = new chunkREXFEDKI_cjs.UserSettingsResource(this);
161
161
  this.billing = new chunkXSYNVD3X_cjs.BillingResource(this);
162
162
  this.surface = new chunkH7Q7D4CT_cjs.SurfaceResource(this);
163
163
  this.uploads = new chunkF6KAMECM_cjs.UploadsResource(this);
164
164
  this.library = new chunkOI4RCW2J_cjs.LibraryResource(this);
165
165
  this.gallery = new chunkW63ZKKYT_cjs.GalleryResource(this);
166
- this.presets = new chunkQ45PC4YD_cjs.PresetsResource(this);
166
+ this.presets = new chunkZ3RI7CSA_cjs.PresetsResource(this);
167
167
  this.savedPosts = new chunkSYVNY3AH_cjs.SavedPostsResource(this);
168
168
  this.collections = new chunkWK4VXPPZ_cjs.CollectionsResource(this);
169
169
  this.palettes = new chunkNBVARNVA_cjs.PalettesResource(this);
170
170
  this.moodboards = new chunkZCWKX4V6_cjs.MoodboardsResource(this);
171
171
  this.competitors = new chunkYFS2LMG4_cjs.CompetitorsResource(this);
172
- this.pickerCatalogs = new chunkEP4J3TLQ_cjs.PickerCatalogsResource(this);
173
- this.catalogs = new chunkBPWUWUZ3_cjs.CatalogsResource(this);
174
- this.models = new chunk76YMDYMT_cjs.ModelsResource(this);
172
+ this.pickerCatalogs = new chunkO4UXEIV6_cjs.PickerCatalogsResource(this);
173
+ this.catalogs = new chunkC4LXPSSF_cjs.CatalogsResource(this);
174
+ this.models = new chunkP7UT2YH4_cjs.ModelsResource(this);
175
175
  this.shots = new chunkMBFUMWI5_cjs.ShotsResource(this);
176
176
  this.recast = new chunkKXEWTYS4_cjs.RecastResource(this);
177
177
  this.castSwap = new chunkGU3YOOCK_cjs.CastSwapResource(this);
@@ -215,5 +215,5 @@ function createClient(opts) {
215
215
 
216
216
  exports.NodaroClient = NodaroClient;
217
217
  exports.createClient = createClient;
218
- //# sourceMappingURL=chunk-PTH6ZUW3.cjs.map
219
- //# sourceMappingURL=chunk-PTH6ZUW3.cjs.map
218
+ //# sourceMappingURL=chunk-4RPUONS5.cjs.map
219
+ //# sourceMappingURL=chunk-4RPUONS5.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/client.ts"],"names":["NodaroClientCore","WorkflowsResource","ProjectsResource","SessionsResource","TrashResource","JobsResource","VideoProResource","ExecutionsResource","NodesResource","Scene3DResource","DeveloperAppsResource","OAuthResource","WebhooksResource","AppsResource","CharactersResource","LocationsResource","ObjectsResource","CreaturesResource","KeepersResource","PipelinesResource","ReduceResource","PromptHelperResource","VoicesResource","LlmResource","MediaResource","ContentRightsResource","AudioResource","CreditsResource","UserSettingsResource","BillingResource","SurfaceResource","UploadsResource","LibraryResource","GalleryResource","PresetsResource","SavedPostsResource","CollectionsResource","PalettesResource","MoodboardsResource","CompetitorsResource","PickerCatalogsResource","CatalogsResource","ModelsResource","ShotsResource","RecastResource","CastSwapResource","TrendsResource","TrendRadarResource","StudioResource","CopilotResource","CommunityResource","TemplatesResource","TutorialsResource","OrganizationsResource","WorkspacesResource","EditResource"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgEO,IAAM,YAAA,GAAN,MAAM,aAAA,SAAqBA,kCAAA,CAAiB;AAAA,EACxC,SAAA;AAAA,EACA,QAAA;AAAA;AAAA,EAEA,QAAA;AAAA;AAAA,EAEA,KAAA;AAAA,EACA,IAAA;AAAA,EACA,QAAA;AAAA,EACA,UAAA;A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IAAA,MAAM,aAAA,GAAgB,KAAK,eAAe,CAAA;AAC1C,IAAA,OAAO,IAAI,aAAA,CAAa;AAAA,MACtB,SAAS,IAAA,CAAK,OAAA;AAAA,MACd,MAAM,IAAA,CAAK,IAAA;AAAA,MACX,WAAW,IAAA,CAAK,SAAA;AAAA,MAChB,GAAI,aAAA,GAAgB,EAAE,KAAA,EAAO,aAAA,KAAkB,EAAC;AAAA,MAChD,GAAI,KAAK,kBAAkB,CAAA,GAAI,EAAE,WAAA,EAAa,IAAA,CAAK,WAAA,EAAY,GAAI,EAAC;AAAA,MACpE,GAAI,WAAA,GAAc,EAAE,WAAA,KAAgB;AAAC,KACtC,CAAA;AAAA,EACH;AACF;AAGO,SAAS,aAAa,IAAA,EAAmC;AAC9D,EAAA,OAAO,IAAI,aAAa,IAAI,CAAA;AAC9B","file":"chunk-PTH6ZUW3.cjs","sourcesContent":["import { WorkflowsResource } from \"./resources/workflows.js\"\nimport { ProjectsResource } from \"./resources/projects.js\"\nimport { SessionsResource } from \"./resources/sessions.js\"\nimport { TrashResource } from \"./resources/trash.js\"\nimport { JobsResource } from \"./resources/jobs.js\"\nimport { VideoProResource } from \"./resources/video-pro.js\"\nimport { ExecutionsResource } from \"./resources/executions.js\"\nimport { NodesResource } from \"./resources/nodes.js\"\nimport { Scene3DResource } from \"./resources/scene3d.js\"\nimport { DeveloperAppsResource } from \"./resources/developer-apps.js\"\nimport { OAuthResource } from \"./resources/oauth.js\"\nimport { WebhooksResource } from \"./resources/webhooks.js\"\nimport { AppsResource } from \"./resources/apps.js\"\nimport { CharactersResource } from \"./resources/characters.js\"\nimport { LocationsResource } from \"./resources/locations.js\"\nimport { ObjectsResource } from \"./resources/objects.js\"\nimport { CreaturesResource } from \"./resources/creatures.js\"\nimport { KeepersResource } from \"./resources/keepers.js\"\nimport { PipelinesResource } from \"./resources/pipelines.js\"\nimport { ReduceResource } from \"./resources/reduce.js\"\nimport { PromptHelperResource } from \"./resources/prompt-helper.js\"\nimport { VoicesResource } from \"./resources/voices.js\"\nimport { LlmResource } from \"./resources/llm.js\"\nimport { MediaResource } from \"./resources/media.js\"\nimport { ContentRightsResource } from \"./resources/content-rights.js\"\nimport { AudioResource } from \"./resources/audio.js\"\nimport { CreditsResource } from \"./resources/credits.js\"\nimport { BillingResource } from \"./resources/billing.js\"\nimport { UserSettingsResource } from \"./resources/user-settings.js\"\nimport { SurfaceResource } from \"./resources/surface.js\"\nimport { UploadsResource } from \"./resources/uploads.js\"\nimport { LibraryResource } from \"./resources/library.js\"\nimport { GalleryResource } from \"./resources/gallery.js\"\nimport { PresetsResource } from \"./resources/node-presets.js\"\nimport { SavedPostsResource } from \"./resources/saved-posts.js\"\nimport { CollectionsResource } from \"./resources/collections.js\"\nimport { PalettesResource } from \"./resources/palettes.js\"\nimport { MoodboardsResource } from \"./resources/moodboards.js\"\nimport { CompetitorsResource } from \"./resources/competitors.js\"\nimport { PickerCatalogsResource } from \"./resources/picker-catalogs.js\"\nimport { CatalogsResource } from \"./resources/catalogs.js\"\nimport { ModelsResource } from \"./resources/models.js\"\nimport { ShotsResource } from \"./resources/shots.js\"\nimport { RecastResource } from \"./resources/recast.js\"\nimport { CastSwapResource } from \"./resources/cast-swap.js\"\nimport { TrendsResource } from \"./resources/trends.js\"\nimport { TrendRadarResource } from \"./resources/trend-radar.js\"\nimport { StudioResource } from \"./resources/studio.js\"\nimport { CopilotResource } from \"./resources/copilot.js\"\nimport { CommunityResource } from \"./resources/community.js\"\nimport { TemplatesResource } from \"./resources/templates.js\"\nimport { TutorialsResource } from \"./resources/tutorials.js\"\nimport { OrganizationsResource } from \"./resources/organizations.js\"\nimport { WorkspacesResource } from \"./resources/workspaces.js\"\nimport { EditResource } from \"./resources/edit.js\"\nimport { NodaroClientCore, type ClientOptions } from \"./core.js\"\n\nexport { CLIENT_HEADER } from \"./core.js\"\nexport type { ClientOptions, UserIdentity, ConnectedApp } from \"./core.js\"\n\n/**\n * The full client: the core (`./core.ts` — config, transport, identity) and\n * every resource.\n */\nexport class NodaroClient extends NodaroClientCore {\n readonly workflows: WorkflowsResource\n readonly projects: ProjectsResource\n /** Generation sessions inside projects (Create Image / Video / Music). */\n readonly sessions: SessionsResource\n /** Your Trash: items removed from sessions and deleted jobs. */\n readonly trash: TrashResource\n readonly jobs: JobsResource\n readonly videoPro: VideoProResource\n readonly executions: ExecutionsResource\n readonly nodes: NodesResource\n readonly scene3d: Scene3DResource\n readonly developerApps: DeveloperAppsResource\n readonly oauth: OAuthResource\n /** Outbound webhooks: endpoints that receive your job.completed / job.failed. */\n readonly webhooks: WebhooksResource\n readonly apps: AppsResource\n readonly characters: CharactersResource\n readonly locations: LocationsResource\n readonly objects: ObjectsResource\n readonly creatures: CreaturesResource\n /** The shared Nodaro Keepers catalog of characters, creatures, locations and objects. */\n readonly keepers: KeepersResource\n readonly pipelines: PipelinesResource\n readonly reduce: ReduceResource\n readonly promptHelper: PromptHelperResource\n readonly voices: VoicesResource\n readonly llm: LlmResource\n readonly media: MediaResource\n /** Content rights: the declaration confirmed before a link is imported, and the confirmation a download carries. */\n readonly contentRights: ContentRightsResource\n readonly audio: AudioResource\n readonly credits: CreditsResource\n /** The signed-in person's own settings (the interface language, the monthly statement opt-in, …). */\n readonly userSettings: UserSettingsResource\n /** Plans and prices, the subscription, and how this deployment bills. */\n readonly billing: BillingResource\n /** What this deployment offers the caller: node types, models and the worlds of the shared header. */\n readonly surface: SurfaceResource\n readonly uploads: UploadsResource\n readonly library: LibraryResource\n /** The public gallery and your favorites. */\n readonly gallery: GalleryResource\n readonly presets: PresetsResource\n readonly savedPosts: SavedPostsResource\n readonly collections: CollectionsResource\n /** Your colour palettes — a generate-image direction (`direction.colorLook: paletteDirectionId(id)`). */\n readonly palettes: PalettesResource\n /** Your moodboards — a generate-image direction (`direction.style: moodboardDirectionId(id)`). */\n readonly moodboards: MoodboardsResource\n readonly competitors: CompetitorsResource\n readonly pickerCatalogs: PickerCatalogsResource\n readonly catalogs: CatalogsResource\n readonly models: ModelsResource\n readonly shots: ShotsResource\n readonly recast: RecastResource\n /** Cast Swap: replace the people and/or location in a short video (Cloud). */\n readonly castSwap: CastSwapResource\n /** Trends: ready-made Cast Swap recipes you fill with your own pictures (Cloud). */\n readonly trends: TrendsResource\n /** Trend Radar: the daily run's candidate trends and the admin's decisions (Cloud, admin session only). */\n readonly trendRadar: TrendRadarResource\n readonly studio: StudioResource\n readonly copilot: CopilotResource\n readonly community: CommunityResource\n readonly templates: TemplatesResource\n readonly tutorials: TutorialsResource\n readonly organizations: OrganizationsResource\n readonly workspaces: WorkspacesResource\n readonly edit: EditResource\n\n constructor(opts: ClientOptions) {\n super(opts)\n\n this.workflows = new WorkflowsResource(this)\n this.projects = new ProjectsResource(this)\n this.sessions = new SessionsResource(this)\n this.trash = new TrashResource(this)\n this.jobs = new JobsResource(this)\n this.videoPro = new VideoProResource(this)\n this.executions = new ExecutionsResource(this)\n this.nodes = new NodesResource(this)\n this.scene3d = new Scene3DResource(this)\n this.developerApps = new DeveloperAppsResource(this)\n this.oauth = new OAuthResource(this)\n this.webhooks = new WebhooksResource(this)\n this.apps = new AppsResource(this)\n this.characters = new CharactersResource(this)\n this.locations = new LocationsResource(this)\n this.objects = new ObjectsResource(this)\n this.creatures = new CreaturesResource(this)\n this.keepers = new KeepersResource(this)\n this.pipelines = new PipelinesResource(this)\n this.reduce = new ReduceResource(this)\n this.promptHelper = new PromptHelperResource(this)\n this.voices = new VoicesResource(this)\n this.llm = new LlmResource(this)\n this.media = new MediaResource(this)\n this.contentRights = new ContentRightsResource(this)\n this.audio = new AudioResource(this)\n this.credits = new CreditsResource(this)\n this.userSettings = new UserSettingsResource(this)\n this.billing = new BillingResource(this)\n this.surface = new SurfaceResource(this)\n this.uploads = new UploadsResource(this)\n this.library = new LibraryResource(this)\n this.gallery = new GalleryResource(this)\n this.presets = new PresetsResource(this)\n this.savedPosts = new SavedPostsResource(this)\n this.collections = new CollectionsResource(this)\n this.palettes = new PalettesResource(this)\n this.moodboards = new MoodboardsResource(this)\n this.competitors = new CompetitorsResource(this)\n this.pickerCatalogs = new PickerCatalogsResource(this)\n this.catalogs = new CatalogsResource(this)\n this.models = new ModelsResource(this)\n this.shots = new ShotsResource(this)\n this.recast = new RecastResource(this)\n this.castSwap = new CastSwapResource(this)\n this.trends = new TrendsResource(this)\n this.trendRadar = new TrendRadarResource(this)\n this.studio = new StudioResource(this)\n this.copilot = new CopilotResource(this)\n this.community = new CommunityResource(this)\n this.templates = new TemplatesResource(this)\n this.tutorials = new TutorialsResource(this)\n this.organizations = new OrganizationsResource(this)\n this.workspaces = new WorkspacesResource(this)\n this.edit = new EditResource(this)\n }\n\n /**\n * A client that acts in `workspaceId`, sharing this one's auth and config.\n *\n * A NEW client rather than a setter, deliberately. A mutable selection is\n * the bug this whole axis exists to prevent: two concurrent operations\n * against one client would race over which workspace they were in, and the\n * loser would create work in the wrong place with nothing failing. A\n * per-workspace client cannot be raced.\n *\n * Pass `null` for the personal space.\n */\n withWorkspace(workspaceId: string | null): NodaroClient {\n // The two private settings are read by bracket access, which TypeScript\n // allows on a subclass and which adds no member to the declarations. Read\n // through `this` (not a side table keyed by the instance), so a client\n // wrapped in a Proxy (Vue/Pinia `reactive()`) or reached through\n // `Object.create(client)` still works.\n const fetchOverride = this[\"fetchOverride\"]\n return new NodaroClient({\n baseUrl: this.baseUrl,\n auth: this.auth,\n timeoutMs: this.timeoutMs,\n ...(fetchOverride ? { fetch: fetchOverride } : {}),\n ...(this[\"sendClientHeader\"] ? { clientLabel: this.clientLabel } : {}),\n ...(workspaceId ? { workspaceId } : {}),\n })\n }\n}\n\n/** Factory function — preferred entry point. */\nexport function createClient(opts: ClientOptions): NodaroClient {\n return new NodaroClient(opts)\n}\n"]}
1
+ {"version":3,"sources":["../src/client.ts"],"names":["NodaroClientCore","WorkflowsResource","ProjectsResource","SessionsResource","TrashResource","JobsResource","VideoProResource","ExecutionsResource","NodesResource","Scene3DResource","DeveloperAppsResource","OAuthResource","WebhooksResource","AppsResource","CharactersResource","LocationsResource","ObjectsResource","CreaturesResource","KeepersResource","PipelinesResource","ReduceResource","PromptHelperResource","VoicesResource","LlmResource","MediaResource","ContentRightsResource","AudioResource","CreditsResource","UserSettingsResource","BillingResource","SurfaceResource","UploadsResource","LibraryResource","GalleryResource","PresetsResource","SavedPostsResource","CollectionsResource","PalettesResource","MoodboardsResource","CompetitorsResource","PickerCatalogsResource","CatalogsResource","ModelsResource","ShotsResource","RecastResource","CastSwapResource","TrendsResource","TrendRadarResource","StudioResource","CopilotResource","CommunityResource","TemplatesResource","TutorialsResource","OrganizationsResource","WorkspacesResource","EditResource"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgEO,IAAM,YAAA,GAAN,MAAM,aAAA,SAAqBA,kCAAA,CAAiB;AAAA,EACxC,SAAA;AAAA,EACA,QAAA;AAAA;AAAA,EAEA,QAAA;AAAA;AAAA,EAEA,KAAA;AAAA,EACA,IAAA;AAAA,EACA,QAAA;AAAA,EACA,UAAA;AAAA,EACA,KAAA;AAAA,EACA,OAAA;AAAA,EACA,aAAA;AAAA,EACA,KAAA;AAAA;AAAA,EAEA,QAAA;AAAA,EACA,IAAA;AAAA,EACA,UAAA;AAAA,EACA,SAAA;AAAA,EACA,OAAA;AAAA,EACA,SAAA;AAAA;AAAA,EAEA,OAAA;AAAA,EACA,SAAA;AAAA,EACA,MAAA;AAAA,EACA,YAAA;AAAA,EACA,MAAA;AAAA,EACA,GAAA;AAAA,EACA,KAAA;AAAA;AAAA,EAEA,aAAA;AAAA,EACA,KAAA;AAAA,EACA,OAAA;AAAA;AAAA,EAEA,YAAA;AAAA;AAAA,EAEA,OAAA;AAAA;AAAA,EAEA,OAAA;AAAA,EACA,OAAA;AAAA,EACA,OAAA;AAAA;AAAA,EAEA,OAAA;AAAA,EACA,OAAA;AAAA,EACA,UAAA;AAAA,EACA,WAAA;AAAA;AAAA,EAEA,QAAA;AAAA;AAAA,EAEA,UAA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import { ProjectsResource } from \"./resources/projects.js\"\nimport { SessionsResource } from \"./resources/sessions.js\"\nimport { TrashResource } from \"./resources/trash.js\"\nimport { JobsResource } from \"./resources/jobs.js\"\nimport { VideoProResource } from \"./resources/video-pro.js\"\nimport { ExecutionsResource } from \"./resources/executions.js\"\nimport { NodesResource } from \"./resources/nodes.js\"\nimport { Scene3DResource } from \"./resources/scene3d.js\"\nimport { DeveloperAppsResource } from \"./resources/developer-apps.js\"\nimport { OAuthResource } from \"./resources/oauth.js\"\nimport { WebhooksResource } from \"./resources/webhooks.js\"\nimport { AppsResource } from \"./resources/apps.js\"\nimport { CharactersResource } from \"./resources/characters.js\"\nimport { LocationsResource } from \"./resources/locations.js\"\nimport { ObjectsResource } from \"./resources/objects.js\"\nimport { CreaturesResource } from \"./resources/creatures.js\"\nimport { KeepersResource } from \"./resources/keepers.js\"\nimport { PipelinesResource } from \"./resources/pipelines.js\"\nimport { ReduceResource } from \"./resources/reduce.js\"\nimport { PromptHelperResource } from \"./resources/prompt-helper.js\"\nimport { VoicesResource } from \"./resources/voices.js\"\nimport { LlmResource } from \"./resources/llm.js\"\nimport { MediaResource } from \"./resources/media.js\"\nimport { ContentRightsResource } from \"./resources/content-rights.js\"\nimport { AudioResource } from \"./resources/audio.js\"\nimport { CreditsResource } from \"./resources/credits.js\"\nimport { BillingResource } from \"./resources/billing.js\"\nimport { UserSettingsResource } from \"./resources/user-settings.js\"\nimport { SurfaceResource } from \"./resources/surface.js\"\nimport { UploadsResource } from \"./resources/uploads.js\"\nimport { LibraryResource } from \"./resources/library.js\"\nimport { GalleryResource } from \"./resources/gallery.js\"\nimport { PresetsResource } from \"./resources/node-presets.js\"\nimport { SavedPostsResource } from \"./resources/saved-posts.js\"\nimport { CollectionsResource } from \"./resources/collections.js\"\nimport { PalettesResource } from \"./resources/palettes.js\"\nimport { MoodboardsResource } from \"./resources/moodboards.js\"\nimport { CompetitorsResource } from \"./resources/competitors.js\"\nimport { PickerCatalogsResource } from \"./resources/picker-catalogs.js\"\nimport { CatalogsResource } from \"./resources/catalogs.js\"\nimport { ModelsResource } from \"./resources/models.js\"\nimport { ShotsResource } from \"./resources/shots.js\"\nimport { RecastResource } from \"./resources/recast.js\"\nimport { CastSwapResource } from \"./resources/cast-swap.js\"\nimport { TrendsResource } from \"./resources/trends.js\"\nimport { TrendRadarResource } from \"./resources/trend-radar.js\"\nimport { StudioResource } from \"./resources/studio.js\"\nimport { CopilotResource } from \"./resources/copilot.js\"\nimport { CommunityResource } from \"./resources/community.js\"\nimport { TemplatesResource } from \"./resources/templates.js\"\nimport { TutorialsResource } from \"./resources/tutorials.js\"\nimport { OrganizationsResource } from \"./resources/organizations.js\"\nimport { WorkspacesResource } from \"./resources/workspaces.js\"\nimport { EditResource } from \"./resources/edit.js\"\nimport { NodaroClientCore, type ClientOptions } from \"./core.js\"\n\nexport { CLIENT_HEADER } from \"./core.js\"\nexport type { ClientOptions, UserIdentity, ConnectedApp } from \"./core.js\"\n\n/**\n * The full client: the core (`./core.ts` — config, transport, identity) and\n * every resource.\n */\nexport class NodaroClient extends NodaroClientCore {\n readonly workflows: WorkflowsResource\n readonly projects: ProjectsResource\n /** Generation sessions inside projects (Create Image / Video / Music). */\n readonly sessions: SessionsResource\n /** Your Trash: items removed from sessions and deleted jobs. */\n readonly trash: TrashResource\n readonly jobs: JobsResource\n readonly videoPro: VideoProResource\n readonly executions: ExecutionsResource\n readonly nodes: NodesResource\n readonly scene3d: Scene3DResource\n readonly developerApps: DeveloperAppsResource\n readonly oauth: OAuthResource\n /** Outbound webhooks: endpoints that receive your job.completed / job.failed. */\n readonly webhooks: WebhooksResource\n readonly apps: AppsResource\n readonly characters: CharactersResource\n readonly locations: LocationsResource\n readonly objects: ObjectsResource\n readonly creatures: CreaturesResource\n /** The shared Nodaro Keepers catalog of characters, creatures, locations and objects. */\n readonly keepers: KeepersResource\n readonly pipelines: PipelinesResource\n readonly reduce: ReduceResource\n readonly promptHelper: PromptHelperResource\n readonly voices: VoicesResource\n readonly llm: LlmResource\n readonly media: MediaResource\n /** Content rights: the declaration confirmed before a link is imported, and the confirmation a download carries. */\n readonly contentRights: ContentRightsResource\n readonly audio: AudioResource\n readonly credits: CreditsResource\n /** The signed-in person's own settings (the interface language, the monthly statement opt-in, …). */\n readonly userSettings: UserSettingsResource\n /** Plans and prices, the subscription, and how this deployment bills. */\n readonly billing: BillingResource\n /** What this deployment offers the caller: node types, models and the worlds of the shared header. */\n readonly surface: SurfaceResource\n readonly uploads: UploadsResource\n readonly library: LibraryResource\n /** The public gallery and your favorites. */\n readonly gallery: GalleryResource\n readonly presets: PresetsResource\n readonly savedPosts: SavedPostsResource\n readonly collections: CollectionsResource\n /** Your colour palettes — a generate-image direction (`direction.colorLook: paletteDirectionId(id)`). */\n readonly palettes: PalettesResource\n /** Your moodboards — a generate-image direction (`direction.style: moodboardDirectionId(id)`). */\n readonly moodboards: MoodboardsResource\n readonly competitors: CompetitorsResource\n readonly pickerCatalogs: PickerCatalogsResource\n readonly catalogs: CatalogsResource\n readonly models: ModelsResource\n readonly shots: ShotsResource\n readonly recast: RecastResource\n /** Cast Swap: replace the people and/or location in a short video (Cloud). */\n readonly castSwap: CastSwapResource\n /** Trends: ready-made Cast Swap recipes you fill with your own pictures (Cloud). */\n readonly trends: TrendsResource\n /** Trend Radar: the daily run's candidate trends and the admin's decisions (Cloud, admin session only). */\n readonly trendRadar: TrendRadarResource\n readonly studio: StudioResource\n readonly copilot: CopilotResource\n readonly community: CommunityResource\n readonly templates: TemplatesResource\n readonly tutorials: TutorialsResource\n readonly organizations: OrganizationsResource\n readonly workspaces: WorkspacesResource\n readonly edit: EditResource\n\n constructor(opts: ClientOptions) {\n super(opts)\n\n this.workflows = new WorkflowsResource(this)\n this.projects = new ProjectsResource(this)\n this.sessions = new SessionsResource(this)\n this.trash = new TrashResource(this)\n this.jobs = new JobsResource(this)\n this.videoPro = new VideoProResource(this)\n this.executions = new ExecutionsResource(this)\n this.nodes = new NodesResource(this)\n this.scene3d = new Scene3DResource(this)\n this.developerApps = new DeveloperAppsResource(this)\n this.oauth = new OAuthResource(this)\n this.webhooks = new WebhooksResource(this)\n this.apps = new AppsResource(this)\n this.characters = new CharactersResource(this)\n this.locations = new LocationsResource(this)\n this.objects = new ObjectsResource(this)\n this.creatures = new CreaturesResource(this)\n this.keepers = new KeepersResource(this)\n this.pipelines = new PipelinesResource(this)\n this.reduce = new ReduceResource(this)\n this.promptHelper = new PromptHelperResource(this)\n this.voices = new VoicesResource(this)\n this.llm = new LlmResource(this)\n this.media = new MediaResource(this)\n this.contentRights = new ContentRightsResource(this)\n this.audio = new AudioResource(this)\n this.credits = new CreditsResource(this)\n this.userSettings = new UserSettingsResource(this)\n this.billing = new BillingResource(this)\n this.surface = new SurfaceResource(this)\n this.uploads = new UploadsResource(this)\n this.library = new LibraryResource(this)\n this.gallery = new GalleryResource(this)\n this.presets = new PresetsResource(this)\n this.savedPosts = new SavedPostsResource(this)\n this.collections = new CollectionsResource(this)\n this.palettes = new PalettesResource(this)\n this.moodboards = new MoodboardsResource(this)\n this.competitors = new CompetitorsResource(this)\n this.pickerCatalogs = new PickerCatalogsResource(this)\n this.catalogs = new CatalogsResource(this)\n this.models = new ModelsResource(this)\n this.shots = new ShotsResource(this)\n this.recast = new RecastResource(this)\n this.castSwap = new CastSwapResource(this)\n this.trends = new TrendsResource(this)\n this.trendRadar = new TrendRadarResource(this)\n this.studio = new StudioResource(this)\n this.copilot = new CopilotResource(this)\n this.community = new CommunityResource(this)\n this.templates = new TemplatesResource(this)\n this.tutorials = new TutorialsResource(this)\n this.organizations = new OrganizationsResource(this)\n this.workspaces = new WorkspacesResource(this)\n this.edit = new EditResource(this)\n }\n\n /**\n * A client that acts in `workspaceId`, sharing this one's auth and config.\n *\n * A NEW client rather than a setter, deliberately. A mutable selection is\n * the bug this whole axis exists to prevent: two concurrent operations\n * against one client would race over which workspace they were in, and the\n * loser would create work in the wrong place with nothing failing. A\n * per-workspace client cannot be raced.\n *\n * Pass `null` for the personal space.\n */\n withWorkspace(workspaceId: string | null): NodaroClient {\n // The two private settings are read by bracket access, which TypeScript\n // allows on a subclass and which adds no member to the declarations. Read\n // through `this` (not a side table keyed by the instance), so a client\n // wrapped in a Proxy (Vue/Pinia `reactive()`) or reached through\n // `Object.create(client)` still works.\n const fetchOverride = this[\"fetchOverride\"]\n return new NodaroClient({\n baseUrl: this.baseUrl,\n auth: this.auth,\n timeoutMs: this.timeoutMs,\n ...(fetchOverride ? { fetch: fetchOverride } : {}),\n ...(this[\"sendClientHeader\"] ? { clientLabel: this.clientLabel } : {}),\n ...(workspaceId ? { workspaceId } : {}),\n })\n }\n}\n\n/** Factory function — preferred entry point. */\nexport function createClient(opts: ClientOptions): NodaroClient {\n return new NodaroClient(opts)\n}\n"]}
@@ -209,6 +209,34 @@ var MediaResource = class {
209
209
  shotCuts(input) {
210
210
  return this.client.request("POST", "/v1/shot-cuts", { body: input });
211
211
  }
212
+ /**
213
+ * Split one image into a base picture and separate layers
214
+ * (`POST /v1/split-into-layers`): each element on its own transparent PNG,
215
+ * with its name, description, stacking order and the box it sits in on the
216
+ * base. `maxLayers` (1–99, default 9) caps the layers — more elements than
217
+ * that merge into fewer layers, none is dropped; `size` is each image's
218
+ * pixel budget (`1K` default, `auto` keeps the picture's own size between 1K
219
+ * and 2K); `prompt` names what to separate. A run holds the price of the
220
+ * most images it may return (`maxLayers` + 1, the base included) and is
221
+ * charged only for the images it returns: ask that price first with
222
+ * `client.nodes.quote("split-into-layers", input)` (nothing is started).
223
+ * Poll `jobs.get(jobId)`; the completed job's `output_data` is a
224
+ * {@link SplitIntoLayersOutput}. `sessionId` files the job in one of your
225
+ * sessions; `origin` tags it with your app's slug.
226
+ *
227
+ * With `options.idempotencyKey` (sent as the `Idempotency-Key` header, at
228
+ * least 8 characters) a retry of the same request answers the job it
229
+ * already started (`deduped: true`) instead of starting and charging a
230
+ * second one.
231
+ */
232
+ splitIntoLayers(input, options = {}) {
233
+ return this.client.request("POST", "/v1/split-into-layers", {
234
+ body: input,
235
+ ...options.idempotencyKey ? { headers: { "Idempotency-Key": options.idempotencyKey } } : {},
236
+ ...options.signal ? { signal: options.signal } : {},
237
+ ...options.timeoutMs !== void 0 ? { timeoutMs: options.timeoutMs } : {}
238
+ });
239
+ }
212
240
  /**
213
241
  * Turn one still image + one audio track into an MP4
214
242
  * (`POST /v1/still-to-video`) — locally rendered (FFmpeg), no AI model,
@@ -234,20 +262,42 @@ var MediaResource = class {
234
262
  return this.client.request("POST", "/v1/slideshow", { body: input });
235
263
  }
236
264
  /**
237
- * Place 1–20 timed image layers over a video (`POST /v1/video-overlay`) —
238
- * rendered locally (FFmpeg) in one pass, no AI; the base audio is kept
239
- * untouched. Each layer has an `imageUrl`, a `start` and an optional `end`
240
- * in seconds (no `end` = to the end of the video) and a placement: a
241
- * `preset` (`"card"`, `"corner-badge"` with a `corner`, `"full-frame"`) or
242
- * an explicit box in {@link MediaResource.imageOverlay}'s percent vocabulary
243
- * (`anchor`, `x`, `y`, `width`, `height`, `fit`) — an explicit box field
244
- * overrides the preset, and a layer with neither is a corner badge
245
- * (bottom-right, or the `corner` it names). `outputAspect` renders onto a
246
- * 16:9 / 9:16 / 1:1 / 4:5 canvas
247
- * (`baseFit` cover by default; `backgroundColor` pads `contain`). Poll
248
- * `jobs.get(jobId)`: the output carries `videoUrl`, `thumbnailUrl`, `width`,
249
- * `height`, `durationSec` and `warnings[]` (a layer clipped or skipped at the
250
- * video's end, an animated image's first frame, re-encoded audio).
265
+ * Place 1–20 timed image or video layers over a video
266
+ * (`POST /v1/video-overlay`) — rendered locally (FFmpeg) in one pass, no AI.
267
+ * Each layer has exactly one source, `imageUrl` or `videoUrl` (at most 2
268
+ * video layers), a `start` and an optional `end` in seconds (no `end` = to
269
+ * the end of the video) and a placement: a `preset` (`"card"`,
270
+ * `"corner-badge"` with a `corner`, `"full-frame"`) or an explicit box in
271
+ * {@link MediaResource.imageOverlay}'s percent vocabulary (`anchor`, `x`,
272
+ * `y`, `width`, `height`, `fit`) — an explicit box field overrides the
273
+ * preset, and a layer with neither is a corner badge (bottom-right, or the
274
+ * `corner` it names). `animate` (a short fade in and out) defaults on for an
275
+ * image and off for a video.
276
+ *
277
+ * A video layer plays from its first frame at its `start`, stops at its
278
+ * `end` (or the base's end) and holds its last frame if it runs out first.
279
+ * It is silent unless it has `sound: { volume }` (0–1): its audio is then
280
+ * mixed with the base's during its window, under a limiter, as AAC. With no
281
+ * layer's sound on, the base audio is kept untouched.
282
+ *
283
+ * `outputAspect` renders onto a 16:9 / 9:16 / 1:1 / 4:5 canvas (`baseFit`
284
+ * cover by default; `backgroundColor` pads `contain`). `baseBox` places the
285
+ * base itself in a layer's box vocabulary (needs `outputAspect`; `anchor`
286
+ * and `width` are required, `x` and `y` default to 0 and `fit` to
287
+ * contain); the canvas it leaves uncovered shows `backgroundColor`. `layout` writes the boxes:
288
+ * `"video-bottom"` / `"video-top"` (the base whole, full width, against that
289
+ * edge), `"stack-whole"` / `"stack-filled"` (the base above the first video
290
+ * layer, both whole or each cropped to half the frame; no `baseBox`) and
291
+ * `"pip"` (the first video layer 30 % wide in its `corner`, default
292
+ * bottom-right). Every layout but `"pip"` needs `outputAspect`; the stacks
293
+ * and `"pip"` need a video layer.
294
+ *
295
+ * A run with a video layer takes a base of up to 60 s and is priced per
296
+ * started 5 s of it; an image-only run is one flat price. Poll
297
+ * `jobs.get(jobId)`: the output carries `videoUrl`, `thumbnailUrl`,
298
+ * `width`, `height`, `durationSec` and `warnings[]` (a layer clipped or
299
+ * skipped at the video's end, an animated image's first frame, re-encoded
300
+ * audio, a video layer with sound on but no audio track).
251
301
  */
252
302
  videoOverlay(input) {
253
303
  return this.client.request("POST", "/v1/video-overlay", { body: input });
@@ -360,5 +410,5 @@ var MediaResource = class {
360
410
  };
361
411
 
362
412
  exports.MediaResource = MediaResource;
363
- //# sourceMappingURL=chunk-3G65RIZS.cjs.map
364
- //# sourceMappingURL=chunk-3G65RIZS.cjs.map
413
+ //# sourceMappingURL=chun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KAAA,EAA+D;AACrE,IAAA,OAAO,IAAA,CAAK,OAAO,OAAA,CAAsC,MAAA,EAAQ,qBAAqB,EAAE,IAAA,EAAM,OAAO,CAAA;AAAA,EACvG;AACF","file":"chunk-5W4OCRFX.cjs","sourcesContent":["import type { NodaroClientCore } from \"../core.js\"\nimport { readSseStream } from \"../sse.js\"\nimport type { OverlayAnchor, VideoMaskRequest, MaskCompositeRequest } from \"@nodaro/shared/media\"\nimport type { CaptionStyle, CaptionLookId, SupportedFontName } from \"@nodaro/shared/captions\"\nimport type { CaptionTranscribeLane } from \"@nodaro/shared/models\"\nimport type { VideoOverlayRequest } from \"@nodaro/shared/video\"\nimport type { GenerationSessionParams, RunNodeOptions } from \"./nodes.js\"\n\n/** One word-timed caption entry (one per WORD for the kinetic styles). */\nexport interface CaptionEntry {\n text: string\n startMs: number\n endMs: number\n timestampMs?: number | null\n confidence?: number | null\n}\n\n/** Look + motion levers — see {@link MediaResource.addCaptions}. `look` is a\n * named preset the explicit levers override; an unset look renders as `outline`\n * (the default). The STYLING levers (`look`, `fontFamily`, `fontWeight`,\n * `strokeColor`/`strokeWidth`, `uppercase`, `positionY`, `maxWordsPerLine`) now\n * apply to the static `subtitle` style too — a subtitle carrying any of them\n * renders via Remotion. Only `highlightColor` (no spoken-word cursor to colour)\n * and `animate` (no motion to freeze) stay kinetic-only and are rejected (400)\n * on `subtitle`. */\nexport interface CaptionLookInput {\n look?: CaptionLookId\n fontFamily?: SupportedFontName\n fontWeight?: number\n strokeColor?: string\n strokeWidth?: number\n highlightColor?: string\n uppercase?: boolean\n positionY?: number\n /** Cap on how many words one caption LINE (or `tiktok-words` page) may hold,\n * 1-20, on TOP of the frame-width budget, sentence ends and pauses that\n * already close a line — 1-2 gives the punchy CapCut read, unset fits the\n * width. Applies to `word-highlight` / `karaoke` / `bouncy` / `tiktok-words`\n * and to a Remotion-rendered `subtitle`; inert on `word-pop` (always one\n * word). */\n maxWordsPerLine?: number\n /** Kinetic styles only. `false` freezes the per-word MOTION — the grouping,\n * line-holding and spoken-word highlight stay, only the movement stops;\n * default `true`. Rejected (400) on the static `subtitle` style. */\n animate?: boolean\n}\n\n/** One caption SEGMENT: a time range with optional style/look overrides and its\n * own words (`text`/`captions`, else the shared transcript filtered to range).\n * A segmented render is entirely Remotion, so any `style` is valid here. */\nexport interface CaptionSegmentInput extends CaptionLookInput {\n startMs: number\n endMs: number\n style?: CaptionStyle\n position?: \"bottom\" | \"top\" | \"center\"\n fontSize?: number\n color?: string\n backgroundColor?: string\n text?: string\n captions?: CaptionEntry[]\n}\n\n/** {@link MediaResource.addCaptions} input. */\nexport interface AddCaptionsInput extends CaptionLookInput {\n videoUrl: string\n text?: string\n captions?: CaptionEntry[]\n /** Transcribe the video's audio when no text/captions are given (default true). */\n autoTranscribe?: boolean\n /** The engine the render transcribes on — Add Captions' own lanes (a length-priced engine such as Nemotron 3.5 Transcribe is not one: transcribe with `audio.transcribe` and pass its `words` as `captions`). */\n transcribeProvider?: CaptionTranscribeLane\n style?: CaptionStyle\n position?: \"bottom\" | \"top\" | \"center\"\n fontSize?: number\n color?: string\n backgroundColor?: string\n /** Apply different treatments to time ranges in one call (non-overlapping). */\n segments?: CaptionSegmentInput[]\n}\n\n/**\n * Media ingestion + trimming — the source-preparation steps a Voice Changer Pro\n * flow (or any pipeline) needs before it has a clip to work on: pull a social\n * video into storage, copy a remote URL into storage, trim a video/audio to a\n * range, and probe a video's metadata. Each generation-style op returns a job id\n * to poll (`jobs.get(jobId)`); `videoMetadata` is a direct read.\n */\n/**\n * Where one overlay layer should go, in {@link MediaResource.imageOverlay}'s\n * percent units — the answer from {@link MediaResource.suggestOverlayPlacement}.\n */\nexport interface OverlayPlacement {\n /** The point on the base image the layer attaches to. */\n anchor: OverlayAnchor\n /** Offset from the anchor in % of the base width (negative on a right anchor = inward). */\n x: number\n /** Offset from the anchor in % of the base height (negative on a bottom anchor = inward). */\n y: number\n /** The layer's width in % of the base width. */\n width: number\n /** One sentence, plain language, on why this spot. */\n reason: string\n}\n\nexport class MediaResource {\n constructor(private client: NodaroClientCore) {}\n\n /**\n * Download the video behind a link (the video's page, or a direct video file\n * link) into your storage (`POST /v1/download-video`). `maxHeight` caps the resolution\n * (default \"best\"); `sectionStartSec` + `sectionEndSec` (both-or-neither) fetch\n * ONLY that time range instead of the whole video. A download that arrives\n * with no audio stream FAILS by default (it is usually a degraded source\n * response, and is retried through other routes first); pass\n * `requireAudio: false` to accept a clip that really has no sound. Returns a\n * `downloadId`; progress streams from\n * `GET /v1/download-video/progress/:downloadId` (server-sent events) and the\n * finished file lands in your library. A section is fetched with ±3 s of\n * padding for the caller to trim; `exactSection: true` cuts it exactly at\n * `sectionStartSec`–`sectionEndSec` instead. `confirmationId` is the content\n * rights confirmation the import is made under (`contentRights.confirm`):\n * checked and consumed before the download starts, written on the stored\n * file; a download without one is refused (`403 rights_confirmation_required`)\n * once the deployment requires it, so a client always sends one.\n */\n downloadVideo(input: {\n url: string\n maxHeight?: number\n sectionStartSec?: number\n sectionEndSec?: number\n exactSection?: boolean\n requireAudio?: boolean\n confirmationId?: string\n }): Promise<{ downloadId: string }> {\n return this.client.request<{ downloadId: string }>(\"POST\", \"/v1/download-video\", { body: input })\n }\n\n /**\n * Stream the live progress of a {@link MediaResource.downloadVideo} import\n * (`GET /v1/download-video/progress/:downloadId`, server-sent events) as an\n * async iterable. Yields a {@link DownloadVideoProgress} roughly every 500ms\n * until the download reaches `completed` (its event carries the stored\n * `videoUrl`) or `failed` (its event carries `error`), then ends. The progress\n * state expires server-side shortly after the download starts existing, so\n * start iterating promptly after `downloadVideo` returns.\n *\n * No request timeout is applied (a large import legitimately takes minutes) —\n * pass an `AbortSignal` to cancel from the caller.\n */\n async *downloadVideoProgress(\n downloadId: string,\n opts: { signal?: AbortSignal } = {},\n ): AsyncGenerator<DownloadVideoProgress, void, undefined> {\n const url = `${this.client.baseUrl}/v1/download-video/progress/${encodeURIComponent(downloadId)}`\n const token = await this.client.auth.getToken()\n const res = await this.client.fetch(url, {\n headers: token ? { Authorization: `Bearer ${token}` } : {},\n signal: opts.signal,\n })\n // The shared reader owns the non-OK throw, the empty-body guard, the frame\n // parse and the cancel-on-early-exit — this route emits the same\n // `data: <json>` frames every other stream here does.\n yield* readSseStream<DownloadVideoProgress>(res, { label: \"progress stream\" })\n }\n\n /**\n * Copy an external media URL into your Nodaro storage (`POST /v1/save-to-storage`)\n * — a server-side fetch, so nothing round-trips through the client. Poll\n * `jobs.get(jobId)`.\n */\n saveToStorage(input: { mediaUrl: string; filename?: string; mediaType?: \"image\" | \"video\" | \"audio\" }): Promise<{ jobId: string }> {\n return this.client.request<{ jobId: string }>(\"POST\", \"/v1/save-to-storage\", { body: input })\n }\n\n /**\n * Composite 2–30 images into ONE large 2K/4K collage (`POST /v1/image-collage`).\n * `layout` `\"smart\"` (default — justified rows at each image's exact aspect\n * ratio, no cropping; the output height floats) or `\"grid\"` (uniform,\n * letterboxed cells). `imageSizes` is index-aligned with `imageUrls` and\n * gives per-image RELATIVE size hints for the smart layout: `0` auto\n * (\"don't care\", default), `1` big (~2× linear vs medium), `2` medium,\n * `3` small (~½ linear). All-equal hints change nothing; grid ignores them.\n * For storyboards, set `numbered` to stamp a 1-based sequence badge at each\n * image's corner (top-left by default; `badgePosition: \"top-right\"` moves it;\n * in `imageUrls` order) and pass `imageLabels`\n * (index-aligned with `imageUrls`; `null`/`\"\"`/omitted = no caption for that\n * image) to caption images after the number, e.g. `3 · Close-up`. Badges are\n * an overlay only — they never change the layout, the output size or the\n * credit cost. Poll `jobs.get(jobId)` for the finished image.\n */\n imageCollage(input: {\n imageUrls: string[]\n imageSizes?: Array<0 | 1 | 2 | 3>\n numbered?: boolean\n imageLabels?: Array<string | null>\n /** Corner the badges sit in — `\"top-left\"` (default, storyboard convention) or `\"top-right\"`. */\n badgePosition?: \"top-left\" | \"top-right\"\n layout?: \"smart\" | \"grid\"\n resolution?: \"2K\" | \"4K\"\n aspectRatio?: string\n gap?: number\n backgroundColor?: string\n }): Promise<{ jobId: string }> {\n return this.client.request<{ jobId: string }>(\"POST\", \"/v1/image-collage\", { body: input })\n }\n\n /**\n * Place 1–12 layers — pictures, real text, QR codes, shapes — on a base image,\n * pixel-exactly (`POST /v1/image-overlay`) — local, deterministic, no AI.\n * Every layer position/size is a PERCENT of the base image: `anchor` (nine\n * positions, default `\"center\"`), `x`/`y` (offset from the anchor in % of\n * the base width/height; negative on a right/bottom anchor moves inward),\n * `width` (% of the base width, default 25 — height follows the layer's\n * aspect unless `height` is set). Plus `opacity` (0..1), `rotation`\n * (degrees), `blend` (`\"over\"` | `\"multiply\"` | `\"screen\"`), `fit`,\n * `shadow` and `roundedCorners`. The output keeps the base's pixel size\n * unless `canvas` is set. Flat credit cost. Poll `jobs.get(jobId)` for the\n * finished image.\n */\n imageOverlay(input: {\n imageUrl: string\n layers: Array<{\n imageUrl: string\n anchor?: OverlayAnchor\n x?: number\n y?: number\n width?: number\n height?: number\n opacity?: number\n rotation?: number\n blend?: \"over\" | \"multiply\" | \"screen\"\n fit?: \"contain\" | \"cover\" | \"stretch\"\n shadow?: { blur: number; offsetX: number; offsetY: number; color: string; opacity: number }\n roundedCorners?: number\n zIndex?: number\n /** \"image\" (default, needs imageUrl) | \"text\" | \"qr\" | \"shape\" — see @nodaro/shared image-overlay-layers. */\n kind?: \"image\" | \"text\" | \"qr\" | \"shape\"\n text?: Record<string, unknown>\n qr?: Record<string, unknown>\n shape?: Record<string, unknown>\n effects?: Record<string, unknown>\n }>\n canvas?: { width: number; height: number; backgroundColor?: string }\n baseFit?: \"contain\" | \"cover\"\n outputFormat?: \"png\" | \"jpg\" | \"webp\"\n /** Extra platform renders (see OVERLAY_PLATFORMS in @nodaro/shared); returned as output `variants[]`. */\n variants?: string[]\n /** The mask the job also emits as output `maskUrl` (white = may change). Default \"around\". */\n maskMode?: \"none\" | \"layers\" | \"around\" | \"outside\"\n maskSpread?: number\n /** Fills every QR layer whose `qr.fromInput` is true — the node's QR link handle. */\n qrText?: string\n }): Promise<{ jobId: string }> {\n // The finished job's output: { imageUrl, width, height, maskUrl?, variants?: [{ id, label, width, height, url }] }.\n return this.client.request<{ jobId: string }>(\"POST\", \"/v1/image-overlay\", { body: input })\n }\n\n /**\n * Ask a vision model WHERE one overlay layer should sit on a base image\n * (`POST /v1/image-overlay/suggest-placement`) — it reads the picture and\n * keeps the element off the faces, the subject and the busiest texture.\n * The answer comes back in {@link MediaResource.imageOverlay}'s own percent\n * units — `anchor`, `x`/`y` offsets, `width` — so it drops straight onto a\n * layer (`const { reason, ...box } = placement`), plus a one-sentence\n * `reason` you can show a user. Nothing is composited here: apply the\n * placement yourself.\n *\n * `layerAspect` is the element's width / height (1 = square, the default) so\n * the proposed box stays in proportion; `intent` says what the element is\n * (\"a logo\", \"a price badge\"); `safeArea` is the always-visible region as\n * fractions of the canvas (a platform preset's safe area), which the\n * placement is kept inside. Unlike the other media calls this one answers\n * synchronously — there is nothing to poll; `jobId` is the billing record\n * (one image-to-text call).\n */\n suggestOverlayPlacement(input: {\n imageUrl: string\n layerAspect?: number\n intent?: string\n safeArea?: { x: number; y: number; w: number; h: number }\n llmModel?: string\n }): Promise<{ jobId: string; placement: OverlayPlacement }> {\n return this.client.request<{ jobId: string; placement: OverlayPlacement }>(\n \"POST\",\n \"/v1/image-overlay/suggest-placement\",\n { body: input },\n )\n }\n\n /**\n * Trim a video to a range (`POST /v1/trim-video`). Give the range in whichever\n * unit fits: `startTime`/`endTime` seconds, `trim*Frames`, `trim*Seconds`, or\n * `keepFirst`/`keepLastSeconds`. Poll `jobs.get(jobId)`.\n */\n trimVideo(input: {\n videoUrl: string\n startTime?: number\n endTime?: number\n trimStartFrames?: number\n trimEndFrames?: number\n trimStartSeconds?: number\n trimEndSeconds?: number\n keepFirstSeconds?: number\n keepLastSeconds?: number\n }): Promise<{ jobId: string }> {\n return this.client.request<{ jobId: string }>(\"POST\", \"/v1/trim-video\", { body: input })\n }\n\n /**\n * Burn captions into a video (`POST /v1/add-captions`). Give the words as\n * `text`, word-timed `captions[]`, or let it transcribe (`autoTranscribe`,\n * the default when neither is set).\n *\n * `style: \"subtitle\"` renders statically (FFmpeg) UNLESS it carries a styling\n * lever, in which case it — like the KINETIC styles (`word-highlight` /\n * `karaoke` / `tiktok-words` / `word-pop` / `bouncy`) — renders via Remotion.\n * `look` picks a preset — `outline` (Montserrat 900, UPPERCASE, black outline,\n * yellow spoken word — the TikTok/Reels read) or `clean`; an UNSET look renders\n * as `outline`. The explicit STYLING levers (`fontFamily`, `fontWeight`,\n * `strokeColor`/`strokeWidth`, `uppercase`, `positionY`, `maxWordsPerLine`)\n * override individual fields of it and now apply to `subtitle` too. Only\n * `highlightColor` (the spoken-word cursor) and `animate` stay kinetic-only\n * and are REJECTED on `subtitle`.\n *\n * `animate` (default true) freezes the per-word MOTION on the kinetic styles\n * when set to false — the grouping, line-holding and spoken-word highlight\n * stay; only the movement stops.\n *\n * `maxWordsPerLine` (1-20) caps how many words a line — or a `tiktok-words`\n * page — may hold, on top of the width budget / sentence ends / pauses that\n * already close one; it is inert on `word-pop`, which is always one word.\n * Like every lever here it exists top-level AND per segment, and a segment\n * that does not name its own inherits the top-level value.\n *\n * `segments[]` applies DIFFERENT treatments to non-overlapping time ranges in\n * one call (e.g. a large top intro, then a small bottom body); a segment that\n * names its own `look` starts fresh from that preset and does not inherit the\n * top-level explicit levers. Poll `jobs.get(jobId)`.\n *\n * `word-highlight` shows ONE held line at a time and a word's\n * `startMs`/`endMs` is its SPOKEN window (what times the highlight, not how\n * long the text is on screen) — so `captions[]` can be handed over verbatim\n * from an `audio.transcribe()` job's `output_data.words`, with\n * `autoTranscribe: false`.\n */\n addCaptions(input: AddCaptionsInput): Promise<{ jobId: string }> {\n const { autoTranscribe, transcribeProvider, ...rest } = input\n // The route body is camelCase except these two flags (worker snake_case);\n // omit each when unset so an absent flag stays absent on the wire.\n const body: Record<string, unknown> = {\n ...rest,\n ...(autoTranscribe !== undefined ? { auto_transcribe: autoTranscribe } : {}),\n ...(transcribeProvider !== undefined ? { transcribe_provider: transcribeProvider } : {}),\n }\n return this.client.request<{ jobId: string }>(\"POST\", \"/v1/add-captions\", { body })\n }\n\n /**\n * Trim (and extract) audio from a video or audio source\n * (`POST /v1/trim-audio`) to `[startTime, endTime]` seconds, in `audioFormat`\n * (`mp3` default / `wav` / `aac`). Poll `jobs.get(jobId)`.\n */\n trimAudio(input: {\n videoUrl?: string\n audioUrl?: string\n audioFormat?: \"mp3\" | \"wav\" | \"aac\"\n startTime?: number\n endTime?: number\n }): Promise<{ jobId: string }> {\n return this.client.request<{ jobId: string }>(\"POST\", \"/v1/trim-audio\", { body: input })\n }\n\n /**\n * Cut a video and/or an audio file into consecutive parts\n * (`POST /v1/split-media`). Every part is at most `chunkDuration` seconds and\n * at least `minPartDuration` (default 4, never above `chunkDuration`) — a\n * short leftover is evened out with the parts before it. Video is cut on\n * whole frames with each part's sound matching its picture; audio parts are\n * sample-exact, in `audioFormat` (`mp3` default / `wav` / `aac`). With both\n * sources each is split on its own. At most 200 parts per input. With\n * `mode: \"shots\"` a video is instead cut into one part per shot, at the cuts\n * measured from the file (no part length; a video only, up to 30 minutes and\n * 200 shots; each part keeps the video's own sound). Poll `jobs.get(jobId)`;\n * the parts are on the completed job's `output_data` — see\n * {@link SplitMediaOutput}.\n */\n splitMedia(input: SplitMediaInput): Promise<{ jobId: string }> {\n return this.client.request<{ jobId: string }>(\"POST\", \"/v1/split-media\", { body: input })\n }\n\n /**\n * Where every shot of a video starts and ends (`POST /v1/shot-cuts`),\n * measured from the file: every decoded frame is scored and each hard cut\n * starts a new shot (dissolves and fades are not cuts). Videos up to 30\n * minutes. `frames: true` also saves each shot's exact first and last frame\n * as PNG images (up to 1,000 shots; same price). Poll `jobs.get(jobId)`; the\n * completed job's `output_data.json` is a {@link ShotCutsResult} — see\n * {@link ShotCutsOutput}.\n */\n shotCuts(input: ShotCutsInput): Promise<{ jobId: string }> {\n return this.client.request<{ jobId: string }>(\"POST\", \"/v1/shot-cuts\", { body: input })\n }\n\n /**\n * Split one image into a base picture and separate layers\n * (`POST /v1/split-into-layers`): each element on its own transparent PNG,\n * with its name, description, stacking order and the box it sits in on the\n * base. `maxLayers` (1–99, default 9) caps the layers — more elements than\n * that merge into fewer layers, none is dropped; `size` is each image's\n * pixel budget (`1K` default, `auto` keeps the picture's own size between 1K\n * and 2K); `prompt` names what to separate. A run holds the price of the\n * most images it may return (`maxLayers` + 1, the base included) and is\n * charged only for the images it returns: ask that price first with\n * `client.nodes.quote(\"split-into-layers\", input)` (nothing is started).\n * Poll `jobs.get(jobId)`; the completed job's `output_data` is a\n * {@link SplitIntoLayersOutput}. `sessionId` files the job in one of your\n * sessions; `origin` tags it with your app's slug.\n *\n * With `options.idempotencyKey` (sent as the `Idempotency-Key` header, at\n * least 8 characters) a retry of the same request answers the job it\n * already started (`deduped: true`) instead of starting and charging a\n * second one.\n */\n splitIntoLayers(input: SplitIntoLayersInput, options: MediaRunOptions = {}): Promise<MediaJobStarted> {\n return this.client.request<MediaJobStarted>(\"POST\", \"/v1/split-into-layers\", {\n body: input,\n ...(options.idempotencyKey ? { headers: { \"Idempotency-Key\": options.idempotencyKey } } : {}),\n ...(options.signal ? { signal: options.signal } : {}),\n ...(options.timeoutMs !== undefined ? { timeoutMs: options.timeoutMs } : {}),\n })\n }\n\n /**\n * Turn one still image + one audio track into an MP4\n * (`POST /v1/still-to-video`) — locally rendered (FFmpeg), no AI model,\n * zero credits. The output duration IS the audio's duration; there is no\n * duration field. Optional `motion` animates the still (zoom / pan /\n * ken-burns) at `intensity` 1–10. `fit: \"contain\"` letterboxes with\n * `padColor` instead of cropping. Poll `jobs.get(jobId)`.\n */\n stillToVideo(input: {\n imageUrl: string\n audioUrl: string\n motion?: \"none\" | \"zoom-in\" | \"zoom-out\" | \"pan-left\" | \"pan-right\" | \"ken-burns\"\n intensity?: number\n resolution?: \"720p\" | \"1080p\" | \"4K\"\n aspectRatio?: \"16:9\" | \"9:16\" | \"1:1\" | \"4:3\"\n fps?: 24 | 30\n fit?: \"cover\" | \"contain\"\n padColor?: string\n }): Promise<{ jobId: string }> {\n return this.client.request<{ jobId: string }>(\"POST\", \"/v1/still-to-video\", { body: input })\n }\n\n /**\n * Turn 2–100 images + one optional audio track into an MP4 slideshow\n * (`POST /v1/slideshow`) — locally rendered (FFmpeg), zero credits. With\n * audio, the output duration IS the audio's duration (equal split unless\n * `imageDurations` pins rows — null entries = auto; mismatched pinned sums\n * scale proportionally and the factor is disclosed in the job output).\n * Without audio: N × `perImageDuration`, silent output. Transitions\n * consume the outgoing slide, so totals stay exact. For a single image use\n * `stillToVideo`. Poll `jobs.get(jobId)`.\n */\n slideshow(input: {\n imageUrls: string[]\n audioUrl?: string\n imageDurations?: Array<number | null>\n perImageDuration?: number\n transition?: string\n transitionDuration?: number\n motion?: \"none\" | \"zoom-in\" | \"zoom-out\" | \"ken-burns\" | \"alternate\"\n intensity?: number\n resolution?: \"720p\" | \"1080p\" | \"4K\"\n aspectRatio?: \"16:9\" | \"9:16\" | \"1:1\" | \"4:3\"\n fps?: 24 | 30\n fit?: \"cover\" | \"contain\"\n padColor?: string\n }): Promise<{ jobId: string }> {\n return this.client.request<{ jobId: string }>(\"POST\", \"/v1/slideshow\", { body: input })\n }\n\n /**\n * Place 1–20 timed image or video layers over a video\n * (`POST /v1/video-overlay`) — rendered locally (FFmpeg) in one pass, no AI.\n * Each layer has exactly one source, `imageUrl` or `videoUrl` (at most 2\n * video layers), a `start` and an optional `end` in seconds (no `end` = to\n * the end of the video) and a placement: a `preset` (`\"card\"`,\n * `\"corner-badge\"` with a `corner`, `\"full-frame\"`) or an explicit box in\n * {@link MediaResource.imageOverlay}'s percent vocabulary (`anchor`, `x`,\n * `y`, `width`, `height`, `fit`) — an explicit box field overrides the\n * preset, and a layer with neither is a corner badge (bottom-right, or the\n * `corner` it names). `animate` (a short fade in and out) defaults on for an\n * image and off for a video.\n *\n * A video layer plays from its first frame at its `start`, stops at its\n * `end` (or the base's end) and holds its last frame if it runs out first.\n * It is silent unless it has `sound: { volume }` (0–1): its audio is then\n * mixed with the base's during its window, under a limiter, as AAC. With no\n * layer's sound on, the base audio is kept untouched.\n *\n * `outputAspect` renders onto a 16:9 / 9:16 / 1:1 / 4:5 canvas (`baseFit`\n * cover by default; `backgroundColor` pads `contain`). `baseBox` places the\n * base itself in a layer's box vocabulary (needs `outputAspect`; `anchor`\n * and `width` are required, `x` and `y` default to 0 and `fit` to\n * contain); the canvas it leaves uncovered shows `backgroundColor`. `layout` writes the boxes:\n * `\"video-bottom\"` / `\"video-top\"` (the base whole, full width, against that\n * edge), `\"stack-whole\"` / `\"stack-filled\"` (the base above the first video\n * layer, both whole or each cropped to half the frame; no `baseBox`) and\n * `\"pip\"` (the first video layer 30 % wide in its `corner`, default\n * bottom-right). Every layout but `\"pip\"` needs `outputAspect`; the stacks\n * and `\"pip\"` need a video layer.\n *\n * A run with a video layer takes a base of up to 60 s and is priced per\n * started 5 s of it; an image-only run is one flat price. Poll\n * `jobs.get(jobId)`: the output carries `videoUrl`, `thumbnailUrl`,\n * `width`, `height`, `durationSec` and `warnings[]` (a layer clipped or\n * skipped at the video's end, an animated image's first frame, re-encoded\n * audio, a video layer with sound on but no audio track).\n */\n videoOverlay(input: VideoOverlayRequest): Promise<{ jobId: string }> {\n return this.client.request<{ jobId: string }>(\"POST\", \"/v1/video-overlay\", { body: input })\n }\n\n /**\n * Track a subject described in plain text through a video and get a\n * black-and-white MASK VIDEO back (`POST /v1/video-mask`, SAM 3.1 by default,\n * or `provider: \"sam-3\"` at half the price) — white = the subject. Clips up\n * to 5 minutes at 30 fps (a faster clip counts\n * proportionally longer), priced by the clip's length. Poll\n * `jobs.get(jobId)`: the output carries `videoUrl` (the mask), `width`,\n * `height`, `frames`, `coverage` (the fraction of pixels selected, rounded\n * to 4 decimals) and `kept` (any region left on any frame: false only when\n * the size / zone filters left an empty mask — read it rather than\n * `coverage`, which a few pixels round to 0), and `recipe` (the version of\n * the masking algorithm that made it, `VIDEO_MASK_RECIPE`: it changes\n * whenever the same clip and settings would give a different mask). Feed the mask to\n * {@link MediaResource.maskComposite}.\n *\n * `holdLastMask: true` keeps the last mask on frames where the subject is\n * lost (a mask covering under 0.002 % of the frame, e.g. a face behind a\n * hand): each such frame after the first detection repeats the most recent\n * non-empty one, for at most 1 s of frames (`VIDEO_MASK_LIMITS.HOLD_MAX_SEC`;\n * longer gaps stay empty after that); the output then also carries `heldFrames`.\n * `minSubjectHeightPct` (0–100, default 0 = off) drops every connected\n * region whose bounding box is shorter than that % of the frame height\n * (extras' small faces behind the main subject); it runs before\n * `holdLastMask`, and the output then carries `droppedRegions`.\n * `maxSubjectHeightPct` (0–100, default 0 = off) is its mirror: it drops\n * regions TALLER than that % (keep only the small background faces). With\n * both set a region is kept when min ≤ height ≤ max; min > max is a 400.\n * `zone` (`{ leftPct, rightPct, topPct, bottomPct }`, each 0–49 % of the\n * frame, a margin left out = 0; default null = off) keeps only the regions\n * whose bounding-box centre lies inside the frame minus those margins (after\n * the size cuts, before `holdLastMask`). `perShot: true` finds the clip's\n * scene cuts first and segments each shot on its own: the subject is\n * detected again after every cut, `holdLastMask` never crosses a cut, and\n * each shot's mask is fitted to that shot's exact frame count; on a clip\n * with no cut it gives the same mask, fitted to the clip's exact frame\n * count. The output carries `shots` (1 when off). `redetectEverySec` (0 =\n * off, the default, or 1–10) also detects the subject again every that\n * many seconds — the clip (each shot, with `perShot`) is sent to the model\n * in pieces of at most that length, a last piece under 8 frames joining the\n * one before — so someone who walks in or turns to the camera mid-shot is\n * masked from the next boundary on. These boundaries are not cuts:\n * `holdLastMask` holds across them. Each piece is one more model request\n * (three run at a time), so it is slower; the price does not change. The\n * output's `chunks` counts the requests.\n */\n videoMask(input: VideoMaskRequest): Promise<{ jobId: string }> {\n return this.client.request<{ jobId: string }>(\"POST\", \"/v1/video-mask\", { body: input })\n }\n\n /**\n * Place a foreground video over a background video through a mask video\n * (`POST /v1/mask-composite`; white = foreground) — local FFmpeg, no AI.\n * The result follows the foreground's size, frame rate and length; the\n * background is fitted (`backgroundFit`, default cover) and loops when\n * shorter; the mask holds its last frame when shorter. Optional\n * `invertMask`, `feather` (0–20 px), `grow` (−10–10 px), `opacity` (0–1,\n * default 1: how strongly the foreground covers the background inside the\n * mask) and `audioSource` (foreground / background / mix / none). Priced per started 5 seconds of\n * the result (the video it follows up to 300 s). Poll `jobs.get(jobId)` for `videoUrl`.\n *\n * `fill` picks what fills the masked area: `video` (default — the\n * foreground, required then), `pixelate` (the background itself in\n * blocks of `pixelSizePct` % of the frame width, 0.2–10, default 1.25) or\n * `blur` (the background blurred, sigma `blurStrengthPct` % of the frame\n * width, 0.1–5, default 2). Pixelate and blur take no\n * `foregroundUrl` (one sent is ignored): the result follows the background\n * and is priced on its length, and it always carries the background's sound\n * (`audioSource` is ignored).\n */\n maskComposite(input: MaskCompositeRequest): Promise<{ jobId: string }> {\n return this.client.request<{ jobId: string }>(\"POST\", \"/v1/mask-composite\", { body: input })\n }\n\n /**\n * Probe a social video's metadata (`POST /v1/video-metadata`) — duration,\n * dimensions, title, live status — WITHOUT downloading it. A direct read, not a\n * job. Use it to decide whether to trim before importing.\n */\n videoMetadata(input: { url: string }): Promise<VideoMetadata> {\n return this.client.request<VideoMetadata>(\"POST\", \"/v1/video-metadata\", { body: input })\n }\n\n /**\n * Cut or crop a stored file (`POST /v1/media/process`) — synchronous and\n * free, the source-preparation sibling of the priced `trimVideo` node.\n * `trim` is `[startTime, endTime]` in seconds; `deleteSource: true` removes\n * the source object afterwards when it is yours and nothing else references\n * it (\"the cut replaces the original\"). Answers the stored file. The\n * platform may take up to 300 s on a long file: pass `timeoutMs` to wait\n * longer than the client's default.\n */\n process(\n input: MediaProcessInput,\n options: { timeoutMs?: number; signal?: AbortSignal } = {},\n ): Promise<{ data: MediaProcessResult }> {\n return this.client.request<{ data: MediaProcessResult }>(\"POST\", \"/v1/media/process\", { body: input, ...options })\n }\n\n /**\n * Throw away a file you just made and no longer need (`POST /v1/media/discard`):\n * a link download replaced before use, a cut superseded by a newer one, a\n * picture imported then cancelled. Not a general delete. The file goes only\n * when it is your own, was made by a link download (`downloadVideo`), a cut\n * (`process`) or a URL import, is under 24 hours old, and no job of yours\n * uses it (as an output or as an input such as a run's `videoUrl`);\n * otherwise it is left untouched and the call fails with 409\n * `not_discardable`. `discarded: false` means there was nothing of yours at\n * that address (already gone, or not yours).\n */\n discard(input: { url: string }): Promise<{ data: MediaDiscardResult }> {\n return this.client.request<{ data: MediaDiscardResult }>(\"POST\", \"/v1/media/discard\", { body: input })\n }\n}\n\n/**\n * One event from {@link MediaResource.downloadVideoProgress}. The stream ends\n * after a `completed` event (which carries the stored `videoUrl` + an optional\n * `thumbnailUrl`) or a `failed` event (which carries `error`).\n */\nexport interface DownloadVideoProgress {\n phase: \"downloading\" | \"processing\" | \"uploading\" | \"completed\" | \"failed\"\n /** Download percent (0–100). Section fetches report jumpy percents — display, don't sum. */\n percent: number\n /** The imported video's storage URL — set on the `completed` event. */\n videoUrl?: string\n /** Thumbnail storage URL — set on the `completed` event when one was captured. */\n thumbnailUrl?: string\n /** What went wrong — set on the `failed` event. */\n error?: string\n}\n\n/** Result of {@link MediaResource.videoMetadata}. Fields are best-effort — a probe may omit some. */\nexport interface VideoMetadata {\n durationSec?: number | null\n width?: number | null\n height?: number | null\n title?: string | null\n isLive?: boolean\n [key: string]: unknown\n}\n\n/** Body of {@link MediaResource.splitMedia} (`POST /v1/split-media`): parts of a set length, or one part per shot of a video. */\nexport type SplitMediaInput = SplitMediaByDurationInput | SplitMediaByShotsInput\n\n/** {@link SplitMediaInput} cutting parts of at most `chunkDuration` seconds. At least one of `videoUrl` / `audioUrl`. */\nexport interface SplitMediaByDurationInput {\n /** Video to split. */\n videoUrl?: string\n /** Audio file to split (split on its own when a video is given too). */\n audioUrl?: string\n /** The default: parts of a set length. */\n mode?: \"duration\"\n /** The longest a part may be, in seconds (at least 1). Every part is at most this long. */\n chunkDuration: number\n /** The shortest a part may be, in seconds (0 or more, default 4). Must not exceed `chunkDuration` (400 otherwise). */\n minPartDuration?: number\n /** Format of the audio parts. Default `mp3`. */\n audioFormat?: \"mp3\" | \"wav\" | \"aac\"\n}\n\n/** {@link SplitMediaInput} cutting a video into one part per shot, at its measured cuts. */\nexport interface SplitMediaByShotsInput {\n /** The video to split (up to 30 minutes). A separate audio file is refused (each part keeps the video's own sound). */\n videoUrl: string\n mode: \"shots\"\n}\n\n/** One part's shot in a shots-mode split: its place on the video, seconds to the millisecond. */\nexport interface SplitMediaShot {\n index: number\n startSec: number\n endSec: number\n durationSec: number\n}\n\n/** A completed split-media job's `output_data`. */\nexport interface SplitMediaOutput {\n /** The video parts, in order (when a video was split). */\n videoUrls?: string[]\n /** The audio parts, in order (when an audio file was split). */\n audioUrls?: string[]\n /** The number of parts — the larger of the two lists. */\n chunkCount: number\n /** Each part's exact length in seconds: the video parts' when a video was split, else the audio parts'. */\n partDurationsSec?: number[]\n /** The audio parts' lengths, only when BOTH a video and an audio file were split. */\n audioPartDurationsSec?: number[]\n /** Shots mode: the number of shots (= parts). */\n shotCount?: number\n /** Shots mode: each part's shot, in part order. */\n shots?: SplitMediaShot[]\n}\n\n/** Body of {@link MediaResource.shotCuts} (`POST /v1/shot-cuts`). */\nexport interface ShotCutsInput {\n /** The video to measure: MP4, MOV, MKV or WebM, up to 30 minutes. */\n videoUrl: string\n /** Also save each shot's first and last frame as images (up to 1,000 shots). Default false. */\n frames?: boolean\n}\n\n/** One shot of a {@link ShotCutsResult}: seconds from the video's first frame, to the millisecond. */\nexport interface ShotCutsShot {\n index: number\n startSec: number\n /** Where the next shot starts, or the video's end. */\n endSec: number\n durationSec: number\n /** With `frames`: the shot's first decoded frame (PNG). */\n firstFrameUrl?: string\n /** With `frames`: its last decoded frame — the one before the next cut, or the video's last. */\n lastFrameUrl?: string\n}\n\n/** What a Shot Cuts run measured (`output_data.json`). */\nexport interface ShotCutsResult {\n shotCount: number\n /** Where each new shot starts: ascending, never 0; `[]` for a single shot. */\n cutsSec: number[]\n /** The video's length. */\n durationSec: number\n shots: ShotCutsShot[]\n}\n\n/** A completed shot-cuts job's `output_data`. */\nexport interface ShotCutsOutput {\n json: ShotCutsResult\n /** With `frames`: each shot's first frame, in shot order. */\n firstFrames?: string[]\n /** With `frames`: each shot's last frame, in shot order. */\n lastFrames?: string[]\n}\n\n/** A layer split's pixel budget per image: about one megapixel at `1K`; `auto` keeps the picture's own size (between 1K and 2K). */\nexport type SplitIntoLayersSize = \"1K\" | \"1.5K\" | \"2K\" | \"auto\"\n\n/** Per-call options of a media request that starts a job ({@link MediaResource.splitIntoLayers}). */\nexport interface MediaRunOptions extends RunNodeOptions {\n /** Abort the request. */\n readonly signal?: AbortSignal\n /** This request's timeout in ms, in place of the client's `timeoutMs`. */\n readonly timeoutMs?: number\n}\n\n/** A media job started: its id, and `deduped: true` when an `Idempotency-Key` retry found the job already started. */\nexport interface MediaJobStarted {\n jobId: string\n deduped?: true\n}\n\n/** Body of {@link MediaResource.splitIntoLayers} (`POST /v1/split-into-layers`), and of its quote (`nodes.quote(\"split-into-layers\", …)`). */\nexport interface SplitIntoLayersInput extends GenerationSessionParams {\n /** The picture to split (an http or https URL). */\n imageUrl: string\n /** \"Max layers\", 1–99 (default 9): more elements than this merge into fewer layers; none is dropped. */\n maxLayers?: number\n /** Default `1K`. `1K` and `1.5K` are priced alike, as are `2K` and `auto`. */\n size?: SplitIntoLayersSize\n /** What to separate (up to 2,000 characters): the elements to split out; `<bbox>x1 y1 x2 y2</bbox>` marks (0–1000) may be typed in it. Empty: the main elements are found automatically. */\n prompt?: string\n}\n\n/** A box on the base picture: `x1`/`y1` its top-left corner, `x2`/`y2` its bottom-right. */\nexport interface SplitLayerBox { x1: number; y1: number; x2: number; y2: number }\n\n/**\n * One layer of a {@link SplitIntoLayersOutput}. A layer is NOT in the base's\n * pixels: it is a transparent PNG cropped to its element, at about the size\n * setting's pixel budget and the element's own shape. To put it back in place,\n * scale it to its `box`.\n */\nexport interface SplitLayer {\n name?: string\n description?: string\n /** Stacking order: 1 sits on the base, higher is drawn above. */\n zIndex: number\n /** The layer file's own pixels (not the base's). */\n width?: number\n height?: number\n /** Where the layer sits on the base picture, in the base's pixels. */\n box?: SplitLayerBox\n /** The same box on a 0–1000 scale of the base's width and height. */\n boxNormalized?: SplitLayerBox\n /** The layer's stored file. */\n url: string\n /** The stored base picture this layer was cut from: the job's own `imageUrl`. */\n baseUrl?: string\n}\n\n/** A completed split-into-layers job's `output_data`. A run that finds no element returns the base only (`layers` empty). */\nexport interface SplitIntoLayersOutput {\n /** The base picture: an opaque PNG. */\n imageUrl: string\n /** Each layer's stored file, bottom to top. */\n layers: string[]\n /** One entry per layer, in the same order. */\n layerData: SplitLayer[]\n /** The number of layers saved. */\n layerCount: number\n /** Layers the model returned that could not be saved (each is tried a few times first); 0 when every layer was saved. The run is charged only for the images saved. */\n layersNotSaved?: number\n /** Each layer as it was filed in the Library, under its name. */\n libraryImages?: Array<{ url: string; name?: string }>\n}\n\nexport interface MediaProcessInput {\n sourceUrl: string\n type: \"video\" | \"audio\"\n trim?: { startTime: number; endTime: number }\n crop?: { x: number; y: number; width: number; height: number }\n format?: \"mp4\" | \"webm\" | \"mp3\" | \"wav\" | \"m4a\" | \"aac\"\n deleteSource?: boolean\n}\n\n/** Result of {@link MediaResource.discard}. */\nexport interface MediaDiscardResult {\n /** True when the file was deleted; false when there was nothing of yours at that address. */\n discarded: boolean\n}\n\nexport interface MediaProcessResult {\n url: string\n thumbnailUrl: string | null\n assetId: string | null\n sizeBytes: number\n mimeType: string\n metadata: Record<string, unknown>\n}\n"]}
@@ -207,6 +207,34 @@ var MediaResource = class {
207
207
  shotCuts(input) {
208
208
  return this.client.request("POST", "/v1/shot-cuts", { body: input });
209
209
  }
210
+ /**
211
+ * Split one image into a base picture and separate layers
212
+ * (`POST /v1/split-into-layers`): each element on its own transparent PNG,
213
+ * with its name, description, stacking order and the box it sits in on the
214
+ * base. `maxLayers` (1–99, default 9) caps the layers — more elements than
215
+ * that merge into fewer layers, none is dropped; `size` is each image's
216
+ * pixel budget (`1K` default, `auto` keeps the picture's own size between 1K
217
+ * and 2K); `prompt` names what to separate. A run holds the price of the
218
+ * most images it may return (`maxLayers` + 1, the base included) and is
219
+ * charged only for the images it returns: ask that price first with
220
+ * `client.nodes.quote("split-into-layers", input)` (nothing is started).
221
+ * Poll `jobs.get(jobId)`; the completed job's `output_data` is a
222
+ * {@link SplitIntoLayersOutput}. `sessionId` files the job in one of your
223
+ * sessions; `origin` tags it with your app's slug.
224
+ *
225
+ * With `options.idempotencyKey` (sent as the `Idempotency-Key` header, at
226
+ * least 8 characters) a retry of the same request answers the job it
227
+ * already started (`deduped: true`) instead of starting and charging a
228
+ * second one.
229
+ */
230
+ splitIntoLayers(input, options = {}) {
231
+ return this.client.request("POST", "/v1/split-into-layers", {
232
+ body: input,
233
+ ...options.idempotencyKey ? { headers: { "Idempotency-Key": options.idempotencyKey } } : {},
234
+ ...options.signal ? { signal: options.signal } : {},
235
+ ...options.timeoutMs !== void 0 ? { timeoutMs: options.timeoutMs } : {}
236
+ });
237
+ }
210
238
  /**
211
239
  * Turn one still image + one audio track into an MP4
212
240
  * (`POST /v1/still-to-video`) — locally rendered (FFmpeg), no AI model,
@@ -232,20 +260,42 @@ var MediaResource = class {
232
260
  return this.client.request("POST", "/v1/slideshow", { body: input });
233
261
  }
234
262
  /**
235
- * Place 1–20 timed image layers over a video (`POST /v1/video-overlay`) —
236
- * rendered locally (FFmpeg) in one pass, no AI; the base audio is kept
237
- * untouched. Each layer has an `imageUrl`, a `start` and an optional `end`
238
- * in seconds (no `end` = to the end of the video) and a placement: a
239
- * `preset` (`"card"`, `"corner-badge"` with a `corner`, `"full-frame"`) or
240
- * an explicit box in {@link MediaResource.imageOverlay}'s percent vocabulary
241
- * (`anchor`, `x`, `y`, `width`, `height`, `fit`) — an explicit box field
242
- * overrides the preset, and a layer with neither is a corner badge
243
- * (bottom-right, or the `corner` it names). `outputAspect` renders onto a
244
- * 16:9 / 9:16 / 1:1 / 4:5 canvas
245
- * (`baseFit` cover by default; `backgroundColor` pads `contain`). Poll
246
- * `jobs.get(jobId)`: the output carries `videoUrl`, `thumbnailUrl`, `width`,
247
- * `height`, `durationSec` and `warnings[]` (a layer clipped or skipped at the
248
- * video's end, an animated image's first frame, re-encoded audio).
263
+ * Place 1–20 timed image or video layers over a video
264
+ * (`POST /v1/video-overlay`) — rendered locally (FFmpeg) in one pass, no AI.
265
+ * Each layer has exactly one source, `imageUrl` or `videoUrl` (at most 2
266
+ * video layers), a `start` and an optional `end` in seconds (no `end` = to
267
+ * the end of the video) and a placement: a `preset` (`"card"`,
268
+ * `"corner-badge"` with a `corner`, `"full-frame"`) or an explicit box in
269
+ * {@link MediaResource.imageOverlay}'s percent vocabulary (`anchor`, `x`,
270
+ * `y`, `width`, `height`, `fit`) — an explicit box field overrides the
271
+ * preset, and a layer with neither is a corner badge (bottom-right, or the
272
+ * `corner` it names). `animate` (a short fade in and out) defaults on for an
273
+ * image and off for a video.
274
+ *
275
+ * A video layer plays from its first frame at its `start`, stops at its
276
+ * `end` (or the base's end) and holds its last frame if it runs out first.
277
+ * It is silent unless it has `sound: { volume }` (0–1): its audio is then
278
+ * mixed with the base's during its window, under a limiter, as AAC. With no
279
+ * layer's sound on, the base audio is kept untouched.
280
+ *
281
+ * `outputAspect` renders onto a 16:9 / 9:16 / 1:1 / 4:5 canvas (`baseFit`
282
+ * cover by default; `backgroundColor` pads `contain`). `baseBox` places the
283
+ * base itself in a layer's box vocabulary (needs `outputAspect`; `anchor`
284
+ * and `width` are required, `x` and `y` default to 0 and `fit` to
285
+ * contain); the canvas it leaves uncovered shows `backgroundColor`. `layout` writes the boxes:
286
+ * `"video-bottom"` / `"video-top"` (the base whole, full width, against that
287
+ * edge), `"stack-whole"` / `"stack-filled"` (the base above the first video
288
+ * layer, both whole or each cropped to half the frame; no `baseBox`) and
289
+ * `"pip"` (the first video layer 30 % wide in its `corner`, default
290
+ * bottom-right). Every layout but `"pip"` needs `outputAspect`; the stacks
291
+ * and `"pip"` need a video layer.
292
+ *
293
+ * A run with a video layer takes a base of up to 60 s and is priced per
294
+ * started 5 s of it; an image-only run is one flat price. Poll
295
+ * `jobs.get(jobId)`: the output carries `videoUrl`, `thumbnailUrl`,
296
+ * `width`, `height`, `durationSec` and `warnings[]` (a layer clipped or
297
+ * skipped at the video's end, an animated image's first frame, re-encoded
298
+ * audio, a video layer with sound on but no audio track).
249
299
  */
250
300
  videoOverlay(input) {
251
301
  return this.client.request("POST", "/v1/video-overlay", { body: input });
@@ -358,5 +408,5 @@ var MediaResource = class {
358
408
  };
359
409
 
360
410
  export { MediaResource };
361
- //# sourceMappingURL=chunk-FFT2YPB4.js.map
362
- //# sourceMappingURL=chunk-FFT2YPB4.js.map
411
+ //# sourceMappingURL=chunk-6SWRJJQE.js.map
412
+ //# sourceMappingURL=chunk-6SWRJJQE.js.map