forked from CenterForOpenScience/angular-osf
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuser-json-api.model.ts
More file actions
86 lines (74 loc) · 1.87 KB
/
user-json-api.model.ts
File metadata and controls
86 lines (74 loc) · 1.87 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
import { ResponseDataJsonApi } from '../common/json-api.model';
import { Education } from './education.model';
import { Employment } from './employment.model';
import { ExternalIdentityModel } from './external-identity.model';
import { SocialModel } from './social.model';
export type UserResponseJsonApi = ResponseDataJsonApi<UserDataJsonApi>;
export interface UserDataResponseJsonApi {
meta: {
active_flags: string[];
current_user: {
data: UserDataJsonApi | null;
};
};
}
export interface UserAcceptedTermsOfServiceJsonApi {
accepted_terms_of_service: boolean;
}
export interface UserDataErrorResponseJsonApi {
data?: UserDataJsonApi;
errors?: UserErrorResponseJsonApi[];
}
export interface UserDataJsonApi {
id: string;
type: string;
attributes: UserAttributesJsonApi;
relationships: UserRelationshipsJsonApi;
links: UserLinksJsonApi;
}
export interface UserAttributesJsonApi {
accepted_terms_of_service: boolean;
active: boolean;
allow_indexing: boolean;
can_view_reviews: boolean;
date_registered: string;
education: Education[];
employment: Employment[];
family_name: string;
full_name: string;
given_name: string;
middle_names: string;
suffix: string;
locale: string;
social: SocialModel;
external_identity: ExternalIdentityModel;
timezone: string;
}
export interface UserErrorResponseJsonApi {
source: Record<string, unknown>;
detail: string;
meta: UserErrorMetaJsonApi;
status: string;
}
export interface UserErrorMetaJsonApi {
full_name: string;
family_name: string;
given_name: string;
middle_names: string;
profile_image: string;
}
interface UserLinksJsonApi {
html: string;
iri: string;
profile_image: string;
self: string;
}
interface UserRelationshipsJsonApi {
default_region: DefaultRegionJsonApi;
}
interface DefaultRegionJsonApi {
data: {
id: string;
type: 'regions';
};
}