-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuser-profile.interface.ts
More file actions
133 lines (120 loc) · 2.61 KB
/
user-profile.interface.ts
File metadata and controls
133 lines (120 loc) · 2.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
// Copyright The Linux Foundation and each contributor to LFX.
// SPDX-License-Identifier: MIT
/**
* Minimal user identity fields for displaying initials
*/
export interface UserInitialsInput {
first_name?: string;
last_name?: string;
email?: string;
}
export interface UserProfile {
id: string;
email: string;
first_name: string | null;
last_name: string | null;
username: string | null;
created_at: string;
updated_at: string;
}
/**
* Combined user profile and details
*/
export interface CombinedProfile {
user: UserProfile;
profile: UserMetadata | null;
}
/**
* User email entry from auth-service
*/
export interface UserEmail {
email: string;
verified: boolean;
user_id?: string;
}
/**
* Combined email management data from auth-service
*/
export interface EmailManagementData {
primary_email: string;
alternate_emails: UserEmail[];
}
/**
* Request to send an OTP to a new email address (step 1 of add-email flow)
*/
export interface AddEmailRequest {
email: string;
}
/**
* Request to change user password
*/
export interface ChangePasswordRequest {
current_password: string;
new_password: string;
}
/**
* Request to send password reset email
*/
export interface PasswordResetRequest {
email: string;
}
/**
* Password strength analysis result
*/
export interface PasswordStrength {
score: number; // 0-4 (weak to strong)
label: 'weak' | 'fair' | 'good' | 'strong';
requirements: {
minLength: boolean;
hasLowercase: boolean;
hasUppercase: boolean;
hasNumbers: boolean;
hasSpecialChars: boolean;
meetsCriteria: boolean; // true if 3 of 4 character types are present
};
}
/**
* User metadata object for profile updates
*/
export interface UserMetadata {
name?: string;
given_name?: string;
family_name?: string;
job_title?: string;
organization?: string;
country?: string;
state_province?: string;
city?: string;
address?: string;
postal_code?: string;
phone_number?: string;
t_shirt_size?: string;
picture?: string;
zoneinfo?: string;
}
/**
* Frontend request for updating user profile via NATS
* Only contains user_metadata - backend extracts token/user_id from OIDC
*/
export interface ProfileUpdateRequest {
user_metadata: UserMetadata;
}
/**
* User metadata update request payload
*/
export interface UserMetadataUpdateRequest {
token: string;
username: string;
user_metadata?: UserMetadata;
}
/**
* User metadata update response payload
*/
export interface UserMetadataUpdateResponse {
success: boolean;
username: string;
message?: string;
updated_fields?: string[];
data?: UserMetadata;
error?: string;
}