@fonoster/common 0.15.21 → 0.16.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.
@@ -217,12 +217,17 @@ message SayRequest {
217
217
  string text = 2;
218
218
 
219
219
  // Assign a playback reference to the request
220
- string playback_ref = 3;
220
+ string playback_ref = 3 [deprecated = true];
221
221
 
222
222
  // TTS options
223
223
  google.protobuf.Struct options = 4;
224
224
  }
225
225
 
226
+ message StopSayRequest {
227
+ // The session reference generated by the Media Server
228
+ string session_ref = 1;
229
+ }
230
+
226
231
  // Dial request message
227
232
  message DialRequest {
228
233
  // The session reference generated by the Media Server
@@ -396,6 +401,9 @@ message VoiceInStream {
396
401
  // Response to a say request (It shares the same response as play)
397
402
  PlayResponse say_response = 10;
398
403
 
404
+ // Response to stopping the an active say speech
405
+ VerbResponse stop_say_response = 18;
406
+
399
407
  // Response to a record request
400
408
  RecordResponse record_response = 11;
401
409
 
@@ -449,6 +457,9 @@ message VoiceOutStream {
449
457
  // Request to say a text
450
458
  SayRequest say_request = 10;
451
459
 
460
+ // Request to stop any active Say speech
461
+ StopSayRequest stop_say_request = 19;
462
+
452
463
  // Request to record
453
464
  RecordRequest record_request = 11;
454
465
 
@@ -18,23 +18,22 @@
18
18
  */
19
19
  import { VoiceGender, VoiceLanguage } from "./types";
20
20
  declare enum ElevenLabsVoice {
21
- SARAH = "Sarah",
22
- LAURA = "Laura",
23
- CHARLIE = "Charlie",
24
- GEORGE = "George",
25
- CALLUM = "Callum",
26
- LIAM = "Liam",
27
- CHARLOTTE = "Charlotte",
28
- ALICE = "Alice",
29
- MATILDA = "Matilda",
30
- WILL = "Will",
31
- JESSICA = "Jessica",
32
- ERIC = "Eric",
33
- CHRIS = "Chris",
34
- BRIAN = "Brian",
35
- DANIEL = "Daniel",
36
- LILY = "Lily",
37
- BILL = "Bill"
21
+ SARAH = "EXAVITQu4vr4xnSDxMaL",
22
+ LAURA = "FGY2WhTYpPnrIDTdsKH5",
23
+ CHARLIE = "IKne3meq5aSn9XLyUdCD",
24
+ GEORGE = "JBFqnCBsd6RMkjVDRZzb",
25
+ CALLUM = "N2lVS1w4EtoT3dr4eOWO",
26
+ LIAM = "TX3LPaxmHKxFdv7VOQHJ",
27
+ ALICE = "Xb7hH8MSUJpSbSDYk0k2",
28
+ MATILDA = "XrExE9yKIg1WjnnlVkGX",
29
+ WILL = "bIHbv24MWmeRgasZH58o",
30
+ JESSICA = "cgSgspJ2msm6clMCkdW9",
31
+ ERIC = "cjVigY5qzO86Huf0OWal",
32
+ CHRIS = "iP95p4xoKVk53GoZ742B",
33
+ BRIAN = "nPczCjzI2devNBz1zQrb",
34
+ DANIEL = "onwK4e9ZLuTAKqWW03F9",
35
+ LILY = "pFZP5JQG7iQjIQuC4Bku",
36
+ BILL = "pqHfZKP75CvOlQylNhV4"
38
37
  }
39
38
  declare const ElevenLabsVoiceDetails: {
40
39
  name: ElevenLabsVoice;
@@ -22,23 +22,22 @@ exports.ElevenLabsVoiceDetails = exports.ElevenLabsVoice = void 0;
22
22
  const types_1 = require("./types");
23
23
  var ElevenLabsVoice;
24
24
  (function (ElevenLabsVoice) {
25
- ElevenLabsVoice["SARAH"] = "Sarah";
26
- ElevenLabsVoice["LAURA"] = "Laura";
27
- ElevenLabsVoice["CHARLIE"] = "Charlie";
28
- ElevenLabsVoice["GEORGE"] = "George";
29
- ElevenLabsVoice["CALLUM"] = "Callum";
30
- ElevenLabsVoice["LIAM"] = "Liam";
31
- ElevenLabsVoice["CHARLOTTE"] = "Charlotte";
32
- ElevenLabsVoice["ALICE"] = "Alice";
33
- ElevenLabsVoice["MATILDA"] = "Matilda";
34
- ElevenLabsVoice["WILL"] = "Will";
35
- ElevenLabsVoice["JESSICA"] = "Jessica";
36
- ElevenLabsVoice["ERIC"] = "Eric";
37
- ElevenLabsVoice["CHRIS"] = "Chris";
38
- ElevenLabsVoice["BRIAN"] = "Brian";
39
- ElevenLabsVoice["DANIEL"] = "Daniel";
40
- ElevenLabsVoice["LILY"] = "Lily";
41
- ElevenLabsVoice["BILL"] = "Bill";
25
+ ElevenLabsVoice["SARAH"] = "EXAVITQu4vr4xnSDxMaL";
26
+ ElevenLabsVoice["LAURA"] = "FGY2WhTYpPnrIDTdsKH5";
27
+ ElevenLabsVoice["CHARLIE"] = "IKne3meq5aSn9XLyUdCD";
28
+ ElevenLabsVoice["GEORGE"] = "JBFqnCBsd6RMkjVDRZzb";
29
+ ElevenLabsVoice["CALLUM"] = "N2lVS1w4EtoT3dr4eOWO";
30
+ ElevenLabsVoice["LIAM"] = "TX3LPaxmHKxFdv7VOQHJ";
31
+ ElevenLabsVoice["ALICE"] = "Xb7hH8MSUJpSbSDYk0k2";
32
+ ElevenLabsVoice["MATILDA"] = "XrExE9yKIg1WjnnlVkGX";
33
+ ElevenLabsVoice["WILL"] = "bIHbv24MWmeRgasZH58o";
34
+ ElevenLabsVoice["JESSICA"] = "cgSgspJ2msm6clMCkdW9";
35
+ ElevenLabsVoice["ERIC"] = "cjVigY5qzO86Huf0OWal";
36
+ ElevenLabsVoice["CHRIS"] = "iP95p4xoKVk53GoZ742B";
37
+ ElevenLabsVoice["BRIAN"] = "nPczCjzI2devNBz1zQrb";
38
+ ElevenLabsVoice["DANIEL"] = "onwK4e9ZLuTAKqWW03F9";
39
+ ElevenLabsVoice["LILY"] = "pFZP5JQG7iQjIQuC4Bku";
40
+ ElevenLabsVoice["BILL"] = "pqHfZKP75CvOlQylNhV4";
42
41
  })(ElevenLabsVoice || (exports.ElevenLabsVoice = ElevenLabsVoice = {}));
43
42
  const ElevenLabsVoiceDetails = [
44
43
  {
@@ -77,12 +76,6 @@ const ElevenLabsVoiceDetails = [
77
76
  languageCode: types_1.VoiceLanguage.EN_US,
78
77
  gender: types_1.VoiceGender.MALE
79
78
  },
80
- {
81
- name: ElevenLabsVoice.CHARLOTTE,
82
- displayName: "Charlotte",
83
- languageCode: types_1.VoiceLanguage.SV_SE,
84
- gender: types_1.VoiceGender.FEMALE
85
- },
86
79
  {
87
80
  name: ElevenLabsVoice.ALICE,
88
81
  displayName: "Alice",
@@ -20,14 +20,9 @@ import { Struct } from "pb-util";
20
20
  import { VerbRequest } from "./Verb";
21
21
  type SayRequest = VerbRequest & {
22
22
  text: string;
23
- playbackRef?: string;
24
23
  options?: Struct;
25
24
  };
26
- type SayResponse = {
27
- playbackRef: string;
28
- };
29
25
  type SayOptions = {
30
- playbackRef?: string;
31
26
  [key: string]: any;
32
27
  };
33
- export { SayOptions, SayRequest, SayResponse };
28
+ export { SayOptions, SayRequest };
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
3
+ * http://github.com/fonoster/fonoster
4
+ *
5
+ * This file is part of Fonoster
6
+ *
7
+ * Licensed under the MIT License (the "License");
8
+ * you may not use this file except in compliance with
9
+ * the License. You may obtain a copy of the License at
10
+ *
11
+ * https://opensource.org/licenses/MIT
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software
14
+ * distributed under the License is distributed on an "AS IS" BASIS,
15
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ * See the License for the specific language governing permissions and
17
+ * limitations under the License.
18
+ */
19
+ import { VerbRequest } from "./Verb";
20
+ type StopSayRequest = VerbRequest & {
21
+ sessionRef: string;
22
+ };
23
+ type StopSayResponse = {
24
+ sessionRef: string;
25
+ };
26
+ export { StopSayRequest, StopSayResponse };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -26,5 +26,6 @@ export * from "./Record";
26
26
  export * from "./Say";
27
27
  export * from "./Stream";
28
28
  export * from "./StreamGather";
29
+ export * from "./StopSay";
29
30
  export * from "./Verb";
30
31
  export * from "./voice";
@@ -42,5 +42,6 @@ __exportStar(require("./Record"), exports);
42
42
  __exportStar(require("./Say"), exports);
43
43
  __exportStar(require("./Stream"), exports);
44
44
  __exportStar(require("./StreamGather"), exports);
45
+ __exportStar(require("./StopSay"), exports);
45
46
  __exportStar(require("./Verb"), exports);
46
47
  __exportStar(require("./voice"), exports);
@@ -24,7 +24,8 @@ import { MuteRequest } from "./Mute";
24
24
  import { PlayRequest, PlayResponse } from "./Play";
25
25
  import { PlayDtmfRequest } from "./PlayDtmf";
26
26
  import { RecordRequest, RecordResponse } from "./Record";
27
- import { SayRequest, SayResponse } from "./Say";
27
+ import { SayRequest } from "./Say";
28
+ import { StopSayRequest } from "./StopSay";
28
29
  import { StartStreamRequest, StartStreamResponse, StopStreamRequest, StreamPayload } from "./Stream";
29
30
  import { StartStreamGatherRequest, StreamGatherPayload } from "./StreamGather";
30
31
  import { VerbRequest, VerbResponse, VoiceRequest } from "./Verb";
@@ -63,6 +64,8 @@ declare enum StreamContent {
63
64
  START_STREAM_RESPONSE = "startStreamResponse",
64
65
  STOP_STREAM_REQUEST = "stopStreamRequest",
65
66
  STOP_STREAM_RESPONSE = "stopStreamResponse",
67
+ STOP_SAY_REQUEST = "stopSayRequest",
68
+ STOP_SAY_RESPONSE = "stopSayResponse",
66
69
  STREAM_PAYLOAD = "streamPayload",
67
70
  START_STREAM_GATHER_REQUEST = "startStreamGatherRequest",
68
71
  START_STREAM_GATHER_RESPONSE = "startStreamGatherResponse",
@@ -93,7 +96,7 @@ type VoiceIn = {
93
96
  muteResponse?: VerbResponse;
94
97
  unmuteResponse?: VerbResponse;
95
98
  gatherResponse?: GatherResponse;
96
- sayResponse?: SayResponse;
99
+ sayResponse?: VerbResponse;
97
100
  recordResponse?: RecordResponse;
98
101
  dialResponse?: {
99
102
  status: DialStatus;
@@ -103,6 +106,7 @@ type VoiceIn = {
103
106
  streamGatherPayload?: StreamGatherPayload;
104
107
  startStreamGatherResponse?: VerbResponse;
105
108
  stopStreamGatherResponse?: VerbResponse;
109
+ stopSayResponse?: VerbResponse;
106
110
  };
107
111
  type VoiceOut = {
108
112
  answerRequest?: VerbRequest;
@@ -121,6 +125,7 @@ type VoiceOut = {
121
125
  streamPayload?: StreamPayload;
122
126
  startStreamGatherRequest?: StartStreamGatherRequest;
123
127
  stopStreamGatherRequest?: VerbRequest;
128
+ stopSayRequest?: StopSayRequest;
124
129
  };
125
130
  type BaseVoiceStream<T, W> = {
126
131
  removeListener: (e: StreamEvent, cb: (voice: T) => void) => void;
@@ -41,6 +41,8 @@ var StreamContent;
41
41
  StreamContent["START_STREAM_RESPONSE"] = "startStreamResponse";
42
42
  StreamContent["STOP_STREAM_REQUEST"] = "stopStreamRequest";
43
43
  StreamContent["STOP_STREAM_RESPONSE"] = "stopStreamResponse";
44
+ StreamContent["STOP_SAY_REQUEST"] = "stopSayRequest";
45
+ StreamContent["STOP_SAY_RESPONSE"] = "stopSayResponse";
44
46
  StreamContent["STREAM_PAYLOAD"] = "streamPayload";
45
47
  StreamContent["START_STREAM_GATHER_REQUEST"] = "startStreamGatherRequest";
46
48
  StreamContent["START_STREAM_GATHER_RESPONSE"] = "startStreamGatherResponse";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fonoster/common",
3
- "version": "0.15.21",
3
+ "version": "0.16.2",
4
4
  "description": "Common library for Fonoster projects",
5
5
  "author": "Pedro Sanders <psanders@fonoster.com>",
6
6
  "homepage": "https://github.com/fonoster/fonoster#readme",
@@ -18,7 +18,7 @@
18
18
  "clean": "rimraf ./dist node_modules tsconfig.tsbuildinfo"
19
19
  },
20
20
  "dependencies": {
21
- "@fonoster/logger": "^0.15.20",
21
+ "@fonoster/logger": "^0.16.0",
22
22
  "@grpc/grpc-js": "~1.10.6",
23
23
  "@grpc/proto-loader": "^0.7.12",
24
24
  "@influxdata/influxdb-client": "^1.35.0",
@@ -49,5 +49,5 @@
49
49
  "devDependencies": {
50
50
  "@types/nodemailer": "^6.4.14"
51
51
  },
52
- "gitHead": "12d1215cf30b3b1bfd5b115a7bdfe2c14a6955b6"
52
+ "gitHead": "4db38b68434f42dad5a6fcfcc3bd91860788112b"
53
53
  }