Files
twenty/packages/twenty-server/src/engine/metadata-modules/serverless-function/dtos/update-serverless-function.input.ts
martmull f8f9bb2b78 Serverless function timeout concerns (#9689)
closes https://github.com/twentyhq/core-team-issues/issues/242
- unify timeout behavior between local and lambda
- add timeout in serverless entity
- set timeout default to 300s (5min)
2025-01-17 13:49:02 +00:00

46 lines
828 B
TypeScript

import { Field, InputType } from '@nestjs/graphql';
import {
IsNotEmpty,
IsNumber,
IsObject,
IsOptional,
IsString,
IsUUID,
Max,
Min,
} from 'class-validator';
import graphqlTypeJson from 'graphql-type-json';
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
@InputType()
export class UpdateServerlessFunctionInput {
@Field(() => UUIDScalarType, {
description: 'Id of the serverless function to execute',
})
@IsNotEmpty()
@IsUUID()
id: string;
@IsString()
@Field()
name: string;
@IsString()
@Field({ nullable: true })
@IsOptional()
description?: string;
@IsNumber()
@Field({ nullable: true })
@Min(1)
@Max(900)
@IsOptional()
timeoutSeconds?: number;
@Field(() => graphqlTypeJson)
@IsObject()
code: JSON;
}