@mxtommy/kip 4.7.0-beta.2 → 4.7.0-beta.4

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,787 @@
1
+ {
2
+ "openapi": "3.0.0",
3
+ "info": {
4
+ "version": "1.1.0",
5
+ "title": "KIP Plugin API",
6
+ "description": "Endpoints\n- List remote displays and control remote dashboard of a given KIP instance.\n- Configure data series for widget framework historical data series and data chart widgets.",
7
+ "termsOfService": "http://signalk.org/terms/",
8
+ "license": {
9
+ "name": "Apache 2.0",
10
+ "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
11
+ }
12
+ },
13
+ "externalDocs": {
14
+ "url": "http://signalk.org/specification/",
15
+ "description": "Signal K specification."
16
+ },
17
+ "servers": [
18
+ {
19
+ "url": "/"
20
+ }
21
+ ],
22
+ "tags": [
23
+ {
24
+ "name": "Displays",
25
+ "description": "KIP remote display discovery and control."
26
+ },
27
+ {
28
+ "name": "Series",
29
+ "description": "KIP widget history series configuration."
30
+ }
31
+ ],
32
+ "components": {
33
+ "schemas": {
34
+ "DisplayInfo": {
35
+ "type": "object",
36
+ "properties": {
37
+ "displayId": {
38
+ "type": "string",
39
+ "description": "KIP instance UUID"
40
+ },
41
+ "displayName": {
42
+ "type": "string",
43
+ "nullable": true
44
+ }
45
+ },
46
+ "required": [
47
+ "displayId"
48
+ ]
49
+ },
50
+ "ScreenItem": {
51
+ "type": "object",
52
+ "properties": {
53
+ "id": {
54
+ "type": "string"
55
+ },
56
+ "name": {
57
+ "type": "string"
58
+ },
59
+ "icon": {
60
+ "type": "string"
61
+ }
62
+ },
63
+ "required": [
64
+ "id",
65
+ "name",
66
+ "icon"
67
+ ]
68
+ },
69
+ "ScreenListOrNull": {
70
+ "type": "array",
71
+ "nullable": true,
72
+ "items": {
73
+ "$ref": "#/components/schemas/ScreenItem"
74
+ }
75
+ },
76
+ "SuccessResponse": {
77
+ "type": "object",
78
+ "properties": {
79
+ "state": {
80
+ "type": "string",
81
+ "enum": [
82
+ "SUCCESS"
83
+ ]
84
+ },
85
+ "statusCode": {
86
+ "type": "integer",
87
+ "enum": [
88
+ 200
89
+ ]
90
+ }
91
+ },
92
+ "required": [
93
+ "state",
94
+ "statusCode"
95
+ ]
96
+ },
97
+ "ErrorResponse": {
98
+ "type": "object",
99
+ "properties": {
100
+ "state": {
101
+ "type": "string",
102
+ "enum": [
103
+ "FAILED"
104
+ ]
105
+ },
106
+ "statusCode": {
107
+ "type": "integer"
108
+ },
109
+ "message": {
110
+ "type": "string"
111
+ }
112
+ },
113
+ "required": [
114
+ "state",
115
+ "statusCode",
116
+ "message"
117
+ ]
118
+ },
119
+ "ActiveScreenSetRequest": {
120
+ "type": "object",
121
+ "properties": {
122
+ "screenIdx": {
123
+ "type": "integer",
124
+ "nullable": true,
125
+ "description": "Index of active screen or null to clear"
126
+ }
127
+ }
128
+ },
129
+ "AnyObjectOrNull": {
130
+ "type": "object",
131
+ "nullable": true,
132
+ "additionalProperties": true
133
+ },
134
+ "SeriesDefinitionBase": {
135
+ "type": "object",
136
+ "properties": {
137
+ "seriesId": {
138
+ "type": "string"
139
+ },
140
+ "datasetUuid": {
141
+ "type": "string"
142
+ },
143
+ "ownerWidgetUuid": {
144
+ "type": "string"
145
+ },
146
+ "ownerWidgetSelector": {
147
+ "type": "string",
148
+ "nullable": true
149
+ },
150
+ "path": {
151
+ "type": "string"
152
+ },
153
+ "context": {
154
+ "type": "string",
155
+ "nullable": true
156
+ },
157
+ "source": {
158
+ "type": "string",
159
+ "nullable": true
160
+ },
161
+ "timeScale": {
162
+ "type": "string",
163
+ "nullable": true
164
+ },
165
+ "period": {
166
+ "type": "integer",
167
+ "nullable": true
168
+ },
169
+ "retentionDurationMs": {
170
+ "type": "integer",
171
+ "nullable": true
172
+ },
173
+ "sampleTime": {
174
+ "type": "integer",
175
+ "nullable": true
176
+ },
177
+ "enabled": {
178
+ "type": "boolean",
179
+ "default": true
180
+ },
181
+ "methods": {
182
+ "type": "array",
183
+ "items": {
184
+ "type": "string",
185
+ "enum": [
186
+ "min",
187
+ "max",
188
+ "avg",
189
+ "sma",
190
+ "ema"
191
+ ]
192
+ }
193
+ },
194
+ "reconcileTs": {
195
+ "type": "integer",
196
+ "nullable": true
197
+ }
198
+ },
199
+ "required": [
200
+ "seriesId",
201
+ "datasetUuid",
202
+ "ownerWidgetUuid",
203
+ "ownerWidgetSelector",
204
+ "path",
205
+ "enabled"
206
+ ]
207
+ },
208
+ "ConcreteSeriesDefinition": {
209
+ "allOf": [
210
+ {
211
+ "$ref": "#/components/schemas/SeriesDefinitionBase"
212
+ },
213
+ {
214
+ "type": "object",
215
+ "properties": {
216
+ "expansionMode": {
217
+ "nullable": true,
218
+ "description": "Null for concrete series definitions."
219
+ },
220
+ "allowedBatteryIds": {
221
+ "type": "array",
222
+ "nullable": true,
223
+ "items": {
224
+ "type": "string"
225
+ },
226
+ "description": "Concrete series do not use battery filters and should leave this null."
227
+ }
228
+ }
229
+ }
230
+ ]
231
+ },
232
+ "TemplateSeriesDefinition": {
233
+ "allOf": [
234
+ {
235
+ "$ref": "#/components/schemas/SeriesDefinitionBase"
236
+ },
237
+ {
238
+ "type": "object",
239
+ "properties": {
240
+ "ownerWidgetSelector": {
241
+ "type": "string",
242
+ "enum": [
243
+ "widget-bms"
244
+ ]
245
+ },
246
+ "expansionMode": {
247
+ "type": "string",
248
+ "enum": [
249
+ "bms-battery-tree"
250
+ ]
251
+ },
252
+ "allowedBatteryIds": {
253
+ "type": "array",
254
+ "nullable": true,
255
+ "items": {
256
+ "type": "string"
257
+ }
258
+ }
259
+ },
260
+ "required": [
261
+ "ownerWidgetSelector",
262
+ "expansionMode"
263
+ ]
264
+ }
265
+ ]
266
+ },
267
+ "SeriesDefinition": {
268
+ "oneOf": [
269
+ {
270
+ "$ref": "#/components/schemas/ConcreteSeriesDefinition"
271
+ },
272
+ {
273
+ "$ref": "#/components/schemas/TemplateSeriesDefinition"
274
+ }
275
+ ]
276
+ },
277
+ "SeriesReconcileResult": {
278
+ "type": "object",
279
+ "properties": {
280
+ "created": {
281
+ "type": "integer"
282
+ },
283
+ "updated": {
284
+ "type": "integer"
285
+ },
286
+ "deleted": {
287
+ "type": "integer"
288
+ },
289
+ "total": {
290
+ "type": "integer"
291
+ }
292
+ },
293
+ "required": [
294
+ "created",
295
+ "updated",
296
+ "deleted",
297
+ "total"
298
+ ]
299
+ }
300
+ },
301
+ "parameters": {
302
+ "DisplayIdParam": {
303
+ "in": "path",
304
+ "required": true,
305
+ "name": "displayId",
306
+ "description": "KIP instance UUID",
307
+ "schema": {
308
+ "type": "string"
309
+ }
310
+ },
311
+ "SeriesIdParam": {
312
+ "in": "path",
313
+ "required": true,
314
+ "name": "seriesId",
315
+ "description": "Series identifier (dataset UUID)",
316
+ "schema": {
317
+ "type": "string"
318
+ }
319
+ }
320
+ },
321
+ "securitySchemes": {
322
+ "bearerAuth": {
323
+ "type": "http",
324
+ "scheme": "bearer",
325
+ "bearerFormat": "JWT"
326
+ },
327
+ "cookieAuth": {
328
+ "type": "apiKey",
329
+ "in": "cookie",
330
+ "name": "JAUTHENTICATION"
331
+ }
332
+ }
333
+ },
334
+ "security": [
335
+ {
336
+ "cookieAuth": []
337
+ },
338
+ {
339
+ "bearerAuth": []
340
+ }
341
+ ],
342
+ "paths": {
343
+ "/plugins/kip/displays": {
344
+ "get": {
345
+ "tags": [
346
+ "Displays"
347
+ ],
348
+ "summary": "List available KIP displays",
349
+ "responses": {
350
+ "200": {
351
+ "description": "List of KIP instances discovered under self.displays",
352
+ "content": {
353
+ "application/json": {
354
+ "schema": {
355
+ "type": "array",
356
+ "items": {
357
+ "$ref": "#/components/schemas/DisplayInfo"
358
+ }
359
+ }
360
+ }
361
+ }
362
+ },
363
+ "400": {
364
+ "description": "Bad request",
365
+ "content": {
366
+ "application/json": {
367
+ "schema": {
368
+ "$ref": "#/components/schemas/ErrorResponse"
369
+ }
370
+ }
371
+ }
372
+ }
373
+ }
374
+ }
375
+ },
376
+ "/plugins/kip/displays/{displayId}": {
377
+ "parameters": [
378
+ {
379
+ "$ref": "#/components/parameters/DisplayIdParam"
380
+ }
381
+ ],
382
+ "get": {
383
+ "tags": [
384
+ "Displays"
385
+ ],
386
+ "summary": "List screens for a display (self.displays.{displayId}.value.screens)",
387
+ "responses": {
388
+ "200": {
389
+ "description": "Array of screen entries (or null)",
390
+ "content": {
391
+ "application/json": {
392
+ "schema": {
393
+ "$ref": "#/components/schemas/ScreenListOrNull"
394
+ }
395
+ }
396
+ }
397
+ },
398
+ "404": {
399
+ "description": "Not found",
400
+ "content": {
401
+ "application/json": {
402
+ "schema": {
403
+ "$ref": "#/components/schemas/ErrorResponse"
404
+ }
405
+ }
406
+ }
407
+ },
408
+ "400": {
409
+ "description": "Bad request",
410
+ "content": {
411
+ "application/json": {
412
+ "schema": {
413
+ "$ref": "#/components/schemas/ErrorResponse"
414
+ }
415
+ }
416
+ }
417
+ }
418
+ }
419
+ },
420
+ "put": {
421
+ "tags": [
422
+ "Displays"
423
+ ],
424
+ "summary": "Set display entry under self.displays.{displayId}",
425
+ "requestBody": {
426
+ "required": false,
427
+ "content": {
428
+ "application/json": {
429
+ "schema": {
430
+ "$ref": "#/components/schemas/AnyObjectOrNull"
431
+ }
432
+ }
433
+ }
434
+ },
435
+ "responses": {
436
+ "200": {
437
+ "description": "Updated",
438
+ "content": {
439
+ "application/json": {
440
+ "schema": {
441
+ "$ref": "#/components/schemas/SuccessResponse"
442
+ }
443
+ }
444
+ }
445
+ },
446
+ "400": {
447
+ "description": "Bad request",
448
+ "content": {
449
+ "application/json": {
450
+ "schema": {
451
+ "$ref": "#/components/schemas/ErrorResponse"
452
+ }
453
+ }
454
+ }
455
+ }
456
+ }
457
+ }
458
+ },
459
+ "/plugins/kip/displays/{displayId}/screenIndex": {
460
+ "parameters": [
461
+ {
462
+ "$ref": "#/components/parameters/DisplayIdParam"
463
+ }
464
+ ],
465
+ "get": {
466
+ "tags": [
467
+ "Displays"
468
+ ],
469
+ "summary": "Get current screen index for display (self.displays.{displayId}.screenIndex)",
470
+ "responses": {
471
+ "200": {
472
+ "description": "Current screen index or null",
473
+ "content": {
474
+ "application/json": {
475
+ "schema": {
476
+ "type": "integer",
477
+ "nullable": true
478
+ }
479
+ }
480
+ }
481
+ },
482
+ "404": {
483
+ "description": "Not found",
484
+ "content": {
485
+ "application/json": {
486
+ "schema": {
487
+ "$ref": "#/components/schemas/ErrorResponse"
488
+ }
489
+ }
490
+ }
491
+ },
492
+ "400": {
493
+ "description": "Bad request",
494
+ "content": {
495
+ "application/json": {
496
+ "schema": {
497
+ "$ref": "#/components/schemas/ErrorResponse"
498
+ }
499
+ }
500
+ }
501
+ }
502
+ }
503
+ },
504
+ "put": {
505
+ "tags": [
506
+ "Displays"
507
+ ],
508
+ "summary": "Set current screen index for display (self.displays.{displayId}.screenIndex)",
509
+ "requestBody": {
510
+ "required": false,
511
+ "content": {
512
+ "application/json": {
513
+ "schema": {
514
+ "$ref": "#/components/schemas/ActiveScreenSetRequest"
515
+ }
516
+ }
517
+ }
518
+ },
519
+ "responses": {
520
+ "200": {
521
+ "description": "Updated",
522
+ "content": {
523
+ "application/json": {
524
+ "schema": {
525
+ "$ref": "#/components/schemas/SuccessResponse"
526
+ }
527
+ }
528
+ }
529
+ },
530
+ "400": {
531
+ "description": "Bad request",
532
+ "content": {
533
+ "application/json": {
534
+ "schema": {
535
+ "$ref": "#/components/schemas/ErrorResponse"
536
+ }
537
+ }
538
+ }
539
+ }
540
+ }
541
+ }
542
+ },
543
+ "/plugins/kip/displays/{displayId}/activeScreen": {
544
+ "parameters": [
545
+ {
546
+ "$ref": "#/components/parameters/DisplayIdParam"
547
+ }
548
+ ],
549
+ "get": {
550
+ "tags": [
551
+ "Displays"
552
+ ],
553
+ "summary": "Get requested screen change index (self.displays.{displayId}.activeScreen)",
554
+ "responses": {
555
+ "200": {
556
+ "description": "Requested screen index or null",
557
+ "content": {
558
+ "application/json": {
559
+ "schema": {
560
+ "type": "integer",
561
+ "nullable": true
562
+ }
563
+ }
564
+ }
565
+ },
566
+ "404": {
567
+ "description": "Not found",
568
+ "content": {
569
+ "application/json": {
570
+ "schema": {
571
+ "$ref": "#/components/schemas/ErrorResponse"
572
+ }
573
+ }
574
+ }
575
+ },
576
+ "400": {
577
+ "description": "Bad request",
578
+ "content": {
579
+ "application/json": {
580
+ "schema": {
581
+ "$ref": "#/components/schemas/ErrorResponse"
582
+ }
583
+ }
584
+ }
585
+ }
586
+ }
587
+ },
588
+ "put": {
589
+ "tags": [
590
+ "Displays"
591
+ ],
592
+ "summary": "Request a screen change (sets self.displays.{displayId}.activeScreen)",
593
+ "requestBody": {
594
+ "required": false,
595
+ "content": {
596
+ "application/json": {
597
+ "schema": {
598
+ "$ref": "#/components/schemas/ActiveScreenSetRequest"
599
+ }
600
+ }
601
+ }
602
+ },
603
+ "responses": {
604
+ "200": {
605
+ "description": "Updated",
606
+ "content": {
607
+ "application/json": {
608
+ "schema": {
609
+ "$ref": "#/components/schemas/SuccessResponse"
610
+ }
611
+ }
612
+ }
613
+ },
614
+ "400": {
615
+ "description": "Bad request",
616
+ "content": {
617
+ "application/json": {
618
+ "schema": {
619
+ "$ref": "#/components/schemas/ErrorResponse"
620
+ }
621
+ }
622
+ }
623
+ }
624
+ }
625
+ }
626
+ },
627
+ "/plugins/kip/series": {
628
+ "get": {
629
+ "tags": [
630
+ "Series"
631
+ ],
632
+ "summary": "List all configured history series",
633
+ "responses": {
634
+ "200": {
635
+ "description": "Current series definitions",
636
+ "content": {
637
+ "application/json": {
638
+ "schema": {
639
+ "type": "array",
640
+ "items": {
641
+ "$ref": "#/components/schemas/SeriesDefinition"
642
+ }
643
+ }
644
+ }
645
+ }
646
+ },
647
+ "400": {
648
+ "description": "Bad request",
649
+ "content": {
650
+ "application/json": {
651
+ "schema": {
652
+ "$ref": "#/components/schemas/ErrorResponse"
653
+ }
654
+ }
655
+ }
656
+ }
657
+ }
658
+ }
659
+ },
660
+ "/plugins/kip/series/{seriesId}": {
661
+ "parameters": [
662
+ {
663
+ "$ref": "#/components/parameters/SeriesIdParam"
664
+ }
665
+ ],
666
+ "put": {
667
+ "tags": [
668
+ "Series"
669
+ ],
670
+ "summary": "Create or update a series definition",
671
+ "requestBody": {
672
+ "required": true,
673
+ "content": {
674
+ "application/json": {
675
+ "schema": {
676
+ "$ref": "#/components/schemas/SeriesDefinition"
677
+ }
678
+ }
679
+ }
680
+ },
681
+ "responses": {
682
+ "200": {
683
+ "description": "Series upserted",
684
+ "content": {
685
+ "application/json": {
686
+ "schema": {
687
+ "$ref": "#/components/schemas/SeriesDefinition"
688
+ }
689
+ }
690
+ }
691
+ },
692
+ "400": {
693
+ "description": "Bad request",
694
+ "content": {
695
+ "application/json": {
696
+ "schema": {
697
+ "$ref": "#/components/schemas/ErrorResponse"
698
+ }
699
+ }
700
+ }
701
+ }
702
+ }
703
+ },
704
+ "delete": {
705
+ "tags": [
706
+ "Series"
707
+ ],
708
+ "summary": "Delete a series definition",
709
+ "responses": {
710
+ "200": {
711
+ "description": "Series removed",
712
+ "content": {
713
+ "application/json": {
714
+ "schema": {
715
+ "$ref": "#/components/schemas/SuccessResponse"
716
+ }
717
+ }
718
+ }
719
+ },
720
+ "404": {
721
+ "description": "Series not found",
722
+ "content": {
723
+ "application/json": {
724
+ "schema": {
725
+ "$ref": "#/components/schemas/ErrorResponse"
726
+ }
727
+ }
728
+ }
729
+ },
730
+ "400": {
731
+ "description": "Bad request",
732
+ "content": {
733
+ "application/json": {
734
+ "schema": {
735
+ "$ref": "#/components/schemas/ErrorResponse"
736
+ }
737
+ }
738
+ }
739
+ }
740
+ }
741
+ }
742
+ },
743
+ "/plugins/kip/series/reconcile": {
744
+ "post": {
745
+ "tags": [
746
+ "Series"
747
+ ],
748
+ "summary": "Reconcile full desired series set",
749
+ "requestBody": {
750
+ "required": true,
751
+ "content": {
752
+ "application/json": {
753
+ "schema": {
754
+ "type": "array",
755
+ "items": {
756
+ "$ref": "#/components/schemas/SeriesDefinition"
757
+ }
758
+ }
759
+ }
760
+ }
761
+ },
762
+ "responses": {
763
+ "200": {
764
+ "description": "Reconcile summary",
765
+ "content": {
766
+ "application/json": {
767
+ "schema": {
768
+ "$ref": "#/components/schemas/SeriesReconcileResult"
769
+ }
770
+ }
771
+ }
772
+ },
773
+ "400": {
774
+ "description": "Bad request",
775
+ "content": {
776
+ "application/json": {
777
+ "schema": {
778
+ "$ref": "#/components/schemas/ErrorResponse"
779
+ }
780
+ }
781
+ }
782
+ }
783
+ }
784
+ }
785
+ }
786
+ }
787
+ }