+export const getUserDisplayName = (user: User, withEmail = false, withUuid = false) => {
+ const displayName = getUserFullname(user) || user.email || user.username || user.uuid;
+ let parts: string[] = [displayName];
+ if (withEmail && user.email && displayName !== user.email) {
+ parts.push(`<${user.email}>`);
+ }
+ if (withUuid) {
+ parts.push(`(${user.uuid})`);
+ }
+ return parts.join(' ');
+};
+
+export const getUserDetailsString = (user: User) => {
+ let parts: string[] = [];
+ user.username.length && parts.push(user.username);
+ user.email.length && parts.push(`<${user.email}>`);
+ user.uuid.length && parts.push(`(${user.uuid})`);
+ return parts.join(' ');
+};
+
+export interface UserResource extends Resource, User {