@fonoster/apiserver 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 (376) hide show
  1. package/dist/applications/buildService.d.ts +5 -1
  2. package/dist/applications/buildService.js +10 -7
  3. package/dist/applications/createCreateApplication.d.ts +6 -2
  4. package/dist/applications/createCreateApplication.js +24 -16
  5. package/dist/applications/createCreateTestToken.d.ts +3 -1
  6. package/dist/applications/createCreateTestToken.js +18 -13
  7. package/dist/applications/createGetApplication.js +2 -2
  8. package/dist/applications/createGetFnUtil.d.ts +22 -18
  9. package/dist/applications/createGetFnUtil.js +3 -5
  10. package/dist/applications/createListApplications.js +3 -4
  11. package/dist/applications/createRotateSigningSecret.d.ts +9 -0
  12. package/dist/{calls/createFetchSingleCall.js → applications/createRotateSigningSecret.js} +23 -20
  13. package/dist/applications/createUpdateApplication.d.ts +6 -2
  14. package/dist/applications/createUpdateApplication.js +35 -36
  15. package/dist/applications/evalKeys.d.ts +9 -0
  16. package/dist/{voice/handlers/dial/recordChannel.js → applications/evalKeys.js} +17 -12
  17. package/dist/applications/session/appModel.d.ts +225 -0
  18. package/dist/applications/session/appModel.js +331 -0
  19. package/dist/applications/types.d.ts +1 -27
  20. package/dist/billing/buildService.d.ts +24 -0
  21. package/dist/billing/buildService.js +116 -0
  22. package/dist/bin/entrypoint.d.ts +1 -0
  23. package/dist/bin/entrypoint.js +180 -0
  24. package/dist/bin/healthcheck.d.ts +2 -0
  25. package/dist/{voice/utils/VoiceServiceClientConstructor.js → bin/healthcheck.js} +24 -9
  26. package/dist/bin/regionHubSetup.d.ts +2 -0
  27. package/dist/bin/regionHubSetup.js +67 -0
  28. package/dist/bin/usage.d.ts +2 -0
  29. package/dist/bin/usage.js +119 -0
  30. package/dist/calls/buildService.d.ts +1 -20
  31. package/dist/calls/buildService.js +59 -6
  32. package/dist/calls/createCall.d.ts +17 -2
  33. package/dist/calls/createCall.js +64 -11
  34. package/dist/calls/createCallPublisher.d.ts +40 -2
  35. package/dist/calls/createCallPublisher.js +43 -9
  36. package/dist/calls/createIsWorkspaceNumber.d.ts +41 -0
  37. package/dist/calls/createIsWorkspaceNumber.js +39 -0
  38. package/dist/calls/createTrackCall.d.ts +55 -2
  39. package/dist/calls/createTrackCall.js +230 -16
  40. package/dist/calls/getCall.d.ts +4 -2
  41. package/dist/calls/getCall.js +2 -3
  42. package/dist/calls/listCalls.d.ts +4 -2
  43. package/dist/calls/listCalls.js +2 -3
  44. package/dist/calls/types.d.ts +11 -2
  45. package/dist/calls/types.js +10 -0
  46. package/dist/{core/buildWelcomeDemoService.d.ts → capabilities/buildService.d.ts} +8 -8
  47. package/dist/capabilities/buildService.js +17 -0
  48. package/dist/capabilities/createGetCapabilities.d.ts +78 -0
  49. package/dist/capabilities/createGetCapabilities.js +98 -0
  50. package/dist/{voice/handlers/utils → capabilities}/index.d.ts +2 -3
  51. package/dist/{voice/handlers/utils → capabilities}/index.js +4 -3
  52. package/dist/config/index.d.ts +23 -0
  53. package/dist/config/index.js +102 -0
  54. package/dist/config/schema.d.ts +1919 -0
  55. package/dist/config/schema.js +357 -0
  56. package/dist/core/allowList.js +2 -1
  57. package/dist/core/applyCatalog.d.ts +10 -0
  58. package/dist/{voice/client/GrpcClientHandler.js → core/applyCatalog.js} +45 -51
  59. package/dist/core/db.d.ts +3 -1
  60. package/dist/core/db.js +2 -1
  61. package/dist/core/durableConsumer.d.ts +41 -0
  62. package/dist/core/durableConsumer.js +104 -0
  63. package/dist/core/httpBridge.d.ts +24 -6
  64. package/dist/core/httpBridge.js +3 -25
  65. package/dist/core/identityConfig.d.ts +2 -35
  66. package/dist/core/identityConfig.js +3 -36
  67. package/dist/core/regionHooks.d.ts +15 -0
  68. package/dist/{calls/influxdb.js → core/regionHooks.js} +4 -8
  69. package/dist/core/runServices.js +98 -15
  70. package/dist/core/services.d.ts +96 -6
  71. package/dist/core/services.js +49 -10
  72. package/dist/{voice/errors/index.d.ts → core/telemetry.d.ts} +2 -2
  73. package/dist/core/telemetry.js +42 -0
  74. package/dist/{applications/utils/convertToApplicationData.d.ts → core/telemetryInterceptor.d.ts} +10 -4
  75. package/dist/core/telemetryInterceptor.js +57 -0
  76. package/dist/core/testTokenConfig.js +4 -1
  77. package/dist/core/upsertRoomrPeer.d.ts +6 -0
  78. package/dist/core/{upsertDefaultPeer.js → upsertRoomrPeer.js} +31 -30
  79. package/dist/envs.d.ts +136 -23
  80. package/dist/envs.js +108 -143
  81. package/dist/index.js +39 -21
  82. package/dist/outbound/createNodeDirectory.d.ts +86 -0
  83. package/dist/outbound/createNodeDirectory.js +140 -0
  84. package/dist/{voice/integrations → outbound}/index.d.ts +4 -1
  85. package/dist/{voice/errors → outbound}/index.js +4 -2
  86. package/dist/outbound/placeOutboundCall.d.ts +96 -0
  87. package/dist/outbound/placeOutboundCall.js +172 -0
  88. package/dist/outbound/placementSweep.d.ts +56 -0
  89. package/dist/outbound/placementSweep.js +127 -0
  90. package/dist/outbound/runOutboundCalls.d.ts +52 -0
  91. package/dist/outbound/runOutboundCalls.js +171 -0
  92. package/dist/providers/createProvidersHandlers.d.ts +39 -0
  93. package/dist/providers/createProvidersHandlers.js +229 -0
  94. package/dist/providers/index.d.ts +47 -0
  95. package/dist/{voice/client → providers}/index.js +15 -6
  96. package/dist/providers/registryUsage.d.ts +48 -0
  97. package/dist/providers/registryUsage.js +236 -0
  98. package/dist/records/createIndexRecord.d.ts +42 -0
  99. package/dist/records/createIndexRecord.js +185 -0
  100. package/dist/records/createRecordsRouter.d.ts +61 -0
  101. package/dist/records/createRecordsRouter.js +330 -0
  102. package/dist/records/createSearchRecords.d.ts +51 -0
  103. package/dist/records/createSearchRecords.js +134 -0
  104. package/dist/{voice/filters → records}/index.d.ts +6 -6
  105. package/dist/{voice/filters → records}/index.js +6 -6
  106. package/dist/records/maintenance.d.ts +33 -0
  107. package/dist/records/maintenance.js +166 -0
  108. package/dist/records/runCallRecords.d.ts +48 -0
  109. package/dist/records/runCallRecords.js +49 -0
  110. package/dist/{events/createPerCallCache.d.ts → records/stores.d.ts} +4 -7
  111. package/dist/{voice/handlers/utils/isDtmf.js → records/stores.js} +9 -3
  112. package/dist/records/types.d.ts +104 -0
  113. package/dist/regions/configSync.d.ts +130 -0
  114. package/dist/regions/configSync.js +316 -0
  115. package/dist/regions/createRegionsRouter.d.ts +151 -0
  116. package/dist/regions/createRegionsRouter.js +391 -0
  117. package/dist/regions/endpoints.d.ts +41 -0
  118. package/dist/regions/endpoints.js +90 -0
  119. package/dist/regions/enrollmentToken.d.ts +41 -0
  120. package/dist/regions/enrollmentToken.js +94 -0
  121. package/dist/regions/httpAuth.d.ts +39 -0
  122. package/dist/regions/httpAuth.js +78 -0
  123. package/dist/regions/ids.d.ts +15 -0
  124. package/dist/regions/ids.js +81 -0
  125. package/dist/{voice/client → regions}/index.d.ts +17 -6
  126. package/dist/regions/index.js +51 -0
  127. package/dist/regions/link.d.ts +17 -0
  128. package/dist/regions/link.js +170 -0
  129. package/dist/regions/natsAuth.d.ts +41 -0
  130. package/dist/regions/natsAuth.js +64 -0
  131. package/dist/regions/natsJwt.d.ts +23 -0
  132. package/dist/regions/natsJwt.js +26 -0
  133. package/dist/regions/relay.d.ts +45 -0
  134. package/dist/regions/relay.js +203 -0
  135. package/dist/regions/relayHttp.d.ts +7 -0
  136. package/dist/regions/relayHttp.js +107 -0
  137. package/dist/regions/relaySlots.d.ts +18 -0
  138. package/dist/regions/relaySlots.js +118 -0
  139. package/dist/regions/runRegions.d.ts +111 -0
  140. package/dist/regions/runRegions.js +235 -0
  141. package/dist/regions/service.d.ts +129 -0
  142. package/dist/regions/service.js +558 -0
  143. package/dist/regions/sources.d.ts +20 -0
  144. package/dist/regions/sources.js +191 -0
  145. package/dist/regions/status.d.ts +35 -0
  146. package/dist/regions/status.js +63 -0
  147. package/dist/regions/types.d.ts +123 -0
  148. package/dist/regions/types.js +41 -0
  149. package/dist/{voice/integrations/getSttConfig.d.ts → regions/withConfigChangeHook.d.ts} +13 -7
  150. package/dist/regions/withConfigChangeHook.js +44 -0
  151. package/dist/secrets/createGetFnUtil.d.ts +2 -2
  152. package/dist/session/createSessionRouter.d.ts +49 -0
  153. package/dist/session/createSessionRouter.js +206 -0
  154. package/dist/{voice/handlers/dial → session}/index.d.ts +1 -1
  155. package/dist/{voice/handlers/dial → session}/index.js +1 -1
  156. package/dist/usage/buildService.d.ts +16 -0
  157. package/dist/{voice/integrations/getTtsConfig.js → usage/buildService.js} +13 -7
  158. package/dist/{voice/tts/utils/convertUlawToPCM16.d.ts → usage/createGetUsage.d.ts} +7 -6
  159. package/dist/usage/createGetUsage.js +118 -0
  160. package/dist/usage/ingestUsage.d.ts +7 -0
  161. package/dist/usage/ingestUsage.js +87 -0
  162. package/dist/usage/publishRecordedUsage.d.ts +52 -0
  163. package/dist/usage/publishRecordedUsage.js +103 -0
  164. package/dist/{utils/createHandleDialEventsWithNats.d.ts → usage/publishUsage.d.ts} +10 -4
  165. package/dist/usage/publishUsage.js +50 -0
  166. package/dist/usage/rebuildUsage.d.ts +48 -0
  167. package/dist/usage/rebuildUsage.js +104 -0
  168. package/dist/usage/runUsageConsumer.d.ts +22 -0
  169. package/dist/usage/runUsageConsumer.js +78 -0
  170. package/dist/usage/snapshotStorage.d.ts +14 -0
  171. package/dist/usage/snapshotStorage.js +95 -0
  172. package/dist/{voice/integrations/getTtsConfig.d.ts → usage/types.d.ts} +17 -6
  173. package/dist/utils/createCheckNumberPreconditions.js +4 -0
  174. package/dist/utils/index.d.ts +0 -2
  175. package/dist/utils/index.js +0 -2
  176. package/dist/voice/stt/Deepgram.d.ts +4 -57
  177. package/dist/voice/stt/Deepgram.js +15 -286
  178. package/dist/voice/stt/Google.d.ts +4 -15
  179. package/dist/voice/stt/Google.js +7 -103
  180. package/dist/voice/stt/types.d.ts +2 -38
  181. package/dist/voice/stt/types.js +25 -3
  182. package/dist/voice/tts/Azure.d.ts +4 -34
  183. package/dist/voice/tts/Azure.js +25 -105
  184. package/dist/voice/tts/Deepgram.d.ts +4 -38
  185. package/dist/voice/tts/Deepgram.js +25 -82
  186. package/dist/voice/tts/ElevenLabs.d.ts +4 -18
  187. package/dist/voice/tts/ElevenLabs.js +6 -97
  188. package/dist/voice/tts/Google.d.ts +4 -38
  189. package/dist/voice/tts/Google.js +25 -91
  190. package/dist/webhooks/createWebhooksHandlers.d.ts +37 -0
  191. package/dist/webhooks/createWebhooksHandlers.js +217 -0
  192. package/dist/webhooks/index.d.ts +37 -0
  193. package/dist/webhooks/index.js +51 -0
  194. package/dist/webhooks/lostCalls.d.ts +49 -0
  195. package/dist/webhooks/lostCalls.js +147 -0
  196. package/dist/webhooks/nodeCallEvents.d.ts +73 -0
  197. package/dist/webhooks/nodeCallEvents.js +177 -0
  198. package/dist/webhooks/runWebhookFanout.d.ts +44 -0
  199. package/dist/webhooks/runWebhookFanout.js +202 -0
  200. package/package.json +21 -31
  201. package/dist/applications/utils/applicationWithEncodedStruct.d.ts +0 -3
  202. package/dist/applications/utils/applicationWithEncodedStruct.js +0 -50
  203. package/dist/applications/utils/convertToApplicationData.js +0 -37
  204. package/dist/applications/validation/assistantWithoutApiKeySchema.d.ts +0 -786
  205. package/dist/applications/validation/assistantWithoutApiKeySchema.js +0 -35
  206. package/dist/applications/validation/createValidationSchema.d.ts +0 -1474
  207. package/dist/applications/validation/createValidationSchema.js +0 -67
  208. package/dist/applications/validation/prepareForValidation.d.ts +0 -21
  209. package/dist/applications/validation/prepareForValidation.js +0 -35
  210. package/dist/applications/validation/speechValidators.d.ts +0 -47
  211. package/dist/applications/validation/speechValidators.js +0 -50
  212. package/dist/applications/validation/validOrThrow.d.ts +0 -21
  213. package/dist/applications/validation/validOrThrow.js +0 -15
  214. package/dist/calls/createFetchCalls.d.ts +0 -22
  215. package/dist/calls/createFetchCalls.js +0 -88
  216. package/dist/calls/createFetchSingleCall.d.ts +0 -22
  217. package/dist/calls/influxdb.d.ts +0 -2
  218. package/dist/calls/runCallManager.d.ts +0 -8
  219. package/dist/calls/runCallManager.js +0 -75
  220. package/dist/core/buildWelcomeDemoService.js +0 -97
  221. package/dist/core/upsertDefaultPeer.d.ts +0 -2
  222. package/dist/events/amdResultCache.d.ts +0 -23
  223. package/dist/events/amdResultCache.js +0 -35
  224. package/dist/events/createInfluxDbPub.d.ts +0 -13
  225. package/dist/events/createInfluxDbPub.js +0 -89
  226. package/dist/events/createPerCallCache.js +0 -46
  227. package/dist/events/mapCallDirectionToEnum.d.ts +0 -21
  228. package/dist/events/mapCallDirectionToEnum.js +0 -37
  229. package/dist/events/nats.d.ts +0 -10
  230. package/dist/events/nats.js +0 -82
  231. package/dist/events/transformEvent.d.ts +0 -2
  232. package/dist/events/transformEvent.js +0 -87
  233. package/dist/events/types.d.ts +0 -26
  234. package/dist/utils/createHandleDialEventsWithNats.js +0 -24
  235. package/dist/utils/createHandleDialEventsWithVoiceClient.d.ts +0 -23
  236. package/dist/utils/createHandleDialEventsWithVoiceClient.js +0 -27
  237. package/dist/utils/getIntegrationsFromFile.d.ts +0 -2
  238. package/dist/utils/getIntegrationsFromFile.js +0 -49
  239. package/dist/utils/mapDialStatus.d.ts +0 -21
  240. package/dist/utils/mapDialStatus.js +0 -38
  241. package/dist/voice/VoiceDispatcher.d.ts +0 -21
  242. package/dist/voice/VoiceDispatcher.js +0 -122
  243. package/dist/voice/amd/mapAsteriskAmd.d.ts +0 -38
  244. package/dist/voice/amd/mapAsteriskAmd.js +0 -68
  245. package/dist/voice/client/AudioSocketHandler.d.ts +0 -38
  246. package/dist/voice/client/AudioSocketHandler.js +0 -70
  247. package/dist/voice/client/AuthorizationHandler.d.ts +0 -13
  248. package/dist/voice/client/AuthorizationHandler.js +0 -78
  249. package/dist/voice/client/ExternalMediaHandler.d.ts +0 -32
  250. package/dist/voice/client/ExternalMediaHandler.js +0 -59
  251. package/dist/voice/client/GrpcClientHandler.d.ts +0 -36
  252. package/dist/voice/client/SpeechHandler.d.ts +0 -60
  253. package/dist/voice/client/SpeechHandler.js +0 -120
  254. package/dist/voice/client/VoiceClientImpl.d.ts +0 -79
  255. package/dist/voice/client/VoiceClientImpl.js +0 -198
  256. package/dist/voice/connectToAri.d.ts +0 -2
  257. package/dist/voice/connectToAri.js +0 -81
  258. package/dist/voice/createCreateVoiceClient.d.ts +0 -9
  259. package/dist/voice/createCreateVoiceClient.js +0 -97
  260. package/dist/voice/errors/ChannelVarNotFoundError.d.ts +0 -23
  261. package/dist/voice/errors/ChannelVarNotFoundError.js +0 -10
  262. package/dist/voice/errors/MethodNotImplementedError.d.ts +0 -22
  263. package/dist/voice/errors/MethodNotImplementedError.js +0 -27
  264. package/dist/voice/filters/AudioFilterFactory.d.ts +0 -35
  265. package/dist/voice/filters/AudioFilterFactory.js +0 -94
  266. package/dist/voice/filters/aiCoustics/createAiCousticsFilter.d.ts +0 -64
  267. package/dist/voice/filters/aiCoustics/createAiCousticsFilter.js +0 -252
  268. package/dist/voice/filters/aiCoustics/types.d.ts +0 -45
  269. package/dist/voice/filters/aiCoustics/types.js +0 -29
  270. package/dist/voice/filters/createAudioFilterChain.d.ts +0 -9
  271. package/dist/voice/filters/createAudioFilterChain.js +0 -171
  272. package/dist/voice/filters/createAudioFilterSession.d.ts +0 -15
  273. package/dist/voice/filters/createAudioFilterSession.js +0 -114
  274. package/dist/voice/filters/pcm.d.ts +0 -21
  275. package/dist/voice/filters/pcm.js +0 -37
  276. package/dist/voice/filters/types.d.ts +0 -61
  277. package/dist/voice/filters/types.js +0 -26
  278. package/dist/voice/handlers/createAnswerHandler.d.ts +0 -23
  279. package/dist/voice/handlers/createAnswerHandler.js +0 -24
  280. package/dist/voice/handlers/createHangupHandler.d.ts +0 -23
  281. package/dist/voice/handlers/createHangupHandler.js +0 -28
  282. package/dist/voice/handlers/createMuteHandler.d.ts +0 -4
  283. package/dist/voice/handlers/createMuteHandler.js +0 -27
  284. package/dist/voice/handlers/createPlayDtmfHandler.d.ts +0 -4
  285. package/dist/voice/handlers/createPlayDtmfHandler.js +0 -27
  286. package/dist/voice/handlers/createPlayHandler.d.ts +0 -4
  287. package/dist/voice/handlers/createPlayHandler.js +0 -33
  288. package/dist/voice/handlers/createPlaybackControlHandler.d.ts +0 -4
  289. package/dist/voice/handlers/createPlaybackControlHandler.js +0 -62
  290. package/dist/voice/handlers/createRecordHandler.d.ts +0 -4
  291. package/dist/voice/handlers/createRecordHandler.js +0 -58
  292. package/dist/voice/handlers/createSayHandler.d.ts +0 -4
  293. package/dist/voice/handlers/createSayHandler.js +0 -31
  294. package/dist/voice/handlers/createSetAudioFiltersHandler.d.ts +0 -11
  295. package/dist/voice/handlers/createSetAudioFiltersHandler.js +0 -74
  296. package/dist/voice/handlers/createStopSayHandler.d.ts +0 -3
  297. package/dist/voice/handlers/createStopSayHandler.js +0 -34
  298. package/dist/voice/handlers/createStreamGatherHandler.d.ts +0 -3
  299. package/dist/voice/handlers/createStreamGatherHandler.js +0 -74
  300. package/dist/voice/handlers/createStreamHandler.d.ts +0 -3
  301. package/dist/voice/handlers/createStreamHandler.js +0 -70
  302. package/dist/voice/handlers/createUnmuteHandler.d.ts +0 -4
  303. package/dist/voice/handlers/createUnmuteHandler.js +0 -27
  304. package/dist/voice/handlers/dial/createDialHandler.d.ts +0 -23
  305. package/dist/voice/handlers/dial/createDialHandler.js +0 -78
  306. package/dist/voice/handlers/dial/handleChannelLeftBridge.d.ts +0 -24
  307. package/dist/voice/handlers/dial/handleChannelLeftBridge.js +0 -29
  308. package/dist/voice/handlers/dial/handleStasisEnd.d.ts +0 -21
  309. package/dist/voice/handlers/dial/handleStasisEnd.js +0 -19
  310. package/dist/voice/handlers/dial/handleStasisStart.d.ts +0 -27
  311. package/dist/voice/handlers/dial/handleStasisStart.js +0 -52
  312. package/dist/voice/handlers/dial/recordChannel.d.ts +0 -22
  313. package/dist/voice/handlers/gather/createGatherHandler.d.ts +0 -3
  314. package/dist/voice/handlers/gather/createGatherHandler.js +0 -86
  315. package/dist/voice/handlers/gather/getTimeoutPromise.d.ts +0 -26
  316. package/dist/voice/handlers/gather/getTimeoutPromise.js +0 -18
  317. package/dist/voice/handlers/index.d.ts +0 -33
  318. package/dist/voice/handlers/index.js +0 -49
  319. package/dist/voice/handlers/utils/awaitForPlaybackFinished.d.ts +0 -21
  320. package/dist/voice/handlers/utils/awaitForPlaybackFinished.js +0 -25
  321. package/dist/voice/handlers/utils/awaitForRecordingFinished.d.ts +0 -5
  322. package/dist/voice/handlers/utils/awaitForRecordingFinished.js +0 -53
  323. package/dist/voice/handlers/utils/isDtmf.d.ts +0 -20
  324. package/dist/voice/handlers/utils/textChunksByClause.d.ts +0 -2
  325. package/dist/voice/handlers/utils/textChunksByClause.js +0 -41
  326. package/dist/voice/handlers/utils/textChunksByFirstNaturalPause.d.ts +0 -2
  327. package/dist/voice/handlers/utils/textChunksByFirstNaturalPause.js +0 -34
  328. package/dist/voice/handlers/utils/withErrorHandling.d.ts +0 -22
  329. package/dist/voice/handlers/utils/withErrorHandling.js +0 -38
  330. package/dist/voice/integrations/ApplicationNotFoundError.d.ts +0 -22
  331. package/dist/voice/integrations/ApplicationNotFoundError.js +0 -28
  332. package/dist/voice/integrations/createCreateContainer.d.ts +0 -4
  333. package/dist/voice/integrations/createCreateContainer.js +0 -76
  334. package/dist/voice/integrations/getSttConfig.js +0 -30
  335. package/dist/voice/integrations/index.js +0 -35
  336. package/dist/voice/integrations/types.d.ts +0 -29
  337. package/dist/voice/stt/AbstractSpeechToText.d.ts +0 -33
  338. package/dist/voice/stt/AbstractSpeechToText.js +0 -19
  339. package/dist/voice/stt/SpeechToTextFactory.d.ts +0 -9
  340. package/dist/voice/stt/SpeechToTextFactory.js +0 -43
  341. package/dist/voice/transcribeOnConnection.d.ts +0 -35
  342. package/dist/voice/transcribeOnConnection.js +0 -91
  343. package/dist/voice/tts/AbstractTextToSpeech.d.ts +0 -40
  344. package/dist/voice/tts/AbstractTextToSpeech.js +0 -50
  345. package/dist/voice/tts/TextToSpeechFactory.d.ts +0 -8
  346. package/dist/voice/tts/TextToSpeechFactory.js +0 -47
  347. package/dist/voice/tts/types.d.ts +0 -48
  348. package/dist/voice/tts/types.js +0 -2
  349. package/dist/voice/tts/utils/convertUlawToPCM16.js +0 -40
  350. package/dist/voice/tts/utils/createChunkedSynthesisStream.d.ts +0 -28
  351. package/dist/voice/tts/utils/createChunkedSynthesisStream.js +0 -78
  352. package/dist/voice/tts/utils/createErrorStream.d.ts +0 -21
  353. package/dist/voice/tts/utils/createErrorStream.js +0 -28
  354. package/dist/voice/tts/utils/index.d.ts +0 -23
  355. package/dist/voice/tts/utils/index.js +0 -39
  356. package/dist/voice/tts/utils/isSsml.d.ts +0 -20
  357. package/dist/voice/tts/utils/isSsml.js +0 -25
  358. package/dist/voice/tts/utils/streamToBuffer.d.ts +0 -20
  359. package/dist/voice/tts/utils/streamToBuffer.js +0 -60
  360. package/dist/voice/types/ari.d.ts +0 -43
  361. package/dist/voice/types/ari.js +0 -48
  362. package/dist/voice/types/index.d.ts +0 -20
  363. package/dist/voice/types/index.js +0 -36
  364. package/dist/voice/types/voice.d.ts +0 -67
  365. package/dist/voice/types/voice.js +0 -2
  366. package/dist/voice/utils/VoiceServiceClientConstructor.d.ts +0 -3
  367. package/dist/voice/utils/createExternalMediaConfig.d.ts +0 -12
  368. package/dist/voice/utils/createExternalMediaConfig.js +0 -37
  369. package/dist/voice/utils/createGetChannelVar.d.ts +0 -22
  370. package/dist/voice/utils/createGetChannelVar.js +0 -27
  371. package/dist/voice/utils/createGetChannelVarWithoutThrow.d.ts +0 -22
  372. package/dist/voice/utils/createGetChannelVarWithoutThrow.js +0 -26
  373. package/dist/voice/utils/index.d.ts +0 -22
  374. package/dist/voice/utils/index.js +0 -38
  375. /package/dist/{events → records}/types.js +0 -0
  376. /package/dist/{voice/integrations → usage}/types.js +0 -0
@@ -1,1474 +0,0 @@
1
- import { ApplicationType } from "@prisma/client";
2
- import { z } from "zod";
3
- declare function createValidationSchema(request: {
4
- applicationType: ApplicationType;
5
- ttsEngineName: string;
6
- sttEngineName: string;
7
- }): z.ZodObject<{
8
- name: z.ZodString;
9
- type: z.ZodNativeEnum<{
10
- EXTERNAL: "EXTERNAL";
11
- AUTOPILOT: "AUTOPILOT";
12
- }>;
13
- endpoint: z.ZodEffects<z.ZodString, string, string>;
14
- textToSpeech: z.ZodObject<{
15
- productRef: z.ZodString;
16
- config: any;
17
- }, "strip", z.ZodTypeAny, {
18
- [x: string]: any;
19
- productRef?: unknown;
20
- config?: unknown;
21
- }, {
22
- [x: string]: any;
23
- productRef?: unknown;
24
- config?: unknown;
25
- }> | z.ZodUndefined;
26
- speechToText: z.ZodUndefined | z.ZodObject<{
27
- productRef: z.ZodString;
28
- config: any;
29
- }, "strip", z.ZodTypeAny, {
30
- [x: string]: any;
31
- productRef?: unknown;
32
- config?: unknown;
33
- }, {
34
- [x: string]: any;
35
- productRef?: unknown;
36
- config?: unknown;
37
- }>;
38
- intelligence: z.ZodUndefined | z.ZodEffects<z.ZodObject<{
39
- productRef: z.ZodString;
40
- config: z.ZodObject<{
41
- audioFilters: z.ZodDefault<z.ZodArray<z.ZodObject<{
42
- name: z.ZodString;
43
- options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
44
- }, "strip", z.ZodTypeAny, {
45
- options?: Record<string, unknown>;
46
- name?: string;
47
- }, {
48
- options?: Record<string, unknown>;
49
- name?: string;
50
- }>, "many">>;
51
- conversationSettings: z.ZodObject<{
52
- firstMessage: z.ZodOptional<z.ZodString>;
53
- systemPrompt: z.ZodString;
54
- goodbyeMessage: z.ZodString;
55
- systemErrorMessage: z.ZodString;
56
- initialDtmf: z.ZodOptional<z.ZodString>;
57
- maxSessionDuration: z.ZodDefault<z.ZodNumber>;
58
- maxSpeechWaitTimeout: z.ZodDefault<z.ZodNumber>;
59
- transferOptions: z.ZodOptional<z.ZodObject<{
60
- phoneNumber: z.ZodString;
61
- message: z.ZodString;
62
- timeout: z.ZodDefault<z.ZodNumber>;
63
- }, "strip", z.ZodTypeAny, {
64
- message?: string;
65
- phoneNumber?: string;
66
- timeout?: number;
67
- }, {
68
- message?: string;
69
- phoneNumber?: string;
70
- timeout?: number;
71
- }>>;
72
- idleOptions: z.ZodObject<{
73
- message: z.ZodString;
74
- timeout: z.ZodDefault<z.ZodNumber>;
75
- maxTimeoutCount: z.ZodDefault<z.ZodNumber>;
76
- }, "strip", z.ZodTypeAny, {
77
- message?: string;
78
- timeout?: number;
79
- maxTimeoutCount?: number;
80
- }, {
81
- message?: string;
82
- timeout?: number;
83
- maxTimeoutCount?: number;
84
- }>;
85
- allowUserBargeIn: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
86
- vad: z.ZodDefault<z.ZodObject<{
87
- pathToModel: z.ZodOptional<z.ZodString>;
88
- activationThreshold: z.ZodNumber;
89
- deactivationThreshold: z.ZodNumber;
90
- debounceFrames: z.ZodNumber;
91
- }, "strip", z.ZodTypeAny, {
92
- pathToModel?: string;
93
- activationThreshold?: number;
94
- deactivationThreshold?: number;
95
- debounceFrames?: number;
96
- }, {
97
- pathToModel?: string;
98
- activationThreshold?: number;
99
- deactivationThreshold?: number;
100
- debounceFrames?: number;
101
- }>>;
102
- }, "strip", z.ZodTypeAny, {
103
- firstMessage?: string;
104
- systemPrompt?: string;
105
- goodbyeMessage?: string;
106
- systemErrorMessage?: string;
107
- initialDtmf?: string;
108
- maxSessionDuration?: number;
109
- maxSpeechWaitTimeout?: number;
110
- transferOptions?: {
111
- message?: string;
112
- phoneNumber?: string;
113
- timeout?: number;
114
- };
115
- idleOptions?: {
116
- message?: string;
117
- timeout?: number;
118
- maxTimeoutCount?: number;
119
- };
120
- allowUserBargeIn?: boolean;
121
- vad?: {
122
- pathToModel?: string;
123
- activationThreshold?: number;
124
- deactivationThreshold?: number;
125
- debounceFrames?: number;
126
- };
127
- }, {
128
- firstMessage?: string;
129
- systemPrompt?: string;
130
- goodbyeMessage?: string;
131
- systemErrorMessage?: string;
132
- initialDtmf?: string;
133
- maxSessionDuration?: number;
134
- maxSpeechWaitTimeout?: number;
135
- transferOptions?: {
136
- message?: string;
137
- phoneNumber?: string;
138
- timeout?: number;
139
- };
140
- idleOptions?: {
141
- message?: string;
142
- timeout?: number;
143
- maxTimeoutCount?: number;
144
- };
145
- allowUserBargeIn?: boolean;
146
- vad?: {
147
- pathToModel?: string;
148
- activationThreshold?: number;
149
- deactivationThreshold?: number;
150
- debounceFrames?: number;
151
- };
152
- }>;
153
- eventsHook: z.ZodOptional<z.ZodObject<{
154
- url: z.ZodString;
155
- headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
156
- events: z.ZodDefault<z.ZodArray<z.ZodNativeEnum<typeof import("@fonoster/common").EventsHookAllowedEvents>, "many">>;
157
- }, "strip", z.ZodTypeAny, {
158
- url?: string;
159
- headers?: Record<string, string>;
160
- events?: import("@fonoster/common").EventsHookAllowedEvents[];
161
- }, {
162
- url?: string;
163
- headers?: Record<string, string>;
164
- events?: import("@fonoster/common").EventsHookAllowedEvents[];
165
- }>>;
166
- testCases: z.ZodOptional<z.ZodObject<{
167
- evalsLanguageModel: z.ZodObject<{
168
- provider: z.ZodEnum<["openai"]>;
169
- model: z.ZodString;
170
- apiKey: z.ZodOptional<z.ZodString>;
171
- }, "strip", z.ZodTypeAny, {
172
- provider?: "openai";
173
- apiKey?: string;
174
- model?: string;
175
- }, {
176
- provider?: "openai";
177
- apiKey?: string;
178
- model?: string;
179
- }>;
180
- evalsSystemPrompt: z.ZodOptional<z.ZodString>;
181
- scenarios: z.ZodArray<z.ZodObject<{
182
- ref: z.ZodString;
183
- description: z.ZodString;
184
- telephonyContext: z.ZodObject<{
185
- callDirection: z.ZodNativeEnum<typeof import("@fonoster/types").CallDirection>;
186
- ingressNumber: z.ZodString;
187
- callerNumber: z.ZodString;
188
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
189
- }, "strip", z.ZodTypeAny, {
190
- callDirection?: import("@fonoster/types").CallDirection;
191
- ingressNumber?: string;
192
- callerNumber?: string;
193
- metadata?: Record<string, string>;
194
- }, {
195
- callDirection?: import("@fonoster/types").CallDirection;
196
- ingressNumber?: string;
197
- callerNumber?: string;
198
- metadata?: Record<string, string>;
199
- }>;
200
- conversation: z.ZodArray<z.ZodObject<{
201
- userInput: z.ZodString;
202
- expected: z.ZodObject<{
203
- text: z.ZodObject<{
204
- type: z.ZodEnum<["EXACT", "SIMILAR"]>;
205
- response: z.ZodString;
206
- }, "strip", z.ZodTypeAny, {
207
- type?: "EXACT" | "SIMILAR";
208
- response?: string;
209
- }, {
210
- type?: "EXACT" | "SIMILAR";
211
- response?: string;
212
- }>;
213
- tools: z.ZodOptional<z.ZodArray<z.ZodObject<{
214
- tool: z.ZodString;
215
- parameters: z.ZodRecord<z.ZodString, z.ZodAny>;
216
- }, "strip", z.ZodTypeAny, {
217
- parameters?: Record<string, any>;
218
- tool?: string;
219
- }, {
220
- parameters?: Record<string, any>;
221
- tool?: string;
222
- }>, "many">>;
223
- }, "strip", z.ZodTypeAny, {
224
- tools?: {
225
- parameters?: Record<string, any>;
226
- tool?: string;
227
- }[];
228
- text?: {
229
- type?: "EXACT" | "SIMILAR";
230
- response?: string;
231
- };
232
- }, {
233
- tools?: {
234
- parameters?: Record<string, any>;
235
- tool?: string;
236
- }[];
237
- text?: {
238
- type?: "EXACT" | "SIMILAR";
239
- response?: string;
240
- };
241
- }>;
242
- }, "strip", z.ZodTypeAny, {
243
- expected?: {
244
- tools?: {
245
- parameters?: Record<string, any>;
246
- tool?: string;
247
- }[];
248
- text?: {
249
- type?: "EXACT" | "SIMILAR";
250
- response?: string;
251
- };
252
- };
253
- userInput?: string;
254
- }, {
255
- expected?: {
256
- tools?: {
257
- parameters?: Record<string, any>;
258
- tool?: string;
259
- }[];
260
- text?: {
261
- type?: "EXACT" | "SIMILAR";
262
- response?: string;
263
- };
264
- };
265
- userInput?: string;
266
- }>, "many">;
267
- }, "strip", z.ZodTypeAny, {
268
- description?: string;
269
- ref?: string;
270
- telephonyContext?: {
271
- callDirection?: import("@fonoster/types").CallDirection;
272
- ingressNumber?: string;
273
- callerNumber?: string;
274
- metadata?: Record<string, string>;
275
- };
276
- conversation?: {
277
- expected?: {
278
- tools?: {
279
- parameters?: Record<string, any>;
280
- tool?: string;
281
- }[];
282
- text?: {
283
- type?: "EXACT" | "SIMILAR";
284
- response?: string;
285
- };
286
- };
287
- userInput?: string;
288
- }[];
289
- }, {
290
- description?: string;
291
- ref?: string;
292
- telephonyContext?: {
293
- callDirection?: import("@fonoster/types").CallDirection;
294
- ingressNumber?: string;
295
- callerNumber?: string;
296
- metadata?: Record<string, string>;
297
- };
298
- conversation?: {
299
- expected?: {
300
- tools?: {
301
- parameters?: Record<string, any>;
302
- tool?: string;
303
- }[];
304
- text?: {
305
- type?: "EXACT" | "SIMILAR";
306
- response?: string;
307
- };
308
- };
309
- userInput?: string;
310
- }[];
311
- }>, "many">;
312
- }, "strip", z.ZodTypeAny, {
313
- evalsLanguageModel?: {
314
- provider?: "openai";
315
- apiKey?: string;
316
- model?: string;
317
- };
318
- evalsSystemPrompt?: string;
319
- scenarios?: {
320
- description?: string;
321
- ref?: string;
322
- telephonyContext?: {
323
- callDirection?: import("@fonoster/types").CallDirection;
324
- ingressNumber?: string;
325
- callerNumber?: string;
326
- metadata?: Record<string, string>;
327
- };
328
- conversation?: {
329
- expected?: {
330
- tools?: {
331
- parameters?: Record<string, any>;
332
- tool?: string;
333
- }[];
334
- text?: {
335
- type?: "EXACT" | "SIMILAR";
336
- response?: string;
337
- };
338
- };
339
- userInput?: string;
340
- }[];
341
- }[];
342
- }, {
343
- evalsLanguageModel?: {
344
- provider?: "openai";
345
- apiKey?: string;
346
- model?: string;
347
- };
348
- evalsSystemPrompt?: string;
349
- scenarios?: {
350
- description?: string;
351
- ref?: string;
352
- telephonyContext?: {
353
- callDirection?: import("@fonoster/types").CallDirection;
354
- ingressNumber?: string;
355
- callerNumber?: string;
356
- metadata?: Record<string, string>;
357
- };
358
- conversation?: {
359
- expected?: {
360
- tools?: {
361
- parameters?: Record<string, any>;
362
- tool?: string;
363
- }[];
364
- text?: {
365
- type?: "EXACT" | "SIMILAR";
366
- response?: string;
367
- };
368
- };
369
- userInput?: string;
370
- }[];
371
- }[];
372
- }>>;
373
- } & {
374
- languageModel: z.ZodEffects<z.ZodObject<{
375
- provider: z.ZodNativeEnum<typeof import("@fonoster/common").LanguageModelProvider>;
376
- apiKey: z.ZodOptional<z.ZodString>;
377
- model: z.ZodString;
378
- temperature: z.ZodNumber;
379
- maxTokens: z.ZodNumber;
380
- baseUrl: z.ZodOptional<z.ZodString>;
381
- knowledgeBase: z.ZodDefault<z.ZodArray<z.ZodObject<{
382
- type: z.ZodEnum<["s3"]>;
383
- title: z.ZodString;
384
- document: z.ZodString;
385
- }, "strip", z.ZodTypeAny, {
386
- type?: "s3";
387
- title?: string;
388
- document?: string;
389
- }, {
390
- type?: "s3";
391
- title?: string;
392
- document?: string;
393
- }>, "many">>;
394
- tools: z.ZodDefault<z.ZodArray<z.ZodObject<{
395
- name: z.ZodString;
396
- description: z.ZodString;
397
- parameters: z.ZodObject<{
398
- type: z.ZodEnum<["object", "array"]>;
399
- properties: z.ZodRecord<z.ZodString, z.ZodEffects<z.ZodObject<{
400
- type: z.ZodString;
401
- format: z.ZodOptional<z.ZodEnum<["enum", "date-time"]>>;
402
- pattern: z.ZodOptional<z.ZodString>;
403
- }, "strip", z.ZodTypeAny, {
404
- type?: string;
405
- format?: "enum" | "date-time";
406
- pattern?: string;
407
- }, {
408
- type?: string;
409
- format?: "enum" | "date-time";
410
- pattern?: string;
411
- }>, {
412
- type?: string;
413
- format?: "enum" | "date-time";
414
- pattern?: string;
415
- }, {
416
- type?: string;
417
- format?: "enum" | "date-time";
418
- pattern?: string;
419
- }>>;
420
- required: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
421
- }, "strip", z.ZodTypeAny, {
422
- type?: "object" | "array";
423
- properties?: Record<string, {
424
- type?: string;
425
- format?: "enum" | "date-time";
426
- pattern?: string;
427
- }>;
428
- required?: string[];
429
- }, {
430
- type?: "object" | "array";
431
- properties?: Record<string, {
432
- type?: string;
433
- format?: "enum" | "date-time";
434
- pattern?: string;
435
- }>;
436
- required?: string[];
437
- }>;
438
- requestStartMessage: z.ZodOptional<z.ZodString>;
439
- operation: z.ZodObject<{
440
- method: z.ZodDefault<z.ZodNativeEnum<typeof import("@fonoster/common").AllowedHttpMethod>>;
441
- url: z.ZodString;
442
- waitForResponse: z.ZodDefault<z.ZodBoolean>;
443
- headers: z.ZodOptional<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodString>, Record<string, string>, Record<string, string>>>;
444
- }, "strip", z.ZodTypeAny, {
445
- url?: string;
446
- method?: import("@fonoster/common").AllowedHttpMethod;
447
- headers?: Record<string, string>;
448
- waitForResponse?: boolean;
449
- }, {
450
- url?: string;
451
- method?: import("@fonoster/common").AllowedHttpMethod;
452
- headers?: Record<string, string>;
453
- waitForResponse?: boolean;
454
- }>;
455
- }, "strip", z.ZodTypeAny, {
456
- name?: string;
457
- description?: string;
458
- parameters?: {
459
- type?: "object" | "array";
460
- properties?: Record<string, {
461
- type?: string;
462
- format?: "enum" | "date-time";
463
- pattern?: string;
464
- }>;
465
- required?: string[];
466
- };
467
- requestStartMessage?: string;
468
- operation?: {
469
- url?: string;
470
- method?: import("@fonoster/common").AllowedHttpMethod;
471
- headers?: Record<string, string>;
472
- waitForResponse?: boolean;
473
- };
474
- }, {
475
- name?: string;
476
- description?: string;
477
- parameters?: {
478
- type?: "object" | "array";
479
- properties?: Record<string, {
480
- type?: string;
481
- format?: "enum" | "date-time";
482
- pattern?: string;
483
- }>;
484
- required?: string[];
485
- };
486
- requestStartMessage?: string;
487
- operation?: {
488
- url?: string;
489
- method?: import("@fonoster/common").AllowedHttpMethod;
490
- headers?: Record<string, string>;
491
- waitForResponse?: boolean;
492
- };
493
- }>, "many">>;
494
- }, "strip", z.ZodTypeAny, {
495
- provider?: import("@fonoster/common").LanguageModelProvider;
496
- apiKey?: string;
497
- model?: string;
498
- temperature?: number;
499
- maxTokens?: number;
500
- baseUrl?: string;
501
- knowledgeBase?: {
502
- type?: "s3";
503
- title?: string;
504
- document?: string;
505
- }[];
506
- tools?: {
507
- name?: string;
508
- description?: string;
509
- parameters?: {
510
- type?: "object" | "array";
511
- properties?: Record<string, {
512
- type?: string;
513
- format?: "enum" | "date-time";
514
- pattern?: string;
515
- }>;
516
- required?: string[];
517
- };
518
- requestStartMessage?: string;
519
- operation?: {
520
- url?: string;
521
- method?: import("@fonoster/common").AllowedHttpMethod;
522
- headers?: Record<string, string>;
523
- waitForResponse?: boolean;
524
- };
525
- }[];
526
- }, {
527
- provider?: import("@fonoster/common").LanguageModelProvider;
528
- apiKey?: string;
529
- model?: string;
530
- temperature?: number;
531
- maxTokens?: number;
532
- baseUrl?: string;
533
- knowledgeBase?: {
534
- type?: "s3";
535
- title?: string;
536
- document?: string;
537
- }[];
538
- tools?: {
539
- name?: string;
540
- description?: string;
541
- parameters?: {
542
- type?: "object" | "array";
543
- properties?: Record<string, {
544
- type?: string;
545
- format?: "enum" | "date-time";
546
- pattern?: string;
547
- }>;
548
- required?: string[];
549
- };
550
- requestStartMessage?: string;
551
- operation?: {
552
- url?: string;
553
- method?: import("@fonoster/common").AllowedHttpMethod;
554
- headers?: Record<string, string>;
555
- waitForResponse?: boolean;
556
- };
557
- }[];
558
- }>, {
559
- provider?: import("@fonoster/common").LanguageModelProvider;
560
- apiKey?: string;
561
- model?: string;
562
- temperature?: number;
563
- maxTokens?: number;
564
- baseUrl?: string;
565
- knowledgeBase?: {
566
- type?: "s3";
567
- title?: string;
568
- document?: string;
569
- }[];
570
- tools?: {
571
- name?: string;
572
- description?: string;
573
- parameters?: {
574
- type?: "object" | "array";
575
- properties?: Record<string, {
576
- type?: string;
577
- format?: "enum" | "date-time";
578
- pattern?: string;
579
- }>;
580
- required?: string[];
581
- };
582
- requestStartMessage?: string;
583
- operation?: {
584
- url?: string;
585
- method?: import("@fonoster/common").AllowedHttpMethod;
586
- headers?: Record<string, string>;
587
- waitForResponse?: boolean;
588
- };
589
- }[];
590
- }, {
591
- provider?: import("@fonoster/common").LanguageModelProvider;
592
- apiKey?: string;
593
- model?: string;
594
- temperature?: number;
595
- maxTokens?: number;
596
- baseUrl?: string;
597
- knowledgeBase?: {
598
- type?: "s3";
599
- title?: string;
600
- document?: string;
601
- }[];
602
- tools?: {
603
- name?: string;
604
- description?: string;
605
- parameters?: {
606
- type?: "object" | "array";
607
- properties?: Record<string, {
608
- type?: string;
609
- format?: "enum" | "date-time";
610
- pattern?: string;
611
- }>;
612
- required?: string[];
613
- };
614
- requestStartMessage?: string;
615
- operation?: {
616
- url?: string;
617
- method?: import("@fonoster/common").AllowedHttpMethod;
618
- headers?: Record<string, string>;
619
- waitForResponse?: boolean;
620
- };
621
- }[];
622
- }>;
623
- }, "strip", z.ZodTypeAny, {
624
- languageModel?: {
625
- provider?: import("@fonoster/common").LanguageModelProvider;
626
- apiKey?: string;
627
- model?: string;
628
- temperature?: number;
629
- maxTokens?: number;
630
- baseUrl?: string;
631
- knowledgeBase?: {
632
- type?: "s3";
633
- title?: string;
634
- document?: string;
635
- }[];
636
- tools?: {
637
- name?: string;
638
- description?: string;
639
- parameters?: {
640
- type?: "object" | "array";
641
- properties?: Record<string, {
642
- type?: string;
643
- format?: "enum" | "date-time";
644
- pattern?: string;
645
- }>;
646
- required?: string[];
647
- };
648
- requestStartMessage?: string;
649
- operation?: {
650
- url?: string;
651
- method?: import("@fonoster/common").AllowedHttpMethod;
652
- headers?: Record<string, string>;
653
- waitForResponse?: boolean;
654
- };
655
- }[];
656
- };
657
- audioFilters?: {
658
- options?: Record<string, unknown>;
659
- name?: string;
660
- }[];
661
- conversationSettings?: {
662
- firstMessage?: string;
663
- systemPrompt?: string;
664
- goodbyeMessage?: string;
665
- systemErrorMessage?: string;
666
- initialDtmf?: string;
667
- maxSessionDuration?: number;
668
- maxSpeechWaitTimeout?: number;
669
- transferOptions?: {
670
- message?: string;
671
- phoneNumber?: string;
672
- timeout?: number;
673
- };
674
- idleOptions?: {
675
- message?: string;
676
- timeout?: number;
677
- maxTimeoutCount?: number;
678
- };
679
- allowUserBargeIn?: boolean;
680
- vad?: {
681
- pathToModel?: string;
682
- activationThreshold?: number;
683
- deactivationThreshold?: number;
684
- debounceFrames?: number;
685
- };
686
- };
687
- eventsHook?: {
688
- url?: string;
689
- headers?: Record<string, string>;
690
- events?: import("@fonoster/common").EventsHookAllowedEvents[];
691
- };
692
- testCases?: {
693
- evalsLanguageModel?: {
694
- provider?: "openai";
695
- apiKey?: string;
696
- model?: string;
697
- };
698
- evalsSystemPrompt?: string;
699
- scenarios?: {
700
- description?: string;
701
- ref?: string;
702
- telephonyContext?: {
703
- callDirection?: import("@fonoster/types").CallDirection;
704
- ingressNumber?: string;
705
- callerNumber?: string;
706
- metadata?: Record<string, string>;
707
- };
708
- conversation?: {
709
- expected?: {
710
- tools?: {
711
- parameters?: Record<string, any>;
712
- tool?: string;
713
- }[];
714
- text?: {
715
- type?: "EXACT" | "SIMILAR";
716
- response?: string;
717
- };
718
- };
719
- userInput?: string;
720
- }[];
721
- }[];
722
- };
723
- }, {
724
- languageModel?: {
725
- provider?: import("@fonoster/common").LanguageModelProvider;
726
- apiKey?: string;
727
- model?: string;
728
- temperature?: number;
729
- maxTokens?: number;
730
- baseUrl?: string;
731
- knowledgeBase?: {
732
- type?: "s3";
733
- title?: string;
734
- document?: string;
735
- }[];
736
- tools?: {
737
- name?: string;
738
- description?: string;
739
- parameters?: {
740
- type?: "object" | "array";
741
- properties?: Record<string, {
742
- type?: string;
743
- format?: "enum" | "date-time";
744
- pattern?: string;
745
- }>;
746
- required?: string[];
747
- };
748
- requestStartMessage?: string;
749
- operation?: {
750
- url?: string;
751
- method?: import("@fonoster/common").AllowedHttpMethod;
752
- headers?: Record<string, string>;
753
- waitForResponse?: boolean;
754
- };
755
- }[];
756
- };
757
- audioFilters?: {
758
- options?: Record<string, unknown>;
759
- name?: string;
760
- }[];
761
- conversationSettings?: {
762
- firstMessage?: string;
763
- systemPrompt?: string;
764
- goodbyeMessage?: string;
765
- systemErrorMessage?: string;
766
- initialDtmf?: string;
767
- maxSessionDuration?: number;
768
- maxSpeechWaitTimeout?: number;
769
- transferOptions?: {
770
- message?: string;
771
- phoneNumber?: string;
772
- timeout?: number;
773
- };
774
- idleOptions?: {
775
- message?: string;
776
- timeout?: number;
777
- maxTimeoutCount?: number;
778
- };
779
- allowUserBargeIn?: boolean;
780
- vad?: {
781
- pathToModel?: string;
782
- activationThreshold?: number;
783
- deactivationThreshold?: number;
784
- debounceFrames?: number;
785
- };
786
- };
787
- eventsHook?: {
788
- url?: string;
789
- headers?: Record<string, string>;
790
- events?: import("@fonoster/common").EventsHookAllowedEvents[];
791
- };
792
- testCases?: {
793
- evalsLanguageModel?: {
794
- provider?: "openai";
795
- apiKey?: string;
796
- model?: string;
797
- };
798
- evalsSystemPrompt?: string;
799
- scenarios?: {
800
- description?: string;
801
- ref?: string;
802
- telephonyContext?: {
803
- callDirection?: import("@fonoster/types").CallDirection;
804
- ingressNumber?: string;
805
- callerNumber?: string;
806
- metadata?: Record<string, string>;
807
- };
808
- conversation?: {
809
- expected?: {
810
- tools?: {
811
- parameters?: Record<string, any>;
812
- tool?: string;
813
- }[];
814
- text?: {
815
- type?: "EXACT" | "SIMILAR";
816
- response?: string;
817
- };
818
- };
819
- userInput?: string;
820
- }[];
821
- }[];
822
- };
823
- }>;
824
- }, "strip", z.ZodTypeAny, {
825
- config?: {
826
- languageModel?: {
827
- provider?: import("@fonoster/common").LanguageModelProvider;
828
- apiKey?: string;
829
- model?: string;
830
- temperature?: number;
831
- maxTokens?: number;
832
- baseUrl?: string;
833
- knowledgeBase?: {
834
- type?: "s3";
835
- title?: string;
836
- document?: string;
837
- }[];
838
- tools?: {
839
- name?: string;
840
- description?: string;
841
- parameters?: {
842
- type?: "object" | "array";
843
- properties?: Record<string, {
844
- type?: string;
845
- format?: "enum" | "date-time";
846
- pattern?: string;
847
- }>;
848
- required?: string[];
849
- };
850
- requestStartMessage?: string;
851
- operation?: {
852
- url?: string;
853
- method?: import("@fonoster/common").AllowedHttpMethod;
854
- headers?: Record<string, string>;
855
- waitForResponse?: boolean;
856
- };
857
- }[];
858
- };
859
- audioFilters?: {
860
- options?: Record<string, unknown>;
861
- name?: string;
862
- }[];
863
- conversationSettings?: {
864
- firstMessage?: string;
865
- systemPrompt?: string;
866
- goodbyeMessage?: string;
867
- systemErrorMessage?: string;
868
- initialDtmf?: string;
869
- maxSessionDuration?: number;
870
- maxSpeechWaitTimeout?: number;
871
- transferOptions?: {
872
- message?: string;
873
- phoneNumber?: string;
874
- timeout?: number;
875
- };
876
- idleOptions?: {
877
- message?: string;
878
- timeout?: number;
879
- maxTimeoutCount?: number;
880
- };
881
- allowUserBargeIn?: boolean;
882
- vad?: {
883
- pathToModel?: string;
884
- activationThreshold?: number;
885
- deactivationThreshold?: number;
886
- debounceFrames?: number;
887
- };
888
- };
889
- eventsHook?: {
890
- url?: string;
891
- headers?: Record<string, string>;
892
- events?: import("@fonoster/common").EventsHookAllowedEvents[];
893
- };
894
- testCases?: {
895
- evalsLanguageModel?: {
896
- provider?: "openai";
897
- apiKey?: string;
898
- model?: string;
899
- };
900
- evalsSystemPrompt?: string;
901
- scenarios?: {
902
- description?: string;
903
- ref?: string;
904
- telephonyContext?: {
905
- callDirection?: import("@fonoster/types").CallDirection;
906
- ingressNumber?: string;
907
- callerNumber?: string;
908
- metadata?: Record<string, string>;
909
- };
910
- conversation?: {
911
- expected?: {
912
- tools?: {
913
- parameters?: Record<string, any>;
914
- tool?: string;
915
- }[];
916
- text?: {
917
- type?: "EXACT" | "SIMILAR";
918
- response?: string;
919
- };
920
- };
921
- userInput?: string;
922
- }[];
923
- }[];
924
- };
925
- };
926
- productRef?: string;
927
- }, {
928
- config?: {
929
- languageModel?: {
930
- provider?: import("@fonoster/common").LanguageModelProvider;
931
- apiKey?: string;
932
- model?: string;
933
- temperature?: number;
934
- maxTokens?: number;
935
- baseUrl?: string;
936
- knowledgeBase?: {
937
- type?: "s3";
938
- title?: string;
939
- document?: string;
940
- }[];
941
- tools?: {
942
- name?: string;
943
- description?: string;
944
- parameters?: {
945
- type?: "object" | "array";
946
- properties?: Record<string, {
947
- type?: string;
948
- format?: "enum" | "date-time";
949
- pattern?: string;
950
- }>;
951
- required?: string[];
952
- };
953
- requestStartMessage?: string;
954
- operation?: {
955
- url?: string;
956
- method?: import("@fonoster/common").AllowedHttpMethod;
957
- headers?: Record<string, string>;
958
- waitForResponse?: boolean;
959
- };
960
- }[];
961
- };
962
- audioFilters?: {
963
- options?: Record<string, unknown>;
964
- name?: string;
965
- }[];
966
- conversationSettings?: {
967
- firstMessage?: string;
968
- systemPrompt?: string;
969
- goodbyeMessage?: string;
970
- systemErrorMessage?: string;
971
- initialDtmf?: string;
972
- maxSessionDuration?: number;
973
- maxSpeechWaitTimeout?: number;
974
- transferOptions?: {
975
- message?: string;
976
- phoneNumber?: string;
977
- timeout?: number;
978
- };
979
- idleOptions?: {
980
- message?: string;
981
- timeout?: number;
982
- maxTimeoutCount?: number;
983
- };
984
- allowUserBargeIn?: boolean;
985
- vad?: {
986
- pathToModel?: string;
987
- activationThreshold?: number;
988
- deactivationThreshold?: number;
989
- debounceFrames?: number;
990
- };
991
- };
992
- eventsHook?: {
993
- url?: string;
994
- headers?: Record<string, string>;
995
- events?: import("@fonoster/common").EventsHookAllowedEvents[];
996
- };
997
- testCases?: {
998
- evalsLanguageModel?: {
999
- provider?: "openai";
1000
- apiKey?: string;
1001
- model?: string;
1002
- };
1003
- evalsSystemPrompt?: string;
1004
- scenarios?: {
1005
- description?: string;
1006
- ref?: string;
1007
- telephonyContext?: {
1008
- callDirection?: import("@fonoster/types").CallDirection;
1009
- ingressNumber?: string;
1010
- callerNumber?: string;
1011
- metadata?: Record<string, string>;
1012
- };
1013
- conversation?: {
1014
- expected?: {
1015
- tools?: {
1016
- parameters?: Record<string, any>;
1017
- tool?: string;
1018
- }[];
1019
- text?: {
1020
- type?: "EXACT" | "SIMILAR";
1021
- response?: string;
1022
- };
1023
- };
1024
- userInput?: string;
1025
- }[];
1026
- }[];
1027
- };
1028
- };
1029
- productRef?: string;
1030
- }>, {
1031
- config?: {
1032
- languageModel?: {
1033
- provider?: import("@fonoster/common").LanguageModelProvider;
1034
- apiKey?: string;
1035
- model?: string;
1036
- temperature?: number;
1037
- maxTokens?: number;
1038
- baseUrl?: string;
1039
- knowledgeBase?: {
1040
- type?: "s3";
1041
- title?: string;
1042
- document?: string;
1043
- }[];
1044
- tools?: {
1045
- name?: string;
1046
- description?: string;
1047
- parameters?: {
1048
- type?: "object" | "array";
1049
- properties?: Record<string, {
1050
- type?: string;
1051
- format?: "enum" | "date-time";
1052
- pattern?: string;
1053
- }>;
1054
- required?: string[];
1055
- };
1056
- requestStartMessage?: string;
1057
- operation?: {
1058
- url?: string;
1059
- method?: import("@fonoster/common").AllowedHttpMethod;
1060
- headers?: Record<string, string>;
1061
- waitForResponse?: boolean;
1062
- };
1063
- }[];
1064
- };
1065
- audioFilters?: {
1066
- options?: Record<string, unknown>;
1067
- name?: string;
1068
- }[];
1069
- conversationSettings?: {
1070
- firstMessage?: string;
1071
- systemPrompt?: string;
1072
- goodbyeMessage?: string;
1073
- systemErrorMessage?: string;
1074
- initialDtmf?: string;
1075
- maxSessionDuration?: number;
1076
- maxSpeechWaitTimeout?: number;
1077
- transferOptions?: {
1078
- message?: string;
1079
- phoneNumber?: string;
1080
- timeout?: number;
1081
- };
1082
- idleOptions?: {
1083
- message?: string;
1084
- timeout?: number;
1085
- maxTimeoutCount?: number;
1086
- };
1087
- allowUserBargeIn?: boolean;
1088
- vad?: {
1089
- pathToModel?: string;
1090
- activationThreshold?: number;
1091
- deactivationThreshold?: number;
1092
- debounceFrames?: number;
1093
- };
1094
- };
1095
- eventsHook?: {
1096
- url?: string;
1097
- headers?: Record<string, string>;
1098
- events?: import("@fonoster/common").EventsHookAllowedEvents[];
1099
- };
1100
- testCases?: {
1101
- evalsLanguageModel?: {
1102
- provider?: "openai";
1103
- apiKey?: string;
1104
- model?: string;
1105
- };
1106
- evalsSystemPrompt?: string;
1107
- scenarios?: {
1108
- description?: string;
1109
- ref?: string;
1110
- telephonyContext?: {
1111
- callDirection?: import("@fonoster/types").CallDirection;
1112
- ingressNumber?: string;
1113
- callerNumber?: string;
1114
- metadata?: Record<string, string>;
1115
- };
1116
- conversation?: {
1117
- expected?: {
1118
- tools?: {
1119
- parameters?: Record<string, any>;
1120
- tool?: string;
1121
- }[];
1122
- text?: {
1123
- type?: "EXACT" | "SIMILAR";
1124
- response?: string;
1125
- };
1126
- };
1127
- userInput?: string;
1128
- }[];
1129
- }[];
1130
- };
1131
- };
1132
- productRef?: string;
1133
- }, {
1134
- config?: {
1135
- languageModel?: {
1136
- provider?: import("@fonoster/common").LanguageModelProvider;
1137
- apiKey?: string;
1138
- model?: string;
1139
- temperature?: number;
1140
- maxTokens?: number;
1141
- baseUrl?: string;
1142
- knowledgeBase?: {
1143
- type?: "s3";
1144
- title?: string;
1145
- document?: string;
1146
- }[];
1147
- tools?: {
1148
- name?: string;
1149
- description?: string;
1150
- parameters?: {
1151
- type?: "object" | "array";
1152
- properties?: Record<string, {
1153
- type?: string;
1154
- format?: "enum" | "date-time";
1155
- pattern?: string;
1156
- }>;
1157
- required?: string[];
1158
- };
1159
- requestStartMessage?: string;
1160
- operation?: {
1161
- url?: string;
1162
- method?: import("@fonoster/common").AllowedHttpMethod;
1163
- headers?: Record<string, string>;
1164
- waitForResponse?: boolean;
1165
- };
1166
- }[];
1167
- };
1168
- audioFilters?: {
1169
- options?: Record<string, unknown>;
1170
- name?: string;
1171
- }[];
1172
- conversationSettings?: {
1173
- firstMessage?: string;
1174
- systemPrompt?: string;
1175
- goodbyeMessage?: string;
1176
- systemErrorMessage?: string;
1177
- initialDtmf?: string;
1178
- maxSessionDuration?: number;
1179
- maxSpeechWaitTimeout?: number;
1180
- transferOptions?: {
1181
- message?: string;
1182
- phoneNumber?: string;
1183
- timeout?: number;
1184
- };
1185
- idleOptions?: {
1186
- message?: string;
1187
- timeout?: number;
1188
- maxTimeoutCount?: number;
1189
- };
1190
- allowUserBargeIn?: boolean;
1191
- vad?: {
1192
- pathToModel?: string;
1193
- activationThreshold?: number;
1194
- deactivationThreshold?: number;
1195
- debounceFrames?: number;
1196
- };
1197
- };
1198
- eventsHook?: {
1199
- url?: string;
1200
- headers?: Record<string, string>;
1201
- events?: import("@fonoster/common").EventsHookAllowedEvents[];
1202
- };
1203
- testCases?: {
1204
- evalsLanguageModel?: {
1205
- provider?: "openai";
1206
- apiKey?: string;
1207
- model?: string;
1208
- };
1209
- evalsSystemPrompt?: string;
1210
- scenarios?: {
1211
- description?: string;
1212
- ref?: string;
1213
- telephonyContext?: {
1214
- callDirection?: import("@fonoster/types").CallDirection;
1215
- ingressNumber?: string;
1216
- callerNumber?: string;
1217
- metadata?: Record<string, string>;
1218
- };
1219
- conversation?: {
1220
- expected?: {
1221
- tools?: {
1222
- parameters?: Record<string, any>;
1223
- tool?: string;
1224
- }[];
1225
- text?: {
1226
- type?: "EXACT" | "SIMILAR";
1227
- response?: string;
1228
- };
1229
- };
1230
- userInput?: string;
1231
- }[];
1232
- }[];
1233
- };
1234
- };
1235
- productRef?: string;
1236
- }>;
1237
- }, "strip", z.ZodTypeAny, {
1238
- textToSpeech?: {
1239
- [x: string]: any;
1240
- productRef?: unknown;
1241
- config?: unknown;
1242
- };
1243
- speechToText?: {
1244
- [x: string]: any;
1245
- productRef?: unknown;
1246
- config?: unknown;
1247
- };
1248
- intelligence?: {
1249
- config?: {
1250
- languageModel?: {
1251
- provider?: import("@fonoster/common").LanguageModelProvider;
1252
- apiKey?: string;
1253
- model?: string;
1254
- temperature?: number;
1255
- maxTokens?: number;
1256
- baseUrl?: string;
1257
- knowledgeBase?: {
1258
- type?: "s3";
1259
- title?: string;
1260
- document?: string;
1261
- }[];
1262
- tools?: {
1263
- name?: string;
1264
- description?: string;
1265
- parameters?: {
1266
- type?: "object" | "array";
1267
- properties?: Record<string, {
1268
- type?: string;
1269
- format?: "enum" | "date-time";
1270
- pattern?: string;
1271
- }>;
1272
- required?: string[];
1273
- };
1274
- requestStartMessage?: string;
1275
- operation?: {
1276
- url?: string;
1277
- method?: import("@fonoster/common").AllowedHttpMethod;
1278
- headers?: Record<string, string>;
1279
- waitForResponse?: boolean;
1280
- };
1281
- }[];
1282
- };
1283
- audioFilters?: {
1284
- options?: Record<string, unknown>;
1285
- name?: string;
1286
- }[];
1287
- conversationSettings?: {
1288
- firstMessage?: string;
1289
- systemPrompt?: string;
1290
- goodbyeMessage?: string;
1291
- systemErrorMessage?: string;
1292
- initialDtmf?: string;
1293
- maxSessionDuration?: number;
1294
- maxSpeechWaitTimeout?: number;
1295
- transferOptions?: {
1296
- message?: string;
1297
- phoneNumber?: string;
1298
- timeout?: number;
1299
- };
1300
- idleOptions?: {
1301
- message?: string;
1302
- timeout?: number;
1303
- maxTimeoutCount?: number;
1304
- };
1305
- allowUserBargeIn?: boolean;
1306
- vad?: {
1307
- pathToModel?: string;
1308
- activationThreshold?: number;
1309
- deactivationThreshold?: number;
1310
- debounceFrames?: number;
1311
- };
1312
- };
1313
- eventsHook?: {
1314
- url?: string;
1315
- headers?: Record<string, string>;
1316
- events?: import("@fonoster/common").EventsHookAllowedEvents[];
1317
- };
1318
- testCases?: {
1319
- evalsLanguageModel?: {
1320
- provider?: "openai";
1321
- apiKey?: string;
1322
- model?: string;
1323
- };
1324
- evalsSystemPrompt?: string;
1325
- scenarios?: {
1326
- description?: string;
1327
- ref?: string;
1328
- telephonyContext?: {
1329
- callDirection?: import("@fonoster/types").CallDirection;
1330
- ingressNumber?: string;
1331
- callerNumber?: string;
1332
- metadata?: Record<string, string>;
1333
- };
1334
- conversation?: {
1335
- expected?: {
1336
- tools?: {
1337
- parameters?: Record<string, any>;
1338
- tool?: string;
1339
- }[];
1340
- text?: {
1341
- type?: "EXACT" | "SIMILAR";
1342
- response?: string;
1343
- };
1344
- };
1345
- userInput?: string;
1346
- }[];
1347
- }[];
1348
- };
1349
- };
1350
- productRef?: string;
1351
- };
1352
- type?: "EXTERNAL" | "AUTOPILOT";
1353
- name?: string;
1354
- endpoint?: string;
1355
- }, {
1356
- textToSpeech?: {
1357
- [x: string]: any;
1358
- productRef?: unknown;
1359
- config?: unknown;
1360
- };
1361
- speechToText?: {
1362
- [x: string]: any;
1363
- productRef?: unknown;
1364
- config?: unknown;
1365
- };
1366
- intelligence?: {
1367
- config?: {
1368
- languageModel?: {
1369
- provider?: import("@fonoster/common").LanguageModelProvider;
1370
- apiKey?: string;
1371
- model?: string;
1372
- temperature?: number;
1373
- maxTokens?: number;
1374
- baseUrl?: string;
1375
- knowledgeBase?: {
1376
- type?: "s3";
1377
- title?: string;
1378
- document?: string;
1379
- }[];
1380
- tools?: {
1381
- name?: string;
1382
- description?: string;
1383
- parameters?: {
1384
- type?: "object" | "array";
1385
- properties?: Record<string, {
1386
- type?: string;
1387
- format?: "enum" | "date-time";
1388
- pattern?: string;
1389
- }>;
1390
- required?: string[];
1391
- };
1392
- requestStartMessage?: string;
1393
- operation?: {
1394
- url?: string;
1395
- method?: import("@fonoster/common").AllowedHttpMethod;
1396
- headers?: Record<string, string>;
1397
- waitForResponse?: boolean;
1398
- };
1399
- }[];
1400
- };
1401
- audioFilters?: {
1402
- options?: Record<string, unknown>;
1403
- name?: string;
1404
- }[];
1405
- conversationSettings?: {
1406
- firstMessage?: string;
1407
- systemPrompt?: string;
1408
- goodbyeMessage?: string;
1409
- systemErrorMessage?: string;
1410
- initialDtmf?: string;
1411
- maxSessionDuration?: number;
1412
- maxSpeechWaitTimeout?: number;
1413
- transferOptions?: {
1414
- message?: string;
1415
- phoneNumber?: string;
1416
- timeout?: number;
1417
- };
1418
- idleOptions?: {
1419
- message?: string;
1420
- timeout?: number;
1421
- maxTimeoutCount?: number;
1422
- };
1423
- allowUserBargeIn?: boolean;
1424
- vad?: {
1425
- pathToModel?: string;
1426
- activationThreshold?: number;
1427
- deactivationThreshold?: number;
1428
- debounceFrames?: number;
1429
- };
1430
- };
1431
- eventsHook?: {
1432
- url?: string;
1433
- headers?: Record<string, string>;
1434
- events?: import("@fonoster/common").EventsHookAllowedEvents[];
1435
- };
1436
- testCases?: {
1437
- evalsLanguageModel?: {
1438
- provider?: "openai";
1439
- apiKey?: string;
1440
- model?: string;
1441
- };
1442
- evalsSystemPrompt?: string;
1443
- scenarios?: {
1444
- description?: string;
1445
- ref?: string;
1446
- telephonyContext?: {
1447
- callDirection?: import("@fonoster/types").CallDirection;
1448
- ingressNumber?: string;
1449
- callerNumber?: string;
1450
- metadata?: Record<string, string>;
1451
- };
1452
- conversation?: {
1453
- expected?: {
1454
- tools?: {
1455
- parameters?: Record<string, any>;
1456
- tool?: string;
1457
- }[];
1458
- text?: {
1459
- type?: "EXACT" | "SIMILAR";
1460
- response?: string;
1461
- };
1462
- };
1463
- userInput?: string;
1464
- }[];
1465
- }[];
1466
- };
1467
- };
1468
- productRef?: string;
1469
- };
1470
- type?: "EXTERNAL" | "AUTOPILOT";
1471
- name?: string;
1472
- endpoint?: string;
1473
- }>;
1474
- export { createValidationSchema };