-
-
Notifications
You must be signed in to change notification settings - Fork 286
/
relationship.js
114 lines (105 loc) · 2.82 KB
/
relationship.js
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
/*
* @flow strict
* Copyright (C) 2017 MetaBrainz Foundation
*
* This file is part of MusicBrainz, the open internet music database,
* and is licensed under the GPL version 2, or (at your option) any
* later version: http://www.gnu.org/licenses/gpl-2.0.txt
*/
/* eslint-disable no-unused-vars */
declare type LinkAttrT = {
+credited_as?: string,
+text_value?: string,
type: {+gid: string} | LinkAttrTypeT,
+typeID: number,
+typeName: string,
};
declare type LinkAttrTypeT = {
...OptionTreeT<'link_attribute_type'>,
+children?: $ReadOnlyArray<LinkAttrTypeT>,
+creditable: boolean,
+free_text: boolean,
+instrument_aliases?: $ReadOnlyArray<string>,
+instrument_comment?: string,
+instrument_type_id?: number,
+instrument_type_name?: string,
l_description?: string,
l_name?: string,
level?: number,
+root_gid: string,
+root_id: number,
};
declare type LinkTypeAttrTypeT = $ReadOnly<{
...TypeRoleT<LinkAttrTypeT>,
+max: number | null,
+min: number | null,
}>;
declare type LinkTypeT = {
...OptionTreeT<'link_type'>,
+attributes: {+[typeId: StrOrNum]: LinkTypeAttrTypeT},
+cardinality0: number,
+cardinality1: number,
+children?: $ReadOnlyArray<LinkTypeT>,
+deprecated: boolean,
+documentation: string | null,
+examples: $ReadOnlyArray<{
+name: string,
+relationship: RelationshipT,
}> | null,
+has_dates: boolean,
+id: number,
/*
* The l_* properties are not sent by the server, but cached client-
* side by the relationship editor.
*/
l_description?: string,
l_link_phrase?: string,
l_name?: string,
l_reverse_link_phrase?: string,
+link_phrase: string,
+long_link_phrase: string,
+orderable_direction: number,
+reverse_link_phrase: string,
+root_id: number | null,
+type0: RelatableEntityTypeT,
+type1: RelatableEntityTypeT,
};
declare type PagedLinkTypeGroupT = {
+backward: boolean,
+is_loaded: boolean,
+limit: number,
+link_type_id: number,
+offset: number,
+relationships: $ReadOnlyArray<RelationshipT>,
+total_relationships: number,
};
declare type PagedTargetTypeGroupT = {
+[linkTypeIdAndSourceColumn: string]: PagedLinkTypeGroupT,
};
declare type RelationshipT = $ReadOnly<{
...DatePeriodRoleT,
...PendingEditsRoleT,
+attributes: $ReadOnlyArray<LinkAttrT>,
+backward: boolean,
+entity0?: ?RelatableEntityT,
+entity0_credit: string,
+entity0_id: number,
+entity1?: ?RelatableEntityT,
+entity1_credit: string,
+entity1_id: number,
+id: number,
+linkOrder: number,
+linkTypeID: number,
+source_id: number | null,
+source_type: RelatableEntityTypeT,
+target: RelatableEntityT,
+target_type: RelatableEntityTypeT,
+verbosePhrase: string,
}>;
declare type SeededRelationshipT = $ReadOnly<{
...RelationshipT,
+entity0_id: number | null,
+entity1_id: number | null,
+id: null,
+linkTypeID: number | null,
}>;