Header of process and node ports follow each other both ways: a panel edit rewrites only the def line of edited code, a code save reads the header back into input ports and settings (draft and response); Space types in the node editor again

This commit is contained in:
2026-10-15 18:19:19 +02:00
parent 87ee7e3429
commit abfb03c441
15 changed files with 645 additions and 48 deletions
+86
View File
@@ -2543,6 +2543,92 @@ export const NodeSourceSchema = {
description: 'The Python source of a node.'
} as const;
export const NodeSourceSavedSchema = {
properties: {
id: {
type: 'string',
title: 'Id'
},
status: {
type: 'string',
title: 'Status',
default: 'active'
},
error: {
anyOf: [
{
type: 'string'
},
{
type: 'null'
}
],
title: 'Error'
},
health: {
type: 'string',
enum: ['ok', 'degraded', 'down'],
title: 'Health',
default: 'ok'
},
health_detail: {
anyOf: [
{
type: 'string'
},
{
type: 'null'
}
],
title: 'Health Detail'
},
last_error: {
type: 'string',
title: 'Last Error',
default: ''
},
last_error_ts: {
anyOf: [
{
type: 'number'
},
{
type: 'null'
}
],
title: 'Last Error Ts'
},
node: {
anyOf: [
{
'$ref': '#/components/schemas/NodeDef-Output'
},
{
type: 'null'
}
]
},
version: {
anyOf: [
{
type: 'integer'
},
{
type: 'null'
}
],
title: 'Version'
}
},
type: 'object',
required: ['id'],
title: 'NodeSourceSaved',
description: `Whether saved code loads, and what its header changed.
\`node\` is set when the parameters of \`\`process\`\` added, dropped or renamed
an input port or setting. The draft moved on to \`version\` with it.`
} as const;
export const NodeStatusPublicSchema = {
properties: {
id: {
+5 -1
View File
@@ -1116,11 +1116,15 @@ export class FlowsService {
* it — and that one is live immediately rather than waiting for a publish,
* because the copy is not any single flow's to hold back. Being live, it is
* audited like a publish.
*
* A node with its own code takes its input ports and settings from the
* header of ``process`` (see `follow_header`), and the answer carries the
* node when that changed it.
* @param data The data for the request.
* @param data.name
* @param data.nodeId
* @param data.requestBody
* @returns NodeStatusPublic Successful Response
* @returns NodeSourceSaved Successful Response
* @throws ApiError
*/
public static saveNodeSource(data: FlowsSaveNodeSourceData): CancelablePromise<FlowsSaveNodeSourceResponse> {
+21 -3
View File
@@ -888,6 +888,26 @@ export type NodeSource = {
missing?: boolean;
};
/**
* Whether saved code loads, and what its header changed.
*
* `node` is set when the parameters of ``process`` added, dropped or renamed
* an input port or setting. The draft moved on to `version` with it.
*/
export type NodeSourceSaved = {
id: string;
status?: string;
error?: (string | null);
health?: 'ok' | 'degraded' | 'down';
health_detail?: (string | null);
last_error?: string;
last_error_ts?: (number | null);
node?: (NodeDef_Output | null);
version?: (number | null);
};
export type health = 'ok' | 'degraded' | 'down';
/**
* Whether a node loaded, and how its connection is doing.
*/
@@ -901,8 +921,6 @@ export type NodeStatusPublic = {
last_error_ts?: (number | null);
};
export type health = 'ok' | 'degraded' | 'down';
/**
* A node type the editor can offer, with its parameter schema.
*/
@@ -1836,7 +1854,7 @@ export type FlowsSaveNodeSourceData = {
requestBody: NodeSource;
};
export type FlowsSaveNodeSourceResponse = (NodeStatusPublic);
export type FlowsSaveNodeSourceResponse = (NodeSourceSaved);
export type FlowsShareNodeData = {
name: string;