2023-01-24 09:10:54 +00:00
|
|
|
import { ObjectType, ID, Field, InputType } from '@nestjs/graphql';
|
2022-12-07 15:00:02 +00:00
|
|
|
|
|
|
|
|
@ObjectType()
|
|
|
|
|
export class User {
|
|
|
|
|
@Field(() => ID, {
|
2022-12-22 16:25:16 +00:00
|
|
|
description: 'UID of the user',
|
2022-12-07 15:00:02 +00:00
|
|
|
})
|
|
|
|
|
uid: string;
|
|
|
|
|
|
|
|
|
|
@Field({
|
|
|
|
|
nullable: true,
|
2022-12-22 16:25:16 +00:00
|
|
|
description: 'Displayed name of the user',
|
2022-12-07 15:00:02 +00:00
|
|
|
})
|
|
|
|
|
displayName?: string;
|
|
|
|
|
|
|
|
|
|
@Field({
|
|
|
|
|
nullable: true,
|
2022-12-22 16:25:16 +00:00
|
|
|
description: 'Email of the user',
|
2022-12-07 15:00:02 +00:00
|
|
|
})
|
|
|
|
|
email?: string;
|
|
|
|
|
|
|
|
|
|
@Field({
|
|
|
|
|
nullable: true,
|
2022-12-22 16:25:16 +00:00
|
|
|
description: 'URL to the profile photo of the user',
|
2022-12-07 15:00:02 +00:00
|
|
|
})
|
|
|
|
|
photoURL?: string;
|
2022-12-22 06:46:03 +00:00
|
|
|
|
|
|
|
|
@Field({
|
|
|
|
|
nullable: true,
|
2022-12-22 16:25:16 +00:00
|
|
|
description: 'Stringified current REST session for logged-in User',
|
2022-12-22 06:46:03 +00:00
|
|
|
})
|
|
|
|
|
currentRESTSession?: string;
|
|
|
|
|
|
|
|
|
|
@Field({
|
|
|
|
|
nullable: true,
|
2022-12-22 16:25:16 +00:00
|
|
|
description: 'Stringified current GraphQL session for logged-in User',
|
2022-12-22 06:46:03 +00:00
|
|
|
})
|
|
|
|
|
currentGQLSession?: string;
|
2022-12-07 15:00:02 +00:00
|
|
|
}
|
2023-01-24 09:10:54 +00:00
|
|
|
|
|
|
|
|
@InputType()
|
|
|
|
|
export class UpdateUserInput {
|
|
|
|
|
@Field({
|
|
|
|
|
nullable: true,
|
|
|
|
|
name: 'displayName',
|
|
|
|
|
description: 'Displayed name of the user (if given)',
|
|
|
|
|
})
|
|
|
|
|
displayName?: string;
|
|
|
|
|
|
|
|
|
|
@Field({
|
|
|
|
|
nullable: true,
|
|
|
|
|
name: 'photoURL',
|
|
|
|
|
description: 'URL to the profile photo of the user (if given)',
|
|
|
|
|
})
|
|
|
|
|
photoURL?: string;
|
|
|
|
|
|
|
|
|
|
@Field({
|
|
|
|
|
nullable: true,
|
|
|
|
|
name: 'currentRESTSession',
|
|
|
|
|
description: 'JSON string of the saved REST session',
|
|
|
|
|
})
|
|
|
|
|
currentRESTSession?: string;
|
|
|
|
|
|
|
|
|
|
@Field({
|
|
|
|
|
nullable: true,
|
|
|
|
|
name: 'currentGQLSession',
|
|
|
|
|
description: 'JSON string of the saved GQL session',
|
|
|
|
|
})
|
|
|
|
|
currentGQLSession?: string;
|
|
|
|
|
}
|