Files
app/frontend/src/client/sdk.gen.ts
T
Melvin StroblandClaude Fable 5 606ab3c423 Separate editing from running with a draft/publish split
Edits autosave to flow.draft.json and nodes.draft/ instead of the files the
engine reads, so the pipeline keeps running the published version until
someone publishes. Every save carries the version it was based on: a second
client editing the same flow is refused with 409 and offered the choice
between their version and its own, rather than silently overwriting.

Draft saves no longer rebuild the pipeline; validation and node status for a
draft come from a throwaway build that never touches live state.

Also fixes a latent bug where an empty state backend is falsy, so Pipeline
quietly built itself a second, private state and left message history empty.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-15 23:13:15 +02:00

759 lines
24 KiB
TypeScript

// This file is auto-generated by @hey-api/openapi-ts
import type { CancelablePromise } from './core/CancelablePromise';
import { OpenAPI } from './core/OpenAPI';
import { request as __request } from './core/request';
import type { FlowsReadFlowsResponse, FlowsReadNodeTypesResponse, FlowsReadFlowData, FlowsReadFlowResponse, FlowsSaveFlowData, FlowsSaveFlowResponse, FlowsDeleteFlowData, FlowsDeleteFlowResponse, FlowsPublishFlowData, FlowsPublishFlowResponse, FlowsDiscardDraftData, FlowsDiscardDraftResponse, FlowsRenameFlowData, FlowsRenameFlowResponse, FlowsReadNodeSourceData, FlowsReadNodeSourceResponse, FlowsSaveNodeSourceData, FlowsSaveNodeSourceResponse, FlowsValidateFlowData, FlowsValidateFlowResponse, FlowsRunFlowData, FlowsRunFlowResponse, FlowsTriggerNodeData, FlowsTriggerNodeResponse, FlowsReadFlowStateData, FlowsReadFlowStateResponse, FlowsReadMessageHistoryData, FlowsReadMessageHistoryResponse, LoginLoginAccessTokenData, LoginLoginAccessTokenResponse, LoginTestTokenResponse, LoginRecoverPasswordData, LoginRecoverPasswordResponse, LoginResetPasswordData, LoginResetPasswordResponse, LoginRecoverPasswordHtmlContentData, LoginRecoverPasswordHtmlContentResponse, PrivateCreateUserData, PrivateCreateUserResponse, SecretsReadSecretsResponse, SecretsSaveSecretData, SecretsSaveSecretResponse, SecretsDeleteSecretData, SecretsDeleteSecretResponse, UsersReadUsersData, UsersReadUsersResponse, UsersCreateUserData, UsersCreateUserResponse, UsersReadUserMeResponse, UsersDeleteUserMeResponse, UsersUpdateUserMeData, UsersUpdateUserMeResponse, UsersUpdatePasswordMeData, UsersUpdatePasswordMeResponse, UsersRegisterUserData, UsersRegisterUserResponse, UsersReadUserByIdData, UsersReadUserByIdResponse, UsersUpdateUserData, UsersUpdateUserResponse, UsersDeleteUserData, UsersDeleteUserResponse, UtilsTestEmailData, UtilsTestEmailResponse, UtilsHealthCheckResponse } from './types.gen';
export class FlowsService {
/**
* Read Flows
* List every flow.
* @returns FlowsPublic Successful Response
* @throws ApiError
*/
public static readFlows(): CancelablePromise<FlowsReadFlowsResponse> {
return __request(OpenAPI, {
method: 'GET',
url: '/api/v1/flows/'
});
}
/**
* Read Node Types
* The node types that can be placed on a canvas.
* @returns NodeTypeInfo Successful Response
* @throws ApiError
*/
public static readNodeTypes(): CancelablePromise<FlowsReadNodeTypesResponse> {
return __request(OpenAPI, {
method: 'GET',
url: '/api/v1/flows/node-types'
});
}
/**
* Read Flow
* Read one flow, with the state of its nodes.
* @param data The data for the request.
* @param data.name
* @returns FlowDetail Successful Response
* @throws ApiError
*/
public static readFlow(data: FlowsReadFlowData): CancelablePromise<FlowsReadFlowResponse> {
return __request(OpenAPI, {
method: 'GET',
url: '/api/v1/flows/{name}',
path: {
name: data.name
},
errors: {
422: 'Validation Error'
}
});
}
/**
* Save Flow
* Save unpublished changes to a flow.
*
* This writes a draft: the running pipeline keeps the published version until
* someone publishes. ``version`` is the one the editor last saw — a mismatch
* means another client saved in between and answers 409 rather than throwing
* their work away.
* @param data The data for the request.
* @param data.name
* @param data.requestBody
* @returns FlowDetail Successful Response
* @throws ApiError
*/
public static saveFlow(data: FlowsSaveFlowData): CancelablePromise<FlowsSaveFlowResponse> {
return __request(OpenAPI, {
method: 'PUT',
url: '/api/v1/flows/{name}',
path: {
name: data.name
},
body: data.requestBody,
mediaType: 'application/json',
errors: {
422: 'Validation Error'
}
});
}
/**
* Delete Flow
* Delete a flow and everything in it.
* @param data The data for the request.
* @param data.name
* @returns Message Successful Response
* @throws ApiError
*/
public static deleteFlow(data: FlowsDeleteFlowData): CancelablePromise<FlowsDeleteFlowResponse> {
return __request(OpenAPI, {
method: 'DELETE',
url: '/api/v1/flows/{name}',
path: {
name: data.name
},
errors: {
422: 'Validation Error'
}
});
}
/**
* Publish Flow
* Deploy the unpublished changes: the engine picks them up from here.
* @param data The data for the request.
* @param data.name
* @param data.requestBody
* @returns FlowDetail Successful Response
* @throws ApiError
*/
public static publishFlow(data: FlowsPublishFlowData): CancelablePromise<FlowsPublishFlowResponse> {
return __request(OpenAPI, {
method: 'POST',
url: '/api/v1/flows/{name}/publish',
path: {
name: data.name
},
body: data.requestBody,
mediaType: 'application/json',
errors: {
422: 'Validation Error'
}
});
}
/**
* Discard Draft
* Throw the unpublished changes away and go back to what is running.
* @param data The data for the request.
* @param data.name
* @returns FlowDetail Successful Response
* @throws ApiError
*/
public static discardDraft(data: FlowsDiscardDraftData): CancelablePromise<FlowsDiscardDraftResponse> {
return __request(OpenAPI, {
method: 'POST',
url: '/api/v1/flows/{name}/discard-draft',
path: {
name: data.name
},
errors: {
422: 'Validation Error'
}
});
}
/**
* Rename Flow
* Rename a flow, along with every reference to its messages.
* @param data The data for the request.
* @param data.name
* @param data.requestBody
* @returns FlowDetail Successful Response
* @throws ApiError
*/
public static renameFlow(data: FlowsRenameFlowData): CancelablePromise<FlowsRenameFlowResponse> {
return __request(OpenAPI, {
method: 'POST',
url: '/api/v1/flows/{name}/rename',
path: {
name: data.name
},
body: data.requestBody,
mediaType: 'application/json',
errors: {
422: 'Validation Error'
}
});
}
/**
* Read Node Source
* Read a node's Python source, including unpublished edits.
* @param data The data for the request.
* @param data.name
* @param data.nodeId
* @returns NodeSource Successful Response
* @throws ApiError
*/
public static readNodeSource(data: FlowsReadNodeSourceData): CancelablePromise<FlowsReadNodeSourceResponse> {
return __request(OpenAPI, {
method: 'GET',
url: '/api/v1/flows/{name}/nodes/{node_id}/source',
path: {
name: data.name,
node_id: data.nodeId
},
errors: {
422: 'Validation Error'
}
});
}
/**
* Save Node Source
* Save a node's source as an unpublished edit and report whether it loads.
*
* The answer comes from compiling the code rather than from the running
* pipeline: a draft is not deployed, and compiling is both faster and more
* precise about what the author just typed.
* @param data The data for the request.
* @param data.name
* @param data.nodeId
* @param data.requestBody
* @returns NodeStatusPublic Successful Response
* @throws ApiError
*/
public static saveNodeSource(data: FlowsSaveNodeSourceData): CancelablePromise<FlowsSaveNodeSourceResponse> {
return __request(OpenAPI, {
method: 'PUT',
url: '/api/v1/flows/{name}/nodes/{node_id}/source',
path: {
name: data.name,
node_id: data.nodeId
},
body: data.requestBody,
mediaType: 'application/json',
errors: {
422: 'Validation Error'
}
});
}
/**
* Validate Flow
* Report what would keep this flow from running.
* @param data The data for the request.
* @param data.name
* @returns ValidationResult Successful Response
* @throws ApiError
*/
public static validateFlow(data: FlowsValidateFlowData): CancelablePromise<FlowsValidateFlowResponse> {
return __request(OpenAPI, {
method: 'POST',
url: '/api/v1/flows/{name}/validate',
path: {
name: data.name
},
errors: {
422: 'Validation Error'
}
});
}
/**
* Run Flow
* Run every node of a flow once.
*
* With unpublished changes this runs the draft, so the button matches what is
* on the canvas. Nothing is deployed by running it.
* @param data The data for the request.
* @param data.name
* @param data.requestBody
* @returns FlowStatePublic Successful Response
* @throws ApiError
*/
public static runFlow(data: FlowsRunFlowData): CancelablePromise<FlowsRunFlowResponse> {
return __request(OpenAPI, {
method: 'POST',
url: '/api/v1/flows/{name}/run',
path: {
name: data.name
},
body: data.requestBody,
mediaType: 'application/json',
errors: {
422: 'Validation Error'
}
});
}
/**
* Trigger Node
* Feed values into a single node.
* @param data The data for the request.
* @param data.name
* @param data.nodeId
* @param data.requestBody
* @returns FlowStatePublic Successful Response
* @throws ApiError
*/
public static triggerNode(data: FlowsTriggerNodeData): CancelablePromise<FlowsTriggerNodeResponse> {
return __request(OpenAPI, {
method: 'POST',
url: '/api/v1/flows/{name}/nodes/{node_id}/trigger',
path: {
name: data.name,
node_id: data.nodeId
},
body: data.requestBody,
mediaType: 'application/json',
errors: {
422: 'Validation Error'
}
});
}
/**
* Read Flow State
* The last value seen on every message of this flow.
* @param data The data for the request.
* @param data.name
* @returns FlowStatePublic Successful Response
* @throws ApiError
*/
public static readFlowState(data: FlowsReadFlowStateData): CancelablePromise<FlowsReadFlowStateResponse> {
return __request(OpenAPI, {
method: 'GET',
url: '/api/v1/flows/{name}/state',
path: {
name: data.name
},
errors: {
422: 'Validation Error'
}
});
}
/**
* Read Message History
* The recent values of one message, for plotting.
*
* ``message`` may be given bare or qualified; a message that never carried a
* number comes back with an empty series.
* @param data The data for the request.
* @param data.name
* @param data.message
* @returns MessageHistory Successful Response
* @throws ApiError
*/
public static readMessageHistory(data: FlowsReadMessageHistoryData): CancelablePromise<FlowsReadMessageHistoryResponse> {
return __request(OpenAPI, {
method: 'GET',
url: '/api/v1/flows/{name}/history/{message}',
path: {
name: data.name,
message: data.message
},
errors: {
422: 'Validation Error'
}
});
}
}
export class LoginService {
/**
* Login Access Token
* OAuth2 compatible token login, get an access token for future requests
* @param data The data for the request.
* @param data.formData
* @returns Token Successful Response
* @throws ApiError
*/
public static loginAccessToken(data: LoginLoginAccessTokenData): CancelablePromise<LoginLoginAccessTokenResponse> {
return __request(OpenAPI, {
method: 'POST',
url: '/api/v1/login/access-token',
formData: data.formData,
mediaType: 'application/x-www-form-urlencoded',
errors: {
422: 'Validation Error'
}
});
}
/**
* Test Token
* Test access token
* @returns UserPublic Successful Response
* @throws ApiError
*/
public static testToken(): CancelablePromise<LoginTestTokenResponse> {
return __request(OpenAPI, {
method: 'POST',
url: '/api/v1/login/test-token'
});
}
/**
* Recover Password
* Password Recovery
* @param data The data for the request.
* @param data.email
* @returns Message Successful Response
* @throws ApiError
*/
public static recoverPassword(data: LoginRecoverPasswordData): CancelablePromise<LoginRecoverPasswordResponse> {
return __request(OpenAPI, {
method: 'POST',
url: '/api/v1/password-recovery/{email}',
path: {
email: data.email
},
errors: {
422: 'Validation Error'
}
});
}
/**
* Reset Password
* Reset password
* @param data The data for the request.
* @param data.requestBody
* @returns Message Successful Response
* @throws ApiError
*/
public static resetPassword(data: LoginResetPasswordData): CancelablePromise<LoginResetPasswordResponse> {
return __request(OpenAPI, {
method: 'POST',
url: '/api/v1/reset-password/',
body: data.requestBody,
mediaType: 'application/json',
errors: {
422: 'Validation Error'
}
});
}
/**
* Recover Password Html Content
* HTML Content for Password Recovery
* @param data The data for the request.
* @param data.email
* @returns string Successful Response
* @throws ApiError
*/
public static recoverPasswordHtmlContent(data: LoginRecoverPasswordHtmlContentData): CancelablePromise<LoginRecoverPasswordHtmlContentResponse> {
return __request(OpenAPI, {
method: 'POST',
url: '/api/v1/password-recovery-html-content/{email}',
path: {
email: data.email
},
errors: {
422: 'Validation Error'
}
});
}
}
export class PrivateService {
/**
* Create User
* Create a new user.
* @param data The data for the request.
* @param data.requestBody
* @returns UserPublic Successful Response
* @throws ApiError
*/
public static createUser(data: PrivateCreateUserData): CancelablePromise<PrivateCreateUserResponse> {
return __request(OpenAPI, {
method: 'POST',
url: '/api/v1/private/users/',
body: data.requestBody,
mediaType: 'application/json',
errors: {
422: 'Validation Error'
}
});
}
}
export class SecretsService {
/**
* Read Secrets
* List the names of stored secrets.
* @returns SecretNames Successful Response
* @throws ApiError
*/
public static readSecrets(): CancelablePromise<SecretsReadSecretsResponse> {
return __request(OpenAPI, {
method: 'GET',
url: '/api/v1/secrets/'
});
}
/**
* Save Secret
* Store a secret under a name that nodes can reference.
* @param data The data for the request.
* @param data.name
* @param data.requestBody
* @returns Message Successful Response
* @throws ApiError
*/
public static saveSecret(data: SecretsSaveSecretData): CancelablePromise<SecretsSaveSecretResponse> {
return __request(OpenAPI, {
method: 'PUT',
url: '/api/v1/secrets/{name}',
path: {
name: data.name
},
body: data.requestBody,
mediaType: 'application/json',
errors: {
422: 'Validation Error'
}
});
}
/**
* Delete Secret
* Delete a secret.
* @param data The data for the request.
* @param data.name
* @returns Message Successful Response
* @throws ApiError
*/
public static deleteSecret(data: SecretsDeleteSecretData): CancelablePromise<SecretsDeleteSecretResponse> {
return __request(OpenAPI, {
method: 'DELETE',
url: '/api/v1/secrets/{name}',
path: {
name: data.name
},
errors: {
422: 'Validation Error'
}
});
}
}
export class UsersService {
/**
* Read Users
* Retrieve users.
* @param data The data for the request.
* @param data.skip
* @param data.limit
* @returns UsersPublic Successful Response
* @throws ApiError
*/
public static readUsers(data: UsersReadUsersData = {}): CancelablePromise<UsersReadUsersResponse> {
return __request(OpenAPI, {
method: 'GET',
url: '/api/v1/users/',
query: {
skip: data.skip,
limit: data.limit
},
errors: {
422: 'Validation Error'
}
});
}
/**
* Create User
* Create new user.
* @param data The data for the request.
* @param data.requestBody
* @returns UserPublic Successful Response
* @throws ApiError
*/
public static createUser(data: UsersCreateUserData): CancelablePromise<UsersCreateUserResponse> {
return __request(OpenAPI, {
method: 'POST',
url: '/api/v1/users/',
body: data.requestBody,
mediaType: 'application/json',
errors: {
422: 'Validation Error'
}
});
}
/**
* Read User Me
* Get current user.
* @returns UserPublic Successful Response
* @throws ApiError
*/
public static readUserMe(): CancelablePromise<UsersReadUserMeResponse> {
return __request(OpenAPI, {
method: 'GET',
url: '/api/v1/users/me'
});
}
/**
* Delete User Me
* Delete own user.
* @returns Message Successful Response
* @throws ApiError
*/
public static deleteUserMe(): CancelablePromise<UsersDeleteUserMeResponse> {
return __request(OpenAPI, {
method: 'DELETE',
url: '/api/v1/users/me'
});
}
/**
* Update User Me
* Update own user.
* @param data The data for the request.
* @param data.requestBody
* @returns UserPublic Successful Response
* @throws ApiError
*/
public static updateUserMe(data: UsersUpdateUserMeData): CancelablePromise<UsersUpdateUserMeResponse> {
return __request(OpenAPI, {
method: 'PATCH',
url: '/api/v1/users/me',
body: data.requestBody,
mediaType: 'application/json',
errors: {
422: 'Validation Error'
}
});
}
/**
* Update Password Me
* Update own password.
* @param data The data for the request.
* @param data.requestBody
* @returns Message Successful Response
* @throws ApiError
*/
public static updatePasswordMe(data: UsersUpdatePasswordMeData): CancelablePromise<UsersUpdatePasswordMeResponse> {
return __request(OpenAPI, {
method: 'PATCH',
url: '/api/v1/users/me/password',
body: data.requestBody,
mediaType: 'application/json',
errors: {
422: 'Validation Error'
}
});
}
/**
* Register User
* Create new user without the need to be logged in.
* @param data The data for the request.
* @param data.requestBody
* @returns UserPublic Successful Response
* @throws ApiError
*/
public static registerUser(data: UsersRegisterUserData): CancelablePromise<UsersRegisterUserResponse> {
return __request(OpenAPI, {
method: 'POST',
url: '/api/v1/users/signup',
body: data.requestBody,
mediaType: 'application/json',
errors: {
422: 'Validation Error'
}
});
}
/**
* Read User By Id
* Get a specific user by id.
* @param data The data for the request.
* @param data.userId
* @returns UserPublic Successful Response
* @throws ApiError
*/
public static readUserById(data: UsersReadUserByIdData): CancelablePromise<UsersReadUserByIdResponse> {
return __request(OpenAPI, {
method: 'GET',
url: '/api/v1/users/{user_id}',
path: {
user_id: data.userId
},
errors: {
422: 'Validation Error'
}
});
}
/**
* Update User
* Update a user.
* @param data The data for the request.
* @param data.userId
* @param data.requestBody
* @returns UserPublic Successful Response
* @throws ApiError
*/
public static updateUser(data: UsersUpdateUserData): CancelablePromise<UsersUpdateUserResponse> {
return __request(OpenAPI, {
method: 'PATCH',
url: '/api/v1/users/{user_id}',
path: {
user_id: data.userId
},
body: data.requestBody,
mediaType: 'application/json',
errors: {
422: 'Validation Error'
}
});
}
/**
* Delete User
* Delete a user.
* @param data The data for the request.
* @param data.userId
* @returns Message Successful Response
* @throws ApiError
*/
public static deleteUser(data: UsersDeleteUserData): CancelablePromise<UsersDeleteUserResponse> {
return __request(OpenAPI, {
method: 'DELETE',
url: '/api/v1/users/{user_id}',
path: {
user_id: data.userId
},
errors: {
422: 'Validation Error'
}
});
}
}
export class UtilsService {
/**
* Test Email
* Test emails.
* @param data The data for the request.
* @param data.emailTo
* @returns Message Successful Response
* @throws ApiError
*/
public static testEmail(data: UtilsTestEmailData): CancelablePromise<UtilsTestEmailResponse> {
return __request(OpenAPI, {
method: 'POST',
url: '/api/v1/utils/test-email/',
query: {
email_to: data.emailTo
},
errors: {
422: 'Validation Error'
}
});
}
/**
* Health Check
* @returns boolean Successful Response
* @throws ApiError
*/
public static healthCheck(): CancelablePromise<UtilsHealthCheckResponse> {
return __request(OpenAPI, {
method: 'GET',
url: '/api/v1/utils/health-check/'
});
}
}