@stinkycomputing/sesame-api-client 1.5.0-alpha.7 → 1.5.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.
- package/README.md +433 -433
- package/dist/command-list.d.ts +30 -1
- package/dist/command-list.d.ts.map +1 -1
- package/dist/index.browser.mjs +110 -157
- package/dist/index.browser.mjs.map +2 -2
- package/dist/index.cjs +110 -157
- 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 +110 -157
- package/dist/index.mjs.map +2 -2
- package/dist/proto/api.d.ts +24 -115
- package/dist/proto/api.js +94 -287
- package/dist/sesame-api-client.d.ts +15 -0
- package/dist/sesame-api-client.d.ts.map +1 -1
- package/dist/sesame-wire-protocol.d.ts +1 -1
- package/docs/protocol-reference.md +2 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -3460,179 +3460,82 @@ var sesame = $root.sesame = (() => {
|
|
|
3460
3460
|
};
|
|
3461
3461
|
return CommandListItem;
|
|
3462
3462
|
}();
|
|
3463
|
-
commands.
|
|
3464
|
-
function
|
|
3463
|
+
commands.MetadataBinding = function() {
|
|
3464
|
+
function MetadataBinding(properties) {
|
|
3465
3465
|
if (properties) {
|
|
3466
3466
|
for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
3467
3467
|
if (properties[keys[i]] != null)
|
|
3468
3468
|
this[keys[i]] = properties[keys[i]];
|
|
3469
3469
|
}
|
|
3470
3470
|
}
|
|
3471
|
-
|
|
3472
|
-
|
|
3473
|
-
|
|
3474
|
-
|
|
3475
|
-
|
|
3471
|
+
MetadataBinding.prototype.sourceId = "";
|
|
3472
|
+
MetadataBinding.prototype.metadataId = "";
|
|
3473
|
+
MetadataBinding.prototype.outputId = "";
|
|
3474
|
+
MetadataBinding.prototype.trackName = "";
|
|
3475
|
+
MetadataBinding.prototype.targetId = "";
|
|
3476
|
+
MetadataBinding.create = function create(properties) {
|
|
3477
|
+
return new MetadataBinding(properties);
|
|
3476
3478
|
};
|
|
3477
|
-
|
|
3479
|
+
MetadataBinding.encode = function encode(message, writer) {
|
|
3478
3480
|
if (!writer)
|
|
3479
3481
|
writer = $Writer.create();
|
|
3480
|
-
if (message.
|
|
3482
|
+
if (message.sourceId != null && Object.hasOwnProperty.call(message, "sourceId"))
|
|
3481
3483
|
writer.uint32(
|
|
3482
3484
|
/* id 1, wireType 2 =*/
|
|
3483
3485
|
10
|
|
3484
|
-
).string(message.
|
|
3485
|
-
if (message.
|
|
3486
|
+
).string(message.sourceId);
|
|
3487
|
+
if (message.metadataId != null && Object.hasOwnProperty.call(message, "metadataId"))
|
|
3486
3488
|
writer.uint32(
|
|
3487
3489
|
/* id 2, wireType 2 =*/
|
|
3488
3490
|
18
|
|
3489
|
-
).string(message.
|
|
3490
|
-
if (message.
|
|
3491
|
+
).string(message.metadataId);
|
|
3492
|
+
if (message.outputId != null && Object.hasOwnProperty.call(message, "outputId"))
|
|
3491
3493
|
writer.uint32(
|
|
3492
3494
|
/* id 3, wireType 2 =*/
|
|
3493
3495
|
26
|
|
3494
|
-
).string(message.
|
|
3496
|
+
).string(message.outputId);
|
|
3497
|
+
if (message.trackName != null && Object.hasOwnProperty.call(message, "trackName"))
|
|
3498
|
+
writer.uint32(
|
|
3499
|
+
/* id 4, wireType 2 =*/
|
|
3500
|
+
34
|
|
3501
|
+
).string(message.trackName);
|
|
3502
|
+
if (message.targetId != null && Object.hasOwnProperty.call(message, "targetId"))
|
|
3503
|
+
writer.uint32(
|
|
3504
|
+
/* id 5, wireType 2 =*/
|
|
3505
|
+
42
|
|
3506
|
+
).string(message.targetId);
|
|
3495
3507
|
return writer;
|
|
3496
3508
|
};
|
|
3497
|
-
|
|
3509
|
+
MetadataBinding.encodeDelimited = function encodeDelimited(message, writer) {
|
|
3498
3510
|
return this.encode(message, writer).ldelim();
|
|
3499
3511
|
};
|
|
3500
|
-
|
|
3512
|
+
MetadataBinding.decode = function decode(reader, length, error) {
|
|
3501
3513
|
if (!(reader instanceof $Reader))
|
|
3502
3514
|
reader = $Reader.create(reader);
|
|
3503
|
-
let end = length === void 0 ? reader.len : reader.pos + length, message = new $root.sesame.v1.commands.
|
|
3515
|
+
let end = length === void 0 ? reader.len : reader.pos + length, message = new $root.sesame.v1.commands.MetadataBinding();
|
|
3504
3516
|
while (reader.pos < end) {
|
|
3505
3517
|
let tag = reader.uint32();
|
|
3506
3518
|
if (tag === error)
|
|
3507
3519
|
break;
|
|
3508
3520
|
switch (tag >>> 3) {
|
|
3509
3521
|
case 1: {
|
|
3510
|
-
message.
|
|
3522
|
+
message.sourceId = reader.string();
|
|
3511
3523
|
break;
|
|
3512
3524
|
}
|
|
3513
3525
|
case 2: {
|
|
3514
|
-
message.
|
|
3526
|
+
message.metadataId = reader.string();
|
|
3515
3527
|
break;
|
|
3516
3528
|
}
|
|
3517
3529
|
case 3: {
|
|
3518
|
-
message.
|
|
3530
|
+
message.outputId = reader.string();
|
|
3519
3531
|
break;
|
|
3520
3532
|
}
|
|
3521
|
-
|
|
3522
|
-
reader.
|
|
3523
|
-
break;
|
|
3524
|
-
}
|
|
3525
|
-
}
|
|
3526
|
-
return message;
|
|
3527
|
-
};
|
|
3528
|
-
MetadataEndpoint.decodeDelimited = function decodeDelimited(reader) {
|
|
3529
|
-
if (!(reader instanceof $Reader))
|
|
3530
|
-
reader = new $Reader(reader);
|
|
3531
|
-
return this.decode(reader, reader.uint32());
|
|
3532
|
-
};
|
|
3533
|
-
MetadataEndpoint.verify = function verify(message) {
|
|
3534
|
-
if (typeof message !== "object" || message === null)
|
|
3535
|
-
return "object expected";
|
|
3536
|
-
if (message.node != null && message.hasOwnProperty("node")) {
|
|
3537
|
-
if (!$util.isString(message.node))
|
|
3538
|
-
return "node: string expected";
|
|
3539
|
-
}
|
|
3540
|
-
if (message.track != null && message.hasOwnProperty("track")) {
|
|
3541
|
-
if (!$util.isString(message.track))
|
|
3542
|
-
return "track: string expected";
|
|
3543
|
-
}
|
|
3544
|
-
if (message.metadataId != null && message.hasOwnProperty("metadataId")) {
|
|
3545
|
-
if (!$util.isString(message.metadataId))
|
|
3546
|
-
return "metadataId: string expected";
|
|
3547
|
-
}
|
|
3548
|
-
return null;
|
|
3549
|
-
};
|
|
3550
|
-
MetadataEndpoint.fromObject = function fromObject(object) {
|
|
3551
|
-
if (object instanceof $root.sesame.v1.commands.MetadataEndpoint)
|
|
3552
|
-
return object;
|
|
3553
|
-
let message = new $root.sesame.v1.commands.MetadataEndpoint();
|
|
3554
|
-
if (object.node != null)
|
|
3555
|
-
message.node = String(object.node);
|
|
3556
|
-
if (object.track != null)
|
|
3557
|
-
message.track = String(object.track);
|
|
3558
|
-
if (object.metadataId != null)
|
|
3559
|
-
message.metadataId = String(object.metadataId);
|
|
3560
|
-
return message;
|
|
3561
|
-
};
|
|
3562
|
-
MetadataEndpoint.toObject = function toObject(message, options) {
|
|
3563
|
-
if (!options)
|
|
3564
|
-
options = {};
|
|
3565
|
-
let object = {};
|
|
3566
|
-
if (options.defaults) {
|
|
3567
|
-
object.node = "";
|
|
3568
|
-
object.track = "";
|
|
3569
|
-
object.metadataId = "";
|
|
3570
|
-
}
|
|
3571
|
-
if (message.node != null && message.hasOwnProperty("node"))
|
|
3572
|
-
object.node = message.node;
|
|
3573
|
-
if (message.track != null && message.hasOwnProperty("track"))
|
|
3574
|
-
object.track = message.track;
|
|
3575
|
-
if (message.metadataId != null && message.hasOwnProperty("metadataId"))
|
|
3576
|
-
object.metadataId = message.metadataId;
|
|
3577
|
-
return object;
|
|
3578
|
-
};
|
|
3579
|
-
MetadataEndpoint.prototype.toJSON = function toJSON() {
|
|
3580
|
-
return this.constructor.toObject(this, import_minimal.default.util.toJSONOptions);
|
|
3581
|
-
};
|
|
3582
|
-
MetadataEndpoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
3583
|
-
if (typeUrlPrefix === void 0) {
|
|
3584
|
-
typeUrlPrefix = "type.googleapis.com";
|
|
3585
|
-
}
|
|
3586
|
-
return typeUrlPrefix + "/sesame.v1.commands.MetadataEndpoint";
|
|
3587
|
-
};
|
|
3588
|
-
return MetadataEndpoint;
|
|
3589
|
-
}();
|
|
3590
|
-
commands.MetadataBinding = function() {
|
|
3591
|
-
function MetadataBinding(properties) {
|
|
3592
|
-
if (properties) {
|
|
3593
|
-
for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
3594
|
-
if (properties[keys[i]] != null)
|
|
3595
|
-
this[keys[i]] = properties[keys[i]];
|
|
3596
|
-
}
|
|
3597
|
-
}
|
|
3598
|
-
MetadataBinding.prototype.from = null;
|
|
3599
|
-
MetadataBinding.prototype.to = null;
|
|
3600
|
-
MetadataBinding.create = function create(properties) {
|
|
3601
|
-
return new MetadataBinding(properties);
|
|
3602
|
-
};
|
|
3603
|
-
MetadataBinding.encode = function encode(message, writer) {
|
|
3604
|
-
if (!writer)
|
|
3605
|
-
writer = $Writer.create();
|
|
3606
|
-
if (message.from != null && Object.hasOwnProperty.call(message, "from"))
|
|
3607
|
-
$root.sesame.v1.commands.MetadataEndpoint.encode(message.from, writer.uint32(
|
|
3608
|
-
/* id 1, wireType 2 =*/
|
|
3609
|
-
10
|
|
3610
|
-
).fork()).ldelim();
|
|
3611
|
-
if (message.to != null && Object.hasOwnProperty.call(message, "to"))
|
|
3612
|
-
$root.sesame.v1.commands.MetadataEndpoint.encode(message.to, writer.uint32(
|
|
3613
|
-
/* id 2, wireType 2 =*/
|
|
3614
|
-
18
|
|
3615
|
-
).fork()).ldelim();
|
|
3616
|
-
return writer;
|
|
3617
|
-
};
|
|
3618
|
-
MetadataBinding.encodeDelimited = function encodeDelimited(message, writer) {
|
|
3619
|
-
return this.encode(message, writer).ldelim();
|
|
3620
|
-
};
|
|
3621
|
-
MetadataBinding.decode = function decode(reader, length, error) {
|
|
3622
|
-
if (!(reader instanceof $Reader))
|
|
3623
|
-
reader = $Reader.create(reader);
|
|
3624
|
-
let end = length === void 0 ? reader.len : reader.pos + length, message = new $root.sesame.v1.commands.MetadataBinding();
|
|
3625
|
-
while (reader.pos < end) {
|
|
3626
|
-
let tag = reader.uint32();
|
|
3627
|
-
if (tag === error)
|
|
3628
|
-
break;
|
|
3629
|
-
switch (tag >>> 3) {
|
|
3630
|
-
case 1: {
|
|
3631
|
-
message.from = $root.sesame.v1.commands.MetadataEndpoint.decode(reader, reader.uint32());
|
|
3533
|
+
case 4: {
|
|
3534
|
+
message.trackName = reader.string();
|
|
3632
3535
|
break;
|
|
3633
3536
|
}
|
|
3634
|
-
case
|
|
3635
|
-
message.
|
|
3537
|
+
case 5: {
|
|
3538
|
+
message.targetId = reader.string();
|
|
3636
3539
|
break;
|
|
3637
3540
|
}
|
|
3638
3541
|
default:
|
|
@@ -3650,15 +3553,25 @@ var sesame = $root.sesame = (() => {
|
|
|
3650
3553
|
MetadataBinding.verify = function verify(message) {
|
|
3651
3554
|
if (typeof message !== "object" || message === null)
|
|
3652
3555
|
return "object expected";
|
|
3653
|
-
if (message.
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
return "from." + error;
|
|
3556
|
+
if (message.sourceId != null && message.hasOwnProperty("sourceId")) {
|
|
3557
|
+
if (!$util.isString(message.sourceId))
|
|
3558
|
+
return "sourceId: string expected";
|
|
3657
3559
|
}
|
|
3658
|
-
if (message.
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
|
|
3560
|
+
if (message.metadataId != null && message.hasOwnProperty("metadataId")) {
|
|
3561
|
+
if (!$util.isString(message.metadataId))
|
|
3562
|
+
return "metadataId: string expected";
|
|
3563
|
+
}
|
|
3564
|
+
if (message.outputId != null && message.hasOwnProperty("outputId")) {
|
|
3565
|
+
if (!$util.isString(message.outputId))
|
|
3566
|
+
return "outputId: string expected";
|
|
3567
|
+
}
|
|
3568
|
+
if (message.trackName != null && message.hasOwnProperty("trackName")) {
|
|
3569
|
+
if (!$util.isString(message.trackName))
|
|
3570
|
+
return "trackName: string expected";
|
|
3571
|
+
}
|
|
3572
|
+
if (message.targetId != null && message.hasOwnProperty("targetId")) {
|
|
3573
|
+
if (!$util.isString(message.targetId))
|
|
3574
|
+
return "targetId: string expected";
|
|
3662
3575
|
}
|
|
3663
3576
|
return null;
|
|
3664
3577
|
};
|
|
@@ -3666,16 +3579,16 @@ var sesame = $root.sesame = (() => {
|
|
|
3666
3579
|
if (object instanceof $root.sesame.v1.commands.MetadataBinding)
|
|
3667
3580
|
return object;
|
|
3668
3581
|
let message = new $root.sesame.v1.commands.MetadataBinding();
|
|
3669
|
-
if (object.
|
|
3670
|
-
|
|
3671
|
-
|
|
3672
|
-
message.
|
|
3673
|
-
|
|
3674
|
-
|
|
3675
|
-
|
|
3676
|
-
|
|
3677
|
-
|
|
3678
|
-
|
|
3582
|
+
if (object.sourceId != null)
|
|
3583
|
+
message.sourceId = String(object.sourceId);
|
|
3584
|
+
if (object.metadataId != null)
|
|
3585
|
+
message.metadataId = String(object.metadataId);
|
|
3586
|
+
if (object.outputId != null)
|
|
3587
|
+
message.outputId = String(object.outputId);
|
|
3588
|
+
if (object.trackName != null)
|
|
3589
|
+
message.trackName = String(object.trackName);
|
|
3590
|
+
if (object.targetId != null)
|
|
3591
|
+
message.targetId = String(object.targetId);
|
|
3679
3592
|
return message;
|
|
3680
3593
|
};
|
|
3681
3594
|
MetadataBinding.toObject = function toObject(message, options) {
|
|
@@ -3683,13 +3596,22 @@ var sesame = $root.sesame = (() => {
|
|
|
3683
3596
|
options = {};
|
|
3684
3597
|
let object = {};
|
|
3685
3598
|
if (options.defaults) {
|
|
3686
|
-
object.
|
|
3687
|
-
object.
|
|
3599
|
+
object.sourceId = "";
|
|
3600
|
+
object.metadataId = "";
|
|
3601
|
+
object.outputId = "";
|
|
3602
|
+
object.trackName = "";
|
|
3603
|
+
object.targetId = "";
|
|
3688
3604
|
}
|
|
3689
|
-
if (message.
|
|
3690
|
-
object.
|
|
3691
|
-
if (message.
|
|
3692
|
-
object.
|
|
3605
|
+
if (message.sourceId != null && message.hasOwnProperty("sourceId"))
|
|
3606
|
+
object.sourceId = message.sourceId;
|
|
3607
|
+
if (message.metadataId != null && message.hasOwnProperty("metadataId"))
|
|
3608
|
+
object.metadataId = message.metadataId;
|
|
3609
|
+
if (message.outputId != null && message.hasOwnProperty("outputId"))
|
|
3610
|
+
object.outputId = message.outputId;
|
|
3611
|
+
if (message.trackName != null && message.hasOwnProperty("trackName"))
|
|
3612
|
+
object.trackName = message.trackName;
|
|
3613
|
+
if (message.targetId != null && message.hasOwnProperty("targetId"))
|
|
3614
|
+
object.targetId = message.targetId;
|
|
3693
3615
|
return object;
|
|
3694
3616
|
};
|
|
3695
3617
|
MetadataBinding.prototype.toJSON = function toJSON() {
|
|
@@ -23822,6 +23744,22 @@ var CommandList = class {
|
|
|
23822
23744
|
};
|
|
23823
23745
|
return this.add(item, timeOffsetMs);
|
|
23824
23746
|
}
|
|
23747
|
+
/**
|
|
23748
|
+
* Replace the server's entire metadata routing table with the supplied bindings.
|
|
23749
|
+
*
|
|
23750
|
+
* Each binding is either **outbound** or **inbound** - not both:
|
|
23751
|
+
*
|
|
23752
|
+
* - **Outbound** (`IMetadataOutboundBinding`): when `publishMetadata(nodeId, metadataId)`
|
|
23753
|
+
* is called (or the server pushes periodic state), the payload is forwarded to every
|
|
23754
|
+
* `(outputId, trackName)` pair that matches `(sourceId, metadataId)`.
|
|
23755
|
+
*
|
|
23756
|
+
* - **Inbound** (`IMetadataInboundBinding`): when a streaming source receives a
|
|
23757
|
+
* `FRAME_TYPE_DATA` frame on `trackName`, it is routed to `targetId` and emitted
|
|
23758
|
+
* as a `MetadataEvent` on `EVENT_TOPIC_METADATA`.
|
|
23759
|
+
*
|
|
23760
|
+
* This command replaces the **entire** table - pass all desired bindings at once.
|
|
23761
|
+
* An empty array clears all routing.
|
|
23762
|
+
*/
|
|
23825
23763
|
setMetadataBindings(bindings, timeOffsetMs) {
|
|
23826
23764
|
const item = new sesame.v1.commands.CommandListItem();
|
|
23827
23765
|
item.setMetadataBindings = { bindings };
|
|
@@ -24580,6 +24518,21 @@ var SesameClient = class extends import_events3.EventEmitter {
|
|
|
24580
24518
|
await this.rpc.service.executeCommandList(cl.getCommandListMsg());
|
|
24581
24519
|
}
|
|
24582
24520
|
}
|
|
24521
|
+
/**
|
|
24522
|
+
* Publish a data-frame payload to all outbound targets registered for
|
|
24523
|
+
* `(nodeId, metadataId)` in the current MetadataRouter binding table.
|
|
24524
|
+
*
|
|
24525
|
+
* The server resolves the binding table entry for the given `(nodeId, metadataId)`
|
|
24526
|
+
* pair and sends a `FRAME_TYPE_DATA` frame to each configured `(outputId, trackName)`
|
|
24527
|
+
* target. If no outbound binding exists a warning is logged server-side and the call
|
|
24528
|
+
* is a no-op.
|
|
24529
|
+
*
|
|
24530
|
+
* @param nodeId ID of the publishing node (source, mixer, or other engine node).
|
|
24531
|
+
* @param metadataId Routing key - must match the `metadata_id` field in the binding.
|
|
24532
|
+
* @param payload Raw frame payload bytes. For `DATA_TYPE_JSON` this must be valid
|
|
24533
|
+
* UTF-8 encoded JSON; for `DATA_TYPE_BINARY` it is opaque bytes.
|
|
24534
|
+
* @param dataType Wire encoding of the payload (defaults to `DATA_TYPE_JSON`).
|
|
24535
|
+
*/
|
|
24583
24536
|
async publishMetadata(nodeId, metadataId, payload, dataType = DataType.DATA_TYPE_JSON) {
|
|
24584
24537
|
await this.rpc.service.publishMetadata({ nodeId, metadataId, payload, dataType });
|
|
24585
24538
|
}
|