@stinkycomputing/sesame-api-client 1.10.0-alpha.2 → 1.10.0-alpha.3
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.
- package/README.md +8 -2
- package/dist/index.browser.mjs +60 -0
- package/dist/index.browser.mjs.map +2 -2
- package/dist/index.cjs +61 -0
- package/dist/index.cjs.map +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +60 -0
- package/dist/index.mjs.map +2 -2
- package/dist/proto/api.d.ts +6 -0
- package/dist/proto/api.js +23 -0
- package/dist/sesame-wire-protocol.d.ts +27 -1
- package/dist/sesame-wire-protocol.d.ts.map +1 -1
- package/docs/protocol-reference.md +47 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -261,12 +261,17 @@ ws.addEventListener('message', async (evt) => {
|
|
|
261
261
|
| `'json'` | `unknown` (parsed JSON) | server → client |
|
|
262
262
|
| `'transport-status'` | `sesame.v1.status.TransportEvent` | server → client |
|
|
263
263
|
| `'audio-state'` | `sesame.v1.audio.AudioMixerStatus` | server → client |
|
|
264
|
+
| `'output-status'` | `sesame.v1.outputs.OutputStatus` | server → client |
|
|
265
|
+
| `'source-status'` | `sesame.v1.sources.SourceStatus` | server → client |
|
|
266
|
+
| `'engine-status'` | `sesame.v1.status.Status` (full monitor status) | server → client |
|
|
264
267
|
| `'transport-control'` | `sesame.v1.sources.TransportControlRequest` | client → server |
|
|
265
268
|
| `'audio-control'` | `sesame.v1.audio.AudioControlRequest` | client → server |
|
|
269
|
+
| `'output-control'` | `sesame.v1.outputs.OutputControlRequest` | client → server |
|
|
270
|
+
| `'source-control'` | `sesame.v1.sources.SourceControlRequest` | client → server |
|
|
266
271
|
|
|
267
272
|
### Sending Remote Control (source stream → server)
|
|
268
273
|
|
|
269
|
-
Send control frames over a WebSocket **source** connection (inbound to the server).
|
|
274
|
+
Send control frames over a WebSocket **source** connection (inbound to the server). Audio control resolves the target mixer from the metadata binding, so no ID is needed in the payload. Transport control tracks are bound to the reserved target `sources` and the request names the source in `sourceId`.
|
|
270
275
|
|
|
271
276
|
```typescript
|
|
272
277
|
import { buildAudioControlFrame, buildTransportControlFrame, sesame } from '@stinkycomputing/sesame-api-client';
|
|
@@ -286,8 +291,9 @@ ws.send(buildAudioControlFrame('sesame.audio.control.v1', {
|
|
|
286
291
|
}],
|
|
287
292
|
}));
|
|
288
293
|
|
|
289
|
-
// Queue a transport command on a bound
|
|
294
|
+
// Queue a transport command on a source (track bound to the reserved target `sources`)
|
|
290
295
|
ws.send(buildTransportControlFrame('sesame.transport.control.v1', {
|
|
296
|
+
sourceId: 'file-1',
|
|
291
297
|
cmdType: sesame.v1.sources.SourceTransportCommandType.SOURCE_TRANSPORT_CMD_PLAY,
|
|
292
298
|
}));
|
|
293
299
|
```
|
package/dist/index.browser.mjs
CHANGED
|
@@ -11374,6 +11374,7 @@ var sesame = $root.sesame = (() => {
|
|
|
11374
11374
|
}
|
|
11375
11375
|
TransportControlRequest.prototype.cmdType = 0;
|
|
11376
11376
|
TransportControlRequest.prototype.value = null;
|
|
11377
|
+
TransportControlRequest.prototype.sourceId = "";
|
|
11377
11378
|
TransportControlRequest.create = function create(properties) {
|
|
11378
11379
|
return new TransportControlRequest(properties);
|
|
11379
11380
|
};
|
|
@@ -11390,6 +11391,11 @@ var sesame = $root.sesame = (() => {
|
|
|
11390
11391
|
/* id 2, wireType 2 =*/
|
|
11391
11392
|
18
|
|
11392
11393
|
).fork()).ldelim();
|
|
11394
|
+
if (message.sourceId != null && Object.hasOwnProperty.call(message, "sourceId"))
|
|
11395
|
+
writer.uint32(
|
|
11396
|
+
/* id 3, wireType 2 =*/
|
|
11397
|
+
26
|
|
11398
|
+
).string(message.sourceId);
|
|
11393
11399
|
return writer;
|
|
11394
11400
|
};
|
|
11395
11401
|
TransportControlRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
|
@@ -11412,6 +11418,10 @@ var sesame = $root.sesame = (() => {
|
|
|
11412
11418
|
message.value = $root.sesame.v1.common.PropValue.decode(reader, reader.uint32());
|
|
11413
11419
|
break;
|
|
11414
11420
|
}
|
|
11421
|
+
case 3: {
|
|
11422
|
+
message.sourceId = reader.string();
|
|
11423
|
+
break;
|
|
11424
|
+
}
|
|
11415
11425
|
default:
|
|
11416
11426
|
reader.skipType(tag & 7);
|
|
11417
11427
|
break;
|
|
@@ -11455,6 +11465,10 @@ var sesame = $root.sesame = (() => {
|
|
|
11455
11465
|
if (error)
|
|
11456
11466
|
return "value." + error;
|
|
11457
11467
|
}
|
|
11468
|
+
if (message.sourceId != null && message.hasOwnProperty("sourceId")) {
|
|
11469
|
+
if (!$util.isString(message.sourceId))
|
|
11470
|
+
return "sourceId: string expected";
|
|
11471
|
+
}
|
|
11458
11472
|
return null;
|
|
11459
11473
|
};
|
|
11460
11474
|
TransportControlRequest.fromObject = function fromObject(object) {
|
|
@@ -11542,6 +11556,8 @@ var sesame = $root.sesame = (() => {
|
|
|
11542
11556
|
throw TypeError(".sesame.v1.sources.TransportControlRequest.value: object expected");
|
|
11543
11557
|
message.value = $root.sesame.v1.common.PropValue.fromObject(object.value);
|
|
11544
11558
|
}
|
|
11559
|
+
if (object.sourceId != null)
|
|
11560
|
+
message.sourceId = String(object.sourceId);
|
|
11545
11561
|
return message;
|
|
11546
11562
|
};
|
|
11547
11563
|
TransportControlRequest.toObject = function toObject(message, options) {
|
|
@@ -11551,11 +11567,14 @@ var sesame = $root.sesame = (() => {
|
|
|
11551
11567
|
if (options.defaults) {
|
|
11552
11568
|
object.cmdType = options.enums === String ? "SOURCE_TRANSPORT_CMD_UNSPECIFIED" : 0;
|
|
11553
11569
|
object.value = null;
|
|
11570
|
+
object.sourceId = "";
|
|
11554
11571
|
}
|
|
11555
11572
|
if (message.cmdType != null && message.hasOwnProperty("cmdType"))
|
|
11556
11573
|
object.cmdType = options.enums === String ? $root.sesame.v1.sources.SourceTransportCommandType[message.cmdType] === void 0 ? message.cmdType : $root.sesame.v1.sources.SourceTransportCommandType[message.cmdType] : message.cmdType;
|
|
11557
11574
|
if (message.value != null && message.hasOwnProperty("value"))
|
|
11558
11575
|
object.value = $root.sesame.v1.common.PropValue.toObject(message.value, options);
|
|
11576
|
+
if (message.sourceId != null && message.hasOwnProperty("sourceId"))
|
|
11577
|
+
object.sourceId = message.sourceId;
|
|
11559
11578
|
return object;
|
|
11560
11579
|
};
|
|
11561
11580
|
TransportControlRequest.prototype.toJSON = function toJSON() {
|
|
@@ -29200,6 +29219,36 @@ function parseDataFrame(frame) {
|
|
|
29200
29219
|
trackName,
|
|
29201
29220
|
request: sesame.v1.audio.AudioControlRequest.decode(payload)
|
|
29202
29221
|
};
|
|
29222
|
+
case sesame.v1.wire.DataType.DATA_TYPE_OUTPUT_CONTROL:
|
|
29223
|
+
return {
|
|
29224
|
+
dataType: "output-control",
|
|
29225
|
+
trackName,
|
|
29226
|
+
request: sesame.v1.outputs.OutputControlRequest.decode(payload)
|
|
29227
|
+
};
|
|
29228
|
+
case sesame.v1.wire.DataType.DATA_TYPE_SOURCE_CONTROL:
|
|
29229
|
+
return {
|
|
29230
|
+
dataType: "source-control",
|
|
29231
|
+
trackName,
|
|
29232
|
+
request: sesame.v1.sources.SourceControlRequest.decode(payload)
|
|
29233
|
+
};
|
|
29234
|
+
case sesame.v1.wire.DataType.DATA_TYPE_OUTPUT_STATUS:
|
|
29235
|
+
return {
|
|
29236
|
+
dataType: "output-status",
|
|
29237
|
+
trackName,
|
|
29238
|
+
status: sesame.v1.outputs.OutputStatus.decode(payload)
|
|
29239
|
+
};
|
|
29240
|
+
case sesame.v1.wire.DataType.DATA_TYPE_SOURCE_STATUS:
|
|
29241
|
+
return {
|
|
29242
|
+
dataType: "source-status",
|
|
29243
|
+
trackName,
|
|
29244
|
+
status: sesame.v1.sources.SourceStatus.decode(payload)
|
|
29245
|
+
};
|
|
29246
|
+
case sesame.v1.wire.DataType.DATA_TYPE_ENGINE_STATUS:
|
|
29247
|
+
return {
|
|
29248
|
+
dataType: "engine-status",
|
|
29249
|
+
trackName,
|
|
29250
|
+
status: sesame.v1.status.Status.decode(payload)
|
|
29251
|
+
};
|
|
29203
29252
|
case sesame.v1.wire.DataType.DATA_TYPE_BINARY:
|
|
29204
29253
|
return { dataType: "binary", trackName, data: payload };
|
|
29205
29254
|
default:
|
|
@@ -29262,6 +29311,16 @@ function buildSourceControlFrame(trackName, request) {
|
|
|
29262
29311
|
payload
|
|
29263
29312
|
);
|
|
29264
29313
|
}
|
|
29314
|
+
function buildOutputControlFrame(trackName, request) {
|
|
29315
|
+
const payload = sesame.v1.outputs.OutputControlRequest.encode(request).finish();
|
|
29316
|
+
return WireProtocol.serialize(
|
|
29317
|
+
{
|
|
29318
|
+
type: sesame.v1.wire.FrameType.FRAME_TYPE_DATA,
|
|
29319
|
+
data: { dataType: sesame.v1.wire.DataType.DATA_TYPE_OUTPUT_CONTROL, trackName }
|
|
29320
|
+
},
|
|
29321
|
+
payload
|
|
29322
|
+
);
|
|
29323
|
+
}
|
|
29265
29324
|
function buildBinaryDataFrame(trackName, payload) {
|
|
29266
29325
|
return WireProtocol.serialize(
|
|
29267
29326
|
{
|
|
@@ -29970,6 +30029,7 @@ export {
|
|
|
29970
30029
|
WireProtocol,
|
|
29971
30030
|
buildAudioControlFrame,
|
|
29972
30031
|
buildBinaryDataFrame,
|
|
30032
|
+
buildOutputControlFrame,
|
|
29973
30033
|
buildSourceControlFrame,
|
|
29974
30034
|
buildTransportControlFrame,
|
|
29975
30035
|
getLogger,
|