diff --git a/apps/billing-web/e2e/fixtures/cloud.ts b/apps/billing-web/e2e/fixtures/cloud.ts index 89b2a86981a..b7c844b91df 100644 --- a/apps/billing-web/e2e/fixtures/cloud.ts +++ b/apps/billing-web/e2e/fixtures/cloud.ts @@ -183,6 +183,7 @@ const POST_REPLIES = new Map([ body: { token: 'e2e-workspace-jwt', expires_at: inAnHour(), + user_id: 'uid-1', permissions: ['workspace:read', 'billing:write'], role: 'owner', workspace: { diff --git a/apps/billing-web/e2e/fixtures/scenario.ts b/apps/billing-web/e2e/fixtures/scenario.ts index 3e59f497969..107d197507b 100644 --- a/apps/billing-web/e2e/fixtures/scenario.ts +++ b/apps/billing-web/e2e/fixtures/scenario.ts @@ -44,6 +44,7 @@ export function capabilitiesWith( can_manage_auto_top_up: false, can_manage_members: false, can_manage_subscription: true, + can_open_plans: true, can_delete_workspace: false, can_leave_workspace: false, can_manage_billing: false, diff --git a/apps/billing-web/e2e/full-page-reconciliation.spec.ts b/apps/billing-web/e2e/full-page-reconciliation.spec.ts index 80ef3c28967..914a7ad1b33 100644 --- a/apps/billing-web/e2e/full-page-reconciliation.spec.ts +++ b/apps/billing-web/e2e/full-page-reconciliation.spec.ts @@ -202,6 +202,7 @@ for (const { name, pending, lands } of [ body: { token: 'e2e-workspace-jwt-2', expires_at: new Date(Date.now() + 3_600_000).toISOString(), + user_id: 'uid-1', permissions: ['workspace:read', 'billing:write'], role: 'owner', workspace: { diff --git a/apps/billing-web/e2e/workspace-binding.spec.ts b/apps/billing-web/e2e/workspace-binding.spec.ts index d61e34c152c..54502d6dc13 100644 --- a/apps/billing-web/e2e/workspace-binding.spec.ts +++ b/apps/billing-web/e2e/workspace-binding.spec.ts @@ -10,6 +10,7 @@ test('an entry link naming a workspace mints for it, names it in the shell, and body: { token: 'e2e-team-jwt', expires_at: new Date(Date.now() + 3_600_000).toISOString(), + user_id: 'uid-1', permissions: ['workspace:read', 'billing:write'], role: 'owner', workspace: { id: 'ws_team_e2e', name: 'Acme Team', type: 'team' } @@ -93,6 +94,7 @@ test('reloading a tab whose workspace was deleted surfaces that reason instead o body: { token: 'e2e-team-jwt', expires_at: new Date(Date.now() + 3_600_000).toISOString(), + user_id: 'uid-1', permissions: ['workspace:read', 'billing:write'], role: 'owner', workspace: { id: 'ws_team_e2e', name: 'Acme Team', type: 'team' } diff --git a/apps/billing-web/src/session/billingWebAuth.flagOff.test.ts b/apps/billing-web/src/session/billingWebAuth.flagOff.test.ts index 84c00cf5210..e62004bb137 100644 --- a/apps/billing-web/src/session/billingWebAuth.flagOff.test.ts +++ b/apps/billing-web/src/session/billingWebAuth.flagOff.test.ts @@ -69,6 +69,7 @@ const MINTED = { token: 'jwt-1', permissions: ['workspace:read'], expires_at: new Date(Date.now() + 90 * 60_000).toISOString(), + user_id: 'uid-1', workspace: { id: 'ws-1', name: 'Personal', type: 'personal' }, role: 'owner' } diff --git a/apps/billing-web/src/session/billingWebSession.test.ts b/apps/billing-web/src/session/billingWebSession.test.ts index a51d181646f..c70a21c70ea 100644 --- a/apps/billing-web/src/session/billingWebSession.test.ts +++ b/apps/billing-web/src/session/billingWebSession.test.ts @@ -30,6 +30,7 @@ function mintedResponse(): Response { token: 'jwt-1', permissions: ['workspace:read'], expires_at: new Date(Date.now() + 90 * 60_000).toISOString(), + user_id: 'uid-1', workspace: { id: 'ws-1', name: 'Personal', type: 'personal' }, role: 'owner' }) diff --git a/apps/billing-web/src/test/fakeBillingClient.ts b/apps/billing-web/src/test/fakeBillingClient.ts index 2198df95e6f..b73a80942d3 100644 --- a/apps/billing-web/src/test/fakeBillingClient.ts +++ b/apps/billing-web/src/test/fakeBillingClient.ts @@ -228,6 +228,7 @@ export function createFakeBillingClient( can_manage_auto_top_up: false, can_manage_members: false, can_manage_subscription: false, + can_open_plans: false, can_delete_workspace: false, can_leave_workspace: false, can_manage_billing: false, diff --git a/apps/website/e2e/fixtures/buyCredits.ts b/apps/website/e2e/fixtures/buyCredits.ts index cbb04e88cb2..2559bdb83ca 100644 --- a/apps/website/e2e/fixtures/buyCredits.ts +++ b/apps/website/e2e/fixtures/buyCredits.ts @@ -55,6 +55,7 @@ const CAPABILITIES: BillingCapabilitiesResponse = { can_manage_auto_top_up: false, can_manage_members: false, can_manage_subscription: false, + can_open_plans: false, can_delete_workspace: false, can_leave_workspace: false, can_manage_billing: false, diff --git a/apps/website/e2e/fixtures/modelsAccount.ts b/apps/website/e2e/fixtures/modelsAccount.ts index 8176a93bb5e..a095d8d66f5 100644 --- a/apps/website/e2e/fixtures/modelsAccount.ts +++ b/apps/website/e2e/fixtures/modelsAccount.ts @@ -34,6 +34,7 @@ export const test = base.extend<{ jsonRoute({ token: MODELS_WORKSPACE_TOKEN, expires_at: new Date(Date.now() + 60 * 60 * 1000).toISOString(), + user_id: 'uid-1', workspace: { id: MODELS_WORKSPACE_ID, name: 'Personal', diff --git a/apps/website/e2e/fixtures/workshopAuth.ts b/apps/website/e2e/fixtures/workshopAuth.ts index 5ed3894222d..e006f4e2919 100644 --- a/apps/website/e2e/fixtures/workshopAuth.ts +++ b/apps/website/e2e/fixtures/workshopAuth.ts @@ -47,6 +47,7 @@ export async function mockWorkspaceMint(page: Page) { jsonRoute({ token: 'mock-workspace-jwt', expires_at: new Date(Date.now() + 60 * 60 * 1000).toISOString(), + user_id: 'uid-1', workspace: { id: 'ws-personal', name: 'Personal', type: 'personal' }, role: 'owner', permissions: [] diff --git a/apps/website/e2e/workshop-api-key-workspace-link.spec.ts b/apps/website/e2e/workshop-api-key-workspace-link.spec.ts index 0d6c534364a..a2b7c2ea833 100644 --- a/apps/website/e2e/workshop-api-key-workspace-link.spec.ts +++ b/apps/website/e2e/workshop-api-key-workspace-link.spec.ts @@ -61,6 +61,7 @@ async function mockWorkspaces(page: Page) { body: JSON.stringify({ token: 'mock-team-jwt', expires_at: new Date(Date.now() + 60 * 60 * 1000).toISOString(), + user_id: 'uid-1', workspace: { id: TEAM.id, name: TEAM.name, type: TEAM.type }, role: TEAM.role, permissions: [] diff --git a/apps/website/e2e/workshop-workspace-switch.spec.ts b/apps/website/e2e/workshop-workspace-switch.spec.ts index 400dd1b4893..b421fddf083 100644 --- a/apps/website/e2e/workshop-workspace-switch.spec.ts +++ b/apps/website/e2e/workshop-workspace-switch.spec.ts @@ -57,6 +57,7 @@ async function mockWorkspaces(page: Page) { body: JSON.stringify({ token: 'mock-team-jwt', expires_at: new Date(Date.now() + 60 * 60 * 1000).toISOString(), + user_id: 'uid-1', workspace: { id: TEAM.id, name: TEAM.name, type: TEAM.type }, role: TEAM.role, permissions: [] diff --git a/apps/website/src/config/__fixtures__/workshopSessionFakes.ts b/apps/website/src/config/__fixtures__/workshopSessionFakes.ts index 17a7f78d4ba..b71b8a59353 100644 --- a/apps/website/src/config/__fixtures__/workshopSessionFakes.ts +++ b/apps/website/src/config/__fixtures__/workshopSessionFakes.ts @@ -54,6 +54,7 @@ export function mintBody(token: string) { token, permissions: ['workspace:read'], expires_at: new Date(Date.now() + 90 * 60 * 1000).toISOString(), + user_id: 'uid-1', workspace: { id: 'ws-1', name: 'Personal', type: 'personal' }, role: 'owner' } diff --git a/apps/website/src/config/workshop-billing-sdk.test.ts b/apps/website/src/config/workshop-billing-sdk.test.ts index 9e2b44d11b6..7c0812f5678 100644 --- a/apps/website/src/config/workshop-billing-sdk.test.ts +++ b/apps/website/src/config/workshop-billing-sdk.test.ts @@ -47,6 +47,7 @@ const CLOUD_BODIES: Readonly> = { can_edit_workspace: false, can_manage_auto_top_up: false, can_manage_subscription: false, + can_open_plans: false, can_run_workflows: false, can_upgrade: false, can_subscribe_self_serve: false, diff --git a/browser_tests/fixtures/data/billingCapabilities.ts b/browser_tests/fixtures/data/billingCapabilities.ts index c9d3d5d1602..49b8a67800a 100644 --- a/browser_tests/fixtures/data/billingCapabilities.ts +++ b/browser_tests/fixtures/data/billingCapabilities.ts @@ -33,6 +33,7 @@ export function createBillingCapabilities( can_edit_workspace: false, can_manage_auto_top_up: false, can_manage_subscription: true, + can_open_plans: true, can_run_workflows: false, can_upgrade: false, can_reactivate: false, @@ -71,6 +72,7 @@ export function createWorkspaceBillingCapabilities( can_invite_members: isOwner, can_manage_members: isOwner, can_manage_subscription: isOwner, + can_open_plans: isOwner, can_reactivate: isOwner, can_subscribe_self_serve: isOwner, can_top_up: isOwner, diff --git a/browser_tests/fixtures/data/webSession.ts b/browser_tests/fixtures/data/webSession.ts index f8874c79823..9c68be482cb 100644 --- a/browser_tests/fixtures/data/webSession.ts +++ b/browser_tests/fixtures/data/webSession.ts @@ -42,6 +42,7 @@ export const WEB_SESSION: WebSessionResponse = { export const WEB_SESSION_MINT: ExchangeTokenResponse = { token: 'session-jwt-e2e', expires_at: '2099-01-01T00:00:00Z', + user_id: 'uid-1', workspace: { id: TEAM_WORKSPACE.id, name: TEAM_WORKSPACE.name, diff --git a/browser_tests/fixtures/data/workspaceAuthFixtures.ts b/browser_tests/fixtures/data/workspaceAuthFixtures.ts index 90b71fe2900..c27d3d099b3 100644 --- a/browser_tests/fixtures/data/workspaceAuthFixtures.ts +++ b/browser_tests/fixtures/data/workspaceAuthFixtures.ts @@ -33,6 +33,7 @@ export function makeWorkspaceTokenResponse( return { token, expires_at: new Date(Date.now() + expiresInMs).toISOString(), + user_id: 'uid-1', workspace: { id: workspace.id, name: workspace.name, diff --git a/browser_tests/fixtures/utils/workspaceMocks.ts b/browser_tests/fixtures/utils/workspaceMocks.ts index 3adcf464614..4de7aa4de06 100644 --- a/browser_tests/fixtures/utils/workspaceMocks.ts +++ b/browser_tests/fixtures/utils/workspaceMocks.ts @@ -46,6 +46,7 @@ export async function mockWorkspaceTokenMint( jsonRoute({ token: 'mock-workspace-token', expires_at: new Date(Date.now() + 60 * 60 * 1000).toISOString(), + user_id: 'uid-1', workspace: { id: ws.id, name: ws.name, type: ws.type }, role: ws.role, permissions: [] diff --git a/browser_tests/fixtures/workspaceSwitcherFixture.ts b/browser_tests/fixtures/workspaceSwitcherFixture.ts index c0281c4fd4c..83a7489349f 100644 --- a/browser_tests/fixtures/workspaceSwitcherFixture.ts +++ b/browser_tests/fixtures/workspaceSwitcherFixture.ts @@ -62,6 +62,7 @@ export const workspaceSwitcherTest = comfyPageFixture.extend<{ const response: WorkspaceTokenResponse = { token: `mock-workspace-token-${workspace.id}`, expires_at: new Date(Date.now() + 60 * 60 * 1000).toISOString(), + user_id: 'uid-1', workspace: { id: workspace.id, name: workspace.name, diff --git a/browser_tests/tests/agent/agentPanelMocks.ts b/browser_tests/tests/agent/agentPanelMocks.ts index 2a275f36f68..283e17f960d 100644 --- a/browser_tests/tests/agent/agentPanelMocks.ts +++ b/browser_tests/tests/agent/agentPanelMocks.ts @@ -551,6 +551,7 @@ async function mockAgentBoot( jsonRoute({ token: 'mock-workspace-token', expires_at: '2100-01-01T00:00:00.000Z', + user_id: 'uid-1', workspace: { id: 'ws-personal', name: 'Personal', type: 'personal' }, role: 'owner', permissions: ['owner:*'] diff --git a/browser_tests/tests/authAccountSwitch.spec.ts b/browser_tests/tests/authAccountSwitch.spec.ts index 81866a0595e..d2eab87da42 100644 --- a/browser_tests/tests/authAccountSwitch.spec.ts +++ b/browser_tests/tests/authAccountSwitch.spec.ts @@ -208,6 +208,7 @@ test.describe('Cloud account switch', { tag: '@cloud' }, () => { const response = { token: `workspace-jwt-${account.id}`, expires_at: new Date(Date.now() + 60 * 60 * 1000).toISOString(), + user_id: 'uid-1', workspace: { id: TEAM_WORKSPACE.id, name: TEAM_WORKSPACE.name, diff --git a/browser_tests/tests/currentUserPopoverCredits.spec.ts b/browser_tests/tests/currentUserPopoverCredits.spec.ts index 53d1c7e077c..9d6f2798056 100644 --- a/browser_tests/tests/currentUserPopoverCredits.spec.ts +++ b/browser_tests/tests/currentUserPopoverCredits.spec.ts @@ -37,6 +37,7 @@ const mockListWorkspacesResponse: { workspaces: WorkspaceWithRole[] } = { const mockTokenResponse: WorkspaceTokenResponse = { token: 'mock-workspace-token', expires_at: FUTURE_DATE, + user_id: 'uid-1', workspace: { id: 'ws-personal', name: PERSONAL_WORKSPACE_NAME, diff --git a/browser_tests/tests/dialogs/topUpDeepLink.spec.ts b/browser_tests/tests/dialogs/topUpDeepLink.spec.ts index fc6f305c86a..e02519172d5 100644 --- a/browser_tests/tests/dialogs/topUpDeepLink.spec.ts +++ b/browser_tests/tests/dialogs/topUpDeepLink.spec.ts @@ -99,6 +99,7 @@ test.describe('Top-up deep link', { tag: '@cloud' }, () => { ], billingCapabilities: createBillingCapabilities(teamWorkspace.id, { can_manage_subscription: false, + can_open_plans: false, can_top_up: false, can_subscribe_self_serve: false }) diff --git a/packages/account-core/src/core/__fixtures__/sessionFakes.ts b/packages/account-core/src/core/__fixtures__/sessionFakes.ts index 613dcc2d386..eef29bb1f65 100644 --- a/packages/account-core/src/core/__fixtures__/sessionFakes.ts +++ b/packages/account-core/src/core/__fixtures__/sessionFakes.ts @@ -60,6 +60,7 @@ export function mintBody(overrides: Record = {}) { token: 'workspace-jwt', permissions: ['workspace:read'], expires_at: new Date(Date.now() + NINETY_MINUTES_MS).toISOString(), + user_id: 'uid-1', workspace: { id: 'ws-1', name: 'Personal', type: 'personal' }, role: 'owner', ...overrides diff --git a/packages/account-core/src/core/billing/capabilities.test.ts b/packages/account-core/src/core/billing/capabilities.test.ts index 954665383ae..8b0cdbb61c5 100644 --- a/packages/account-core/src/core/billing/capabilities.test.ts +++ b/packages/account-core/src/core/billing/capabilities.test.ts @@ -55,6 +55,7 @@ const CAPABILITIES = { can_edit_workspace: false, can_manage_auto_top_up: false, can_manage_subscription: false, + can_open_plans: false, can_run_workflows: false, can_upgrade: false, can_subscribe_self_serve: false, diff --git a/packages/account-core/src/core/billing/capabilitiesCrossUser.test.ts b/packages/account-core/src/core/billing/capabilitiesCrossUser.test.ts index a1270516a33..8866ee66207 100644 --- a/packages/account-core/src/core/billing/capabilitiesCrossUser.test.ts +++ b/packages/account-core/src/core/billing/capabilitiesCrossUser.test.ts @@ -63,6 +63,7 @@ const NO_RIGHTS: BillingCapabilities = { can_manage_members: false, can_manage_partner_node_access: false, can_manage_subscription: false, + can_open_plans: false, can_view_pending_invites: false, can_view_team_usage: false, can_reactivate: false, diff --git a/packages/account-core/src/core/billing/contracts/billingCapabilities.contract.test.ts b/packages/account-core/src/core/billing/contracts/billingCapabilities.contract.test.ts index a8e458affdf..79dc1ea00df 100644 --- a/packages/account-core/src/core/billing/contracts/billingCapabilities.contract.test.ts +++ b/packages/account-core/src/core/billing/contracts/billingCapabilities.contract.test.ts @@ -27,6 +27,7 @@ function capabilities(): Capabilities { can_manage_auto_top_up: true, can_manage_members: true, can_manage_subscription: true, + can_open_plans: true, can_delete_workspace: false, can_leave_workspace: false, can_manage_billing: false, @@ -65,6 +66,7 @@ expectTypeOf().toEqualTypeOf< | 'denied_reason_params' | 'denied_reasons' | 'expires_at' + | 'has_parked_billing_operation' | 'payment_recovery_available' | 'plan_kind' | 'recovery_route' @@ -86,6 +88,7 @@ expectTypeOf().toEqualTypeOf<{ can_manage_members: boolean can_manage_partner_node_access: boolean can_manage_subscription: boolean + can_open_plans: boolean can_reactivate: boolean can_revert_scheduled_change: boolean can_run_workflows: boolean diff --git a/packages/account-core/src/core/billing/operationState.ts b/packages/account-core/src/core/billing/operationState.ts index b7022e86d23..bf4cabf13ec 100644 --- a/packages/account-core/src/core/billing/operationState.ts +++ b/packages/account-core/src/core/billing/operationState.ts @@ -15,7 +15,8 @@ import { zBillingOpChargeBreakdown, zBillingOpChargeReason, zBillingOpReceiptPlan, - zBillingOpStatusResponse + zBillingOpStatusResponse, + zTopUpPurchaseAmount } from '@comfyorg/ingest-types/zod' import { z } from 'zod' @@ -42,7 +43,10 @@ export const BillingOpStatusSchema = zBillingOpStatusResponse.extend({ amount_charged_cents: wireCents.optional(), credits_added: wireCents.optional(), charge_breakdown: ChargeBreakdownSchema.optional(), - plan: ReceiptPlanSchema.optional() + plan: ReceiptPlanSchema.optional(), + topup_purchase_amount: zTopUpPurchaseAmount + .extend({ amount_cents: wireCents }) + .optional() }) export type BillingOpStatus = z.infer diff --git a/packages/account-core/src/core/billing/scopedReader.test.ts b/packages/account-core/src/core/billing/scopedReader.test.ts index 70459ed0009..8c15d8ffb5c 100644 --- a/packages/account-core/src/core/billing/scopedReader.test.ts +++ b/packages/account-core/src/core/billing/scopedReader.test.ts @@ -153,6 +153,7 @@ function capabilitiesBody(overrides: Record = {}) { can_edit_workspace: false, can_manage_auto_top_up: false, can_manage_subscription: false, + can_open_plans: false, can_run_workflows: false, can_upgrade: false, can_subscribe_self_serve: false, diff --git a/packages/account-core/src/core/billing/topup.test.ts b/packages/account-core/src/core/billing/topup.test.ts index db961250ba4..63115749857 100644 --- a/packages/account-core/src/core/billing/topup.test.ts +++ b/packages/account-core/src/core/billing/topup.test.ts @@ -104,6 +104,7 @@ const CAPABILITIES = { can_edit_workspace: false, can_manage_auto_top_up: false, can_manage_subscription: false, + can_open_plans: false, can_run_workflows: false, can_upgrade: false, can_subscribe_self_serve: false, diff --git a/packages/account-core/src/core/credentialCache.ts b/packages/account-core/src/core/credentialCache.ts index f49b53549f4..1ba3f032c58 100644 --- a/packages/account-core/src/core/credentialCache.ts +++ b/packages/account-core/src/core/credentialCache.ts @@ -17,7 +17,8 @@ export interface CredentialStorage { /** The generated contract for POST /api/auth/token, never a local copy of it. */ const CachedCredentialSchema = CredentialResponseSchema.omit({ - expires_at: true + expires_at: true, + user_id: true }).extend({ // Storage and broadcast are untrusted boundaries: an empty token can never // authorize and a non-finite expiry can never lapse, so neither is a session. diff --git a/packages/account-core/src/core/session.scheduler.test.ts b/packages/account-core/src/core/session.scheduler.test.ts index fcf01b0f373..07dbf512d9b 100644 --- a/packages/account-core/src/core/session.scheduler.test.ts +++ b/packages/account-core/src/core/session.scheduler.test.ts @@ -143,6 +143,7 @@ describe('opt-in refresh scheduler', () => { permissions: [], // Already inside the buffer: a zero delay would loop the mint. expires_at: new Date(Date.now() + 60_000).toISOString(), + user_id: 'uid-1', workspace: { id: 'ws-1', name: 'Personal', type: 'personal' }, role: 'owner' }), @@ -238,6 +239,7 @@ describe('opt-in refresh scheduler', () => { token, permissions: ['workspace:read'], expires_at: new Date(Date.now() + NINETY_MINUTES_MS).toISOString(), + user_id: 'uid-1', workspace: { id: wsId, name: 'Team', type: 'team' }, role: 'member' }), @@ -457,6 +459,7 @@ describe('opt-in refresh scheduler', () => { token: 'jwt-team', permissions: ['workspace:read'], expires_at: new Date(Date.now() + NINETY_MINUTES_MS).toISOString(), + user_id: 'uid-1', workspace: { id: 'ws-team', name: 'Team', type: 'team' }, role: 'member' }), @@ -497,6 +500,7 @@ describe('opt-in refresh scheduler', () => { expires_at: new Date( Date.now() + NINETY_MINUTES_MS ).toISOString(), + user_id: 'uid-1', workspace: { id: 'ws-team', name: 'Team', type: 'team' }, role: 'member' }), @@ -1055,6 +1059,7 @@ describe('cross-tab refresh coordination', () => { token: 'jwt-team', permissions: ['workspace:read'], expires_at: new Date(Date.now() + NINETY_MINUTES_MS).toISOString(), + user_id: 'uid-1', workspace: { id: 'ws-team', name: 'Team', type: 'team' }, role: 'member' }), diff --git a/packages/account-core/src/core/sessionTokenMint.test.ts b/packages/account-core/src/core/sessionTokenMint.test.ts index f5860a13fc7..381447b60d5 100644 --- a/packages/account-core/src/core/sessionTokenMint.test.ts +++ b/packages/account-core/src/core/sessionTokenMint.test.ts @@ -34,6 +34,7 @@ function tokenBody(token: string, expiresAt: number) { return { token, expires_at: new Date(expiresAt).toISOString(), + user_id: 'uid-1', workspace: { id: 'ws-personal', name: 'Personal', type: 'personal' }, role: 'owner', permissions: [] diff --git a/packages/account-ui/src/billing/__fixtures__/billingHarness.ts b/packages/account-ui/src/billing/__fixtures__/billingHarness.ts index 72b76fca210..9154af74337 100644 --- a/packages/account-ui/src/billing/__fixtures__/billingHarness.ts +++ b/packages/account-ui/src/billing/__fixtures__/billingHarness.ts @@ -126,6 +126,7 @@ export const CAPABILITIES = { can_edit_workspace: false, can_manage_auto_top_up: false, can_manage_subscription: false, + can_open_plans: false, can_run_workflows: false, can_upgrade: false, can_subscribe_self_serve: true, diff --git a/packages/ingest-types/src/index.ts b/packages/ingest-types/src/index.ts index 74d133734ed..7b3cc21ff85 100644 --- a/packages/ingest-types/src/index.ts +++ b/packages/ingest-types/src/index.ts @@ -139,10 +139,13 @@ export type { AgentSkill, AgentSkillListResponse, AgentSkillPublishRequest, + AgentThinkingEntry, AgentThreadCreated, AgentThreadCreateRequest, AgentThreadListResponse, AgentThreadSummary, + AgentToolCallData, + AgentToolCallFrame, AgentTurnAccepted, AgentViewableAttachmentExtension, Asset, @@ -166,6 +169,11 @@ export type { AutoReloadSettings, AutoReloadSettingsRequest, AutoTopUpSetup, + BatchCccItemsData, + BatchCccItemsError, + BatchCccItemsErrors, + BatchCccItemsResponse, + BatchCccItemsResponses, BillingAddress, BillingBalanceResponse, BillingCapabilities, @@ -225,6 +233,14 @@ export type { CancelTaskResponse, CancelTaskResponses, CatalogProvider, + CccAuthoringContext, + CccCatalogState, + CccCheckedReviewReceipt, + Cccjson, + CccPublicItemsPage, + CccWebsiteCardFacet, + CccWebsiteCardFacets, + CccWebsiteCardsPage, CheckAssetByHashData, CheckAssetByHashError, CheckAssetByHashErrors, @@ -252,6 +268,8 @@ export type { ClearWorkspaceDeploymentResponses, ClientOptions, CloudNodeCompatibility, + ContentCatalogProjection, + ContentCatalogRecord, CreateAssetData, CreateAssetDownloadData, CreateAssetDownloadError, @@ -272,6 +290,16 @@ export type { CreateAssetFromHashResponses, CreateAssetResponse, CreateAssetResponses, + CreateCccItemData, + CreateCccItemError, + CreateCccItemErrors, + CreateCccItemResponse, + CreateCccItemResponses, + CreateDeployBundleData, + CreateDeployBundleError, + CreateDeployBundleErrors, + CreateDeployBundleResponse, + CreateDeployBundleResponses, CreateDesktopLoginCodeData, CreateDesktopLoginCodeError, CreateDesktopLoginCodeErrors, @@ -293,6 +321,11 @@ export type { CreateInputUploadUrlErrors, CreateInputUploadUrlResponse, CreateInputUploadUrlResponses, + CreateInteractiveTopupData, + CreateInteractiveTopupError, + CreateInteractiveTopupErrors, + CreateInteractiveTopupResponse, + CreateInteractiveTopupResponses, CreateInviteRequest, CreateSecretData, CreateSecretError, @@ -368,6 +401,16 @@ export type { DeleteAssetErrors, DeleteAssetResponse, DeleteAssetResponses, + DeleteCccItemData, + DeleteCccItemError, + DeleteCccItemErrors, + DeleteCccItemResponse, + DeleteCccItemResponses, + DeleteCccMediaData, + DeleteCccMediaError, + DeleteCccMediaErrors, + DeleteCccMediaResponse, + DeleteCccMediaResponses, DeleteGlobalSettingData, DeleteGlobalSettingError, DeleteGlobalSettingErrors, @@ -397,6 +440,11 @@ export type { DeleteUserdataFileData, DeleteUserdataFileError, DeleteUserdataFileErrors, + DeleteUserdataFilePublishData, + DeleteUserdataFilePublishError, + DeleteUserdataFilePublishErrors, + DeleteUserdataFilePublishResponse, + DeleteUserdataFilePublishResponses, DeleteUserdataFileResponse, DeleteUserdataFileResponses, DeleteWorkflowData, @@ -412,12 +460,18 @@ export type { DeploymentCompatibility, DeploymentCompatibilityRequest, DeploymentNodeCompatibility, + DeployToCloudError, DesktopLoginCodeCreateRequest, DesktopLoginCodeCreateResponse, DesktopLoginCodeExchangeRequest, DesktopLoginCodeExchangeResponse, DesktopLoginCodeRedeemRequest, DesktopLoginCodeRedeemResponse, + DiscardCccChangesData, + DiscardCccChangesError, + DiscardCccChangesErrors, + DiscardCccChangesResponse, + DiscardCccChangesResponses, DiscoverSsoData, DiscoverSsoError, DiscoverSsoErrors, @@ -428,6 +482,8 @@ export type { DocOpsResultFrame, DocResetData, DocResetFrame, + DocSubscribedData, + DocSubscribedFrame, DocUpdateData, DocUpdateFrame, DownloadExportData, @@ -545,11 +601,75 @@ export type { GetBillingUsageTimeSeriesErrors, GetBillingUsageTimeSeriesResponse, GetBillingUsageTimeSeriesResponses, + GetCatalogAgentInstructionsData, + GetCatalogAgentInstructionsErrors, + GetCatalogAgentInstructionsResponse, + GetCatalogAgentInstructionsResponses, + GetCatalogDocsData, + GetCatalogDocsErrors, + GetCatalogDocsResponse, + GetCatalogDocsResponses, + GetCatalogOpenApiData, + GetCatalogOpenApiErrors, + GetCatalogOpenApiResponse, + GetCatalogOpenApiResponses, + GetCccAuthoringContextData, + GetCccAuthoringContextError, + GetCccAuthoringContextErrors, + GetCccAuthoringContextResponse, + GetCccAuthoringContextResponses, + GetCccDraftItemData, + GetCccDraftItemError, + GetCccDraftItemErrors, + GetCccDraftItemResponse, + GetCccDraftItemResponses, + GetCccFinalReviewData, + GetCccFinalReviewError, + GetCccFinalReviewErrors, + GetCccFinalReviewResponse, + GetCccFinalReviewResponses, + GetCccItemHistoryData, + GetCccItemHistoryError, + GetCccItemHistoryErrors, + GetCccItemHistoryResponse, + GetCccItemHistoryResponses, + GetCccPreviewMediaBytesData, + GetCccPreviewMediaBytesError, + GetCccPreviewMediaBytesErrors, + GetCccPreviewMediaBytesResponse, + GetCccPreviewMediaBytesResponses, + GetCccPublicMediaBytesData, + GetCccPublicMediaBytesErrors, + GetCccPublicMediaBytesResponse, + GetCccPublicMediaBytesResponses, + GetCccRevisionItemData, + GetCccRevisionItemError, + GetCccRevisionItemErrors, + GetCccRevisionItemResponse, + GetCccRevisionItemResponses, + GetCccStagingData, + GetCccStagingError, + GetCccStagingErrors, + GetCccStagingResponse, + GetCccStagingResponses, + GetCccStateData, + GetCccStateError, + GetCccStateErrors, + GetCccStateResponse, + GetCccStateResponses, + GetCccTypeSchemaData, + GetCccTypeSchemaErrors, + GetCccTypeSchemaResponse, + GetCccTypeSchemaResponses, GetChurnkeyAuthData, GetChurnkeyAuthError, GetChurnkeyAuthErrors, GetChurnkeyAuthResponse, GetChurnkeyAuthResponses, + GetContentCatalogItemData, + GetContentCatalogItemErrors, + GetContentCatalogItemResponse, + GetContentCatalogItemResponses, GetCurrentWorkspaceData, GetCurrentWorkspaceError, GetCurrentWorkspaceErrors, @@ -562,6 +682,11 @@ export type { GetDefaultWorkflowData, GetDefaultWorkflowResponse, GetDefaultWorkflowResponses, + GetDeploySummaryData, + GetDeploySummaryError, + GetDeploySummaryErrors, + GetDeploySummaryResponse, + GetDeploySummaryResponses, GetEmbeddingsData, GetEmbeddingsResponse, GetEmbeddingsResponses, @@ -874,6 +999,10 @@ export type { GlobalSettingValue, GlobalSubgraphData, GlobalSubgraphInfo, + HeadCccPreviewMediaBytesData, + HeadCccPreviewMediaBytesErrors, + HeadCccPublicMediaBytesData, + HeadCccPublicMediaBytesErrors, HistoryDetailEntry, HistoryDetailResponse, HistoryEntry, @@ -903,6 +1032,7 @@ export type { ImportPublishedAssetsResponses, InputUploadResponse, InputUploadUrlRequest, + InteractiveTopupRequest, InterruptJobData, InterruptJobError, InterruptJobErrors, @@ -932,6 +1062,15 @@ export type { ListAssetsResponse2, ListAssetsResponses, ListAssetsResponseWritable, + ListCccWebsiteCardsData, + ListCccWebsiteCardsErrors, + ListCccWebsiteCardsResponse, + ListCccWebsiteCardsResponses, + ListContentCatalogItemsData, + ListContentCatalogItemsError, + ListContentCatalogItemsErrors, + ListContentCatalogItemsResponse, + ListContentCatalogItemsResponses, ListHubLabelsData, ListHubLabelsError, ListHubLabelsErrors, @@ -1123,6 +1262,11 @@ export type { PruneAssetsData, PruneAssetsResponse, PruneAssetsResponses, + PublishCccDraftData, + PublishCccDraftError, + PublishCccDraftErrors, + PublishCccDraftResponse, + PublishCccDraftResponses, PublishedWorkflowDetail, PublishHubWorkflowData, PublishHubWorkflowError, @@ -1168,11 +1312,26 @@ export type { RemoveWorkspaceMemberResponse, RemoveWorkspaceMemberResponses, RenewalInvoice, + ReplaceCccItemData, + ReplaceCccItemError, + ReplaceCccItemErrors, + ReplaceCccItemResponse, + ReplaceCccItemResponses, + ReplaceCccMediaFileData, + ReplaceCccMediaFileError, + ReplaceCccMediaFileErrors, + ReplaceCccMediaFileResponse, + ReplaceCccMediaFileResponses, ResendWorkspaceInviteData, ResendWorkspaceInviteError, ResendWorkspaceInviteErrors, ResendWorkspaceInviteResponse, ResendWorkspaceInviteResponses, + RestoreCccItemVersionData, + RestoreCccItemVersionError, + RestoreCccItemVersionErrors, + RestoreCccItemVersionResponse, + RestoreCccItemVersionResponses, ResubscribeData, ResubscribeError, ResubscribeErrors, @@ -1193,6 +1352,16 @@ export type { RevertScheduledChangeResponse, RevertScheduledChangeResponse2, RevertScheduledChangeResponses, + ReviewCccCheckedPublicationData, + ReviewCccCheckedPublicationError, + ReviewCccCheckedPublicationErrors, + ReviewCccCheckedPublicationResponse, + ReviewCccCheckedPublicationResponses, + ReviewCccCheckedReceiptData, + ReviewCccCheckedReceiptError, + ReviewCccCheckedReceiptErrors, + ReviewCccCheckedReceiptResponse, + ReviewCccCheckedReceiptResponses, RevokeAllSessionsData, RevokeAllSessionsError, RevokeAllSessionsErrors, @@ -1235,6 +1404,11 @@ export type { SetWorkspaceDefaultDeploymentResponse, SetWorkspaceDefaultDeploymentResponses, SsoDiscoverResponse, + StageCccChangesData, + StageCccChangesError, + StageCccChangesErrors, + StageCccChangesResponse, + StageCccChangesResponses, StartSsoConfirmedData, StartSsoConfirmedError, StartSsoConfirmedErrors, @@ -1272,6 +1446,7 @@ export type { TeamCreditStops, TeamCreditStopSummary, ToolCallSummary, + TopUpPurchaseAmount, TopupQuoteResponse, UpdateAssetData, UpdateAssetError, @@ -1323,6 +1498,11 @@ export type { UpdateWorkspaceRequest, UpdateWorkspaceResponse, UpdateWorkspaceResponses, + UploadCccMediaData, + UploadCccMediaError, + UploadCccMediaErrors, + UploadCccMediaResponse, + UploadCccMediaResponses, UploadGrantPutData, UploadGrantPutErrors, UploadGrantPutResponse, diff --git a/packages/ingest-types/src/types.gen.ts b/packages/ingest-types/src/types.gen.ts index bf1eb1ec83d..60861fd739f 100644 --- a/packages/ingest-types/src/types.gen.ts +++ b/packages/ingest-types/src/types.gen.ts @@ -585,11 +585,11 @@ export type UsageGroupLabel = { */ cost_kind?: 'gpu' | 'storage' /** - * Only for `model` when the key is a Serverless deployment: the deployment's id. Under Serverless the model level is the deployment, with its GPU time and its storage as separate keys. + * For `model` and `source` when the key is a Serverless deployment: the deployment's id. Under Serverless the model level is the deployment, with its GPU time and its storage as separate keys; under `source` each deployment is one key. */ deployment_id?: string /** - * Only for `model` when the key is a Serverless deployment and the caller is a signed-in session comfy-deploy can name it for; absent on an API-key read or when comfy-deploy could not be reached, and `display_name` then carries the id. + * For `model` and `source` when the key is a Serverless deployment and the caller is a signed-in session comfy-deploy can name it for; absent on an API-key read or when comfy-deploy could not be reached, and `display_name` then carries the id. */ deployment_name?: string /** @@ -617,19 +617,19 @@ export type UsageGroupLabel = { */ key_prefix?: string /** - * Only for `source`. + * Only for `source`. A `deployment` key is one Serverless deployment's id (`deployment_id` set); the bare key `deployment` is deployment spend recorded without an id. */ kind?: 'api_key' | 'session' | 'deployment' /** - * Only for `source` when the key's owner is known. + * Only for `source` when the key's or deployment's owner is known. */ owner_display_name?: string /** - * Only for `source` when the key's owner is known; tells two owners with one name apart. + * Only for `source` when the key's or deployment's owner is known; tells two owners with one name apart. */ owner_email?: string /** - * Only for `source` when the key is known to this workspace. + * Only for `source`: the API key's owner when the key is known to this workspace, or the member who deployed a deployment when comfy-deploy names it. */ owner_user_id?: string } @@ -760,6 +760,28 @@ export type TopupQuoteResponse = { * */ expires_at: string + /** + * Environment-configured Stripe payment method configuration for + * one-time credit top-up checkout. Omitted when not configured. + * This metadata does not establish interactive payment eligibility, + * ownership of a saved method, or guarantee payment success. The + * interactive endpoint independently accepts only cards without + * future usage and revalidates payment authority. + * Clients must constrain the interactive payment form to that + * card-only, no-future-use contract; this configuration alone does + * not guarantee its enabled methods are compatible. + * + */ + payment_method_configuration_id?: string +} + +/** + * Requested credit purchase from this operation's validated stored interactive top-up intent. Visible only to callers authorized for payment details. Not the amount charged or proof of payment. Omitted for historical, non-interactive, invalid or non-top-up operations. + * + */ +export type TopUpPurchaseAmount = { + amount_cents: number + currency: 'usd' } /** @@ -1350,7 +1372,11 @@ export type AgentConsentSettingValue = { /** * Server-to-client CRDT document frame carried by the /ws envelope. */ -export type ServerDocFrame = DocUpdateFrame | DocResetFrame | DocOpsResultFrame +export type ServerDocFrame = + | DocSubscribedFrame + | DocUpdateFrame + | DocResetFrame + | DocOpsResultFrame /** * First rejected op in an abort-remainder batch. @@ -1422,6 +1448,37 @@ export type DocUpdateFrame = { type: 'doc_update' } +export type DocSubscribedData = { + code?: string + /** + * Binds a stale-schema refusal to the exact row the client may re-mint. Present only with stale_schema_reseed_required. + */ + expected_seq?: number + /** + * Current lineage sequence. On an accepted subscription, omission means lineage 0 (the document has not been minted yet). + */ + lineage_seq?: number + /** + * Human-readable rejection reason. The generated Go field is named Reason so it does not collide with the frame's Message method. + */ + message?: string + ok: boolean + /** + * Current document sequence. On an accepted subscription, omission means sequence 0 (the document has not been minted yet). + */ + seq?: number + v: number + workflow_id: string +} + +/** + * Server acknowledgement for a doc_subscribe request. + */ +export type DocSubscribedFrame = { + data: DocSubscribedData + type: 'doc_subscribed' +} + /** * User secret metadata (the secret value itself is never returned after creation). */ @@ -3434,6 +3491,56 @@ export type JobAssetsResponse = { pagination: PaginationInfo } +/** + * Pay once with exactly one new-card confirmation token or explicitly selected attached card. Keep the exact request and key on retry; never fall back to the on-file route. + */ +export type InteractiveTopupRequest = { + /** + * Nominal credit purchase in USD cents, excluding tax and discounts. Actual payment and credit grant are asynchronous. + */ + amount_cents: number + /** + * Client-minted identifier for one checkout attempt, generated when + * the customer starts checkout and sent on every request and + * analytics event of that attempt. Purely for observability: it is + * what joins the frontend funnel (which emits events before any + * billing op exists) to the backend outcome. Expected to match + * ^[A-Za-z0-9_-]{1,64}$; a present value that does not is ignored, + * never rejected, so the constraint is intentionally not declared + * here as pattern/maxLength -- either would make a conforming + * client or request validator reject the request before the backend + * ever applies that "ignored, not rejected" behavior. + * + */ + checkout_attempt_id?: string + /** + * New-card confirmation authority. Valid only on the dedicated interactive route; mutually exclusive with saved_payment_method_id. At most 255 UTF-8 bytes. No implicit saving. + */ + confirmation_token?: string + /** + * Required globally unique opaque key for this exact purchase (for example, a UUID), at most 255 UTF-8 bytes. Replays bind amount, actor, customer, selected authority and return URL; changing them returns IDEMPOTENCY_MISMATCH. Never mint a new key while payment is unresolved. + * + */ + idempotency_key: string + /** + * Valid only on the interactive route. True is currently rejected; paying does not change invoice defaults. + */ + make_default?: boolean + /** + * Required with confirmation_token; at most 2048 bytes before and after URL normalization. Must use an existing allowed HTTPS destination (HTTP only for configured localhost or 127.0.0.1). Bound to the request. Callers must supply credential-free routing URLs: the validator rejects userinfo, fragments, known authentication query keys and recognizable Stripe authority patterns, but cannot identify every opaque secret. + * + */ + return_url?: string + /** + * Valid only on the interactive route. True is currently rejected; pay once does not save a new card. + */ + save_payment_method?: boolean + /** + * Explicit attached card selection, at most 255 UTF-8 bytes. Valid only on the dedicated interactive route; never changes the invoice default. + */ + saved_payment_method_id?: string +} + /** * Request body for minting an input-image, input-audio or input-video upload grant. */ @@ -4180,6 +4287,14 @@ export type ExchangeTokenResponse = { * Cloud JWT token */ token: string + /** + * Canonical Comfy user ID the token was minted for: the token's `sub`, + * and the same ID `GET /api/billing/capabilities` returns in + * `resolved_for.user_id`. Clients scope per-user reads with it. It is + * not the Firebase UID, which can differ. + * + */ + user_id: string workspace: WorkspaceSummary } @@ -4337,6 +4452,28 @@ export type CloudNodeCompatibility = { missing_node_types: Array } +/** + * Error body of local ComfyUI's /api/deploy* routes. Branch on `error`, never on `message`. + */ +export type DeployToCloudError = { + error: + | 'offline' + | 'multiple_credentials' + | 'invalid_api_key_format' + | 'invalid_body' + | 'missing_credentials' + | 'unauthorized' + | 'too_large' + | 'too_many_bundles' + | 'builder_rejected' + | 'builder_unavailable' + | 'builder_busy' + /** + * Human-readable detail, present for invalid_body and builder_rejected. + */ + message?: string +} + /** * Response after deleting a session cookie */ @@ -4501,7 +4638,7 @@ export type CreateTopupResponse = { } /** - * Request body for purchasing a one-time credit top-up. + * Legacy on-file top-up. Explicit payment authority and save/default fields require the dedicated interactive route and are rejected here, including null or false values. */ export type CreateTopupRequest = { /** @@ -4658,6 +4795,33 @@ export type CreateHubProfileRequest = { workspace_id: string } +export type ContentCatalogRecord = { + data: { + [key: string]: unknown + } + deleted: boolean + edit_version: string + enabled: boolean + kind: 'MODEL' | 'WORKFLOW' | 'APP' | 'TEMPLATE_SET' + /** + * Integer revision supplying this entity; may precede the requested catalog revision. + */ + revision: number + /** + * Canonical website pathname for page content; native slug for template sets. Identity is always UID. + */ + slug: string + uid: string + visibility: 'PUBLIC' | 'STAFF' + visible_from?: string +} + +export type ContentCatalogProjection = { + generation: number + items: Array + revision_id: number +} + /** * Credentials the Churnkey embed requires to launch the cancel flow. * `auth_hash` is hex-encoded HMAC-SHA256 of `customer_id` signed with the @@ -4730,6 +4894,121 @@ export type CancelSubscriptionAcceptedResponse = { status: 'pending' } +export type CccWebsiteCardsPage = { + available_kinds: Array<'MODEL' | 'WORKFLOW' | 'APP'> + facets: CccWebsiteCardFacets + /** + * Staff-only Draft generation + */ + generation?: number + has_more: boolean + items: Array + next_cursor?: string + page_size: number + previous_cursor?: string + revision_id: number + sort_orders: Array<'popular' | 'name' | 'priceAsc' | 'priceDesc'> + /** + * Staff-only filtered count; omitted for anonymous callers + */ + total?: number +} + +export type CccWebsiteCardFacet = { + /** + * Staff-only eligible facet count + */ + count?: number + label: string + value: string +} + +export type CccWebsiteCardFacets = { + categories: Array + models: Array + use_cases: Array +} + +export type CccPublicItemsPage = ContentCatalogProjection & { + has_more: boolean + /** + * Opaque continuation bound to this query and publication identity; omitted on the last page. + */ + next_cursor?: string + page_size: number +} + +/** + * Flat type-versioned CCC JSON. Domain schemas (/api/v1/catalog/schemas/{type}/{version}) constrain authored fields. The readOnly properties are server metadata returned by reads; a save may send them back unchanged and they are ignored, never applied. expected_draft_rev and expected_revision_uid are the save concurrency tokens. + */ +export type Cccjson = { + /** + * Catalog revision of this edit; may be older than the working Draft. + */ + readonly catalog_rev?: number + /** + * Immutable account that created the resource. + */ + readonly creator_uid?: string + /** + * SHA-256 of the canonical authored document. + */ + readonly digest?: string + readonly draft_generation?: number + readonly edit_sequence?: number + /** + * Tombstone flag. false may be sent back; true is refused (use restore). + */ + readonly is_deleted?: boolean + /** + * Fixed organization owner; never transferred by a save. + */ + readonly owner_uid?: string + /** + * This immutable edit; send it back as expected_revision_uid. + */ + readonly revision_uid?: string + /** + * RFC3339 UTC save time of this exact edit. + */ + readonly saved_at?: string + /** + * Account that saved this edit. + */ + readonly saved_by_uid?: string + /** + * Server-assigned logical resource UID. + */ + readonly uid?: string + [key: string]: unknown +} + +export type CccCheckedReviewReceipt = { + publish_enabled: boolean + receipt_version: 1 + selected_count: number + selected_versions_digest: string + selection_digest: string + state: CccCatalogState + unchecked_count: number +} + +export type CccCatalogState = { + draft_generation: number + draft_rev: number + live_rev: number + next_rev: number + previous_live_rev: number | null +} + +export type CccAuthoringContext = { + actor_uid: string + can_apply: boolean + can_edit: boolean + owner_uid: string + state: CccCatalogState +} + /** * Response after bulk-revoking API keys for a workspace member. */ @@ -4788,6 +5067,10 @@ export type BillingStatusResponse = { * Whether the workspace has an active subscription */ is_active: boolean + /** + * Owner-only ID of the workspace's newest initial subscription or plan transition, in any status, ordered by creation time then ID. A newer attempt supersedes an older one regardless of completion time. Poll /api/billing/ops/{id} for its checkout state. Independent of pending top-up discovery. Omitted for non-owners, no matching attempt, disabled billing, unavailable reads and older servers; omission is unknown and must not be interpreted as successful checkout or acknowledgment. + */ + latest_subscription_op_id?: string /** * Effective active workspace seat limit after applying any workspace override. 0 means unlimited (billing-disabled/no-op). */ @@ -4939,6 +5222,16 @@ export type BillingOpStatusResponse = { */ cancelable?: boolean charge_breakdown?: BillingOpChargeBreakdown + /** + * Owner-only subscription-checkout banner fact for initial subscriptions and plan transitions. unfinished means awaiting a payment method for a known target plan; verify_payment has a usable payment action; processing means the bank is processing the payment; payment_received means payment succeeded while the operation remains pending; failed is a terminal payment refusal, excluding abandoned/superseded checkouts. none is a known non-banner state, including resolved or reconciliation operations. Omitted for members, other operation types, uncertain provider reads and older servers. Omission is unknown, never an implied none. + */ + checkout_state?: + | 'unfinished' + | 'verify_payment' + | 'processing' + | 'payment_received' + | 'failed' + | 'none' /** * When the operation completed (success or failure) */ @@ -5028,6 +5321,7 @@ export type BillingOpStatusResponse = { * */ status: 'pending' | 'succeeded' | 'failed' | 'reconciliation_needed' + topup_purchase_amount?: TopUpPurchaseAmount } /** @@ -5181,6 +5475,14 @@ export type BillingEvent = { * When the event occurred */ createdAt: string + /** + * The Serverless deployment the charge came through, from the event's `deployment_id`; absent for a session or an API key. + */ + deployment_id?: string + /** + * That deployment's name, when the caller is a signed-in session comfy-deploy can name it for; absent on an API-key read or when comfy-deploy could not be reached. + */ + deployment_name?: string /** * Unique event identifier */ @@ -5565,6 +5867,25 @@ export type BillingCapabilityDenials = { * */ can_manage_subscription?: 'not_a_member' | 'not_workspace_owner' + /** + * Why can_open_plans is false, present only for a refused capability. Missing means no recognized explanation, never permission. It is the can_subscribe_self_serve reason with the creator rule always applied and a scheduled plan change set aside: a non-creator owner gets not_original_owner in every rollout mode, and subscription_change_in_progress never appears here. + * - not_a_member: The actor is not a workspace member. + * - not_workspace_owner: The actor does not hold the workspace owner role. + * - not_original_owner: Plan changes require the workspace creator. + * - creator_only_provisioning: Only the creator can provision this billing identity. + * - tier_not_self_serve: The current tier is sales-managed or unrecognized. + * - subscription_not_started: The existing subscription has not started. + * - subscription_status_unrecognized: The existing subscription status is unrecognized. + * + */ + can_open_plans?: + | 'not_a_member' + | 'not_workspace_owner' + | 'not_original_owner' + | 'creator_only_provisioning' + | 'tier_not_self_serve' + | 'subscription_not_started' + | 'subscription_status_unrecognized' /** * Present only when can_reactivate is false. The value names the resolver * branch that decided, not customer wording. Values are listed in the order the @@ -5653,6 +5974,7 @@ export type BillingCapabilityDenials = { * Why can_run_workflows is false, present only for a refused capability. Missing means no recognized explanation, never permission. Values describe the existing deciding policy branches, not authorization or sibling capabilities. Workflow rules short-circuit in policy order. * - manual_block: The workspace is manually blocked. * - subscription_inactive: Cloud workflow billing admission requires an active or eligible Free subscription. + * - payment_past_due: Subscription inactivity blocks workflow billing admission and a bound live subscription has a recoverable payment failure. Visible to workspace members; does not grant payment management. * - no_funds: The applicable balance is exhausted and allowance does not bypass it. * - workspace_cap_exceeded: The workspace spend cap is exceeded. * - project_cap_exceeded: The applicable project spend cap is exceeded. @@ -5663,6 +5985,7 @@ export type BillingCapabilityDenials = { can_run_workflows?: | 'manual_block' | 'subscription_inactive' + | 'payment_past_due' | 'no_funds' | 'workspace_cap_exceeded' | 'project_cap_exceeded' @@ -5807,6 +6130,10 @@ export type BillingCapabilitiesResponse = { * Time after which the client must refetch this snapshot. */ expires_at: string + /** + * Whether any workspace billing operation needs support reconciliation (paid_ungrantable or supersede_uncancelled), across all operation types including automatic top-ups, and independent of an active plan. Shown only when can_manage_billing is true; true requests the payment support banner, not proof of a charge. False means the local read found no parked operation. Omitted for non-managers, unavailable reads, older servers or disabled billing; omission means unknown, not a healthy payment state. + */ + has_parked_billing_operation?: boolean /** * Whether this actor may use payment management to recover an outstanding * subscription payment. True only when can_manage_billing is true, the @@ -6095,6 +6422,10 @@ export type BillingCapabilities = { * */ can_manage_subscription: boolean + /** + * Whether to offer this actor the way into Plans (Manage, Explore plans, Choose a plan). Creator-only, whatever the lifecycle rollout mode: false for members and for owners who are not the workspace's creator. Otherwise the same rule as can_subscribe_self_serve, except that a plan change already scheduled (subscription_change_in_progress) does not close it, so the creator can still open Plans to review or revert that change. Which plans are selectable stays with the plans listing. False when an older billing-api omits it. Guidance only; writes recheck. + */ + can_open_plans: boolean /** * - Answers: may the user undo a SCHEDULED cancellation on a subscription that * is still running? @@ -6202,8 +6533,11 @@ export type BillingCapabilities = { /** * Recorded account setup guidance, separate from owner authority in - * can_manage_auto_top_up. Frozen keeps the owner's card visible but prevents - * enabling/editing; unavailable hides it. Owner read/disable authority remains. + * can_manage_auto_top_up. Frozen prevents enabling/editing; unavailable + * means setup is not available. Owner read/disable authority remains separate. + * These states do not determine surface visibility. Unified billing settings + * hide the auto top-up card when can_top_up is false, including paused or + * payment-failed billing. * Ready does not authorize a charge or guarantee an off-session payment method. * This fact ignores saved consent and monthly budget. An absent fact is unknown. * @@ -6337,6 +6671,11 @@ export type AutoReloadSettingsRequest = { * */ export type AutoReloadSettings = { + /** + * True when the validated default card is already expired or its expiry-month boundary (00:00 UTC on the first day of the following month) is within the next 30 days. Absent or null means unknown, never a healthy-card claim. This includes non-card methods, malformed data, provider errors or a live Stripe default that differs from the recorded default payment method (for example, before a portal-change webhook syncs). Independent of status and charge eligibility; save responses omit the fact. Missing on an older server also means unknown. + * + */ + card_expiring_soon?: boolean | null configured: boolean /** * When the budget cycle resets; null when no cycle anchor is known. @@ -6606,6 +6945,47 @@ export type AgentTurnAccepted = { thread_id: string } +/** + * Server-to-client agent_tool_call frame on /ws. A tool invocation started or reached a terminal state. Closed, like the canonical envelope. + */ +export type AgentToolCallFrame = { + data: AgentToolCallData + type: 'agent_tool_call' +} + +/** + * The `data` of an agent_tool_call WebSocket event: one tool invocation's lifecycle. Mirrors `$defs.agent_tool_call.data` in services/agent/api/agent_events.schema.json, which also states the presence rules: the document correlation fields appear only on a terminal (success or error) frame, workflow_id and op_ids appear together, and doc_seq and doc_lineage_seq appear together and only with both of them. This schema leaves those rules out on purpose. A oneOf over closed variants could express them, but it would turn the generated frontend type into a union the consumer cannot extend field by field. The producer enforces them instead: the Publisher omits incomplete correlation, and TestToolCallEmissionsSatisfyBothContracts validates every emitted shape against the canonical schema. Consumers treat correlation as advisory and use it only when workflow_id and op_ids are both present on a terminal frame. TestToolCallFrameMatchesContract holds the two definitions to the same fields and constraints. + */ +export type AgentToolCallData = { + /** + * Present with doc_seq. The lineage containing every correlated update, so a follower can detect replacement and resync. + */ + doc_lineage_seq?: number + /** + * Optional terminal recovery barrier. The highest published doc_update sequence carrying this call's op_ids. + */ + doc_seq?: number + duration_ms?: number + error_code?: string + message_id: string + /** + * Terminal success or error only. The semantic operations whose effects are carried by published doc_update frames for this call. + */ + op_ids?: Array + /** + * load_skill only. The skill pack name the call's input names, on its running frame and on its terminal frame, including an unknown_skill error. Omitted on every other tool. + */ + skill?: string + status: 'running' | 'success' | 'error' + thread_id: string + tool_call_id: string + tool_name: string + /** + * Terminal success or error only. The workflow whose published doc_update contains op_ids. Replace-canvas doc_reset calls do not carry this correlation. + */ + workflow_id?: string +} + /** * One agent thread row for the history sidebar. */ @@ -6673,6 +7053,17 @@ export type AgentThreadCreateRequest = { workflow_id?: string } +/** + * One model round's thinking as persisted on an assistant message's content.thinking (services/agent/internal/loop.persistedThinking): the round's reasoning text, then its narration, scrubbed exactly as the live agent_thinking frames were. Display data only. + */ +export type AgentThinkingEntry = { + text: string + /** + * The provider tool-use id of the round's first tool call, the same id ToolCallSummary.tool_call_id carries, so a client can place the entry ahead of that round's calls. Absent for the final round, whose thinking follows the last call. + */ + tool_call_id?: string +} + /** * A user-authored skill pack to create or replace. Plain JSON — a pack body is small enough that a signed-URL upload would be pure overhead. */ @@ -6888,6 +7279,10 @@ export type AgentPostMessageRequest = { * Client-generated identifier for this send attempt. The frontend emits the same value on app:agent_message_sent; the agent echoes it on agent_turn_started so accepted turns can be joined to their originating sends without using timestamp proximity. Retries mint a new value. Older clients may omit it. */ client_message_id?: string + /** + * The frontend build that sent this turn (ComfyUI_frontend __COMFYUI_FRONTEND_VERSION__, optionally +commit). Observability only; never changes the turn. Recorded on the turn's trace as `comfy.client.version`. A value longer than 64 bytes, or one containing anything other than ASCII letters, digits, `.`, `+` and `-`, is DROPPED, not rejected — accepted with 202 exactly like omitting the field. Surrounding whitespace is trimmed. + */ + client_version?: string /** * The user's message. */ @@ -7079,7 +7474,7 @@ export type AgentPendingAsk = */ export type AgentMessage = { /** - * Message payload. User turns carry {text, attachments?, attachment_refs?, workflow_references?}. Attachments are the input-image filenames from the request. attachment_refs is the server's own resolution of those same filenames to library assets, as {name, id?, kind?, display_name?} objects. display_name carries the validated user-facing filename when name is an opaque storage key; the server may remove a registered emoji selector that does not change the displayed glyph. To bound denormalized data, repeated entries with the same name carry display_name only on the first occurrence; clients should apply it to every entry sharing that name. The sibling exists so a later turn in the thread can reach an earlier turn's file — clients should keep reading attachments. workflow_references is an optional array of explicit non-target references, each with workflow_id and name (an empty string when no name was supplied). An optional unavailable: true records that the reference could not be authorized at turn start, without distinguishing unknown IDs, inaccessible workflows, or lookup failures. These entries preserve the user's reference intent without exposing workflow content; the frontend restores reference chips from this metadata. The field is omitted when there are no references. Assistant turns carry {text} — the final answer text (or error copy on a failed turn). Omitted when empty (e.g. an assistant message still streaming). Per-turn token accounting is NOT included here; it is surfaced on the agent_message_done WebSocket broadcast. tool_calls is an optional array of ToolCallSummary, attached to an assistant message that has persisted terminal (ok/error) tool-call rows — it lets a chat reload render the tool history a turn produced instead of showing nothing until the next live turn. Omitted when the message has no such rows. + * Message payload. User turns carry {text, attachments?, attachment_refs?, workflow_references?}. Attachments are the input-image filenames from the request. attachment_refs is the server's own resolution of those same filenames to library assets, as {name, id?, kind?, display_name?} objects. display_name carries the validated user-facing filename when name is an opaque storage key; the server may remove a registered emoji selector that does not change the displayed glyph. To bound denormalized data, repeated entries with the same name carry display_name only on the first occurrence; clients should apply it to every entry sharing that name. The sibling exists so a later turn in the thread can reach an earlier turn's file — clients should keep reading attachments. workflow_references is an optional array of explicit non-target references, each with workflow_id and name (an empty string when no name was supplied). An optional unavailable: true records that the reference could not be authorized at turn start, without distinguishing unknown IDs, inaccessible workflows, or lookup failures. These entries preserve the user's reference intent without exposing workflow content; the frontend restores reference chips from this metadata. The field is omitted when there are no references. Assistant turns carry {text} — the final answer text (or error copy on a failed turn). Omitted when empty (e.g. an assistant message still streaming). Per-turn token accounting is NOT included here; it is surfaced on the agent_message_done WebSocket broadcast. tool_calls is an optional array of ToolCallSummary, attached to an assistant message that has persisted terminal (ok/error) tool-call rows — it lets a chat reload render the tool history a turn produced instead of showing nothing until the next live turn. Omitted when the message has no such rows. thinking is an optional array of AgentThinkingEntry on a completed assistant message: the agent_thinking text the live turn showed, one entry per model round in order, so a reload keeps the thinking in the turn's work trace. Omitted when the turn produced none. */ content?: { attachment_refs?: Array<{ @@ -7089,6 +7484,7 @@ export type AgentMessage = { name?: string [key: string]: unknown }> + thinking?: Array tool_calls?: Array [key: string]: unknown } @@ -8311,6 +8707,25 @@ export type AgentListThreadsData = { * */ after?: string + /** + * Return only the threads currently associated with this workflow. + * The association is the thread's current target and may change on a + * later turn. `workflow_id` is not unique across threads, so this can + * still match several, and the page ordering is unchanged + * (newest-created first). + * + * Use this rather than listing threads and matching `workflow_id` + * client-side: an unfiltered list is one page of at most 100, so a + * client-side match silently misses a workflow's thread once the + * caller has more threads than the page holds. A workflow with no + * threads returns an empty page, not an error. + * + * Narrowing applies within the caller's own workspace and user scope + * and cannot widen it. `total` in the response counts the narrowed + * set. + * + */ + workflow_id?: string } url: '/api/agent/threads' } @@ -8809,7 +9224,7 @@ export type CreateAssetData = { */ preview_id?: string /** - * JSON-encoded array of freeform tag strings, e.g. '["models","checkpoint"]'. Common types include "models", "input", "output", and "temp", but any tag can be used in any order. + * JSON-encoded array of freeform tag strings, e.g. '["models","checkpoint"]'. Common types include "models", "input", "output", and "temp", but any tag can be used in any order. At most 64 tags, each a non-empty UTF-8 string of at most 256 bytes (surrounding whitespace included) with no NUL; a request breaking either rule is refused with 400 `INVALID_BODY`. JSON decoding replaces invalid UTF-8 and lone surrogate escapes (e.g. `�`) with U+FFFD (3 bytes each) instead of refusing them, and the 256-byte limit applies to the replaced value. */ tags?: string /** @@ -9160,7 +9575,7 @@ export type RemoveAssetTagsResponse = export type AddAssetTagsData = { body: { /** - * Tags to add to the asset + * Tags to add to the asset. At most 64 tags, each a non-empty UTF-8 string of at most 256 bytes (surrounding whitespace included) with no NUL; a request breaking either rule is refused with 400 `INVALID_BODY`. An add that would grow the asset's stored set (server-added tags included) past 64 is refused the same way; an asset already over 64 is not trimmed and can still re-apply its stored non-category tags that add no new server-derived tag (`input`, `output`, `temp` and `models` are refused with 422 `RESERVED_TAG` before any count check; re-applying a legacy bare model-directory tag whose `model_type:` twin is not stored adds that twin, so it counts as growth). The counted set is the stored one, which the response's `total_tags` need not equal, as it hides stored `model_type:` tags or shows synthesized ones, depending on the deployment. JSON decoding replaces invalid UTF-8 and lone surrogate escapes (e.g. `�`) with U+FFFD (3 bytes each) instead of refusing them, and the 256-byte limit applies to the replaced value. */ tags: Array } @@ -9224,7 +9639,7 @@ export type CreateAssetDownloadData = { */ source_url: string /** - * Optional tags for the asset (e.g., ["model", "checkpoint"]) + * Optional tags for the asset (e.g., ["model", "checkpoint"]). At most 64 tags, each a non-empty UTF-8 string of at most 256 bytes (surrounding whitespace included) with no NUL; a request breaking either rule is refused with 400 `INVALID_BODY`. JSON decoding replaces invalid UTF-8 and lone surrogate escapes (e.g. `�`) with U+FFFD (3 bytes each) instead of refusing them, and the 256-byte limit applies to the replaced value. */ tags?: Array /** @@ -9416,7 +9831,7 @@ export type CreateAssetFromHashData = { */ name?: string /** - * Freeform tags for the asset. Common types include "models", "input", "output", and "temp", but any tag can be used in any order. + * Freeform tags for the asset. Common types include "models", "input", "output", and "temp", but any tag can be used in any order. At most 64 tags, each a non-empty UTF-8 string of at most 256 bytes (surrounding whitespace included) with no NUL; a request breaking either rule is refused with 400 `INVALID_BODY`. JSON decoding replaces invalid UTF-8 and lone surrogate escapes (e.g. `�`) with U+FFFD (3 bytes each) instead of refusing them, and the 256-byte limit applies to the replaced value. */ tags: Array /** @@ -10647,7 +11062,7 @@ export type GetBillingEventsData = { */ user_id?: string /** - * Keep only charges made through this source: `session`, `deployment`, or an API key's display prefix (`comfyui-` plus eight hex characters) as the usage `source` grouping returns it. Combines with `scope`, so a member sees only their own charges through it. Any other value is a 400 `INVALID_FILTER`. + * Keep only charges made through this source: `session`; one deployment's id or one API key's display prefix (`comfyui-` plus eight hex characters), as the usage `source` grouping returns them; or every source of a kind, `deployment` for every deployment and `api_key` for every API key. Combines with `scope`, so a member sees only their own charges through it. Any other value is a 400 `INVALID_FILTER`. */ spend_source?: string /** @@ -11505,20 +11920,16 @@ export type GetTopupCheckoutResponses = { export type GetTopupCheckoutResponse = GetTopupCheckoutResponses[keyof GetTopupCheckoutResponses] -export type CreateTopupQuoteData = { - body: CreateTopupQuoteRequest +export type CreateInteractiveTopupData = { + body: InteractiveTopupRequest path?: never query?: never - url: '/api/billing/topup/quote' + url: '/api/billing/topup/interactive' } -export type CreateTopupQuoteErrors = { +export type CreateInteractiveTopupErrors = { /** - * Refused: `INVALID_REQUEST`, `INVALID_AMOUNT`, - * `LEGACY_STRIPE_CHECKOUT_REQUIRED` (use Stripe Checkout), - * `BILLING_PLAN_ENDED` (retained code for unresolved existing plan/tier/status), or - * `BILLING_DISABLED`. - * + * Bad request (invalid amount, no payment method) */ 400: ErrorResponse /** @@ -11529,32 +11940,87 @@ export type CreateTopupQuoteErrors = { * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. */ 403: ForbiddenError + /** + * Immutable request mismatch, another pending operation, or billing reconciliation required. Do not start another purchase while unresolved. + */ + 409: ErrorResponse + /** + * Request body exceeds the 16 KiB resource limit. + */ + 413: unknown /** * Internal server error */ 500: ErrorResponse + /** + * Interactive route unavailable or payment/workflow state unknown. Preserve the original request, key and operation; no fallback purchase. + */ + 503: ErrorResponse } -export type CreateTopupQuoteError = - CreateTopupQuoteErrors[keyof CreateTopupQuoteErrors] +export type CreateInteractiveTopupError = + CreateInteractiveTopupErrors[keyof CreateInteractiveTopupErrors] -export type CreateTopupQuoteResponses = { +export type CreateInteractiveTopupResponses = { /** - * Top-up quote + * Top-up initiated successfully */ - 200: TopupQuoteResponse + 200: CreateTopupResponse } -export type CreateTopupQuoteResponse = - CreateTopupQuoteResponses[keyof CreateTopupQuoteResponses] +export type CreateInteractiveTopupResponse = + CreateInteractiveTopupResponses[keyof CreateInteractiveTopupResponses] -export type GetBillingUsageTimeSeriesData = { - body?: never +export type CreateTopupQuoteData = { + body: CreateTopupQuoteRequest path?: never - query?: { - /** - * `product_line` folds products into the customer-facing lines (Agent, - * Third-Party Partner API, Comfy Cloud, Serverless) plus an + query?: never + url: '/api/billing/topup/quote' +} + +export type CreateTopupQuoteErrors = { + /** + * Refused: `INVALID_REQUEST`, `INVALID_AMOUNT`, + * `LEGACY_STRIPE_CHECKOUT_REQUIRED` (use Stripe Checkout), + * `BILLING_PLAN_ENDED` (retained code for unresolved existing plan/tier/status), or + * `BILLING_DISABLED`. + * + */ + 400: ErrorResponse + /** + * Unauthorized + */ + 401: ErrorResponse + /** + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + */ + 403: ForbiddenError + /** + * Internal server error + */ + 500: ErrorResponse +} + +export type CreateTopupQuoteError = + CreateTopupQuoteErrors[keyof CreateTopupQuoteErrors] + +export type CreateTopupQuoteResponses = { + /** + * Top-up quote + */ + 200: TopupQuoteResponse +} + +export type CreateTopupQuoteResponse = + CreateTopupQuoteResponses[keyof CreateTopupQuoteResponses] + +export type GetBillingUsageTimeSeriesData = { + body?: never + path?: never + query?: { + /** + * `product_line` folds products into the customer-facing lines (Agent, + * Partner Models, Comfy Cloud, Serverless) plus an * `unattributed` bucket that is always counted in the total. * `person` and `source` attribute spend to the member or to the API * key (`spend_source`) that caused it, read from the usage ledger @@ -11604,7 +12070,7 @@ export type GetBillingUsageTimeSeriesData = { */ filter_person?: string /** - * Keep only spend from this source (a key the `source` grouping returns, or `unattributed`). See `filter_product_line`. + * Keep only spend from this source (a key the `source` grouping returns, or `unattributed`), or every source of one kind (`api_key` for every API key, `deployment` for every deployment). See `filter_product_line`. */ filter_source?: string granularity?: 'hour' | 'day' | 'month' @@ -11666,6 +12132,121 @@ export type GetDefaultWorkflowResponses = { export type GetDefaultWorkflowResponse = GetDefaultWorkflowResponses[keyof GetDefaultWorkflowResponses] +export type CreateDeployBundleData = { + /** + * A JSON object; `{}` is valid. Null members count as absent. + */ + body: { + /** + * Optional label for the bundle. + */ + name?: string | null + /** + * The workflow open in ComfyUI, sent as is. + */ + workflow?: { + [key: string]: unknown + } | null + } + path?: never + query?: never + url: '/api/deploy/bundle' +} + +export type CreateDeployBundleErrors = { + /** + * Rejected before upload: `multiple_credentials` (both headers sent), `invalid_api_key_format` (X-API-Key is not comfyui- followed by 64 hex characters) or `invalid_body` (not a JSON object, or a bad workflow or name). + */ + 400: DeployToCloudError + /** + * `missing_credentials` (no credential sent) or `unauthorized` (the builder refused the credential). + */ + 401: DeployToCloudError + /** + * `offline` (the server runs with --offline) or `unauthorized` (the builder refused the credential). + */ + 403: DeployToCloudError + /** + * The bundle exceeds the builder's size cap (`too_large`). + */ + 413: DeployToCloudError + /** + * The user already holds the builder's limit of unexpired bundles in this workspace (`too_many_bundles`); clears as older bundles expire. + */ + 429: DeployToCloudError + /** + * `builder_rejected` (the builder refused the bundle as invalid; `message` carries its reason, at most 500 characters) or `builder_unavailable` (the builder could not be reached or answered unexpectedly). + */ + 502: DeployToCloudError + /** + * The builder is busy (`builder_busy`); retry after Retry-After seconds when present. + */ + 503: DeployToCloudError +} + +export type CreateDeployBundleError = + CreateDeployBundleErrors[keyof CreateDeployBundleErrors] + +export type CreateDeployBundleResponses = { + /** + * Bundle stored on comfy-builder + */ + 200: { + bundle_id: string + /** + * When the bundle stops being readable (24 hours after creation). + */ + expires_at: string + /** + * The Create a Build wizard link that opens the bundle (/profile/builds/new?step=import&bundle=&workspace=&bundle_workspace=). + */ + url: string + /** + * The workspace the bundle belongs to (the credential's). + */ + workspace_id: string + } +} + +export type CreateDeployBundleResponse = + CreateDeployBundleResponses[keyof CreateDeployBundleResponses] + +export type GetDeploySummaryData = { + body?: never + path?: never + query?: never + url: '/api/deploy/summary' +} + +export type GetDeploySummaryErrors = { + /** + * The server runs with --offline (error `offline`) + */ + 403: DeployToCloudError +} + +export type GetDeploySummaryError = + GetDeploySummaryErrors[keyof GetDeploySummaryErrors] + +export type GetDeploySummaryResponses = { + /** + * Counts of what the bundle would include + */ + 200: { + /** + * Custom node packages found in the custom_nodes folders + */ + custom_nodes: number + /** + * Model files found across the model folders + */ + models: number + } +} + +export type GetDeploySummaryResponse = + GetDeploySummaryResponses[keyof GetDeploySummaryResponses] + export type GetEmbeddingsData = { body?: never path?: never @@ -11949,6 +12530,10 @@ export type GetFeaturesResponses = { * Because absence carries that meaning, the field is only ever the authority's answer: unlike the flags beside it, it cannot be set from dynamic configuration, and it is removed from the response rather than left at a configured value when it is unresolvable. It is likewise absent from the WebSocket feature_flags push, which resolves no capability, so a client refreshing from the socket reads "unknown" and fails open rather than inheriting a stale answer. */ can_run_partner_nodes?: boolean + /** + * Local ComfyUI only: whether the UI should offer Deploy to Cloud. True when the server is not --offline and this installation has ever had a prompt queued by a non-browser client (a persistent marker in the user directory). A discovery hint only: it grants nothing, and the /api/deploy* routes do not check it. Not settable with --feature-flag. + */ + deploy_to_cloud?: boolean /** * Free-tier job allowance for an authenticated non-paid (FREE-tier) user in the rollout. Absent for paid users and unauthenticated requests. Synthesized from config before a grant row exists so a brand-new user still sees their full allowance. */ @@ -14723,6 +15308,10 @@ export type UploadImageErrors = { * Internal server error */ 500: ErrorResponse + /** + * Upload buffer budget exhausted on this pod; retry after the Retry-After seconds. `code` is `UPLOAD_BUDGET_EXHAUSTED`. + */ + 503: ErrorResponse } export type UploadImageError = UploadImageErrors[keyof UploadImageErrors] @@ -14783,6 +15372,10 @@ export type UploadMaskErrors = { * Internal server error */ 500: ErrorResponse + /** + * Upload buffer budget exhausted on this pod; retry after the Retry-After seconds. `code` is `UPLOAD_BUDGET_EXHAUSTED`. + */ + 503: ErrorResponse } export type UploadMaskError = UploadMaskErrors[keyof UploadMaskErrors] @@ -14828,7 +15421,7 @@ export type UploadGrantPutErrors = { */ 404: unknown /** - * Body exceeds the per-purpose size cap + * Body exceeds the per-purpose size cap, or is more than the pod's upload memory budget could ever buffer */ 413: unknown /** @@ -14840,7 +15433,7 @@ export type UploadGrantPutErrors = { */ 500: unknown /** - * Uploads temporarily unavailable (grant store not reachable) + * Uploads temporarily unavailable (grant store not reachable, `code` SERVICE_UNAVAILABLE), or upload buffer budget exhausted on this pod; retry after the Retry-After seconds (`code` UPLOAD_BUDGET_EXHAUSTED). */ 503: unknown } @@ -15165,6 +15758,54 @@ export type MoveUserdataFileResponses = { export type MoveUserdataFileResponse = MoveUserdataFileResponses[keyof MoveUserdataFileResponses] +export type DeleteUserdataFilePublishData = { + body?: never + path: { + /** + * The workflow file path within the user's data directory (URL encoded if necessary). + */ + file: string + } + query?: never + url: '/api/userdata/{file}/publish' +} + +export type DeleteUserdataFilePublishErrors = { + /** + * `code` is `workspace_id_invalid`: the `X-Comfy-Workspace-ID` header or `workspace_id` query value is malformed, or conflicts with another value or with the workspace the credential resolves to. Answered only while `web_session_enabled` is on for the user. See the `WebSessionAuth` scheme. + */ + 400: ErrorResponse + /** + * Unauthorized + */ + 401: ErrorResponse + /** + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + */ + 403: ForbiddenError + /** + * Workflow or share not found + */ + 404: ErrorResponse + /** + * Internal server error + */ + 500: ErrorResponse +} + +export type DeleteUserdataFilePublishError = + DeleteUserdataFilePublishErrors[keyof DeleteUserdataFilePublishErrors] + +export type DeleteUserdataFilePublishResponses = { + /** + * Share revoked + */ + 204: void +} + +export type DeleteUserdataFilePublishResponse = + DeleteUserdataFilePublishResponses[keyof DeleteUserdataFilePublishResponses] + export type GetUserdataFilePublishData = { body?: never path: { @@ -15304,6 +15945,1363 @@ export type GetUsersInfoResponses = { export type GetUsersInfoResponse = GetUsersInfoResponses[keyof GetUsersInfoResponses] +export type GetCatalogAgentInstructionsData = { + body?: never + path?: never + query?: never + url: '/api/v1/catalog/agents' +} + +export type GetCatalogAgentInstructionsErrors = { + /** + * Catalog disabled or unavailable + */ + 503: unknown +} + +export type GetCatalogAgentInstructionsResponses = { + /** + * Editing instructions from this deployed catalog API build + */ + 200: string +} + +export type GetCatalogAgentInstructionsResponse = + GetCatalogAgentInstructionsResponses[keyof GetCatalogAgentInstructionsResponses] + +export type GetCccAuthoringContextData = { + body?: never + path?: never + query?: never + url: '/api/v1/catalog/authoring-context' +} + +export type GetCccAuthoringContextErrors = { + /** + * Unsupported query parameters; or `code` `workspace_id_invalid` (see SessionWorkspaceIDInvalid). + */ + 400: ErrorResponse + /** + * No valid credential, or an `Authorization` header, `X-API-Key` header or `?token=` next to the session cookie that could not be read, which is refused rather than answered with the session. `code` is `UNAUTHORIZED`. + */ + 401: ErrorResponse + /** + * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. On `GET /api/billing/churnkey/auth`, `NOT_ORIGINAL_OWNER` means the caller is not the workspace's creator; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. + */ + 403: ForbiddenError + /** + * Dedicated catalog unavailable + */ + 503: unknown +} + +export type GetCccAuthoringContextError = + GetCccAuthoringContextErrors[keyof GetCccAuthoringContextErrors] + +export type GetCccAuthoringContextResponses = { + /** + * Current verified authoring context; private no-store + */ + 200: CccAuthoringContext +} + +export type GetCccAuthoringContextResponse = + GetCccAuthoringContextResponses[keyof GetCccAuthoringContextResponses] + +export type ListCccWebsiteCardsData = { + body?: never + path?: never + query: { + kind: 'MODEL' | 'WORKFLOW' | 'APP' + limit?: number + cursor?: string + locale?: 'en' | 'zh-CN' + q?: string + sort?: 'popular' | 'name' | 'priceAsc' | 'priceDesc' + category?: Array + model?: Array + use?: Array + modality?: Array + provider?: Array + capability?: Array + } + url: '/api/v1/catalog/cards' +} + +export type ListCccWebsiteCardsErrors = { + /** + * Invalid or unsupported query or cursor + */ + 400: unknown + /** + * Verified staff permission required for Preview + */ + 403: unknown + /** + * Cursor selection changed or expired; restart from first page + */ + 409: unknown + /** + * Catalog unavailable or card budget exceeded + */ + 503: unknown +} + +export type ListCccWebsiteCardsResponses = { + /** + * At most 24 card summaries; no graphs, inputs, examples or long bodies. Anonymous responses omit total, generation and facet counts. Cursors are audience, filter, clock and state bound and expire after five minutes. + */ + 200: CccWebsiteCardsPage +} + +export type ListCccWebsiteCardsResponse = + ListCccWebsiteCardsResponses[keyof ListCccWebsiteCardsResponses] + +export type GetCatalogDocsData = { + body?: never + path?: never + query?: never + url: '/api/v1/catalog/docs' +} + +export type GetCatalogDocsErrors = { + /** + * Catalog disabled or unavailable + */ + 503: unknown +} + +export type GetCatalogDocsResponses = { + /** + * Build-coupled catalog instructions, permissions and endpoint contracts + */ + 200: string +} + +export type GetCatalogDocsResponse = + GetCatalogDocsResponses[keyof GetCatalogDocsResponses] + +export type BatchCccItemsData = { + body: { + expected_draft_rev: number + items: Array + } + headers: { + 'Idempotency-Key': string + } + path?: never + query?: never + url: '/api/v1/catalog/draft/batch' +} + +export type BatchCccItemsErrors = { + /** + * Structured validation failure with item field paths + */ + 400: Cccjson + /** + * No valid credential, or an `Authorization` header, `X-API-Key` header or `?token=` next to the session cookie that could not be read, which is refused rather than answered with the session. `code` is `UNAUTHORIZED`. + */ + 401: ErrorResponse + /** + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + */ + 403: ForbiddenError + /** + * Existing target absent from owner-scoped Draft + */ + 404: unknown + /** + * Stale Draft/edit token or idempotency mismatch + */ + 409: unknown + /** + * Dedicated catalog unavailable + */ + 503: unknown +} + +export type BatchCccItemsError = BatchCccItemsErrors[keyof BatchCccItemsErrors] + +export type BatchCccItemsResponses = { + /** + * Flat immutable edits in request order; retry returns identical UIDs/tokens + */ + 200: Array +} + +export type BatchCccItemsResponse = + BatchCccItemsResponses[keyof BatchCccItemsResponses] + +export type DiscardCccChangesData = { + body: Cccjson + headers: { + 'Idempotency-Key': string + } + path?: never + query?: never + url: '/api/v1/catalog/draft/discard-changes' +} + +export type DiscardCccChangesErrors = { + /** + * `code` is `workspace_id_invalid`: the `X-Comfy-Workspace-ID` header or `workspace_id` query value is malformed, or conflicts with another value or with the workspace the credential resolves to. Answered only while `web_session_enabled` is on for the user. See the `WebSessionAuth` scheme. + */ + 400: ErrorResponse + /** + * No valid credential, or an `Authorization` header, `X-API-Key` header or `?token=` next to the session cookie that could not be read, which is refused rather than answered with the session. `code` is `UNAUTHORIZED`. + */ + 401: ErrorResponse + /** + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + */ + 403: ForbiddenError + /** + * Stale state/selection/exact version or idempotency mismatch; no partial discard + */ + 409: unknown + /** + * Invalid confirmed selection or remaining Draft dependency/pin conflict; no partial discard + */ + 422: Cccjson + /** + * Catalog unavailable + */ + 503: unknown +} + +export type DiscardCccChangesError = + DiscardCccChangesErrors[keyof DiscardCccChangesErrors] + +export type DiscardCccChangesResponses = { + /** + * Updated complete unfiltered private staging snapshot and global unresolved_count + */ + 200: Cccjson +} + +export type DiscardCccChangesResponse = + DiscardCccChangesResponses[keyof DiscardCccChangesResponses] + +export type GetCccFinalReviewData = { + body?: never + path?: never + query?: never + url: '/api/v1/catalog/draft/final-review' +} + +export type GetCccFinalReviewErrors = { + /** + * Unsupported query parameters; or `code` `workspace_id_invalid` (see SessionWorkspaceIDInvalid). + */ + 400: ErrorResponse + /** + * No valid credential, or an `Authorization` header, `X-API-Key` header or `?token=` next to the session cookie that could not be read, which is refused rather than answered with the session. `code` is `UNAUTHORIZED`. + */ + 401: ErrorResponse + /** + * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. On `GET /api/billing/churnkey/auth`, `NOT_ORIGINAL_OWNER` means the caller is not the workspace's creator; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. + */ + 403: ForbiddenError + /** + * Unreviewed work, no approved changes, or invalid selective candidate + */ + 422: unknown + /** + * Dedicated catalog unavailable + */ + 503: unknown +} + +export type GetCccFinalReviewError = + GetCccFinalReviewErrors[keyof GetCccFinalReviewErrors] + +export type GetCccFinalReviewResponses = { + /** + * Private exact approved changes, deferred work, state and selection digest + */ + 200: Cccjson +} + +export type GetCccFinalReviewResponse = + GetCccFinalReviewResponses[keyof GetCccFinalReviewResponses] + +export type ReviewCccCheckedPublicationData = { + body: Cccjson + path?: never + query?: never + url: '/api/v1/catalog/draft/final-review' +} + +export type ReviewCccCheckedPublicationErrors = { + /** + * Unsupported query parameters; or `code` `workspace_id_invalid` (see SessionWorkspaceIDInvalid). + */ + 400: ErrorResponse + /** + * No valid credential, or an `Authorization` header, `X-API-Key` header or `?token=` next to the session cookie that could not be read, which is refused rather than answered with the session. `code` is `UNAUTHORIZED`. + */ + 401: ErrorResponse + /** + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + */ + 403: ForbiddenError + /** + * Stale reviewed state or selected item no longer pending + */ + 409: unknown + /** + * Invalid explicit selection or candidate dependencies; bounded field_errors include the affected resource_uid when known + */ + 422: Cccjson + /** + * Dedicated catalog unavailable + */ + 503: unknown +} + +export type ReviewCccCheckedPublicationError = + ReviewCccCheckedPublicationErrors[keyof ReviewCccCheckedPublicationErrors] + +export type ReviewCccCheckedPublicationResponses = { + /** + * Exact checked changes and unchecked private work with state and selection digest + */ + 200: Cccjson +} + +export type ReviewCccCheckedPublicationResponse = + ReviewCccCheckedPublicationResponses[keyof ReviewCccCheckedPublicationResponses] + +export type ReviewCccCheckedReceiptData = { + body: Cccjson + path?: never + query?: never + url: '/api/v1/catalog/draft/final-review/receipt' +} + +export type ReviewCccCheckedReceiptErrors = { + /** + * Unsupported query parameters; or `code` `workspace_id_invalid` (see SessionWorkspaceIDInvalid). + */ + 400: ErrorResponse + /** + * No valid credential, or an `Authorization` header, `X-API-Key` header or `?token=` next to the session cookie that could not be read, which is refused rather than answered with the session. `code` is `UNAUTHORIZED`. + */ + 401: ErrorResponse + /** + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + */ + 403: ForbiddenError + /** + * Stale reviewed state or selected item no longer pending + */ + 409: unknown + /** + * Invalid explicit selection or candidate dependencies; bounded field_errors include affected resource_uid + */ + 422: Cccjson + /** + * Dedicated catalog unavailable + */ + 503: unknown +} + +export type ReviewCccCheckedReceiptError = + ReviewCccCheckedReceiptErrors[keyof ReviewCccCheckedReceiptErrors] + +export type ReviewCccCheckedReceiptResponses = { + /** + * Exact checked-version receipt after complete candidate validation + */ + 200: CccCheckedReviewReceipt +} + +export type ReviewCccCheckedReceiptResponse = + ReviewCccCheckedReceiptResponses[keyof ReviewCccCheckedReceiptResponses] + +export type CreateCccItemData = { + body: Cccjson + headers: { + 'Idempotency-Key': string + } + path?: never + query?: never + url: '/api/v1/catalog/draft/items' +} + +export type CreateCccItemErrors = { + /** + * Structured document or token validation errors + */ + 400: Cccjson + /** + * No valid credential, or an `Authorization` header, `X-API-Key` header or `?token=` next to the session cookie that could not be read, which is refused rather than answered with the session. `code` is `UNAUTHORIZED`. + */ + 401: ErrorResponse + /** + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + */ + 403: ForbiddenError + /** + * Stale Draft/edit token or idempotency payload mismatch + */ + 409: unknown + /** + * Dedicated catalog unavailable + */ + 503: unknown +} + +export type CreateCccItemError = CreateCccItemErrors[keyof CreateCccItemErrors] + +export type CreateCccItemResponses = { + /** + * Flat immutable Content edit with exact concurrency tokens + */ + 201: Cccjson +} + +export type CreateCccItemResponse = + CreateCccItemResponses[keyof CreateCccItemResponses] + +export type DeleteCccItemData = { + body: { + expected_draft_rev: number + expected_revision_uid: string + } + headers: { + 'Idempotency-Key': string + } + path: { + uid: string + } + query?: never + url: '/api/v1/catalog/draft/items/{uid}' +} + +export type DeleteCccItemErrors = { + /** + * Invalid tokens; generic Media mutation refused + */ + 400: Cccjson + /** + * No valid credential, or an `Authorization` header, `X-API-Key` header or `?token=` next to the session cookie that could not be read, which is refused rather than answered with the session. `code` is `UNAUTHORIZED`. + */ + 401: ErrorResponse + /** + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + */ + 403: ForbiddenError + /** + * Resource absent from owner-scoped Draft + */ + 404: unknown + /** + * Stale Draft/edit token or idempotency mismatch + */ + 409: unknown + /** + * Dedicated catalog unavailable + */ + 503: unknown +} + +export type DeleteCccItemError = DeleteCccItemErrors[keyof DeleteCccItemErrors] + +export type DeleteCccItemResponses = { + /** + * Flat retained Content with is_deleted=true and new exact edit token + */ + 200: Cccjson +} + +export type DeleteCccItemResponse = + DeleteCccItemResponses[keyof DeleteCccItemResponses] + +export type GetCccDraftItemData = { + body?: never + path: { + uid: string + } + query?: never + url: '/api/v1/catalog/draft/items/{uid}' +} + +export type GetCccDraftItemErrors = { + /** + * Invalid UID or unsupported query parameters; or `code` `workspace_id_invalid` (see SessionWorkspaceIDInvalid). + */ + 400: ErrorResponse + /** + * No valid credential, or an `Authorization` header, `X-API-Key` header or `?token=` next to the session cookie that could not be read, which is refused rather than answered with the session. `code` is `UNAUTHORIZED`. + */ + 401: ErrorResponse + /** + * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. On `GET /api/billing/churnkey/auth`, `NOT_ORIGINAL_OWNER` means the caller is not the workspace's creator; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. + */ + 403: ForbiddenError + /** + * Resource missing or outside canonical owner scope + */ + 404: unknown + /** + * Dedicated catalog unavailable + */ + 503: unknown +} + +export type GetCccDraftItemError = + GetCccDraftItemErrors[keyof GetCccDraftItemErrors] + +export type GetCccDraftItemResponses = { + /** + * Current complete authored JSON with exact working-save tokens and read-only metadata + */ + 200: Cccjson +} + +export type GetCccDraftItemResponse = + GetCccDraftItemResponses[keyof GetCccDraftItemResponses] + +export type ReplaceCccItemData = { + body: Cccjson + headers: { + 'Idempotency-Key': string + } + path: { + uid: string + } + query?: never + url: '/api/v1/catalog/draft/items/{uid}' +} + +export type ReplaceCccItemErrors = { + /** + * Structured document or token validation errors + */ + 400: Cccjson + /** + * No valid credential, or an `Authorization` header, `X-API-Key` header or `?token=` next to the session cookie that could not be read, which is refused rather than answered with the session. `code` is `UNAUTHORIZED`. + */ + 401: ErrorResponse + /** + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + */ + 403: ForbiddenError + /** + * Resource not found in the selected Draft/owner scope + */ + 404: unknown + /** + * Stale Draft/edit token or idempotency payload mismatch + */ + 409: unknown + /** + * Dedicated catalog unavailable + */ + 503: unknown +} + +export type ReplaceCccItemError = + ReplaceCccItemErrors[keyof ReplaceCccItemErrors] + +export type ReplaceCccItemResponses = { + /** + * New immutable edit; owner stays fixed, author attribution is versioned and saved_by_uid records the actual editor + */ + 200: Cccjson +} + +export type ReplaceCccItemResponse = + ReplaceCccItemResponses[keyof ReplaceCccItemResponses] + +export type RestoreCccItemVersionData = { + body: { + expected_draft_rev: number + expected_revision_uid: string + source_revision_uid: string + } + headers: { + 'Idempotency-Key': string + } + path: { + uid: string + } + query?: never + url: '/api/v1/catalog/draft/items/{uid}/restore' +} + +export type RestoreCccItemVersionErrors = { + /** + * Invalid tokens or unsupported historical schema + */ + 400: Cccjson + /** + * No valid credential, or an `Authorization` header, `X-API-Key` header or `?token=` next to the session cookie that could not be read, which is refused rather than answered with the session. `code` is `UNAUTHORIZED`. + */ + 401: ErrorResponse + /** + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + */ + 403: ForbiddenError + /** + * Current or source edit not found in the target UID/owner scope + */ + 404: unknown + /** + * Stale Draft/edit token or idempotency mismatch + */ + 409: unknown + /** + * Dedicated catalog unavailable + */ + 503: unknown +} + +export type RestoreCccItemVersionError = + RestoreCccItemVersionErrors[keyof RestoreCccItemVersionErrors] + +export type RestoreCccItemVersionResponses = { + /** + * New immutable forward Draft save and exact concurrency tokens + */ + 200: Cccjson +} + +export type RestoreCccItemVersionResponse = + RestoreCccItemVersionResponses[keyof RestoreCccItemVersionResponses] + +export type UploadCccMediaData = { + body: { + /** + * Optional case-sensitive editorial batch label; not identity or approval. + */ + change_id?: string + expected_draft_rev: number + file: Blob | File + /** + * Safe contextual filename/path; normally entity-slug/filename. + */ + name: string + originating_entity_uid: string + role: string + } + headers: { + 'Idempotency-Key': string + } + path?: never + query?: never + url: '/api/v1/catalog/draft/media' +} + +export type UploadCccMediaErrors = { + /** + * Malformed multipart request; or `code` `workspace_id_invalid` (see SessionWorkspaceIDInvalid). + */ + 400: ErrorResponse + /** + * No valid credential, or an `Authorization` header, `X-API-Key` header or `?token=` next to the session cookie that could not be read, which is refused rather than answered with the session. `code` is `UNAUTHORIZED`. + */ + 401: ErrorResponse + /** + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + */ + 403: ForbiddenError + /** + * Origin is absent or outside owner scope + */ + 404: unknown + /** + * Stale Draft or reused retry key with different input + */ + 409: unknown + /** + * Request body exceeds bounded upload envelope + */ + 413: unknown + /** + * Invalid fields or unsupported/unsafe bytes + */ + 422: Cccjson + /** + * Private storage or dedicated catalog unavailable + */ + 503: unknown +} + +export type UploadCccMediaError = + UploadCccMediaErrors[keyof UploadCccMediaErrors] + +export type UploadCccMediaResponses = { + /** + * Private verified media metadata and exact Draft/edit tokens; bytes remain unreleased + */ + 201: Cccjson +} + +export type UploadCccMediaResponse = + UploadCccMediaResponses[keyof UploadCccMediaResponses] + +export type DeleteCccMediaData = { + body: Cccjson + headers: { + 'Idempotency-Key': string + } + path: { + uid: string + } + query?: never + url: '/api/v1/catalog/draft/media/{uid}' +} + +export type DeleteCccMediaErrors = { + /** + * `code` is `workspace_id_invalid`: the `X-Comfy-Workspace-ID` header or `workspace_id` query value is malformed, or conflicts with another value or with the workspace the credential resolves to. Answered only while `web_session_enabled` is on for the user. See the `WebSessionAuth` scheme. + */ + 400: ErrorResponse + /** + * No valid credential, or an `Authorization` header, `X-API-Key` header or `?token=` next to the session cookie that could not be read, which is refused rather than answered with the session. `code` is `UNAUTHORIZED`. + */ + 401: ErrorResponse + /** + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + */ + 403: ForbiddenError + /** + * Logical media is absent or outside owner scope + */ + 404: unknown + /** + * Stale Draft/edit token or retry mismatch + */ + 409: unknown + /** + * Invalid exact edit tokens or non-Media target + */ + 422: Cccjson + /** + * Dedicated catalog unavailable + */ + 503: unknown +} + +export type DeleteCccMediaError = + DeleteCccMediaErrors[keyof DeleteCccMediaErrors] + +export type DeleteCccMediaResponses = { + /** + * New tombstone version and Draft generation; history bytes retained + */ + 200: Cccjson +} + +export type DeleteCccMediaResponse = + DeleteCccMediaResponses[keyof DeleteCccMediaResponses] + +export type ReplaceCccMediaFileData = { + body: { + /** + * Optional case-sensitive editorial batch label; not identity or approval. + */ + change_id?: string + expected_draft_rev: number + expected_revision_uid: string + file: Blob | File + name: string + } + headers: { + 'Idempotency-Key': string + } + path: { + uid: string + } + query?: never + url: '/api/v1/catalog/draft/media/{uid}/file' +} + +export type ReplaceCccMediaFileErrors = { + /** + * Malformed multipart request; or `code` `workspace_id_invalid` (see SessionWorkspaceIDInvalid). + */ + 400: ErrorResponse + /** + * No valid credential, or an `Authorization` header, `X-API-Key` header or `?token=` next to the session cookie that could not be read, which is refused rather than answered with the session. `code` is `UNAUTHORIZED`. + */ + 401: ErrorResponse + /** + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + */ + 403: ForbiddenError + /** + * Logical media is absent or outside owner scope + */ + 404: unknown + /** + * Stale Draft/edit token or retry mismatch + */ + 409: unknown + /** + * Request body exceeds bounded upload envelope + */ + 413: unknown + /** + * Invalid fields or unsupported/unsafe bytes + */ + 422: Cccjson + /** + * Private storage or dedicated catalog unavailable + */ + 503: unknown +} + +export type ReplaceCccMediaFileError = + ReplaceCccMediaFileErrors[keyof ReplaceCccMediaFileErrors] + +export type ReplaceCccMediaFileResponses = { + /** + * New immutable Draft file-version metadata under the same media UID + */ + 200: Cccjson +} + +export type ReplaceCccMediaFileResponse = + ReplaceCccMediaFileResponses[keyof ReplaceCccMediaFileResponses] + +export type PublishCccDraftData = { + body: Cccjson + headers: { + 'Idempotency-Key': string + } + path?: never + query?: never + url: '/api/v1/catalog/draft/publish' +} + +export type PublishCccDraftErrors = { + /** + * Unsupported query parameters; or `code` `workspace_id_invalid` (see SessionWorkspaceIDInvalid). + */ + 400: ErrorResponse + /** + * No valid credential, or an `Authorization` header, `X-API-Key` header or `?token=` next to the session cookie that could not be read, which is refused rather than answered with the session. `code` is `UNAUTHORIZED`. + */ + 401: ErrorResponse + /** + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + */ + 403: ForbiddenError + /** + * Stale reviewed state or decisions or conflicting retry; nothing published + */ + 409: unknown + /** + * Invalid review, unfinished decisions or reference/dependency validation failed; nothing published. Bounded field_errors include the affected resource_uid when known. + */ + 422: Cccjson + /** + * Catalog unavailable + */ + 503: unknown +} + +export type PublishCccDraftError = + PublishCccDraftErrors[keyof PublishCccDraftErrors] + +export type PublishCccDraftResponses = { + /** + * New Live, previous Live and fresh Draft state after atomic commit + */ + 200: Cccjson +} + +export type PublishCccDraftResponse = + PublishCccDraftResponses[keyof PublishCccDraftResponses] + +export type GetCccStagingData = { + body?: never + path?: never + query?: { + search?: string + author_uid?: string + change_id?: string + tags?: Array + types?: Array<'model' | 'workflow' | 'app' | 'media' | 'template_set'> + statuses?: Array<'NEW' | 'APPROVED' | 'DEFERRED' | 'DELETED'> + } + url: '/api/v1/catalog/draft/staging' +} + +export type GetCccStagingErrors = { + /** + * Unknown, repeated scalar or invalid filter; bounded result exceeded; or `code` `workspace_id_invalid` (see SessionWorkspaceIDInvalid). + */ + 400: ErrorResponse + /** + * No valid credential, or an `Authorization` header, `X-API-Key` header or `?token=` next to the session cookie that could not be read, which is refused rather than answered with the session. `code` is `UNAUTHORIZED`. + */ + 401: ErrorResponse + /** + * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. On `GET /api/billing/churnkey/auth`, `NOT_ORIGINAL_OWNER` means the caller is not the workspace's creator; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. + */ + 403: ForbiddenError + /** + * Dedicated catalog unavailable + */ + 503: unknown +} + +export type GetCccStagingError = GetCccStagingErrors[keyof GetCccStagingErrors] + +export type GetCccStagingResponses = { + /** + * Private complete matching changes and exact Draft generation + */ + 200: Cccjson +} + +export type GetCccStagingResponse = + GetCccStagingResponses[keyof GetCccStagingResponses] + +export type StageCccChangesData = { + body: Cccjson + headers: { + 'Idempotency-Key': string + } + path?: never + query?: never + url: '/api/v1/catalog/draft/staging' +} + +export type StageCccChangesErrors = { + /** + * `code` is `workspace_id_invalid`: the `X-Comfy-Workspace-ID` header or `workspace_id` query value is malformed, or conflicts with another value or with the workspace the credential resolves to. Answered only while `web_session_enabled` is on for the user. See the `WebSessionAuth` scheme. + */ + 400: ErrorResponse + /** + * No valid credential, or an `Authorization` header, `X-API-Key` header or `?token=` next to the session cookie that could not be read, which is refused rather than answered with the session. `code` is `UNAUTHORIZED`. + */ + 401: ErrorResponse + /** + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + */ + 403: ForbiddenError + /** + * Stale review, changed matching count or conflicting retry + */ + 409: unknown + /** + * Invalid status/filter/tokens/count or missing unfiltered confirmation + */ + 422: unknown + /** + * Dedicated catalog unavailable + */ + 503: unknown +} + +export type StageCccChangesError = + StageCccChangesErrors[keyof StageCccChangesErrors] + +export type StageCccChangesResponses = { + /** + * Atomic matching-set decisions and updated private staging state + */ + 200: Cccjson +} + +export type StageCccChangesResponse = + StageCccChangesResponses[keyof StageCccChangesResponses] + +export type ListContentCatalogItemsData = { + body?: never + path?: never + query?: { + q?: string + slug?: string + kind?: 'MODEL' | 'WORKFLOW' | 'APP' + type?: 'model' | 'workflow' | 'app' | 'template_set' + surface?: + | 'hub' + | 'cloud_templates' + | 'local_templates' + | 'desktop_starters' + | 'nvidia_performance_tests' + tag?: string + use_case?: string + sort?: 'sort_order' | 'title' + limit?: number + cursor?: string + /** + * Compatibility detail lookup, exclusive with all other query parameters. Select at most one eligible record by canonical path, UID or website detail slug, expanding the verified primary API file for that workflow only. A miss returns an empty page, never the collection. Collection reads never open API blobs. kind is a legacy alias for type and cannot be combined with type; slug accepts a canonical Hub pathname or native slug. + */ + workflow_slug?: string + } + url: '/api/v1/catalog/items' +} + +export type ListContentCatalogItemsErrors = { + /** + * Invalid, repeated, unsupported or conflicting query parameters or malformed cursor + */ + 400: ErrorResponse + /** + * Cursor publication identity changed; restart from first page + */ + 409: ErrorResponse + /** + * Catalog disabled or unavailable + */ + 503: unknown +} + +export type ListContentCatalogItemsError = + ListContentCatalogItemsErrors[keyof ListContentCatalogItemsErrors] + +export type ListContentCatalogItemsResponses = { + /** + * Bounded LIVE page with continuation metadata + */ + 200: CccPublicItemsPage +} + +export type ListContentCatalogItemsResponse = + ListContentCatalogItemsResponses[keyof ListContentCatalogItemsResponses] + +export type GetContentCatalogItemData = { + body?: never + path: { + uid: string + } + query?: never + url: '/api/v1/catalog/items/{uid}' +} + +export type GetContentCatalogItemErrors = { + /** + * Not found or not publicly eligible + */ + 404: unknown + /** + * Catalog disabled or unavailable + */ + 503: unknown +} + +export type GetContentCatalogItemResponses = { + /** + * Website content record + */ + 200: ContentCatalogRecord +} + +export type GetContentCatalogItemResponse = + GetContentCatalogItemResponses[keyof GetContentCatalogItemResponses] + +export type GetCccItemHistoryData = { + body?: never + path: { + uid: string + } + query?: { + limit?: number + cursor?: string + } + url: '/api/v1/catalog/items/{uid}/history' +} + +export type GetCccItemHistoryErrors = { + /** + * Invalid limit, cursor or unsupported query parameter; or `code` `workspace_id_invalid` (see SessionWorkspaceIDInvalid). + */ + 400: ErrorResponse + /** + * No valid credential, or an `Authorization` header, `X-API-Key` header or `?token=` next to the session cookie that could not be read, which is refused rather than answered with the session. `code` is `UNAUTHORIZED`. + */ + 401: ErrorResponse + /** + * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. On `GET /api/billing/churnkey/auth`, `NOT_ORIGINAL_OWNER` means the caller is not the workspace's creator; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. + */ + 403: ForbiddenError + /** + * Resource outside organization scope or absent + */ + 404: unknown + /** + * Dedicated catalog unavailable + */ + 503: unknown +} + +export type GetCccItemHistoryError = + GetCccItemHistoryErrors[keyof GetCccItemHistoryErrors] + +export type GetCccItemHistoryResponses = { + /** + * Flat immutable items with catalog_status and saved_at, has_more and optional opaque next_cursor; no total + */ + 200: Cccjson +} + +export type GetCccItemHistoryResponse = + GetCccItemHistoryResponses[keyof GetCccItemHistoryResponses] + +export type GetCccPublicMediaBytesData = { + body?: never + path: { + uid: string + version: string + } + query?: never + url: '/api/v1/catalog/media/{uid}/{version}' +} + +export type GetCccPublicMediaBytesErrors = { + /** + * Missing or unverifiable authority, unpublished/scheduled/private, or unsupported HEAD/range/query + */ + 404: unknown +} + +export type GetCccPublicMediaBytesResponses = { + /** + * Exact current LIVE bytes; authority checked before byte access; no-store + */ + 200: Blob | File +} + +export type GetCccPublicMediaBytesResponse = + GetCccPublicMediaBytesResponses[keyof GetCccPublicMediaBytesResponses] + +export type HeadCccPublicMediaBytesData = { + body?: never + path: { + uid: string + version: string + } + query?: never + url: '/api/v1/catalog/media/{uid}/{version}' +} + +export type HeadCccPublicMediaBytesErrors = { + /** + * HEAD is unsupported; no-store with no bytes or redirects + */ + 404: unknown +} + +export type GetCatalogOpenApiData = { + body?: never + path?: never + query?: never + url: '/api/v1/catalog/openapi.json' +} + +export type GetCatalogOpenApiErrors = { + /** + * Catalog disabled or unavailable + */ + 503: unknown +} + +export type GetCatalogOpenApiResponses = { + /** + * Catalog OpenAPI with contract fingerprint and environment + */ + 200: Cccjson +} + +export type GetCatalogOpenApiResponse = + GetCatalogOpenApiResponses[keyof GetCatalogOpenApiResponses] + +export type GetCccPreviewMediaBytesData = { + body?: never + path: { + rev: number + uid: string + version: string + } + query?: never + url: '/api/v1/catalog/preview-media/{rev}/{uid}/{version}' +} + +export type GetCccPreviewMediaBytesErrors = { + /** + * `code` is `workspace_id_invalid`: the `X-Comfy-Workspace-ID` header or `workspace_id` query value is malformed, or conflicts with another value or with the workspace the credential resolves to. Answered only while `web_session_enabled` is on for the user. See the `WebSessionAuth` scheme. + */ + 400: ErrorResponse + /** + * No valid credential, or an `Authorization` header, `X-API-Key` header or `?token=` next to the session cookie that could not be read, which is refused rather than answered with the session. `code` is `UNAUTHORIZED`. + */ + 401: ErrorResponse + /** + * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. On `GET /api/billing/churnkey/auth`, `NOT_ORIGINAL_OWNER` means the caller is not the workspace's creator; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. + */ + 403: ForbiddenError + /** + * Unauthorized, unavailable, unselected, or unsupported HEAD/range/query + */ + 404: unknown +} + +export type GetCccPreviewMediaBytesError = + GetCccPreviewMediaBytesErrors[keyof GetCccPreviewMediaBytesErrors] + +export type GetCccPreviewMediaBytesResponses = { + /** + * Verified selected bytes; private no-store; no origin redirect + */ + 200: Blob | File +} + +export type GetCccPreviewMediaBytesResponse = + GetCccPreviewMediaBytesResponses[keyof GetCccPreviewMediaBytesResponses] + +export type HeadCccPreviewMediaBytesData = { + body?: never + path: { + rev: number + uid: string + version: string + } + query?: never + url: '/api/v1/catalog/preview-media/{rev}/{uid}/{version}' +} + +export type HeadCccPreviewMediaBytesErrors = { + /** + * Session workspace selector refused (workspace_id_invalid); no body on HEAD + */ + 400: unknown + /** + * No valid credential (see SessionUnauthorized); no body on HEAD + */ + 401: unknown + /** + * Refused (see SessionForbidden); no body on HEAD + */ + 403: unknown + /** + * HEAD is unsupported; private no-store with no bytes or redirects + */ + 404: unknown +} + +export type GetCccRevisionItemData = { + body?: never + path: { + rev: number + uid: string + } + query?: never + url: '/api/v1/catalog/revisions/{rev}/items/{uid}' +} + +export type GetCccRevisionItemErrors = { + /** + * `code` is `workspace_id_invalid`: the `X-Comfy-Workspace-ID` header or `workspace_id` query value is malformed, or conflicts with another value or with the workspace the credential resolves to. Answered only while `web_session_enabled` is on for the user. See the `WebSessionAuth` scheme. + */ + 400: ErrorResponse + /** + * No valid credential, or an `Authorization` header, `X-API-Key` header or `?token=` next to the session cookie that could not be read, which is refused rather than answered with the session. `code` is `UNAUTHORIZED`. + */ + 401: ErrorResponse + /** + * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. On `GET /api/billing/churnkey/auth`, `NOT_ORIGINAL_OWNER` means the caller is not the workspace's creator; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. + */ + 403: ForbiddenError + /** + * Resource/revision not found in organization scope + */ + 404: unknown + /** + * Dedicated catalog unavailable + */ + 503: unknown +} + +export type GetCccRevisionItemError = + GetCccRevisionItemErrors[keyof GetCccRevisionItemErrors] + +export type GetCccRevisionItemResponses = { + /** + * Flat Content and exact edit/revision context + */ + 200: Cccjson +} + +export type GetCccRevisionItemResponse = + GetCccRevisionItemResponses[keyof GetCccRevisionItemResponses] + +export type GetCccTypeSchemaData = { + body?: never + path: { + type: 'model' | 'workflow' | 'app' | 'template_set' | 'media' + schema_version: number + } + query?: never + url: '/api/v1/catalog/schemas/{type}/{schema_version}' +} + +export type GetCccTypeSchemaErrors = { + /** + * Unsupported type or schema version + */ + 404: unknown + /** + * Catalog disabled or unavailable + */ + 503: unknown +} + +export type GetCccTypeSchemaResponses = { + /** + * Build-coupled OpenAPI 3.0 schema object, type, version and API environment + */ + 200: Cccjson +} + +export type GetCccTypeSchemaResponse = + GetCccTypeSchemaResponses[keyof GetCccTypeSchemaResponses] + +export type GetCccStateData = { + body?: never + path?: never + query?: never + url: '/api/v1/catalog/state' +} + +export type GetCccStateErrors = { + /** + * `code` is `workspace_id_invalid`: the `X-Comfy-Workspace-ID` header or `workspace_id` query value is malformed, or conflicts with another value or with the workspace the credential resolves to. Answered only while `web_session_enabled` is on for the user. See the `WebSessionAuth` scheme. + */ + 400: ErrorResponse + /** + * No valid credential, or an `Authorization` header, `X-API-Key` header or `?token=` next to the session cookie that could not be read, which is refused rather than answered with the session. `code` is `UNAUTHORIZED`. + */ + 401: ErrorResponse + /** + * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. On `GET /api/billing/churnkey/auth`, `NOT_ORIGINAL_OWNER` means the caller is not the workspace's creator; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. + */ + 403: ForbiddenError + /** + * Dedicated catalog unavailable; no legacy fallback + */ + 503: unknown +} + +export type GetCccStateError = GetCccStateErrors[keyof GetCccStateErrors] + +export type GetCccStateResponses = { + /** + * Private state; never cacheable + */ + 200: Cccjson +} + +export type GetCccStateResponse = + GetCccStateResponses[keyof GetCccStateResponses] + export type GetLegacyUserdataV2Data = { body?: never path?: never diff --git a/packages/ingest-types/src/zod.gen.ts b/packages/ingest-types/src/zod.gen.ts index 94dedd46eca..aa494947f15 100644 --- a/packages/ingest-types/src/zod.gen.ts +++ b/packages/ingest-types/src/zod.gen.ts @@ -451,7 +451,22 @@ export const zTopupQuoteResponse = z.object({ .max(BigInt('9223372036854775807'), { error: 'Invalid value: Expected int64 to be <= 9223372036854775807' }), - expires_at: z.iso.datetime() + expires_at: z.iso.datetime(), + payment_method_configuration_id: z.string().optional() +}) + +/** + * Requested credit purchase from this operation's validated stored interactive top-up intent. Visible only to callers authorized for payment details. Not the amount charged or proof of payment. Omitted for historical, non-interactive, invalid or non-top-up operations. + * + */ +export const zTopUpPurchaseAmount = z.object({ + amount_cents: z.coerce + .bigint() + .gte(BigInt(1)) + .max(BigInt('9223372036854775807'), { + error: 'Invalid value: Expected int64 to be <= 9223372036854775807' + }), + currency: z.enum(['usd']) }) /** @@ -873,10 +888,54 @@ export const zDocUpdateFrame = z.object({ type: z.enum(['doc_update']) }) +export const zDocSubscribedData = z.object({ + code: z.string().optional(), + expected_seq: z.coerce + .bigint() + .min(BigInt('-9223372036854775808'), { + error: 'Invalid value: Expected int64 to be >= -9223372036854775808' + }) + .max(BigInt('9223372036854775807'), { + error: 'Invalid value: Expected int64 to be <= 9223372036854775807' + }) + .optional(), + lineage_seq: z.coerce + .bigint() + .min(BigInt('-9223372036854775808'), { + error: 'Invalid value: Expected int64 to be >= -9223372036854775808' + }) + .max(BigInt('9223372036854775807'), { + error: 'Invalid value: Expected int64 to be <= 9223372036854775807' + }) + .optional(), + message: z.string().optional(), + ok: z.boolean(), + seq: z.coerce + .bigint() + .min(BigInt('-9223372036854775808'), { + error: 'Invalid value: Expected int64 to be >= -9223372036854775808' + }) + .max(BigInt('9223372036854775807'), { + error: 'Invalid value: Expected int64 to be <= 9223372036854775807' + }) + .optional(), + v: z.int().gte(1).lte(1), + workflow_id: z.string().min(1).max(128) +}) + +/** + * Server acknowledgement for a doc_subscribe request. + */ +export const zDocSubscribedFrame = z.object({ + data: zDocSubscribedData, + type: z.enum(['doc_subscribed']) +}) + /** * Server-to-client CRDT document frame carried by the /ws envelope. */ export const zServerDocFrame = z.union([ + zDocSubscribedFrame, zDocUpdateFrame, zDocResetFrame, zDocOpsResultFrame @@ -2071,6 +2130,20 @@ export const zJobAssetsResponse = z.object({ pagination: zPaginationInfo }) +/** + * Pay once with exactly one new-card confirmation token or explicitly selected attached card. Keep the exact request and key on retry; never fall back to the on-file route. + */ +export const zInteractiveTopupRequest = z.object({ + amount_cents: z.coerce.bigint().gte(BigInt(500)).lte(BigInt(99999999)), + checkout_attempt_id: z.string().optional(), + confirmation_token: z.string().min(1).max(255).optional(), + idempotency_key: z.string().min(1).max(255), + make_default: z.boolean().optional().default(false), + return_url: z.string().min(1).max(2048).optional(), + save_payment_method: z.boolean().optional().default(false), + saved_payment_method_id: z.string().min(1).max(255).optional() +}) + /** * Request body for minting an input-image, input-audio or input-video upload grant. */ @@ -2563,6 +2636,7 @@ export const zExchangeTokenResponse = z.object({ permissions: z.array(z.string()), role: z.enum(['owner', 'member']), token: z.string(), + user_id: z.string(), workspace: zWorkspaceSummary }) @@ -2656,6 +2730,26 @@ export const zDeploymentCompatibility = z.object({ deployments: z.array(zDeploymentNodeCompatibility) }) +/** + * Error body of local ComfyUI's /api/deploy* routes. Branch on `error`, never on `message`. + */ +export const zDeployToCloudError = z.object({ + error: z.enum([ + 'offline', + 'multiple_credentials', + 'invalid_api_key_format', + 'invalid_body', + 'missing_credentials', + 'unauthorized', + 'too_large', + 'too_many_bundles', + 'builder_rejected', + 'builder_unavailable', + 'builder_busy' + ]), + message: z.string().optional() +}) + /** * Response after deleting a session cookie */ @@ -2742,7 +2836,7 @@ export const zCreateTopupResponse = z.object({ }) /** - * Request body for purchasing a one-time credit top-up. + * Legacy on-file top-up. Explicit payment authority and save/default fields require the dedicated interactive route and are rejected here, including null or false values. */ export const zCreateTopupRequest = z.object({ amount_cents: z.coerce @@ -2826,6 +2920,42 @@ export const zCreateHubProfileRequest = z.object({ workspace_id: z.string() }) +export const zContentCatalogRecord = z.object({ + data: z.record(z.string(), z.unknown()), + deleted: z.boolean(), + edit_version: z.string(), + enabled: z.boolean(), + kind: z.enum(['MODEL', 'WORKFLOW', 'APP', 'TEMPLATE_SET']), + revision: z.coerce + .bigint() + .gte(BigInt(1)) + .max(BigInt('9223372036854775807'), { + error: 'Invalid value: Expected int64 to be <= 9223372036854775807' + }), + slug: z.string(), + uid: z.string(), + visibility: z.enum(['PUBLIC', 'STAFF']), + visible_from: z.iso.datetime().optional() +}) + +export const zContentCatalogProjection = z.object({ + generation: z.coerce + .bigint() + .min(BigInt('-9223372036854775808'), { + error: 'Invalid value: Expected int64 to be >= -9223372036854775808' + }) + .max(BigInt('9223372036854775807'), { + error: 'Invalid value: Expected int64 to be <= 9223372036854775807' + }), + items: z.array(zContentCatalogRecord), + revision_id: z.coerce + .bigint() + .gte(BigInt(1)) + .max(BigInt('9223372036854775807'), { + error: 'Invalid value: Expected int64 to be <= 9223372036854775807' + }) +}) + /** * Credentials the Churnkey embed requires to launch the cancel flow. * `auth_hash` is hex-encoded HMAC-SHA256 of `customer_id` signed with the @@ -2863,6 +2993,153 @@ export const zCancelSubscriptionAcceptedResponse = z.object({ status: z.enum(['pending']) }) +export const zCccWebsiteCardFacet = z.object({ + count: z.int().gte(0).optional(), + label: z.string(), + value: z.string() +}) + +export const zCccWebsiteCardFacets = z.object({ + categories: z.array(zCccWebsiteCardFacet).max(100), + models: z.array(zCccWebsiteCardFacet).max(100), + use_cases: z.array(zCccWebsiteCardFacet).max(100) +}) + +export const zCccWebsiteCardsPage = z.object({ + available_kinds: z.array(z.enum(['MODEL', 'WORKFLOW', 'APP'])).max(3), + facets: zCccWebsiteCardFacets, + generation: z.coerce + .bigint() + .min(BigInt('-9223372036854775808'), { + error: 'Invalid value: Expected int64 to be >= -9223372036854775808' + }) + .max(BigInt('9223372036854775807'), { + error: 'Invalid value: Expected int64 to be <= 9223372036854775807' + }) + .optional(), + has_more: z.boolean(), + items: z.array(zContentCatalogRecord).max(24), + next_cursor: z.string().max(4096).optional(), + page_size: z.int().gte(1).lte(24), + previous_cursor: z.string().max(4096).optional(), + revision_id: z.coerce + .bigint() + .min(BigInt('-9223372036854775808'), { + error: 'Invalid value: Expected int64 to be >= -9223372036854775808' + }) + .max(BigInt('9223372036854775807'), { + error: 'Invalid value: Expected int64 to be <= 9223372036854775807' + }), + sort_orders: z + .array(z.enum(['popular', 'name', 'priceAsc', 'priceDesc'])) + .max(4), + total: z.int().gte(0).optional() +}) + +export const zCccPublicItemsPage = zContentCatalogProjection.and( + z.object({ + has_more: z.boolean(), + next_cursor: z.string().optional(), + page_size: z.int().gte(1).lte(100) + }) +) + +/** + * Flat type-versioned CCC JSON. Domain schemas (/api/v1/catalog/schemas/{type}/{version}) constrain authored fields. The readOnly properties are server metadata returned by reads; a save may send them back unchanged and they are ignored, never applied. expected_draft_rev and expected_revision_uid are the save concurrency tokens. + */ +export const zCccjson = z.object({ + catalog_rev: z.coerce + .bigint() + .min(BigInt('-9223372036854775808'), { + error: 'Invalid value: Expected int64 to be >= -9223372036854775808' + }) + .max(BigInt('9223372036854775807'), { + error: 'Invalid value: Expected int64 to be <= 9223372036854775807' + }) + .readonly() + .optional(), + creator_uid: z.string().readonly().optional(), + digest: z.string().readonly().optional(), + draft_generation: z.coerce + .bigint() + .min(BigInt('-9223372036854775808'), { + error: 'Invalid value: Expected int64 to be >= -9223372036854775808' + }) + .max(BigInt('9223372036854775807'), { + error: 'Invalid value: Expected int64 to be <= 9223372036854775807' + }) + .readonly() + .optional(), + edit_sequence: z.coerce + .bigint() + .min(BigInt('-9223372036854775808'), { + error: 'Invalid value: Expected int64 to be >= -9223372036854775808' + }) + .max(BigInt('9223372036854775807'), { + error: 'Invalid value: Expected int64 to be <= 9223372036854775807' + }) + .readonly() + .optional(), + is_deleted: z.boolean().readonly().optional(), + owner_uid: z.string().readonly().optional(), + revision_uid: z.uuid().readonly().optional(), + saved_at: z.iso.datetime().readonly().optional(), + saved_by_uid: z.string().readonly().optional(), + uid: z.uuid().readonly().optional() +}) + +export const zCccCatalogState = z.object({ + draft_generation: z.coerce + .bigint() + .gte(BigInt(0)) + .max(BigInt('9223372036854775807'), { + error: 'Invalid value: Expected int64 to be <= 9223372036854775807' + }), + draft_rev: z.coerce + .bigint() + .gte(BigInt(1)) + .max(BigInt('9223372036854775807'), { + error: 'Invalid value: Expected int64 to be <= 9223372036854775807' + }), + live_rev: z.coerce + .bigint() + .gte(BigInt(1)) + .max(BigInt('9223372036854775807'), { + error: 'Invalid value: Expected int64 to be <= 9223372036854775807' + }), + next_rev: z.coerce + .bigint() + .gte(BigInt(1)) + .max(BigInt('9223372036854775807'), { + error: 'Invalid value: Expected int64 to be <= 9223372036854775807' + }), + previous_live_rev: z.coerce + .bigint() + .gte(BigInt(1)) + .max(BigInt('9223372036854775807'), { + error: 'Invalid value: Expected int64 to be <= 9223372036854775807' + }) + .nullable() +}) + +export const zCccCheckedReviewReceipt = z.object({ + publish_enabled: z.boolean(), + receipt_version: z.literal(1), + selected_count: z.int().gte(1).lte(5000), + selected_versions_digest: z.string().regex(/^[0-9a-f]{64}$/), + selection_digest: z.string().regex(/^[0-9a-f]{64}$/), + state: zCccCatalogState, + unchecked_count: z.int().gte(0).lte(5000) +}) + +export const zCccAuthoringContext = z.object({ + actor_uid: z.string().min(1), + can_apply: z.boolean(), + can_edit: z.boolean(), + owner_uid: z.string().min(1), + state: zCccCatalogState +}) + /** * Response after bulk-revoking API keys for a workspace member. */ @@ -2903,6 +3180,7 @@ export const zBillingStatusResponse = z.object({ cancel_at: z.iso.datetime().optional(), has_funds: z.boolean(), is_active: z.boolean(), + latest_subscription_op_id: z.string().optional(), max_seats: z.int(), occupied_seats: z.int(), payment_intent_client_secret: z.string().optional(), @@ -3039,6 +3317,16 @@ export const zBillingOpStatusResponse = z.object({ .optional(), cancelable: z.boolean().optional(), charge_breakdown: zBillingOpChargeBreakdown.optional(), + checkout_state: z + .enum([ + 'unfinished', + 'verify_payment', + 'processing', + 'payment_received', + 'failed', + 'none' + ]) + .optional(), completed_at: z.iso.datetime().optional(), credits_added: z.coerce .bigint() @@ -3083,7 +3371,8 @@ export const zBillingOpStatusResponse = z.object({ .optional(), retryable: z.boolean().optional(), started_at: z.iso.datetime(), - status: z.enum(['pending', 'succeeded', 'failed', 'reconciliation_needed']) + status: z.enum(['pending', 'succeeded', 'failed', 'reconciliation_needed']), + topup_purchase_amount: zTopUpPurchaseAmount.optional() }) export const zBillingOpCancelResponse = z.object({ @@ -3098,6 +3387,8 @@ export const zBillingEvent = z.object({ api_key_name: z.string().optional(), api_key_prefix: z.string().optional(), createdAt: z.iso.datetime(), + deployment_id: z.string().optional(), + deployment_name: z.string().optional(), event_id: z.string(), event_type: z.string(), member_display_name: z.string().optional(), @@ -3299,6 +3590,17 @@ export const zBillingCapabilityDenials = z.object({ can_manage_subscription: z .enum(['not_a_member', 'not_workspace_owner']) .optional(), + can_open_plans: z + .enum([ + 'not_a_member', + 'not_workspace_owner', + 'not_original_owner', + 'creator_only_provisioning', + 'tier_not_self_serve', + 'subscription_not_started', + 'subscription_status_unrecognized' + ]) + .optional(), can_reactivate: z .enum([ 'not_a_member', @@ -3330,6 +3632,7 @@ export const zBillingCapabilityDenials = z.object({ .enum([ 'manual_block', 'subscription_inactive', + 'payment_past_due', 'no_funds', 'workspace_cap_exceeded', 'project_cap_exceeded', @@ -3438,6 +3741,7 @@ export const zBillingCapabilities = z.object({ can_manage_members: z.boolean(), can_manage_partner_node_access: z.boolean(), can_manage_subscription: z.boolean(), + can_open_plans: z.boolean(), can_reactivate: z.boolean(), can_revert_scheduled_change: z.boolean(), can_run_workflows: z.boolean(), @@ -3451,8 +3755,11 @@ export const zBillingCapabilities = z.object({ /** * Recorded account setup guidance, separate from owner authority in - * can_manage_auto_top_up. Frozen keeps the owner's card visible but prevents - * enabling/editing; unavailable hides it. Owner read/disable authority remains. + * can_manage_auto_top_up. Frozen prevents enabling/editing; unavailable + * means setup is not available. Owner read/disable authority remains separate. + * These states do not determine surface visibility. Unified billing settings + * hide the auto top-up card when can_top_up is false, including paused or + * payment-failed billing. * Ready does not authorize a charge or guarantee an off-session payment method. * This fact ignores saved consent and monthly budget. An absent fact is unknown. * @@ -3489,6 +3796,7 @@ export const zBillingCapabilitiesResponse = z.object({ denied_reason_params: zBillingCapabilityDenialParams.optional(), denied_reasons: zBillingCapabilityDenials.optional(), expires_at: z.iso.datetime(), + has_parked_billing_operation: z.boolean().optional(), payment_recovery_available: z.boolean().optional(), plan_kind: z.enum(['none', 'self_serve', 'sales_managed']).optional(), recovery_route: z.enum(['none', 'resubscribe', 'contact_sales']).optional(), @@ -3579,6 +3887,7 @@ export const zAutoReloadSettingsRequest = z.object({ * */ export const zAutoReloadSettings = z.object({ + card_expiring_soon: z.boolean().nullish(), configured: z.boolean(), cycle_resets_at: z.iso.datetime().nullable(), disabled_reason: z.string().nullable(), @@ -3762,6 +4071,42 @@ export const zAgentTurnAccepted = z.object({ thread_id: z.string() }) +/** + * The `data` of an agent_tool_call WebSocket event: one tool invocation's lifecycle. Mirrors `$defs.agent_tool_call.data` in services/agent/api/agent_events.schema.json, which also states the presence rules: the document correlation fields appear only on a terminal (success or error) frame, workflow_id and op_ids appear together, and doc_seq and doc_lineage_seq appear together and only with both of them. This schema leaves those rules out on purpose. A oneOf over closed variants could express them, but it would turn the generated frontend type into a union the consumer cannot extend field by field. The producer enforces them instead: the Publisher omits incomplete correlation, and TestToolCallEmissionsSatisfyBothContracts validates every emitted shape against the canonical schema. Consumers treat correlation as advisory and use it only when workflow_id and op_ids are both present on a terminal frame. TestToolCallFrameMatchesContract holds the two definitions to the same fields and constraints. + */ +export const zAgentToolCallData = z.object({ + doc_lineage_seq: z.int().gte(1).optional(), + doc_seq: z.int().gte(1).optional(), + duration_ms: z.int().optional(), + error_code: z.string().optional(), + message_id: z.string(), + op_ids: z + .array( + z + .string() + .min(1) + .max(128) + .regex(/^[^\x00\n\r\t]+$/) + ) + .min(1) + .max(256) + .optional(), + skill: z.string().optional(), + status: z.enum(['running', 'success', 'error']), + thread_id: z.string(), + tool_call_id: z.string(), + tool_name: z.string(), + workflow_id: z.string().min(1).optional() +}) + +/** + * Server-to-client agent_tool_call frame on /ws. A tool invocation started or reached a terminal state. Closed, like the canonical envelope. + */ +export const zAgentToolCallFrame = z.object({ + data: zAgentToolCallData, + type: z.enum(['agent_tool_call']) +}) + /** * One agent thread row for the history sidebar. */ @@ -3799,6 +4144,14 @@ export const zAgentThreadCreateRequest = z.object({ workflow_id: z.string().optional() }) +/** + * One model round's thinking as persisted on an assistant message's content.thinking (services/agent/internal/loop.persistedThinking): the round's reasoning text, then its narration, scrubbed exactly as the live agent_thinking frames were. Display data only. + */ +export const zAgentThinkingEntry = z.object({ + text: z.string(), + tool_call_id: z.string().optional() +}) + /** * A user-authored skill pack to create or replace. Plain JSON — a pack body is small enough that a signed-URL upload would be pure overhead. */ @@ -3953,6 +4306,7 @@ export const zAgentPostMessageRequest = z.object({ attachments: z.array(z.string().max(256)).max(25).optional(), client_id: z.string().optional(), client_message_id: z.string().max(128).optional(), + client_version: z.string().optional(), content: z.string(), current_tab: z.string().optional(), current_tab_unbound: z.boolean().optional(), @@ -4109,6 +4463,7 @@ export const zAgentMessage = z.object({ }) ) .optional(), + thinking: z.array(zAgentThinkingEntry).optional(), tool_calls: z.array(zToolCallSummary).optional() }) .optional(), @@ -4521,7 +4876,8 @@ export const zAgentDeleteSkillResponse = z.void() export const zAgentListThreadsQuery = z.object({ limit: z.int().gte(1).lte(100).optional().default(20), - after: z.string().optional() + after: z.string().optional(), + workflow_id: z.string().min(1).max(128).optional() }) /** @@ -4689,7 +5045,7 @@ export const zRemoveAssetTagsPath = z.object({ export const zRemoveAssetTagsResponse = zTagsModificationResponse export const zAddAssetTagsBody = z.object({ - tags: z.array(z.string()).min(1) + tags: z.array(z.string()).min(1).max(64) }) export const zAddAssetTagsPath = z.object({ @@ -4704,7 +5060,7 @@ export const zAddAssetTagsResponse = zTagsModificationResponse export const zCreateAssetDownloadBody = z.object({ preview_id: z.uuid().optional(), source_url: z.url(), - tags: z.array(z.string()).optional(), + tags: z.array(z.string()).max(64).optional(), user_metadata: z.record(z.string(), z.unknown()).optional() }) @@ -4744,7 +5100,7 @@ export const zCreateAssetFromHashBody = z.object({ hash: z.string().regex(/^blake3:[a-f0-9]{64}$/), mime_type: z.string().optional(), name: z.string().optional(), - tags: z.array(z.string()).min(1), + tags: z.array(z.string()).min(1).max(64), user_metadata: z.record(z.string(), z.unknown()).optional() }) @@ -5083,6 +5439,13 @@ export const zGetTopupCheckoutPath = z.object({ */ export const zGetTopupCheckoutResponse = zHostedTopupCheckout +export const zCreateInteractiveTopupBody = zInteractiveTopupRequest + +/** + * Top-up initiated successfully + */ +export const zCreateInteractiveTopupResponse = zCreateTopupResponse + export const zCreateTopupQuoteBody = zCreateTopupQuoteRequest /** @@ -5115,6 +5478,32 @@ export const zGetBillingUsageTimeSeriesResponse = zUsageTimeSeries */ export const zGetDefaultWorkflowResponse = z.record(z.string(), z.unknown()) +/** + * A JSON object; `{}` is valid. Null members count as absent. + */ +export const zCreateDeployBundleBody = z.object({ + name: z.string().max(200).nullish(), + workflow: z.record(z.string(), z.unknown()).nullish() +}) + +/** + * Bundle stored on comfy-builder + */ +export const zCreateDeployBundleResponse = z.object({ + bundle_id: z.uuid(), + expires_at: z.iso.datetime(), + url: z.url(), + workspace_id: z.string() +}) + +/** + * Counts of what the bundle would include + */ +export const zGetDeploySummaryResponse = z.object({ + custom_nodes: z.int(), + models: z.int() +}) + /** * Embedding names */ @@ -5174,6 +5563,7 @@ export const zGetFeaturesResponse = z.object({ .default('control'), billing_web_url: z.string().optional(), can_run_partner_nodes: z.boolean().optional(), + deploy_to_cloud: z.boolean().optional(), free_tier_balance: z .object({ allowance: z.int(), @@ -5805,6 +6195,15 @@ export const zMoveUserdataFileQuery = z.object({ */ export const zMoveUserdataFileResponse = zUserDataResponseFull +export const zDeleteUserdataFilePublishPath = z.object({ + file: z.string() +}) + +/** + * Share revoked + */ +export const zDeleteUserdataFilePublishResponse = z.void() + export const zGetUserdataFilePublishPath = z.object({ file: z.string() }) @@ -5833,6 +6232,400 @@ export const zGetUsersInfoResponse = z.object({ storage: z.string() }) +/** + * Editing instructions from this deployed catalog API build + */ +export const zGetCatalogAgentInstructionsResponse = z.string() + +/** + * Current verified authoring context; private no-store + */ +export const zGetCccAuthoringContextResponse = zCccAuthoringContext + +export const zListCccWebsiteCardsQuery = z.object({ + kind: z.enum(['MODEL', 'WORKFLOW', 'APP']), + limit: z.int().gte(1).lte(24).optional().default(24), + cursor: z.string().max(4096).optional(), + locale: z.enum(['en', 'zh-CN']).optional().default('en'), + q: z.string().max(300).optional(), + sort: z + .enum(['popular', 'name', 'priceAsc', 'priceDesc']) + .optional() + .default('popular'), + category: z.array(z.string().max(200)).max(30).optional(), + model: z.array(z.string().max(200)).max(30).optional(), + use: z.array(z.string().max(200)).max(30).optional(), + modality: z.array(z.string().max(200)).max(30).optional(), + provider: z.array(z.string().max(200)).max(30).optional(), + capability: z.array(z.string().max(200)).max(30).optional() +}) + +/** + * At most 24 card summaries; no graphs, inputs, examples or long bodies. Anonymous responses omit total, generation and facet counts. Cursors are audience, filter, clock and state bound and expire after five minutes. + */ +export const zListCccWebsiteCardsResponse = zCccWebsiteCardsPage + +/** + * Build-coupled catalog instructions, permissions and endpoint contracts + */ +export const zGetCatalogDocsResponse = z.string() + +export const zBatchCccItemsBody = z.object({ + expected_draft_rev: z.coerce + .bigint() + .gte(BigInt(1)) + .max(BigInt('9223372036854775807'), { + error: 'Invalid value: Expected int64 to be <= 9223372036854775807' + }), + items: z.array(zCccjson).min(1).max(100) +}) + +export const zBatchCccItemsHeaders = z.object({ + 'Idempotency-Key': z.string().min(1).max(200) +}) + +/** + * Flat immutable edits in request order; retry returns identical UIDs/tokens + */ +export const zBatchCccItemsResponse = z.array(zCccjson) + +export const zDiscardCccChangesBody = zCccjson + +export const zDiscardCccChangesHeaders = z.object({ + 'Idempotency-Key': z.string().min(1).max(200) +}) + +/** + * Updated complete unfiltered private staging snapshot and global unresolved_count + */ +export const zDiscardCccChangesResponse = zCccjson + +/** + * Private exact approved changes, deferred work, state and selection digest + */ +export const zGetCccFinalReviewResponse = zCccjson + +export const zReviewCccCheckedPublicationBody = zCccjson + +/** + * Exact checked changes and unchecked private work with state and selection digest + */ +export const zReviewCccCheckedPublicationResponse = zCccjson + +export const zReviewCccCheckedReceiptBody = zCccjson + +/** + * Exact checked-version receipt after complete candidate validation + */ +export const zReviewCccCheckedReceiptResponse = zCccCheckedReviewReceipt + +export const zCreateCccItemBody = zCccjson + +export const zCreateCccItemHeaders = z.object({ + 'Idempotency-Key': z.string().min(1).max(200) +}) + +/** + * Flat immutable Content edit with exact concurrency tokens + */ +export const zCreateCccItemResponse = zCccjson + +export const zDeleteCccItemBody = z.object({ + expected_draft_rev: z.coerce + .bigint() + .gte(BigInt(1)) + .max(BigInt('9223372036854775807'), { + error: 'Invalid value: Expected int64 to be <= 9223372036854775807' + }), + expected_revision_uid: z.uuid() +}) + +export const zDeleteCccItemHeaders = z.object({ + 'Idempotency-Key': z.string().min(1).max(200) +}) + +export const zDeleteCccItemPath = z.object({ + uid: z.uuid() +}) + +/** + * Flat retained Content with is_deleted=true and new exact edit token + */ +export const zDeleteCccItemResponse = zCccjson + +export const zGetCccDraftItemPath = z.object({ + uid: z.uuid() +}) + +/** + * Current complete authored JSON with exact working-save tokens and read-only metadata + */ +export const zGetCccDraftItemResponse = zCccjson + +export const zReplaceCccItemBody = zCccjson + +export const zReplaceCccItemHeaders = z.object({ + 'Idempotency-Key': z.string().min(1).max(200) +}) + +export const zReplaceCccItemPath = z.object({ + uid: z.uuid() +}) + +/** + * New immutable edit; owner stays fixed, author attribution is versioned and saved_by_uid records the actual editor + */ +export const zReplaceCccItemResponse = zCccjson + +export const zRestoreCccItemVersionBody = z.object({ + expected_draft_rev: z.coerce + .bigint() + .gte(BigInt(1)) + .max(BigInt('9223372036854775807'), { + error: 'Invalid value: Expected int64 to be <= 9223372036854775807' + }), + expected_revision_uid: z.uuid(), + source_revision_uid: z.uuid() +}) + +export const zRestoreCccItemVersionHeaders = z.object({ + 'Idempotency-Key': z.string().min(1).max(200) +}) + +export const zRestoreCccItemVersionPath = z.object({ + uid: z.uuid() +}) + +/** + * New immutable forward Draft save and exact concurrency tokens + */ +export const zRestoreCccItemVersionResponse = zCccjson + +export const zUploadCccMediaBody = z.object({ + change_id: z + .string() + .min(1) + .max(128) + .regex(/^[A-Za-z0-9][A-Za-z0-9._-]*$/) + .optional(), + expected_draft_rev: z.int().gte(1), + file: z.string(), + name: z.string().min(1).max(500), + originating_entity_uid: z.uuid(), + role: z.string().min(1).max(500) +}) + +export const zUploadCccMediaHeaders = z.object({ + 'Idempotency-Key': z.string().min(1).max(200) +}) + +/** + * Private verified media metadata and exact Draft/edit tokens; bytes remain unreleased + */ +export const zUploadCccMediaResponse = zCccjson + +export const zDeleteCccMediaBody = zCccjson + +export const zDeleteCccMediaHeaders = z.object({ + 'Idempotency-Key': z.string().min(1).max(200) +}) + +export const zDeleteCccMediaPath = z.object({ + uid: z.uuid() +}) + +/** + * New tombstone version and Draft generation; history bytes retained + */ +export const zDeleteCccMediaResponse = zCccjson + +export const zReplaceCccMediaFileBody = z.object({ + change_id: z + .string() + .min(1) + .max(128) + .regex(/^[A-Za-z0-9][A-Za-z0-9._-]*$/) + .optional(), + expected_draft_rev: z.int().gte(1), + expected_revision_uid: z.uuid(), + file: z.string(), + name: z.string().min(1).max(500) +}) + +export const zReplaceCccMediaFileHeaders = z.object({ + 'Idempotency-Key': z.string().min(1).max(200) +}) + +export const zReplaceCccMediaFilePath = z.object({ + uid: z.uuid() +}) + +/** + * New immutable Draft file-version metadata under the same media UID + */ +export const zReplaceCccMediaFileResponse = zCccjson + +export const zPublishCccDraftBody = zCccjson + +export const zPublishCccDraftHeaders = z.object({ + 'Idempotency-Key': z.string().min(1).max(200) +}) + +/** + * New Live, previous Live and fresh Draft state after atomic commit + */ +export const zPublishCccDraftResponse = zCccjson + +export const zGetCccStagingQuery = z.object({ + search: z.string().max(300).optional(), + author_uid: z.string().min(1).optional(), + change_id: z + .string() + .min(1) + .max(128) + .regex(/^[A-Za-z0-9][A-Za-z0-9._-]*$/) + .optional(), + tags: z.array(z.string().min(1).max(200)).max(30).optional(), + types: z + .array(z.enum(['model', 'workflow', 'app', 'media', 'template_set'])) + .max(5) + .optional(), + statuses: z + .array(z.enum(['NEW', 'APPROVED', 'DEFERRED', 'DELETED'])) + .max(4) + .optional() +}) + +/** + * Private complete matching changes and exact Draft generation + */ +export const zGetCccStagingResponse = zCccjson + +export const zStageCccChangesBody = zCccjson + +export const zStageCccChangesHeaders = z.object({ + 'Idempotency-Key': z.string().min(1).max(200) +}) + +/** + * Atomic matching-set decisions and updated private staging state + */ +export const zStageCccChangesResponse = zCccjson + +export const zListContentCatalogItemsQuery = z.object({ + q: z.string().max(300).optional(), + slug: z.string().optional(), + kind: z.enum(['MODEL', 'WORKFLOW', 'APP']).optional(), + type: z.enum(['model', 'workflow', 'app', 'template_set']).optional(), + surface: z + .enum([ + 'hub', + 'cloud_templates', + 'local_templates', + 'desktop_starters', + 'nvidia_performance_tests' + ]) + .optional(), + tag: z.string().max(200).optional(), + use_case: z.string().max(200).optional(), + sort: z.enum(['sort_order', 'title']).optional().default('sort_order'), + limit: z.int().gte(1).lte(100).optional().default(20), + cursor: z.string().max(4096).optional(), + workflow_slug: z.string().min(1).max(300).optional() +}) + +/** + * Bounded LIVE page with continuation metadata + */ +export const zListContentCatalogItemsResponse = zCccPublicItemsPage + +export const zGetContentCatalogItemPath = z.object({ + uid: z.string() +}) + +/** + * Website content record + */ +export const zGetContentCatalogItemResponse = zContentCatalogRecord + +export const zGetCccItemHistoryPath = z.object({ + uid: z.uuid() +}) + +export const zGetCccItemHistoryQuery = z.object({ + limit: z.int().gte(1).lte(100).optional().default(20), + cursor: z.string().max(256).optional() +}) + +/** + * Flat immutable items with catalog_status and saved_at, has_more and optional opaque next_cursor; no total + */ +export const zGetCccItemHistoryResponse = zCccjson + +export const zGetCccPublicMediaBytesPath = z.object({ + uid: z.uuid(), + version: z.uuid() +}) + +/** + * Exact current LIVE bytes; authority checked before byte access; no-store + */ +export const zGetCccPublicMediaBytesResponse = z.string() + +export const zHeadCccPublicMediaBytesPath = z.object({ + uid: z.uuid(), + version: z.uuid() +}) + +/** + * Catalog OpenAPI with contract fingerprint and environment + */ +export const zGetCatalogOpenApiResponse = zCccjson + +export const zGetCccPreviewMediaBytesPath = z.object({ + rev: z.int().gte(1), + uid: z.uuid(), + version: z.uuid() +}) + +/** + * Verified selected bytes; private no-store; no origin redirect + */ +export const zGetCccPreviewMediaBytesResponse = z.string() + +export const zHeadCccPreviewMediaBytesPath = z.object({ + rev: z.int().gte(1), + uid: z.uuid(), + version: z.uuid() +}) + +export const zGetCccRevisionItemPath = z.object({ + rev: z.coerce.bigint().gte(BigInt(1)).max(BigInt('9223372036854775807'), { + error: 'Invalid value: Expected int64 to be <= 9223372036854775807' + }), + uid: z.uuid() +}) + +/** + * Flat Content and exact edit/revision context + */ +export const zGetCccRevisionItemResponse = zCccjson + +export const zGetCccTypeSchemaPath = z.object({ + type: z.enum(['model', 'workflow', 'app', 'template_set', 'media']), + schema_version: z.int().gte(1) +}) + +/** + * Build-coupled OpenAPI 3.0 schema object, type, version and API environment + */ +export const zGetCccTypeSchemaResponse = zCccjson + +/** + * Private state; never cacheable + */ +export const zGetCccStateResponse = zCccjson + export const zGetVhsQueryVideoQuery = z.object({ filename: z.string(), workspace_id: z.string().optional() diff --git a/src/platform/auth/nonWebClientsStayOnTokens.test.ts b/src/platform/auth/nonWebClientsStayOnTokens.test.ts index 0a74e23b599..4983371c1a5 100644 --- a/src/platform/auth/nonWebClientsStayOnTokens.test.ts +++ b/src/platform/auth/nonWebClientsStayOnTokens.test.ts @@ -160,6 +160,7 @@ function installFetchRecorder(features: Record) { return { token: `cloud-jwt-${mintCount}`, expires_at: new Date(Date.now() + ONE_HOUR_MS).toISOString(), + user_id: 'uid-1', workspace: { id: 'ws-personal', name: 'Personal', type: 'personal' }, role: 'owner', permissions: ['owner:*'] diff --git a/src/platform/auth/partnerNode/partnerNodeQueueToken.test.ts b/src/platform/auth/partnerNode/partnerNodeQueueToken.test.ts index 5f95fb6acb7..f2541f73a71 100644 --- a/src/platform/auth/partnerNode/partnerNodeQueueToken.test.ts +++ b/src/platform/auth/partnerNode/partnerNodeQueueToken.test.ts @@ -52,6 +52,7 @@ function respondWithPartnerNodeToken() { Response.json({ token: 'partner-node-token', expires_at: new Date(Date.now() + 90 * 60 * 1000).toISOString(), + user_id: 'uid-1', workspace: { id: 'ws-a', name: 'Team', type: 'team' }, role: 'owner', permissions: [] @@ -188,6 +189,7 @@ describe('queueAuthToken', () => { Response.json({ token: 'partner-node-token', expires_at: new Date(Date.now() + 90 * 60 * 1000).toISOString(), + user_id: 'uid-1', workspace: { id: 'ws-b', name: 'Other', type: 'team' }, role: 'owner', permissions: [] @@ -313,6 +315,7 @@ describe('sign-out', () => { return Response.json({ token: `partner-node-${workspace_id}`, expires_at: new Date(Date.now() + 90 * 60 * 1000).toISOString(), + user_id: 'uid-1', workspace: { id: workspace_id, name: 'Team', type: 'team' }, role: 'owner', permissions: [] diff --git a/src/platform/auth/partnerNode/partnerNodeTokenSource.reload.test.ts b/src/platform/auth/partnerNode/partnerNodeTokenSource.reload.test.ts index aa095597a9b..4b66594de2e 100644 --- a/src/platform/auth/partnerNode/partnerNodeTokenSource.reload.test.ts +++ b/src/platform/auth/partnerNode/partnerNodeTokenSource.reload.test.ts @@ -16,6 +16,7 @@ function mintResponse(token: string) { return Response.json({ token, expires_at: new Date(NOW + 90 * 60 * 1000).toISOString(), + user_id: 'uid-1', workspace: { id: 'ws-a', name: 'Team', type: 'team' }, role: 'owner', permissions: [] diff --git a/src/platform/auth/partnerNode/partnerNodeTokenSource.test.ts b/src/platform/auth/partnerNode/partnerNodeTokenSource.test.ts index 1d1ba7dafe7..944534c0094 100644 --- a/src/platform/auth/partnerNode/partnerNodeTokenSource.test.ts +++ b/src/platform/auth/partnerNode/partnerNodeTokenSource.test.ts @@ -24,6 +24,7 @@ function mintResponse( return Response.json({ token, expires_at: new Date(NOW + lifetimeMs).toISOString(), + user_id: 'uid-1', workspace: { id: workspaceId, name: 'Team', type: 'team' }, role: 'owner', permissions: [] diff --git a/src/platform/auth/webSessionFlagOff.test.ts b/src/platform/auth/webSessionFlagOff.test.ts index b2c389656d7..a86bcece112 100644 --- a/src/platform/auth/webSessionFlagOff.test.ts +++ b/src/platform/auth/webSessionFlagOff.test.ts @@ -176,6 +176,7 @@ const CAPABILITIES = { can_edit_workspace: false, can_manage_auto_top_up: false, can_manage_subscription: false, + can_open_plans: false, can_run_workflows: false, can_upgrade: false } satisfies BillingCapabilities, @@ -211,6 +212,7 @@ function installFetchRecorder(features: Record) { return { token: `cloud-jwt-${mintCount}`, expires_at: new Date(Date.now() + ONE_HOUR_MS).toISOString(), + user_id: 'uid-1', workspace: { id: 'ws-personal', name: 'Personal', type: 'personal' }, role: 'owner', permissions: ['owner:*'] diff --git a/src/platform/auth/webSessionFlagOn.test.ts b/src/platform/auth/webSessionFlagOn.test.ts index 948eb385dc1..2da4670c8af 100644 --- a/src/platform/auth/webSessionFlagOn.test.ts +++ b/src/platform/auth/webSessionFlagOn.test.ts @@ -673,6 +673,7 @@ function capabilitiesResponse({ can_edit_workspace: false, can_manage_auto_top_up: false, can_manage_subscription: false, + can_open_plans: false, can_run_workflows: false, can_upgrade: false, can_downgrade_to_personal: false @@ -758,6 +759,7 @@ function installIngest(features: Record = {}) { return jsonResponse({ token: `session-jwt-${ingest.mints}`, expires_at: new Date(Date.now() + 15 * 60_000).toISOString(), + user_id: 'uid-1', workspace: { id: 'ws-personal', name: 'Personal', type: 'personal' }, role: 'owner', permissions: [] @@ -2572,6 +2574,7 @@ describe.for([{ unified: false }, { unified: true }])( return jsonResponse({ token: 'session-jwt-1', expires_at: new Date(Date.now() + TEN_MINUTES_MS).toISOString(), + user_id: 'uid-1', workspace: { id: 'ws-personal', name: 'Personal', diff --git a/src/platform/workspace/api/__mocks__/workspaceApi.ts b/src/platform/workspace/api/__mocks__/workspaceApi.ts index 73b053f9963..a37ea25e07f 100644 --- a/src/platform/workspace/api/__mocks__/workspaceApi.ts +++ b/src/platform/workspace/api/__mocks__/workspaceApi.ts @@ -108,6 +108,7 @@ export const workspaceApi = vi.mockObject( can_edit_workspace: false, can_manage_auto_top_up: false, can_manage_subscription: false, + can_open_plans: false, can_run_workflows: false, can_upgrade: false, can_reactivate: false, diff --git a/src/platform/workspace/billing/sdk/billingCapabilitiesView.test.ts b/src/platform/workspace/billing/sdk/billingCapabilitiesView.test.ts index 3f43aa1c17c..39645c1c0c0 100644 --- a/src/platform/workspace/billing/sdk/billingCapabilitiesView.test.ts +++ b/src/platform/workspace/billing/sdk/billingCapabilitiesView.test.ts @@ -20,6 +20,7 @@ const SNAPSHOT: CapabilitiesSnapshot = { can_edit_workspace: false, can_manage_auto_top_up: false, can_manage_subscription: false, + can_open_plans: false, can_run_workflows: false, can_upgrade: false, can_reactivate: false, diff --git a/src/platform/workspace/billing/sdk/billingSdkTelemetryOwnership.test.ts b/src/platform/workspace/billing/sdk/billingSdkTelemetryOwnership.test.ts index 41097014837..9efd8b648a6 100644 --- a/src/platform/workspace/billing/sdk/billingSdkTelemetryOwnership.test.ts +++ b/src/platform/workspace/billing/sdk/billingSdkTelemetryOwnership.test.ts @@ -164,6 +164,7 @@ const CAPABILITIES = { can_edit_workspace: false, can_manage_auto_top_up: false, can_manage_subscription: false, + can_open_plans: false, can_run_workflows: false, can_upgrade: false, can_reactivate: true, diff --git a/src/platform/workspace/billing/sdk/createBillingSdk.test.ts b/src/platform/workspace/billing/sdk/createBillingSdk.test.ts index 66d4d1e0b8b..f0cd79ac80c 100644 --- a/src/platform/workspace/billing/sdk/createBillingSdk.test.ts +++ b/src/platform/workspace/billing/sdk/createBillingSdk.test.ts @@ -70,6 +70,7 @@ const CAPABILITIES = { can_edit_workspace: false, can_manage_auto_top_up: false, can_manage_subscription: false, + can_open_plans: false, can_run_workflows: false, can_upgrade: false, can_reactivate: false, diff --git a/src/platform/workspace/composables/useBillingCapabilities.crossUser.test.ts b/src/platform/workspace/composables/useBillingCapabilities.crossUser.test.ts index 4d0d023e4f6..3c81b7d3681 100644 --- a/src/platform/workspace/composables/useBillingCapabilities.crossUser.test.ts +++ b/src/platform/workspace/composables/useBillingCapabilities.crossUser.test.ts @@ -59,6 +59,7 @@ function capabilitiesFor( can_edit_workspace: isOwner, can_manage_auto_top_up: isOwner, can_manage_subscription: isOwner, + can_open_plans: isOwner, can_run_workflows: isOwner, can_upgrade: isOwner }, diff --git a/src/platform/workspace/composables/useBillingCapabilities.test.ts b/src/platform/workspace/composables/useBillingCapabilities.test.ts index c132c53f73d..f611ad5f160 100644 --- a/src/platform/workspace/composables/useBillingCapabilities.test.ts +++ b/src/platform/workspace/composables/useBillingCapabilities.test.ts @@ -85,6 +85,7 @@ function capabilitiesResponse( can_edit_workspace: false, can_manage_auto_top_up: false, can_manage_subscription: false, + can_open_plans: false, can_run_workflows: false, can_upgrade: false, can_downgrade_to_personal: true, @@ -1414,6 +1415,7 @@ describe('useBillingCapabilities on the SDK rail', () => { can_edit_workspace: false, can_manage_auto_top_up: false, can_manage_subscription: false, + can_open_plans: false, can_run_workflows: false, can_upgrade: false }, diff --git a/src/platform/workspace/stores/legacyWorkspaceTokenRail.lifecycle.test.ts b/src/platform/workspace/stores/legacyWorkspaceTokenRail.lifecycle.test.ts index c7bdb675824..82ed21bb015 100644 --- a/src/platform/workspace/stores/legacyWorkspaceTokenRail.lifecycle.test.ts +++ b/src/platform/workspace/stores/legacyWorkspaceTokenRail.lifecycle.test.ts @@ -39,6 +39,7 @@ function tokenResponse( return Response.json({ token: `token-${workspaceId}`, expires_at: new Date(Date.now() + expiresInMs).toISOString(), + user_id: 'uid-1', workspace: { id: workspaceId, name: workspace.name, type: 'team' }, role: 'owner', permissions: ['owner:*'], diff --git a/src/platform/workspace/stores/legacyWorkspaceTokenRail.test.ts b/src/platform/workspace/stores/legacyWorkspaceTokenRail.test.ts index 4338a16d280..47d3a3c8ff6 100644 --- a/src/platform/workspace/stores/legacyWorkspaceTokenRail.test.ts +++ b/src/platform/workspace/stores/legacyWorkspaceTokenRail.test.ts @@ -42,6 +42,7 @@ describe('createLegacyWorkspaceTokenRail', () => { Response.json({ token: 'workspace-token-abc', expires_at: new Date(Date.now() + expiresInMs).toISOString(), + user_id: 'uid-1', workspace: { id: workspace.id, name: workspace.name, type: 'team' }, role: 'owner', permissions: ['owner:*'] diff --git a/src/platform/workspace/stores/legacyWorkspaceTokenRail.ts b/src/platform/workspace/stores/legacyWorkspaceTokenRail.ts index c6eb0f5df29..b6824de3906 100644 --- a/src/platform/workspace/stores/legacyWorkspaceTokenRail.ts +++ b/src/platform/workspace/stores/legacyWorkspaceTokenRail.ts @@ -33,6 +33,7 @@ const WorkspaceIdentitySchema = zWorkspaceWithRole.pick({ const WorkspaceTokenResponseSchema = z.object({ token: z.string(), expires_at: z.string(), + user_id: z.string().optional(), workspace: zWorkspaceWithRole.pick({ id: true, name: true, type: true }), role: zWorkspaceWithRole.shape.role, permissions: z.array(z.string()) diff --git a/src/platform/workspace/stores/useWorkspaceAuth.test.ts b/src/platform/workspace/stores/useWorkspaceAuth.test.ts index 3da83f12ab9..c450d1cbc35 100644 --- a/src/platform/workspace/stores/useWorkspaceAuth.test.ts +++ b/src/platform/workspace/stores/useWorkspaceAuth.test.ts @@ -115,6 +115,7 @@ const mockWorkspaceWithRole = { const mockTokenResponse = { token: 'workspace-token-abc', expires_at: new Date('2024-06-15T13:00:00Z').toISOString(), + user_id: 'uid-1', workspace: mockWorkspace, role: 'owner' as const, permissions: ['owner:*'] @@ -1935,6 +1936,7 @@ describe('useWorkspaceAuthStore', () => { const personalTokenResponse = { token: 'unified-token-1', expires_at: new Date(Date.now() + 3600 * 1000).toISOString(), + user_id: 'uid-1', workspace: { id: 'workspace-personal', name: 'Personal', @@ -3606,6 +3608,7 @@ describe('useWorkspaceAuthStore constructed before authStore', () => { Response.json({ token: 'unified-token-1', expires_at: new Date(Date.now() + 3600 * 1000).toISOString(), + user_id: 'uid-1', workspace: { id: 'workspace-personal', name: 'Personal', diff --git a/src/platform/workspace/telemetry/workspaceTelemetryContext.test.ts b/src/platform/workspace/telemetry/workspaceTelemetryContext.test.ts index 6836d800605..682d1be4219 100644 --- a/src/platform/workspace/telemetry/workspaceTelemetryContext.test.ts +++ b/src/platform/workspace/telemetry/workspaceTelemetryContext.test.ts @@ -178,6 +178,7 @@ describe('useBillingCapabilities workspace scope mismatch', () => { can_edit_workspace: false, can_manage_auto_top_up: false, can_manage_subscription: false, + can_open_plans: false, can_run_workflows: false, can_upgrade: false }, diff --git a/src/stores/authStore.test.ts b/src/stores/authStore.test.ts index d34d7e03387..af00afdb5fb 100644 --- a/src/stores/authStore.test.ts +++ b/src/stores/authStore.test.ts @@ -2817,6 +2817,7 @@ describe('store construction order', () => { const tokenResponse = { token: 'construction-token', expires_at: new Date(Date.now() + 3600 * 1000).toISOString(), + user_id: 'uid-1', workspace: { id: 'workspace-personal', name: 'Personal', type: 'personal' }, role: 'owner', permissions: ['owner:*']