@fishjam-cloud/js-server-sdk 0.25.0 → 0.25.2
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/{chunk-QK3SKSR4.mjs → chunk-ZXWNCWEY.mjs} +12 -4
- package/dist/index.d.mts +7 -2
- package/dist/index.d.ts +7 -2
- package/dist/index.js +28 -13
- package/dist/index.mjs +17 -10
- package/dist/integrations/gemini.d.mts +28 -33
- package/dist/integrations/gemini.d.ts +28 -33
- package/dist/integrations/gemini.js +46 -49
- package/dist/integrations/gemini.mjs +28 -46
- package/package.json +15 -7
|
@@ -33,7 +33,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
33
33
|
// package.json
|
|
34
34
|
var package_default = {
|
|
35
35
|
name: "@fishjam-cloud/js-server-sdk",
|
|
36
|
-
version: "0.25.
|
|
36
|
+
version: "0.25.2",
|
|
37
37
|
description: "Fishjam server SDK for JavaScript",
|
|
38
38
|
homepage: "https://github.com/fishjam-cloud/js-server-sdk",
|
|
39
39
|
author: "Fishjam Team",
|
|
@@ -57,8 +57,16 @@ var package_default = {
|
|
|
57
57
|
"dist"
|
|
58
58
|
],
|
|
59
59
|
exports: {
|
|
60
|
-
".":
|
|
61
|
-
|
|
60
|
+
".": {
|
|
61
|
+
types: "./dist/index.d.ts",
|
|
62
|
+
import: "./dist/index.mjs",
|
|
63
|
+
require: "./dist/index.js"
|
|
64
|
+
},
|
|
65
|
+
"./gemini": {
|
|
66
|
+
types: "./dist/integrations/gemini.d.ts",
|
|
67
|
+
import: "./dist/integrations/gemini.mjs",
|
|
68
|
+
require: "./dist/integrations/gemini.js"
|
|
69
|
+
}
|
|
62
70
|
},
|
|
63
71
|
scripts: {
|
|
64
72
|
build: "tsup --dts-resolve",
|
|
@@ -110,7 +118,7 @@ var package_default = {
|
|
|
110
118
|
},
|
|
111
119
|
"lint-staged": {
|
|
112
120
|
"*.{js,ts,tsx,mjs,cjs}": [
|
|
113
|
-
"eslint --fix --config
|
|
121
|
+
"eslint --fix --config eslint.config.mjs"
|
|
114
122
|
]
|
|
115
123
|
}
|
|
116
124
|
};
|
package/dist/index.d.mts
CHANGED
|
@@ -759,7 +759,7 @@ declare class FishjamWSNotifier extends FishjamWSNotifier_base {
|
|
|
759
759
|
private isExpectedEvent;
|
|
760
760
|
}
|
|
761
761
|
|
|
762
|
-
declare const expectedEventsList: readonly ["trackData"];
|
|
762
|
+
declare const expectedEventsList: readonly ["trackData", "trackImage"];
|
|
763
763
|
/**
|
|
764
764
|
* @useDeclaredType
|
|
765
765
|
*/
|
|
@@ -767,6 +767,7 @@ type ExpectedAgentEvents = (typeof expectedEventsList)[number];
|
|
|
767
767
|
type IncomingTrackData = Omit<NonNullable<AgentResponse_TrackData>, 'peerId'> & {
|
|
768
768
|
peerId: PeerId;
|
|
769
769
|
};
|
|
770
|
+
type IncomingTrackImage = NonNullable<AgentResponse_TrackImage>;
|
|
770
771
|
type OutgoingTrackData = Omit<NonNullable<AgentRequest_TrackData>, 'peerId'> & {
|
|
771
772
|
peerId: PeerId;
|
|
772
773
|
};
|
|
@@ -819,6 +820,10 @@ declare class FishjamAgent extends FishjamAgent_base {
|
|
|
819
820
|
* Send audio data for the given track
|
|
820
821
|
*/
|
|
821
822
|
sendData(trackId: TrackId, data: Uint8Array): void;
|
|
823
|
+
/**
|
|
824
|
+
* Request a captured image from the given track
|
|
825
|
+
*/
|
|
826
|
+
captureImage(trackId: TrackId): void;
|
|
822
827
|
disconnect(): void;
|
|
823
828
|
private dispatchNotification;
|
|
824
829
|
private setupConnection;
|
|
@@ -937,4 +942,4 @@ declare class ServiceUnavailableException extends FishjamBaseException {
|
|
|
937
942
|
declare class UnknownException extends FishjamBaseException {
|
|
938
943
|
}
|
|
939
944
|
|
|
940
|
-
export { type AgentCallbacks, type AgentEvents, type AgentTrack, type AudioCodecParameters, BadRequestException, type Brand, type CloseEventHandler, type ErrorEventHandler, type ExpectedAgentEvents, type ExpectedEvents, FishjamAgent, FishjamBaseException, FishjamClient, type FishjamConfig, FishjamNotFoundException, FishjamWSNotifier, ForbiddenException, type IncomingTrackData, MissingFishjamIdException, type NotificationEvents, type OutgoingTrackData, type Peer, type PeerAdded, type PeerConnected, type PeerCrashed, type PeerDeleted, type PeerDisconnected, type PeerId, type PeerMetadataUpdated, PeerNotFoundException, type PeerOptions, type PeerOptionsAgent, type PeerOptionsWebRTC, PeerStatus, type Room, type RoomConfig, type RoomCrashed, type RoomCreated, type RoomDeleted, type RoomId, RoomNotFoundException, RoomType, ServerMessage, ServiceUnavailableException, type StreamConnected, type StreamDisconnected, type StreamerToken, type TrackAdded, type TrackId, type TrackMetadataUpdated, type TrackRemoved, type TrackType, UnauthorizedException, UnknownException, VideoCodec, type ViewerConnected, type ViewerDisconnected, type ViewerToken };
|
|
945
|
+
export { type AgentCallbacks, type AgentEvents, type AgentTrack, type AudioCodecParameters, BadRequestException, type Brand, type CloseEventHandler, type ErrorEventHandler, type ExpectedAgentEvents, type ExpectedEvents, FishjamAgent, FishjamBaseException, FishjamClient, type FishjamConfig, FishjamNotFoundException, FishjamWSNotifier, ForbiddenException, type IncomingTrackData, type IncomingTrackImage, MissingFishjamIdException, type NotificationEvents, type OutgoingTrackData, type Peer, type PeerAdded, type PeerConnected, type PeerCrashed, type PeerDeleted, type PeerDisconnected, type PeerId, type PeerMetadataUpdated, PeerNotFoundException, type PeerOptions, type PeerOptionsAgent, type PeerOptionsWebRTC, PeerStatus, type Room, type RoomConfig, type RoomCrashed, type RoomCreated, type RoomDeleted, type RoomId, RoomNotFoundException, RoomType, ServerMessage, ServiceUnavailableException, type StreamConnected, type StreamDisconnected, type StreamerToken, type TrackAdded, type TrackId, type TrackMetadataUpdated, type TrackRemoved, type TrackType, UnauthorizedException, UnknownException, VideoCodec, type ViewerConnected, type ViewerDisconnected, type ViewerToken };
|
package/dist/index.d.ts
CHANGED
|
@@ -759,7 +759,7 @@ declare class FishjamWSNotifier extends FishjamWSNotifier_base {
|
|
|
759
759
|
private isExpectedEvent;
|
|
760
760
|
}
|
|
761
761
|
|
|
762
|
-
declare const expectedEventsList: readonly ["trackData"];
|
|
762
|
+
declare const expectedEventsList: readonly ["trackData", "trackImage"];
|
|
763
763
|
/**
|
|
764
764
|
* @useDeclaredType
|
|
765
765
|
*/
|
|
@@ -767,6 +767,7 @@ type ExpectedAgentEvents = (typeof expectedEventsList)[number];
|
|
|
767
767
|
type IncomingTrackData = Omit<NonNullable<AgentResponse_TrackData>, 'peerId'> & {
|
|
768
768
|
peerId: PeerId;
|
|
769
769
|
};
|
|
770
|
+
type IncomingTrackImage = NonNullable<AgentResponse_TrackImage>;
|
|
770
771
|
type OutgoingTrackData = Omit<NonNullable<AgentRequest_TrackData>, 'peerId'> & {
|
|
771
772
|
peerId: PeerId;
|
|
772
773
|
};
|
|
@@ -819,6 +820,10 @@ declare class FishjamAgent extends FishjamAgent_base {
|
|
|
819
820
|
* Send audio data for the given track
|
|
820
821
|
*/
|
|
821
822
|
sendData(trackId: TrackId, data: Uint8Array): void;
|
|
823
|
+
/**
|
|
824
|
+
* Request a captured image from the given track
|
|
825
|
+
*/
|
|
826
|
+
captureImage(trackId: TrackId): void;
|
|
822
827
|
disconnect(): void;
|
|
823
828
|
private dispatchNotification;
|
|
824
829
|
private setupConnection;
|
|
@@ -937,4 +942,4 @@ declare class ServiceUnavailableException extends FishjamBaseException {
|
|
|
937
942
|
declare class UnknownException extends FishjamBaseException {
|
|
938
943
|
}
|
|
939
944
|
|
|
940
|
-
export { type AgentCallbacks, type AgentEvents, type AgentTrack, type AudioCodecParameters, BadRequestException, type Brand, type CloseEventHandler, type ErrorEventHandler, type ExpectedAgentEvents, type ExpectedEvents, FishjamAgent, FishjamBaseException, FishjamClient, type FishjamConfig, FishjamNotFoundException, FishjamWSNotifier, ForbiddenException, type IncomingTrackData, MissingFishjamIdException, type NotificationEvents, type OutgoingTrackData, type Peer, type PeerAdded, type PeerConnected, type PeerCrashed, type PeerDeleted, type PeerDisconnected, type PeerId, type PeerMetadataUpdated, PeerNotFoundException, type PeerOptions, type PeerOptionsAgent, type PeerOptionsWebRTC, PeerStatus, type Room, type RoomConfig, type RoomCrashed, type RoomCreated, type RoomDeleted, type RoomId, RoomNotFoundException, RoomType, ServerMessage, ServiceUnavailableException, type StreamConnected, type StreamDisconnected, type StreamerToken, type TrackAdded, type TrackId, type TrackMetadataUpdated, type TrackRemoved, type TrackType, UnauthorizedException, UnknownException, VideoCodec, type ViewerConnected, type ViewerDisconnected, type ViewerToken };
|
|
945
|
+
export { type AgentCallbacks, type AgentEvents, type AgentTrack, type AudioCodecParameters, BadRequestException, type Brand, type CloseEventHandler, type ErrorEventHandler, type ExpectedAgentEvents, type ExpectedEvents, FishjamAgent, FishjamBaseException, FishjamClient, type FishjamConfig, FishjamNotFoundException, FishjamWSNotifier, ForbiddenException, type IncomingTrackData, type IncomingTrackImage, MissingFishjamIdException, type NotificationEvents, type OutgoingTrackData, type Peer, type PeerAdded, type PeerConnected, type PeerCrashed, type PeerDeleted, type PeerDisconnected, type PeerId, type PeerMetadataUpdated, PeerNotFoundException, type PeerOptions, type PeerOptionsAgent, type PeerOptionsWebRTC, PeerStatus, type Room, type RoomConfig, type RoomCrashed, type RoomCreated, type RoomDeleted, type RoomId, RoomNotFoundException, RoomType, ServerMessage, ServiceUnavailableException, type StreamConnected, type StreamDisconnected, type StreamerToken, type TrackAdded, type TrackId, type TrackMetadataUpdated, type TrackRemoved, type TrackType, UnauthorizedException, UnknownException, VideoCodec, type ViewerConnected, type ViewerDisconnected, type ViewerToken };
|
package/dist/index.js
CHANGED
|
@@ -15479,7 +15479,7 @@ var require_dist2 = __commonJS({
|
|
|
15479
15479
|
AgentResponse: () => AgentResponse2,
|
|
15480
15480
|
AgentResponse_Authenticated: () => AgentResponse_Authenticated,
|
|
15481
15481
|
AgentResponse_TrackData: () => AgentResponse_TrackData2,
|
|
15482
|
-
AgentResponse_TrackImage: () =>
|
|
15482
|
+
AgentResponse_TrackImage: () => AgentResponse_TrackImage2,
|
|
15483
15483
|
ServerMessage: () => ServerMessage3,
|
|
15484
15484
|
ServerMessage_AuthRequest: () => ServerMessage_AuthRequest,
|
|
15485
15485
|
ServerMessage_Authenticated: () => ServerMessage_Authenticated,
|
|
@@ -19495,7 +19495,7 @@ var require_dist2 = __commonJS({
|
|
|
19495
19495
|
AgentResponse_TrackData2.encode(message.trackData, writer.uint32(18).fork()).join();
|
|
19496
19496
|
}
|
|
19497
19497
|
if (message.trackImage !== void 0) {
|
|
19498
|
-
|
|
19498
|
+
AgentResponse_TrackImage2.encode(message.trackImage, writer.uint32(26).fork()).join();
|
|
19499
19499
|
}
|
|
19500
19500
|
return writer;
|
|
19501
19501
|
},
|
|
@@ -19524,7 +19524,7 @@ var require_dist2 = __commonJS({
|
|
|
19524
19524
|
if (tag !== 26) {
|
|
19525
19525
|
break;
|
|
19526
19526
|
}
|
|
19527
|
-
message.trackImage =
|
|
19527
|
+
message.trackImage = AgentResponse_TrackImage2.decode(reader, reader.uint32());
|
|
19528
19528
|
continue;
|
|
19529
19529
|
}
|
|
19530
19530
|
}
|
|
@@ -19539,7 +19539,7 @@ var require_dist2 = __commonJS({
|
|
|
19539
19539
|
return {
|
|
19540
19540
|
authenticated: isSet3(object.authenticated) ? AgentResponse_Authenticated.fromJSON(object.authenticated) : void 0,
|
|
19541
19541
|
trackData: isSet3(object.trackData) ? AgentResponse_TrackData2.fromJSON(object.trackData) : void 0,
|
|
19542
|
-
trackImage: isSet3(object.trackImage) ?
|
|
19542
|
+
trackImage: isSet3(object.trackImage) ? AgentResponse_TrackImage2.fromJSON(object.trackImage) : void 0
|
|
19543
19543
|
};
|
|
19544
19544
|
},
|
|
19545
19545
|
toJSON(message) {
|
|
@@ -19551,7 +19551,7 @@ var require_dist2 = __commonJS({
|
|
|
19551
19551
|
obj.trackData = AgentResponse_TrackData2.toJSON(message.trackData);
|
|
19552
19552
|
}
|
|
19553
19553
|
if (message.trackImage !== void 0) {
|
|
19554
|
-
obj.trackImage =
|
|
19554
|
+
obj.trackImage = AgentResponse_TrackImage2.toJSON(message.trackImage);
|
|
19555
19555
|
}
|
|
19556
19556
|
return obj;
|
|
19557
19557
|
},
|
|
@@ -19562,7 +19562,7 @@ var require_dist2 = __commonJS({
|
|
|
19562
19562
|
const message = createBaseAgentResponse();
|
|
19563
19563
|
message.authenticated = object.authenticated !== void 0 && object.authenticated !== null ? AgentResponse_Authenticated.fromPartial(object.authenticated) : void 0;
|
|
19564
19564
|
message.trackData = object.trackData !== void 0 && object.trackData !== null ? AgentResponse_TrackData2.fromPartial(object.trackData) : void 0;
|
|
19565
|
-
message.trackImage = object.trackImage !== void 0 && object.trackImage !== null ?
|
|
19565
|
+
message.trackImage = object.trackImage !== void 0 && object.trackImage !== null ? AgentResponse_TrackImage2.fromPartial(object.trackImage) : void 0;
|
|
19566
19566
|
return message;
|
|
19567
19567
|
}
|
|
19568
19568
|
};
|
|
@@ -19689,7 +19689,7 @@ var require_dist2 = __commonJS({
|
|
|
19689
19689
|
function createBaseAgentResponse_TrackImage() {
|
|
19690
19690
|
return { trackId: "", contentType: "", data: new Uint8Array(0) };
|
|
19691
19691
|
}
|
|
19692
|
-
var
|
|
19692
|
+
var AgentResponse_TrackImage2 = {
|
|
19693
19693
|
encode(message, writer = new BinaryWriter()) {
|
|
19694
19694
|
if (message.trackId !== "") {
|
|
19695
19695
|
writer.uint32(10).string(message.trackId);
|
|
@@ -19759,7 +19759,7 @@ var require_dist2 = __commonJS({
|
|
|
19759
19759
|
return obj;
|
|
19760
19760
|
},
|
|
19761
19761
|
create(base) {
|
|
19762
|
-
return
|
|
19762
|
+
return AgentResponse_TrackImage2.fromPartial(base ?? {});
|
|
19763
19763
|
},
|
|
19764
19764
|
fromPartial(object) {
|
|
19765
19765
|
const message = createBaseAgentResponse_TrackImage();
|
|
@@ -19942,7 +19942,7 @@ var FishjamWSNotifier = class extends import_events.EventEmitter {
|
|
|
19942
19942
|
var import_events2 = require("events");
|
|
19943
19943
|
var import_uuid = require("uuid");
|
|
19944
19944
|
var import_fishjam_proto2 = __toESM(require_dist2());
|
|
19945
|
-
var expectedEventsList2 = ["trackData"];
|
|
19945
|
+
var expectedEventsList2 = ["trackData", "trackImage"];
|
|
19946
19946
|
var FishjamAgent = class extends import_events2.EventEmitter {
|
|
19947
19947
|
client;
|
|
19948
19948
|
resolveConnectionPromise = null;
|
|
@@ -20008,6 +20008,13 @@ var FishjamAgent = class extends import_events2.EventEmitter {
|
|
|
20008
20008
|
const trackData = import_fishjam_proto2.AgentRequest.encode({ trackData: { trackId, data } }).finish();
|
|
20009
20009
|
this.client.send(trackData);
|
|
20010
20010
|
}
|
|
20011
|
+
/**
|
|
20012
|
+
* Request a captured image from the given track
|
|
20013
|
+
*/
|
|
20014
|
+
captureImage(trackId) {
|
|
20015
|
+
const msg = import_fishjam_proto2.AgentRequest.encode({ captureImage: { trackId } }).finish();
|
|
20016
|
+
this.client.send(msg);
|
|
20017
|
+
}
|
|
20011
20018
|
disconnect() {
|
|
20012
20019
|
this.client.close();
|
|
20013
20020
|
}
|
|
@@ -20076,7 +20083,7 @@ var mapException = (error, entity) => {
|
|
|
20076
20083
|
// package.json
|
|
20077
20084
|
var package_default = {
|
|
20078
20085
|
name: "@fishjam-cloud/js-server-sdk",
|
|
20079
|
-
version: "0.25.
|
|
20086
|
+
version: "0.25.2",
|
|
20080
20087
|
description: "Fishjam server SDK for JavaScript",
|
|
20081
20088
|
homepage: "https://github.com/fishjam-cloud/js-server-sdk",
|
|
20082
20089
|
author: "Fishjam Team",
|
|
@@ -20100,8 +20107,16 @@ var package_default = {
|
|
|
20100
20107
|
"dist"
|
|
20101
20108
|
],
|
|
20102
20109
|
exports: {
|
|
20103
|
-
".":
|
|
20104
|
-
|
|
20110
|
+
".": {
|
|
20111
|
+
types: "./dist/index.d.ts",
|
|
20112
|
+
import: "./dist/index.mjs",
|
|
20113
|
+
require: "./dist/index.js"
|
|
20114
|
+
},
|
|
20115
|
+
"./gemini": {
|
|
20116
|
+
types: "./dist/integrations/gemini.d.ts",
|
|
20117
|
+
import: "./dist/integrations/gemini.mjs",
|
|
20118
|
+
require: "./dist/integrations/gemini.js"
|
|
20119
|
+
}
|
|
20105
20120
|
},
|
|
20106
20121
|
scripts: {
|
|
20107
20122
|
build: "tsup --dts-resolve",
|
|
@@ -20153,7 +20168,7 @@ var package_default = {
|
|
|
20153
20168
|
},
|
|
20154
20169
|
"lint-staged": {
|
|
20155
20170
|
"*.{js,ts,tsx,mjs,cjs}": [
|
|
20156
|
-
"eslint --fix --config
|
|
20171
|
+
"eslint --fix --config eslint.config.mjs"
|
|
20157
20172
|
]
|
|
20158
20173
|
}
|
|
20159
20174
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
__require,
|
|
4
4
|
__toESM,
|
|
5
5
|
package_default
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ZXWNCWEY.mjs";
|
|
7
7
|
|
|
8
8
|
// ../fishjam-openapi/dist/index.js
|
|
9
9
|
var require_dist = __commonJS({
|
|
@@ -15454,7 +15454,7 @@ var require_dist2 = __commonJS({
|
|
|
15454
15454
|
AgentResponse: () => AgentResponse2,
|
|
15455
15455
|
AgentResponse_Authenticated: () => AgentResponse_Authenticated,
|
|
15456
15456
|
AgentResponse_TrackData: () => AgentResponse_TrackData2,
|
|
15457
|
-
AgentResponse_TrackImage: () =>
|
|
15457
|
+
AgentResponse_TrackImage: () => AgentResponse_TrackImage2,
|
|
15458
15458
|
ServerMessage: () => ServerMessage3,
|
|
15459
15459
|
ServerMessage_AuthRequest: () => ServerMessage_AuthRequest,
|
|
15460
15460
|
ServerMessage_Authenticated: () => ServerMessage_Authenticated,
|
|
@@ -19470,7 +19470,7 @@ var require_dist2 = __commonJS({
|
|
|
19470
19470
|
AgentResponse_TrackData2.encode(message.trackData, writer.uint32(18).fork()).join();
|
|
19471
19471
|
}
|
|
19472
19472
|
if (message.trackImage !== void 0) {
|
|
19473
|
-
|
|
19473
|
+
AgentResponse_TrackImage2.encode(message.trackImage, writer.uint32(26).fork()).join();
|
|
19474
19474
|
}
|
|
19475
19475
|
return writer;
|
|
19476
19476
|
},
|
|
@@ -19499,7 +19499,7 @@ var require_dist2 = __commonJS({
|
|
|
19499
19499
|
if (tag !== 26) {
|
|
19500
19500
|
break;
|
|
19501
19501
|
}
|
|
19502
|
-
message.trackImage =
|
|
19502
|
+
message.trackImage = AgentResponse_TrackImage2.decode(reader, reader.uint32());
|
|
19503
19503
|
continue;
|
|
19504
19504
|
}
|
|
19505
19505
|
}
|
|
@@ -19514,7 +19514,7 @@ var require_dist2 = __commonJS({
|
|
|
19514
19514
|
return {
|
|
19515
19515
|
authenticated: isSet3(object.authenticated) ? AgentResponse_Authenticated.fromJSON(object.authenticated) : void 0,
|
|
19516
19516
|
trackData: isSet3(object.trackData) ? AgentResponse_TrackData2.fromJSON(object.trackData) : void 0,
|
|
19517
|
-
trackImage: isSet3(object.trackImage) ?
|
|
19517
|
+
trackImage: isSet3(object.trackImage) ? AgentResponse_TrackImage2.fromJSON(object.trackImage) : void 0
|
|
19518
19518
|
};
|
|
19519
19519
|
},
|
|
19520
19520
|
toJSON(message) {
|
|
@@ -19526,7 +19526,7 @@ var require_dist2 = __commonJS({
|
|
|
19526
19526
|
obj.trackData = AgentResponse_TrackData2.toJSON(message.trackData);
|
|
19527
19527
|
}
|
|
19528
19528
|
if (message.trackImage !== void 0) {
|
|
19529
|
-
obj.trackImage =
|
|
19529
|
+
obj.trackImage = AgentResponse_TrackImage2.toJSON(message.trackImage);
|
|
19530
19530
|
}
|
|
19531
19531
|
return obj;
|
|
19532
19532
|
},
|
|
@@ -19537,7 +19537,7 @@ var require_dist2 = __commonJS({
|
|
|
19537
19537
|
const message = createBaseAgentResponse();
|
|
19538
19538
|
message.authenticated = object.authenticated !== void 0 && object.authenticated !== null ? AgentResponse_Authenticated.fromPartial(object.authenticated) : void 0;
|
|
19539
19539
|
message.trackData = object.trackData !== void 0 && object.trackData !== null ? AgentResponse_TrackData2.fromPartial(object.trackData) : void 0;
|
|
19540
|
-
message.trackImage = object.trackImage !== void 0 && object.trackImage !== null ?
|
|
19540
|
+
message.trackImage = object.trackImage !== void 0 && object.trackImage !== null ? AgentResponse_TrackImage2.fromPartial(object.trackImage) : void 0;
|
|
19541
19541
|
return message;
|
|
19542
19542
|
}
|
|
19543
19543
|
};
|
|
@@ -19664,7 +19664,7 @@ var require_dist2 = __commonJS({
|
|
|
19664
19664
|
function createBaseAgentResponse_TrackImage() {
|
|
19665
19665
|
return { trackId: "", contentType: "", data: new Uint8Array(0) };
|
|
19666
19666
|
}
|
|
19667
|
-
var
|
|
19667
|
+
var AgentResponse_TrackImage2 = {
|
|
19668
19668
|
encode(message, writer = new BinaryWriter()) {
|
|
19669
19669
|
if (message.trackId !== "") {
|
|
19670
19670
|
writer.uint32(10).string(message.trackId);
|
|
@@ -19734,7 +19734,7 @@ var require_dist2 = __commonJS({
|
|
|
19734
19734
|
return obj;
|
|
19735
19735
|
},
|
|
19736
19736
|
create(base) {
|
|
19737
|
-
return
|
|
19737
|
+
return AgentResponse_TrackImage2.fromPartial(base ?? {});
|
|
19738
19738
|
},
|
|
19739
19739
|
fromPartial(object) {
|
|
19740
19740
|
const message = createBaseAgentResponse_TrackImage();
|
|
@@ -19890,7 +19890,7 @@ var FishjamWSNotifier = class extends EventEmitter {
|
|
|
19890
19890
|
var import_fishjam_proto2 = __toESM(require_dist2());
|
|
19891
19891
|
import { EventEmitter as EventEmitter2 } from "events";
|
|
19892
19892
|
import { v4 as uuid4 } from "uuid";
|
|
19893
|
-
var expectedEventsList2 = ["trackData"];
|
|
19893
|
+
var expectedEventsList2 = ["trackData", "trackImage"];
|
|
19894
19894
|
var FishjamAgent = class extends EventEmitter2 {
|
|
19895
19895
|
client;
|
|
19896
19896
|
resolveConnectionPromise = null;
|
|
@@ -19956,6 +19956,13 @@ var FishjamAgent = class extends EventEmitter2 {
|
|
|
19956
19956
|
const trackData = import_fishjam_proto2.AgentRequest.encode({ trackData: { trackId, data } }).finish();
|
|
19957
19957
|
this.client.send(trackData);
|
|
19958
19958
|
}
|
|
19959
|
+
/**
|
|
19960
|
+
* Request a captured image from the given track
|
|
19961
|
+
*/
|
|
19962
|
+
captureImage(trackId) {
|
|
19963
|
+
const msg = import_fishjam_proto2.AgentRequest.encode({ captureImage: { trackId } }).finish();
|
|
19964
|
+
this.client.send(msg);
|
|
19965
|
+
}
|
|
19959
19966
|
disconnect() {
|
|
19960
19967
|
this.client.close();
|
|
19961
19968
|
}
|
|
@@ -1,39 +1,34 @@
|
|
|
1
1
|
import { GoogleGenAIOptions, GoogleGenAI } from '@google/genai';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Creates a GoogleGenAI client.
|
|
5
|
+
* This function dynamically loads the "@google/genai" module,
|
|
6
|
+
* so it will only be loaded when this function is called.
|
|
7
|
+
*
|
|
8
|
+
* @param options Configuration for the GoogleGenAI client.
|
|
9
|
+
* @returns A GoogleGenAI instance.
|
|
5
10
|
*/
|
|
6
|
-
declare const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
createClient: (options: GoogleGenAIOptions) => GoogleGenAI;
|
|
16
|
-
/**
|
|
17
|
-
* Predefined audio settings for the agent's output track,
|
|
18
|
-
* configured for Gemini's 24kHz audio output.
|
|
19
|
-
*/
|
|
20
|
-
geminiOutputAudioSettings: {
|
|
21
|
-
readonly encoding: "pcm16";
|
|
22
|
-
readonly channels: 1;
|
|
23
|
-
readonly sampleRate: 24000;
|
|
24
|
-
};
|
|
25
|
-
/**
|
|
26
|
-
* Predefined audio settings for subscribing to room audio,
|
|
27
|
-
* configured for Gemini's 16kHz audio input.
|
|
28
|
-
*/
|
|
29
|
-
geminiInputAudioSettings: {
|
|
30
|
-
readonly audioFormat: "pcm16";
|
|
31
|
-
readonly audioSampleRate: 16000;
|
|
32
|
-
};
|
|
33
|
-
/**
|
|
34
|
-
* The MIME type for the audio data sent to Gemini.
|
|
35
|
-
*/
|
|
36
|
-
inputMimeType: "audio/pcm;rate=16000";
|
|
11
|
+
declare const createClient: (options: GoogleGenAIOptions) => GoogleGenAI;
|
|
12
|
+
/**
|
|
13
|
+
* Predefined audio settings for the agent's output track,
|
|
14
|
+
* configured for Gemini's 24kHz audio output.
|
|
15
|
+
*/
|
|
16
|
+
declare const geminiOutputAudioSettings: {
|
|
17
|
+
readonly encoding: "pcm16";
|
|
18
|
+
readonly channels: 1;
|
|
19
|
+
readonly sampleRate: 24000;
|
|
37
20
|
};
|
|
21
|
+
/**
|
|
22
|
+
* Predefined audio settings for subscribing to room audio,
|
|
23
|
+
* configured for Gemini's 16kHz audio input.
|
|
24
|
+
*/
|
|
25
|
+
declare const geminiInputAudioSettings: {
|
|
26
|
+
readonly audioFormat: "pcm16";
|
|
27
|
+
readonly audioSampleRate: 16000;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* The MIME type for the audio data sent to Gemini.
|
|
31
|
+
*/
|
|
32
|
+
declare const inputMimeType: "audio/pcm;rate=16000";
|
|
38
33
|
|
|
39
|
-
export {
|
|
34
|
+
export { createClient, geminiInputAudioSettings, geminiOutputAudioSettings, inputMimeType };
|
|
@@ -1,39 +1,34 @@
|
|
|
1
1
|
import { GoogleGenAIOptions, GoogleGenAI } from '@google/genai';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Creates a GoogleGenAI client.
|
|
5
|
+
* This function dynamically loads the "@google/genai" module,
|
|
6
|
+
* so it will only be loaded when this function is called.
|
|
7
|
+
*
|
|
8
|
+
* @param options Configuration for the GoogleGenAI client.
|
|
9
|
+
* @returns A GoogleGenAI instance.
|
|
5
10
|
*/
|
|
6
|
-
declare const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
createClient: (options: GoogleGenAIOptions) => GoogleGenAI;
|
|
16
|
-
/**
|
|
17
|
-
* Predefined audio settings for the agent's output track,
|
|
18
|
-
* configured for Gemini's 24kHz audio output.
|
|
19
|
-
*/
|
|
20
|
-
geminiOutputAudioSettings: {
|
|
21
|
-
readonly encoding: "pcm16";
|
|
22
|
-
readonly channels: 1;
|
|
23
|
-
readonly sampleRate: 24000;
|
|
24
|
-
};
|
|
25
|
-
/**
|
|
26
|
-
* Predefined audio settings for subscribing to room audio,
|
|
27
|
-
* configured for Gemini's 16kHz audio input.
|
|
28
|
-
*/
|
|
29
|
-
geminiInputAudioSettings: {
|
|
30
|
-
readonly audioFormat: "pcm16";
|
|
31
|
-
readonly audioSampleRate: 16000;
|
|
32
|
-
};
|
|
33
|
-
/**
|
|
34
|
-
* The MIME type for the audio data sent to Gemini.
|
|
35
|
-
*/
|
|
36
|
-
inputMimeType: "audio/pcm;rate=16000";
|
|
11
|
+
declare const createClient: (options: GoogleGenAIOptions) => GoogleGenAI;
|
|
12
|
+
/**
|
|
13
|
+
* Predefined audio settings for the agent's output track,
|
|
14
|
+
* configured for Gemini's 24kHz audio output.
|
|
15
|
+
*/
|
|
16
|
+
declare const geminiOutputAudioSettings: {
|
|
17
|
+
readonly encoding: "pcm16";
|
|
18
|
+
readonly channels: 1;
|
|
19
|
+
readonly sampleRate: 24000;
|
|
37
20
|
};
|
|
21
|
+
/**
|
|
22
|
+
* Predefined audio settings for subscribing to room audio,
|
|
23
|
+
* configured for Gemini's 16kHz audio input.
|
|
24
|
+
*/
|
|
25
|
+
declare const geminiInputAudioSettings: {
|
|
26
|
+
readonly audioFormat: "pcm16";
|
|
27
|
+
readonly audioSampleRate: 16000;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* The MIME type for the audio data sent to Gemini.
|
|
31
|
+
*/
|
|
32
|
+
declare const inputMimeType: "audio/pcm;rate=16000";
|
|
38
33
|
|
|
39
|
-
export {
|
|
34
|
+
export { createClient, geminiInputAudioSettings, geminiOutputAudioSettings, inputMimeType };
|
|
@@ -20,14 +20,17 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// src/integrations/gemini.ts
|
|
21
21
|
var gemini_exports = {};
|
|
22
22
|
__export(gemini_exports, {
|
|
23
|
-
|
|
23
|
+
createClient: () => createClient,
|
|
24
|
+
geminiInputAudioSettings: () => geminiInputAudioSettings,
|
|
25
|
+
geminiOutputAudioSettings: () => geminiOutputAudioSettings,
|
|
26
|
+
inputMimeType: () => inputMimeType
|
|
24
27
|
});
|
|
25
28
|
module.exports = __toCommonJS(gemini_exports);
|
|
26
29
|
|
|
27
30
|
// package.json
|
|
28
31
|
var package_default = {
|
|
29
32
|
name: "@fishjam-cloud/js-server-sdk",
|
|
30
|
-
version: "0.25.
|
|
33
|
+
version: "0.25.2",
|
|
31
34
|
description: "Fishjam server SDK for JavaScript",
|
|
32
35
|
homepage: "https://github.com/fishjam-cloud/js-server-sdk",
|
|
33
36
|
author: "Fishjam Team",
|
|
@@ -51,8 +54,16 @@ var package_default = {
|
|
|
51
54
|
"dist"
|
|
52
55
|
],
|
|
53
56
|
exports: {
|
|
54
|
-
".":
|
|
55
|
-
|
|
57
|
+
".": {
|
|
58
|
+
types: "./dist/index.d.ts",
|
|
59
|
+
import: "./dist/index.mjs",
|
|
60
|
+
require: "./dist/index.js"
|
|
61
|
+
},
|
|
62
|
+
"./gemini": {
|
|
63
|
+
types: "./dist/integrations/gemini.d.ts",
|
|
64
|
+
import: "./dist/integrations/gemini.mjs",
|
|
65
|
+
require: "./dist/integrations/gemini.js"
|
|
66
|
+
}
|
|
56
67
|
},
|
|
57
68
|
scripts: {
|
|
58
69
|
build: "tsup --dts-resolve",
|
|
@@ -104,56 +115,42 @@ var package_default = {
|
|
|
104
115
|
},
|
|
105
116
|
"lint-staged": {
|
|
106
117
|
"*.{js,ts,tsx,mjs,cjs}": [
|
|
107
|
-
"eslint --fix --config
|
|
118
|
+
"eslint --fix --config eslint.config.mjs"
|
|
108
119
|
]
|
|
109
120
|
}
|
|
110
121
|
};
|
|
111
122
|
|
|
112
123
|
// src/integrations/gemini.ts
|
|
113
124
|
var SDK_NAME = "fishjam-js-server-sdk";
|
|
114
|
-
var
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
const { GoogleGenAI } = require("@google/genai");
|
|
125
|
-
const trackingHeader = { "X-Goog-Api-Client": `${SDK_NAME}/${package_default.version}` };
|
|
126
|
-
const finalOptions = {
|
|
127
|
-
...options,
|
|
128
|
-
httpOptions: {
|
|
129
|
-
...options.httpOptions,
|
|
130
|
-
headers: {
|
|
131
|
-
...options.httpOptions?.headers,
|
|
132
|
-
...trackingHeader
|
|
133
|
-
}
|
|
125
|
+
var createClient = (options) => {
|
|
126
|
+
const { GoogleGenAI } = require("@google/genai");
|
|
127
|
+
const trackingHeader = { "X-Goog-Api-Client": `${SDK_NAME}/${package_default.version}` };
|
|
128
|
+
const finalOptions = {
|
|
129
|
+
...options,
|
|
130
|
+
httpOptions: {
|
|
131
|
+
...options.httpOptions,
|
|
132
|
+
headers: {
|
|
133
|
+
...options.httpOptions?.headers,
|
|
134
|
+
...trackingHeader
|
|
134
135
|
}
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
encoding: "pcm16",
|
|
144
|
-
channels: 1,
|
|
145
|
-
sampleRate: 24e3
|
|
146
|
-
},
|
|
147
|
-
/**
|
|
148
|
-
* Predefined audio settings for subscribing to room audio,
|
|
149
|
-
* configured for Gemini's 16kHz audio input.
|
|
150
|
-
*/
|
|
151
|
-
geminiInputAudioSettings: {
|
|
152
|
-
audioFormat: "pcm16",
|
|
153
|
-
audioSampleRate: 16e3
|
|
154
|
-
},
|
|
155
|
-
/**
|
|
156
|
-
* The MIME type for the audio data sent to Gemini.
|
|
157
|
-
*/
|
|
158
|
-
inputMimeType: "audio/pcm;rate=16000"
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
return new GoogleGenAI(finalOptions);
|
|
139
|
+
};
|
|
140
|
+
var geminiOutputAudioSettings = {
|
|
141
|
+
encoding: "pcm16",
|
|
142
|
+
channels: 1,
|
|
143
|
+
sampleRate: 24e3
|
|
159
144
|
};
|
|
145
|
+
var geminiInputAudioSettings = {
|
|
146
|
+
audioFormat: "pcm16",
|
|
147
|
+
audioSampleRate: 16e3
|
|
148
|
+
};
|
|
149
|
+
var inputMimeType = "audio/pcm;rate=16000";
|
|
150
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
151
|
+
0 && (module.exports = {
|
|
152
|
+
createClient,
|
|
153
|
+
geminiInputAudioSettings,
|
|
154
|
+
geminiOutputAudioSettings,
|
|
155
|
+
inputMimeType
|
|
156
|
+
});
|
|
@@ -1,56 +1,38 @@
|
|
|
1
1
|
import {
|
|
2
2
|
__require,
|
|
3
3
|
package_default
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-ZXWNCWEY.mjs";
|
|
5
5
|
|
|
6
6
|
// src/integrations/gemini.ts
|
|
7
7
|
var SDK_NAME = "fishjam-js-server-sdk";
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const { GoogleGenAI } = __require("@google/genai");
|
|
19
|
-
const trackingHeader = { "X-Goog-Api-Client": `${SDK_NAME}/${package_default.version}` };
|
|
20
|
-
const finalOptions = {
|
|
21
|
-
...options,
|
|
22
|
-
httpOptions: {
|
|
23
|
-
...options.httpOptions,
|
|
24
|
-
headers: {
|
|
25
|
-
...options.httpOptions?.headers,
|
|
26
|
-
...trackingHeader
|
|
27
|
-
}
|
|
8
|
+
var createClient = (options) => {
|
|
9
|
+
const { GoogleGenAI } = __require("@google/genai");
|
|
10
|
+
const trackingHeader = { "X-Goog-Api-Client": `${SDK_NAME}/${package_default.version}` };
|
|
11
|
+
const finalOptions = {
|
|
12
|
+
...options,
|
|
13
|
+
httpOptions: {
|
|
14
|
+
...options.httpOptions,
|
|
15
|
+
headers: {
|
|
16
|
+
...options.httpOptions?.headers,
|
|
17
|
+
...trackingHeader
|
|
28
18
|
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Predefined audio settings for the agent's output track,
|
|
34
|
-
* configured for Gemini's 24kHz audio output.
|
|
35
|
-
*/
|
|
36
|
-
geminiOutputAudioSettings: {
|
|
37
|
-
encoding: "pcm16",
|
|
38
|
-
channels: 1,
|
|
39
|
-
sampleRate: 24e3
|
|
40
|
-
},
|
|
41
|
-
/**
|
|
42
|
-
* Predefined audio settings for subscribing to room audio,
|
|
43
|
-
* configured for Gemini's 16kHz audio input.
|
|
44
|
-
*/
|
|
45
|
-
geminiInputAudioSettings: {
|
|
46
|
-
audioFormat: "pcm16",
|
|
47
|
-
audioSampleRate: 16e3
|
|
48
|
-
},
|
|
49
|
-
/**
|
|
50
|
-
* The MIME type for the audio data sent to Gemini.
|
|
51
|
-
*/
|
|
52
|
-
inputMimeType: "audio/pcm;rate=16000"
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
return new GoogleGenAI(finalOptions);
|
|
53
22
|
};
|
|
23
|
+
var geminiOutputAudioSettings = {
|
|
24
|
+
encoding: "pcm16",
|
|
25
|
+
channels: 1,
|
|
26
|
+
sampleRate: 24e3
|
|
27
|
+
};
|
|
28
|
+
var geminiInputAudioSettings = {
|
|
29
|
+
audioFormat: "pcm16",
|
|
30
|
+
audioSampleRate: 16e3
|
|
31
|
+
};
|
|
32
|
+
var inputMimeType = "audio/pcm;rate=16000";
|
|
54
33
|
export {
|
|
55
|
-
|
|
34
|
+
createClient,
|
|
35
|
+
geminiInputAudioSettings,
|
|
36
|
+
geminiOutputAudioSettings,
|
|
37
|
+
inputMimeType
|
|
56
38
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fishjam-cloud/js-server-sdk",
|
|
3
|
-
"version": "0.25.
|
|
3
|
+
"version": "0.25.2",
|
|
4
4
|
"description": "Fishjam server SDK for JavaScript",
|
|
5
5
|
"homepage": "https://github.com/fishjam-cloud/js-server-sdk",
|
|
6
6
|
"author": "Fishjam Team",
|
|
@@ -24,8 +24,16 @@
|
|
|
24
24
|
"dist"
|
|
25
25
|
],
|
|
26
26
|
"exports": {
|
|
27
|
-
".":
|
|
28
|
-
|
|
27
|
+
".": {
|
|
28
|
+
"types": "./dist/index.d.ts",
|
|
29
|
+
"import": "./dist/index.mjs",
|
|
30
|
+
"require": "./dist/index.js"
|
|
31
|
+
},
|
|
32
|
+
"./gemini": {
|
|
33
|
+
"types": "./dist/integrations/gemini.d.ts",
|
|
34
|
+
"import": "./dist/integrations/gemini.mjs",
|
|
35
|
+
"require": "./dist/integrations/gemini.js"
|
|
36
|
+
}
|
|
29
37
|
},
|
|
30
38
|
"scripts": {
|
|
31
39
|
"build": "tsup --dts-resolve",
|
|
@@ -65,8 +73,8 @@
|
|
|
65
73
|
}
|
|
66
74
|
},
|
|
67
75
|
"devDependencies": {
|
|
68
|
-
"@fishjam-cloud/fishjam-openapi": "
|
|
69
|
-
"@fishjam-cloud/fishjam-proto": "
|
|
76
|
+
"@fishjam-cloud/fishjam-openapi": "workspace:*",
|
|
77
|
+
"@fishjam-cloud/fishjam-proto": "workspace:*",
|
|
70
78
|
"@openapitools/openapi-generator-cli": "^2.18.4",
|
|
71
79
|
"@types/node": "^22.13.16",
|
|
72
80
|
"@types/websocket": "^1.0.10",
|
|
@@ -77,7 +85,7 @@
|
|
|
77
85
|
},
|
|
78
86
|
"lint-staged": {
|
|
79
87
|
"*.{js,ts,tsx,mjs,cjs}": [
|
|
80
|
-
"eslint --fix --config
|
|
88
|
+
"eslint --fix --config eslint.config.mjs"
|
|
81
89
|
]
|
|
82
90
|
}
|
|
83
|
-
}
|
|
91
|
+
}
|