Files
twenty/packages/twenty-server/src/engine/metadata-modules/remote-server/dtos/remote-server.dto.ts
T
Félix Malfait 8b4b9ef8da Change type import rule (#13751)
Forcing "type" to be explicit, works best will rollup on the frontend to
exclude depdendencies
2025-08-08 01:27:05 +02:00

48 lines
1.2 KiB
TypeScript

import { Field, HideField, ObjectType } from '@nestjs/graphql';
import { IsOptional } from 'class-validator';
import GraphQLJSON from 'graphql-type-json';
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
import { UserMappingOptionsDTO } from 'src/engine/metadata-modules/remote-server/dtos/user-mapping-dto';
import {
ForeignDataWrapperOptions,
type RemoteServerType,
} from 'src/engine/metadata-modules/remote-server/remote-server.entity';
@ObjectType('RemoteServer')
export class RemoteServerDTO<T extends RemoteServerType> {
@Field(() => UUIDScalarType)
id: string;
@Field(() => UUIDScalarType)
foreignDataWrapperId: string;
@Field(() => String)
foreignDataWrapperType: T;
@Field(() => String)
label: string;
@IsOptional()
@Field(() => GraphQLJSON, { nullable: true })
foreignDataWrapperOptions?: ForeignDataWrapperOptions<T>;
@IsOptional()
@Field(() => UserMappingOptionsDTO, { nullable: true })
userMappingOptions?: UserMappingOptionsDTO;
@IsOptional()
@Field(() => String, { nullable: true })
schema?: string;
@HideField()
workspaceId: string;
@Field()
createdAt: Date;
@Field()
updatedAt: Date;
}