@nodaro/sdk 2.44.0 → 2.46.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 (161) hide show
  1. package/dist/{chunk-ETX3TLNB.cjs → chunk-22P4X3N5.cjs} +16 -5
  2. package/dist/chunk-22P4X3N5.cjs.map +1 -0
  3. package/dist/{chunk-RETNLKOC.js → chunk-33HT46A3.js} +2 -2
  4. package/dist/{chunk-RETNLKOC.js.map → chunk-33HT46A3.js.map} +1 -1
  5. package/dist/{chunk-IGMWFEFB.js → chunk-5MOJSYHI.js} +2 -2
  6. package/dist/chunk-5MOJSYHI.js.map +1 -0
  7. package/dist/{chunk-DAGJLS7W.js → chunk-5Q4SUZPL.js} +3 -3
  8. package/dist/{chunk-DAGJLS7W.js.map → chunk-5Q4SUZPL.js.map} +1 -1
  9. package/dist/{chunk-55ZX6TE3.cjs → chunk-66M54BUO.cjs} +6 -6
  10. package/dist/chunk-66M54BUO.cjs.map +1 -0
  11. package/dist/chunk-6NTKEXT5.js +3 -0
  12. package/dist/chunk-6NTKEXT5.js.map +1 -0
  13. package/dist/{chunk-FQNCIP6K.js → chunk-7LODCIQK.js} +2 -2
  14. package/dist/chunk-7LODCIQK.js.map +1 -0
  15. package/dist/{chunk-34JMD6ZO.cjs → chunk-7LTVS75S.cjs} +36 -12
  16. package/dist/chunk-7LTVS75S.cjs.map +1 -0
  17. package/dist/{chunk-DQAYIVVS.js → chunk-BQAW4RX2.js} +16 -5
  18. package/dist/chunk-BQAW4RX2.js.map +1 -0
  19. package/dist/{chunk-HKDIIFG2.js → chunk-C3C7IL25.js} +6 -6
  20. package/dist/chunk-C3C7IL25.js.map +1 -0
  21. package/dist/{chunk-QHXLMCBR.cjs → chunk-DIF7A5OH.cjs} +2 -2
  22. package/dist/chunk-DIF7A5OH.cjs.map +1 -0
  23. package/dist/{chunk-PQ7OKM3E.cjs → chunk-FIMBPKIH.cjs} +2 -2
  24. package/dist/chunk-FIMBPKIH.cjs.map +1 -0
  25. package/dist/{chunk-ZWPDWFN2.js → chunk-GW76IRQD.js} +2 -2
  26. package/dist/chunk-GW76IRQD.js.map +1 -0
  27. package/dist/{chunk-YSZM3N7Q.js → chunk-HPXE3NZW.js} +2 -2
  28. package/dist/{chunk-YSZM3N7Q.js.map → chunk-HPXE3NZW.js.map} +1 -1
  29. package/dist/{chunk-OIYMTGYN.cjs → chunk-JOXZ4ZIF.cjs} +2 -2
  30. package/dist/chunk-JOXZ4ZIF.cjs.map +1 -0
  31. package/dist/chunk-KBHDUHKM.js +21 -0
  32. package/dist/chunk-KBHDUHKM.js.map +1 -0
  33. package/dist/{chunk-FHVNTS4E.cjs → chunk-KMNSPC72.cjs} +2 -2
  34. package/dist/{chunk-FHVNTS4E.cjs.map → chunk-KMNSPC72.cjs.map} +1 -1
  35. package/dist/{chunk-ILG5DHQQ.js → chunk-M7VSFZMV.js} +2 -2
  36. package/dist/chunk-M7VSFZMV.js.map +1 -0
  37. package/dist/{chunk-3ZZWCHF5.cjs → chunk-POKNFGGD.cjs} +33 -29
  38. package/dist/chunk-POKNFGGD.cjs.map +1 -0
  39. package/dist/{chunk-6MQ2LTJZ.js → chunk-PQHZUWSL.js} +36 -12
  40. package/dist/chunk-PQHZUWSL.js.map +1 -0
  41. package/dist/{chunk-Z7UZ3FD3.js → chunk-RBX3QTKB.js} +2 -2
  42. package/dist/{chunk-Z7UZ3FD3.js.map → chunk-RBX3QTKB.js.map} +1 -1
  43. package/dist/{chunk-7XOK277W.cjs → chunk-SF2CMKWA.cjs} +2 -2
  44. package/dist/{chunk-7XOK277W.cjs.map → chunk-SF2CMKWA.cjs.map} +1 -1
  45. package/dist/{chunk-2VJOHJUZ.cjs → chunk-TK2CEVSK.cjs} +2 -2
  46. package/dist/chunk-TK2CEVSK.cjs.map +1 -0
  47. package/dist/chunk-UANHMQ3A.cjs +4 -0
  48. package/dist/chunk-UANHMQ3A.cjs.map +1 -0
  49. package/dist/{chunk-EK672FFM.cjs → chunk-UIBYZNDR.cjs} +2 -2
  50. package/dist/chunk-UIBYZNDR.cjs.map +1 -0
  51. package/dist/{chunk-6PI3CI7P.js → chunk-WFAFFAGV.js} +20 -16
  52. package/dist/chunk-WFAFFAGV.js.map +1 -0
  53. package/dist/{chunk-PEMLIAPZ.cjs → chunk-WMT7HEBZ.cjs} +40 -7
  54. package/dist/chunk-WMT7HEBZ.cjs.map +1 -0
  55. package/dist/{chunk-Y6VDCZPB.js → chunk-WS4ZQ4AA.js} +40 -7
  56. package/dist/chunk-WS4ZQ4AA.js.map +1 -0
  57. package/dist/{chunk-VYEGCEZ3.cjs → chunk-WUM6CWTE.cjs} +2 -2
  58. package/dist/{chunk-VYEGCEZ3.cjs.map → chunk-WUM6CWTE.cjs.map} +1 -1
  59. package/dist/{chunk-4UPVE662.js → chunk-XILR6TFO.js} +2 -2
  60. package/dist/chunk-XILR6TFO.js.map +1 -0
  61. package/dist/chunk-XKDVEQVD.cjs +23 -0
  62. package/dist/chunk-XKDVEQVD.cjs.map +1 -0
  63. package/dist/{chunk-MPQQC45L.cjs → chunk-ZJCHIJND.cjs} +3 -3
  64. package/dist/{chunk-MPQQC45L.cjs.map → chunk-ZJCHIJND.cjs.map} +1 -1
  65. package/dist/entries/apps.cjs +2 -2
  66. package/dist/entries/apps.d.cts +1 -1
  67. package/dist/entries/apps.d.ts +1 -1
  68. package/dist/entries/apps.js +1 -1
  69. package/dist/entries/cast-swap.cjs +2 -2
  70. package/dist/entries/cast-swap.d.cts +117 -143
  71. package/dist/entries/cast-swap.d.ts +117 -143
  72. package/dist/entries/cast-swap.js +1 -1
  73. package/dist/entries/characters.d.cts +1 -1
  74. package/dist/entries/characters.d.ts +1 -1
  75. package/dist/entries/client.cjs +21 -20
  76. package/dist/entries/client.d.cts +4 -1
  77. package/dist/entries/client.d.ts +4 -1
  78. package/dist/entries/client.js +16 -15
  79. package/dist/entries/core.cjs +5 -5
  80. package/dist/entries/core.js +1 -1
  81. package/dist/entries/creatures.d.cts +1 -1
  82. package/dist/entries/creatures.d.ts +1 -1
  83. package/dist/entries/credits.cjs +2 -2
  84. package/dist/entries/credits.d.cts +2 -2
  85. package/dist/entries/credits.d.ts +2 -2
  86. package/dist/entries/credits.js +1 -1
  87. package/dist/entries/edit.cjs +6 -6
  88. package/dist/entries/edit.d.cts +1 -1
  89. package/dist/entries/edit.d.ts +1 -1
  90. package/dist/entries/edit.js +1 -1
  91. package/dist/entries/jobs.cjs +2 -2
  92. package/dist/entries/jobs.d.cts +57 -8
  93. package/dist/entries/jobs.d.ts +57 -8
  94. package/dist/entries/jobs.js +1 -1
  95. package/dist/entries/locations.d.cts +1 -1
  96. package/dist/entries/locations.d.ts +1 -1
  97. package/dist/entries/media.cjs +2 -2
  98. package/dist/entries/media.d.cts +14 -3
  99. package/dist/entries/media.d.ts +14 -3
  100. package/dist/entries/media.js +1 -1
  101. package/dist/entries/nodes.cjs +2 -2
  102. package/dist/entries/nodes.d.cts +1 -1
  103. package/dist/entries/nodes.d.ts +1 -1
  104. package/dist/entries/nodes.js +1 -1
  105. package/dist/entries/objects.d.cts +1 -1
  106. package/dist/entries/objects.d.ts +1 -1
  107. package/dist/entries/scene3d.d.cts +2 -2
  108. package/dist/entries/scene3d.d.ts +2 -2
  109. package/dist/entries/sessions.cjs +2 -2
  110. package/dist/entries/sessions.d.cts +58 -8
  111. package/dist/entries/sessions.d.ts +58 -8
  112. package/dist/entries/sessions.js +1 -1
  113. package/dist/entries/templates.cjs +2 -2
  114. package/dist/entries/templates.d.cts +1 -1
  115. package/dist/entries/templates.d.ts +1 -1
  116. package/dist/entries/templates.js +1 -1
  117. package/dist/entries/trash.cjs +13 -0
  118. package/dist/entries/trash.cjs.map +1 -0
  119. package/dist/entries/trash.d.cts +71 -0
  120. package/dist/entries/trash.d.ts +71 -0
  121. package/dist/entries/trash.js +4 -0
  122. package/dist/entries/trash.js.map +1 -0
  123. package/dist/entries/trends.cjs +2 -2
  124. package/dist/entries/trends.d.cts +86 -28
  125. package/dist/entries/trends.d.ts +86 -28
  126. package/dist/entries/trends.js +1 -1
  127. package/dist/entries/tutorials.cjs +2 -2
  128. package/dist/entries/tutorials.d.cts +1 -1
  129. package/dist/entries/tutorials.d.ts +1 -1
  130. package/dist/entries/tutorials.js +1 -1
  131. package/dist/entries/workflows.cjs +2 -2
  132. package/dist/entries/workflows.d.cts +11 -4
  133. package/dist/entries/workflows.d.ts +11 -4
  134. package/dist/entries/workflows.js +1 -1
  135. package/dist/index.cjs +48 -42
  136. package/dist/index.d.cts +6 -5
  137. package/dist/index.d.ts +6 -5
  138. package/dist/index.js +18 -16
  139. package/dist/{nodes-B4ZEqx2V.d.ts → nodes-C9j0PFto.d.ts} +12 -2
  140. package/dist/{nodes-DzBGNOUV.d.cts → nodes-DGIefTze.d.cts} +12 -2
  141. package/package.json +8 -3
  142. package/dist/chunk-2VJOHJUZ.cjs.map +0 -1
  143. package/dist/chunk-34JMD6ZO.cjs.map +0 -1
  144. package/dist/chunk-3ZZWCHF5.cjs.map +0 -1
  145. package/dist/chunk-4UPVE662.js.map +0 -1
  146. package/dist/chunk-55ZX6TE3.cjs.map +0 -1
  147. package/dist/chunk-6MQ2LTJZ.js.map +0 -1
  148. package/dist/chunk-6PI3CI7P.js.map +0 -1
  149. package/dist/chunk-DQAYIVVS.js.map +0 -1
  150. package/dist/chunk-EK672FFM.cjs.map +0 -1
  151. package/dist/chunk-ETX3TLNB.cjs.map +0 -1
  152. package/dist/chunk-FQNCIP6K.js.map +0 -1
  153. package/dist/chunk-HKDIIFG2.js.map +0 -1
  154. package/dist/chunk-IGMWFEFB.js.map +0 -1
  155. package/dist/chunk-ILG5DHQQ.js.map +0 -1
  156. package/dist/chunk-OIYMTGYN.cjs.map +0 -1
  157. package/dist/chunk-PEMLIAPZ.cjs.map +0 -1
  158. package/dist/chunk-PQ7OKM3E.cjs.map +0 -1
  159. package/dist/chunk-QHXLMCBR.cjs.map +0 -1
  160. package/dist/chunk-Y6VDCZPB.js.map +0 -1
  161. package/dist/chunk-ZWPDWFN2.js.map +0 -1
@@ -1,16 +1,17 @@
1
+ import { UploadsResource } from './chunk-WY4QRJZW.js';
1
2
  import { VideoProResource } from './chunk-ERLXU47J.js';
2
3
  import { VoicesResource } from './chunk-T7N7DFQJ.js';
3
4
  import { WebhooksResource } from './chunk-YN6CBIIB.js';
4
- import { WorkflowsResource } from './chunk-RETNLKOC.js';
5
+ import { WorkflowsResource } from './chunk-33HT46A3.js';
5
6
  import { WorkspacesResource } from './chunk-Z5GLY4R3.js';
6
7
  import { Scene3DResource } from './chunk-NNHWH7ER.js';
7
- import { SessionsResource } from './chunk-Y6VDCZPB.js';
8
+ import { SessionsResource } from './chunk-WS4ZQ4AA.js';
8
9
  import { ShotsResource } from './chunk-WVFAQBS7.js';
9
10
  import { StudioResource } from './chunk-AUKHMT53.js';
10
- import { TemplatesResource } from './chunk-ILG5DHQQ.js';
11
- import { TrendsResource } from './chunk-4UPVE662.js';
12
- import { TutorialsResource } from './chunk-YSZM3N7Q.js';
13
- import { UploadsResource } from './chunk-WY4QRJZW.js';
11
+ import { TemplatesResource } from './chunk-M7VSFZMV.js';
12
+ import { TrashResource } from './chunk-KBHDUHKM.js';
13
+ import { TrendsResource } from './chunk-XILR6TFO.js';
14
+ import { TutorialsResource } from './chunk-HPXE3NZW.js';
14
15
  import { PalettesResource } from './chunk-WEQWU2IC.js';
15
16
  import { PickerCatalogsResource } from './chunk-KFZOJBI5.js';
16
17
  import { PipelinesResource } from './chunk-K4RQOSJH.js';
@@ -19,18 +20,18 @@ import { PromptHelperResource } from './chunk-OIPPTBW4.js';
19
20
  import { RecastResource } from './chunk-AJVSMNPZ.js';
20
21
  import { ReduceResource } from './chunk-IHKIYVZQ.js';
21
22
  import { SavedPostsResource } from './chunk-NCCBS6GU.js';
22
- import { MediaResource } from './chunk-DQAYIVVS.js';
23
+ import { MediaResource } from './chunk-BQAW4RX2.js';
23
24
  import { ModelsResource } from './chunk-Y6V6CBY5.js';
24
25
  import { MoodboardsResource } from './chunk-YVU2M7MI.js';
25
26
  import { PresetsResource } from './chunk-JTAW54UM.js';
26
- import { NodesResource } from './chunk-ZWPDWFN2.js';
27
+ import { NodesResource } from './chunk-GW76IRQD.js';
27
28
  import { OAuthResource } from './chunk-Z7LGWNI7.js';
28
29
  import { ObjectsResource } from './chunk-7LSFG2AF.js';
29
30
  import { OrganizationsResource } from './chunk-ALSLZG3U.js';
30
- import { EditResource } from './chunk-Z7UZ3FD3.js';
31
+ import { EditResource } from './chunk-RBX3QTKB.js';
31
32
  import { ExecutionsResource } from './chunk-Z3ZKFI2M.js';
32
33
  import { GalleryResource } from './chunk-JDEZHITT.js';
33
- import { JobsResource } from './chunk-6MQ2LTJZ.js';
34
+ import { JobsResource } from './chunk-PQHZUWSL.js';
34
35
  import { LibraryResource } from './chunk-P6E4QDJN.js';
35
36
  import { LlmResource } from './chunk-E37CVHWW.js';
36
37
  import { LocationsResource } from './chunk-TVENC6PH.js';
@@ -38,14 +39,14 @@ import { CollectionsResource } from './chunk-4WRDR4GN.js';
38
39
  import { CommunityResource } from './chunk-SFB4YLCS.js';
39
40
  import { CompetitorsResource } from './chunk-BU5A6K4C.js';
40
41
  import { CopilotResource } from './chunk-D2ILCSOQ.js';
41
- import { NodaroClientCore } from './chunk-DAGJLS7W.js';
42
+ import { NodaroClientCore } from './chunk-5Q4SUZPL.js';
42
43
  import { CreaturesResource } from './chunk-CK3AMMSC.js';
43
- import { CreditsResource } from './chunk-IGMWFEFB.js';
44
+ import { CreditsResource } from './chunk-5MOJSYHI.js';
44
45
  import { DeveloperAppsResource } from './chunk-65E3JBFZ.js';
45
- import { AppsResource } from './chunk-FQNCIP6K.js';
46
+ import { AppsResource } from './chunk-7LODCIQK.js';
46
47
  import { AudioResource } from './chunk-3QFTP5P5.js';
47
48
  import { BillingResource } from './chunk-J4WFSKY6.js';
48
- import { CastSwapResource } from './chunk-HKDIIFG2.js';
49
+ import { CastSwapResource } from './chunk-C3C7IL25.js';
49
50
  import { CatalogsResource } from './chunk-KG4R454Z.js';
50
51
  import { CharactersResource } from './chunk-EJSGJDZY.js';
51
52
 
@@ -55,6 +56,8 @@ var NodaroClient = class _NodaroClient extends NodaroClientCore {
55
56
  projects;
56
57
  /** Generation sessions inside projects (Create Image / Video / Music). */
57
58
  sessions;
59
+ /** Your Trash: items removed from sessions and deleted jobs. */
60
+ trash;
58
61
  jobs;
59
62
  videoPro;
60
63
  executions;
@@ -113,6 +116,7 @@ var NodaroClient = class _NodaroClient extends NodaroClientCore {
113
116
  this.workflows = new WorkflowsResource(this);
114
117
  this.projects = new ProjectsResource(this);
115
118
  this.sessions = new SessionsResource(this);
119
+ this.trash = new TrashResource(this);
116
120
  this.jobs = new JobsResource(this);
117
121
  this.videoPro = new VideoProResource(this);
118
122
  this.executions = new ExecutionsResource(this);
@@ -188,5 +192,5 @@ function createClient(opts) {
188
192
  }
189
193
 
190
194
  export { NodaroClient, createClient };
191
- //# sourceMappingURL=chunk-6PI3CI7P.js.map
192
- //# sourceMappingURL=chunk-6PI3CI7P.js.map
195
+ //# sourceMappingURL=chunk-WFAFFAGV.js.map
196
+ //# sourceMappingURL=chunk-WFAFFAGV.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/client.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2DO,IAAM,YAAA,GAAN,MAAM,aAAA,SAAqB,gBAAA,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,EACA,SAAA;AA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,IAAI,CAAA;AAC3C,IAAA,IAAA,CAAK,SAAA,GAAY,IAAI,iBAAA,CAAkB,IAAI,CAAA;AAC3C,IAAA,IAAA,CAAK,SAAA,GAAY,IAAI,iBAAA,CAAkB,IAAI,CAAA;AAC3C,IAAA,IAAA,CAAK,aAAA,GAAgB,IAAI,qBAAA,CAAsB,IAAI,CAAA;AACnD,IAAA,IAAA,CAAK,UAAA,GAAa,IAAI,kBAAA,CAAmB,IAAI,CAAA;AAC7C,IAAA,IAAA,CAAK,IAAA,GAAO,IAAI,YAAA,CAAa,IAAI,CAAA;AAAA,EACnC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaA,cAAc,WAAA,EAA0C;AAMtD,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-WFAFFAGV.js","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 { 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 { AudioResource } from \"./resources/audio.js\"\nimport { CreditsResource } from \"./resources/credits.js\"\nimport { BillingResource } from \"./resources/billing.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 { 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 readonly pipelines: PipelinesResource\n readonly reduce: ReduceResource\n readonly promptHelper: PromptHelperResource\n readonly voices: VoicesResource\n readonly llm: LlmResource\n readonly media: MediaResource\n readonly audio: AudioResource\n readonly credits: CreditsResource\n /** Plans and prices, the subscription, and how this deployment bills. */\n readonly billing: BillingResource\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 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.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.audio = new AudioResource(this)\n this.credits = new CreditsResource(this)\n this.billing = new BillingResource(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.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"]}
@@ -35,9 +35,15 @@ var SessionsResource = class {
35
35
  delete(id) {
36
36
  return this.client.request("DELETE", `/v1/sessions/${encodeURIComponent(id)}`);
37
37
  }
38
- /** The session's items, born-in and imported, newest first. */
38
+ /**
39
+ * The session's live items, born-in and imported, newest first — or, with
40
+ * `{ removed: true }`, the items removed from it (its part of the Trash),
41
+ * newest removal first. An item whose job was deleted is in neither: it is in
42
+ * `client.trash.list()` as the deleted job.
43
+ */
39
44
  items(id, params = {}) {
40
45
  const query = {};
46
+ if (params.removed) query.removed = "true";
41
47
  if (params.limit !== void 0) query.limit = String(params.limit);
42
48
  if (params.cursor) query.cursor = params.cursor;
43
49
  return this.client.request("GET", `/v1/sessions/${encodeURIComponent(id)}/items`, { query });
@@ -45,20 +51,47 @@ var SessionsResource = class {
45
51
  /**
46
52
  * Import some of your own jobs into a session — a link, not a copy (up to 100
47
53
  * a call). All-or-nothing: if any id is not one of your jobs, nothing is
48
- * imported and the call fails with 404. Items already there are left as they are.
54
+ * imported and the call fails with 404. Items already there are left as they
55
+ * are; an item removed from the session comes back where it was.
49
56
  */
50
57
  importItems(id, input) {
51
58
  return this.client.request("POST", `/v1/sessions/${encodeURIComponent(id)}/items`, { body: input });
52
59
  }
53
- /** Remove one item from a session. Only the link goes: the job, and every other session holding it, stay. */
54
- removeItem(id, jobId) {
60
+ /**
61
+ * Remove one item from a session: it goes to the session's Trash until
62
+ * {@link restoreItem} brings it back or `{ forever: true }` deletes it for good
63
+ * — no automatic cleanup. Only the link moves: the job, and every other
64
+ * session holding it, stay; an item in no session shows in General
65
+ * (`client.jobs.list({ inSession: false })`). `forever` on an item that is
66
+ * not removed fails with a 409 `NodaroError` whose `code` is `"not_in_trash"`.
67
+ */
68
+ removeItem(id, jobId, options = {}) {
55
69
  return this.client.request(
56
70
  "DELETE",
57
- `/v1/sessions/${encodeURIComponent(id)}/items/${encodeURIComponent(jobId)}`
71
+ `/v1/sessions/${encodeURIComponent(id)}/items/${encodeURIComponent(jobId)}`,
72
+ options.forever ? { query: { forever: "true" } } : {}
73
+ );
74
+ }
75
+ /** Bring a removed item back into the session, where it was. An item that is not removed succeeds too. */
76
+ restoreItem(id, jobId) {
77
+ return this.client.request(
78
+ "POST",
79
+ `/v1/sessions/${encodeURIComponent(id)}/items/${encodeURIComponent(jobId)}/restore`
58
80
  );
59
81
  }
82
+ /**
83
+ * Move items of another of your sessions into `targetId`, in one
84
+ * transaction: the target gets them (born-in stays born-in, else imported
85
+ * from the source), the source keeps them as removed items — so the move is
86
+ * undone with `restoreItem(fromSessionId, jobId)`. A session in another
87
+ * project is how an item moves to another project. All-or-nothing: if any id
88
+ * is not a live item of `fromSessionId`, nothing moves (404).
89
+ */
90
+ moveItems(targetId, input) {
91
+ return this.client.request("POST", `/v1/sessions/${encodeURIComponent(targetId)}/items/move`, { body: input });
92
+ }
60
93
  };
61
94
 
62
95
  exports.SessionsResource = SessionsResource;
63
- //# sourceMappingURL=chunk-PEMLIAPZ.cjs.map
64
- //# sourceMappingURL=chunk-PEMLIAPZ.cjs.map
96
+ //# sourceMappingURL=chunk-WMT7HEBZ.cjs.map
97
+ //# sourceMappingURL=chunk-WMT7HEBZ.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/resources/sessions.ts"],"names":[],"mappings":";;;AAiGO,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;AAAA,EAOpB,OAAO,KAAA,EAAiE;AACtE,IAAA,OAAO,IAAA,CAAK,OAAO,OAAA,CAAQ,MAAA,EAAQ,gBAAgB,EAAE,IAAA,EAAM,OAAO,CAAA;AAAA,EACpE;AAAA;AAAA,EAGA,IAAA,CAAK,MAAA,GAA6B,EAAC,EAA4C;AAC7E,IAAA,MAAM,QAAgC,EAAC;AACvC,IAAA,IAAI,MAAA,CAAO,SAAA,EAAW,KAAA,CAAM,SAAA,GAAY,MAAA,CAAO,SAAA;AAC/C,IAAA,IAAI,MAAA,CAAO,IAAA,EAAM,KAAA,CAAM,IAAA,GAAO,MAAA,CAAO,IAAA;AACrC,IAAA,IAAI,MAAA,CAAO,eAAA,EAAiB,KAAA,CAAM,eAAA,GAAkB,MAAA;AACpD,IAAA,IAAI,OAAO,KAAA,KAAU,MAAA,QAAiB,KAAA,GAAQ,MAAA,CAAO,OAAO,KAAK,CAAA;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A;AAAA,EAC/G;AACF","file":"chunk-WMT7HEBZ.cjs","sourcesContent":["import type { NodaroClientCore } from \"../core.js\"\nimport type { Job } from \"./jobs.js\"\n\n/**\n * A generation session: one run of work in a creation tool (Create Image,\n * Video, Music), optionally inside a project. Its project is fixed at\n * creation — to get an item into another project, move it into a session\n * there ({@link SessionsResource.moveItems}) or import a copy of the link.\n */\nexport interface GenerationSession {\n id: string\n /** Null when the session has no project, or its project was deleted. */\n projectId: string | null\n /** Null = untitled; a UI may fall back to the first prompt. */\n title: string | null\n /** The creation tool that owns the session, e.g. `\"create-image\"`. */\n tool: string\n createdAt: string\n /** The latest activity: an item added, or an edit. */\n updatedAt: string\n archivedAt: string | null\n /** The item picked as the session's cover (`update(id, { coverJobId })`); `null` = automatic. */\n coverJobId: string | null\n /** Live items: not removed, and their job not deleted. */\n itemCount: number\n /** Items removed from the session — its part of the Trash\n * (`items(id, { removed: true })`, `client.trash.list()`). Absent from an\n * older server. */\n removedCount?: number\n /** Up to four image links: the cover's image first when one is set, then the\n * newest completed items. */\n previewUrls: string[]\n}\n\nexport interface CreateSessionInput {\n /** One of your projects (on the side of the workspace line you are on). */\n projectId?: string\n title?: string\n /** Lowercase letters, digits and dashes, at most 40 — e.g. `\"create-image\"`. */\n tool: string\n}\n\nexport interface UpdateSessionInput {\n /** `null` makes the session untitled again. */\n title?: string | null\n archived?: boolean\n /** One of the session's items to lead its previews (404 if it is not an\n * item of this session); `null` goes back to automatic. */\n coverJobId?: string | null\n}\n\nexport interface ListSessionsParams {\n /** A project's id, or `\"none\"` for the sessions with no project. */\n projectId?: string | \"none\"\n tool?: string\n /** Archived sessions are left out unless this is true. */\n includeArchived?: boolean\n /** Page size, 1–100 (server default 50). */\n limit?: number\n /** The previous page's `next`. */\n cursor?: string\n}\n\n/** One item of a session's feed: a link to one of your jobs. */\nexport interface SessionItem {\n jobId: string\n addedAt: string\n /** When the item was removed from the session (it is in the Trash); `null`\n * for a live item. Absent from an older server. */\n removedAt?: string | null\n /** True when imported from elsewhere rather than born in this session. */\n imported: boolean\n importedFrom: { sessionId: string; title: string | null } | null\n job: Job\n}\n\nexport interface ListSessionItemsParams {\n /** `true`: the items removed from the session (its Trash), newest removal first. */\n removed?: boolean\n limit?: number\n cursor?: string\n}\n\n/** {@link SessionsResource.moveItems}' body. */\nexport interface MoveSessionItemsInput {\n /** Items of `fromSessionId` to move, up to 100. */\n jobIds: string[]\n /** The session they are in now. It keeps them as removed items, so the move can be undone from its Trash. */\n fromSessionId: string\n}\n\nexport interface SessionPage<T> {\n data: T[]\n /** Pass back as `cursor` for the next page; `null` on the last one. */\n next: string | null\n}\n\nexport class SessionsResource {\n constructor(private client: NodaroClientCore) {}\n\n /**\n * Create a session. Send its `id` as `sessionId` on a generation request\n * (`nodes.run(\"generate-image\", { sessionId, … })`, video, speech, music) and\n * the job is born in it.\n */\n create(input: CreateSessionInput): Promise<{ data: GenerationSession }> {\n return this.client.request(\"POST\", \"/v1/sessions\", { body: input })\n }\n\n /** Your sessions, newest first. */\n list(params: ListSessionsParams = {}): Promise<SessionPage<GenerationSession>> {\n const query: Record<string, string> = {}\n if (params.projectId) query.projectId = params.projectId\n if (params.tool) query.tool = params.tool\n if (params.includeArchived) query.includeArchived = \"true\"\n if (params.limit !== undefined) query.limit = String(params.limit)\n if (params.cursor) query.cursor = params.cursor\n return this.client.request(\"GET\", \"/v1/sessions\", { query })\n }\n\n get(id: string): Promise<{ data: GenerationSession }> {\n return this.client.request(\"GET\", `/v1/sessions/${encodeURIComponent(id)}`)\n }\n\n /** Rename or archive a session, or pick its cover. Its project cannot change. */\n update(id: string, input: UpdateSessionInput): Promise<{ data: GenerationSession }> {\n return this.client.request(\"PATCH\", `/v1/sessions/${encodeURIComponent(id)}`, { body: input })\n }\n\n /** Delete a session and its links. Its jobs are kept, and stay in every other session holding them. */\n delete(id: string): Promise<{ success: true }> {\n return this.client.request(\"DELETE\", `/v1/sessions/${encodeURIComponent(id)}`)\n }\n\n /**\n * The session's live items, born-in and imported, newest first — or, with\n * `{ removed: true }`, the items removed from it (its part of the Trash),\n * newest removal first. An item whose job was deleted is in neither: it is in\n * `client.trash.list()` as the deleted job.\n */\n items(id: string, params: ListSessionItemsParams = {}): Promise<SessionPage<SessionItem>> {\n const query: Record<string, string> = {}\n if (params.removed) query.removed = \"true\"\n if (params.limit !== undefined) query.limit = String(params.limit)\n if (params.cursor) query.cursor = params.cursor\n return this.client.request(\"GET\", `/v1/sessions/${encodeURIComponent(id)}/items`, { query })\n }\n\n /**\n * Import some of your own jobs into a session — a link, not a copy (up to 100\n * a call). All-or-nothing: if any id is not one of your jobs, nothing is\n * imported and the call fails with 404. Items already there are left as they\n * are; an item removed from the session comes back where it was.\n */\n importItems(id: string, input: { jobIds: string[] }): Promise<{ data: { imported: number; requested: number } }> {\n return this.client.request(\"POST\", `/v1/sessions/${encodeURIComponent(id)}/items`, { body: input })\n }\n\n /**\n * Remove one item from a session: it goes to the session's Trash until\n * {@link restoreItem} brings it back or `{ forever: true }` deletes it for good\n * — no automatic cleanup. Only the link moves: the job, and every other\n * session holding it, stay; an item in no session shows in General\n * (`client.jobs.list({ inSession: false })`). `forever` on an item that is\n * not removed fails with a 409 `NodaroError` whose `code` is `\"not_in_trash\"`.\n */\n removeItem(id: string, jobId: string, options: { forever?: boolean } = {}): Promise<{ success: true }> {\n return this.client.request(\n \"DELETE\",\n `/v1/sessions/${encodeURIComponent(id)}/items/${encodeURIComponent(jobId)}`,\n options.forever ? { query: { forever: \"true\" } } : {},\n )\n }\n\n /** Bring a removed item back into the session, where it was. An item that is not removed succeeds too. */\n restoreItem(id: string, jobId: string): Promise<{ success: true }> {\n return this.client.request(\n \"POST\",\n `/v1/sessions/${encodeURIComponent(id)}/items/${encodeURIComponent(jobId)}/restore`,\n )\n }\n\n /**\n * Move items of another of your sessions into `targetId`, in one\n * transaction: the target gets them (born-in stays born-in, else imported\n * from the source), the source keeps them as removed items — so the move is\n * undone with `restoreItem(fromSessionId, jobId)`. A session in another\n * project is how an item moves to another project. All-or-nothing: if any id\n * is not a live item of `fromSessionId`, nothing moves (404).\n */\n moveItems(targetId: string, input: MoveSessionItemsInput): Promise<{ data: { moved: number } }> {\n return this.client.request(\"POST\", `/v1/sessions/${encodeURIComponent(targetId)}/items/move`, { body: input })\n }\n}\n"]}
@@ -33,9 +33,15 @@ var SessionsResource = class {
33
33
  delete(id) {
34
34
  return this.client.request("DELETE", `/v1/sessions/${encodeURIComponent(id)}`);
35
35
  }
36
- /** The session's items, born-in and imported, newest first. */
36
+ /**
37
+ * The session's live items, born-in and imported, newest first — or, with
38
+ * `{ removed: true }`, the items removed from it (its part of the Trash),
39
+ * newest removal first. An item whose job was deleted is in neither: it is in
40
+ * `client.trash.list()` as the deleted job.
41
+ */
37
42
  items(id, params = {}) {
38
43
  const query = {};
44
+ if (params.removed) query.removed = "true";
39
45
  if (params.limit !== void 0) query.limit = String(params.limit);
40
46
  if (params.cursor) query.cursor = params.cursor;
41
47
  return this.client.request("GET", `/v1/sessions/${encodeURIComponent(id)}/items`, { query });
@@ -43,20 +49,47 @@ var SessionsResource = class {
43
49
  /**
44
50
  * Import some of your own jobs into a session — a link, not a copy (up to 100
45
51
  * a call). All-or-nothing: if any id is not one of your jobs, nothing is
46
- * imported and the call fails with 404. Items already there are left as they are.
52
+ * imported and the call fails with 404. Items already there are left as they
53
+ * are; an item removed from the session comes back where it was.
47
54
  */
48
55
  importItems(id, input) {
49
56
  return this.client.request("POST", `/v1/sessions/${encodeURIComponent(id)}/items`, { body: input });
50
57
  }
51
- /** Remove one item from a session. Only the link goes: the job, and every other session holding it, stay. */
52
- removeItem(id, jobId) {
58
+ /**
59
+ * Remove one item from a session: it goes to the session's Trash until
60
+ * {@link restoreItem} brings it back or `{ forever: true }` deletes it for good
61
+ * — no automatic cleanup. Only the link moves: the job, and every other
62
+ * session holding it, stay; an item in no session shows in General
63
+ * (`client.jobs.list({ inSession: false })`). `forever` on an item that is
64
+ * not removed fails with a 409 `NodaroError` whose `code` is `"not_in_trash"`.
65
+ */
66
+ removeItem(id, jobId, options = {}) {
53
67
  return this.client.request(
54
68
  "DELETE",
55
- `/v1/sessions/${encodeURIComponent(id)}/items/${encodeURIComponent(jobId)}`
69
+ `/v1/sessions/${encodeURIComponent(id)}/items/${encodeURIComponent(jobId)}`,
70
+ options.forever ? { query: { forever: "true" } } : {}
71
+ );
72
+ }
73
+ /** Bring a removed item back into the session, where it was. An item that is not removed succeeds too. */
74
+ restoreItem(id, jobId) {
75
+ return this.client.request(
76
+ "POST",
77
+ `/v1/sessions/${encodeURIComponent(id)}/items/${encodeURIComponent(jobId)}/restore`
56
78
  );
57
79
  }
80
+ /**
81
+ * Move items of another of your sessions into `targetId`, in one
82
+ * transaction: the target gets them (born-in stays born-in, else imported
83
+ * from the source), the source keeps them as removed items — so the move is
84
+ * undone with `restoreItem(fromSessionId, jobId)`. A session in another
85
+ * project is how an item moves to another project. All-or-nothing: if any id
86
+ * is not a live item of `fromSessionId`, nothing moves (404).
87
+ */
88
+ moveItems(targetId, input) {
89
+ return this.client.request("POST", `/v1/sessions/${encodeURIComponent(targetId)}/items/move`, { body: input });
90
+ }
58
91
  };
59
92
 
60
93
  export { SessionsResource };
61
- //# sourceMappingURL=chunk-Y6VDCZPB.js.map
62
- //# sourceMappingURL=chunk-Y6VDCZPB.js.map
94
+ //# sourceMappingURL=chunk-WS4ZQ4AA.js.map
95
+ //# sourceMappingURL=chunk-WS4ZQ4AA.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/resources/sessions.ts"],"names":[],"mappings":";AAiGO,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;AAAA,EAOpB,OAAO,KAAA,EAAiE;AACtE,IAAA,OAAO,IAAA,CAAK,OAAO,OAAA,CAAQ,MAAA,EAAQ,gBAAgB,EAA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AA,EAA2C;AACjE,IAAA,OAAO,KAAK,MAAA,CAAO,OAAA;AAAA,MACjB,MAAA;AAAA,MACA,gBAAgB,kBAAA,CAAmB,EAAE,CAAC,CAAA,OAAA,EAAU,kBAAA,CAAmB,KAAK,CAAC,CAAA,QAAA;AAAA,KAC3E;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,SAAA,CAAU,UAAkB,KAAA,EAAoE;AAC9F,IAAA,OAAO,IAAA,CAAK,MAAA,CAAO,OAAA,CAAQ,MAAA,EAAQ,CAAA,aAAA,EAAgB,kBAAA,CAAmB,QAAQ,CAAC,CAAA,WAAA,CAAA,EAAe,EAAE,IAAA,EAAM,KAAA,EAAO,CAAA;AAAA,EAC/G;AACF","file":"chunk-WS4ZQ4AA.js","sourcesContent":["import type { NodaroClientCore } from \"../core.js\"\nimport type { Job } from \"./jobs.js\"\n\n/**\n * A generation session: one run of work in a creation tool (Create Image,\n * Video, Music), optionally inside a project. Its project is fixed at\n * creation — to get an item into another project, move it into a session\n * there ({@link SessionsResource.moveItems}) or import a copy of the link.\n */\nexport interface GenerationSession {\n id: string\n /** Null when the session has no project, or its project was deleted. */\n projectId: string | null\n /** Null = untitled; a UI may fall back to the first prompt. */\n title: string | null\n /** The creation tool that owns the session, e.g. `\"create-image\"`. */\n tool: string\n createdAt: string\n /** The latest activity: an item added, or an edit. */\n updatedAt: string\n archivedAt: string | null\n /** The item picked as the session's cover (`update(id, { coverJobId })`); `null` = automatic. */\n coverJobId: string | null\n /** Live items: not removed, and their job not deleted. */\n itemCount: number\n /** Items removed from the session — its part of the Trash\n * (`items(id, { removed: true })`, `client.trash.list()`). Absent from an\n * older server. */\n removedCount?: number\n /** Up to four image links: the cover's image first when one is set, then the\n * newest completed items. */\n previewUrls: string[]\n}\n\nexport interface CreateSessionInput {\n /** One of your projects (on the side of the workspace line you are on). */\n projectId?: string\n title?: string\n /** Lowercase letters, digits and dashes, at most 40 — e.g. `\"create-image\"`. */\n tool: string\n}\n\nexport interface UpdateSessionInput {\n /** `null` makes the session untitled again. */\n title?: string | null\n archived?: boolean\n /** One of the session's items to lead its previews (404 if it is not an\n * item of this session); `null` goes back to automatic. */\n coverJobId?: string | null\n}\n\nexport interface ListSessionsParams {\n /** A project's id, or `\"none\"` for the sessions with no project. */\n projectId?: string | \"none\"\n tool?: string\n /** Archived sessions are left out unless this is true. */\n includeArchived?: boolean\n /** Page size, 1–100 (server default 50). */\n limit?: number\n /** The previous page's `next`. */\n cursor?: string\n}\n\n/** One item of a session's feed: a link to one of your jobs. */\nexport interface SessionItem {\n jobId: string\n addedAt: string\n /** When the item was removed from the session (it is in the Trash); `null`\n * for a live item. Absent from an older server. */\n removedAt?: string | null\n /** True when imported from elsewhere rather than born in this session. */\n imported: boolean\n importedFrom: { sessionId: string; title: string | null } | null\n job: Job\n}\n\nexport interface ListSessionItemsParams {\n /** `true`: the items removed from the session (its Trash), newest removal first. */\n removed?: boolean\n limit?: number\n cursor?: string\n}\n\n/** {@link SessionsResource.moveItems}' body. */\nexport interface MoveSessionItemsInput {\n /** Items of `fromSessionId` to move, up to 100. */\n jobIds: string[]\n /** The session they are in now. It keeps them as removed items, so the move can be undone from its Trash. */\n fromSessionId: string\n}\n\nexport interface SessionPage<T> {\n data: T[]\n /** Pass back as `cursor` for the next page; `null` on the last one. */\n next: string | null\n}\n\nexport class SessionsResource {\n constructor(private client: NodaroClientCore) {}\n\n /**\n * Create a session. Send its `id` as `sessionId` on a generation request\n * (`nodes.run(\"generate-image\", { sessionId, … })`, video, speech, music) and\n * the job is born in it.\n */\n create(input: CreateSessionInput): Promise<{ data: GenerationSession }> {\n return this.client.request(\"POST\", \"/v1/sessions\", { body: input })\n }\n\n /** Your sessions, newest first. */\n list(params: ListSessionsParams = {}): Promise<SessionPage<GenerationSession>> {\n const query: Record<string, string> = {}\n if (params.projectId) query.projectId = params.projectId\n if (params.tool) query.tool = params.tool\n if (params.includeArchived) query.includeArchived = \"true\"\n if (params.limit !== undefined) query.limit = String(params.limit)\n if (params.cursor) query.cursor = params.cursor\n return this.client.request(\"GET\", \"/v1/sessions\", { query })\n }\n\n get(id: string): Promise<{ data: GenerationSession }> {\n return this.client.request(\"GET\", `/v1/sessions/${encodeURIComponent(id)}`)\n }\n\n /** Rename or archive a session, or pick its cover. Its project cannot change. */\n update(id: string, input: UpdateSessionInput): Promise<{ data: GenerationSession }> {\n return this.client.request(\"PATCH\", `/v1/sessions/${encodeURIComponent(id)}`, { body: input })\n }\n\n /** Delete a session and its links. Its jobs are kept, and stay in every other session holding them. */\n delete(id: string): Promise<{ success: true }> {\n return this.client.request(\"DELETE\", `/v1/sessions/${encodeURIComponent(id)}`)\n }\n\n /**\n * The session's live items, born-in and imported, newest first — or, with\n * `{ removed: true }`, the items removed from it (its part of the Trash),\n * newest removal first. An item whose job was deleted is in neither: it is in\n * `client.trash.list()` as the deleted job.\n */\n items(id: string, params: ListSessionItemsParams = {}): Promise<SessionPage<SessionItem>> {\n const query: Record<string, string> = {}\n if (params.removed) query.removed = \"true\"\n if (params.limit !== undefined) query.limit = String(params.limit)\n if (params.cursor) query.cursor = params.cursor\n return this.client.request(\"GET\", `/v1/sessions/${encodeURIComponent(id)}/items`, { query })\n }\n\n /**\n * Import some of your own jobs into a session — a link, not a copy (up to 100\n * a call). All-or-nothing: if any id is not one of your jobs, nothing is\n * imported and the call fails with 404. Items already there are left as they\n * are; an item removed from the session comes back where it was.\n */\n importItems(id: string, input: { jobIds: string[] }): Promise<{ data: { imported: number; requested: number } }> {\n return this.client.request(\"POST\", `/v1/sessions/${encodeURIComponent(id)}/items`, { body: input })\n }\n\n /**\n * Remove one item from a session: it goes to the session's Trash until\n * {@link restoreItem} brings it back or `{ forever: true }` deletes it for good\n * — no automatic cleanup. Only the link moves: the job, and every other\n * session holding it, stay; an item in no session shows in General\n * (`client.jobs.list({ inSession: false })`). `forever` on an item that is\n * not removed fails with a 409 `NodaroError` whose `code` is `\"not_in_trash\"`.\n */\n removeItem(id: string, jobId: string, options: { forever?: boolean } = {}): Promise<{ success: true }> {\n return this.client.request(\n \"DELETE\",\n `/v1/sessions/${encodeURIComponent(id)}/items/${encodeURIComponent(jobId)}`,\n options.forever ? { query: { forever: \"true\" } } : {},\n )\n }\n\n /** Bring a removed item back into the session, where it was. An item that is not removed succeeds too. */\n restoreItem(id: string, jobId: string): Promise<{ success: true }> {\n return this.client.request(\n \"POST\",\n `/v1/sessions/${encodeURIComponent(id)}/items/${encodeURIComponent(jobId)}/restore`,\n )\n }\n\n /**\n * Move items of another of your sessions into `targetId`, in one\n * transaction: the target gets them (born-in stays born-in, else imported\n * from the source), the source keeps them as removed items — so the move is\n * undone with `restoreItem(fromSessionId, jobId)`. A session in another\n * project is how an item moves to another project. All-or-nothing: if any id\n * is not a live item of `fromSessionId`, nothing moves (404).\n */\n moveItems(targetId: string, input: MoveSessionItemsInput): Promise<{ data: { moved: number } }> {\n return this.client.request(\"POST\", `/v1/sessions/${encodeURIComponent(targetId)}/items/move`, { body: input })\n }\n}\n"]}
@@ -209,5 +209,5 @@ var WorkflowsResource = class {
209
209
  };
210
210
 
211
211
  exports.WorkflowsResource = WorkflowsResource;
212
- //# sourceMappingURL=chunk-VYEGCEZ3.cjs.map
213
- //# sourceMappingURL=chunk-VYEGCEZ3.cjs.map
212
+ //# sourceMappingURL=chunk-WUM6CWTE.cjs.map
213
+ //# sourceMappingURL=chunk-WUM6CWTE.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/resources/workflows.ts"],"names":[],"mappings":";;;AAyQO,IAAM,gCAAN,MAAoC;AAAA,EACzC,YAAoB,MAAA,EAA0B;AAA1B,IAAA,IAAA,CAAA,MAAA,GAAA,MAAA;AAAA,EAA2B;AAAA,EAA3B,MAAA;AAAA;AAAA,EAGpB,KAAK,UAAA,EAAuD;AAC1D,IAAA,OAAO,KAAK,MAAA,CAAO,OAAA;AAAA,MACjB,KAAA;AAAA,MACA,CAAA,cAAA,EAAiB,kBAAA,C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GAAQ,MAAA,CAAO,KAAA;AACvC,IAAA,IAAI,MAAA,CAAO,SAAS,MAAA,EAAQ,KAAA,CAAM,UAAU,MAAA,CAAO,OAAA,CAAQ,KAAK,GAAG,CAAA;AACnE,IAAA,OAAO,KAAK,MAAA,CAAO,OAAA,CAAQ,OAAO,uBAAA,EAAyB,EAAE,OAAO,CAAA;AAAA,EACtE;AACF","file":"chunk-VYEGCEZ3.cjs","sourcesContent":["import type { NodaroClientCore } from \"../core.js\"\nimport type {\n GenericNode,\n GenericEdge,\n} from \"@nodaro/shared/types\"\nimport type {\n WorkflowExport,\n WorkflowImportReport,\n} from \"@nodaro/shared/workflow\"\nimport type {\n WorkflowVisibility,\n CollaboratorRole,\n} from \"@nodaro/shared/organizations\"\n\n/**\n * Workflow metadata + (when fetched as a single record) full nodes/edges/settings.\n *\n * The list endpoint returns metadata only; `get`, `create`, and `update` return the\n * full record. `nodes`, `edges`, `settings`, and `sourcePrompt` are present only on\n * full records and omitted in list responses.\n */\nexport interface Workflow {\n id: string\n projectId: string | null\n userId: string\n name: string\n description?: string | null\n folderId?: string | null\n isTemplate?: boolean\n version?: number\n thumbnailUrl?: string | null\n nodes?: GenericNode[]\n edges?: GenericEdge[]\n settings?: Record<string, unknown>\n sourcePrompt?: string | null\n createdAt: string\n updatedAt: string\n}\n\nexport interface ListWorkflowsParams {\n /** Required — list endpoint is `/v1/projects/:projectId/workflows`. */\n projectId: string\n}\n\nexport interface CreateWorkflowInput {\n /** Required — workflow is created under this project. */\n projectId: string\n name: string\n description?: string\n folderId?: string | null\n nodes?: GenericNode[]\n edges?: GenericEdge[]\n settings?: Record<string, unknown>\n sourcePrompt?: string\n}\n\nexport interface UpdateWorkflowInput {\n name?: string\n description?: string\n folderId?: string | null\n nodes?: GenericNode[]\n edges?: GenericEdge[]\n settings?: Record<string, unknown>\n sourcePrompt?: string\n thumbnailUrl?: string | null\n /**\n * Optimistic concurrency: the `updatedAt` your copy of the workflow was\n * loaded with. When the row has since been written by another tab/device,\n * the update is rejected with HTTP 409 `workflow_conflict`\n * (`WorkflowConflictError`) carrying the current record — re-read/merge and\n * retry instead of last-writer-wins clobbering the other writer's changes.\n * Omit for the legacy unconditional replace.\n */\n expectedUpdatedAt?: string\n /**\n * Optimistic concurrency by monotonic version — preferred over\n * `expectedUpdatedAt` (integer bumped by the DB on every content change).\n */\n expectedVersion?: number\n}\n\nexport interface RunWorkflowParams {\n /**\n * Optional subset of node IDs to execute. Omit to run the full workflow.\n * With `continueMode: \"from-failed\"`, the nodes to consider (default: the\n * nodes the run's chain was first started on, plus every node left failed or\n * held back; see `continueMode`); the run executes only those the failed run\n * did not complete. Every id sent counts as named: a node of work no run of\n * the chain ever ran (each only handed on its saved results) runs and is\n * priced, while a source, trigger, parameter picker or container keeps what\n * the run handed on and a node set to skip never runs.\n */\n nodeIds?: string[]\n /**\n * Per-node field overrides for this run only, `{ [nodeId]: { field: value } }`,\n * shallow-merged over each node's saved data (the node's saved results are\n * not used). A run through the API has nobody to review a Preview render, so\n * a workflow whose Apply EDL render is set to Preview is refused\n * (`preview_review_required`) unless the run sets it to Final:\n * `{ [renderNodeId]: { quality: \"final\" } }`. A node with Review before\n * render on (Tighten Episode, Trailer) is refused the same way (turn its\n * review off). A failed execution records what held it —\n * `preview_review_required` / `preview_render_nested` (a render),\n * `…_review_on` (a review-on node) or `…_mixed` (both); match all six with\n * `isPreviewRefusalCode` from `@nodaro/shared`. A review-on Tighten Episode\n * fed by a List is refused with `use_case_review_list_driven`; a Trailer fed\n * by a List, with `use_case_list_driven`.\n */\n inputOverrides?: Record<string, Record<string, unknown>>\n /**\n * Continue from an earlier execution of this workflow — Render final after a\n * run that stopped at its preview, or (with `continueMode: \"from-failed\"`) a\n * failed run from where it stopped. The run executes `nodeIds` only\n * (required with this field, except with `continueMode`); every other node\n * hands on what that execution produced, not the workflow's saved results,\n * and an Edit Plan hands on its plan with the person's review applied. The\n * execution must be your own `completed` run of this workflow (`failed`,\n * with `continueMode`), not of a published app version. Refused with\n * `continuation_subset_required`, `continuation_not_found` (404),\n * `continuation_workflow_mismatch`, `continuation_version_mismatch` or\n * `continuation_not_completed` (409). A continuation its payer cannot cover\n * (with or without `continueMode`, priced on the nodes it runs) throws\n * `InsufficientCreditsError` before any execution exists, checked as a\n * {@link WorkflowsResource.renderFinal} is.\n */\n continueFromExecutionId?: string\n /**\n * `\"from-failed\"`: continue a FAILED run (`continueFromExecutionId`) from\n * where it stopped. It runs every node that run did not complete — of\n * `nodeIds`, which default to the nodes the run was started on (a run\n * started on named nodes is continued on those, a run of every node on every\n * node; a continuation of a continuation keeps those of the first run of its\n * chain) plus every node the run left failed or held back — and hands on\n * what it completed,\n * never run or charged again. That is per node: a node that failed runs\n * again in full, every list item included. When a later continuation of it\n * completed only part of what it left (a narrower `nodeIds`), the run builds\n * on the newest such one: it is seeded from that run and runs only what is\n * still left ({@link RunWorkflowResult.continuedFrom} names it). A node\n * `nodeIds` names that no run of the chain ever ran runs too, and is priced\n * (see `nodeIds`). A Render\n * final, or a run of named nodes, continuing the newest of those counts as\n * one of them too. Not combinable with {@link renderFinal}. Refused with\n * `continuation_not_failed` (409) for a run that did not fail,\n * `continuation_superseded` (409) when a later continuation supersedes it —\n * the message names that run: one that failed (continue that one instead),\n * or one that completed all this run left (the work is done, and its results\n * are on that run) — `continuation_preview_pending` (409, a\n * `ContinuationPreviewPendingError`) when the newest later continuation\n * stopped at a Preview review of a render or of a Tighten Episode (the error\n * names that run, what holds it, and in `next` the run that finishes it:\n * `client.workflows.run(workflowId, error.next)` first — for a single render,\n * its {@link renderFinal}), and\n * `continuation_subset_required` (409) when nothing is left to run. Send an\n * {@link RunWorkflowOptions.idempotencyKey} with each continuation.\n */\n continueMode?: \"from-failed\"\n}\n\n/** Per-call options for {@link WorkflowsResource.run}. */\nexport interface RunWorkflowOptions {\n /**\n * Sent as the `Idempotency-Key` header (at least 8 characters; the server\n * ignores a shorter one). Reuse the same value when retrying the same\n * request: the server answers the run it already started (`deduped: true`)\n * instead of starting a second one — or, once that run is under way or has\n * superseded the one it continued, refuses with `already_running` (an\n * `AlreadyRunningError` carrying its `executionId`) or\n * `continuation_superseded` naming it. Either way nothing runs twice.\n */\n idempotencyKey?: string\n}\n\nexport interface RunWorkflowResult {\n executionId: string\n status: \"pending\" | \"running\"\n /** `true` when an `idempotencyKey` retry found the run already started: `executionId` is that run. */\n deduped?: boolean\n /**\n * With `continueMode: \"from-failed\"`: the execution the run continued from —\n * its states seed the run. The run asked for (`continueFromExecutionId`), or\n * the newest later continuation of it that completed part of what it left.\n * Absent on any other run, and on a `deduped` answer.\n */\n continuedFrom?: string\n}\n\n/**\n * A Render final: the Apply EDL render at Final for this run only, and every\n * node after it (Camera Switch first, in multicam). The server works out which\n * nodes run — the same rule as the editor's Render final button.\n */\nexport interface RenderFinalParams {\n /** The Apply EDL render node to finalize. */\n renderNodeId: string\n /**\n * The execution that stopped at the preview: your own `completed` run of\n * this workflow. Every node the Render final does not run hands on what it\n * produced (an Edit Plan hands on its plan with the review applied).\n */\n continueFromExecutionId: string\n}\n\n/** What a Render final will run and charge. Nothing is created by the quote. */\nexport interface RenderFinalQuote {\n renderNodeId: string\n /** The nodes the run executes, in canvas order. */\n nodeIds: string[]\n /** The one-shot override it runs with: `{ [renderNodeId]: { quality: \"final\" } }`. */\n inputOverrides: Record<string, Record<string, unknown>>\n /** Estimated credits; `null` in an edition without credits. */\n estimatedCredits: number | null\n /**\n * Present (`true`) when `estimatedCredits` includes an LLM node's estimate:\n * an LLM call is charged its actual usage after it runs, so show `~N`.\n * Absent for a fixed price.\n */\n estimatedCreditsIsEstimate?: true\n /**\n * Whether the payer can cover `estimatedCredits`; `null` in an edition\n * without credits. When `false`, {@link WorkflowsResource.renderFinal} is\n * refused with `InsufficientCreditsError` before any execution exists.\n */\n sufficient: boolean | null\n /**\n * The payer's spendable credits; `null` when it is not yours to see (a\n * deployment's operator pays) or a workspace budget pays.\n */\n available: number | null\n}\n\n/** A person granted access to a workflow. Email is never returned (privacy). */\nexport interface Collaborator {\n userId: string\n name?: string | null\n avatar?: string | null\n role: CollaboratorRole\n}\n\nexport interface AddCollaboratorInput {\n /** Provide exactly one of `userId` or `email`. */\n userId?: string\n email?: string\n role: CollaboratorRole\n}\n\n/** A workflow someone else shared with you, plus the role you hold on it. */\nexport interface SharedWorkflow extends Workflow {\n grantedRole: CollaboratorRole\n}\n\n/** A grant dropped because a move took the workflow out of the workspace the\n * access came from. */\nexport interface DroppedCollaborator {\n userId: string\n name: string | null\n}\n\n/**\n * The people a workflow is shared with — reached as `client.workflows.collaborators`.\n * All four endpoints are served by the organizations feature and exist only when\n * it is enabled server-side; against an install without it they 404\n * (→ `NotFoundError`). The active workspace travels on the request like every\n * other call, so a workspace admin's grants apply automatically.\n */\nexport class WorkflowCollaboratorsResource {\n constructor(private client: NodaroClientCore) {}\n\n /** List a workflow's collaborators (id, name, avatar, role — never email). */\n list(workflowId: string): Promise<{ data: Collaborator[] }> {\n return this.client.request(\n \"GET\",\n `/v1/workflows/${encodeURIComponent(workflowId)}/collaborators`,\n )\n }\n\n /** Add a collaborator by `userId` OR `email` (exactly one), at the given role. */\n add(\n workflowId: string,\n input: AddCollaboratorInput,\n ): Promise<{ data: { userId: string; role: CollaboratorRole } }> {\n return this.client.request(\n \"POST\",\n `/v1/workflows/${encodeURIComponent(workflowId)}/collaborators`,\n { body: input },\n )\n }\n\n /** Change a collaborator's role. */\n update(\n workflowId: string,\n userId: string,\n input: { role: CollaboratorRole },\n ): Promise<{ data: { userId: string; role: CollaboratorRole } }> {\n return this.client.request(\n \"PATCH\",\n `/v1/workflows/${encodeURIComponent(workflowId)}/collaborators/${encodeURIComponent(userId)}`,\n { body: input },\n )\n }\n\n /** Remove a collaborator — or yourself. Returns `{ success: true }`. */\n remove(workflowId: string, userId: string): Promise<{ success: true }> {\n return this.client.request(\n \"DELETE\",\n `/v1/workflows/${encodeURIComponent(workflowId)}/collaborators/${encodeURIComponent(userId)}`,\n )\n }\n}\n\n/** One MCP conversation: a flow its assistant built step by step (`GET /v1/mcp-conversations`). */\nexport interface McpConversation {\n /** The conversation's workflow id — open it with {@link WorkflowsResource.get}. */\n id: string\n projectId: string\n name: string\n /** The source: \"claude\", \"claude-code\", \"chatgpt\", or another client's name in lower case. */\n client: string\n clientLabel: string\n /** The connection's own name, as the connector was named. */\n clientName: string\n startedAt: string\n lastActivityAt: string\n /** Still receiving steps: its last step is less than 30 minutes old. */\n live: boolean\n /** The user's first request, when the assistant passed it. */\n firstRequest: string | null\n nodeCount: number\n counts: { image: number; video: number; audio: number }\n /** Credits charged for its jobs; null where credits are not billed. */\n credits: number | null\n cover: { url: string; kind: \"image\" | \"video\"; setByUser: boolean } | null\n updatedAt: string\n}\n\nexport interface ListMcpConversationsParams {\n /** \"YYYY-MM\". Default: the latest month that has conversations. */\n month?: string\n /** Keep only these sources (\"claude\", \"claude-code\", \"chatgpt\", …). */\n sources?: readonly string[]\n}\n\nexport interface McpConversationList {\n /** The month listed. */\n month: string\n /** Every month that has conversations, newest first, with its count. */\n months: Array<{ month: string; conversations: number }>\n /** The month's sources, with the connection names each one folds in. */\n sources: Array<{ client: string; label: string; conversations: number; connections: Array<{ clientName: string; conversations: number }> }>\n data: McpConversation[]\n}\n\nexport class WorkflowsResource {\n /** The people this workflow is shared with. See {@link WorkflowCollaboratorsResource}. */\n readonly collaborators: WorkflowCollaboratorsResource\n\n constructor(private client: NodaroClientCore) {\n this.collaborators = new WorkflowCollaboratorsResource(client)\n }\n\n /** List workflows for a project. Returns metadata only — `nodes`/`edges` are not included. */\n list(params: ListWorkflowsParams): Promise<{ data: Workflow[] }> {\n return this.client.request(\n \"GET\",\n `/v1/projects/${encodeURIComponent(params.projectId)}/workflows`,\n )\n }\n\n /** Get a workflow including its full nodes/edges/settings. */\n get(id: string): Promise<{ data: Workflow }> {\n return this.client.request(\"GET\", `/v1/workflows/${encodeURIComponent(id)}`)\n }\n\n /**\n * Get a PUBLICLY-SHARED workflow by id (`GET /v1/public/workflows/:id`) — the\n * unauthenticated share-by-link read. Returns the workflow's nodes/edges/\n * settings ONLY when it's opted into sharing server-side (`settings.studio.shared\n * === true`); otherwise the route 404s (→ `NotFoundError`). No auth required —\n * a share viewer has no session; the SDK omits the bearer when no token exists.\n */\n getPublic(id: string): Promise<{ data: Workflow }> {\n return this.client.request(\"GET\", `/v1/public/workflows/${encodeURIComponent(id)}`)\n }\n\n /**\n * Create a workflow under a project. Returns the full record.\n * NOTE: server route is `POST /v1/projects/:projectId/workflows`.\n */\n create(input: CreateWorkflowInput): Promise<{ data: Workflow }> {\n const { projectId, ...body } = input\n return this.client.request(\n \"POST\",\n `/v1/projects/${encodeURIComponent(projectId)}/workflows`,\n { body },\n )\n }\n\n /** Patch a workflow. Returns the full updated record. */\n update(id: string, input: UpdateWorkflowInput): Promise<{ data: Workflow }> {\n return this.client.request(\n \"PATCH\",\n `/v1/workflows/${encodeURIComponent(id)}`,\n { body: input },\n )\n }\n\n /** Delete a workflow. Returns `{ success: true }`. Throws `NotFoundError`\n * when the id doesn't exist or isn't yours (the delete is not silent). */\n delete(id: string): Promise<{ success: true }> {\n return this.client.request(\"DELETE\", `/v1/workflows/${encodeURIComponent(id)}`)\n }\n\n /**\n * Run a workflow. Returns the executionId for polling via\n * `client.executions.get(executionId)`.\n */\n run(id: string, params: RunWorkflowParams = {}, options?: RunWorkflowOptions): Promise<RunWorkflowResult> {\n return this.client.request(\n \"POST\",\n `/v1/workflows/${encodeURIComponent(id)}/run`,\n {\n body: params,\n ...(options?.idempotencyKey ? { headers: { \"Idempotency-Key\": options.idempotencyKey } } : {}),\n },\n )\n }\n\n /**\n * Render final (`renderFinal` on `POST /v1/workflows/:id/run`): run the\n * render at Final for this run only, and every node after it, continuing the\n * execution that stopped at its preview. The server derives the nodes and\n * the override — send nothing else. Quote it first with\n * {@link estimateRenderFinal}. Refused with `render_final_node_not_found`,\n * `render_final_not_a_render`, or a continuation code (see `run`); a run\n * its payer cannot cover throws `InsufficientCreditsError` (with `required`\n * and, when it is yours to see, `available`) before any execution exists.\n */\n renderFinal(id: string, params: RenderFinalParams): Promise<RunWorkflowResult> {\n return this.client.request(\"POST\", `/v1/workflows/${encodeURIComponent(id)}/run`, {\n body: {\n renderFinal: { renderNodeId: params.renderNodeId },\n continueFromExecutionId: params.continueFromExecutionId,\n },\n })\n }\n\n /**\n * Quote a Render final (`POST /v1/workflows/:id/render-final/estimate`): the\n * nodes it will run, the override it runs with and its estimated credits.\n * Nothing is created or charged.\n */\n estimateRenderFinal(id: string, params: RenderFinalParams): Promise<{ data: RenderFinalQuote }> {\n return this.client.request(\"POST\", `/v1/workflows/${encodeURIComponent(id)}/render-final/estimate`, {\n body: { renderNodeId: params.renderNodeId, continueFromExecutionId: params.continueFromExecutionId },\n })\n }\n\n /**\n * Export a workflow as a portable JSON bundle.\n * Pass `opts.assets = true` to include character/object/location entity data.\n */\n export(\n workflowId: string,\n opts?: { assets?: boolean },\n ): Promise<{ data: WorkflowExport }> {\n return this.client.request(\n \"GET\",\n `/v1/workflows/${encodeURIComponent(workflowId)}/export`,\n { query: { assets: opts?.assets ?? false } },\n )\n }\n\n /**\n * Import a `WorkflowExport` bundle into the specified project.\n * Re-creates any bundled assets (characters, objects, creatures, locations)\n * under your account, and re-points BOTH the entity nodes and every `@`-chip\n * (`ConnectedReference`) bound in the graph at the rows it created.\n * Media the bundle references on other hosts is copied onto this instance's\n * storage where reachable; a bundled entity's images are copied whoever\n * hosts them, because they are the exporter's bytes and their lifecycle is\n * not yours. `importReport` says what was copied, what could not be reached\n * and what was skipped (and why); `assetIdMap` maps each bundled entity id\n * to the row created for it (for chips you hold outside the graph), and\n * `assetsSkipped` names the entities your storage quota left uncreated —\n * the workflow itself still lands.\n */\n import(input: WorkflowExport & { projectId: string }): Promise<{ data: Workflow; importReport?: WorkflowImportReport }> {\n const { projectId, ...workflowJson } = input\n return this.client.request(\"POST\", \"/v1/workflows/import\", {\n body: { projectId, workflow_json: workflowJson },\n })\n }\n\n /**\n * Set a workflow's visibility — `\"private\"` (creator + explicit collaborators)\n * or `\"workspace\"` (everyone in its workspace). Only the creator or a workspace\n * admin may change it; anyone else gets HTTP 403. Thin wrapper over `update()`:\n * the visibility lever lives on `PATCH /v1/workflows/:id`.\n */\n setVisibility(id: string, visibility: WorkflowVisibility): Promise<{ data: Workflow }> {\n return this.client.request(\"PATCH\", `/v1/workflows/${encodeURIComponent(id)}`, {\n body: { visibility },\n })\n }\n\n /**\n * Move a workflow to another project (`POST /v1/workflows/:id/move`); its folder\n * is cleared. When the move takes the workflow out of a workspace, collaborator\n * grants that came from that workspace are dropped and returned as\n * `droppedCollaborators`.\n */\n move(\n id: string,\n params: { projectId: string },\n ): Promise<{ data: Workflow; droppedCollaborators: DroppedCollaborator[] }> {\n return this.client.request(\"POST\", `/v1/workflows/${encodeURIComponent(id)}/move`, {\n body: params,\n })\n }\n\n /**\n * Workflows other people shared with you (`GET /v1/workflows/shared-with-me`) —\n * grants on work that is NOT in a workspace you belong to (workspace work already\n * shows in that workspace's own lists). Each carries the `grantedRole` you hold.\n * Empty when the organizations feature is off server-side.\n */\n sharedWithMe(): Promise<{ data: SharedWorkflow[] }> {\n return this.client.request(\"GET\", \"/v1/workflows/shared-with-me\")\n }\n\n /**\n * Your MCP conversations of one month (`GET /v1/mcp-conversations`): each is a\n * flow an assistant built from its steps, newest first. A conversation is a\n * workflow, so open, rename, export or delete it with the other methods here.\n */\n listMcpConversations(params: ListMcpConversationsParams = {}): Promise<McpConversationList> {\n const query: Record<string, string> = {}\n if (params.month) query.month = params.month\n if (params.sources?.length) query.sources = params.sources.join(\",\")\n return this.client.request(\"GET\", \"/v1/mcp-conversations\", { query })\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/resources/workflows.ts"],"names":[],"mappings":";;;AAgRO,IAAM,gCAAN,MAAoC;AAAA,EACzC,YAAoB,MAAA,EAA0B;AAA1B,IAAA,IAAA,CAAA,MAAA,GAAA,MAAA;AAAA,EAA2B;AAAA,EAA3B,MAAA;AAAA;AAAA,EAGpB,K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AAA,GAAqC,EAAC,EAAiC;AAC1F,IAAA,MAAM,QAAgC,EAAC;AACvC,IAAA,IAAI,MAAA,CAAO,KAAA,EAAO,KAAA,CAAM,KAAA,GAAQ,MAAA,CAAO,KAAA;AACvC,IAAA,IAAI,MAAA,CAAO,SAAS,MAAA,EAAQ,KAAA,CAAM,UAAU,MAAA,CAAO,OAAA,CAAQ,KAAK,GAAG,CAAA;AACnE,IAAA,OAAO,KAAK,MAAA,CAAO,OAAA,CAAQ,OAAO,uBAAA,EAAyB,EAAE,OAAO,CAAA;AAAA,EACtE;AACF","file":"chunk-WUM6CWTE.cjs","sourcesContent":["import type { NodaroClientCore } from \"../core.js\"\nimport type {\n GenericNode,\n GenericEdge,\n} from \"@nodaro/shared/types\"\nimport type {\n WorkflowExport,\n WorkflowImportReport,\n} from \"@nodaro/shared/workflow\"\nimport type {\n WorkflowVisibility,\n CollaboratorRole,\n} from \"@nodaro/shared/organizations\"\n\n/**\n * Workflow metadata + (when fetched as a single record) full nodes/edges/settings.\n *\n * The list endpoint returns metadata only; `get`, `create`, and `update` return the\n * full record. `nodes`, `edges`, `settings`, and `sourcePrompt` are present only on\n * full records and omitted in list responses.\n */\nexport interface Workflow {\n id: string\n projectId: string | null\n userId: string\n name: string\n description?: string | null\n folderId?: string | null\n isTemplate?: boolean\n version?: number\n thumbnailUrl?: string | null\n nodes?: GenericNode[]\n edges?: GenericEdge[]\n settings?: Record<string, unknown>\n sourcePrompt?: string | null\n createdAt: string\n updatedAt: string\n}\n\nexport interface ListWorkflowsParams {\n /** Required — list endpoint is `/v1/projects/:projectId/workflows`. */\n projectId: string\n}\n\nexport interface CreateWorkflowInput {\n /** Required — workflow is created under this project. */\n projectId: string\n name: string\n description?: string\n folderId?: string | null\n nodes?: GenericNode[]\n edges?: GenericEdge[]\n settings?: Record<string, unknown>\n sourcePrompt?: string\n}\n\nexport interface UpdateWorkflowInput {\n name?: string\n description?: string\n folderId?: string | null\n nodes?: GenericNode[]\n edges?: GenericEdge[]\n settings?: Record<string, unknown>\n sourcePrompt?: string\n thumbnailUrl?: string | null\n /**\n * Optimistic concurrency: the `updatedAt` your copy of the workflow was\n * loaded with. When the row has since been written by another tab/device,\n * the update is rejected with HTTP 409 `workflow_conflict`\n * (`WorkflowConflictError`) carrying the current record — re-read/merge and\n * retry instead of last-writer-wins clobbering the other writer's changes.\n * Omit for the legacy unconditional replace.\n */\n expectedUpdatedAt?: string\n /**\n * Optimistic concurrency by monotonic version — preferred over\n * `expectedUpdatedAt` (integer bumped by the DB on every content change).\n */\n expectedVersion?: number\n}\n\nexport interface RunWorkflowParams {\n /**\n * Optional subset of node IDs to execute. Omit to run the full workflow.\n * With `continueMode: \"from-failed\"`, the nodes to consider (default: the\n * nodes the run's chain was first started on, plus every node left failed or\n * held back; see `continueMode`); the run executes only those the failed run\n * did not complete. Every id sent counts as named: a node of work no run of\n * the chain ever ran (each only handed on its saved results) runs and is\n * priced, while a source, trigger, parameter picker or container keeps what\n * the run handed on and a node set to skip never runs.\n */\n nodeIds?: string[]\n /**\n * Per-node field overrides for this run only, `{ [nodeId]: { field: value } }`,\n * shallow-merged over each node's saved data (the node's saved results are\n * not used). A run through the API has nobody to review a Preview render, so\n * a workflow whose Apply EDL render is set to Preview is refused\n * (`preview_review_required`) unless the run sets it to Final:\n * `{ [renderNodeId]: { quality: \"final\" } }`. A node with Review before\n * render on (Tighten Episode, Trailer) is refused the same way (turn its\n * review off). A failed execution records what held it —\n * `preview_review_required` / `preview_render_nested` (a render),\n * `…_review_on` (a review-on node) or `…_mixed` (both); match all six with\n * `isPreviewRefusalCode` from `@nodaro/shared`. A review-on Tighten Episode\n * fed by a List is refused with `use_case_review_list_driven`; a Trailer fed\n * by a List, with `use_case_list_driven`.\n */\n inputOverrides?: Record<string, Record<string, unknown>>\n /**\n * Continue from an earlier execution of this workflow — Render final after a\n * run that stopped at its preview, or (with `continueMode: \"from-failed\"`) a\n * failed run from where it stopped. The run executes `nodeIds` only\n * (required with this field, except with `continueMode`); every other node\n * hands on what that execution produced, not the workflow's saved results,\n * and an Edit Plan hands on its plan with the person's review applied. The\n * execution must be your own `completed` run of this workflow (`failed`,\n * with `continueMode`), not of a published app version. Refused with\n * `continuation_subset_required`, `continuation_not_found` (404),\n * `continuation_workflow_mismatch`, `continuation_version_mismatch` or\n * `continuation_not_completed` (409). A continuation its payer cannot cover\n * (with or without `continueMode`, priced on the nodes it runs) throws\n * `InsufficientCreditsError` before any execution exists, checked as a\n * {@link WorkflowsResource.renderFinal} is.\n */\n continueFromExecutionId?: string\n /**\n * `\"from-failed\"`: continue a FAILED run (`continueFromExecutionId`) from\n * where it stopped. It runs every node that run did not complete — of\n * `nodeIds`, which default to the nodes the run was started on (a run\n * started on named nodes is continued on those, a run of every node on every\n * node; a continuation of a continuation keeps those of the first run of its\n * chain) plus every node the run left failed or held back — and hands on\n * what it completed,\n * never run or charged again. That is per node: a node that failed runs\n * again in full, every list item included. When a later continuation of it\n * completed only part of what it left (a narrower `nodeIds`), the run builds\n * on the newest such one: it is seeded from that run and runs only what is\n * still left ({@link RunWorkflowResult.continuedFrom} names it). A node\n * `nodeIds` names that no run of the chain ever ran runs too, and is priced\n * (see `nodeIds`). A Render\n * final, or a run of named nodes, continuing the newest of those counts as\n * one of them too. Not combinable with {@link renderFinal}. Refused with\n * `continuation_not_failed` (409) for a run that did not fail,\n * `continuation_superseded` (409) when a later continuation supersedes it —\n * the message names that run: one that failed (continue that one instead),\n * or one that completed all this run left (the work is done, and its results\n * are on that run) — `continuation_preview_pending` (409, a\n * `ContinuationPreviewPendingError`) when the newest later continuation\n * stopped at a Preview review of a render or of a Tighten Episode (the error\n * names that run, what holds it, and in `next` the run that finishes it:\n * `client.workflows.run(workflowId, error.next)` first — for a single render,\n * its {@link renderFinal}), and\n * `continuation_subset_required` (409) when nothing is left to run. Send an\n * {@link RunWorkflowOptions.idempotencyKey} with each continuation.\n */\n continueMode?: \"from-failed\"\n}\n\n/** Per-call options for {@link WorkflowsResource.run}. */\nexport interface RunWorkflowOptions {\n /**\n * Sent as the `Idempotency-Key` header (at least 8 characters; the server\n * ignores a shorter one). Reuse the same value when retrying the same\n * request: the server answers the run it already started (`deduped: true`)\n * instead of starting a second one — or, once that run is under way or has\n * superseded the one it continued, refuses with `already_running` (an\n * `AlreadyRunningError` carrying its `executionId`) or\n * `continuation_superseded` naming it. Either way nothing runs twice.\n */\n idempotencyKey?: string\n}\n\nexport interface RunWorkflowResult {\n executionId: string\n status: \"pending\" | \"running\"\n /** `true` when an `idempotencyKey` retry found the run already started: `executionId` is that run. */\n deduped?: boolean\n /**\n * With `continueMode: \"from-failed\"`: the execution the run continued from —\n * its states seed the run. The run asked for (`continueFromExecutionId`), or\n * the newest later continuation of it that completed part of what it left.\n * Absent on any other run, and on a `deduped` answer.\n */\n continuedFrom?: string\n}\n\n/**\n * A Render final: the Apply EDL render at Final for this run only, and every\n * node after it (Camera Switch first, in multicam). The server works out which\n * nodes run — the same rule as the editor's Render final button.\n */\nexport interface RenderFinalParams {\n /** The Apply EDL render node to finalize. */\n renderNodeId: string\n /**\n * The execution that stopped at the preview: your own `completed` run of\n * this workflow. Every node the Render final does not run hands on what it\n * produced (an Edit Plan hands on its plan with the review applied).\n */\n continueFromExecutionId: string\n}\n\n/** What a Render final will run and charge. Nothing is created by the quote. */\nexport interface RenderFinalQuote {\n renderNodeId: string\n /** The nodes the run executes, in canvas order. */\n nodeIds: string[]\n /** The one-shot override it runs with: `{ [renderNodeId]: { quality: \"final\" } }`. */\n inputOverrides: Record<string, Record<string, unknown>>\n /** Estimated credits; `null` in an edition without credits. */\n estimatedCredits: number | null\n /**\n * Present (`true`) when `estimatedCredits` includes an LLM node's estimate:\n * an LLM call is charged its actual usage after it runs, so show `≈N`.\n * Absent for a fixed price.\n */\n estimatedCreditsIsEstimate?: true\n /**\n * What the run holds while it renders (a UGC clip at its hold), never below\n * `estimatedCredits`: the figure `sufficient` is checked against. `null` in\n * an edition without credits; absent from an older server.\n */\n holdCredits?: number | null\n /**\n * Whether the payer can cover what the run holds (`holdCredits`); `null` in\n * an edition without credits. When `false`, {@link WorkflowsResource.renderFinal}\n * is refused with `InsufficientCreditsError` (its `required` is that hold)\n * before any execution exists.\n */\n sufficient: boolean | null\n /**\n * The payer's spendable credits; `null` when it is not yours to see (a\n * deployment's operator pays) or a workspace budget pays.\n */\n available: number | null\n}\n\n/** A person granted access to a workflow. Email is never returned (privacy). */\nexport interface Collaborator {\n userId: string\n name?: string | null\n avatar?: string | null\n role: CollaboratorRole\n}\n\nexport interface AddCollaboratorInput {\n /** Provide exactly one of `userId` or `email`. */\n userId?: string\n email?: string\n role: CollaboratorRole\n}\n\n/** A workflow someone else shared with you, plus the role you hold on it. */\nexport interface SharedWorkflow extends Workflow {\n grantedRole: CollaboratorRole\n}\n\n/** A grant dropped because a move took the workflow out of the workspace the\n * access came from. */\nexport interface DroppedCollaborator {\n userId: string\n name: string | null\n}\n\n/**\n * The people a workflow is shared with — reached as `client.workflows.collaborators`.\n * All four endpoints are served by the organizations feature and exist only when\n * it is enabled server-side; against an install without it they 404\n * (→ `NotFoundError`). The active workspace travels on the request like every\n * other call, so a workspace admin's grants apply automatically.\n */\nexport class WorkflowCollaboratorsResource {\n constructor(private client: NodaroClientCore) {}\n\n /** List a workflow's collaborators (id, name, avatar, role — never email). */\n list(workflowId: string): Promise<{ data: Collaborator[] }> {\n return this.client.request(\n \"GET\",\n `/v1/workflows/${encodeURIComponent(workflowId)}/collaborators`,\n )\n }\n\n /** Add a collaborator by `userId` OR `email` (exactly one), at the given role. */\n add(\n workflowId: string,\n input: AddCollaboratorInput,\n ): Promise<{ data: { userId: string; role: CollaboratorRole } }> {\n return this.client.request(\n \"POST\",\n `/v1/workflows/${encodeURIComponent(workflowId)}/collaborators`,\n { body: input },\n )\n }\n\n /** Change a collaborator's role. */\n update(\n workflowId: string,\n userId: string,\n input: { role: CollaboratorRole },\n ): Promise<{ data: { userId: string; role: CollaboratorRole } }> {\n return this.client.request(\n \"PATCH\",\n `/v1/workflows/${encodeURIComponent(workflowId)}/collaborators/${encodeURIComponent(userId)}`,\n { body: input },\n )\n }\n\n /** Remove a collaborator — or yourself. Returns `{ success: true }`. */\n remove(workflowId: string, userId: string): Promise<{ success: true }> {\n return this.client.request(\n \"DELETE\",\n `/v1/workflows/${encodeURIComponent(workflowId)}/collaborators/${encodeURIComponent(userId)}`,\n )\n }\n}\n\n/** One MCP conversation: a flow its assistant built step by step (`GET /v1/mcp-conversations`). */\nexport interface McpConversation {\n /** The conversation's workflow id — open it with {@link WorkflowsResource.get}. */\n id: string\n projectId: string\n name: string\n /** The source: \"claude\", \"claude-code\", \"chatgpt\", or another client's name in lower case. */\n client: string\n clientLabel: string\n /** The connection's own name, as the connector was named. */\n clientName: string\n startedAt: string\n lastActivityAt: string\n /** Still receiving steps: its last step is less than 30 minutes old. */\n live: boolean\n /** The user's first request, when the assistant passed it. */\n firstRequest: string | null\n nodeCount: number\n counts: { image: number; video: number; audio: number }\n /** Credits charged for its jobs; null where credits are not billed. */\n credits: number | null\n cover: { url: string; kind: \"image\" | \"video\"; setByUser: boolean } | null\n updatedAt: string\n}\n\nexport interface ListMcpConversationsParams {\n /** \"YYYY-MM\". Default: the latest month that has conversations. */\n month?: string\n /** Keep only these sources (\"claude\", \"claude-code\", \"chatgpt\", …). */\n sources?: readonly string[]\n}\n\nexport interface McpConversationList {\n /** The month listed. */\n month: string\n /** Every month that has conversations, newest first, with its count. */\n months: Array<{ month: string; conversations: number }>\n /** The month's sources, with the connection names each one folds in. */\n sources: Array<{ client: string; label: string; conversations: number; connections: Array<{ clientName: string; conversations: number }> }>\n data: McpConversation[]\n}\n\nexport class WorkflowsResource {\n /** The people this workflow is shared with. See {@link WorkflowCollaboratorsResource}. */\n readonly collaborators: WorkflowCollaboratorsResource\n\n constructor(private client: NodaroClientCore) {\n this.collaborators = new WorkflowCollaboratorsResource(client)\n }\n\n /** List workflows for a project. Returns metadata only — `nodes`/`edges` are not included. */\n list(params: ListWorkflowsParams): Promise<{ data: Workflow[] }> {\n return this.client.request(\n \"GET\",\n `/v1/projects/${encodeURIComponent(params.projectId)}/workflows`,\n )\n }\n\n /** Get a workflow including its full nodes/edges/settings. */\n get(id: string): Promise<{ data: Workflow }> {\n return this.client.request(\"GET\", `/v1/workflows/${encodeURIComponent(id)}`)\n }\n\n /**\n * Get a PUBLICLY-SHARED workflow by id (`GET /v1/public/workflows/:id`) — the\n * unauthenticated share-by-link read. Returns the workflow's nodes/edges/\n * settings ONLY when it's opted into sharing server-side (`settings.studio.shared\n * === true`); otherwise the route 404s (→ `NotFoundError`). No auth required —\n * a share viewer has no session; the SDK omits the bearer when no token exists.\n */\n getPublic(id: string): Promise<{ data: Workflow }> {\n return this.client.request(\"GET\", `/v1/public/workflows/${encodeURIComponent(id)}`)\n }\n\n /**\n * Create a workflow under a project. Returns the full record.\n * NOTE: server route is `POST /v1/projects/:projectId/workflows`.\n */\n create(input: CreateWorkflowInput): Promise<{ data: Workflow }> {\n const { projectId, ...body } = input\n return this.client.request(\n \"POST\",\n `/v1/projects/${encodeURIComponent(projectId)}/workflows`,\n { body },\n )\n }\n\n /** Patch a workflow. Returns the full updated record. */\n update(id: string, input: UpdateWorkflowInput): Promise<{ data: Workflow }> {\n return this.client.request(\n \"PATCH\",\n `/v1/workflows/${encodeURIComponent(id)}`,\n { body: input },\n )\n }\n\n /** Delete a workflow. Returns `{ success: true }`. Throws `NotFoundError`\n * when the id doesn't exist or isn't yours (the delete is not silent). */\n delete(id: string): Promise<{ success: true }> {\n return this.client.request(\"DELETE\", `/v1/workflows/${encodeURIComponent(id)}`)\n }\n\n /**\n * Run a workflow. Returns the executionId for polling via\n * `client.executions.get(executionId)`.\n */\n run(id: string, params: RunWorkflowParams = {}, options?: RunWorkflowOptions): Promise<RunWorkflowResult> {\n return this.client.request(\n \"POST\",\n `/v1/workflows/${encodeURIComponent(id)}/run`,\n {\n body: params,\n ...(options?.idempotencyKey ? { headers: { \"Idempotency-Key\": options.idempotencyKey } } : {}),\n },\n )\n }\n\n /**\n * Render final (`renderFinal` on `POST /v1/workflows/:id/run`): run the\n * render at Final for this run only, and every node after it, continuing the\n * execution that stopped at its preview. The server derives the nodes and\n * the override — send nothing else. Quote it first with\n * {@link estimateRenderFinal}. Refused with `render_final_node_not_found`,\n * `render_final_not_a_render`, or a continuation code (see `run`); a run\n * its payer cannot cover throws `InsufficientCreditsError` (with `required`\n * and, when it is yours to see, `available`) before any execution exists.\n */\n renderFinal(id: string, params: RenderFinalParams): Promise<RunWorkflowResult> {\n return this.client.request(\"POST\", `/v1/workflows/${encodeURIComponent(id)}/run`, {\n body: {\n renderFinal: { renderNodeId: params.renderNodeId },\n continueFromExecutionId: params.continueFromExecutionId,\n },\n })\n }\n\n /**\n * Quote a Render final (`POST /v1/workflows/:id/render-final/estimate`): the\n * nodes it will run, the override it runs with and its estimated credits.\n * Nothing is created or charged.\n */\n estimateRenderFinal(id: string, params: RenderFinalParams): Promise<{ data: RenderFinalQuote }> {\n return this.client.request(\"POST\", `/v1/workflows/${encodeURIComponent(id)}/render-final/estimate`, {\n body: { renderNodeId: params.renderNodeId, continueFromExecutionId: params.continueFromExecutionId },\n })\n }\n\n /**\n * Export a workflow as a portable JSON bundle.\n * Pass `opts.assets = true` to include character/object/location entity data.\n */\n export(\n workflowId: string,\n opts?: { assets?: boolean },\n ): Promise<{ data: WorkflowExport }> {\n return this.client.request(\n \"GET\",\n `/v1/workflows/${encodeURIComponent(workflowId)}/export`,\n { query: { assets: opts?.assets ?? false } },\n )\n }\n\n /**\n * Import a `WorkflowExport` bundle into the specified project.\n * Re-creates any bundled assets (characters, objects, creatures, locations)\n * under your account, and re-points BOTH the entity nodes and every `@`-chip\n * (`ConnectedReference`) bound in the graph at the rows it created.\n * Media the bundle references on other hosts is copied onto this instance's\n * storage where reachable; a bundled entity's images are copied whoever\n * hosts them, because they are the exporter's bytes and their lifecycle is\n * not yours. `importReport` says what was copied, what could not be reached\n * and what was skipped (and why); `assetIdMap` maps each bundled entity id\n * to the row created for it (for chips you hold outside the graph), and\n * `assetsSkipped` names the entities your storage quota left uncreated —\n * the workflow itself still lands.\n */\n import(input: WorkflowExport & { projectId: string }): Promise<{ data: Workflow; importReport?: WorkflowImportReport }> {\n const { projectId, ...workflowJson } = input\n return this.client.request(\"POST\", \"/v1/workflows/import\", {\n body: { projectId, workflow_json: workflowJson },\n })\n }\n\n /**\n * Set a workflow's visibility — `\"private\"` (creator + explicit collaborators)\n * or `\"workspace\"` (everyone in its workspace). Only the creator or a workspace\n * admin may change it; anyone else gets HTTP 403. Thin wrapper over `update()`:\n * the visibility lever lives on `PATCH /v1/workflows/:id`.\n */\n setVisibility(id: string, visibility: WorkflowVisibility): Promise<{ data: Workflow }> {\n return this.client.request(\"PATCH\", `/v1/workflows/${encodeURIComponent(id)}`, {\n body: { visibility },\n })\n }\n\n /**\n * Move a workflow to another project (`POST /v1/workflows/:id/move`); its folder\n * is cleared. When the move takes the workflow out of a workspace, collaborator\n * grants that came from that workspace are dropped and returned as\n * `droppedCollaborators`.\n */\n move(\n id: string,\n params: { projectId: string },\n ): Promise<{ data: Workflow; droppedCollaborators: DroppedCollaborator[] }> {\n return this.client.request(\"POST\", `/v1/workflows/${encodeURIComponent(id)}/move`, {\n body: params,\n })\n }\n\n /**\n * Workflows other people shared with you (`GET /v1/workflows/shared-with-me`) —\n * grants on work that is NOT in a workspace you belong to (workspace work already\n * shows in that workspace's own lists). Each carries the `grantedRole` you hold.\n * Empty when the organizations feature is off server-side.\n */\n sharedWithMe(): Promise<{ data: SharedWorkflow[] }> {\n return this.client.request(\"GET\", \"/v1/workflows/shared-with-me\")\n }\n\n /**\n * Your MCP conversations of one month (`GET /v1/mcp-conversations`): each is a\n * flow an assistant built from its steps, newest first. A conversation is a\n * workflow, so open, rename, export or delete it with the other methods here.\n */\n listMcpConversations(params: ListMcpConversationsParams = {}): Promise<McpConversationList> {\n const query: Record<string, string> = {}\n if (params.month) query.month = params.month\n if (params.sources?.length) query.sources = params.sources.join(\",\")\n return this.client.request(\"GET\", \"/v1/mcp-conversations\", { query })\n }\n}\n"]}
@@ -98,5 +98,5 @@ var TrendsResource = class {
98
98
  };
99
99
 
100
100
  export { TrendsResource };
101
- //# sourceMappingURL=chunk-4UPVE662.js.map
102
- //# sourceMappingURL=chunk-4UPVE662.js.map
101
+ //# sourceMappingURL=chunk-XILR6TFO.js.map
102
+ //# sourceMappingURL=chunk-XILR6TFO.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/resources/trends.ts"],"names":[],"mappings":";AA4DA,IAAM,cAAA,GAAmD;AAAA,EACvD,IAAA,EAAM,0BAAA;AAAA,EACN,IAAA,EAAM;AACR,CAAA;AAEA,SAAS,SAAA,CAAU,IAAA,EAAc,IAAA,GAAO,EAAA,EAAY;AAClD,EAAA,IAAI,MAAA,CAAO,MAAA,CAAO,cAAA,EAAgB,IAAI,CAAA,EAAG;AACvC,IAAA,MAAM,IAAI,UAAU,CAAA,CAAA,EAAI,IAAI,6CAA6C,cAAA,CAAe,IAAI,CAAC,CAAA,CAAA,CAAG,CAAA;AAAA,EAClG;AACA,EAAA,OAAO,CAAA,WAAA,EAAc,kBAAA,CAAmB,IAAI,CAAC,GAAG,IAAI,CAAA,CAAA;AACtD;AAyVO,IAAM,iBAAN,MAAqB;AAAA,EAC1B,YAAoB,MAAA,EAA0B;AAA1B,IAAA,IAAA,CAAA,MAAA,GAAA,MAAA;AAAA,EAA2B;AAAA,EAA3B,MAAA;AAAA;AAAA,EAGpB,IAAA,CAAK,MAAA,GAA2B,EAAC,EAAkC;AACjE,IAAA,MAAM,QAAgC,EAAC;AACvC,IAAA,IAAI,MAAA,CAAO,CAAA,EAAG,KAAA,CAAM,CAAA,GAAI,MAAA,CAAO,CAAA;AAC/B,IAAA,IAAI,MAAA,CAAO,GAAA,EAAK,KAAA,CAAM,GAAA,GAAM,MAAA,CAAO,GAAA;AACnC,IAAA,IAAI,MAAA,CAAO,SAAA,EAAW,KAAA,CAAM,SAAA,GAAY,GAAA;AACxC,I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AAO,iBAAA,EAAmB,EAAE,KAAA,EAAO,CAAA;AAC/F,IAAA,OAAO,GAAA,CAAI,IAAA;AAAA,EACb;AAAA;AAAA,EAGA,MAAM,SAAS,IAAA,EAA6B;AAC1C,IAAA,MAAM,KAAK,MAAA,CAAO,OAAA,CAAc,OAAO,SAAA,CAAU,IAAA,EAAM,WAAW,CAAC,CAAA;AAAA,EACrE;AAAA;AAAA,EAGA,MAAM,WAAW,IAAA,EAA6B;AAC5C,IAAA,MAAM,KAAK,MAAA,CAAO,OAAA,CAAc,UAAU,SAAA,CAAU,IAAA,EAAM,WAAW,CAAC,CAAA;AAAA,EACxE;AACF","file":"chunk-XILR6TFO.js","sourcesContent":["import type { NodaroClientCore } from \"../core.js\"\nimport type { CastSwapEngine } from \"./cast-swap.js\"\n\n/**\n * Trends — ready-made Nodaro Motion recipes. A trend is a short clip with slots\n * (the people, pets, products and place you can replace); fill its slots with\n * your own pictures and run it to get the clip back with them in it.\n *\n * Cloud edition only: `/v1/trends` 404s on self-hosted installs. Only\n * published trends exist here: a draft, unpublished or unknown slug is a 404\n * on every route. `\"runs\"` and `\"tags\"` are never slugs (`/v1/trends/runs` is\n * the run list, `/v1/trends/tags` the tag list): the slug methods throw a\n * `TypeError` for them before any request. `run()` answers 202 with a job id; follow it with\n * `client.jobs.get(jobId)` / `client.jobs.getStatus(jobId)` like any other\n * job, or read it back as a trend run with `getRun(jobId)` / `runs()`.\n *\n * Repeats: pass `{ idempotencyKey }` to `run()` and it is sent as the\n * `Idempotency-Key` header. A repeat with the same key answers with the first\n * run's `jobId`; nothing new is started or charged.\n *\n * Refusals (thrown as a `NodaroError` subclass; body `{ error: { code, message } }`):\n * - 400 `validation_error` (the body, a query, or a bad `cursor`);\n * `estimate()` / `run()` only, before anything is charged:\n * `missing_slot` (a required slot without pictures, or an optional one\n * left empty that the chosen example has no pictures for), `unknown_slot`,\n * `invalid_choice` (a chip the slot's kind does not take),\n * `chip_not_offered` (a chip of the kind that the slot's\n * {@link TrendDetailSlot.chips} does not list: the trend fixes it),\n * `example_out_of_range` (`example` names no example of the trend, or is\n * sent at all on a trend with none), `preview_unavailable` (the trend offers no\n * preview), `invalid_slot_mention` (a `{slot:<key>}` in `details` naming no\n * slot), `prompt_too_long` (shorten `details`), `draft_unsupported`\n * (`draft: true` on a trend whose `engine` has no draft: Nodaro Motion Lite),\n * `resolution_unsupported` (a `resolution` not in the trend's\n * `resolutions`), `too_many_images` (a Nodaro Motion Lite trend's run would send more\n * than 10 pictures: send fewer per slot). The slot errors carry the\n * slot's key as `slot` (in `NodaroError.details`), and `chip_not_offered`\n * the chip as `chip` too.\n * - 401 `unauthorized`.\n * - 404 `not_found`: the trend is not published (every method), or `run()`'s\n * `sessionId` is not a session you may use.\n * - 502 `engine_error` (`estimate()` / `run()`).\n * - 503 `engine_unsupported` (this platform version cannot run trends yet),\n * `trend_unavailable` (`estimate()` / `run()`), `not_available` (this\n * server has no trend catalog yet).\n * - `estimate()` / `run()` answer the video engine's refusals with the trend\n * routes' OWN codes and fixed messages — never the engine's text or\n * `issues`: 400 `trend_run_rejected` (the inputs could not run), or\n * `clip_out_of_range` / `preview_out_of_range` / `video_unreadable` (this\n * trend's clip), `unsafe_url` (a picture is not a public http(s) address),\n * `raw_reference_token` (`details` holds `{image:` / `{video:` /\n * `{audio:`); 402 `insufficient_credits` (or a workspace cap) as given;\n * 413 `storage_limit_exceeded`; 422 `job_blocked` (the job policy\n * blocked it); 429 `rate_limited`; 503 `engine_unsupported`,\n * `estimate_unavailable`; 502 `engine_error` for anything else. `run()`\n * also answers 400 `validation_error` for an `idempotencyKey` outside\n * 8–200 characters.\n */\n\n/** `/v1/trends/runs` is the run list and `/v1/trends/tags` the tag list, so neither can be a trend's slug. */\nconst RESERVED_SLUGS: Readonly<Record<string, string>> = {\n runs: \"the run list; use runs()\",\n tags: \"the tag list; use tags()\",\n}\n\nfunction trendPath(slug: string, rest = \"\"): string {\n if (Object.hasOwn(RESERVED_SLUGS, slug)) {\n throw new TypeError(`\"${slug}\" is not a trend slug (it is reserved for ${RESERVED_SLUGS[slug]})`)\n }\n return `/v1/trends/${encodeURIComponent(slug)}${rest}`\n}\n\n/** What a slot holds. */\nexport type TrendSlotKind = \"person\" | \"location\" | \"product\" | \"pet\"\n\n/** A chip: make this trait anew from your pictures (`\"new\"`), or keep the clip's (`\"original\"`). */\nexport type TrendChoice = \"new\" | \"original\"\n\n/**\n * The chips a slot can take, by its kind: a person `body` / `outfit` / `hair`,\n * a pet `body` / `coat`, a product `shape` / `finish`, a location none.\n */\nexport interface TrendChips {\n body?: TrendChoice\n outfit?: TrendChoice\n hair?: TrendChoice\n coat?: TrendChoice\n shape?: TrendChoice\n finish?: TrendChoice\n}\n\n/** A chip's name: `body`, `outfit`, `hair`, `coat`, `shape` or `finish`. */\nexport type TrendChipKey = keyof TrendChips\n\nexport type TrendResolution = \"480p\" | \"720p\" | \"1080p\"\n\n/**\n * The engine a trend runs on, by its public id ({@link CastSwapEngine}):\n * `\"motion-pro\"` (Nodaro Motion Pro) or `\"motion-lite\"` (Nodaro Motion Lite).\n * The trend chooses it, never the person running it.\n */\nexport type TrendEngine = CastSwapEngine\n\n/** A trend in the catalog (`list()`). Text is in the resolved locale. */\nexport interface TrendCard {\n id: string\n slug: string\n name: string\n description?: string\n tags: string[]\n /** e.g. `\"trending\"`, `\"new\"`. */\n badges: string[]\n /**\n * The trend's first example, else (a trend with no example) its original's\n * display copy, as {@link TrendDetail.original}.\n */\n cover: { videoUrl: string; posterUrl?: string; width: number; height: number }\n /** How many slots of each kind the trend has. */\n needs: Record<TrendSlotKind, number>\n /** The length of a full run, in seconds. */\n durationSec: number\n isFavorite: boolean\n}\n\n/** One slot of a trend: what it asks you for. */\nexport interface TrendDetailSlot {\n /** The key to fill in {@link TrendRunRequest.slots}, and to mention in `details` as `{slot:<key>}`. */\n key: string\n label: string\n kind: TrendSlotKind\n /**\n * A required slot needs pictures; an optional one left empty takes the\n * chosen example's, or, on a trend with no example, stays as in the original.\n */\n required: boolean\n hint?: string\n /**\n * A picture showing who or what this slot is in the original (e.g. a frame\n * of that actor), when the trend has one. Show it on an empty slot; a run\n * never sends it.\n */\n hintImageUrl?: string\n /**\n * The chips you may set on this slot, in its kind's order; `[]` = none (show\n * no chips row). A chip of the kind that is not listed is fixed by the\n * trend: sending it is refused with `400 chip_not_offered`.\n */\n chips: TrendChipKey[]\n /** The starting value of the chips in {@link chips} (only those). */\n defaults?: TrendChips\n}\n\n/** A finished run shown on a trend's page, with the pictures it used per slot. */\nexport interface TrendExample {\n videoUrl: string\n posterUrl?: string\n width: number\n height: number\n /** Slot key → the pictures this example used for it. */\n slots: Record<string, string[]>\n}\n\n/**\n * The clip a trend recasts, as you may show it: a browser-safe copy (H.264\n * MP4) of the clip every run starts from. Its fields parallel\n * {@link TrendExample}'s.\n */\nexport interface TrendOriginal {\n videoUrl: string\n posterUrl?: string\n width: number\n height: number\n /** The copy's length, in seconds. */\n durationSec: number\n /**\n * Where the 4-second preview starts in the clip, in seconds (`0` included),\n * when the trend offers one ({@link TrendDetail.previewSec} is `4`); absent\n * otherwise.\n */\n previewStartSec?: number\n}\n\n/** A trend's page (`get()`). */\nexport interface TrendDetail extends TrendCard {\n /** The published version this page shows. */\n version: number\n /** `4` when the trend offers a 4-second preview run, else `null`. */\n previewSec: 4 | null\n /**\n * The original clip every run starts from, to show beside the examples.\n * Absent only on a version without a display copy (and from an older server).\n */\n original?: TrendOriginal\n /** The engine every run of this trend uses. Absent (an older server) = `\"motion-pro\"`. */\n engine?: TrendEngine\n /** Its name to show: \"Nodaro Motion Pro\" or \"Nodaro Motion Lite\". Absent from an older server. */\n engineName?: string\n /**\n * The resolutions a run may ask for, the default first. Nodaro Motion Pro:\n * `[\"480p\", \"720p\", \"1080p\"]`, where 480p is a draft (show it as one);\n * Nodaro Motion Lite: `[\"720p\", \"1080p\"]`, no draft. Offer exactly these.\n */\n resolutions: TrendResolution[]\n slots: TrendDetailSlot[]\n /** Finished runs to show beside the original; may be empty (a trend with only its original). */\n examples: TrendExample[]\n}\n\n/** What you put in one slot of a run: 1–3 pictures, and the chips the slot offers ({@link TrendDetailSlot.chips}). */\nexport interface TrendRunSlot extends TrendChips {\n images?: string[]\n}\n\n/** The body of `estimate()` and `run()`. */\nexport interface TrendRunRequest {\n /**\n * Slot key → what you put in it. Every required slot needs pictures; an\n * optional slot left out takes the chosen example's, or, on a trend with no\n * example, stays as in the original. 1–3 pictures per slot.\n */\n slots: Record<string, TrendRunSlot>\n /**\n * 1-based example whose pictures fill the optional slots you leave empty.\n * Default 1. Leave it out on a trend with no examples: sending one there\n * answers 400 `example_out_of_range` (and `0` is a `validation_error`).\n */\n example?: number\n /** Your own words, at most 1,000 characters. Mention a slot as `{slot:<key>}`. */\n details?: string\n /** `true` runs a 4-second preview (only when the trend's `previewSec` is `4`). */\n preview?: boolean\n /**\n * One of the trend's {@link TrendDetail.resolutions}; default its first\n * (`\"480p\"` on Nodaro Motion Pro, `\"720p\"` on Nodaro Motion Lite). Another answers 400\n * `resolution_unsupported`.\n */\n resolution?: TrendResolution\n /**\n * A draft run, only at 480p on a Nodaro Motion Pro trend. Default `true` at\n * 480p. `true` on a Nodaro Motion Lite trend answers 400 `draft_unsupported`.\n */\n draft?: boolean\n /**\n * A generation session of yours. Accepted (and checked: one you may not use\n * is a 404), but not yet applied: trend runs are not filed into sessions yet.\n */\n sessionId?: string\n /** Accepted, but not used by the run today. */\n projectId?: string\n /**\n * A full run's own preview: the `jobId` of a completed preview run of this\n * trend that you started. When that preview needed the trend's retry (the\n * clip refused at first), the full run is made that way from the start (the\n * quote includes it). Any other job is ignored, without an error. Must be a uuid\n * (else 400 `validation_error`).\n */\n previewJobId?: string\n /**\n * `run()`: your client app's slug (e.g. `\"tools\"`: lowercase letters,\n * digits and `-`, 1–40 characters, starting with a letter or digit), as on\n * any job: the run's job carries it as `input_data.origin`, so\n * `client.jobs.list({ origin })` finds it. Not a slug is a 400\n * `validation_error`; without it the run has no origin. `estimate()`\n * ignores it.\n */\n origin?: string\n}\n\n/** What a run would cost, in credits (`estimate()`). */\nexport interface TrendEstimate {\n /** The charge the run is expected to come to. */\n expectedCredits: number\n /** What is reserved when the run starts; the run is charged what it actually costs. */\n holdCredits: number\n /**\n * The parts of the quote, by name, for display only: some are alternatives\n * or sit outside the totals (`privacy`, the retry's, beside\n * `privacyCredits`), so read `expectedCredits` and `holdCredits`, never\n * their sum.\n */\n breakdown: Record<string, number>\n /**\n * Only on a trend that retries a clip the video model refuses: the extra\n * credits charged if that retry runs. Not included in `expectedCredits` or\n * `holdCredits`. 0 (or absent) when there is nothing extra to charge.\n */\n privacyCredits?: number\n /** @deprecated read {@link privacyCredits} (an older server answered this name). */\n maskingCredits?: number\n}\n\n/** Per-call options for {@link TrendsResource.run}. */\nexport interface TrendRunOptions {\n /**\n * Sent as the `Idempotency-Key` header, unchanged (an empty string sends no\n * header). The server takes 8–200 characters and answers 400 for any other\n * length. Reuse it when retrying the same run.\n */\n idempotencyKey?: string\n}\n\n/** One slot of a past run, as it was run. Labels are English. */\nexport interface TrendRunDisplaySlot extends TrendChips {\n key: string\n label: string\n kind: TrendSlotKind\n images: string[]\n /**\n * `true` when the slot was left empty and the example's pictures filled it.\n * `false` with no `images`: left empty on a trend with no example, so it\n * stayed as in the original.\n */\n fromExample: boolean\n}\n\n/**\n * One of your trend runs (`runs()`, `getRun()`). Stays readable after the\n * trend moves on or is unpublished.\n *\n * A Full Quality version of a draft is a run of its own, with its own status,\n * result and charge: `fullQualityOf` names the draft it was made from, and it\n * stays listed after that draft is deleted.\n */\nexport interface TrendRun {\n jobId: string\n status: string\n progress: number | null\n /**\n * Why a failed or cancelled run did not finish; `null` otherwise. `code` is\n * `safety-block` or `policy-block` when the job was blocked, `credits` when\n * it ran out of credits partway (it was refunded: ask the person to top up,\n * then run it again), else `cancelled` or `failed`. `message` is the same\n * fixed sentence for every code — branch on `code`, not on the text.\n */\n error: { code?: string; message: string } | null\n createdAt: string\n completedAt: string | null\n /** The trend and version it ran (name in English). */\n trend: { id: string; slug: string; version: number; name: string }\n /**\n * The 1-based example used for empty optional slots; `0` = the trend had no\n * example (none was used: never show it as \"Example 0\").\n */\n example: number\n slots: TrendRunDisplaySlot[]\n details?: string\n preview: boolean\n resolution: string\n draft: boolean\n /** The engine the run was made on. Absent (an older server) = `\"motion-pro\"`. */\n engine?: TrendEngine\n /** Its name to show: \"Nodaro Motion Pro\" or \"Nodaro Motion Lite\". Absent from an older server. */\n engineName?: string\n /** The result, once completed. */\n videoUrl: string | null\n posterUrl: string | null\n creditsCharged: number | null\n /** A Full Quality version: the job id of the run (a draft, or a Nodaro Motion Lite 720p run) it was made from. `null` for any other run. */\n fullQualityOf: string | null\n /**\n * A draft's (or Nodaro Motion Lite 720p run's) newest Full Quality try, if one was started: a pointer only,\n * to know an upgrade exists and how it is going. Its video and charge are on\n * that run, listed on its own (its `fullQualityOf` is this run's `jobId`) —\n * read it there (`getRun(fullQuality.jobId)`). Older tries of the draft (a\n * failed or cancelled one tried again) are not listed by `runs()`;\n * `getRun()` still reads one by its id.\n */\n fullQuality: { jobId: string; status: string } | null\n /**\n * Until when a completed run can be redone in Full Quality — a Nodaro Motion\n * Pro draft (the same take at 1080p) or a Nodaro Motion Lite run at 720p (a new take at\n * 1080p); `null` otherwise.\n */\n fullQualityUntil: string | null\n}\n\nexport interface ListTrendsParams {\n /** Search text. */\n q?: string\n tag?: string\n /** `true` lists only your favorites. */\n favorites?: boolean\n /** A platform language for names and descriptions; default your profile's, then English. */\n locale?: string\n /** The previous page's `next`. */\n cursor?: string\n /** Page size, 1–60 (server default 30). */\n limit?: number\n}\n\nexport interface ListTrendRunsParams {\n /** Only runs of this trend (its slug). */\n trend?: string\n /** The previous page's `next`. */\n cursor?: string\n /** Page size, 1–60 (server default 30). */\n limit?: number\n}\n\n/** A tag in use on the published catalog (`tags()`). */\nexport interface TrendTag {\n /** The tag itself: pass it as `list({ tag })`. */\n tag: string\n /** The tag's label in the resolved locale; the tag itself when it has none. */\n label: string\n /** How many published trends carry it. */\n count: number\n}\n\nexport interface TrendPage<T> {\n data: T[]\n /** Pass back as `cursor` for the next page; `null` on the last one. */\n next: string | null\n}\n\nexport class TrendsResource {\n constructor(private client: NodaroClientCore) {}\n\n /** The published catalog in its curated order (`GET /v1/trends`), a page at a time. */\n list(params: ListTrendsParams = {}): Promise<TrendPage<TrendCard>> {\n const query: Record<string, string> = {}\n if (params.q) query.q = params.q\n if (params.tag) query.tag = params.tag\n if (params.favorites) query.favorites = \"1\"\n if (params.locale) query.locale = params.locale\n if (params.cursor) query.cursor = params.cursor\n if (params.limit !== undefined) query.limit = String(params.limit)\n return this.client.request(\"GET\", \"/v1/trends\", { query })\n }\n\n /** A published trend's page (`GET /v1/trends/:slug`). */\n async get(slug: string, params: { locale?: string } = {}): Promise<TrendDetail> {\n const query: Record<string, string> = {}\n if (params.locale) query.locale = params.locale\n const res = await this.client.request<{ data: TrendDetail }>(\"GET\", trendPath(slug), { query })\n return res.data\n }\n\n /** Quote a run before starting it (`POST /v1/trends/:slug/estimate`); spends nothing. */\n async estimate(slug: string, request: TrendRunRequest): Promise<TrendEstimate> {\n const res = await this.client.request<{ data: TrendEstimate }>(\n \"POST\",\n trendPath(slug, \"/estimate\"),\n { body: request },\n )\n return res.data\n }\n\n /**\n * Start a run (`POST /v1/trends/:slug/runs`, 202). Returns the job to follow.\n * With `options.idempotencyKey` (sent as the `Idempotency-Key` header) a\n * repeat with the same key answers with the first run's `jobId`.\n */\n async run(slug: string, request: TrendRunRequest, options?: TrendRunOptions): Promise<{ jobId: string }> {\n const res = await this.client.request<{ data: { jobId: string } }>(\n \"POST\",\n trendPath(slug, \"/runs\"),\n {\n body: request,\n ...(options?.idempotencyKey ? { headers: { \"Idempotency-Key\": options.idempotencyKey } } : {}),\n },\n )\n return res.data\n }\n\n /**\n * Your trend runs, newest first (`GET /v1/trends/runs`). A Full Quality\n * version of a draft is listed as its own run (`fullQualityOf`).\n */\n runs(params: ListTrendRunsParams = {}): Promise<TrendPage<TrendRun>> {\n const query: Record<string, string> = {}\n if (params.trend) query.trend = params.trend\n if (params.cursor) query.cursor = params.cursor\n if (params.limit !== undefined) query.limit = String(params.limit)\n return this.client.request(\"GET\", \"/v1/trends/runs\", { query })\n }\n\n /**\n * One of your trend runs by its job id (`GET /v1/trends/runs/:jobId`), in\n * the same shape as `runs()`. A job that is not your own trend run is a\n * `NotFoundError`.\n */\n async getRun(jobId: string): Promise<TrendRun> {\n const res = await this.client.request<{ data: TrendRun }>(\"GET\", `/v1/trends/runs/${encodeURIComponent(jobId)}`)\n return res.data\n }\n\n /**\n * The tags in use on the published catalog, each with its label in the\n * resolved locale (`GET /v1/trends/tags`), most used first.\n */\n async tags(params: { locale?: string } = {}): Promise<TrendTag[]> {\n const query: Record<string, string> = {}\n if (params.locale) query.locale = params.locale\n const res = await this.client.request<{ data: TrendTag[] }>(\"GET\", \"/v1/trends/tags\", { query })\n return res.data\n }\n\n /** Add a trend to your favorites (`PUT /v1/trends/:slug/favorite`). */\n async favorite(slug: string): Promise<void> {\n await this.client.request<void>(\"PUT\", trendPath(slug, \"/favorite\"))\n }\n\n /** Remove a trend from your favorites (`DELETE /v1/trends/:slug/favorite`). */\n async unfavorite(slug: string): Promise<void> {\n await this.client.request<void>(\"DELETE\", trendPath(slug, \"/favorite\"))\n }\n}\n"]}
@@ -0,0 +1,23 @@
1
+ 'use strict';
2
+
3
+ // src/resources/trash.ts
4
+ var TrashResource = class {
5
+ constructor(client) {
6
+ this.client = client;
7
+ }
8
+ client;
9
+ /** One newest-first page of the Trash, on your side of the workspace line. */
10
+ list(params = {}) {
11
+ const query = {};
12
+ if (params.projectId) query.projectId = params.projectId;
13
+ if (params.tool) query.tool = params.tool;
14
+ if (params.type !== void 0) query.type = typeof params.type === "string" ? params.type : params.type.join(",");
15
+ if (params.limit !== void 0) query.limit = String(params.limit);
16
+ if (params.cursor) query.cursor = params.cursor;
17
+ return this.client.request("GET", "/v1/trash", { query });
18
+ }
19
+ };
20
+
21
+ exports.TrashResource = TrashResource;
22
+ //# sourceMappingURL=chunk-XKDVEQVD.cjs.map
23
+ //# sourceMappingURL=chunk-XKDVEQVD.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/resources/trash.ts"],"names":[],"mappings":";;;AAyDO,IAAM,gBAAN,MAAoB;AAAA,EACzB,YAAoB,MAAA,EAA0B;AAA1B,IAAA,IAAA,CAAA,MAAA,GAAA,MAAA;AAAA,EAA2B;AAAA,EAA3B,MAAA;AAAA;AAAA,EAGpB,IAAA,CAAK,MAAA,GAA0B,EAAC,EAAuB;AACrD,IAAA,MAAM,QAAgC,EAAC;AACvC,IAAA,IAAI,MAAA,CAAO,SAAA,EAAW,KAAA,CAAM,SAAA,GAAY,MAAA,CAAO,SAAA;AAC/C,IAAA,IAAI,MAAA,CAAO,IAAA,EAAM,KAAA,CAAM,IAAA,GAAO,MAAA,CAAO,IAAA;AACrC,IAAA,IAAI,MAAA,CAAO,IAAA,KAAS,MAAA,EAAW,KAAA,CAAM,OAAO,OAAO,MAAA,CAAO,IAAA,KAAS,QAAA,GAAW,MAAA,CAAO,IAAA,GAAO,MAAA,CAAO,IAAA,CAAK,KAAK,GAAG,CAAA;AAChH,IAAA,IAAI,OAAO,KAAA,KAAU,MAAA,QAAiB,KAAA,GAAQ,MAAA,CAAO,OAAO,KAAK,CAAA;AACjE,IAAA,IAAI,MAAA,CAAO,MAAA,EAAQ,KAAA,CAAM,MAAA,GAAS,MAAA,CAAO,MAAA;AACzC,IAAA,OAAO,KAAK,MAAA,CAAO,OAAA,CAAQ,OAAO,WAAA,EAAa,EAAE,OAAO,CAAA;AAAA,EAC1D;AACF","file":"chunk-XKDVEQVD.cjs","sourcesContent":["import type { NodaroClientCore } from \"../core.js\"\nimport type { Job } from \"./jobs.js\"\n\n/** The session a removed item was removed from. */\nexport interface TrashSession {\n id: string\n title: string | null\n projectId: string | null\n}\n\n/**\n * One entry of the Trash: an item removed from a session, or a deleted job.\n * Narrow on `kind`.\n *\n * - `removed`: kept until restored (`client.sessions.restoreItem(session.id, job.id)`)\n * or deleted for good (`client.sessions.removeItem(session.id, job.id, { forever: true })`).\n * - `deleted`: kept until `purgeAt` (30 days after `deletedAt`), then deleted for\n * good (a copy saved to the Library stays); restore with `client.jobs.restore(job.id)`, or delete\n * now with `client.jobs.delete(job.id, { forever: true })`.\n *\n * A removed item whose job was also deleted is listed once, as the deleted job.\n */\nexport type TrashEntry =\n | { kind: \"removed\"; removedAt: string; session: TrashSession; job: Job }\n | { kind: \"deleted\"; deletedAt: string; purgeAt: string; job: Job }\n\nexport interface ListTrashParams {\n /**\n * A project's id: its sessions' removed items, and deleted jobs a session of\n * it held. `\"none\"`: the sessions with no project, and General.\n */\n projectId?: string | \"none\"\n /**\n * A creation tool (e.g. `\"create-image\"`): what a session of that tool holds\n * or held. A job no session ever held has no tool and is left out — filter by\n * `type` alone to include it.\n */\n tool?: string\n /**\n * The job's `input_data.type` (`\"generate-image\"`, …), like `client.jobs.list`.\n * One value or several (up to 20). Every filter combines with AND.\n */\n type?: string | readonly string[]\n /** Page size, 1–100 (server default 50). */\n limit?: number\n /** The previous page's `next`. */\n cursor?: string\n}\n\nexport interface TrashPage {\n /** A page may hold fewer than `limit` entries and still carry a `next`; page on `next`. */\n data: TrashEntry[]\n /** Pass back as `cursor` for the next page; `null` on the last one. */\n next: string | null\n}\n\n/** Your Trash (`GET /v1/trash`): one entry beside General in a creation tool's sessions list. */\nexport class TrashResource {\n constructor(private client: NodaroClientCore) {}\n\n /** One newest-first page of the Trash, on your side of the workspace line. */\n list(params: ListTrashParams = {}): Promise<TrashPage> {\n const query: Record<string, string> = {}\n if (params.projectId) query.projectId = params.projectId\n if (params.tool) query.tool = params.tool\n if (params.type !== undefined) query.type = typeof params.type === \"string\" ? params.type : params.type.join(\",\")\n if (params.limit !== undefined) query.limit = String(params.limit)\n if (params.cursor) query.cursor = params.cursor\n return this.client.request(\"GET\", \"/v1/trash\", { query })\n }\n}\n"]}
@@ -36,7 +36,7 @@ async function readBinaryResponse(response, maxBytes) {
36
36
  }
37
37
  return bytes.buffer;
38
38
  }
39
- var SDK_VERSION = "2.44.0" ;
39
+ var SDK_VERSION = "2.46.0" ;
40
40
  var CLIENT_HEADER = "X-Nodaro-Client";
41
41
  var isBrowser = () => typeof window !== "undefined" && typeof window.document !== "undefined";
42
42
  var NodaroClientCore = class {
@@ -229,5 +229,5 @@ exports.CallbackAuth = CallbackAuth;
229
229
  exports.NodaroClientCore = NodaroClientCore;
230
230
  exports.StaticTokenAuth = StaticTokenAuth;
231
231
  exports.supabaseAuth = supabaseAuth;
232
- //# sourceMappingURL=chunk-MPQQC45L.cjs.map
233
- //# sourceMappingURL=chunk-MPQQC45L.cjs.map
232
+ //# sourceMappingURL=chunk-ZJCHIJND.cjs.map
233
+ //# sourceMappingURL=chunk-ZJCHIJND.cjs.map