@ksp-gonogo/kerbcast 1.9.1 → 1.10.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.
|
@@ -249,9 +249,32 @@ export declare enum ErrorSource {
|
|
|
249
249
|
Sidecar = "sidecar",
|
|
250
250
|
Client = "client"
|
|
251
251
|
}
|
|
252
|
+
/**
|
|
253
|
+
* Machine-readable reason for an `ErrorPayload`, so a client can react to a
|
|
254
|
+
* refusal without matching on the wording of `message`.
|
|
255
|
+
*/
|
|
256
|
+
export declare enum ErrorCode {
|
|
257
|
+
/** Every video slot is bound; the client negotiated too few transceivers. */
|
|
258
|
+
NoFreeSlot = "no-free-slot",
|
|
259
|
+
/**
|
|
260
|
+
* No camera with the requested flight id is registered. For cameras
|
|
261
|
+
* requested at connect time this is true as of the offer; the camera may
|
|
262
|
+
* appear later, so a client can retry with `Subscribe`.
|
|
263
|
+
*/
|
|
264
|
+
CameraNotFound = "camera-not-found",
|
|
265
|
+
/** The named camera exists but its part is gone. */
|
|
266
|
+
CameraDestroyed = "camera-destroyed"
|
|
267
|
+
}
|
|
252
268
|
export interface ErrorPayload {
|
|
253
269
|
message: string;
|
|
254
270
|
source?: ErrorSource;
|
|
271
|
+
/** Camera the error is about, when it concerns one. */
|
|
272
|
+
flightId?: number;
|
|
273
|
+
/**
|
|
274
|
+
* Reason code for refusals a client may want to act on. Absent for
|
|
275
|
+
* errors that only carry a human-readable `message`.
|
|
276
|
+
*/
|
|
277
|
+
code?: ErrorCode;
|
|
255
278
|
}
|
|
256
279
|
export interface FlightIdPayload {
|
|
257
280
|
flightId: number;
|
|
@@ -109,3 +109,20 @@ export var ErrorSource;
|
|
|
109
109
|
ErrorSource["Sidecar"] = "sidecar";
|
|
110
110
|
ErrorSource["Client"] = "client";
|
|
111
111
|
})(ErrorSource || (ErrorSource = {}));
|
|
112
|
+
/**
|
|
113
|
+
* Machine-readable reason for an `ErrorPayload`, so a client can react to a
|
|
114
|
+
* refusal without matching on the wording of `message`.
|
|
115
|
+
*/
|
|
116
|
+
export var ErrorCode;
|
|
117
|
+
(function (ErrorCode) {
|
|
118
|
+
/** Every video slot is bound; the client negotiated too few transceivers. */
|
|
119
|
+
ErrorCode["NoFreeSlot"] = "no-free-slot";
|
|
120
|
+
/**
|
|
121
|
+
* No camera with the requested flight id is registered. For cameras
|
|
122
|
+
* requested at connect time this is true as of the offer; the camera may
|
|
123
|
+
* appear later, so a client can retry with `Subscribe`.
|
|
124
|
+
*/
|
|
125
|
+
ErrorCode["CameraNotFound"] = "camera-not-found";
|
|
126
|
+
/** The named camera exists but its part is gone. */
|
|
127
|
+
ErrorCode["CameraDestroyed"] = "camera-destroyed";
|
|
128
|
+
})(ErrorCode || (ErrorCode = {}));
|
package/dist/testing/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CameraKind, CameraLifecycle, ErrorSource, Layer, QualityPreset, TrackMode } from "../__generated__/types";
|
|
1
|
+
import { CameraKind, CameraLifecycle, ErrorCode, ErrorSource, Layer, QualityPreset, TrackMode } from "../__generated__/types";
|
|
2
2
|
function buildCamera(init) {
|
|
3
3
|
return {
|
|
4
4
|
flightId: init.flightId,
|
|
@@ -525,7 +525,12 @@ export class MockSidecar {
|
|
|
525
525
|
if (freeMid === undefined) {
|
|
526
526
|
this._sendToClient({
|
|
527
527
|
type: "error",
|
|
528
|
-
content: {
|
|
528
|
+
content: {
|
|
529
|
+
message: "no free slot",
|
|
530
|
+
source: ErrorSource.Sidecar,
|
|
531
|
+
flightId,
|
|
532
|
+
code: ErrorCode.NoFreeSlot,
|
|
533
|
+
},
|
|
529
534
|
});
|
|
530
535
|
}
|
|
531
536
|
else {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ksp-gonogo/kerbcast",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.0",
|
|
4
4
|
"description": "TypeScript client for the kerbcast KSP camera-streaming sidecar. KerbcastClient wraps the WebRTC peer + control channel; wire-format types are typeshare-generated from the sidecar's Rust protocol module.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Jon Pepler",
|
|
@@ -265,9 +265,33 @@ export enum ErrorSource {
|
|
|
265
265
|
Client = "client",
|
|
266
266
|
}
|
|
267
267
|
|
|
268
|
+
/**
|
|
269
|
+
* Machine-readable reason for an `ErrorPayload`, so a client can react to a
|
|
270
|
+
* refusal without matching on the wording of `message`.
|
|
271
|
+
*/
|
|
272
|
+
export enum ErrorCode {
|
|
273
|
+
/** Every video slot is bound; the client negotiated too few transceivers. */
|
|
274
|
+
NoFreeSlot = "no-free-slot",
|
|
275
|
+
/**
|
|
276
|
+
* No camera with the requested flight id is registered. For cameras
|
|
277
|
+
* requested at connect time this is true as of the offer; the camera may
|
|
278
|
+
* appear later, so a client can retry with `Subscribe`.
|
|
279
|
+
*/
|
|
280
|
+
CameraNotFound = "camera-not-found",
|
|
281
|
+
/** The named camera exists but its part is gone. */
|
|
282
|
+
CameraDestroyed = "camera-destroyed",
|
|
283
|
+
}
|
|
284
|
+
|
|
268
285
|
export interface ErrorPayload {
|
|
269
286
|
message: string;
|
|
270
287
|
source?: ErrorSource;
|
|
288
|
+
/** Camera the error is about, when it concerns one. */
|
|
289
|
+
flightId?: number;
|
|
290
|
+
/**
|
|
291
|
+
* Reason code for refusals a client may want to act on. Absent for
|
|
292
|
+
* errors that only carry a human-readable `message`.
|
|
293
|
+
*/
|
|
294
|
+
code?: ErrorCode;
|
|
271
295
|
}
|
|
272
296
|
|
|
273
297
|
export interface FlightIdPayload {
|
package/src/testing/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AdaptiveShedPayload, CameraState, ClientMessage, ErrorPayload, ServerMessage, SettingsStatePayload } from "../__generated__/types";
|
|
2
|
-
import { CameraKind, CameraLifecycle, CrewLocation, ErrorSource, Layer, QualityPreset, TrackMode } from "../__generated__/types";
|
|
2
|
+
import { CameraKind, CameraLifecycle, CrewLocation, ErrorCode, ErrorSource, Layer, QualityPreset, TrackMode } from "../__generated__/types";
|
|
3
3
|
import type {
|
|
4
4
|
DiscoveredCamera,
|
|
5
5
|
InboundVideoStats,
|
|
@@ -646,7 +646,12 @@ export class MockSidecar {
|
|
|
646
646
|
if (freeMid === undefined) {
|
|
647
647
|
this._sendToClient({
|
|
648
648
|
type: "error",
|
|
649
|
-
content: {
|
|
649
|
+
content: {
|
|
650
|
+
message: "no free slot",
|
|
651
|
+
source: ErrorSource.Sidecar,
|
|
652
|
+
flightId,
|
|
653
|
+
code: ErrorCode.NoFreeSlot,
|
|
654
|
+
},
|
|
650
655
|
});
|
|
651
656
|
} else {
|
|
652
657
|
this._slotBindings.set(freeMid, flightId);
|