@fishjam-cloud/js-server-sdk 0.25.2 → 0.25.4

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.
@@ -1,39 +1,7 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
8
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
9
- }) : x)(function(x) {
10
- if (typeof require !== "undefined") return require.apply(this, arguments);
11
- throw Error('Dynamic require of "' + x + '" is not supported');
12
- });
13
- var __commonJS = (cb, mod) => function __require2() {
14
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
15
- };
16
- var __copyProps = (to, from, except, desc) => {
17
- if (from && typeof from === "object" || typeof from === "function") {
18
- for (let key of __getOwnPropNames(from))
19
- if (!__hasOwnProp.call(to, key) && key !== except)
20
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
21
- }
22
- return to;
23
- };
24
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
25
- // If the importer is in node compatibility mode or this is not an ESM
26
- // file that has been converted to a CommonJS file using a Babel-
27
- // compatible transform (i.e. "__esModule" has not been set), then set
28
- // "default" to the CommonJS "module.exports" for node compatibility.
29
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
30
- mod
31
- ));
32
-
33
1
  // package.json
34
2
  var package_default = {
35
3
  name: "@fishjam-cloud/js-server-sdk",
36
- version: "0.25.2",
4
+ version: "0.25.4",
37
5
  description: "Fishjam server SDK for JavaScript",
38
6
  homepage: "https://github.com/fishjam-cloud/js-server-sdk",
39
7
  author: "Fishjam Team",
@@ -124,8 +92,5 @@ var package_default = {
124
92
  };
125
93
 
126
94
  export {
127
- __require,
128
- __commonJS,
129
- __toESM,
130
95
  package_default
131
96
  };
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { BinaryWriter, BinaryReader } from '@bufbuild/protobuf/wire';
2
- import axios from 'axios';
2
+ import { AxiosError } from 'axios';
3
3
 
4
4
  /**
5
5
  * Output audio options
@@ -759,7 +759,7 @@ declare class FishjamWSNotifier extends FishjamWSNotifier_base {
759
759
  private isExpectedEvent;
760
760
  }
761
761
 
762
- declare const expectedEventsList: readonly ["trackData", "trackImage"];
762
+ declare const expectedEventsList: readonly ["trackData"];
763
763
  /**
764
764
  * @useDeclaredType
765
765
  */
@@ -793,6 +793,7 @@ declare class FishjamAgent extends FishjamAgent_base {
793
793
  private readonly client;
794
794
  private resolveConnectionPromise;
795
795
  private readonly connectionPromise;
796
+ private readonly pendingImageCaptures;
796
797
  constructor(config: FishjamConfig, agentToken: string, callbacks?: AgentCallbacks);
797
798
  /**
798
799
  * Await Agent connection to Fishjam.
@@ -822,9 +823,14 @@ declare class FishjamAgent extends FishjamAgent_base {
822
823
  sendData(trackId: TrackId, data: Uint8Array): void;
823
824
  /**
824
825
  * Request a captured image from the given track
826
+ * @param trackId - the track to capture an image from
827
+ * @param timeoutMs - timeout in milliseconds (default: 5000)
828
+ * @returns a promise that resolves with the captured image data
825
829
  */
826
- captureImage(trackId: TrackId): void;
830
+ captureImage(trackId: TrackId, timeoutMs?: number): Promise<IncomingTrackImage>;
827
831
  disconnect(): void;
832
+ private handleTrackImageMessage;
833
+ private rejectPendingCaptures;
828
834
  private dispatchNotification;
829
835
  private setupConnection;
830
836
  private isExpectedEvent;
@@ -923,7 +929,7 @@ declare class FishjamBaseException extends Error {
923
929
  statusCode: number;
924
930
  axiosCode?: string;
925
931
  details?: string;
926
- constructor(error: axios.AxiosError<Record<string, string>>);
932
+ constructor(error: AxiosError<Record<string, string>>);
927
933
  }
928
934
  declare class BadRequestException extends FishjamBaseException {
929
935
  }
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { BinaryWriter, BinaryReader } from '@bufbuild/protobuf/wire';
2
- import axios from 'axios';
2
+ import { AxiosError } from 'axios';
3
3
 
4
4
  /**
5
5
  * Output audio options
@@ -759,7 +759,7 @@ declare class FishjamWSNotifier extends FishjamWSNotifier_base {
759
759
  private isExpectedEvent;
760
760
  }
761
761
 
762
- declare const expectedEventsList: readonly ["trackData", "trackImage"];
762
+ declare const expectedEventsList: readonly ["trackData"];
763
763
  /**
764
764
  * @useDeclaredType
765
765
  */
@@ -793,6 +793,7 @@ declare class FishjamAgent extends FishjamAgent_base {
793
793
  private readonly client;
794
794
  private resolveConnectionPromise;
795
795
  private readonly connectionPromise;
796
+ private readonly pendingImageCaptures;
796
797
  constructor(config: FishjamConfig, agentToken: string, callbacks?: AgentCallbacks);
797
798
  /**
798
799
  * Await Agent connection to Fishjam.
@@ -822,9 +823,14 @@ declare class FishjamAgent extends FishjamAgent_base {
822
823
  sendData(trackId: TrackId, data: Uint8Array): void;
823
824
  /**
824
825
  * Request a captured image from the given track
826
+ * @param trackId - the track to capture an image from
827
+ * @param timeoutMs - timeout in milliseconds (default: 5000)
828
+ * @returns a promise that resolves with the captured image data
825
829
  */
826
- captureImage(trackId: TrackId): void;
830
+ captureImage(trackId: TrackId, timeoutMs?: number): Promise<IncomingTrackImage>;
827
831
  disconnect(): void;
832
+ private handleTrackImageMessage;
833
+ private rejectPendingCaptures;
828
834
  private dispatchNotification;
829
835
  private setupConnection;
830
836
  private isExpectedEvent;
@@ -923,7 +929,7 @@ declare class FishjamBaseException extends Error {
923
929
  statusCode: number;
924
930
  axiosCode?: string;
925
931
  details?: string;
926
- constructor(error: axios.AxiosError<Record<string, string>>);
932
+ constructor(error: AxiosError<Record<string, string>>);
927
933
  }
928
934
  declare class BadRequestException extends FishjamBaseException {
929
935
  }