@stinkycomputing/sesame-api-client 1.4.0 → 1.4.1-alpha.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 +47 -0
- package/dist/browser.cjs +27 -4
- package/dist/browser.cjs.map +2 -2
- package/dist/browser.mjs +27 -4
- package/dist/browser.mjs.map +2 -2
- package/dist/command-list.d.ts +14 -1
- package/dist/command-list.d.ts.map +1 -1
- package/dist/index.cjs +67 -10
- 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 +67 -10
- package/dist/index.mjs.map +2 -2
- package/dist/sesame-api-client.d.ts +19 -1
- package/dist/sesame-api-client.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ type IEvent = sesame.v1.rpc.IEvent;
|
|
|
17
17
|
export { sesame, Message, Request, Response, Event };
|
|
18
18
|
export type { IMessage, IRequest, IResponse, IEvent };
|
|
19
19
|
export { CommandList } from './command-list';
|
|
20
|
-
export type { CompositorID, ReplayID, AudioMixerID, INodeConfig, IEncoderConfig, IRecorderOutputConfig, IOutputConfig, IEncoderOutputConfig, IDecklinkOutputConfig, INDIOutputConfig, IAudioMixerChannel, IAudioMixerConfig, ISourceConfig, IFileSourceConfig, IDecklinkSourceConfig, INDISourceConfig, ISRTSourceConfig, IRTMPSourceConfig, IRTSPSourceConfig, IRecorderSourceConfig, ISourceTransportConfig, ITransportCommand, IPlaylistClip, IPlaylist, ITransactionOptions } from './command-list';
|
|
20
|
+
export type { CompositorID, ReplayID, AudioMixerID, INodeConfig, IEncoderConfig, IRecorderOutputConfig, IOutputConfig, IEncoderOutputConfig, IDecklinkOutputConfig, INDIOutputConfig, IAudioMixerChannel, IAudioMixerConfig, ISourceConfig, IFileSourceConfig, IDecklinkSourceConfig, INDISourceConfig, ISRTSourceConfig, IRTMPSourceConfig, IRTSPSourceConfig, IRecorderSourceConfig, ISourceTransportConfig, ITransportCommand, IPlaylistClip, IPlaylist, ITransactionOptions, keyframe } from './command-list';
|
|
21
21
|
export { RPCClient, IClientOptions, IProtobufType } from './rpc-client';
|
|
22
22
|
export { SesameConnection, IConnectionOptions, VideoCallback, AudioCallback, waitForEvent } from './sesame-connection';
|
|
23
23
|
export { SesameBinaryProtocol, PacketType, CodecType } from './sesame-binary-protocol';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,QAAA,MAAM,OAAO,8BAAwB,CAAC;AACtC,QAAA,MAAM,OAAO,8BAAwB,CAAC;AACtC,QAAA,MAAM,QAAQ,+BAAyB,CAAC;AACxC,QAAA,MAAM,KAAK,4BAAsB,CAAC;AAElC,KAAK,QAAQ,GAAG,MAAM,CAAC,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC;AACvC,KAAK,QAAQ,GAAG,MAAM,CAAC,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC;AACvC,KAAK,SAAS,GAAG,MAAM,CAAC,EAAE,CAAC,GAAG,CAAC,SAAS,CAAC;AACzC,KAAK,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC;AAEnC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;AACrD,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC;AAGtD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,YAAY,EACV,YAAY,EACZ,QAAQ,EACR,YAAY,EACZ,WAAW,EACX,cAAc,EACd,qBAAqB,EACrB,aAAa,EACb,oBAAoB,EACpB,qBAAqB,EACrB,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AgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,sBAAsB,EACtB,iBAAiB,EACjB,aAAa,EACb,SAAS,EACT,mBAAmB,EACnB,QAAQ,EACT,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,aAAa,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACvH,OAAO,EAAE,oBAAoB,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACvF,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAG7D,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC"}
|
package/dist/index.mjs
CHANGED
|
@@ -21398,10 +21398,10 @@ var CommandList = class {
|
|
|
21398
21398
|
transitionTimeUs: (clip.transitionTime || 0) * 1e3,
|
|
21399
21399
|
speed: clip.speed || 1,
|
|
21400
21400
|
audioRouting: clip.audioRouting,
|
|
21401
|
-
startTimeUs:
|
|
21402
|
-
endTimeUs:
|
|
21403
|
-
transitionType: sesame.v1.recorder.TransitionType.TRANSITION_TYPE_MIX,
|
|
21404
|
-
transitionFadeColor: { x: 0, y: 0, z: 0, w: 0 }
|
|
21401
|
+
startTimeUs: clip.startTime,
|
|
21402
|
+
endTimeUs: clip.endTime,
|
|
21403
|
+
transitionType: clip.transitionType ?? sesame.v1.recorder.TransitionType.TRANSITION_TYPE_MIX,
|
|
21404
|
+
transitionFadeColor: clip.transitionFadeColor ?? { x: 0, y: 0, z: 0, w: 0 }
|
|
21405
21405
|
})),
|
|
21406
21406
|
sourceId,
|
|
21407
21407
|
userPlaylistId: playlist.id,
|
|
@@ -21450,6 +21450,29 @@ var CommandList = class {
|
|
|
21450
21450
|
case "set_recorder":
|
|
21451
21451
|
cmd = sesame.v1.sources.SourceTransportCommandType.SOURCE_TRANSPORT_CMD_MONITOR;
|
|
21452
21452
|
break;
|
|
21453
|
+
case "take":
|
|
21454
|
+
cmd = sesame.v1.sources.SourceTransportCommandType.SOURCE_TRANSPORT_CMD_TAKE;
|
|
21455
|
+
break;
|
|
21456
|
+
case "pre_roll":
|
|
21457
|
+
cmd = sesame.v1.sources.SourceTransportCommandType.SOURCE_TRANSPORT_CMD_PRE_ROLL;
|
|
21458
|
+
break;
|
|
21459
|
+
case "post_roll":
|
|
21460
|
+
cmd = sesame.v1.sources.SourceTransportCommandType.SOURCE_TRANSPORT_CMD_POST_ROLL;
|
|
21461
|
+
break;
|
|
21462
|
+
case "next_playlist_clip":
|
|
21463
|
+
cmd = sesame.v1.sources.SourceTransportCommandType.SOURCE_TRANSPORT_CMD_NEXT;
|
|
21464
|
+
break;
|
|
21465
|
+
case "skip_next_playlist_clip":
|
|
21466
|
+
cmd = sesame.v1.sources.SourceTransportCommandType.SOURCE_TRANSPORT_CMD_SKIP_NEXT;
|
|
21467
|
+
break;
|
|
21468
|
+
case "transitions_disabled":
|
|
21469
|
+
cmd = sesame.v1.sources.SourceTransportCommandType.SOURCE_TRANSPORT_CMD_TRANSITIONS_DISABLED;
|
|
21470
|
+
useIntValue = true;
|
|
21471
|
+
break;
|
|
21472
|
+
case "set_scrubbing":
|
|
21473
|
+
cmd = sesame.v1.sources.SourceTransportCommandType.SOURCE_TRANSPORT_CMD_SET_SCRUBBING;
|
|
21474
|
+
useIntValue = true;
|
|
21475
|
+
break;
|
|
21453
21476
|
default:
|
|
21454
21477
|
throw new Error("Unknown transport command type: " + msg.type);
|
|
21455
21478
|
}
|
|
@@ -22114,7 +22137,7 @@ var EaseKind = /* @__PURE__ */ ((EaseKind2) => {
|
|
|
22114
22137
|
return EaseKind2;
|
|
22115
22138
|
})(EaseKind || {});
|
|
22116
22139
|
var SesameClient = class extends EventEmitter3 {
|
|
22117
|
-
constructor(
|
|
22140
|
+
constructor(portOrUrl) {
|
|
22118
22141
|
super();
|
|
22119
22142
|
this.subscriptions = [];
|
|
22120
22143
|
this.errorIsLogged = false;
|
|
@@ -22124,8 +22147,9 @@ var SesameClient = class extends EventEmitter3 {
|
|
|
22124
22147
|
};
|
|
22125
22148
|
this.onCallbackMessage = () => {
|
|
22126
22149
|
};
|
|
22150
|
+
const url = typeof portOrUrl === "number" ? `ws://127.0.0.1:${portOrUrl}/api` : portOrUrl;
|
|
22127
22151
|
this.conn = new SesameConnection({
|
|
22128
|
-
url
|
|
22152
|
+
url,
|
|
22129
22153
|
autoConnect: true,
|
|
22130
22154
|
autoReconnect: true
|
|
22131
22155
|
});
|
|
@@ -22162,6 +22186,9 @@ var SesameClient = class extends EventEmitter3 {
|
|
|
22162
22186
|
this.errorIsLogged = false;
|
|
22163
22187
|
this.emit("connected");
|
|
22164
22188
|
});
|
|
22189
|
+
this.conn.on("close", () => {
|
|
22190
|
+
this.emit("disconnected");
|
|
22191
|
+
});
|
|
22165
22192
|
this.conn.on("video-packet", (data) => this.onVideoPacket(this.video_subscription, data));
|
|
22166
22193
|
this.conn.on("audio-packet", (data) => this.onAudioPacket(this.video_subscription, data));
|
|
22167
22194
|
this.subscriptions = [];
|
|
@@ -22187,6 +22214,9 @@ var SesameClient = class extends EventEmitter3 {
|
|
|
22187
22214
|
const reply = await this.rpc.service.requestIODeviceList(new sesame.v1.common.Empty());
|
|
22188
22215
|
return reply;
|
|
22189
22216
|
}
|
|
22217
|
+
async request_keyframe(outputId) {
|
|
22218
|
+
await this.rpc.service.requestKeyframe({ id: outputId });
|
|
22219
|
+
}
|
|
22190
22220
|
add_video_subscription(id) {
|
|
22191
22221
|
this.video_subscription = id;
|
|
22192
22222
|
this.send_subscriptions();
|
|
@@ -22200,6 +22230,10 @@ var SesameClient = class extends EventEmitter3 {
|
|
|
22200
22230
|
this.subscriptions.push({ topic, callback });
|
|
22201
22231
|
this.send_subscriptions();
|
|
22202
22232
|
}
|
|
22233
|
+
remove_subscription(topic, callback) {
|
|
22234
|
+
this.subscriptions = this.subscriptions.filter((s) => !(s.topic === topic && s.callback === callback));
|
|
22235
|
+
this.send_subscriptions();
|
|
22236
|
+
}
|
|
22203
22237
|
getService() {
|
|
22204
22238
|
return this.rpc;
|
|
22205
22239
|
}
|
|
@@ -22213,10 +22247,29 @@ var SesameClient = class extends EventEmitter3 {
|
|
|
22213
22247
|
const msg = sesame.v1.recorder.RecorderClipAddRequest.create({ clip });
|
|
22214
22248
|
await this.rpc.service.requestRecorderOperation({ recorderId, addClip: msg });
|
|
22215
22249
|
}
|
|
22250
|
+
async copyClip(recorderId, clipId, newClipId) {
|
|
22251
|
+
const msg = sesame.v1.recorder.RecorderClipCopyRequest.create({ clipId, newClipId });
|
|
22252
|
+
await this.rpc.service.requestRecorderOperation({ recorderId, copyClip: msg });
|
|
22253
|
+
}
|
|
22216
22254
|
async removeClip(recorderId, id) {
|
|
22217
22255
|
const msg = sesame.v1.recorder.RecorderClipRemoveRequest.create({ clipId: id });
|
|
22218
22256
|
await this.rpc.service.requestRecorderOperation({ recorderId, removeClip: msg });
|
|
22219
22257
|
}
|
|
22258
|
+
async removeAllClips(recorderId, protect) {
|
|
22259
|
+
const msg = sesame.v1.recorder.RecorderClipsClearRequest.create();
|
|
22260
|
+
if (protect) msg.protectedRanges = protect;
|
|
22261
|
+
await this.rpc.service.requestRecorderOperation({ recorderId, clearClips: msg });
|
|
22262
|
+
}
|
|
22263
|
+
async verifyClips(recorderId) {
|
|
22264
|
+
var _a;
|
|
22265
|
+
const msg = sesame.v1.recorder.RecorderClipsVerifyRequest.create();
|
|
22266
|
+
const reply = await this.rpc.service.requestRecorderOperation({ recorderId, verifyClips: msg });
|
|
22267
|
+
return ((_a = reply.verifyClipsResponse) == null ? void 0 : _a.errors) || [];
|
|
22268
|
+
}
|
|
22269
|
+
async setLockedDuration(frames) {
|
|
22270
|
+
const msg = sesame.v1.recorder.RecorderLockedDurationSetRequest.create({ frames });
|
|
22271
|
+
await this.rpc.service.requestRecorderOperation({ recorderId: "", setLockedDuration: msg });
|
|
22272
|
+
}
|
|
22220
22273
|
async setMetadata(recorderId, metadata) {
|
|
22221
22274
|
const msg = sesame.v1.recorder.RecorderMetadataSetRequest.create({ metadata });
|
|
22222
22275
|
await this.rpc.service.requestRecorderOperation({ recorderId, setMetadata: msg });
|
|
@@ -22232,7 +22285,9 @@ var SesameClient = class extends EventEmitter3 {
|
|
|
22232
22285
|
endTime: Number(c.endTimeUs),
|
|
22233
22286
|
lockedStart: Number(c.lockedStartUs),
|
|
22234
22287
|
lockedEnd: Number(c.lockedEndUs),
|
|
22235
|
-
userTime: c.userTimeUs ? Number(c.userTimeUs) : void 0
|
|
22288
|
+
userTime: c.userTimeUs ? Number(c.userTimeUs) : void 0,
|
|
22289
|
+
name: c.name ?? "",
|
|
22290
|
+
userData: c.userData
|
|
22236
22291
|
};
|
|
22237
22292
|
});
|
|
22238
22293
|
} else {
|
|
@@ -22264,10 +22319,12 @@ var SesameClient = class extends EventEmitter3 {
|
|
|
22264
22319
|
id: clip.id,
|
|
22265
22320
|
recorderId: clip.recorderId,
|
|
22266
22321
|
transitionTimeUs: (clip.transitionTime ?? 0) * 1e3,
|
|
22267
|
-
transitionType: sesame.v1.recorder.TransitionType.TRANSITION_TYPE_MIX,
|
|
22268
|
-
transitionFadeColor: { x: 0, y: 0, z: 0, w: 0 },
|
|
22322
|
+
transitionType: clip.transitionType ?? sesame.v1.recorder.TransitionType.TRANSITION_TYPE_MIX,
|
|
22323
|
+
transitionFadeColor: clip.transitionFadeColor ?? { x: 0, y: 0, z: 0, w: 0 },
|
|
22269
22324
|
speed: clip.speed ?? 1,
|
|
22270
|
-
audioRouting: clip.audioRouting
|
|
22325
|
+
audioRouting: clip.audioRouting,
|
|
22326
|
+
startTimeUs: clip.startTime,
|
|
22327
|
+
endTimeUs: clip.endTime
|
|
22271
22328
|
}));
|
|
22272
22329
|
await this.rpc.service.requestPlaylistExportStart(msg);
|
|
22273
22330
|
}
|