@fonoster/common 0.27.0 → 0.31.0

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.
Files changed (209) hide show
  1. package/dist/{voice/PlayDtmf.d.ts → agents/index.d.ts} +3 -5
  2. package/dist/{assistants → agents}/index.js +2 -6
  3. package/dist/agents/sessionAgentSchema.d.ts +755 -0
  4. package/dist/agents/sessionAgentSchema.js +117 -0
  5. package/dist/{voice/Dial.d.ts → calls/index.d.ts} +16 -13
  6. package/dist/calls/index.js +44 -0
  7. package/dist/cellsecrets/index.d.ts +91 -0
  8. package/dist/cellsecrets/index.js +299 -0
  9. package/dist/config/cli/check.d.ts +6 -0
  10. package/dist/config/cli/check.js +202 -0
  11. package/dist/config/cli/envFile.d.ts +23 -0
  12. package/dist/config/cli/envFile.js +81 -0
  13. package/dist/config/cli/exposure.d.ts +10 -0
  14. package/dist/config/cli/exposure.js +93 -0
  15. package/dist/config/cli/index.d.ts +2 -0
  16. package/dist/{identity/tokenHasAccessKeyId.js → config/cli/index.js} +7 -8
  17. package/dist/config/cli/info.d.ts +6 -0
  18. package/dist/config/cli/info.js +62 -0
  19. package/dist/config/cli/init.d.ts +9 -0
  20. package/dist/config/cli/init.js +152 -0
  21. package/dist/config/cli/main.d.ts +11 -0
  22. package/dist/config/cli/main.js +155 -0
  23. package/dist/config/cli/render.d.ts +44 -0
  24. package/dist/config/cli/render.js +129 -0
  25. package/dist/config/cli/secrets.d.ts +21 -0
  26. package/dist/config/cli/secrets.js +117 -0
  27. package/dist/config/cli/types.d.ts +24 -0
  28. package/dist/config/cli/types.js +7 -0
  29. package/dist/{assistants/index.d.ts → config/configHints.d.ts} +8 -7
  30. package/dist/config/configHints.js +47 -0
  31. package/dist/{voice → config}/index.d.ts +11 -13
  32. package/dist/{voice → config}/index.js +11 -13
  33. package/dist/config/interpolateEnv.d.ts +34 -0
  34. package/dist/config/interpolateEnv.js +70 -0
  35. package/dist/config/loadServiceConfig.d.ts +28 -0
  36. package/dist/config/loadServiceConfig.js +112 -0
  37. package/dist/config/logsSchema.d.ts +76 -0
  38. package/dist/config/logsSchema.js +49 -0
  39. package/dist/config/natsConnection.d.ts +53 -0
  40. package/dist/config/natsConnection.js +58 -0
  41. package/dist/config/parseConfigFile.d.ts +7 -0
  42. package/dist/config/parseConfigFile.js +60 -0
  43. package/dist/config/resolveConfigFile.d.ts +17 -0
  44. package/dist/config/resolveConfigFile.js +54 -0
  45. package/dist/config/resolveSecretRefs.d.ts +35 -0
  46. package/dist/config/resolveSecretRefs.js +129 -0
  47. package/dist/{assistants/audioFiltersSchema.d.ts → config/strictDeep.d.ts} +9 -12
  48. package/dist/config/strictDeep.js +58 -0
  49. package/dist/config/telemetrySchema.d.ts +39 -0
  50. package/dist/config/telemetrySchema.js +44 -0
  51. package/dist/config/toJsonSchema.d.ts +30 -0
  52. package/dist/config/toJsonSchema.js +161 -0
  53. package/dist/constants.d.ts +1 -6
  54. package/dist/constants.js +4 -7
  55. package/dist/envs.d.ts +2 -1
  56. package/dist/envs.js +13 -11
  57. package/dist/errors/handleZodError.js +3 -1
  58. package/dist/filters/index.d.ts +70 -0
  59. package/dist/filters/index.js +101 -0
  60. package/dist/identity/createAuthInterceptor.d.ts +9 -2
  61. package/dist/identity/createAuthInterceptor.js +36 -30
  62. package/dist/identity/hasAccess.d.ts +9 -3
  63. package/dist/identity/hasAccess.js +32 -8
  64. package/dist/identity/index.d.ts +1 -0
  65. package/dist/identity/index.js +1 -0
  66. package/dist/identity/isValidToken.d.ts +12 -2
  67. package/dist/identity/isValidToken.js +25 -9
  68. package/dist/identity/roles.js +33 -7
  69. package/dist/identity/types.d.ts +6 -1
  70. package/dist/identity/types.js +1 -0
  71. package/dist/{assistants/LanguageModelProvider.js → identity/verifyAccessToken.d.ts} +10 -11
  72. package/dist/identity/verifyAccessToken.js +44 -0
  73. package/dist/index.d.ts +15 -2
  74. package/dist/index.js +18 -3
  75. package/dist/net/assertPublicDestination.d.ts +52 -0
  76. package/dist/net/assertPublicDestination.js +342 -0
  77. package/dist/{voice/StopSay.d.ts → net/index.d.ts} +1 -6
  78. package/dist/net/index.js +35 -0
  79. package/dist/notifications/createSendEmail.js +3 -1
  80. package/dist/protos/applications.proto +138 -3
  81. package/dist/protos/authz.proto +26 -4
  82. package/dist/protos/billing.proto +92 -0
  83. package/dist/protos/calls.proto +4 -0
  84. package/dist/protos/capabilities.proto +102 -0
  85. package/dist/protos/identity.proto +26 -1
  86. package/dist/protos/providers.proto +139 -0
  87. package/dist/protos/roomr.proto +146 -0
  88. package/dist/protos/session.proto +194 -0
  89. package/dist/protos/usage.proto +59 -0
  90. package/dist/protos/webhooks.proto +140 -0
  91. package/dist/{utils/types.d.ts → regions/hub/index.d.ts} +1 -5
  92. package/dist/regions/hub/index.js +35 -0
  93. package/dist/regions/hub/natsJwt.d.ts +63 -0
  94. package/dist/regions/hub/natsJwt.js +195 -0
  95. package/dist/registry/Registry.d.ts +87 -0
  96. package/dist/registry/Registry.js +432 -0
  97. package/dist/registry/cli.d.ts +20 -0
  98. package/dist/registry/cli.js +436 -0
  99. package/dist/registry/features.d.ts +31 -0
  100. package/dist/registry/features.js +38 -0
  101. package/dist/registry/index.d.ts +24 -0
  102. package/dist/registry/index.js +40 -0
  103. package/dist/registry/prisma.d.ts +67 -0
  104. package/dist/registry/prisma.js +399 -0
  105. package/dist/registry/stores.d.ts +21 -0
  106. package/dist/{assistants/languageModelConfigSchema.js → registry/stores.js} +55 -38
  107. package/dist/registry/types.d.ts +110 -0
  108. package/dist/{assistants/LanguageModelProvider.d.ts → registry/types.js} +6 -8
  109. package/dist/registry/workspaceKeys.d.ts +41 -0
  110. package/dist/registry/workspaceKeys.js +64 -0
  111. package/dist/roomr/health.d.ts +9 -0
  112. package/dist/{assistants/eventsHookSchema.js → roomr/health.js} +22 -18
  113. package/dist/roomr/index.d.ts +75 -0
  114. package/dist/roomr/index.js +146 -0
  115. package/dist/roomr/session.d.ts +133 -0
  116. package/dist/roomr/session.js +132 -0
  117. package/dist/session/index.d.ts +19 -0
  118. package/dist/session/index.js +35 -0
  119. package/dist/session/schema.d.ts +2140 -0
  120. package/dist/session/schema.js +448 -0
  121. package/dist/sessions/index.d.ts +96 -0
  122. package/dist/sessions/index.js +197 -0
  123. package/dist/telemetry.d.ts +76 -0
  124. package/dist/telemetry.js +360 -0
  125. package/dist/types.d.ts +3 -5
  126. package/dist/{voice/Gather.d.ts → usage/CallUsage.d.ts} +19 -18
  127. package/dist/usage/CallUsage.js +76 -0
  128. package/dist/usage/index.d.ts +22 -0
  129. package/dist/usage/index.js +38 -0
  130. package/dist/usage/meters.d.ts +113 -0
  131. package/dist/usage/meters.js +90 -0
  132. package/dist/usage/types.d.ts +159 -0
  133. package/dist/usage/types.js +84 -0
  134. package/dist/usage/usageId.d.ts +6 -0
  135. package/dist/usage/usageId.js +45 -0
  136. package/dist/utils/{findIntegrationsCredentials.js → WriteBehind.d.ts} +13 -10
  137. package/dist/utils/WriteBehind.js +64 -0
  138. package/dist/utils/index.d.ts +1 -3
  139. package/dist/utils/index.js +1 -3
  140. package/dist/utils/{createFetchSingleCallByCallId.d.ts → logUnhandledRejections.d.ts} +8 -4
  141. package/dist/{assistants/audioFiltersSchema.js → utils/logUnhandledRejections.js} +17 -12
  142. package/dist/utils/withErrorHandling.js +1 -1
  143. package/dist/validators/calls.d.ts +3 -0
  144. package/dist/validators/calls.js +12 -2
  145. package/dist/validators/identity.d.ts +37 -8
  146. package/dist/validators/identity.js +22 -3
  147. package/dist/validators/index.d.ts +1 -0
  148. package/dist/validators/index.js +1 -0
  149. package/dist/validators/sip.d.ts +40 -0
  150. package/dist/validators/sip.js +99 -0
  151. package/dist/validators/sipnet/credentials.d.ts +2 -2
  152. package/dist/validators/sipnet/domains.js +7 -7
  153. package/dist/validators/sipnet/trunks.d.ts +14 -14
  154. package/dist/validators/sipnet/trunks.js +4 -2
  155. package/dist/webhooks/Dispatcher.d.ts +87 -0
  156. package/dist/webhooks/Dispatcher.js +225 -0
  157. package/dist/webhooks/bus.d.ts +68 -0
  158. package/dist/webhooks/bus.js +178 -0
  159. package/dist/webhooks/events.d.ts +66 -0
  160. package/dist/webhooks/events.js +62 -0
  161. package/dist/webhooks/index.d.ts +23 -0
  162. package/dist/webhooks/index.js +39 -0
  163. package/dist/webhooks/prisma.d.ts +55 -0
  164. package/dist/webhooks/prisma.js +242 -0
  165. package/dist/webhooks/signing.d.ts +8 -0
  166. package/dist/webhooks/signing.js +53 -0
  167. package/package.json +25 -11
  168. package/schema/session.v1.json +871 -0
  169. package/dist/assistants/assistantSchema.d.ts +0 -739
  170. package/dist/assistants/assistantSchema.js +0 -37
  171. package/dist/assistants/conversationSettingsSchema.d.ts +0 -122
  172. package/dist/assistants/conversationSettingsSchema.js +0 -133
  173. package/dist/assistants/eventsHookSchema.d.ts +0 -38
  174. package/dist/assistants/languageModelConfigSchema.d.ts +0 -206
  175. package/dist/identity/tokenHasAccessKeyId.d.ts +0 -2
  176. package/dist/protos/voice.proto +0 -557
  177. package/dist/utils/createFetchSingleCallByCallId.js +0 -33
  178. package/dist/utils/findIntegrationsCredentials.d.ts +0 -23
  179. package/dist/utils/types.js +0 -2
  180. package/dist/voice/Dial.js +0 -20
  181. package/dist/voice/Gather.js +0 -9
  182. package/dist/voice/Mute.d.ts +0 -31
  183. package/dist/voice/Mute.js +0 -9
  184. package/dist/voice/Play.d.ts +0 -30
  185. package/dist/voice/Play.js +0 -2
  186. package/dist/voice/PlayDtmf.js +0 -2
  187. package/dist/voice/PlaybackControl.d.ts +0 -31
  188. package/dist/voice/PlaybackControl.js +0 -11
  189. package/dist/voice/Record.d.ts +0 -36
  190. package/dist/voice/Record.js +0 -7
  191. package/dist/voice/Say.d.ts +0 -28
  192. package/dist/voice/Say.js +0 -2
  193. package/dist/voice/StopSay.js +0 -2
  194. package/dist/voice/Stream.d.ts +0 -53
  195. package/dist/voice/Stream.js +0 -19
  196. package/dist/voice/StreamGather.d.ts +0 -34
  197. package/dist/voice/StreamGather.js +0 -9
  198. package/dist/voice/Verb.d.ts +0 -27
  199. package/dist/voice/Verb.js +0 -2
  200. package/dist/voice/voice.d.ts +0 -171
  201. package/dist/voice/voice.js +0 -65
  202. package/dist/{assistants → agents}/testCasesSchema.d.ts +4 -4
  203. /package/dist/{assistants → agents}/testCasesSchema.js +0 -0
  204. /package/dist/{assistants → agents}/tools/index.d.ts +0 -0
  205. /package/dist/{assistants → agents}/tools/index.js +0 -0
  206. /package/dist/{assistants → agents}/tools/propertySchema.d.ts +0 -0
  207. /package/dist/{assistants → agents}/tools/propertySchema.js +0 -0
  208. /package/dist/{assistants → agents}/tools/toolSchema.d.ts +0 -0
  209. /package/dist/{assistants → agents}/tools/toolSchema.js +0 -0
@@ -1,30 +0,0 @@
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 PlayOptions = {
21
- playbackRef?: string;
22
- };
23
- type PlayRequest = VerbRequest & {
24
- url: string;
25
- } & PlayOptions;
26
- type PlayResponse = {
27
- mediaSessionRef: string;
28
- playbackRef: string;
29
- };
30
- export { PlayOptions, PlayRequest, PlayResponse };
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,31 +0,0 @@
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
- declare enum PlaybackControlAction {
21
- STOP = "STOP",
22
- RESTART = "RESTART",
23
- PAUSE = "PAUSE",
24
- UNPAUSE = "UNPAUSE",
25
- FORWARD = "FORWARD"
26
- }
27
- type PlaybackControlRequest = VerbRequest & {
28
- playbackRef: string;
29
- action: PlaybackControlAction;
30
- };
31
- export { PlaybackControlAction, PlaybackControlRequest };
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PlaybackControlAction = void 0;
4
- var PlaybackControlAction;
5
- (function (PlaybackControlAction) {
6
- PlaybackControlAction["STOP"] = "STOP";
7
- PlaybackControlAction["RESTART"] = "RESTART";
8
- PlaybackControlAction["PAUSE"] = "PAUSE";
9
- PlaybackControlAction["UNPAUSE"] = "UNPAUSE";
10
- PlaybackControlAction["FORWARD"] = "FORWARD";
11
- })(PlaybackControlAction || (exports.PlaybackControlAction = PlaybackControlAction = {}));
@@ -1,36 +0,0 @@
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
- declare enum RecordFormat {
21
- WAV = "wav"
22
- }
23
- type RecordOptions = {
24
- maxDuration?: number;
25
- maxSilence?: number;
26
- beep?: boolean;
27
- finishOnKey?: string;
28
- };
29
- type RecordRequest = VerbRequest & RecordOptions;
30
- type RecordResponse = {
31
- mediaSessionRef: string;
32
- name: string;
33
- duration: number;
34
- format: RecordFormat;
35
- };
36
- export { RecordFormat, RecordOptions, RecordRequest, RecordResponse };
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RecordFormat = void 0;
4
- var RecordFormat;
5
- (function (RecordFormat) {
6
- RecordFormat["WAV"] = "wav";
7
- })(RecordFormat || (exports.RecordFormat = RecordFormat = {}));
@@ -1,28 +0,0 @@
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 { Struct } from "pb-util";
20
- import { VerbRequest } from "./Verb";
21
- type SayRequest = VerbRequest & {
22
- text: string;
23
- options?: Struct;
24
- };
25
- type SayOptions = {
26
- [key: string]: any;
27
- };
28
- export { SayOptions, SayRequest };
package/dist/voice/Say.js DELETED
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,53 +0,0 @@
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, VerbResponse } from "./Verb";
20
- declare enum StreamDirection {
21
- IN = "IN",
22
- OUT = "OUT",
23
- BOTH = "BOTH"
24
- }
25
- declare enum StreamAudioFormat {
26
- WAV = "WAV"
27
- }
28
- declare enum StreamMessageType {
29
- AUDIO_IN = "AUDIO_IN",
30
- AUDIO_OUT = "AUDIO_OUT",
31
- ERROR = "ERROR"
32
- }
33
- type StreamOptions = {
34
- direction?: StreamDirection;
35
- format?: StreamAudioFormat;
36
- };
37
- type StartStreamRequest = VerbRequest & StreamOptions;
38
- type StartStreamResponse = VerbResponse & {
39
- streamRef: string;
40
- };
41
- type StopStreamRequest = VerbRequest & {
42
- streamRef: string;
43
- };
44
- type StreamPayload = {
45
- mediaSessionRef: string;
46
- streamRef: string;
47
- format: StreamAudioFormat;
48
- type: StreamMessageType;
49
- data?: Uint8Array;
50
- code?: string;
51
- message?: string;
52
- };
53
- export { StartStreamRequest, StartStreamResponse, StopStreamRequest, StreamAudioFormat, StreamDirection, StreamMessageType, StreamOptions, StreamPayload };
@@ -1,19 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.StreamMessageType = exports.StreamDirection = exports.StreamAudioFormat = void 0;
4
- var StreamDirection;
5
- (function (StreamDirection) {
6
- StreamDirection["IN"] = "IN";
7
- StreamDirection["OUT"] = "OUT";
8
- StreamDirection["BOTH"] = "BOTH";
9
- })(StreamDirection || (exports.StreamDirection = StreamDirection = {}));
10
- var StreamAudioFormat;
11
- (function (StreamAudioFormat) {
12
- StreamAudioFormat["WAV"] = "WAV";
13
- })(StreamAudioFormat || (exports.StreamAudioFormat = StreamAudioFormat = {}));
14
- var StreamMessageType;
15
- (function (StreamMessageType) {
16
- StreamMessageType["AUDIO_IN"] = "AUDIO_IN";
17
- StreamMessageType["AUDIO_OUT"] = "AUDIO_OUT";
18
- StreamMessageType["ERROR"] = "ERROR";
19
- })(StreamMessageType || (exports.StreamMessageType = StreamMessageType = {}));
@@ -1,34 +0,0 @@
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, VerbResponse } from "./Verb";
20
- declare enum StreamGatherSource {
21
- SPEECH = "speech",
22
- DTMF = "dtmf",
23
- SPEECH_AND_DTMF = "speech,dtmf"
24
- }
25
- type StreamGatherOptions = {
26
- source?: StreamGatherSource;
27
- };
28
- type StartStreamGatherRequest = VerbRequest & StreamGatherOptions;
29
- type StreamGatherPayload = VerbResponse & {
30
- speech?: string;
31
- digit?: string;
32
- responseTime: number;
33
- };
34
- export { StartStreamGatherRequest, StreamGatherOptions, StreamGatherPayload, StreamGatherSource };
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.StreamGatherSource = void 0;
4
- var StreamGatherSource;
5
- (function (StreamGatherSource) {
6
- StreamGatherSource["SPEECH"] = "speech";
7
- StreamGatherSource["DTMF"] = "dtmf";
8
- StreamGatherSource["SPEECH_AND_DTMF"] = "speech,dtmf";
9
- })(StreamGatherSource || (exports.StreamGatherSource = StreamGatherSource = {}));
@@ -1,27 +0,0 @@
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 { VoiceClientConfig } from "./voice";
20
- type VoiceRequest = VoiceClientConfig;
21
- type VerbRequest = {
22
- mediaSessionRef: string;
23
- };
24
- type VerbResponse = {
25
- mediaSessionRef: string;
26
- };
27
- export { VerbRequest, VerbResponse, VoiceRequest };
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,171 +0,0 @@
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 { CallDirection } from "@fonoster/types";
20
- import { GrpcError } from "../GrpcError";
21
- import { DialRequest, DialStatus } from "./Dial";
22
- import { GatherRequest, GatherResponse } from "./Gather";
23
- import { MuteRequest } from "./Mute";
24
- import { PlayRequest, PlayResponse } from "./Play";
25
- import { PlayDtmfRequest } from "./PlayDtmf";
26
- import { RecordRequest, RecordResponse } from "./Record";
27
- import { SayRequest } from "./Say";
28
- import { StopSayRequest } from "./StopSay";
29
- import { StartStreamRequest, StartStreamResponse, StopStreamRequest, StreamPayload } from "./Stream";
30
- import { StartStreamGatherRequest, StreamGatherPayload } from "./StreamGather";
31
- import { VerbRequest, VerbResponse, VoiceRequest } from "./Verb";
32
- declare const DATA = "data";
33
- declare const END = "end";
34
- declare const ERROR = "error";
35
- declare enum StreamEvent {
36
- DATA = "data",
37
- END = "end",
38
- ERROR = "error"
39
- }
40
- declare enum StreamContent {
41
- ANSWER_REQUEST = "answerRequest",
42
- ANSWER_RESPONSE = "answerResponse",
43
- HANGUP_REQUEST = "hangupRequest",
44
- HANGUP_RESPONSE = "hangupResponse",
45
- PLAY_REQUEST = "playRequest",
46
- PLAY_RESPONSE = "playResponse",
47
- PLAY_DTMF_REQUEST = "playDtmfRequest",
48
- PLAY_DTMF_RESPONSE = "playDtmfResponse",
49
- PLAYBACK_CONTROL_REQUEST = "playbackControlRequest",
50
- PLAYBACK_CONTROL_RESPONSE = "playbackControlResponse",
51
- MUTE_REQUEST = "muteRequest",
52
- MUTE_RESPONSE = "muteResponse",
53
- UNMUTE_REQUEST = "unmuteRequest",
54
- UNMUTE_RESPONSE = "unmuteResponse",
55
- GATHER_REQUEST = "gatherRequest",
56
- GATHER_RESPONSE = "gatherResponse",
57
- SAY_REQUEST = "sayRequest",
58
- SAY_RESPONSE = "sayResponse",
59
- RECORD_REQUEST = "recordRequest",
60
- RECORD_RESPONSE = "recordResponse",
61
- DIAL_REQUEST = "dialRequest",
62
- DIAL_RESPONSE = "dialResponse",
63
- START_STREAM_REQUEST = "startStreamRequest",
64
- START_STREAM_RESPONSE = "startStreamResponse",
65
- STOP_STREAM_REQUEST = "stopStreamRequest",
66
- STOP_STREAM_RESPONSE = "stopStreamResponse",
67
- STOP_SAY_REQUEST = "stopSayRequest",
68
- STOP_SAY_RESPONSE = "stopSayResponse",
69
- STREAM_PAYLOAD = "streamPayload",
70
- START_STREAM_GATHER_REQUEST = "startStreamGatherRequest",
71
- START_STREAM_GATHER_RESPONSE = "startStreamGatherResponse",
72
- STOP_STREAM_GATHER_REQUEST = "stopStreamGatherRequest",
73
- STOP_STREAM_GATHER_RESPONSE = "stopStreamGatherResponse",
74
- STREAM_GATHER_PAYLOAD = "streamGatherPayload",
75
- SET_AUDIO_FILTERS_REQUEST = "setAudioFiltersRequest",
76
- SET_AUDIO_FILTERS_RESPONSE = "setAudioFiltersResponse"
77
- }
78
- type AudioFilterConfig = {
79
- name: string;
80
- options?: Record<string, unknown>;
81
- };
82
- type SetAudioFiltersRequest = {
83
- mediaSessionRef: string;
84
- filters: AudioFilterConfig[];
85
- };
86
- type SetAudioFiltersResponse = {
87
- mediaSessionRef: string;
88
- error?: string;
89
- };
90
- declare enum AmdStatus {
91
- UNSPECIFIED = "AMD_STATUS_UNSPECIFIED",
92
- HUMAN = "HUMAN",
93
- MACHINE = "MACHINE",
94
- VOICEMAIL = "VOICEMAIL",
95
- IVR = "IVR",
96
- UNKNOWN = "UNKNOWN"
97
- }
98
- type Amd = {
99
- status: AmdStatus;
100
- confidence: number;
101
- detector: string;
102
- latencyMs: number;
103
- };
104
- type VoiceClientConfig = {
105
- appRef: string;
106
- accessKeyId: string;
107
- endpoint: string;
108
- ingressNumber: string;
109
- callerName: string;
110
- callerNumber: string;
111
- mediaSessionRef: string;
112
- callRef: string;
113
- sessionToken: string;
114
- callDirection: CallDirection;
115
- metadata?: Record<string, string>;
116
- amd?: Amd;
117
- };
118
- type VoiceIn = {
119
- request?: VoiceRequest;
120
- content?: StreamContent;
121
- answerResponse?: VerbResponse;
122
- hangupResponse?: VerbResponse;
123
- playResponse?: PlayResponse;
124
- playDtmfResponse?: VerbResponse;
125
- playbackControlResponse?: VerbResponse;
126
- muteResponse?: VerbResponse;
127
- unmuteResponse?: VerbResponse;
128
- gatherResponse?: GatherResponse;
129
- sayResponse?: VerbResponse;
130
- recordResponse?: RecordResponse;
131
- dialResponse?: {
132
- status: DialStatus;
133
- };
134
- startStreamResponse?: StartStreamResponse;
135
- streamPayload?: StreamPayload;
136
- streamGatherPayload?: StreamGatherPayload;
137
- startStreamGatherResponse?: VerbResponse;
138
- stopStreamGatherResponse?: VerbResponse;
139
- stopSayResponse?: VerbResponse;
140
- setAudioFiltersResponse?: SetAudioFiltersResponse;
141
- };
142
- type VoiceOut = {
143
- answerRequest?: VerbRequest;
144
- hangupRequest?: VerbRequest;
145
- playRequest?: PlayRequest;
146
- playDtmfRequest?: PlayDtmfRequest;
147
- playbackControlRequest?: VerbRequest;
148
- muteRequest?: MuteRequest;
149
- unmuteRequest?: MuteRequest;
150
- gatherRequest?: GatherRequest;
151
- sayRequest?: SayRequest;
152
- recordRequest?: RecordRequest;
153
- dialRequest?: DialRequest;
154
- startStreamRequest?: StartStreamRequest;
155
- stopStreamRequest?: StopStreamRequest;
156
- streamPayload?: StreamPayload;
157
- startStreamGatherRequest?: StartStreamGatherRequest;
158
- stopStreamGatherRequest?: VerbRequest;
159
- stopSayRequest?: StopSayRequest;
160
- setAudioFiltersRequest?: SetAudioFiltersRequest;
161
- };
162
- type BaseVoiceStream<T, W> = {
163
- removeListener: (e: StreamEvent, cb: (voice: T) => void) => void;
164
- on: (e: StreamEvent, cb: (voice: T) => void) => void;
165
- once: (e: StreamEvent, cb: (voice: T) => void) => void;
166
- write: (voice: W) => void;
167
- end: () => void;
168
- };
169
- type VoiceSessionStreamServer = BaseVoiceStream<VoiceIn, VoiceOut>;
170
- type VoiceSessionStreamClient = BaseVoiceStream<VoiceOut | GrpcError, VoiceIn | GrpcError>;
171
- export { Amd, AmdStatus, AudioFilterConfig, DATA, END, ERROR, SetAudioFiltersRequest, SetAudioFiltersResponse, StreamContent, StreamEvent, VoiceClientConfig, VoiceIn, VoiceOut, VoiceSessionStreamClient, VoiceSessionStreamServer };
@@ -1,65 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.StreamEvent = exports.StreamContent = exports.ERROR = exports.END = exports.DATA = exports.AmdStatus = void 0;
4
- const DATA = "data";
5
- exports.DATA = DATA;
6
- const END = "end";
7
- exports.END = END;
8
- const ERROR = "error";
9
- exports.ERROR = ERROR;
10
- var StreamEvent;
11
- (function (StreamEvent) {
12
- StreamEvent["DATA"] = "data";
13
- StreamEvent["END"] = "end";
14
- StreamEvent["ERROR"] = "error";
15
- })(StreamEvent || (exports.StreamEvent = StreamEvent = {}));
16
- var StreamContent;
17
- (function (StreamContent) {
18
- StreamContent["ANSWER_REQUEST"] = "answerRequest";
19
- StreamContent["ANSWER_RESPONSE"] = "answerResponse";
20
- StreamContent["HANGUP_REQUEST"] = "hangupRequest";
21
- StreamContent["HANGUP_RESPONSE"] = "hangupResponse";
22
- StreamContent["PLAY_REQUEST"] = "playRequest";
23
- StreamContent["PLAY_RESPONSE"] = "playResponse";
24
- StreamContent["PLAY_DTMF_REQUEST"] = "playDtmfRequest";
25
- StreamContent["PLAY_DTMF_RESPONSE"] = "playDtmfResponse";
26
- StreamContent["PLAYBACK_CONTROL_REQUEST"] = "playbackControlRequest";
27
- StreamContent["PLAYBACK_CONTROL_RESPONSE"] = "playbackControlResponse";
28
- StreamContent["MUTE_REQUEST"] = "muteRequest";
29
- StreamContent["MUTE_RESPONSE"] = "muteResponse";
30
- StreamContent["UNMUTE_REQUEST"] = "unmuteRequest";
31
- StreamContent["UNMUTE_RESPONSE"] = "unmuteResponse";
32
- StreamContent["GATHER_REQUEST"] = "gatherRequest";
33
- StreamContent["GATHER_RESPONSE"] = "gatherResponse";
34
- StreamContent["SAY_REQUEST"] = "sayRequest";
35
- StreamContent["SAY_RESPONSE"] = "sayResponse";
36
- StreamContent["RECORD_REQUEST"] = "recordRequest";
37
- StreamContent["RECORD_RESPONSE"] = "recordResponse";
38
- StreamContent["DIAL_REQUEST"] = "dialRequest";
39
- StreamContent["DIAL_RESPONSE"] = "dialResponse";
40
- StreamContent["START_STREAM_REQUEST"] = "startStreamRequest";
41
- StreamContent["START_STREAM_RESPONSE"] = "startStreamResponse";
42
- StreamContent["STOP_STREAM_REQUEST"] = "stopStreamRequest";
43
- StreamContent["STOP_STREAM_RESPONSE"] = "stopStreamResponse";
44
- StreamContent["STOP_SAY_REQUEST"] = "stopSayRequest";
45
- StreamContent["STOP_SAY_RESPONSE"] = "stopSayResponse";
46
- StreamContent["STREAM_PAYLOAD"] = "streamPayload";
47
- StreamContent["START_STREAM_GATHER_REQUEST"] = "startStreamGatherRequest";
48
- StreamContent["START_STREAM_GATHER_RESPONSE"] = "startStreamGatherResponse";
49
- StreamContent["STOP_STREAM_GATHER_REQUEST"] = "stopStreamGatherRequest";
50
- StreamContent["STOP_STREAM_GATHER_RESPONSE"] = "stopStreamGatherResponse";
51
- StreamContent["STREAM_GATHER_PAYLOAD"] = "streamGatherPayload";
52
- StreamContent["SET_AUDIO_FILTERS_REQUEST"] = "setAudioFiltersRequest";
53
- StreamContent["SET_AUDIO_FILTERS_RESPONSE"] = "setAudioFiltersResponse";
54
- })(StreamContent || (exports.StreamContent = StreamContent = {}));
55
- // Answering Machine Detection verdict. String values match the proto enum value
56
- // names so the object round-trips through @grpc/proto-loader (enums: String).
57
- var AmdStatus;
58
- (function (AmdStatus) {
59
- AmdStatus["UNSPECIFIED"] = "AMD_STATUS_UNSPECIFIED";
60
- AmdStatus["HUMAN"] = "HUMAN";
61
- AmdStatus["MACHINE"] = "MACHINE";
62
- AmdStatus["VOICEMAIL"] = "VOICEMAIL";
63
- AmdStatus["IVR"] = "IVR";
64
- AmdStatus["UNKNOWN"] = "UNKNOWN";
65
- })(AmdStatus || (exports.AmdStatus = AmdStatus = {}));
@@ -24,13 +24,13 @@ declare const testCasesSchema: z.ZodObject<{
24
24
  model: z.ZodString;
25
25
  apiKey: z.ZodOptional<z.ZodString>;
26
26
  }, "strip", z.ZodTypeAny, {
27
+ model?: string;
27
28
  provider?: "openai";
28
29
  apiKey?: string;
29
- model?: string;
30
30
  }, {
31
+ model?: string;
31
32
  provider?: "openai";
32
33
  apiKey?: string;
33
- model?: string;
34
34
  }>;
35
35
  evalsSystemPrompt: z.ZodOptional<z.ZodString>;
36
36
  scenarios: z.ZodArray<z.ZodObject<{
@@ -166,9 +166,9 @@ declare const testCasesSchema: z.ZodObject<{
166
166
  }>, "many">;
167
167
  }, "strip", z.ZodTypeAny, {
168
168
  evalsLanguageModel?: {
169
+ model?: string;
169
170
  provider?: "openai";
170
171
  apiKey?: string;
171
- model?: string;
172
172
  };
173
173
  evalsSystemPrompt?: string;
174
174
  scenarios?: {
@@ -196,9 +196,9 @@ declare const testCasesSchema: z.ZodObject<{
196
196
  }[];
197
197
  }, {
198
198
  evalsLanguageModel?: {
199
+ model?: string;
199
200
  provider?: "openai";
200
201
  apiKey?: string;
201
- model?: string;
202
202
  };
203
203
  evalsSystemPrompt?: string;
204
204
  scenarios?: {
File without changes
File without changes
File without changes
File without changes