phonic 0.31.2 → 0.31.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +102 -15
- package/dist/cjs/BaseClient.d.ts +40 -0
- package/dist/cjs/BaseClient.js +62 -0
- package/dist/cjs/Client.d.ts +27 -48
- package/dist/cjs/Client.js +17 -60
- package/dist/cjs/api/errors/BadRequestError.d.ts +1 -4
- package/dist/cjs/api/errors/BadRequestError.js +6 -4
- package/dist/cjs/api/errors/ConflictError.d.ts +1 -4
- package/dist/cjs/api/errors/ConflictError.js +6 -4
- package/dist/cjs/api/errors/ForbiddenError.d.ts +1 -4
- package/dist/cjs/api/errors/ForbiddenError.js +6 -4
- package/dist/cjs/api/errors/GatewayTimeoutError.d.ts +2 -5
- package/dist/cjs/api/errors/GatewayTimeoutError.js +6 -4
- package/dist/cjs/api/errors/InternalServerError.d.ts +2 -5
- package/dist/cjs/api/errors/InternalServerError.js +6 -4
- package/dist/cjs/api/errors/NotFoundError.d.ts +1 -4
- package/dist/cjs/api/errors/NotFoundError.js +6 -4
- package/dist/cjs/api/errors/UnauthorizedError.d.ts +2 -5
- package/dist/cjs/api/errors/UnauthorizedError.js +6 -4
- package/dist/cjs/api/errors/index.d.ts +4 -4
- package/dist/cjs/api/errors/index.js +4 -4
- package/dist/cjs/api/resources/agents/client/Client.d.ts +26 -47
- package/dist/cjs/api/resources/agents/client/Client.js +128 -249
- package/dist/cjs/api/resources/agents/client/index.d.ts +0 -1
- package/dist/cjs/api/resources/agents/client/requests/AgentsAddCustomPhoneNumberRequest.d.ts +2 -5
- package/dist/cjs/api/resources/agents/client/requests/AgentsAddCustomPhoneNumberRequest.js +1 -3
- package/dist/cjs/api/resources/agents/client/requests/AgentsCreateRequest.d.ts +1 -4
- package/dist/cjs/api/resources/agents/client/requests/AgentsCreateRequest.js +1 -3
- package/dist/cjs/api/resources/agents/client/requests/AgentsDeleteCustomPhoneNumberRequest.d.ts +0 -3
- package/dist/cjs/api/resources/agents/client/requests/AgentsDeleteCustomPhoneNumberRequest.js +1 -3
- package/dist/cjs/api/resources/agents/client/requests/AgentsDeleteRequest.d.ts +0 -3
- package/dist/cjs/api/resources/agents/client/requests/AgentsDeleteRequest.js +1 -3
- package/dist/cjs/api/resources/agents/client/requests/AgentsGetRequest.d.ts +0 -3
- package/dist/cjs/api/resources/agents/client/requests/AgentsGetRequest.js +1 -3
- package/dist/cjs/api/resources/agents/client/requests/AgentsListRequest.d.ts +0 -3
- package/dist/cjs/api/resources/agents/client/requests/AgentsListRequest.js +1 -3
- package/dist/cjs/api/resources/agents/client/requests/AgentsUpdatePhoneNumberRequest.d.ts +2 -5
- package/dist/cjs/api/resources/agents/client/requests/AgentsUpdatePhoneNumberRequest.js +1 -3
- package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.d.ts +9 -16
- package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.js +3 -3
- package/dist/cjs/api/resources/agents/client/requests/UpsertAgentRequest.d.ts +1 -4
- package/dist/cjs/api/resources/agents/client/requests/UpsertAgentRequest.js +1 -3
- package/dist/cjs/api/resources/agents/client/requests/index.d.ts +9 -9
- package/dist/cjs/api/resources/agents/client/requests/index.js +3 -0
- package/dist/cjs/api/resources/agents/exports.d.ts +2 -0
- package/dist/cjs/api/resources/agents/exports.js +21 -0
- package/dist/cjs/api/resources/agents/index.d.ts +1 -1
- package/dist/cjs/api/resources/agents/index.js +1 -1
- package/dist/cjs/api/resources/agents/types/AgentsAddCustomPhoneNumberResponse.d.ts +0 -3
- package/dist/cjs/api/resources/agents/types/AgentsAddCustomPhoneNumberResponse.js +1 -3
- package/dist/cjs/api/resources/agents/types/AgentsCreateResponse.d.ts +0 -3
- package/dist/cjs/api/resources/agents/types/AgentsCreateResponse.js +1 -3
- package/dist/cjs/api/resources/agents/types/AgentsDeleteCustomPhoneNumberResponse.d.ts +0 -3
- package/dist/cjs/api/resources/agents/types/AgentsDeleteCustomPhoneNumberResponse.js +1 -3
- package/dist/cjs/api/resources/agents/types/AgentsDeleteResponse.d.ts +0 -3
- package/dist/cjs/api/resources/agents/types/AgentsDeleteResponse.js +1 -3
- package/dist/cjs/api/resources/agents/types/AgentsGetResponse.d.ts +1 -4
- package/dist/cjs/api/resources/agents/types/AgentsGetResponse.js +1 -3
- package/dist/cjs/api/resources/agents/types/AgentsListResponse.d.ts +1 -4
- package/dist/cjs/api/resources/agents/types/AgentsListResponse.js +1 -3
- package/dist/cjs/api/resources/agents/types/AgentsUpdatePhoneNumberResponse.d.ts +0 -3
- package/dist/cjs/api/resources/agents/types/AgentsUpdatePhoneNumberResponse.js +1 -3
- package/dist/cjs/api/resources/agents/types/AgentsUpdateResponse.d.ts +0 -3
- package/dist/cjs/api/resources/agents/types/AgentsUpdateResponse.js +1 -3
- package/dist/cjs/api/resources/agents/types/AgentsUpsertResponse.d.ts +1 -4
- package/dist/cjs/api/resources/agents/types/AgentsUpsertResponse.js +1 -3
- package/dist/cjs/api/resources/agents/types/index.d.ts +6 -6
- package/dist/cjs/api/resources/agents/types/index.js +6 -6
- package/dist/cjs/api/resources/auth/client/Client.d.ts +10 -31
- package/dist/cjs/api/resources/auth/client/Client.js +20 -43
- package/dist/cjs/api/resources/auth/client/index.d.ts +0 -1
- package/dist/cjs/api/resources/auth/client/requests/CreateSessionTokenRequest.d.ts +0 -3
- package/dist/cjs/api/resources/auth/client/requests/CreateSessionTokenRequest.js +1 -3
- package/dist/cjs/api/resources/auth/client/requests/index.d.ts +1 -1
- package/dist/cjs/api/resources/auth/exports.d.ts +2 -0
- package/dist/cjs/api/resources/auth/exports.js +21 -0
- package/dist/cjs/api/resources/auth/index.d.ts +1 -1
- package/dist/cjs/api/resources/auth/index.js +1 -1
- package/dist/cjs/api/resources/auth/types/AuthCreateSessionTokenResponse.d.ts +0 -3
- package/dist/cjs/api/resources/auth/types/AuthCreateSessionTokenResponse.js +1 -3
- package/dist/cjs/api/resources/conversations/client/Client.d.ts +36 -51
- package/dist/cjs/api/resources/conversations/client/Client.js +134 -270
- package/dist/cjs/api/resources/conversations/client/Socket.d.ts +2 -12
- package/dist/cjs/api/resources/conversations/client/Socket.js +15 -40
- package/dist/cjs/api/resources/conversations/client/index.d.ts +0 -1
- package/dist/cjs/api/resources/conversations/client/requests/ConversationsListRequest.d.ts +0 -6
- package/dist/cjs/api/resources/conversations/client/requests/ConversationsListRequest.js +1 -3
- package/dist/cjs/api/resources/conversations/client/requests/ConversationsSipOutboundCallRequest.d.ts +1 -4
- package/dist/cjs/api/resources/conversations/client/requests/ConversationsSipOutboundCallRequest.js +1 -3
- package/dist/cjs/api/resources/conversations/client/requests/EvaluateConversationRequest.d.ts +0 -3
- package/dist/cjs/api/resources/conversations/client/requests/EvaluateConversationRequest.js +1 -3
- package/dist/cjs/api/resources/conversations/client/requests/ExtractDataRequest.d.ts +0 -3
- package/dist/cjs/api/resources/conversations/client/requests/ExtractDataRequest.js +1 -3
- package/dist/cjs/api/resources/conversations/client/requests/OutboundCallRequest.d.ts +1 -4
- package/dist/cjs/api/resources/conversations/client/requests/OutboundCallRequest.js +1 -3
- package/dist/cjs/api/resources/conversations/client/requests/index.d.ts +5 -5
- package/dist/cjs/api/resources/conversations/exports.d.ts +2 -0
- package/dist/cjs/api/resources/conversations/exports.js +21 -0
- package/dist/cjs/api/resources/conversations/index.d.ts +1 -1
- package/dist/cjs/api/resources/conversations/index.js +1 -1
- package/dist/cjs/api/resources/conversations/types/ConversationsCancelResponse.d.ts +0 -3
- package/dist/cjs/api/resources/conversations/types/ConversationsCancelResponse.js +1 -3
- package/dist/cjs/api/resources/conversations/types/ConversationsExtractDataResponse.d.ts +0 -3
- package/dist/cjs/api/resources/conversations/types/ConversationsExtractDataResponse.js +1 -3
- package/dist/cjs/api/resources/conversations/types/ConversationsGetAnalysisResponse.d.ts +1 -4
- package/dist/cjs/api/resources/conversations/types/ConversationsGetAnalysisResponse.js +1 -3
- package/dist/cjs/api/resources/conversations/types/ConversationsGetResponse.d.ts +1 -4
- package/dist/cjs/api/resources/conversations/types/ConversationsGetResponse.js +1 -3
- package/dist/cjs/api/resources/conversations/types/ConversationsListEvaluationsResponse.d.ts +1 -4
- package/dist/cjs/api/resources/conversations/types/ConversationsListEvaluationsResponse.js +1 -3
- package/dist/cjs/api/resources/conversations/types/ConversationsListExtractionsResponse.d.ts +1 -4
- package/dist/cjs/api/resources/conversations/types/ConversationsListExtractionsResponse.js +1 -3
- package/dist/cjs/api/resources/conversations/types/ConversationsListResponse.d.ts +1 -4
- package/dist/cjs/api/resources/conversations/types/ConversationsListResponse.js +1 -3
- package/dist/cjs/api/resources/conversations/types/ConversationsOutboundCallResponse.d.ts +0 -3
- package/dist/cjs/api/resources/conversations/types/ConversationsOutboundCallResponse.js +1 -3
- package/dist/cjs/api/resources/conversations/types/ConversationsSipOutboundCallResponse.d.ts +0 -3
- package/dist/cjs/api/resources/conversations/types/ConversationsSipOutboundCallResponse.js +1 -3
- package/dist/cjs/api/resources/conversations/types/index.d.ts +4 -4
- package/dist/cjs/api/resources/conversations/types/index.js +4 -4
- package/dist/cjs/api/resources/extractionSchemas/client/Client.d.ts +18 -39
- package/dist/cjs/api/resources/extractionSchemas/client/Client.js +74 -146
- package/dist/cjs/api/resources/extractionSchemas/client/index.d.ts +0 -1
- package/dist/cjs/api/resources/extractionSchemas/client/requests/CreateExtractionSchemaRequest.d.ts +1 -4
- package/dist/cjs/api/resources/extractionSchemas/client/requests/CreateExtractionSchemaRequest.js +1 -3
- package/dist/cjs/api/resources/extractionSchemas/client/requests/ExtractionSchemasDeleteRequest.d.ts +0 -3
- package/dist/cjs/api/resources/extractionSchemas/client/requests/ExtractionSchemasDeleteRequest.js +1 -3
- package/dist/cjs/api/resources/extractionSchemas/client/requests/ExtractionSchemasGetRequest.d.ts +0 -3
- package/dist/cjs/api/resources/extractionSchemas/client/requests/ExtractionSchemasGetRequest.js +1 -3
- package/dist/cjs/api/resources/extractionSchemas/client/requests/ExtractionSchemasListRequest.d.ts +0 -3
- package/dist/cjs/api/resources/extractionSchemas/client/requests/ExtractionSchemasListRequest.js +1 -3
- package/dist/cjs/api/resources/extractionSchemas/client/requests/UpdateExtractionSchemaRequest.d.ts +1 -4
- package/dist/cjs/api/resources/extractionSchemas/client/requests/UpdateExtractionSchemaRequest.js +1 -3
- package/dist/cjs/api/resources/extractionSchemas/client/requests/index.d.ts +5 -5
- package/dist/cjs/api/resources/extractionSchemas/exports.d.ts +2 -0
- package/dist/cjs/api/resources/extractionSchemas/exports.js +21 -0
- package/dist/cjs/api/resources/extractionSchemas/index.d.ts +1 -1
- package/dist/cjs/api/resources/extractionSchemas/index.js +1 -1
- package/dist/cjs/api/resources/extractionSchemas/types/ExtractionSchemasCreateResponse.d.ts +0 -3
- package/dist/cjs/api/resources/extractionSchemas/types/ExtractionSchemasCreateResponse.js +1 -3
- package/dist/cjs/api/resources/extractionSchemas/types/ExtractionSchemasDeleteResponse.d.ts +0 -3
- package/dist/cjs/api/resources/extractionSchemas/types/ExtractionSchemasDeleteResponse.js +1 -3
- package/dist/cjs/api/resources/extractionSchemas/types/ExtractionSchemasGetResponse.d.ts +1 -4
- package/dist/cjs/api/resources/extractionSchemas/types/ExtractionSchemasGetResponse.js +1 -3
- package/dist/cjs/api/resources/extractionSchemas/types/ExtractionSchemasListResponse.d.ts +1 -4
- package/dist/cjs/api/resources/extractionSchemas/types/ExtractionSchemasListResponse.js +1 -3
- package/dist/cjs/api/resources/extractionSchemas/types/ExtractionSchemasUpdateResponse.d.ts +0 -3
- package/dist/cjs/api/resources/extractionSchemas/types/ExtractionSchemasUpdateResponse.js +1 -3
- package/dist/cjs/api/resources/extractionSchemas/types/index.d.ts +2 -2
- package/dist/cjs/api/resources/extractionSchemas/types/index.js +2 -2
- package/dist/cjs/api/resources/index.d.ts +13 -13
- package/dist/cjs/api/resources/index.js +17 -17
- package/dist/cjs/api/resources/projects/client/Client.d.ts +22 -43
- package/dist/cjs/api/resources/projects/client/Client.js +79 -168
- package/dist/cjs/api/resources/projects/client/index.d.ts +0 -1
- package/dist/cjs/api/resources/projects/client/requests/CreateConversationEvalPromptRequest.d.ts +0 -3
- package/dist/cjs/api/resources/projects/client/requests/CreateConversationEvalPromptRequest.js +1 -3
- package/dist/cjs/api/resources/projects/client/requests/CreateProjectRequest.d.ts +0 -3
- package/dist/cjs/api/resources/projects/client/requests/CreateProjectRequest.js +1 -3
- package/dist/cjs/api/resources/projects/client/requests/UpdateProjectRequest.d.ts +0 -3
- package/dist/cjs/api/resources/projects/client/requests/UpdateProjectRequest.js +1 -3
- package/dist/cjs/api/resources/projects/client/requests/index.d.ts +3 -3
- package/dist/cjs/api/resources/projects/exports.d.ts +2 -0
- package/dist/cjs/api/resources/projects/exports.js +21 -0
- package/dist/cjs/api/resources/projects/index.d.ts +1 -1
- package/dist/cjs/api/resources/projects/index.js +1 -1
- package/dist/cjs/api/resources/projects/types/ProjectsCreateEvalPromptResponse.d.ts +0 -3
- package/dist/cjs/api/resources/projects/types/ProjectsCreateEvalPromptResponse.js +1 -3
- package/dist/cjs/api/resources/projects/types/ProjectsCreateResponse.d.ts +0 -3
- package/dist/cjs/api/resources/projects/types/ProjectsCreateResponse.js +1 -3
- package/dist/cjs/api/resources/projects/types/ProjectsDeleteResponse.d.ts +0 -3
- package/dist/cjs/api/resources/projects/types/ProjectsDeleteResponse.js +1 -3
- package/dist/cjs/api/resources/projects/types/ProjectsGetResponse.d.ts +1 -4
- package/dist/cjs/api/resources/projects/types/ProjectsGetResponse.js +1 -3
- package/dist/cjs/api/resources/projects/types/ProjectsListEvalPromptsResponse.d.ts +1 -4
- package/dist/cjs/api/resources/projects/types/ProjectsListEvalPromptsResponse.js +1 -3
- package/dist/cjs/api/resources/projects/types/ProjectsListResponse.d.ts +1 -4
- package/dist/cjs/api/resources/projects/types/ProjectsListResponse.js +1 -3
- package/dist/cjs/api/resources/projects/types/ProjectsUpdateResponse.d.ts +0 -3
- package/dist/cjs/api/resources/projects/types/ProjectsUpdateResponse.js +1 -3
- package/dist/cjs/api/resources/projects/types/index.d.ts +4 -4
- package/dist/cjs/api/resources/projects/types/index.js +4 -4
- package/dist/cjs/api/resources/tools/client/Client.d.ts +18 -39
- package/dist/cjs/api/resources/tools/client/Client.js +74 -146
- package/dist/cjs/api/resources/tools/client/index.d.ts +0 -1
- package/dist/cjs/api/resources/tools/client/requests/CreateToolRequest.d.ts +7 -16
- package/dist/cjs/api/resources/tools/client/requests/CreateToolRequest.js +4 -3
- package/dist/cjs/api/resources/tools/client/requests/ToolsDeleteRequest.d.ts +0 -3
- package/dist/cjs/api/resources/tools/client/requests/ToolsDeleteRequest.js +1 -3
- package/dist/cjs/api/resources/tools/client/requests/ToolsGetRequest.d.ts +0 -23
- package/dist/cjs/api/resources/tools/client/requests/ToolsGetRequest.js +1 -3
- package/dist/cjs/api/resources/tools/client/requests/ToolsListRequest.d.ts +0 -3
- package/dist/cjs/api/resources/tools/client/requests/ToolsListRequest.js +1 -3
- package/dist/cjs/api/resources/tools/client/requests/UpdateToolRequest.d.ts +7 -16
- package/dist/cjs/api/resources/tools/client/requests/UpdateToolRequest.js +4 -3
- package/dist/cjs/api/resources/tools/client/requests/index.d.ts +5 -5
- package/dist/cjs/api/resources/tools/client/requests/index.js +5 -0
- package/dist/cjs/api/resources/tools/exports.d.ts +2 -0
- package/dist/cjs/api/resources/tools/exports.js +21 -0
- package/dist/cjs/api/resources/tools/index.d.ts +1 -1
- package/dist/cjs/api/resources/tools/index.js +1 -1
- package/dist/cjs/api/resources/tools/types/ToolsCreateResponse.d.ts +0 -3
- package/dist/cjs/api/resources/tools/types/ToolsCreateResponse.js +1 -3
- package/dist/cjs/api/resources/tools/types/ToolsDeleteResponse.d.ts +0 -3
- package/dist/cjs/api/resources/tools/types/ToolsDeleteResponse.js +1 -3
- package/dist/cjs/api/resources/tools/types/ToolsGetResponse.d.ts +1 -4
- package/dist/cjs/api/resources/tools/types/ToolsGetResponse.js +1 -3
- package/dist/cjs/api/resources/tools/types/ToolsListResponse.d.ts +1 -4
- package/dist/cjs/api/resources/tools/types/ToolsListResponse.js +1 -3
- package/dist/cjs/api/resources/tools/types/ToolsUpdateResponse.d.ts +0 -3
- package/dist/cjs/api/resources/tools/types/ToolsUpdateResponse.js +1 -3
- package/dist/cjs/api/resources/tools/types/index.d.ts +2 -2
- package/dist/cjs/api/resources/tools/types/index.js +2 -2
- package/dist/cjs/api/resources/voices/client/Client.d.ts +12 -33
- package/dist/cjs/api/resources/voices/client/Client.js +33 -66
- package/dist/cjs/api/resources/voices/client/index.d.ts +0 -1
- package/dist/cjs/api/resources/voices/client/requests/VoicesListRequest.d.ts +0 -3
- package/dist/cjs/api/resources/voices/client/requests/VoicesListRequest.js +1 -3
- package/dist/cjs/api/resources/voices/client/requests/index.d.ts +1 -1
- package/dist/cjs/api/resources/voices/exports.d.ts +2 -0
- package/dist/cjs/api/resources/voices/exports.js +21 -0
- package/dist/cjs/api/resources/voices/index.d.ts +1 -1
- package/dist/cjs/api/resources/voices/index.js +1 -1
- package/dist/cjs/api/resources/voices/types/VoicesGetResponse.d.ts +1 -4
- package/dist/cjs/api/resources/voices/types/VoicesGetResponse.js +1 -3
- package/dist/cjs/api/resources/voices/types/VoicesListResponse.d.ts +1 -4
- package/dist/cjs/api/resources/voices/types/VoicesListResponse.js +1 -3
- package/dist/cjs/api/resources/voices/types/index.d.ts +1 -1
- package/dist/cjs/api/resources/voices/types/index.js +1 -1
- package/dist/cjs/api/types/AddSystemMessagePayload.d.ts +0 -3
- package/dist/cjs/api/types/AddSystemMessagePayload.js +1 -3
- package/dist/cjs/api/types/Agent.d.ts +11 -18
- package/dist/cjs/api/types/Agent.js +3 -3
- package/dist/cjs/api/types/AssistantChoseNotToRespondPayload.d.ts +0 -3
- package/dist/cjs/api/types/AssistantChoseNotToRespondPayload.js +1 -3
- package/dist/cjs/api/types/AssistantEndedConversationPayload.d.ts +0 -3
- package/dist/cjs/api/types/AssistantEndedConversationPayload.js +1 -3
- package/dist/cjs/api/types/AssistantFinishedSpeakingPayload.d.ts +0 -3
- package/dist/cjs/api/types/AssistantFinishedSpeakingPayload.js +1 -3
- package/dist/cjs/api/types/AssistantStartedSpeakingPayload.d.ts +0 -3
- package/dist/cjs/api/types/AssistantStartedSpeakingPayload.js +1 -3
- package/dist/cjs/api/types/AudioChunkPayload.d.ts +1 -4
- package/dist/cjs/api/types/AudioChunkPayload.js +1 -3
- package/dist/cjs/api/types/AudioChunkResponsePayload.d.ts +0 -3
- package/dist/cjs/api/types/AudioChunkResponsePayload.js +1 -3
- package/dist/cjs/api/types/BadRequestErrorBody.d.ts +1 -4
- package/dist/cjs/api/types/BadRequestErrorBody.js +1 -3
- package/dist/cjs/api/types/BasicError.d.ts +2 -5
- package/dist/cjs/api/types/BasicError.js +1 -3
- package/dist/cjs/api/types/ConfigPayload.d.ts +30 -39
- package/dist/cjs/api/types/ConfigPayload.js +4 -3
- package/dist/cjs/api/types/Conversation.d.ts +10 -19
- package/dist/cjs/api/types/Conversation.js +4 -3
- package/dist/cjs/api/types/ConversationAnalysis.d.ts +0 -3
- package/dist/cjs/api/types/ConversationAnalysis.js +1 -3
- package/dist/cjs/api/types/ConversationCreatedPayload.d.ts +0 -3
- package/dist/cjs/api/types/ConversationCreatedPayload.js +1 -3
- package/dist/cjs/api/types/ConversationEval.d.ts +0 -3
- package/dist/cjs/api/types/ConversationEval.js +1 -3
- package/dist/cjs/api/types/ConversationEvalPrompt.d.ts +0 -3
- package/dist/cjs/api/types/ConversationEvalPrompt.js +1 -3
- package/dist/cjs/api/types/ConversationEvaluation.d.ts +1 -4
- package/dist/cjs/api/types/ConversationEvaluation.js +1 -3
- package/dist/cjs/api/types/ConversationEvaluationResult.d.ts +2 -7
- package/dist/cjs/api/types/ConversationEvaluationResult.js +2 -3
- package/dist/cjs/api/types/ConversationExtraction.d.ts +1 -4
- package/dist/cjs/api/types/ConversationExtraction.js +1 -3
- package/dist/cjs/api/types/ConversationItem.d.ts +14 -19
- package/dist/cjs/api/types/ConversationItem.js +2 -3
- package/dist/cjs/api/types/CreateAgentRequest.d.ts +37 -44
- package/dist/cjs/api/types/CreateAgentRequest.js +3 -3
- package/dist/cjs/api/types/DtmfPayload.d.ts +0 -3
- package/dist/cjs/api/types/DtmfPayload.js +1 -3
- package/dist/cjs/api/types/ErrorPayload.d.ts +2 -5
- package/dist/cjs/api/types/ErrorPayload.js +1 -3
- package/dist/cjs/api/types/Error_.d.ts +1 -4
- package/dist/cjs/api/types/Error_.js +1 -3
- package/dist/cjs/api/types/ExtractionField.d.ts +3 -8
- package/dist/cjs/api/types/ExtractionField.js +2 -3
- package/dist/cjs/api/types/ExtractionSchema.d.ts +1 -4
- package/dist/cjs/api/types/ExtractionSchema.js +1 -3
- package/dist/cjs/api/types/GenerateReplyPayload.d.ts +1 -4
- package/dist/cjs/api/types/GenerateReplyPayload.js +1 -3
- package/dist/cjs/api/types/InputCancelledPayload.d.ts +0 -3
- package/dist/cjs/api/types/InputCancelledPayload.js +1 -3
- package/dist/cjs/api/types/InputTextPayload.d.ts +0 -3
- package/dist/cjs/api/types/InputTextPayload.js +1 -3
- package/dist/cjs/api/types/LanguageCode.d.ts +2 -7
- package/dist/cjs/api/types/LanguageCode.js +2 -3
- package/dist/cjs/api/types/OutboundCallConfig.d.ts +14 -17
- package/dist/cjs/api/types/OutboundCallConfig.js +1 -3
- package/dist/cjs/api/types/Project.d.ts +0 -3
- package/dist/cjs/api/types/Project.js +1 -3
- package/dist/cjs/api/types/ReadyToStartConversationPayload.d.ts +0 -3
- package/dist/cjs/api/types/ReadyToStartConversationPayload.js +1 -3
- package/dist/cjs/api/types/SetExternalIdPayload.d.ts +0 -3
- package/dist/cjs/api/types/SetExternalIdPayload.js +1 -3
- package/dist/cjs/api/types/Task.d.ts +0 -3
- package/dist/cjs/api/types/Task.js +1 -3
- package/dist/cjs/api/types/Tool.d.ts +22 -31
- package/dist/cjs/api/types/Tool.js +4 -3
- package/dist/cjs/api/types/ToolCallInterruptedPayload.d.ts +0 -3
- package/dist/cjs/api/types/ToolCallInterruptedPayload.js +1 -3
- package/dist/cjs/api/types/ToolCallOutputPayload.d.ts +1 -4
- package/dist/cjs/api/types/ToolCallOutputPayload.js +1 -3
- package/dist/cjs/api/types/ToolCallOutputProcessedPayload.d.ts +14 -17
- package/dist/cjs/api/types/ToolCallOutputProcessedPayload.js +1 -3
- package/dist/cjs/api/types/ToolCallPayload.d.ts +0 -3
- package/dist/cjs/api/types/ToolCallPayload.js +1 -3
- package/dist/cjs/api/types/ToolParameter.d.ts +7 -14
- package/dist/cjs/api/types/ToolParameter.js +10 -3
- package/dist/cjs/api/types/UpdateSystemPromptPayload.d.ts +0 -3
- package/dist/cjs/api/types/UpdateSystemPromptPayload.js +1 -3
- package/dist/cjs/api/types/UserFinishedSpeakingPayload.d.ts +0 -3
- package/dist/cjs/api/types/UserFinishedSpeakingPayload.js +1 -3
- package/dist/cjs/api/types/UserStartedSpeakingPayload.d.ts +0 -3
- package/dist/cjs/api/types/UserStartedSpeakingPayload.js +1 -3
- package/dist/cjs/api/types/ValidationError.d.ts +0 -3
- package/dist/cjs/api/types/ValidationError.js +1 -3
- package/dist/cjs/api/types/Voice.d.ts +0 -3
- package/dist/cjs/api/types/Voice.js +1 -3
- package/dist/cjs/api/types/WarningPayload.d.ts +1 -4
- package/dist/cjs/api/types/WarningPayload.js +1 -3
- package/dist/cjs/api/types/index.d.ts +38 -38
- package/dist/cjs/api/types/index.js +38 -38
- package/dist/cjs/auth/BearerAuthProvider.d.ts +20 -0
- package/dist/cjs/auth/BearerAuthProvider.js +82 -0
- package/dist/cjs/auth/index.d.ts +1 -0
- package/dist/cjs/auth/index.js +5 -0
- package/dist/cjs/core/auth/AuthProvider.d.ts +5 -2
- package/dist/cjs/core/auth/BasicAuth.js +2 -1
- package/dist/cjs/core/auth/BearerToken.d.ts +3 -1
- package/dist/cjs/core/auth/BearerToken.js +7 -6
- package/dist/cjs/core/auth/NoOpAuthProvider.d.ts +5 -0
- package/dist/cjs/core/auth/NoOpAuthProvider.js +9 -0
- package/dist/cjs/core/auth/index.d.ts +3 -2
- package/dist/cjs/core/auth/index.js +3 -1
- package/dist/cjs/core/exports.d.ts +2 -0
- package/dist/cjs/core/exports.js +18 -0
- package/dist/cjs/core/fetcher/APIResponse.d.ts +1 -1
- package/dist/cjs/core/fetcher/BinaryResponse.d.ts +5 -6
- package/dist/cjs/core/fetcher/EndpointMetadata.d.ts +13 -0
- package/dist/cjs/core/fetcher/EndpointMetadata.js +2 -0
- package/dist/cjs/core/fetcher/EndpointSupplier.d.ts +12 -0
- package/dist/cjs/core/fetcher/EndpointSupplier.js +22 -0
- package/dist/cjs/core/fetcher/Fetcher.d.ts +13 -5
- package/dist/cjs/core/fetcher/Fetcher.js +213 -11
- package/dist/cjs/core/fetcher/HttpResponsePromise.d.ts +1 -1
- package/dist/cjs/core/fetcher/getErrorResponseBody.js +2 -1
- package/dist/cjs/core/fetcher/getRequestBody.d.ts +1 -1
- package/dist/cjs/core/fetcher/getRequestBody.js +4 -0
- package/dist/cjs/core/fetcher/getResponseBody.js +21 -7
- package/dist/cjs/core/fetcher/index.d.ts +2 -0
- package/dist/cjs/core/fetcher/index.js +3 -1
- package/dist/cjs/core/fetcher/makeRequest.d.ts +6 -1
- package/dist/cjs/core/fetcher/makeRequest.js +32 -13
- package/dist/cjs/core/fetcher/requestWithRetries.js +3 -12
- package/dist/cjs/core/fetcher/signals.d.ts +1 -7
- package/dist/cjs/core/fetcher/signals.js +0 -12
- package/dist/cjs/core/headers.d.ts +2 -3
- package/dist/cjs/core/headers.js +6 -4
- package/dist/cjs/core/index.d.ts +3 -2
- package/dist/cjs/core/index.js +4 -3
- package/dist/cjs/core/logging/exports.d.ts +18 -0
- package/dist/cjs/core/logging/exports.js +45 -0
- package/dist/cjs/core/logging/index.d.ts +1 -0
- package/dist/cjs/core/logging/index.js +17 -0
- package/dist/cjs/core/logging/logger.d.ts +126 -0
- package/dist/cjs/core/logging/logger.js +144 -0
- package/dist/cjs/core/runtime/runtime.js +17 -15
- package/dist/cjs/core/url/encodePathParam.d.ts +1 -0
- package/dist/cjs/core/url/encodePathParam.js +21 -0
- package/dist/cjs/core/url/index.d.ts +1 -0
- package/dist/cjs/core/url/index.js +3 -1
- package/dist/cjs/core/url/join.js +3 -4
- package/dist/cjs/core/websocket/exports.d.ts +8 -0
- package/dist/cjs/core/websocket/exports.js +2 -0
- package/dist/cjs/core/websocket/ws.d.ts +14 -11
- package/dist/cjs/core/websocket/ws.js +42 -29
- package/dist/cjs/environments.d.ts +0 -3
- package/dist/cjs/environments.js +1 -3
- package/dist/cjs/errors/PhonicError.d.ts +1 -4
- package/dist/cjs/errors/PhonicError.js +7 -5
- package/dist/cjs/errors/PhonicTimeoutError.d.ts +0 -3
- package/dist/cjs/errors/PhonicTimeoutError.js +6 -4
- package/dist/cjs/errors/handleNonStatusCodeError.d.ts +2 -0
- package/dist/cjs/errors/handleNonStatusCodeError.js +65 -0
- package/dist/cjs/exports.d.ts +1 -0
- package/dist/cjs/exports.js +17 -0
- package/dist/cjs/index.d.ts +4 -2
- package/dist/cjs/index.js +8 -4
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.d.mts +40 -0
- package/dist/esm/BaseClient.mjs +25 -0
- package/dist/esm/Client.d.mts +27 -48
- package/dist/esm/Client.mjs +18 -28
- package/dist/esm/api/errors/BadRequestError.d.mts +1 -4
- package/dist/esm/api/errors/BadRequestError.mjs +6 -4
- package/dist/esm/api/errors/ConflictError.d.mts +1 -4
- package/dist/esm/api/errors/ConflictError.mjs +6 -4
- package/dist/esm/api/errors/ForbiddenError.d.mts +1 -4
- package/dist/esm/api/errors/ForbiddenError.mjs +6 -4
- package/dist/esm/api/errors/GatewayTimeoutError.d.mts +2 -5
- package/dist/esm/api/errors/GatewayTimeoutError.mjs +6 -4
- package/dist/esm/api/errors/InternalServerError.d.mts +2 -5
- package/dist/esm/api/errors/InternalServerError.mjs +6 -4
- package/dist/esm/api/errors/NotFoundError.d.mts +1 -4
- package/dist/esm/api/errors/NotFoundError.mjs +6 -4
- package/dist/esm/api/errors/UnauthorizedError.d.mts +2 -5
- package/dist/esm/api/errors/UnauthorizedError.mjs +6 -4
- package/dist/esm/api/errors/index.d.mts +4 -4
- package/dist/esm/api/errors/index.mjs +4 -4
- package/dist/esm/api/resources/agents/client/Client.d.mts +26 -47
- package/dist/esm/api/resources/agents/client/Client.mjs +126 -247
- package/dist/esm/api/resources/agents/client/index.d.mts +0 -1
- package/dist/esm/api/resources/agents/client/requests/AgentsAddCustomPhoneNumberRequest.d.mts +2 -5
- package/dist/esm/api/resources/agents/client/requests/AgentsAddCustomPhoneNumberRequest.mjs +1 -3
- package/dist/esm/api/resources/agents/client/requests/AgentsCreateRequest.d.mts +1 -4
- package/dist/esm/api/resources/agents/client/requests/AgentsCreateRequest.mjs +1 -3
- package/dist/esm/api/resources/agents/client/requests/AgentsDeleteCustomPhoneNumberRequest.d.mts +0 -3
- package/dist/esm/api/resources/agents/client/requests/AgentsDeleteCustomPhoneNumberRequest.mjs +1 -3
- package/dist/esm/api/resources/agents/client/requests/AgentsDeleteRequest.d.mts +0 -3
- package/dist/esm/api/resources/agents/client/requests/AgentsDeleteRequest.mjs +1 -3
- package/dist/esm/api/resources/agents/client/requests/AgentsGetRequest.d.mts +0 -3
- package/dist/esm/api/resources/agents/client/requests/AgentsGetRequest.mjs +1 -3
- package/dist/esm/api/resources/agents/client/requests/AgentsListRequest.d.mts +0 -3
- package/dist/esm/api/resources/agents/client/requests/AgentsListRequest.mjs +1 -3
- package/dist/esm/api/resources/agents/client/requests/AgentsUpdatePhoneNumberRequest.d.mts +2 -5
- package/dist/esm/api/resources/agents/client/requests/AgentsUpdatePhoneNumberRequest.mjs +1 -3
- package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.d.mts +9 -16
- package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.mjs +3 -3
- package/dist/esm/api/resources/agents/client/requests/UpsertAgentRequest.d.mts +1 -4
- package/dist/esm/api/resources/agents/client/requests/UpsertAgentRequest.mjs +1 -3
- package/dist/esm/api/resources/agents/client/requests/index.d.mts +9 -9
- package/dist/esm/api/resources/agents/client/requests/index.mjs +1 -1
- package/dist/esm/api/resources/agents/exports.d.mts +2 -0
- package/dist/esm/api/resources/agents/exports.mjs +3 -0
- package/dist/esm/api/resources/agents/index.d.mts +1 -1
- package/dist/esm/api/resources/agents/index.mjs +1 -1
- package/dist/esm/api/resources/agents/types/AgentsAddCustomPhoneNumberResponse.d.mts +0 -3
- package/dist/esm/api/resources/agents/types/AgentsAddCustomPhoneNumberResponse.mjs +1 -3
- package/dist/esm/api/resources/agents/types/AgentsCreateResponse.d.mts +0 -3
- package/dist/esm/api/resources/agents/types/AgentsCreateResponse.mjs +1 -3
- package/dist/esm/api/resources/agents/types/AgentsDeleteCustomPhoneNumberResponse.d.mts +0 -3
- package/dist/esm/api/resources/agents/types/AgentsDeleteCustomPhoneNumberResponse.mjs +1 -3
- package/dist/esm/api/resources/agents/types/AgentsDeleteResponse.d.mts +0 -3
- package/dist/esm/api/resources/agents/types/AgentsDeleteResponse.mjs +1 -3
- package/dist/esm/api/resources/agents/types/AgentsGetResponse.d.mts +1 -4
- package/dist/esm/api/resources/agents/types/AgentsGetResponse.mjs +1 -3
- package/dist/esm/api/resources/agents/types/AgentsListResponse.d.mts +1 -4
- package/dist/esm/api/resources/agents/types/AgentsListResponse.mjs +1 -3
- package/dist/esm/api/resources/agents/types/AgentsUpdatePhoneNumberResponse.d.mts +0 -3
- package/dist/esm/api/resources/agents/types/AgentsUpdatePhoneNumberResponse.mjs +1 -3
- package/dist/esm/api/resources/agents/types/AgentsUpdateResponse.d.mts +0 -3
- package/dist/esm/api/resources/agents/types/AgentsUpdateResponse.mjs +1 -3
- package/dist/esm/api/resources/agents/types/AgentsUpsertResponse.d.mts +1 -4
- package/dist/esm/api/resources/agents/types/AgentsUpsertResponse.mjs +1 -3
- package/dist/esm/api/resources/agents/types/index.d.mts +6 -6
- package/dist/esm/api/resources/agents/types/index.mjs +6 -6
- package/dist/esm/api/resources/auth/client/Client.d.mts +10 -31
- package/dist/esm/api/resources/auth/client/Client.mjs +18 -41
- package/dist/esm/api/resources/auth/client/index.d.mts +0 -1
- package/dist/esm/api/resources/auth/client/requests/CreateSessionTokenRequest.d.mts +0 -3
- package/dist/esm/api/resources/auth/client/requests/CreateSessionTokenRequest.mjs +1 -3
- package/dist/esm/api/resources/auth/client/requests/index.d.mts +1 -1
- package/dist/esm/api/resources/auth/exports.d.mts +2 -0
- package/dist/esm/api/resources/auth/exports.mjs +3 -0
- package/dist/esm/api/resources/auth/index.d.mts +1 -1
- package/dist/esm/api/resources/auth/index.mjs +1 -1
- package/dist/esm/api/resources/auth/types/AuthCreateSessionTokenResponse.d.mts +0 -3
- package/dist/esm/api/resources/auth/types/AuthCreateSessionTokenResponse.mjs +1 -3
- package/dist/esm/api/resources/conversations/client/Client.d.mts +36 -51
- package/dist/esm/api/resources/conversations/client/Client.mjs +132 -268
- package/dist/esm/api/resources/conversations/client/Socket.d.mts +2 -12
- package/dist/esm/api/resources/conversations/client/Socket.mjs +15 -40
- package/dist/esm/api/resources/conversations/client/index.d.mts +0 -1
- package/dist/esm/api/resources/conversations/client/requests/ConversationsListRequest.d.mts +0 -6
- package/dist/esm/api/resources/conversations/client/requests/ConversationsListRequest.mjs +1 -3
- package/dist/esm/api/resources/conversations/client/requests/ConversationsSipOutboundCallRequest.d.mts +1 -4
- package/dist/esm/api/resources/conversations/client/requests/ConversationsSipOutboundCallRequest.mjs +1 -3
- package/dist/esm/api/resources/conversations/client/requests/EvaluateConversationRequest.d.mts +0 -3
- package/dist/esm/api/resources/conversations/client/requests/EvaluateConversationRequest.mjs +1 -3
- package/dist/esm/api/resources/conversations/client/requests/ExtractDataRequest.d.mts +0 -3
- package/dist/esm/api/resources/conversations/client/requests/ExtractDataRequest.mjs +1 -3
- package/dist/esm/api/resources/conversations/client/requests/OutboundCallRequest.d.mts +1 -4
- package/dist/esm/api/resources/conversations/client/requests/OutboundCallRequest.mjs +1 -3
- package/dist/esm/api/resources/conversations/client/requests/index.d.mts +5 -5
- package/dist/esm/api/resources/conversations/exports.d.mts +2 -0
- package/dist/esm/api/resources/conversations/exports.mjs +3 -0
- package/dist/esm/api/resources/conversations/index.d.mts +1 -1
- package/dist/esm/api/resources/conversations/index.mjs +1 -1
- package/dist/esm/api/resources/conversations/types/ConversationsCancelResponse.d.mts +0 -3
- package/dist/esm/api/resources/conversations/types/ConversationsCancelResponse.mjs +1 -3
- package/dist/esm/api/resources/conversations/types/ConversationsExtractDataResponse.d.mts +0 -3
- package/dist/esm/api/resources/conversations/types/ConversationsExtractDataResponse.mjs +1 -3
- package/dist/esm/api/resources/conversations/types/ConversationsGetAnalysisResponse.d.mts +1 -4
- package/dist/esm/api/resources/conversations/types/ConversationsGetAnalysisResponse.mjs +1 -3
- package/dist/esm/api/resources/conversations/types/ConversationsGetResponse.d.mts +1 -4
- package/dist/esm/api/resources/conversations/types/ConversationsGetResponse.mjs +1 -3
- package/dist/esm/api/resources/conversations/types/ConversationsListEvaluationsResponse.d.mts +1 -4
- package/dist/esm/api/resources/conversations/types/ConversationsListEvaluationsResponse.mjs +1 -3
- package/dist/esm/api/resources/conversations/types/ConversationsListExtractionsResponse.d.mts +1 -4
- package/dist/esm/api/resources/conversations/types/ConversationsListExtractionsResponse.mjs +1 -3
- package/dist/esm/api/resources/conversations/types/ConversationsListResponse.d.mts +1 -4
- package/dist/esm/api/resources/conversations/types/ConversationsListResponse.mjs +1 -3
- package/dist/esm/api/resources/conversations/types/ConversationsOutboundCallResponse.d.mts +0 -3
- package/dist/esm/api/resources/conversations/types/ConversationsOutboundCallResponse.mjs +1 -3
- package/dist/esm/api/resources/conversations/types/ConversationsSipOutboundCallResponse.d.mts +0 -3
- package/dist/esm/api/resources/conversations/types/ConversationsSipOutboundCallResponse.mjs +1 -3
- package/dist/esm/api/resources/conversations/types/index.d.mts +4 -4
- package/dist/esm/api/resources/conversations/types/index.mjs +4 -4
- package/dist/esm/api/resources/extractionSchemas/client/Client.d.mts +18 -39
- package/dist/esm/api/resources/extractionSchemas/client/Client.mjs +72 -144
- package/dist/esm/api/resources/extractionSchemas/client/index.d.mts +0 -1
- package/dist/esm/api/resources/extractionSchemas/client/requests/CreateExtractionSchemaRequest.d.mts +1 -4
- package/dist/esm/api/resources/extractionSchemas/client/requests/CreateExtractionSchemaRequest.mjs +1 -3
- package/dist/esm/api/resources/extractionSchemas/client/requests/ExtractionSchemasDeleteRequest.d.mts +0 -3
- package/dist/esm/api/resources/extractionSchemas/client/requests/ExtractionSchemasDeleteRequest.mjs +1 -3
- package/dist/esm/api/resources/extractionSchemas/client/requests/ExtractionSchemasGetRequest.d.mts +0 -3
- package/dist/esm/api/resources/extractionSchemas/client/requests/ExtractionSchemasGetRequest.mjs +1 -3
- package/dist/esm/api/resources/extractionSchemas/client/requests/ExtractionSchemasListRequest.d.mts +0 -3
- package/dist/esm/api/resources/extractionSchemas/client/requests/ExtractionSchemasListRequest.mjs +1 -3
- package/dist/esm/api/resources/extractionSchemas/client/requests/UpdateExtractionSchemaRequest.d.mts +1 -4
- package/dist/esm/api/resources/extractionSchemas/client/requests/UpdateExtractionSchemaRequest.mjs +1 -3
- package/dist/esm/api/resources/extractionSchemas/client/requests/index.d.mts +5 -5
- package/dist/esm/api/resources/extractionSchemas/exports.d.mts +2 -0
- package/dist/esm/api/resources/extractionSchemas/exports.mjs +3 -0
- package/dist/esm/api/resources/extractionSchemas/index.d.mts +1 -1
- package/dist/esm/api/resources/extractionSchemas/index.mjs +1 -1
- package/dist/esm/api/resources/extractionSchemas/types/ExtractionSchemasCreateResponse.d.mts +0 -3
- package/dist/esm/api/resources/extractionSchemas/types/ExtractionSchemasCreateResponse.mjs +1 -3
- package/dist/esm/api/resources/extractionSchemas/types/ExtractionSchemasDeleteResponse.d.mts +0 -3
- package/dist/esm/api/resources/extractionSchemas/types/ExtractionSchemasDeleteResponse.mjs +1 -3
- package/dist/esm/api/resources/extractionSchemas/types/ExtractionSchemasGetResponse.d.mts +1 -4
- package/dist/esm/api/resources/extractionSchemas/types/ExtractionSchemasGetResponse.mjs +1 -3
- package/dist/esm/api/resources/extractionSchemas/types/ExtractionSchemasListResponse.d.mts +1 -4
- package/dist/esm/api/resources/extractionSchemas/types/ExtractionSchemasListResponse.mjs +1 -3
- package/dist/esm/api/resources/extractionSchemas/types/ExtractionSchemasUpdateResponse.d.mts +0 -3
- package/dist/esm/api/resources/extractionSchemas/types/ExtractionSchemasUpdateResponse.mjs +1 -3
- package/dist/esm/api/resources/extractionSchemas/types/index.d.mts +2 -2
- package/dist/esm/api/resources/extractionSchemas/types/index.mjs +2 -2
- package/dist/esm/api/resources/index.d.mts +13 -13
- package/dist/esm/api/resources/index.mjs +13 -13
- package/dist/esm/api/resources/projects/client/Client.d.mts +22 -43
- package/dist/esm/api/resources/projects/client/Client.mjs +77 -166
- package/dist/esm/api/resources/projects/client/index.d.mts +0 -1
- package/dist/esm/api/resources/projects/client/requests/CreateConversationEvalPromptRequest.d.mts +0 -3
- package/dist/esm/api/resources/projects/client/requests/CreateConversationEvalPromptRequest.mjs +1 -3
- package/dist/esm/api/resources/projects/client/requests/CreateProjectRequest.d.mts +0 -3
- package/dist/esm/api/resources/projects/client/requests/CreateProjectRequest.mjs +1 -3
- package/dist/esm/api/resources/projects/client/requests/UpdateProjectRequest.d.mts +0 -3
- package/dist/esm/api/resources/projects/client/requests/UpdateProjectRequest.mjs +1 -3
- package/dist/esm/api/resources/projects/client/requests/index.d.mts +3 -3
- package/dist/esm/api/resources/projects/exports.d.mts +2 -0
- package/dist/esm/api/resources/projects/exports.mjs +3 -0
- package/dist/esm/api/resources/projects/index.d.mts +1 -1
- package/dist/esm/api/resources/projects/index.mjs +1 -1
- package/dist/esm/api/resources/projects/types/ProjectsCreateEvalPromptResponse.d.mts +0 -3
- package/dist/esm/api/resources/projects/types/ProjectsCreateEvalPromptResponse.mjs +1 -3
- package/dist/esm/api/resources/projects/types/ProjectsCreateResponse.d.mts +0 -3
- package/dist/esm/api/resources/projects/types/ProjectsCreateResponse.mjs +1 -3
- package/dist/esm/api/resources/projects/types/ProjectsDeleteResponse.d.mts +0 -3
- package/dist/esm/api/resources/projects/types/ProjectsDeleteResponse.mjs +1 -3
- package/dist/esm/api/resources/projects/types/ProjectsGetResponse.d.mts +1 -4
- package/dist/esm/api/resources/projects/types/ProjectsGetResponse.mjs +1 -3
- package/dist/esm/api/resources/projects/types/ProjectsListEvalPromptsResponse.d.mts +1 -4
- package/dist/esm/api/resources/projects/types/ProjectsListEvalPromptsResponse.mjs +1 -3
- package/dist/esm/api/resources/projects/types/ProjectsListResponse.d.mts +1 -4
- package/dist/esm/api/resources/projects/types/ProjectsListResponse.mjs +1 -3
- package/dist/esm/api/resources/projects/types/ProjectsUpdateResponse.d.mts +0 -3
- package/dist/esm/api/resources/projects/types/ProjectsUpdateResponse.mjs +1 -3
- package/dist/esm/api/resources/projects/types/index.d.mts +4 -4
- package/dist/esm/api/resources/projects/types/index.mjs +4 -4
- package/dist/esm/api/resources/tools/client/Client.d.mts +18 -39
- package/dist/esm/api/resources/tools/client/Client.mjs +72 -144
- package/dist/esm/api/resources/tools/client/index.d.mts +0 -1
- package/dist/esm/api/resources/tools/client/requests/CreateToolRequest.d.mts +7 -16
- package/dist/esm/api/resources/tools/client/requests/CreateToolRequest.mjs +4 -3
- package/dist/esm/api/resources/tools/client/requests/ToolsDeleteRequest.d.mts +0 -3
- package/dist/esm/api/resources/tools/client/requests/ToolsDeleteRequest.mjs +1 -3
- package/dist/esm/api/resources/tools/client/requests/ToolsGetRequest.d.mts +0 -23
- package/dist/esm/api/resources/tools/client/requests/ToolsGetRequest.mjs +1 -3
- package/dist/esm/api/resources/tools/client/requests/ToolsListRequest.d.mts +0 -3
- package/dist/esm/api/resources/tools/client/requests/ToolsListRequest.mjs +1 -3
- package/dist/esm/api/resources/tools/client/requests/UpdateToolRequest.d.mts +7 -16
- package/dist/esm/api/resources/tools/client/requests/UpdateToolRequest.mjs +4 -3
- package/dist/esm/api/resources/tools/client/requests/index.d.mts +5 -5
- package/dist/esm/api/resources/tools/client/requests/index.mjs +2 -1
- package/dist/esm/api/resources/tools/exports.d.mts +2 -0
- package/dist/esm/api/resources/tools/exports.mjs +3 -0
- package/dist/esm/api/resources/tools/index.d.mts +1 -1
- package/dist/esm/api/resources/tools/index.mjs +1 -1
- package/dist/esm/api/resources/tools/types/ToolsCreateResponse.d.mts +0 -3
- package/dist/esm/api/resources/tools/types/ToolsCreateResponse.mjs +1 -3
- package/dist/esm/api/resources/tools/types/ToolsDeleteResponse.d.mts +0 -3
- package/dist/esm/api/resources/tools/types/ToolsDeleteResponse.mjs +1 -3
- package/dist/esm/api/resources/tools/types/ToolsGetResponse.d.mts +1 -4
- package/dist/esm/api/resources/tools/types/ToolsGetResponse.mjs +1 -3
- package/dist/esm/api/resources/tools/types/ToolsListResponse.d.mts +1 -4
- package/dist/esm/api/resources/tools/types/ToolsListResponse.mjs +1 -3
- package/dist/esm/api/resources/tools/types/ToolsUpdateResponse.d.mts +0 -3
- package/dist/esm/api/resources/tools/types/ToolsUpdateResponse.mjs +1 -3
- package/dist/esm/api/resources/tools/types/index.d.mts +2 -2
- package/dist/esm/api/resources/tools/types/index.mjs +2 -2
- package/dist/esm/api/resources/voices/client/Client.d.mts +12 -33
- package/dist/esm/api/resources/voices/client/Client.mjs +31 -64
- package/dist/esm/api/resources/voices/client/index.d.mts +0 -1
- package/dist/esm/api/resources/voices/client/requests/VoicesListRequest.d.mts +0 -3
- package/dist/esm/api/resources/voices/client/requests/VoicesListRequest.mjs +1 -3
- package/dist/esm/api/resources/voices/client/requests/index.d.mts +1 -1
- package/dist/esm/api/resources/voices/exports.d.mts +2 -0
- package/dist/esm/api/resources/voices/exports.mjs +3 -0
- package/dist/esm/api/resources/voices/index.d.mts +1 -1
- package/dist/esm/api/resources/voices/index.mjs +1 -1
- package/dist/esm/api/resources/voices/types/VoicesGetResponse.d.mts +1 -4
- package/dist/esm/api/resources/voices/types/VoicesGetResponse.mjs +1 -3
- package/dist/esm/api/resources/voices/types/VoicesListResponse.d.mts +1 -4
- package/dist/esm/api/resources/voices/types/VoicesListResponse.mjs +1 -3
- package/dist/esm/api/resources/voices/types/index.d.mts +1 -1
- package/dist/esm/api/resources/voices/types/index.mjs +1 -1
- package/dist/esm/api/types/AddSystemMessagePayload.d.mts +0 -3
- package/dist/esm/api/types/AddSystemMessagePayload.mjs +1 -3
- package/dist/esm/api/types/Agent.d.mts +11 -18
- package/dist/esm/api/types/Agent.mjs +3 -3
- package/dist/esm/api/types/AssistantChoseNotToRespondPayload.d.mts +0 -3
- package/dist/esm/api/types/AssistantChoseNotToRespondPayload.mjs +1 -3
- package/dist/esm/api/types/AssistantEndedConversationPayload.d.mts +0 -3
- package/dist/esm/api/types/AssistantEndedConversationPayload.mjs +1 -3
- package/dist/esm/api/types/AssistantFinishedSpeakingPayload.d.mts +0 -3
- package/dist/esm/api/types/AssistantFinishedSpeakingPayload.mjs +1 -3
- package/dist/esm/api/types/AssistantStartedSpeakingPayload.d.mts +0 -3
- package/dist/esm/api/types/AssistantStartedSpeakingPayload.mjs +1 -3
- package/dist/esm/api/types/AudioChunkPayload.d.mts +1 -4
- package/dist/esm/api/types/AudioChunkPayload.mjs +1 -3
- package/dist/esm/api/types/AudioChunkResponsePayload.d.mts +0 -3
- package/dist/esm/api/types/AudioChunkResponsePayload.mjs +1 -3
- package/dist/esm/api/types/BadRequestErrorBody.d.mts +1 -4
- package/dist/esm/api/types/BadRequestErrorBody.mjs +1 -3
- package/dist/esm/api/types/BasicError.d.mts +2 -5
- package/dist/esm/api/types/BasicError.mjs +1 -3
- package/dist/esm/api/types/ConfigPayload.d.mts +30 -39
- package/dist/esm/api/types/ConfigPayload.mjs +4 -3
- package/dist/esm/api/types/Conversation.d.mts +10 -19
- package/dist/esm/api/types/Conversation.mjs +4 -3
- package/dist/esm/api/types/ConversationAnalysis.d.mts +0 -3
- package/dist/esm/api/types/ConversationAnalysis.mjs +1 -3
- package/dist/esm/api/types/ConversationCreatedPayload.d.mts +0 -3
- package/dist/esm/api/types/ConversationCreatedPayload.mjs +1 -3
- package/dist/esm/api/types/ConversationEval.d.mts +0 -3
- package/dist/esm/api/types/ConversationEval.mjs +1 -3
- package/dist/esm/api/types/ConversationEvalPrompt.d.mts +0 -3
- package/dist/esm/api/types/ConversationEvalPrompt.mjs +1 -3
- package/dist/esm/api/types/ConversationEvaluation.d.mts +1 -4
- package/dist/esm/api/types/ConversationEvaluation.mjs +1 -3
- package/dist/esm/api/types/ConversationEvaluationResult.d.mts +2 -7
- package/dist/esm/api/types/ConversationEvaluationResult.mjs +2 -3
- package/dist/esm/api/types/ConversationExtraction.d.mts +1 -4
- package/dist/esm/api/types/ConversationExtraction.mjs +1 -3
- package/dist/esm/api/types/ConversationItem.d.mts +14 -19
- package/dist/esm/api/types/ConversationItem.mjs +2 -3
- package/dist/esm/api/types/CreateAgentRequest.d.mts +37 -44
- package/dist/esm/api/types/CreateAgentRequest.mjs +3 -3
- package/dist/esm/api/types/DtmfPayload.d.mts +0 -3
- package/dist/esm/api/types/DtmfPayload.mjs +1 -3
- package/dist/esm/api/types/ErrorPayload.d.mts +2 -5
- package/dist/esm/api/types/ErrorPayload.mjs +1 -3
- package/dist/esm/api/types/Error_.d.mts +1 -4
- package/dist/esm/api/types/Error_.mjs +1 -3
- package/dist/esm/api/types/ExtractionField.d.mts +3 -8
- package/dist/esm/api/types/ExtractionField.mjs +2 -3
- package/dist/esm/api/types/ExtractionSchema.d.mts +1 -4
- package/dist/esm/api/types/ExtractionSchema.mjs +1 -3
- package/dist/esm/api/types/GenerateReplyPayload.d.mts +1 -4
- package/dist/esm/api/types/GenerateReplyPayload.mjs +1 -3
- package/dist/esm/api/types/InputCancelledPayload.d.mts +0 -3
- package/dist/esm/api/types/InputCancelledPayload.mjs +1 -3
- package/dist/esm/api/types/InputTextPayload.d.mts +0 -3
- package/dist/esm/api/types/InputTextPayload.mjs +1 -3
- package/dist/esm/api/types/LanguageCode.d.mts +2 -7
- package/dist/esm/api/types/LanguageCode.mjs +2 -3
- package/dist/esm/api/types/OutboundCallConfig.d.mts +14 -17
- package/dist/esm/api/types/OutboundCallConfig.mjs +1 -3
- package/dist/esm/api/types/Project.d.mts +0 -3
- package/dist/esm/api/types/Project.mjs +1 -3
- package/dist/esm/api/types/ReadyToStartConversationPayload.d.mts +0 -3
- package/dist/esm/api/types/ReadyToStartConversationPayload.mjs +1 -3
- package/dist/esm/api/types/SetExternalIdPayload.d.mts +0 -3
- package/dist/esm/api/types/SetExternalIdPayload.mjs +1 -3
- package/dist/esm/api/types/Task.d.mts +0 -3
- package/dist/esm/api/types/Task.mjs +1 -3
- package/dist/esm/api/types/Tool.d.mts +22 -31
- package/dist/esm/api/types/Tool.mjs +4 -3
- package/dist/esm/api/types/ToolCallInterruptedPayload.d.mts +0 -3
- package/dist/esm/api/types/ToolCallInterruptedPayload.mjs +1 -3
- package/dist/esm/api/types/ToolCallOutputPayload.d.mts +1 -4
- package/dist/esm/api/types/ToolCallOutputPayload.mjs +1 -3
- package/dist/esm/api/types/ToolCallOutputProcessedPayload.d.mts +14 -17
- package/dist/esm/api/types/ToolCallOutputProcessedPayload.mjs +1 -3
- package/dist/esm/api/types/ToolCallPayload.d.mts +0 -3
- package/dist/esm/api/types/ToolCallPayload.mjs +1 -3
- package/dist/esm/api/types/ToolParameter.d.mts +7 -14
- package/dist/esm/api/types/ToolParameter.mjs +10 -3
- package/dist/esm/api/types/UpdateSystemPromptPayload.d.mts +0 -3
- package/dist/esm/api/types/UpdateSystemPromptPayload.mjs +1 -3
- package/dist/esm/api/types/UserFinishedSpeakingPayload.d.mts +0 -3
- package/dist/esm/api/types/UserFinishedSpeakingPayload.mjs +1 -3
- package/dist/esm/api/types/UserStartedSpeakingPayload.d.mts +0 -3
- package/dist/esm/api/types/UserStartedSpeakingPayload.mjs +1 -3
- package/dist/esm/api/types/ValidationError.d.mts +0 -3
- package/dist/esm/api/types/ValidationError.mjs +1 -3
- package/dist/esm/api/types/Voice.d.mts +0 -3
- package/dist/esm/api/types/Voice.mjs +1 -3
- package/dist/esm/api/types/WarningPayload.d.mts +1 -4
- package/dist/esm/api/types/WarningPayload.mjs +1 -3
- package/dist/esm/api/types/index.d.mts +38 -38
- package/dist/esm/api/types/index.mjs +38 -38
- package/dist/esm/auth/BearerAuthProvider.d.mts +20 -0
- package/dist/esm/auth/BearerAuthProvider.mjs +45 -0
- package/dist/esm/auth/index.d.mts +1 -0
- package/dist/esm/auth/index.mjs +1 -0
- package/dist/esm/core/auth/AuthProvider.d.mts +5 -2
- package/dist/esm/core/auth/BasicAuth.mjs +2 -1
- package/dist/esm/core/auth/BearerToken.d.mts +3 -1
- package/dist/esm/core/auth/BearerToken.mjs +7 -6
- package/dist/esm/core/auth/NoOpAuthProvider.d.mts +5 -0
- package/dist/esm/core/auth/NoOpAuthProvider.mjs +5 -0
- package/dist/esm/core/auth/index.d.mts +3 -2
- package/dist/esm/core/auth/index.mjs +1 -0
- package/dist/esm/core/exports.d.mts +2 -0
- package/dist/esm/core/exports.mjs +2 -0
- package/dist/esm/core/fetcher/APIResponse.d.mts +1 -1
- package/dist/esm/core/fetcher/BinaryResponse.d.mts +5 -6
- package/dist/esm/core/fetcher/EndpointMetadata.d.mts +13 -0
- package/dist/esm/core/fetcher/EndpointMetadata.mjs +1 -0
- package/dist/esm/core/fetcher/EndpointSupplier.d.mts +12 -0
- package/dist/esm/core/fetcher/EndpointSupplier.mjs +19 -0
- package/dist/esm/core/fetcher/Fetcher.d.mts +13 -5
- package/dist/esm/core/fetcher/Fetcher.mjs +213 -11
- package/dist/esm/core/fetcher/HttpResponsePromise.d.mts +1 -1
- package/dist/esm/core/fetcher/getErrorResponseBody.mjs +2 -1
- package/dist/esm/core/fetcher/getRequestBody.d.mts +1 -1
- package/dist/esm/core/fetcher/getRequestBody.mjs +4 -0
- package/dist/esm/core/fetcher/getResponseBody.mjs +21 -7
- package/dist/esm/core/fetcher/index.d.mts +2 -0
- package/dist/esm/core/fetcher/index.mjs +1 -0
- package/dist/esm/core/fetcher/makeRequest.d.mts +6 -1
- package/dist/esm/core/fetcher/makeRequest.mjs +30 -13
- package/dist/esm/core/fetcher/requestWithRetries.mjs +3 -12
- package/dist/esm/core/fetcher/signals.d.mts +1 -7
- package/dist/esm/core/fetcher/signals.mjs +0 -12
- package/dist/esm/core/headers.d.mts +2 -3
- package/dist/esm/core/headers.mjs +6 -4
- package/dist/esm/core/index.d.mts +3 -2
- package/dist/esm/core/index.mjs +3 -2
- package/dist/esm/core/logging/exports.d.mts +18 -0
- package/dist/esm/core/logging/exports.mjs +9 -0
- package/dist/esm/core/logging/index.d.mts +1 -0
- package/dist/esm/core/logging/index.mjs +1 -0
- package/dist/esm/core/logging/logger.d.mts +126 -0
- package/dist/esm/core/logging/logger.mjs +138 -0
- package/dist/esm/core/runtime/runtime.mjs +17 -15
- package/dist/esm/core/url/encodePathParam.d.mts +1 -0
- package/dist/esm/core/url/encodePathParam.mjs +18 -0
- package/dist/esm/core/url/index.d.mts +1 -0
- package/dist/esm/core/url/index.mjs +1 -0
- package/dist/esm/core/url/join.mjs +3 -4
- package/dist/esm/core/websocket/exports.d.mts +8 -0
- package/dist/esm/core/websocket/exports.mjs +1 -0
- package/dist/esm/core/websocket/ws.d.mts +14 -11
- package/dist/esm/core/websocket/ws.mjs +42 -29
- package/dist/esm/environments.d.mts +0 -3
- package/dist/esm/environments.mjs +1 -3
- package/dist/esm/errors/PhonicError.d.mts +1 -4
- package/dist/esm/errors/PhonicError.mjs +7 -5
- package/dist/esm/errors/PhonicTimeoutError.d.mts +0 -3
- package/dist/esm/errors/PhonicTimeoutError.mjs +6 -4
- package/dist/esm/errors/handleNonStatusCodeError.d.mts +2 -0
- package/dist/esm/errors/handleNonStatusCodeError.mjs +29 -0
- package/dist/esm/exports.d.mts +1 -0
- package/dist/esm/exports.mjs +1 -0
- package/dist/esm/index.d.mts +4 -2
- package/dist/esm/index.mjs +2 -1
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +92 -8
- package/reference.md +309 -325
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
* This file was auto-generated by Fern from our API Definition.
|
|
4
|
-
*/
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
5
3
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
4
|
if (k2 === undefined) k2 = k;
|
|
7
5
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -56,21 +54,23 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
56
54
|
return t;
|
|
57
55
|
};
|
|
58
56
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
59
|
-
exports.
|
|
60
|
-
const
|
|
61
|
-
const core = __importStar(require("../../../../core/index.js"));
|
|
62
|
-
const Phonic = __importStar(require("../../../index.js"));
|
|
57
|
+
exports.AgentsClient = void 0;
|
|
58
|
+
const BaseClient_js_1 = require("../../../../BaseClient.js");
|
|
63
59
|
const headers_js_1 = require("../../../../core/headers.js");
|
|
60
|
+
const core = __importStar(require("../../../../core/index.js"));
|
|
61
|
+
const environments = __importStar(require("../../../../environments.js"));
|
|
62
|
+
const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatusCodeError.js");
|
|
64
63
|
const errors = __importStar(require("../../../../errors/index.js"));
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
64
|
+
const Phonic = __importStar(require("../../../index.js"));
|
|
65
|
+
class AgentsClient {
|
|
66
|
+
constructor(options = {}) {
|
|
67
|
+
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
68
68
|
}
|
|
69
69
|
/**
|
|
70
70
|
* Returns all agents in a project.
|
|
71
71
|
*
|
|
72
72
|
* @param {Phonic.AgentsListRequest} request
|
|
73
|
-
* @param {
|
|
73
|
+
* @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
74
74
|
*
|
|
75
75
|
* @throws {@link Phonic.NotFoundError}
|
|
76
76
|
* @throws {@link Phonic.InternalServerError}
|
|
@@ -83,22 +83,24 @@ class Agents {
|
|
|
83
83
|
}
|
|
84
84
|
__list() {
|
|
85
85
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
86
|
-
var _a, _b, _c, _d;
|
|
86
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
87
87
|
const { project } = request;
|
|
88
|
-
const _queryParams = {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
88
|
+
const _queryParams = {
|
|
89
|
+
project,
|
|
90
|
+
};
|
|
91
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
92
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
93
93
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
94
94
|
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)
|
|
95
95
|
.base, "agents"),
|
|
96
96
|
method: "GET",
|
|
97
97
|
headers: _headers,
|
|
98
98
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
99
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds)
|
|
100
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
99
|
+
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,
|
|
100
|
+
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,
|
|
101
101
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
102
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
103
|
+
logging: this._options.logging,
|
|
102
104
|
});
|
|
103
105
|
if (_response.ok) {
|
|
104
106
|
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
@@ -117,28 +119,14 @@ class Agents {
|
|
|
117
119
|
});
|
|
118
120
|
}
|
|
119
121
|
}
|
|
120
|
-
|
|
121
|
-
case "non-json":
|
|
122
|
-
throw new errors.PhonicError({
|
|
123
|
-
statusCode: _response.error.statusCode,
|
|
124
|
-
body: _response.error.rawBody,
|
|
125
|
-
rawResponse: _response.rawResponse,
|
|
126
|
-
});
|
|
127
|
-
case "timeout":
|
|
128
|
-
throw new errors.PhonicTimeoutError("Timeout exceeded when calling GET /agents.");
|
|
129
|
-
case "unknown":
|
|
130
|
-
throw new errors.PhonicError({
|
|
131
|
-
message: _response.error.errorMessage,
|
|
132
|
-
rawResponse: _response.rawResponse,
|
|
133
|
-
});
|
|
134
|
-
}
|
|
122
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/agents");
|
|
135
123
|
});
|
|
136
124
|
}
|
|
137
125
|
/**
|
|
138
126
|
* Creates a new agent in a project.
|
|
139
127
|
*
|
|
140
128
|
* @param {Phonic.AgentsCreateRequest} request
|
|
141
|
-
* @param {
|
|
129
|
+
* @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
142
130
|
*
|
|
143
131
|
* @throws {@link Phonic.BadRequestError}
|
|
144
132
|
* @throws {@link Phonic.UnauthorizedError}
|
|
@@ -185,13 +173,13 @@ class Agents {
|
|
|
185
173
|
}
|
|
186
174
|
__create(request, requestOptions) {
|
|
187
175
|
return __awaiter(this, void 0, void 0, function* () {
|
|
188
|
-
var _a, _b, _c, _d;
|
|
176
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
189
177
|
const { project } = request, _body = __rest(request, ["project"]);
|
|
190
|
-
const _queryParams = {
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
178
|
+
const _queryParams = {
|
|
179
|
+
project,
|
|
180
|
+
};
|
|
181
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
182
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
195
183
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
196
184
|
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)
|
|
197
185
|
.base, "agents"),
|
|
@@ -201,9 +189,11 @@ class Agents {
|
|
|
201
189
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
202
190
|
requestType: "json",
|
|
203
191
|
body: _body,
|
|
204
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds)
|
|
205
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
192
|
+
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,
|
|
193
|
+
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,
|
|
206
194
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
195
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
196
|
+
logging: this._options.logging,
|
|
207
197
|
});
|
|
208
198
|
if (_response.ok) {
|
|
209
199
|
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
@@ -226,28 +216,14 @@ class Agents {
|
|
|
226
216
|
});
|
|
227
217
|
}
|
|
228
218
|
}
|
|
229
|
-
|
|
230
|
-
case "non-json":
|
|
231
|
-
throw new errors.PhonicError({
|
|
232
|
-
statusCode: _response.error.statusCode,
|
|
233
|
-
body: _response.error.rawBody,
|
|
234
|
-
rawResponse: _response.rawResponse,
|
|
235
|
-
});
|
|
236
|
-
case "timeout":
|
|
237
|
-
throw new errors.PhonicTimeoutError("Timeout exceeded when calling POST /agents.");
|
|
238
|
-
case "unknown":
|
|
239
|
-
throw new errors.PhonicError({
|
|
240
|
-
message: _response.error.errorMessage,
|
|
241
|
-
rawResponse: _response.rawResponse,
|
|
242
|
-
});
|
|
243
|
-
}
|
|
219
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/agents");
|
|
244
220
|
});
|
|
245
221
|
}
|
|
246
222
|
/**
|
|
247
223
|
* Upserts an agent by name. If an agent with the same name already exists, it will be updated. Otherwise, it will be created.
|
|
248
224
|
*
|
|
249
225
|
* @param {Phonic.UpsertAgentRequest} request
|
|
250
|
-
* @param {
|
|
226
|
+
* @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
251
227
|
*
|
|
252
228
|
* @throws {@link Phonic.BadRequestError}
|
|
253
229
|
* @throws {@link Phonic.NotFoundError}
|
|
@@ -292,13 +268,13 @@ class Agents {
|
|
|
292
268
|
}
|
|
293
269
|
__upsert(request, requestOptions) {
|
|
294
270
|
return __awaiter(this, void 0, void 0, function* () {
|
|
295
|
-
var _a, _b, _c, _d;
|
|
271
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
296
272
|
const { project } = request, _body = __rest(request, ["project"]);
|
|
297
|
-
const _queryParams = {
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
273
|
+
const _queryParams = {
|
|
274
|
+
project,
|
|
275
|
+
};
|
|
276
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
277
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
302
278
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
303
279
|
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)
|
|
304
280
|
.base, "agents/upsert"),
|
|
@@ -308,9 +284,11 @@ class Agents {
|
|
|
308
284
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
309
285
|
requestType: "json",
|
|
310
286
|
body: _body,
|
|
311
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds)
|
|
312
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
287
|
+
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,
|
|
288
|
+
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,
|
|
313
289
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
290
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
291
|
+
logging: this._options.logging,
|
|
314
292
|
});
|
|
315
293
|
if (_response.ok) {
|
|
316
294
|
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
@@ -329,21 +307,7 @@ class Agents {
|
|
|
329
307
|
});
|
|
330
308
|
}
|
|
331
309
|
}
|
|
332
|
-
|
|
333
|
-
case "non-json":
|
|
334
|
-
throw new errors.PhonicError({
|
|
335
|
-
statusCode: _response.error.statusCode,
|
|
336
|
-
body: _response.error.rawBody,
|
|
337
|
-
rawResponse: _response.rawResponse,
|
|
338
|
-
});
|
|
339
|
-
case "timeout":
|
|
340
|
-
throw new errors.PhonicTimeoutError("Timeout exceeded when calling PUT /agents/upsert.");
|
|
341
|
-
case "unknown":
|
|
342
|
-
throw new errors.PhonicError({
|
|
343
|
-
message: _response.error.errorMessage,
|
|
344
|
-
rawResponse: _response.rawResponse,
|
|
345
|
-
});
|
|
346
|
-
}
|
|
310
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PUT", "/agents/upsert");
|
|
347
311
|
});
|
|
348
312
|
}
|
|
349
313
|
/**
|
|
@@ -351,7 +315,7 @@ class Agents {
|
|
|
351
315
|
*
|
|
352
316
|
* @param {string} nameOrId - The name or the ID of the agent to get.
|
|
353
317
|
* @param {Phonic.AgentsGetRequest} request
|
|
354
|
-
* @param {
|
|
318
|
+
* @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
355
319
|
*
|
|
356
320
|
* @throws {@link Phonic.ForbiddenError}
|
|
357
321
|
* @throws {@link Phonic.NotFoundError}
|
|
@@ -366,22 +330,24 @@ class Agents {
|
|
|
366
330
|
}
|
|
367
331
|
__get(nameOrId_1) {
|
|
368
332
|
return __awaiter(this, arguments, void 0, function* (nameOrId, request = {}, requestOptions) {
|
|
369
|
-
var _a, _b, _c, _d;
|
|
333
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
370
334
|
const { project } = request;
|
|
371
|
-
const _queryParams = {
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
335
|
+
const _queryParams = {
|
|
336
|
+
project,
|
|
337
|
+
};
|
|
338
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
339
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
376
340
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
377
341
|
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)
|
|
378
|
-
.base, `agents/${
|
|
342
|
+
.base, `agents/${core.url.encodePathParam(nameOrId)}`),
|
|
379
343
|
method: "GET",
|
|
380
344
|
headers: _headers,
|
|
381
345
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
382
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds)
|
|
383
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
346
|
+
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,
|
|
347
|
+
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,
|
|
384
348
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
349
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
350
|
+
logging: this._options.logging,
|
|
385
351
|
});
|
|
386
352
|
if (_response.ok) {
|
|
387
353
|
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
@@ -400,21 +366,7 @@ class Agents {
|
|
|
400
366
|
});
|
|
401
367
|
}
|
|
402
368
|
}
|
|
403
|
-
|
|
404
|
-
case "non-json":
|
|
405
|
-
throw new errors.PhonicError({
|
|
406
|
-
statusCode: _response.error.statusCode,
|
|
407
|
-
body: _response.error.rawBody,
|
|
408
|
-
rawResponse: _response.rawResponse,
|
|
409
|
-
});
|
|
410
|
-
case "timeout":
|
|
411
|
-
throw new errors.PhonicTimeoutError("Timeout exceeded when calling GET /agents/{nameOrId}.");
|
|
412
|
-
case "unknown":
|
|
413
|
-
throw new errors.PhonicError({
|
|
414
|
-
message: _response.error.errorMessage,
|
|
415
|
-
rawResponse: _response.rawResponse,
|
|
416
|
-
});
|
|
417
|
-
}
|
|
369
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/agents/{nameOrId}");
|
|
418
370
|
});
|
|
419
371
|
}
|
|
420
372
|
/**
|
|
@@ -422,7 +374,7 @@ class Agents {
|
|
|
422
374
|
*
|
|
423
375
|
* @param {string} nameOrId - The name or the ID of the agent to delete.
|
|
424
376
|
* @param {Phonic.AgentsDeleteRequest} request
|
|
425
|
-
* @param {
|
|
377
|
+
* @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
426
378
|
*
|
|
427
379
|
* @throws {@link Phonic.ForbiddenError}
|
|
428
380
|
* @throws {@link Phonic.NotFoundError}
|
|
@@ -437,22 +389,24 @@ class Agents {
|
|
|
437
389
|
}
|
|
438
390
|
__delete(nameOrId_1) {
|
|
439
391
|
return __awaiter(this, arguments, void 0, function* (nameOrId, request = {}, requestOptions) {
|
|
440
|
-
var _a, _b, _c, _d;
|
|
392
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
441
393
|
const { project } = request;
|
|
442
|
-
const _queryParams = {
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
394
|
+
const _queryParams = {
|
|
395
|
+
project,
|
|
396
|
+
};
|
|
397
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
398
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
447
399
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
448
400
|
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)
|
|
449
|
-
.base, `agents/${
|
|
401
|
+
.base, `agents/${core.url.encodePathParam(nameOrId)}`),
|
|
450
402
|
method: "DELETE",
|
|
451
403
|
headers: _headers,
|
|
452
404
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
453
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds)
|
|
454
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
405
|
+
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,
|
|
406
|
+
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,
|
|
455
407
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
408
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
409
|
+
logging: this._options.logging,
|
|
456
410
|
});
|
|
457
411
|
if (_response.ok) {
|
|
458
412
|
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
@@ -471,21 +425,7 @@ class Agents {
|
|
|
471
425
|
});
|
|
472
426
|
}
|
|
473
427
|
}
|
|
474
|
-
|
|
475
|
-
case "non-json":
|
|
476
|
-
throw new errors.PhonicError({
|
|
477
|
-
statusCode: _response.error.statusCode,
|
|
478
|
-
body: _response.error.rawBody,
|
|
479
|
-
rawResponse: _response.rawResponse,
|
|
480
|
-
});
|
|
481
|
-
case "timeout":
|
|
482
|
-
throw new errors.PhonicTimeoutError("Timeout exceeded when calling DELETE /agents/{nameOrId}.");
|
|
483
|
-
case "unknown":
|
|
484
|
-
throw new errors.PhonicError({
|
|
485
|
-
message: _response.error.errorMessage,
|
|
486
|
-
rawResponse: _response.rawResponse,
|
|
487
|
-
});
|
|
488
|
-
}
|
|
428
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/agents/{nameOrId}");
|
|
489
429
|
});
|
|
490
430
|
}
|
|
491
431
|
/**
|
|
@@ -493,7 +433,7 @@ class Agents {
|
|
|
493
433
|
*
|
|
494
434
|
* @param {string} nameOrId - The name or the ID of the agent to update.
|
|
495
435
|
* @param {Phonic.UpdateAgentRequest} request
|
|
496
|
-
* @param {
|
|
436
|
+
* @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
497
437
|
*
|
|
498
438
|
* @throws {@link Phonic.BadRequestError}
|
|
499
439
|
* @throws {@link Phonic.ForbiddenError}
|
|
@@ -539,25 +479,27 @@ class Agents {
|
|
|
539
479
|
}
|
|
540
480
|
__update(nameOrId_1) {
|
|
541
481
|
return __awaiter(this, arguments, void 0, function* (nameOrId, request = {}, requestOptions) {
|
|
542
|
-
var _a, _b, _c, _d;
|
|
482
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
543
483
|
const { project } = request, _body = __rest(request, ["project"]);
|
|
544
|
-
const _queryParams = {
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
484
|
+
const _queryParams = {
|
|
485
|
+
project,
|
|
486
|
+
};
|
|
487
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
488
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
549
489
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
550
490
|
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)
|
|
551
|
-
.base, `agents/${
|
|
491
|
+
.base, `agents/${core.url.encodePathParam(nameOrId)}`),
|
|
552
492
|
method: "PATCH",
|
|
553
493
|
headers: _headers,
|
|
554
494
|
contentType: "application/json",
|
|
555
495
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
556
496
|
requestType: "json",
|
|
557
497
|
body: _body,
|
|
558
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds)
|
|
559
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
498
|
+
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,
|
|
499
|
+
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,
|
|
560
500
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
501
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
502
|
+
logging: this._options.logging,
|
|
561
503
|
});
|
|
562
504
|
if (_response.ok) {
|
|
563
505
|
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
@@ -578,21 +520,7 @@ class Agents {
|
|
|
578
520
|
});
|
|
579
521
|
}
|
|
580
522
|
}
|
|
581
|
-
|
|
582
|
-
case "non-json":
|
|
583
|
-
throw new errors.PhonicError({
|
|
584
|
-
statusCode: _response.error.statusCode,
|
|
585
|
-
body: _response.error.rawBody,
|
|
586
|
-
rawResponse: _response.rawResponse,
|
|
587
|
-
});
|
|
588
|
-
case "timeout":
|
|
589
|
-
throw new errors.PhonicTimeoutError("Timeout exceeded when calling PATCH /agents/{nameOrId}.");
|
|
590
|
-
case "unknown":
|
|
591
|
-
throw new errors.PhonicError({
|
|
592
|
-
message: _response.error.errorMessage,
|
|
593
|
-
rawResponse: _response.rawResponse,
|
|
594
|
-
});
|
|
595
|
-
}
|
|
523
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PATCH", "/agents/{nameOrId}");
|
|
596
524
|
});
|
|
597
525
|
}
|
|
598
526
|
/**
|
|
@@ -600,7 +528,7 @@ class Agents {
|
|
|
600
528
|
*
|
|
601
529
|
* @param {string} nameOrId - The name or the ID of the agent.
|
|
602
530
|
* @param {Phonic.AgentsAddCustomPhoneNumberRequest} request
|
|
603
|
-
* @param {
|
|
531
|
+
* @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
604
532
|
*
|
|
605
533
|
* @throws {@link Phonic.BadRequestError}
|
|
606
534
|
* @throws {@link Phonic.UnauthorizedError}
|
|
@@ -626,30 +554,31 @@ class Agents {
|
|
|
626
554
|
}
|
|
627
555
|
__addCustomPhoneNumber(nameOrId, request, requestOptions) {
|
|
628
556
|
return __awaiter(this, void 0, void 0, function* () {
|
|
629
|
-
var _a, _b, _c, _d;
|
|
557
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
630
558
|
const { project, "X-Sip-Address": sipAddress, "X-Sip-Auth-Username": sipAuthUsername, "X-Sip-Auth-Password": sipAuthPassword } = request, _body = __rest(request, ["project", "X-Sip-Address", "X-Sip-Auth-Username", "X-Sip-Auth-Password"]);
|
|
631
|
-
const _queryParams = {
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
"X-Sip-
|
|
638
|
-
"X-Sip-Auth-
|
|
639
|
-
"X-Sip-Auth-Password": sipAuthPassword != null ? sipAuthPassword : undefined,
|
|
559
|
+
const _queryParams = {
|
|
560
|
+
project,
|
|
561
|
+
};
|
|
562
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
563
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
564
|
+
"X-Sip-Address": sipAddress,
|
|
565
|
+
"X-Sip-Auth-Username": sipAuthUsername,
|
|
566
|
+
"X-Sip-Auth-Password": sipAuthPassword,
|
|
640
567
|
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
641
568
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
642
569
|
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)
|
|
643
|
-
.base, `agents/${
|
|
570
|
+
.base, `agents/${core.url.encodePathParam(nameOrId)}/custom-phone-numbers`),
|
|
644
571
|
method: "POST",
|
|
645
572
|
headers: _headers,
|
|
646
573
|
contentType: "application/json",
|
|
647
574
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
648
575
|
requestType: "json",
|
|
649
576
|
body: _body,
|
|
650
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds)
|
|
651
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
577
|
+
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,
|
|
578
|
+
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,
|
|
652
579
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
580
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
581
|
+
logging: this._options.logging,
|
|
653
582
|
});
|
|
654
583
|
if (_response.ok) {
|
|
655
584
|
return {
|
|
@@ -677,21 +606,7 @@ class Agents {
|
|
|
677
606
|
});
|
|
678
607
|
}
|
|
679
608
|
}
|
|
680
|
-
|
|
681
|
-
case "non-json":
|
|
682
|
-
throw new errors.PhonicError({
|
|
683
|
-
statusCode: _response.error.statusCode,
|
|
684
|
-
body: _response.error.rawBody,
|
|
685
|
-
rawResponse: _response.rawResponse,
|
|
686
|
-
});
|
|
687
|
-
case "timeout":
|
|
688
|
-
throw new errors.PhonicTimeoutError("Timeout exceeded when calling POST /agents/{nameOrId}/custom-phone-numbers.");
|
|
689
|
-
case "unknown":
|
|
690
|
-
throw new errors.PhonicError({
|
|
691
|
-
message: _response.error.errorMessage,
|
|
692
|
-
rawResponse: _response.rawResponse,
|
|
693
|
-
});
|
|
694
|
-
}
|
|
609
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/agents/{nameOrId}/custom-phone-numbers");
|
|
695
610
|
});
|
|
696
611
|
}
|
|
697
612
|
/**
|
|
@@ -699,7 +614,7 @@ class Agents {
|
|
|
699
614
|
*
|
|
700
615
|
* @param {string} nameOrId - The name or the ID of the agent.
|
|
701
616
|
* @param {Phonic.AgentsDeleteCustomPhoneNumberRequest} request
|
|
702
|
-
* @param {
|
|
617
|
+
* @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
703
618
|
*
|
|
704
619
|
* @throws {@link Phonic.BadRequestError}
|
|
705
620
|
* @throws {@link Phonic.UnauthorizedError}
|
|
@@ -718,25 +633,27 @@ class Agents {
|
|
|
718
633
|
}
|
|
719
634
|
__deleteCustomPhoneNumber(nameOrId, request, requestOptions) {
|
|
720
635
|
return __awaiter(this, void 0, void 0, function* () {
|
|
721
|
-
var _a, _b, _c, _d;
|
|
636
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
722
637
|
const { project } = request, _body = __rest(request, ["project"]);
|
|
723
|
-
const _queryParams = {
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
638
|
+
const _queryParams = {
|
|
639
|
+
project,
|
|
640
|
+
};
|
|
641
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
642
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
728
643
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
729
644
|
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)
|
|
730
|
-
.base, `agents/${
|
|
645
|
+
.base, `agents/${core.url.encodePathParam(nameOrId)}/custom-phone-numbers`),
|
|
731
646
|
method: "DELETE",
|
|
732
647
|
headers: _headers,
|
|
733
648
|
contentType: "application/json",
|
|
734
649
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
735
650
|
requestType: "json",
|
|
736
651
|
body: _body,
|
|
737
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds)
|
|
738
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
652
|
+
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,
|
|
653
|
+
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,
|
|
739
654
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
655
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
656
|
+
logging: this._options.logging,
|
|
740
657
|
});
|
|
741
658
|
if (_response.ok) {
|
|
742
659
|
return {
|
|
@@ -764,21 +681,7 @@ class Agents {
|
|
|
764
681
|
});
|
|
765
682
|
}
|
|
766
683
|
}
|
|
767
|
-
|
|
768
|
-
case "non-json":
|
|
769
|
-
throw new errors.PhonicError({
|
|
770
|
-
statusCode: _response.error.statusCode,
|
|
771
|
-
body: _response.error.rawBody,
|
|
772
|
-
rawResponse: _response.rawResponse,
|
|
773
|
-
});
|
|
774
|
-
case "timeout":
|
|
775
|
-
throw new errors.PhonicTimeoutError("Timeout exceeded when calling DELETE /agents/{nameOrId}/custom-phone-numbers.");
|
|
776
|
-
case "unknown":
|
|
777
|
-
throw new errors.PhonicError({
|
|
778
|
-
message: _response.error.errorMessage,
|
|
779
|
-
rawResponse: _response.rawResponse,
|
|
780
|
-
});
|
|
781
|
-
}
|
|
684
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/agents/{nameOrId}/custom-phone-numbers");
|
|
782
685
|
});
|
|
783
686
|
}
|
|
784
687
|
/**
|
|
@@ -786,7 +689,7 @@ class Agents {
|
|
|
786
689
|
*
|
|
787
690
|
* @param {string} nameOrId - The name or the ID of the agent.
|
|
788
691
|
* @param {Phonic.AgentsUpdatePhoneNumberRequest} request
|
|
789
|
-
* @param {
|
|
692
|
+
* @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
790
693
|
*
|
|
791
694
|
* @throws {@link Phonic.BadRequestError}
|
|
792
695
|
* @throws {@link Phonic.UnauthorizedError}
|
|
@@ -812,25 +715,27 @@ class Agents {
|
|
|
812
715
|
}
|
|
813
716
|
__updatePhoneNumber(nameOrId, request, requestOptions) {
|
|
814
717
|
return __awaiter(this, void 0, void 0, function* () {
|
|
815
|
-
var _a, _b, _c, _d;
|
|
718
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
816
719
|
const { project } = request, _body = __rest(request, ["project"]);
|
|
817
|
-
const _queryParams = {
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
720
|
+
const _queryParams = {
|
|
721
|
+
project,
|
|
722
|
+
};
|
|
723
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
724
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
822
725
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
823
726
|
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)
|
|
824
|
-
.base, `agents/${
|
|
727
|
+
.base, `agents/${core.url.encodePathParam(nameOrId)}/phone-numbers`),
|
|
825
728
|
method: "PATCH",
|
|
826
729
|
headers: _headers,
|
|
827
730
|
contentType: "application/json",
|
|
828
731
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
829
732
|
requestType: "json",
|
|
830
733
|
body: _body,
|
|
831
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds)
|
|
832
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
734
|
+
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,
|
|
735
|
+
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,
|
|
833
736
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
737
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
738
|
+
logging: this._options.logging,
|
|
834
739
|
});
|
|
835
740
|
if (_response.ok) {
|
|
836
741
|
return {
|
|
@@ -858,34 +763,8 @@ class Agents {
|
|
|
858
763
|
});
|
|
859
764
|
}
|
|
860
765
|
}
|
|
861
|
-
|
|
862
|
-
case "non-json":
|
|
863
|
-
throw new errors.PhonicError({
|
|
864
|
-
statusCode: _response.error.statusCode,
|
|
865
|
-
body: _response.error.rawBody,
|
|
866
|
-
rawResponse: _response.rawResponse,
|
|
867
|
-
});
|
|
868
|
-
case "timeout":
|
|
869
|
-
throw new errors.PhonicTimeoutError("Timeout exceeded when calling PATCH /agents/{nameOrId}/phone-numbers.");
|
|
870
|
-
case "unknown":
|
|
871
|
-
throw new errors.PhonicError({
|
|
872
|
-
message: _response.error.errorMessage,
|
|
873
|
-
rawResponse: _response.rawResponse,
|
|
874
|
-
});
|
|
875
|
-
}
|
|
876
|
-
});
|
|
877
|
-
}
|
|
878
|
-
_getAuthorizationHeader() {
|
|
879
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
880
|
-
var _a;
|
|
881
|
-
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"];
|
|
882
|
-
if (bearer == null) {
|
|
883
|
-
throw new errors.PhonicError({
|
|
884
|
-
message: "Please specify a bearer by either passing it in to the constructor or initializing a PHONIC_API_KEY environment variable",
|
|
885
|
-
});
|
|
886
|
-
}
|
|
887
|
-
return `Bearer ${bearer}`;
|
|
766
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PATCH", "/agents/{nameOrId}/phone-numbers");
|
|
888
767
|
});
|
|
889
768
|
}
|
|
890
769
|
}
|
|
891
|
-
exports.
|
|
770
|
+
exports.AgentsClient = AgentsClient;
|