phonic 0.31.2 → 0.31.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +105 -16
- 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 +321 -329
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as logger from "./logger.mjs";
|
|
2
|
+
export var logging;
|
|
3
|
+
(function (logging) {
|
|
4
|
+
logging.LogLevel = logger.LogLevel;
|
|
5
|
+
/**
|
|
6
|
+
* Console logger implementation that outputs to the console.
|
|
7
|
+
*/
|
|
8
|
+
logging.ConsoleLogger = logger.ConsoleLogger;
|
|
9
|
+
})(logging || (logging = {}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./logger.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./logger.mjs";
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
export declare const LogLevel: {
|
|
2
|
+
readonly Debug: "debug";
|
|
3
|
+
readonly Info: "info";
|
|
4
|
+
readonly Warn: "warn";
|
|
5
|
+
readonly Error: "error";
|
|
6
|
+
};
|
|
7
|
+
export type LogLevel = (typeof LogLevel)[keyof typeof LogLevel];
|
|
8
|
+
export interface ILogger {
|
|
9
|
+
/**
|
|
10
|
+
* Logs a debug message.
|
|
11
|
+
* @param message - The message to log
|
|
12
|
+
* @param args - Additional arguments to log
|
|
13
|
+
*/
|
|
14
|
+
debug(message: string, ...args: unknown[]): void;
|
|
15
|
+
/**
|
|
16
|
+
* Logs an info message.
|
|
17
|
+
* @param message - The message to log
|
|
18
|
+
* @param args - Additional arguments to log
|
|
19
|
+
*/
|
|
20
|
+
info(message: string, ...args: unknown[]): void;
|
|
21
|
+
/**
|
|
22
|
+
* Logs a warning message.
|
|
23
|
+
* @param message - The message to log
|
|
24
|
+
* @param args - Additional arguments to log
|
|
25
|
+
*/
|
|
26
|
+
warn(message: string, ...args: unknown[]): void;
|
|
27
|
+
/**
|
|
28
|
+
* Logs an error message.
|
|
29
|
+
* @param message - The message to log
|
|
30
|
+
* @param args - Additional arguments to log
|
|
31
|
+
*/
|
|
32
|
+
error(message: string, ...args: unknown[]): void;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Configuration for logger initialization.
|
|
36
|
+
*/
|
|
37
|
+
export interface LogConfig {
|
|
38
|
+
/**
|
|
39
|
+
* Minimum log level to output.
|
|
40
|
+
* @default LogLevel.Info
|
|
41
|
+
*/
|
|
42
|
+
level?: LogLevel;
|
|
43
|
+
/**
|
|
44
|
+
* Logger implementation to use.
|
|
45
|
+
* @default new ConsoleLogger()
|
|
46
|
+
*/
|
|
47
|
+
logger?: ILogger;
|
|
48
|
+
/**
|
|
49
|
+
* Whether logging should be silenced.
|
|
50
|
+
* @default true
|
|
51
|
+
*/
|
|
52
|
+
silent?: boolean;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Default console-based logger implementation.
|
|
56
|
+
*/
|
|
57
|
+
export declare class ConsoleLogger implements ILogger {
|
|
58
|
+
debug(message: string, ...args: unknown[]): void;
|
|
59
|
+
info(message: string, ...args: unknown[]): void;
|
|
60
|
+
warn(message: string, ...args: unknown[]): void;
|
|
61
|
+
error(message: string, ...args: unknown[]): void;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Logger class that provides level-based logging functionality.
|
|
65
|
+
*/
|
|
66
|
+
export declare class Logger {
|
|
67
|
+
private readonly level;
|
|
68
|
+
private readonly logger;
|
|
69
|
+
private readonly silent;
|
|
70
|
+
/**
|
|
71
|
+
* Creates a new logger instance.
|
|
72
|
+
* @param config - Logger configuration
|
|
73
|
+
*/
|
|
74
|
+
constructor(config: Required<LogConfig>);
|
|
75
|
+
/**
|
|
76
|
+
* Checks if a log level should be output based on configuration.
|
|
77
|
+
* @param level - The log level to check
|
|
78
|
+
* @returns True if the level should be logged
|
|
79
|
+
*/
|
|
80
|
+
shouldLog(level: LogLevel): boolean;
|
|
81
|
+
/**
|
|
82
|
+
* Checks if debug logging is enabled.
|
|
83
|
+
* @returns True if debug logs should be output
|
|
84
|
+
*/
|
|
85
|
+
isDebug(): boolean;
|
|
86
|
+
/**
|
|
87
|
+
* Logs a debug message if debug logging is enabled.
|
|
88
|
+
* @param message - The message to log
|
|
89
|
+
* @param args - Additional arguments to log
|
|
90
|
+
*/
|
|
91
|
+
debug(message: string, ...args: unknown[]): void;
|
|
92
|
+
/**
|
|
93
|
+
* Checks if info logging is enabled.
|
|
94
|
+
* @returns True if info logs should be output
|
|
95
|
+
*/
|
|
96
|
+
isInfo(): boolean;
|
|
97
|
+
/**
|
|
98
|
+
* Logs an info message if info logging is enabled.
|
|
99
|
+
* @param message - The message to log
|
|
100
|
+
* @param args - Additional arguments to log
|
|
101
|
+
*/
|
|
102
|
+
info(message: string, ...args: unknown[]): void;
|
|
103
|
+
/**
|
|
104
|
+
* Checks if warning logging is enabled.
|
|
105
|
+
* @returns True if warning logs should be output
|
|
106
|
+
*/
|
|
107
|
+
isWarn(): boolean;
|
|
108
|
+
/**
|
|
109
|
+
* Logs a warning message if warning logging is enabled.
|
|
110
|
+
* @param message - The message to log
|
|
111
|
+
* @param args - Additional arguments to log
|
|
112
|
+
*/
|
|
113
|
+
warn(message: string, ...args: unknown[]): void;
|
|
114
|
+
/**
|
|
115
|
+
* Checks if error logging is enabled.
|
|
116
|
+
* @returns True if error logs should be output
|
|
117
|
+
*/
|
|
118
|
+
isError(): boolean;
|
|
119
|
+
/**
|
|
120
|
+
* Logs an error message if error logging is enabled.
|
|
121
|
+
* @param message - The message to log
|
|
122
|
+
* @param args - Additional arguments to log
|
|
123
|
+
*/
|
|
124
|
+
error(message: string, ...args: unknown[]): void;
|
|
125
|
+
}
|
|
126
|
+
export declare function createLogger(config?: LogConfig | Logger): Logger;
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
export const LogLevel = {
|
|
2
|
+
Debug: "debug",
|
|
3
|
+
Info: "info",
|
|
4
|
+
Warn: "warn",
|
|
5
|
+
Error: "error",
|
|
6
|
+
};
|
|
7
|
+
const logLevelMap = {
|
|
8
|
+
[LogLevel.Debug]: 1,
|
|
9
|
+
[LogLevel.Info]: 2,
|
|
10
|
+
[LogLevel.Warn]: 3,
|
|
11
|
+
[LogLevel.Error]: 4,
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Default console-based logger implementation.
|
|
15
|
+
*/
|
|
16
|
+
export class ConsoleLogger {
|
|
17
|
+
debug(message, ...args) {
|
|
18
|
+
console.debug(message, ...args);
|
|
19
|
+
}
|
|
20
|
+
info(message, ...args) {
|
|
21
|
+
console.info(message, ...args);
|
|
22
|
+
}
|
|
23
|
+
warn(message, ...args) {
|
|
24
|
+
console.warn(message, ...args);
|
|
25
|
+
}
|
|
26
|
+
error(message, ...args) {
|
|
27
|
+
console.error(message, ...args);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Logger class that provides level-based logging functionality.
|
|
32
|
+
*/
|
|
33
|
+
export class Logger {
|
|
34
|
+
/**
|
|
35
|
+
* Creates a new logger instance.
|
|
36
|
+
* @param config - Logger configuration
|
|
37
|
+
*/
|
|
38
|
+
constructor(config) {
|
|
39
|
+
this.level = logLevelMap[config.level];
|
|
40
|
+
this.logger = config.logger;
|
|
41
|
+
this.silent = config.silent;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Checks if a log level should be output based on configuration.
|
|
45
|
+
* @param level - The log level to check
|
|
46
|
+
* @returns True if the level should be logged
|
|
47
|
+
*/
|
|
48
|
+
shouldLog(level) {
|
|
49
|
+
return !this.silent && this.level <= logLevelMap[level];
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Checks if debug logging is enabled.
|
|
53
|
+
* @returns True if debug logs should be output
|
|
54
|
+
*/
|
|
55
|
+
isDebug() {
|
|
56
|
+
return this.shouldLog(LogLevel.Debug);
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Logs a debug message if debug logging is enabled.
|
|
60
|
+
* @param message - The message to log
|
|
61
|
+
* @param args - Additional arguments to log
|
|
62
|
+
*/
|
|
63
|
+
debug(message, ...args) {
|
|
64
|
+
if (this.isDebug()) {
|
|
65
|
+
this.logger.debug(message, ...args);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Checks if info logging is enabled.
|
|
70
|
+
* @returns True if info logs should be output
|
|
71
|
+
*/
|
|
72
|
+
isInfo() {
|
|
73
|
+
return this.shouldLog(LogLevel.Info);
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Logs an info message if info logging is enabled.
|
|
77
|
+
* @param message - The message to log
|
|
78
|
+
* @param args - Additional arguments to log
|
|
79
|
+
*/
|
|
80
|
+
info(message, ...args) {
|
|
81
|
+
if (this.isInfo()) {
|
|
82
|
+
this.logger.info(message, ...args);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Checks if warning logging is enabled.
|
|
87
|
+
* @returns True if warning logs should be output
|
|
88
|
+
*/
|
|
89
|
+
isWarn() {
|
|
90
|
+
return this.shouldLog(LogLevel.Warn);
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Logs a warning message if warning logging is enabled.
|
|
94
|
+
* @param message - The message to log
|
|
95
|
+
* @param args - Additional arguments to log
|
|
96
|
+
*/
|
|
97
|
+
warn(message, ...args) {
|
|
98
|
+
if (this.isWarn()) {
|
|
99
|
+
this.logger.warn(message, ...args);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Checks if error logging is enabled.
|
|
104
|
+
* @returns True if error logs should be output
|
|
105
|
+
*/
|
|
106
|
+
isError() {
|
|
107
|
+
return this.shouldLog(LogLevel.Error);
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Logs an error message if error logging is enabled.
|
|
111
|
+
* @param message - The message to log
|
|
112
|
+
* @param args - Additional arguments to log
|
|
113
|
+
*/
|
|
114
|
+
error(message, ...args) {
|
|
115
|
+
if (this.isError()) {
|
|
116
|
+
this.logger.error(message, ...args);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
export function createLogger(config) {
|
|
121
|
+
var _a, _b, _c;
|
|
122
|
+
if (config == null) {
|
|
123
|
+
return defaultLogger;
|
|
124
|
+
}
|
|
125
|
+
if (config instanceof Logger) {
|
|
126
|
+
return config;
|
|
127
|
+
}
|
|
128
|
+
config = config !== null && config !== void 0 ? config : {};
|
|
129
|
+
(_a = config.level) !== null && _a !== void 0 ? _a : (config.level = LogLevel.Info);
|
|
130
|
+
(_b = config.logger) !== null && _b !== void 0 ? _b : (config.logger = new ConsoleLogger());
|
|
131
|
+
(_c = config.silent) !== null && _c !== void 0 ? _c : (config.silent = true);
|
|
132
|
+
return new Logger(config);
|
|
133
|
+
}
|
|
134
|
+
const defaultLogger = new Logger({
|
|
135
|
+
level: LogLevel.Info,
|
|
136
|
+
logger: new ConsoleLogger(),
|
|
137
|
+
silent: true,
|
|
138
|
+
});
|
|
@@ -68,23 +68,9 @@ function evaluateRuntime() {
|
|
|
68
68
|
version: Bun.version,
|
|
69
69
|
};
|
|
70
70
|
}
|
|
71
|
-
/**
|
|
72
|
-
* A constant that indicates whether the environment the code is running is Node.JS.
|
|
73
|
-
*/
|
|
74
|
-
const isNode = typeof process !== "undefined" &&
|
|
75
|
-
"version" in process &&
|
|
76
|
-
!!process.version &&
|
|
77
|
-
"versions" in process &&
|
|
78
|
-
!!((_e = process.versions) === null || _e === void 0 ? void 0 : _e.node);
|
|
79
|
-
if (isNode) {
|
|
80
|
-
return {
|
|
81
|
-
type: "node",
|
|
82
|
-
version: process.versions.node,
|
|
83
|
-
parsedVersion: Number(process.versions.node.split(".")[0]),
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
71
|
/**
|
|
87
72
|
* A constant that indicates whether the environment the code is running is in React-Native.
|
|
73
|
+
* This check should come before Node.js detection since React Native may have a process polyfill.
|
|
88
74
|
* https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Core/setUpNavigator.js
|
|
89
75
|
*/
|
|
90
76
|
const isReactNative = typeof navigator !== "undefined" && (navigator === null || navigator === void 0 ? void 0 : navigator.product) === "ReactNative";
|
|
@@ -93,6 +79,22 @@ function evaluateRuntime() {
|
|
|
93
79
|
type: "react-native",
|
|
94
80
|
};
|
|
95
81
|
}
|
|
82
|
+
/**
|
|
83
|
+
* A constant that indicates whether the environment the code is running is Node.JS.
|
|
84
|
+
*
|
|
85
|
+
* We assign `process` to a local variable first to avoid being flagged by
|
|
86
|
+
* bundlers that perform static analysis on `process.versions` (e.g. Next.js
|
|
87
|
+
* Edge Runtime warns about Node.js APIs even when they are guarded).
|
|
88
|
+
*/
|
|
89
|
+
const _process = typeof process !== "undefined" ? process : undefined;
|
|
90
|
+
const isNode = typeof _process !== "undefined" && typeof ((_e = _process.versions) === null || _e === void 0 ? void 0 : _e.node) === "string";
|
|
91
|
+
if (isNode) {
|
|
92
|
+
return {
|
|
93
|
+
type: "node",
|
|
94
|
+
version: _process.versions.node,
|
|
95
|
+
parsedVersion: Number(_process.versions.node.split(".")[0]),
|
|
96
|
+
};
|
|
97
|
+
}
|
|
96
98
|
return {
|
|
97
99
|
type: "unknown",
|
|
98
100
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function encodePathParam(param: unknown): string;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export function encodePathParam(param) {
|
|
2
|
+
if (param === null) {
|
|
3
|
+
return "null";
|
|
4
|
+
}
|
|
5
|
+
const typeofParam = typeof param;
|
|
6
|
+
switch (typeofParam) {
|
|
7
|
+
case "undefined":
|
|
8
|
+
return "undefined";
|
|
9
|
+
case "string":
|
|
10
|
+
case "number":
|
|
11
|
+
case "boolean":
|
|
12
|
+
break;
|
|
13
|
+
default:
|
|
14
|
+
param = String(param);
|
|
15
|
+
break;
|
|
16
|
+
}
|
|
17
|
+
return encodeURIComponent(param);
|
|
18
|
+
}
|
|
@@ -11,11 +11,10 @@ export function join(base, ...segments) {
|
|
|
11
11
|
url = new URL(base);
|
|
12
12
|
}
|
|
13
13
|
catch (_a) {
|
|
14
|
-
// Fallback to path joining if URL is malformed
|
|
15
14
|
return joinPath(base, ...segments);
|
|
16
15
|
}
|
|
17
16
|
const lastSegment = segments[segments.length - 1];
|
|
18
|
-
const shouldPreserveTrailingSlash = lastSegment
|
|
17
|
+
const shouldPreserveTrailingSlash = lastSegment === null || lastSegment === void 0 ? void 0 : lastSegment.endsWith("/");
|
|
19
18
|
for (const segment of segments) {
|
|
20
19
|
const cleanSegment = trimSlashes(segment);
|
|
21
20
|
if (cleanSegment) {
|
|
@@ -35,7 +34,7 @@ function joinPath(base, ...segments) {
|
|
|
35
34
|
}
|
|
36
35
|
let result = base;
|
|
37
36
|
const lastSegment = segments[segments.length - 1];
|
|
38
|
-
const shouldPreserveTrailingSlash = lastSegment
|
|
37
|
+
const shouldPreserveTrailingSlash = lastSegment === null || lastSegment === void 0 ? void 0 : lastSegment.endsWith("/");
|
|
39
38
|
for (const segment of segments) {
|
|
40
39
|
const cleanSegment = trimSlashes(segment);
|
|
41
40
|
if (cleanSegment) {
|
|
@@ -51,7 +50,7 @@ function joinPathSegments(left, right) {
|
|
|
51
50
|
if (left.endsWith("/")) {
|
|
52
51
|
return left + right;
|
|
53
52
|
}
|
|
54
|
-
return left
|
|
53
|
+
return `${left}/${right}`;
|
|
55
54
|
}
|
|
56
55
|
function trimSlashes(str) {
|
|
57
56
|
if (!str)
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type * as events from "./events.mjs";
|
|
2
|
+
import type * as ws from "./ws.mjs";
|
|
3
|
+
export type ReconnectingWebSocket = typeof ws.ReconnectingWebSocket;
|
|
4
|
+
export declare namespace ReconnectingWebSocket {
|
|
5
|
+
type Event = events.Event;
|
|
6
|
+
type CloseEvent = events.CloseEvent;
|
|
7
|
+
type ErrorEvent = events.ErrorEvent;
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -7,8 +7,9 @@ export declare namespace ReconnectingWebSocket {
|
|
|
7
7
|
url: string;
|
|
8
8
|
protocols?: string | string[];
|
|
9
9
|
options?: ReconnectingWebSocket.Options;
|
|
10
|
-
headers?: Record<string,
|
|
11
|
-
queryParameters?: Record<string,
|
|
10
|
+
headers?: Record<string, unknown>;
|
|
11
|
+
queryParameters?: Record<string, unknown>;
|
|
12
|
+
abortSignal?: AbortSignal;
|
|
12
13
|
}
|
|
13
14
|
type Options = {
|
|
14
15
|
WebSocket?: any;
|
|
@@ -47,15 +48,16 @@ export declare class ReconnectingWebSocket {
|
|
|
47
48
|
private readonly _options;
|
|
48
49
|
private readonly _headers?;
|
|
49
50
|
private readonly _queryParameters?;
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
static
|
|
53
|
-
static
|
|
54
|
-
static
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
51
|
+
private readonly _abortSignal?;
|
|
52
|
+
constructor({ url, protocols, options, headers, queryParameters, abortSignal }: ReconnectingWebSocket.Args);
|
|
53
|
+
static readonly CONNECTING = 0;
|
|
54
|
+
static readonly OPEN = 1;
|
|
55
|
+
static readonly CLOSING = 2;
|
|
56
|
+
static readonly CLOSED = 3;
|
|
57
|
+
readonly CONNECTING: typeof ReconnectingWebSocket.CONNECTING;
|
|
58
|
+
readonly OPEN: typeof ReconnectingWebSocket.OPEN;
|
|
59
|
+
readonly CLOSING: typeof ReconnectingWebSocket.CLOSING;
|
|
60
|
+
readonly CLOSED: typeof ReconnectingWebSocket.CLOSED;
|
|
59
61
|
get binaryType(): BinaryType;
|
|
60
62
|
set binaryType(value: BinaryType);
|
|
61
63
|
/**
|
|
@@ -133,6 +135,7 @@ export declare class ReconnectingWebSocket {
|
|
|
133
135
|
private _wait;
|
|
134
136
|
private _getNextUrl;
|
|
135
137
|
private _connect;
|
|
138
|
+
private _handleAbort;
|
|
136
139
|
private _handleTimeout;
|
|
137
140
|
private _disconnect;
|
|
138
141
|
private _acceptOpen;
|
|
@@ -3,7 +3,6 @@ import { RUNTIME } from "../runtime/index.mjs";
|
|
|
3
3
|
import { toQueryString } from "../url/qs.mjs";
|
|
4
4
|
import * as Events from "./events.mjs";
|
|
5
5
|
const getGlobalWebSocket = () => {
|
|
6
|
-
// Use Node.js 'ws' library for server-side runtimes since native WebSocket doesn't support headers
|
|
7
6
|
if (RUNTIME.type === "node" || RUNTIME.type === "bun" || RUNTIME.type === "deno") {
|
|
8
7
|
return NodeWebSocket;
|
|
9
8
|
}
|
|
@@ -29,7 +28,7 @@ const DEFAULT_OPTIONS = {
|
|
|
29
28
|
debug: false,
|
|
30
29
|
};
|
|
31
30
|
export class ReconnectingWebSocket {
|
|
32
|
-
constructor({ url, protocols, options, headers, queryParameters }) {
|
|
31
|
+
constructor({ url, protocols, options, headers, queryParameters, abortSignal }) {
|
|
33
32
|
this._listeners = {
|
|
34
33
|
error: [],
|
|
35
34
|
message: [],
|
|
@@ -42,6 +41,10 @@ export class ReconnectingWebSocket {
|
|
|
42
41
|
this._binaryType = "blob";
|
|
43
42
|
this._closeCalled = false;
|
|
44
43
|
this._messageQueue = [];
|
|
44
|
+
this.CONNECTING = ReconnectingWebSocket.CONNECTING;
|
|
45
|
+
this.OPEN = ReconnectingWebSocket.OPEN;
|
|
46
|
+
this.CLOSING = ReconnectingWebSocket.CLOSING;
|
|
47
|
+
this.CLOSED = ReconnectingWebSocket.CLOSED;
|
|
45
48
|
/**
|
|
46
49
|
* An event listener to be called when the WebSocket connection's readyState changes to CLOSED
|
|
47
50
|
*/
|
|
@@ -59,6 +62,25 @@ export class ReconnectingWebSocket {
|
|
|
59
62
|
* this indicates that the connection is ready to send and receive data
|
|
60
63
|
*/
|
|
61
64
|
this.onopen = null;
|
|
65
|
+
this._handleAbort = () => {
|
|
66
|
+
if (this._closeCalled) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
this._debug("abort signal fired");
|
|
70
|
+
this._shouldReconnect = false;
|
|
71
|
+
this._closeCalled = true;
|
|
72
|
+
this._clearTimeouts();
|
|
73
|
+
if (this._ws) {
|
|
74
|
+
this._removeListeners();
|
|
75
|
+
try {
|
|
76
|
+
this._ws.close(1000, "aborted");
|
|
77
|
+
this._handleClose(new Events.CloseEvent(1000, "aborted", this));
|
|
78
|
+
}
|
|
79
|
+
catch (_error) {
|
|
80
|
+
// ignore
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
};
|
|
62
84
|
this._handleOpen = (event) => {
|
|
63
85
|
this._debug("open event");
|
|
64
86
|
const { minUptime = DEFAULT_OPTIONS.minUptime } = this._options;
|
|
@@ -109,35 +131,15 @@ export class ReconnectingWebSocket {
|
|
|
109
131
|
this._options = options !== null && options !== void 0 ? options : DEFAULT_OPTIONS;
|
|
110
132
|
this._headers = headers;
|
|
111
133
|
this._queryParameters = queryParameters;
|
|
134
|
+
this._abortSignal = abortSignal;
|
|
135
|
+
if (this._abortSignal) {
|
|
136
|
+
this._abortSignal.addEventListener("abort", this._handleAbort, { once: true });
|
|
137
|
+
}
|
|
112
138
|
if (this._options.startClosed) {
|
|
113
139
|
this._shouldReconnect = false;
|
|
114
140
|
}
|
|
115
141
|
this._connect();
|
|
116
142
|
}
|
|
117
|
-
static get CONNECTING() {
|
|
118
|
-
return 0;
|
|
119
|
-
}
|
|
120
|
-
static get OPEN() {
|
|
121
|
-
return 1;
|
|
122
|
-
}
|
|
123
|
-
static get CLOSING() {
|
|
124
|
-
return 2;
|
|
125
|
-
}
|
|
126
|
-
static get CLOSED() {
|
|
127
|
-
return 3;
|
|
128
|
-
}
|
|
129
|
-
get CONNECTING() {
|
|
130
|
-
return ReconnectingWebSocket.CONNECTING;
|
|
131
|
-
}
|
|
132
|
-
get OPEN() {
|
|
133
|
-
return ReconnectingWebSocket.OPEN;
|
|
134
|
-
}
|
|
135
|
-
get CLOSING() {
|
|
136
|
-
return ReconnectingWebSocket.CLOSING;
|
|
137
|
-
}
|
|
138
|
-
get CLOSED() {
|
|
139
|
-
return ReconnectingWebSocket.CLOSED;
|
|
140
|
-
}
|
|
141
143
|
get binaryType() {
|
|
142
144
|
return this._ws ? this._ws.binaryType : this._binaryType;
|
|
143
145
|
}
|
|
@@ -295,7 +297,7 @@ export class ReconnectingWebSocket {
|
|
|
295
297
|
const { reconnectionDelayGrowFactor = DEFAULT_OPTIONS.reconnectionDelayGrowFactor, minReconnectionDelay = DEFAULT_OPTIONS.minReconnectionDelay, maxReconnectionDelay = DEFAULT_OPTIONS.maxReconnectionDelay, } = this._options;
|
|
296
298
|
let delay = 0;
|
|
297
299
|
if (this._retryCount > 0) {
|
|
298
|
-
delay = minReconnectionDelay * Math.pow(reconnectionDelayGrowFactor, this._retryCount - 1);
|
|
300
|
+
delay = minReconnectionDelay * Math.pow(reconnectionDelayGrowFactor, (this._retryCount - 1));
|
|
299
301
|
if (delay > maxReconnectionDelay) {
|
|
300
302
|
delay = maxReconnectionDelay;
|
|
301
303
|
}
|
|
@@ -325,9 +327,14 @@ export class ReconnectingWebSocket {
|
|
|
325
327
|
throw Error("Invalid URL");
|
|
326
328
|
}
|
|
327
329
|
_connect() {
|
|
330
|
+
var _a;
|
|
328
331
|
if (this._connectLock || !this._shouldReconnect) {
|
|
329
332
|
return;
|
|
330
333
|
}
|
|
334
|
+
if ((_a = this._abortSignal) === null || _a === void 0 ? void 0 : _a.aborted) {
|
|
335
|
+
this._debug("connect aborted");
|
|
336
|
+
return;
|
|
337
|
+
}
|
|
331
338
|
this._connectLock = true;
|
|
332
339
|
const { maxRetries = DEFAULT_OPTIONS.maxRetries, connectionTimeout = DEFAULT_OPTIONS.connectionTimeout, WebSocket = getGlobalWebSocket(), } = this._options;
|
|
333
340
|
if (this._retryCount >= maxRetries) {
|
|
@@ -343,7 +350,9 @@ export class ReconnectingWebSocket {
|
|
|
343
350
|
this._wait()
|
|
344
351
|
.then(() => this._getNextUrl(this._url))
|
|
345
352
|
.then((url) => {
|
|
346
|
-
|
|
353
|
+
var _a;
|
|
354
|
+
if (this._closeCalled || ((_a = this._abortSignal) === null || _a === void 0 ? void 0 : _a.aborted)) {
|
|
355
|
+
this._connectLock = false;
|
|
347
356
|
return;
|
|
348
357
|
}
|
|
349
358
|
const options = {};
|
|
@@ -377,7 +386,7 @@ export class ReconnectingWebSocket {
|
|
|
377
386
|
this._ws.close(code, reason);
|
|
378
387
|
this._handleClose(new Events.CloseEvent(code, reason, this));
|
|
379
388
|
}
|
|
380
|
-
catch (
|
|
389
|
+
catch (_error) {
|
|
381
390
|
// ignore
|
|
382
391
|
}
|
|
383
392
|
}
|
|
@@ -422,3 +431,7 @@ export class ReconnectingWebSocket {
|
|
|
422
431
|
clearTimeout(this._uptimeTimeout);
|
|
423
432
|
}
|
|
424
433
|
}
|
|
434
|
+
ReconnectingWebSocket.CONNECTING = 0;
|
|
435
|
+
ReconnectingWebSocket.OPEN = 1;
|
|
436
|
+
ReconnectingWebSocket.CLOSING = 2;
|
|
437
|
+
ReconnectingWebSocket.CLOSED = 3;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
-
*/
|
|
4
|
-
import * as core from "../core/index.mjs";
|
|
1
|
+
import type * as core from "../core/index.mjs";
|
|
5
2
|
export declare class PhonicError extends Error {
|
|
6
3
|
readonly statusCode?: number;
|
|
7
4
|
readonly body?: unknown;
|
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
-
*/
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
4
2
|
import { toJson } from "../core/json.mjs";
|
|
5
3
|
export class PhonicError extends Error {
|
|
6
4
|
constructor({ message, statusCode, body, rawResponse, }) {
|
|
7
5
|
super(buildMessage({ message, statusCode, body }));
|
|
8
|
-
Object.setPrototypeOf(this,
|
|
6
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
7
|
+
if (Error.captureStackTrace) {
|
|
8
|
+
Error.captureStackTrace(this, this.constructor);
|
|
9
|
+
}
|
|
10
|
+
this.name = this.constructor.name;
|
|
9
11
|
this.statusCode = statusCode;
|
|
10
12
|
this.body = body;
|
|
11
13
|
this.rawResponse = rawResponse;
|
|
12
14
|
}
|
|
13
15
|
}
|
|
14
16
|
function buildMessage({ message, statusCode, body, }) {
|
|
15
|
-
|
|
17
|
+
const lines = [];
|
|
16
18
|
if (message != null) {
|
|
17
19
|
lines.push(message);
|
|
18
20
|
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
-
*/
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
4
2
|
export class PhonicTimeoutError extends Error {
|
|
5
3
|
constructor(message) {
|
|
6
4
|
super(message);
|
|
7
|
-
Object.setPrototypeOf(this,
|
|
5
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
6
|
+
if (Error.captureStackTrace) {
|
|
7
|
+
Error.captureStackTrace(this, this.constructor);
|
|
8
|
+
}
|
|
9
|
+
this.name = this.constructor.name;
|
|
8
10
|
}
|
|
9
11
|
}
|