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
|
@@ -15,6 +15,11 @@ var __asyncValues = (this && this.__asyncValues) || function (o) {
|
|
|
15
15
|
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
|
16
16
|
};
|
|
17
17
|
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
|
18
|
+
var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {
|
|
19
|
+
var i, p;
|
|
20
|
+
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
21
|
+
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; }
|
|
22
|
+
};
|
|
18
23
|
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
|
19
24
|
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
20
25
|
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
@@ -27,8 +32,10 @@ var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _ar
|
|
|
27
32
|
function reject(value) { resume("throw", value); }
|
|
28
33
|
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
|
29
34
|
};
|
|
35
|
+
import { fromJson } from "../json.mjs";
|
|
30
36
|
import { RUNTIME } from "../runtime/index.mjs";
|
|
31
37
|
const DATA_PREFIX = "data:";
|
|
38
|
+
const EVENT_PREFIX = "event:";
|
|
32
39
|
export class Stream {
|
|
33
40
|
constructor({ stream, parse, eventShape, signal }) {
|
|
34
41
|
this.controller = new AbortController();
|
|
@@ -38,6 +45,7 @@ export class Stream {
|
|
|
38
45
|
this.prefix = DATA_PREFIX;
|
|
39
46
|
this.messageTerminator = "\n";
|
|
40
47
|
this.streamTerminator = eventShape.streamTerminator;
|
|
48
|
+
this.eventDiscriminator = eventShape.eventDiscriminator;
|
|
41
49
|
}
|
|
42
50
|
else {
|
|
43
51
|
this.messageTerminator = eventShape.messageTerminator;
|
|
@@ -50,8 +58,17 @@ export class Stream {
|
|
|
50
58
|
}
|
|
51
59
|
iterMessages() {
|
|
52
60
|
return __asyncGenerator(this, arguments, function* iterMessages_1() {
|
|
61
|
+
if (this.eventDiscriminator != null) {
|
|
62
|
+
yield __await(yield* __asyncDelegator(__asyncValues(this.iterSseEvents())));
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
yield __await(yield* __asyncDelegator(__asyncValues(this.iterDataMessages())));
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
iterDataMessages() {
|
|
70
|
+
return __asyncGenerator(this, arguments, function* iterDataMessages_1() {
|
|
53
71
|
var _a, e_1, _b, _c;
|
|
54
|
-
this.controller.signal;
|
|
55
72
|
const stream = readableStreamAsyncIterable(this.stream);
|
|
56
73
|
let buf = "";
|
|
57
74
|
let prefixSeen = false;
|
|
@@ -79,7 +96,7 @@ export class Stream {
|
|
|
79
96
|
if (this.streamTerminator != null && line.includes(this.streamTerminator)) {
|
|
80
97
|
return yield __await(void 0);
|
|
81
98
|
}
|
|
82
|
-
const message = yield __await(this.parse(
|
|
99
|
+
const message = yield __await(this.parse(fromJson(line)));
|
|
83
100
|
yield yield __await(message);
|
|
84
101
|
prefixSeen = false;
|
|
85
102
|
}
|
|
@@ -94,9 +111,87 @@ export class Stream {
|
|
|
94
111
|
}
|
|
95
112
|
});
|
|
96
113
|
}
|
|
114
|
+
iterSseEvents() {
|
|
115
|
+
return __asyncGenerator(this, arguments, function* iterSseEvents_1() {
|
|
116
|
+
var _a, e_2, _b, _c;
|
|
117
|
+
const stream = readableStreamAsyncIterable(this.stream);
|
|
118
|
+
let buf = "";
|
|
119
|
+
let eventType;
|
|
120
|
+
let dataValue;
|
|
121
|
+
try {
|
|
122
|
+
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) {
|
|
123
|
+
_c = stream_2_1.value;
|
|
124
|
+
_d = false;
|
|
125
|
+
const chunk = _c;
|
|
126
|
+
buf += this.decodeChunk(chunk);
|
|
127
|
+
let terminatorIndex;
|
|
128
|
+
while ((terminatorIndex = buf.indexOf("\n")) >= 0) {
|
|
129
|
+
const line = buf.slice(0, terminatorIndex).replace(/\r$/, "");
|
|
130
|
+
buf = buf.slice(terminatorIndex + 1);
|
|
131
|
+
if (!line.trim()) {
|
|
132
|
+
if (dataValue != null) {
|
|
133
|
+
const message = yield __await(this.dispatchSseEvent(dataValue, eventType));
|
|
134
|
+
if (message == null) {
|
|
135
|
+
return yield __await(void 0);
|
|
136
|
+
}
|
|
137
|
+
yield yield __await(message);
|
|
138
|
+
}
|
|
139
|
+
eventType = undefined;
|
|
140
|
+
dataValue = undefined;
|
|
141
|
+
continue;
|
|
142
|
+
}
|
|
143
|
+
if (line.startsWith(EVENT_PREFIX)) {
|
|
144
|
+
eventType = line.slice(EVENT_PREFIX.length).trim();
|
|
145
|
+
}
|
|
146
|
+
else if (line.startsWith(DATA_PREFIX)) {
|
|
147
|
+
const val = line.slice(DATA_PREFIX.length).trim();
|
|
148
|
+
dataValue = dataValue != null ? `${dataValue}\n${val}` : val;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
154
|
+
finally {
|
|
155
|
+
try {
|
|
156
|
+
if (!_d && !_a && (_b = stream_2.return)) yield __await(_b.call(stream_2));
|
|
157
|
+
}
|
|
158
|
+
finally { if (e_2) throw e_2.error; }
|
|
159
|
+
}
|
|
160
|
+
if (dataValue != null) {
|
|
161
|
+
const message = yield __await(this.dispatchSseEvent(dataValue, eventType));
|
|
162
|
+
if (message != null) {
|
|
163
|
+
yield yield __await(message);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Parses and returns a single SSE event, or returns null if the event is a stream terminator.
|
|
170
|
+
*/
|
|
171
|
+
dispatchSseEvent(dataValue, eventType) {
|
|
172
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
173
|
+
if (this.streamTerminator != null && dataValue.includes(this.streamTerminator)) {
|
|
174
|
+
return null;
|
|
175
|
+
}
|
|
176
|
+
return this.parse(this.injectDiscriminator(fromJson(dataValue), eventType));
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
injectDiscriminator(parsed, eventType) {
|
|
180
|
+
if (this.eventDiscriminator == null || eventType == null) {
|
|
181
|
+
return parsed;
|
|
182
|
+
}
|
|
183
|
+
if (parsed == null || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
184
|
+
return parsed;
|
|
185
|
+
}
|
|
186
|
+
const obj = parsed;
|
|
187
|
+
if (this.eventDiscriminator in obj) {
|
|
188
|
+
return parsed;
|
|
189
|
+
}
|
|
190
|
+
return Object.assign({ [this.eventDiscriminator]: eventType }, obj);
|
|
191
|
+
}
|
|
97
192
|
[Symbol.asyncIterator]() {
|
|
98
193
|
return __asyncGenerator(this, arguments, function* _a() {
|
|
99
|
-
var _b,
|
|
194
|
+
var _b, e_3, _c, _d;
|
|
100
195
|
try {
|
|
101
196
|
for (var _e = true, _f = __asyncValues(this.iterMessages()), _g; _g = yield __await(_f.next()), _b = _g.done, !_b; _e = true) {
|
|
102
197
|
_d = _g.value;
|
|
@@ -105,12 +200,12 @@ export class Stream {
|
|
|
105
200
|
yield yield __await(message);
|
|
106
201
|
}
|
|
107
202
|
}
|
|
108
|
-
catch (
|
|
203
|
+
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
109
204
|
finally {
|
|
110
205
|
try {
|
|
111
206
|
if (!_e && !_b && (_c = _f.return)) yield __await(_c.call(_f));
|
|
112
207
|
}
|
|
113
|
-
finally { if (
|
|
208
|
+
finally { if (e_3) throw e_3.error; }
|
|
114
209
|
}
|
|
115
210
|
});
|
|
116
211
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
import * as errors from "./index.mjs";
|
|
3
|
+
export function handleNonStatusCodeError(error, rawResponse, method, path) {
|
|
4
|
+
switch (error.reason) {
|
|
5
|
+
case "non-json":
|
|
6
|
+
throw new errors.phenomlError({
|
|
7
|
+
statusCode: error.statusCode,
|
|
8
|
+
body: error.rawBody,
|
|
9
|
+
rawResponse: rawResponse,
|
|
10
|
+
});
|
|
11
|
+
case "body-is-null":
|
|
12
|
+
throw new errors.phenomlError({
|
|
13
|
+
statusCode: error.statusCode,
|
|
14
|
+
rawResponse: rawResponse,
|
|
15
|
+
});
|
|
16
|
+
case "timeout":
|
|
17
|
+
throw new errors.phenomlTimeoutError(`Timeout exceeded when calling ${method} ${path}.`);
|
|
18
|
+
case "unknown":
|
|
19
|
+
throw new errors.phenomlError({
|
|
20
|
+
message: error.errorMessage,
|
|
21
|
+
rawResponse: rawResponse,
|
|
22
|
+
});
|
|
23
|
+
default:
|
|
24
|
+
throw new errors.phenomlError({
|
|
25
|
+
message: "Unknown error",
|
|
26
|
+
rawResponse: rawResponse,
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -3,7 +3,11 @@ import { toJson } from "../core/json.mjs";
|
|
|
3
3
|
export class phenomlError extends Error {
|
|
4
4
|
constructor({ message, statusCode, body, rawResponse, }) {
|
|
5
5
|
super(buildMessage({ message, statusCode, body }));
|
|
6
|
-
Object.setPrototypeOf(this,
|
|
6
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
7
|
+
if (Error.captureStackTrace) {
|
|
8
|
+
Error.captureStackTrace(this, this.constructor);
|
|
9
|
+
}
|
|
10
|
+
this.name = this.constructor.name;
|
|
7
11
|
this.statusCode = statusCode;
|
|
8
12
|
this.body = body;
|
|
9
13
|
this.rawResponse = rawResponse;
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
export class phenomlTimeoutError extends Error {
|
|
3
3
|
constructor(message) {
|
|
4
4
|
super(message);
|
|
5
|
-
Object.setPrototypeOf(this,
|
|
5
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
6
|
+
if (Error.captureStackTrace) {
|
|
7
|
+
Error.captureStackTrace(this, this.constructor);
|
|
8
|
+
}
|
|
9
|
+
this.name = this.constructor.name;
|
|
6
10
|
}
|
|
7
11
|
}
|
package/dist/esm/index.d.mts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export * as phenoml from "./api/index.mjs";
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
2
|
+
export type { BaseClientOptions, BaseRequestOptions } from "./BaseClient.mjs";
|
|
3
|
+
export { phenomlClient } from "./Client.mjs";
|
|
4
4
|
export { phenomlEnvironment } from "./environments.mjs";
|
|
5
|
+
export { phenomlError, phenomlTimeoutError } from "./errors/index.mjs";
|
|
6
|
+
export * from "./exports.mjs";
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * as phenoml from "./api/index.mjs";
|
|
2
|
-
export {
|
|
3
|
-
export { PhenoMLClient } from "./WrapperClient.mjs";
|
|
2
|
+
export { phenomlClient } from "./Client.mjs";
|
|
4
3
|
export { phenomlEnvironment } from "./environments.mjs";
|
|
4
|
+
export { phenomlError, phenomlTimeoutError } from "./errors/index.mjs";
|
|
5
|
+
export * from "./exports.mjs";
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "
|
|
1
|
+
export declare const SDK_VERSION = "10.0.0";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "
|
|
1
|
+
export const SDK_VERSION = "10.0.0";
|
package/package.json
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "phenoml",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "10.0.0",
|
|
4
4
|
"private": false,
|
|
5
|
-
"repository":
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/PhenoML/phenoml-ts-sdk.git"
|
|
8
|
+
},
|
|
6
9
|
"type": "commonjs",
|
|
7
10
|
"main": "./dist/cjs/index.js",
|
|
8
11
|
"module": "./dist/esm/index.mjs",
|
|
9
12
|
"types": "./dist/cjs/index.d.ts",
|
|
10
13
|
"exports": {
|
|
11
14
|
".": {
|
|
12
|
-
"types": "./dist/cjs/index.d.ts",
|
|
13
15
|
"import": {
|
|
14
16
|
"types": "./dist/esm/index.d.mts",
|
|
15
17
|
"default": "./dist/esm/index.mjs"
|
|
@@ -20,6 +22,160 @@
|
|
|
20
22
|
},
|
|
21
23
|
"default": "./dist/cjs/index.js"
|
|
22
24
|
},
|
|
25
|
+
"./agent": {
|
|
26
|
+
"import": {
|
|
27
|
+
"types": "./dist/esm/api/resources/agent/exports.d.mts",
|
|
28
|
+
"default": "./dist/esm/api/resources/agent/exports.mjs"
|
|
29
|
+
},
|
|
30
|
+
"require": {
|
|
31
|
+
"types": "./dist/cjs/api/resources/agent/exports.d.ts",
|
|
32
|
+
"default": "./dist/cjs/api/resources/agent/exports.js"
|
|
33
|
+
},
|
|
34
|
+
"default": "./dist/cjs/api/resources/agent/exports.js"
|
|
35
|
+
},
|
|
36
|
+
"./agent/prompts": {
|
|
37
|
+
"import": {
|
|
38
|
+
"types": "./dist/esm/api/resources/agent/resources/prompts/exports.d.mts",
|
|
39
|
+
"default": "./dist/esm/api/resources/agent/resources/prompts/exports.mjs"
|
|
40
|
+
},
|
|
41
|
+
"require": {
|
|
42
|
+
"types": "./dist/cjs/api/resources/agent/resources/prompts/exports.d.ts",
|
|
43
|
+
"default": "./dist/cjs/api/resources/agent/resources/prompts/exports.js"
|
|
44
|
+
},
|
|
45
|
+
"default": "./dist/cjs/api/resources/agent/resources/prompts/exports.js"
|
|
46
|
+
},
|
|
47
|
+
"./authtoken": {
|
|
48
|
+
"import": {
|
|
49
|
+
"types": "./dist/esm/api/resources/authtoken/exports.d.mts",
|
|
50
|
+
"default": "./dist/esm/api/resources/authtoken/exports.mjs"
|
|
51
|
+
},
|
|
52
|
+
"require": {
|
|
53
|
+
"types": "./dist/cjs/api/resources/authtoken/exports.d.ts",
|
|
54
|
+
"default": "./dist/cjs/api/resources/authtoken/exports.js"
|
|
55
|
+
},
|
|
56
|
+
"default": "./dist/cjs/api/resources/authtoken/exports.js"
|
|
57
|
+
},
|
|
58
|
+
"./authtoken/auth": {
|
|
59
|
+
"import": {
|
|
60
|
+
"types": "./dist/esm/api/resources/authtoken/resources/auth/exports.d.mts",
|
|
61
|
+
"default": "./dist/esm/api/resources/authtoken/resources/auth/exports.mjs"
|
|
62
|
+
},
|
|
63
|
+
"require": {
|
|
64
|
+
"types": "./dist/cjs/api/resources/authtoken/resources/auth/exports.d.ts",
|
|
65
|
+
"default": "./dist/cjs/api/resources/authtoken/resources/auth/exports.js"
|
|
66
|
+
},
|
|
67
|
+
"default": "./dist/cjs/api/resources/authtoken/resources/auth/exports.js"
|
|
68
|
+
},
|
|
69
|
+
"./cohort": {
|
|
70
|
+
"import": {
|
|
71
|
+
"types": "./dist/esm/api/resources/cohort/exports.d.mts",
|
|
72
|
+
"default": "./dist/esm/api/resources/cohort/exports.mjs"
|
|
73
|
+
},
|
|
74
|
+
"require": {
|
|
75
|
+
"types": "./dist/cjs/api/resources/cohort/exports.d.ts",
|
|
76
|
+
"default": "./dist/cjs/api/resources/cohort/exports.js"
|
|
77
|
+
},
|
|
78
|
+
"default": "./dist/cjs/api/resources/cohort/exports.js"
|
|
79
|
+
},
|
|
80
|
+
"./construe": {
|
|
81
|
+
"import": {
|
|
82
|
+
"types": "./dist/esm/api/resources/construe/exports.d.mts",
|
|
83
|
+
"default": "./dist/esm/api/resources/construe/exports.mjs"
|
|
84
|
+
},
|
|
85
|
+
"require": {
|
|
86
|
+
"types": "./dist/cjs/api/resources/construe/exports.d.ts",
|
|
87
|
+
"default": "./dist/cjs/api/resources/construe/exports.js"
|
|
88
|
+
},
|
|
89
|
+
"default": "./dist/cjs/api/resources/construe/exports.js"
|
|
90
|
+
},
|
|
91
|
+
"./fhir": {
|
|
92
|
+
"import": {
|
|
93
|
+
"types": "./dist/esm/api/resources/fhir/exports.d.mts",
|
|
94
|
+
"default": "./dist/esm/api/resources/fhir/exports.mjs"
|
|
95
|
+
},
|
|
96
|
+
"require": {
|
|
97
|
+
"types": "./dist/cjs/api/resources/fhir/exports.d.ts",
|
|
98
|
+
"default": "./dist/cjs/api/resources/fhir/exports.js"
|
|
99
|
+
},
|
|
100
|
+
"default": "./dist/cjs/api/resources/fhir/exports.js"
|
|
101
|
+
},
|
|
102
|
+
"./fhirProvider": {
|
|
103
|
+
"import": {
|
|
104
|
+
"types": "./dist/esm/api/resources/fhirProvider/exports.d.mts",
|
|
105
|
+
"default": "./dist/esm/api/resources/fhirProvider/exports.mjs"
|
|
106
|
+
},
|
|
107
|
+
"require": {
|
|
108
|
+
"types": "./dist/cjs/api/resources/fhirProvider/exports.d.ts",
|
|
109
|
+
"default": "./dist/cjs/api/resources/fhirProvider/exports.js"
|
|
110
|
+
},
|
|
111
|
+
"default": "./dist/cjs/api/resources/fhirProvider/exports.js"
|
|
112
|
+
},
|
|
113
|
+
"./lang2Fhir": {
|
|
114
|
+
"import": {
|
|
115
|
+
"types": "./dist/esm/api/resources/lang2Fhir/exports.d.mts",
|
|
116
|
+
"default": "./dist/esm/api/resources/lang2Fhir/exports.mjs"
|
|
117
|
+
},
|
|
118
|
+
"require": {
|
|
119
|
+
"types": "./dist/cjs/api/resources/lang2Fhir/exports.d.ts",
|
|
120
|
+
"default": "./dist/cjs/api/resources/lang2Fhir/exports.js"
|
|
121
|
+
},
|
|
122
|
+
"default": "./dist/cjs/api/resources/lang2Fhir/exports.js"
|
|
123
|
+
},
|
|
124
|
+
"./summary": {
|
|
125
|
+
"import": {
|
|
126
|
+
"types": "./dist/esm/api/resources/summary/exports.d.mts",
|
|
127
|
+
"default": "./dist/esm/api/resources/summary/exports.mjs"
|
|
128
|
+
},
|
|
129
|
+
"require": {
|
|
130
|
+
"types": "./dist/cjs/api/resources/summary/exports.d.ts",
|
|
131
|
+
"default": "./dist/cjs/api/resources/summary/exports.js"
|
|
132
|
+
},
|
|
133
|
+
"default": "./dist/cjs/api/resources/summary/exports.js"
|
|
134
|
+
},
|
|
135
|
+
"./tools": {
|
|
136
|
+
"import": {
|
|
137
|
+
"types": "./dist/esm/api/resources/tools/exports.d.mts",
|
|
138
|
+
"default": "./dist/esm/api/resources/tools/exports.mjs"
|
|
139
|
+
},
|
|
140
|
+
"require": {
|
|
141
|
+
"types": "./dist/cjs/api/resources/tools/exports.d.ts",
|
|
142
|
+
"default": "./dist/cjs/api/resources/tools/exports.js"
|
|
143
|
+
},
|
|
144
|
+
"default": "./dist/cjs/api/resources/tools/exports.js"
|
|
145
|
+
},
|
|
146
|
+
"./tools/mcpServer": {
|
|
147
|
+
"import": {
|
|
148
|
+
"types": "./dist/esm/api/resources/tools/resources/mcpServer/exports.d.mts",
|
|
149
|
+
"default": "./dist/esm/api/resources/tools/resources/mcpServer/exports.mjs"
|
|
150
|
+
},
|
|
151
|
+
"require": {
|
|
152
|
+
"types": "./dist/cjs/api/resources/tools/resources/mcpServer/exports.d.ts",
|
|
153
|
+
"default": "./dist/cjs/api/resources/tools/resources/mcpServer/exports.js"
|
|
154
|
+
},
|
|
155
|
+
"default": "./dist/cjs/api/resources/tools/resources/mcpServer/exports.js"
|
|
156
|
+
},
|
|
157
|
+
"./tools/mcpServer/tools": {
|
|
158
|
+
"import": {
|
|
159
|
+
"types": "./dist/esm/api/resources/tools/resources/mcpServer/resources/tools/exports.d.mts",
|
|
160
|
+
"default": "./dist/esm/api/resources/tools/resources/mcpServer/resources/tools/exports.mjs"
|
|
161
|
+
},
|
|
162
|
+
"require": {
|
|
163
|
+
"types": "./dist/cjs/api/resources/tools/resources/mcpServer/resources/tools/exports.d.ts",
|
|
164
|
+
"default": "./dist/cjs/api/resources/tools/resources/mcpServer/resources/tools/exports.js"
|
|
165
|
+
},
|
|
166
|
+
"default": "./dist/cjs/api/resources/tools/resources/mcpServer/resources/tools/exports.js"
|
|
167
|
+
},
|
|
168
|
+
"./workflows": {
|
|
169
|
+
"import": {
|
|
170
|
+
"types": "./dist/esm/api/resources/workflows/exports.d.mts",
|
|
171
|
+
"default": "./dist/esm/api/resources/workflows/exports.mjs"
|
|
172
|
+
},
|
|
173
|
+
"require": {
|
|
174
|
+
"types": "./dist/cjs/api/resources/workflows/exports.d.ts",
|
|
175
|
+
"default": "./dist/cjs/api/resources/workflows/exports.js"
|
|
176
|
+
},
|
|
177
|
+
"default": "./dist/cjs/api/resources/workflows/exports.js"
|
|
178
|
+
},
|
|
23
179
|
"./package.json": "./package.json"
|
|
24
180
|
},
|
|
25
181
|
"files": [
|
|
@@ -50,13 +206,14 @@
|
|
|
50
206
|
"msw": "2.11.2",
|
|
51
207
|
"@types/node": "^18.19.70",
|
|
52
208
|
"typescript": "~5.7.2",
|
|
53
|
-
"@biomejs/biome": "2.3
|
|
209
|
+
"@biomejs/biome": "2.4.3"
|
|
54
210
|
},
|
|
55
211
|
"browser": {
|
|
56
212
|
"fs": false,
|
|
57
213
|
"os": false,
|
|
58
214
|
"path": false,
|
|
59
|
-
"stream": false
|
|
215
|
+
"stream": false,
|
|
216
|
+
"crypto": false
|
|
60
217
|
},
|
|
61
218
|
"packageManager": "pnpm@10.20.0",
|
|
62
219
|
"engines": {
|