-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathSTRUCTS
200 lines (177 loc) · 6.01 KB
/
STRUCTS
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
#
# Copyright (C) 2013 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
-----------------------------------------------------------------------------
This document describes data structures that are serialized and exchanged by
middleware.
-----------------------------------------------------------------------------
Result (returned by serialize()):
=================================
'attrs' : {
'uri' : string
'title' : string
'art' : string
'dnd_uri' : string
+ any custom key-value attribute added by scope author.
},
'internal' : {
'result' : dictionary (serialized Result), optional
'flags' : integer, optional (activation/preview flags defined by ResultImpl::Flags enum)
'origin' : string (scope id)
}
CategorisedResult (returned by serialize()):
=======================================
'attrs' : {
// all Result's attributes
},
'internal' : {
'cat_id' : string
+ all Result's internal values
}
Category (returned by serialize()):
=====================================
'id' : string
'title' : string
'icon' : string
'renderer_template' : string
Department (returned by serialize()):
=====================================
'query' : dictionary (serialized Query)
'label' : string
'alt_label' : string, optional
'departments' : array of dictionaries (serialized Departments), optional
'has_subdepartments' : bool (optional)
ScopeMetadata (returned by serialize()):
=====================================
'scope_id' : string
'proxy' : dictionary
'identity' : string
'endpoint' : string
'display_name' : string
'description' : string
'scope_dir' : string, optional
'art' : string, optional
'icon' : string, optional
'search_hint' : string, optional
'hot_key' : string, optional
'invisible' : bool, optional
'appearance_attributes' : dictionary, optional
'results_ttl_type' : int, optional
'settings_definitions' : dictionary, optional
'location_data_needed' : bool, optional
'child_scopes' : array of strings, optional
'version' : int, optional
'keywords' : set of strings, optional
'is_aggregator' : bool, optional
Query (returned by serialize())
===============================
'scope' : string
'query_string' : string
'department_id' : string
'filter_state' : dictionary (serialized FilterState)
Link (returned by serialize())
==============================
'label' : string
'query' : Query
Annotation (returned by serialize())
====================================
'type' : string
'label' : string, optional
'icon' : string, optional
'links' : array of Links
FilterState (returned by serialize())
=====================================
filter_id : Variant (arbitrary, depends on filter type)
FilterGroup
===========
'id' : string
'label' : string
FilterOption
============
'id' : string
'label' : string
OptionSelectorFilter
====================
'id' : string
'filter_type' : string
'display_hints': int, optional
'filter_group' : string, optional
OptionSelectorFilter (FilterBase)
=================================
'id' : string
'filter_type' : "option_selector"
'label' : string
'multi_select' : bool
'options' : array of FilterOption
RangeInputFilter
================
'id' : string
'default_start_value' : variant (int, double, null)
'default_end_value' : variant (int, double, null)
'start_prefix_label' : string
'start_postfix_label' : string
'end_prefix_label' : string
'end_postfix_label' : string
'central_label' : string
'filter_group' : string, optional
Filters
=======
'filter' : array of filters (implementations of FilterBase)
PreviewResult (returned by serialize())
=======================================
'id' : string
'type' : string
'attributes' : dict
'components' : dict
PushRequest (capnproto structure)
=================================
result : dictionary with:
"category" and/or
"result" or
"annotation" or
"departments" and "current_department" or
"columns"
key and
serialized Category / CategorisedResult / Annotation / DepartmentList / ColumnLayoutList respectively.
ActivationResponse (returned by serialize())
============================================
'status' : int (corresponds to ActivationResponse::Status enum)
'scope_data' : variant
'query' : variant (optional)
'updated_result' : variant (optional)
'updated_widgets': variant (optional)
QueryMetadata (returned by serialize())
=======================================
'type' : string (metadata type)
'locale' : string
'form_factor' : string
'hints' : dict
'internet_connectivity' : bool (optional)
SearchMetadata (returned by serialize())
========================================
all QueryMetadata attributes
'cardinality' : int
'location' : dict
ActionMetadata (returned by serialize())
========================================
all QueryMetadata attributes
'scope_data' : variant
CannedQuery (returned by serialize())
=====================================
'scope' : string
'query_string' : string
'department_id' : string
'filter_state' : variant
'data' : variant (optional)