Files
twenty/packages/twenty-server/src/workspace/workspace-sync-metadata/standard-objects/api-key.object-metadata.ts
T
2023-12-10 18:10:54 +01:00

45 lines
1.1 KiB
TypeScript

import { FieldMetadataType } from 'src/metadata/field-metadata/field-metadata.entity';
import {
ObjectMetadata,
FieldMetadata,
IsNullable,
IsSystem,
} from 'src/workspace/workspace-sync-metadata/decorators/metadata.decorator';
import { BaseObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/base.object-metadata';
@ObjectMetadata({
namePlural: 'apiKeys',
labelSingular: 'Api Key',
labelPlural: 'Api Keys',
description: 'An api key',
icon: 'IconRobot',
})
@IsSystem()
export class ApiKeyObjectMetadata extends BaseObjectMetadata {
@FieldMetadata({
type: FieldMetadataType.TEXT,
label: 'Name',
description: 'ApiKey name',
icon: 'IconLink',
defaultValue: { value: '' },
})
name: string;
@FieldMetadata({
type: FieldMetadataType.DATE_TIME,
label: 'Expiration date',
description: 'ApiKey expiration date',
icon: 'IconCalendar',
})
expiresAt: Date;
@FieldMetadata({
type: FieldMetadataType.DATE_TIME,
label: 'Revocation date',
description: 'ApiKey revocation date',
icon: 'IconCalendar',
})
@IsNullable()
revokedAt?: Date;
}