@nodaro/sdk 2.73.0 → 2.74.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 (167) hide show
  1. package/dist/{chunk-BY3XIXWC.js → chunk-3GF4VPK4.js} +2 -2
  2. package/dist/chunk-3GF4VPK4.js.map +1 -0
  3. package/dist/{chunk-C4LXPSSF.cjs → chunk-7OLINQTA.cjs} +2 -2
  4. package/dist/chunk-7OLINQTA.cjs.map +1 -0
  5. package/dist/{chunk-25IKUIM3.js → chunk-AZMUM5WG.js} +2 -2
  6. package/dist/chunk-AZMUM5WG.js.map +1 -0
  7. package/dist/{chunk-Z3RI7CSA.cjs → chunk-DUE24QGQ.cjs} +2 -2
  8. package/dist/chunk-DUE24QGQ.cjs.map +1 -0
  9. package/dist/{chunk-ROUCXQU3.js → chunk-H77BJMV2.js} +2 -2
  10. package/dist/chunk-H77BJMV2.js.map +1 -0
  11. package/dist/{chunk-VHHLYDF5.js → chunk-IKJNFENZ.js} +6 -6
  12. package/dist/{chunk-VHHLYDF5.js.map → chunk-IKJNFENZ.js.map} +1 -1
  13. package/dist/{chunk-O4UXEIV6.cjs → chunk-NECPBLEM.cjs} +2 -2
  14. package/dist/chunk-NECPBLEM.cjs.map +1 -0
  15. package/dist/{chunk-JWWRUP6Z.js → chunk-NJ5ZFUWJ.js} +3 -3
  16. package/dist/{chunk-JWWRUP6Z.js.map → chunk-NJ5ZFUWJ.js.map} +1 -1
  17. package/dist/{chunk-47TWDFFJ.cjs → chunk-SRL555ST.cjs} +3 -3
  18. package/dist/{chunk-47TWDFFJ.cjs.map → chunk-SRL555ST.cjs.map} +1 -1
  19. package/dist/{chunk-NZUF5U37.cjs → chunk-VVVJW4DD.cjs} +10 -10
  20. package/dist/{chunk-NZUF5U37.cjs.map → chunk-VVVJW4DD.cjs.map} +1 -1
  21. package/dist/{developer-apps-CMUzKpE9.d.ts → developer-apps-D59GfAnO.d.cts} +7 -0
  22. package/dist/{developer-apps-CMUzKpE9.d.cts → developer-apps-D59GfAnO.d.ts} +7 -0
  23. package/dist/entries/apps.d.cts +1 -1
  24. package/dist/entries/apps.d.ts +1 -1
  25. package/dist/entries/audio.d.cts +1 -1
  26. package/dist/entries/audio.d.ts +1 -1
  27. package/dist/entries/billing.d.cts +1 -1
  28. package/dist/entries/billing.d.ts +1 -1
  29. package/dist/entries/cast-swap.d.cts +1 -1
  30. package/dist/entries/cast-swap.d.ts +1 -1
  31. package/dist/entries/catalogs.cjs +2 -2
  32. package/dist/entries/catalogs.d.cts +10 -3
  33. package/dist/entries/catalogs.d.ts +10 -3
  34. package/dist/entries/catalogs.js +1 -1
  35. package/dist/entries/characters.d.cts +3 -3
  36. package/dist/entries/characters.d.ts +3 -3
  37. package/dist/entries/client.cjs +10 -10
  38. package/dist/entries/client.d.cts +5 -5
  39. package/dist/entries/client.d.ts +5 -5
  40. package/dist/entries/client.js +5 -5
  41. package/dist/entries/collections.d.cts +1 -1
  42. package/dist/entries/collections.d.ts +1 -1
  43. package/dist/entries/community.d.cts +1 -1
  44. package/dist/entries/community.d.ts +1 -1
  45. package/dist/entries/competitors.d.cts +1 -1
  46. package/dist/entries/competitors.d.ts +1 -1
  47. package/dist/entries/content-rights.d.cts +1 -1
  48. package/dist/entries/content-rights.d.ts +1 -1
  49. package/dist/entries/copilot.d.cts +1 -1
  50. package/dist/entries/copilot.d.ts +1 -1
  51. package/dist/entries/core.cjs +5 -5
  52. package/dist/entries/core.d.cts +1 -1
  53. package/dist/entries/core.d.ts +1 -1
  54. package/dist/entries/core.js +1 -1
  55. package/dist/entries/creatures.d.cts +3 -3
  56. package/dist/entries/creatures.d.ts +3 -3
  57. package/dist/entries/credits.d.cts +1 -1
  58. package/dist/entries/credits.d.ts +1 -1
  59. package/dist/entries/developer-apps.d.cts +1 -1
  60. package/dist/entries/developer-apps.d.ts +1 -1
  61. package/dist/entries/dubbing.d.cts +1 -1
  62. package/dist/entries/dubbing.d.ts +1 -1
  63. package/dist/entries/edit.d.cts +1 -1
  64. package/dist/entries/edit.d.ts +1 -1
  65. package/dist/entries/errors.d.cts +2 -2
  66. package/dist/entries/errors.d.ts +2 -2
  67. package/dist/entries/executions.d.cts +1 -1
  68. package/dist/entries/executions.d.ts +1 -1
  69. package/dist/entries/gallery.d.cts +1 -1
  70. package/dist/entries/gallery.d.ts +1 -1
  71. package/dist/entries/jobs.d.cts +1 -1
  72. package/dist/entries/jobs.d.ts +1 -1
  73. package/dist/entries/keepers.d.cts +1 -1
  74. package/dist/entries/keepers.d.ts +1 -1
  75. package/dist/entries/library.d.cts +1 -1
  76. package/dist/entries/library.d.ts +1 -1
  77. package/dist/entries/llm.d.cts +1 -1
  78. package/dist/entries/llm.d.ts +1 -1
  79. package/dist/entries/locations.d.cts +3 -3
  80. package/dist/entries/locations.d.ts +3 -3
  81. package/dist/entries/media.d.cts +3 -3
  82. package/dist/entries/media.d.ts +3 -3
  83. package/dist/entries/models.d.cts +1 -1
  84. package/dist/entries/models.d.ts +1 -1
  85. package/dist/entries/moodboards.d.cts +1 -1
  86. package/dist/entries/moodboards.d.ts +1 -1
  87. package/dist/entries/node-presets.cjs +2 -2
  88. package/dist/entries/node-presets.d.cts +8 -4
  89. package/dist/entries/node-presets.d.ts +8 -4
  90. package/dist/entries/node-presets.js +1 -1
  91. package/dist/entries/nodes.d.cts +3 -3
  92. package/dist/entries/nodes.d.ts +3 -3
  93. package/dist/entries/oauth.d.cts +1 -1
  94. package/dist/entries/oauth.d.ts +1 -1
  95. package/dist/entries/objects.d.cts +3 -3
  96. package/dist/entries/objects.d.ts +3 -3
  97. package/dist/entries/organizations.d.cts +1 -1
  98. package/dist/entries/organizations.d.ts +1 -1
  99. package/dist/entries/palettes.d.cts +1 -1
  100. package/dist/entries/palettes.d.ts +1 -1
  101. package/dist/entries/picker-catalogs.cjs +2 -2
  102. package/dist/entries/picker-catalogs.d.cts +10 -3
  103. package/dist/entries/picker-catalogs.d.ts +10 -3
  104. package/dist/entries/picker-catalogs.js +1 -1
  105. package/dist/entries/pipelines.d.cts +1 -1
  106. package/dist/entries/pipelines.d.ts +1 -1
  107. package/dist/entries/projects.d.cts +1 -1
  108. package/dist/entries/projects.d.ts +1 -1
  109. package/dist/entries/prompt-helper.d.cts +1 -1
  110. package/dist/entries/prompt-helper.d.ts +1 -1
  111. package/dist/entries/recast.d.cts +1 -1
  112. package/dist/entries/recast.d.ts +1 -1
  113. package/dist/entries/reduce.d.cts +1 -1
  114. package/dist/entries/reduce.d.ts +1 -1
  115. package/dist/entries/saved-posts.d.cts +1 -1
  116. package/dist/entries/saved-posts.d.ts +1 -1
  117. package/dist/entries/scene3d.d.cts +4 -4
  118. package/dist/entries/scene3d.d.ts +4 -4
  119. package/dist/entries/sessions.d.cts +1 -1
  120. package/dist/entries/sessions.d.ts +1 -1
  121. package/dist/entries/shots.d.cts +1 -1
  122. package/dist/entries/shots.d.ts +1 -1
  123. package/dist/entries/studio.d.cts +3 -3
  124. package/dist/entries/studio.d.ts +3 -3
  125. package/dist/entries/surface.d.cts +1 -1
  126. package/dist/entries/surface.d.ts +1 -1
  127. package/dist/entries/templates.d.cts +1 -1
  128. package/dist/entries/templates.d.ts +1 -1
  129. package/dist/entries/trash.d.cts +1 -1
  130. package/dist/entries/trash.d.ts +1 -1
  131. package/dist/entries/trend-radar.d.cts +1 -1
  132. package/dist/entries/trend-radar.d.ts +1 -1
  133. package/dist/entries/trends.d.cts +1 -1
  134. package/dist/entries/trends.d.ts +1 -1
  135. package/dist/entries/tutorials.d.cts +1 -1
  136. package/dist/entries/tutorials.d.ts +1 -1
  137. package/dist/entries/uploads.d.cts +1 -1
  138. package/dist/entries/uploads.d.ts +1 -1
  139. package/dist/entries/user-settings.d.cts +1 -1
  140. package/dist/entries/user-settings.d.ts +1 -1
  141. package/dist/entries/video-pro.d.cts +1 -1
  142. package/dist/entries/video-pro.d.ts +1 -1
  143. package/dist/entries/voices.d.cts +1 -1
  144. package/dist/entries/voices.d.ts +1 -1
  145. package/dist/entries/webhooks.d.cts +3 -3
  146. package/dist/entries/webhooks.d.ts +3 -3
  147. package/dist/entries/workflows.d.cts +1 -1
  148. package/dist/entries/workflows.d.ts +1 -1
  149. package/dist/entries/workspaces.d.cts +1 -1
  150. package/dist/entries/workspaces.d.ts +1 -1
  151. package/dist/index.cjs +14 -14
  152. package/dist/index.d.cts +4 -4
  153. package/dist/index.d.ts +4 -4
  154. package/dist/index.js +5 -5
  155. package/dist/{nodes-CB5hXtZV.d.ts → nodes-CHXTwiWW.d.ts} +11 -1
  156. package/dist/{nodes-RenTt7e3.d.cts → nodes-DEGPmZ9a.d.cts} +11 -1
  157. package/dist/{studio-productions-CMiS827q.d.cts → studio-productions-Cd_AEbKh.d.cts} +1 -1
  158. package/dist/{studio-productions-DkI51Z9M.d.ts → studio-productions-CsFExPit.d.ts} +1 -1
  159. package/dist/{webhooks-C2DZTK4n.d.ts → webhooks-Bbrs93kN.d.ts} +1 -1
  160. package/dist/{webhooks-tg3VN39V.d.cts → webhooks-CqM7KFa6.d.cts} +1 -1
  161. package/package.json +3 -3
  162. package/dist/chunk-25IKUIM3.js.map +0 -1
  163. package/dist/chunk-BY3XIXWC.js.map +0 -1
  164. package/dist/chunk-C4LXPSSF.cjs.map +0 -1
  165. package/dist/chunk-O4UXEIV6.cjs.map +0 -1
  166. package/dist/chunk-ROUCXQU3.js.map +0 -1
  167. package/dist/chunk-Z3RI7CSA.cjs.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/resources/node-presets.ts"],"names":[],"mappings":";;;AAoLO,IAAM,kBAAN,MAAsB;AAAA,EAC3B,YAAoB,MAAA,EAA0B;AAA1B,IAAA,IAAA,CAAA,MAAA,GAAA,MAAA;AAAA,EAA2B;AAAA,EAA3B,MAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMpB,MAAM,KAAK,QAAA,EAA0C;AACnD,IAAA,MAAM,KAAK,QAAA,GAAW,CAAA,UAAA,EAAa,kBAAA,CAAmB,QAAQ,CAAC,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,CAAA,uBAAA,EAA0B,kBAAA,CAAmB,EAAE,CAAC,CAAA,CAAA,EAAI;AAAA,MAC5H,IAAA,EAAM;AAAA,KACP,CAAA;AACD,IAAA,OAAO,GAAA,CAAI,IAAA;AAAA,EACb;AAAA;AAAA,EAGA,MAAM,YAAY,EAAA,EAAwC;AACxD,IAAA,MAAM,GAAA,GAAM,MAAM,IAAA,CAAK,MAAA,CAAO,OAAA,CAAqC,UAAU,CAAA,uBAAA,EAA0B,kBAAA,CAAmB,EAAE,CAAC,CAAA,CAAE,CAAA;AAC/H,IAAA,OAAO,GAAA,CAAI,IAAA;AAAA,EACb;AACF","file":"chunk-Z3RI7CSA.cjs","sourcesContent":["import type { NodaroClientCore } from \"../core.js\"\nimport type { FactoryPreset } from \"@nodaro/prompts/presets\"\n\n/**\n * A user's saved custom preset (`GET /v1/node-presets`). Mirrors the backend's\n * camelCase row shape. `data` is captured node config — merge it into a node's\n * data when building/running a workflow to \"apply\" the preset.\n */\nexport interface NodePreset {\n id: string\n nodeType: string\n name: string\n description?: string\n data: Record<string, unknown>\n groupId?: string\n tags: string[]\n sortOrder: number\n /**\n * How many connected reference images the preset works from (0 = none),\n * counted from the `{image:N}` tokens in its prompt. Absent from servers that\n * predate it.\n */\n minReferences?: number\n /** `minReferences > 0` — the preset works from a connected photo. */\n needsImage?: boolean\n /** The example picture stored with the preset, or null. */\n previewUrl?: string | null\n createdAt: string\n updatedAt: string\n}\n\n/** A user's preset folder/section (`GET /v1/node-preset-groups`). */\nexport interface NodePresetGroup {\n id: string\n nodeType: string\n name: string\n kind: \"folder\" | \"section\"\n sortOrder: number\n createdAt: string\n updatedAt: string\n}\n\n/**\n * One built-in preset as `GET /v1/node-presets/factory` serves it: the\n * catalog entry plus what a client needs to present it.\n */\nexport interface FactoryPresetEntry extends FactoryPreset {\n /**\n * How many connected reference images the preset works from (0 = none):\n * Reference Sheet, Portrait Transformations, Edits and every template using\n * `{image:N}` need at least one. Absent from servers that predate it.\n */\n minReferences?: number\n /** `minReferences > 0` — the preset works from a connected photo. */\n needsImage?: boolean\n /**\n * An example picture of what the preset makes — an absolute URL on the\n * server you asked — or null while the preset has none.\n */\n previewUrl?: string | null\n /**\n * The same picture at its two sizes for an `<img srcset>` — the tile picture\n * at 512w and the full-screen one at up to 1024w. Present only when the\n * preset has both; absent from servers that predate it.\n */\n previewSrcSet?: string\n /**\n * The tile picture's real width and height (`previewUrl`'s), so a client\n * draws it in a box of its own shape before it loads — a preset's\n * `data.aspectRatio` is what it generates, not always its picture's shape.\n * Present for a built-in picture; absent from servers that predate it.\n */\n previewWidth?: number\n previewHeight?: number\n}\n\n/**\n * Result of `GET /v1/node-presets/factory` — the built-in (factory) catalog for\n * a node type.\n */\nexport interface FactoryPresetsResult {\n data: FactoryPresetEntry[]\n}\n\n/**\n * One category (group) of the built-in catalog, as `listFactoryGroups()` lists\n * it: enough to show the categories (a menu, a shelf) without the whole catalog.\n */\nexport interface FactoryPresetGroupSummary {\n /** The group's name, as the presets carry it (`FactoryPresetEntry.group`). */\n group: string\n /**\n * The shelf a picker files it under: `\"video\"`, `\"marketing\"`, `\"photos\"`,\n * `\"creative\"`, `\"life\"`, `\"pro\"` (the pro catalog), or `\"more\"` (a group no\n * shelf names yet). Shown in that order.\n */\n shelf: string\n /** How many presets it holds. */\n count: number\n /** The example picture of its first preset that has one, or null. */\n previewUrl: string | null\n /** Its first example pictures, in catalog order, each once: at most three (empty when none has one). */\n previewUrls: string[]\n}\n\n/** `POST /v1/node-presets` body. */\nexport interface CreateNodePresetInput {\n /** The node type the preset configures, e.g. `\"generate-image\"`. */\n nodeType: string\n /** Unique per node type (case-insensitive); a duplicate answers 409 `name_taken`. */\n name: string\n description?: string\n /** Node config (≤ 64 KB). Runtime keys (results, job ids, labels) are stripped. */\n data: Record<string, unknown>\n /** One of your preset groups, or null for none. */\n groupId?: string | null\n tags?: string[]\n sortOrder?: number\n /**\n * An example picture: an image stored on this platform (an upload or a\n * generated result) that already exists. Anything else answers 400.\n */\n previewUrl?: string | null\n}\n\n/** `PATCH /v1/node-presets/:id` body — every field optional; `previewUrl: null` removes the picture. */\nexport type UpdateNodePresetInput = Partial<Omit<CreateNodePresetInput, \"nodeType\">>\n\n/** One entry of `POST /v1/node-presets/import` (the `presets export` envelope's entries fit). */\nexport interface ImportNodePresetInput {\n nodeType: string\n name: string\n description?: string\n data: Record<string, unknown>\n previewUrl?: string | null\n}\n\n/** `POST /v1/node-presets/reorder` body. */\nexport interface ReorderNodePresetsInput {\n groups?: Array<{ id: string; sortOrder: number }>\n /** `groupId` moves the preset into one of your groups (null = out of any group). */\n presets?: Array<{ id: string; groupId?: string | null; sortOrder: number }>\n}\n\n/** A favorite: a factory preset id (`\"generate-image/character-board\"`) or one of your preset ids. */\nexport interface NodePresetFavoriteInput {\n nodeType: string\n presetId: string\n}\n\n/** `POST /v1/node-preset-groups` body. */\nexport interface CreateNodePresetGroupInput {\n nodeType: string\n name: string\n /** A collapsible `\"folder\"` (default) or a flat `\"section\"` header. */\n kind?: \"folder\" | \"section\"\n sortOrder?: number\n}\n\n/** `PATCH /v1/node-preset-groups/:id` body. */\nexport interface UpdateNodePresetGroupInput {\n name?: string\n sortOrder?: number\n}\n\n/**\n * Node presets — reusable, named node configurations: your own presets and\n * folders, your favorites, and the built-in factory catalog.\n *\n * To *use* a preset, take its `data` and merge it into a node's config when you\n * create/update a workflow. `needsImage` / `minReferences` say how many photos\n * it works from; `previewUrl` is an example picture (null when there is none).\n *\n * The factory catalog (`listFactory`) is public: no token needed. Reads of\n * your own library need the `presets:read` scope for an OAuth app token;\n * writes (create, update, delete, import, reorder, favorites, groups) need\n * `assets:write`. Your own API key needs neither — but a key limited to some\n * workflows cannot reach your own presets (it reads the factory catalog as\n * anyone can).\n */\nexport class PresetsResource {\n constructor(private client: NodaroClientCore) {}\n\n /**\n * `GET /v1/node-presets` → your custom presets, newest first. Pass `nodeType`\n * (e.g. `\"generate-image\"`) to filter to one node type.\n */\n async list(nodeType?: string): Promise<NodePreset[]> {\n const qs = nodeType ? `?nodeType=${encodeURIComponent(nodeType)}` : \"\"\n const res = await this.client.request<{ data: NodePreset[] }>(\"GET\", `/v1/node-presets${qs}`)\n return res.data\n }\n\n /**\n * `GET /v1/node-preset-groups` → your preset folders/sections, in display\n * order. Pass `nodeType` to filter to one node type.\n */\n async listGroups(nodeType?: string): Promise<NodePresetGroup[]> {\n const qs = nodeType ? `?nodeType=${encodeURIComponent(nodeType)}` : \"\"\n const res = await this.client.request<{ data: NodePresetGroup[] }>(\"GET\", `/v1/node-preset-groups${qs}`)\n return res.data\n }\n\n /**\n * `GET /v1/node-presets/factory` → the built-in catalog for `nodeType`. These\n * ship with the app (no account needed to exist), so they're a good starting\n * point for \"what configs are available\".\n *\n * Login is optional: the catalog is public, so this works on a client with\n * no credential at all (`auth: { getToken: async () => null }`) — show the\n * names, example pictures (`previewUrl`) and photo counts (`minReferences`,\n * `needsImage`) to a visitor who is not signed in, and ask for a login only\n * when they generate. Your OWN presets (`list()`) still need a token.\n */\n listFactory(nodeType: string): Promise<FactoryPresetsResult> {\n return this.client.request<FactoryPresetsResult>(\n \"GET\",\n `/v1/node-presets/factory?nodeType=${encodeURIComponent(nodeType)}`,\n )\n }\n\n /**\n * `GET /v1/node-presets/factory/groups` → the built-in catalog's categories for\n * `nodeType`, in the order a picker shows them (shelf by shelf, then the\n * design's order, then catalog order): each group's name, its shelf, how many\n * presets it holds and its first example picture. A few KB where `listFactory()` is the\n * whole catalog: for a menu or a shelf that lists the categories. Public, as\n * `listFactory()` is: no credential needed.\n */\n async listFactoryGroups(nodeType: string): Promise<FactoryPresetGroupSummary[]> {\n const res = await this.client.request<{ data: FactoryPresetGroupSummary[] }>(\n \"GET\",\n `/v1/node-presets/factory/groups?nodeType=${encodeURIComponent(nodeType)}`,\n )\n return res.data\n }\n\n /** `POST /v1/node-presets` → the new preset. */\n async create(input: CreateNodePresetInput): Promise<NodePreset> {\n const res = await this.client.request<{ data: NodePreset }>(\"POST\", \"/v1/node-presets\", { body: input })\n return res.data\n }\n\n /**\n * `PATCH /v1/node-presets/:id` → the updated preset. Pass the `updatedAt` you\n * read as `expectedUpdatedAt` to refuse (409 `conflict`) a change made\n * elsewhere since.\n */\n async update(id: string, patch: UpdateNodePresetInput, opts: { expectedUpdatedAt?: string } = {}): Promise<NodePreset> {\n const body = opts.expectedUpdatedAt ? { ...patch, expectedUpdatedAt: opts.expectedUpdatedAt } : patch\n const res = await this.client.request<{ data: NodePreset }>(\"PATCH\", `/v1/node-presets/${encodeURIComponent(id)}`, { body })\n return res.data\n }\n\n /** `DELETE /v1/node-presets/:id` (404 when it is not yours). `expectedUpdatedAt` as on `update`. */\n async delete(id: string, opts: { expectedUpdatedAt?: string } = {}): Promise<{ success: true }> {\n const res = await this.client.request<{ data: { success: true } }>(\"DELETE\", `/v1/node-presets/${encodeURIComponent(id)}`, {\n query: { expectedUpdatedAt: opts.expectedUpdatedAt },\n })\n return res.data\n }\n\n /**\n * `POST /v1/node-presets/import` — up to 500 presets in one call. A name you\n * already use gets an \"(imported N)\" suffix; a preset whose data is empty\n * after stripping runtime keys is skipped.\n */\n async import(presets: ImportNodePresetInput[]): Promise<{ imported: number }> {\n const res = await this.client.request<{ data: { imported: number } }>(\"POST\", \"/v1/node-presets/import\", { body: { presets } })\n return res.data\n }\n\n /** `POST /v1/node-presets/reorder` — positions (and group membership) for many presets and groups at once. */\n async reorder(input: ReorderNodePresetsInput): Promise<{ ok: true }> {\n const res = await this.client.request<{ data: { ok: true } }>(\"POST\", \"/v1/node-presets/reorder\", { body: input })\n return res.data\n }\n\n /** `GET /v1/node-presets/favorites` → your favorite preset ids for `nodeType`, newest first. */\n async favorites(nodeType: string): Promise<string[]> {\n const res = await this.client.request<{ data: string[] }>(\"GET\", \"/v1/node-presets/favorites\", { query: { nodeType } })\n return res.data\n }\n\n /** `POST /v1/node-presets/favorites` — idempotent. */\n async addFavorite(input: NodePresetFavoriteInput): Promise<{ success: true }> {\n const res = await this.client.request<{ data: { success: true } }>(\"POST\", \"/v1/node-presets/favorites\", { body: input })\n return res.data\n }\n\n /** `DELETE /v1/node-presets/favorites` — idempotent. */\n async removeFavorite(input: NodePresetFavoriteInput): Promise<{ success: true }> {\n const res = await this.client.request<{ data: { success: true } }>(\"DELETE\", \"/v1/node-presets/favorites\", {\n query: { nodeType: input.nodeType, presetId: input.presetId },\n })\n return res.data\n }\n\n /** `POST /v1/node-preset-groups` → the new folder or section. */\n async createGroup(input: CreateNodePresetGroupInput): Promise<NodePresetGroup> {\n const res = await this.client.request<{ data: NodePresetGroup }>(\"POST\", \"/v1/node-preset-groups\", { body: input })\n return res.data\n }\n\n /** `PATCH /v1/node-preset-groups/:id` → the renamed or moved group. */\n async updateGroup(id: string, patch: UpdateNodePresetGroupInput): Promise<NodePresetGroup> {\n const res = await this.client.request<{ data: NodePresetGroup }>(\"PATCH\", `/v1/node-preset-groups/${encodeURIComponent(id)}`, {\n body: patch,\n })\n return res.data\n }\n\n /** `DELETE /v1/node-preset-groups/:id` — its presets move out of the group; none are deleted. */\n async deleteGroup(id: string): Promise<{ success: true }> {\n const res = await this.client.request<{ data: { success: true } }>(\"DELETE\", `/v1/node-preset-groups/${encodeURIComponent(id)}`)\n return res.data\n }\n}\n"]}