@nodaro/sdk 2.34.0 → 2.39.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-JMOKD6ZP.js → chunk-7CUWAVWB.js} +3 -3
- package/dist/{chunk-JMOKD6ZP.js.map → chunk-7CUWAVWB.js.map} +1 -1
- package/dist/{chunk-E5BM4BLO.js → chunk-7IWVDWSP.js} +20 -3
- package/dist/chunk-7IWVDWSP.js.map +1 -0
- package/dist/{chunk-RHJRLXKY.cjs → chunk-7XOK277W.cjs} +9 -9
- package/dist/{chunk-RHJRLXKY.cjs.map → chunk-7XOK277W.cjs.map} +1 -1
- package/dist/{chunk-3QBH2VE2.cjs → chunk-A7QSOD2S.cjs} +20 -3
- package/dist/chunk-A7QSOD2S.cjs.map +1 -0
- package/dist/chunk-AQHU7EI5.js +54 -0
- package/dist/chunk-AQHU7EI5.js.map +1 -0
- package/dist/{chunk-VV4TZG5S.js → chunk-AUKHMT53.js} +3 -3
- package/dist/chunk-AUKHMT53.js.map +1 -0
- package/dist/{chunk-CWH642B2.js → chunk-CIUZMTER.js} +22 -18
- package/dist/chunk-CIUZMTER.js.map +1 -0
- package/dist/{chunk-I6CXC345.js → chunk-D2ILCSOQ.js} +3 -3
- package/dist/{chunk-I6CXC345.js.map → chunk-D2ILCSOQ.js.map} +1 -1
- package/dist/{chunk-4NLVBYMW.js → chunk-DQAYIVVS.js} +42 -8
- package/dist/chunk-DQAYIVVS.js.map +1 -0
- package/dist/{chunk-5ALNFATQ.cjs → chunk-EK672FFM.cjs} +2 -2
- package/dist/chunk-EK672FFM.cjs.map +1 -0
- package/dist/{chunk-OXQKE5EG.cjs → chunk-ETX3TLNB.cjs} +43 -9
- package/dist/{chunk-4NLVBYMW.js.map → chunk-ETX3TLNB.cjs.map} +1 -1
- package/dist/{chunk-BRV7Z4GD.cjs → chunk-FHVNTS4E.cjs} +2 -2
- package/dist/{chunk-BRV7Z4GD.cjs.map → chunk-FHVNTS4E.cjs.map} +1 -1
- package/dist/{chunk-N6GLZOE4.cjs → chunk-FM2KM5TY.cjs} +52 -10
- package/dist/chunk-FM2KM5TY.cjs.map +1 -0
- package/dist/{chunk-53SXNN3A.js → chunk-FQNCIP6K.js} +2 -2
- package/dist/chunk-FQNCIP6K.js.map +1 -0
- package/dist/{chunk-KNMW722T.cjs → chunk-FRQJNGJS.cjs} +5 -5
- package/dist/{chunk-KNMW722T.cjs.map → chunk-FRQJNGJS.cjs.map} +1 -1
- package/dist/{chunk-4CXB7RA6.js → chunk-IGMWFEFB.js} +6 -4
- package/dist/chunk-IGMWFEFB.js.map +1 -0
- package/dist/{chunk-6OGGJQVA.js → chunk-ILG5DHQQ.js} +2 -2
- package/dist/chunk-ILG5DHQQ.js.map +1 -0
- package/dist/{chunk-CFY6XXOT.cjs → chunk-IXCJ26F5.cjs} +37 -33
- package/dist/chunk-IXCJ26F5.cjs.map +1 -0
- package/dist/{chunk-ZQQABQMH.cjs → chunk-JTOEHQQJ.cjs} +12 -2
- package/dist/chunk-JTOEHQQJ.cjs.map +1 -0
- package/dist/{chunk-ZXJQSFIA.js → chunk-JUON5NXA.js} +2 -2
- package/dist/{chunk-ZXJQSFIA.js.map → chunk-JUON5NXA.js.map} +1 -1
- package/dist/{chunk-JGS6YBDW.js → chunk-L6T44A3G.js} +51 -11
- package/dist/chunk-L6T44A3G.js.map +1 -0
- package/dist/{chunk-U4T3Z3K7.cjs → chunk-NKH2UFSD.cjs} +5 -5
- package/dist/chunk-NKH2UFSD.cjs.map +1 -0
- package/dist/{chunk-VFMWBW2Q.js → chunk-NU4QSOMH.js} +4 -4
- package/dist/{chunk-VFMWBW2Q.js.map → chunk-NU4QSOMH.js.map} +1 -1
- package/dist/{chunk-E2ZXHS6E.js → chunk-OIPPTBW4.js} +2 -2
- package/dist/chunk-OIPPTBW4.js.map +1 -0
- package/dist/{chunk-DKEYSJCE.cjs → chunk-OIYMTGYN.cjs} +2 -2
- package/dist/chunk-OIYMTGYN.cjs.map +1 -0
- package/dist/{chunk-NLQQHJ25.cjs → chunk-OSMKIRKI.cjs} +4 -4
- package/dist/{chunk-NLQQHJ25.cjs.map → chunk-OSMKIRKI.cjs.map} +1 -1
- package/dist/chunk-PG2GBS3K.cjs +4 -0
- package/dist/chunk-PG2GBS3K.cjs.map +1 -0
- package/dist/{chunk-GB724HW2.cjs → chunk-PQ7OKM3E.cjs} +6 -4
- package/dist/chunk-PQ7OKM3E.cjs.map +1 -0
- package/dist/chunk-QGOEQGAE.js +102 -0
- package/dist/chunk-QGOEQGAE.js.map +1 -0
- package/dist/{chunk-EAGD6NEE.cjs → chunk-QZHRXPN5.cjs} +22 -22
- package/dist/chunk-QZHRXPN5.cjs.map +1 -0
- package/dist/{chunk-5MTCKWKA.cjs → chunk-QZMI7364.cjs} +5 -5
- package/dist/{chunk-5MTCKWKA.cjs.map → chunk-QZMI7364.cjs.map} +1 -1
- package/dist/chunk-SRBYCGRC.cjs +56 -0
- package/dist/chunk-SRBYCGRC.cjs.map +1 -0
- package/dist/{chunk-KGKCAGRD.cjs → chunk-TCLNSVYA.cjs} +2 -2
- package/dist/chunk-TCLNSVYA.cjs.map +1 -0
- package/dist/chunk-VCEYLJ2Q.cjs +104 -0
- package/dist/chunk-VCEYLJ2Q.cjs.map +1 -0
- package/dist/{chunk-VGWOIWRQ.cjs → chunk-VHSMOBU7.cjs} +2 -2
- package/dist/{chunk-VGWOIWRQ.cjs.map → chunk-VHSMOBU7.cjs.map} +1 -1
- package/dist/{chunk-T3SYREY4.js → chunk-WY4QRJZW.js} +12 -2
- package/dist/chunk-WY4QRJZW.js.map +1 -0
- package/dist/chunk-YCVRQZT3.js +3 -0
- package/dist/chunk-YCVRQZT3.js.map +1 -0
- package/dist/{chunk-DPSMVOM3.js → chunk-YSZM3N7Q.js} +2 -2
- package/dist/chunk-YSZM3N7Q.js.map +1 -0
- package/dist/{chunk-5A7J24LN.js → chunk-Z7UZ3FD3.js} +3 -3
- package/dist/{chunk-5A7J24LN.js.map → chunk-Z7UZ3FD3.js.map} +1 -1
- package/dist/{chunk-4JKI6JRC.js → chunk-ZDSC6KBT.js} +3 -3
- package/dist/chunk-ZDSC6KBT.js.map +1 -0
- package/dist/entries/apps.cjs +2 -2
- package/dist/entries/apps.d.cts +4 -0
- package/dist/entries/apps.d.ts +4 -0
- package/dist/entries/apps.js +1 -1
- package/dist/entries/cast-swap.cjs +2 -2
- package/dist/entries/cast-swap.d.cts +278 -18
- package/dist/entries/cast-swap.d.ts +278 -18
- package/dist/entries/cast-swap.js +1 -1
- package/dist/entries/characters.d.cts +2 -2
- package/dist/entries/characters.d.ts +2 -2
- package/dist/entries/client.cjs +25 -24
- package/dist/entries/client.d.cts +5 -2
- package/dist/entries/client.d.ts +5 -2
- package/dist/entries/client.js +20 -19
- package/dist/entries/copilot.cjs +4 -4
- package/dist/entries/copilot.js +3 -3
- package/dist/entries/core.cjs +6 -6
- package/dist/entries/core.js +2 -2
- package/dist/entries/creatures.d.cts +2 -2
- package/dist/entries/creatures.d.ts +2 -2
- package/dist/entries/credits.cjs +2 -2
- package/dist/entries/credits.d.cts +37 -2
- package/dist/entries/credits.d.ts +37 -2
- package/dist/entries/credits.js +1 -1
- package/dist/entries/edit.cjs +7 -7
- package/dist/entries/edit.d.cts +3 -0
- package/dist/entries/edit.d.ts +3 -0
- package/dist/entries/edit.js +2 -2
- package/dist/entries/errors.cjs +30 -22
- package/dist/entries/errors.d.cts +42 -4
- package/dist/entries/errors.d.ts +42 -4
- package/dist/entries/errors.js +1 -1
- package/dist/entries/jobs.cjs +2 -2
- package/dist/entries/jobs.d.cts +76 -4
- package/dist/entries/jobs.d.ts +76 -4
- package/dist/entries/jobs.js +1 -1
- package/dist/entries/locations.d.cts +2 -2
- package/dist/entries/locations.d.ts +2 -2
- package/dist/entries/media.cjs +4 -4
- package/dist/entries/media.d.cts +39 -5
- package/dist/entries/media.d.ts +39 -5
- package/dist/entries/media.js +3 -3
- package/dist/entries/nodes.cjs +3 -3
- package/dist/entries/nodes.d.cts +2 -2
- package/dist/entries/nodes.d.ts +2 -2
- package/dist/entries/nodes.js +2 -2
- package/dist/entries/objects.d.cts +2 -2
- package/dist/entries/objects.d.ts +2 -2
- package/dist/entries/prompt-helper.cjs +2 -2
- package/dist/entries/prompt-helper.d.cts +3 -1
- package/dist/entries/prompt-helper.d.ts +3 -1
- package/dist/entries/prompt-helper.js +1 -1
- package/dist/entries/scene3d.d.cts +3 -3
- package/dist/entries/scene3d.d.ts +3 -3
- package/dist/entries/studio.cjs +5 -5
- package/dist/entries/studio.d.cts +2 -2
- package/dist/entries/studio.d.ts +2 -2
- package/dist/entries/studio.js +2 -2
- package/dist/entries/templates.cjs +2 -2
- package/dist/entries/templates.d.cts +4 -0
- package/dist/entries/templates.d.ts +4 -0
- package/dist/entries/templates.js +1 -1
- package/dist/entries/trends.cjs +13 -0
- package/dist/entries/trends.cjs.map +1 -0
- package/dist/entries/trends.d.cts +295 -0
- package/dist/entries/trends.d.ts +295 -0
- package/dist/entries/trends.js +4 -0
- package/dist/entries/trends.js.map +1 -0
- package/dist/entries/tutorials.cjs +2 -2
- package/dist/entries/tutorials.d.cts +4 -0
- package/dist/entries/tutorials.d.ts +4 -0
- package/dist/entries/tutorials.js +1 -1
- package/dist/entries/uploads.cjs +2 -2
- package/dist/entries/uploads.d.cts +14 -1
- package/dist/entries/uploads.d.ts +14 -1
- package/dist/entries/uploads.js +1 -1
- package/dist/entries/workflows.cjs +2 -2
- package/dist/entries/workflows.d.cts +6 -0
- package/dist/entries/workflows.d.ts +6 -0
- package/dist/entries/workflows.js +1 -1
- package/dist/index.cjs +85 -71
- package/dist/index.d.cts +8 -7
- package/dist/index.d.ts +8 -7
- package/dist/index.js +22 -20
- package/dist/{nodes-D2tbtzt7.d.ts → nodes-9WpYNWtS.d.ts} +13 -1
- package/dist/{nodes-CTujw6Qd.d.cts → nodes-BDUk5Aej.d.cts} +13 -1
- package/dist/{studio-productions-vbCNSbtf.d.ts → studio-productions-DtTE8mdl.d.ts} +35 -1
- package/dist/{studio-productions-DUHvdSvk.d.cts → studio-productions-r2-VZsKj.d.cts} +35 -1
- package/package.json +7 -2
- package/dist/chunk-3QBH2VE2.cjs.map +0 -1
- package/dist/chunk-4CXB7RA6.js.map +0 -1
- package/dist/chunk-4JKI6JRC.js.map +0 -1
- package/dist/chunk-53SXNN3A.js.map +0 -1
- package/dist/chunk-5ALNFATQ.cjs.map +0 -1
- package/dist/chunk-6OGGJQVA.js.map +0 -1
- package/dist/chunk-CFY6XXOT.cjs.map +0 -1
- package/dist/chunk-CWH642B2.js.map +0 -1
- package/dist/chunk-DKEYSJCE.cjs.map +0 -1
- package/dist/chunk-DPSMVOM3.js.map +0 -1
- package/dist/chunk-E2ZXHS6E.js.map +0 -1
- package/dist/chunk-E5BM4BLO.js.map +0 -1
- package/dist/chunk-EAGD6NEE.cjs.map +0 -1
- package/dist/chunk-GB724HW2.cjs.map +0 -1
- package/dist/chunk-GDXS4EJ5.js +0 -28
- package/dist/chunk-GDXS4EJ5.js.map +0 -1
- package/dist/chunk-GVBSOZDI.cjs +0 -30
- package/dist/chunk-GVBSOZDI.cjs.map +0 -1
- package/dist/chunk-JGS6YBDW.js.map +0 -1
- package/dist/chunk-KGKCAGRD.cjs.map +0 -1
- package/dist/chunk-N6GLZOE4.cjs.map +0 -1
- package/dist/chunk-OXQKE5EG.cjs.map +0 -1
- package/dist/chunk-T3SYREY4.js.map +0 -1
- package/dist/chunk-U4T3Z3K7.cjs.map +0 -1
- package/dist/chunk-VV4TZG5S.js.map +0 -1
- package/dist/chunk-ZQQABQMH.cjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/resources/apps.ts"],"names":[],"mappings":";AAoPO,IAAM,eAAN,MAAmB;AAAA,EACxB,YAAoB,MAAA,EAA0B;AAA1B,IAAA,IAAA,CAAA,MAAA,GAAA,MAAA;AAAA,EAA2B;AAAA,EAA3B,MAAA;AAAA;AAAA,EAGpB,IA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AAY,MAAA,GAAY,EAAE,OAAA,EAAS,IAAA,CAAK,OAAA,EAAQ,GAAI;AAAC;AAChE;AACF,KACF;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,SAAA,CAAU,MAAc,KAAA,EAA4C;AAClE,IAAA,OAAO,KAAK,MAAA,CAAO,OAAA;AAAA,MACjB,QAAA;AAAA,MACA,WAAW,kBAAA,CAAmB,IAAI,CAAC,CAAA,MAAA,EAAS,kBAAA,CAAmB,KAAK,CAAC,CAAA;AAAA,KACvE;AAAA,EACF;AACF","file":"chunk-FQNCIP6K.js","sourcesContent":["import type { NodaroClientCore } from \"../core.js\"\n\n/**\n * A published app — a workflow wrapped in a curated input/output presentation.\n * Returned by the public `/v1/apps/browse` endpoint.\n */\nexport interface PublishedApp {\n id: string\n slug: string\n name: string\n description?: string | null\n creatorId: string\n creatorName?: string | null\n thumbnailUrl?: string | null\n category?: string | null\n isFeatured?: boolean\n runCount?: number\n /** The listed price per run; when `perMinuteCredits` is above 0, its fixed part. */\n estimatedCredits?: number | null\n /** The listed price holds a metered LLM call's ESTIMATE (its model's typical\n * call, charged its actual usage per token): show it `~N`. Absent for a\n * fixed price, and on a deployment running the tier-pricing rollback. */\n estimatedCreditsIsEstimate?: true\n /**\n * Credits per minute of the recording the app is given, when its price\n * follows that recording's length: the price is `estimatedCredits` plus\n * this per minute. 0 or absent when the price does not depend on a\n * recording's length.\n */\n perMinuteCredits?: number\n /**\n * Credits for each item beyond the creator's saved items of a list input\n * the app's user fills: the price is the listed one plus this per further\n * item. 0 or absent when the app has no such input.\n */\n perItemCredits?: number\n /**\n * The listed price is a range: `estimatedCredits` (with `perMinuteCredits` /\n * `perItemCredits`) is \"from\" — the app's saved settings — and these are\n * \"up to\": the most a run can cost over the choices the app's user has (every\n * exposed field, at the creator's restricted values where set). Present only\n * when they differ from \"from\"; absent on an app published before the range\n * existed until its next publish.\n */\n maxEstimatedCredits?: number\n maxPerMinuteCredits?: number\n maxPerItemCredits?: number\n createdAt: string\n updatedAt: string\n}\n\nexport interface ListAppsParams {\n /** Substring search across app name + description. */\n search?: string\n /** Page size; backend caps at 50. */\n limit?: number\n /** Cursor token returned by the previous page. */\n cursor?: string\n /** Filter to a single category slug. */\n category?: string\n}\n\nexport interface ListAppsResult {\n data: PublishedApp[]\n nextCursor?: string | null\n}\n\n/**\n * App detail — includes the input schema (required + optional fields end users\n * fill in) and the output mapping (which workflow nodes produce which display\n * cards).\n */\nexport interface PublishedAppDetail extends PublishedApp {\n inputSchema: Record<string, unknown>\n outputs: Array<{ nodeId: string; label: string; type: string }>\n /**\n * The app run alone: the listed price less its Render final part (run and\n * charged separately) — fixed, per minute of the recording and per further\n * list item. Absent from a server that predates them; read the listed\n * `estimatedCredits` / `perMinuteCredits` / `perItemCredits` instead.\n */\n runEstimatedCredits?: number\n runPerMinuteCredits?: number\n runPerItemCredits?: number\n /**\n * Whether this server charges Edit Plan per started minute of the recording\n * (otherwise in 15/30/60/90/120/180-minute steps). Absent from a server that\n * predates it: read it as the steps.\n */\n editPlanPerMinute?: boolean\n}\n\nexport interface AppRunResult {\n /** The execution-id that was started — poll via client.executions.get(). */\n executionId: string\n status: \"pending\" | \"running\"\n /** App-run id (distinct from executionId — used by listRuns/getRun). */\n runId?: string\n}\n\nexport interface AppRun {\n id: string\n appSlug: string\n executionId: string\n status: \"pending\" | \"running\" | \"completed\" | \"failed\" | \"cancelled\"\n inputs: Record<string, unknown>\n outputs?: Array<{ nodeId: string; type: string; url?: string; text?: string }>\n startedAt: string\n finishedAt?: string | null\n}\n\nexport interface ListAppRunsParams {\n limit?: number\n cursor?: string\n}\n\n/**\n * Result of a soft-delete (archive) operation. The run is moved to the user's\n * archive in the Nodaro UI; restoration and permanent deletion are UI-only by\n * design — SDK / MCP / API delete callers can't accidentally destroy data.\n */\nexport interface DeleteAppRunResult {\n success: true\n archived: true\n}\n\n/** Advanced per-run options for `apps.run`. */\nexport interface RunAppOptions {\n /**\n * Raw node-data overrides keyed by node id → field → value, merged onto the\n * app's workflow for THIS run only. Reaches fields that are NOT exposed as app\n * inputs — e.g. `{ [nodeId]: { promptPrefix: \"…\", promptSuffix: \"…\" } }` to\n * wrap the end user's prompt with text they never see.\n */\n inputOverrides?: Record<string, Record<string, unknown>>\n}\n\n/** Options for `apps.resume` — the Retry of a failed app run. */\nexport interface ResumeAppRunOptions {\n /** Answer what the Retry would run and charge, and start nothing. */\n dryRun?: boolean\n /**\n * The app version you expect the Retry to run — the one starting over would\n * run. Absent: the app's latest. A run of another version is refused with\n * `app_run_version_changed`; send the run's own version (the refusal's\n * `runVersion`) to continue on it anyway.\n */\n version?: number\n}\n\n/** One step a Retry runs again. */\nexport interface AppRunResumeStep {\n nodeId: string\n type: string\n /** The node's label, or `null` when it has none. */\n label: string | null\n}\n\n/** What a Retry would do (`apps.resume(…, { dryRun: true })`); nothing is started. */\nexport interface AppRunResumePlan {\n runId: string\n /** The failed execution the Retry continues. */\n continuesExecutionId: string\n /** The app version the Retry runs (the run's own). */\n appVersion: number | null\n /** Every node the Retry runs, in graph order. */\n nodeIds: string[]\n /** The steps that run again. */\n steps: AppRunResumeStep[]\n /** What the Retry is expected to charge, the creator's fee included; `null` without credits. */\n estimatedCredits: number | null\n /** Clips handed back at no cost. */\n reusedClips: number\n /** Whether your balance and your app credits cover what the Retry holds while it runs; `null` without credits. */\n sufficient: boolean | null\n /** Your spendable balance; `null` without credits. */\n available: number | null\n /** Your app credits, present only when they are what stops the Retry (it would be refused `insufficient_app_credits`). */\n appCreditsAllowance?: number\n}\n\n/**\n * A Retry that started. `deduped: true` when a concurrent double press reached\n * the same Retry; a second call made while the first is pending is refused\n * with `already_running` (`AlreadyRunningError`) instead.\n */\nexport interface AppRunResumeResult {\n /** The Retry's execution — the run now points at it. Poll via client.executions.get(). */\n executionId: string\n runId: string\n status: \"pending\"\n /** Every node the Retry runs. */\n nodeIds: string[]\n /** `true` when a concurrent press had already started this Retry. */\n deduped?: true\n}\n\n/**\n * The `code` the server gives an `apps.resume` refusal. Nothing is written or\n * billed when a Retry is refused. How each arrives:\n * - `app_run_version_changed` as `AppRunVersionChangedError`;\n * - `already_running` as `AlreadyRunningError` (with the live `executionId`);\n * - `not_found` and `continuation_not_found` as `NotFoundError`, whose `code`\n * is always `not_found` (the server's message is kept);\n * - `insufficient_credits` and `insufficient_app_credits` as\n * `InsufficientCreditsError`, whose `code` is always `insufficient_credits`\n * (the server's message says which);\n * - the rest as `NodaroError` carrying this code.\n */\nexport type AppRunResumeRefusalCode =\n /** No such run of yours under this app. */\n | \"not_found\"\n /** The run's execution is not yours. */\n | \"continuation_not_found\"\n /** A malformed run id or body, or a component's run (continued by the run that called it). */\n | \"validation_error\"\n /** The app version the run ran is gone: start the run over. */\n | \"app_run_version_unavailable\"\n /** The app is on another version than the run ran: start over, or send `version` = the run's. */\n | \"app_run_version_changed\"\n /** The run's execution ran another workflow, or another version of it (rare). */\n | \"continuation_workflow_mismatch\"\n | \"continuation_version_mismatch\"\n /** The run did not fail (it completed or was stopped): start it over. */\n | \"continuation_not_failed\"\n /** The run is still running, a Retry of it is pending, or it was started again elsewhere. */\n | \"already_running\"\n /** Nothing is left to retry: every step completed (409), or the app runs no step (400). */\n | \"continuation_subset_required\"\n /** An input the run applied sets a field the app does not let a runner set. */\n | \"locked_field\"\n /**\n * The Retry would stop at a Preview with nobody to review it: retry it from the app page.\n * (The same refusal arrives under the other preview refusal codes when a review-on use-case\n * node holds the run; `isPreviewRefusalCode` in `@nodaro/shared/nodes` asks for all of them.)\n */\n | \"preview_review_required\"\n /** Your app credits cannot cover it. */\n | \"insufficient_app_credits\"\n /** Your balance cannot cover it. */\n | \"insufficient_credits\"\n /** Billing is briefly unavailable for a workspace run (503): try again shortly. */\n | \"billing_unavailable\"\n\nexport class AppsResource {\n constructor(private client: NodaroClientCore) {}\n\n /** List published apps. Public — no auth required for community apps. */\n list(params: ListAppsParams = {}): Promise<ListAppsResult> {\n const qs = new URLSearchParams()\n if (params.search) qs.set(\"search\", params.search)\n if (params.limit !== undefined) qs.set(\"limit\", String(params.limit))\n if (params.cursor) qs.set(\"cursor\", params.cursor)\n if (params.category) qs.set(\"category\", params.category)\n const query = qs.toString()\n return this.client.request(\"GET\", `/v1/apps/browse${query ? `?${query}` : \"\"}`)\n }\n\n /** Get one app's metadata + input schema by slug. */\n get(slug: string): Promise<{ data: PublishedAppDetail }> {\n return this.client.request(\"GET\", `/v1/app/${encodeURIComponent(slug)}`)\n }\n\n /**\n * Trigger an app run with the given input values. The keys in `inputs` must\n * match the app's input-schema field names (see `get(slug).inputSchema`).\n * `opts.inputOverrides` adds raw per-node overrides (see {@link RunAppOptions}).\n * Returns the execution-id for status polling via client.executions.get().\n */\n run(\n slug: string,\n inputs: Record<string, unknown> = {},\n opts: RunAppOptions = {},\n ): Promise<AppRunResult> {\n return this.client.request(\"POST\", `/v1/app/${encodeURIComponent(slug)}/run`, {\n body: { inputs, ...(opts.inputOverrides ? { inputOverrides: opts.inputOverrides } : {}) },\n })\n }\n\n /** List past runs for an app (the caller must own the app or the runs). */\n listRuns(slug: string, params: ListAppRunsParams = {}): Promise<{ data: AppRun[]; nextCursor?: string | null }> {\n const qs = new URLSearchParams()\n if (params.limit !== undefined) qs.set(\"limit\", String(params.limit))\n if (params.cursor) qs.set(\"cursor\", params.cursor)\n const query = qs.toString()\n return this.client.request(\n \"GET\",\n `/v1/app/${encodeURIComponent(slug)}/runs${query ? `?${query}` : \"\"}`,\n )\n }\n\n /** Get one app-run by id. */\n getRun(slug: string, runId: string): Promise<{ data: AppRun }> {\n return this.client.request(\n \"GET\",\n `/v1/app/${encodeURIComponent(slug)}/runs/${encodeURIComponent(runId)}`,\n )\n }\n\n /**\n * Retry a FAILED app run from where it stopped: only the steps it did not\n * complete run, and only those are charged; every step it completed hands\n * on its result. It runs the version the run ran, with the inputs the run\n * applied (it takes none of its own). The run's execution moves to the\n * Retry's.\n *\n * `{ dryRun: true }` answers what the Retry would run and charge\n * ({@link AppRunResumePlan}) and starts nothing — show it before a Retry.\n * Refusals are listed in {@link AppRunResumeRefusalCode}; to run with other\n * inputs or on the app's current version, start over with\n * `run(slug, inputs)` instead.\n *\n * @param slug The published app's slug.\n * @param runId The run's UUID (`AppRunResult.runId`, `AppRun.id`).\n */\n resume(slug: string, runId: string, opts: ResumeAppRunOptions & { dryRun: true }): Promise<{ data: AppRunResumePlan }>\n resume(slug: string, runId: string, opts?: ResumeAppRunOptions & { dryRun?: false }): Promise<AppRunResumeResult>\n resume(slug: string, runId: string, opts?: ResumeAppRunOptions): Promise<{ data: AppRunResumePlan } | AppRunResumeResult>\n resume(slug: string, runId: string, opts: ResumeAppRunOptions = {}): Promise<{ data: AppRunResumePlan } | AppRunResumeResult> {\n return this.client.request(\n \"POST\",\n `/v1/app/${encodeURIComponent(slug)}/runs/${encodeURIComponent(runId)}/resume`,\n {\n body: {\n ...(opts.dryRun ? { dryRun: true } : {}),\n ...(opts.version !== undefined ? { version: opts.version } : {}),\n },\n },\n )\n }\n\n /**\n * Archive (soft-delete) a published-app run. The run is hidden from the\n * default run list and can be restored or permanently deleted from the\n * archive view at https://app.nodaro.ai/archived-runs.\n *\n * @param slug The published app's slug (the last path segment of its URL).\n * @param runId The run's UUID.\n */\n deleteRun(slug: string, runId: string): Promise<DeleteAppRunResult> {\n return this.client.request(\n \"DELETE\",\n `/v1/app/${encodeURIComponent(slug)}/runs/${encodeURIComponent(runId)}`,\n )\n }\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkFM2KM5TY_cjs = require('./chunk-FM2KM5TY.cjs');
|
|
4
4
|
|
|
5
5
|
// src/sse.ts
|
|
6
6
|
async function* readSseStream(res, opts = {}) {
|
|
@@ -10,10 +10,10 @@ async function* readSseStream(res, opts = {}) {
|
|
|
10
10
|
errBody = await res.json();
|
|
11
11
|
} catch {
|
|
12
12
|
}
|
|
13
|
-
|
|
13
|
+
chunkFM2KM5TY_cjs.throwFromResponse(res.status, errBody);
|
|
14
14
|
}
|
|
15
15
|
if (!res.body) {
|
|
16
|
-
throw new
|
|
16
|
+
throw new chunkFM2KM5TY_cjs.NodaroError(`${opts.label ?? "event stream"} has no response body`, "empty_stream", res.status);
|
|
17
17
|
}
|
|
18
18
|
const reader = res.body.getReader();
|
|
19
19
|
const decoder = new TextDecoder();
|
|
@@ -44,5 +44,5 @@ async function* readSseStream(res, opts = {}) {
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
exports.readSseStream = readSseStream;
|
|
47
|
-
//# sourceMappingURL=chunk-
|
|
48
|
-
//# sourceMappingURL=chunk-
|
|
47
|
+
//# sourceMappingURL=chunk-FRQJNGJS.cjs.map
|
|
48
|
+
//# sourceMappingURL=chunk-FRQJNGJS.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/sse.ts"],"names":["throwFromResponse","NodaroError"],"mappings":";;;;;AAyBA,gBAAuB,aAAA,CACrB,GAAA,EACA,IAAA,GAGI,EAAC,EAC+B;AACpC,EAAA,IAAI,CAAC,IAAI,EAAA,EAAI;AACX,IAAA,IAAI,UAAmC,EAAC;AACxC,IAAA,IAAI;AACF,MAAA,OAAA,GAAW,MAAM,IAAI,IAAA,EAAK;AAAA,IAC5B,CAAA,CAAA,MAAQ;AAAA,IAER;AACA,IAAAA,mCAAA,CAAkB,GAAA,CAAI,QAAQ,OAAO,CAAA;AAAA,EACvC;AACA,EAAA,IAAI,CAAC,IAAI,IAAA,EAAM;AACb,IAAA,MAAM,IAAIC,8BAAY,CAAA,EAAG,IAAA,CAAK,SAAS,cAAc,CAAA,qBAAA,CAAA,EAAyB,cAAA,EAAgB,GAAA,CAAI,MAAM,CAAA;AAAA,EAC1G;AAEA,EAAA,MAAM,MAAA,GAAS,GAAA,CAAI,IAAA,CAAK,SAAA,EAAU;AAClC,EAAA,MAAM,OAAA,GAAU,IAAI,WAAA,EAAY;AAChC,EAAA,I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AAE,MAAM,CAAA;AAAA,UACvC,CAAA,CAAA,MAAQ;AAAA,UAER;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF,CAAA,SAAE;AAEA,IAAA,MAAA,CAAO,WAAA,EAAY;AACnB,IAAA,MAAM,GAAA,CAAI,IAAA,CAAK,MAAA,EAAO,CAAE,MAAM,MAAM;AAAA,IAAC,CAAC,CAAA;AAAA,EACxC;AACF","file":"chunk-FRQJNGJS.cjs","sourcesContent":["import { NodaroError, throwFromResponse } from \"./errors.js\"\n\n/**\n * The ONE server-sent-event reader in this package.\n *\n * Every streaming route here writes the same minimal shape — `data: <json>\\n\\n`\n * frames, with the event kind INSIDE the JSON rather than on an `event:` line —\n * so one reader serves them all, and a second hand-rolled parse loop is the\n * thing this file exists to prevent. Deliberately minimal, matching the\n * server's writer rather than the whole SSE grammar: split on blank lines,\n * JSON-parse each `data:` line on its own, skip what does not parse (the next\n * frame re-reports state), and ignore every other line — keepalive comments\n * (`: keepalive`) included.\n *\n * Frames are separated by a bare `\\n\\n` and each `data:` line is parsed on its\n * own, exactly as the server writes them. Both halves are literal: a stream\n * whose frames arrive CRLF-terminated, or whose JSON was split across two\n * `data:` lines, yields NOTHING rather than erroring — so an intermediary that\n * normalises line endings would show up as an empty stream, not a parse\n * failure. The server's writer produces neither shape.\n *\n * No timeout is applied. The caller owns the lifetime: pass the `AbortSignal`\n * to the `fetch` that produced `res`, or just stop iterating — the `finally`\n * cancels the body, which ends the HTTP request.\n */\nexport async function* readSseStream<T>(\n res: Response,\n opts: {\n /** Names the stream in the \"no response body\" error. */\n label?: string\n } = {},\n): AsyncGenerator<T, void, undefined> {\n if (!res.ok) {\n let errBody: Record<string, unknown> = {}\n try {\n errBody = (await res.json()) as Record<string, unknown>\n } catch {\n // Empty/non-JSON body — fall through with empty errBody\n }\n throwFromResponse(res.status, errBody)\n }\n if (!res.body) {\n throw new NodaroError(`${opts.label ?? \"event stream\"} has no response body`, \"empty_stream\", res.status)\n }\n\n const reader = res.body.getReader()\n const decoder = new TextDecoder()\n let buffer = \"\"\n try {\n for (;;) {\n const { done, value } = await reader.read()\n if (done) break\n buffer += decoder.decode(value, { stream: true })\n let sep: number\n while ((sep = buffer.indexOf(\"\\n\\n\")) >= 0) {\n const frame = buffer.slice(0, sep)\n buffer = buffer.slice(sep + 2)\n for (const line of frame.split(\"\\n\")) {\n if (!line.startsWith(\"data:\")) continue\n try {\n yield JSON.parse(line.slice(5).trim()) as T\n } catch {\n // Skip malformed frames — the next tick re-reports full state.\n }\n }\n }\n }\n } finally {\n // Ends the HTTP request when the consumer breaks out of the loop early.\n reader.releaseLock()\n await res.body.cancel().catch(() => {})\n }\n}\n"]}
|
|
@@ -33,7 +33,8 @@ var CreditsResource = class {
|
|
|
33
33
|
* `POST /v1/credits/model-costs` → per-identifier credit cost, for editor
|
|
34
34
|
* cost previews. Capped at the first {@link MODEL_COSTS_LIMIT} identifiers
|
|
35
35
|
* (the route's request limit). Preserves the `{ data, missing, errors }`
|
|
36
|
-
* fault-isolation shape verbatim
|
|
36
|
+
* fault-isolation shape verbatim, plus `estimates` / `errorCodes` when a
|
|
37
|
+
* metered LLM price key was asked (see {@link ModelCostsResult}).
|
|
37
38
|
*/
|
|
38
39
|
modelCosts(ids) {
|
|
39
40
|
return this.client.request("POST", "/v1/credits/model-costs", {
|
|
@@ -92,7 +93,8 @@ var CreditsResource = class {
|
|
|
92
93
|
}
|
|
93
94
|
// NOTE: no `estimate(...)` helper. The backend exposes
|
|
94
95
|
// `POST /v1/credits/estimate-workflow` (body `{ nodes }` → `{ data: {
|
|
95
|
-
// totalCredits, nodeCount } }`
|
|
96
|
+
// totalCredits, nodeCount, estimate?: true } }` — `estimate` when a metered
|
|
97
|
+
// LLM node's estimate is in the total), but no consumer has a settled shape for it
|
|
96
98
|
// yet (studio pre-checks `balance >= Σ modelCosts` client-side rather than
|
|
97
99
|
// calling an estimate endpoint). Adding it now would be inventing an API
|
|
98
100
|
// surface ahead of a real caller, so it's deliberately omitted — add it when
|
|
@@ -100,5 +102,5 @@ var CreditsResource = class {
|
|
|
100
102
|
};
|
|
101
103
|
|
|
102
104
|
export { CreditsResource };
|
|
103
|
-
//# sourceMappingURL=chunk-
|
|
104
|
-
//# sourceMappingURL=chunk-
|
|
105
|
+
//# sourceMappingURL=chunk-IGMWFEFB.js.map
|
|
106
|
+
//# sourceMappingURL=chunk-IGMWFEFB.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/resources/credits.ts"],"names":[],"mappings":";AAuNA,IAAM,iBAAA,GAAoB,EAAA;AAEnB,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;AAAA,EAOpB,MAAM,OAAA,GAAgC;AACpC,IAAA,MAAM,GAAA,GAAM,MAAM,IAAA,CAAK,MAAA,CAAO,OAAA;AAAA,MAC5B,KAAA;AAAA,MACA;AAAA,KACF;AACA,IAAA,OAAO,GAAA,CAAI,IAAA;AAAA,EACb;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,YAAA,CAAa,OAAA,GAAqC,EAAC,EAAoC;AACrF,IAAA,OAAO,IAAA,CAAK,MAAA,CAAO,OAAA,CAAgC,KAAA,EAAO,0BAAA,EAA4B;AAAA,MACpF,OAAO,EAAE,KAAA,EAAO,QAAQ,KAAA,EAAO,MAAA,EAAQ,QAAQ,MAAA;AAAO,KACvD,CAAA;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,WAAW,GAAA,EAA0C;AACnD,IAAA,OAAO,IAAA,CAAK,MAAA,CAAO,OAAA,CAA0B,MAAA,EAAQ,yBAAA,EAA2B;AAAA,MAC9E,MAAM,EAAE,MAAA,EAAQ,IAAI,KAAA,CAAM,CAAA,EAAG,iBAAiB,CAAA;AAAE,KACjD,CAAA;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAcA,gBAAA,CAAiB,IAAA,GAAmB,EAAC,EAAoC;AACvE,IAAA,OAAO,IAAA,CAAK,MAAA,CAAO,OAAA,CAAgC,MAAA,EAAQ,gCAAA,EAAkC;AAAA,MAC3F,IAAA,EAAM;AAAA,KACP,CAAA;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAiBA,iBAAA,CAAkB,KAAA,GAAgC,EAAC,EAAqC;AACtF,IAAA,OAAO,IAAA,CAAK,MAAA,CAAO,OAAA,CAAiC,MAAA,EAAQ,iCAAA,EAAmC;AAAA,MAC7F,IAAA,EAAM;AAAA,KACP,CAAA;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYA,oBAAA,GAAwD;AACtD,IAAA,OAAO,IAAA,CAAK,MAAA,CAAO,OAAA,CAAgC,MAAA,EAAQ,gCAAgC,CAAA;AAAA,EAC7F;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUF","file":"chunk-IGMWFEFB.js","sourcesContent":["import type { NodaroClientCore } from \"../core.js\"\n\n/**\n * Authenticated user's credit balance — the shape of `GET /v1/user/credits`'s\n * `data` field. Mirrors the canonical `UserBalance` from the backend billing\n * module (`backend/src/ee/billing/credits.ts`), the source of truth: keep this\n * in sync if that interface changes.\n */\nexport interface UserBalance {\n total: number\n subscription: number\n topup: number\n dailySpent: number\n dailyLimit: number | null\n monthlyAllocation: number\n /** Stored billing tier. Display should prefer `effectiveTier`. */\n tier: string\n /** Derived entitlement tier: \"payg\" when stored-free with purchased credits. */\n effectiveTier: string\n features: Record<string, unknown>\n periodEnd: string | null\n /** Credits earned for app usage (free tier only — earned by running flows). */\n appCreditsAllowance: number\n /** Present when a deployment uses an external shared wallet. Raw credits;\n * null means unavailable. Do not substitute the personal `total` balance. */\n externalWallet?: { available: number | null }\n /**\n * Where the account's free signup grant stands. `\"withheld\"` means the\n * account works but the grant did not land — show the activation path.\n * Absent where the deployment has no signup grant.\n */\n freeGrantState?: FreeGrantState\n /**\n * Present only with `freeGrantState: \"withheld\"`, when the claim showed no\n * browser signals at all: the app may say \"free credits need a regular\n * browser — reload\", because a reload in one judges the account again.\n */\n freeGrantNotice?: \"browser_unmeasured\"\n /**\n * The welcome-credits opt-in. PRESENT only while the deployment has the\n * offer switched on — absent means \"no popup, no banner, no block\".\n */\n welcomeOffer?: WelcomeOfferState\n}\n\n/** Where an account's free signup grant stands. */\nexport type FreeGrantState = \"unclaimed\" | \"granted\" | \"withheld\" | \"revoked\"\n\n/** `UserBalance.welcomeOffer` — what an app needs to show the welcome offer. */\nexport interface WelcomeOfferState {\n /** The one-time popup was already shown (see `markWelcomeOfferSeen`). */\n popupSeen: boolean\n /**\n * The account already has its credits (granted elsewhere) but still owes\n * the email consent: the web apps block creation until it is given — the\n * claim records it.\n */\n consentPending: boolean\n /** The credits a claim grants. Name this figure in the offer; never hard-code it. */\n credits: number\n}\n\n/** What `claimWelcomeOffer` sends: the browser signals plus the app answering. */\nexport interface WelcomeOfferClaimInput extends SignupKeys {\n /**\n * The answering app's slug (lowercase letters, digits and `-`, up to 40\n * characters), recorded with the consent. A value outside that grammar is\n * stored as absent, never refused.\n */\n sourceApp?: string\n /**\n * The interface language the user answered in — the id of a language Nodaro\n * ships, such as `\"en\"`, `\"ja\"` or `\"pt-BR\"`. Matched exactly and\n * case-sensitively: `\"en-US\"` or `\"pt-br\"` is stored as absent, never refused.\n * Recorded with the consent as the language of the LATEST consent: a later\n * \"yes\" in another language replaces it.\n */\n locale?: string\n}\n\n/** The answer of `POST /v1/credits/welcome-offer/claim`. */\nexport interface WelcomeOfferClaimResult {\n /** The email consent is recorded. */\n consent: \"granted\"\n /** Where the free grant stands after the claim — `\"withheld\"` when the abuse gate refused it. */\n grant: FreeGrantState\n /** The grant's figure. A grant tops the subscription credits UP TO it (it is not added on top), so a claim that lands it leaves the subscription credits at no less than this. */\n credits: number\n}\n\n/** The answer of `POST /v1/credits/welcome-offer/seen`. */\nexport interface WelcomeOfferSeenResult {\n ok: true\n}\n\n/**\n * Result of `POST /v1/credits/model-costs` — a batch cost lookup for editor\n * cost previews. `data` maps each priced identifier → its credit cost.\n *\n * Per-model fault isolation (the route runs the lookups under\n * `Promise.allSettled`): identifiers with no pricing row are reported in\n * `missing` (undisplayable until an operator seeds a price) and lookup\n * failures in `errors`, instead of failing the whole batch. Callers typically\n * render `'—'` for any identifier that lands in `missing`. The hard-fail\n * policy still triggers at reservation time when the user actually runs the\n * node — this preview lookup is intentionally lenient.\n */\nexport interface ModelCostsResult {\n data: Record<string, number>\n missing: string[]\n errors: string[]\n /**\n * Why each identifier in `errors` has no price — today only\n * `llm_model_unpriced`: a metered LLM price key whose model has no rate on\n * the lane it would be served on (it cannot be run). Omitted when `errors`\n * is empty.\n */\n errorCodes?: Record<string, ModelCostError>\n /**\n * The identifiers in `data` whose figure is an ESTIMATE, not a fixed price:\n * metered LLM price keys (`llmPriceKey` from `@nodaro/shared/llm-models`,\n * `<feature>:<model>[:direct]`), charged on what the call actually uses.\n * Show these as `~N`. Omitted when there are none, so a batch of fixed ids\n * answers exactly as it always has. A metered key that lands in `missing`\n * instead means the server is not pricing LLM calls per model — show no\n * price for it.\n */\n estimates?: string[]\n}\n\n/** {@link ModelCostsResult.errorCodes} — why an identifier has no price. */\nexport interface ModelCostError {\n /** Today only `llm_model_unpriced`; open to codes a newer server may add. */\n code: \"llm_model_unpriced\" | (string & {})\n /** A sentence to show the user. */\n message: string\n}\n\n/**\n * Result of `GET /v1/credits/model-cost?model=<id>` (`data`): the credits one\n * identifier is charged. `estimate: true` marks a metered LLM price key's\n * figure as an estimate (show it as `~N`); such an answer is never cached.\n */\nexport interface ModelCostResult {\n model: string\n creditCost: number\n estimate?: true\n}\n\n/**\n * The two browser signals a claim reports — SHA-256 hex digests computed by\n * `@nodaro/sdk/signup-signals` (`collectSignupKeys`). Either may be absent:\n * a browser that cannot be measured still claims, and the server treats the\n * absence as what it is. Any other value is stored as absent server-side.\n */\nexport interface SignupKeys {\n browserKey?: string\n deviceKey?: string\n}\n\n/** The answer of `POST /v1/credits/claim-signup-grant`. */\nexport interface SignupGrantClaimResult {\n /** Where the account's free grant stands after this call. */\n state: FreeGrantState\n /** True only when THIS call moved the credits — a repeat is `false` with the same state. */\n granted: boolean\n}\n\n/**\n * One row of `GET /v1/credits/transactions` — a run's reservation and how it\n * settled.\n *\n * Which amount to read: a run first HOLDS credits and is then settled — charged\n * all or part of the hold, the rest returned. `credits_charged` is what the run\n * cost (`null` while the hold is still open, `0` once refunded); sum it for\n * spend. `credits_reserved` is the hold, which never changes. `credits_used`\n * is the same hold under its original name, kept for existing integrations.\n */\nexport interface CreditTransaction {\n id: string\n /** ISO-8601. Also the paging cursor: pass the last row's value as `cursor`. */\n created_at: string\n /** Settled charge; `null` while `status` is `\"reserved\"`, `0` when refunded. */\n credits_charged: number | null\n /** The hold taken when the run was accepted. */\n credits_reserved: number | null\n /** The hold, under its original name. Prefer `credits_charged`. */\n credits_used: number | null\n /** The model or operation the credits were for. */\n action: string | null\n provider: string | null\n /** Reservation lifecycle: `\"reserved\"`, `\"committed\"` or `\"refunded\"`. */\n status: string | null\n /** The caller's own billing details for the run (model, which pool paid, …). */\n metadata: Record<string, unknown>\n /** `\"workspace\"` when a class or team budget paid, not your balance. */\n payer: \"user\" | \"workspace\"\n workspaceId: string | null\n}\n\n/** A page of {@link CreditTransaction}s, newest first. */\nexport interface CreditTransactionsPage {\n data: CreditTransaction[]\n /** Pass as `cursor` for the next page; `null` when there are no more rows. */\n nextCursor: string | null\n}\n\nexport interface CreditTransactionsOptions {\n /** Rows per page, 1–50 (server default 20). */\n limit?: number\n /** The `nextCursor` of the previous page. */\n cursor?: string\n}\n\n/** Max identifiers per `model-costs` batch — the route caps the request at 50. */\nconst MODEL_COSTS_LIMIT = 50\n\nexport class CreditsResource {\n constructor(private client: NodaroClientCore) {}\n\n /**\n * `GET /v1/user/credits` → the authenticated user's credit balance and tier\n * info. Throws `UnauthorizedError` (401) when signed out, and the SDK's\n * other typed errors on the usual statuses.\n */\n async balance(): Promise<UserBalance> {\n const res = await this.client.request<{ data: UserBalance }>(\n \"GET\",\n \"/v1/user/credits\",\n )\n return res.data\n }\n\n /**\n * `GET /v1/credits/transactions` → one page of the caller's credit\n * transactions, newest first, with `nextCursor` for the next page (`null`\n * at the end). Read `credits_charged` for what each run cost — it can be\n * below the hold (`credits_reserved`) and is `null` while the hold is open.\n * Cloud-only route: a self-hosted instance answers 404.\n */\n transactions(options: CreditTransactionsOptions = {}): Promise<CreditTransactionsPage> {\n return this.client.request<CreditTransactionsPage>(\"GET\", \"/v1/credits/transactions\", {\n query: { limit: options.limit, cursor: options.cursor },\n })\n }\n\n /**\n * `POST /v1/credits/model-costs` → per-identifier credit cost, for editor\n * cost previews. Capped at the first {@link MODEL_COSTS_LIMIT} identifiers\n * (the route's request limit). Preserves the `{ data, missing, errors }`\n * fault-isolation shape verbatim, plus `estimates` / `errorCodes` when a\n * metered LLM price key was asked (see {@link ModelCostsResult}).\n */\n modelCosts(ids: string[]): Promise<ModelCostsResult> {\n return this.client.request<ModelCostsResult>(\"POST\", \"/v1/credits/model-costs\", {\n body: { models: ids.slice(0, MODEL_COSTS_LIMIT) },\n })\n }\n\n /**\n * `POST /v1/credits/claim-signup-grant` → claims the account's free signup\n * grant, once, with the browser signals of the page making the claim.\n *\n * Call it once per page load as soon as the session is known, and never\n * wait on it for rendering: it is idempotent (a decided account answers\n * with its state and `granted: false`), it costs the user nothing when it\n * fails (the next load asks again), and the signals are what make the\n * claim worth sending — collect them with `collectSignupKeys()` from\n * `@nodaro/sdk/signup-signals` and pass whatever came back, `{}` included.\n * Cloud-only route: a self-hosted instance answers 404.\n */\n claimSignupGrant(keys: SignupKeys = {}): Promise<SignupGrantClaimResult> {\n return this.client.request<SignupGrantClaimResult>(\"POST\", \"/v1/credits/claim-signup-grant\", {\n body: keys,\n })\n }\n\n /**\n * `POST /v1/credits/welcome-offer/claim` → the user's \"yes\" to the welcome\n * offer, as ONE server action: the marketing-email consent is recorded,\n * then the free signup grant is claimed with that consent. The abuse gate\n * still decides — consent is necessary, not sufficient — so read `grant`:\n * `\"granted\"` (the grant has landed: this call topped the subscription credits up to `credits` — not added on top — or it had landed before), `\"withheld\"` (refused), `\"revoked\"` (taken back earlier; nothing moves), `\"unclaimed\"` (nothing moved — treat as a failure and let the user retry).\n * Pass the browser signals from `collectSignupKeys()` and your app's slug.\n *\n * **Browser session only.** Usable from a first-party web app signed in\n * with a Supabase session (the consent is a person's choice in a browser);\n * an API key or OAuth app token is refused with 403. 409\n * `welcome_offer_disabled` while the deployment has the offer off — show\n * it only when `balance().welcomeOffer` is present. Cloud-only route: a\n * self-hosted instance answers 404.\n */\n claimWelcomeOffer(input: WelcomeOfferClaimInput = {}): Promise<WelcomeOfferClaimResult> {\n return this.client.request<WelcomeOfferClaimResult>(\"POST\", \"/v1/credits/welcome-offer/claim\", {\n body: input,\n })\n }\n\n /**\n * `POST /v1/credits/welcome-offer/seen` → records that the one-time welcome\n * popup was shown, so `balance().welcomeOffer.popupSeen` turns true on every\n * app. Idempotent (the first stamp wins); a failed call only means the popup\n * may show once more, so callers usually ignore errors.\n *\n * **Browser session only**, like {@link claimWelcomeOffer}: 403 for an API\n * key or OAuth app token, 409 `welcome_offer_disabled` while the offer is\n * off, 404 on a self-hosted instance.\n */\n markWelcomeOfferSeen(): Promise<WelcomeOfferSeenResult> {\n return this.client.request<WelcomeOfferSeenResult>(\"POST\", \"/v1/credits/welcome-offer/seen\")\n }\n\n // NOTE: no `estimate(...)` helper. The backend exposes\n // `POST /v1/credits/estimate-workflow` (body `{ nodes }` → `{ data: {\n // totalCredits, nodeCount, estimate?: true } }` — `estimate` when a metered\n // LLM node's estimate is in the total), but no consumer has a settled shape for it\n // yet (studio pre-checks `balance >= Σ modelCosts` client-side rather than\n // calling an estimate endpoint). Adding it now would be inventing an API\n // surface ahead of a real caller, so it's deliberately omitted — add it when\n // a consumer needs it, shaped to that need.\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/resources/templates.ts"],"names":[],"mappings":";AA4GO,IAAM,oBAAN,MAAwB;AAAA,EAC7B,YAAoB,MAAA,EAA0B;AAA1B,IAAA,IAAA,CAAA,MAAA,GAAA,MAAA;AAAA,EAA2B;AAAA,EAA3B,MAAA;AAAA;AAAA,EAGpB,MAAA,CAAO,MAAA,GAAgC,EAAC,EAAmC;AACzE,IAAA,OAAO,IAAA,CAAK,MAAA,CAAO,OAAA,CAAQ,KAAA,EAAO,sBAAA,EAAwB,EAAE,KAAA,EAAO,EAAE,GAAG,MAAA,EAAO,EAAG,CAAA;AAAA,EACpF;AAAA;AAAA,EAGA,IAAI,IAAA,EAAiC;AACnC,IAAA,OAAO,IAAA,CAAK,OAAO,OAAA,CAAQ,KAAA,EAAO,iBAAiB,kBAAA,CAAmB,IAAI,CAAC,CAAA,CAAE,CAAA;AAAA,EAC/E;AAAA;AAAA,EAGA,KAAA,CAAM,MAAc,MAAA,EAA2D;AAC7E,IAAA,OAAO,IAAA,CAAK,OAAO,OAAA,CAAQ,MAAA,EAAQ,iBAAiB,kBAAA,CAAmB,IAAI,CAAC,CAAA,MAAA,CAAA,EAAU;AAAA,MACpF,IAAA,EAAM;AAAA,KACP,CAAA;AAAA,EACH;AACF","file":"chunk-ILG5DHQQ.js","sourcesContent":["import type { NodaroClientCore } from \"../core.js\"\n\n/**\n * Workflow-template marketplace — the PUBLIC-BY-DESIGN surfaces only:\n * browse cards, a single template with its full snapshot, and the free\n * clone-into-my-project action. Creator/admin surfaces (publish, mine,\n * favorites, metadata patch, tutorial flags) are deliberately NOT part of\n * the public SDK contract; first-party apps reach them via\n * `client.request()`.\n */\n\n/** Card returned by the marketplace browse (no snapshot payload). */\nexport interface TemplateBrowseCard {\n id: string\n slug: string\n name: string\n description: string | null\n /** The listed price; when `estimatedPerMinuteCredits` is above 0, its fixed part. */\n estimatedCredits: number\n /** The listed price holds a metered LLM call's ESTIMATE (its model's typical\n * call, charged its actual usage per token): show it `~N`. Absent for a\n * fixed price, and on a deployment running the tier-pricing rollback. */\n estimatedCreditsIsEstimate?: true\n /**\n * Credits per minute of the recording the template is given, when its price\n * follows that recording's length (an Apply EDL render of a whole episode,\n * an Edit Plan pass): the price is `estimatedCredits` plus this per minute.\n * 0 or absent when the price does not depend on a recording's length.\n */\n estimatedPerMinuteCredits?: number\n /**\n * The listed price is a range: `estimatedCredits` / `estimatedPerMinuteCredits`\n * are \"from\" (the saved settings), these \"up to\" — the most a run can cost over\n * the template's exposed fields. Present only when they differ from \"from\".\n */\n maxEstimatedCredits?: number\n maxEstimatedPerMinuteCredits?: number\n category: string\n outputTypes: string[]\n tags: string[]\n nodeTypesUsed: string[]\n providersUsed: string[]\n nodeCount: number\n complexity: string\n previewMediaUrl: string | null\n previewMediaType: \"image\" | \"video\" | null\n creatorId: string\n creatorDisplayName: string | null\n cloneCount: number\n favoriteCount: number\n createdAt: string\n}\n\nexport type TemplateSort = \"newest\" | \"popular\" | \"most-favorited\"\n\nexport interface BrowseTemplatesParams {\n /** Opaque cursor from the previous page's `nextCursor`. */\n cursor?: string\n limit?: number\n category?: string\n outputType?: string\n tag?: string\n /** Full-text search over name/description/tags. */\n search?: string\n sort?: TemplateSort\n /** Only templates using this node type. */\n nodeType?: string\n /** Only templates using this provider/model id. */\n provider?: string\n complexity?: string\n}\n\nexport interface BrowseTemplatesResult {\n data: TemplateBrowseCard[]\n /** Pass back as `cursor` to fetch the next page; `null` on the last page. */\n nextCursor: string | null\n}\n\n/**\n * A single public template (`GET /v1/templates/:slug`) — the browse-card\n * fields plus the full workflow snapshot the viewer/clone consume. The route\n * returns the whole camelCased row, so additional columns may appear beyond\n * the ones typed here; the index signature keeps them reachable without\n * casting.\n */\nexport interface Template extends TemplateBrowseCard {\n markdownDescription: string | null\n /** React Flow node snapshots (generic node JSON, execution data stripped on clone). */\n snapshotNodes: unknown[]\n snapshotEdges: unknown[]\n snapshotSettings: Record<string, unknown>\n /** Channels the template is listed in (e.g. \"marketplace\", \"tutorial\"). */\n listedIn: string[]\n readonly [key: string]: unknown\n}\n\nexport interface CloneTemplateParams {\n /** Target project (must belong to the caller). */\n projectId: string\n /** Optional name for the cloned workflow; defaults to the template's name. */\n name?: string\n}\n\nexport interface CloneTemplateResult {\n workflowId: string\n projectId: string\n}\n\nexport class TemplatesResource {\n constructor(private client: NodaroClientCore) {}\n\n /** Browse the public template marketplace (cursor-paginated, no auth required). */\n browse(params: BrowseTemplatesParams = {}): Promise<BrowseTemplatesResult> {\n return this.client.request(\"GET\", \"/v1/templates/browse\", { query: { ...params } })\n }\n\n /** Fetch one public template by slug, including its full workflow snapshot. */\n get(slug: string): Promise<Template> {\n return this.client.request(\"GET\", `/v1/templates/${encodeURIComponent(slug)}`)\n }\n\n /** Clone a template into one of the caller's projects. Free — no credits charged. */\n clone(slug: string, params: CloneTemplateParams): Promise<CloneTemplateResult> {\n return this.client.request(\"POST\", `/v1/templates/${encodeURIComponent(slug)}/clone`, {\n body: params,\n })\n }\n}\n"]}
|
|
@@ -1,57 +1,58 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var chunkW5VHATSR_cjs = require('./chunk-W5VHATSR.cjs');
|
|
3
4
|
var chunkR63TTR35_cjs = require('./chunk-R63TTR35.cjs');
|
|
4
5
|
var chunk3B47IHB3_cjs = require('./chunk-3B47IHB3.cjs');
|
|
5
|
-
var
|
|
6
|
+
var chunkVHSMOBU7_cjs = require('./chunk-VHSMOBU7.cjs');
|
|
6
7
|
var chunkLKH5M44B_cjs = require('./chunk-LKH5M44B.cjs');
|
|
7
8
|
var chunkYDRXBRW2_cjs = require('./chunk-YDRXBRW2.cjs');
|
|
8
9
|
var chunkPEMLIAPZ_cjs = require('./chunk-PEMLIAPZ.cjs');
|
|
9
10
|
var chunkMBFUMWI5_cjs = require('./chunk-MBFUMWI5.cjs');
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
var
|
|
11
|
+
var chunkNKH2UFSD_cjs = require('./chunk-NKH2UFSD.cjs');
|
|
12
|
+
var chunkEK672FFM_cjs = require('./chunk-EK672FFM.cjs');
|
|
13
|
+
var chunkVCEYLJ2Q_cjs = require('./chunk-VCEYLJ2Q.cjs');
|
|
14
|
+
var chunkFHVNTS4E_cjs = require('./chunk-FHVNTS4E.cjs');
|
|
15
|
+
var chunkJTOEHQQJ_cjs = require('./chunk-JTOEHQQJ.cjs');
|
|
15
16
|
var chunkNBVARNVA_cjs = require('./chunk-NBVARNVA.cjs');
|
|
16
17
|
var chunkOSX2GVZ2_cjs = require('./chunk-OSX2GVZ2.cjs');
|
|
17
18
|
var chunkCOCKKMNP_cjs = require('./chunk-COCKKMNP.cjs');
|
|
18
19
|
var chunkLAWYFC4G_cjs = require('./chunk-LAWYFC4G.cjs');
|
|
19
|
-
var
|
|
20
|
+
var chunkTCLNSVYA_cjs = require('./chunk-TCLNSVYA.cjs');
|
|
20
21
|
var chunkKXEWTYS4_cjs = require('./chunk-KXEWTYS4.cjs');
|
|
21
22
|
var chunkGB6C5OEZ_cjs = require('./chunk-GB6C5OEZ.cjs');
|
|
22
23
|
var chunkSYVNY3AH_cjs = require('./chunk-SYVNY3AH.cjs');
|
|
23
|
-
var
|
|
24
|
+
var chunkETX3TLNB_cjs = require('./chunk-ETX3TLNB.cjs');
|
|
24
25
|
var chunk7QOCWJKD_cjs = require('./chunk-7QOCWJKD.cjs');
|
|
25
26
|
var chunkZCWKX4V6_cjs = require('./chunk-ZCWKX4V6.cjs');
|
|
26
27
|
var chunk34PU2DAT_cjs = require('./chunk-34PU2DAT.cjs');
|
|
27
|
-
var
|
|
28
|
+
var chunkQZHRXPN5_cjs = require('./chunk-QZHRXPN5.cjs');
|
|
28
29
|
var chunkGVIFLUYZ_cjs = require('./chunk-GVIFLUYZ.cjs');
|
|
29
30
|
var chunkCR5E2SF3_cjs = require('./chunk-CR5E2SF3.cjs');
|
|
30
31
|
var chunkJ5LGGCAS_cjs = require('./chunk-J5LGGCAS.cjs');
|
|
31
|
-
var
|
|
32
|
+
var chunk7XOK277W_cjs = require('./chunk-7XOK277W.cjs');
|
|
32
33
|
var chunkSBV5MWEL_cjs = require('./chunk-SBV5MWEL.cjs');
|
|
33
34
|
var chunkWUKIJJG2_cjs = require('./chunk-WUKIJJG2.cjs');
|
|
34
|
-
var
|
|
35
|
+
var chunkA7QSOD2S_cjs = require('./chunk-A7QSOD2S.cjs');
|
|
35
36
|
var chunk2DZWWIJ4_cjs = require('./chunk-2DZWWIJ4.cjs');
|
|
36
37
|
var chunkSS3B6PHT_cjs = require('./chunk-SS3B6PHT.cjs');
|
|
37
38
|
var chunkMQ74AKA2_cjs = require('./chunk-MQ74AKA2.cjs');
|
|
38
39
|
var chunkWK4VXPPZ_cjs = require('./chunk-WK4VXPPZ.cjs');
|
|
39
40
|
var chunk43FVH6LJ_cjs = require('./chunk-43FVH6LJ.cjs');
|
|
40
41
|
var chunkYFS2LMG4_cjs = require('./chunk-YFS2LMG4.cjs');
|
|
41
|
-
var
|
|
42
|
-
var
|
|
42
|
+
var chunkOSMKIRKI_cjs = require('./chunk-OSMKIRKI.cjs');
|
|
43
|
+
var chunkQZMI7364_cjs = require('./chunk-QZMI7364.cjs');
|
|
43
44
|
var chunkHGCVWOGK_cjs = require('./chunk-HGCVWOGK.cjs');
|
|
44
|
-
var
|
|
45
|
+
var chunkPQ7OKM3E_cjs = require('./chunk-PQ7OKM3E.cjs');
|
|
45
46
|
var chunkA3S55XGF_cjs = require('./chunk-A3S55XGF.cjs');
|
|
46
|
-
var
|
|
47
|
+
var chunkOIYMTGYN_cjs = require('./chunk-OIYMTGYN.cjs');
|
|
47
48
|
var chunkGA4LZZKQ_cjs = require('./chunk-GA4LZZKQ.cjs');
|
|
48
49
|
var chunkNGKODS3J_cjs = require('./chunk-NGKODS3J.cjs');
|
|
49
|
-
var
|
|
50
|
+
var chunkSRBYCGRC_cjs = require('./chunk-SRBYCGRC.cjs');
|
|
50
51
|
var chunkBPWUWUZ3_cjs = require('./chunk-BPWUWUZ3.cjs');
|
|
51
52
|
var chunkHAKYPZLB_cjs = require('./chunk-HAKYPZLB.cjs');
|
|
52
53
|
|
|
53
54
|
// src/client.ts
|
|
54
|
-
var NodaroClient = class _NodaroClient extends
|
|
55
|
+
var NodaroClient = class _NodaroClient extends chunkQZMI7364_cjs.NodaroClientCore {
|
|
55
56
|
workflows;
|
|
56
57
|
projects;
|
|
57
58
|
/** Generation sessions inside projects (Create Image / Video / Music). */
|
|
@@ -99,6 +100,8 @@ var NodaroClient = class _NodaroClient extends chunk5MTCKWKA_cjs.NodaroClientCor
|
|
|
99
100
|
recast;
|
|
100
101
|
/** Cast Swap: replace the people and/or location in a short video (Cloud). */
|
|
101
102
|
castSwap;
|
|
103
|
+
/** Trends: ready-made Cast Swap recipes you fill with your own pictures (Cloud). */
|
|
104
|
+
trends;
|
|
102
105
|
studio;
|
|
103
106
|
copilot;
|
|
104
107
|
community;
|
|
@@ -109,32 +112,32 @@ var NodaroClient = class _NodaroClient extends chunk5MTCKWKA_cjs.NodaroClientCor
|
|
|
109
112
|
edit;
|
|
110
113
|
constructor(opts) {
|
|
111
114
|
super(opts);
|
|
112
|
-
this.workflows = new
|
|
115
|
+
this.workflows = new chunkVHSMOBU7_cjs.WorkflowsResource(this);
|
|
113
116
|
this.projects = new chunkLAWYFC4G_cjs.ProjectsResource(this);
|
|
114
117
|
this.sessions = new chunkPEMLIAPZ_cjs.SessionsResource(this);
|
|
115
|
-
this.jobs = new
|
|
118
|
+
this.jobs = new chunkA7QSOD2S_cjs.JobsResource(this);
|
|
116
119
|
this.videoPro = new chunkW5VHATSR_cjs.VideoProResource(this);
|
|
117
120
|
this.executions = new chunkSBV5MWEL_cjs.ExecutionsResource(this);
|
|
118
|
-
this.nodes = new
|
|
121
|
+
this.nodes = new chunkQZHRXPN5_cjs.NodesResource(this);
|
|
119
122
|
this.scene3d = new chunkYDRXBRW2_cjs.Scene3DResource(this);
|
|
120
123
|
this.developerApps = new chunkA3S55XGF_cjs.DeveloperAppsResource(this);
|
|
121
124
|
this.oauth = new chunkGVIFLUYZ_cjs.OAuthResource(this);
|
|
122
125
|
this.webhooks = new chunk3B47IHB3_cjs.WebhooksResource(this);
|
|
123
|
-
this.apps = new
|
|
126
|
+
this.apps = new chunkOIYMTGYN_cjs.AppsResource(this);
|
|
124
127
|
this.characters = new chunkHAKYPZLB_cjs.CharactersResource(this);
|
|
125
128
|
this.locations = new chunkMQ74AKA2_cjs.LocationsResource(this);
|
|
126
129
|
this.objects = new chunkCR5E2SF3_cjs.ObjectsResource(this);
|
|
127
130
|
this.creatures = new chunkHGCVWOGK_cjs.CreaturesResource(this);
|
|
128
131
|
this.pipelines = new chunkCOCKKMNP_cjs.PipelinesResource(this);
|
|
129
132
|
this.reduce = new chunkGB6C5OEZ_cjs.ReduceResource(this);
|
|
130
|
-
this.promptHelper = new
|
|
133
|
+
this.promptHelper = new chunkTCLNSVYA_cjs.PromptHelperResource(this);
|
|
131
134
|
this.voices = new chunkR63TTR35_cjs.VoicesResource(this);
|
|
132
135
|
this.llm = new chunkSS3B6PHT_cjs.LlmResource(this);
|
|
133
|
-
this.media = new
|
|
136
|
+
this.media = new chunkETX3TLNB_cjs.MediaResource(this);
|
|
134
137
|
this.audio = new chunkGA4LZZKQ_cjs.AudioResource(this);
|
|
135
|
-
this.credits = new
|
|
138
|
+
this.credits = new chunkPQ7OKM3E_cjs.CreditsResource(this);
|
|
136
139
|
this.billing = new chunkNGKODS3J_cjs.BillingResource(this);
|
|
137
|
-
this.uploads = new
|
|
140
|
+
this.uploads = new chunkJTOEHQQJ_cjs.UploadsResource(this);
|
|
138
141
|
this.library = new chunk2DZWWIJ4_cjs.LibraryResource(this);
|
|
139
142
|
this.gallery = new chunkWUKIJJG2_cjs.GalleryResource(this);
|
|
140
143
|
this.presets = new chunk34PU2DAT_cjs.PresetsResource(this);
|
|
@@ -148,15 +151,16 @@ var NodaroClient = class _NodaroClient extends chunk5MTCKWKA_cjs.NodaroClientCor
|
|
|
148
151
|
this.models = new chunk7QOCWJKD_cjs.ModelsResource(this);
|
|
149
152
|
this.shots = new chunkMBFUMWI5_cjs.ShotsResource(this);
|
|
150
153
|
this.recast = new chunkKXEWTYS4_cjs.RecastResource(this);
|
|
151
|
-
this.castSwap = new
|
|
152
|
-
this.
|
|
153
|
-
this.
|
|
154
|
+
this.castSwap = new chunkSRBYCGRC_cjs.CastSwapResource(this);
|
|
155
|
+
this.trends = new chunkVCEYLJ2Q_cjs.TrendsResource(this);
|
|
156
|
+
this.studio = new chunkNKH2UFSD_cjs.StudioResource(this);
|
|
157
|
+
this.copilot = new chunkOSMKIRKI_cjs.CopilotResource(this);
|
|
154
158
|
this.community = new chunk43FVH6LJ_cjs.CommunityResource(this);
|
|
155
|
-
this.templates = new
|
|
156
|
-
this.tutorials = new
|
|
159
|
+
this.templates = new chunkEK672FFM_cjs.TemplatesResource(this);
|
|
160
|
+
this.tutorials = new chunkFHVNTS4E_cjs.TutorialsResource(this);
|
|
157
161
|
this.organizations = new chunkJ5LGGCAS_cjs.OrganizationsResource(this);
|
|
158
162
|
this.workspaces = new chunkLKH5M44B_cjs.WorkspacesResource(this);
|
|
159
|
-
this.edit = new
|
|
163
|
+
this.edit = new chunk7XOK277W_cjs.EditResource(this);
|
|
160
164
|
}
|
|
161
165
|
/**
|
|
162
166
|
* A client that acts in `workspaceId`, sharing this one's auth and config.
|
|
@@ -187,5 +191,5 @@ function createClient(opts) {
|
|
|
187
191
|
|
|
188
192
|
exports.NodaroClient = NodaroClient;
|
|
189
193
|
exports.createClient = createClient;
|
|
190
|
-
//# sourceMappingURL=chunk-
|
|
191
|
-
//# sourceMappingURL=chunk-
|
|
194
|
+
//# sourceMappingURL=chunk-IXCJ26F5.cjs.map
|
|
195
|
+
//# sourceMappingURL=chunk-IXCJ26F5.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/client.ts"],"names":["NodaroClientCore","WorkflowsResource","ProjectsResource","SessionsResource","JobsResource","VideoProResource","ExecutionsResource","NodesResource","Scene3DResource","DeveloperAppsResource","OAuthResource","WebhooksResource","AppsResource","CharactersResource","LocationsResource","ObjectsResource","CreaturesResource","PipelinesResource","ReduceResource","PromptHelperResource","VoicesResource","LlmResource","MediaResource","AudioResource","CreditsResource","BillingResource","UploadsResource","LibraryResource","GalleryResource","PresetsResource","SavedPostsResource","CollectionsResource","PalettesResource","MoodboardsResource","CompetitorsResource","PickerCatalogsResource","CatalogsResource","ModelsResource","ShotsResource","RecastResource","CastSwapResource","TrendsResource","StudioResource","CopilotResource","CommunityResource","TemplatesResource","TutorialsResource","OrganizationsResource","WorkspacesResource","EditResource"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0DO,IAAM,YAAA,GAAN,MAAM,aAAA,SAAqBA,kCAAA,CAAiB;AAAA,EACxC,SAAA;AAAA,EACA,QAAA;AAAA;AAAA,EAEA,QAAA;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;AAAA,EACA,MAAA;AAAA,EACA,YAAA;AAAA,EACA,MAAA;AAAA,EACA,GAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,OAAA;AAAA;AAAA,EAEA,OAAA;AAAA,EACA,OAAA;AA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AI,CAAA;AAC3C,IAAA,IAAA,CAAK,aAAA,GAAgB,IAAIC,uCAAA,CAAsB,IAAI,CAAA;AACnD,IAAA,IAAA,CAAK,UAAA,GAAa,IAAIC,oCAAA,CAAmB,IAAI,CAAA;AAC7C,IAAA,IAAA,CAAK,IAAA,GAAO,IAAIC,8BAAA,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-IXCJ26F5.cjs","sourcesContent":["import { WorkflowsResource } from \"./resources/workflows.js\"\nimport { ProjectsResource } from \"./resources/projects.js\"\nimport { SessionsResource } from \"./resources/sessions.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 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.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"]}
|
|
@@ -24,8 +24,18 @@ var UploadsResource = class {
|
|
|
24
24
|
);
|
|
25
25
|
return res.data;
|
|
26
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* Store a JSON document (`POST /v1/upload-json`, up to 25 MB) and get its
|
|
29
|
+
* public URL — e.g. an image editor's design state, passed to
|
|
30
|
+
* `client.jobs.fromUpload` as `editStateUrl` so the edit can be reopened.
|
|
31
|
+
* The URL is unguessable but public: never store a secret in it. Creates no
|
|
32
|
+
* library item.
|
|
33
|
+
*/
|
|
34
|
+
uploadJson(json) {
|
|
35
|
+
return this.client.request("POST", "/v1/upload-json", { body: json });
|
|
36
|
+
}
|
|
27
37
|
};
|
|
28
38
|
|
|
29
39
|
exports.UploadsResource = UploadsResource;
|
|
30
|
-
//# sourceMappingURL=chunk-
|
|
31
|
-
//# sourceMappingURL=chunk-
|
|
40
|
+
//# sourceMappingURL=chunk-JTOEHQQJ.cjs.map
|
|
41
|
+
//# sourceMappingURL=chunk-JTOEHQQJ.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/resources/uploads.ts"],"names":[],"mappings":";;;AA4BO,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;AAAA;AAAA;AAAA;AAAA,EAUpB,MAAM,OAAO,IAAA,EAAmC;AAC9C,IAAA,MAAM,IAAA,GAAO,IAAI,QAAA,EAAS;AAC1B,IAAA,IAAA,CAAK,MAAA,CAAO,QAAQ,IAAI,CAAA;AACxB,IAAA,MAAM,GAAA,GAAM,MAAM,IAAA,CAAK,MAAA,CAAO,OAAA;AAAA,MAC5B,MAAA;AAAA,MACA,YAAA;AAAA,MACA,EAAE,MAAM,IAAA;AAAK,KACf;AACA,IAAA,OAAO,GAAA,CAAI,IAAA;AAAA,EACb;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,WAAW,IAAA,EAA+E;AACxF,IAAA,OAAO,IAAA,CAAK,OAAO,OAAA,CAA0B,MAAA,EAAQ,mBAAmB,EAAE,IAAA,EAAM,MAAM,CAAA;AAAA,EACxF;AACF","file":"chunk-JTOEHQQJ.cjs","sourcesContent":["import type { NodaroClientCore } from \"../core.js\"\n\n/**\n * Result of a successful `POST /v1/upload`. Mirrors the route's `data` envelope\n * (`backend/src/routes/upload.ts`), the source of truth — keep in sync if that\n * response changes. The route also returns loosely-typed extracted `metadata`;\n * it is omitted here until a consumer needs a typed shape (add it shaped to\n * that need rather than inventing `Record<string, unknown>` surface now).\n */\nexport interface UploadResult {\n /** Public R2 URL of the stored asset (always present on success). */\n readonly url: string\n /** Storage row id; `null` when no asset row was written (e.g. unauthenticated). */\n readonly assetId: string | null\n /** Generated thumbnail URL (images/video); `null` for audio or on failure. */\n readonly thumbnailUrl: string | null\n /** Server-classified asset category (e.g. \"image\" | \"video\" | \"audio\"). */\n readonly category: string\n /** Display filename (server override or the original). */\n readonly filename: string\n /** Final MIME type after server normalization. */\n readonly mimeType: string\n /** Stored byte size. */\n readonly sizeBytes: number\n /** R2 object key. */\n readonly r2Key: string\n}\n\nexport class UploadsResource {\n constructor(private client: NodaroClientCore) {}\n\n /**\n * Upload one file (`POST /v1/upload`, multipart — the file rides the `file`\n * field). The SDK's `request` detects the `FormData` body and lets the\n * runtime set the multipart boundary. Returns the persisted asset's public\n * URL + storage metadata (unwraps the `{ data }` envelope). Throws\n * `StorageExceededError` (413) over the storage cap and the SDK's other typed\n * errors on the usual statuses.\n */\n async upload(file: File): Promise<UploadResult> {\n const form = new FormData()\n form.append(\"file\", file)\n const res = await this.client.request<{ data: UploadResult }>(\n \"POST\",\n \"/v1/upload\",\n { body: form },\n )\n return res.data\n }\n\n /**\n * Store a JSON document (`POST /v1/upload-json`, up to 25 MB) and get its\n * public URL — e.g. an image editor's design state, passed to\n * `client.jobs.fromUpload` as `editStateUrl` so the edit can be reopened.\n * The URL is unguessable but public: never store a secret in it. Creates no\n * library item.\n */\n uploadJson(json: Record<string, unknown> | readonly unknown[]): Promise<UploadJsonResult> {\n return this.client.request<UploadJsonResult>(\"POST\", \"/v1/upload-json\", { body: json })\n }\n}\n\n/** Result of {@link UploadsResource.uploadJson}. */\nexport interface UploadJsonResult {\n /** Public URL of the stored JSON document. */\n readonly url: string\n}\n"]}
|
|
@@ -196,5 +196,5 @@ var WorkflowsResource = class {
|
|
|
196
196
|
};
|
|
197
197
|
|
|
198
198
|
export { WorkflowsResource };
|
|
199
|
-
//# sourceMappingURL=chunk-
|
|
200
|
-
//# sourceMappingURL=chunk-
|
|
199
|
+
//# sourceMappingURL=chunk-JUON5NXA.js.map
|
|
200
|
+
//# sourceMappingURL=chunk-JUON5NXA.js.map
|
|
@@ -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AAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,YAAA,GAAoD;AAClD,IAAA,OAAO,IAAA,CAAK,MAAA,CAAO,OAAA,CAAQ,KAAA,EAAO,8BAA8B,CAAA;AAAA,EAClE;AACF","file":"chunk-ZXJQSFIA.js","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 * 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\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"]}
|
|
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,K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"\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\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"]}
|