wisp-schema 0.18.1 → 0.19.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/canary-nouns.json +71 -0
- data/canary-wisp.json +495 -0
- data/lib/wisp-schema.rb +30 -2
- metadata +33 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e5a7f8e544ab5bf31e4b34c5af1af937b85bd805d7fadfe30f26d0a46ce0eb03
|
4
|
+
data.tar.gz: b96f5b664e0d3d6fd37b18f477fe94bef8fbae77681072364458edaf5ee2b6f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 289a662106f9ca0dd837bbb944da20c08d9b999425e31b34a3fc13020009f08c59da41490dddcf97d70b5f41815f78efaf9bde9bb5f4c909c912dfed727a0797
|
7
|
+
data.tar.gz: bcaf5486437ef4f25cb04fc3463fb466ff6f80bdd6a8fab38c81764ca94be149ffa5b17799804e53c84c402487993a29250214072e7c2c1a05279b945e3ba355
|
data/canary-nouns.json
ADDED
@@ -0,0 +1,71 @@
|
|
1
|
+
{
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
3
|
+
"definitions": {
|
4
|
+
"ui_element": {
|
5
|
+
"type": "object",
|
6
|
+
"title": "UI Element",
|
7
|
+
"description": "Any other UI Element",
|
8
|
+
"properties": {
|
9
|
+
"type": {
|
10
|
+
"enum": ["ui_element"]
|
11
|
+
},
|
12
|
+
"element": {"title": "Element", "type": "string"},
|
13
|
+
"focus_x": {"title": "Focus offset for x-axis from top left corner", "type": "integer", "options": {"hidden": true}},
|
14
|
+
"focus_y": {"title": "Focus offset for y-axis from top left corner", "type": "integer", "options": {"hidden": true}},
|
15
|
+
"match_mode": {
|
16
|
+
"enum": ["pixel", "pixel_and_ocr"]
|
17
|
+
},
|
18
|
+
"ocr_expression": {
|
19
|
+
"title": "Expression to use for text matching",
|
20
|
+
"type": "string",
|
21
|
+
"maxLength": 999
|
22
|
+
},
|
23
|
+
"ocr_status": {
|
24
|
+
"title": "OCR result description",
|
25
|
+
"enum": ["SUCCESS", "TOO_MUCH_TEXT", "NO_TEXT"]
|
26
|
+
},
|
27
|
+
"ocr_box": {
|
28
|
+
"title": "Text content bounding box",
|
29
|
+
"type": "object",
|
30
|
+
"properties": {
|
31
|
+
"x": {"type": "integer"},
|
32
|
+
"y": {"type": "integer"},
|
33
|
+
"w": {"type": "integer"},
|
34
|
+
"h": {"type": "integer"}
|
35
|
+
}
|
36
|
+
}
|
37
|
+
},
|
38
|
+
"additionalProperties": false,
|
39
|
+
"required": ["type", "element"]
|
40
|
+
},
|
41
|
+
"ui_element_reference": {
|
42
|
+
"type": "object",
|
43
|
+
"title": "UI Element Reference",
|
44
|
+
"description": "A UI Element stored in the database",
|
45
|
+
"properties": {
|
46
|
+
"type": {
|
47
|
+
"enum": ["ui_element_reference"]
|
48
|
+
},
|
49
|
+
"id": {"title": "UI Element ID", "type": "integer"}
|
50
|
+
},
|
51
|
+
"additionalProperties": false,
|
52
|
+
"required": ["type", "id"]
|
53
|
+
}
|
54
|
+
},
|
55
|
+
"type": "object",
|
56
|
+
"title": "Single Wisp Noun",
|
57
|
+
"properties": {
|
58
|
+
"version": {
|
59
|
+
"type": "string",
|
60
|
+
"title": "Version"
|
61
|
+
},
|
62
|
+
"noun": {
|
63
|
+
"oneOf": [
|
64
|
+
{"$ref": "#/definitions/ui_element"},
|
65
|
+
{"$ref": "#/definitions/ui_element_reference"}
|
66
|
+
]
|
67
|
+
}
|
68
|
+
},
|
69
|
+
"additionalProperties": false,
|
70
|
+
"required": ["version", "noun"]
|
71
|
+
}
|
data/canary-wisp.json
ADDED
@@ -0,0 +1,495 @@
|
|
1
|
+
{
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
3
|
+
"definitions": {
|
4
|
+
"noun": {
|
5
|
+
"title": "Wisp Noun",
|
6
|
+
"oneOf": [
|
7
|
+
{"$ref": "#/definitions/ui_element"},
|
8
|
+
{"$ref": "#/definitions/ui_element_reference"}
|
9
|
+
]
|
10
|
+
},
|
11
|
+
"ui_element": {
|
12
|
+
"type": "object",
|
13
|
+
"title": "UI Element",
|
14
|
+
"description": "Any other UI Element",
|
15
|
+
"properties": {
|
16
|
+
"type": {
|
17
|
+
"enum": ["ui_element"]
|
18
|
+
},
|
19
|
+
"element": {"title": "Element", "type": "string"},
|
20
|
+
"focus_x": {"title": "Focus offset for x-axis from top left corner", "type": "integer", "options": {"hidden": true}},
|
21
|
+
"focus_y": {"title": "Focus offset for y-axis from top left corner", "type": "integer", "options": {"hidden": true}},
|
22
|
+
"match_mode": {
|
23
|
+
"enum": ["pixel", "pixel_and_ocr"]
|
24
|
+
},
|
25
|
+
"ocr_expression": {
|
26
|
+
"title": "Expression to use for text matching",
|
27
|
+
"type": "string",
|
28
|
+
"maxLength": 999
|
29
|
+
},
|
30
|
+
"ocr_status": {
|
31
|
+
"title": "OCR result description",
|
32
|
+
"enum": ["SUCCESS", "TOO_MUCH_TEXT", "NO_TEXT"]
|
33
|
+
},
|
34
|
+
"ocr_box": {
|
35
|
+
"title": "Text content bounding box",
|
36
|
+
"type": "object",
|
37
|
+
"properties": {
|
38
|
+
"x": {"type": "integer"},
|
39
|
+
"y": {"type": "integer"},
|
40
|
+
"w": {"type": "integer"},
|
41
|
+
"h": {"type": "integer"}
|
42
|
+
}
|
43
|
+
}
|
44
|
+
},
|
45
|
+
"additionalProperties": false,
|
46
|
+
"required": ["type", "element"]
|
47
|
+
},
|
48
|
+
"ui_element_reference": {
|
49
|
+
"type": "object",
|
50
|
+
"title": "UI Element Reference",
|
51
|
+
"description": "A UI Element stored in the database",
|
52
|
+
"properties": {
|
53
|
+
"type": {
|
54
|
+
"enum": ["ui_element_reference"]
|
55
|
+
},
|
56
|
+
"id": {"title": "UI Element ID", "type": "integer"}
|
57
|
+
},
|
58
|
+
"additionalProperties": false,
|
59
|
+
"required": ["type", "id"]
|
60
|
+
},
|
61
|
+
"verb": {
|
62
|
+
"title": "Wisp Verb",
|
63
|
+
"oneOf": [
|
64
|
+
{"$ref": "#/definitions/click"},
|
65
|
+
{"$ref": "#/definitions/double_click"},
|
66
|
+
{"$ref": "#/definitions/fill"},
|
67
|
+
{"$ref": "#/definitions/type"},
|
68
|
+
{"$ref": "#/definitions/send_key"},
|
69
|
+
{"$ref": "#/definitions/hover"},
|
70
|
+
{"$ref": "#/definitions/dropdown_select"},
|
71
|
+
{"$ref": "#/definitions/checkbox_check"},
|
72
|
+
{"$ref": "#/definitions/checkbox_uncheck"},
|
73
|
+
{"$ref": "#/definitions/refresh"},
|
74
|
+
{"$ref": "#/definitions/navigate"},
|
75
|
+
{"$ref": "#/definitions/navigate_new_tab"},
|
76
|
+
{"$ref": "#/definitions/navigate_incognito_tab"},
|
77
|
+
{"$ref": "#/definitions/close_tab"},
|
78
|
+
{"$ref": "#/definitions/scroll"},
|
79
|
+
{"$ref": "#/definitions/sleep"},
|
80
|
+
{"$ref": "#/definitions/drag_and_drop"},
|
81
|
+
{"$ref": "#/definitions/click_and_hold"},
|
82
|
+
{"$ref": "#/definitions/plain_language"},
|
83
|
+
{"$ref": "#/definitions/custom_action"},
|
84
|
+
{"$ref": "#/definitions/see"},
|
85
|
+
{"$ref": "#/definitions/disappear"},
|
86
|
+
{"$ref": "#/definitions/loaded"},
|
87
|
+
{"$ref": "#/definitions/plain_language_assertion"}
|
88
|
+
]
|
89
|
+
},
|
90
|
+
"click": {
|
91
|
+
"type": "object",
|
92
|
+
"title": "Click",
|
93
|
+
"description": "Clicks on the UI element",
|
94
|
+
"properties": {
|
95
|
+
"action": {
|
96
|
+
"enum": ["click"]
|
97
|
+
},
|
98
|
+
"custom_action_id": {"title": "Custom Action ID", "type": "integer"},
|
99
|
+
"target": {
|
100
|
+
"title": "Target",
|
101
|
+
"$ref": "#/definitions/noun"
|
102
|
+
},
|
103
|
+
"button": {"title": "Mouse Button", "type": "string", "enum": ["left", "middle", "right"]}
|
104
|
+
},
|
105
|
+
"additionalProperties": false,
|
106
|
+
"required": ["action", "target"]
|
107
|
+
},
|
108
|
+
"double_click": {
|
109
|
+
"type": "object",
|
110
|
+
"title": "Double Click",
|
111
|
+
"description": "Double-clicks on the UI element",
|
112
|
+
"properties": {
|
113
|
+
"action": {
|
114
|
+
"enum": ["double_click"]
|
115
|
+
},
|
116
|
+
"custom_action_id": {"title": "Custom Action ID", "type": "integer"},
|
117
|
+
"target": {
|
118
|
+
"title": "Target",
|
119
|
+
"$ref": "#/definitions/noun"
|
120
|
+
}
|
121
|
+
},
|
122
|
+
"additionalProperties": false,
|
123
|
+
"required": ["action", "target"]
|
124
|
+
},
|
125
|
+
"fill": {
|
126
|
+
"type": "object",
|
127
|
+
"title": "Fill",
|
128
|
+
"description": "Fills the text field with specified content",
|
129
|
+
"properties": {
|
130
|
+
"action": {
|
131
|
+
"enum": ["fill"]
|
132
|
+
},
|
133
|
+
"custom_action_id": {"title": "Custom Action ID", "type": "integer"},
|
134
|
+
"target": {
|
135
|
+
"title": "Target",
|
136
|
+
"$ref": "#/definitions/noun"
|
137
|
+
},
|
138
|
+
"text": {"title": "Text", "type": "string"},
|
139
|
+
"method": { "title": "Text entry method", "type": "string", "enum": ["pasting", "typing"] }
|
140
|
+
},
|
141
|
+
"additionalProperties": false,
|
142
|
+
"required": ["action", "target", "text"]
|
143
|
+
},
|
144
|
+
"type": {
|
145
|
+
"type": "object",
|
146
|
+
"title": "Type",
|
147
|
+
"description": "Types in specified text",
|
148
|
+
"properties": {
|
149
|
+
"action": {
|
150
|
+
"enum": ["type"]
|
151
|
+
},
|
152
|
+
"custom_action_id": {"title": "Custom Action ID", "type": "integer"},
|
153
|
+
"text": {"title": "Text", "type": "string"},
|
154
|
+
"method": { "title": "Text entry method", "type": "string", "enum": ["pasting", "typing"] }
|
155
|
+
},
|
156
|
+
"additionalProperties": false,
|
157
|
+
"required": ["action", "text"]
|
158
|
+
},
|
159
|
+
"send_key": {
|
160
|
+
"type": "object",
|
161
|
+
"title": "Press Key",
|
162
|
+
"description": "Press specified key or key combination.",
|
163
|
+
"properties": {
|
164
|
+
"action": {
|
165
|
+
"enum": ["send_key"]
|
166
|
+
},
|
167
|
+
"custom_action_id": {"title": "Custom Action ID", "type": "integer"},
|
168
|
+
"key": {"title": "Key", "type": "string"},
|
169
|
+
"modifier": {"title": "Modifier", "type": "string"}
|
170
|
+
},
|
171
|
+
"additionalProperties": false,
|
172
|
+
"required": ["action", "key"]
|
173
|
+
},
|
174
|
+
"hover": {
|
175
|
+
"type": "object",
|
176
|
+
"title": "Hover",
|
177
|
+
"description": "Hovers over specified element",
|
178
|
+
"properties": {
|
179
|
+
"action": {
|
180
|
+
"enum": ["hover"]
|
181
|
+
},
|
182
|
+
"custom_action_id": {"title": "Custom Action ID", "type": "integer"},
|
183
|
+
"target": {
|
184
|
+
"title": "Target",
|
185
|
+
"$ref": "#/definitions/noun"
|
186
|
+
}
|
187
|
+
},
|
188
|
+
"additionalProperties": false,
|
189
|
+
"required": ["action", "target"]
|
190
|
+
},
|
191
|
+
"dropdown_select": {
|
192
|
+
"type": "object",
|
193
|
+
"title": "Dropdown Select",
|
194
|
+
"description": "Selects specified item from the dropdown",
|
195
|
+
"properties": {
|
196
|
+
"action": {
|
197
|
+
"enum": ["dropdown_select"]
|
198
|
+
},
|
199
|
+
"custom_action_id": {"title": "Custom Action ID", "type": "integer"},
|
200
|
+
"target": {
|
201
|
+
"title": "Target",
|
202
|
+
"$ref": "#/definitions/noun"
|
203
|
+
},
|
204
|
+
"option": {
|
205
|
+
"title": "Option",
|
206
|
+
"$ref": "#/definitions/noun"
|
207
|
+
}
|
208
|
+
},
|
209
|
+
"additionalProperties": false,
|
210
|
+
"required": ["action", "target", "option"]
|
211
|
+
},
|
212
|
+
"checkbox_check": {
|
213
|
+
"type": "object",
|
214
|
+
"title": "Checkbox Check",
|
215
|
+
"description": "Checks specified checkbox",
|
216
|
+
"properties": {
|
217
|
+
"action": {
|
218
|
+
"enum": ["checkbox_check"]
|
219
|
+
},
|
220
|
+
"custom_action_id": {"title": "Custom Action ID", "type": "integer"},
|
221
|
+
"target": {
|
222
|
+
"title": "Target",
|
223
|
+
"$ref": "#/definitions/noun"
|
224
|
+
}
|
225
|
+
},
|
226
|
+
"additionalProperties": false,
|
227
|
+
"required": ["action", "target"]
|
228
|
+
},
|
229
|
+
"checkbox_uncheck": {
|
230
|
+
"type": "object",
|
231
|
+
"title": "Checkbox Uncheck",
|
232
|
+
"description": "Unchecks specified checkbox",
|
233
|
+
"properties": {
|
234
|
+
"action": {
|
235
|
+
"enum": ["checkbox_uncheck"]
|
236
|
+
},
|
237
|
+
"custom_action_id": {"title": "Custom Action ID", "type": "integer"},
|
238
|
+
"target": {
|
239
|
+
"title": "Target",
|
240
|
+
"$ref": "#/definitions/noun"
|
241
|
+
}
|
242
|
+
},
|
243
|
+
"additionalProperties": false,
|
244
|
+
"required": ["action", "target"]
|
245
|
+
},
|
246
|
+
"refresh": {
|
247
|
+
"type": "object",
|
248
|
+
"title": "Refresh",
|
249
|
+
"description": "Refreshes the webpage",
|
250
|
+
"properties": {
|
251
|
+
"action": {
|
252
|
+
"enum": ["refresh"]
|
253
|
+
},
|
254
|
+
"custom_action_id": {"title": "Custom Action ID", "type": "integer"}
|
255
|
+
},
|
256
|
+
"additionalProperties": false,
|
257
|
+
"required": ["action"]
|
258
|
+
},
|
259
|
+
"navigate": {
|
260
|
+
"type": "object",
|
261
|
+
"title": "Navigate",
|
262
|
+
"description": "Navigates to specified URL",
|
263
|
+
"properties": {
|
264
|
+
"action": {
|
265
|
+
"enum": ["navigate"]
|
266
|
+
},
|
267
|
+
"custom_action_id": {"title": "Custom Action ID", "type": "integer"},
|
268
|
+
"url": {"title": "URL", "type": "string"}
|
269
|
+
},
|
270
|
+
"additionalProperties": false,
|
271
|
+
"required": ["action", "url"]
|
272
|
+
},
|
273
|
+
"navigate_new_tab": {
|
274
|
+
"type": "object",
|
275
|
+
"title": "Navigate - New Tab",
|
276
|
+
"description": "Navigates to specified URL in a new tab",
|
277
|
+
"properties": {
|
278
|
+
"action": {
|
279
|
+
"enum": ["navigate_new_tab"]
|
280
|
+
},
|
281
|
+
"custom_action_id": {"title": "Custom Action ID", "type": "integer"},
|
282
|
+
"url": {"title": "URL", "type": "string"}
|
283
|
+
},
|
284
|
+
"additionalProperties": false,
|
285
|
+
"required": ["action", "url"]
|
286
|
+
},
|
287
|
+
"navigate_incognito_tab": {
|
288
|
+
"type": "object",
|
289
|
+
"title": "Navigate - Incognito Tab",
|
290
|
+
"description": "Navigates to specified URL in a new incognito tab",
|
291
|
+
"properties": {
|
292
|
+
"action": {
|
293
|
+
"enum": ["navigate_incognito_tab"]
|
294
|
+
},
|
295
|
+
"custom_action_id": {"title": "Custom Action ID", "type": "integer"},
|
296
|
+
"url": {"title": "URL", "type": "string"}
|
297
|
+
},
|
298
|
+
"additionalProperties": false,
|
299
|
+
"required": ["action", "url"]
|
300
|
+
},
|
301
|
+
"close_tab": {
|
302
|
+
"type": "object",
|
303
|
+
"title": "Close Tab",
|
304
|
+
"description": "Closes current browser tab",
|
305
|
+
"properties": {
|
306
|
+
"action": {
|
307
|
+
"enum": ["close_tab"]
|
308
|
+
},
|
309
|
+
"custom_action_id": {"title": "Custom Action ID", "type": "integer"}
|
310
|
+
},
|
311
|
+
"additionalProperties": false,
|
312
|
+
"required": ["action"]
|
313
|
+
},
|
314
|
+
"scroll": {
|
315
|
+
"type": "object",
|
316
|
+
"title": "Scroll",
|
317
|
+
"description": "Scrolls the page into specified direction until target is reached",
|
318
|
+
"properties": {
|
319
|
+
"action": {
|
320
|
+
"enum": ["scroll"]
|
321
|
+
},
|
322
|
+
"custom_action_id": {"title": "Custom Action ID", "type": "integer"},
|
323
|
+
"direction": {"title": "Direction", "type": "string", "enum": ["up", "down", "left", "right"]},
|
324
|
+
"target": {
|
325
|
+
"title": "Target",
|
326
|
+
"$ref": "#/definitions/noun"
|
327
|
+
}
|
328
|
+
},
|
329
|
+
"additionalProperties": false,
|
330
|
+
"required": ["action", "direction", "target"]
|
331
|
+
},
|
332
|
+
"sleep": {
|
333
|
+
"type": "object",
|
334
|
+
"title": "Sleep",
|
335
|
+
"description": "Waits for a number of seconds",
|
336
|
+
"properties": {
|
337
|
+
"action": {
|
338
|
+
"enum": ["sleep"]
|
339
|
+
},
|
340
|
+
"custom_action_id": {"title": "Custom Action ID", "type": "integer"},
|
341
|
+
"seconds": {"title": "seconds", "type": "integer"}
|
342
|
+
},
|
343
|
+
"additionalProperties": false,
|
344
|
+
"required": ["action", "seconds"]
|
345
|
+
},
|
346
|
+
"drag_and_drop": {
|
347
|
+
"type": "object",
|
348
|
+
"title": "Drag and drop",
|
349
|
+
"description": "Drag and drop",
|
350
|
+
"properties": {
|
351
|
+
"action": {
|
352
|
+
"enum": ["drag_and_drop"]
|
353
|
+
},
|
354
|
+
"custom_action_id": {"title": "Custom Action ID", "type": "integer"},
|
355
|
+
"object": {
|
356
|
+
"title": "Object",
|
357
|
+
"$ref": "#/definitions/noun"
|
358
|
+
},
|
359
|
+
"target": {
|
360
|
+
"title": "Target",
|
361
|
+
"$ref": "#/definitions/noun"
|
362
|
+
}
|
363
|
+
},
|
364
|
+
"additionalProperties": false,
|
365
|
+
"required": ["action", "target", "object"]
|
366
|
+
},
|
367
|
+
"click_and_hold": {
|
368
|
+
"type": "object",
|
369
|
+
"title": "Click and Hold",
|
370
|
+
"description": "Clicks and holds the left mouse button over object for a number of seconds",
|
371
|
+
"properties": {
|
372
|
+
"action": {
|
373
|
+
"enum": ["click_and_hold"]
|
374
|
+
},
|
375
|
+
"custom_action_id": {"title": "Custom Action ID", "type": "integer"},
|
376
|
+
"target": {
|
377
|
+
"title": "Target",
|
378
|
+
"$ref": "#/definitions/noun"
|
379
|
+
},
|
380
|
+
"seconds": {"title": "Seconds", "type": "integer"}
|
381
|
+
},
|
382
|
+
"additionalProperties": false,
|
383
|
+
"required": ["action", "target", "seconds"]
|
384
|
+
},
|
385
|
+
"custom_action": {
|
386
|
+
"type": "object",
|
387
|
+
"title": "Custom Action",
|
388
|
+
"description": "Reusable custom action",
|
389
|
+
"properties": {
|
390
|
+
"action": {
|
391
|
+
"enum": ["custom_action"]
|
392
|
+
},
|
393
|
+
"test_id": {
|
394
|
+
"title": "Test ID",
|
395
|
+
"type": "integer"
|
396
|
+
}
|
397
|
+
},
|
398
|
+
"additionalProperties": false,
|
399
|
+
"required": ["action", "test_id"]
|
400
|
+
},
|
401
|
+
"plain_language": {
|
402
|
+
"type": "object",
|
403
|
+
"title": "Plain Language",
|
404
|
+
"description": "Allows to fallback to english",
|
405
|
+
"properties": {
|
406
|
+
"action": {
|
407
|
+
"enum": ["plain_language"]
|
408
|
+
},
|
409
|
+
"custom_action_id": {"title": "Custom Action ID", "type": "integer"},
|
410
|
+
"instruction": {"title": "Instruction", "type": "string"}
|
411
|
+
},
|
412
|
+
"additionalProperties": false,
|
413
|
+
"required": ["action", "instruction"]
|
414
|
+
},
|
415
|
+
"see": {
|
416
|
+
"type": "object",
|
417
|
+
"title": "See",
|
418
|
+
"description": "Checks if element of the UI is visible",
|
419
|
+
"properties": {
|
420
|
+
"assertion": {
|
421
|
+
"enum": ["see"]
|
422
|
+
},
|
423
|
+
"custom_action_id": {"title": "Custom Action ID", "type": "integer"},
|
424
|
+
"object": {
|
425
|
+
"title": "Object",
|
426
|
+
"$ref": "#/definitions/noun"
|
427
|
+
}
|
428
|
+
},
|
429
|
+
"additionalProperties": false,
|
430
|
+
"required": ["assertion", "object"]
|
431
|
+
},
|
432
|
+
"disappear": {
|
433
|
+
"type": "object",
|
434
|
+
"title": "Disappear",
|
435
|
+
"description": "Checks if element of the UI is no longer visible",
|
436
|
+
"properties": {
|
437
|
+
"assertion": {
|
438
|
+
"enum": ["disappear"]
|
439
|
+
},
|
440
|
+
"custom_action_id": {"title": "Custom Action ID", "type": "integer"},
|
441
|
+
"object": {
|
442
|
+
"title": "Object",
|
443
|
+
"$ref": "#/definitions/noun"
|
444
|
+
}
|
445
|
+
},
|
446
|
+
"additionalProperties": false,
|
447
|
+
"required": ["assertion", "object"]
|
448
|
+
},
|
449
|
+
"loaded": {
|
450
|
+
"type": "object",
|
451
|
+
"title": "Loaded",
|
452
|
+
"description": "Checks if specified page has loaded",
|
453
|
+
"properties": {
|
454
|
+
"assertion": {
|
455
|
+
"enum": ["loaded"]
|
456
|
+
},
|
457
|
+
"custom_action_id": {"title": "Custom Action ID", "type": "integer"},
|
458
|
+
"page": {"title": "Page", "type": "string"}
|
459
|
+
},
|
460
|
+
"additionalProperties": false,
|
461
|
+
"required": ["assertion", "page"]
|
462
|
+
},
|
463
|
+
"plain_language_assertion": {
|
464
|
+
"type": "object",
|
465
|
+
"title": "Plain Language Assertion",
|
466
|
+
"description": "Allows to fallback to english",
|
467
|
+
"properties": {
|
468
|
+
"assertion": {
|
469
|
+
"enum": ["plain_language_assertion"]
|
470
|
+
},
|
471
|
+
"custom_action_id": {"title": "Custom Action ID", "type": "integer"},
|
472
|
+
"instruction": {"title": "Instruction", "type": "string"}
|
473
|
+
},
|
474
|
+
"additionalProperties": false,
|
475
|
+
"required": ["assertion", "instruction"]
|
476
|
+
}
|
477
|
+
},
|
478
|
+
"type": "object",
|
479
|
+
"title": "Wisp Test",
|
480
|
+
"properties": {
|
481
|
+
"version": {
|
482
|
+
"type": "string",
|
483
|
+
"title": "Version"
|
484
|
+
},
|
485
|
+
"verbs": {
|
486
|
+
"type": "array",
|
487
|
+
"title": "Verbs",
|
488
|
+
"items": {
|
489
|
+
"$ref": "#/definitions/verb"
|
490
|
+
}
|
491
|
+
}
|
492
|
+
},
|
493
|
+
"additionalProperties": false,
|
494
|
+
"required": ["version", "verbs"]
|
495
|
+
}
|
data/lib/wisp-schema.rb
CHANGED
@@ -1,8 +1,36 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
require 'json_schemer'
|
3
|
+
require 'semantic'
|
4
|
+
require_relative 'version'
|
2
5
|
|
3
6
|
module Wisp
|
4
|
-
VERSION = '0.18.1'
|
5
|
-
|
6
7
|
SCHEMA_PATH = File.expand_path('../wisp.json', __dir__)
|
7
8
|
NOUNS_PATH = File.expand_path('../nouns.json', __dir__)
|
9
|
+
|
10
|
+
CANARY_SCHEMA_PATH = File.expand_path('../canary-wisp.json', __dir__)
|
11
|
+
CANARY_NOUNS_PATH = File.expand_path('../canary-nouns.json', __dir__)
|
12
|
+
|
13
|
+
SEMANTIC_STABLE_VERSION = Semantic::Version.new(STABLE_VERSION)
|
14
|
+
|
15
|
+
def wisp_schemer(raw_version)
|
16
|
+
version = Semantic::Version.new(raw_version)
|
17
|
+
|
18
|
+
if version > SEMANTIC_STABLE_VERSION
|
19
|
+
JSONSchemer.schema(Pathname.new(Wisp::CANARY_SCHEMA_PATH))
|
20
|
+
else
|
21
|
+
JSONSchemer.schema(Pathname.new(Wisp::SCHEMA_PATH))
|
22
|
+
end
|
23
|
+
end
|
24
|
+
module_function :wisp_schemer
|
25
|
+
|
26
|
+
def nouns_schemer(raw_version)
|
27
|
+
version = Semantic::Version.new(raw_version)
|
28
|
+
|
29
|
+
if version > SEMANTIC_STABLE_VERSION
|
30
|
+
JSONSchemer.schema(Pathname.new(Wisp::CANARY_NOUNS_PATH))
|
31
|
+
else
|
32
|
+
JSONSchemer.schema(Pathname.new(Wisp::NOUNS_PATH))
|
33
|
+
end
|
34
|
+
end
|
35
|
+
module_function :nouns_schemer
|
8
36
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wisp-schema
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.19.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Grodowski
|
@@ -11,13 +11,43 @@ autorequire:
|
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
13
|
date: 2018-11-15 00:00:00.000000000 Z
|
14
|
-
dependencies:
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: json_schemer
|
17
|
+
requirement: !ruby/object:Gem::Requirement
|
18
|
+
requirements:
|
19
|
+
- - "~>"
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 0.2.17
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
requirements:
|
26
|
+
- - "~>"
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
version: 0.2.17
|
29
|
+
- !ruby/object:Gem::Dependency
|
30
|
+
name: semantic
|
31
|
+
requirement: !ruby/object:Gem::Requirement
|
32
|
+
requirements:
|
33
|
+
- - "~>"
|
34
|
+
- !ruby/object:Gem::Version
|
35
|
+
version: '1.6'
|
36
|
+
type: :runtime
|
37
|
+
prerelease: false
|
38
|
+
version_requirements: !ruby/object:Gem::Requirement
|
39
|
+
requirements:
|
40
|
+
- - "~>"
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: '1.6'
|
15
43
|
description: This gem contains Wisp's JSON schema definition
|
16
44
|
email:
|
17
45
|
executables: []
|
18
46
|
extensions: []
|
19
47
|
extra_rdoc_files: []
|
20
48
|
files:
|
49
|
+
- canary-nouns.json
|
50
|
+
- canary-wisp.json
|
21
51
|
- lib/wisp-schema.rb
|
22
52
|
- nouns.json
|
23
53
|
- wisp.json
|
@@ -40,7 +70,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
40
70
|
- !ruby/object:Gem::Version
|
41
71
|
version: '0'
|
42
72
|
requirements: []
|
43
|
-
rubygems_version: 3.
|
73
|
+
rubygems_version: 3.2.3
|
44
74
|
signing_key:
|
45
75
|
specification_version: 4
|
46
76
|
summary: Wisp's schema
|