@stinkycomputing/sesame-api-client 1.4.0 → 1.4.1-alpha.1
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 +31 -6
- package/dist/browser.cjs.map +2 -2
- package/dist/browser.mjs +31 -6
- package/dist/browser.mjs.map +2 -2
- package/dist/command-list.d.ts +15 -1
- package/dist/command-list.d.ts.map +1 -1
- package/dist/index.cjs +78 -16
- 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 +78 -16
- 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/dist/sesame-connection.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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AAiB,EACjB,qBAAqB,EACrB,gBAAgB,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
|
@@ -21290,7 +21290,8 @@ var CommandList = class {
|
|
|
21290
21290
|
encoded: this.buildOutputEncodedConfig(cfg.encodedConfig),
|
|
21291
21291
|
filename: cfg.recorderConfig.filename,
|
|
21292
21292
|
sizeGb: cfg.recorderConfig.sizeGb,
|
|
21293
|
-
groupId: cfg.recorderConfig.groupId
|
|
21293
|
+
groupId: cfg.recorderConfig.groupId,
|
|
21294
|
+
recorderType: cfg.recorderConfig.type
|
|
21294
21295
|
};
|
|
21295
21296
|
break;
|
|
21296
21297
|
case sesame.v1.outputs.OutputType.OUTPUT_TYPE_ENCODED_SUPER_SLOWMO_RECORDER:
|
|
@@ -21300,7 +21301,8 @@ var CommandList = class {
|
|
|
21300
21301
|
encoded: this.buildOutputEncodedConfig(cfg.encodedConfig),
|
|
21301
21302
|
filename: cfg.recorderConfig.filename,
|
|
21302
21303
|
sizeGb: cfg.recorderConfig.sizeGb,
|
|
21303
|
-
groupId: cfg.recorderConfig.groupId
|
|
21304
|
+
groupId: cfg.recorderConfig.groupId,
|
|
21305
|
+
recorderType: cfg.recorderConfig.type
|
|
21304
21306
|
};
|
|
21305
21307
|
break;
|
|
21306
21308
|
case sesame.v1.outputs.OutputType.OUTPUT_TYPE_SYSTEM_AUDIO:
|
|
@@ -21398,10 +21400,10 @@ var CommandList = class {
|
|
|
21398
21400
|
transitionTimeUs: (clip.transitionTime || 0) * 1e3,
|
|
21399
21401
|
speed: clip.speed || 1,
|
|
21400
21402
|
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 }
|
|
21403
|
+
startTimeUs: clip.startTime,
|
|
21404
|
+
endTimeUs: clip.endTime,
|
|
21405
|
+
transitionType: clip.transitionType ?? sesame.v1.recorder.TransitionType.TRANSITION_TYPE_MIX,
|
|
21406
|
+
transitionFadeColor: clip.transitionFadeColor ?? { x: 0, y: 0, z: 0, w: 0 }
|
|
21405
21407
|
})),
|
|
21406
21408
|
sourceId,
|
|
21407
21409
|
userPlaylistId: playlist.id,
|
|
@@ -21450,6 +21452,29 @@ var CommandList = class {
|
|
|
21450
21452
|
case "set_recorder":
|
|
21451
21453
|
cmd = sesame.v1.sources.SourceTransportCommandType.SOURCE_TRANSPORT_CMD_MONITOR;
|
|
21452
21454
|
break;
|
|
21455
|
+
case "take":
|
|
21456
|
+
cmd = sesame.v1.sources.SourceTransportCommandType.SOURCE_TRANSPORT_CMD_TAKE;
|
|
21457
|
+
break;
|
|
21458
|
+
case "pre_roll":
|
|
21459
|
+
cmd = sesame.v1.sources.SourceTransportCommandType.SOURCE_TRANSPORT_CMD_PRE_ROLL;
|
|
21460
|
+
break;
|
|
21461
|
+
case "post_roll":
|
|
21462
|
+
cmd = sesame.v1.sources.SourceTransportCommandType.SOURCE_TRANSPORT_CMD_POST_ROLL;
|
|
21463
|
+
break;
|
|
21464
|
+
case "next_playlist_clip":
|
|
21465
|
+
cmd = sesame.v1.sources.SourceTransportCommandType.SOURCE_TRANSPORT_CMD_NEXT;
|
|
21466
|
+
break;
|
|
21467
|
+
case "skip_next_playlist_clip":
|
|
21468
|
+
cmd = sesame.v1.sources.SourceTransportCommandType.SOURCE_TRANSPORT_CMD_SKIP_NEXT;
|
|
21469
|
+
break;
|
|
21470
|
+
case "transitions_disabled":
|
|
21471
|
+
cmd = sesame.v1.sources.SourceTransportCommandType.SOURCE_TRANSPORT_CMD_TRANSITIONS_DISABLED;
|
|
21472
|
+
useIntValue = true;
|
|
21473
|
+
break;
|
|
21474
|
+
case "set_scrubbing":
|
|
21475
|
+
cmd = sesame.v1.sources.SourceTransportCommandType.SOURCE_TRANSPORT_CMD_SET_SCRUBBING;
|
|
21476
|
+
useIntValue = true;
|
|
21477
|
+
break;
|
|
21453
21478
|
default:
|
|
21454
21479
|
throw new Error("Unknown transport command type: " + msg.type);
|
|
21455
21480
|
}
|
|
@@ -22044,11 +22069,12 @@ var SesameConnection = class extends EventEmitter2 {
|
|
|
22044
22069
|
if (!this.socket) {
|
|
22045
22070
|
return;
|
|
22046
22071
|
}
|
|
22047
|
-
|
|
22048
|
-
|
|
22072
|
+
const sock = this.socket;
|
|
22073
|
+
if (sock.readyState !== WebSocket2.CLOSED) {
|
|
22074
|
+
sock.close();
|
|
22049
22075
|
await waitForEvent(this, "close");
|
|
22050
22076
|
}
|
|
22051
|
-
|
|
22077
|
+
sock.removeAllListeners();
|
|
22052
22078
|
}
|
|
22053
22079
|
retryHandler() {
|
|
22054
22080
|
if (this.active && this.autoReconnect) {
|
|
@@ -22057,6 +22083,9 @@ var SesameConnection = class extends EventEmitter2 {
|
|
|
22057
22083
|
}
|
|
22058
22084
|
closeHandler() {
|
|
22059
22085
|
this.emit("close");
|
|
22086
|
+
if (this.socket) {
|
|
22087
|
+
this.socket.removeAllListeners();
|
|
22088
|
+
}
|
|
22060
22089
|
this.socket = void 0;
|
|
22061
22090
|
if (this.active) {
|
|
22062
22091
|
try {
|
|
@@ -22114,7 +22143,7 @@ var EaseKind = /* @__PURE__ */ ((EaseKind2) => {
|
|
|
22114
22143
|
return EaseKind2;
|
|
22115
22144
|
})(EaseKind || {});
|
|
22116
22145
|
var SesameClient = class extends EventEmitter3 {
|
|
22117
|
-
constructor(
|
|
22146
|
+
constructor(portOrUrl) {
|
|
22118
22147
|
super();
|
|
22119
22148
|
this.subscriptions = [];
|
|
22120
22149
|
this.errorIsLogged = false;
|
|
@@ -22124,8 +22153,9 @@ var SesameClient = class extends EventEmitter3 {
|
|
|
22124
22153
|
};
|
|
22125
22154
|
this.onCallbackMessage = () => {
|
|
22126
22155
|
};
|
|
22156
|
+
const url = typeof portOrUrl === "number" ? `ws://127.0.0.1:${portOrUrl}/api` : portOrUrl;
|
|
22127
22157
|
this.conn = new SesameConnection({
|
|
22128
|
-
url
|
|
22158
|
+
url,
|
|
22129
22159
|
autoConnect: true,
|
|
22130
22160
|
autoReconnect: true
|
|
22131
22161
|
});
|
|
@@ -22162,6 +22192,9 @@ var SesameClient = class extends EventEmitter3 {
|
|
|
22162
22192
|
this.errorIsLogged = false;
|
|
22163
22193
|
this.emit("connected");
|
|
22164
22194
|
});
|
|
22195
|
+
this.conn.on("close", () => {
|
|
22196
|
+
this.emit("disconnected");
|
|
22197
|
+
});
|
|
22165
22198
|
this.conn.on("video-packet", (data) => this.onVideoPacket(this.video_subscription, data));
|
|
22166
22199
|
this.conn.on("audio-packet", (data) => this.onAudioPacket(this.video_subscription, data));
|
|
22167
22200
|
this.subscriptions = [];
|
|
@@ -22187,6 +22220,9 @@ var SesameClient = class extends EventEmitter3 {
|
|
|
22187
22220
|
const reply = await this.rpc.service.requestIODeviceList(new sesame.v1.common.Empty());
|
|
22188
22221
|
return reply;
|
|
22189
22222
|
}
|
|
22223
|
+
async request_keyframe(outputId) {
|
|
22224
|
+
await this.rpc.service.requestKeyframe({ id: outputId });
|
|
22225
|
+
}
|
|
22190
22226
|
add_video_subscription(id) {
|
|
22191
22227
|
this.video_subscription = id;
|
|
22192
22228
|
this.send_subscriptions();
|
|
@@ -22200,6 +22236,10 @@ var SesameClient = class extends EventEmitter3 {
|
|
|
22200
22236
|
this.subscriptions.push({ topic, callback });
|
|
22201
22237
|
this.send_subscriptions();
|
|
22202
22238
|
}
|
|
22239
|
+
remove_subscription(topic, callback) {
|
|
22240
|
+
this.subscriptions = this.subscriptions.filter((s) => !(s.topic === topic && s.callback === callback));
|
|
22241
|
+
this.send_subscriptions();
|
|
22242
|
+
}
|
|
22203
22243
|
getService() {
|
|
22204
22244
|
return this.rpc;
|
|
22205
22245
|
}
|
|
@@ -22213,10 +22253,29 @@ var SesameClient = class extends EventEmitter3 {
|
|
|
22213
22253
|
const msg = sesame.v1.recorder.RecorderClipAddRequest.create({ clip });
|
|
22214
22254
|
await this.rpc.service.requestRecorderOperation({ recorderId, addClip: msg });
|
|
22215
22255
|
}
|
|
22256
|
+
async copyClip(recorderId, clipId, newClipId) {
|
|
22257
|
+
const msg = sesame.v1.recorder.RecorderClipCopyRequest.create({ clipId, newClipId });
|
|
22258
|
+
await this.rpc.service.requestRecorderOperation({ recorderId, copyClip: msg });
|
|
22259
|
+
}
|
|
22216
22260
|
async removeClip(recorderId, id) {
|
|
22217
22261
|
const msg = sesame.v1.recorder.RecorderClipRemoveRequest.create({ clipId: id });
|
|
22218
22262
|
await this.rpc.service.requestRecorderOperation({ recorderId, removeClip: msg });
|
|
22219
22263
|
}
|
|
22264
|
+
async removeAllClips(recorderId, protect) {
|
|
22265
|
+
const msg = sesame.v1.recorder.RecorderClipsClearRequest.create();
|
|
22266
|
+
if (protect) msg.protectedRanges = protect;
|
|
22267
|
+
await this.rpc.service.requestRecorderOperation({ recorderId, clearClips: msg });
|
|
22268
|
+
}
|
|
22269
|
+
async verifyClips(recorderId) {
|
|
22270
|
+
var _a;
|
|
22271
|
+
const msg = sesame.v1.recorder.RecorderClipsVerifyRequest.create();
|
|
22272
|
+
const reply = await this.rpc.service.requestRecorderOperation({ recorderId, verifyClips: msg });
|
|
22273
|
+
return ((_a = reply.verifyClipsResponse) == null ? void 0 : _a.errors) || [];
|
|
22274
|
+
}
|
|
22275
|
+
async setLockedDuration(frames) {
|
|
22276
|
+
const msg = sesame.v1.recorder.RecorderLockedDurationSetRequest.create({ frames });
|
|
22277
|
+
await this.rpc.service.requestRecorderOperation({ recorderId: "", setLockedDuration: msg });
|
|
22278
|
+
}
|
|
22220
22279
|
async setMetadata(recorderId, metadata) {
|
|
22221
22280
|
const msg = sesame.v1.recorder.RecorderMetadataSetRequest.create({ metadata });
|
|
22222
22281
|
await this.rpc.service.requestRecorderOperation({ recorderId, setMetadata: msg });
|
|
@@ -22232,7 +22291,9 @@ var SesameClient = class extends EventEmitter3 {
|
|
|
22232
22291
|
endTime: Number(c.endTimeUs),
|
|
22233
22292
|
lockedStart: Number(c.lockedStartUs),
|
|
22234
22293
|
lockedEnd: Number(c.lockedEndUs),
|
|
22235
|
-
userTime: c.userTimeUs ? Number(c.userTimeUs) : void 0
|
|
22294
|
+
userTime: c.userTimeUs ? Number(c.userTimeUs) : void 0,
|
|
22295
|
+
name: c.name ?? "",
|
|
22296
|
+
userData: c.userData
|
|
22236
22297
|
};
|
|
22237
22298
|
});
|
|
22238
22299
|
} else {
|
|
@@ -22264,10 +22325,12 @@ var SesameClient = class extends EventEmitter3 {
|
|
|
22264
22325
|
id: clip.id,
|
|
22265
22326
|
recorderId: clip.recorderId,
|
|
22266
22327
|
transitionTimeUs: (clip.transitionTime ?? 0) * 1e3,
|
|
22267
|
-
transitionType: sesame.v1.recorder.TransitionType.TRANSITION_TYPE_MIX,
|
|
22268
|
-
transitionFadeColor: { x: 0, y: 0, z: 0, w: 0 },
|
|
22328
|
+
transitionType: clip.transitionType ?? sesame.v1.recorder.TransitionType.TRANSITION_TYPE_MIX,
|
|
22329
|
+
transitionFadeColor: clip.transitionFadeColor ?? { x: 0, y: 0, z: 0, w: 0 },
|
|
22269
22330
|
speed: clip.speed ?? 1,
|
|
22270
|
-
audioRouting: clip.audioRouting
|
|
22331
|
+
audioRouting: clip.audioRouting,
|
|
22332
|
+
startTimeUs: clip.startTime,
|
|
22333
|
+
endTimeUs: clip.endTime
|
|
22271
22334
|
}));
|
|
22272
22335
|
await this.rpc.service.requestPlaylistExportStart(msg);
|
|
22273
22336
|
}
|
|
@@ -22290,7 +22353,6 @@ var SesameClient = class extends EventEmitter3 {
|
|
|
22290
22353
|
return this.rpc.service.requestClipImportAbort(msg);
|
|
22291
22354
|
}
|
|
22292
22355
|
disconnect() {
|
|
22293
|
-
this.conn.removeAllListeners();
|
|
22294
22356
|
this.conn.disconnect();
|
|
22295
22357
|
}
|
|
22296
22358
|
};
|