Files
hoppscotch/packages/hoppscotch-backend/src/user/user.model.ts
Balu Babu 4ce9e67460 chore: added global lint and test commands to backend package (#81)
* chore: added global lint and test commands to backend package

* chore: removed lint command from root scope execution
2023-04-10 12:25:45 +05:30

59 lines
1.1 KiB
TypeScript

import { ObjectType, ID, Field, registerEnumType } from '@nestjs/graphql';
@ObjectType()
export class User {
@Field(() => ID, {
description: 'UID of the user',
})
uid: string;
@Field({
nullable: true,
description: 'Name of the user (if fetched)',
})
displayName?: string;
@Field({
nullable: true,
description: 'Email of the user',
})
email?: string;
@Field({
nullable: true,
description: 'URL to the profile photo of the user (if fetched)',
})
photoURL?: string;
@Field({
description: 'Flag to determine if user is an Admin or not',
})
isAdmin: boolean;
@Field({
description: 'Date when the user account was created',
})
createdOn: Date;
@Field({
nullable: true,
description: 'Stringified current REST session for logged-in User',
})
currentRESTSession?: string;
@Field({
nullable: true,
description: 'Stringified current GraphQL session for logged-in User',
})
currentGQLSession?: string;
}
export enum SessionType {
REST = 'REST',
GQL = 'GQL',
}
registerEnumType(SessionType, {
name: 'SessionType',
});