phonic 0.31.2 → 0.31.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (787) hide show
  1. package/README.md +105 -16
  2. package/dist/cjs/BaseClient.d.ts +40 -0
  3. package/dist/cjs/BaseClient.js +62 -0
  4. package/dist/cjs/Client.d.ts +27 -48
  5. package/dist/cjs/Client.js +17 -60
  6. package/dist/cjs/api/errors/BadRequestError.d.ts +1 -4
  7. package/dist/cjs/api/errors/BadRequestError.js +6 -4
  8. package/dist/cjs/api/errors/ConflictError.d.ts +1 -4
  9. package/dist/cjs/api/errors/ConflictError.js +6 -4
  10. package/dist/cjs/api/errors/ForbiddenError.d.ts +1 -4
  11. package/dist/cjs/api/errors/ForbiddenError.js +6 -4
  12. package/dist/cjs/api/errors/GatewayTimeoutError.d.ts +2 -5
  13. package/dist/cjs/api/errors/GatewayTimeoutError.js +6 -4
  14. package/dist/cjs/api/errors/InternalServerError.d.ts +2 -5
  15. package/dist/cjs/api/errors/InternalServerError.js +6 -4
  16. package/dist/cjs/api/errors/NotFoundError.d.ts +1 -4
  17. package/dist/cjs/api/errors/NotFoundError.js +6 -4
  18. package/dist/cjs/api/errors/UnauthorizedError.d.ts +2 -5
  19. package/dist/cjs/api/errors/UnauthorizedError.js +6 -4
  20. package/dist/cjs/api/errors/index.d.ts +4 -4
  21. package/dist/cjs/api/errors/index.js +4 -4
  22. package/dist/cjs/api/resources/agents/client/Client.d.ts +26 -47
  23. package/dist/cjs/api/resources/agents/client/Client.js +128 -249
  24. package/dist/cjs/api/resources/agents/client/index.d.ts +0 -1
  25. package/dist/cjs/api/resources/agents/client/requests/AgentsAddCustomPhoneNumberRequest.d.ts +2 -5
  26. package/dist/cjs/api/resources/agents/client/requests/AgentsAddCustomPhoneNumberRequest.js +1 -3
  27. package/dist/cjs/api/resources/agents/client/requests/AgentsCreateRequest.d.ts +1 -4
  28. package/dist/cjs/api/resources/agents/client/requests/AgentsCreateRequest.js +1 -3
  29. package/dist/cjs/api/resources/agents/client/requests/AgentsDeleteCustomPhoneNumberRequest.d.ts +0 -3
  30. package/dist/cjs/api/resources/agents/client/requests/AgentsDeleteCustomPhoneNumberRequest.js +1 -3
  31. package/dist/cjs/api/resources/agents/client/requests/AgentsDeleteRequest.d.ts +0 -3
  32. package/dist/cjs/api/resources/agents/client/requests/AgentsDeleteRequest.js +1 -3
  33. package/dist/cjs/api/resources/agents/client/requests/AgentsGetRequest.d.ts +0 -3
  34. package/dist/cjs/api/resources/agents/client/requests/AgentsGetRequest.js +1 -3
  35. package/dist/cjs/api/resources/agents/client/requests/AgentsListRequest.d.ts +0 -3
  36. package/dist/cjs/api/resources/agents/client/requests/AgentsListRequest.js +1 -3
  37. package/dist/cjs/api/resources/agents/client/requests/AgentsUpdatePhoneNumberRequest.d.ts +2 -5
  38. package/dist/cjs/api/resources/agents/client/requests/AgentsUpdatePhoneNumberRequest.js +1 -3
  39. package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.d.ts +9 -16
  40. package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.js +3 -3
  41. package/dist/cjs/api/resources/agents/client/requests/UpsertAgentRequest.d.ts +1 -4
  42. package/dist/cjs/api/resources/agents/client/requests/UpsertAgentRequest.js +1 -3
  43. package/dist/cjs/api/resources/agents/client/requests/index.d.ts +9 -9
  44. package/dist/cjs/api/resources/agents/client/requests/index.js +3 -0
  45. package/dist/cjs/api/resources/agents/exports.d.ts +2 -0
  46. package/dist/cjs/api/resources/agents/exports.js +21 -0
  47. package/dist/cjs/api/resources/agents/index.d.ts +1 -1
  48. package/dist/cjs/api/resources/agents/index.js +1 -1
  49. package/dist/cjs/api/resources/agents/types/AgentsAddCustomPhoneNumberResponse.d.ts +0 -3
  50. package/dist/cjs/api/resources/agents/types/AgentsAddCustomPhoneNumberResponse.js +1 -3
  51. package/dist/cjs/api/resources/agents/types/AgentsCreateResponse.d.ts +0 -3
  52. package/dist/cjs/api/resources/agents/types/AgentsCreateResponse.js +1 -3
  53. package/dist/cjs/api/resources/agents/types/AgentsDeleteCustomPhoneNumberResponse.d.ts +0 -3
  54. package/dist/cjs/api/resources/agents/types/AgentsDeleteCustomPhoneNumberResponse.js +1 -3
  55. package/dist/cjs/api/resources/agents/types/AgentsDeleteResponse.d.ts +0 -3
  56. package/dist/cjs/api/resources/agents/types/AgentsDeleteResponse.js +1 -3
  57. package/dist/cjs/api/resources/agents/types/AgentsGetResponse.d.ts +1 -4
  58. package/dist/cjs/api/resources/agents/types/AgentsGetResponse.js +1 -3
  59. package/dist/cjs/api/resources/agents/types/AgentsListResponse.d.ts +1 -4
  60. package/dist/cjs/api/resources/agents/types/AgentsListResponse.js +1 -3
  61. package/dist/cjs/api/resources/agents/types/AgentsUpdatePhoneNumberResponse.d.ts +0 -3
  62. package/dist/cjs/api/resources/agents/types/AgentsUpdatePhoneNumberResponse.js +1 -3
  63. package/dist/cjs/api/resources/agents/types/AgentsUpdateResponse.d.ts +0 -3
  64. package/dist/cjs/api/resources/agents/types/AgentsUpdateResponse.js +1 -3
  65. package/dist/cjs/api/resources/agents/types/AgentsUpsertResponse.d.ts +1 -4
  66. package/dist/cjs/api/resources/agents/types/AgentsUpsertResponse.js +1 -3
  67. package/dist/cjs/api/resources/agents/types/index.d.ts +6 -6
  68. package/dist/cjs/api/resources/agents/types/index.js +6 -6
  69. package/dist/cjs/api/resources/auth/client/Client.d.ts +10 -31
  70. package/dist/cjs/api/resources/auth/client/Client.js +20 -43
  71. package/dist/cjs/api/resources/auth/client/index.d.ts +0 -1
  72. package/dist/cjs/api/resources/auth/client/requests/CreateSessionTokenRequest.d.ts +0 -3
  73. package/dist/cjs/api/resources/auth/client/requests/CreateSessionTokenRequest.js +1 -3
  74. package/dist/cjs/api/resources/auth/client/requests/index.d.ts +1 -1
  75. package/dist/cjs/api/resources/auth/exports.d.ts +2 -0
  76. package/dist/cjs/api/resources/auth/exports.js +21 -0
  77. package/dist/cjs/api/resources/auth/index.d.ts +1 -1
  78. package/dist/cjs/api/resources/auth/index.js +1 -1
  79. package/dist/cjs/api/resources/auth/types/AuthCreateSessionTokenResponse.d.ts +0 -3
  80. package/dist/cjs/api/resources/auth/types/AuthCreateSessionTokenResponse.js +1 -3
  81. package/dist/cjs/api/resources/conversations/client/Client.d.ts +36 -51
  82. package/dist/cjs/api/resources/conversations/client/Client.js +134 -270
  83. package/dist/cjs/api/resources/conversations/client/Socket.d.ts +2 -12
  84. package/dist/cjs/api/resources/conversations/client/Socket.js +15 -40
  85. package/dist/cjs/api/resources/conversations/client/index.d.ts +0 -1
  86. package/dist/cjs/api/resources/conversations/client/requests/ConversationsListRequest.d.ts +0 -6
  87. package/dist/cjs/api/resources/conversations/client/requests/ConversationsListRequest.js +1 -3
  88. package/dist/cjs/api/resources/conversations/client/requests/ConversationsSipOutboundCallRequest.d.ts +1 -4
  89. package/dist/cjs/api/resources/conversations/client/requests/ConversationsSipOutboundCallRequest.js +1 -3
  90. package/dist/cjs/api/resources/conversations/client/requests/EvaluateConversationRequest.d.ts +0 -3
  91. package/dist/cjs/api/resources/conversations/client/requests/EvaluateConversationRequest.js +1 -3
  92. package/dist/cjs/api/resources/conversations/client/requests/ExtractDataRequest.d.ts +0 -3
  93. package/dist/cjs/api/resources/conversations/client/requests/ExtractDataRequest.js +1 -3
  94. package/dist/cjs/api/resources/conversations/client/requests/OutboundCallRequest.d.ts +1 -4
  95. package/dist/cjs/api/resources/conversations/client/requests/OutboundCallRequest.js +1 -3
  96. package/dist/cjs/api/resources/conversations/client/requests/index.d.ts +5 -5
  97. package/dist/cjs/api/resources/conversations/exports.d.ts +2 -0
  98. package/dist/cjs/api/resources/conversations/exports.js +21 -0
  99. package/dist/cjs/api/resources/conversations/index.d.ts +1 -1
  100. package/dist/cjs/api/resources/conversations/index.js +1 -1
  101. package/dist/cjs/api/resources/conversations/types/ConversationsCancelResponse.d.ts +0 -3
  102. package/dist/cjs/api/resources/conversations/types/ConversationsCancelResponse.js +1 -3
  103. package/dist/cjs/api/resources/conversations/types/ConversationsExtractDataResponse.d.ts +0 -3
  104. package/dist/cjs/api/resources/conversations/types/ConversationsExtractDataResponse.js +1 -3
  105. package/dist/cjs/api/resources/conversations/types/ConversationsGetAnalysisResponse.d.ts +1 -4
  106. package/dist/cjs/api/resources/conversations/types/ConversationsGetAnalysisResponse.js +1 -3
  107. package/dist/cjs/api/resources/conversations/types/ConversationsGetResponse.d.ts +1 -4
  108. package/dist/cjs/api/resources/conversations/types/ConversationsGetResponse.js +1 -3
  109. package/dist/cjs/api/resources/conversations/types/ConversationsListEvaluationsResponse.d.ts +1 -4
  110. package/dist/cjs/api/resources/conversations/types/ConversationsListEvaluationsResponse.js +1 -3
  111. package/dist/cjs/api/resources/conversations/types/ConversationsListExtractionsResponse.d.ts +1 -4
  112. package/dist/cjs/api/resources/conversations/types/ConversationsListExtractionsResponse.js +1 -3
  113. package/dist/cjs/api/resources/conversations/types/ConversationsListResponse.d.ts +1 -4
  114. package/dist/cjs/api/resources/conversations/types/ConversationsListResponse.js +1 -3
  115. package/dist/cjs/api/resources/conversations/types/ConversationsOutboundCallResponse.d.ts +0 -3
  116. package/dist/cjs/api/resources/conversations/types/ConversationsOutboundCallResponse.js +1 -3
  117. package/dist/cjs/api/resources/conversations/types/ConversationsSipOutboundCallResponse.d.ts +0 -3
  118. package/dist/cjs/api/resources/conversations/types/ConversationsSipOutboundCallResponse.js +1 -3
  119. package/dist/cjs/api/resources/conversations/types/index.d.ts +4 -4
  120. package/dist/cjs/api/resources/conversations/types/index.js +4 -4
  121. package/dist/cjs/api/resources/extractionSchemas/client/Client.d.ts +18 -39
  122. package/dist/cjs/api/resources/extractionSchemas/client/Client.js +74 -146
  123. package/dist/cjs/api/resources/extractionSchemas/client/index.d.ts +0 -1
  124. package/dist/cjs/api/resources/extractionSchemas/client/requests/CreateExtractionSchemaRequest.d.ts +1 -4
  125. package/dist/cjs/api/resources/extractionSchemas/client/requests/CreateExtractionSchemaRequest.js +1 -3
  126. package/dist/cjs/api/resources/extractionSchemas/client/requests/ExtractionSchemasDeleteRequest.d.ts +0 -3
  127. package/dist/cjs/api/resources/extractionSchemas/client/requests/ExtractionSchemasDeleteRequest.js +1 -3
  128. package/dist/cjs/api/resources/extractionSchemas/client/requests/ExtractionSchemasGetRequest.d.ts +0 -3
  129. package/dist/cjs/api/resources/extractionSchemas/client/requests/ExtractionSchemasGetRequest.js +1 -3
  130. package/dist/cjs/api/resources/extractionSchemas/client/requests/ExtractionSchemasListRequest.d.ts +0 -3
  131. package/dist/cjs/api/resources/extractionSchemas/client/requests/ExtractionSchemasListRequest.js +1 -3
  132. package/dist/cjs/api/resources/extractionSchemas/client/requests/UpdateExtractionSchemaRequest.d.ts +1 -4
  133. package/dist/cjs/api/resources/extractionSchemas/client/requests/UpdateExtractionSchemaRequest.js +1 -3
  134. package/dist/cjs/api/resources/extractionSchemas/client/requests/index.d.ts +5 -5
  135. package/dist/cjs/api/resources/extractionSchemas/exports.d.ts +2 -0
  136. package/dist/cjs/api/resources/extractionSchemas/exports.js +21 -0
  137. package/dist/cjs/api/resources/extractionSchemas/index.d.ts +1 -1
  138. package/dist/cjs/api/resources/extractionSchemas/index.js +1 -1
  139. package/dist/cjs/api/resources/extractionSchemas/types/ExtractionSchemasCreateResponse.d.ts +0 -3
  140. package/dist/cjs/api/resources/extractionSchemas/types/ExtractionSchemasCreateResponse.js +1 -3
  141. package/dist/cjs/api/resources/extractionSchemas/types/ExtractionSchemasDeleteResponse.d.ts +0 -3
  142. package/dist/cjs/api/resources/extractionSchemas/types/ExtractionSchemasDeleteResponse.js +1 -3
  143. package/dist/cjs/api/resources/extractionSchemas/types/ExtractionSchemasGetResponse.d.ts +1 -4
  144. package/dist/cjs/api/resources/extractionSchemas/types/ExtractionSchemasGetResponse.js +1 -3
  145. package/dist/cjs/api/resources/extractionSchemas/types/ExtractionSchemasListResponse.d.ts +1 -4
  146. package/dist/cjs/api/resources/extractionSchemas/types/ExtractionSchemasListResponse.js +1 -3
  147. package/dist/cjs/api/resources/extractionSchemas/types/ExtractionSchemasUpdateResponse.d.ts +0 -3
  148. package/dist/cjs/api/resources/extractionSchemas/types/ExtractionSchemasUpdateResponse.js +1 -3
  149. package/dist/cjs/api/resources/extractionSchemas/types/index.d.ts +2 -2
  150. package/dist/cjs/api/resources/extractionSchemas/types/index.js +2 -2
  151. package/dist/cjs/api/resources/index.d.ts +13 -13
  152. package/dist/cjs/api/resources/index.js +17 -17
  153. package/dist/cjs/api/resources/projects/client/Client.d.ts +22 -43
  154. package/dist/cjs/api/resources/projects/client/Client.js +79 -168
  155. package/dist/cjs/api/resources/projects/client/index.d.ts +0 -1
  156. package/dist/cjs/api/resources/projects/client/requests/CreateConversationEvalPromptRequest.d.ts +0 -3
  157. package/dist/cjs/api/resources/projects/client/requests/CreateConversationEvalPromptRequest.js +1 -3
  158. package/dist/cjs/api/resources/projects/client/requests/CreateProjectRequest.d.ts +0 -3
  159. package/dist/cjs/api/resources/projects/client/requests/CreateProjectRequest.js +1 -3
  160. package/dist/cjs/api/resources/projects/client/requests/UpdateProjectRequest.d.ts +0 -3
  161. package/dist/cjs/api/resources/projects/client/requests/UpdateProjectRequest.js +1 -3
  162. package/dist/cjs/api/resources/projects/client/requests/index.d.ts +3 -3
  163. package/dist/cjs/api/resources/projects/exports.d.ts +2 -0
  164. package/dist/cjs/api/resources/projects/exports.js +21 -0
  165. package/dist/cjs/api/resources/projects/index.d.ts +1 -1
  166. package/dist/cjs/api/resources/projects/index.js +1 -1
  167. package/dist/cjs/api/resources/projects/types/ProjectsCreateEvalPromptResponse.d.ts +0 -3
  168. package/dist/cjs/api/resources/projects/types/ProjectsCreateEvalPromptResponse.js +1 -3
  169. package/dist/cjs/api/resources/projects/types/ProjectsCreateResponse.d.ts +0 -3
  170. package/dist/cjs/api/resources/projects/types/ProjectsCreateResponse.js +1 -3
  171. package/dist/cjs/api/resources/projects/types/ProjectsDeleteResponse.d.ts +0 -3
  172. package/dist/cjs/api/resources/projects/types/ProjectsDeleteResponse.js +1 -3
  173. package/dist/cjs/api/resources/projects/types/ProjectsGetResponse.d.ts +1 -4
  174. package/dist/cjs/api/resources/projects/types/ProjectsGetResponse.js +1 -3
  175. package/dist/cjs/api/resources/projects/types/ProjectsListEvalPromptsResponse.d.ts +1 -4
  176. package/dist/cjs/api/resources/projects/types/ProjectsListEvalPromptsResponse.js +1 -3
  177. package/dist/cjs/api/resources/projects/types/ProjectsListResponse.d.ts +1 -4
  178. package/dist/cjs/api/resources/projects/types/ProjectsListResponse.js +1 -3
  179. package/dist/cjs/api/resources/projects/types/ProjectsUpdateResponse.d.ts +0 -3
  180. package/dist/cjs/api/resources/projects/types/ProjectsUpdateResponse.js +1 -3
  181. package/dist/cjs/api/resources/projects/types/index.d.ts +4 -4
  182. package/dist/cjs/api/resources/projects/types/index.js +4 -4
  183. package/dist/cjs/api/resources/tools/client/Client.d.ts +18 -39
  184. package/dist/cjs/api/resources/tools/client/Client.js +74 -146
  185. package/dist/cjs/api/resources/tools/client/index.d.ts +0 -1
  186. package/dist/cjs/api/resources/tools/client/requests/CreateToolRequest.d.ts +7 -16
  187. package/dist/cjs/api/resources/tools/client/requests/CreateToolRequest.js +4 -3
  188. package/dist/cjs/api/resources/tools/client/requests/ToolsDeleteRequest.d.ts +0 -3
  189. package/dist/cjs/api/resources/tools/client/requests/ToolsDeleteRequest.js +1 -3
  190. package/dist/cjs/api/resources/tools/client/requests/ToolsGetRequest.d.ts +0 -23
  191. package/dist/cjs/api/resources/tools/client/requests/ToolsGetRequest.js +1 -3
  192. package/dist/cjs/api/resources/tools/client/requests/ToolsListRequest.d.ts +0 -3
  193. package/dist/cjs/api/resources/tools/client/requests/ToolsListRequest.js +1 -3
  194. package/dist/cjs/api/resources/tools/client/requests/UpdateToolRequest.d.ts +7 -16
  195. package/dist/cjs/api/resources/tools/client/requests/UpdateToolRequest.js +4 -3
  196. package/dist/cjs/api/resources/tools/client/requests/index.d.ts +5 -5
  197. package/dist/cjs/api/resources/tools/client/requests/index.js +5 -0
  198. package/dist/cjs/api/resources/tools/exports.d.ts +2 -0
  199. package/dist/cjs/api/resources/tools/exports.js +21 -0
  200. package/dist/cjs/api/resources/tools/index.d.ts +1 -1
  201. package/dist/cjs/api/resources/tools/index.js +1 -1
  202. package/dist/cjs/api/resources/tools/types/ToolsCreateResponse.d.ts +0 -3
  203. package/dist/cjs/api/resources/tools/types/ToolsCreateResponse.js +1 -3
  204. package/dist/cjs/api/resources/tools/types/ToolsDeleteResponse.d.ts +0 -3
  205. package/dist/cjs/api/resources/tools/types/ToolsDeleteResponse.js +1 -3
  206. package/dist/cjs/api/resources/tools/types/ToolsGetResponse.d.ts +1 -4
  207. package/dist/cjs/api/resources/tools/types/ToolsGetResponse.js +1 -3
  208. package/dist/cjs/api/resources/tools/types/ToolsListResponse.d.ts +1 -4
  209. package/dist/cjs/api/resources/tools/types/ToolsListResponse.js +1 -3
  210. package/dist/cjs/api/resources/tools/types/ToolsUpdateResponse.d.ts +0 -3
  211. package/dist/cjs/api/resources/tools/types/ToolsUpdateResponse.js +1 -3
  212. package/dist/cjs/api/resources/tools/types/index.d.ts +2 -2
  213. package/dist/cjs/api/resources/tools/types/index.js +2 -2
  214. package/dist/cjs/api/resources/voices/client/Client.d.ts +12 -33
  215. package/dist/cjs/api/resources/voices/client/Client.js +33 -66
  216. package/dist/cjs/api/resources/voices/client/index.d.ts +0 -1
  217. package/dist/cjs/api/resources/voices/client/requests/VoicesListRequest.d.ts +0 -3
  218. package/dist/cjs/api/resources/voices/client/requests/VoicesListRequest.js +1 -3
  219. package/dist/cjs/api/resources/voices/client/requests/index.d.ts +1 -1
  220. package/dist/cjs/api/resources/voices/exports.d.ts +2 -0
  221. package/dist/cjs/api/resources/voices/exports.js +21 -0
  222. package/dist/cjs/api/resources/voices/index.d.ts +1 -1
  223. package/dist/cjs/api/resources/voices/index.js +1 -1
  224. package/dist/cjs/api/resources/voices/types/VoicesGetResponse.d.ts +1 -4
  225. package/dist/cjs/api/resources/voices/types/VoicesGetResponse.js +1 -3
  226. package/dist/cjs/api/resources/voices/types/VoicesListResponse.d.ts +1 -4
  227. package/dist/cjs/api/resources/voices/types/VoicesListResponse.js +1 -3
  228. package/dist/cjs/api/resources/voices/types/index.d.ts +1 -1
  229. package/dist/cjs/api/resources/voices/types/index.js +1 -1
  230. package/dist/cjs/api/types/AddSystemMessagePayload.d.ts +0 -3
  231. package/dist/cjs/api/types/AddSystemMessagePayload.js +1 -3
  232. package/dist/cjs/api/types/Agent.d.ts +11 -18
  233. package/dist/cjs/api/types/Agent.js +3 -3
  234. package/dist/cjs/api/types/AssistantChoseNotToRespondPayload.d.ts +0 -3
  235. package/dist/cjs/api/types/AssistantChoseNotToRespondPayload.js +1 -3
  236. package/dist/cjs/api/types/AssistantEndedConversationPayload.d.ts +0 -3
  237. package/dist/cjs/api/types/AssistantEndedConversationPayload.js +1 -3
  238. package/dist/cjs/api/types/AssistantFinishedSpeakingPayload.d.ts +0 -3
  239. package/dist/cjs/api/types/AssistantFinishedSpeakingPayload.js +1 -3
  240. package/dist/cjs/api/types/AssistantStartedSpeakingPayload.d.ts +0 -3
  241. package/dist/cjs/api/types/AssistantStartedSpeakingPayload.js +1 -3
  242. package/dist/cjs/api/types/AudioChunkPayload.d.ts +1 -4
  243. package/dist/cjs/api/types/AudioChunkPayload.js +1 -3
  244. package/dist/cjs/api/types/AudioChunkResponsePayload.d.ts +0 -3
  245. package/dist/cjs/api/types/AudioChunkResponsePayload.js +1 -3
  246. package/dist/cjs/api/types/BadRequestErrorBody.d.ts +1 -4
  247. package/dist/cjs/api/types/BadRequestErrorBody.js +1 -3
  248. package/dist/cjs/api/types/BasicError.d.ts +2 -5
  249. package/dist/cjs/api/types/BasicError.js +1 -3
  250. package/dist/cjs/api/types/ConfigPayload.d.ts +30 -39
  251. package/dist/cjs/api/types/ConfigPayload.js +4 -3
  252. package/dist/cjs/api/types/Conversation.d.ts +10 -19
  253. package/dist/cjs/api/types/Conversation.js +4 -3
  254. package/dist/cjs/api/types/ConversationAnalysis.d.ts +0 -3
  255. package/dist/cjs/api/types/ConversationAnalysis.js +1 -3
  256. package/dist/cjs/api/types/ConversationCreatedPayload.d.ts +0 -3
  257. package/dist/cjs/api/types/ConversationCreatedPayload.js +1 -3
  258. package/dist/cjs/api/types/ConversationEval.d.ts +0 -3
  259. package/dist/cjs/api/types/ConversationEval.js +1 -3
  260. package/dist/cjs/api/types/ConversationEvalPrompt.d.ts +0 -3
  261. package/dist/cjs/api/types/ConversationEvalPrompt.js +1 -3
  262. package/dist/cjs/api/types/ConversationEvaluation.d.ts +1 -4
  263. package/dist/cjs/api/types/ConversationEvaluation.js +1 -3
  264. package/dist/cjs/api/types/ConversationEvaluationResult.d.ts +2 -7
  265. package/dist/cjs/api/types/ConversationEvaluationResult.js +2 -3
  266. package/dist/cjs/api/types/ConversationExtraction.d.ts +1 -4
  267. package/dist/cjs/api/types/ConversationExtraction.js +1 -3
  268. package/dist/cjs/api/types/ConversationItem.d.ts +14 -19
  269. package/dist/cjs/api/types/ConversationItem.js +2 -3
  270. package/dist/cjs/api/types/CreateAgentRequest.d.ts +37 -44
  271. package/dist/cjs/api/types/CreateAgentRequest.js +3 -3
  272. package/dist/cjs/api/types/DtmfPayload.d.ts +0 -3
  273. package/dist/cjs/api/types/DtmfPayload.js +1 -3
  274. package/dist/cjs/api/types/ErrorPayload.d.ts +2 -5
  275. package/dist/cjs/api/types/ErrorPayload.js +1 -3
  276. package/dist/cjs/api/types/Error_.d.ts +1 -4
  277. package/dist/cjs/api/types/Error_.js +1 -3
  278. package/dist/cjs/api/types/ExtractionField.d.ts +3 -8
  279. package/dist/cjs/api/types/ExtractionField.js +2 -3
  280. package/dist/cjs/api/types/ExtractionSchema.d.ts +1 -4
  281. package/dist/cjs/api/types/ExtractionSchema.js +1 -3
  282. package/dist/cjs/api/types/GenerateReplyPayload.d.ts +1 -4
  283. package/dist/cjs/api/types/GenerateReplyPayload.js +1 -3
  284. package/dist/cjs/api/types/InputCancelledPayload.d.ts +0 -3
  285. package/dist/cjs/api/types/InputCancelledPayload.js +1 -3
  286. package/dist/cjs/api/types/InputTextPayload.d.ts +0 -3
  287. package/dist/cjs/api/types/InputTextPayload.js +1 -3
  288. package/dist/cjs/api/types/LanguageCode.d.ts +2 -7
  289. package/dist/cjs/api/types/LanguageCode.js +2 -3
  290. package/dist/cjs/api/types/OutboundCallConfig.d.ts +14 -17
  291. package/dist/cjs/api/types/OutboundCallConfig.js +1 -3
  292. package/dist/cjs/api/types/Project.d.ts +0 -3
  293. package/dist/cjs/api/types/Project.js +1 -3
  294. package/dist/cjs/api/types/ReadyToStartConversationPayload.d.ts +0 -3
  295. package/dist/cjs/api/types/ReadyToStartConversationPayload.js +1 -3
  296. package/dist/cjs/api/types/SetExternalIdPayload.d.ts +0 -3
  297. package/dist/cjs/api/types/SetExternalIdPayload.js +1 -3
  298. package/dist/cjs/api/types/Task.d.ts +0 -3
  299. package/dist/cjs/api/types/Task.js +1 -3
  300. package/dist/cjs/api/types/Tool.d.ts +22 -31
  301. package/dist/cjs/api/types/Tool.js +4 -3
  302. package/dist/cjs/api/types/ToolCallInterruptedPayload.d.ts +0 -3
  303. package/dist/cjs/api/types/ToolCallInterruptedPayload.js +1 -3
  304. package/dist/cjs/api/types/ToolCallOutputPayload.d.ts +1 -4
  305. package/dist/cjs/api/types/ToolCallOutputPayload.js +1 -3
  306. package/dist/cjs/api/types/ToolCallOutputProcessedPayload.d.ts +14 -17
  307. package/dist/cjs/api/types/ToolCallOutputProcessedPayload.js +1 -3
  308. package/dist/cjs/api/types/ToolCallPayload.d.ts +0 -3
  309. package/dist/cjs/api/types/ToolCallPayload.js +1 -3
  310. package/dist/cjs/api/types/ToolParameter.d.ts +7 -14
  311. package/dist/cjs/api/types/ToolParameter.js +10 -3
  312. package/dist/cjs/api/types/UpdateSystemPromptPayload.d.ts +0 -3
  313. package/dist/cjs/api/types/UpdateSystemPromptPayload.js +1 -3
  314. package/dist/cjs/api/types/UserFinishedSpeakingPayload.d.ts +0 -3
  315. package/dist/cjs/api/types/UserFinishedSpeakingPayload.js +1 -3
  316. package/dist/cjs/api/types/UserStartedSpeakingPayload.d.ts +0 -3
  317. package/dist/cjs/api/types/UserStartedSpeakingPayload.js +1 -3
  318. package/dist/cjs/api/types/ValidationError.d.ts +0 -3
  319. package/dist/cjs/api/types/ValidationError.js +1 -3
  320. package/dist/cjs/api/types/Voice.d.ts +0 -3
  321. package/dist/cjs/api/types/Voice.js +1 -3
  322. package/dist/cjs/api/types/WarningPayload.d.ts +1 -4
  323. package/dist/cjs/api/types/WarningPayload.js +1 -3
  324. package/dist/cjs/api/types/index.d.ts +38 -38
  325. package/dist/cjs/api/types/index.js +38 -38
  326. package/dist/cjs/auth/BearerAuthProvider.d.ts +20 -0
  327. package/dist/cjs/auth/BearerAuthProvider.js +82 -0
  328. package/dist/cjs/auth/index.d.ts +1 -0
  329. package/dist/cjs/auth/index.js +5 -0
  330. package/dist/cjs/core/auth/AuthProvider.d.ts +5 -2
  331. package/dist/cjs/core/auth/BasicAuth.js +2 -1
  332. package/dist/cjs/core/auth/BearerToken.d.ts +3 -1
  333. package/dist/cjs/core/auth/BearerToken.js +7 -6
  334. package/dist/cjs/core/auth/NoOpAuthProvider.d.ts +5 -0
  335. package/dist/cjs/core/auth/NoOpAuthProvider.js +9 -0
  336. package/dist/cjs/core/auth/index.d.ts +3 -2
  337. package/dist/cjs/core/auth/index.js +3 -1
  338. package/dist/cjs/core/exports.d.ts +2 -0
  339. package/dist/cjs/core/exports.js +18 -0
  340. package/dist/cjs/core/fetcher/APIResponse.d.ts +1 -1
  341. package/dist/cjs/core/fetcher/BinaryResponse.d.ts +5 -6
  342. package/dist/cjs/core/fetcher/EndpointMetadata.d.ts +13 -0
  343. package/dist/cjs/core/fetcher/EndpointMetadata.js +2 -0
  344. package/dist/cjs/core/fetcher/EndpointSupplier.d.ts +12 -0
  345. package/dist/cjs/core/fetcher/EndpointSupplier.js +22 -0
  346. package/dist/cjs/core/fetcher/Fetcher.d.ts +13 -5
  347. package/dist/cjs/core/fetcher/Fetcher.js +213 -11
  348. package/dist/cjs/core/fetcher/HttpResponsePromise.d.ts +1 -1
  349. package/dist/cjs/core/fetcher/getErrorResponseBody.js +2 -1
  350. package/dist/cjs/core/fetcher/getRequestBody.d.ts +1 -1
  351. package/dist/cjs/core/fetcher/getRequestBody.js +4 -0
  352. package/dist/cjs/core/fetcher/getResponseBody.js +21 -7
  353. package/dist/cjs/core/fetcher/index.d.ts +2 -0
  354. package/dist/cjs/core/fetcher/index.js +3 -1
  355. package/dist/cjs/core/fetcher/makeRequest.d.ts +6 -1
  356. package/dist/cjs/core/fetcher/makeRequest.js +32 -13
  357. package/dist/cjs/core/fetcher/requestWithRetries.js +3 -12
  358. package/dist/cjs/core/fetcher/signals.d.ts +1 -7
  359. package/dist/cjs/core/fetcher/signals.js +0 -12
  360. package/dist/cjs/core/headers.d.ts +2 -3
  361. package/dist/cjs/core/headers.js +6 -4
  362. package/dist/cjs/core/index.d.ts +3 -2
  363. package/dist/cjs/core/index.js +4 -3
  364. package/dist/cjs/core/logging/exports.d.ts +18 -0
  365. package/dist/cjs/core/logging/exports.js +45 -0
  366. package/dist/cjs/core/logging/index.d.ts +1 -0
  367. package/dist/cjs/core/logging/index.js +17 -0
  368. package/dist/cjs/core/logging/logger.d.ts +126 -0
  369. package/dist/cjs/core/logging/logger.js +144 -0
  370. package/dist/cjs/core/runtime/runtime.js +17 -15
  371. package/dist/cjs/core/url/encodePathParam.d.ts +1 -0
  372. package/dist/cjs/core/url/encodePathParam.js +21 -0
  373. package/dist/cjs/core/url/index.d.ts +1 -0
  374. package/dist/cjs/core/url/index.js +3 -1
  375. package/dist/cjs/core/url/join.js +3 -4
  376. package/dist/cjs/core/websocket/exports.d.ts +8 -0
  377. package/dist/cjs/core/websocket/exports.js +2 -0
  378. package/dist/cjs/core/websocket/ws.d.ts +14 -11
  379. package/dist/cjs/core/websocket/ws.js +42 -29
  380. package/dist/cjs/environments.d.ts +0 -3
  381. package/dist/cjs/environments.js +1 -3
  382. package/dist/cjs/errors/PhonicError.d.ts +1 -4
  383. package/dist/cjs/errors/PhonicError.js +7 -5
  384. package/dist/cjs/errors/PhonicTimeoutError.d.ts +0 -3
  385. package/dist/cjs/errors/PhonicTimeoutError.js +6 -4
  386. package/dist/cjs/errors/handleNonStatusCodeError.d.ts +2 -0
  387. package/dist/cjs/errors/handleNonStatusCodeError.js +65 -0
  388. package/dist/cjs/exports.d.ts +1 -0
  389. package/dist/cjs/exports.js +17 -0
  390. package/dist/cjs/index.d.ts +4 -2
  391. package/dist/cjs/index.js +8 -4
  392. package/dist/cjs/version.d.ts +1 -1
  393. package/dist/cjs/version.js +1 -1
  394. package/dist/esm/BaseClient.d.mts +40 -0
  395. package/dist/esm/BaseClient.mjs +25 -0
  396. package/dist/esm/Client.d.mts +27 -48
  397. package/dist/esm/Client.mjs +18 -28
  398. package/dist/esm/api/errors/BadRequestError.d.mts +1 -4
  399. package/dist/esm/api/errors/BadRequestError.mjs +6 -4
  400. package/dist/esm/api/errors/ConflictError.d.mts +1 -4
  401. package/dist/esm/api/errors/ConflictError.mjs +6 -4
  402. package/dist/esm/api/errors/ForbiddenError.d.mts +1 -4
  403. package/dist/esm/api/errors/ForbiddenError.mjs +6 -4
  404. package/dist/esm/api/errors/GatewayTimeoutError.d.mts +2 -5
  405. package/dist/esm/api/errors/GatewayTimeoutError.mjs +6 -4
  406. package/dist/esm/api/errors/InternalServerError.d.mts +2 -5
  407. package/dist/esm/api/errors/InternalServerError.mjs +6 -4
  408. package/dist/esm/api/errors/NotFoundError.d.mts +1 -4
  409. package/dist/esm/api/errors/NotFoundError.mjs +6 -4
  410. package/dist/esm/api/errors/UnauthorizedError.d.mts +2 -5
  411. package/dist/esm/api/errors/UnauthorizedError.mjs +6 -4
  412. package/dist/esm/api/errors/index.d.mts +4 -4
  413. package/dist/esm/api/errors/index.mjs +4 -4
  414. package/dist/esm/api/resources/agents/client/Client.d.mts +26 -47
  415. package/dist/esm/api/resources/agents/client/Client.mjs +126 -247
  416. package/dist/esm/api/resources/agents/client/index.d.mts +0 -1
  417. package/dist/esm/api/resources/agents/client/requests/AgentsAddCustomPhoneNumberRequest.d.mts +2 -5
  418. package/dist/esm/api/resources/agents/client/requests/AgentsAddCustomPhoneNumberRequest.mjs +1 -3
  419. package/dist/esm/api/resources/agents/client/requests/AgentsCreateRequest.d.mts +1 -4
  420. package/dist/esm/api/resources/agents/client/requests/AgentsCreateRequest.mjs +1 -3
  421. package/dist/esm/api/resources/agents/client/requests/AgentsDeleteCustomPhoneNumberRequest.d.mts +0 -3
  422. package/dist/esm/api/resources/agents/client/requests/AgentsDeleteCustomPhoneNumberRequest.mjs +1 -3
  423. package/dist/esm/api/resources/agents/client/requests/AgentsDeleteRequest.d.mts +0 -3
  424. package/dist/esm/api/resources/agents/client/requests/AgentsDeleteRequest.mjs +1 -3
  425. package/dist/esm/api/resources/agents/client/requests/AgentsGetRequest.d.mts +0 -3
  426. package/dist/esm/api/resources/agents/client/requests/AgentsGetRequest.mjs +1 -3
  427. package/dist/esm/api/resources/agents/client/requests/AgentsListRequest.d.mts +0 -3
  428. package/dist/esm/api/resources/agents/client/requests/AgentsListRequest.mjs +1 -3
  429. package/dist/esm/api/resources/agents/client/requests/AgentsUpdatePhoneNumberRequest.d.mts +2 -5
  430. package/dist/esm/api/resources/agents/client/requests/AgentsUpdatePhoneNumberRequest.mjs +1 -3
  431. package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.d.mts +9 -16
  432. package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.mjs +3 -3
  433. package/dist/esm/api/resources/agents/client/requests/UpsertAgentRequest.d.mts +1 -4
  434. package/dist/esm/api/resources/agents/client/requests/UpsertAgentRequest.mjs +1 -3
  435. package/dist/esm/api/resources/agents/client/requests/index.d.mts +9 -9
  436. package/dist/esm/api/resources/agents/client/requests/index.mjs +1 -1
  437. package/dist/esm/api/resources/agents/exports.d.mts +2 -0
  438. package/dist/esm/api/resources/agents/exports.mjs +3 -0
  439. package/dist/esm/api/resources/agents/index.d.mts +1 -1
  440. package/dist/esm/api/resources/agents/index.mjs +1 -1
  441. package/dist/esm/api/resources/agents/types/AgentsAddCustomPhoneNumberResponse.d.mts +0 -3
  442. package/dist/esm/api/resources/agents/types/AgentsAddCustomPhoneNumberResponse.mjs +1 -3
  443. package/dist/esm/api/resources/agents/types/AgentsCreateResponse.d.mts +0 -3
  444. package/dist/esm/api/resources/agents/types/AgentsCreateResponse.mjs +1 -3
  445. package/dist/esm/api/resources/agents/types/AgentsDeleteCustomPhoneNumberResponse.d.mts +0 -3
  446. package/dist/esm/api/resources/agents/types/AgentsDeleteCustomPhoneNumberResponse.mjs +1 -3
  447. package/dist/esm/api/resources/agents/types/AgentsDeleteResponse.d.mts +0 -3
  448. package/dist/esm/api/resources/agents/types/AgentsDeleteResponse.mjs +1 -3
  449. package/dist/esm/api/resources/agents/types/AgentsGetResponse.d.mts +1 -4
  450. package/dist/esm/api/resources/agents/types/AgentsGetResponse.mjs +1 -3
  451. package/dist/esm/api/resources/agents/types/AgentsListResponse.d.mts +1 -4
  452. package/dist/esm/api/resources/agents/types/AgentsListResponse.mjs +1 -3
  453. package/dist/esm/api/resources/agents/types/AgentsUpdatePhoneNumberResponse.d.mts +0 -3
  454. package/dist/esm/api/resources/agents/types/AgentsUpdatePhoneNumberResponse.mjs +1 -3
  455. package/dist/esm/api/resources/agents/types/AgentsUpdateResponse.d.mts +0 -3
  456. package/dist/esm/api/resources/agents/types/AgentsUpdateResponse.mjs +1 -3
  457. package/dist/esm/api/resources/agents/types/AgentsUpsertResponse.d.mts +1 -4
  458. package/dist/esm/api/resources/agents/types/AgentsUpsertResponse.mjs +1 -3
  459. package/dist/esm/api/resources/agents/types/index.d.mts +6 -6
  460. package/dist/esm/api/resources/agents/types/index.mjs +6 -6
  461. package/dist/esm/api/resources/auth/client/Client.d.mts +10 -31
  462. package/dist/esm/api/resources/auth/client/Client.mjs +18 -41
  463. package/dist/esm/api/resources/auth/client/index.d.mts +0 -1
  464. package/dist/esm/api/resources/auth/client/requests/CreateSessionTokenRequest.d.mts +0 -3
  465. package/dist/esm/api/resources/auth/client/requests/CreateSessionTokenRequest.mjs +1 -3
  466. package/dist/esm/api/resources/auth/client/requests/index.d.mts +1 -1
  467. package/dist/esm/api/resources/auth/exports.d.mts +2 -0
  468. package/dist/esm/api/resources/auth/exports.mjs +3 -0
  469. package/dist/esm/api/resources/auth/index.d.mts +1 -1
  470. package/dist/esm/api/resources/auth/index.mjs +1 -1
  471. package/dist/esm/api/resources/auth/types/AuthCreateSessionTokenResponse.d.mts +0 -3
  472. package/dist/esm/api/resources/auth/types/AuthCreateSessionTokenResponse.mjs +1 -3
  473. package/dist/esm/api/resources/conversations/client/Client.d.mts +36 -51
  474. package/dist/esm/api/resources/conversations/client/Client.mjs +132 -268
  475. package/dist/esm/api/resources/conversations/client/Socket.d.mts +2 -12
  476. package/dist/esm/api/resources/conversations/client/Socket.mjs +15 -40
  477. package/dist/esm/api/resources/conversations/client/index.d.mts +0 -1
  478. package/dist/esm/api/resources/conversations/client/requests/ConversationsListRequest.d.mts +0 -6
  479. package/dist/esm/api/resources/conversations/client/requests/ConversationsListRequest.mjs +1 -3
  480. package/dist/esm/api/resources/conversations/client/requests/ConversationsSipOutboundCallRequest.d.mts +1 -4
  481. package/dist/esm/api/resources/conversations/client/requests/ConversationsSipOutboundCallRequest.mjs +1 -3
  482. package/dist/esm/api/resources/conversations/client/requests/EvaluateConversationRequest.d.mts +0 -3
  483. package/dist/esm/api/resources/conversations/client/requests/EvaluateConversationRequest.mjs +1 -3
  484. package/dist/esm/api/resources/conversations/client/requests/ExtractDataRequest.d.mts +0 -3
  485. package/dist/esm/api/resources/conversations/client/requests/ExtractDataRequest.mjs +1 -3
  486. package/dist/esm/api/resources/conversations/client/requests/OutboundCallRequest.d.mts +1 -4
  487. package/dist/esm/api/resources/conversations/client/requests/OutboundCallRequest.mjs +1 -3
  488. package/dist/esm/api/resources/conversations/client/requests/index.d.mts +5 -5
  489. package/dist/esm/api/resources/conversations/exports.d.mts +2 -0
  490. package/dist/esm/api/resources/conversations/exports.mjs +3 -0
  491. package/dist/esm/api/resources/conversations/index.d.mts +1 -1
  492. package/dist/esm/api/resources/conversations/index.mjs +1 -1
  493. package/dist/esm/api/resources/conversations/types/ConversationsCancelResponse.d.mts +0 -3
  494. package/dist/esm/api/resources/conversations/types/ConversationsCancelResponse.mjs +1 -3
  495. package/dist/esm/api/resources/conversations/types/ConversationsExtractDataResponse.d.mts +0 -3
  496. package/dist/esm/api/resources/conversations/types/ConversationsExtractDataResponse.mjs +1 -3
  497. package/dist/esm/api/resources/conversations/types/ConversationsGetAnalysisResponse.d.mts +1 -4
  498. package/dist/esm/api/resources/conversations/types/ConversationsGetAnalysisResponse.mjs +1 -3
  499. package/dist/esm/api/resources/conversations/types/ConversationsGetResponse.d.mts +1 -4
  500. package/dist/esm/api/resources/conversations/types/ConversationsGetResponse.mjs +1 -3
  501. package/dist/esm/api/resources/conversations/types/ConversationsListEvaluationsResponse.d.mts +1 -4
  502. package/dist/esm/api/resources/conversations/types/ConversationsListEvaluationsResponse.mjs +1 -3
  503. package/dist/esm/api/resources/conversations/types/ConversationsListExtractionsResponse.d.mts +1 -4
  504. package/dist/esm/api/resources/conversations/types/ConversationsListExtractionsResponse.mjs +1 -3
  505. package/dist/esm/api/resources/conversations/types/ConversationsListResponse.d.mts +1 -4
  506. package/dist/esm/api/resources/conversations/types/ConversationsListResponse.mjs +1 -3
  507. package/dist/esm/api/resources/conversations/types/ConversationsOutboundCallResponse.d.mts +0 -3
  508. package/dist/esm/api/resources/conversations/types/ConversationsOutboundCallResponse.mjs +1 -3
  509. package/dist/esm/api/resources/conversations/types/ConversationsSipOutboundCallResponse.d.mts +0 -3
  510. package/dist/esm/api/resources/conversations/types/ConversationsSipOutboundCallResponse.mjs +1 -3
  511. package/dist/esm/api/resources/conversations/types/index.d.mts +4 -4
  512. package/dist/esm/api/resources/conversations/types/index.mjs +4 -4
  513. package/dist/esm/api/resources/extractionSchemas/client/Client.d.mts +18 -39
  514. package/dist/esm/api/resources/extractionSchemas/client/Client.mjs +72 -144
  515. package/dist/esm/api/resources/extractionSchemas/client/index.d.mts +0 -1
  516. package/dist/esm/api/resources/extractionSchemas/client/requests/CreateExtractionSchemaRequest.d.mts +1 -4
  517. package/dist/esm/api/resources/extractionSchemas/client/requests/CreateExtractionSchemaRequest.mjs +1 -3
  518. package/dist/esm/api/resources/extractionSchemas/client/requests/ExtractionSchemasDeleteRequest.d.mts +0 -3
  519. package/dist/esm/api/resources/extractionSchemas/client/requests/ExtractionSchemasDeleteRequest.mjs +1 -3
  520. package/dist/esm/api/resources/extractionSchemas/client/requests/ExtractionSchemasGetRequest.d.mts +0 -3
  521. package/dist/esm/api/resources/extractionSchemas/client/requests/ExtractionSchemasGetRequest.mjs +1 -3
  522. package/dist/esm/api/resources/extractionSchemas/client/requests/ExtractionSchemasListRequest.d.mts +0 -3
  523. package/dist/esm/api/resources/extractionSchemas/client/requests/ExtractionSchemasListRequest.mjs +1 -3
  524. package/dist/esm/api/resources/extractionSchemas/client/requests/UpdateExtractionSchemaRequest.d.mts +1 -4
  525. package/dist/esm/api/resources/extractionSchemas/client/requests/UpdateExtractionSchemaRequest.mjs +1 -3
  526. package/dist/esm/api/resources/extractionSchemas/client/requests/index.d.mts +5 -5
  527. package/dist/esm/api/resources/extractionSchemas/exports.d.mts +2 -0
  528. package/dist/esm/api/resources/extractionSchemas/exports.mjs +3 -0
  529. package/dist/esm/api/resources/extractionSchemas/index.d.mts +1 -1
  530. package/dist/esm/api/resources/extractionSchemas/index.mjs +1 -1
  531. package/dist/esm/api/resources/extractionSchemas/types/ExtractionSchemasCreateResponse.d.mts +0 -3
  532. package/dist/esm/api/resources/extractionSchemas/types/ExtractionSchemasCreateResponse.mjs +1 -3
  533. package/dist/esm/api/resources/extractionSchemas/types/ExtractionSchemasDeleteResponse.d.mts +0 -3
  534. package/dist/esm/api/resources/extractionSchemas/types/ExtractionSchemasDeleteResponse.mjs +1 -3
  535. package/dist/esm/api/resources/extractionSchemas/types/ExtractionSchemasGetResponse.d.mts +1 -4
  536. package/dist/esm/api/resources/extractionSchemas/types/ExtractionSchemasGetResponse.mjs +1 -3
  537. package/dist/esm/api/resources/extractionSchemas/types/ExtractionSchemasListResponse.d.mts +1 -4
  538. package/dist/esm/api/resources/extractionSchemas/types/ExtractionSchemasListResponse.mjs +1 -3
  539. package/dist/esm/api/resources/extractionSchemas/types/ExtractionSchemasUpdateResponse.d.mts +0 -3
  540. package/dist/esm/api/resources/extractionSchemas/types/ExtractionSchemasUpdateResponse.mjs +1 -3
  541. package/dist/esm/api/resources/extractionSchemas/types/index.d.mts +2 -2
  542. package/dist/esm/api/resources/extractionSchemas/types/index.mjs +2 -2
  543. package/dist/esm/api/resources/index.d.mts +13 -13
  544. package/dist/esm/api/resources/index.mjs +13 -13
  545. package/dist/esm/api/resources/projects/client/Client.d.mts +22 -43
  546. package/dist/esm/api/resources/projects/client/Client.mjs +77 -166
  547. package/dist/esm/api/resources/projects/client/index.d.mts +0 -1
  548. package/dist/esm/api/resources/projects/client/requests/CreateConversationEvalPromptRequest.d.mts +0 -3
  549. package/dist/esm/api/resources/projects/client/requests/CreateConversationEvalPromptRequest.mjs +1 -3
  550. package/dist/esm/api/resources/projects/client/requests/CreateProjectRequest.d.mts +0 -3
  551. package/dist/esm/api/resources/projects/client/requests/CreateProjectRequest.mjs +1 -3
  552. package/dist/esm/api/resources/projects/client/requests/UpdateProjectRequest.d.mts +0 -3
  553. package/dist/esm/api/resources/projects/client/requests/UpdateProjectRequest.mjs +1 -3
  554. package/dist/esm/api/resources/projects/client/requests/index.d.mts +3 -3
  555. package/dist/esm/api/resources/projects/exports.d.mts +2 -0
  556. package/dist/esm/api/resources/projects/exports.mjs +3 -0
  557. package/dist/esm/api/resources/projects/index.d.mts +1 -1
  558. package/dist/esm/api/resources/projects/index.mjs +1 -1
  559. package/dist/esm/api/resources/projects/types/ProjectsCreateEvalPromptResponse.d.mts +0 -3
  560. package/dist/esm/api/resources/projects/types/ProjectsCreateEvalPromptResponse.mjs +1 -3
  561. package/dist/esm/api/resources/projects/types/ProjectsCreateResponse.d.mts +0 -3
  562. package/dist/esm/api/resources/projects/types/ProjectsCreateResponse.mjs +1 -3
  563. package/dist/esm/api/resources/projects/types/ProjectsDeleteResponse.d.mts +0 -3
  564. package/dist/esm/api/resources/projects/types/ProjectsDeleteResponse.mjs +1 -3
  565. package/dist/esm/api/resources/projects/types/ProjectsGetResponse.d.mts +1 -4
  566. package/dist/esm/api/resources/projects/types/ProjectsGetResponse.mjs +1 -3
  567. package/dist/esm/api/resources/projects/types/ProjectsListEvalPromptsResponse.d.mts +1 -4
  568. package/dist/esm/api/resources/projects/types/ProjectsListEvalPromptsResponse.mjs +1 -3
  569. package/dist/esm/api/resources/projects/types/ProjectsListResponse.d.mts +1 -4
  570. package/dist/esm/api/resources/projects/types/ProjectsListResponse.mjs +1 -3
  571. package/dist/esm/api/resources/projects/types/ProjectsUpdateResponse.d.mts +0 -3
  572. package/dist/esm/api/resources/projects/types/ProjectsUpdateResponse.mjs +1 -3
  573. package/dist/esm/api/resources/projects/types/index.d.mts +4 -4
  574. package/dist/esm/api/resources/projects/types/index.mjs +4 -4
  575. package/dist/esm/api/resources/tools/client/Client.d.mts +18 -39
  576. package/dist/esm/api/resources/tools/client/Client.mjs +72 -144
  577. package/dist/esm/api/resources/tools/client/index.d.mts +0 -1
  578. package/dist/esm/api/resources/tools/client/requests/CreateToolRequest.d.mts +7 -16
  579. package/dist/esm/api/resources/tools/client/requests/CreateToolRequest.mjs +4 -3
  580. package/dist/esm/api/resources/tools/client/requests/ToolsDeleteRequest.d.mts +0 -3
  581. package/dist/esm/api/resources/tools/client/requests/ToolsDeleteRequest.mjs +1 -3
  582. package/dist/esm/api/resources/tools/client/requests/ToolsGetRequest.d.mts +0 -23
  583. package/dist/esm/api/resources/tools/client/requests/ToolsGetRequest.mjs +1 -3
  584. package/dist/esm/api/resources/tools/client/requests/ToolsListRequest.d.mts +0 -3
  585. package/dist/esm/api/resources/tools/client/requests/ToolsListRequest.mjs +1 -3
  586. package/dist/esm/api/resources/tools/client/requests/UpdateToolRequest.d.mts +7 -16
  587. package/dist/esm/api/resources/tools/client/requests/UpdateToolRequest.mjs +4 -3
  588. package/dist/esm/api/resources/tools/client/requests/index.d.mts +5 -5
  589. package/dist/esm/api/resources/tools/client/requests/index.mjs +2 -1
  590. package/dist/esm/api/resources/tools/exports.d.mts +2 -0
  591. package/dist/esm/api/resources/tools/exports.mjs +3 -0
  592. package/dist/esm/api/resources/tools/index.d.mts +1 -1
  593. package/dist/esm/api/resources/tools/index.mjs +1 -1
  594. package/dist/esm/api/resources/tools/types/ToolsCreateResponse.d.mts +0 -3
  595. package/dist/esm/api/resources/tools/types/ToolsCreateResponse.mjs +1 -3
  596. package/dist/esm/api/resources/tools/types/ToolsDeleteResponse.d.mts +0 -3
  597. package/dist/esm/api/resources/tools/types/ToolsDeleteResponse.mjs +1 -3
  598. package/dist/esm/api/resources/tools/types/ToolsGetResponse.d.mts +1 -4
  599. package/dist/esm/api/resources/tools/types/ToolsGetResponse.mjs +1 -3
  600. package/dist/esm/api/resources/tools/types/ToolsListResponse.d.mts +1 -4
  601. package/dist/esm/api/resources/tools/types/ToolsListResponse.mjs +1 -3
  602. package/dist/esm/api/resources/tools/types/ToolsUpdateResponse.d.mts +0 -3
  603. package/dist/esm/api/resources/tools/types/ToolsUpdateResponse.mjs +1 -3
  604. package/dist/esm/api/resources/tools/types/index.d.mts +2 -2
  605. package/dist/esm/api/resources/tools/types/index.mjs +2 -2
  606. package/dist/esm/api/resources/voices/client/Client.d.mts +12 -33
  607. package/dist/esm/api/resources/voices/client/Client.mjs +31 -64
  608. package/dist/esm/api/resources/voices/client/index.d.mts +0 -1
  609. package/dist/esm/api/resources/voices/client/requests/VoicesListRequest.d.mts +0 -3
  610. package/dist/esm/api/resources/voices/client/requests/VoicesListRequest.mjs +1 -3
  611. package/dist/esm/api/resources/voices/client/requests/index.d.mts +1 -1
  612. package/dist/esm/api/resources/voices/exports.d.mts +2 -0
  613. package/dist/esm/api/resources/voices/exports.mjs +3 -0
  614. package/dist/esm/api/resources/voices/index.d.mts +1 -1
  615. package/dist/esm/api/resources/voices/index.mjs +1 -1
  616. package/dist/esm/api/resources/voices/types/VoicesGetResponse.d.mts +1 -4
  617. package/dist/esm/api/resources/voices/types/VoicesGetResponse.mjs +1 -3
  618. package/dist/esm/api/resources/voices/types/VoicesListResponse.d.mts +1 -4
  619. package/dist/esm/api/resources/voices/types/VoicesListResponse.mjs +1 -3
  620. package/dist/esm/api/resources/voices/types/index.d.mts +1 -1
  621. package/dist/esm/api/resources/voices/types/index.mjs +1 -1
  622. package/dist/esm/api/types/AddSystemMessagePayload.d.mts +0 -3
  623. package/dist/esm/api/types/AddSystemMessagePayload.mjs +1 -3
  624. package/dist/esm/api/types/Agent.d.mts +11 -18
  625. package/dist/esm/api/types/Agent.mjs +3 -3
  626. package/dist/esm/api/types/AssistantChoseNotToRespondPayload.d.mts +0 -3
  627. package/dist/esm/api/types/AssistantChoseNotToRespondPayload.mjs +1 -3
  628. package/dist/esm/api/types/AssistantEndedConversationPayload.d.mts +0 -3
  629. package/dist/esm/api/types/AssistantEndedConversationPayload.mjs +1 -3
  630. package/dist/esm/api/types/AssistantFinishedSpeakingPayload.d.mts +0 -3
  631. package/dist/esm/api/types/AssistantFinishedSpeakingPayload.mjs +1 -3
  632. package/dist/esm/api/types/AssistantStartedSpeakingPayload.d.mts +0 -3
  633. package/dist/esm/api/types/AssistantStartedSpeakingPayload.mjs +1 -3
  634. package/dist/esm/api/types/AudioChunkPayload.d.mts +1 -4
  635. package/dist/esm/api/types/AudioChunkPayload.mjs +1 -3
  636. package/dist/esm/api/types/AudioChunkResponsePayload.d.mts +0 -3
  637. package/dist/esm/api/types/AudioChunkResponsePayload.mjs +1 -3
  638. package/dist/esm/api/types/BadRequestErrorBody.d.mts +1 -4
  639. package/dist/esm/api/types/BadRequestErrorBody.mjs +1 -3
  640. package/dist/esm/api/types/BasicError.d.mts +2 -5
  641. package/dist/esm/api/types/BasicError.mjs +1 -3
  642. package/dist/esm/api/types/ConfigPayload.d.mts +30 -39
  643. package/dist/esm/api/types/ConfigPayload.mjs +4 -3
  644. package/dist/esm/api/types/Conversation.d.mts +10 -19
  645. package/dist/esm/api/types/Conversation.mjs +4 -3
  646. package/dist/esm/api/types/ConversationAnalysis.d.mts +0 -3
  647. package/dist/esm/api/types/ConversationAnalysis.mjs +1 -3
  648. package/dist/esm/api/types/ConversationCreatedPayload.d.mts +0 -3
  649. package/dist/esm/api/types/ConversationCreatedPayload.mjs +1 -3
  650. package/dist/esm/api/types/ConversationEval.d.mts +0 -3
  651. package/dist/esm/api/types/ConversationEval.mjs +1 -3
  652. package/dist/esm/api/types/ConversationEvalPrompt.d.mts +0 -3
  653. package/dist/esm/api/types/ConversationEvalPrompt.mjs +1 -3
  654. package/dist/esm/api/types/ConversationEvaluation.d.mts +1 -4
  655. package/dist/esm/api/types/ConversationEvaluation.mjs +1 -3
  656. package/dist/esm/api/types/ConversationEvaluationResult.d.mts +2 -7
  657. package/dist/esm/api/types/ConversationEvaluationResult.mjs +2 -3
  658. package/dist/esm/api/types/ConversationExtraction.d.mts +1 -4
  659. package/dist/esm/api/types/ConversationExtraction.mjs +1 -3
  660. package/dist/esm/api/types/ConversationItem.d.mts +14 -19
  661. package/dist/esm/api/types/ConversationItem.mjs +2 -3
  662. package/dist/esm/api/types/CreateAgentRequest.d.mts +37 -44
  663. package/dist/esm/api/types/CreateAgentRequest.mjs +3 -3
  664. package/dist/esm/api/types/DtmfPayload.d.mts +0 -3
  665. package/dist/esm/api/types/DtmfPayload.mjs +1 -3
  666. package/dist/esm/api/types/ErrorPayload.d.mts +2 -5
  667. package/dist/esm/api/types/ErrorPayload.mjs +1 -3
  668. package/dist/esm/api/types/Error_.d.mts +1 -4
  669. package/dist/esm/api/types/Error_.mjs +1 -3
  670. package/dist/esm/api/types/ExtractionField.d.mts +3 -8
  671. package/dist/esm/api/types/ExtractionField.mjs +2 -3
  672. package/dist/esm/api/types/ExtractionSchema.d.mts +1 -4
  673. package/dist/esm/api/types/ExtractionSchema.mjs +1 -3
  674. package/dist/esm/api/types/GenerateReplyPayload.d.mts +1 -4
  675. package/dist/esm/api/types/GenerateReplyPayload.mjs +1 -3
  676. package/dist/esm/api/types/InputCancelledPayload.d.mts +0 -3
  677. package/dist/esm/api/types/InputCancelledPayload.mjs +1 -3
  678. package/dist/esm/api/types/InputTextPayload.d.mts +0 -3
  679. package/dist/esm/api/types/InputTextPayload.mjs +1 -3
  680. package/dist/esm/api/types/LanguageCode.d.mts +2 -7
  681. package/dist/esm/api/types/LanguageCode.mjs +2 -3
  682. package/dist/esm/api/types/OutboundCallConfig.d.mts +14 -17
  683. package/dist/esm/api/types/OutboundCallConfig.mjs +1 -3
  684. package/dist/esm/api/types/Project.d.mts +0 -3
  685. package/dist/esm/api/types/Project.mjs +1 -3
  686. package/dist/esm/api/types/ReadyToStartConversationPayload.d.mts +0 -3
  687. package/dist/esm/api/types/ReadyToStartConversationPayload.mjs +1 -3
  688. package/dist/esm/api/types/SetExternalIdPayload.d.mts +0 -3
  689. package/dist/esm/api/types/SetExternalIdPayload.mjs +1 -3
  690. package/dist/esm/api/types/Task.d.mts +0 -3
  691. package/dist/esm/api/types/Task.mjs +1 -3
  692. package/dist/esm/api/types/Tool.d.mts +22 -31
  693. package/dist/esm/api/types/Tool.mjs +4 -3
  694. package/dist/esm/api/types/ToolCallInterruptedPayload.d.mts +0 -3
  695. package/dist/esm/api/types/ToolCallInterruptedPayload.mjs +1 -3
  696. package/dist/esm/api/types/ToolCallOutputPayload.d.mts +1 -4
  697. package/dist/esm/api/types/ToolCallOutputPayload.mjs +1 -3
  698. package/dist/esm/api/types/ToolCallOutputProcessedPayload.d.mts +14 -17
  699. package/dist/esm/api/types/ToolCallOutputProcessedPayload.mjs +1 -3
  700. package/dist/esm/api/types/ToolCallPayload.d.mts +0 -3
  701. package/dist/esm/api/types/ToolCallPayload.mjs +1 -3
  702. package/dist/esm/api/types/ToolParameter.d.mts +7 -14
  703. package/dist/esm/api/types/ToolParameter.mjs +10 -3
  704. package/dist/esm/api/types/UpdateSystemPromptPayload.d.mts +0 -3
  705. package/dist/esm/api/types/UpdateSystemPromptPayload.mjs +1 -3
  706. package/dist/esm/api/types/UserFinishedSpeakingPayload.d.mts +0 -3
  707. package/dist/esm/api/types/UserFinishedSpeakingPayload.mjs +1 -3
  708. package/dist/esm/api/types/UserStartedSpeakingPayload.d.mts +0 -3
  709. package/dist/esm/api/types/UserStartedSpeakingPayload.mjs +1 -3
  710. package/dist/esm/api/types/ValidationError.d.mts +0 -3
  711. package/dist/esm/api/types/ValidationError.mjs +1 -3
  712. package/dist/esm/api/types/Voice.d.mts +0 -3
  713. package/dist/esm/api/types/Voice.mjs +1 -3
  714. package/dist/esm/api/types/WarningPayload.d.mts +1 -4
  715. package/dist/esm/api/types/WarningPayload.mjs +1 -3
  716. package/dist/esm/api/types/index.d.mts +38 -38
  717. package/dist/esm/api/types/index.mjs +38 -38
  718. package/dist/esm/auth/BearerAuthProvider.d.mts +20 -0
  719. package/dist/esm/auth/BearerAuthProvider.mjs +45 -0
  720. package/dist/esm/auth/index.d.mts +1 -0
  721. package/dist/esm/auth/index.mjs +1 -0
  722. package/dist/esm/core/auth/AuthProvider.d.mts +5 -2
  723. package/dist/esm/core/auth/BasicAuth.mjs +2 -1
  724. package/dist/esm/core/auth/BearerToken.d.mts +3 -1
  725. package/dist/esm/core/auth/BearerToken.mjs +7 -6
  726. package/dist/esm/core/auth/NoOpAuthProvider.d.mts +5 -0
  727. package/dist/esm/core/auth/NoOpAuthProvider.mjs +5 -0
  728. package/dist/esm/core/auth/index.d.mts +3 -2
  729. package/dist/esm/core/auth/index.mjs +1 -0
  730. package/dist/esm/core/exports.d.mts +2 -0
  731. package/dist/esm/core/exports.mjs +2 -0
  732. package/dist/esm/core/fetcher/APIResponse.d.mts +1 -1
  733. package/dist/esm/core/fetcher/BinaryResponse.d.mts +5 -6
  734. package/dist/esm/core/fetcher/EndpointMetadata.d.mts +13 -0
  735. package/dist/esm/core/fetcher/EndpointMetadata.mjs +1 -0
  736. package/dist/esm/core/fetcher/EndpointSupplier.d.mts +12 -0
  737. package/dist/esm/core/fetcher/EndpointSupplier.mjs +19 -0
  738. package/dist/esm/core/fetcher/Fetcher.d.mts +13 -5
  739. package/dist/esm/core/fetcher/Fetcher.mjs +213 -11
  740. package/dist/esm/core/fetcher/HttpResponsePromise.d.mts +1 -1
  741. package/dist/esm/core/fetcher/getErrorResponseBody.mjs +2 -1
  742. package/dist/esm/core/fetcher/getRequestBody.d.mts +1 -1
  743. package/dist/esm/core/fetcher/getRequestBody.mjs +4 -0
  744. package/dist/esm/core/fetcher/getResponseBody.mjs +21 -7
  745. package/dist/esm/core/fetcher/index.d.mts +2 -0
  746. package/dist/esm/core/fetcher/index.mjs +1 -0
  747. package/dist/esm/core/fetcher/makeRequest.d.mts +6 -1
  748. package/dist/esm/core/fetcher/makeRequest.mjs +30 -13
  749. package/dist/esm/core/fetcher/requestWithRetries.mjs +3 -12
  750. package/dist/esm/core/fetcher/signals.d.mts +1 -7
  751. package/dist/esm/core/fetcher/signals.mjs +0 -12
  752. package/dist/esm/core/headers.d.mts +2 -3
  753. package/dist/esm/core/headers.mjs +6 -4
  754. package/dist/esm/core/index.d.mts +3 -2
  755. package/dist/esm/core/index.mjs +3 -2
  756. package/dist/esm/core/logging/exports.d.mts +18 -0
  757. package/dist/esm/core/logging/exports.mjs +9 -0
  758. package/dist/esm/core/logging/index.d.mts +1 -0
  759. package/dist/esm/core/logging/index.mjs +1 -0
  760. package/dist/esm/core/logging/logger.d.mts +126 -0
  761. package/dist/esm/core/logging/logger.mjs +138 -0
  762. package/dist/esm/core/runtime/runtime.mjs +17 -15
  763. package/dist/esm/core/url/encodePathParam.d.mts +1 -0
  764. package/dist/esm/core/url/encodePathParam.mjs +18 -0
  765. package/dist/esm/core/url/index.d.mts +1 -0
  766. package/dist/esm/core/url/index.mjs +1 -0
  767. package/dist/esm/core/url/join.mjs +3 -4
  768. package/dist/esm/core/websocket/exports.d.mts +8 -0
  769. package/dist/esm/core/websocket/exports.mjs +1 -0
  770. package/dist/esm/core/websocket/ws.d.mts +14 -11
  771. package/dist/esm/core/websocket/ws.mjs +42 -29
  772. package/dist/esm/environments.d.mts +0 -3
  773. package/dist/esm/environments.mjs +1 -3
  774. package/dist/esm/errors/PhonicError.d.mts +1 -4
  775. package/dist/esm/errors/PhonicError.mjs +7 -5
  776. package/dist/esm/errors/PhonicTimeoutError.d.mts +0 -3
  777. package/dist/esm/errors/PhonicTimeoutError.mjs +6 -4
  778. package/dist/esm/errors/handleNonStatusCodeError.d.mts +2 -0
  779. package/dist/esm/errors/handleNonStatusCodeError.mjs +29 -0
  780. package/dist/esm/exports.d.mts +1 -0
  781. package/dist/esm/exports.mjs +1 -0
  782. package/dist/esm/index.d.mts +4 -2
  783. package/dist/esm/index.mjs +2 -1
  784. package/dist/esm/version.d.mts +1 -1
  785. package/dist/esm/version.mjs +1 -1
  786. package/package.json +92 -8
  787. package/reference.md +321 -329
@@ -1,6 +1,4 @@
1
- /**
2
- * This file was auto-generated by Fern from our API Definition.
3
- */
1
+ // This file was auto-generated by Fern from our API Definition.
4
2
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
5
3
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
6
4
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -21,20 +19,22 @@ var __rest = (this && this.__rest) || function (s, e) {
21
19
  }
22
20
  return t;
23
21
  };
24
- import * as environments from "../../../../environments.mjs";
22
+ import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
23
+ import { mergeHeaders } from "../../../../core/headers.mjs";
25
24
  import * as core from "../../../../core/index.mjs";
26
- import * as Phonic from "../../../index.mjs";
27
- import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.mjs";
25
+ import * as environments from "../../../../environments.mjs";
26
+ import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
28
27
  import * as errors from "../../../../errors/index.mjs";
29
- export class Tools {
30
- constructor(_options = {}) {
31
- this._options = _options;
28
+ import * as Phonic from "../../../index.mjs";
29
+ export class ToolsClient {
30
+ constructor(options = {}) {
31
+ this._options = normalizeClientOptionsWithAuth(options);
32
32
  }
33
33
  /**
34
34
  * Returns all custom tools for the organization.
35
35
  *
36
36
  * @param {Phonic.ToolsListRequest} request
37
- * @param {Tools.RequestOptions} requestOptions - Request-specific configuration.
37
+ * @param {ToolsClient.RequestOptions} requestOptions - Request-specific configuration.
38
38
  *
39
39
  * @throws {@link Phonic.NotFoundError}
40
40
  *
@@ -48,22 +48,24 @@ export class Tools {
48
48
  }
49
49
  __list() {
50
50
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
51
- var _a, _b, _c, _d;
51
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
52
52
  const { project } = request;
53
- const _queryParams = {};
54
- if (project != null) {
55
- _queryParams["project"] = project;
56
- }
57
- let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
53
+ const _queryParams = {
54
+ project,
55
+ };
56
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
57
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
58
58
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
59
59
  url: core.url.join((_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : ((_d = (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.PhonicEnvironment.Default)
60
60
  .base, "tools"),
61
61
  method: "GET",
62
62
  headers: _headers,
63
63
  queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
64
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
65
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
64
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
65
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
66
66
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
67
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
68
+ logging: this._options.logging,
67
69
  });
68
70
  if (_response.ok) {
69
71
  return { data: _response.body, rawResponse: _response.rawResponse };
@@ -80,28 +82,14 @@ export class Tools {
80
82
  });
81
83
  }
82
84
  }
83
- switch (_response.error.reason) {
84
- case "non-json":
85
- throw new errors.PhonicError({
86
- statusCode: _response.error.statusCode,
87
- body: _response.error.rawBody,
88
- rawResponse: _response.rawResponse,
89
- });
90
- case "timeout":
91
- throw new errors.PhonicTimeoutError("Timeout exceeded when calling GET /tools.");
92
- case "unknown":
93
- throw new errors.PhonicError({
94
- message: _response.error.errorMessage,
95
- rawResponse: _response.rawResponse,
96
- });
97
- }
85
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/tools");
98
86
  });
99
87
  }
100
88
  /**
101
89
  * Creates a new tool in a project.
102
90
  *
103
91
  * @param {Phonic.CreateToolRequest} request
104
- * @param {Tools.RequestOptions} requestOptions - Request-specific configuration.
92
+ * @param {ToolsClient.RequestOptions} requestOptions - Request-specific configuration.
105
93
  *
106
94
  * @throws {@link Phonic.BadRequestError}
107
95
  * @throws {@link Phonic.ForbiddenError}
@@ -209,13 +197,13 @@ export class Tools {
209
197
  }
210
198
  __create(request, requestOptions) {
211
199
  return __awaiter(this, void 0, void 0, function* () {
212
- var _a, _b, _c, _d;
200
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
213
201
  const { project } = request, _body = __rest(request, ["project"]);
214
- const _queryParams = {};
215
- if (project != null) {
216
- _queryParams["project"] = project;
217
- }
218
- let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
202
+ const _queryParams = {
203
+ project,
204
+ };
205
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
206
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
219
207
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
220
208
  url: core.url.join((_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : ((_d = (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.PhonicEnvironment.Default)
221
209
  .base, "tools"),
@@ -225,9 +213,11 @@ export class Tools {
225
213
  queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
226
214
  requestType: "json",
227
215
  body: _body,
228
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
229
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
216
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
217
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
230
218
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
219
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
220
+ logging: this._options.logging,
231
221
  });
232
222
  if (_response.ok) {
233
223
  return { data: _response.body, rawResponse: _response.rawResponse };
@@ -248,21 +238,7 @@ export class Tools {
248
238
  });
249
239
  }
250
240
  }
251
- switch (_response.error.reason) {
252
- case "non-json":
253
- throw new errors.PhonicError({
254
- statusCode: _response.error.statusCode,
255
- body: _response.error.rawBody,
256
- rawResponse: _response.rawResponse,
257
- });
258
- case "timeout":
259
- throw new errors.PhonicTimeoutError("Timeout exceeded when calling POST /tools.");
260
- case "unknown":
261
- throw new errors.PhonicError({
262
- message: _response.error.errorMessage,
263
- rawResponse: _response.rawResponse,
264
- });
265
- }
241
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/tools");
266
242
  });
267
243
  }
268
244
  /**
@@ -270,7 +246,7 @@ export class Tools {
270
246
  *
271
247
  * @param {string} nameOrId - The name or the ID of the tool to get.
272
248
  * @param {Phonic.ToolsGetRequest} request
273
- * @param {Tools.RequestOptions} requestOptions - Request-specific configuration.
249
+ * @param {ToolsClient.RequestOptions} requestOptions - Request-specific configuration.
274
250
  *
275
251
  * @throws {@link Phonic.ForbiddenError}
276
252
  * @throws {@link Phonic.NotFoundError}
@@ -285,22 +261,24 @@ export class Tools {
285
261
  }
286
262
  __get(nameOrId_1) {
287
263
  return __awaiter(this, arguments, void 0, function* (nameOrId, request = {}, requestOptions) {
288
- var _a, _b, _c, _d;
264
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
289
265
  const { project } = request;
290
- const _queryParams = {};
291
- if (project != null) {
292
- _queryParams["project"] = project;
293
- }
294
- let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
266
+ const _queryParams = {
267
+ project,
268
+ };
269
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
270
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
295
271
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
296
272
  url: core.url.join((_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : ((_d = (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.PhonicEnvironment.Default)
297
- .base, `tools/${encodeURIComponent(nameOrId)}`),
273
+ .base, `tools/${core.url.encodePathParam(nameOrId)}`),
298
274
  method: "GET",
299
275
  headers: _headers,
300
276
  queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
301
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
302
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
277
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
278
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
303
279
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
280
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
281
+ logging: this._options.logging,
304
282
  });
305
283
  if (_response.ok) {
306
284
  return { data: _response.body, rawResponse: _response.rawResponse };
@@ -319,21 +297,7 @@ export class Tools {
319
297
  });
320
298
  }
321
299
  }
322
- switch (_response.error.reason) {
323
- case "non-json":
324
- throw new errors.PhonicError({
325
- statusCode: _response.error.statusCode,
326
- body: _response.error.rawBody,
327
- rawResponse: _response.rawResponse,
328
- });
329
- case "timeout":
330
- throw new errors.PhonicTimeoutError("Timeout exceeded when calling GET /tools/{nameOrId}.");
331
- case "unknown":
332
- throw new errors.PhonicError({
333
- message: _response.error.errorMessage,
334
- rawResponse: _response.rawResponse,
335
- });
336
- }
300
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/tools/{nameOrId}");
337
301
  });
338
302
  }
339
303
  /**
@@ -341,7 +305,7 @@ export class Tools {
341
305
  *
342
306
  * @param {string} nameOrId - The name or the ID of the tool to delete.
343
307
  * @param {Phonic.ToolsDeleteRequest} request
344
- * @param {Tools.RequestOptions} requestOptions - Request-specific configuration.
308
+ * @param {ToolsClient.RequestOptions} requestOptions - Request-specific configuration.
345
309
  *
346
310
  * @throws {@link Phonic.NotFoundError}
347
311
  *
@@ -355,22 +319,24 @@ export class Tools {
355
319
  }
356
320
  __delete(nameOrId_1) {
357
321
  return __awaiter(this, arguments, void 0, function* (nameOrId, request = {}, requestOptions) {
358
- var _a, _b, _c, _d;
322
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
359
323
  const { project } = request;
360
- const _queryParams = {};
361
- if (project != null) {
362
- _queryParams["project"] = project;
363
- }
364
- let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
324
+ const _queryParams = {
325
+ project,
326
+ };
327
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
328
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
365
329
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
366
330
  url: core.url.join((_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : ((_d = (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.PhonicEnvironment.Default)
367
- .base, `tools/${encodeURIComponent(nameOrId)}`),
331
+ .base, `tools/${core.url.encodePathParam(nameOrId)}`),
368
332
  method: "DELETE",
369
333
  headers: _headers,
370
334
  queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
371
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
372
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
335
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
336
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
373
337
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
338
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
339
+ logging: this._options.logging,
374
340
  });
375
341
  if (_response.ok) {
376
342
  return { data: _response.body, rawResponse: _response.rawResponse };
@@ -387,21 +353,7 @@ export class Tools {
387
353
  });
388
354
  }
389
355
  }
390
- switch (_response.error.reason) {
391
- case "non-json":
392
- throw new errors.PhonicError({
393
- statusCode: _response.error.statusCode,
394
- body: _response.error.rawBody,
395
- rawResponse: _response.rawResponse,
396
- });
397
- case "timeout":
398
- throw new errors.PhonicTimeoutError("Timeout exceeded when calling DELETE /tools/{nameOrId}.");
399
- case "unknown":
400
- throw new errors.PhonicError({
401
- message: _response.error.errorMessage,
402
- rawResponse: _response.rawResponse,
403
- });
404
- }
356
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/tools/{nameOrId}");
405
357
  });
406
358
  }
407
359
  /**
@@ -409,7 +361,7 @@ export class Tools {
409
361
  *
410
362
  * @param {string} nameOrId - The name or the ID of the tool to update.
411
363
  * @param {Phonic.UpdateToolRequest} request
412
- * @param {Tools.RequestOptions} requestOptions - Request-specific configuration.
364
+ * @param {ToolsClient.RequestOptions} requestOptions - Request-specific configuration.
413
365
  *
414
366
  * @throws {@link Phonic.BadRequestError}
415
367
  * @throws {@link Phonic.NotFoundError}
@@ -430,25 +382,27 @@ export class Tools {
430
382
  }
431
383
  __update(nameOrId_1) {
432
384
  return __awaiter(this, arguments, void 0, function* (nameOrId, request = {}, requestOptions) {
433
- var _a, _b, _c, _d;
385
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
434
386
  const { project } = request, _body = __rest(request, ["project"]);
435
- const _queryParams = {};
436
- if (project != null) {
437
- _queryParams["project"] = project;
438
- }
439
- let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
387
+ const _queryParams = {
388
+ project,
389
+ };
390
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
391
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
440
392
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
441
393
  url: core.url.join((_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : ((_d = (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.PhonicEnvironment.Default)
442
- .base, `tools/${encodeURIComponent(nameOrId)}`),
394
+ .base, `tools/${core.url.encodePathParam(nameOrId)}`),
443
395
  method: "PATCH",
444
396
  headers: _headers,
445
397
  contentType: "application/json",
446
398
  queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
447
399
  requestType: "json",
448
400
  body: _body,
449
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
450
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
401
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
402
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
451
403
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
404
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
405
+ logging: this._options.logging,
452
406
  });
453
407
  if (_response.ok) {
454
408
  return { data: _response.body, rawResponse: _response.rawResponse };
@@ -469,33 +423,7 @@ export class Tools {
469
423
  });
470
424
  }
471
425
  }
472
- switch (_response.error.reason) {
473
- case "non-json":
474
- throw new errors.PhonicError({
475
- statusCode: _response.error.statusCode,
476
- body: _response.error.rawBody,
477
- rawResponse: _response.rawResponse,
478
- });
479
- case "timeout":
480
- throw new errors.PhonicTimeoutError("Timeout exceeded when calling PATCH /tools/{nameOrId}.");
481
- case "unknown":
482
- throw new errors.PhonicError({
483
- message: _response.error.errorMessage,
484
- rawResponse: _response.rawResponse,
485
- });
486
- }
487
- });
488
- }
489
- _getAuthorizationHeader() {
490
- return __awaiter(this, void 0, void 0, function* () {
491
- var _a;
492
- const bearer = (_a = (yield core.Supplier.get(this._options.apiKey))) !== null && _a !== void 0 ? _a : process === null || process === void 0 ? void 0 : process.env["PHONIC_API_KEY"];
493
- if (bearer == null) {
494
- throw new errors.PhonicError({
495
- message: "Please specify a bearer by either passing it in to the constructor or initializing a PHONIC_API_KEY environment variable",
496
- });
497
- }
498
- return `Bearer ${bearer}`;
426
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "PATCH", "/tools/{nameOrId}");
499
427
  });
500
428
  }
501
429
  }
@@ -1,2 +1 @@
1
- export {};
2
1
  export * from "./requests/index.mjs";
@@ -1,7 +1,4 @@
1
- /**
2
- * This file was auto-generated by Fern from our API Definition.
3
- */
4
- import * as Phonic from "../../../../index.mjs";
1
+ import type * as Phonic from "../../../../index.mjs";
5
2
  /**
6
3
  * @example
7
4
  * {
@@ -150,10 +147,7 @@ export interface CreateToolRequest {
150
147
  wait_for_response?: boolean;
151
148
  }
152
149
  export declare namespace CreateToolRequest {
153
- /**
154
- * The type of tool.
155
- */
156
- type Type = "custom_context" | "custom_webhook" | "custom_websocket" | "built_in_transfer_to_phone_number" | "built_in_transfer_to_agent";
150
+ /** The type of tool. */
157
151
  const Type: {
158
152
  readonly CustomContext: "custom_context";
159
153
  readonly CustomWebhook: "custom_webhook";
@@ -161,20 +155,17 @@ export declare namespace CreateToolRequest {
161
155
  readonly BuiltInTransferToPhoneNumber: "built_in_transfer_to_phone_number";
162
156
  readonly BuiltInTransferToAgent: "built_in_transfer_to_agent";
163
157
  };
164
- /**
165
- * Mode of operation.
166
- */
167
- type ExecutionMode = "sync" | "async";
158
+ type Type = (typeof Type)[keyof typeof Type];
159
+ /** Mode of operation. */
168
160
  const ExecutionMode: {
169
161
  readonly Sync: "sync";
170
162
  readonly Async: "async";
171
163
  };
172
- /**
173
- * Required for webhook tools. HTTP method for the webhook endpoint.
174
- */
175
- type EndpointMethod = "GET" | "POST";
164
+ type ExecutionMode = (typeof ExecutionMode)[keyof typeof ExecutionMode];
165
+ /** Required for webhook tools. HTTP method for the webhook endpoint. */
176
166
  const EndpointMethod: {
177
167
  readonly Get: "GET";
178
168
  readonly Post: "POST";
179
169
  };
170
+ type EndpointMethod = (typeof EndpointMethod)[keyof typeof EndpointMethod];
180
171
  }
@@ -1,8 +1,7 @@
1
- /**
2
- * This file was auto-generated by Fern from our API Definition.
3
- */
1
+ // This file was auto-generated by Fern from our API Definition.
4
2
  export var CreateToolRequest;
5
3
  (function (CreateToolRequest) {
4
+ /** The type of tool. */
6
5
  CreateToolRequest.Type = {
7
6
  CustomContext: "custom_context",
8
7
  CustomWebhook: "custom_webhook",
@@ -10,10 +9,12 @@ export var CreateToolRequest;
10
9
  BuiltInTransferToPhoneNumber: "built_in_transfer_to_phone_number",
11
10
  BuiltInTransferToAgent: "built_in_transfer_to_agent",
12
11
  };
12
+ /** Mode of operation. */
13
13
  CreateToolRequest.ExecutionMode = {
14
14
  Sync: "sync",
15
15
  Async: "async",
16
16
  };
17
+ /** Required for webhook tools. HTTP method for the webhook endpoint. */
17
18
  CreateToolRequest.EndpointMethod = {
18
19
  Get: "GET",
19
20
  Post: "POST",
@@ -1,6 +1,3 @@
1
- /**
2
- * This file was auto-generated by Fern from our API Definition.
3
- */
4
1
  /**
5
2
  * @example
6
3
  * {
@@ -1,4 +1,2 @@
1
- /**
2
- * This file was auto-generated by Fern from our API Definition.
3
- */
1
+ // This file was auto-generated by Fern from our API Definition.
4
2
  export {};
@@ -1,27 +1,4 @@
1
1
  /**
2
- * This file was auto-generated by Fern from our API Definition.
3
- */
4
- /**
5
- * @example
6
- * {
7
- * project: "main"
8
- * }
9
- *
10
- * @example
11
- * {
12
- * project: "main"
13
- * }
14
- *
15
- * @example
16
- * {
17
- * project: "main"
18
- * }
19
- *
20
- * @example
21
- * {
22
- * project: "main"
23
- * }
24
- *
25
2
  * @example
26
3
  * {
27
4
  * project: "main"
@@ -1,4 +1,2 @@
1
- /**
2
- * This file was auto-generated by Fern from our API Definition.
3
- */
1
+ // This file was auto-generated by Fern from our API Definition.
4
2
  export {};
@@ -1,6 +1,3 @@
1
- /**
2
- * This file was auto-generated by Fern from our API Definition.
3
- */
4
1
  /**
5
2
  * @example
6
3
  * {
@@ -1,4 +1,2 @@
1
- /**
2
- * This file was auto-generated by Fern from our API Definition.
3
- */
1
+ // This file was auto-generated by Fern from our API Definition.
4
2
  export {};
@@ -1,7 +1,4 @@
1
- /**
2
- * This file was auto-generated by Fern from our API Definition.
3
- */
4
- import * as Phonic from "../../../../index.mjs";
1
+ import type * as Phonic from "../../../../index.mjs";
5
2
  /**
6
3
  * @example
7
4
  * {
@@ -59,10 +56,7 @@ export interface UpdateToolRequest {
59
56
  wait_for_response?: boolean;
60
57
  }
61
58
  export declare namespace UpdateToolRequest {
62
- /**
63
- * The type of tool.
64
- */
65
- type Type = "custom_context" | "custom_webhook" | "custom_websocket" | "built_in_transfer_to_phone_number" | "built_in_transfer_to_agent";
59
+ /** The type of tool. */
66
60
  const Type: {
67
61
  readonly CustomContext: "custom_context";
68
62
  readonly CustomWebhook: "custom_webhook";
@@ -70,20 +64,17 @@ export declare namespace UpdateToolRequest {
70
64
  readonly BuiltInTransferToPhoneNumber: "built_in_transfer_to_phone_number";
71
65
  readonly BuiltInTransferToAgent: "built_in_transfer_to_agent";
72
66
  };
73
- /**
74
- * Mode of operation.
75
- */
76
- type ExecutionMode = "sync" | "async";
67
+ type Type = (typeof Type)[keyof typeof Type];
68
+ /** Mode of operation. */
77
69
  const ExecutionMode: {
78
70
  readonly Sync: "sync";
79
71
  readonly Async: "async";
80
72
  };
81
- /**
82
- * HTTP method for webhook tools. When changing this value, all parameters must include explicit `location` values.
83
- */
84
- type EndpointMethod = "GET" | "POST";
73
+ type ExecutionMode = (typeof ExecutionMode)[keyof typeof ExecutionMode];
74
+ /** HTTP method for webhook tools. When changing this value, all parameters must include explicit `location` values. */
85
75
  const EndpointMethod: {
86
76
  readonly Get: "GET";
87
77
  readonly Post: "POST";
88
78
  };
79
+ type EndpointMethod = (typeof EndpointMethod)[keyof typeof EndpointMethod];
89
80
  }
@@ -1,8 +1,7 @@
1
- /**
2
- * This file was auto-generated by Fern from our API Definition.
3
- */
1
+ // This file was auto-generated by Fern from our API Definition.
4
2
  export var UpdateToolRequest;
5
3
  (function (UpdateToolRequest) {
4
+ /** The type of tool. */
6
5
  UpdateToolRequest.Type = {
7
6
  CustomContext: "custom_context",
8
7
  CustomWebhook: "custom_webhook",
@@ -10,10 +9,12 @@ export var UpdateToolRequest;
10
9
  BuiltInTransferToPhoneNumber: "built_in_transfer_to_phone_number",
11
10
  BuiltInTransferToAgent: "built_in_transfer_to_agent",
12
11
  };
12
+ /** Mode of operation. */
13
13
  UpdateToolRequest.ExecutionMode = {
14
14
  Sync: "sync",
15
15
  Async: "async",
16
16
  };
17
+ /** HTTP method for webhook tools. When changing this value, all parameters must include explicit `location` values. */
17
18
  UpdateToolRequest.EndpointMethod = {
18
19
  Get: "GET",
19
20
  Post: "POST",
@@ -1,5 +1,5 @@
1
- export { type ToolsListRequest } from "./ToolsListRequest.mjs";
2
- export { type CreateToolRequest } from "./CreateToolRequest.mjs";
3
- export { type ToolsGetRequest } from "./ToolsGetRequest.mjs";
4
- export { type ToolsDeleteRequest } from "./ToolsDeleteRequest.mjs";
5
- export { type UpdateToolRequest } from "./UpdateToolRequest.mjs";
1
+ export { CreateToolRequest } from "./CreateToolRequest.mjs";
2
+ export type { ToolsDeleteRequest } from "./ToolsDeleteRequest.mjs";
3
+ export type { ToolsGetRequest } from "./ToolsGetRequest.mjs";
4
+ export type { ToolsListRequest } from "./ToolsListRequest.mjs";
5
+ export { UpdateToolRequest } from "./UpdateToolRequest.mjs";
@@ -1 +1,2 @@
1
- export {};
1
+ export { CreateToolRequest } from "./CreateToolRequest.mjs";
2
+ export { UpdateToolRequest } from "./UpdateToolRequest.mjs";
@@ -0,0 +1,2 @@
1
+ export { ToolsClient } from "./client/Client.mjs";
2
+ export * from "./client/index.mjs";
@@ -0,0 +1,3 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export { ToolsClient } from "./client/Client.mjs";
3
+ export * from "./client/index.mjs";
@@ -1,2 +1,2 @@
1
- export * from "./types/index.mjs";
2
1
  export * from "./client/index.mjs";
2
+ export * from "./types/index.mjs";
@@ -1,2 +1,2 @@
1
- export * from "./types/index.mjs";
2
1
  export * from "./client/index.mjs";
2
+ export * from "./types/index.mjs";
@@ -1,6 +1,3 @@
1
- /**
2
- * This file was auto-generated by Fern from our API Definition.
3
- */
4
1
  export interface ToolsCreateResponse {
5
2
  /** The ID of the created tool. */
6
3
  id: string;
@@ -1,4 +1,2 @@
1
- /**
2
- * This file was auto-generated by Fern from our API Definition.
3
- */
1
+ // This file was auto-generated by Fern from our API Definition.
4
2
  export {};