@stinkycomputing/sesame-api-client 1.4.1-alpha.7 → 1.4.1-alpha.8
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/dist/browser.cjs +21 -21
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.mjs +21 -21
- package/dist/browser.mjs.map +1 -1
- package/dist/index.cjs +169 -136
- package/dist/index.cjs.map +4 -4
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +166 -136
- package/dist/index.mjs.map +4 -4
- package/dist/jobs-api.d.ts +15 -0
- package/dist/jobs-api.d.ts.map +1 -0
- package/dist/proto/api.d.ts +4 -4
- package/dist/proto/api.js +24 -24
- package/dist/recorder-api.d.ts +16 -0
- package/dist/recorder-api.d.ts.map +1 -0
- package/dist/sesame-api-client.d.ts +16 -25
- package/dist/sesame-api-client.d.ts.map +1 -1
- package/dist/status-api.d.ts +11 -0
- package/dist/status-api.d.ts.map +1 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -34,14 +34,17 @@ __export(index_exports, {
|
|
|
34
34
|
CommandList: () => CommandList,
|
|
35
35
|
EaseKind: () => EaseKind,
|
|
36
36
|
Event: () => Event,
|
|
37
|
+
JobsApi: () => JobsApi,
|
|
37
38
|
Message: () => Message,
|
|
38
39
|
PacketType: () => PacketType,
|
|
39
40
|
RPCClient: () => RPCClient,
|
|
41
|
+
RecorderApi: () => RecorderApi,
|
|
40
42
|
Request: () => Request,
|
|
41
43
|
Response: () => Response,
|
|
42
44
|
SesameBinaryProtocol: () => SesameBinaryProtocol,
|
|
43
45
|
SesameClient: () => SesameClient,
|
|
44
46
|
SesameConnection: () => SesameConnection,
|
|
47
|
+
StatusApi: () => StatusApi,
|
|
45
48
|
getLogger: () => getLogger,
|
|
46
49
|
log: () => log,
|
|
47
50
|
sesame: () => sesame,
|
|
@@ -8232,7 +8235,7 @@ var sesame = $root.sesame = (() => {
|
|
|
8232
8235
|
RecorderClip.prototype.endTimeUs = $util.Long ? $util.Long.fromBits(0, 0, false) : 0;
|
|
8233
8236
|
RecorderClip.prototype.lockedStartUs = $util.Long ? $util.Long.fromBits(0, 0, false) : 0;
|
|
8234
8237
|
RecorderClip.prototype.lockedEndUs = $util.Long ? $util.Long.fromBits(0, 0, false) : 0;
|
|
8235
|
-
RecorderClip.prototype.
|
|
8238
|
+
RecorderClip.prototype.userTimeMs = $util.Long ? $util.Long.fromBits(0, 0, false) : 0;
|
|
8236
8239
|
RecorderClip.create = function create(properties) {
|
|
8237
8240
|
return new RecorderClip(properties);
|
|
8238
8241
|
};
|
|
@@ -8279,11 +8282,11 @@ var sesame = $root.sesame = (() => {
|
|
|
8279
8282
|
/* id 8, wireType 0 =*/
|
|
8280
8283
|
64
|
|
8281
8284
|
).int64(message.lockedEndUs);
|
|
8282
|
-
if (message.
|
|
8285
|
+
if (message.userTimeMs != null && Object.hasOwnProperty.call(message, "userTimeMs"))
|
|
8283
8286
|
writer.uint32(
|
|
8284
8287
|
/* id 9, wireType 0 =*/
|
|
8285
8288
|
72
|
|
8286
|
-
).int64(message.
|
|
8289
|
+
).int64(message.userTimeMs);
|
|
8287
8290
|
return writer;
|
|
8288
8291
|
};
|
|
8289
8292
|
RecorderClip.encodeDelimited = function encodeDelimited(message, writer) {
|
|
@@ -8331,7 +8334,7 @@ var sesame = $root.sesame = (() => {
|
|
|
8331
8334
|
break;
|
|
8332
8335
|
}
|
|
8333
8336
|
case 9: {
|
|
8334
|
-
message.
|
|
8337
|
+
message.userTimeMs = reader.int64();
|
|
8335
8338
|
break;
|
|
8336
8339
|
}
|
|
8337
8340
|
default:
|
|
@@ -8381,9 +8384,9 @@ var sesame = $root.sesame = (() => {
|
|
|
8381
8384
|
if (!$util.isInteger(message.lockedEndUs) && !(message.lockedEndUs && $util.isInteger(message.lockedEndUs.low) && $util.isInteger(message.lockedEndUs.high)))
|
|
8382
8385
|
return "lockedEndUs: integer|Long expected";
|
|
8383
8386
|
}
|
|
8384
|
-
if (message.
|
|
8385
|
-
if (!$util.isInteger(message.
|
|
8386
|
-
return "
|
|
8387
|
+
if (message.userTimeMs != null && message.hasOwnProperty("userTimeMs")) {
|
|
8388
|
+
if (!$util.isInteger(message.userTimeMs) && !(message.userTimeMs && $util.isInteger(message.userTimeMs.low) && $util.isInteger(message.userTimeMs.high)))
|
|
8389
|
+
return "userTimeMs: integer|Long expected";
|
|
8387
8390
|
}
|
|
8388
8391
|
return null;
|
|
8389
8392
|
};
|
|
@@ -8455,15 +8458,15 @@ var sesame = $root.sesame = (() => {
|
|
|
8455
8458
|
else if (typeof object.lockedEndUs === "object")
|
|
8456
8459
|
message.lockedEndUs = new $util.LongBits(object.lockedEndUs.low >>> 0, object.lockedEndUs.high >>> 0).toNumber();
|
|
8457
8460
|
}
|
|
8458
|
-
if (object.
|
|
8461
|
+
if (object.userTimeMs != null) {
|
|
8459
8462
|
if ($util.Long)
|
|
8460
|
-
(message.
|
|
8461
|
-
else if (typeof object.
|
|
8462
|
-
message.
|
|
8463
|
-
else if (typeof object.
|
|
8464
|
-
message.
|
|
8465
|
-
else if (typeof object.
|
|
8466
|
-
message.
|
|
8463
|
+
(message.userTimeMs = $util.Long.fromValue(object.userTimeMs)).unsigned = false;
|
|
8464
|
+
else if (typeof object.userTimeMs === "string")
|
|
8465
|
+
message.userTimeMs = parseInt(object.userTimeMs, 10);
|
|
8466
|
+
else if (typeof object.userTimeMs === "number")
|
|
8467
|
+
message.userTimeMs = object.userTimeMs;
|
|
8468
|
+
else if (typeof object.userTimeMs === "object")
|
|
8469
|
+
message.userTimeMs = new $util.LongBits(object.userTimeMs.low >>> 0, object.userTimeMs.high >>> 0).toNumber();
|
|
8467
8470
|
}
|
|
8468
8471
|
return message;
|
|
8469
8472
|
};
|
|
@@ -8506,9 +8509,9 @@ var sesame = $root.sesame = (() => {
|
|
|
8506
8509
|
object.lockedEndUs = options.longs === String ? "0" : 0;
|
|
8507
8510
|
if ($util.Long) {
|
|
8508
8511
|
let long = new $util.Long(0, 0, false);
|
|
8509
|
-
object.
|
|
8512
|
+
object.userTimeMs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
8510
8513
|
} else
|
|
8511
|
-
object.
|
|
8514
|
+
object.userTimeMs = options.longs === String ? "0" : 0;
|
|
8512
8515
|
}
|
|
8513
8516
|
if (message.id != null && message.hasOwnProperty("id"))
|
|
8514
8517
|
if (typeof message.id === "number")
|
|
@@ -8544,11 +8547,11 @@ var sesame = $root.sesame = (() => {
|
|
|
8544
8547
|
object.lockedEndUs = options.longs === String ? String(message.lockedEndUs) : message.lockedEndUs;
|
|
8545
8548
|
else
|
|
8546
8549
|
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;
|
|
8547
|
-
if (message.
|
|
8548
|
-
if (typeof message.
|
|
8549
|
-
object.
|
|
8550
|
+
if (message.userTimeMs != null && message.hasOwnProperty("userTimeMs"))
|
|
8551
|
+
if (typeof message.userTimeMs === "number")
|
|
8552
|
+
object.userTimeMs = options.longs === String ? String(message.userTimeMs) : message.userTimeMs;
|
|
8550
8553
|
else
|
|
8551
|
-
object.
|
|
8554
|
+
object.userTimeMs = options.longs === String ? $util.Long.prototype.toString.call(message.userTimeMs) : options.longs === Number ? new $util.LongBits(message.userTimeMs.low >>> 0, message.userTimeMs.high >>> 0).toNumber() : message.userTimeMs;
|
|
8552
8555
|
return object;
|
|
8553
8556
|
};
|
|
8554
8557
|
RecorderClip.prototype.toJSON = function toJSON() {
|
|
@@ -21931,6 +21934,133 @@ var defaultBackoff = (tries) => {
|
|
|
21931
21934
|
|
|
21932
21935
|
// src/sesame-api-client.ts
|
|
21933
21936
|
var import_events3 = require("events");
|
|
21937
|
+
|
|
21938
|
+
// src/status-api.ts
|
|
21939
|
+
var StatusApi = class {
|
|
21940
|
+
/** @internal */
|
|
21941
|
+
constructor(rpc2) {
|
|
21942
|
+
this.rpc = rpc2;
|
|
21943
|
+
}
|
|
21944
|
+
async getStatus() {
|
|
21945
|
+
return this.rpc.service.requestStatus(new sesame.v1.common.Empty());
|
|
21946
|
+
}
|
|
21947
|
+
async getIODevices() {
|
|
21948
|
+
return this.rpc.service.requestIODeviceList(new sesame.v1.common.Empty());
|
|
21949
|
+
}
|
|
21950
|
+
async requestKeyframe(outputId) {
|
|
21951
|
+
await this.rpc.service.requestKeyframe({ id: outputId });
|
|
21952
|
+
}
|
|
21953
|
+
};
|
|
21954
|
+
|
|
21955
|
+
// src/recorder-api.ts
|
|
21956
|
+
var RecorderApi = class {
|
|
21957
|
+
/** @internal */
|
|
21958
|
+
constructor(rpc2) {
|
|
21959
|
+
this.rpc = rpc2;
|
|
21960
|
+
}
|
|
21961
|
+
async addClip(recorderId, clip) {
|
|
21962
|
+
const msg = sesame.v1.recorder.RecorderClipAddRequest.create({ clip });
|
|
21963
|
+
await this.rpc.service.requestRecorderOperation({ recorderId, addClip: msg });
|
|
21964
|
+
}
|
|
21965
|
+
async copyClip(recorderId, clipId, newClipId) {
|
|
21966
|
+
const msg = sesame.v1.recorder.RecorderClipCopyRequest.create({ clipId, newClipId });
|
|
21967
|
+
await this.rpc.service.requestRecorderOperation({ recorderId, copyClip: msg });
|
|
21968
|
+
}
|
|
21969
|
+
async removeClip(recorderId, id) {
|
|
21970
|
+
const msg = sesame.v1.recorder.RecorderClipRemoveRequest.create({ clipId: id });
|
|
21971
|
+
await this.rpc.service.requestRecorderOperation({ recorderId, removeClip: msg });
|
|
21972
|
+
}
|
|
21973
|
+
async removeAllClips(recorderId, protect) {
|
|
21974
|
+
const msg = sesame.v1.recorder.RecorderClipsClearRequest.create();
|
|
21975
|
+
if (protect) msg.protectedRanges = protect;
|
|
21976
|
+
await this.rpc.service.requestRecorderOperation({ recorderId, clearClips: msg });
|
|
21977
|
+
}
|
|
21978
|
+
async verifyClips(recorderId) {
|
|
21979
|
+
var _a;
|
|
21980
|
+
const msg = sesame.v1.recorder.RecorderClipsVerifyRequest.create();
|
|
21981
|
+
const reply = await this.rpc.service.requestRecorderOperation({ recorderId, verifyClips: msg });
|
|
21982
|
+
return ((_a = reply.verifyClipsResponse) == null ? void 0 : _a.errors) || [];
|
|
21983
|
+
}
|
|
21984
|
+
async getClips(recorderId) {
|
|
21985
|
+
var _a;
|
|
21986
|
+
const msg = sesame.v1.recorder.RecorderClipsGetRequest.create();
|
|
21987
|
+
const reply = await this.rpc.service.requestRecorderOperation({ recorderId, getClips: msg });
|
|
21988
|
+
if ((_a = reply.getClipsResponse) == null ? void 0 : _a.clips) {
|
|
21989
|
+
return reply.getClipsResponse.clips;
|
|
21990
|
+
} else {
|
|
21991
|
+
throw new Error(`No clips returned: ${JSON.stringify(reply)}`);
|
|
21992
|
+
}
|
|
21993
|
+
}
|
|
21994
|
+
async setLockedDuration(frames) {
|
|
21995
|
+
const msg = sesame.v1.recorder.RecorderLockedDurationSetRequest.create({ frames });
|
|
21996
|
+
await this.rpc.service.requestRecorderOperation({ recorderId: "", setLockedDuration: msg });
|
|
21997
|
+
}
|
|
21998
|
+
async setMetadata(recorderId, metadata) {
|
|
21999
|
+
const msg = sesame.v1.recorder.RecorderMetadataSetRequest.create({ metadata });
|
|
22000
|
+
await this.rpc.service.requestRecorderOperation({ recorderId, setMetadata: msg });
|
|
22001
|
+
}
|
|
22002
|
+
};
|
|
22003
|
+
|
|
22004
|
+
// src/jobs-api.ts
|
|
22005
|
+
var JobsApi = class {
|
|
22006
|
+
/** @internal */
|
|
22007
|
+
constructor(rpc2) {
|
|
22008
|
+
this.rpc = rpc2;
|
|
22009
|
+
}
|
|
22010
|
+
async importClip(config) {
|
|
22011
|
+
const msg = sesame.v1.jobs.ImportStartRequest.create();
|
|
22012
|
+
msg.config = config;
|
|
22013
|
+
const res = await this.rpc.service.requestClipImportStart(msg);
|
|
22014
|
+
if (res.error) {
|
|
22015
|
+
throw new Error(res.error);
|
|
22016
|
+
}
|
|
22017
|
+
return res;
|
|
22018
|
+
}
|
|
22019
|
+
async getImportStatus() {
|
|
22020
|
+
const msg = sesame.v1.jobs.ImportListRequest.create();
|
|
22021
|
+
return this.rpc.service.requestClipImportList(msg);
|
|
22022
|
+
}
|
|
22023
|
+
async abortImport(jobId) {
|
|
22024
|
+
const msg = { jobId };
|
|
22025
|
+
return this.rpc.service.requestClipImportAbort(msg);
|
|
22026
|
+
}
|
|
22027
|
+
async exportPlaylist(playlist, config) {
|
|
22028
|
+
const msg = sesame.v1.jobs.ExportStartRequest.create();
|
|
22029
|
+
if (!config.filename) throw new Error("Filename is required");
|
|
22030
|
+
msg.config = {
|
|
22031
|
+
...config,
|
|
22032
|
+
filename: config.filename,
|
|
22033
|
+
videoCodec: config.videoCodec ?? sesame.v1.common.CodecId.CODEC_ID_H264,
|
|
22034
|
+
videoBitrateKbps: config.videoBitrateKbps ?? 1024,
|
|
22035
|
+
audioCodec: config.audioCodec ?? sesame.v1.jobs.AudioCodecId.AUDIO_CODEC_ID_AAC,
|
|
22036
|
+
audioBitrateKbps: config.audioBitrateKbps ?? 128,
|
|
22037
|
+
audioChannels: config.audioChannels ?? 4,
|
|
22038
|
+
audioRouting: config.audioRouting ?? [0, 1, 2, 3]
|
|
22039
|
+
};
|
|
22040
|
+
msg.items = playlist.clips.map((clip) => ({
|
|
22041
|
+
id: clip.id,
|
|
22042
|
+
recorderId: clip.recorderId,
|
|
22043
|
+
transitionTimeUs: clip.transitionTimeUs ?? 0,
|
|
22044
|
+
transitionType: clip.transitionType ?? sesame.v1.recorder.TransitionType.TRANSITION_TYPE_MIX,
|
|
22045
|
+
transitionFadeColor: clip.transitionFadeColor ?? { x: 0, y: 0, z: 0, w: 0 },
|
|
22046
|
+
speed: clip.speed ?? 1,
|
|
22047
|
+
audioRouting: clip.audioRouting,
|
|
22048
|
+
startTimeUs: clip.startTimeUs,
|
|
22049
|
+
endTimeUs: clip.endTimeUs
|
|
22050
|
+
}));
|
|
22051
|
+
await this.rpc.service.requestPlaylistExportStart(msg);
|
|
22052
|
+
}
|
|
22053
|
+
async getExportStatus() {
|
|
22054
|
+
const msg = sesame.v1.jobs.ExportListRequest.create();
|
|
22055
|
+
return this.rpc.service.requestPlaylistExportList(msg);
|
|
22056
|
+
}
|
|
22057
|
+
async abortExport(jobId) {
|
|
22058
|
+
const msg = { jobId };
|
|
22059
|
+
return this.rpc.service.requestPlaylistExportAbort(msg);
|
|
22060
|
+
}
|
|
22061
|
+
};
|
|
22062
|
+
|
|
22063
|
+
// src/sesame-api-client.ts
|
|
21934
22064
|
var EaseKind = /* @__PURE__ */ ((EaseKind2) => {
|
|
21935
22065
|
EaseKind2["STEPPED"] = "stepped";
|
|
21936
22066
|
EaseKind2["LINEAR"] = "linear";
|
|
@@ -22001,6 +22131,9 @@ var SesameClient = class extends import_events3.EventEmitter {
|
|
|
22001
22131
|
eventTypes: events
|
|
22002
22132
|
};
|
|
22003
22133
|
this.rpc = new RPCClient(this.conn, sesame.v1.rpc.SesameAPIService, options);
|
|
22134
|
+
this.status = new StatusApi(this.rpc);
|
|
22135
|
+
this.recorder = new RecorderApi(this.rpc);
|
|
22136
|
+
this.jobs = new JobsApi(this.rpc);
|
|
22004
22137
|
this.rpc.on("event", (topic, msg) => {
|
|
22005
22138
|
for (const subscription of this.subscriptions) {
|
|
22006
22139
|
if (subscription.topic === topic) {
|
|
@@ -22012,57 +22145,46 @@ var SesameClient = class extends import_events3.EventEmitter {
|
|
|
22012
22145
|
log.error(`RPC error: ${err.message}`);
|
|
22013
22146
|
});
|
|
22014
22147
|
this.conn.on("open", async () => {
|
|
22015
|
-
this.
|
|
22148
|
+
this.sendSubscriptions();
|
|
22016
22149
|
this.errorIsLogged = false;
|
|
22017
22150
|
this.emit("connected");
|
|
22018
22151
|
});
|
|
22019
22152
|
this.conn.on("close", () => {
|
|
22020
22153
|
this.emit("disconnected");
|
|
22021
22154
|
});
|
|
22022
|
-
this.conn.on("video-packet", (data) => this.onVideoPacket(this.
|
|
22023
|
-
this.conn.on("audio-packet", (data) => this.onAudioPacket(this.
|
|
22155
|
+
this.conn.on("video-packet", (data) => this.onVideoPacket(this.videoSubscriptionId, data));
|
|
22156
|
+
this.conn.on("audio-packet", (data) => this.onAudioPacket(this.videoSubscriptionId, data));
|
|
22024
22157
|
this.subscriptions = [];
|
|
22025
22158
|
}
|
|
22026
22159
|
isConnected() {
|
|
22027
22160
|
return this.conn.isConnected();
|
|
22028
22161
|
}
|
|
22029
|
-
|
|
22162
|
+
sendSubscriptions() {
|
|
22030
22163
|
if (!this.isConnected()) return;
|
|
22031
22164
|
const eventTopics = this.subscriptions.map((subscription) => subscription.topic);
|
|
22032
22165
|
const channels = [];
|
|
22033
|
-
if (this.
|
|
22166
|
+
if (this.videoSubscriptionId) channels.push(`video/${this.videoSubscriptionId}`);
|
|
22034
22167
|
let subs = { eventTopics, channels };
|
|
22035
22168
|
this.rpc.service.updateSubscriptions(subs).catch((err) => {
|
|
22036
22169
|
log.error(`Failed to update subscriptions: ${err.message}`);
|
|
22037
22170
|
});
|
|
22038
22171
|
}
|
|
22039
|
-
|
|
22040
|
-
|
|
22041
|
-
|
|
22042
|
-
}
|
|
22043
|
-
async get_io_devices() {
|
|
22044
|
-
const reply = await this.rpc.service.requestIODeviceList(new sesame.v1.common.Empty());
|
|
22045
|
-
return reply;
|
|
22172
|
+
addVideoSubscription(id) {
|
|
22173
|
+
this.videoSubscriptionId = id;
|
|
22174
|
+
this.sendSubscriptions();
|
|
22046
22175
|
}
|
|
22047
|
-
|
|
22048
|
-
await this.rpc.service.requestKeyframe({ id: outputId });
|
|
22049
|
-
}
|
|
22050
|
-
add_video_subscription(id) {
|
|
22051
|
-
this.video_subscription = id;
|
|
22052
|
-
this.send_subscriptions();
|
|
22053
|
-
}
|
|
22054
|
-
add_subscription(topic, callback) {
|
|
22176
|
+
addSubscription(topic, callback) {
|
|
22055
22177
|
for (let i = 0; i < this.subscriptions.length; i++) {
|
|
22056
22178
|
if (this.subscriptions[i].callback === callback && this.subscriptions[i].topic === topic) {
|
|
22057
22179
|
return;
|
|
22058
22180
|
}
|
|
22059
22181
|
}
|
|
22060
22182
|
this.subscriptions.push({ topic, callback });
|
|
22061
|
-
this.
|
|
22183
|
+
this.sendSubscriptions();
|
|
22062
22184
|
}
|
|
22063
|
-
|
|
22185
|
+
removeSubscription(topic, callback) {
|
|
22064
22186
|
this.subscriptions = this.subscriptions.filter((s) => !(s.topic === topic && s.callback === callback));
|
|
22065
|
-
this.
|
|
22187
|
+
this.sendSubscriptions();
|
|
22066
22188
|
}
|
|
22067
22189
|
getService() {
|
|
22068
22190
|
return this.rpc;
|
|
@@ -22073,98 +22195,6 @@ var SesameClient = class extends import_events3.EventEmitter {
|
|
|
22073
22195
|
await this.rpc.service.executeCommandList(cl.get_command_list_msg());
|
|
22074
22196
|
}
|
|
22075
22197
|
}
|
|
22076
|
-
async addClip(recorderId, clip) {
|
|
22077
|
-
const msg = sesame.v1.recorder.RecorderClipAddRequest.create({ clip });
|
|
22078
|
-
await this.rpc.service.requestRecorderOperation({ recorderId, addClip: msg });
|
|
22079
|
-
}
|
|
22080
|
-
async copyClip(recorderId, clipId, newClipId) {
|
|
22081
|
-
const msg = sesame.v1.recorder.RecorderClipCopyRequest.create({ clipId, newClipId });
|
|
22082
|
-
await this.rpc.service.requestRecorderOperation({ recorderId, copyClip: msg });
|
|
22083
|
-
}
|
|
22084
|
-
async removeClip(recorderId, id) {
|
|
22085
|
-
const msg = sesame.v1.recorder.RecorderClipRemoveRequest.create({ clipId: id });
|
|
22086
|
-
await this.rpc.service.requestRecorderOperation({ recorderId, removeClip: msg });
|
|
22087
|
-
}
|
|
22088
|
-
async removeAllClips(recorderId, protect) {
|
|
22089
|
-
const msg = sesame.v1.recorder.RecorderClipsClearRequest.create();
|
|
22090
|
-
if (protect) msg.protectedRanges = protect;
|
|
22091
|
-
await this.rpc.service.requestRecorderOperation({ recorderId, clearClips: msg });
|
|
22092
|
-
}
|
|
22093
|
-
async verifyClips(recorderId) {
|
|
22094
|
-
var _a;
|
|
22095
|
-
const msg = sesame.v1.recorder.RecorderClipsVerifyRequest.create();
|
|
22096
|
-
const reply = await this.rpc.service.requestRecorderOperation({ recorderId, verifyClips: msg });
|
|
22097
|
-
return ((_a = reply.verifyClipsResponse) == null ? void 0 : _a.errors) || [];
|
|
22098
|
-
}
|
|
22099
|
-
async setLockedDuration(frames) {
|
|
22100
|
-
const msg = sesame.v1.recorder.RecorderLockedDurationSetRequest.create({ frames });
|
|
22101
|
-
await this.rpc.service.requestRecorderOperation({ recorderId: "", setLockedDuration: msg });
|
|
22102
|
-
}
|
|
22103
|
-
async setMetadata(recorderId, metadata) {
|
|
22104
|
-
const msg = sesame.v1.recorder.RecorderMetadataSetRequest.create({ metadata });
|
|
22105
|
-
await this.rpc.service.requestRecorderOperation({ recorderId, setMetadata: msg });
|
|
22106
|
-
}
|
|
22107
|
-
async getClips(recorderId) {
|
|
22108
|
-
const msg = sesame.v1.recorder.RecorderClipsGetRequest.create();
|
|
22109
|
-
const reply = await this.rpc.service.requestRecorderOperation({ recorderId, getClips: msg });
|
|
22110
|
-
if (reply.getClipsResponse && reply.getClipsResponse.clips) {
|
|
22111
|
-
return reply.getClipsResponse.clips;
|
|
22112
|
-
} else {
|
|
22113
|
-
throw new Error(`No clips returned: ${JSON.stringify(reply)}`);
|
|
22114
|
-
}
|
|
22115
|
-
}
|
|
22116
|
-
async getImportClipStatus() {
|
|
22117
|
-
const msg = sesame.v1.jobs.ImportListRequest.create();
|
|
22118
|
-
return await this.rpc.service.requestClipImportList(msg);
|
|
22119
|
-
}
|
|
22120
|
-
async getExportPlaylistStatus() {
|
|
22121
|
-
const msg = sesame.v1.jobs.ExportListRequest.create();
|
|
22122
|
-
return await this.rpc.service.requestPlaylistExportList(msg);
|
|
22123
|
-
}
|
|
22124
|
-
async exportPlaylist(playlist, config) {
|
|
22125
|
-
const msg = sesame.v1.jobs.ExportStartRequest.create();
|
|
22126
|
-
if (!config.filename) throw new Error("Filename is required");
|
|
22127
|
-
msg.config = {
|
|
22128
|
-
...config,
|
|
22129
|
-
filename: config.filename,
|
|
22130
|
-
videoCodec: config.videoCodec ?? sesame.v1.common.CodecId.CODEC_ID_H264,
|
|
22131
|
-
videoBitrateKbps: config.videoBitrateKbps ?? 1024,
|
|
22132
|
-
audioCodec: config.audioCodec ?? sesame.v1.jobs.AudioCodecId.AUDIO_CODEC_ID_AAC,
|
|
22133
|
-
audioBitrateKbps: config.audioBitrateKbps ?? 128,
|
|
22134
|
-
audioChannels: config.audioChannels ?? 4,
|
|
22135
|
-
audioRouting: config.audioRouting ?? [0, 1, 2, 3]
|
|
22136
|
-
};
|
|
22137
|
-
msg.items = playlist.clips.map((clip) => ({
|
|
22138
|
-
id: clip.id,
|
|
22139
|
-
recorderId: clip.recorderId,
|
|
22140
|
-
transitionTimeUs: clip.transitionTimeUs ?? 0,
|
|
22141
|
-
transitionType: clip.transitionType ?? sesame.v1.recorder.TransitionType.TRANSITION_TYPE_MIX,
|
|
22142
|
-
transitionFadeColor: clip.transitionFadeColor ?? { x: 0, y: 0, z: 0, w: 0 },
|
|
22143
|
-
speed: clip.speed ?? 1,
|
|
22144
|
-
audioRouting: clip.audioRouting,
|
|
22145
|
-
startTimeUs: clip.startTimeUs,
|
|
22146
|
-
endTimeUs: clip.endTimeUs
|
|
22147
|
-
}));
|
|
22148
|
-
await this.rpc.service.requestPlaylistExportStart(msg);
|
|
22149
|
-
}
|
|
22150
|
-
async importClip(config) {
|
|
22151
|
-
const msg = sesame.v1.jobs.ImportStartRequest.create();
|
|
22152
|
-
msg.config = config;
|
|
22153
|
-
const res = await this.rpc.service.requestClipImportStart(msg);
|
|
22154
|
-
if (res.error) {
|
|
22155
|
-
throw new Error(res.error);
|
|
22156
|
-
} else {
|
|
22157
|
-
return res;
|
|
22158
|
-
}
|
|
22159
|
-
}
|
|
22160
|
-
async abortExportJob(jobId) {
|
|
22161
|
-
const msg = { jobId };
|
|
22162
|
-
return this.rpc.service.requestPlaylistExportAbort(msg);
|
|
22163
|
-
}
|
|
22164
|
-
async abortImportJob(jobId) {
|
|
22165
|
-
const msg = { jobId };
|
|
22166
|
-
return this.rpc.service.requestClipImportAbort(msg);
|
|
22167
|
-
}
|
|
22168
22198
|
disconnect() {
|
|
22169
22199
|
this.conn.disconnect();
|
|
22170
22200
|
}
|
|
@@ -22181,14 +22211,17 @@ var Event = sesame.v1.rpc.Event;
|
|
|
22181
22211
|
CommandList,
|
|
22182
22212
|
EaseKind,
|
|
22183
22213
|
Event,
|
|
22214
|
+
JobsApi,
|
|
22184
22215
|
Message,
|
|
22185
22216
|
PacketType,
|
|
22186
22217
|
RPCClient,
|
|
22218
|
+
RecorderApi,
|
|
22187
22219
|
Request,
|
|
22188
22220
|
Response,
|
|
22189
22221
|
SesameBinaryProtocol,
|
|
22190
22222
|
SesameClient,
|
|
22191
22223
|
SesameConnection,
|
|
22224
|
+
StatusApi,
|
|
22192
22225
|
getLogger,
|
|
22193
22226
|
log,
|
|
22194
22227
|
sesame,
|