fix(ui): update client & nodes test code w/ new Edge type

This commit is contained in:
psychedelicious 2023-03-15 18:44:51 +11:00
parent 1c7d92dc48
commit 16442e8f15
7 changed files with 51 additions and 12 deletions

View File

@ -45,10 +45,10 @@ const NodeAPITest = () => {
}, },
}, },
edges: [ edges: [
[ {
{ node_id: 'a', field: 'image' }, source: { node_id: 'a', field: 'image' },
{ node_id: 'b', field: 'image' }, destination: { node_id: 'b', field: 'image' },
], },
], ],
}); });

View File

@ -12,6 +12,7 @@ export type { CollectInvocation } from './models/CollectInvocation';
export type { CollectInvocationOutput } from './models/CollectInvocationOutput'; export type { CollectInvocationOutput } from './models/CollectInvocationOutput';
export type { CropImageInvocation } from './models/CropImageInvocation'; export type { CropImageInvocation } from './models/CropImageInvocation';
export type { CvInpaintInvocation } from './models/CvInpaintInvocation'; export type { CvInpaintInvocation } from './models/CvInpaintInvocation';
export type { Edge } from './models/Edge';
export type { EdgeConnection } from './models/EdgeConnection'; export type { EdgeConnection } from './models/EdgeConnection';
export type { Graph } from './models/Graph'; export type { Graph } from './models/Graph';
export type { GraphExecutionState } from './models/GraphExecutionState'; export type { GraphExecutionState } from './models/GraphExecutionState';
@ -45,6 +46,7 @@ export { $CollectInvocation } from './schemas/$CollectInvocation';
export { $CollectInvocationOutput } from './schemas/$CollectInvocationOutput'; export { $CollectInvocationOutput } from './schemas/$CollectInvocationOutput';
export { $CropImageInvocation } from './schemas/$CropImageInvocation'; export { $CropImageInvocation } from './schemas/$CropImageInvocation';
export { $CvInpaintInvocation } from './schemas/$CvInpaintInvocation'; export { $CvInpaintInvocation } from './schemas/$CvInpaintInvocation';
export { $Edge } from './schemas/$Edge';
export { $EdgeConnection } from './schemas/$EdgeConnection'; export { $EdgeConnection } from './schemas/$EdgeConnection';
export { $Graph } from './schemas/$Graph'; export { $Graph } from './schemas/$Graph';
export { $GraphExecutionState } from './schemas/$GraphExecutionState'; export { $GraphExecutionState } from './schemas/$GraphExecutionState';

View File

@ -0,0 +1,17 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { EdgeConnection } from './EdgeConnection';
export type Edge = {
/**
* The connection for the edge's from node and field
*/
source: EdgeConnection;
/**
* The connection for the edge's to node and field
*/
destination: EdgeConnection;
};

View File

@ -6,7 +6,7 @@ import type { BlurInvocation } from './BlurInvocation';
import type { CollectInvocation } from './CollectInvocation'; import type { CollectInvocation } from './CollectInvocation';
import type { CropImageInvocation } from './CropImageInvocation'; import type { CropImageInvocation } from './CropImageInvocation';
import type { CvInpaintInvocation } from './CvInpaintInvocation'; import type { CvInpaintInvocation } from './CvInpaintInvocation';
import type { EdgeConnection } from './EdgeConnection'; import type { Edge } from './Edge';
import type { GraphInvocation } from './GraphInvocation'; import type { GraphInvocation } from './GraphInvocation';
import type { ImageToImageInvocation } from './ImageToImageInvocation'; import type { ImageToImageInvocation } from './ImageToImageInvocation';
import type { InpaintInvocation } from './InpaintInvocation'; import type { InpaintInvocation } from './InpaintInvocation';
@ -33,6 +33,6 @@ export type Graph = {
/** /**
* The connections between nodes and their fields in this graph * The connections between nodes and their fields in this graph
*/ */
edges?: Array<[EdgeConnection, EdgeConnection]>; edges?: Array<Edge>;
}; };

View File

@ -0,0 +1,23 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export const $Edge = {
properties: {
source: {
type: 'all-of',
description: `The connection for the edge's from node and field`,
contains: [{
type: 'EdgeConnection',
}],
isRequired: true,
},
destination: {
type: 'all-of',
description: `The connection for the edge's to node and field`,
contains: [{
type: 'EdgeConnection',
}],
isRequired: true,
},
},
} as const;

View File

@ -51,11 +51,7 @@ export const $Graph = {
edges: { edges: {
type: 'array', type: 'array',
contains: { contains: {
type: 'array', type: 'Edge',
contains: {
properties: {
},
},
}, },
}, },
}, },

View File

@ -5,6 +5,7 @@ import type { BlurInvocation } from '../models/BlurInvocation';
import type { CollectInvocation } from '../models/CollectInvocation'; import type { CollectInvocation } from '../models/CollectInvocation';
import type { CropImageInvocation } from '../models/CropImageInvocation'; import type { CropImageInvocation } from '../models/CropImageInvocation';
import type { CvInpaintInvocation } from '../models/CvInpaintInvocation'; import type { CvInpaintInvocation } from '../models/CvInpaintInvocation';
import type { Edge } from '../models/Edge';
import type { Graph } from '../models/Graph'; import type { Graph } from '../models/Graph';
import type { GraphExecutionState } from '../models/GraphExecutionState'; import type { GraphExecutionState } from '../models/GraphExecutionState';
import type { GraphInvocation } from '../models/GraphInvocation'; import type { GraphInvocation } from '../models/GraphInvocation';
@ -197,7 +198,7 @@ export class SessionsService {
*/ */
public static addEdge( public static addEdge(
sessionId: string, sessionId: string,
requestBody: Array<any>, requestBody: Edge,
): CancelablePromise<GraphExecutionState> { ): CancelablePromise<GraphExecutionState> {
return __request(OpenAPI, { return __request(OpenAPI, {
method: 'POST', method: 'POST',