@nodaro/sdk 1.9.0 → 1.11.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.d.cts CHANGED
@@ -86,6 +86,20 @@ interface UpdateWorkflowInput {
86
86
  settings?: Record<string, unknown>;
87
87
  sourcePrompt?: string;
88
88
  thumbnailUrl?: string | null;
89
+ /**
90
+ * Optimistic concurrency: the `updatedAt` your copy of the workflow was
91
+ * loaded with. When the row has since been written by another tab/device,
92
+ * the update is rejected with HTTP 409 `workflow_conflict`
93
+ * (`WorkflowConflictError`) carrying the current record — re-read/merge and
94
+ * retry instead of last-writer-wins clobbering the other writer's changes.
95
+ * Omit for the legacy unconditional replace.
96
+ */
97
+ expectedUpdatedAt?: string;
98
+ /**
99
+ * Optimistic concurrency by monotonic version — preferred over
100
+ * `expectedUpdatedAt` (integer bumped by the DB on every content change).
101
+ */
102
+ expectedVersion?: number;
89
103
  }
90
104
  interface RunWorkflowParams {
91
105
  /** Optional subset of node IDs to execute. Omit to run the full workflow. */
@@ -3344,6 +3358,18 @@ interface CommonInput {
3344
3358
  llmModel?: string;
3345
3359
  /** Reasoning effort level (model-dependent). */
3346
3360
  reasoningEffort?: string;
3361
+ /**
3362
+ * Gemini models only. Runs the request on the provider's own API so
3363
+ * `temperature`, `maxTokens` and the full reasoning range actually take
3364
+ * effect — on the default lane those levers are not reliably honoured.
3365
+ * Bills one credit tier up. A model without a direct lane returns
3366
+ * `400 advanced_mode_unsupported`.
3367
+ */
3368
+ advancedMode?: boolean;
3369
+ /** Sampling temperature. Only honoured when `advancedMode` is true. */
3370
+ temperature?: number;
3371
+ /** Output token cap. Only honoured when `advancedMode` is true. */
3372
+ maxTokens?: number;
3347
3373
  nodeContext?: WizardNodeContext;
3348
3374
  userPreference?: string;
3349
3375
  /** Associates this call with a workflow execution. Read server-side before Zod. */
@@ -4513,6 +4539,19 @@ declare class StorageExceededError extends NodaroError {
4513
4539
  readonly limitBytes?: number | undefined;
4514
4540
  constructor(message?: string, limitBytes?: number | undefined);
4515
4541
  }
4542
+ /**
4543
+ * Optimistic-concurrency rejection (HTTP 409 `workflow_conflict`): the workflow
4544
+ * was written by another tab/device after the state carried in
4545
+ * `expectedUpdatedAt`/`expectedVersion` was read. `currentRecord` — when the
4546
+ * server includes it — is the full current workflow: merge your changes onto it
4547
+ * and retry with its fresh `updatedAt`, no follow-up GET needed.
4548
+ */
4549
+ declare class WorkflowConflictError extends NodaroError {
4550
+ readonly currentUpdatedAt?: string | undefined;
4551
+ readonly currentVersion?: number | undefined;
4552
+ readonly currentRecord?: Record<string, unknown> | undefined;
4553
+ constructor(message?: string, currentUpdatedAt?: string | undefined, currentVersion?: number | undefined, currentRecord?: Record<string, unknown> | undefined);
4554
+ }
4516
4555
  /**
4517
4556
  * A job reached a terminal `failed`/`cancelled` status while being awaited by
4518
4557
  * `nodes.runAndWait` / `nodes.runMany`. Not an HTTP-level error (the polls
@@ -4561,4 +4600,4 @@ interface ApiErrorBody {
4561
4600
  }
4562
4601
  declare function throwFromResponse(status: number, body: ApiErrorBody): never;
4563
4602
 
4564
- 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, CREATURE_ASSET_TYPES, CallbackAuth, type CancelExecutionParams, type CancelJobResult, type Character, type CharacterDetail, type CharacterUsage, CharactersResource, type ChatStageResult, type ChatTurn, type ClientOptions, CommunityResource, type ContinueVideoProResult, type CreateCreatureInput, type CreateDeveloperAppInput, type CreateDeveloperAppResult, type CreateLocationInput, type CreateObjectInput, type CreateProjectInput, type CreateWorkflowInput, 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 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 Job, JobAbortedError, JobFailedError, type JobStatus, type JobStatusResult, JobTimeoutError, JobsResource, type LibraryAsset, LibraryResource, type ListAppRunsParams, type ListAppsParams, type ListAppsResult, type ListCharactersParams, type ListCreaturesParams, type ListExecutionsForWorkflowParams, type ListExecutionsPage, type ListLibraryParams, type ListLibraryResult, type ListLocationsParams, type ListObjectsParams, type ListWorkflowsParams, type Location, type LocationDetail, type LocationReferencePhoto, type LocationReferencePhotoKind, LocationsResource, MediaResource, type ModelCostsResult, 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, type OutputType, type PickerCatalog, type PickerCatalogSummary, PickerCatalogsResource, type PickerDimension, type PickerOption, PipelinesResource, PresetsResource, type Project, ProjectsResource, PromptHelperResource, type PromptResult, type PublishedApp, type PublishedAppDetail, RateLimitedError, type RecaptionCreatureResult, type RecaptionLocationResult, type RecaptionObjectResult, type RecaptionResult, type ReduceInput, ReduceResource, type ReduceResult, type ReferencePhoto, type ReferencePhotoKind, type RotateSecretResult, type RunAndWaitOptions, type RunManyResult, type RunNodeResult, type RunWorkflowParams, type RunWorkflowResult, StaticTokenAuth, type StopVideoProResult, StorageExceededError, type StructuredReferenceParams, UnauthorizedError, type UpdateCreatureInput, type UpdateCreatureResult, type UpdateDeveloperAppInput, type UpdateLocationInput, type UpdateLocationResult, type UpdateObjectInput, type UpdateObjectResult, type UpdateProjectInput, 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, type WorkflowExecution, type WorkflowExecutionSummary, WorkflowsResource, buildPersonSeedPrompt, createClient, supabaseAuth, throwFromResponse };
4603
+ 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, CREATURE_ASSET_TYPES, CallbackAuth, type CancelExecutionParams, type CancelJobResult, type Character, type CharacterDetail, type CharacterUsage, CharactersResource, type ChatStageResult, type ChatTurn, type ClientOptions, CommunityResource, type ContinueVideoProResult, type CreateCreatureInput, type CreateDeveloperAppInput, type CreateDeveloperAppResult, type CreateLocationInput, type CreateObjectInput, type CreateProjectInput, type CreateWorkflowInput, 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 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 Job, JobAbortedError, JobFailedError, type JobStatus, type JobStatusResult, JobTimeoutError, JobsResource, type LibraryAsset, LibraryResource, type ListAppRunsParams, type ListAppsParams, type ListAppsResult, type ListCharactersParams, type ListCreaturesParams, type ListExecutionsForWorkflowParams, type ListExecutionsPage, type ListLibraryParams, type ListLibraryResult, type ListLocationsParams, type ListObjectsParams, type ListWorkflowsParams, type Location, type LocationDetail, type LocationReferencePhoto, type LocationReferencePhotoKind, LocationsResource, MediaResource, type ModelCostsResult, 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, type OutputType, type PickerCatalog, type PickerCatalogSummary, PickerCatalogsResource, type PickerDimension, type PickerOption, PipelinesResource, PresetsResource, type Project, ProjectsResource, PromptHelperResource, type PromptResult, type PublishedApp, type PublishedAppDetail, RateLimitedError, type RecaptionCreatureResult, type RecaptionLocationResult, type RecaptionObjectResult, type RecaptionResult, type ReduceInput, ReduceResource, type ReduceResult, type ReferencePhoto, type ReferencePhotoKind, type RotateSecretResult, type RunAndWaitOptions, type RunManyResult, type RunNodeResult, type RunWorkflowParams, type RunWorkflowResult, StaticTokenAuth, type StopVideoProResult, StorageExceededError, type StructuredReferenceParams, UnauthorizedError, type UpdateCreatureInput, type UpdateCreatureResult, type UpdateDeveloperAppInput, type UpdateLocationInput, type UpdateLocationResult, type UpdateObjectInput, type UpdateObjectResult, type UpdateProjectInput, 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, buildPersonSeedPrompt, createClient, supabaseAuth, throwFromResponse };
package/dist/index.d.ts CHANGED
@@ -86,6 +86,20 @@ interface UpdateWorkflowInput {
86
86
  settings?: Record<string, unknown>;
87
87
  sourcePrompt?: string;
88
88
  thumbnailUrl?: string | null;
89
+ /**
90
+ * Optimistic concurrency: the `updatedAt` your copy of the workflow was
91
+ * loaded with. When the row has since been written by another tab/device,
92
+ * the update is rejected with HTTP 409 `workflow_conflict`
93
+ * (`WorkflowConflictError`) carrying the current record — re-read/merge and
94
+ * retry instead of last-writer-wins clobbering the other writer's changes.
95
+ * Omit for the legacy unconditional replace.
96
+ */
97
+ expectedUpdatedAt?: string;
98
+ /**
99
+ * Optimistic concurrency by monotonic version — preferred over
100
+ * `expectedUpdatedAt` (integer bumped by the DB on every content change).
101
+ */
102
+ expectedVersion?: number;
89
103
  }
90
104
  interface RunWorkflowParams {
91
105
  /** Optional subset of node IDs to execute. Omit to run the full workflow. */
@@ -3344,6 +3358,18 @@ interface CommonInput {
3344
3358
  llmModel?: string;
3345
3359
  /** Reasoning effort level (model-dependent). */
3346
3360
  reasoningEffort?: string;
3361
+ /**
3362
+ * Gemini models only. Runs the request on the provider's own API so
3363
+ * `temperature`, `maxTokens` and the full reasoning range actually take
3364
+ * effect — on the default lane those levers are not reliably honoured.
3365
+ * Bills one credit tier up. A model without a direct lane returns
3366
+ * `400 advanced_mode_unsupported`.
3367
+ */
3368
+ advancedMode?: boolean;
3369
+ /** Sampling temperature. Only honoured when `advancedMode` is true. */
3370
+ temperature?: number;
3371
+ /** Output token cap. Only honoured when `advancedMode` is true. */
3372
+ maxTokens?: number;
3347
3373
  nodeContext?: WizardNodeContext;
3348
3374
  userPreference?: string;
3349
3375
  /** Associates this call with a workflow execution. Read server-side before Zod. */
@@ -4513,6 +4539,19 @@ declare class StorageExceededError extends NodaroError {
4513
4539
  readonly limitBytes?: number | undefined;
4514
4540
  constructor(message?: string, limitBytes?: number | undefined);
4515
4541
  }
4542
+ /**
4543
+ * Optimistic-concurrency rejection (HTTP 409 `workflow_conflict`): the workflow
4544
+ * was written by another tab/device after the state carried in
4545
+ * `expectedUpdatedAt`/`expectedVersion` was read. `currentRecord` — when the
4546
+ * server includes it — is the full current workflow: merge your changes onto it
4547
+ * and retry with its fresh `updatedAt`, no follow-up GET needed.
4548
+ */
4549
+ declare class WorkflowConflictError extends NodaroError {
4550
+ readonly currentUpdatedAt?: string | undefined;
4551
+ readonly currentVersion?: number | undefined;
4552
+ readonly currentRecord?: Record<string, unknown> | undefined;
4553
+ constructor(message?: string, currentUpdatedAt?: string | undefined, currentVersion?: number | undefined, currentRecord?: Record<string, unknown> | undefined);
4554
+ }
4516
4555
  /**
4517
4556
  * A job reached a terminal `failed`/`cancelled` status while being awaited by
4518
4557
  * `nodes.runAndWait` / `nodes.runMany`. Not an HTTP-level error (the polls
@@ -4561,4 +4600,4 @@ interface ApiErrorBody {
4561
4600
  }
4562
4601
  declare function throwFromResponse(status: number, body: ApiErrorBody): never;
4563
4602
 
4564
- 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, CREATURE_ASSET_TYPES, CallbackAuth, type CancelExecutionParams, type CancelJobResult, type Character, type CharacterDetail, type CharacterUsage, CharactersResource, type ChatStageResult, type ChatTurn, type ClientOptions, CommunityResource, type ContinueVideoProResult, type CreateCreatureInput, type CreateDeveloperAppInput, type CreateDeveloperAppResult, type CreateLocationInput, type CreateObjectInput, type CreateProjectInput, type CreateWorkflowInput, 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 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 Job, JobAbortedError, JobFailedError, type JobStatus, type JobStatusResult, JobTimeoutError, JobsResource, type LibraryAsset, LibraryResource, type ListAppRunsParams, type ListAppsParams, type ListAppsResult, type ListCharactersParams, type ListCreaturesParams, type ListExecutionsForWorkflowParams, type ListExecutionsPage, type ListLibraryParams, type ListLibraryResult, type ListLocationsParams, type ListObjectsParams, type ListWorkflowsParams, type Location, type LocationDetail, type LocationReferencePhoto, type LocationReferencePhotoKind, LocationsResource, MediaResource, type ModelCostsResult, 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, type OutputType, type PickerCatalog, type PickerCatalogSummary, PickerCatalogsResource, type PickerDimension, type PickerOption, PipelinesResource, PresetsResource, type Project, ProjectsResource, PromptHelperResource, type PromptResult, type PublishedApp, type PublishedAppDetail, RateLimitedError, type RecaptionCreatureResult, type RecaptionLocationResult, type RecaptionObjectResult, type RecaptionResult, type ReduceInput, ReduceResource, type ReduceResult, type ReferencePhoto, type ReferencePhotoKind, type RotateSecretResult, type RunAndWaitOptions, type RunManyResult, type RunNodeResult, type RunWorkflowParams, type RunWorkflowResult, StaticTokenAuth, type StopVideoProResult, StorageExceededError, type StructuredReferenceParams, UnauthorizedError, type UpdateCreatureInput, type UpdateCreatureResult, type UpdateDeveloperAppInput, type UpdateLocationInput, type UpdateLocationResult, type UpdateObjectInput, type UpdateObjectResult, type UpdateProjectInput, 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, type WorkflowExecution, type WorkflowExecutionSummary, WorkflowsResource, buildPersonSeedPrompt, createClient, supabaseAuth, throwFromResponse };
4603
+ 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, CREATURE_ASSET_TYPES, CallbackAuth, type CancelExecutionParams, type CancelJobResult, type Character, type CharacterDetail, type CharacterUsage, CharactersResource, type ChatStageResult, type ChatTurn, type ClientOptions, CommunityResource, type ContinueVideoProResult, type CreateCreatureInput, type CreateDeveloperAppInput, type CreateDeveloperAppResult, type CreateLocationInput, type CreateObjectInput, type CreateProjectInput, type CreateWorkflowInput, 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 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 Job, JobAbortedError, JobFailedError, type JobStatus, type JobStatusResult, JobTimeoutError, JobsResource, type LibraryAsset, LibraryResource, type ListAppRunsParams, type ListAppsParams, type ListAppsResult, type ListCharactersParams, type ListCreaturesParams, type ListExecutionsForWorkflowParams, type ListExecutionsPage, type ListLibraryParams, type ListLibraryResult, type ListLocationsParams, type ListObjectsParams, type ListWorkflowsParams, type Location, type LocationDetail, type LocationReferencePhoto, type LocationReferencePhotoKind, LocationsResource, MediaResource, type ModelCostsResult, 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, type OutputType, type PickerCatalog, type PickerCatalogSummary, PickerCatalogsResource, type PickerDimension, type PickerOption, PipelinesResource, PresetsResource, type Project, ProjectsResource, PromptHelperResource, type PromptResult, type PublishedApp, type PublishedAppDetail, RateLimitedError, type RecaptionCreatureResult, type RecaptionLocationResult, type RecaptionObjectResult, type RecaptionResult, type ReduceInput, ReduceResource, type ReduceResult, type ReferencePhoto, type ReferencePhotoKind, type RotateSecretResult, type RunAndWaitOptions, type RunManyResult, type RunNodeResult, type RunWorkflowParams, type RunWorkflowResult, StaticTokenAuth, type StopVideoProResult, StorageExceededError, type StructuredReferenceParams, UnauthorizedError, type UpdateCreatureInput, type UpdateCreatureResult, type UpdateDeveloperAppInput, type UpdateLocationInput, type UpdateLocationResult, type UpdateObjectInput, type UpdateObjectResult, type UpdateProjectInput, 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, buildPersonSeedPrompt, createClient, supabaseAuth, throwFromResponse };
package/dist/index.js CHANGED
@@ -57,6 +57,18 @@ var StorageExceededError = class extends NodaroError {
57
57
  }
58
58
  limitBytes;
59
59
  };
60
+ var WorkflowConflictError = class extends NodaroError {
61
+ constructor(message = "Workflow was updated by another writer", currentUpdatedAt, currentVersion, currentRecord) {
62
+ super(message, "workflow_conflict", 409);
63
+ this.currentUpdatedAt = currentUpdatedAt;
64
+ this.currentVersion = currentVersion;
65
+ this.currentRecord = currentRecord;
66
+ this.name = "WorkflowConflictError";
67
+ }
68
+ currentUpdatedAt;
69
+ currentVersion;
70
+ currentRecord;
71
+ };
60
72
  var JobFailedError = class extends NodaroError {
61
73
  constructor(message, jobId, jobStatus = "failed") {
62
74
  super(message, "job_failed", 0);
@@ -89,6 +101,14 @@ function throwFromResponse(status, body) {
89
101
  const code = body.error?.code ?? "internal_error";
90
102
  const message = body.error?.message ?? "Request failed";
91
103
  if (status === 401) throw new UnauthorizedError(message);
104
+ if (status === 409 && code === "workflow_conflict") {
105
+ throw new WorkflowConflictError(
106
+ message,
107
+ body.error?.currentUpdatedAt,
108
+ body.error?.currentVersion,
109
+ body.error?.currentRecord
110
+ );
111
+ }
92
112
  if (status === 403 && code === "insufficient_scope") {
93
113
  throw new ForbiddenError(message, body.error?.missingScope);
94
114
  }
@@ -2257,6 +2277,6 @@ function supabaseAuth(supabase) {
2257
2277
  };
2258
2278
  }
2259
2279
 
2260
- export { AppsResource, AudioResource, CREATURE_ASSET_TYPES, CallbackAuth, CharactersResource, CommunityResource, CreaturesResource, CreditsResource, DeveloperAppsResource, ExecutionsResource, ForbiddenError, InsufficientCreditsError, JobAbortedError, JobFailedError, JobTimeoutError, JobsResource, LibraryResource, LocationsResource, MediaResource, NodaroClient, NodaroError, NodesResource, NotFoundError, OAuthResource, ObjectsResource, PickerCatalogsResource, PipelinesResource, PresetsResource, ProjectsResource, PromptHelperResource, RateLimitedError, ReduceResource, StaticTokenAuth, StorageExceededError, UnauthorizedError, UploadsResource, VideoProResource, VoicesResource, WorkflowsResource, buildPersonSeedPrompt, createClient, supabaseAuth, throwFromResponse };
2280
+ export { AppsResource, AudioResource, CREATURE_ASSET_TYPES, CallbackAuth, CharactersResource, CommunityResource, CreaturesResource, CreditsResource, DeveloperAppsResource, ExecutionsResource, ForbiddenError, InsufficientCreditsError, JobAbortedError, JobFailedError, JobTimeoutError, JobsResource, LibraryResource, LocationsResource, MediaResource, NodaroClient, NodaroError, NodesResource, NotFoundError, OAuthResource, ObjectsResource, PickerCatalogsResource, PipelinesResource, PresetsResource, ProjectsResource, PromptHelperResource, RateLimitedError, ReduceResource, StaticTokenAuth, StorageExceededError, UnauthorizedError, UploadsResource, VideoProResource, VoicesResource, WorkflowConflictError, WorkflowsResource, buildPersonSeedPrompt, createClient, supabaseAuth, throwFromResponse };
2261
2281
  //# sourceMappingURL=index.js.map
2262
2282
  //# sourceMappingURL=index.js.map