phenoml 9.2.0 → 10.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/BaseClient.d.ts +13 -4
- package/dist/cjs/BaseClient.js +59 -0
- package/dist/cjs/Client.d.ts +34 -34
- package/dist/cjs/Client.js +13 -54
- package/dist/cjs/api/resources/agent/client/Client.d.ts +26 -27
- package/dist/cjs/api/resources/agent/client/Client.js +56 -185
- package/dist/cjs/api/resources/agent/errors/BadRequestError.js +5 -1
- package/dist/cjs/api/resources/agent/errors/ForbiddenError.js +5 -1
- package/dist/cjs/api/resources/agent/errors/InternalServerError.js +5 -1
- package/dist/cjs/api/resources/agent/errors/NotFoundError.js +5 -1
- package/dist/cjs/api/resources/agent/errors/UnauthorizedError.js +5 -1
- package/dist/cjs/api/resources/agent/exports.d.ts +3 -0
- package/dist/cjs/api/resources/agent/exports.js +22 -0
- package/dist/cjs/api/resources/agent/resources/prompts/client/Client.d.ts +20 -21
- package/dist/cjs/api/resources/agent/resources/prompts/client/Client.js +35 -129
- package/dist/cjs/api/resources/agent/resources/prompts/exports.d.ts +2 -0
- package/dist/cjs/api/resources/agent/resources/prompts/exports.js +21 -0
- package/dist/cjs/api/resources/agent/resources/prompts/types/PromptsDeleteResponse.d.ts +2 -2
- package/dist/cjs/api/resources/agent/resources/prompts/types/PromptsListResponse.d.ts +3 -3
- package/dist/cjs/api/resources/agent/types/AgentChatResponse.d.ts +4 -4
- package/dist/cjs/api/resources/agent/types/AgentChatStreamEvent.d.ts +8 -8
- package/dist/cjs/api/resources/agent/types/AgentCreateRequest.d.ts +4 -4
- package/dist/cjs/api/resources/agent/types/AgentDeleteResponse.d.ts +2 -2
- package/dist/cjs/api/resources/agent/types/AgentGetChatMessagesResponse.d.ts +3 -3
- package/dist/cjs/api/resources/agent/types/AgentListResponse.d.ts +3 -3
- package/dist/cjs/api/resources/agent/types/AgentPromptsResponse.d.ts +3 -3
- package/dist/cjs/api/resources/agent/types/AgentResponse.d.ts +3 -3
- package/dist/cjs/api/resources/agent/types/AgentTemplate.d.ts +8 -8
- package/dist/cjs/api/resources/agent/types/ChatMessageTemplate.d.ts +10 -10
- package/dist/cjs/api/resources/agent/types/ChatSessionTemplate.d.ts +9 -9
- package/dist/cjs/api/resources/agent/types/JsonPatchOperation.d.ts +2 -2
- package/dist/cjs/api/resources/agent/types/PromptTemplate.d.ts +6 -6
- package/dist/cjs/api/resources/agent/types/SuccessResponse.d.ts +2 -2
- package/dist/cjs/api/resources/authtoken/client/Client.d.ts +9 -9
- package/dist/cjs/api/resources/authtoken/client/Client.js +7 -6
- package/dist/cjs/api/resources/authtoken/errors/BadRequestError.js +5 -1
- package/dist/cjs/api/resources/authtoken/errors/InternalServerError.d.ts +5 -0
- package/dist/cjs/api/resources/authtoken/errors/InternalServerError.js +54 -0
- package/dist/cjs/api/resources/authtoken/errors/UnauthorizedError.js +5 -1
- package/dist/cjs/api/resources/authtoken/errors/index.d.ts +1 -0
- package/dist/cjs/api/resources/authtoken/errors/index.js +1 -0
- package/dist/cjs/api/resources/authtoken/exports.d.ts +3 -0
- package/dist/cjs/api/resources/authtoken/exports.js +22 -0
- package/dist/cjs/api/resources/authtoken/resources/auth/client/Client.d.ts +28 -30
- package/dist/cjs/api/resources/authtoken/resources/auth/client/Client.js +76 -43
- package/dist/cjs/api/resources/authtoken/resources/auth/client/requests/ClientCredentialsRequest.d.ts +12 -0
- package/dist/cjs/api/resources/authtoken/resources/auth/client/requests/ClientCredentialsRequest.js +3 -0
- package/dist/cjs/api/resources/authtoken/resources/auth/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/authtoken/resources/auth/exports.d.ts +2 -0
- package/dist/cjs/api/resources/authtoken/resources/auth/exports.js +21 -0
- package/dist/cjs/api/resources/authtoken/types/BadRequestErrorBody.d.ts +3 -3
- package/dist/cjs/api/resources/authtoken/types/OAuthError.d.ts +19 -0
- package/dist/cjs/api/resources/authtoken/types/OAuthError.js +14 -0
- package/dist/cjs/api/resources/authtoken/types/TokenResponse.d.ts +8 -0
- package/dist/cjs/api/resources/authtoken/types/TokenResponse.js +3 -0
- package/dist/cjs/api/resources/authtoken/types/UnauthorizedErrorBody.d.ts +3 -3
- package/dist/cjs/api/resources/authtoken/types/index.d.ts +2 -0
- package/dist/cjs/api/resources/authtoken/types/index.js +2 -0
- package/dist/cjs/api/resources/cohort/client/Client.d.ts +8 -9
- package/dist/cjs/api/resources/cohort/client/Client.js +11 -27
- package/dist/cjs/api/resources/cohort/errors/BadRequestError.js +5 -1
- package/dist/cjs/api/resources/cohort/errors/InternalServerError.js +5 -1
- package/dist/cjs/api/resources/cohort/errors/UnauthorizedError.js +5 -1
- package/dist/cjs/api/resources/cohort/exports.d.ts +2 -0
- package/dist/cjs/api/resources/cohort/exports.js +21 -0
- package/dist/cjs/api/resources/cohort/types/CohortResponse.d.ts +3 -3
- package/dist/cjs/api/resources/cohort/types/SearchConcept.d.ts +4 -4
- package/dist/cjs/api/resources/construe/client/Client.d.ts +28 -29
- package/dist/cjs/api/resources/construe/client/Client.js +78 -239
- package/dist/cjs/api/resources/construe/client/requests/index.d.ts +1 -1
- package/dist/cjs/api/resources/construe/client/requests/index.js +3 -0
- package/dist/cjs/api/resources/construe/errors/BadRequestError.js +5 -1
- package/dist/cjs/api/resources/construe/errors/ConflictError.js +5 -1
- package/dist/cjs/api/resources/construe/errors/FailedDependencyError.js +5 -1
- package/dist/cjs/api/resources/construe/errors/ForbiddenError.js +5 -1
- package/dist/cjs/api/resources/construe/errors/GatewayTimeoutError.js +5 -1
- package/dist/cjs/api/resources/construe/errors/InternalServerError.js +5 -1
- package/dist/cjs/api/resources/construe/errors/NotFoundError.js +5 -1
- package/dist/cjs/api/resources/construe/errors/NotImplementedError.js +5 -1
- package/dist/cjs/api/resources/construe/errors/ServiceUnavailableError.js +5 -1
- package/dist/cjs/api/resources/construe/errors/UnauthorizedError.js +5 -1
- package/dist/cjs/api/resources/construe/exports.d.ts +2 -0
- package/dist/cjs/api/resources/construe/exports.js +21 -0
- package/dist/cjs/api/resources/construe/types/CodeResponse.d.ts +1 -1
- package/dist/cjs/api/resources/construe/types/ConstrueUploadCodeSystemResponse.d.ts +3 -3
- package/dist/cjs/api/resources/construe/types/ExtractRequestConfig.d.ts +8 -8
- package/dist/cjs/api/resources/construe/types/ExtractRequestSystem.d.ts +2 -2
- package/dist/cjs/api/resources/construe/types/ExtractedCodeResult.d.ts +3 -3
- package/dist/cjs/api/resources/construe/types/GetCodeResponse.d.ts +1 -1
- package/dist/cjs/api/resources/construe/types/ListCodesResponse.d.ts +1 -1
- package/dist/cjs/api/resources/fhir/client/Client.d.ts +18 -19
- package/dist/cjs/api/resources/fhir/client/Client.js +46 -134
- package/dist/cjs/api/resources/fhir/client/requests/FhirSearchRequest.d.ts +0 -6
- package/dist/cjs/api/resources/fhir/errors/BadGatewayError.js +5 -1
- package/dist/cjs/api/resources/fhir/errors/BadRequestError.js +5 -1
- package/dist/cjs/api/resources/fhir/errors/InternalServerError.js +5 -1
- package/dist/cjs/api/resources/fhir/errors/NotFoundError.js +5 -1
- package/dist/cjs/api/resources/fhir/errors/UnauthorizedError.js +5 -1
- package/dist/cjs/api/resources/fhir/exports.d.ts +2 -0
- package/dist/cjs/api/resources/fhir/exports.js +21 -0
- package/dist/cjs/api/resources/fhir/types/ErrorResponse.d.ts +2 -2
- package/dist/cjs/api/resources/fhir/types/FhirBundle.d.ts +8 -8
- package/dist/cjs/api/resources/fhir/types/FhirPatchRequestBodyItem.d.ts +2 -2
- package/dist/cjs/api/resources/fhir/types/FhirResource.d.ts +5 -5
- package/dist/cjs/api/resources/fhirProvider/client/Client.d.ts +20 -21
- package/dist/cjs/api/resources/fhirProvider/client/Client.js +35 -129
- package/dist/cjs/api/resources/fhirProvider/errors/BadRequestError.js +5 -1
- package/dist/cjs/api/resources/fhirProvider/errors/ForbiddenError.js +5 -1
- package/dist/cjs/api/resources/fhirProvider/errors/InternalServerError.js +5 -1
- package/dist/cjs/api/resources/fhirProvider/errors/NotFoundError.js +5 -1
- package/dist/cjs/api/resources/fhirProvider/errors/UnauthorizedError.js +5 -1
- package/dist/cjs/api/resources/fhirProvider/exports.d.ts +2 -0
- package/dist/cjs/api/resources/fhirProvider/exports.js +21 -0
- package/dist/cjs/api/resources/fhirProvider/types/ClientSecretAuth.d.ts +2 -2
- package/dist/cjs/api/resources/fhirProvider/types/FhirProviderAuthConfig.d.ts +12 -12
- package/dist/cjs/api/resources/fhirProvider/types/FhirProviderDeleteResponse.d.ts +2 -2
- package/dist/cjs/api/resources/fhirProvider/types/FhirProviderListResponse.d.ts +3 -3
- package/dist/cjs/api/resources/fhirProvider/types/FhirProviderRemoveAuthConfigResponse.d.ts +3 -3
- package/dist/cjs/api/resources/fhirProvider/types/FhirProviderResponse.d.ts +3 -3
- package/dist/cjs/api/resources/fhirProvider/types/FhirProviderSandboxInfo.d.ts +4 -4
- package/dist/cjs/api/resources/fhirProvider/types/FhirProviderTemplate.d.ts +8 -8
- package/dist/cjs/api/resources/fhirProvider/types/FhirQueryResponse.d.ts +4 -4
- package/dist/cjs/api/resources/fhirProvider/types/JsonWebKey.d.ts +6 -6
- package/dist/cjs/api/resources/fhirProvider/types/JwtAuth.d.ts +3 -3
- package/dist/cjs/api/resources/fhirProvider/types/OnBehalfOfAuth.d.ts +2 -2
- package/dist/cjs/api/resources/fhirProvider/types/ServiceAccountMetadata.d.ts +4 -4
- package/dist/cjs/api/resources/fhirProvider/types/SmartConfiguration.d.ts +5 -5
- package/dist/cjs/api/resources/lang2Fhir/client/Client.d.ts +18 -19
- package/dist/cjs/api/resources/lang2Fhir/client/Client.js +31 -112
- package/dist/cjs/api/resources/lang2Fhir/client/requests/index.d.ts +1 -1
- package/dist/cjs/api/resources/lang2Fhir/client/requests/index.js +3 -0
- package/dist/cjs/api/resources/lang2Fhir/errors/BadRequestError.js +5 -1
- package/dist/cjs/api/resources/lang2Fhir/errors/FailedDependencyError.js +5 -1
- package/dist/cjs/api/resources/lang2Fhir/errors/ForbiddenError.js +5 -1
- package/dist/cjs/api/resources/lang2Fhir/errors/InternalServerError.js +5 -1
- package/dist/cjs/api/resources/lang2Fhir/errors/UnauthorizedError.js +5 -1
- package/dist/cjs/api/resources/lang2Fhir/errors/UnprocessableEntityError.js +5 -1
- package/dist/cjs/api/resources/lang2Fhir/exports.d.ts +2 -0
- package/dist/cjs/api/resources/lang2Fhir/exports.js +21 -0
- package/dist/cjs/api/resources/lang2Fhir/types/CreateMultiResponse.d.ts +15 -15
- package/dist/cjs/api/resources/lang2Fhir/types/Lang2FhirUploadProfileResponse.d.ts +4 -4
- package/dist/cjs/api/resources/lang2Fhir/types/SearchResponse.d.ts +2 -2
- package/dist/cjs/api/resources/summary/client/Client.d.ts +18 -19
- package/dist/cjs/api/resources/summary/client/Client.js +31 -112
- package/dist/cjs/api/resources/summary/client/requests/index.d.ts +1 -1
- package/dist/cjs/api/resources/summary/client/requests/index.js +3 -0
- package/dist/cjs/api/resources/summary/errors/BadRequestError.js +5 -1
- package/dist/cjs/api/resources/summary/errors/ForbiddenError.js +5 -1
- package/dist/cjs/api/resources/summary/errors/InternalServerError.js +5 -1
- package/dist/cjs/api/resources/summary/errors/NotFoundError.js +5 -1
- package/dist/cjs/api/resources/summary/errors/UnauthorizedError.js +5 -1
- package/dist/cjs/api/resources/summary/exports.d.ts +2 -0
- package/dist/cjs/api/resources/summary/exports.js +21 -0
- package/dist/cjs/api/resources/summary/types/CreateSummaryResponse.d.ts +4 -4
- package/dist/cjs/api/resources/summary/types/CreateSummaryTemplateResponse.d.ts +4 -4
- package/dist/cjs/api/resources/summary/types/ErrorResponse.d.ts +2 -2
- package/dist/cjs/api/resources/summary/types/FhirBundle.d.ts +1 -1
- package/dist/cjs/api/resources/summary/types/SummaryDeleteTemplateResponse.d.ts +2 -2
- package/dist/cjs/api/resources/summary/types/SummaryGetTemplateResponse.d.ts +2 -2
- package/dist/cjs/api/resources/summary/types/SummaryListTemplatesResponse.d.ts +2 -2
- package/dist/cjs/api/resources/summary/types/SummaryTemplate.d.ts +9 -9
- package/dist/cjs/api/resources/summary/types/SummaryUpdateTemplateResponse.d.ts +3 -3
- package/dist/cjs/api/resources/tools/client/Client.d.ts +17 -18
- package/dist/cjs/api/resources/tools/client/Client.js +32 -91
- package/dist/cjs/api/resources/tools/client/requests/index.d.ts +1 -1
- package/dist/cjs/api/resources/tools/client/requests/index.js +3 -0
- package/dist/cjs/api/resources/tools/errors/BadRequestError.js +5 -1
- package/dist/cjs/api/resources/tools/errors/FailedDependencyError.js +5 -1
- package/dist/cjs/api/resources/tools/errors/ForbiddenError.js +5 -1
- package/dist/cjs/api/resources/tools/errors/InternalServerError.js +5 -1
- package/dist/cjs/api/resources/tools/errors/UnauthorizedError.js +5 -1
- package/dist/cjs/api/resources/tools/exports.d.ts +3 -0
- package/dist/cjs/api/resources/tools/exports.js +22 -0
- package/dist/cjs/api/resources/tools/resources/mcpServer/client/Client.d.ts +17 -18
- package/dist/cjs/api/resources/tools/resources/mcpServer/client/Client.js +24 -79
- package/dist/cjs/api/resources/tools/resources/mcpServer/exports.d.ts +3 -0
- package/dist/cjs/api/resources/tools/resources/mcpServer/exports.js +22 -0
- package/dist/cjs/api/resources/tools/resources/mcpServer/resources/tools/client/Client.d.ts +14 -15
- package/dist/cjs/api/resources/tools/resources/mcpServer/resources/tools/client/Client.js +23 -78
- package/dist/cjs/api/resources/tools/resources/mcpServer/resources/tools/exports.d.ts +2 -0
- package/dist/cjs/api/resources/tools/resources/mcpServer/resources/tools/exports.js +21 -0
- package/dist/cjs/api/resources/tools/types/CohortResponse.d.ts +5 -5
- package/dist/cjs/api/resources/tools/types/Lang2FhirAndCreateMultiResponse.d.ts +10 -10
- package/dist/cjs/api/resources/tools/types/Lang2FhirAndCreateResponse.d.ts +4 -4
- package/dist/cjs/api/resources/tools/types/Lang2FhirAndSearchResponse.d.ts +5 -5
- package/dist/cjs/api/resources/tools/types/McpServerResponse.d.ts +7 -7
- package/dist/cjs/api/resources/tools/types/McpServerToolCallResponse.d.ts +4 -4
- package/dist/cjs/api/resources/tools/types/McpServerToolResponse.d.ts +9 -9
- package/dist/cjs/api/resources/tools/types/SearchConcept.d.ts +4 -4
- package/dist/cjs/api/resources/workflows/client/Client.d.ts +18 -19
- package/dist/cjs/api/resources/workflows/client/Client.js +43 -128
- package/dist/cjs/api/resources/workflows/errors/BadRequestError.js +5 -1
- package/dist/cjs/api/resources/workflows/errors/ForbiddenError.js +5 -1
- package/dist/cjs/api/resources/workflows/errors/InternalServerError.js +5 -1
- package/dist/cjs/api/resources/workflows/errors/NotFoundError.js +5 -1
- package/dist/cjs/api/resources/workflows/errors/UnauthorizedError.js +5 -1
- package/dist/cjs/api/resources/workflows/exports.d.ts +2 -0
- package/dist/cjs/api/resources/workflows/exports.js +21 -0
- package/dist/cjs/api/resources/workflows/types/CreateWorkflowResponse.d.ts +5 -5
- package/dist/cjs/api/resources/workflows/types/DecisionNodeDefinition.d.ts +3 -3
- package/dist/cjs/api/resources/workflows/types/ExecuteWorkflowResponse.d.ts +4 -4
- package/dist/cjs/api/resources/workflows/types/Lang2FhirCreateDefinition.d.ts +4 -4
- package/dist/cjs/api/resources/workflows/types/Lang2FhirSearchDefinition.d.ts +5 -5
- package/dist/cjs/api/resources/workflows/types/ListWorkflowsResponse.d.ts +4 -4
- package/dist/cjs/api/resources/workflows/types/StepOperation.d.ts +4 -4
- package/dist/cjs/api/resources/workflows/types/SubWorkflowDefinition.d.ts +3 -3
- package/dist/cjs/api/resources/workflows/types/WorkflowConfig.d.ts +2 -2
- package/dist/cjs/api/resources/workflows/types/WorkflowDefinition.d.ts +8 -8
- package/dist/cjs/api/resources/workflows/types/WorkflowGraph.d.ts +1 -1
- package/dist/cjs/api/resources/workflows/types/WorkflowResponse.d.ts +9 -9
- package/dist/cjs/api/resources/workflows/types/WorkflowStep.d.ts +8 -8
- package/dist/cjs/api/resources/workflows/types/WorkflowStepSummary.d.ts +5 -5
- package/dist/cjs/api/resources/workflows/types/WorkflowsDeleteResponse.d.ts +2 -2
- package/dist/cjs/api/resources/workflows/types/WorkflowsGetResponse.d.ts +3 -3
- package/dist/cjs/api/resources/workflows/types/WorkflowsUpdateResponse.d.ts +4 -4
- package/dist/cjs/auth/OAuthAuthProvider.d.ts +45 -0
- package/dist/cjs/auth/OAuthAuthProvider.js +190 -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 +4 -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 +1 -0
- package/dist/cjs/core/auth/index.js +3 -1
- package/dist/cjs/core/fetcher/BinaryResponse.d.ts +6 -7
- package/dist/cjs/core/fetcher/EndpointSupplier.d.ts +2 -2
- package/dist/cjs/core/fetcher/Fetcher.d.ts +6 -3
- package/dist/cjs/core/fetcher/Fetcher.js +10 -3
- package/dist/cjs/core/fetcher/getResponseBody.js +18 -4
- package/dist/cjs/core/fetcher/makeRequest.d.ts +6 -1
- package/dist/cjs/core/fetcher/makeRequest.js +30 -9
- package/dist/cjs/core/fetcher/signals.d.ts +1 -1
- package/dist/cjs/core/headers.d.ts +2 -2
- package/dist/cjs/core/runtime/runtime.js +17 -15
- package/dist/cjs/core/stream/Stream.d.ts +9 -0
- package/dist/cjs/core/stream/Stream.js +100 -5
- package/dist/cjs/errors/handleNonStatusCodeError.d.ts +2 -0
- package/dist/cjs/errors/handleNonStatusCodeError.js +65 -0
- package/dist/cjs/errors/phenomlError.js +5 -1
- package/dist/cjs/errors/phenomlTimeoutError.js +5 -1
- package/dist/cjs/index.d.ts +4 -2
- package/dist/cjs/index.js +9 -5
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.d.mts +13 -4
- package/dist/esm/BaseClient.mjs +24 -1
- package/dist/esm/Client.d.mts +34 -34
- package/dist/esm/Client.mjs +23 -31
- package/dist/esm/api/resources/agent/client/Client.d.mts +26 -27
- package/dist/esm/api/resources/agent/client/Client.mjs +55 -184
- package/dist/esm/api/resources/agent/errors/BadRequestError.mjs +5 -1
- package/dist/esm/api/resources/agent/errors/ForbiddenError.mjs +5 -1
- package/dist/esm/api/resources/agent/errors/InternalServerError.mjs +5 -1
- package/dist/esm/api/resources/agent/errors/NotFoundError.mjs +5 -1
- package/dist/esm/api/resources/agent/errors/UnauthorizedError.mjs +5 -1
- package/dist/esm/api/resources/agent/exports.d.mts +3 -0
- package/dist/esm/api/resources/agent/exports.mjs +4 -0
- package/dist/esm/api/resources/agent/resources/prompts/client/Client.d.mts +20 -21
- package/dist/esm/api/resources/agent/resources/prompts/client/Client.mjs +34 -128
- package/dist/esm/api/resources/agent/resources/prompts/exports.d.mts +2 -0
- package/dist/esm/api/resources/agent/resources/prompts/exports.mjs +3 -0
- package/dist/esm/api/resources/agent/resources/prompts/types/PromptsDeleteResponse.d.mts +2 -2
- package/dist/esm/api/resources/agent/resources/prompts/types/PromptsListResponse.d.mts +3 -3
- package/dist/esm/api/resources/agent/types/AgentChatResponse.d.mts +4 -4
- package/dist/esm/api/resources/agent/types/AgentChatStreamEvent.d.mts +8 -8
- package/dist/esm/api/resources/agent/types/AgentCreateRequest.d.mts +4 -4
- package/dist/esm/api/resources/agent/types/AgentDeleteResponse.d.mts +2 -2
- package/dist/esm/api/resources/agent/types/AgentGetChatMessagesResponse.d.mts +3 -3
- package/dist/esm/api/resources/agent/types/AgentListResponse.d.mts +3 -3
- package/dist/esm/api/resources/agent/types/AgentPromptsResponse.d.mts +3 -3
- package/dist/esm/api/resources/agent/types/AgentResponse.d.mts +3 -3
- package/dist/esm/api/resources/agent/types/AgentTemplate.d.mts +8 -8
- package/dist/esm/api/resources/agent/types/ChatMessageTemplate.d.mts +10 -10
- package/dist/esm/api/resources/agent/types/ChatSessionTemplate.d.mts +9 -9
- package/dist/esm/api/resources/agent/types/JsonPatchOperation.d.mts +2 -2
- package/dist/esm/api/resources/agent/types/PromptTemplate.d.mts +6 -6
- package/dist/esm/api/resources/agent/types/SuccessResponse.d.mts +2 -2
- package/dist/esm/api/resources/authtoken/client/Client.d.mts +9 -9
- package/dist/esm/api/resources/authtoken/client/Client.mjs +6 -5
- package/dist/esm/api/resources/authtoken/errors/BadRequestError.mjs +5 -1
- package/dist/esm/api/resources/authtoken/errors/InternalServerError.d.mts +5 -0
- package/dist/esm/api/resources/authtoken/errors/InternalServerError.mjs +17 -0
- package/dist/esm/api/resources/authtoken/errors/UnauthorizedError.mjs +5 -1
- package/dist/esm/api/resources/authtoken/errors/index.d.mts +1 -0
- package/dist/esm/api/resources/authtoken/errors/index.mjs +1 -0
- package/dist/esm/api/resources/authtoken/exports.d.mts +3 -0
- package/dist/esm/api/resources/authtoken/exports.mjs +4 -0
- package/dist/esm/api/resources/authtoken/resources/auth/client/Client.d.mts +28 -30
- package/dist/esm/api/resources/authtoken/resources/auth/client/Client.mjs +74 -41
- package/dist/esm/api/resources/authtoken/resources/auth/client/requests/ClientCredentialsRequest.d.mts +12 -0
- package/dist/esm/api/resources/authtoken/resources/auth/client/requests/ClientCredentialsRequest.mjs +2 -0
- package/dist/esm/api/resources/authtoken/resources/auth/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/authtoken/resources/auth/exports.d.mts +2 -0
- package/dist/esm/api/resources/authtoken/resources/auth/exports.mjs +3 -0
- package/dist/esm/api/resources/authtoken/types/BadRequestErrorBody.d.mts +3 -3
- package/dist/esm/api/resources/authtoken/types/OAuthError.d.mts +19 -0
- package/dist/esm/api/resources/authtoken/types/OAuthError.mjs +11 -0
- package/dist/esm/api/resources/authtoken/types/TokenResponse.d.mts +8 -0
- package/dist/esm/api/resources/authtoken/types/TokenResponse.mjs +2 -0
- package/dist/esm/api/resources/authtoken/types/UnauthorizedErrorBody.d.mts +3 -3
- package/dist/esm/api/resources/authtoken/types/index.d.mts +2 -0
- package/dist/esm/api/resources/authtoken/types/index.mjs +2 -0
- package/dist/esm/api/resources/cohort/client/Client.d.mts +8 -9
- package/dist/esm/api/resources/cohort/client/Client.mjs +10 -26
- package/dist/esm/api/resources/cohort/errors/BadRequestError.mjs +5 -1
- package/dist/esm/api/resources/cohort/errors/InternalServerError.mjs +5 -1
- package/dist/esm/api/resources/cohort/errors/UnauthorizedError.mjs +5 -1
- package/dist/esm/api/resources/cohort/exports.d.mts +2 -0
- package/dist/esm/api/resources/cohort/exports.mjs +3 -0
- package/dist/esm/api/resources/cohort/types/CohortResponse.d.mts +3 -3
- package/dist/esm/api/resources/cohort/types/SearchConcept.d.mts +4 -4
- package/dist/esm/api/resources/construe/client/Client.d.mts +28 -29
- package/dist/esm/api/resources/construe/client/Client.mjs +77 -238
- package/dist/esm/api/resources/construe/client/requests/index.d.mts +1 -1
- package/dist/esm/api/resources/construe/client/requests/index.mjs +1 -1
- package/dist/esm/api/resources/construe/errors/BadRequestError.mjs +5 -1
- package/dist/esm/api/resources/construe/errors/ConflictError.mjs +5 -1
- package/dist/esm/api/resources/construe/errors/FailedDependencyError.mjs +5 -1
- package/dist/esm/api/resources/construe/errors/ForbiddenError.mjs +5 -1
- package/dist/esm/api/resources/construe/errors/GatewayTimeoutError.mjs +5 -1
- package/dist/esm/api/resources/construe/errors/InternalServerError.mjs +5 -1
- package/dist/esm/api/resources/construe/errors/NotFoundError.mjs +5 -1
- package/dist/esm/api/resources/construe/errors/NotImplementedError.mjs +5 -1
- package/dist/esm/api/resources/construe/errors/ServiceUnavailableError.mjs +5 -1
- package/dist/esm/api/resources/construe/errors/UnauthorizedError.mjs +5 -1
- package/dist/esm/api/resources/construe/exports.d.mts +2 -0
- package/dist/esm/api/resources/construe/exports.mjs +3 -0
- package/dist/esm/api/resources/construe/types/CodeResponse.d.mts +1 -1
- package/dist/esm/api/resources/construe/types/ConstrueUploadCodeSystemResponse.d.mts +3 -3
- package/dist/esm/api/resources/construe/types/ExtractRequestConfig.d.mts +8 -8
- package/dist/esm/api/resources/construe/types/ExtractRequestSystem.d.mts +2 -2
- package/dist/esm/api/resources/construe/types/ExtractedCodeResult.d.mts +3 -3
- package/dist/esm/api/resources/construe/types/GetCodeResponse.d.mts +1 -1
- package/dist/esm/api/resources/construe/types/ListCodesResponse.d.mts +1 -1
- package/dist/esm/api/resources/fhir/client/Client.d.mts +18 -19
- package/dist/esm/api/resources/fhir/client/Client.mjs +44 -132
- package/dist/esm/api/resources/fhir/client/requests/FhirSearchRequest.d.mts +0 -6
- package/dist/esm/api/resources/fhir/errors/BadGatewayError.mjs +5 -1
- package/dist/esm/api/resources/fhir/errors/BadRequestError.mjs +5 -1
- package/dist/esm/api/resources/fhir/errors/InternalServerError.mjs +5 -1
- package/dist/esm/api/resources/fhir/errors/NotFoundError.mjs +5 -1
- package/dist/esm/api/resources/fhir/errors/UnauthorizedError.mjs +5 -1
- package/dist/esm/api/resources/fhir/exports.d.mts +2 -0
- package/dist/esm/api/resources/fhir/exports.mjs +3 -0
- package/dist/esm/api/resources/fhir/types/ErrorResponse.d.mts +2 -2
- package/dist/esm/api/resources/fhir/types/FhirBundle.d.mts +8 -8
- package/dist/esm/api/resources/fhir/types/FhirPatchRequestBodyItem.d.mts +2 -2
- package/dist/esm/api/resources/fhir/types/FhirResource.d.mts +5 -5
- package/dist/esm/api/resources/fhirProvider/client/Client.d.mts +20 -21
- package/dist/esm/api/resources/fhirProvider/client/Client.mjs +34 -128
- package/dist/esm/api/resources/fhirProvider/errors/BadRequestError.mjs +5 -1
- package/dist/esm/api/resources/fhirProvider/errors/ForbiddenError.mjs +5 -1
- package/dist/esm/api/resources/fhirProvider/errors/InternalServerError.mjs +5 -1
- package/dist/esm/api/resources/fhirProvider/errors/NotFoundError.mjs +5 -1
- package/dist/esm/api/resources/fhirProvider/errors/UnauthorizedError.mjs +5 -1
- package/dist/esm/api/resources/fhirProvider/exports.d.mts +2 -0
- package/dist/esm/api/resources/fhirProvider/exports.mjs +3 -0
- package/dist/esm/api/resources/fhirProvider/types/ClientSecretAuth.d.mts +2 -2
- package/dist/esm/api/resources/fhirProvider/types/FhirProviderAuthConfig.d.mts +12 -12
- package/dist/esm/api/resources/fhirProvider/types/FhirProviderDeleteResponse.d.mts +2 -2
- package/dist/esm/api/resources/fhirProvider/types/FhirProviderListResponse.d.mts +3 -3
- package/dist/esm/api/resources/fhirProvider/types/FhirProviderRemoveAuthConfigResponse.d.mts +3 -3
- package/dist/esm/api/resources/fhirProvider/types/FhirProviderResponse.d.mts +3 -3
- package/dist/esm/api/resources/fhirProvider/types/FhirProviderSandboxInfo.d.mts +4 -4
- package/dist/esm/api/resources/fhirProvider/types/FhirProviderTemplate.d.mts +8 -8
- package/dist/esm/api/resources/fhirProvider/types/FhirQueryResponse.d.mts +4 -4
- package/dist/esm/api/resources/fhirProvider/types/JsonWebKey.d.mts +6 -6
- package/dist/esm/api/resources/fhirProvider/types/JwtAuth.d.mts +3 -3
- package/dist/esm/api/resources/fhirProvider/types/OnBehalfOfAuth.d.mts +2 -2
- package/dist/esm/api/resources/fhirProvider/types/ServiceAccountMetadata.d.mts +4 -4
- package/dist/esm/api/resources/fhirProvider/types/SmartConfiguration.d.mts +5 -5
- package/dist/esm/api/resources/lang2Fhir/client/Client.d.mts +18 -19
- package/dist/esm/api/resources/lang2Fhir/client/Client.mjs +30 -111
- package/dist/esm/api/resources/lang2Fhir/client/requests/index.d.mts +1 -1
- package/dist/esm/api/resources/lang2Fhir/client/requests/index.mjs +1 -1
- package/dist/esm/api/resources/lang2Fhir/errors/BadRequestError.mjs +5 -1
- package/dist/esm/api/resources/lang2Fhir/errors/FailedDependencyError.mjs +5 -1
- package/dist/esm/api/resources/lang2Fhir/errors/ForbiddenError.mjs +5 -1
- package/dist/esm/api/resources/lang2Fhir/errors/InternalServerError.mjs +5 -1
- package/dist/esm/api/resources/lang2Fhir/errors/UnauthorizedError.mjs +5 -1
- package/dist/esm/api/resources/lang2Fhir/errors/UnprocessableEntityError.mjs +5 -1
- package/dist/esm/api/resources/lang2Fhir/exports.d.mts +2 -0
- package/dist/esm/api/resources/lang2Fhir/exports.mjs +3 -0
- package/dist/esm/api/resources/lang2Fhir/types/CreateMultiResponse.d.mts +15 -15
- package/dist/esm/api/resources/lang2Fhir/types/Lang2FhirUploadProfileResponse.d.mts +4 -4
- package/dist/esm/api/resources/lang2Fhir/types/SearchResponse.d.mts +2 -2
- package/dist/esm/api/resources/summary/client/Client.d.mts +18 -19
- package/dist/esm/api/resources/summary/client/Client.mjs +30 -111
- package/dist/esm/api/resources/summary/client/requests/index.d.mts +1 -1
- package/dist/esm/api/resources/summary/client/requests/index.mjs +1 -1
- package/dist/esm/api/resources/summary/errors/BadRequestError.mjs +5 -1
- package/dist/esm/api/resources/summary/errors/ForbiddenError.mjs +5 -1
- package/dist/esm/api/resources/summary/errors/InternalServerError.mjs +5 -1
- package/dist/esm/api/resources/summary/errors/NotFoundError.mjs +5 -1
- package/dist/esm/api/resources/summary/errors/UnauthorizedError.mjs +5 -1
- package/dist/esm/api/resources/summary/exports.d.mts +2 -0
- package/dist/esm/api/resources/summary/exports.mjs +3 -0
- package/dist/esm/api/resources/summary/types/CreateSummaryResponse.d.mts +4 -4
- package/dist/esm/api/resources/summary/types/CreateSummaryTemplateResponse.d.mts +4 -4
- package/dist/esm/api/resources/summary/types/ErrorResponse.d.mts +2 -2
- package/dist/esm/api/resources/summary/types/FhirBundle.d.mts +1 -1
- package/dist/esm/api/resources/summary/types/SummaryDeleteTemplateResponse.d.mts +2 -2
- package/dist/esm/api/resources/summary/types/SummaryGetTemplateResponse.d.mts +2 -2
- package/dist/esm/api/resources/summary/types/SummaryListTemplatesResponse.d.mts +2 -2
- package/dist/esm/api/resources/summary/types/SummaryTemplate.d.mts +9 -9
- package/dist/esm/api/resources/summary/types/SummaryUpdateTemplateResponse.d.mts +3 -3
- package/dist/esm/api/resources/tools/client/Client.d.mts +17 -18
- package/dist/esm/api/resources/tools/client/Client.mjs +31 -90
- package/dist/esm/api/resources/tools/client/requests/index.d.mts +1 -1
- package/dist/esm/api/resources/tools/client/requests/index.mjs +1 -1
- package/dist/esm/api/resources/tools/errors/BadRequestError.mjs +5 -1
- package/dist/esm/api/resources/tools/errors/FailedDependencyError.mjs +5 -1
- package/dist/esm/api/resources/tools/errors/ForbiddenError.mjs +5 -1
- package/dist/esm/api/resources/tools/errors/InternalServerError.mjs +5 -1
- package/dist/esm/api/resources/tools/errors/UnauthorizedError.mjs +5 -1
- package/dist/esm/api/resources/tools/exports.d.mts +3 -0
- package/dist/esm/api/resources/tools/exports.mjs +4 -0
- package/dist/esm/api/resources/tools/resources/mcpServer/client/Client.d.mts +17 -18
- package/dist/esm/api/resources/tools/resources/mcpServer/client/Client.mjs +24 -79
- package/dist/esm/api/resources/tools/resources/mcpServer/exports.d.mts +3 -0
- package/dist/esm/api/resources/tools/resources/mcpServer/exports.mjs +4 -0
- package/dist/esm/api/resources/tools/resources/mcpServer/resources/tools/client/Client.d.mts +14 -15
- package/dist/esm/api/resources/tools/resources/mcpServer/resources/tools/client/Client.mjs +22 -77
- package/dist/esm/api/resources/tools/resources/mcpServer/resources/tools/exports.d.mts +2 -0
- package/dist/esm/api/resources/tools/resources/mcpServer/resources/tools/exports.mjs +3 -0
- package/dist/esm/api/resources/tools/types/CohortResponse.d.mts +5 -5
- package/dist/esm/api/resources/tools/types/Lang2FhirAndCreateMultiResponse.d.mts +10 -10
- package/dist/esm/api/resources/tools/types/Lang2FhirAndCreateResponse.d.mts +4 -4
- package/dist/esm/api/resources/tools/types/Lang2FhirAndSearchResponse.d.mts +5 -5
- package/dist/esm/api/resources/tools/types/McpServerResponse.d.mts +7 -7
- package/dist/esm/api/resources/tools/types/McpServerToolCallResponse.d.mts +4 -4
- package/dist/esm/api/resources/tools/types/McpServerToolResponse.d.mts +9 -9
- package/dist/esm/api/resources/tools/types/SearchConcept.d.mts +4 -4
- package/dist/esm/api/resources/workflows/client/Client.d.mts +18 -19
- package/dist/esm/api/resources/workflows/client/Client.mjs +42 -127
- package/dist/esm/api/resources/workflows/errors/BadRequestError.mjs +5 -1
- package/dist/esm/api/resources/workflows/errors/ForbiddenError.mjs +5 -1
- package/dist/esm/api/resources/workflows/errors/InternalServerError.mjs +5 -1
- package/dist/esm/api/resources/workflows/errors/NotFoundError.mjs +5 -1
- package/dist/esm/api/resources/workflows/errors/UnauthorizedError.mjs +5 -1
- package/dist/esm/api/resources/workflows/exports.d.mts +2 -0
- package/dist/esm/api/resources/workflows/exports.mjs +3 -0
- package/dist/esm/api/resources/workflows/types/CreateWorkflowResponse.d.mts +5 -5
- package/dist/esm/api/resources/workflows/types/DecisionNodeDefinition.d.mts +3 -3
- package/dist/esm/api/resources/workflows/types/ExecuteWorkflowResponse.d.mts +4 -4
- package/dist/esm/api/resources/workflows/types/Lang2FhirCreateDefinition.d.mts +4 -4
- package/dist/esm/api/resources/workflows/types/Lang2FhirSearchDefinition.d.mts +5 -5
- package/dist/esm/api/resources/workflows/types/ListWorkflowsResponse.d.mts +4 -4
- package/dist/esm/api/resources/workflows/types/StepOperation.d.mts +4 -4
- package/dist/esm/api/resources/workflows/types/SubWorkflowDefinition.d.mts +3 -3
- package/dist/esm/api/resources/workflows/types/WorkflowConfig.d.mts +2 -2
- package/dist/esm/api/resources/workflows/types/WorkflowDefinition.d.mts +8 -8
- package/dist/esm/api/resources/workflows/types/WorkflowGraph.d.mts +1 -1
- package/dist/esm/api/resources/workflows/types/WorkflowResponse.d.mts +9 -9
- package/dist/esm/api/resources/workflows/types/WorkflowStep.d.mts +8 -8
- package/dist/esm/api/resources/workflows/types/WorkflowStepSummary.d.mts +5 -5
- package/dist/esm/api/resources/workflows/types/WorkflowsDeleteResponse.d.mts +2 -2
- package/dist/esm/api/resources/workflows/types/WorkflowsGetResponse.d.mts +3 -3
- package/dist/esm/api/resources/workflows/types/WorkflowsUpdateResponse.d.mts +4 -4
- package/dist/esm/auth/OAuthAuthProvider.d.mts +45 -0
- package/dist/esm/auth/OAuthAuthProvider.mjs +152 -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 +4 -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 +1 -0
- package/dist/esm/core/auth/index.mjs +1 -0
- package/dist/esm/core/fetcher/BinaryResponse.d.mts +6 -7
- package/dist/esm/core/fetcher/EndpointSupplier.d.mts +2 -2
- package/dist/esm/core/fetcher/Fetcher.d.mts +6 -3
- package/dist/esm/core/fetcher/Fetcher.mjs +10 -3
- package/dist/esm/core/fetcher/getResponseBody.mjs +18 -4
- package/dist/esm/core/fetcher/makeRequest.d.mts +6 -1
- package/dist/esm/core/fetcher/makeRequest.mjs +28 -9
- package/dist/esm/core/fetcher/signals.d.mts +1 -1
- package/dist/esm/core/headers.d.mts +2 -2
- package/dist/esm/core/runtime/runtime.mjs +17 -15
- package/dist/esm/core/stream/Stream.d.mts +9 -0
- package/dist/esm/core/stream/Stream.mjs +100 -5
- package/dist/esm/errors/handleNonStatusCodeError.d.mts +2 -0
- package/dist/esm/errors/handleNonStatusCodeError.mjs +29 -0
- package/dist/esm/errors/phenomlError.mjs +5 -1
- package/dist/esm/errors/phenomlTimeoutError.mjs +5 -1
- package/dist/esm/index.d.mts +4 -2
- package/dist/esm/index.mjs +3 -2
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +162 -5
- package/reference.md +141 -74
- package/dist/cjs/WrapperClient.d.ts +0 -21
- package/dist/cjs/WrapperClient.js +0 -111
- package/dist/cjs/core/fetcher/ResponseWithBody.d.ts +0 -4
- package/dist/cjs/core/fetcher/ResponseWithBody.js +0 -6
- package/dist/esm/WrapperClient.d.mts +0 -21
- package/dist/esm/WrapperClient.mjs +0 -75
- package/dist/esm/core/fetcher/ResponseWithBody.d.mts +0 -4
- package/dist/esm/core/fetcher/ResponseWithBody.mjs +0 -3
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BearerToken = exports.BasicAuth = void 0;
|
|
3
|
+
exports.NoOpAuthProvider = exports.BearerToken = exports.BasicAuth = void 0;
|
|
4
4
|
var BasicAuth_js_1 = require("./BasicAuth.js");
|
|
5
5
|
Object.defineProperty(exports, "BasicAuth", { enumerable: true, get: function () { return BasicAuth_js_1.BasicAuth; } });
|
|
6
6
|
var BearerToken_js_1 = require("./BearerToken.js");
|
|
7
7
|
Object.defineProperty(exports, "BearerToken", { enumerable: true, get: function () { return BearerToken_js_1.BearerToken; } });
|
|
8
|
+
var NoOpAuthProvider_js_1 = require("./NoOpAuthProvider.js");
|
|
9
|
+
Object.defineProperty(exports, "NoOpAuthProvider", { enumerable: true, get: function () { return NoOpAuthProvider_js_1.NoOpAuthProvider; } });
|
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
import type { ResponseWithBody } from "./ResponseWithBody.js";
|
|
2
1
|
export type BinaryResponse = {
|
|
3
2
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bodyUsed) */
|
|
4
|
-
bodyUsed:
|
|
3
|
+
bodyUsed: Response["bodyUsed"];
|
|
5
4
|
/**
|
|
6
5
|
* Returns a ReadableStream of the response body.
|
|
7
6
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/body)
|
|
8
7
|
*/
|
|
9
|
-
stream: () =>
|
|
8
|
+
stream: () => Response["body"];
|
|
10
9
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/arrayBuffer) */
|
|
11
|
-
arrayBuffer: () =>
|
|
10
|
+
arrayBuffer: () => ReturnType<Response["arrayBuffer"]>;
|
|
12
11
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/blob) */
|
|
13
|
-
blob: () =>
|
|
12
|
+
blob: () => ReturnType<Response["blob"]>;
|
|
14
13
|
/**
|
|
15
14
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bytes)
|
|
16
15
|
* Some versions of the Fetch API may not support this method.
|
|
17
16
|
*/
|
|
18
|
-
bytes?():
|
|
17
|
+
bytes?(): ReturnType<Response["bytes"]>;
|
|
19
18
|
};
|
|
20
|
-
export declare function getBinaryResponse(response:
|
|
19
|
+
export declare function getBinaryResponse(response: Response): BinaryResponse;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { EndpointMetadata } from "./EndpointMetadata.js";
|
|
2
2
|
import type { Supplier } from "./Supplier.js";
|
|
3
3
|
type EndpointSupplierFn<T> = (arg: {
|
|
4
|
-
endpointMetadata
|
|
4
|
+
endpointMetadata?: EndpointMetadata;
|
|
5
5
|
}) => T | Promise<T>;
|
|
6
6
|
export type EndpointSupplier<T> = Supplier<T> | EndpointSupplierFn<T>;
|
|
7
7
|
export declare const EndpointSupplier: {
|
|
8
8
|
get: <T>(supplier: EndpointSupplier<T>, arg: {
|
|
9
|
-
endpointMetadata
|
|
9
|
+
endpointMetadata?: EndpointMetadata;
|
|
10
10
|
}) => Promise<T>;
|
|
11
11
|
};
|
|
12
12
|
export {};
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { type LogConfig, type Logger } from "../logging/logger.js";
|
|
2
2
|
import type { APIResponse } from "./APIResponse.js";
|
|
3
3
|
import type { EndpointMetadata } from "./EndpointMetadata.js";
|
|
4
|
-
import { EndpointSupplier } from "./EndpointSupplier.js";
|
|
5
4
|
export type FetchFunction = <R = unknown>(args: Fetcher.Args) => Promise<APIResponse<R, Fetcher.Error>>;
|
|
6
5
|
export declare namespace Fetcher {
|
|
7
6
|
interface Args {
|
|
8
7
|
url: string;
|
|
9
8
|
method: string;
|
|
10
9
|
contentType?: string;
|
|
11
|
-
headers?: Record<string,
|
|
10
|
+
headers?: Record<string, unknown>;
|
|
12
11
|
queryParameters?: Record<string, unknown>;
|
|
13
12
|
body?: unknown;
|
|
14
13
|
timeoutMs?: number;
|
|
@@ -22,7 +21,7 @@ export declare namespace Fetcher {
|
|
|
22
21
|
fetchFn?: typeof fetch;
|
|
23
22
|
logging?: LogConfig | Logger;
|
|
24
23
|
}
|
|
25
|
-
type Error = FailedStatusCodeError | NonJsonError | TimeoutError | UnknownError;
|
|
24
|
+
type Error = FailedStatusCodeError | NonJsonError | BodyIsNullError | TimeoutError | UnknownError;
|
|
26
25
|
interface FailedStatusCodeError {
|
|
27
26
|
reason: "status-code";
|
|
28
27
|
statusCode: number;
|
|
@@ -33,6 +32,10 @@ export declare namespace Fetcher {
|
|
|
33
32
|
statusCode: number;
|
|
34
33
|
rawBody: string;
|
|
35
34
|
}
|
|
35
|
+
interface BodyIsNullError {
|
|
36
|
+
reason: "body-is-null";
|
|
37
|
+
statusCode: number;
|
|
38
|
+
}
|
|
36
39
|
interface TimeoutError {
|
|
37
40
|
reason: "timeout";
|
|
38
41
|
}
|
|
@@ -156,7 +156,13 @@ function getHeaders(args) {
|
|
|
156
156
|
return __awaiter(this, void 0, void 0, function* () {
|
|
157
157
|
var _a;
|
|
158
158
|
const newHeaders = new Headers_js_1.Headers();
|
|
159
|
-
newHeaders.set("Accept", args.responseType === "json"
|
|
159
|
+
newHeaders.set("Accept", args.responseType === "json"
|
|
160
|
+
? "application/json"
|
|
161
|
+
: args.responseType === "text"
|
|
162
|
+
? "text/plain"
|
|
163
|
+
: args.responseType === "sse"
|
|
164
|
+
? "text/event-stream"
|
|
165
|
+
: "*/*");
|
|
160
166
|
if (args.body !== undefined && args.contentType != null) {
|
|
161
167
|
newHeaders.set("Content-Type", args.contentType);
|
|
162
168
|
}
|
|
@@ -200,7 +206,7 @@ function fetcherImpl(args) {
|
|
|
200
206
|
}
|
|
201
207
|
try {
|
|
202
208
|
const response = yield (0, requestWithRetries_js_1.requestWithRetries)(() => __awaiter(this, void 0, void 0, function* () {
|
|
203
|
-
return (0, makeRequest_js_1.makeRequest)(fetchFn, url, args.method, headers, requestBody, args.timeoutMs, args.abortSignal, args.withCredentials, args.duplex);
|
|
209
|
+
return (0, makeRequest_js_1.makeRequest)(fetchFn, url, args.method, headers, requestBody, args.timeoutMs, args.abortSignal, args.withCredentials, args.duplex, args.responseType === "streaming" || args.responseType === "sse");
|
|
204
210
|
}), args.maxRetries);
|
|
205
211
|
if (response.status >= 200 && response.status < 400) {
|
|
206
212
|
if (logger.isDebug()) {
|
|
@@ -212,9 +218,10 @@ function fetcherImpl(args) {
|
|
|
212
218
|
};
|
|
213
219
|
logger.debug("HTTP request succeeded", metadata);
|
|
214
220
|
}
|
|
221
|
+
const body = yield (0, getResponseBody_js_1.getResponseBody)(response, args.responseType);
|
|
215
222
|
return {
|
|
216
223
|
ok: true,
|
|
217
|
-
body:
|
|
224
|
+
body: body,
|
|
218
225
|
headers: response.headers,
|
|
219
226
|
rawResponse: (0, RawResponse_js_1.toRawResponse)(response),
|
|
220
227
|
};
|
|
@@ -12,12 +12,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.getResponseBody = getResponseBody;
|
|
13
13
|
const json_js_1 = require("../json.js");
|
|
14
14
|
const BinaryResponse_js_1 = require("./BinaryResponse.js");
|
|
15
|
-
const ResponseWithBody_js_1 = require("./ResponseWithBody.js");
|
|
16
15
|
function getResponseBody(response, responseType) {
|
|
17
16
|
return __awaiter(this, void 0, void 0, function* () {
|
|
18
|
-
if (!(0, ResponseWithBody_js_1.isResponseWithBody)(response)) {
|
|
19
|
-
return undefined;
|
|
20
|
-
}
|
|
21
17
|
switch (responseType) {
|
|
22
18
|
case "binary-response":
|
|
23
19
|
return (0, BinaryResponse_js_1.getBinaryResponse)(response);
|
|
@@ -26,8 +22,26 @@ function getResponseBody(response, responseType) {
|
|
|
26
22
|
case "arrayBuffer":
|
|
27
23
|
return yield response.arrayBuffer();
|
|
28
24
|
case "sse":
|
|
25
|
+
if (response.body == null) {
|
|
26
|
+
return {
|
|
27
|
+
ok: false,
|
|
28
|
+
error: {
|
|
29
|
+
reason: "body-is-null",
|
|
30
|
+
statusCode: response.status,
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
}
|
|
29
34
|
return response.body;
|
|
30
35
|
case "streaming":
|
|
36
|
+
if (response.body == null) {
|
|
37
|
+
return {
|
|
38
|
+
ok: false,
|
|
39
|
+
error: {
|
|
40
|
+
reason: "body-is-null",
|
|
41
|
+
statusCode: response.status,
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
}
|
|
31
45
|
return response.body;
|
|
32
46
|
case "text":
|
|
33
47
|
return yield response.text();
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
export declare
|
|
1
|
+
export declare function isCacheNoStoreSupported(): boolean;
|
|
2
|
+
/**
|
|
3
|
+
* Reset the cached result of `isCacheNoStoreSupported`. Exposed for testing only.
|
|
4
|
+
*/
|
|
5
|
+
export declare function resetCacheNoStoreSupported(): void;
|
|
6
|
+
export declare const makeRequest: (fetchFn: (url: string, init: RequestInit) => Promise<Response>, url: string, method: string, headers: Headers | Record<string, string>, requestBody: BodyInit | undefined, timeoutMs?: number, abortSignal?: AbortSignal, withCredentials?: boolean, duplex?: "half", disableCache?: boolean) => Promise<Response>;
|
|
@@ -10,8 +10,35 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.makeRequest = void 0;
|
|
13
|
+
exports.isCacheNoStoreSupported = isCacheNoStoreSupported;
|
|
14
|
+
exports.resetCacheNoStoreSupported = resetCacheNoStoreSupported;
|
|
13
15
|
const signals_js_1 = require("./signals.js");
|
|
14
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Cached result of checking whether the current runtime supports
|
|
18
|
+
* the `cache` option in `Request`. Some runtimes (e.g. Cloudflare Workers)
|
|
19
|
+
* throw a TypeError when this option is used.
|
|
20
|
+
*/
|
|
21
|
+
let _cacheNoStoreSupported;
|
|
22
|
+
function isCacheNoStoreSupported() {
|
|
23
|
+
if (_cacheNoStoreSupported != null) {
|
|
24
|
+
return _cacheNoStoreSupported;
|
|
25
|
+
}
|
|
26
|
+
try {
|
|
27
|
+
new Request("http://localhost", { cache: "no-store" });
|
|
28
|
+
_cacheNoStoreSupported = true;
|
|
29
|
+
}
|
|
30
|
+
catch (_a) {
|
|
31
|
+
_cacheNoStoreSupported = false;
|
|
32
|
+
}
|
|
33
|
+
return _cacheNoStoreSupported;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Reset the cached result of `isCacheNoStoreSupported`. Exposed for testing only.
|
|
37
|
+
*/
|
|
38
|
+
function resetCacheNoStoreSupported() {
|
|
39
|
+
_cacheNoStoreSupported = undefined;
|
|
40
|
+
}
|
|
41
|
+
const makeRequest = (fetchFn, url, method, headers, requestBody, timeoutMs, abortSignal, withCredentials, duplex, disableCache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
15
42
|
const signals = [];
|
|
16
43
|
let timeoutAbortId;
|
|
17
44
|
if (timeoutMs != null) {
|
|
@@ -23,15 +50,9 @@ const makeRequest = (fetchFn, url, method, headers, requestBody, timeoutMs, abor
|
|
|
23
50
|
signals.push(abortSignal);
|
|
24
51
|
}
|
|
25
52
|
const newSignals = (0, signals_js_1.anySignal)(signals);
|
|
26
|
-
const response = yield fetchFn(url, {
|
|
27
|
-
method: method,
|
|
28
|
-
headers,
|
|
29
|
-
body: requestBody,
|
|
30
|
-
signal: newSignals,
|
|
31
|
-
credentials: withCredentials ? "include" : undefined,
|
|
53
|
+
const response = yield fetchFn(url, Object.assign({ method: method, headers, body: requestBody, signal: newSignals, credentials: withCredentials ? "include" : undefined,
|
|
32
54
|
// @ts-ignore
|
|
33
|
-
duplex,
|
|
34
|
-
});
|
|
55
|
+
duplex }, (disableCache && isCacheNoStoreSupported() ? { cache: "no-store" } : {})));
|
|
35
56
|
if (timeoutAbortId != null) {
|
|
36
57
|
clearTimeout(timeoutAbortId);
|
|
37
58
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function mergeHeaders
|
|
2
|
-
export declare function mergeOnlyDefinedHeaders
|
|
1
|
+
export declare function mergeHeaders(...headersArray: (Record<string, unknown> | null | undefined)[]): Record<string, unknown>;
|
|
2
|
+
export declare function mergeOnlyDefinedHeaders(...headersArray: (Record<string, unknown> | null | undefined)[]): Record<string, unknown>;
|
|
@@ -71,23 +71,9 @@ function evaluateRuntime() {
|
|
|
71
71
|
version: Bun.version,
|
|
72
72
|
};
|
|
73
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
74
|
/**
|
|
90
75
|
* A constant that indicates whether the environment the code is running is in React-Native.
|
|
76
|
+
* This check should come before Node.js detection since React Native may have a process polyfill.
|
|
91
77
|
* https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Core/setUpNavigator.js
|
|
92
78
|
*/
|
|
93
79
|
const isReactNative = typeof navigator !== "undefined" && (navigator === null || navigator === void 0 ? void 0 : navigator.product) === "ReactNative";
|
|
@@ -96,6 +82,22 @@ function evaluateRuntime() {
|
|
|
96
82
|
type: "react-native",
|
|
97
83
|
};
|
|
98
84
|
}
|
|
85
|
+
/**
|
|
86
|
+
* A constant that indicates whether the environment the code is running is Node.JS.
|
|
87
|
+
*
|
|
88
|
+
* We assign `process` to a local variable first to avoid being flagged by
|
|
89
|
+
* bundlers that perform static analysis on `process.versions` (e.g. Next.js
|
|
90
|
+
* Edge Runtime warns about Node.js APIs even when they are guarded).
|
|
91
|
+
*/
|
|
92
|
+
const _process = typeof process !== "undefined" ? process : undefined;
|
|
93
|
+
const isNode = typeof _process !== "undefined" && typeof ((_e = _process.versions) === null || _e === void 0 ? void 0 : _e.node) === "string";
|
|
94
|
+
if (isNode) {
|
|
95
|
+
return {
|
|
96
|
+
type: "node",
|
|
97
|
+
version: _process.versions.node,
|
|
98
|
+
parsedVersion: Number(_process.versions.node.split(".")[0]),
|
|
99
|
+
};
|
|
100
|
+
}
|
|
99
101
|
return {
|
|
100
102
|
type: "unknown",
|
|
101
103
|
};
|
|
@@ -20,6 +20,7 @@ export declare namespace Stream {
|
|
|
20
20
|
interface SseEvent {
|
|
21
21
|
type: "sse";
|
|
22
22
|
streamTerminator?: string;
|
|
23
|
+
eventDiscriminator?: string;
|
|
23
24
|
}
|
|
24
25
|
}
|
|
25
26
|
export declare class Stream<T> implements AsyncIterable<T> {
|
|
@@ -32,12 +33,20 @@ export declare class Stream<T> implements AsyncIterable<T> {
|
|
|
32
33
|
private prefix;
|
|
33
34
|
private messageTerminator;
|
|
34
35
|
private streamTerminator;
|
|
36
|
+
private eventDiscriminator;
|
|
35
37
|
private controller;
|
|
36
38
|
private decoder;
|
|
37
39
|
constructor({ stream, parse, eventShape, signal }: Stream.Args & {
|
|
38
40
|
parse: (val: unknown) => Promise<T>;
|
|
39
41
|
});
|
|
40
42
|
private iterMessages;
|
|
43
|
+
private iterDataMessages;
|
|
44
|
+
private iterSseEvents;
|
|
45
|
+
/**
|
|
46
|
+
* Parses and returns a single SSE event, or returns null if the event is a stream terminator.
|
|
47
|
+
*/
|
|
48
|
+
private dispatchSseEvent;
|
|
49
|
+
private injectDiscriminator;
|
|
41
50
|
[Symbol.asyncIterator](): AsyncIterator<T, void, unknown>;
|
|
42
51
|
private decodeChunk;
|
|
43
52
|
}
|
|
@@ -16,6 +16,11 @@ var __asyncValues = (this && this.__asyncValues) || function (o) {
|
|
|
16
16
|
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
|
17
17
|
};
|
|
18
18
|
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
|
19
|
+
var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {
|
|
20
|
+
var i, p;
|
|
21
|
+
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
22
|
+
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }
|
|
23
|
+
};
|
|
19
24
|
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
|
20
25
|
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
21
26
|
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
@@ -31,8 +36,10 @@ var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _ar
|
|
|
31
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
37
|
exports.Stream = void 0;
|
|
33
38
|
exports.readableStreamAsyncIterable = readableStreamAsyncIterable;
|
|
39
|
+
const json_js_1 = require("../json.js");
|
|
34
40
|
const index_js_1 = require("../runtime/index.js");
|
|
35
41
|
const DATA_PREFIX = "data:";
|
|
42
|
+
const EVENT_PREFIX = "event:";
|
|
36
43
|
class Stream {
|
|
37
44
|
constructor({ stream, parse, eventShape, signal }) {
|
|
38
45
|
this.controller = new AbortController();
|
|
@@ -42,6 +49,7 @@ class Stream {
|
|
|
42
49
|
this.prefix = DATA_PREFIX;
|
|
43
50
|
this.messageTerminator = "\n";
|
|
44
51
|
this.streamTerminator = eventShape.streamTerminator;
|
|
52
|
+
this.eventDiscriminator = eventShape.eventDiscriminator;
|
|
45
53
|
}
|
|
46
54
|
else {
|
|
47
55
|
this.messageTerminator = eventShape.messageTerminator;
|
|
@@ -54,8 +62,17 @@ class Stream {
|
|
|
54
62
|
}
|
|
55
63
|
iterMessages() {
|
|
56
64
|
return __asyncGenerator(this, arguments, function* iterMessages_1() {
|
|
65
|
+
if (this.eventDiscriminator != null) {
|
|
66
|
+
yield __await(yield* __asyncDelegator(__asyncValues(this.iterSseEvents())));
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
yield __await(yield* __asyncDelegator(__asyncValues(this.iterDataMessages())));
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
iterDataMessages() {
|
|
74
|
+
return __asyncGenerator(this, arguments, function* iterDataMessages_1() {
|
|
57
75
|
var _a, e_1, _b, _c;
|
|
58
|
-
this.controller.signal;
|
|
59
76
|
const stream = readableStreamAsyncIterable(this.stream);
|
|
60
77
|
let buf = "";
|
|
61
78
|
let prefixSeen = false;
|
|
@@ -83,7 +100,7 @@ class Stream {
|
|
|
83
100
|
if (this.streamTerminator != null && line.includes(this.streamTerminator)) {
|
|
84
101
|
return yield __await(void 0);
|
|
85
102
|
}
|
|
86
|
-
const message = yield __await(this.parse(
|
|
103
|
+
const message = yield __await(this.parse((0, json_js_1.fromJson)(line)));
|
|
87
104
|
yield yield __await(message);
|
|
88
105
|
prefixSeen = false;
|
|
89
106
|
}
|
|
@@ -98,9 +115,87 @@ class Stream {
|
|
|
98
115
|
}
|
|
99
116
|
});
|
|
100
117
|
}
|
|
118
|
+
iterSseEvents() {
|
|
119
|
+
return __asyncGenerator(this, arguments, function* iterSseEvents_1() {
|
|
120
|
+
var _a, e_2, _b, _c;
|
|
121
|
+
const stream = readableStreamAsyncIterable(this.stream);
|
|
122
|
+
let buf = "";
|
|
123
|
+
let eventType;
|
|
124
|
+
let dataValue;
|
|
125
|
+
try {
|
|
126
|
+
for (var _d = true, stream_2 = __asyncValues(stream), stream_2_1; stream_2_1 = yield __await(stream_2.next()), _a = stream_2_1.done, !_a; _d = true) {
|
|
127
|
+
_c = stream_2_1.value;
|
|
128
|
+
_d = false;
|
|
129
|
+
const chunk = _c;
|
|
130
|
+
buf += this.decodeChunk(chunk);
|
|
131
|
+
let terminatorIndex;
|
|
132
|
+
while ((terminatorIndex = buf.indexOf("\n")) >= 0) {
|
|
133
|
+
const line = buf.slice(0, terminatorIndex).replace(/\r$/, "");
|
|
134
|
+
buf = buf.slice(terminatorIndex + 1);
|
|
135
|
+
if (!line.trim()) {
|
|
136
|
+
if (dataValue != null) {
|
|
137
|
+
const message = yield __await(this.dispatchSseEvent(dataValue, eventType));
|
|
138
|
+
if (message == null) {
|
|
139
|
+
return yield __await(void 0);
|
|
140
|
+
}
|
|
141
|
+
yield yield __await(message);
|
|
142
|
+
}
|
|
143
|
+
eventType = undefined;
|
|
144
|
+
dataValue = undefined;
|
|
145
|
+
continue;
|
|
146
|
+
}
|
|
147
|
+
if (line.startsWith(EVENT_PREFIX)) {
|
|
148
|
+
eventType = line.slice(EVENT_PREFIX.length).trim();
|
|
149
|
+
}
|
|
150
|
+
else if (line.startsWith(DATA_PREFIX)) {
|
|
151
|
+
const val = line.slice(DATA_PREFIX.length).trim();
|
|
152
|
+
dataValue = dataValue != null ? `${dataValue}\n${val}` : val;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
158
|
+
finally {
|
|
159
|
+
try {
|
|
160
|
+
if (!_d && !_a && (_b = stream_2.return)) yield __await(_b.call(stream_2));
|
|
161
|
+
}
|
|
162
|
+
finally { if (e_2) throw e_2.error; }
|
|
163
|
+
}
|
|
164
|
+
if (dataValue != null) {
|
|
165
|
+
const message = yield __await(this.dispatchSseEvent(dataValue, eventType));
|
|
166
|
+
if (message != null) {
|
|
167
|
+
yield yield __await(message);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Parses and returns a single SSE event, or returns null if the event is a stream terminator.
|
|
174
|
+
*/
|
|
175
|
+
dispatchSseEvent(dataValue, eventType) {
|
|
176
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
177
|
+
if (this.streamTerminator != null && dataValue.includes(this.streamTerminator)) {
|
|
178
|
+
return null;
|
|
179
|
+
}
|
|
180
|
+
return this.parse(this.injectDiscriminator((0, json_js_1.fromJson)(dataValue), eventType));
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
injectDiscriminator(parsed, eventType) {
|
|
184
|
+
if (this.eventDiscriminator == null || eventType == null) {
|
|
185
|
+
return parsed;
|
|
186
|
+
}
|
|
187
|
+
if (parsed == null || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
188
|
+
return parsed;
|
|
189
|
+
}
|
|
190
|
+
const obj = parsed;
|
|
191
|
+
if (this.eventDiscriminator in obj) {
|
|
192
|
+
return parsed;
|
|
193
|
+
}
|
|
194
|
+
return Object.assign({ [this.eventDiscriminator]: eventType }, obj);
|
|
195
|
+
}
|
|
101
196
|
[Symbol.asyncIterator]() {
|
|
102
197
|
return __asyncGenerator(this, arguments, function* _a() {
|
|
103
|
-
var _b,
|
|
198
|
+
var _b, e_3, _c, _d;
|
|
104
199
|
try {
|
|
105
200
|
for (var _e = true, _f = __asyncValues(this.iterMessages()), _g; _g = yield __await(_f.next()), _b = _g.done, !_b; _e = true) {
|
|
106
201
|
_d = _g.value;
|
|
@@ -109,12 +204,12 @@ class Stream {
|
|
|
109
204
|
yield yield __await(message);
|
|
110
205
|
}
|
|
111
206
|
}
|
|
112
|
-
catch (
|
|
207
|
+
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
113
208
|
finally {
|
|
114
209
|
try {
|
|
115
210
|
if (!_e && !_b && (_c = _f.return)) yield __await(_c.call(_f));
|
|
116
211
|
}
|
|
117
|
-
finally { if (
|
|
212
|
+
finally { if (e_3) throw e_3.error; }
|
|
118
213
|
}
|
|
119
214
|
});
|
|
120
215
|
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.handleNonStatusCodeError = handleNonStatusCodeError;
|
|
38
|
+
const errors = __importStar(require("./index.js"));
|
|
39
|
+
function handleNonStatusCodeError(error, rawResponse, method, path) {
|
|
40
|
+
switch (error.reason) {
|
|
41
|
+
case "non-json":
|
|
42
|
+
throw new errors.phenomlError({
|
|
43
|
+
statusCode: error.statusCode,
|
|
44
|
+
body: error.rawBody,
|
|
45
|
+
rawResponse: rawResponse,
|
|
46
|
+
});
|
|
47
|
+
case "body-is-null":
|
|
48
|
+
throw new errors.phenomlError({
|
|
49
|
+
statusCode: error.statusCode,
|
|
50
|
+
rawResponse: rawResponse,
|
|
51
|
+
});
|
|
52
|
+
case "timeout":
|
|
53
|
+
throw new errors.phenomlTimeoutError(`Timeout exceeded when calling ${method} ${path}.`);
|
|
54
|
+
case "unknown":
|
|
55
|
+
throw new errors.phenomlError({
|
|
56
|
+
message: error.errorMessage,
|
|
57
|
+
rawResponse: rawResponse,
|
|
58
|
+
});
|
|
59
|
+
default:
|
|
60
|
+
throw new errors.phenomlError({
|
|
61
|
+
message: "Unknown error",
|
|
62
|
+
rawResponse: rawResponse,
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -6,7 +6,11 @@ const json_js_1 = require("../core/json.js");
|
|
|
6
6
|
class phenomlError extends Error {
|
|
7
7
|
constructor({ message, statusCode, body, rawResponse, }) {
|
|
8
8
|
super(buildMessage({ message, statusCode, body }));
|
|
9
|
-
Object.setPrototypeOf(this,
|
|
9
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
10
|
+
if (Error.captureStackTrace) {
|
|
11
|
+
Error.captureStackTrace(this, this.constructor);
|
|
12
|
+
}
|
|
13
|
+
this.name = this.constructor.name;
|
|
10
14
|
this.statusCode = statusCode;
|
|
11
15
|
this.body = body;
|
|
12
16
|
this.rawResponse = rawResponse;
|
|
@@ -5,7 +5,11 @@ exports.phenomlTimeoutError = void 0;
|
|
|
5
5
|
class phenomlTimeoutError extends Error {
|
|
6
6
|
constructor(message) {
|
|
7
7
|
super(message);
|
|
8
|
-
Object.setPrototypeOf(this,
|
|
8
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
9
|
+
if (Error.captureStackTrace) {
|
|
10
|
+
Error.captureStackTrace(this, this.constructor);
|
|
11
|
+
}
|
|
12
|
+
this.name = this.constructor.name;
|
|
9
13
|
}
|
|
10
14
|
}
|
|
11
15
|
exports.phenomlTimeoutError = phenomlTimeoutError;
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export * as phenoml from "./api/index.js";
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
2
|
+
export type { BaseClientOptions, BaseRequestOptions } from "./BaseClient.js";
|
|
3
|
+
export { phenomlClient } from "./Client.js";
|
|
4
4
|
export { phenomlEnvironment } from "./environments.js";
|
|
5
|
+
export { phenomlError, phenomlTimeoutError } from "./errors/index.js";
|
|
6
|
+
export * from "./exports.js";
|
package/dist/cjs/index.js
CHANGED
|
@@ -32,13 +32,17 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
32
32
|
return result;
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
36
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
37
|
+
};
|
|
35
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.
|
|
39
|
+
exports.phenomlTimeoutError = exports.phenomlError = exports.phenomlEnvironment = exports.phenomlClient = exports.phenoml = void 0;
|
|
37
40
|
exports.phenoml = __importStar(require("./api/index.js"));
|
|
41
|
+
var Client_js_1 = require("./Client.js");
|
|
42
|
+
Object.defineProperty(exports, "phenomlClient", { enumerable: true, get: function () { return Client_js_1.phenomlClient; } });
|
|
43
|
+
var environments_js_1 = require("./environments.js");
|
|
44
|
+
Object.defineProperty(exports, "phenomlEnvironment", { enumerable: true, get: function () { return environments_js_1.phenomlEnvironment; } });
|
|
38
45
|
var index_js_1 = require("./errors/index.js");
|
|
39
46
|
Object.defineProperty(exports, "phenomlError", { enumerable: true, get: function () { return index_js_1.phenomlError; } });
|
|
40
47
|
Object.defineProperty(exports, "phenomlTimeoutError", { enumerable: true, get: function () { return index_js_1.phenomlTimeoutError; } });
|
|
41
|
-
|
|
42
|
-
Object.defineProperty(exports, "PhenoMLClient", { enumerable: true, get: function () { return WrapperClient_js_1.PhenoMLClient; } });
|
|
43
|
-
var environments_js_1 = require("./environments.js");
|
|
44
|
-
Object.defineProperty(exports, "phenomlEnvironment", { enumerable: true, get: function () { return environments_js_1.phenomlEnvironment; } });
|
|
48
|
+
__exportStar(require("./exports.js"), exports);
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "
|
|
1
|
+
export declare const SDK_VERSION = "10.0.0";
|
package/dist/cjs/version.js
CHANGED