@nodaro/sdk 1.25.0 → 1.27.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/index.cjs +119 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +233 -3
- package/dist/index.d.ts +233 -3
- package/dist/index.js +116 -6
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CollaboratorRole, GenericNode, GenericEdge, WorkflowExport, WorkflowImportReport, WorkflowVisibility, ConnectedReference, TtsProvider, EntityStyle, CharacterAspectRatio, CharacterAttachColumn, LocationAssetType, LocationAttachColumn, SurroundDirection, ObjectAssetType, ObjectAttachColumn, ObjectAspectRatio, CreatureAttachColumn, PipelineInput, PipelineStatus, PipelineMode, PipelineStageName, SubGateName, ChatEnabledStage, ProposedChange, ReduceStrategyId, ReduceMeta, Voice, VoiceLibraryParams, VoiceLibraryResponse, VoiceClone, AudioFxPreset, BrowseCommunityParams, BrowseCommunityResult, CommunityCard, CommunityFullDetail, CommunityEntityType, CloneListingResult, FavoriteListingResult, CommunityReportReason, ReportListingResult, PublishListingParams, PublishListingResult, SharedListing, OrganizationView, OrgKind, OrgSettings, OrgPage, OrgMemberView, MemberStatus, WorkspaceRole, InvitationDelivery, InvitationState, InvitationView, InvitationPreview, OrgAuditEntry, WorkspaceSummary, WorkspaceView, WorkspaceSettings, WorkspaceMemberView, JoinCodeView, MeOrganizations } from '@nodaro/shared';
|
|
2
|
-
export { AudioFxPreset, BrowseCommunityParams, BrowseCommunityResult, CHARACTER_ASPECT_DEFAULTS, CHARACTER_ASPECT_OPTIONS, CHARACTER_STYLES, OBJECT_ASPECT_DEFAULTS as CREATURE_ASPECT_DEFAULTS, OBJECT_ASPECT_OPTIONS as CREATURE_ASPECT_OPTIONS, CREATURE_ATTACH_COLUMNS, CharacterAspectRatio, CloneListingResult, CommunityCard, CommunityEntityType, CommunityReportReason, CommunitySort, ConnectedReference, ObjectAspectRatio as CreatureAspectRatio, CreatureAttachColumn, EntityStyle, FavoriteListingResult, GenericEdge, GenericNode, InvitationDelivery, InvitationPreview, InvitationState, InvitationView, JoinCodeView, LOCATION_ASSET_TYPES, LOCATION_ATTACH_COLUMNS, LocationAssetType, LocationAttachColumn, MeOrganizations, MemberStatus, OBJECT_ASPECT_DEFAULTS, OBJECT_ASPECT_OPTIONS, OBJECT_ASSET_TYPES, OBJECT_ATTACH_COLUMNS, ObjectAspectRatio, ObjectAssetType, ObjectAttachColumn, OrgAuditEntry, OrgErrorCode, OrgKind, OrgMemberView, OrgPage, OrgRole, OrgSettings, OrgStatus, OrganizationSummary, OrganizationView, PROMPT_PREFIX_KEY, PROMPT_SUFFIX_KEY, PipelineStageName, PromptAffixFields, PublishListingParams, PublishListingResult, ReduceMeta, ReduceStrategyId, ReportListingResult, SURROUND_DIRECTIONS, SharedListing, SharedVoice, SurroundDirection, Voice, VoiceClone, VoiceLibraryParams, VoiceLibraryResponse, WORKSPACE_HEADER, WorkflowExport, WorkflowExportCharacter, WorkflowExportLocation, WorkflowExportObject, WorkspaceMemberView, WorkspaceRole, WorkspaceSettings, WorkspaceSummary, WorkspaceView } from '@nodaro/shared';
|
|
1
|
+
import { CollaboratorRole, GenericNode, GenericEdge, WorkflowExport, WorkflowImportReport, WorkflowVisibility, ConnectedReference, ModelInputAdjustment, TtsProvider, EntityStyle, CharacterAspectRatio, CharacterAttachColumn, LocationAssetType, LocationAttachColumn, SurroundDirection, ObjectAssetType, ObjectAttachColumn, ObjectAspectRatio, CreatureAttachColumn, PipelineInput, PipelineStatus, PipelineMode, PipelineStageName, SubGateName, ChatEnabledStage, ProposedChange, ReduceStrategyId, ReduceMeta, Voice, VoiceLibraryParams, VoiceLibraryResponse, VoiceClone, AudioFxPreset, BrowseCommunityParams, BrowseCommunityResult, CommunityCard, CommunityFullDetail, CommunityEntityType, CloneListingResult, FavoriteListingResult, CommunityReportReason, ReportListingResult, PublishListingParams, PublishListingResult, SharedListing, OrganizationView, OrgKind, OrgSettings, OrgPage, OrgMemberView, MemberStatus, WorkspaceRole, InvitationDelivery, InvitationState, InvitationView, InvitationPreview, OrgAuditEntry, UsageQuery, UsageReport, UsageLogEntry, WorkspaceSummary, WorkspaceView, WorkspaceSettings, WorkspaceMemberView, JoinCodeView, MeOrganizations } from '@nodaro/shared';
|
|
2
|
+
export { AudioFxPreset, BrowseCommunityParams, BrowseCommunityResult, CHARACTER_ASPECT_DEFAULTS, CHARACTER_ASPECT_OPTIONS, CHARACTER_STYLES, OBJECT_ASPECT_DEFAULTS as CREATURE_ASPECT_DEFAULTS, OBJECT_ASPECT_OPTIONS as CREATURE_ASPECT_OPTIONS, CREATURE_ATTACH_COLUMNS, CharacterAspectRatio, CloneListingResult, CommunityCard, CommunityEntityType, CommunityReportReason, CommunitySort, ConnectedReference, ObjectAspectRatio as CreatureAspectRatio, CreatureAttachColumn, EntityStyle, FavoriteListingResult, GenericEdge, GenericNode, InvitationDelivery, InvitationPreview, InvitationState, InvitationView, JoinCodeView, LOCATION_ASSET_TYPES, LOCATION_ATTACH_COLUMNS, LocationAssetType, LocationAttachColumn, MeOrganizations, MemberStatus, OBJECT_ASPECT_DEFAULTS, OBJECT_ASPECT_OPTIONS, OBJECT_ASSET_TYPES, OBJECT_ATTACH_COLUMNS, ObjectAspectRatio, ObjectAssetType, ObjectAttachColumn, OrgAuditEntry, OrgErrorCode, OrgKind, OrgMemberView, OrgPage, OrgRole, OrgSettings, OrgStatus, OrganizationSummary, OrganizationView, PROMPT_PREFIX_KEY, PROMPT_SUFFIX_KEY, PipelineStageName, PromptAffixFields, PublishListingParams, PublishListingResult, ReduceMeta, ReduceStrategyId, ReportListingResult, SURROUND_DIRECTIONS, SharedListing, SharedVoice, SurroundDirection, USAGE_GROUP_BYS, UsageGroupBy, UsageLogEntry, UsageQuery, UsageReport, UsageReportRow, UsageReportTotals, UsageVarianceRow, Voice, VoiceClone, VoiceLibraryParams, VoiceLibraryResponse, WORKSPACE_HEADER, WorkflowExport, WorkflowExportCharacter, WorkflowExportLocation, WorkflowExportObject, WorkspaceMemberView, WorkspaceRole, WorkspaceSettings, WorkspaceSummary, WorkspaceView } from '@nodaro/shared';
|
|
3
3
|
import { PersonValue, WizardNodeContext, WizardQuestion, WizardSelection, RecommendedModel, FactoryPreset } from '@nodaro/prompts';
|
|
4
4
|
export { PEOPLE, PERSON_DIMENSION_LABELS, PERSON_DIMENSION_ORDER, PersonValue, RecommendedModel, WizardNodeContext, WizardOption, WizardQuestion, WizardSelection, buildPersonHints } from '@nodaro/prompts';
|
|
5
5
|
|
|
@@ -317,6 +317,29 @@ declare class ProjectsResource {
|
|
|
317
317
|
}
|
|
318
318
|
|
|
319
319
|
type JobStatus = "pending" | "queued" | "processing" | "completed" | "failed" | "cancelled";
|
|
320
|
+
/**
|
|
321
|
+
* A job's `jobs.error_hint` (migration 376) — a user-safe, machine-readable
|
|
322
|
+
* failure verdict the worker writes on a FINAL provider content-policy
|
|
323
|
+
* block, so a caller can act on it without parsing `error_message` prose.
|
|
324
|
+
* `class` distinguishes a deterministic block (copyright/likeness — retrying
|
|
325
|
+
* the same request never helps) from `safety`, whose filter is known to be
|
|
326
|
+
* non-deterministic for some models: `retried` says whether the worker
|
|
327
|
+
* already spent its one extra attempt, and `suggestedProvider` — present
|
|
328
|
+
* only when the catalog declares a fallback for the model that failed — is a
|
|
329
|
+
* real model id the SAME prompt/references can be retried on.
|
|
330
|
+
*/
|
|
331
|
+
interface JobErrorHint {
|
|
332
|
+
kind: "safety-block";
|
|
333
|
+
class: "copyright" | "likeness" | "safety";
|
|
334
|
+
retried: boolean;
|
|
335
|
+
suggestedProvider?: string;
|
|
336
|
+
}
|
|
337
|
+
/**
|
|
338
|
+
* The billing lifecycle of a job's credit reservation — `usage_logs.status`
|
|
339
|
+
* for the job's `usage_log_id`. `null` when the job has no usage log (e.g. a
|
|
340
|
+
* free run) or hasn't reserved credits yet.
|
|
341
|
+
*/
|
|
342
|
+
type CreditStatus = "reserved" | "committed" | "refunded";
|
|
320
343
|
/**
|
|
321
344
|
* Job record returned to non-admin SDK consumers. Field names are snake_case
|
|
322
345
|
* to match the wire format (per the OpenAPI fix in Phase 1).
|
|
@@ -335,6 +358,13 @@ interface Job {
|
|
|
335
358
|
input_data: unknown;
|
|
336
359
|
output_data: unknown;
|
|
337
360
|
error_message: string | null;
|
|
361
|
+
/** PR9: present on a failed job the worker classified as a content-policy
|
|
362
|
+
* block; absent/null otherwise. User-safe by construction. */
|
|
363
|
+
error_hint?: JobErrorHint | null;
|
|
364
|
+
/** PR9: the job's credit reservation lifecycle, derived server-side from
|
|
365
|
+
* `usage_logs.status`. `null` when there is no usage log to report. Never
|
|
366
|
+
* changes the meaning of `credits` (the reserved amount) below. */
|
|
367
|
+
credit_status?: CreditStatus | null;
|
|
338
368
|
credits: number | null;
|
|
339
369
|
job_type: string | null;
|
|
340
370
|
created_at: string;
|
|
@@ -354,6 +384,22 @@ interface CancelJobResult {
|
|
|
354
384
|
success: true;
|
|
355
385
|
cancelled: number;
|
|
356
386
|
}
|
|
387
|
+
interface ListJobsParams {
|
|
388
|
+
/** Exact match on `input_data.type` — the route that created the job
|
|
389
|
+
* (`"llm-structured"`, `"video-analysis"`, …). */
|
|
390
|
+
type?: string;
|
|
391
|
+
/** Exact match on `input_data.origin` — the client app that sent it. */
|
|
392
|
+
origin?: string;
|
|
393
|
+
/** Page size, 1–100 (server default 50). */
|
|
394
|
+
limit?: number;
|
|
395
|
+
/** The previous page's `next`. */
|
|
396
|
+
cursor?: string;
|
|
397
|
+
}
|
|
398
|
+
interface ListJobsPage {
|
|
399
|
+
data: Job[];
|
|
400
|
+
/** Pass back as `cursor` for the next page; `null` on the last one. */
|
|
401
|
+
next: string | null;
|
|
402
|
+
}
|
|
357
403
|
/**
|
|
358
404
|
* Lean job status returned by `GET /v1/jobs/:id/status`. Skips the
|
|
359
405
|
* `input_data` JSONB and cost/timestamp columns. Its `output_data` still goes
|
|
@@ -366,6 +412,10 @@ interface JobStatusResult {
|
|
|
366
412
|
progress?: number;
|
|
367
413
|
output_data?: unknown;
|
|
368
414
|
error_message?: string | null;
|
|
415
|
+
/** PR9: see {@link Job.error_hint}. */
|
|
416
|
+
error_hint?: JobErrorHint | null;
|
|
417
|
+
/** PR9: see {@link Job.credit_status}. */
|
|
418
|
+
credit_status?: CreditStatus | null;
|
|
369
419
|
}
|
|
370
420
|
declare class JobsResource {
|
|
371
421
|
private client;
|
|
@@ -374,6 +424,12 @@ declare class JobsResource {
|
|
|
374
424
|
get(id: string): Promise<{
|
|
375
425
|
data: Job;
|
|
376
426
|
}>;
|
|
427
|
+
/**
|
|
428
|
+
* Your jobs, newest first (`GET /v1/jobs`), cursor-paginated. `type` and
|
|
429
|
+
* `origin` filter on the job's own `input_data`, which every job carries —
|
|
430
|
+
* a client app lists its runs with `{ type: "llm-structured", origin: "studio" }`.
|
|
431
|
+
*/
|
|
432
|
+
list(params?: ListJobsParams): Promise<ListJobsPage>;
|
|
377
433
|
/**
|
|
378
434
|
* Get the lean status of a single job (poll-loop friendly).
|
|
379
435
|
* Hits `GET /v1/jobs/:id/status` — returns only id/status/progress/
|
|
@@ -591,9 +647,22 @@ interface NodeDescriptor {
|
|
|
591
647
|
* result body. The shape is route-specific; consumers should branch on the
|
|
592
648
|
* presence of `jobId`.
|
|
593
649
|
*/
|
|
650
|
+
/**
|
|
651
|
+
* One parameter the server corrected because the chosen model does not accept
|
|
652
|
+
* the value you sent (e.g. `gpt-image-2` has no 3:2 aspect ratio). The run
|
|
653
|
+
* proceeds with the corrected value rather than failing — this is how you find
|
|
654
|
+
* out what it actually used.
|
|
655
|
+
*
|
|
656
|
+
* Re-exports `@nodaro/shared`'s `ModelInputAdjustment` — the same shape the
|
|
657
|
+
* server's `normalizeModelInput` / `resolveNormalizedImageGen` populate — under
|
|
658
|
+
* the SDK's naming convention, rather than declaring a second copy of the
|
|
659
|
+
* fields.
|
|
660
|
+
*/
|
|
661
|
+
type RunNodeAdjustment = ModelInputAdjustment;
|
|
594
662
|
type RunNodeResult = {
|
|
595
663
|
jobId: string;
|
|
596
664
|
usageLogId?: string;
|
|
665
|
+
adjustments?: RunNodeAdjustment[];
|
|
597
666
|
[k: string]: unknown;
|
|
598
667
|
} | Record<string, unknown>;
|
|
599
668
|
/**
|
|
@@ -4079,6 +4148,89 @@ interface DubbingInput {
|
|
|
4079
4148
|
watermark?: boolean;
|
|
4080
4149
|
}
|
|
4081
4150
|
|
|
4151
|
+
/**
|
|
4152
|
+
* Structured LLM output — `POST /v1/llm/structured` and its asynchronous
|
|
4153
|
+
* twin. The platform supplies the model lane, forced JSON-Schema output with
|
|
4154
|
+
* validation and error-fed retries, the job row and the credit lifecycle; the
|
|
4155
|
+
* caller supplies its own system prompt and schema (an app-owned vocabulary
|
|
4156
|
+
* the platform cannot know — Nodaro Studio's production plan is the first).
|
|
4157
|
+
*/
|
|
4158
|
+
interface LlmStructuredInput {
|
|
4159
|
+
/** The system prompt (≤ 100,000 chars). */
|
|
4160
|
+
system: string;
|
|
4161
|
+
/** The user turn (1–100,000 chars). */
|
|
4162
|
+
input: string;
|
|
4163
|
+
/** A JSON Schema OBJECT (`type: "object"`, ≤ 64 KB, ≤ 20 levels) in the
|
|
4164
|
+
* keyword subset the server converts — see the API guide. */
|
|
4165
|
+
jsonSchema: Record<string, unknown>;
|
|
4166
|
+
/** Names the forced-output tool the provider sees (≤ 64 chars). */
|
|
4167
|
+
schemaName?: string;
|
|
4168
|
+
llmModel?: string;
|
|
4169
|
+
reasoningEffort?: string;
|
|
4170
|
+
/** Invalid answers fed back with their error before the call fails (0–3, default 2). */
|
|
4171
|
+
maxRetries?: number;
|
|
4172
|
+
/** Your app's slug — attribution only; `jobs.list({ origin })` finds the rows. */
|
|
4173
|
+
origin?: string;
|
|
4174
|
+
advancedMode?: boolean;
|
|
4175
|
+
temperature?: number;
|
|
4176
|
+
maxTokens?: number;
|
|
4177
|
+
}
|
|
4178
|
+
interface LlmStructuredResult<T = unknown> {
|
|
4179
|
+
jobId: string;
|
|
4180
|
+
output: T;
|
|
4181
|
+
usage: {
|
|
4182
|
+
inputTokens: number;
|
|
4183
|
+
outputTokens: number;
|
|
4184
|
+
};
|
|
4185
|
+
}
|
|
4186
|
+
interface LlmStructuredJobInput extends LlmStructuredInput {
|
|
4187
|
+
/** Display label stored on the job (≤ 120 chars) — a run list's row title. */
|
|
4188
|
+
label?: string;
|
|
4189
|
+
/** Draft FROM this video: the platform analyzes it first (`POST
|
|
4190
|
+
* /v1/video-analysis`, a separate job you own) and appends the analysis
|
|
4191
|
+
* to `input` before the LLM call. */
|
|
4192
|
+
videoUrl?: string;
|
|
4193
|
+
/** Analysis options, handed to the analysis route unchanged (its tiers). */
|
|
4194
|
+
videoAnalysis?: {
|
|
4195
|
+
llmModel?: string;
|
|
4196
|
+
selectionMode?: "choose" | "combine";
|
|
4197
|
+
};
|
|
4198
|
+
}
|
|
4199
|
+
/** `output_data` of an `llm-structured` job as it progresses: `stage` while
|
|
4200
|
+
* running (`analyzing` only for movie runs), then the result. */
|
|
4201
|
+
interface LlmStructuredJobOutput<T = unknown> {
|
|
4202
|
+
stage?: "analyzing" | "drafting";
|
|
4203
|
+
output?: T;
|
|
4204
|
+
inputTokens?: number;
|
|
4205
|
+
outputTokens?: number;
|
|
4206
|
+
analysisJobId?: string;
|
|
4207
|
+
analysisCredits?: number;
|
|
4208
|
+
}
|
|
4209
|
+
declare class LlmResource {
|
|
4210
|
+
private client;
|
|
4211
|
+
constructor(client: NodaroClient);
|
|
4212
|
+
/**
|
|
4213
|
+
* Synchronous forced-schema completion (`POST /v1/llm/structured`). A call
|
|
4214
|
+
* can run several minutes — longer than the client's default 60 s
|
|
4215
|
+
* `timeoutMs`; construct the client with a larger `timeoutMs` for this
|
|
4216
|
+
* call, or use {@link LlmResource.structuredJob}.
|
|
4217
|
+
*/
|
|
4218
|
+
structured<T = unknown>(input: LlmStructuredInput): Promise<LlmStructuredResult<T>>;
|
|
4219
|
+
/**
|
|
4220
|
+
* The same call as a job (`POST /v1/llm/structured/jobs`): answers `{ jobId }`
|
|
4221
|
+
* at once. Poll `jobs.getStatus(jobId)` — `output_data` is an
|
|
4222
|
+
* {@link LlmStructuredJobOutput}; `error_message` says why a run failed.
|
|
4223
|
+
* `jobs.list({ type: "llm-structured", origin })` finds every run later.
|
|
4224
|
+
* Throws `NotFoundError` on a platform that predates the route. An instance
|
|
4225
|
+
* that proxies its LLM calls to nodaro.ai answers `503 provider_unavailable`
|
|
4226
|
+
* permanently — the SDK surfaces that as a generic `NodaroError` with the
|
|
4227
|
+
* same code; treat it as unavailable here, not as transient.
|
|
4228
|
+
*/
|
|
4229
|
+
structuredJob(input: LlmStructuredJobInput): Promise<{
|
|
4230
|
+
jobId: string;
|
|
4231
|
+
}>;
|
|
4232
|
+
}
|
|
4233
|
+
|
|
4082
4234
|
/**
|
|
4083
4235
|
* Media ingestion + trimming — the source-preparation steps a Voice Changer Pro
|
|
4084
4236
|
* flow (or any pipeline) needs before it has a clip to work on: pull a social
|
|
@@ -4251,6 +4403,16 @@ declare class MediaResource {
|
|
|
4251
4403
|
videoMetadata(input: {
|
|
4252
4404
|
url: string;
|
|
4253
4405
|
}): Promise<VideoMetadata>;
|
|
4406
|
+
/**
|
|
4407
|
+
* Cut or crop a stored file (`POST /v1/media/process`) — synchronous and
|
|
4408
|
+
* free, the source-preparation sibling of the priced `trimVideo` node.
|
|
4409
|
+
* `trim` is `[startTime, endTime]` in seconds; `deleteSource: true` removes
|
|
4410
|
+
* the source object afterwards when it is yours and nothing else references
|
|
4411
|
+
* it ("the cut replaces the original"). Answers the stored file.
|
|
4412
|
+
*/
|
|
4413
|
+
process(input: MediaProcessInput): Promise<{
|
|
4414
|
+
data: MediaProcessResult;
|
|
4415
|
+
}>;
|
|
4254
4416
|
}
|
|
4255
4417
|
/**
|
|
4256
4418
|
* One event from {@link MediaResource.downloadVideoProgress}. The stream ends
|
|
@@ -4277,6 +4439,30 @@ interface VideoMetadata {
|
|
|
4277
4439
|
isLive?: boolean;
|
|
4278
4440
|
[key: string]: unknown;
|
|
4279
4441
|
}
|
|
4442
|
+
interface MediaProcessInput {
|
|
4443
|
+
sourceUrl: string;
|
|
4444
|
+
type: "video" | "audio";
|
|
4445
|
+
trim?: {
|
|
4446
|
+
startTime: number;
|
|
4447
|
+
endTime: number;
|
|
4448
|
+
};
|
|
4449
|
+
crop?: {
|
|
4450
|
+
x: number;
|
|
4451
|
+
y: number;
|
|
4452
|
+
width: number;
|
|
4453
|
+
height: number;
|
|
4454
|
+
};
|
|
4455
|
+
format?: "mp4" | "webm" | "mp3" | "wav" | "m4a" | "aac";
|
|
4456
|
+
deleteSource?: boolean;
|
|
4457
|
+
}
|
|
4458
|
+
interface MediaProcessResult {
|
|
4459
|
+
url: string;
|
|
4460
|
+
thumbnailUrl: string | null;
|
|
4461
|
+
assetId: string | null;
|
|
4462
|
+
sizeBytes: number;
|
|
4463
|
+
mimeType: string;
|
|
4464
|
+
metadata: Record<string, unknown>;
|
|
4465
|
+
}
|
|
4280
4466
|
|
|
4281
4467
|
/**
|
|
4282
4468
|
* Audio primitives — the building blocks Voice Changer Pro composes internally
|
|
@@ -5504,6 +5690,20 @@ declare class OrganizationsResource {
|
|
|
5504
5690
|
cursor?: string;
|
|
5505
5691
|
limit?: number;
|
|
5506
5692
|
}): Promise<OrgPage<OrgAuditEntry>>;
|
|
5693
|
+
/**
|
|
5694
|
+
* Credits by workspace, member, model or day. Owner and org admins only.
|
|
5695
|
+
* Inclusive dates (`from`/`to`), IANA `tz` (default UTC), ≤ 366 days
|
|
5696
|
+
* (default last 30).
|
|
5697
|
+
*/
|
|
5698
|
+
usage(orgId: string, opts?: Omit<UsageQuery, "cursor" | "limit" | "groupBy"> & {
|
|
5699
|
+
groupBy?: "workspace" | "member" | "model" | "day";
|
|
5700
|
+
}): Promise<{
|
|
5701
|
+
data: UsageReport;
|
|
5702
|
+
}>;
|
|
5703
|
+
/** The individual runs behind a report, newest first, cursor-paged. */
|
|
5704
|
+
usageRows(orgId: string, opts?: Omit<UsageQuery, "groupBy">): Promise<OrgPage<UsageLogEntry>>;
|
|
5705
|
+
/** The same report (or the rows, with `groupBy: "none"`) as CSV text. */
|
|
5706
|
+
usageCsv(orgId: string, opts?: Omit<UsageQuery, "cursor" | "limit">): Promise<string>;
|
|
5507
5707
|
}
|
|
5508
5708
|
|
|
5509
5709
|
/**
|
|
@@ -5608,6 +5808,21 @@ declare class WorkspacesResource {
|
|
|
5608
5808
|
workspaceId: string;
|
|
5609
5809
|
};
|
|
5610
5810
|
}>;
|
|
5811
|
+
/**
|
|
5812
|
+
* Credits by member, model or day for this workspace. A plain member sees
|
|
5813
|
+
* their OWN runs (the report is self-narrowed and `groupBy: "member"` is
|
|
5814
|
+
* refused); a workspace admin sees everyone and may filter `userId`.
|
|
5815
|
+
* Inclusive dates, IANA `tz` (default UTC), ≤ 366 days (default last 30).
|
|
5816
|
+
*/
|
|
5817
|
+
usage(id: string, opts?: Omit<UsageQuery, "cursor" | "limit" | "workspaceId" | "groupBy"> & {
|
|
5818
|
+
groupBy?: "member" | "model" | "day";
|
|
5819
|
+
}): Promise<{
|
|
5820
|
+
data: UsageReport;
|
|
5821
|
+
}>;
|
|
5822
|
+
/** The individual runs behind a report, newest first, cursor-paged. */
|
|
5823
|
+
usageRows(id: string, opts?: Omit<UsageQuery, "groupBy" | "workspaceId">): Promise<OrgPage<UsageLogEntry>>;
|
|
5824
|
+
/** The same report (or the rows, with `groupBy: "none"`) as CSV text. */
|
|
5825
|
+
usageCsv(id: string, opts?: Omit<UsageQuery, "cursor" | "limit" | "workspaceId">): Promise<string>;
|
|
5611
5826
|
}
|
|
5612
5827
|
|
|
5613
5828
|
interface ClientOptions {
|
|
@@ -5703,6 +5918,7 @@ declare class NodaroClient {
|
|
|
5703
5918
|
readonly reduce: ReduceResource;
|
|
5704
5919
|
readonly promptHelper: PromptHelperResource;
|
|
5705
5920
|
readonly voices: VoicesResource;
|
|
5921
|
+
readonly llm: LlmResource;
|
|
5706
5922
|
readonly media: MediaResource;
|
|
5707
5923
|
readonly audio: AudioResource;
|
|
5708
5924
|
readonly credits: CreditsResource;
|
|
@@ -5734,7 +5950,21 @@ declare class NodaroClient {
|
|
|
5734
5950
|
* Pass `null` for the personal space.
|
|
5735
5951
|
*/
|
|
5736
5952
|
withWorkspace(workspaceId: string | null): NodaroClient;
|
|
5953
|
+
/**
|
|
5954
|
+
* The transport: build the request, send it, throw the typed error on a
|
|
5955
|
+
* non-2xx via {@link throwFromResponse}, then read the body via `read` — all
|
|
5956
|
+
* inside the abort timer, so `timeoutMs` bounds the body download too (a
|
|
5957
|
+
* stalled CSV stream aborts, it does not hang forever). Both the JSON path
|
|
5958
|
+
* ({@link request}) and the text path ({@link requestText}) go through here.
|
|
5959
|
+
*/
|
|
5960
|
+
private send;
|
|
5737
5961
|
request<T>(method: string, path: string, options?: RequestOptions): Promise<T>;
|
|
5962
|
+
/**
|
|
5963
|
+
* Like {@link request}, for endpoints that answer text (CSV exports). Errors
|
|
5964
|
+
* are still the JSON envelope and throw the same typed errors, and the read is
|
|
5965
|
+
* bounded by the same timeout as the request.
|
|
5966
|
+
*/
|
|
5967
|
+
requestText(method: string, path: string, options?: RequestOptions): Promise<string>;
|
|
5738
5968
|
/**
|
|
5739
5969
|
* `GET /v1/me` → the authenticated user's identity (see {@link UserIdentity}).
|
|
5740
5970
|
* Unwraps the `{ data }` envelope. Throws `UnauthorizedError` (401) when the
|
|
@@ -5842,4 +6072,4 @@ interface ApiErrorBody {
|
|
|
5842
6072
|
}
|
|
5843
6073
|
declare function throwFromResponse(status: number, body: ApiErrorBody): never;
|
|
5844
6074
|
|
|
5845
|
-
export { type AccessTokenResponse, type AnalyzeInput, type AnalyzeResult, type AppRun, type AppRunResult, type ApplyChatProposalResult, type ApproveCreatureMainImageResult, type ApproveMainImageResult, type ApproveObjectMainImageResult, type ApprovePortraitResult, AppsResource, AudioResource, type Auth, type BranchPipelineInput, type BranchPipelineResult, type BrowseTemplatesParams, type BrowseTemplatesResult, CREATURE_ASSET_TYPES, CallbackAuth, type CancelExecutionParams, type CancelJobResult, CatalogsResource, type Character, type CharacterDetail, type CharacterUsage, CharactersResource, type ChatStageResult, type ChatTurn, type ClientOptions, type CloneTemplateParams, type CloneTemplateResult, CommunityResource, type ContinueVideoProResult, type CreateCreatureInput, type CreateDeveloperAppInput, type CreateDeveloperAppResult, type CreateLocationInput, type CreateObjectInput, type CreateOrgInput, type CreateProjectInput, type CreateRecastInput, type CreateShotInput, type CreateWorkflowInput, type CreateWorkspaceInput, type Creature, type CreatureAssetType, type CreatureDetail, type CreatureReferencePhoto, type CreatureReferencePhotoKind, CreaturesResource, CreditsResource, type DeleteAppRunResult, type DeveloperApp, type DeveloperAppScope, type DeveloperAppStatus, DeveloperAppsResource, type DownloadVideoProgress, type DubbingInput, type DuplicateCharacterInput, type EnhanceInput, type EstimateRecastInput, type EstimateRecastRescoreInput, type ExchangeCodeInput, type ExecutionStatus, type ExecutionTriggerType, ExecutionsResource, type FactoryPresetsResult, ForbiddenError, type GenerateAssetInput, type GenerateCharacterInput, type GenerateCharacterResult, type GenerateCreatureAssetInput, type GenerateCreatureAssetResult, type GenerateCreatureInput, type GenerateCreatureMotionInput, type GenerateCreatureMotionResult, type GenerateCreatureResult, type GenerateImageParams, type GenerateInput, type GenerateLocationAssetInput, type GenerateLocationInput, type GenerateLocationResult, type GenerateMotionInput, type GenerateObjectAssetInput, type GenerateObjectAssetResult, type GenerateObjectInput, type GenerateObjectMotionInput, type GenerateObjectMotionResult, type GenerateObjectResult, type GenerateSurroundContinuationInput, type GenerateVideoParams, type GetPickerCatalogOptions, InsufficientCreditsError, type InviteInput, type Job, JobAbortedError, JobFailedError, type JobStatus, type JobStatusResult, JobTimeoutError, JobsResource, type LibraryAsset, LibraryResource, type ListAppRunsParams, type ListAppsParams, type ListAppsResult, type ListCharactersParams, type ListCharactersResult, type ListCreaturesParams, type ListExecutionsForWorkflowParams, type ListExecutionsPage, type ListInvitationsOptions, type ListLibraryParams, type ListLibraryResult, type ListLocationsParams, type ListModelsOptions, type ListObjectsParams, type ListWorkflowsParams, type Location, type LocationDetail, type LocationReferencePhoto, type LocationReferencePhotoKind, LocationsResource, MediaResource, type ModelCostsResult, type ModelSummary, type ModelsListResult, ModelsResource, NodaroClient, NodaroError, type NodeCategory, type NodeDescriptor, type NodeExecutionState, type NodeInputField, type NodeInputSchema, type NodeJobOutput, type NodePreset, type NodePresetGroup, NodesResource, NotFoundError, type OAuthAppInfo, OAuthResource, type Object$1 as Object, type ObjectCategory, type ObjectDetail, type ObjectReferencePhoto, type ObjectReferencePhotoKind, ObjectsResource, OrganizationsResource, type OutputType, type PickerCatalog, type PickerCatalogSummary, PickerCatalogsResource, type PickerDimension, type PickerOption, PipelinesResource, PresetsResource, type Project, type ProjectedCatalog, type ProjectedCatalogDimension, type ProjectedCatalogOption, ProjectsResource, PromptHelperResource, type PromptResult, type PublishedApp, type PublishedAppDetail, RateLimitedError, type RecaptionCreatureResult, type RecaptionLocationResult, type RecaptionObjectResult, type RecaptionResult, type RecastAudioLayerName, type RecastAudioManifestV1, type RecastAudioMix, type RecastAudioMixControl, type RecastAudioSectionReplacement, type RecastEstimate, type RecastRescoreOperation, type RecastRescoreQuote, type RecastRescoreReplacement, type RecastRescoreRequestV2, type RecastRescoreResponse, RecastResource, type RecastRunSnapshot, type RecastScriptImportResult, type RecastScriptValidation, type RecastScriptValidationError, type ReduceInput, ReduceResource, type ReduceResult, type ReferencePhoto, type ReferencePhotoKind, type ResolveRecastGateInput, type RotateSecretResult, type RunAndWaitOptions, type RunAppOptions, type RunManyResult, type RunNodeResult, type RunWorkflowParams, type RunWorkflowResult, type Shot, type ShotEntityRef, type ShotMode, ShotsResource, StaticTokenAuth, type StopVideoProResult, StorageExceededError, type StructuredReferenceParams, type Template, type TemplateBrowseCard, type TemplateSort, TemplatesResource, type TutorialCategory, type TutorialFlowItem, type TutorialVideoItem, TutorialsResource, UnauthorizedError, type UpdateCreatureInput, type UpdateCreatureResult, type UpdateDeveloperAppInput, type UpdateLocationInput, type UpdateLocationResult, type UpdateObjectInput, type UpdateObjectResult, type UpdateProjectInput, type UpdateShotInput, type UpdateWorkflowInput, type UploadResult, UploadsResource, type UpsertCharacterInput, type UpsertCharacterResult, type UpsertCreatureInput, type UpsertCreatureResult, type UpsertObjectInput, type UpsertObjectResult, type UserBalance, type UserIdentity, type VcpAnalysis, type VcpAnalysisSpeaker, type VcpAnalyzeInput, type VcpExportInput, type VcpExportTrack, type VideoMetadata, VideoProResource, type VoiceChangerProInput, type VoiceChangerProVoice, type VoiceDesignInput, type VoiceRemixInput, VoicesResource, type Workflow, WorkflowConflictError, type WorkflowExecution, type WorkflowExecutionSummary, WorkflowsResource, WorkspacesResource, buildPersonSeedPrompt, createClient, supabaseAuth, throwFromResponse };
|
|
6075
|
+
export { type AccessTokenResponse, type AnalyzeInput, type AnalyzeResult, type AppRun, type AppRunResult, type ApplyChatProposalResult, type ApproveCreatureMainImageResult, type ApproveMainImageResult, type ApproveObjectMainImageResult, type ApprovePortraitResult, AppsResource, AudioResource, type Auth, type BranchPipelineInput, type BranchPipelineResult, type BrowseTemplatesParams, type BrowseTemplatesResult, CREATURE_ASSET_TYPES, CallbackAuth, type CancelExecutionParams, type CancelJobResult, CatalogsResource, type Character, type CharacterDetail, type CharacterUsage, CharactersResource, type ChatStageResult, type ChatTurn, type ClientOptions, type CloneTemplateParams, type CloneTemplateResult, CommunityResource, type ContinueVideoProResult, type CreateCreatureInput, type CreateDeveloperAppInput, type CreateDeveloperAppResult, type CreateLocationInput, type CreateObjectInput, type CreateOrgInput, type CreateProjectInput, type CreateRecastInput, type CreateShotInput, type CreateWorkflowInput, type CreateWorkspaceInput, type Creature, type CreatureAssetType, type CreatureDetail, type CreatureReferencePhoto, type CreatureReferencePhotoKind, CreaturesResource, CreditsResource, type DeleteAppRunResult, type DeveloperApp, type DeveloperAppScope, type DeveloperAppStatus, DeveloperAppsResource, type DownloadVideoProgress, type DubbingInput, type DuplicateCharacterInput, type EnhanceInput, type EstimateRecastInput, type EstimateRecastRescoreInput, type ExchangeCodeInput, type ExecutionStatus, type ExecutionTriggerType, ExecutionsResource, type FactoryPresetsResult, ForbiddenError, type GenerateAssetInput, type GenerateCharacterInput, type GenerateCharacterResult, type GenerateCreatureAssetInput, type GenerateCreatureAssetResult, type GenerateCreatureInput, type GenerateCreatureMotionInput, type GenerateCreatureMotionResult, type GenerateCreatureResult, type GenerateImageParams, type GenerateInput, type GenerateLocationAssetInput, type GenerateLocationInput, type GenerateLocationResult, type GenerateMotionInput, type GenerateObjectAssetInput, type GenerateObjectAssetResult, type GenerateObjectInput, type GenerateObjectMotionInput, type GenerateObjectMotionResult, type GenerateObjectResult, type GenerateSurroundContinuationInput, type GenerateVideoParams, type GetPickerCatalogOptions, InsufficientCreditsError, type InviteInput, type Job, JobAbortedError, JobFailedError, type JobStatus, type JobStatusResult, JobTimeoutError, JobsResource, type LibraryAsset, LibraryResource, type ListAppRunsParams, type ListAppsParams, type ListAppsResult, type ListCharactersParams, type ListCharactersResult, type ListCreaturesParams, type ListExecutionsForWorkflowParams, type ListExecutionsPage, type ListInvitationsOptions, type ListJobsPage, type ListJobsParams, type ListLibraryParams, type ListLibraryResult, type ListLocationsParams, type ListModelsOptions, type ListObjectsParams, type ListWorkflowsParams, LlmResource, type LlmStructuredInput, type LlmStructuredJobInput, type LlmStructuredJobOutput, type LlmStructuredResult, type Location, type LocationDetail, type LocationReferencePhoto, type LocationReferencePhotoKind, LocationsResource, type MediaProcessInput, type MediaProcessResult, MediaResource, type ModelCostsResult, type ModelSummary, type ModelsListResult, ModelsResource, NodaroClient, NodaroError, type NodeCategory, type NodeDescriptor, type NodeExecutionState, type NodeInputField, type NodeInputSchema, type NodeJobOutput, type NodePreset, type NodePresetGroup, NodesResource, NotFoundError, type OAuthAppInfo, OAuthResource, type Object$1 as Object, type ObjectCategory, type ObjectDetail, type ObjectReferencePhoto, type ObjectReferencePhotoKind, ObjectsResource, OrganizationsResource, type OutputType, type PickerCatalog, type PickerCatalogSummary, PickerCatalogsResource, type PickerDimension, type PickerOption, PipelinesResource, PresetsResource, type Project, type ProjectedCatalog, type ProjectedCatalogDimension, type ProjectedCatalogOption, ProjectsResource, PromptHelperResource, type PromptResult, type PublishedApp, type PublishedAppDetail, RateLimitedError, type RecaptionCreatureResult, type RecaptionLocationResult, type RecaptionObjectResult, type RecaptionResult, type RecastAudioLayerName, type RecastAudioManifestV1, type RecastAudioMix, type RecastAudioMixControl, type RecastAudioSectionReplacement, type RecastEstimate, type RecastRescoreOperation, type RecastRescoreQuote, type RecastRescoreReplacement, type RecastRescoreRequestV2, type RecastRescoreResponse, RecastResource, type RecastRunSnapshot, type RecastScriptImportResult, type RecastScriptValidation, type RecastScriptValidationError, type ReduceInput, ReduceResource, type ReduceResult, type ReferencePhoto, type ReferencePhotoKind, type ResolveRecastGateInput, type RotateSecretResult, type RunAndWaitOptions, type RunAppOptions, type RunManyResult, type RunNodeAdjustment, type RunNodeResult, type RunWorkflowParams, type RunWorkflowResult, type Shot, type ShotEntityRef, type ShotMode, ShotsResource, StaticTokenAuth, type StopVideoProResult, StorageExceededError, type StructuredReferenceParams, type Template, type TemplateBrowseCard, type TemplateSort, TemplatesResource, type TutorialCategory, type TutorialFlowItem, type TutorialVideoItem, TutorialsResource, UnauthorizedError, type UpdateCreatureInput, type UpdateCreatureResult, type UpdateDeveloperAppInput, type UpdateLocationInput, type UpdateLocationResult, type UpdateObjectInput, type UpdateObjectResult, type UpdateProjectInput, type UpdateShotInput, type UpdateWorkflowInput, type UploadResult, UploadsResource, type UpsertCharacterInput, type UpsertCharacterResult, type UpsertCreatureInput, type UpsertCreatureResult, type UpsertObjectInput, type UpsertObjectResult, type UserBalance, type UserIdentity, type VcpAnalysis, type VcpAnalysisSpeaker, type VcpAnalyzeInput, type VcpExportInput, type VcpExportTrack, type VideoMetadata, VideoProResource, type VoiceChangerProInput, type VoiceChangerProVoice, type VoiceDesignInput, type VoiceRemixInput, VoicesResource, type Workflow, WorkflowConflictError, type WorkflowExecution, type WorkflowExecutionSummary, WorkflowsResource, WorkspacesResource, buildPersonSeedPrompt, createClient, supabaseAuth, throwFromResponse };
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { buildPersonHints } from '@nodaro/prompts';
|
|
2
2
|
export { PEOPLE, PERSON_DIMENSION_LABELS, PERSON_DIMENSION_ORDER, buildPersonHints } from '@nodaro/prompts';
|
|
3
3
|
import { WORKSPACE_HEADER } from '@nodaro/shared';
|
|
4
|
-
export { CHARACTER_ASPECT_DEFAULTS, CHARACTER_ASPECT_OPTIONS, CHARACTER_STYLES, OBJECT_ASPECT_DEFAULTS as CREATURE_ASPECT_DEFAULTS, OBJECT_ASPECT_OPTIONS as CREATURE_ASPECT_OPTIONS, CREATURE_ATTACH_COLUMNS, LOCATION_ASSET_TYPES, LOCATION_ATTACH_COLUMNS, OBJECT_ASPECT_DEFAULTS, OBJECT_ASPECT_OPTIONS, OBJECT_ASSET_TYPES, OBJECT_ATTACH_COLUMNS, PROMPT_PREFIX_KEY, PROMPT_SUFFIX_KEY, SURROUND_DIRECTIONS, WORKSPACE_HEADER } from '@nodaro/shared';
|
|
4
|
+
export { CHARACTER_ASPECT_DEFAULTS, CHARACTER_ASPECT_OPTIONS, CHARACTER_STYLES, OBJECT_ASPECT_DEFAULTS as CREATURE_ASPECT_DEFAULTS, OBJECT_ASPECT_OPTIONS as CREATURE_ASPECT_OPTIONS, CREATURE_ATTACH_COLUMNS, LOCATION_ASSET_TYPES, LOCATION_ATTACH_COLUMNS, OBJECT_ASPECT_DEFAULTS, OBJECT_ASPECT_OPTIONS, OBJECT_ASSET_TYPES, OBJECT_ATTACH_COLUMNS, PROMPT_PREFIX_KEY, PROMPT_SUFFIX_KEY, SURROUND_DIRECTIONS, USAGE_GROUP_BYS, WORKSPACE_HEADER } from '@nodaro/shared';
|
|
5
5
|
|
|
6
6
|
// src/errors.ts
|
|
7
7
|
var NodaroError = class extends Error {
|
|
@@ -331,6 +331,14 @@ var JobsResource = class {
|
|
|
331
331
|
get(id) {
|
|
332
332
|
return this.client.request("GET", `/v1/jobs/${encodeURIComponent(id)}`);
|
|
333
333
|
}
|
|
334
|
+
/**
|
|
335
|
+
* Your jobs, newest first (`GET /v1/jobs`), cursor-paginated. `type` and
|
|
336
|
+
* `origin` filter on the job's own `input_data`, which every job carries —
|
|
337
|
+
* a client app lists its runs with `{ type: "llm-structured", origin: "studio" }`.
|
|
338
|
+
*/
|
|
339
|
+
list(params = {}) {
|
|
340
|
+
return this.client.request("GET", "/v1/jobs", { query: { ...params } });
|
|
341
|
+
}
|
|
334
342
|
/**
|
|
335
343
|
* Get the lean status of a single job (poll-loop friendly).
|
|
336
344
|
* Hits `GET /v1/jobs/:id/status` — returns only id/status/progress/
|
|
@@ -1793,6 +1801,36 @@ var VoicesResource = class {
|
|
|
1793
1801
|
}
|
|
1794
1802
|
};
|
|
1795
1803
|
|
|
1804
|
+
// src/resources/llm.ts
|
|
1805
|
+
var LlmResource = class {
|
|
1806
|
+
constructor(client) {
|
|
1807
|
+
this.client = client;
|
|
1808
|
+
}
|
|
1809
|
+
client;
|
|
1810
|
+
/**
|
|
1811
|
+
* Synchronous forced-schema completion (`POST /v1/llm/structured`). A call
|
|
1812
|
+
* can run several minutes — longer than the client's default 60 s
|
|
1813
|
+
* `timeoutMs`; construct the client with a larger `timeoutMs` for this
|
|
1814
|
+
* call, or use {@link LlmResource.structuredJob}.
|
|
1815
|
+
*/
|
|
1816
|
+
structured(input) {
|
|
1817
|
+
return this.client.request("POST", "/v1/llm/structured", { body: input });
|
|
1818
|
+
}
|
|
1819
|
+
/**
|
|
1820
|
+
* The same call as a job (`POST /v1/llm/structured/jobs`): answers `{ jobId }`
|
|
1821
|
+
* at once. Poll `jobs.getStatus(jobId)` — `output_data` is an
|
|
1822
|
+
* {@link LlmStructuredJobOutput}; `error_message` says why a run failed.
|
|
1823
|
+
* `jobs.list({ type: "llm-structured", origin })` finds every run later.
|
|
1824
|
+
* Throws `NotFoundError` on a platform that predates the route. An instance
|
|
1825
|
+
* that proxies its LLM calls to nodaro.ai answers `503 provider_unavailable`
|
|
1826
|
+
* permanently — the SDK surfaces that as a generic `NodaroError` with the
|
|
1827
|
+
* same code; treat it as unavailable here, not as transient.
|
|
1828
|
+
*/
|
|
1829
|
+
structuredJob(input) {
|
|
1830
|
+
return this.client.request("POST", "/v1/llm/structured/jobs", { body: input });
|
|
1831
|
+
}
|
|
1832
|
+
};
|
|
1833
|
+
|
|
1796
1834
|
// src/resources/media.ts
|
|
1797
1835
|
var MediaResource = class {
|
|
1798
1836
|
constructor(client) {
|
|
@@ -1942,6 +1980,16 @@ var MediaResource = class {
|
|
|
1942
1980
|
videoMetadata(input) {
|
|
1943
1981
|
return this.client.request("POST", "/v1/video-metadata", { body: input });
|
|
1944
1982
|
}
|
|
1983
|
+
/**
|
|
1984
|
+
* Cut or crop a stored file (`POST /v1/media/process`) — synchronous and
|
|
1985
|
+
* free, the source-preparation sibling of the priced `trimVideo` node.
|
|
1986
|
+
* `trim` is `[startTime, endTime]` in seconds; `deleteSource: true` removes
|
|
1987
|
+
* the source object afterwards when it is yours and nothing else references
|
|
1988
|
+
* it ("the cut replaces the original"). Answers the stored file.
|
|
1989
|
+
*/
|
|
1990
|
+
process(input) {
|
|
1991
|
+
return this.client.request("POST", "/v1/media/process", { body: input });
|
|
1992
|
+
}
|
|
1945
1993
|
};
|
|
1946
1994
|
|
|
1947
1995
|
// src/resources/audio.ts
|
|
@@ -2543,6 +2591,23 @@ var OrganizationsResource = class {
|
|
|
2543
2591
|
audit(orgId, opts = {}) {
|
|
2544
2592
|
return this.client.request("GET", `/v1/orgs/${encodeURIComponent(orgId)}/audit`, { query: { ...opts } });
|
|
2545
2593
|
}
|
|
2594
|
+
// -- usage ----------------------------------------------------------------
|
|
2595
|
+
/**
|
|
2596
|
+
* Credits by workspace, member, model or day. Owner and org admins only.
|
|
2597
|
+
* Inclusive dates (`from`/`to`), IANA `tz` (default UTC), ≤ 366 days
|
|
2598
|
+
* (default last 30).
|
|
2599
|
+
*/
|
|
2600
|
+
usage(orgId, opts = {}) {
|
|
2601
|
+
return this.client.request("GET", `/v1/orgs/${encodeURIComponent(orgId)}/usage`, { query: { ...opts } });
|
|
2602
|
+
}
|
|
2603
|
+
/** The individual runs behind a report, newest first, cursor-paged. */
|
|
2604
|
+
usageRows(orgId, opts = {}) {
|
|
2605
|
+
return this.client.request("GET", `/v1/orgs/${encodeURIComponent(orgId)}/usage`, { query: { ...opts, groupBy: "none" } });
|
|
2606
|
+
}
|
|
2607
|
+
/** The same report (or the rows, with `groupBy: "none"`) as CSV text. */
|
|
2608
|
+
usageCsv(orgId, opts = {}) {
|
|
2609
|
+
return this.client.requestText("GET", `/v1/orgs/${encodeURIComponent(orgId)}/usage`, { query: { ...opts, format: "csv" } });
|
|
2610
|
+
}
|
|
2546
2611
|
};
|
|
2547
2612
|
|
|
2548
2613
|
// src/resources/workspaces.ts
|
|
@@ -2634,8 +2699,26 @@ var WorkspacesResource = class {
|
|
|
2634
2699
|
join(code) {
|
|
2635
2700
|
return this.client.request("POST", "/v1/workspaces/join", { body: { code } });
|
|
2636
2701
|
}
|
|
2702
|
+
// -- usage ----------------------------------------------------------------
|
|
2703
|
+
/**
|
|
2704
|
+
* Credits by member, model or day for this workspace. A plain member sees
|
|
2705
|
+
* their OWN runs (the report is self-narrowed and `groupBy: "member"` is
|
|
2706
|
+
* refused); a workspace admin sees everyone and may filter `userId`.
|
|
2707
|
+
* Inclusive dates, IANA `tz` (default UTC), ≤ 366 days (default last 30).
|
|
2708
|
+
*/
|
|
2709
|
+
usage(id, opts = {}) {
|
|
2710
|
+
return this.client.request("GET", `/v1/workspaces/${encodeURIComponent(id)}/usage`, { query: { ...opts } });
|
|
2711
|
+
}
|
|
2712
|
+
/** The individual runs behind a report, newest first, cursor-paged. */
|
|
2713
|
+
usageRows(id, opts = {}) {
|
|
2714
|
+
return this.client.request("GET", `/v1/workspaces/${encodeURIComponent(id)}/usage`, { query: { ...opts, groupBy: "none" } });
|
|
2715
|
+
}
|
|
2716
|
+
/** The same report (or the rows, with `groupBy: "none"`) as CSV text. */
|
|
2717
|
+
usageCsv(id, opts = {}) {
|
|
2718
|
+
return this.client.requestText("GET", `/v1/workspaces/${encodeURIComponent(id)}/usage`, { query: { ...opts, format: "csv" } });
|
|
2719
|
+
}
|
|
2637
2720
|
};
|
|
2638
|
-
var SDK_VERSION = "1.
|
|
2721
|
+
var SDK_VERSION = "1.27.0" ;
|
|
2639
2722
|
var CLIENT_HEADER = "X-Nodaro-Client";
|
|
2640
2723
|
var isBrowser = () => typeof window !== "undefined" && typeof window.document !== "undefined";
|
|
2641
2724
|
var NodaroClient = class _NodaroClient {
|
|
@@ -2673,6 +2756,7 @@ var NodaroClient = class _NodaroClient {
|
|
|
2673
2756
|
reduce;
|
|
2674
2757
|
promptHelper;
|
|
2675
2758
|
voices;
|
|
2759
|
+
llm;
|
|
2676
2760
|
media;
|
|
2677
2761
|
audio;
|
|
2678
2762
|
credits;
|
|
@@ -2716,6 +2800,7 @@ var NodaroClient = class _NodaroClient {
|
|
|
2716
2800
|
this.reduce = new ReduceResource(this);
|
|
2717
2801
|
this.promptHelper = new PromptHelperResource(this);
|
|
2718
2802
|
this.voices = new VoicesResource(this);
|
|
2803
|
+
this.llm = new LlmResource(this);
|
|
2719
2804
|
this.media = new MediaResource(this);
|
|
2720
2805
|
this.audio = new AudioResource(this);
|
|
2721
2806
|
this.credits = new CreditsResource(this);
|
|
@@ -2754,7 +2839,14 @@ var NodaroClient = class _NodaroClient {
|
|
|
2754
2839
|
...workspaceId ? { workspaceId } : {}
|
|
2755
2840
|
});
|
|
2756
2841
|
}
|
|
2757
|
-
|
|
2842
|
+
/**
|
|
2843
|
+
* The transport: build the request, send it, throw the typed error on a
|
|
2844
|
+
* non-2xx via {@link throwFromResponse}, then read the body via `read` — all
|
|
2845
|
+
* inside the abort timer, so `timeoutMs` bounds the body download too (a
|
|
2846
|
+
* stalled CSV stream aborts, it does not hang forever). Both the JSON path
|
|
2847
|
+
* ({@link request}) and the text path ({@link requestText}) go through here.
|
|
2848
|
+
*/
|
|
2849
|
+
async send(method, path, options, read) {
|
|
2758
2850
|
const url = this.buildUrl(path, options.query);
|
|
2759
2851
|
const token = await this.auth.getToken();
|
|
2760
2852
|
const isFormData = typeof FormData !== "undefined" && options.body instanceof FormData;
|
|
@@ -2787,12 +2879,30 @@ var NodaroClient = class _NodaroClient {
|
|
|
2787
2879
|
}
|
|
2788
2880
|
throwFromResponse(res.status, errBody);
|
|
2789
2881
|
}
|
|
2790
|
-
|
|
2791
|
-
return await res.json();
|
|
2882
|
+
return await read(res);
|
|
2792
2883
|
} finally {
|
|
2793
2884
|
clearTimeout(timeoutId);
|
|
2794
2885
|
}
|
|
2795
2886
|
}
|
|
2887
|
+
async request(method, path, options = {}) {
|
|
2888
|
+
return this.send(
|
|
2889
|
+
method,
|
|
2890
|
+
path,
|
|
2891
|
+
options,
|
|
2892
|
+
async (res) => (
|
|
2893
|
+
// 204 No Content
|
|
2894
|
+
res.status === 204 ? void 0 : await res.json()
|
|
2895
|
+
)
|
|
2896
|
+
);
|
|
2897
|
+
}
|
|
2898
|
+
/**
|
|
2899
|
+
* Like {@link request}, for endpoints that answer text (CSV exports). Errors
|
|
2900
|
+
* are still the JSON envelope and throw the same typed errors, and the read is
|
|
2901
|
+
* bounded by the same timeout as the request.
|
|
2902
|
+
*/
|
|
2903
|
+
async requestText(method, path, options = {}) {
|
|
2904
|
+
return this.send(method, path, options, (res) => res.text());
|
|
2905
|
+
}
|
|
2796
2906
|
/**
|
|
2797
2907
|
* `GET /v1/me` → the authenticated user's identity (see {@link UserIdentity}).
|
|
2798
2908
|
* Unwraps the `{ data }` envelope. Throws `UnauthorizedError` (401) when the
|
|
@@ -2856,6 +2966,6 @@ function supabaseAuth(supabase) {
|
|
|
2856
2966
|
};
|
|
2857
2967
|
}
|
|
2858
2968
|
|
|
2859
|
-
export { AppsResource, AudioResource, CREATURE_ASSET_TYPES, CallbackAuth, CatalogsResource, CharactersResource, CommunityResource, CreaturesResource, CreditsResource, DeveloperAppsResource, ExecutionsResource, ForbiddenError, InsufficientCreditsError, JobAbortedError, JobFailedError, JobTimeoutError, JobsResource, LibraryResource, LocationsResource, MediaResource, ModelsResource, NodaroClient, NodaroError, NodesResource, NotFoundError, OAuthResource, ObjectsResource, OrganizationsResource, PickerCatalogsResource, PipelinesResource, PresetsResource, ProjectsResource, PromptHelperResource, RateLimitedError, RecastResource, ReduceResource, ShotsResource, StaticTokenAuth, StorageExceededError, TemplatesResource, TutorialsResource, UnauthorizedError, UploadsResource, VideoProResource, VoicesResource, WorkflowConflictError, WorkflowsResource, WorkspacesResource, buildPersonSeedPrompt, createClient, supabaseAuth, throwFromResponse };
|
|
2969
|
+
export { AppsResource, AudioResource, CREATURE_ASSET_TYPES, CallbackAuth, CatalogsResource, CharactersResource, CommunityResource, CreaturesResource, CreditsResource, DeveloperAppsResource, ExecutionsResource, ForbiddenError, InsufficientCreditsError, JobAbortedError, JobFailedError, JobTimeoutError, JobsResource, LibraryResource, LlmResource, LocationsResource, MediaResource, ModelsResource, NodaroClient, NodaroError, NodesResource, NotFoundError, OAuthResource, ObjectsResource, OrganizationsResource, PickerCatalogsResource, PipelinesResource, PresetsResource, ProjectsResource, PromptHelperResource, RateLimitedError, RecastResource, ReduceResource, ShotsResource, StaticTokenAuth, StorageExceededError, TemplatesResource, TutorialsResource, UnauthorizedError, UploadsResource, VideoProResource, VoicesResource, WorkflowConflictError, WorkflowsResource, WorkspacesResource, buildPersonSeedPrompt, createClient, supabaseAuth, throwFromResponse };
|
|
2860
2970
|
//# sourceMappingURL=index.js.map
|
|
2861
2971
|
//# sourceMappingURL=index.js.map
|