phonic 0.30.3 → 0.30.5
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 +22 -24
- package/package.json +1 -1
- package/reference.md +21 -23
- package/dist/cjs/Client.d.ts +0 -50
- package/dist/cjs/Client.js +0 -84
- package/dist/cjs/api/errors/BadRequestError.d.ts +0 -8
- package/dist/cjs/api/errors/BadRequestError.js +0 -52
- package/dist/cjs/api/errors/ConflictError.d.ts +0 -8
- package/dist/cjs/api/errors/ConflictError.js +0 -52
- package/dist/cjs/api/errors/ForbiddenError.d.ts +0 -8
- package/dist/cjs/api/errors/ForbiddenError.js +0 -52
- package/dist/cjs/api/errors/GatewayTimeoutError.d.ts +0 -9
- package/dist/cjs/api/errors/GatewayTimeoutError.js +0 -52
- package/dist/cjs/api/errors/InternalServerError.d.ts +0 -9
- package/dist/cjs/api/errors/InternalServerError.js +0 -52
- package/dist/cjs/api/errors/NotFoundError.d.ts +0 -8
- package/dist/cjs/api/errors/NotFoundError.js +0 -52
- package/dist/cjs/api/errors/UnauthorizedError.d.ts +0 -9
- package/dist/cjs/api/errors/UnauthorizedError.js +0 -52
- package/dist/cjs/api/errors/index.d.ts +0 -7
- package/dist/cjs/api/errors/index.js +0 -23
- package/dist/cjs/api/index.d.ts +0 -4
- package/dist/cjs/api/index.js +0 -20
- package/dist/cjs/api/resources/agents/client/Client.d.ts +0 -208
- package/dist/cjs/api/resources/agents/client/Client.js +0 -595
- package/dist/cjs/api/resources/agents/client/index.d.ts +0 -2
- package/dist/cjs/api/resources/agents/client/index.js +0 -17
- package/dist/cjs/api/resources/agents/client/requests/AgentsCreateRequest.d.ts +0 -41
- package/dist/cjs/api/resources/agents/client/requests/AgentsCreateRequest.js +0 -5
- package/dist/cjs/api/resources/agents/client/requests/AgentsDeleteRequest.d.ts +0 -13
- package/dist/cjs/api/resources/agents/client/requests/AgentsDeleteRequest.js +0 -5
- package/dist/cjs/api/resources/agents/client/requests/AgentsGetRequest.d.ts +0 -13
- package/dist/cjs/api/resources/agents/client/requests/AgentsGetRequest.js +0 -5
- package/dist/cjs/api/resources/agents/client/requests/AgentsListRequest.d.ts +0 -11
- package/dist/cjs/api/resources/agents/client/requests/AgentsListRequest.js +0 -5
- package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.d.ts +0 -102
- package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.js +0 -13
- package/dist/cjs/api/resources/agents/client/requests/UpsertAgentRequest.d.ts +0 -38
- package/dist/cjs/api/resources/agents/client/requests/UpsertAgentRequest.js +0 -5
- package/dist/cjs/api/resources/agents/client/requests/index.d.ts +0 -6
- package/dist/cjs/api/resources/agents/client/requests/index.js +0 -2
- package/dist/cjs/api/resources/agents/index.d.ts +0 -2
- package/dist/cjs/api/resources/agents/index.js +0 -18
- package/dist/cjs/api/resources/agents/types/AgentsCreateResponse.d.ts +0 -9
- package/dist/cjs/api/resources/agents/types/AgentsCreateResponse.js +0 -5
- package/dist/cjs/api/resources/agents/types/AgentsDeleteResponse.d.ts +0 -7
- package/dist/cjs/api/resources/agents/types/AgentsDeleteResponse.js +0 -5
- package/dist/cjs/api/resources/agents/types/AgentsGetResponse.d.ts +0 -7
- package/dist/cjs/api/resources/agents/types/AgentsGetResponse.js +0 -5
- package/dist/cjs/api/resources/agents/types/AgentsListResponse.d.ts +0 -7
- package/dist/cjs/api/resources/agents/types/AgentsListResponse.js +0 -5
- package/dist/cjs/api/resources/agents/types/AgentsUpdateResponse.d.ts +0 -7
- package/dist/cjs/api/resources/agents/types/AgentsUpdateResponse.js +0 -5
- package/dist/cjs/api/resources/agents/types/AgentsUpsertResponse.d.ts +0 -11
- package/dist/cjs/api/resources/agents/types/AgentsUpsertResponse.js +0 -5
- package/dist/cjs/api/resources/agents/types/index.d.ts +0 -6
- package/dist/cjs/api/resources/agents/types/index.js +0 -22
- package/dist/cjs/api/resources/conversations/client/Client.d.ts +0 -236
- package/dist/cjs/api/resources/conversations/client/Client.js +0 -895
- package/dist/cjs/api/resources/conversations/client/Socket.d.ts +0 -64
- package/dist/cjs/api/resources/conversations/client/Socket.js +0 -196
- package/dist/cjs/api/resources/conversations/client/index.d.ts +0 -2
- package/dist/cjs/api/resources/conversations/client/index.js +0 -17
- package/dist/cjs/api/resources/conversations/client/requests/ConversationsListRequest.d.ts +0 -30
- package/dist/cjs/api/resources/conversations/client/requests/ConversationsListRequest.js +0 -5
- package/dist/cjs/api/resources/conversations/client/requests/ConversationsSipOutboundCallRequest.d.ts +0 -29
- package/dist/cjs/api/resources/conversations/client/requests/ConversationsSipOutboundCallRequest.js +0 -5
- package/dist/cjs/api/resources/conversations/client/requests/EvaluateConversationRequest.d.ts +0 -13
- package/dist/cjs/api/resources/conversations/client/requests/EvaluateConversationRequest.js +0 -5
- package/dist/cjs/api/resources/conversations/client/requests/ExtractDataRequest.d.ts +0 -13
- package/dist/cjs/api/resources/conversations/client/requests/ExtractDataRequest.js +0 -5
- package/dist/cjs/api/resources/conversations/client/requests/OutboundCallRequest.d.ts +0 -30
- package/dist/cjs/api/resources/conversations/client/requests/OutboundCallRequest.js +0 -5
- package/dist/cjs/api/resources/conversations/client/requests/index.d.ts +0 -5
- package/dist/cjs/api/resources/conversations/client/requests/index.js +0 -2
- package/dist/cjs/api/resources/conversations/index.d.ts +0 -2
- package/dist/cjs/api/resources/conversations/index.js +0 -18
- package/dist/cjs/api/resources/conversations/types/ConversationsCancelResponse.d.ts +0 -7
- package/dist/cjs/api/resources/conversations/types/ConversationsCancelResponse.js +0 -5
- package/dist/cjs/api/resources/conversations/types/ConversationsExtractDataResponse.d.ts +0 -7
- package/dist/cjs/api/resources/conversations/types/ConversationsExtractDataResponse.js +0 -5
- package/dist/cjs/api/resources/conversations/types/ConversationsGetAnalysisResponse.d.ts +0 -7
- package/dist/cjs/api/resources/conversations/types/ConversationsGetAnalysisResponse.js +0 -5
- package/dist/cjs/api/resources/conversations/types/ConversationsGetResponse.d.ts +0 -7
- package/dist/cjs/api/resources/conversations/types/ConversationsGetResponse.js +0 -5
- package/dist/cjs/api/resources/conversations/types/ConversationsListEvaluationsResponse.d.ts +0 -7
- package/dist/cjs/api/resources/conversations/types/ConversationsListEvaluationsResponse.js +0 -5
- package/dist/cjs/api/resources/conversations/types/ConversationsListExtractionsResponse.d.ts +0 -7
- package/dist/cjs/api/resources/conversations/types/ConversationsListExtractionsResponse.js +0 -5
- package/dist/cjs/api/resources/conversations/types/ConversationsListResponse.d.ts +0 -9
- package/dist/cjs/api/resources/conversations/types/ConversationsListResponse.js +0 -5
- package/dist/cjs/api/resources/conversations/types/ConversationsOutboundCallResponse.d.ts +0 -7
- package/dist/cjs/api/resources/conversations/types/ConversationsOutboundCallResponse.js +0 -5
- package/dist/cjs/api/resources/conversations/types/ConversationsSipOutboundCallResponse.d.ts +0 -7
- package/dist/cjs/api/resources/conversations/types/ConversationsSipOutboundCallResponse.js +0 -5
- package/dist/cjs/api/resources/conversations/types/index.d.ts +0 -9
- package/dist/cjs/api/resources/conversations/types/index.js +0 -25
- package/dist/cjs/api/resources/extractionSchemas/client/Client.d.ts +0 -142
- package/dist/cjs/api/resources/extractionSchemas/client/Client.js +0 -473
- package/dist/cjs/api/resources/extractionSchemas/client/index.d.ts +0 -2
- package/dist/cjs/api/resources/extractionSchemas/client/index.js +0 -17
- package/dist/cjs/api/resources/extractionSchemas/client/requests/CreateExtractionSchemaRequest.d.ts +0 -35
- package/dist/cjs/api/resources/extractionSchemas/client/requests/CreateExtractionSchemaRequest.js +0 -5
- package/dist/cjs/api/resources/extractionSchemas/client/requests/ExtractionSchemasDeleteRequest.d.ts +0 -13
- package/dist/cjs/api/resources/extractionSchemas/client/requests/ExtractionSchemasDeleteRequest.js +0 -5
- package/dist/cjs/api/resources/extractionSchemas/client/requests/ExtractionSchemasGetRequest.d.ts +0 -13
- package/dist/cjs/api/resources/extractionSchemas/client/requests/ExtractionSchemasGetRequest.js +0 -5
- package/dist/cjs/api/resources/extractionSchemas/client/requests/ExtractionSchemasListRequest.d.ts +0 -13
- package/dist/cjs/api/resources/extractionSchemas/client/requests/ExtractionSchemasListRequest.js +0 -5
- package/dist/cjs/api/resources/extractionSchemas/client/requests/UpdateExtractionSchemaRequest.d.ts +0 -31
- package/dist/cjs/api/resources/extractionSchemas/client/requests/UpdateExtractionSchemaRequest.js +0 -5
- package/dist/cjs/api/resources/extractionSchemas/client/requests/index.d.ts +0 -5
- package/dist/cjs/api/resources/extractionSchemas/client/requests/index.js +0 -2
- package/dist/cjs/api/resources/extractionSchemas/index.d.ts +0 -2
- package/dist/cjs/api/resources/extractionSchemas/index.js +0 -18
- package/dist/cjs/api/resources/extractionSchemas/types/ExtractionSchemasCreateResponse.d.ts +0 -9
- package/dist/cjs/api/resources/extractionSchemas/types/ExtractionSchemasCreateResponse.js +0 -5
- package/dist/cjs/api/resources/extractionSchemas/types/ExtractionSchemasDeleteResponse.d.ts +0 -7
- package/dist/cjs/api/resources/extractionSchemas/types/ExtractionSchemasDeleteResponse.js +0 -5
- package/dist/cjs/api/resources/extractionSchemas/types/ExtractionSchemasGetResponse.d.ts +0 -7
- package/dist/cjs/api/resources/extractionSchemas/types/ExtractionSchemasGetResponse.js +0 -5
- package/dist/cjs/api/resources/extractionSchemas/types/ExtractionSchemasListResponse.d.ts +0 -7
- package/dist/cjs/api/resources/extractionSchemas/types/ExtractionSchemasListResponse.js +0 -5
- package/dist/cjs/api/resources/extractionSchemas/types/ExtractionSchemasUpdateResponse.d.ts +0 -7
- package/dist/cjs/api/resources/extractionSchemas/types/ExtractionSchemasUpdateResponse.js +0 -5
- package/dist/cjs/api/resources/extractionSchemas/types/index.d.ts +0 -5
- package/dist/cjs/api/resources/extractionSchemas/types/index.js +0 -21
- package/dist/cjs/api/resources/index.d.ts +0 -18
- package/dist/cjs/api/resources/index.js +0 -57
- package/dist/cjs/api/resources/projects/client/Client.d.ts +0 -157
- package/dist/cjs/api/resources/projects/client/Client.js +0 -584
- package/dist/cjs/api/resources/projects/client/index.d.ts +0 -2
- package/dist/cjs/api/resources/projects/client/index.js +0 -17
- package/dist/cjs/api/resources/projects/client/requests/CreateConversationEvalPromptRequest.d.ts +0 -16
- package/dist/cjs/api/resources/projects/client/requests/CreateConversationEvalPromptRequest.js +0 -5
- package/dist/cjs/api/resources/projects/client/requests/CreateProjectRequest.d.ts +0 -13
- package/dist/cjs/api/resources/projects/client/requests/CreateProjectRequest.js +0 -5
- package/dist/cjs/api/resources/projects/client/requests/UpdateProjectRequest.d.ts +0 -15
- package/dist/cjs/api/resources/projects/client/requests/UpdateProjectRequest.js +0 -5
- package/dist/cjs/api/resources/projects/client/requests/index.d.ts +0 -3
- package/dist/cjs/api/resources/projects/client/requests/index.js +0 -2
- package/dist/cjs/api/resources/projects/index.d.ts +0 -2
- package/dist/cjs/api/resources/projects/index.js +0 -18
- package/dist/cjs/api/resources/projects/types/ProjectsCreateEvalPromptResponse.d.ts +0 -7
- package/dist/cjs/api/resources/projects/types/ProjectsCreateEvalPromptResponse.js +0 -5
- package/dist/cjs/api/resources/projects/types/ProjectsCreateResponse.d.ts +0 -9
- package/dist/cjs/api/resources/projects/types/ProjectsCreateResponse.js +0 -5
- package/dist/cjs/api/resources/projects/types/ProjectsDeleteResponse.d.ts +0 -7
- package/dist/cjs/api/resources/projects/types/ProjectsDeleteResponse.js +0 -5
- package/dist/cjs/api/resources/projects/types/ProjectsGetResponse.d.ts +0 -7
- package/dist/cjs/api/resources/projects/types/ProjectsGetResponse.js +0 -5
- package/dist/cjs/api/resources/projects/types/ProjectsListEvalPromptsResponse.d.ts +0 -7
- package/dist/cjs/api/resources/projects/types/ProjectsListEvalPromptsResponse.js +0 -5
- package/dist/cjs/api/resources/projects/types/ProjectsListResponse.d.ts +0 -7
- package/dist/cjs/api/resources/projects/types/ProjectsListResponse.js +0 -5
- package/dist/cjs/api/resources/projects/types/ProjectsUpdateResponse.d.ts +0 -7
- package/dist/cjs/api/resources/projects/types/ProjectsUpdateResponse.js +0 -5
- package/dist/cjs/api/resources/projects/types/index.d.ts +0 -7
- package/dist/cjs/api/resources/projects/types/index.js +0 -23
- package/dist/cjs/api/resources/tools/client/Client.d.ts +0 -170
- package/dist/cjs/api/resources/tools/client/Client.js +0 -494
- package/dist/cjs/api/resources/tools/client/index.d.ts +0 -2
- package/dist/cjs/api/resources/tools/client/index.js +0 -17
- package/dist/cjs/api/resources/tools/client/requests/CreateToolRequest.d.ts +0 -103
- package/dist/cjs/api/resources/tools/client/requests/CreateToolRequest.js +0 -18
- package/dist/cjs/api/resources/tools/client/requests/ToolsDeleteRequest.d.ts +0 -13
- package/dist/cjs/api/resources/tools/client/requests/ToolsDeleteRequest.js +0 -5
- package/dist/cjs/api/resources/tools/client/requests/ToolsGetRequest.d.ts +0 -23
- package/dist/cjs/api/resources/tools/client/requests/ToolsGetRequest.js +0 -5
- package/dist/cjs/api/resources/tools/client/requests/ToolsListRequest.d.ts +0 -13
- package/dist/cjs/api/resources/tools/client/requests/ToolsListRequest.js +0 -5
- package/dist/cjs/api/resources/tools/client/requests/UpdateToolRequest.d.ts +0 -55
- package/dist/cjs/api/resources/tools/client/requests/UpdateToolRequest.js +0 -18
- package/dist/cjs/api/resources/tools/client/requests/index.d.ts +0 -5
- package/dist/cjs/api/resources/tools/client/requests/index.js +0 -2
- package/dist/cjs/api/resources/tools/index.d.ts +0 -2
- package/dist/cjs/api/resources/tools/index.js +0 -18
- package/dist/cjs/api/resources/tools/types/ToolsCreateResponse.d.ts +0 -9
- package/dist/cjs/api/resources/tools/types/ToolsCreateResponse.js +0 -5
- package/dist/cjs/api/resources/tools/types/ToolsDeleteResponse.d.ts +0 -7
- package/dist/cjs/api/resources/tools/types/ToolsDeleteResponse.js +0 -5
- package/dist/cjs/api/resources/tools/types/ToolsGetResponse.d.ts +0 -7
- package/dist/cjs/api/resources/tools/types/ToolsGetResponse.js +0 -5
- package/dist/cjs/api/resources/tools/types/ToolsListResponse.d.ts +0 -7
- package/dist/cjs/api/resources/tools/types/ToolsListResponse.js +0 -5
- package/dist/cjs/api/resources/tools/types/ToolsUpdateResponse.d.ts +0 -7
- package/dist/cjs/api/resources/tools/types/ToolsUpdateResponse.js +0 -5
- package/dist/cjs/api/resources/tools/types/index.d.ts +0 -5
- package/dist/cjs/api/resources/tools/types/index.js +0 -21
- package/dist/cjs/api/resources/voices/client/Client.d.ts +0 -65
- package/dist/cjs/api/resources/voices/client/Client.js +0 -205
- package/dist/cjs/api/resources/voices/client/index.d.ts +0 -2
- package/dist/cjs/api/resources/voices/client/index.js +0 -17
- package/dist/cjs/api/resources/voices/client/requests/VoicesListRequest.d.ts +0 -13
- package/dist/cjs/api/resources/voices/client/requests/VoicesListRequest.js +0 -5
- package/dist/cjs/api/resources/voices/client/requests/index.d.ts +0 -1
- package/dist/cjs/api/resources/voices/client/requests/index.js +0 -2
- package/dist/cjs/api/resources/voices/index.d.ts +0 -2
- package/dist/cjs/api/resources/voices/index.js +0 -18
- package/dist/cjs/api/resources/voices/types/VoicesGetResponse.d.ts +0 -7
- package/dist/cjs/api/resources/voices/types/VoicesGetResponse.js +0 -5
- package/dist/cjs/api/resources/voices/types/VoicesListResponse.d.ts +0 -7
- package/dist/cjs/api/resources/voices/types/VoicesListResponse.js +0 -5
- package/dist/cjs/api/resources/voices/types/index.d.ts +0 -2
- package/dist/cjs/api/resources/voices/types/index.js +0 -18
- package/dist/cjs/api/types/Agent.d.ts +0 -80
- package/dist/cjs/api/types/Agent.js +0 -13
- package/dist/cjs/api/types/AssistantChoseNotToRespondPayload.d.ts +0 -6
- package/dist/cjs/api/types/AssistantChoseNotToRespondPayload.js +0 -5
- package/dist/cjs/api/types/AssistantEndedConversationPayload.d.ts +0 -6
- package/dist/cjs/api/types/AssistantEndedConversationPayload.js +0 -5
- package/dist/cjs/api/types/AudioChunkPayload.d.ts +0 -10
- package/dist/cjs/api/types/AudioChunkPayload.js +0 -5
- package/dist/cjs/api/types/AudioChunkResponsePayload.d.ts +0 -10
- package/dist/cjs/api/types/AudioChunkResponsePayload.js +0 -5
- package/dist/cjs/api/types/AudioFinishedPayload.d.ts +0 -6
- package/dist/cjs/api/types/AudioFinishedPayload.js +0 -5
- package/dist/cjs/api/types/BadRequestErrorBody.d.ts +0 -5
- package/dist/cjs/api/types/BadRequestErrorBody.js +0 -5
- package/dist/cjs/api/types/BasicError.d.ts +0 -14
- package/dist/cjs/api/types/BasicError.js +0 -5
- package/dist/cjs/api/types/ConfigPayload.d.ts +0 -66
- package/dist/cjs/api/types/ConfigPayload.js +0 -17
- package/dist/cjs/api/types/Conversation.d.ts +0 -51
- package/dist/cjs/api/types/Conversation.js +0 -5
- package/dist/cjs/api/types/ConversationAnalysis.d.ts +0 -9
- package/dist/cjs/api/types/ConversationAnalysis.js +0 -5
- package/dist/cjs/api/types/ConversationCreatedPayload.d.ts +0 -8
- package/dist/cjs/api/types/ConversationCreatedPayload.js +0 -5
- package/dist/cjs/api/types/ConversationEval.d.ts +0 -4
- package/dist/cjs/api/types/ConversationEval.js +0 -5
- package/dist/cjs/api/types/ConversationEvalPrompt.d.ts +0 -11
- package/dist/cjs/api/types/ConversationEvalPrompt.js +0 -5
- package/dist/cjs/api/types/ConversationEvaluation.d.ts +0 -8
- package/dist/cjs/api/types/ConversationEvaluation.js +0 -5
- package/dist/cjs/api/types/ConversationEvaluationResult.d.ts +0 -32
- package/dist/cjs/api/types/ConversationEvaluationResult.js +0 -15
- package/dist/cjs/api/types/ConversationExtraction.d.ts +0 -22
- package/dist/cjs/api/types/ConversationExtraction.js +0 -5
- package/dist/cjs/api/types/ConversationItem.d.ts +0 -31
- package/dist/cjs/api/types/ConversationItem.js +0 -13
- package/dist/cjs/api/types/CreateAgentRequest.d.ts +0 -70
- package/dist/cjs/api/types/CreateAgentRequest.js +0 -13
- package/dist/cjs/api/types/DtmfPayload.d.ts +0 -8
- package/dist/cjs/api/types/DtmfPayload.js +0 -5
- package/dist/cjs/api/types/ErrorPayload.d.ts +0 -17
- package/dist/cjs/api/types/ErrorPayload.js +0 -5
- package/dist/cjs/api/types/Error_.d.ts +0 -5
- package/dist/cjs/api/types/Error_.js +0 -5
- package/dist/cjs/api/types/ExtractionField.d.ts +0 -23
- package/dist/cjs/api/types/ExtractionField.js +0 -15
- package/dist/cjs/api/types/ExtractionSchema.d.ts +0 -14
- package/dist/cjs/api/types/ExtractionSchema.js +0 -5
- package/dist/cjs/api/types/InputCancelledPayload.d.ts +0 -6
- package/dist/cjs/api/types/InputCancelledPayload.js +0 -5
- package/dist/cjs/api/types/InputTextPayload.d.ts +0 -8
- package/dist/cjs/api/types/InputTextPayload.js +0 -5
- package/dist/cjs/api/types/InterruptedResponsePayload.d.ts +0 -8
- package/dist/cjs/api/types/InterruptedResponsePayload.js +0 -5
- package/dist/cjs/api/types/IsUserSpeakingPayload.d.ts +0 -8
- package/dist/cjs/api/types/IsUserSpeakingPayload.js +0 -5
- package/dist/cjs/api/types/OutboundCallConfig.d.ts +0 -39
- package/dist/cjs/api/types/OutboundCallConfig.js +0 -5
- package/dist/cjs/api/types/Project.d.ts +0 -22
- package/dist/cjs/api/types/Project.js +0 -5
- package/dist/cjs/api/types/ReadyToStartConversationPayload.d.ts +0 -6
- package/dist/cjs/api/types/ReadyToStartConversationPayload.js +0 -5
- package/dist/cjs/api/types/SetExternalIdPayload.d.ts +0 -8
- package/dist/cjs/api/types/SetExternalIdPayload.js +0 -5
- package/dist/cjs/api/types/SetTwilioCallSidPayload.d.ts +0 -8
- package/dist/cjs/api/types/SetTwilioCallSidPayload.js +0 -5
- package/dist/cjs/api/types/Task.d.ts +0 -9
- package/dist/cjs/api/types/Task.js +0 -5
- package/dist/cjs/api/types/Tool.d.ts +0 -54
- package/dist/cjs/api/types/Tool.js +0 -18
- package/dist/cjs/api/types/ToolCallInterruptedPayload.d.ts +0 -12
- package/dist/cjs/api/types/ToolCallInterruptedPayload.js +0 -5
- package/dist/cjs/api/types/ToolCallOutputPayload.d.ts +0 -9
- package/dist/cjs/api/types/ToolCallOutputPayload.js +0 -5
- package/dist/cjs/api/types/ToolCallOutputProcessedPayload.d.ts +0 -35
- package/dist/cjs/api/types/ToolCallOutputProcessedPayload.js +0 -5
- package/dist/cjs/api/types/ToolCallPayload.d.ts +0 -12
- package/dist/cjs/api/types/ToolCallPayload.js +0 -5
- package/dist/cjs/api/types/ToolParameter.d.ts +0 -38
- package/dist/cjs/api/types/ToolParameter.js +0 -22
- package/dist/cjs/api/types/UpdateSystemPromptPayload.d.ts +0 -8
- package/dist/cjs/api/types/UpdateSystemPromptPayload.js +0 -5
- package/dist/cjs/api/types/UserFinishedSpeakingPayload.d.ts +0 -6
- package/dist/cjs/api/types/UserFinishedSpeakingPayload.js +0 -5
- package/dist/cjs/api/types/UserStartedSpeakingPayload.d.ts +0 -6
- package/dist/cjs/api/types/UserStartedSpeakingPayload.js +0 -5
- package/dist/cjs/api/types/ValidationError.d.ts +0 -14
- package/dist/cjs/api/types/ValidationError.js +0 -5
- package/dist/cjs/api/types/Voice.d.ts +0 -11
- package/dist/cjs/api/types/Voice.js +0 -5
- package/dist/cjs/api/types/index.d.ts +0 -45
- package/dist/cjs/api/types/index.js +0 -61
- package/dist/cjs/api/types/overrides.d.ts +0 -50
- package/dist/cjs/api/types/overrides.js +0 -2
- package/dist/cjs/core/auth/AuthProvider.d.ts +0 -4
- package/dist/cjs/core/auth/AuthProvider.js +0 -2
- package/dist/cjs/core/auth/AuthRequest.d.ts +0 -9
- package/dist/cjs/core/auth/AuthRequest.js +0 -2
- package/dist/cjs/core/auth/BasicAuth.d.ts +0 -8
- package/dist/cjs/core/auth/BasicAuth.js +0 -26
- package/dist/cjs/core/auth/BearerToken.d.ts +0 -5
- package/dist/cjs/core/auth/BearerToken.js +0 -15
- package/dist/cjs/core/auth/index.d.ts +0 -4
- package/dist/cjs/core/auth/index.js +0 -7
- package/dist/cjs/core/base64.d.ts +0 -2
- package/dist/cjs/core/base64.js +0 -26
- package/dist/cjs/core/fetcher/APIResponse.d.ts +0 -20
- package/dist/cjs/core/fetcher/APIResponse.js +0 -2
- package/dist/cjs/core/fetcher/BinaryResponse.d.ts +0 -20
- package/dist/cjs/core/fetcher/BinaryResponse.js +0 -17
- package/dist/cjs/core/fetcher/Fetcher.d.ts +0 -40
- package/dist/cjs/core/fetcher/Fetcher.js +0 -120
- package/dist/cjs/core/fetcher/Headers.d.ts +0 -2
- package/dist/cjs/core/fetcher/Headers.js +0 -84
- package/dist/cjs/core/fetcher/HttpResponsePromise.d.ts +0 -58
- package/dist/cjs/core/fetcher/HttpResponsePromise.js +0 -103
- package/dist/cjs/core/fetcher/RawResponse.d.ts +0 -29
- package/dist/cjs/core/fetcher/RawResponse.js +0 -44
- package/dist/cjs/core/fetcher/ResponseWithBody.d.ts +0 -4
- package/dist/cjs/core/fetcher/ResponseWithBody.js +0 -6
- package/dist/cjs/core/fetcher/Supplier.d.ts +0 -4
- package/dist/cjs/core/fetcher/Supplier.js +0 -22
- package/dist/cjs/core/fetcher/createRequestUrl.d.ts +0 -1
- package/dist/cjs/core/fetcher/createRequestUrl.js +0 -8
- package/dist/cjs/core/fetcher/getErrorResponseBody.d.ts +0 -1
- package/dist/cjs/core/fetcher/getErrorResponseBody.js +0 -44
- package/dist/cjs/core/fetcher/getFetchFn.d.ts +0 -1
- package/dist/cjs/core/fetcher/getFetchFn.js +0 -17
- package/dist/cjs/core/fetcher/getHeader.d.ts +0 -1
- package/dist/cjs/core/fetcher/getHeader.js +0 -11
- package/dist/cjs/core/fetcher/getRequestBody.d.ts +0 -7
- package/dist/cjs/core/fetcher/getRequestBody.js +0 -23
- package/dist/cjs/core/fetcher/getResponseBody.d.ts +0 -1
- package/dist/cjs/core/fetcher/getResponseBody.js +0 -55
- package/dist/cjs/core/fetcher/index.d.ts +0 -9
- package/dist/cjs/core/fetcher/index.js +0 -15
- package/dist/cjs/core/fetcher/makeRequest.d.ts +0 -1
- package/dist/cjs/core/fetcher/makeRequest.js +0 -42
- package/dist/cjs/core/fetcher/requestWithRetries.d.ts +0 -1
- package/dist/cjs/core/fetcher/requestWithRetries.js +0 -40
- package/dist/cjs/core/fetcher/signals.d.ts +0 -11
- package/dist/cjs/core/fetcher/signals.js +0 -36
- package/dist/cjs/core/headers.d.ts +0 -3
- package/dist/cjs/core/headers.js +0 -29
- package/dist/cjs/core/index.d.ts +0 -6
- package/dist/cjs/core/index.js +0 -45
- package/dist/cjs/core/json.d.ts +0 -15
- package/dist/cjs/core/json.js +0 -24
- package/dist/cjs/core/runtime/index.d.ts +0 -1
- package/dist/cjs/core/runtime/index.js +0 -5
- package/dist/cjs/core/runtime/runtime.d.ts +0 -9
- package/dist/cjs/core/runtime/runtime.js +0 -102
- package/dist/cjs/core/url/index.d.ts +0 -2
- package/dist/cjs/core/url/index.js +0 -7
- package/dist/cjs/core/url/join.d.ts +0 -1
- package/dist/cjs/core/url/join.js +0 -69
- package/dist/cjs/core/url/qs.d.ts +0 -6
- package/dist/cjs/core/url/qs.js +0 -64
- package/dist/cjs/core/websocket/events.d.ts +0 -36
- package/dist/cjs/core/websocket/events.js +0 -27
- package/dist/cjs/core/websocket/index.d.ts +0 -1
- package/dist/cjs/core/websocket/index.js +0 -17
- package/dist/cjs/core/websocket/ws.d.ts +0 -147
- package/dist/cjs/core/websocket/ws.js +0 -460
- package/dist/cjs/environments.d.ts +0 -14
- package/dist/cjs/environments.js +0 -12
- package/dist/cjs/errors/PhonicError.d.ts +0 -15
- package/dist/cjs/errors/PhonicError.js +0 -30
- package/dist/cjs/errors/PhonicTimeoutError.d.ts +0 -6
- package/dist/cjs/errors/PhonicTimeoutError.js +0 -13
- package/dist/cjs/errors/index.d.ts +0 -2
- package/dist/cjs/errors/index.js +0 -7
- package/dist/cjs/index.d.ts +0 -4
- package/dist/cjs/index.js +0 -44
- package/dist/cjs/version.d.ts +0 -1
- package/dist/cjs/version.js +0 -4
- package/dist/index.d.mts +0 -640
- package/dist/index.d.ts +0 -640
- package/dist/index.js +0 -628
- package/dist/index.mjs +0 -591
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.requestWithRetries = requestWithRetries;
|
|
13
|
-
const INITIAL_RETRY_DELAY = 1000; // in milliseconds
|
|
14
|
-
const MAX_RETRY_DELAY = 60000; // in milliseconds
|
|
15
|
-
const DEFAULT_MAX_RETRIES = 2;
|
|
16
|
-
const JITTER_FACTOR = 0.2; // 20% random jitter
|
|
17
|
-
function addJitter(delay) {
|
|
18
|
-
// Generate a random value between -JITTER_FACTOR and +JITTER_FACTOR
|
|
19
|
-
const jitterMultiplier = 1 + (Math.random() * 2 - 1) * JITTER_FACTOR;
|
|
20
|
-
return delay * jitterMultiplier;
|
|
21
|
-
}
|
|
22
|
-
function requestWithRetries(requestFn_1) {
|
|
23
|
-
return __awaiter(this, arguments, void 0, function* (requestFn, maxRetries = DEFAULT_MAX_RETRIES) {
|
|
24
|
-
let response = yield requestFn();
|
|
25
|
-
for (let i = 0; i < maxRetries; ++i) {
|
|
26
|
-
if ([408, 429].includes(response.status) || response.status >= 500) {
|
|
27
|
-
// Calculate base delay using exponential backoff (in milliseconds)
|
|
28
|
-
const baseDelay = Math.min(INITIAL_RETRY_DELAY * Math.pow(2, i), MAX_RETRY_DELAY);
|
|
29
|
-
// Add jitter to the delay
|
|
30
|
-
const delayWithJitter = addJitter(baseDelay);
|
|
31
|
-
yield new Promise((resolve) => setTimeout(resolve, delayWithJitter));
|
|
32
|
-
response = yield requestFn();
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
break;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
return response;
|
|
39
|
-
});
|
|
40
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export declare function getTimeoutSignal(timeoutMs: number): {
|
|
2
|
-
signal: AbortSignal;
|
|
3
|
-
abortId: NodeJS.Timeout;
|
|
4
|
-
};
|
|
5
|
-
/**
|
|
6
|
-
* Returns an abort signal that is getting aborted when
|
|
7
|
-
* at least one of the specified abort signals is aborted.
|
|
8
|
-
*
|
|
9
|
-
* Requires at least node.js 18.
|
|
10
|
-
*/
|
|
11
|
-
export declare function anySignal(...args: AbortSignal[] | [AbortSignal[]]): AbortSignal;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getTimeoutSignal = getTimeoutSignal;
|
|
4
|
-
exports.anySignal = anySignal;
|
|
5
|
-
const TIMEOUT = "timeout";
|
|
6
|
-
function getTimeoutSignal(timeoutMs) {
|
|
7
|
-
const controller = new AbortController();
|
|
8
|
-
const abortId = setTimeout(() => controller.abort(TIMEOUT), timeoutMs);
|
|
9
|
-
return { signal: controller.signal, abortId };
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Returns an abort signal that is getting aborted when
|
|
13
|
-
* at least one of the specified abort signals is aborted.
|
|
14
|
-
*
|
|
15
|
-
* Requires at least node.js 18.
|
|
16
|
-
*/
|
|
17
|
-
function anySignal(...args) {
|
|
18
|
-
// Allowing signals to be passed either as array
|
|
19
|
-
// of signals or as multiple arguments.
|
|
20
|
-
const signals = (args.length === 1 && Array.isArray(args[0]) ? args[0] : args);
|
|
21
|
-
const controller = new AbortController();
|
|
22
|
-
for (const signal of signals) {
|
|
23
|
-
if (signal.aborted) {
|
|
24
|
-
// Exiting early if one of the signals
|
|
25
|
-
// is already aborted.
|
|
26
|
-
controller.abort(signal === null || signal === void 0 ? void 0 : signal.reason);
|
|
27
|
-
break;
|
|
28
|
-
}
|
|
29
|
-
// Listening for signals and removing the listeners
|
|
30
|
-
// when at least one symbol is aborted.
|
|
31
|
-
signal.addEventListener("abort", () => controller.abort(signal === null || signal === void 0 ? void 0 : signal.reason), {
|
|
32
|
-
signal: controller.signal,
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
return controller.signal;
|
|
36
|
-
}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import * as core from "./index.js";
|
|
2
|
-
export declare function mergeHeaders(...headersArray: (Record<string, string | core.Supplier<string | undefined> | undefined> | undefined)[]): Record<string, string | core.Supplier<string | undefined>>;
|
|
3
|
-
export declare function mergeOnlyDefinedHeaders(...headersArray: (Record<string, string | core.Supplier<string | undefined> | undefined> | undefined)[]): Record<string, string | core.Supplier<string | undefined>>;
|
package/dist/cjs/core/headers.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.mergeHeaders = mergeHeaders;
|
|
4
|
-
exports.mergeOnlyDefinedHeaders = mergeOnlyDefinedHeaders;
|
|
5
|
-
function mergeHeaders(...headersArray) {
|
|
6
|
-
const result = {};
|
|
7
|
-
for (const [key, value] of headersArray
|
|
8
|
-
.filter((headers) => headers != null)
|
|
9
|
-
.flatMap((headers) => Object.entries(headers))) {
|
|
10
|
-
if (value != null) {
|
|
11
|
-
result[key] = value;
|
|
12
|
-
}
|
|
13
|
-
else if (key in result) {
|
|
14
|
-
delete result[key];
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
return result;
|
|
18
|
-
}
|
|
19
|
-
function mergeOnlyDefinedHeaders(...headersArray) {
|
|
20
|
-
const result = {};
|
|
21
|
-
for (const [key, value] of headersArray
|
|
22
|
-
.filter((headers) => headers != null)
|
|
23
|
-
.flatMap((headers) => Object.entries(headers))) {
|
|
24
|
-
if (value != null) {
|
|
25
|
-
result[key] = value;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
return result;
|
|
29
|
-
}
|
package/dist/cjs/core/index.d.ts
DELETED
package/dist/cjs/core/index.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
19
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
20
|
-
};
|
|
21
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
-
var ownKeys = function(o) {
|
|
23
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
-
var ar = [];
|
|
25
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
-
return ar;
|
|
27
|
-
};
|
|
28
|
-
return ownKeys(o);
|
|
29
|
-
};
|
|
30
|
-
return function (mod) {
|
|
31
|
-
if (mod && mod.__esModule) return mod;
|
|
32
|
-
var result = {};
|
|
33
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
-
__setModuleDefault(result, mod);
|
|
35
|
-
return result;
|
|
36
|
-
};
|
|
37
|
-
})();
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.url = void 0;
|
|
40
|
-
__exportStar(require("./fetcher/index.js"), exports);
|
|
41
|
-
__exportStar(require("./runtime/index.js"), exports);
|
|
42
|
-
exports.url = __importStar(require("./url/index.js"));
|
|
43
|
-
__exportStar(require("./websocket/index.js"), exports);
|
|
44
|
-
__exportStar(require("./auth/index.js"), exports);
|
|
45
|
-
__exportStar(require("./base64.js"), exports);
|
package/dist/cjs/core/json.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Serialize a value to JSON
|
|
3
|
-
* @param value A JavaScript value, usually an object or array, to be converted.
|
|
4
|
-
* @param replacer A function that transforms the results.
|
|
5
|
-
* @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.
|
|
6
|
-
* @returns JSON string
|
|
7
|
-
*/
|
|
8
|
-
export declare const toJson: (value: unknown, replacer?: (this: unknown, key: string, value: unknown) => unknown, space?: string | number) => string;
|
|
9
|
-
/**
|
|
10
|
-
* Parse JSON string to object, array, or other type
|
|
11
|
-
* @param text A valid JSON string.
|
|
12
|
-
* @param reviver A function that transforms the results. This function is called for each member of the object. If a member contains nested objects, the nested objects are transformed before the parent object is.
|
|
13
|
-
* @returns Parsed object, array, or other type
|
|
14
|
-
*/
|
|
15
|
-
export declare function fromJson<T = unknown>(text: string, reviver?: (this: unknown, key: string, value: unknown) => unknown): T;
|
package/dist/cjs/core/json.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toJson = void 0;
|
|
4
|
-
exports.fromJson = fromJson;
|
|
5
|
-
/**
|
|
6
|
-
* Serialize a value to JSON
|
|
7
|
-
* @param value A JavaScript value, usually an object or array, to be converted.
|
|
8
|
-
* @param replacer A function that transforms the results.
|
|
9
|
-
* @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.
|
|
10
|
-
* @returns JSON string
|
|
11
|
-
*/
|
|
12
|
-
const toJson = (value, replacer, space) => {
|
|
13
|
-
return JSON.stringify(value, replacer, space);
|
|
14
|
-
};
|
|
15
|
-
exports.toJson = toJson;
|
|
16
|
-
/**
|
|
17
|
-
* Parse JSON string to object, array, or other type
|
|
18
|
-
* @param text A valid JSON string.
|
|
19
|
-
* @param reviver A function that transforms the results. This function is called for each member of the object. If a member contains nested objects, the nested objects are transformed before the parent object is.
|
|
20
|
-
* @returns Parsed object, array, or other type
|
|
21
|
-
*/
|
|
22
|
-
function fromJson(text, reviver) {
|
|
23
|
-
return JSON.parse(text, reviver);
|
|
24
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { RUNTIME } from "./runtime.js";
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A constant that indicates which environment and version the SDK is running in.
|
|
3
|
-
*/
|
|
4
|
-
export declare const RUNTIME: Runtime;
|
|
5
|
-
export interface Runtime {
|
|
6
|
-
type: "browser" | "web-worker" | "deno" | "bun" | "node" | "react-native" | "unknown" | "workerd" | "edge-runtime";
|
|
7
|
-
version?: string;
|
|
8
|
-
parsedVersion?: number;
|
|
9
|
-
}
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RUNTIME = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* A constant that indicates which environment and version the SDK is running in.
|
|
6
|
-
*/
|
|
7
|
-
exports.RUNTIME = evaluateRuntime();
|
|
8
|
-
function evaluateRuntime() {
|
|
9
|
-
var _a, _b, _c, _d, _e;
|
|
10
|
-
/**
|
|
11
|
-
* A constant that indicates whether the environment the code is running is a Web Browser.
|
|
12
|
-
*/
|
|
13
|
-
const isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined";
|
|
14
|
-
if (isBrowser) {
|
|
15
|
-
return {
|
|
16
|
-
type: "browser",
|
|
17
|
-
version: window.navigator.userAgent,
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* A constant that indicates whether the environment the code is running is Cloudflare.
|
|
22
|
-
* https://developers.cloudflare.com/workers/runtime-apis/web-standards/#navigatoruseragent
|
|
23
|
-
*/
|
|
24
|
-
const isCloudflare = typeof globalThis !== "undefined" && ((_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.navigator) === null || _a === void 0 ? void 0 : _a.userAgent) === "Cloudflare-Workers";
|
|
25
|
-
if (isCloudflare) {
|
|
26
|
-
return {
|
|
27
|
-
type: "workerd",
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* A constant that indicates whether the environment the code is running is Edge Runtime.
|
|
32
|
-
* https://vercel.com/docs/functions/runtimes/edge-runtime#check-if-you're-running-on-the-edge-runtime
|
|
33
|
-
*/
|
|
34
|
-
const isEdgeRuntime = typeof EdgeRuntime === "string";
|
|
35
|
-
if (isEdgeRuntime) {
|
|
36
|
-
return {
|
|
37
|
-
type: "edge-runtime",
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* A constant that indicates whether the environment the code is running is a Web Worker.
|
|
42
|
-
*/
|
|
43
|
-
const isWebWorker = typeof self === "object" &&
|
|
44
|
-
typeof (self === null || self === void 0 ? void 0 : self.importScripts) === "function" &&
|
|
45
|
-
(((_b = self.constructor) === null || _b === void 0 ? void 0 : _b.name) === "DedicatedWorkerGlobalScope" ||
|
|
46
|
-
((_c = self.constructor) === null || _c === void 0 ? void 0 : _c.name) === "ServiceWorkerGlobalScope" ||
|
|
47
|
-
((_d = self.constructor) === null || _d === void 0 ? void 0 : _d.name) === "SharedWorkerGlobalScope");
|
|
48
|
-
if (isWebWorker) {
|
|
49
|
-
return {
|
|
50
|
-
type: "web-worker",
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* A constant that indicates whether the environment the code is running is Deno.
|
|
55
|
-
* FYI Deno spoofs process.versions.node, see https://deno.land/std@0.177.0/node/process.ts?s=versions
|
|
56
|
-
*/
|
|
57
|
-
const isDeno = typeof Deno !== "undefined" && typeof Deno.version !== "undefined" && typeof Deno.version.deno !== "undefined";
|
|
58
|
-
if (isDeno) {
|
|
59
|
-
return {
|
|
60
|
-
type: "deno",
|
|
61
|
-
version: Deno.version.deno,
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* A constant that indicates whether the environment the code is running is Bun.sh.
|
|
66
|
-
*/
|
|
67
|
-
const isBun = typeof Bun !== "undefined" && typeof Bun.version !== "undefined";
|
|
68
|
-
if (isBun) {
|
|
69
|
-
return {
|
|
70
|
-
type: "bun",
|
|
71
|
-
version: Bun.version,
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* A constant that indicates whether the environment the code is running is Node.JS.
|
|
76
|
-
*/
|
|
77
|
-
const isNode = typeof process !== "undefined" &&
|
|
78
|
-
"version" in process &&
|
|
79
|
-
!!process.version &&
|
|
80
|
-
"versions" in process &&
|
|
81
|
-
!!((_e = process.versions) === null || _e === void 0 ? void 0 : _e.node);
|
|
82
|
-
if (isNode) {
|
|
83
|
-
return {
|
|
84
|
-
type: "node",
|
|
85
|
-
version: process.versions.node,
|
|
86
|
-
parsedVersion: Number(process.versions.node.split(".")[0]),
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* A constant that indicates whether the environment the code is running is in React-Native.
|
|
91
|
-
* https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Core/setUpNavigator.js
|
|
92
|
-
*/
|
|
93
|
-
const isReactNative = typeof navigator !== "undefined" && (navigator === null || navigator === void 0 ? void 0 : navigator.product) === "ReactNative";
|
|
94
|
-
if (isReactNative) {
|
|
95
|
-
return {
|
|
96
|
-
type: "react-native",
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
return {
|
|
100
|
-
type: "unknown",
|
|
101
|
-
};
|
|
102
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toQueryString = exports.join = void 0;
|
|
4
|
-
var join_js_1 = require("./join.js");
|
|
5
|
-
Object.defineProperty(exports, "join", { enumerable: true, get: function () { return join_js_1.join; } });
|
|
6
|
-
var qs_js_1 = require("./qs.js");
|
|
7
|
-
Object.defineProperty(exports, "toQueryString", { enumerable: true, get: function () { return qs_js_1.toQueryString; } });
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function join(base: string, ...segments: string[]): string;
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.join = join;
|
|
4
|
-
function join(base, ...segments) {
|
|
5
|
-
if (!base) {
|
|
6
|
-
return "";
|
|
7
|
-
}
|
|
8
|
-
if (segments.length === 0) {
|
|
9
|
-
return base;
|
|
10
|
-
}
|
|
11
|
-
if (base.includes("://")) {
|
|
12
|
-
let url;
|
|
13
|
-
try {
|
|
14
|
-
url = new URL(base);
|
|
15
|
-
}
|
|
16
|
-
catch (_a) {
|
|
17
|
-
// Fallback to path joining if URL is malformed
|
|
18
|
-
return joinPath(base, ...segments);
|
|
19
|
-
}
|
|
20
|
-
const lastSegment = segments[segments.length - 1];
|
|
21
|
-
const shouldPreserveTrailingSlash = lastSegment && lastSegment.endsWith("/");
|
|
22
|
-
for (const segment of segments) {
|
|
23
|
-
const cleanSegment = trimSlashes(segment);
|
|
24
|
-
if (cleanSegment) {
|
|
25
|
-
url.pathname = joinPathSegments(url.pathname, cleanSegment);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
if (shouldPreserveTrailingSlash && !url.pathname.endsWith("/")) {
|
|
29
|
-
url.pathname += "/";
|
|
30
|
-
}
|
|
31
|
-
return url.toString();
|
|
32
|
-
}
|
|
33
|
-
return joinPath(base, ...segments);
|
|
34
|
-
}
|
|
35
|
-
function joinPath(base, ...segments) {
|
|
36
|
-
if (segments.length === 0) {
|
|
37
|
-
return base;
|
|
38
|
-
}
|
|
39
|
-
let result = base;
|
|
40
|
-
const lastSegment = segments[segments.length - 1];
|
|
41
|
-
const shouldPreserveTrailingSlash = lastSegment && lastSegment.endsWith("/");
|
|
42
|
-
for (const segment of segments) {
|
|
43
|
-
const cleanSegment = trimSlashes(segment);
|
|
44
|
-
if (cleanSegment) {
|
|
45
|
-
result = joinPathSegments(result, cleanSegment);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
if (shouldPreserveTrailingSlash && !result.endsWith("/")) {
|
|
49
|
-
result += "/";
|
|
50
|
-
}
|
|
51
|
-
return result;
|
|
52
|
-
}
|
|
53
|
-
function joinPathSegments(left, right) {
|
|
54
|
-
if (left.endsWith("/")) {
|
|
55
|
-
return left + right;
|
|
56
|
-
}
|
|
57
|
-
return left + "/" + right;
|
|
58
|
-
}
|
|
59
|
-
function trimSlashes(str) {
|
|
60
|
-
if (!str)
|
|
61
|
-
return str;
|
|
62
|
-
let start = 0;
|
|
63
|
-
let end = str.length;
|
|
64
|
-
if (str.startsWith("/"))
|
|
65
|
-
start = 1;
|
|
66
|
-
if (str.endsWith("/"))
|
|
67
|
-
end = str.length - 1;
|
|
68
|
-
return start === 0 && end === str.length ? str : str.slice(start, end);
|
|
69
|
-
}
|
package/dist/cjs/core/url/qs.js
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toQueryString = toQueryString;
|
|
4
|
-
const defaultQsOptions = {
|
|
5
|
-
arrayFormat: "indices",
|
|
6
|
-
encode: true,
|
|
7
|
-
};
|
|
8
|
-
function encodeValue(value, shouldEncode) {
|
|
9
|
-
if (value === undefined) {
|
|
10
|
-
return "";
|
|
11
|
-
}
|
|
12
|
-
if (value === null) {
|
|
13
|
-
return "";
|
|
14
|
-
}
|
|
15
|
-
const stringValue = String(value);
|
|
16
|
-
return shouldEncode ? encodeURIComponent(stringValue) : stringValue;
|
|
17
|
-
}
|
|
18
|
-
function stringifyObject(obj, prefix = "", options) {
|
|
19
|
-
const parts = [];
|
|
20
|
-
for (const [key, value] of Object.entries(obj)) {
|
|
21
|
-
const fullKey = prefix ? `${prefix}[${key}]` : key;
|
|
22
|
-
if (value === undefined) {
|
|
23
|
-
continue;
|
|
24
|
-
}
|
|
25
|
-
if (Array.isArray(value)) {
|
|
26
|
-
if (value.length === 0) {
|
|
27
|
-
continue;
|
|
28
|
-
}
|
|
29
|
-
for (let i = 0; i < value.length; i++) {
|
|
30
|
-
const item = value[i];
|
|
31
|
-
if (item === undefined) {
|
|
32
|
-
continue;
|
|
33
|
-
}
|
|
34
|
-
if (typeof item === "object" && !Array.isArray(item) && item !== null) {
|
|
35
|
-
const arrayKey = options.arrayFormat === "indices" ? `${fullKey}[${i}]` : fullKey;
|
|
36
|
-
parts.push(...stringifyObject(item, arrayKey, options));
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
const arrayKey = options.arrayFormat === "indices" ? `${fullKey}[${i}]` : fullKey;
|
|
40
|
-
const encodedKey = options.encode ? encodeURIComponent(arrayKey) : arrayKey;
|
|
41
|
-
parts.push(`${encodedKey}=${encodeValue(item, options.encode)}`);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
else if (typeof value === "object" && value !== null) {
|
|
46
|
-
if (Object.keys(value).length === 0) {
|
|
47
|
-
continue;
|
|
48
|
-
}
|
|
49
|
-
parts.push(...stringifyObject(value, fullKey, options));
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
52
|
-
const encodedKey = options.encode ? encodeURIComponent(fullKey) : fullKey;
|
|
53
|
-
parts.push(`${encodedKey}=${encodeValue(value, options.encode)}`);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
return parts;
|
|
57
|
-
}
|
|
58
|
-
function toQueryString(obj, options) {
|
|
59
|
-
if (obj == null || typeof obj !== "object") {
|
|
60
|
-
return "";
|
|
61
|
-
}
|
|
62
|
-
const parts = stringifyObject(obj, "", Object.assign(Object.assign({}, defaultQsOptions), options));
|
|
63
|
-
return parts.join("&");
|
|
64
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
export declare class Event {
|
|
2
|
-
target: any;
|
|
3
|
-
type: string;
|
|
4
|
-
constructor(type: string, target: any);
|
|
5
|
-
}
|
|
6
|
-
export declare class ErrorEvent extends Event {
|
|
7
|
-
message: string;
|
|
8
|
-
error: Error;
|
|
9
|
-
constructor(error: Error, target: any);
|
|
10
|
-
}
|
|
11
|
-
export declare class CloseEvent extends Event {
|
|
12
|
-
code: number;
|
|
13
|
-
reason: string;
|
|
14
|
-
wasClean: boolean;
|
|
15
|
-
constructor(code: number | undefined, reason: string | undefined, target: any);
|
|
16
|
-
}
|
|
17
|
-
export interface WebSocketEventMap {
|
|
18
|
-
close: CloseEvent;
|
|
19
|
-
error: ErrorEvent;
|
|
20
|
-
message: MessageEvent;
|
|
21
|
-
open: Event;
|
|
22
|
-
}
|
|
23
|
-
export interface WebSocketEventListenerMap {
|
|
24
|
-
close: (event: CloseEvent) => void | {
|
|
25
|
-
handleEvent: (event: CloseEvent) => void;
|
|
26
|
-
};
|
|
27
|
-
error: (event: ErrorEvent) => void | {
|
|
28
|
-
handleEvent: (event: ErrorEvent) => void;
|
|
29
|
-
};
|
|
30
|
-
message: (event: MessageEvent) => void | {
|
|
31
|
-
handleEvent: (event: MessageEvent) => void;
|
|
32
|
-
};
|
|
33
|
-
open: (event: Event) => void | {
|
|
34
|
-
handleEvent: (event: Event) => void;
|
|
35
|
-
};
|
|
36
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CloseEvent = exports.ErrorEvent = exports.Event = void 0;
|
|
4
|
-
class Event {
|
|
5
|
-
constructor(type, target) {
|
|
6
|
-
this.target = target;
|
|
7
|
-
this.type = type;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
exports.Event = Event;
|
|
11
|
-
class ErrorEvent extends Event {
|
|
12
|
-
constructor(error, target) {
|
|
13
|
-
super("error", target);
|
|
14
|
-
this.message = error.message;
|
|
15
|
-
this.error = error;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
exports.ErrorEvent = ErrorEvent;
|
|
19
|
-
class CloseEvent extends Event {
|
|
20
|
-
constructor(code = 1000, reason = "", target) {
|
|
21
|
-
super("close", target);
|
|
22
|
-
this.wasClean = true;
|
|
23
|
-
this.code = code;
|
|
24
|
-
this.reason = reason;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
exports.CloseEvent = CloseEvent;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./ws.js";
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./ws.js"), exports);
|