@opencraw/driver 0.0.0-stage → 0.2.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,770 @@
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.1.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
+ "probe": {
45
+ "direction": "client-to-driver",
46
+ "params": {
47
+ "$ref": "#/$defs/probe.params"
48
+ },
49
+ "result": {
50
+ "$ref": "#/$defs/probe.result"
51
+ }
52
+ },
53
+ "diff": {
54
+ "direction": "client-to-driver",
55
+ "params": {
56
+ "$ref": "#/$defs/diff.params"
57
+ },
58
+ "result": {
59
+ "$ref": "#/$defs/diff.result"
60
+ }
61
+ },
62
+ "export": {
63
+ "direction": "client-to-driver",
64
+ "params": {
65
+ "$ref": "#/$defs/export.params"
66
+ },
67
+ "result": {
68
+ "$ref": "#/$defs/export.result"
69
+ }
70
+ },
71
+ "shutdown": {
72
+ "direction": "client-to-driver",
73
+ "result": {
74
+ "$ref": "#/$defs/shutdown.result"
75
+ }
76
+ },
77
+ "callout": {
78
+ "direction": "driver-to-client",
79
+ "params": {
80
+ "$ref": "#/$defs/callout.params"
81
+ },
82
+ "result": {
83
+ "$ref": "#/$defs/callout.result"
84
+ }
85
+ },
86
+ "event": {
87
+ "direction": "driver-to-client",
88
+ "params": {
89
+ "$ref": "#/$defs/event.params"
90
+ }
91
+ },
92
+ "record": {
93
+ "direction": "driver-to-client",
94
+ "params": {
95
+ "$ref": "#/$defs/record.params"
96
+ }
97
+ },
98
+ "finished": {
99
+ "direction": "driver-to-client",
100
+ "params": {
101
+ "$ref": "#/$defs/finished.params"
102
+ }
103
+ }
104
+ },
105
+ "$defs": {
106
+ "initialize.params": {
107
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
108
+ "type": "object",
109
+ "properties": {
110
+ "clientName": {
111
+ "type": "string",
112
+ "minLength": 1
113
+ },
114
+ "clientVersion": {
115
+ "type": "string",
116
+ "minLength": 1
117
+ },
118
+ "protocolVersion": {
119
+ "type": "string",
120
+ "pattern": "^\\d+\\.\\d+\\.\\d+$"
121
+ }
122
+ },
123
+ "required": [
124
+ "clientName",
125
+ "clientVersion",
126
+ "protocolVersion"
127
+ ],
128
+ "additionalProperties": false
129
+ },
130
+ "initialize.result": {
131
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
132
+ "type": "object",
133
+ "properties": {
134
+ "driverVersion": {
135
+ "type": "string"
136
+ },
137
+ "protocolVersion": {
138
+ "type": "string"
139
+ },
140
+ "methods": {
141
+ "type": "array",
142
+ "items": {
143
+ "type": "string"
144
+ }
145
+ }
146
+ },
147
+ "required": [
148
+ "driverVersion",
149
+ "protocolVersion",
150
+ "methods"
151
+ ],
152
+ "additionalProperties": false
153
+ },
154
+ "validate.params": {
155
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
156
+ "type": "object",
157
+ "properties": {
158
+ "paths": {
159
+ "minItems": 1,
160
+ "type": "array",
161
+ "items": {
162
+ "type": "string"
163
+ }
164
+ },
165
+ "recipes": {
166
+ "minItems": 1,
167
+ "type": "array",
168
+ "items": {
169
+ "type": "object",
170
+ "propertyNames": {
171
+ "type": "string"
172
+ },
173
+ "additionalProperties": {}
174
+ }
175
+ },
176
+ "only": {
177
+ "type": "array",
178
+ "items": {
179
+ "type": "string"
180
+ }
181
+ }
182
+ },
183
+ "additionalProperties": false
184
+ },
185
+ "validate.result": {
186
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
187
+ "type": "object",
188
+ "properties": {
189
+ "ok": {
190
+ "type": "boolean"
191
+ },
192
+ "inputs": {
193
+ "type": "array",
194
+ "items": {
195
+ "type": "string"
196
+ }
197
+ },
198
+ "hooks": {
199
+ "type": "array",
200
+ "items": {
201
+ "type": "string"
202
+ }
203
+ },
204
+ "issues": {
205
+ "type": "array",
206
+ "items": {
207
+ "type": "object",
208
+ "properties": {
209
+ "source": {
210
+ "type": "string"
211
+ },
212
+ "recipeId": {
213
+ "type": "string"
214
+ },
215
+ "path": {
216
+ "type": "string"
217
+ },
218
+ "message": {
219
+ "type": "string"
220
+ }
221
+ },
222
+ "required": [
223
+ "path",
224
+ "message"
225
+ ],
226
+ "additionalProperties": false
227
+ }
228
+ }
229
+ },
230
+ "required": [
231
+ "ok",
232
+ "inputs",
233
+ "hooks",
234
+ "issues"
235
+ ],
236
+ "additionalProperties": false
237
+ },
238
+ "run.params": {
239
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
240
+ "type": "object",
241
+ "properties": {
242
+ "paths": {
243
+ "minItems": 1,
244
+ "type": "array",
245
+ "items": {
246
+ "type": "string"
247
+ }
248
+ },
249
+ "recipes": {
250
+ "minItems": 1,
251
+ "type": "array",
252
+ "items": {
253
+ "type": "object",
254
+ "propertyNames": {
255
+ "type": "string"
256
+ },
257
+ "additionalProperties": {}
258
+ }
259
+ },
260
+ "only": {
261
+ "type": "array",
262
+ "items": {
263
+ "type": "string"
264
+ }
265
+ },
266
+ "out": {
267
+ "type": "string"
268
+ },
269
+ "append": {
270
+ "type": "boolean"
271
+ },
272
+ "resume": {
273
+ "type": "boolean"
274
+ },
275
+ "dryRun": {
276
+ "type": "boolean"
277
+ },
278
+ "parallel": {
279
+ "type": "integer",
280
+ "minimum": 1,
281
+ "maximum": 16
282
+ },
283
+ "browser": {
284
+ "type": "object",
285
+ "properties": {
286
+ "headless": {
287
+ "type": "boolean"
288
+ },
289
+ "executablePath": {
290
+ "type": "string"
291
+ },
292
+ "ignoreHTTPSErrors": {
293
+ "type": "boolean"
294
+ }
295
+ },
296
+ "additionalProperties": false
297
+ },
298
+ "hooks": {
299
+ "type": "array",
300
+ "items": {
301
+ "type": "string"
302
+ }
303
+ },
304
+ "captchaSolvers": {
305
+ "type": "array",
306
+ "items": {
307
+ "type": "string"
308
+ }
309
+ },
310
+ "accessConfig": {
311
+ "type": "string"
312
+ },
313
+ "access": {
314
+ "type": "string"
315
+ },
316
+ "accessPlugins": {
317
+ "type": "array",
318
+ "items": {
319
+ "type": "string"
320
+ }
321
+ }
322
+ },
323
+ "additionalProperties": false
324
+ },
325
+ "run.result": {
326
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
327
+ "type": "object",
328
+ "properties": {
329
+ "runId": {
330
+ "type": "string"
331
+ }
332
+ },
333
+ "required": [
334
+ "runId"
335
+ ],
336
+ "additionalProperties": false
337
+ },
338
+ "cancel.params": {
339
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
340
+ "type": "object",
341
+ "properties": {
342
+ "runId": {
343
+ "type": "string"
344
+ }
345
+ },
346
+ "required": [
347
+ "runId"
348
+ ],
349
+ "additionalProperties": false
350
+ },
351
+ "cancel.result": {
352
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
353
+ "type": "object",
354
+ "properties": {
355
+ "cancelled": {
356
+ "type": "boolean"
357
+ }
358
+ },
359
+ "required": [
360
+ "cancelled"
361
+ ],
362
+ "additionalProperties": false
363
+ },
364
+ "probe.params": {
365
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
366
+ "type": "object",
367
+ "properties": {
368
+ "url": {
369
+ "type": "string",
370
+ "minLength": 1
371
+ },
372
+ "browser": {
373
+ "type": "boolean"
374
+ },
375
+ "browserPath": {
376
+ "type": "string"
377
+ },
378
+ "insecureTls": {
379
+ "type": "boolean"
380
+ },
381
+ "userAgent": {
382
+ "type": "string"
383
+ },
384
+ "accessConfig": {
385
+ "type": "string"
386
+ },
387
+ "access": {
388
+ "type": "string"
389
+ },
390
+ "accessPlugins": {
391
+ "type": "array",
392
+ "items": {
393
+ "type": "string"
394
+ }
395
+ }
396
+ },
397
+ "required": [
398
+ "url"
399
+ ],
400
+ "additionalProperties": false
401
+ },
402
+ "probe.result": {
403
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
404
+ "type": "object",
405
+ "propertyNames": {
406
+ "type": "string"
407
+ },
408
+ "additionalProperties": {}
409
+ },
410
+ "diff.params": {
411
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
412
+ "type": "object",
413
+ "properties": {
414
+ "previous": {
415
+ "type": "string",
416
+ "minLength": 1
417
+ },
418
+ "current": {
419
+ "type": "string",
420
+ "minLength": 1
421
+ },
422
+ "key": {
423
+ "type": "array",
424
+ "items": {
425
+ "type": "string"
426
+ }
427
+ },
428
+ "ignore": {
429
+ "type": "array",
430
+ "items": {
431
+ "type": "string"
432
+ }
433
+ },
434
+ "limit": {
435
+ "type": "integer",
436
+ "minimum": 0,
437
+ "maximum": 9007199254740991
438
+ }
439
+ },
440
+ "required": [
441
+ "previous",
442
+ "current"
443
+ ],
444
+ "additionalProperties": false
445
+ },
446
+ "diff.result": {
447
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
448
+ "type": "object",
449
+ "properties": {
450
+ "added": {
451
+ "type": "number"
452
+ },
453
+ "removed": {
454
+ "type": "number"
455
+ },
456
+ "changed": {
457
+ "type": "number"
458
+ },
459
+ "unchanged": {
460
+ "type": "number"
461
+ },
462
+ "shrunk": {
463
+ "type": "object",
464
+ "properties": {
465
+ "previous": {
466
+ "type": "number"
467
+ },
468
+ "current": {
469
+ "type": "number"
470
+ }
471
+ },
472
+ "required": [
473
+ "previous",
474
+ "current"
475
+ ],
476
+ "additionalProperties": false
477
+ },
478
+ "summary": {
479
+ "type": "array",
480
+ "items": {
481
+ "type": "string"
482
+ }
483
+ },
484
+ "changes": {
485
+ "type": "array",
486
+ "items": {
487
+ "type": "object",
488
+ "propertyNames": {
489
+ "type": "string"
490
+ },
491
+ "additionalProperties": {}
492
+ }
493
+ },
494
+ "truncated": {
495
+ "type": "boolean"
496
+ }
497
+ },
498
+ "required": [
499
+ "added",
500
+ "removed",
501
+ "changed",
502
+ "unchanged",
503
+ "summary",
504
+ "changes",
505
+ "truncated"
506
+ ],
507
+ "additionalProperties": false
508
+ },
509
+ "export.params": {
510
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
511
+ "type": "object",
512
+ "properties": {
513
+ "records": {
514
+ "type": "string",
515
+ "minLength": 1
516
+ },
517
+ "output": {
518
+ "type": "string",
519
+ "minLength": 1
520
+ },
521
+ "out": {
522
+ "type": "string",
523
+ "minLength": 1
524
+ }
525
+ },
526
+ "required": [
527
+ "records",
528
+ "output",
529
+ "out"
530
+ ],
531
+ "additionalProperties": false
532
+ },
533
+ "export.result": {
534
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
535
+ "type": "object",
536
+ "properties": {
537
+ "written": {
538
+ "type": "number"
539
+ },
540
+ "location": {
541
+ "type": "string"
542
+ }
543
+ },
544
+ "required": [
545
+ "written",
546
+ "location"
547
+ ],
548
+ "additionalProperties": false
549
+ },
550
+ "shutdown.result": {
551
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
552
+ "type": "object",
553
+ "properties": {},
554
+ "additionalProperties": false
555
+ },
556
+ "callout.params": {
557
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
558
+ "type": "object",
559
+ "properties": {
560
+ "runId": {
561
+ "type": "string"
562
+ },
563
+ "request": {
564
+ "type": "object",
565
+ "properties": {
566
+ "kind": {
567
+ "type": "string",
568
+ "enum": [
569
+ "hook",
570
+ "captcha",
571
+ "access"
572
+ ]
573
+ },
574
+ "name": {
575
+ "type": "string",
576
+ "minLength": 1
577
+ },
578
+ "input": {},
579
+ "args": {
580
+ "type": "object",
581
+ "propertyNames": {
582
+ "type": "string"
583
+ },
584
+ "additionalProperties": {}
585
+ },
586
+ "context": {
587
+ "type": "object",
588
+ "properties": {
589
+ "recipeId": {
590
+ "type": "string"
591
+ },
592
+ "scope": {
593
+ "type": "object",
594
+ "propertyNames": {
595
+ "type": "string"
596
+ },
597
+ "additionalProperties": {}
598
+ }
599
+ },
600
+ "required": [
601
+ "recipeId",
602
+ "scope"
603
+ ],
604
+ "additionalProperties": false
605
+ },
606
+ "idempotencyKey": {
607
+ "type": "string"
608
+ },
609
+ "callback": {
610
+ "type": "object",
611
+ "properties": {
612
+ "url": {
613
+ "type": "string",
614
+ "format": "uri"
615
+ }
616
+ },
617
+ "required": [
618
+ "url"
619
+ ],
620
+ "additionalProperties": false
621
+ }
622
+ },
623
+ "required": [
624
+ "kind",
625
+ "name",
626
+ "args",
627
+ "context",
628
+ "idempotencyKey"
629
+ ],
630
+ "additionalProperties": false
631
+ }
632
+ },
633
+ "required": [
634
+ "runId",
635
+ "request"
636
+ ],
637
+ "additionalProperties": false
638
+ },
639
+ "callout.result": {
640
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
641
+ "oneOf": [
642
+ {
643
+ "type": "object",
644
+ "properties": {
645
+ "status": {
646
+ "type": "string",
647
+ "const": "ok"
648
+ },
649
+ "output": {}
650
+ },
651
+ "required": [
652
+ "status"
653
+ ],
654
+ "additionalProperties": false
655
+ },
656
+ {
657
+ "type": "object",
658
+ "properties": {
659
+ "status": {
660
+ "type": "string",
661
+ "const": "error"
662
+ },
663
+ "error": {
664
+ "type": "string"
665
+ }
666
+ },
667
+ "required": [
668
+ "status",
669
+ "error"
670
+ ],
671
+ "additionalProperties": false
672
+ },
673
+ {
674
+ "type": "object",
675
+ "properties": {
676
+ "status": {
677
+ "type": "string",
678
+ "const": "pending"
679
+ },
680
+ "retryAfterMs": {
681
+ "type": "integer",
682
+ "minimum": 0,
683
+ "maximum": 9007199254740991
684
+ }
685
+ },
686
+ "required": [
687
+ "status"
688
+ ],
689
+ "additionalProperties": false
690
+ }
691
+ ]
692
+ },
693
+ "event.params": {
694
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
695
+ "type": "object",
696
+ "properties": {
697
+ "runId": {
698
+ "type": "string"
699
+ },
700
+ "event": {
701
+ "type": "object",
702
+ "propertyNames": {
703
+ "type": "string"
704
+ },
705
+ "additionalProperties": {}
706
+ }
707
+ },
708
+ "required": [
709
+ "runId",
710
+ "event"
711
+ ],
712
+ "additionalProperties": false
713
+ },
714
+ "record.params": {
715
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
716
+ "type": "object",
717
+ "properties": {
718
+ "runId": {
719
+ "type": "string"
720
+ },
721
+ "recipeId": {
722
+ "type": "string"
723
+ },
724
+ "key": {
725
+ "type": [
726
+ "string",
727
+ "null"
728
+ ]
729
+ },
730
+ "data": {
731
+ "type": "object",
732
+ "propertyNames": {
733
+ "type": "string"
734
+ },
735
+ "additionalProperties": {}
736
+ }
737
+ },
738
+ "required": [
739
+ "runId",
740
+ "recipeId",
741
+ "key",
742
+ "data"
743
+ ],
744
+ "additionalProperties": false
745
+ },
746
+ "finished.params": {
747
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
748
+ "type": "object",
749
+ "properties": {
750
+ "runId": {
751
+ "type": "string"
752
+ },
753
+ "report": {
754
+ "type": "object",
755
+ "propertyNames": {
756
+ "type": "string"
757
+ },
758
+ "additionalProperties": {}
759
+ },
760
+ "error": {
761
+ "type": "string"
762
+ }
763
+ },
764
+ "required": [
765
+ "runId"
766
+ ],
767
+ "additionalProperties": false
768
+ }
769
+ }
770
+ }