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
|
@@ -54,26 +54,28 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
54
54
|
return t;
|
|
55
55
|
};
|
|
56
56
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
57
|
-
exports.
|
|
57
|
+
exports.AgentClient = void 0;
|
|
58
|
+
const BaseClient_js_1 = require("../../../../BaseClient.js");
|
|
58
59
|
const headers_js_1 = require("../../../../core/headers.js");
|
|
59
60
|
const core = __importStar(require("../../../../core/index.js"));
|
|
60
61
|
const environments = __importStar(require("../../../../environments.js"));
|
|
62
|
+
const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatusCodeError.js");
|
|
61
63
|
const errors = __importStar(require("../../../../errors/index.js"));
|
|
62
64
|
const phenoml = __importStar(require("../../../index.js"));
|
|
63
65
|
const Client_js_1 = require("../resources/prompts/client/Client.js");
|
|
64
|
-
class
|
|
65
|
-
constructor(
|
|
66
|
-
this._options =
|
|
66
|
+
class AgentClient {
|
|
67
|
+
constructor(options = {}) {
|
|
68
|
+
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
67
69
|
}
|
|
68
70
|
get prompts() {
|
|
69
71
|
var _a;
|
|
70
|
-
return ((_a = this._prompts) !== null && _a !== void 0 ? _a : (this._prompts = new Client_js_1.
|
|
72
|
+
return ((_a = this._prompts) !== null && _a !== void 0 ? _a : (this._prompts = new Client_js_1.PromptsClient(this._options)));
|
|
71
73
|
}
|
|
72
74
|
/**
|
|
73
75
|
* Creates a new PhenoAgent with specified configuration
|
|
74
76
|
*
|
|
75
77
|
* @param {phenoml.agent.AgentCreateRequest} request
|
|
76
|
-
* @param {
|
|
78
|
+
* @param {AgentClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
77
79
|
*
|
|
78
80
|
* @throws {@link phenoml.agent.BadRequestError}
|
|
79
81
|
* @throws {@link phenoml.agent.UnauthorizedError}
|
|
@@ -93,7 +95,8 @@ class Agent {
|
|
|
93
95
|
__create(request, requestOptions) {
|
|
94
96
|
return __awaiter(this, void 0, void 0, function* () {
|
|
95
97
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
96
|
-
const
|
|
98
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
99
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
97
100
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
98
101
|
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, "agent/create"),
|
|
99
102
|
method: "POST",
|
|
@@ -129,28 +132,14 @@ class Agent {
|
|
|
129
132
|
});
|
|
130
133
|
}
|
|
131
134
|
}
|
|
132
|
-
|
|
133
|
-
case "non-json":
|
|
134
|
-
throw new errors.phenomlError({
|
|
135
|
-
statusCode: _response.error.statusCode,
|
|
136
|
-
body: _response.error.rawBody,
|
|
137
|
-
rawResponse: _response.rawResponse,
|
|
138
|
-
});
|
|
139
|
-
case "timeout":
|
|
140
|
-
throw new errors.phenomlTimeoutError("Timeout exceeded when calling POST /agent/create.");
|
|
141
|
-
case "unknown":
|
|
142
|
-
throw new errors.phenomlError({
|
|
143
|
-
message: _response.error.errorMessage,
|
|
144
|
-
rawResponse: _response.rawResponse,
|
|
145
|
-
});
|
|
146
|
-
}
|
|
135
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/agent/create");
|
|
147
136
|
});
|
|
148
137
|
}
|
|
149
138
|
/**
|
|
150
139
|
* Retrieves a list of PhenoAgents belonging to the authenticated user
|
|
151
140
|
*
|
|
152
141
|
* @param {phenoml.agent.AgentListRequest} request
|
|
153
|
-
* @param {
|
|
142
|
+
* @param {AgentClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
154
143
|
*
|
|
155
144
|
* @throws {@link phenoml.agent.UnauthorizedError}
|
|
156
145
|
* @throws {@link phenoml.agent.ForbiddenError}
|
|
@@ -168,11 +157,11 @@ class Agent {
|
|
|
168
157
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
169
158
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
170
159
|
const { tags } = request;
|
|
171
|
-
const _queryParams = {
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers,
|
|
160
|
+
const _queryParams = {
|
|
161
|
+
tags,
|
|
162
|
+
};
|
|
163
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
164
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
176
165
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
177
166
|
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, "agent/list"),
|
|
178
167
|
method: "GET",
|
|
@@ -203,28 +192,14 @@ class Agent {
|
|
|
203
192
|
});
|
|
204
193
|
}
|
|
205
194
|
}
|
|
206
|
-
|
|
207
|
-
case "non-json":
|
|
208
|
-
throw new errors.phenomlError({
|
|
209
|
-
statusCode: _response.error.statusCode,
|
|
210
|
-
body: _response.error.rawBody,
|
|
211
|
-
rawResponse: _response.rawResponse,
|
|
212
|
-
});
|
|
213
|
-
case "timeout":
|
|
214
|
-
throw new errors.phenomlTimeoutError("Timeout exceeded when calling GET /agent/list.");
|
|
215
|
-
case "unknown":
|
|
216
|
-
throw new errors.phenomlError({
|
|
217
|
-
message: _response.error.errorMessage,
|
|
218
|
-
rawResponse: _response.rawResponse,
|
|
219
|
-
});
|
|
220
|
-
}
|
|
195
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/agent/list");
|
|
221
196
|
});
|
|
222
197
|
}
|
|
223
198
|
/**
|
|
224
199
|
* Retrieves a specific agent by its ID
|
|
225
200
|
*
|
|
226
201
|
* @param {string} id - Agent ID
|
|
227
|
-
* @param {
|
|
202
|
+
* @param {AgentClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
228
203
|
*
|
|
229
204
|
* @throws {@link phenoml.agent.UnauthorizedError}
|
|
230
205
|
* @throws {@link phenoml.agent.ForbiddenError}
|
|
@@ -240,7 +215,8 @@ class Agent {
|
|
|
240
215
|
__get(id, requestOptions) {
|
|
241
216
|
return __awaiter(this, void 0, void 0, function* () {
|
|
242
217
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
243
|
-
const
|
|
218
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
219
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
244
220
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
245
221
|
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, `agent/${core.url.encodePathParam(id)}`),
|
|
246
222
|
method: "GET",
|
|
@@ -273,21 +249,7 @@ class Agent {
|
|
|
273
249
|
});
|
|
274
250
|
}
|
|
275
251
|
}
|
|
276
|
-
|
|
277
|
-
case "non-json":
|
|
278
|
-
throw new errors.phenomlError({
|
|
279
|
-
statusCode: _response.error.statusCode,
|
|
280
|
-
body: _response.error.rawBody,
|
|
281
|
-
rawResponse: _response.rawResponse,
|
|
282
|
-
});
|
|
283
|
-
case "timeout":
|
|
284
|
-
throw new errors.phenomlTimeoutError("Timeout exceeded when calling GET /agent/{id}.");
|
|
285
|
-
case "unknown":
|
|
286
|
-
throw new errors.phenomlError({
|
|
287
|
-
message: _response.error.errorMessage,
|
|
288
|
-
rawResponse: _response.rawResponse,
|
|
289
|
-
});
|
|
290
|
-
}
|
|
252
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/agent/{id}");
|
|
291
253
|
});
|
|
292
254
|
}
|
|
293
255
|
/**
|
|
@@ -295,7 +257,7 @@ class Agent {
|
|
|
295
257
|
*
|
|
296
258
|
* @param {string} id - Agent ID
|
|
297
259
|
* @param {phenoml.agent.AgentCreateRequest} request
|
|
298
|
-
* @param {
|
|
260
|
+
* @param {AgentClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
299
261
|
*
|
|
300
262
|
* @throws {@link phenoml.agent.BadRequestError}
|
|
301
263
|
* @throws {@link phenoml.agent.UnauthorizedError}
|
|
@@ -316,7 +278,8 @@ class Agent {
|
|
|
316
278
|
__update(id, request, requestOptions) {
|
|
317
279
|
return __awaiter(this, void 0, void 0, function* () {
|
|
318
280
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
319
|
-
const
|
|
281
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
282
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
320
283
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
321
284
|
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, `agent/${core.url.encodePathParam(id)}`),
|
|
322
285
|
method: "PUT",
|
|
@@ -354,28 +317,14 @@ class Agent {
|
|
|
354
317
|
});
|
|
355
318
|
}
|
|
356
319
|
}
|
|
357
|
-
|
|
358
|
-
case "non-json":
|
|
359
|
-
throw new errors.phenomlError({
|
|
360
|
-
statusCode: _response.error.statusCode,
|
|
361
|
-
body: _response.error.rawBody,
|
|
362
|
-
rawResponse: _response.rawResponse,
|
|
363
|
-
});
|
|
364
|
-
case "timeout":
|
|
365
|
-
throw new errors.phenomlTimeoutError("Timeout exceeded when calling PUT /agent/{id}.");
|
|
366
|
-
case "unknown":
|
|
367
|
-
throw new errors.phenomlError({
|
|
368
|
-
message: _response.error.errorMessage,
|
|
369
|
-
rawResponse: _response.rawResponse,
|
|
370
|
-
});
|
|
371
|
-
}
|
|
320
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PUT", "/agent/{id}");
|
|
372
321
|
});
|
|
373
322
|
}
|
|
374
323
|
/**
|
|
375
324
|
* Deletes an existing agent
|
|
376
325
|
*
|
|
377
326
|
* @param {string} id - Agent ID
|
|
378
|
-
* @param {
|
|
327
|
+
* @param {AgentClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
379
328
|
*
|
|
380
329
|
* @throws {@link phenoml.agent.UnauthorizedError}
|
|
381
330
|
* @throws {@link phenoml.agent.ForbiddenError}
|
|
@@ -391,7 +340,8 @@ class Agent {
|
|
|
391
340
|
__delete(id, requestOptions) {
|
|
392
341
|
return __awaiter(this, void 0, void 0, function* () {
|
|
393
342
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
394
|
-
const
|
|
343
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
344
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
395
345
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
396
346
|
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, `agent/${core.url.encodePathParam(id)}`),
|
|
397
347
|
method: "DELETE",
|
|
@@ -424,21 +374,7 @@ class Agent {
|
|
|
424
374
|
});
|
|
425
375
|
}
|
|
426
376
|
}
|
|
427
|
-
|
|
428
|
-
case "non-json":
|
|
429
|
-
throw new errors.phenomlError({
|
|
430
|
-
statusCode: _response.error.statusCode,
|
|
431
|
-
body: _response.error.rawBody,
|
|
432
|
-
rawResponse: _response.rawResponse,
|
|
433
|
-
});
|
|
434
|
-
case "timeout":
|
|
435
|
-
throw new errors.phenomlTimeoutError("Timeout exceeded when calling DELETE /agent/{id}.");
|
|
436
|
-
case "unknown":
|
|
437
|
-
throw new errors.phenomlError({
|
|
438
|
-
message: _response.error.errorMessage,
|
|
439
|
-
rawResponse: _response.rawResponse,
|
|
440
|
-
});
|
|
441
|
-
}
|
|
377
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/agent/{id}");
|
|
442
378
|
});
|
|
443
379
|
}
|
|
444
380
|
/**
|
|
@@ -446,7 +382,7 @@ class Agent {
|
|
|
446
382
|
*
|
|
447
383
|
* @param {string} id - Agent ID
|
|
448
384
|
* @param {phenoml.agent.JsonPatch} request
|
|
449
|
-
* @param {
|
|
385
|
+
* @param {AgentClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
450
386
|
*
|
|
451
387
|
* @throws {@link phenoml.agent.BadRequestError}
|
|
452
388
|
* @throws {@link phenoml.agent.UnauthorizedError}
|
|
@@ -474,7 +410,8 @@ class Agent {
|
|
|
474
410
|
__patch(id, request, requestOptions) {
|
|
475
411
|
return __awaiter(this, void 0, void 0, function* () {
|
|
476
412
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
477
|
-
const
|
|
413
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
414
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
478
415
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
479
416
|
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, `agent/${core.url.encodePathParam(id)}`),
|
|
480
417
|
method: "PATCH",
|
|
@@ -512,28 +449,14 @@ class Agent {
|
|
|
512
449
|
});
|
|
513
450
|
}
|
|
514
451
|
}
|
|
515
|
-
|
|
516
|
-
case "non-json":
|
|
517
|
-
throw new errors.phenomlError({
|
|
518
|
-
statusCode: _response.error.statusCode,
|
|
519
|
-
body: _response.error.rawBody,
|
|
520
|
-
rawResponse: _response.rawResponse,
|
|
521
|
-
});
|
|
522
|
-
case "timeout":
|
|
523
|
-
throw new errors.phenomlTimeoutError("Timeout exceeded when calling PATCH /agent/{id}.");
|
|
524
|
-
case "unknown":
|
|
525
|
-
throw new errors.phenomlError({
|
|
526
|
-
message: _response.error.errorMessage,
|
|
527
|
-
rawResponse: _response.rawResponse,
|
|
528
|
-
});
|
|
529
|
-
}
|
|
452
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PATCH", "/agent/{id}");
|
|
530
453
|
});
|
|
531
454
|
}
|
|
532
455
|
/**
|
|
533
456
|
* Send a message to an agent and receive a JSON response.
|
|
534
457
|
*
|
|
535
458
|
* @param {phenoml.agent.AgentChatRequest} request
|
|
536
|
-
* @param {
|
|
459
|
+
* @param {AgentClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
537
460
|
*
|
|
538
461
|
* @throws {@link phenoml.agent.BadRequestError}
|
|
539
462
|
* @throws {@link phenoml.agent.UnauthorizedError}
|
|
@@ -555,10 +478,10 @@ class Agent {
|
|
|
555
478
|
return __awaiter(this, void 0, void 0, function* () {
|
|
556
479
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
557
480
|
const { "X-Phenoml-On-Behalf-Of": phenomlOnBehalfOf, "X-Phenoml-Fhir-Provider": phenomlFhirProvider } = request, _body = __rest(request, ["X-Phenoml-On-Behalf-Of", "X-Phenoml-Fhir-Provider"]);
|
|
558
|
-
const
|
|
559
|
-
|
|
560
|
-
"X-Phenoml-On-Behalf-Of": phenomlOnBehalfOf
|
|
561
|
-
"X-Phenoml-Fhir-Provider": phenomlFhirProvider
|
|
481
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
482
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
483
|
+
"X-Phenoml-On-Behalf-Of": phenomlOnBehalfOf,
|
|
484
|
+
"X-Phenoml-Fhir-Provider": phenomlFhirProvider,
|
|
562
485
|
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
563
486
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
564
487
|
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, "agent/chat"),
|
|
@@ -595,21 +518,7 @@ class Agent {
|
|
|
595
518
|
});
|
|
596
519
|
}
|
|
597
520
|
}
|
|
598
|
-
|
|
599
|
-
case "non-json":
|
|
600
|
-
throw new errors.phenomlError({
|
|
601
|
-
statusCode: _response.error.statusCode,
|
|
602
|
-
body: _response.error.rawBody,
|
|
603
|
-
rawResponse: _response.rawResponse,
|
|
604
|
-
});
|
|
605
|
-
case "timeout":
|
|
606
|
-
throw new errors.phenomlTimeoutError("Timeout exceeded when calling POST /agent/chat.");
|
|
607
|
-
case "unknown":
|
|
608
|
-
throw new errors.phenomlError({
|
|
609
|
-
message: _response.error.errorMessage,
|
|
610
|
-
rawResponse: _response.rawResponse,
|
|
611
|
-
});
|
|
612
|
-
}
|
|
521
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/agent/chat");
|
|
613
522
|
});
|
|
614
523
|
}
|
|
615
524
|
/**
|
|
@@ -624,10 +533,10 @@ class Agent {
|
|
|
624
533
|
return __awaiter(this, void 0, void 0, function* () {
|
|
625
534
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
626
535
|
const { "X-Phenoml-On-Behalf-Of": phenomlOnBehalfOf, "X-Phenoml-Fhir-Provider": phenomlFhirProvider } = request, _body = __rest(request, ["X-Phenoml-On-Behalf-Of", "X-Phenoml-Fhir-Provider"]);
|
|
627
|
-
const
|
|
628
|
-
|
|
629
|
-
"X-Phenoml-On-Behalf-Of": phenomlOnBehalfOf
|
|
630
|
-
"X-Phenoml-Fhir-Provider": phenomlFhirProvider
|
|
536
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
537
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
538
|
+
"X-Phenoml-On-Behalf-Of": phenomlOnBehalfOf,
|
|
539
|
+
"X-Phenoml-Fhir-Provider": phenomlFhirProvider,
|
|
631
540
|
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
632
541
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
633
542
|
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, "agent/stream-chat"),
|
|
@@ -652,7 +561,6 @@ class Agent {
|
|
|
652
561
|
signal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
653
562
|
eventShape: {
|
|
654
563
|
type: "sse",
|
|
655
|
-
streamTerminator: "[DONE]",
|
|
656
564
|
},
|
|
657
565
|
}),
|
|
658
566
|
rawResponse: _response.rawResponse,
|
|
@@ -676,28 +584,14 @@ class Agent {
|
|
|
676
584
|
});
|
|
677
585
|
}
|
|
678
586
|
}
|
|
679
|
-
|
|
680
|
-
case "non-json":
|
|
681
|
-
throw new errors.phenomlError({
|
|
682
|
-
statusCode: _response.error.statusCode,
|
|
683
|
-
body: _response.error.rawBody,
|
|
684
|
-
rawResponse: _response.rawResponse,
|
|
685
|
-
});
|
|
686
|
-
case "timeout":
|
|
687
|
-
throw new errors.phenomlTimeoutError("Timeout exceeded when calling POST /agent/stream-chat.");
|
|
688
|
-
case "unknown":
|
|
689
|
-
throw new errors.phenomlError({
|
|
690
|
-
message: _response.error.errorMessage,
|
|
691
|
-
rawResponse: _response.rawResponse,
|
|
692
|
-
});
|
|
693
|
-
}
|
|
587
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/agent/stream-chat");
|
|
694
588
|
});
|
|
695
589
|
}
|
|
696
590
|
/**
|
|
697
591
|
* Retrieves a list of chat messages for a given chat session
|
|
698
592
|
*
|
|
699
593
|
* @param {phenoml.agent.AgentGetChatMessagesRequest} request
|
|
700
|
-
* @param {
|
|
594
|
+
* @param {AgentClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
701
595
|
*
|
|
702
596
|
* @throws {@link phenoml.agent.UnauthorizedError}
|
|
703
597
|
* @throws {@link phenoml.agent.ForbiddenError}
|
|
@@ -718,18 +612,14 @@ class Agent {
|
|
|
718
612
|
return __awaiter(this, void 0, void 0, function* () {
|
|
719
613
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
720
614
|
const { chat_session_id: chatSessionId, num_messages: numMessages, role, order } = request;
|
|
721
|
-
const _queryParams = {
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
if (order != null) {
|
|
730
|
-
_queryParams.order = order;
|
|
731
|
-
}
|
|
732
|
-
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
615
|
+
const _queryParams = {
|
|
616
|
+
chat_session_id: chatSessionId,
|
|
617
|
+
num_messages: numMessages,
|
|
618
|
+
role: role != null ? role : undefined,
|
|
619
|
+
order: order != null ? order : undefined,
|
|
620
|
+
};
|
|
621
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
622
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
733
623
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
734
624
|
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, "agent/chat/messages"),
|
|
735
625
|
method: "GET",
|
|
@@ -763,27 +653,8 @@ class Agent {
|
|
|
763
653
|
});
|
|
764
654
|
}
|
|
765
655
|
}
|
|
766
|
-
|
|
767
|
-
case "non-json":
|
|
768
|
-
throw new errors.phenomlError({
|
|
769
|
-
statusCode: _response.error.statusCode,
|
|
770
|
-
body: _response.error.rawBody,
|
|
771
|
-
rawResponse: _response.rawResponse,
|
|
772
|
-
});
|
|
773
|
-
case "timeout":
|
|
774
|
-
throw new errors.phenomlTimeoutError("Timeout exceeded when calling GET /agent/chat/messages.");
|
|
775
|
-
case "unknown":
|
|
776
|
-
throw new errors.phenomlError({
|
|
777
|
-
message: _response.error.errorMessage,
|
|
778
|
-
rawResponse: _response.rawResponse,
|
|
779
|
-
});
|
|
780
|
-
}
|
|
781
|
-
});
|
|
782
|
-
}
|
|
783
|
-
_getAuthorizationHeader() {
|
|
784
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
785
|
-
return `Bearer ${yield core.Supplier.get(this._options.token)}`;
|
|
656
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/agent/chat/messages");
|
|
786
657
|
});
|
|
787
658
|
}
|
|
788
659
|
}
|
|
789
|
-
exports.
|
|
660
|
+
exports.AgentClient = AgentClient;
|
|
@@ -44,7 +44,11 @@ class BadRequestError extends errors.phenomlError {
|
|
|
44
44
|
body: body,
|
|
45
45
|
rawResponse: rawResponse,
|
|
46
46
|
});
|
|
47
|
-
Object.setPrototypeOf(this,
|
|
47
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
48
|
+
if (Error.captureStackTrace) {
|
|
49
|
+
Error.captureStackTrace(this, this.constructor);
|
|
50
|
+
}
|
|
51
|
+
this.name = this.constructor.name;
|
|
48
52
|
}
|
|
49
53
|
}
|
|
50
54
|
exports.BadRequestError = BadRequestError;
|
|
@@ -44,7 +44,11 @@ class ForbiddenError extends errors.phenomlError {
|
|
|
44
44
|
body: body,
|
|
45
45
|
rawResponse: rawResponse,
|
|
46
46
|
});
|
|
47
|
-
Object.setPrototypeOf(this,
|
|
47
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
48
|
+
if (Error.captureStackTrace) {
|
|
49
|
+
Error.captureStackTrace(this, this.constructor);
|
|
50
|
+
}
|
|
51
|
+
this.name = this.constructor.name;
|
|
48
52
|
}
|
|
49
53
|
}
|
|
50
54
|
exports.ForbiddenError = ForbiddenError;
|
|
@@ -44,7 +44,11 @@ class InternalServerError extends errors.phenomlError {
|
|
|
44
44
|
body: body,
|
|
45
45
|
rawResponse: rawResponse,
|
|
46
46
|
});
|
|
47
|
-
Object.setPrototypeOf(this,
|
|
47
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
48
|
+
if (Error.captureStackTrace) {
|
|
49
|
+
Error.captureStackTrace(this, this.constructor);
|
|
50
|
+
}
|
|
51
|
+
this.name = this.constructor.name;
|
|
48
52
|
}
|
|
49
53
|
}
|
|
50
54
|
exports.InternalServerError = InternalServerError;
|
|
@@ -44,7 +44,11 @@ class NotFoundError extends errors.phenomlError {
|
|
|
44
44
|
body: body,
|
|
45
45
|
rawResponse: rawResponse,
|
|
46
46
|
});
|
|
47
|
-
Object.setPrototypeOf(this,
|
|
47
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
48
|
+
if (Error.captureStackTrace) {
|
|
49
|
+
Error.captureStackTrace(this, this.constructor);
|
|
50
|
+
}
|
|
51
|
+
this.name = this.constructor.name;
|
|
48
52
|
}
|
|
49
53
|
}
|
|
50
54
|
exports.NotFoundError = NotFoundError;
|
|
@@ -44,7 +44,11 @@ class UnauthorizedError extends errors.phenomlError {
|
|
|
44
44
|
body: body,
|
|
45
45
|
rawResponse: rawResponse,
|
|
46
46
|
});
|
|
47
|
-
Object.setPrototypeOf(this,
|
|
47
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
48
|
+
if (Error.captureStackTrace) {
|
|
49
|
+
Error.captureStackTrace(this, this.constructor);
|
|
50
|
+
}
|
|
51
|
+
this.name = this.constructor.name;
|
|
48
52
|
}
|
|
49
53
|
}
|
|
50
54
|
exports.UnauthorizedError = UnauthorizedError;
|
|
@@ -0,0 +1,22 @@
|
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
15
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
16
|
+
};
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.AgentClient = void 0;
|
|
19
|
+
var Client_js_1 = require("./client/Client.js");
|
|
20
|
+
Object.defineProperty(exports, "AgentClient", { enumerable: true, get: function () { return Client_js_1.AgentClient; } });
|
|
21
|
+
__exportStar(require("./client/index.js"), exports);
|
|
22
|
+
__exportStar(require("./resources/index.js"), exports);
|