@fishjam-cloud/js-server-sdk 0.25.1 → 0.25.3

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,35 @@
1
1
  import { GoogleGenAIOptions, GoogleGenAI } from '@google/genai';
2
2
 
3
3
  /**
4
- * A collection of settings for Google Gemini integration.
4
+ * Creates a GoogleGenAI client.
5
+ *
6
+ * This module is a separate entry point (`@fishjam-cloud/js-server-sdk/gemini`),
7
+ * so `@google/genai` is only loaded when the consumer imports this module.
8
+ *
9
+ * @param options Configuration for the GoogleGenAI client.
10
+ * @returns A GoogleGenAI instance.
5
11
  */
6
- declare const _default: {
7
- /**
8
- * Creates a GoogleGenAI client.
9
- * This function dynamically imports the "@google/genai" module,
10
- * so it will only be loaded when this function is called.
11
- *
12
- * @param options Configuration for the GoogleGenAI client.
13
- * @returns A GoogleGenAI instance.
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";
12
+ declare const createClient: (options: GoogleGenAIOptions) => GoogleGenAI;
13
+ /**
14
+ * Predefined audio settings for the agent's output track,
15
+ * configured for Gemini's 24kHz audio output.
16
+ */
17
+ declare const geminiOutputAudioSettings: {
18
+ readonly encoding: "pcm16";
19
+ readonly channels: 1;
20
+ readonly sampleRate: 24000;
37
21
  };
22
+ /**
23
+ * Predefined audio settings for subscribing to room audio,
24
+ * configured for Gemini's 16kHz audio input.
25
+ */
26
+ declare const geminiInputAudioSettings: {
27
+ readonly audioFormat: "pcm16";
28
+ readonly audioSampleRate: 16000;
29
+ };
30
+ /**
31
+ * The MIME type for the audio data sent to Gemini.
32
+ */
33
+ declare const inputMimeType: "audio/pcm;rate=16000";
38
34
 
39
- export { _default as default };
35
+ export { createClient, geminiInputAudioSettings, geminiOutputAudioSettings, inputMimeType };
@@ -1,39 +1,35 @@
1
1
  import { GoogleGenAIOptions, GoogleGenAI } from '@google/genai';
2
2
 
3
3
  /**
4
- * A collection of settings for Google Gemini integration.
4
+ * Creates a GoogleGenAI client.
5
+ *
6
+ * This module is a separate entry point (`@fishjam-cloud/js-server-sdk/gemini`),
7
+ * so `@google/genai` is only loaded when the consumer imports this module.
8
+ *
9
+ * @param options Configuration for the GoogleGenAI client.
10
+ * @returns A GoogleGenAI instance.
5
11
  */
6
- declare const _default: {
7
- /**
8
- * Creates a GoogleGenAI client.
9
- * This function dynamically imports the "@google/genai" module,
10
- * so it will only be loaded when this function is called.
11
- *
12
- * @param options Configuration for the GoogleGenAI client.
13
- * @returns A GoogleGenAI instance.
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";
12
+ declare const createClient: (options: GoogleGenAIOptions) => GoogleGenAI;
13
+ /**
14
+ * Predefined audio settings for the agent's output track,
15
+ * configured for Gemini's 24kHz audio output.
16
+ */
17
+ declare const geminiOutputAudioSettings: {
18
+ readonly encoding: "pcm16";
19
+ readonly channels: 1;
20
+ readonly sampleRate: 24000;
37
21
  };
22
+ /**
23
+ * Predefined audio settings for subscribing to room audio,
24
+ * configured for Gemini's 16kHz audio input.
25
+ */
26
+ declare const geminiInputAudioSettings: {
27
+ readonly audioFormat: "pcm16";
28
+ readonly audioSampleRate: 16000;
29
+ };
30
+ /**
31
+ * The MIME type for the audio data sent to Gemini.
32
+ */
33
+ declare const inputMimeType: "audio/pcm;rate=16000";
38
34
 
39
- export { _default as default };
35
+ export { createClient, geminiInputAudioSettings, geminiOutputAudioSettings, inputMimeType };
@@ -20,14 +20,18 @@ 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
- default: () => gemini_default
23
+ createClient: () => createClient,
24
+ geminiInputAudioSettings: () => geminiInputAudioSettings,
25
+ geminiOutputAudioSettings: () => geminiOutputAudioSettings,
26
+ inputMimeType: () => inputMimeType
24
27
  });
25
28
  module.exports = __toCommonJS(gemini_exports);
29
+ var import_genai = require("@google/genai");
26
30
 
27
31
  // package.json
28
32
  var package_default = {
29
33
  name: "@fishjam-cloud/js-server-sdk",
30
- version: "0.25.1",
34
+ version: "0.25.3",
31
35
  description: "Fishjam server SDK for JavaScript",
32
36
  homepage: "https://github.com/fishjam-cloud/js-server-sdk",
33
37
  author: "Fishjam Team",
@@ -51,8 +55,16 @@ var package_default = {
51
55
  "dist"
52
56
  ],
53
57
  exports: {
54
- ".": "./dist/index.js",
55
- "./gemini": "./dist/integrations/gemini.js"
58
+ ".": {
59
+ types: "./dist/index.d.ts",
60
+ import: "./dist/index.mjs",
61
+ require: "./dist/index.js"
62
+ },
63
+ "./gemini": {
64
+ types: "./dist/integrations/gemini.d.ts",
65
+ import: "./dist/integrations/gemini.mjs",
66
+ require: "./dist/integrations/gemini.js"
67
+ }
56
68
  },
57
69
  scripts: {
58
70
  build: "tsup --dts-resolve",
@@ -104,56 +116,41 @@ var package_default = {
104
116
  },
105
117
  "lint-staged": {
106
118
  "*.{js,ts,tsx,mjs,cjs}": [
107
- "eslint --fix --config packages/js-server-sdk/eslint.config.mjs"
119
+ "eslint --fix --config eslint.config.mjs"
108
120
  ]
109
121
  }
110
122
  };
111
123
 
112
124
  // src/integrations/gemini.ts
113
125
  var SDK_NAME = "fishjam-js-server-sdk";
114
- var gemini_default = {
115
- /**
116
- * Creates a GoogleGenAI client.
117
- * This function dynamically imports the "@google/genai" module,
118
- * so it will only be loaded when this function is called.
119
- *
120
- * @param options Configuration for the GoogleGenAI client.
121
- * @returns A GoogleGenAI instance.
122
- */
123
- createClient: (options) => {
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
- }
126
+ var createClient = (options) => {
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
- return new GoogleGenAI(finalOptions);
137
- },
138
- /**
139
- * Predefined audio settings for the agent's output track,
140
- * configured for Gemini's 24kHz audio output.
141
- */
142
- geminiOutputAudioSettings: {
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 import_genai.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,37 @@
1
1
  import {
2
- __require,
3
2
  package_default
4
- } from "../chunk-LWFSVLXM.mjs";
3
+ } from "../chunk-4UDMIEMT.mjs";
5
4
 
6
5
  // src/integrations/gemini.ts
6
+ import { GoogleGenAI } from "@google/genai";
7
7
  var SDK_NAME = "fishjam-js-server-sdk";
8
- var gemini_default = {
9
- /**
10
- * Creates a GoogleGenAI client.
11
- * This function dynamically imports the "@google/genai" module,
12
- * so it will only be loaded when this function is called.
13
- *
14
- * @param options Configuration for the GoogleGenAI client.
15
- * @returns A GoogleGenAI instance.
16
- */
17
- createClient: (options) => {
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 trackingHeader = { "X-Goog-Api-Client": `${SDK_NAME}/${package_default.version}` };
10
+ const finalOptions = {
11
+ ...options,
12
+ httpOptions: {
13
+ ...options.httpOptions,
14
+ headers: {
15
+ ...options.httpOptions?.headers,
16
+ ...trackingHeader
28
17
  }
29
- };
30
- return new GoogleGenAI(finalOptions);
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"
18
+ }
19
+ };
20
+ return new GoogleGenAI(finalOptions);
53
21
  };
22
+ var geminiOutputAudioSettings = {
23
+ encoding: "pcm16",
24
+ channels: 1,
25
+ sampleRate: 24e3
26
+ };
27
+ var geminiInputAudioSettings = {
28
+ audioFormat: "pcm16",
29
+ audioSampleRate: 16e3
30
+ };
31
+ var inputMimeType = "audio/pcm;rate=16000";
54
32
  export {
55
- gemini_default as default
33
+ createClient,
34
+ geminiInputAudioSettings,
35
+ geminiOutputAudioSettings,
36
+ inputMimeType
56
37
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fishjam-cloud/js-server-sdk",
3
- "version": "0.25.1",
3
+ "version": "0.25.3",
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
- ".": "./dist/index.js",
28
- "./gemini": "./dist/integrations/gemini.js"
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",
@@ -77,7 +85,7 @@
77
85
  },
78
86
  "lint-staged": {
79
87
  "*.{js,ts,tsx,mjs,cjs}": [
80
- "eslint --fix --config packages/js-server-sdk/eslint.config.mjs"
88
+ "eslint --fix --config eslint.config.mjs"
81
89
  ]
82
90
  }
83
91
  }
@@ -1,123 +0,0 @@
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
- // package.json
34
- var package_default = {
35
- name: "@fishjam-cloud/js-server-sdk",
36
- version: "0.25.1",
37
- description: "Fishjam server SDK for JavaScript",
38
- homepage: "https://github.com/fishjam-cloud/js-server-sdk",
39
- author: "Fishjam Team",
40
- repository: {
41
- type: "git",
42
- url: "https://github.com/fishjam-cloud/js-server-sdk.git"
43
- },
44
- bugs: {
45
- url: "https://github.com/fishjam-cloud/js-server-sdk/issues"
46
- },
47
- license: "Apache-2.0",
48
- keywords: [
49
- "webrtc",
50
- "fishjam",
51
- "server",
52
- "membrane"
53
- ],
54
- main: "./dist/index.js",
55
- types: "./dist/index.d.ts",
56
- files: [
57
- "dist"
58
- ],
59
- exports: {
60
- ".": "./dist/index.js",
61
- "./gemini": "./dist/integrations/gemini.js"
62
- },
63
- scripts: {
64
- build: "tsup --dts-resolve",
65
- format: "prettier --write .",
66
- "format:check": "prettier --check .",
67
- typecheck: "tsc --noEmit",
68
- lint: "eslint . --fix",
69
- "lint:check": "eslint . "
70
- },
71
- tsup: {
72
- entry: [
73
- "src/index.ts",
74
- "src/integrations/gemini.ts",
75
- "src/proto.ts"
76
- ],
77
- noExternal: [
78
- "fishjam-openapi",
79
- "fishjam-proto"
80
- ],
81
- minify: false,
82
- format: [
83
- "cjs",
84
- "esm"
85
- ],
86
- outDir: "dist"
87
- },
88
- dependencies: {
89
- axios: "^1.7.9",
90
- uuid: "^11.1.0"
91
- },
92
- peerDependencies: {
93
- "@google/genai": "^1.0.0"
94
- },
95
- peerDependenciesMeta: {
96
- "@google/genai": {
97
- optional: true
98
- }
99
- },
100
- devDependencies: {
101
- "@fishjam-cloud/fishjam-openapi": "workspace:*",
102
- "@fishjam-cloud/fishjam-proto": "workspace:*",
103
- "@openapitools/openapi-generator-cli": "^2.18.4",
104
- "@types/node": "^22.13.16",
105
- "@types/websocket": "^1.0.10",
106
- eslint: "^9.33.0",
107
- prettier: "^3.6.2",
108
- tsup: "^8.4.0",
109
- "typed-emitter": "^2.1.0"
110
- },
111
- "lint-staged": {
112
- "*.{js,ts,tsx,mjs,cjs}": [
113
- "eslint --fix --config packages/js-server-sdk/eslint.config.mjs"
114
- ]
115
- }
116
- };
117
-
118
- export {
119
- __require,
120
- __commonJS,
121
- __toESM,
122
- package_default
123
- };