- remove asynchronous serverless function build - build serverless function synchronously instead on activate workflow or execute - add a loader on workflow code step test tab test button - add a new `ServerlessFunctionSyncStatus` `BUILDING` - add a new route to build a serverless function draft version - delay artificially execution to avoid UI flashing https://github.com/user-attachments/assets/8d958d9a-ef41-4261-999e-6ea374191e33
46 lines
1.1 KiB
TypeScript
46 lines
1.1 KiB
TypeScript
import { Field, ObjectType, registerEnumType } from '@nestjs/graphql';
|
|
|
|
import { IsObject, IsOptional } from 'class-validator';
|
|
import graphqlTypeJson from 'graphql-type-json';
|
|
|
|
export enum ServerlessFunctionExecutionStatus {
|
|
IDLE = 'IDLE',
|
|
SUCCESS = 'SUCCESS',
|
|
ERROR = 'ERROR',
|
|
}
|
|
|
|
registerEnumType(ServerlessFunctionExecutionStatus, {
|
|
name: 'ServerlessFunctionExecutionStatus',
|
|
description: 'Status of the serverless function execution',
|
|
});
|
|
|
|
@ObjectType('ServerlessFunctionExecutionResult')
|
|
export class ServerlessFunctionExecutionResultDTO {
|
|
@IsObject()
|
|
@Field(() => graphqlTypeJson, {
|
|
description: 'Execution result in JSON format',
|
|
nullable: true,
|
|
})
|
|
data?: JSON;
|
|
|
|
@Field({ description: 'Execution duration in milliseconds' })
|
|
duration: number;
|
|
|
|
@Field(() => ServerlessFunctionExecutionStatus, {
|
|
description: 'Execution status',
|
|
})
|
|
status: ServerlessFunctionExecutionStatus;
|
|
|
|
@IsObject()
|
|
@IsOptional()
|
|
@Field(() => graphqlTypeJson, {
|
|
description: 'Execution error in JSON format',
|
|
nullable: true,
|
|
})
|
|
error?: {
|
|
errorType: string;
|
|
errorMessage: string;
|
|
stackTrace: string;
|
|
};
|
|
}
|