@stim-cli/server 0.0.0 → 1.10.1

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,689 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "Stim server protocol",
4
+ "description": "Messages exchanged over the stim-server WebSocket, protocol version 1.",
5
+ "x-stim-protocol": 1,
6
+ "$defs": {
7
+ "ProtocolError": {
8
+ "type": "object",
9
+ "required": [
10
+ "code",
11
+ "message"
12
+ ],
13
+ "additionalProperties": false,
14
+ "properties": {
15
+ "code": {
16
+ "enum": [
17
+ "unauthorized",
18
+ "pairing-expired",
19
+ "protocol-unsupported",
20
+ "identity-unavailable",
21
+ "bad-request",
22
+ "unknown-method",
23
+ "already-authenticated",
24
+ "unknown-subscription",
25
+ "unknown-workspace",
26
+ "limit-exceeded",
27
+ "slow-client",
28
+ "status-failed",
29
+ "logs-failed",
30
+ "stim-failed",
31
+ "frames-failed"
32
+ ]
33
+ },
34
+ "message": {
35
+ "type": "string"
36
+ }
37
+ }
38
+ },
39
+ "HelloParams": {
40
+ "type": "object",
41
+ "required": [
42
+ "protocol",
43
+ "client",
44
+ "auth"
45
+ ],
46
+ "additionalProperties": false,
47
+ "properties": {
48
+ "protocol": {
49
+ "type": "integer"
50
+ },
51
+ "client": {
52
+ "type": "object",
53
+ "required": [
54
+ "name",
55
+ "version"
56
+ ],
57
+ "properties": {
58
+ "name": {
59
+ "type": "string"
60
+ },
61
+ "version": {
62
+ "type": "string"
63
+ }
64
+ }
65
+ },
66
+ "auth": {
67
+ "oneOf": [
68
+ {
69
+ "type": "object",
70
+ "required": [
71
+ "pairingToken",
72
+ "deviceName"
73
+ ],
74
+ "additionalProperties": false,
75
+ "properties": {
76
+ "pairingToken": {
77
+ "type": "string"
78
+ },
79
+ "deviceName": {
80
+ "type": "string",
81
+ "minLength": 1
82
+ }
83
+ }
84
+ },
85
+ {
86
+ "type": "object",
87
+ "required": [
88
+ "deviceToken"
89
+ ],
90
+ "additionalProperties": false,
91
+ "properties": {
92
+ "deviceToken": {
93
+ "type": "string"
94
+ }
95
+ }
96
+ }
97
+ ]
98
+ }
99
+ }
100
+ },
101
+ "HelloResult": {
102
+ "type": "object",
103
+ "required": [
104
+ "protocol",
105
+ "server",
106
+ "capabilities",
107
+ "device"
108
+ ],
109
+ "additionalProperties": false,
110
+ "properties": {
111
+ "protocol": {
112
+ "type": "integer"
113
+ },
114
+ "server": {
115
+ "type": "object",
116
+ "required": [
117
+ "name",
118
+ "version",
119
+ "stim"
120
+ ],
121
+ "additionalProperties": false,
122
+ "properties": {
123
+ "name": {
124
+ "type": "string"
125
+ },
126
+ "version": {
127
+ "type": "string"
128
+ },
129
+ "stim": {
130
+ "type": "string"
131
+ }
132
+ }
133
+ },
134
+ "capabilities": {
135
+ "type": "array",
136
+ "items": {
137
+ "enum": [
138
+ "read"
139
+ ]
140
+ }
141
+ },
142
+ "device": {
143
+ "type": "object",
144
+ "required": [
145
+ "id",
146
+ "name"
147
+ ],
148
+ "additionalProperties": false,
149
+ "properties": {
150
+ "id": {
151
+ "type": "string"
152
+ },
153
+ "name": {
154
+ "type": "string"
155
+ }
156
+ }
157
+ },
158
+ "deviceToken": {
159
+ "type": "string"
160
+ }
161
+ }
162
+ },
163
+ "LogRecord": {
164
+ "type": "object",
165
+ "description": "One record as `stim logs --json` prints it.",
166
+ "properties": {
167
+ "ts": {
168
+ "type": "number"
169
+ },
170
+ "src": {
171
+ "type": "string"
172
+ },
173
+ "level": {
174
+ "type": "string"
175
+ },
176
+ "msg": {
177
+ "type": "string"
178
+ }
179
+ }
180
+ },
181
+ "LogFilter": {
182
+ "type": "object",
183
+ "required": [
184
+ "workspace"
185
+ ],
186
+ "additionalProperties": false,
187
+ "properties": {
188
+ "workspace": {
189
+ "type": "string",
190
+ "description": "An environment path from a status payload."
191
+ },
192
+ "sources": {
193
+ "type": "array",
194
+ "minItems": 1,
195
+ "items": {
196
+ "enum": [
197
+ "metro",
198
+ "client",
199
+ "device",
200
+ "build"
201
+ ]
202
+ }
203
+ },
204
+ "level": {
205
+ "enum": [
206
+ "debug",
207
+ "info",
208
+ "warn",
209
+ "error",
210
+ "fatal"
211
+ ]
212
+ },
213
+ "slot": {
214
+ "type": "string",
215
+ "minLength": 1
216
+ },
217
+ "grep": {
218
+ "type": "string",
219
+ "description": "A regular expression matched against each message."
220
+ },
221
+ "errors": {
222
+ "type": "boolean"
223
+ },
224
+ "tail": {
225
+ "type": "integer",
226
+ "minimum": 1,
227
+ "maximum": 5000,
228
+ "default": 5000
229
+ }
230
+ }
231
+ },
232
+ "FrameTarget": {
233
+ "type": "object",
234
+ "required": [
235
+ "workspace",
236
+ "platform"
237
+ ],
238
+ "additionalProperties": false,
239
+ "properties": {
240
+ "workspace": {
241
+ "type": "string",
242
+ "description": "An environment path from a status payload."
243
+ },
244
+ "platform": {
245
+ "enum": [
246
+ "ios",
247
+ "android"
248
+ ]
249
+ },
250
+ "slot": {
251
+ "type": "string",
252
+ "minLength": 1,
253
+ "default": "default"
254
+ }
255
+ }
256
+ },
257
+ "WorkspaceParams": {
258
+ "type": "object",
259
+ "additionalProperties": false,
260
+ "properties": {
261
+ "workspace": {
262
+ "type": "string",
263
+ "description": "An environment path from a status payload."
264
+ }
265
+ }
266
+ },
267
+ "ClientRequest": {
268
+ "oneOf": [
269
+ {
270
+ "type": "object",
271
+ "required": [
272
+ "id",
273
+ "method",
274
+ "params"
275
+ ],
276
+ "additionalProperties": false,
277
+ "properties": {
278
+ "id": {
279
+ "type": [
280
+ "integer",
281
+ "string"
282
+ ]
283
+ },
284
+ "method": {
285
+ "const": "hello"
286
+ },
287
+ "params": {
288
+ "$ref": "#/$defs/HelloParams"
289
+ }
290
+ }
291
+ },
292
+ {
293
+ "type": "object",
294
+ "required": [
295
+ "id",
296
+ "method"
297
+ ],
298
+ "additionalProperties": false,
299
+ "properties": {
300
+ "id": {
301
+ "type": [
302
+ "integer",
303
+ "string"
304
+ ]
305
+ },
306
+ "method": {
307
+ "const": "status.subscribe"
308
+ },
309
+ "params": {
310
+ "type": "object",
311
+ "maxProperties": 0
312
+ }
313
+ }
314
+ },
315
+ {
316
+ "type": "object",
317
+ "required": [
318
+ "id",
319
+ "method",
320
+ "params"
321
+ ],
322
+ "additionalProperties": false,
323
+ "properties": {
324
+ "id": {
325
+ "type": [
326
+ "integer",
327
+ "string"
328
+ ]
329
+ },
330
+ "method": {
331
+ "const": "logs.query"
332
+ },
333
+ "params": {
334
+ "$ref": "#/$defs/LogFilter"
335
+ }
336
+ }
337
+ },
338
+ {
339
+ "type": "object",
340
+ "required": [
341
+ "id",
342
+ "method",
343
+ "params"
344
+ ],
345
+ "additionalProperties": false,
346
+ "properties": {
347
+ "id": {
348
+ "type": [
349
+ "integer",
350
+ "string"
351
+ ]
352
+ },
353
+ "method": {
354
+ "const": "logs.subscribe"
355
+ },
356
+ "params": {
357
+ "$ref": "#/$defs/LogFilter"
358
+ }
359
+ }
360
+ },
361
+ {
362
+ "type": "object",
363
+ "required": [
364
+ "id",
365
+ "method",
366
+ "params"
367
+ ],
368
+ "additionalProperties": false,
369
+ "properties": {
370
+ "id": {
371
+ "type": [
372
+ "integer",
373
+ "string"
374
+ ]
375
+ },
376
+ "method": {
377
+ "const": "frames.subscribe"
378
+ },
379
+ "params": {
380
+ "$ref": "#/$defs/FrameTarget"
381
+ }
382
+ }
383
+ },
384
+ {
385
+ "type": "object",
386
+ "required": [
387
+ "id",
388
+ "method"
389
+ ],
390
+ "additionalProperties": false,
391
+ "properties": {
392
+ "id": {
393
+ "type": [
394
+ "integer",
395
+ "string"
396
+ ]
397
+ },
398
+ "method": {
399
+ "const": "stats.get"
400
+ },
401
+ "params": {
402
+ "$ref": "#/$defs/WorkspaceParams"
403
+ }
404
+ }
405
+ },
406
+ {
407
+ "type": "object",
408
+ "required": [
409
+ "id",
410
+ "method"
411
+ ],
412
+ "additionalProperties": false,
413
+ "properties": {
414
+ "id": {
415
+ "type": [
416
+ "integer",
417
+ "string"
418
+ ]
419
+ },
420
+ "method": {
421
+ "const": "settings.get"
422
+ },
423
+ "params": {
424
+ "$ref": "#/$defs/WorkspaceParams"
425
+ }
426
+ }
427
+ },
428
+ {
429
+ "type": "object",
430
+ "required": [
431
+ "id",
432
+ "method",
433
+ "params"
434
+ ],
435
+ "additionalProperties": false,
436
+ "properties": {
437
+ "id": {
438
+ "type": [
439
+ "integer",
440
+ "string"
441
+ ]
442
+ },
443
+ "method": {
444
+ "const": "unsubscribe"
445
+ },
446
+ "params": {
447
+ "type": "object",
448
+ "required": [
449
+ "subscription"
450
+ ],
451
+ "additionalProperties": false,
452
+ "properties": {
453
+ "subscription": {
454
+ "type": "string"
455
+ }
456
+ }
457
+ }
458
+ }
459
+ }
460
+ ]
461
+ },
462
+ "ServerResponse": {
463
+ "oneOf": [
464
+ {
465
+ "type": "object",
466
+ "required": [
467
+ "id",
468
+ "result"
469
+ ],
470
+ "additionalProperties": false,
471
+ "properties": {
472
+ "id": {
473
+ "type": [
474
+ "integer",
475
+ "string"
476
+ ]
477
+ },
478
+ "result": {
479
+ "anyOf": [
480
+ {
481
+ "$ref": "#/$defs/HelloResult"
482
+ },
483
+ {
484
+ "type": "object",
485
+ "required": [
486
+ "subscription"
487
+ ],
488
+ "additionalProperties": false,
489
+ "properties": {
490
+ "subscription": {
491
+ "type": "string"
492
+ }
493
+ }
494
+ },
495
+ {
496
+ "type": "object",
497
+ "required": [
498
+ "records"
499
+ ],
500
+ "additionalProperties": false,
501
+ "properties": {
502
+ "records": {
503
+ "type": "array",
504
+ "items": {
505
+ "$ref": "#/$defs/LogRecord"
506
+ }
507
+ }
508
+ }
509
+ },
510
+ {
511
+ "type": "object",
512
+ "description": "The payload of `stim stats --json` or `stim settings --json`, or {} for unsubscribe."
513
+ }
514
+ ]
515
+ }
516
+ }
517
+ },
518
+ {
519
+ "type": "object",
520
+ "required": [
521
+ "id",
522
+ "error"
523
+ ],
524
+ "additionalProperties": false,
525
+ "properties": {
526
+ "id": {
527
+ "type": [
528
+ "integer",
529
+ "string",
530
+ "null"
531
+ ]
532
+ },
533
+ "error": {
534
+ "$ref": "#/$defs/ProtocolError"
535
+ }
536
+ }
537
+ }
538
+ ]
539
+ },
540
+ "ServerEvent": {
541
+ "oneOf": [
542
+ {
543
+ "type": "object",
544
+ "required": [
545
+ "event",
546
+ "subscription",
547
+ "payload"
548
+ ],
549
+ "additionalProperties": false,
550
+ "properties": {
551
+ "event": {
552
+ "const": "status"
553
+ },
554
+ "subscription": {
555
+ "type": "string"
556
+ },
557
+ "payload": {
558
+ "type": "object",
559
+ "description": "A full payload, as `stim status --watch --json` prints it."
560
+ }
561
+ }
562
+ },
563
+ {
564
+ "type": "object",
565
+ "required": [
566
+ "event",
567
+ "subscription",
568
+ "records"
569
+ ],
570
+ "additionalProperties": false,
571
+ "properties": {
572
+ "event": {
573
+ "const": "logs"
574
+ },
575
+ "subscription": {
576
+ "type": "string"
577
+ },
578
+ "records": {
579
+ "type": "array",
580
+ "items": {
581
+ "$ref": "#/$defs/LogRecord"
582
+ }
583
+ }
584
+ }
585
+ },
586
+ {
587
+ "type": "object",
588
+ "required": [
589
+ "event",
590
+ "subscription",
591
+ "platform",
592
+ "slot",
593
+ "mime",
594
+ "width",
595
+ "height",
596
+ "capturedAt",
597
+ "data"
598
+ ],
599
+ "additionalProperties": false,
600
+ "properties": {
601
+ "event": {
602
+ "const": "frame"
603
+ },
604
+ "subscription": {
605
+ "type": "string"
606
+ },
607
+ "platform": {
608
+ "enum": [
609
+ "ios",
610
+ "android"
611
+ ]
612
+ },
613
+ "slot": {
614
+ "type": "string"
615
+ },
616
+ "mime": {
617
+ "const": "image/jpeg"
618
+ },
619
+ "width": {
620
+ "type": "integer"
621
+ },
622
+ "height": {
623
+ "type": "integer"
624
+ },
625
+ "capturedAt": {
626
+ "type": "string",
627
+ "format": "date-time"
628
+ },
629
+ "data": {
630
+ "type": "string",
631
+ "contentEncoding": "base64"
632
+ }
633
+ }
634
+ },
635
+ {
636
+ "type": "object",
637
+ "required": [
638
+ "event",
639
+ "subscription",
640
+ "delayed"
641
+ ],
642
+ "additionalProperties": false,
643
+ "properties": {
644
+ "event": {
645
+ "const": "frame-delayed"
646
+ },
647
+ "subscription": {
648
+ "type": "string"
649
+ },
650
+ "delayed": {
651
+ "type": "boolean"
652
+ }
653
+ }
654
+ },
655
+ {
656
+ "type": "object",
657
+ "required": [
658
+ "event",
659
+ "subscription",
660
+ "error"
661
+ ],
662
+ "additionalProperties": false,
663
+ "properties": {
664
+ "event": {
665
+ "const": "error"
666
+ },
667
+ "subscription": {
668
+ "type": "string"
669
+ },
670
+ "error": {
671
+ "$ref": "#/$defs/ProtocolError"
672
+ }
673
+ }
674
+ }
675
+ ]
676
+ }
677
+ },
678
+ "oneOf": [
679
+ {
680
+ "$ref": "#/$defs/ClientRequest"
681
+ },
682
+ {
683
+ "$ref": "#/$defs/ServerResponse"
684
+ },
685
+ {
686
+ "$ref": "#/$defs/ServerEvent"
687
+ }
688
+ ]
689
+ }
@@ -0,0 +1 @@
1
+ export {}