-
Notifications
You must be signed in to change notification settings - Fork 6
/
schema.json
265 lines (265 loc) · 8.34 KB
/
schema.json
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
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
{
"swagger": "2.0",
"info": {
"description": "Navigation helper",
"title": "Electrode Native generic navigation api (V2.0)"
},
"produces": [
"application/json"
],
"paths": {
"/navigate": {
"post": {
"tags": [
"EnNavigation"
],
"operationId": "navigate",
"parameters": [
{
"name": "route",
"in": "body",
"description": "Route object that details where to navigate next",
"required": true,
"schema": {
"$ref": "#/definitions/ErnNavRoute"
}
}
]
}
},
"/update": {
"post": {
"tags": [
"EnNavigation"
],
"operationId": "update",
"parameters": [
{
"name": "updatedRoute",
"in": "body",
"description": "Updated route object. This API expects that the path of the update call is unchanged from the last navigate call. It is likely that the native implementation will reject your update call if the path is different from the last navigate call.",
"required": true,
"schema": {
"$ref": "#/definitions/ErnNavRoute"
}
}
]
}
},
"/finish": {
"post": {
"tags": [
"EnNavigation"
],
"operationId": "finish",
"parameters": [
{
"name": "finalPayload",
"in": "body",
"description": "Optional json string payload to pass when a flow is completed. Use this to pass in any info needed by the RN view host on the native side",
"required": false,
"schema": {
"type": "string"
}
}
]
}
},
"/back": {
"post": {
"tags": [
"EnNavigation"
],
"operationId": "back",
"parameters": [
{
"name": "route",
"in": "body",
"description": "Route object that details where to navigate next. Use this when you want to go back to a previous screen, it could be any previous screen in a given flow. If the given route is not found on the stack, native layer may push a new screen on top.",
"required": true,
"schema": {
"$ref": "#/definitions/ErnNavRoute"
}
}
]
}
},
"/events": {
"event": {
"tags": [
"EnNavigation"
],
"description": "Fire this event when a navigation bar button is clicked",
"operationId": "OnNavButtonClick",
"parameters": [
{
"name": "buttonId",
"in": "path",
"description": "Id of the button that is being clicked",
"required": true,
"type": "string"
}
]
}
},
"/events-navigation": {
"event": {
"tags": [
"EnNavigation"
],
"description": "Generic navigation related events",
"operationId": "NavEvent",
"parameters": [
{
"name": "eventData",
"in": "body",
"description": "navigation event data",
"required": true,
"schema": {
"$ref": "#/definitions/NavEventData"
}
}
]
}
}
},
"definitions": {
"ErnNavRoute": {
"properties": {
"path": {
"type": "string",
"description": "Path of the Route. Mostly the name of the container (defined by the native app) or the MiniApp name. The content of the path is mainly determined by the native implementation of the API"
},
"jsonPayload": {
"type": "string",
"description": "Optional Payload (represented as JSON String) needed by the screen you are trying to navigate to."
},
"navigationBar": {
"$ref": "#/definitions/NavigationBar"
},
"overlay": {
"type": "boolean",
"description": "If set to true, the view component would be displayed over a transparent theme. Default value is false."
},
"refresh": {
"type": "boolean",
"description": "Set to true if you would like to re-render a component while navigating back to it."
},
"replace": {
"type": "boolean",
"description": "Set to true if you would like to replace the last page with the new one."
}
},
"required": [
"path"
]
},
"NavigationBarButton": {
"properties": {
"title": {
"type": "string",
"description": "Button title if any."
},
"icon": {
"type": "string",
"description": "Icon resource identifier that can be used find the icon"
},
"tint": {
"type": "string",
"description": "Specifies a tint for the icon. Supported formats: #RRGGBB, #AARRGGBB. Supported values: red, blue, green, black, white, gray, cyan, magenta, yellow, lightgray, darkgray, grey, lightgrey, darkgrey, aqua, fuchsia, lime, maroon, navy, olive, purple, silver and teal"
},
"id": {
"type": "string",
"description": "Id of the button, this namespace will be used as an identifier when a button click event is emitted."
},
"location": {
"type": "string",
"description": "@Deprecated This is now Deprecated with the introduction of NavigationBarLeftButton. Allowed enums: left, right"
},
"disabled": {
"type": "boolean",
"description": "Default to false. If set to true the button will be disabled(non-clickable)"
},
"adaLabel": {
"type": "string",
"description": "Accessibility label"
}
},
"required": [
"id"
]
},
"NavigationBarLeftButton": {
"properties": {
"title": {
"type": "string",
"description": "Button title if any, applied only for iOS."
},
"icon": {
"type": "string",
"description": "Icon resource identifier that can be used find the icon"
},
"tint": {
"type": "string",
"description": "Specifies a tint for the icon. Supported formats: #RRGGBB, #AARRGGBB. Supported values: red, blue, green, black, white, gray, cyan, magenta, yellow, lightgray, darkgray, grey, lightgrey, darkgrey, aqua, fuchsia, lime, maroon, navy, olive, purple, silver and teal"
},
"id": {
"type": "string",
"description": "Id of the button, this namespace will be used as an identifier when a button click event is emitted. If included, click will not be handled by native instead an event will be fired for react native to handle the backpress."
},
"disabled": {
"type": "boolean",
"description": "Default to false. If set to true the button will be disabled(non-clickable). Android will remove the left icon indicator"
},
"adaLabel": {
"type": "string",
"description": "Accessibility label"
}
}
},
"NavigationBar": {
"properties": {
"title": {
"type": "string",
"description": "Title of Nav Bar"
},
"hide": {
"type": "boolean",
"description": "Use to hide the navigation bar."
},
"buttons": {
"type": "array",
"items": {
"$ref": "#/definitions/NavigationBarButton"
},
"description": "Right button properties"
},
"leftButton": {
"$ref": "#/definitions/NavigationBarLeftButton"
}
},
"required": [
"title"
]
},
"NavEventData": {
"properties": {
"eventType": {
"type": "string",
"description": "Type of the event. Supported values [BUTTON_CLICK, DID_FOCUS, DID_BLUR]"
},
"viewId": {
"type": "string",
"description": "MiniApp view identifier to indicate the view instance that is firing the event. This is needed when more than one instance of the same component is mounted."
},
"jsonPayload": {
"type": "string",
"description": "optional payload associated with the event"
}
},
"required": [
"eventType"
]
}
}
}