@opencraw/driver 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,539 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://opencraw/schemas/driver-protocol.schema.json",
4
+ "title": "OpenCraw driver protocol",
5
+ "description": "JSON-RPC 2.0 over stdio, one message per line. Methods with a result are requests; the rest are notifications.",
6
+ "protocolVersion": "1.0.0",
7
+ "methods": {
8
+ "initialize": {
9
+ "direction": "client-to-driver",
10
+ "params": {
11
+ "$ref": "#/$defs/initialize.params"
12
+ },
13
+ "result": {
14
+ "$ref": "#/$defs/initialize.result"
15
+ }
16
+ },
17
+ "validate": {
18
+ "direction": "client-to-driver",
19
+ "params": {
20
+ "$ref": "#/$defs/validate.params"
21
+ },
22
+ "result": {
23
+ "$ref": "#/$defs/validate.result"
24
+ }
25
+ },
26
+ "run": {
27
+ "direction": "client-to-driver",
28
+ "params": {
29
+ "$ref": "#/$defs/run.params"
30
+ },
31
+ "result": {
32
+ "$ref": "#/$defs/run.result"
33
+ }
34
+ },
35
+ "cancel": {
36
+ "direction": "client-to-driver",
37
+ "params": {
38
+ "$ref": "#/$defs/cancel.params"
39
+ },
40
+ "result": {
41
+ "$ref": "#/$defs/cancel.result"
42
+ }
43
+ },
44
+ "shutdown": {
45
+ "direction": "client-to-driver",
46
+ "result": {
47
+ "$ref": "#/$defs/shutdown.result"
48
+ }
49
+ },
50
+ "callout": {
51
+ "direction": "driver-to-client",
52
+ "params": {
53
+ "$ref": "#/$defs/callout.params"
54
+ },
55
+ "result": {
56
+ "$ref": "#/$defs/callout.result"
57
+ }
58
+ },
59
+ "event": {
60
+ "direction": "driver-to-client",
61
+ "params": {
62
+ "$ref": "#/$defs/event.params"
63
+ }
64
+ },
65
+ "record": {
66
+ "direction": "driver-to-client",
67
+ "params": {
68
+ "$ref": "#/$defs/record.params"
69
+ }
70
+ },
71
+ "finished": {
72
+ "direction": "driver-to-client",
73
+ "params": {
74
+ "$ref": "#/$defs/finished.params"
75
+ }
76
+ }
77
+ },
78
+ "$defs": {
79
+ "initialize.params": {
80
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
81
+ "type": "object",
82
+ "properties": {
83
+ "clientName": {
84
+ "type": "string",
85
+ "minLength": 1
86
+ },
87
+ "clientVersion": {
88
+ "type": "string",
89
+ "minLength": 1
90
+ },
91
+ "protocolVersion": {
92
+ "type": "string",
93
+ "pattern": "^\\d+\\.\\d+\\.\\d+$"
94
+ }
95
+ },
96
+ "required": [
97
+ "clientName",
98
+ "clientVersion",
99
+ "protocolVersion"
100
+ ],
101
+ "additionalProperties": false
102
+ },
103
+ "initialize.result": {
104
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
105
+ "type": "object",
106
+ "properties": {
107
+ "driverVersion": {
108
+ "type": "string"
109
+ },
110
+ "protocolVersion": {
111
+ "type": "string"
112
+ },
113
+ "methods": {
114
+ "type": "array",
115
+ "items": {
116
+ "type": "string"
117
+ }
118
+ }
119
+ },
120
+ "required": [
121
+ "driverVersion",
122
+ "protocolVersion",
123
+ "methods"
124
+ ],
125
+ "additionalProperties": false
126
+ },
127
+ "validate.params": {
128
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
129
+ "type": "object",
130
+ "properties": {
131
+ "paths": {
132
+ "minItems": 1,
133
+ "type": "array",
134
+ "items": {
135
+ "type": "string"
136
+ }
137
+ },
138
+ "recipes": {
139
+ "minItems": 1,
140
+ "type": "array",
141
+ "items": {
142
+ "type": "object",
143
+ "propertyNames": {
144
+ "type": "string"
145
+ },
146
+ "additionalProperties": {}
147
+ }
148
+ },
149
+ "only": {
150
+ "type": "array",
151
+ "items": {
152
+ "type": "string"
153
+ }
154
+ }
155
+ },
156
+ "additionalProperties": false
157
+ },
158
+ "validate.result": {
159
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
160
+ "type": "object",
161
+ "properties": {
162
+ "ok": {
163
+ "type": "boolean"
164
+ },
165
+ "inputs": {
166
+ "type": "array",
167
+ "items": {
168
+ "type": "string"
169
+ }
170
+ },
171
+ "hooks": {
172
+ "type": "array",
173
+ "items": {
174
+ "type": "string"
175
+ }
176
+ },
177
+ "issues": {
178
+ "type": "array",
179
+ "items": {
180
+ "type": "object",
181
+ "properties": {
182
+ "source": {
183
+ "type": "string"
184
+ },
185
+ "recipeId": {
186
+ "type": "string"
187
+ },
188
+ "path": {
189
+ "type": "string"
190
+ },
191
+ "message": {
192
+ "type": "string"
193
+ }
194
+ },
195
+ "required": [
196
+ "path",
197
+ "message"
198
+ ],
199
+ "additionalProperties": false
200
+ }
201
+ }
202
+ },
203
+ "required": [
204
+ "ok",
205
+ "inputs",
206
+ "hooks",
207
+ "issues"
208
+ ],
209
+ "additionalProperties": false
210
+ },
211
+ "run.params": {
212
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
213
+ "type": "object",
214
+ "properties": {
215
+ "paths": {
216
+ "minItems": 1,
217
+ "type": "array",
218
+ "items": {
219
+ "type": "string"
220
+ }
221
+ },
222
+ "recipes": {
223
+ "minItems": 1,
224
+ "type": "array",
225
+ "items": {
226
+ "type": "object",
227
+ "propertyNames": {
228
+ "type": "string"
229
+ },
230
+ "additionalProperties": {}
231
+ }
232
+ },
233
+ "only": {
234
+ "type": "array",
235
+ "items": {
236
+ "type": "string"
237
+ }
238
+ },
239
+ "out": {
240
+ "type": "string"
241
+ },
242
+ "append": {
243
+ "type": "boolean"
244
+ },
245
+ "resume": {
246
+ "type": "boolean"
247
+ },
248
+ "dryRun": {
249
+ "type": "boolean"
250
+ },
251
+ "parallel": {
252
+ "type": "integer",
253
+ "minimum": 1,
254
+ "maximum": 16
255
+ },
256
+ "browser": {
257
+ "type": "object",
258
+ "properties": {
259
+ "headless": {
260
+ "type": "boolean"
261
+ },
262
+ "executablePath": {
263
+ "type": "string"
264
+ },
265
+ "ignoreHTTPSErrors": {
266
+ "type": "boolean"
267
+ }
268
+ },
269
+ "additionalProperties": false
270
+ },
271
+ "hooks": {
272
+ "type": "array",
273
+ "items": {
274
+ "type": "string"
275
+ }
276
+ }
277
+ },
278
+ "additionalProperties": false
279
+ },
280
+ "run.result": {
281
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
282
+ "type": "object",
283
+ "properties": {
284
+ "runId": {
285
+ "type": "string"
286
+ }
287
+ },
288
+ "required": [
289
+ "runId"
290
+ ],
291
+ "additionalProperties": false
292
+ },
293
+ "cancel.params": {
294
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
295
+ "type": "object",
296
+ "properties": {
297
+ "runId": {
298
+ "type": "string"
299
+ }
300
+ },
301
+ "required": [
302
+ "runId"
303
+ ],
304
+ "additionalProperties": false
305
+ },
306
+ "cancel.result": {
307
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
308
+ "type": "object",
309
+ "properties": {
310
+ "cancelled": {
311
+ "type": "boolean"
312
+ }
313
+ },
314
+ "required": [
315
+ "cancelled"
316
+ ],
317
+ "additionalProperties": false
318
+ },
319
+ "shutdown.result": {
320
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
321
+ "type": "object",
322
+ "properties": {},
323
+ "additionalProperties": false
324
+ },
325
+ "callout.params": {
326
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
327
+ "type": "object",
328
+ "properties": {
329
+ "runId": {
330
+ "type": "string"
331
+ },
332
+ "request": {
333
+ "type": "object",
334
+ "properties": {
335
+ "kind": {
336
+ "type": "string",
337
+ "enum": [
338
+ "hook",
339
+ "captcha",
340
+ "access"
341
+ ]
342
+ },
343
+ "name": {
344
+ "type": "string",
345
+ "minLength": 1
346
+ },
347
+ "input": {},
348
+ "args": {
349
+ "type": "object",
350
+ "propertyNames": {
351
+ "type": "string"
352
+ },
353
+ "additionalProperties": {}
354
+ },
355
+ "context": {
356
+ "type": "object",
357
+ "properties": {
358
+ "recipeId": {
359
+ "type": "string"
360
+ },
361
+ "scope": {
362
+ "type": "object",
363
+ "propertyNames": {
364
+ "type": "string"
365
+ },
366
+ "additionalProperties": {}
367
+ }
368
+ },
369
+ "required": [
370
+ "recipeId",
371
+ "scope"
372
+ ],
373
+ "additionalProperties": false
374
+ },
375
+ "idempotencyKey": {
376
+ "type": "string"
377
+ },
378
+ "callback": {
379
+ "type": "object",
380
+ "properties": {
381
+ "url": {
382
+ "type": "string",
383
+ "format": "uri"
384
+ }
385
+ },
386
+ "required": [
387
+ "url"
388
+ ],
389
+ "additionalProperties": false
390
+ }
391
+ },
392
+ "required": [
393
+ "kind",
394
+ "name",
395
+ "args",
396
+ "context",
397
+ "idempotencyKey"
398
+ ],
399
+ "additionalProperties": false
400
+ }
401
+ },
402
+ "required": [
403
+ "runId",
404
+ "request"
405
+ ],
406
+ "additionalProperties": false
407
+ },
408
+ "callout.result": {
409
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
410
+ "oneOf": [
411
+ {
412
+ "type": "object",
413
+ "properties": {
414
+ "status": {
415
+ "type": "string",
416
+ "const": "ok"
417
+ },
418
+ "output": {}
419
+ },
420
+ "required": [
421
+ "status"
422
+ ],
423
+ "additionalProperties": false
424
+ },
425
+ {
426
+ "type": "object",
427
+ "properties": {
428
+ "status": {
429
+ "type": "string",
430
+ "const": "error"
431
+ },
432
+ "error": {
433
+ "type": "string"
434
+ }
435
+ },
436
+ "required": [
437
+ "status",
438
+ "error"
439
+ ],
440
+ "additionalProperties": false
441
+ },
442
+ {
443
+ "type": "object",
444
+ "properties": {
445
+ "status": {
446
+ "type": "string",
447
+ "const": "pending"
448
+ },
449
+ "retryAfterMs": {
450
+ "type": "integer",
451
+ "minimum": 0,
452
+ "maximum": 9007199254740991
453
+ }
454
+ },
455
+ "required": [
456
+ "status"
457
+ ],
458
+ "additionalProperties": false
459
+ }
460
+ ]
461
+ },
462
+ "event.params": {
463
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
464
+ "type": "object",
465
+ "properties": {
466
+ "runId": {
467
+ "type": "string"
468
+ },
469
+ "event": {
470
+ "type": "object",
471
+ "propertyNames": {
472
+ "type": "string"
473
+ },
474
+ "additionalProperties": {}
475
+ }
476
+ },
477
+ "required": [
478
+ "runId",
479
+ "event"
480
+ ],
481
+ "additionalProperties": false
482
+ },
483
+ "record.params": {
484
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
485
+ "type": "object",
486
+ "properties": {
487
+ "runId": {
488
+ "type": "string"
489
+ },
490
+ "recipeId": {
491
+ "type": "string"
492
+ },
493
+ "key": {
494
+ "type": [
495
+ "string",
496
+ "null"
497
+ ]
498
+ },
499
+ "data": {
500
+ "type": "object",
501
+ "propertyNames": {
502
+ "type": "string"
503
+ },
504
+ "additionalProperties": {}
505
+ }
506
+ },
507
+ "required": [
508
+ "runId",
509
+ "recipeId",
510
+ "key",
511
+ "data"
512
+ ],
513
+ "additionalProperties": false
514
+ },
515
+ "finished.params": {
516
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
517
+ "type": "object",
518
+ "properties": {
519
+ "runId": {
520
+ "type": "string"
521
+ },
522
+ "report": {
523
+ "type": "object",
524
+ "propertyNames": {
525
+ "type": "string"
526
+ },
527
+ "additionalProperties": {}
528
+ },
529
+ "error": {
530
+ "type": "string"
531
+ }
532
+ },
533
+ "required": [
534
+ "runId"
535
+ ],
536
+ "additionalProperties": false
537
+ }
538
+ }
539
+ }