@stinkycomputing/sesame-api-client 1.4.1-beta.5 → 1.4.1-beta.7
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 +2 -0
- package/dist/index.browser.mjs +75 -61
- package/dist/index.browser.mjs.map +2 -2
- package/dist/index.cjs +75 -61
- package/dist/index.cjs.map +2 -2
- package/dist/index.mjs +75 -61
- package/dist/index.mjs.map +2 -2
- package/dist/jobs-api.d.ts +1 -1
- package/dist/proto/api.d.ts +8 -8
- package/dist/proto/api.js +48 -48
- package/dist/sesame-connection.d.ts.map +1 -1
- package/docs/protocol-reference.md +1218 -0
- package/package.json +2 -1
package/dist/index.cjs
CHANGED
|
@@ -8236,7 +8236,7 @@ var sesame = $root.sesame = (() => {
|
|
|
8236
8236
|
RecorderClip.prototype.endTimeUs = $util.Long ? $util.Long.fromBits(0, 0, false) : 0;
|
|
8237
8237
|
RecorderClip.prototype.lockedStartUs = $util.Long ? $util.Long.fromBits(0, 0, false) : 0;
|
|
8238
8238
|
RecorderClip.prototype.lockedEndUs = $util.Long ? $util.Long.fromBits(0, 0, false) : 0;
|
|
8239
|
-
RecorderClip.prototype.
|
|
8239
|
+
RecorderClip.prototype.userTimeUs = $util.Long ? $util.Long.fromBits(0, 0, false) : 0;
|
|
8240
8240
|
RecorderClip.create = function create(properties) {
|
|
8241
8241
|
return new RecorderClip(properties);
|
|
8242
8242
|
};
|
|
@@ -8283,11 +8283,11 @@ var sesame = $root.sesame = (() => {
|
|
|
8283
8283
|
/* id 8, wireType 0 =*/
|
|
8284
8284
|
64
|
|
8285
8285
|
).int64(message.lockedEndUs);
|
|
8286
|
-
if (message.
|
|
8286
|
+
if (message.userTimeUs != null && Object.hasOwnProperty.call(message, "userTimeUs"))
|
|
8287
8287
|
writer.uint32(
|
|
8288
8288
|
/* id 9, wireType 0 =*/
|
|
8289
8289
|
72
|
|
8290
|
-
).int64(message.
|
|
8290
|
+
).int64(message.userTimeUs);
|
|
8291
8291
|
return writer;
|
|
8292
8292
|
};
|
|
8293
8293
|
RecorderClip.encodeDelimited = function encodeDelimited(message, writer) {
|
|
@@ -8335,7 +8335,7 @@ var sesame = $root.sesame = (() => {
|
|
|
8335
8335
|
break;
|
|
8336
8336
|
}
|
|
8337
8337
|
case 9: {
|
|
8338
|
-
message.
|
|
8338
|
+
message.userTimeUs = reader.int64();
|
|
8339
8339
|
break;
|
|
8340
8340
|
}
|
|
8341
8341
|
default:
|
|
@@ -8385,9 +8385,9 @@ var sesame = $root.sesame = (() => {
|
|
|
8385
8385
|
if (!$util.isInteger(message.lockedEndUs) && !(message.lockedEndUs && $util.isInteger(message.lockedEndUs.low) && $util.isInteger(message.lockedEndUs.high)))
|
|
8386
8386
|
return "lockedEndUs: integer|Long expected";
|
|
8387
8387
|
}
|
|
8388
|
-
if (message.
|
|
8389
|
-
if (!$util.isInteger(message.
|
|
8390
|
-
return "
|
|
8388
|
+
if (message.userTimeUs != null && message.hasOwnProperty("userTimeUs")) {
|
|
8389
|
+
if (!$util.isInteger(message.userTimeUs) && !(message.userTimeUs && $util.isInteger(message.userTimeUs.low) && $util.isInteger(message.userTimeUs.high)))
|
|
8390
|
+
return "userTimeUs: integer|Long expected";
|
|
8391
8391
|
}
|
|
8392
8392
|
return null;
|
|
8393
8393
|
};
|
|
@@ -8459,15 +8459,15 @@ var sesame = $root.sesame = (() => {
|
|
|
8459
8459
|
else if (typeof object.lockedEndUs === "object")
|
|
8460
8460
|
message.lockedEndUs = new $util.LongBits(object.lockedEndUs.low >>> 0, object.lockedEndUs.high >>> 0).toNumber();
|
|
8461
8461
|
}
|
|
8462
|
-
if (object.
|
|
8462
|
+
if (object.userTimeUs != null) {
|
|
8463
8463
|
if ($util.Long)
|
|
8464
|
-
(message.
|
|
8465
|
-
else if (typeof object.
|
|
8466
|
-
message.
|
|
8467
|
-
else if (typeof object.
|
|
8468
|
-
message.
|
|
8469
|
-
else if (typeof object.
|
|
8470
|
-
message.
|
|
8464
|
+
(message.userTimeUs = $util.Long.fromValue(object.userTimeUs)).unsigned = false;
|
|
8465
|
+
else if (typeof object.userTimeUs === "string")
|
|
8466
|
+
message.userTimeUs = parseInt(object.userTimeUs, 10);
|
|
8467
|
+
else if (typeof object.userTimeUs === "number")
|
|
8468
|
+
message.userTimeUs = object.userTimeUs;
|
|
8469
|
+
else if (typeof object.userTimeUs === "object")
|
|
8470
|
+
message.userTimeUs = new $util.LongBits(object.userTimeUs.low >>> 0, object.userTimeUs.high >>> 0).toNumber();
|
|
8471
8471
|
}
|
|
8472
8472
|
return message;
|
|
8473
8473
|
};
|
|
@@ -8510,9 +8510,9 @@ var sesame = $root.sesame = (() => {
|
|
|
8510
8510
|
object.lockedEndUs = options.longs === String ? "0" : 0;
|
|
8511
8511
|
if ($util.Long) {
|
|
8512
8512
|
let long = new $util.Long(0, 0, false);
|
|
8513
|
-
object.
|
|
8513
|
+
object.userTimeUs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
8514
8514
|
} else
|
|
8515
|
-
object.
|
|
8515
|
+
object.userTimeUs = options.longs === String ? "0" : 0;
|
|
8516
8516
|
}
|
|
8517
8517
|
if (message.id != null && message.hasOwnProperty("id"))
|
|
8518
8518
|
if (typeof message.id === "number")
|
|
@@ -8548,11 +8548,11 @@ var sesame = $root.sesame = (() => {
|
|
|
8548
8548
|
object.lockedEndUs = options.longs === String ? String(message.lockedEndUs) : message.lockedEndUs;
|
|
8549
8549
|
else
|
|
8550
8550
|
object.lockedEndUs = options.longs === String ? $util.Long.prototype.toString.call(message.lockedEndUs) : options.longs === Number ? new $util.LongBits(message.lockedEndUs.low >>> 0, message.lockedEndUs.high >>> 0).toNumber() : message.lockedEndUs;
|
|
8551
|
-
if (message.
|
|
8552
|
-
if (typeof message.
|
|
8553
|
-
object.
|
|
8551
|
+
if (message.userTimeUs != null && message.hasOwnProperty("userTimeUs"))
|
|
8552
|
+
if (typeof message.userTimeUs === "number")
|
|
8553
|
+
object.userTimeUs = options.longs === String ? String(message.userTimeUs) : message.userTimeUs;
|
|
8554
8554
|
else
|
|
8555
|
-
object.
|
|
8555
|
+
object.userTimeUs = options.longs === String ? $util.Long.prototype.toString.call(message.userTimeUs) : options.longs === Number ? new $util.LongBits(message.userTimeUs.low >>> 0, message.userTimeUs.high >>> 0).toNumber() : message.userTimeUs;
|
|
8556
8556
|
return object;
|
|
8557
8557
|
};
|
|
8558
8558
|
RecorderClip.prototype.toJSON = function toJSON() {
|
|
@@ -13365,7 +13365,7 @@ var sesame = $root.sesame = (() => {
|
|
|
13365
13365
|
TransportEvent.prototype.durationUs = $util.Long ? $util.Long.fromBits(0, 0, false) : 0;
|
|
13366
13366
|
TransportEvent.prototype.positionUs = $util.Long ? $util.Long.fromBits(0, 0, false) : 0;
|
|
13367
13367
|
TransportEvent.prototype.materialPositionUs = $util.Long ? $util.Long.fromBits(0, 0, false) : 0;
|
|
13368
|
-
TransportEvent.prototype.
|
|
13368
|
+
TransportEvent.prototype.userTimeUs = $util.Long ? $util.Long.fromBits(0, 0, false) : 0;
|
|
13369
13369
|
TransportEvent.prototype.speed = 0;
|
|
13370
13370
|
TransportEvent.prototype.userPlaylistId = "";
|
|
13371
13371
|
TransportEvent.prototype.playlistIndex = 0;
|
|
@@ -13417,11 +13417,11 @@ var sesame = $root.sesame = (() => {
|
|
|
13417
13417
|
/* id 7, wireType 0 =*/
|
|
13418
13418
|
56
|
|
13419
13419
|
).int64(message.materialPositionUs);
|
|
13420
|
-
if (message.
|
|
13420
|
+
if (message.userTimeUs != null && Object.hasOwnProperty.call(message, "userTimeUs"))
|
|
13421
13421
|
writer.uint32(
|
|
13422
13422
|
/* id 8, wireType 0 =*/
|
|
13423
13423
|
64
|
|
13424
|
-
).int64(message.
|
|
13424
|
+
).int64(message.userTimeUs);
|
|
13425
13425
|
if (message.speed != null && Object.hasOwnProperty.call(message, "speed"))
|
|
13426
13426
|
writer.uint32(
|
|
13427
13427
|
/* id 9, wireType 5 =*/
|
|
@@ -13515,7 +13515,7 @@ var sesame = $root.sesame = (() => {
|
|
|
13515
13515
|
break;
|
|
13516
13516
|
}
|
|
13517
13517
|
case 8: {
|
|
13518
|
-
message.
|
|
13518
|
+
message.userTimeUs = reader.int64();
|
|
13519
13519
|
break;
|
|
13520
13520
|
}
|
|
13521
13521
|
case 9: {
|
|
@@ -13608,9 +13608,9 @@ var sesame = $root.sesame = (() => {
|
|
|
13608
13608
|
if (!$util.isInteger(message.materialPositionUs) && !(message.materialPositionUs && $util.isInteger(message.materialPositionUs.low) && $util.isInteger(message.materialPositionUs.high)))
|
|
13609
13609
|
return "materialPositionUs: integer|Long expected";
|
|
13610
13610
|
}
|
|
13611
|
-
if (message.
|
|
13612
|
-
if (!$util.isInteger(message.
|
|
13613
|
-
return "
|
|
13611
|
+
if (message.userTimeUs != null && message.hasOwnProperty("userTimeUs")) {
|
|
13612
|
+
if (!$util.isInteger(message.userTimeUs) && !(message.userTimeUs && $util.isInteger(message.userTimeUs.low) && $util.isInteger(message.userTimeUs.high)))
|
|
13613
|
+
return "userTimeUs: integer|Long expected";
|
|
13614
13614
|
}
|
|
13615
13615
|
if (message.speed != null && message.hasOwnProperty("speed")) {
|
|
13616
13616
|
if (typeof message.speed !== "number")
|
|
@@ -13722,15 +13722,15 @@ var sesame = $root.sesame = (() => {
|
|
|
13722
13722
|
else if (typeof object.materialPositionUs === "object")
|
|
13723
13723
|
message.materialPositionUs = new $util.LongBits(object.materialPositionUs.low >>> 0, object.materialPositionUs.high >>> 0).toNumber();
|
|
13724
13724
|
}
|
|
13725
|
-
if (object.
|
|
13725
|
+
if (object.userTimeUs != null) {
|
|
13726
13726
|
if ($util.Long)
|
|
13727
|
-
(message.
|
|
13728
|
-
else if (typeof object.
|
|
13729
|
-
message.
|
|
13730
|
-
else if (typeof object.
|
|
13731
|
-
message.
|
|
13732
|
-
else if (typeof object.
|
|
13733
|
-
message.
|
|
13727
|
+
(message.userTimeUs = $util.Long.fromValue(object.userTimeUs)).unsigned = false;
|
|
13728
|
+
else if (typeof object.userTimeUs === "string")
|
|
13729
|
+
message.userTimeUs = parseInt(object.userTimeUs, 10);
|
|
13730
|
+
else if (typeof object.userTimeUs === "number")
|
|
13731
|
+
message.userTimeUs = object.userTimeUs;
|
|
13732
|
+
else if (typeof object.userTimeUs === "object")
|
|
13733
|
+
message.userTimeUs = new $util.LongBits(object.userTimeUs.low >>> 0, object.userTimeUs.high >>> 0).toNumber();
|
|
13734
13734
|
}
|
|
13735
13735
|
if (object.speed != null)
|
|
13736
13736
|
message.speed = Number(object.speed);
|
|
@@ -13804,9 +13804,9 @@ var sesame = $root.sesame = (() => {
|
|
|
13804
13804
|
object.materialPositionUs = options.longs === String ? "0" : 0;
|
|
13805
13805
|
if ($util.Long) {
|
|
13806
13806
|
let long = new $util.Long(0, 0, false);
|
|
13807
|
-
object.
|
|
13807
|
+
object.userTimeUs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
13808
13808
|
} else
|
|
13809
|
-
object.
|
|
13809
|
+
object.userTimeUs = options.longs === String ? "0" : 0;
|
|
13810
13810
|
object.speed = 0;
|
|
13811
13811
|
object.userPlaylistId = "";
|
|
13812
13812
|
object.playlistIndex = 0;
|
|
@@ -13853,11 +13853,11 @@ var sesame = $root.sesame = (() => {
|
|
|
13853
13853
|
object.materialPositionUs = options.longs === String ? String(message.materialPositionUs) : message.materialPositionUs;
|
|
13854
13854
|
else
|
|
13855
13855
|
object.materialPositionUs = options.longs === String ? $util.Long.prototype.toString.call(message.materialPositionUs) : options.longs === Number ? new $util.LongBits(message.materialPositionUs.low >>> 0, message.materialPositionUs.high >>> 0).toNumber() : message.materialPositionUs;
|
|
13856
|
-
if (message.
|
|
13857
|
-
if (typeof message.
|
|
13858
|
-
object.
|
|
13856
|
+
if (message.userTimeUs != null && message.hasOwnProperty("userTimeUs"))
|
|
13857
|
+
if (typeof message.userTimeUs === "number")
|
|
13858
|
+
object.userTimeUs = options.longs === String ? String(message.userTimeUs) : message.userTimeUs;
|
|
13859
13859
|
else
|
|
13860
|
-
object.
|
|
13860
|
+
object.userTimeUs = options.longs === String ? $util.Long.prototype.toString.call(message.userTimeUs) : options.longs === Number ? new $util.LongBits(message.userTimeUs.low >>> 0, message.userTimeUs.high >>> 0).toNumber() : message.userTimeUs;
|
|
13861
13861
|
if (message.speed != null && message.hasOwnProperty("speed"))
|
|
13862
13862
|
object.speed = options.json && !isFinite(message.speed) ? String(message.speed) : message.speed;
|
|
13863
13863
|
if (message.userPlaylistId != null && message.hasOwnProperty("userPlaylistId"))
|
|
@@ -21979,8 +21979,8 @@ var RPCClient = class extends import_events.EventEmitter {
|
|
|
21979
21979
|
} else {
|
|
21980
21980
|
throw new Error("Unsupported RPC message payload");
|
|
21981
21981
|
}
|
|
21982
|
-
} catch (
|
|
21983
|
-
const error = new Error(
|
|
21982
|
+
} catch (err) {
|
|
21983
|
+
const error = new Error(`Got invalid message: ${err instanceof Error ? err.message : String(err)}`);
|
|
21984
21984
|
this.errorHandler(error);
|
|
21985
21985
|
}
|
|
21986
21986
|
};
|
|
@@ -22055,8 +22055,8 @@ var RPCClient = class extends import_events.EventEmitter {
|
|
|
22055
22055
|
try {
|
|
22056
22056
|
payload = type.decode(event.payload);
|
|
22057
22057
|
object = type.toObject(payload, { longs: Number });
|
|
22058
|
-
} catch (
|
|
22059
|
-
const error = new Error(
|
|
22058
|
+
} catch (err) {
|
|
22059
|
+
const error = new Error(`Could not decode event payload: ${err instanceof Error ? err.message : String(err)}`);
|
|
22060
22060
|
this.errorHandler(error);
|
|
22061
22061
|
return;
|
|
22062
22062
|
}
|
|
@@ -22211,14 +22211,29 @@ var SesameConnection = class extends import_events2.EventEmitter {
|
|
|
22211
22211
|
this.socket.addEventListener("close", this.boundCloseHandler);
|
|
22212
22212
|
this.socket.addEventListener("error", this.boundErrorHandler);
|
|
22213
22213
|
this.socket.binaryType = "arraybuffer";
|
|
22214
|
-
await new Promise((resolve) => {
|
|
22215
|
-
const
|
|
22216
|
-
this.removeListener("open",
|
|
22217
|
-
this.removeListener("close",
|
|
22218
|
-
|
|
22214
|
+
await new Promise((resolve, reject) => {
|
|
22215
|
+
const cleanup = () => {
|
|
22216
|
+
this.removeListener("open", onOpen);
|
|
22217
|
+
this.removeListener("close", onClose);
|
|
22218
|
+
this.removeListener("error", onError);
|
|
22219
22219
|
};
|
|
22220
|
-
|
|
22221
|
-
|
|
22220
|
+
const onOpen = () => {
|
|
22221
|
+
cleanup();
|
|
22222
|
+
resolve();
|
|
22223
|
+
};
|
|
22224
|
+
const onError = (err) => {
|
|
22225
|
+
cleanup();
|
|
22226
|
+
reject(err instanceof Error ? err : new Error("WebSocket connection error"));
|
|
22227
|
+
};
|
|
22228
|
+
const onClose = () => {
|
|
22229
|
+
if (!this.isConnected()) {
|
|
22230
|
+
cleanup();
|
|
22231
|
+
reject(new Error("WebSocket connection closed before opening"));
|
|
22232
|
+
}
|
|
22233
|
+
};
|
|
22234
|
+
this.on("open", onOpen);
|
|
22235
|
+
this.on("close", onClose);
|
|
22236
|
+
this.on("error", onError);
|
|
22222
22237
|
});
|
|
22223
22238
|
}
|
|
22224
22239
|
/**
|
|
@@ -22362,7 +22377,6 @@ var JobsApi = class {
|
|
|
22362
22377
|
if (!config.filename) throw new Error("Filename is required");
|
|
22363
22378
|
exportReq.config = {
|
|
22364
22379
|
...config,
|
|
22365
|
-
filename: config.filename,
|
|
22366
22380
|
videoCodec: config.videoCodec ?? sesame.v1.common.CodecId.CODEC_ID_H264,
|
|
22367
22381
|
videoBitrateKbps: config.videoBitrateKbps ?? 1024,
|
|
22368
22382
|
audioCodec: config.audioCodec ?? sesame.v1.jobs.AudioCodecId.AUDIO_CODEC_ID_AAC,
|
|
@@ -22371,18 +22385,18 @@ var JobsApi = class {
|
|
|
22371
22385
|
audioRouting: config.audioRouting ?? [0, 1, 2, 3]
|
|
22372
22386
|
};
|
|
22373
22387
|
exportReq.items = playlist.clips.map((clip) => ({
|
|
22374
|
-
|
|
22375
|
-
recorderId: clip.recorderId,
|
|
22388
|
+
...clip,
|
|
22376
22389
|
transitionTimeUs: clip.transitionTimeUs ?? 0,
|
|
22377
22390
|
transitionType: clip.transitionType ?? sesame.v1.recorder.TransitionType.TRANSITION_TYPE_MIX,
|
|
22378
22391
|
transitionFadeColor: clip.transitionFadeColor ?? { x: 0, y: 0, z: 0, w: 0 },
|
|
22379
|
-
speed: clip.speed ?? 1
|
|
22380
|
-
audioRouting: clip.audioRouting,
|
|
22381
|
-
startTimeUs: clip.startTimeUs,
|
|
22382
|
-
endTimeUs: clip.endTimeUs
|
|
22392
|
+
speed: clip.speed ?? 1
|
|
22383
22393
|
}));
|
|
22384
22394
|
const msg = sesame.v1.jobs.JobStartRequest.create({ exportRequest: exportReq });
|
|
22385
|
-
await this.rpc.service.startJob(msg);
|
|
22395
|
+
const job = await this.rpc.service.startJob(msg);
|
|
22396
|
+
if (job.error) {
|
|
22397
|
+
throw new Error(job.error);
|
|
22398
|
+
}
|
|
22399
|
+
return job;
|
|
22386
22400
|
}
|
|
22387
22401
|
async abortJob(jobId) {
|
|
22388
22402
|
const msg = { jobId };
|