import { Field, HideField, InputType } from '@nestjs/graphql'; import { IsBoolean, IsNotEmpty, IsNumber, IsObject, IsOptional, IsString, Max, Min, } from 'class-validator'; import graphqlTypeJson from 'graphql-type-json'; import { Sources } from 'twenty-shared/types'; @InputType() export class CreateLogicFunctionInput { @IsString() @IsNotEmpty() @Field() name: string; @IsString() @IsOptional() @Field({ nullable: true }) description?: string; @IsNumber() @Field({ nullable: true }) @Min(1) @Max(900) @IsOptional() timeoutSeconds?: number; @HideField() applicationId?: string; @HideField() universalIdentifier?: string; @Field(() => graphqlTypeJson, { nullable: true }) @IsObject() @IsOptional() code?: Sources; @IsString() @Field({ nullable: true }) @IsOptional() handlerName?: string; @IsString() @Field({ nullable: true }) @IsOptional() sourceHandlerPath?: string; @IsString() @Field({ nullable: true }) @IsOptional() builtHandlerPath?: string; @Field(() => graphqlTypeJson, { nullable: true }) @IsObject() @IsOptional() toolInputSchema?: object; @IsBoolean() @Field({ nullable: true }) @IsOptional() isTool?: boolean; }