phenoml 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/cjs/Client.d.ts +10 -4
- package/dist/cjs/Client.js +17 -7
- package/dist/cjs/api/resources/agent/client/Client.d.ts +12 -8
- package/dist/cjs/api/resources/agent/client/Client.js +15 -7
- package/dist/cjs/api/resources/agent/client/requests/AgentChatRequest.d.ts +0 -3
- package/dist/cjs/api/resources/agent/client/requests/index.d.ts +0 -2
- package/dist/cjs/api/resources/agent/resources/prompts/client/Client.d.ts +5 -5
- package/dist/cjs/api/resources/agent/resources/prompts/client/Client.js +6 -2
- package/dist/cjs/api/resources/agent/{client/requests → types}/AgentCreateRequest.d.ts +14 -12
- package/dist/cjs/api/resources/agent/types/AgentTemplate.d.ts +14 -4
- package/dist/cjs/api/resources/agent/types/index.d.ts +1 -4
- package/dist/cjs/api/resources/agent/types/index.js +1 -4
- package/dist/cjs/api/resources/authtoken/client/Client.d.ts +3 -3
- package/dist/cjs/api/resources/authtoken/client/Client.js +1 -1
- package/dist/cjs/api/resources/authtoken/resources/auth/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/authtoken/resources/auth/client/Client.js +1 -1
- package/dist/cjs/api/resources/cohort/client/Client.d.ts +5 -5
- package/dist/cjs/api/resources/cohort/client/Client.js +6 -2
- package/dist/cjs/api/resources/construe/client/Client.d.ts +5 -5
- package/dist/cjs/api/resources/construe/client/Client.js +6 -2
- package/dist/cjs/api/resources/fhir/client/Client.d.ts +293 -0
- package/dist/cjs/api/resources/fhir/client/Client.js +674 -0
- package/dist/cjs/api/resources/fhir/client/index.d.ts +2 -0
- package/dist/cjs/api/resources/fhir/client/index.js +17 -0
- package/dist/cjs/api/resources/fhir/client/requests/FhirCreateRequest.d.ts +18 -0
- package/dist/cjs/api/resources/fhir/client/requests/FhirDeleteRequest.d.ts +13 -0
- package/dist/cjs/api/resources/fhir/client/requests/FhirExecuteBundleRequest.d.ts +47 -0
- package/dist/cjs/api/resources/fhir/client/requests/FhirPatchRequest.d.ts +69 -0
- package/dist/cjs/api/resources/fhir/client/requests/FhirSearchRequest.d.ts +26 -0
- package/dist/cjs/api/resources/fhir/client/requests/FhirUpsertRequest.d.ts +19 -0
- package/dist/cjs/api/resources/fhir/client/requests/FhirUpsertRequest.js +5 -0
- package/dist/cjs/api/resources/fhir/client/requests/index.d.ts +6 -0
- package/dist/cjs/api/resources/fhir/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/fhir/errors/BadRequestError.d.ts +8 -0
- package/dist/cjs/api/resources/fhir/errors/BadRequestError.js +52 -0
- package/dist/cjs/api/resources/fhir/errors/InternalServerError.d.ts +8 -0
- package/dist/cjs/api/resources/fhir/errors/InternalServerError.js +52 -0
- package/dist/cjs/api/resources/fhir/errors/NotFoundError.d.ts +8 -0
- package/dist/cjs/api/resources/fhir/errors/NotFoundError.js +52 -0
- package/dist/cjs/api/resources/fhir/errors/UnauthorizedError.d.ts +8 -0
- package/dist/cjs/api/resources/fhir/errors/UnauthorizedError.js +52 -0
- package/dist/cjs/api/resources/fhir/errors/index.d.ts +4 -0
- package/dist/cjs/api/resources/fhir/errors/index.js +20 -0
- package/dist/cjs/api/resources/fhir/index.d.ts +3 -0
- package/dist/cjs/api/resources/fhir/index.js +19 -0
- package/dist/cjs/api/resources/fhir/types/ErrorResponse.d.ts +14 -0
- package/dist/cjs/api/resources/fhir/types/ErrorResponse.js +5 -0
- package/dist/cjs/api/resources/fhir/types/FhirBundle.d.ts +57 -0
- package/dist/cjs/api/resources/fhir/types/FhirBundle.js +25 -0
- package/dist/cjs/api/resources/fhir/types/FhirPatchRequestBodyItem.d.ts +26 -0
- package/dist/cjs/api/resources/fhir/types/FhirPatchRequestBodyItem.js +17 -0
- package/dist/cjs/api/resources/fhir/types/FhirResource.d.ts +27 -0
- package/dist/cjs/api/resources/fhir/types/FhirResource.js +5 -0
- package/dist/cjs/api/resources/fhir/types/FhirSearchResponse.d.ts +5 -0
- package/dist/cjs/api/resources/fhir/types/FhirSearchResponse.js +5 -0
- package/dist/cjs/api/resources/fhir/types/index.d.ts +5 -0
- package/dist/cjs/api/resources/fhir/types/index.js +21 -0
- package/dist/cjs/api/resources/fhirProvider/client/Client.d.ts +161 -0
- package/dist/cjs/api/resources/fhirProvider/client/Client.js +596 -0
- package/dist/cjs/api/resources/fhirProvider/client/index.d.ts +2 -0
- package/dist/cjs/api/resources/fhirProvider/client/index.js +17 -0
- package/dist/cjs/api/resources/fhirProvider/client/requests/FhirProviderAddAuthConfigRequest.d.ts +20 -0
- package/dist/cjs/api/resources/fhirProvider/client/requests/FhirProviderAddAuthConfigRequest.js +5 -0
- package/dist/cjs/api/resources/fhirProvider/client/requests/FhirProviderCreateRequest.d.ts +30 -0
- package/dist/cjs/api/resources/fhirProvider/client/requests/FhirProviderCreateRequest.js +5 -0
- package/dist/cjs/api/resources/fhirProvider/client/requests/FhirProviderRemoveAuthConfigRequest.d.ts +13 -0
- package/dist/cjs/api/resources/fhirProvider/client/requests/FhirProviderRemoveAuthConfigRequest.js +5 -0
- package/dist/cjs/api/resources/fhirProvider/client/requests/FhirProviderSetActiveAuthConfigRequest.d.ts +13 -0
- package/dist/cjs/api/resources/fhirProvider/client/requests/FhirProviderSetActiveAuthConfigRequest.js +5 -0
- package/dist/cjs/api/resources/fhirProvider/client/requests/index.d.ts +4 -0
- package/dist/cjs/api/resources/fhirProvider/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/fhirProvider/errors/BadRequestError.d.ts +8 -0
- package/dist/cjs/api/resources/fhirProvider/errors/BadRequestError.js +52 -0
- package/dist/cjs/api/resources/fhirProvider/errors/ForbiddenError.d.ts +8 -0
- package/dist/cjs/api/resources/fhirProvider/errors/ForbiddenError.js +52 -0
- package/dist/cjs/api/resources/fhirProvider/errors/InternalServerError.d.ts +8 -0
- package/dist/cjs/api/resources/fhirProvider/errors/InternalServerError.js +52 -0
- package/dist/cjs/api/resources/fhirProvider/errors/NotFoundError.d.ts +8 -0
- package/dist/cjs/api/resources/fhirProvider/errors/NotFoundError.js +52 -0
- package/dist/cjs/api/resources/fhirProvider/errors/UnauthorizedError.d.ts +8 -0
- package/dist/cjs/api/resources/fhirProvider/errors/UnauthorizedError.js +52 -0
- package/dist/cjs/api/resources/fhirProvider/errors/index.d.ts +5 -0
- package/dist/cjs/api/resources/fhirProvider/errors/index.js +21 -0
- package/dist/cjs/api/resources/fhirProvider/index.d.ts +3 -0
- package/dist/cjs/api/resources/fhirProvider/index.js +19 -0
- package/dist/cjs/api/resources/fhirProvider/types/AuthMethod.d.ts +14 -0
- package/dist/cjs/api/resources/fhirProvider/types/AuthMethod.js +13 -0
- package/dist/cjs/api/resources/fhirProvider/types/FhirProviderAuthConfig.d.ts +22 -0
- package/dist/cjs/api/resources/fhirProvider/types/FhirProviderAuthConfig.js +5 -0
- package/dist/cjs/api/resources/fhirProvider/types/FhirProviderDeleteResponse.d.ts +7 -0
- package/dist/cjs/api/resources/fhirProvider/types/FhirProviderDeleteResponse.js +5 -0
- package/dist/cjs/api/resources/fhirProvider/types/FhirProviderListResponse.d.ts +9 -0
- package/dist/cjs/api/resources/fhirProvider/types/FhirProviderListResponse.js +5 -0
- package/dist/cjs/api/resources/fhirProvider/types/FhirProviderRemoveAuthConfigResponse.d.ts +9 -0
- package/dist/cjs/api/resources/fhirProvider/types/FhirProviderRemoveAuthConfigResponse.js +5 -0
- package/dist/cjs/api/resources/fhirProvider/types/FhirProviderResponse.d.ts +9 -0
- package/dist/cjs/api/resources/fhirProvider/types/FhirProviderResponse.js +5 -0
- package/dist/cjs/api/resources/fhirProvider/types/FhirProviderSetActiveAuthConfigResponse.d.ts +9 -0
- package/dist/cjs/api/resources/fhirProvider/types/FhirProviderSetActiveAuthConfigResponse.js +5 -0
- package/dist/cjs/api/resources/fhirProvider/types/FhirProviderTemplate.d.ts +25 -0
- package/dist/cjs/api/resources/fhirProvider/types/FhirProviderTemplate.js +5 -0
- package/dist/cjs/api/resources/fhirProvider/types/FhirQueryResponse.d.ts +19 -0
- package/dist/cjs/api/resources/fhirProvider/types/FhirQueryResponse.js +5 -0
- package/dist/cjs/api/resources/fhirProvider/types/JsonWebKey.d.ts +20 -0
- package/dist/cjs/api/resources/fhirProvider/types/JsonWebKey.js +5 -0
- package/dist/cjs/api/resources/fhirProvider/types/Provider.d.ts +17 -0
- package/dist/cjs/api/resources/{agent/types/ProviderType.js → fhirProvider/types/Provider.js} +8 -4
- package/dist/cjs/api/resources/fhirProvider/types/ServiceAccountKey.d.ts +19 -0
- package/dist/cjs/api/resources/fhirProvider/types/ServiceAccountKey.js +5 -0
- package/dist/cjs/api/resources/fhirProvider/types/SmartConfiguration.d.ts +18 -0
- package/dist/cjs/api/resources/fhirProvider/types/SmartConfiguration.js +5 -0
- package/dist/cjs/api/resources/fhirProvider/types/index.d.ts +13 -0
- package/dist/cjs/api/resources/fhirProvider/types/index.js +29 -0
- package/dist/cjs/api/resources/index.d.ts +2 -0
- package/dist/cjs/api/resources/index.js +3 -1
- package/dist/cjs/api/resources/lang2Fhir/client/Client.d.ts +5 -5
- package/dist/cjs/api/resources/lang2Fhir/client/Client.js +6 -2
- package/dist/cjs/api/resources/tools/client/Client.d.ts +6 -6
- package/dist/cjs/api/resources/tools/client/Client.js +7 -3
- package/dist/cjs/api/resources/tools/client/requests/CohortRequest.d.ts +3 -17
- package/dist/cjs/api/resources/tools/client/requests/CohortRequest.js +0 -10
- package/dist/cjs/api/resources/tools/client/requests/Lang2FhirAndCreateRequest.d.ts +2 -14
- package/dist/cjs/api/resources/tools/client/requests/Lang2FhirAndCreateRequest.js +0 -6
- package/dist/cjs/api/resources/tools/client/requests/Lang2FhirAndSearchRequest.d.ts +2 -16
- package/dist/cjs/api/resources/tools/client/requests/Lang2FhirAndSearchRequest.js +0 -10
- package/dist/cjs/api/resources/tools/resources/mcpServer/client/Client.d.ts +5 -5
- package/dist/cjs/api/resources/tools/resources/mcpServer/client/Client.js +6 -2
- package/dist/cjs/api/resources/tools/resources/mcpServer/resources/tools/client/Client.d.ts +5 -5
- package/dist/cjs/api/resources/tools/resources/mcpServer/resources/tools/client/Client.js +6 -2
- package/dist/cjs/api/resources/tools/types/index.d.ts +0 -1
- package/dist/cjs/api/resources/tools/types/index.js +0 -1
- package/dist/cjs/core/fetcher/Fetcher.d.ts +1 -1
- package/dist/cjs/core/fetcher/requestWithRetries.js +44 -8
- package/dist/cjs/core/headers.d.ts +2 -2
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Client.d.mts +10 -4
- package/dist/esm/Client.mjs +13 -3
- package/dist/esm/api/resources/agent/client/Client.d.mts +12 -8
- package/dist/esm/api/resources/agent/client/Client.mjs +15 -7
- package/dist/esm/api/resources/agent/client/requests/AgentChatRequest.d.mts +0 -3
- package/dist/esm/api/resources/agent/client/requests/index.d.mts +0 -2
- package/dist/esm/api/resources/agent/resources/prompts/client/Client.d.mts +5 -5
- package/dist/esm/api/resources/agent/resources/prompts/client/Client.mjs +6 -2
- package/dist/esm/api/resources/agent/{client/requests → types}/AgentCreateRequest.d.mts +14 -12
- package/dist/esm/api/resources/agent/types/AgentTemplate.d.mts +14 -4
- package/dist/esm/api/resources/agent/types/index.d.mts +1 -4
- package/dist/esm/api/resources/agent/types/index.mjs +1 -4
- package/dist/esm/api/resources/authtoken/client/Client.d.mts +3 -3
- package/dist/esm/api/resources/authtoken/client/Client.mjs +1 -1
- package/dist/esm/api/resources/authtoken/resources/auth/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/authtoken/resources/auth/client/Client.mjs +1 -1
- package/dist/esm/api/resources/cohort/client/Client.d.mts +5 -5
- package/dist/esm/api/resources/cohort/client/Client.mjs +6 -2
- package/dist/esm/api/resources/construe/client/Client.d.mts +5 -5
- package/dist/esm/api/resources/construe/client/Client.mjs +6 -2
- package/dist/esm/api/resources/fhir/client/Client.d.mts +293 -0
- package/dist/esm/api/resources/fhir/client/Client.mjs +637 -0
- package/dist/esm/api/resources/fhir/client/index.d.mts +2 -0
- package/dist/esm/api/resources/fhir/client/index.mjs +1 -0
- package/dist/esm/api/resources/fhir/client/requests/FhirCreateRequest.d.mts +18 -0
- package/dist/esm/api/resources/fhir/client/requests/FhirDeleteRequest.d.mts +13 -0
- package/dist/esm/api/resources/fhir/client/requests/FhirExecuteBundleRequest.d.mts +47 -0
- package/dist/esm/api/resources/fhir/client/requests/FhirPatchRequest.d.mts +69 -0
- package/dist/esm/api/resources/fhir/client/requests/FhirSearchRequest.d.mts +26 -0
- package/dist/esm/api/resources/fhir/client/requests/FhirUpsertRequest.d.mts +19 -0
- package/dist/esm/api/resources/fhir/client/requests/FhirUpsertRequest.mjs +4 -0
- package/dist/esm/api/resources/fhir/client/requests/index.d.mts +6 -0
- package/dist/esm/api/resources/fhir/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/fhir/errors/BadRequestError.d.mts +8 -0
- package/dist/esm/api/resources/fhir/errors/BadRequestError.mjs +15 -0
- package/dist/esm/api/resources/fhir/errors/InternalServerError.d.mts +8 -0
- package/dist/esm/api/resources/fhir/errors/InternalServerError.mjs +15 -0
- package/dist/esm/api/resources/fhir/errors/NotFoundError.d.mts +8 -0
- package/dist/esm/api/resources/fhir/errors/NotFoundError.mjs +15 -0
- package/dist/esm/api/resources/fhir/errors/UnauthorizedError.d.mts +8 -0
- package/dist/esm/api/resources/fhir/errors/UnauthorizedError.mjs +15 -0
- package/dist/esm/api/resources/fhir/errors/index.d.mts +4 -0
- package/dist/esm/api/resources/fhir/errors/index.mjs +4 -0
- package/dist/esm/api/resources/fhir/index.d.mts +3 -0
- package/dist/esm/api/resources/fhir/index.mjs +3 -0
- package/dist/esm/api/resources/fhir/types/ErrorResponse.d.mts +14 -0
- package/dist/esm/api/resources/fhir/types/ErrorResponse.mjs +4 -0
- package/dist/esm/api/resources/fhir/types/FhirBundle.d.mts +57 -0
- package/dist/esm/api/resources/fhir/types/FhirBundle.mjs +22 -0
- package/dist/esm/api/resources/fhir/types/FhirPatchRequestBodyItem.d.mts +26 -0
- package/dist/esm/api/resources/fhir/types/FhirPatchRequestBodyItem.mjs +14 -0
- package/dist/esm/api/resources/fhir/types/FhirResource.d.mts +27 -0
- package/dist/esm/api/resources/fhir/types/FhirResource.mjs +4 -0
- package/dist/esm/api/resources/fhir/types/FhirSearchResponse.d.mts +5 -0
- package/dist/esm/api/resources/fhir/types/FhirSearchResponse.mjs +4 -0
- package/dist/esm/api/resources/fhir/types/index.d.mts +5 -0
- package/dist/esm/api/resources/fhir/types/index.mjs +5 -0
- package/dist/esm/api/resources/fhirProvider/client/Client.d.mts +161 -0
- package/dist/esm/api/resources/fhirProvider/client/Client.mjs +559 -0
- package/dist/esm/api/resources/fhirProvider/client/index.d.mts +2 -0
- package/dist/esm/api/resources/fhirProvider/client/index.mjs +1 -0
- package/dist/esm/api/resources/fhirProvider/client/requests/FhirProviderAddAuthConfigRequest.d.mts +20 -0
- package/dist/esm/api/resources/fhirProvider/client/requests/FhirProviderAddAuthConfigRequest.mjs +4 -0
- package/dist/esm/api/resources/fhirProvider/client/requests/FhirProviderCreateRequest.d.mts +30 -0
- package/dist/esm/api/resources/fhirProvider/client/requests/FhirProviderCreateRequest.mjs +4 -0
- package/dist/esm/api/resources/fhirProvider/client/requests/FhirProviderRemoveAuthConfigRequest.d.mts +13 -0
- package/dist/esm/api/resources/fhirProvider/client/requests/FhirProviderRemoveAuthConfigRequest.mjs +4 -0
- package/dist/esm/api/resources/fhirProvider/client/requests/FhirProviderSetActiveAuthConfigRequest.d.mts +13 -0
- package/dist/esm/api/resources/fhirProvider/client/requests/FhirProviderSetActiveAuthConfigRequest.mjs +4 -0
- package/dist/esm/api/resources/fhirProvider/client/requests/index.d.mts +4 -0
- package/dist/esm/api/resources/fhirProvider/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/fhirProvider/errors/BadRequestError.d.mts +8 -0
- package/dist/esm/api/resources/fhirProvider/errors/BadRequestError.mjs +15 -0
- package/dist/esm/api/resources/fhirProvider/errors/ForbiddenError.d.mts +8 -0
- package/dist/esm/api/resources/fhirProvider/errors/ForbiddenError.mjs +15 -0
- package/dist/esm/api/resources/fhirProvider/errors/InternalServerError.d.mts +8 -0
- package/dist/esm/api/resources/fhirProvider/errors/InternalServerError.mjs +15 -0
- package/dist/esm/api/resources/fhirProvider/errors/NotFoundError.d.mts +8 -0
- package/dist/esm/api/resources/fhirProvider/errors/NotFoundError.mjs +15 -0
- package/dist/esm/api/resources/fhirProvider/errors/UnauthorizedError.d.mts +8 -0
- package/dist/esm/api/resources/fhirProvider/errors/UnauthorizedError.mjs +15 -0
- package/dist/esm/api/resources/fhirProvider/errors/index.d.mts +5 -0
- package/dist/esm/api/resources/fhirProvider/errors/index.mjs +5 -0
- package/dist/esm/api/resources/fhirProvider/index.d.mts +3 -0
- package/dist/esm/api/resources/fhirProvider/index.mjs +3 -0
- package/dist/esm/api/resources/fhirProvider/types/AuthMethod.d.mts +14 -0
- package/dist/esm/api/resources/fhirProvider/types/AuthMethod.mjs +10 -0
- package/dist/esm/api/resources/fhirProvider/types/FhirProviderAuthConfig.d.mts +22 -0
- package/dist/esm/api/resources/fhirProvider/types/FhirProviderAuthConfig.mjs +4 -0
- package/dist/esm/api/resources/fhirProvider/types/FhirProviderDeleteResponse.d.mts +7 -0
- package/dist/esm/api/resources/fhirProvider/types/FhirProviderDeleteResponse.mjs +4 -0
- package/dist/esm/api/resources/fhirProvider/types/FhirProviderListResponse.d.mts +9 -0
- package/dist/esm/api/resources/fhirProvider/types/FhirProviderListResponse.mjs +4 -0
- package/dist/esm/api/resources/fhirProvider/types/FhirProviderRemoveAuthConfigResponse.d.mts +9 -0
- package/dist/esm/api/resources/fhirProvider/types/FhirProviderRemoveAuthConfigResponse.mjs +4 -0
- package/dist/esm/api/resources/fhirProvider/types/FhirProviderResponse.d.mts +9 -0
- package/dist/esm/api/resources/fhirProvider/types/FhirProviderResponse.mjs +4 -0
- package/dist/esm/api/resources/fhirProvider/types/FhirProviderSetActiveAuthConfigResponse.d.mts +9 -0
- package/dist/esm/api/resources/fhirProvider/types/FhirProviderSetActiveAuthConfigResponse.mjs +4 -0
- package/dist/esm/api/resources/fhirProvider/types/FhirProviderTemplate.d.mts +25 -0
- package/dist/esm/api/resources/fhirProvider/types/FhirProviderTemplate.mjs +4 -0
- package/dist/esm/api/resources/fhirProvider/types/FhirQueryResponse.d.mts +19 -0
- package/dist/esm/api/resources/fhirProvider/types/FhirQueryResponse.mjs +4 -0
- package/dist/esm/api/resources/fhirProvider/types/JsonWebKey.d.mts +20 -0
- package/dist/esm/api/resources/fhirProvider/types/JsonWebKey.mjs +4 -0
- package/dist/esm/api/resources/fhirProvider/types/Provider.d.mts +17 -0
- package/dist/esm/api/resources/{agent/types/ProviderType.mjs → fhirProvider/types/Provider.mjs} +7 -3
- package/dist/esm/api/resources/fhirProvider/types/ServiceAccountKey.d.mts +19 -0
- package/dist/esm/api/resources/fhirProvider/types/ServiceAccountKey.mjs +4 -0
- package/dist/esm/api/resources/fhirProvider/types/SmartConfiguration.d.mts +18 -0
- package/dist/esm/api/resources/fhirProvider/types/SmartConfiguration.mjs +4 -0
- package/dist/esm/api/resources/fhirProvider/types/index.d.mts +13 -0
- package/dist/esm/api/resources/fhirProvider/types/index.mjs +13 -0
- package/dist/esm/api/resources/index.d.mts +2 -0
- package/dist/esm/api/resources/index.mjs +2 -0
- package/dist/esm/api/resources/lang2Fhir/client/Client.d.mts +5 -5
- package/dist/esm/api/resources/lang2Fhir/client/Client.mjs +6 -2
- package/dist/esm/api/resources/tools/client/Client.d.mts +6 -6
- package/dist/esm/api/resources/tools/client/Client.mjs +7 -3
- package/dist/esm/api/resources/tools/client/requests/CohortRequest.d.mts +3 -17
- package/dist/esm/api/resources/tools/client/requests/CohortRequest.mjs +1 -9
- package/dist/esm/api/resources/tools/client/requests/Lang2FhirAndCreateRequest.d.mts +2 -14
- package/dist/esm/api/resources/tools/client/requests/Lang2FhirAndCreateRequest.mjs +0 -6
- package/dist/esm/api/resources/tools/client/requests/Lang2FhirAndSearchRequest.d.mts +2 -16
- package/dist/esm/api/resources/tools/client/requests/Lang2FhirAndSearchRequest.mjs +1 -9
- package/dist/esm/api/resources/tools/resources/mcpServer/client/Client.d.mts +5 -5
- package/dist/esm/api/resources/tools/resources/mcpServer/client/Client.mjs +6 -2
- package/dist/esm/api/resources/tools/resources/mcpServer/resources/tools/client/Client.d.mts +5 -5
- package/dist/esm/api/resources/tools/resources/mcpServer/resources/tools/client/Client.mjs +6 -2
- package/dist/esm/api/resources/tools/types/index.d.mts +0 -1
- package/dist/esm/api/resources/tools/types/index.mjs +0 -1
- package/dist/esm/core/fetcher/Fetcher.d.mts +1 -1
- package/dist/esm/core/fetcher/requestWithRetries.mjs +44 -8
- package/dist/esm/core/headers.d.mts +2 -2
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +2 -3
- package/reference.md +1090 -4
- package/LICENSE +0 -21
- package/dist/cjs/api/resources/agent/client/requests/AgentUpdateRequest.d.ts +0 -25
- package/dist/cjs/api/resources/agent/types/AgentFhirConfig.d.ts +0 -12
- package/dist/cjs/api/resources/agent/types/AgentProvider.d.ts +0 -11
- package/dist/cjs/api/resources/agent/types/ChatFhirClientConfig.d.ts +0 -12
- package/dist/cjs/api/resources/agent/types/ProviderType.d.ts +0 -13
- package/dist/cjs/api/resources/tools/types/FhirClientConfig.d.ts +0 -12
- package/dist/esm/api/resources/agent/client/requests/AgentUpdateRequest.d.mts +0 -25
- package/dist/esm/api/resources/agent/types/AgentFhirConfig.d.mts +0 -12
- package/dist/esm/api/resources/agent/types/AgentProvider.d.mts +0 -11
- package/dist/esm/api/resources/agent/types/ChatFhirClientConfig.d.mts +0 -12
- package/dist/esm/api/resources/agent/types/ProviderType.d.mts +0 -13
- package/dist/esm/api/resources/tools/types/FhirClientConfig.d.mts +0 -12
- /package/dist/cjs/api/resources/agent/{client/requests → types}/AgentCreateRequest.js +0 -0
- /package/dist/cjs/api/resources/{agent/client/requests/AgentUpdateRequest.js → fhir/client/requests/FhirCreateRequest.js} +0 -0
- /package/dist/cjs/api/resources/{agent/types/AgentFhirConfig.js → fhir/client/requests/FhirDeleteRequest.js} +0 -0
- /package/dist/cjs/api/resources/{agent/types/AgentProvider.js → fhir/client/requests/FhirExecuteBundleRequest.js} +0 -0
- /package/dist/cjs/api/resources/{agent/types/ChatFhirClientConfig.js → fhir/client/requests/FhirPatchRequest.js} +0 -0
- /package/dist/cjs/api/resources/{tools/types/FhirClientConfig.js → fhir/client/requests/FhirSearchRequest.js} +0 -0
- /package/dist/esm/api/resources/agent/{client/requests → types}/AgentCreateRequest.mjs +0 -0
- /package/dist/esm/api/resources/{agent/client/requests/AgentUpdateRequest.mjs → fhir/client/requests/FhirCreateRequest.mjs} +0 -0
- /package/dist/esm/api/resources/{agent/types/AgentFhirConfig.mjs → fhir/client/requests/FhirDeleteRequest.mjs} +0 -0
- /package/dist/esm/api/resources/{agent/types/AgentProvider.mjs → fhir/client/requests/FhirExecuteBundleRequest.mjs} +0 -0
- /package/dist/esm/api/resources/{agent/types/ChatFhirClientConfig.mjs → fhir/client/requests/FhirPatchRequest.mjs} +0 -0
- /package/dist/esm/api/resources/{tools/types/FhirClientConfig.mjs → fhir/client/requests/FhirSearchRequest.mjs} +0 -0
|
@@ -0,0 +1,559 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
5
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
6
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
7
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
8
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
9
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
10
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
import * as environments from "../../../../environments.mjs";
|
|
14
|
+
import * as core from "../../../../core/index.mjs";
|
|
15
|
+
import * as phenoml from "../../../index.mjs";
|
|
16
|
+
import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.mjs";
|
|
17
|
+
import * as errors from "../../../../errors/index.mjs";
|
|
18
|
+
export class FhirProvider {
|
|
19
|
+
constructor(_options = {}) {
|
|
20
|
+
this._options = _options;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Creates a new FHIR provider configuration with authentication credentials
|
|
24
|
+
*
|
|
25
|
+
* @param {phenoml.fhirProvider.FhirProviderCreateRequest} request
|
|
26
|
+
* @param {FhirProvider.RequestOptions} requestOptions - Request-specific configuration.
|
|
27
|
+
*
|
|
28
|
+
* @throws {@link phenoml.fhirProvider.BadRequestError}
|
|
29
|
+
* @throws {@link phenoml.fhirProvider.UnauthorizedError}
|
|
30
|
+
* @throws {@link phenoml.fhirProvider.ForbiddenError}
|
|
31
|
+
* @throws {@link phenoml.fhirProvider.InternalServerError}
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* await client.fhirProvider.create({
|
|
35
|
+
* name: "Epic Sandbox",
|
|
36
|
+
* provider: "athenahealth",
|
|
37
|
+
* auth_method: "client_secret",
|
|
38
|
+
* base_url: "https://fhir.epic.com/interconnect-fhir-oauth/api/FHIR/R4"
|
|
39
|
+
* })
|
|
40
|
+
*/
|
|
41
|
+
create(request, requestOptions) {
|
|
42
|
+
return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions));
|
|
43
|
+
}
|
|
44
|
+
__create(request, requestOptions) {
|
|
45
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
46
|
+
var _a, _b, _c, _d;
|
|
47
|
+
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
48
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
49
|
+
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, "fhir-provider/create"),
|
|
50
|
+
method: "POST",
|
|
51
|
+
headers: _headers,
|
|
52
|
+
contentType: "application/json",
|
|
53
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
54
|
+
requestType: "json",
|
|
55
|
+
body: request,
|
|
56
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
57
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
58
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
59
|
+
});
|
|
60
|
+
if (_response.ok) {
|
|
61
|
+
return {
|
|
62
|
+
data: _response.body,
|
|
63
|
+
rawResponse: _response.rawResponse,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
if (_response.error.reason === "status-code") {
|
|
67
|
+
switch (_response.error.statusCode) {
|
|
68
|
+
case 400:
|
|
69
|
+
throw new phenoml.fhirProvider.BadRequestError(_response.error.body, _response.rawResponse);
|
|
70
|
+
case 401:
|
|
71
|
+
throw new phenoml.fhirProvider.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
72
|
+
case 403:
|
|
73
|
+
throw new phenoml.fhirProvider.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
74
|
+
case 500:
|
|
75
|
+
throw new phenoml.fhirProvider.InternalServerError(_response.error.body, _response.rawResponse);
|
|
76
|
+
default:
|
|
77
|
+
throw new errors.phenomlError({
|
|
78
|
+
statusCode: _response.error.statusCode,
|
|
79
|
+
body: _response.error.body,
|
|
80
|
+
rawResponse: _response.rawResponse,
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
switch (_response.error.reason) {
|
|
85
|
+
case "non-json":
|
|
86
|
+
throw new errors.phenomlError({
|
|
87
|
+
statusCode: _response.error.statusCode,
|
|
88
|
+
body: _response.error.rawBody,
|
|
89
|
+
rawResponse: _response.rawResponse,
|
|
90
|
+
});
|
|
91
|
+
case "timeout":
|
|
92
|
+
throw new errors.phenomlTimeoutError("Timeout exceeded when calling POST /fhir-provider/create.");
|
|
93
|
+
case "unknown":
|
|
94
|
+
throw new errors.phenomlError({
|
|
95
|
+
message: _response.error.errorMessage,
|
|
96
|
+
rawResponse: _response.rawResponse,
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Retrieves a list of all active FHIR providers for the authenticated user
|
|
103
|
+
*
|
|
104
|
+
* @param {FhirProvider.RequestOptions} requestOptions - Request-specific configuration.
|
|
105
|
+
*
|
|
106
|
+
* @throws {@link phenoml.fhirProvider.UnauthorizedError}
|
|
107
|
+
* @throws {@link phenoml.fhirProvider.ForbiddenError}
|
|
108
|
+
* @throws {@link phenoml.fhirProvider.InternalServerError}
|
|
109
|
+
*
|
|
110
|
+
* @example
|
|
111
|
+
* await client.fhirProvider.list()
|
|
112
|
+
*/
|
|
113
|
+
list(requestOptions) {
|
|
114
|
+
return core.HttpResponsePromise.fromPromise(this.__list(requestOptions));
|
|
115
|
+
}
|
|
116
|
+
__list(requestOptions) {
|
|
117
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
118
|
+
var _a, _b, _c, _d;
|
|
119
|
+
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
120
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
121
|
+
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, "fhir-provider/list"),
|
|
122
|
+
method: "GET",
|
|
123
|
+
headers: _headers,
|
|
124
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
125
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
126
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
127
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
128
|
+
});
|
|
129
|
+
if (_response.ok) {
|
|
130
|
+
return {
|
|
131
|
+
data: _response.body,
|
|
132
|
+
rawResponse: _response.rawResponse,
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
if (_response.error.reason === "status-code") {
|
|
136
|
+
switch (_response.error.statusCode) {
|
|
137
|
+
case 401:
|
|
138
|
+
throw new phenoml.fhirProvider.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
139
|
+
case 403:
|
|
140
|
+
throw new phenoml.fhirProvider.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
141
|
+
case 500:
|
|
142
|
+
throw new phenoml.fhirProvider.InternalServerError(_response.error.body, _response.rawResponse);
|
|
143
|
+
default:
|
|
144
|
+
throw new errors.phenomlError({
|
|
145
|
+
statusCode: _response.error.statusCode,
|
|
146
|
+
body: _response.error.body,
|
|
147
|
+
rawResponse: _response.rawResponse,
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
switch (_response.error.reason) {
|
|
152
|
+
case "non-json":
|
|
153
|
+
throw new errors.phenomlError({
|
|
154
|
+
statusCode: _response.error.statusCode,
|
|
155
|
+
body: _response.error.rawBody,
|
|
156
|
+
rawResponse: _response.rawResponse,
|
|
157
|
+
});
|
|
158
|
+
case "timeout":
|
|
159
|
+
throw new errors.phenomlTimeoutError("Timeout exceeded when calling GET /fhir-provider/list.");
|
|
160
|
+
case "unknown":
|
|
161
|
+
throw new errors.phenomlError({
|
|
162
|
+
message: _response.error.errorMessage,
|
|
163
|
+
rawResponse: _response.rawResponse,
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Retrieves a specific FHIR provider configuration by its ID
|
|
170
|
+
*
|
|
171
|
+
* @param {string} fhirProviderId - ID of the FHIR provider to retrieve
|
|
172
|
+
* @param {FhirProvider.RequestOptions} requestOptions - Request-specific configuration.
|
|
173
|
+
*
|
|
174
|
+
* @throws {@link phenoml.fhirProvider.UnauthorizedError}
|
|
175
|
+
* @throws {@link phenoml.fhirProvider.ForbiddenError}
|
|
176
|
+
* @throws {@link phenoml.fhirProvider.NotFoundError}
|
|
177
|
+
* @throws {@link phenoml.fhirProvider.InternalServerError}
|
|
178
|
+
*
|
|
179
|
+
* @example
|
|
180
|
+
* await client.fhirProvider.get("fhir_provider_id")
|
|
181
|
+
*/
|
|
182
|
+
get(fhirProviderId, requestOptions) {
|
|
183
|
+
return core.HttpResponsePromise.fromPromise(this.__get(fhirProviderId, requestOptions));
|
|
184
|
+
}
|
|
185
|
+
__get(fhirProviderId, requestOptions) {
|
|
186
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
187
|
+
var _a, _b, _c, _d;
|
|
188
|
+
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
189
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
190
|
+
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, `fhir-provider/${encodeURIComponent(fhirProviderId)}`),
|
|
191
|
+
method: "GET",
|
|
192
|
+
headers: _headers,
|
|
193
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
194
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
195
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
196
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
197
|
+
});
|
|
198
|
+
if (_response.ok) {
|
|
199
|
+
return {
|
|
200
|
+
data: _response.body,
|
|
201
|
+
rawResponse: _response.rawResponse,
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
if (_response.error.reason === "status-code") {
|
|
205
|
+
switch (_response.error.statusCode) {
|
|
206
|
+
case 401:
|
|
207
|
+
throw new phenoml.fhirProvider.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
208
|
+
case 403:
|
|
209
|
+
throw new phenoml.fhirProvider.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
210
|
+
case 404:
|
|
211
|
+
throw new phenoml.fhirProvider.NotFoundError(_response.error.body, _response.rawResponse);
|
|
212
|
+
case 500:
|
|
213
|
+
throw new phenoml.fhirProvider.InternalServerError(_response.error.body, _response.rawResponse);
|
|
214
|
+
default:
|
|
215
|
+
throw new errors.phenomlError({
|
|
216
|
+
statusCode: _response.error.statusCode,
|
|
217
|
+
body: _response.error.body,
|
|
218
|
+
rawResponse: _response.rawResponse,
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
switch (_response.error.reason) {
|
|
223
|
+
case "non-json":
|
|
224
|
+
throw new errors.phenomlError({
|
|
225
|
+
statusCode: _response.error.statusCode,
|
|
226
|
+
body: _response.error.rawBody,
|
|
227
|
+
rawResponse: _response.rawResponse,
|
|
228
|
+
});
|
|
229
|
+
case "timeout":
|
|
230
|
+
throw new errors.phenomlTimeoutError("Timeout exceeded when calling GET /fhir-provider/{fhir_provider_id}.");
|
|
231
|
+
case "unknown":
|
|
232
|
+
throw new errors.phenomlError({
|
|
233
|
+
message: _response.error.errorMessage,
|
|
234
|
+
rawResponse: _response.rawResponse,
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Soft deletes a FHIR provider by setting is_active to false
|
|
241
|
+
*
|
|
242
|
+
* @param {string} fhirProviderId - ID of the FHIR provider to delete
|
|
243
|
+
* @param {FhirProvider.RequestOptions} requestOptions - Request-specific configuration.
|
|
244
|
+
*
|
|
245
|
+
* @throws {@link phenoml.fhirProvider.UnauthorizedError}
|
|
246
|
+
* @throws {@link phenoml.fhirProvider.ForbiddenError}
|
|
247
|
+
* @throws {@link phenoml.fhirProvider.NotFoundError}
|
|
248
|
+
* @throws {@link phenoml.fhirProvider.InternalServerError}
|
|
249
|
+
*
|
|
250
|
+
* @example
|
|
251
|
+
* await client.fhirProvider.delete("fhir_provider_id")
|
|
252
|
+
*/
|
|
253
|
+
delete(fhirProviderId, requestOptions) {
|
|
254
|
+
return core.HttpResponsePromise.fromPromise(this.__delete(fhirProviderId, requestOptions));
|
|
255
|
+
}
|
|
256
|
+
__delete(fhirProviderId, requestOptions) {
|
|
257
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
258
|
+
var _a, _b, _c, _d;
|
|
259
|
+
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
260
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
261
|
+
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, `fhir-provider/${encodeURIComponent(fhirProviderId)}`),
|
|
262
|
+
method: "DELETE",
|
|
263
|
+
headers: _headers,
|
|
264
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
265
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
266
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
267
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
268
|
+
});
|
|
269
|
+
if (_response.ok) {
|
|
270
|
+
return {
|
|
271
|
+
data: _response.body,
|
|
272
|
+
rawResponse: _response.rawResponse,
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
if (_response.error.reason === "status-code") {
|
|
276
|
+
switch (_response.error.statusCode) {
|
|
277
|
+
case 401:
|
|
278
|
+
throw new phenoml.fhirProvider.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
279
|
+
case 403:
|
|
280
|
+
throw new phenoml.fhirProvider.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
281
|
+
case 404:
|
|
282
|
+
throw new phenoml.fhirProvider.NotFoundError(_response.error.body, _response.rawResponse);
|
|
283
|
+
case 500:
|
|
284
|
+
throw new phenoml.fhirProvider.InternalServerError(_response.error.body, _response.rawResponse);
|
|
285
|
+
default:
|
|
286
|
+
throw new errors.phenomlError({
|
|
287
|
+
statusCode: _response.error.statusCode,
|
|
288
|
+
body: _response.error.body,
|
|
289
|
+
rawResponse: _response.rawResponse,
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
switch (_response.error.reason) {
|
|
294
|
+
case "non-json":
|
|
295
|
+
throw new errors.phenomlError({
|
|
296
|
+
statusCode: _response.error.statusCode,
|
|
297
|
+
body: _response.error.rawBody,
|
|
298
|
+
rawResponse: _response.rawResponse,
|
|
299
|
+
});
|
|
300
|
+
case "timeout":
|
|
301
|
+
throw new errors.phenomlTimeoutError("Timeout exceeded when calling DELETE /fhir-provider/{fhir_provider_id}.");
|
|
302
|
+
case "unknown":
|
|
303
|
+
throw new errors.phenomlError({
|
|
304
|
+
message: _response.error.errorMessage,
|
|
305
|
+
rawResponse: _response.rawResponse,
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* Adds a new authentication configuration to an existing FHIR provider. This enables key rotation and multiple auth configurations per provider.
|
|
312
|
+
*
|
|
313
|
+
* @param {string} fhirProviderId - ID of the FHIR provider to add auth config to
|
|
314
|
+
* @param {phenoml.fhirProvider.FhirProviderAddAuthConfigRequest} request
|
|
315
|
+
* @param {FhirProvider.RequestOptions} requestOptions - Request-specific configuration.
|
|
316
|
+
*
|
|
317
|
+
* @throws {@link phenoml.fhirProvider.BadRequestError}
|
|
318
|
+
* @throws {@link phenoml.fhirProvider.UnauthorizedError}
|
|
319
|
+
* @throws {@link phenoml.fhirProvider.ForbiddenError}
|
|
320
|
+
* @throws {@link phenoml.fhirProvider.NotFoundError}
|
|
321
|
+
* @throws {@link phenoml.fhirProvider.InternalServerError}
|
|
322
|
+
*
|
|
323
|
+
* @example
|
|
324
|
+
* await client.fhirProvider.addAuthConfig("1716d214-de93-43a4-aa6b-a878d864e2ad", {
|
|
325
|
+
* auth_method: "client_secret"
|
|
326
|
+
* })
|
|
327
|
+
*/
|
|
328
|
+
addAuthConfig(fhirProviderId, request, requestOptions) {
|
|
329
|
+
return core.HttpResponsePromise.fromPromise(this.__addAuthConfig(fhirProviderId, request, requestOptions));
|
|
330
|
+
}
|
|
331
|
+
__addAuthConfig(fhirProviderId, request, requestOptions) {
|
|
332
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
333
|
+
var _a, _b, _c, _d;
|
|
334
|
+
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
335
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
336
|
+
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, `fhir-provider/${encodeURIComponent(fhirProviderId)}/add-auth-config`),
|
|
337
|
+
method: "PATCH",
|
|
338
|
+
headers: _headers,
|
|
339
|
+
contentType: "application/json",
|
|
340
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
341
|
+
requestType: "json",
|
|
342
|
+
body: request,
|
|
343
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
344
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
345
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
346
|
+
});
|
|
347
|
+
if (_response.ok) {
|
|
348
|
+
return {
|
|
349
|
+
data: _response.body,
|
|
350
|
+
rawResponse: _response.rawResponse,
|
|
351
|
+
};
|
|
352
|
+
}
|
|
353
|
+
if (_response.error.reason === "status-code") {
|
|
354
|
+
switch (_response.error.statusCode) {
|
|
355
|
+
case 400:
|
|
356
|
+
throw new phenoml.fhirProvider.BadRequestError(_response.error.body, _response.rawResponse);
|
|
357
|
+
case 401:
|
|
358
|
+
throw new phenoml.fhirProvider.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
359
|
+
case 403:
|
|
360
|
+
throw new phenoml.fhirProvider.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
361
|
+
case 404:
|
|
362
|
+
throw new phenoml.fhirProvider.NotFoundError(_response.error.body, _response.rawResponse);
|
|
363
|
+
case 500:
|
|
364
|
+
throw new phenoml.fhirProvider.InternalServerError(_response.error.body, _response.rawResponse);
|
|
365
|
+
default:
|
|
366
|
+
throw new errors.phenomlError({
|
|
367
|
+
statusCode: _response.error.statusCode,
|
|
368
|
+
body: _response.error.body,
|
|
369
|
+
rawResponse: _response.rawResponse,
|
|
370
|
+
});
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
switch (_response.error.reason) {
|
|
374
|
+
case "non-json":
|
|
375
|
+
throw new errors.phenomlError({
|
|
376
|
+
statusCode: _response.error.statusCode,
|
|
377
|
+
body: _response.error.rawBody,
|
|
378
|
+
rawResponse: _response.rawResponse,
|
|
379
|
+
});
|
|
380
|
+
case "timeout":
|
|
381
|
+
throw new errors.phenomlTimeoutError("Timeout exceeded when calling PATCH /fhir-provider/{fhir_provider_id}/add-auth-config.");
|
|
382
|
+
case "unknown":
|
|
383
|
+
throw new errors.phenomlError({
|
|
384
|
+
message: _response.error.errorMessage,
|
|
385
|
+
rawResponse: _response.rawResponse,
|
|
386
|
+
});
|
|
387
|
+
}
|
|
388
|
+
});
|
|
389
|
+
}
|
|
390
|
+
/**
|
|
391
|
+
* Sets which authentication configuration should be active for a FHIR provider. Only one auth config can be active at a time.
|
|
392
|
+
*
|
|
393
|
+
* @param {string} fhirProviderId - ID of the FHIR provider
|
|
394
|
+
* @param {phenoml.fhirProvider.FhirProviderSetActiveAuthConfigRequest} request
|
|
395
|
+
* @param {FhirProvider.RequestOptions} requestOptions - Request-specific configuration.
|
|
396
|
+
*
|
|
397
|
+
* @throws {@link phenoml.fhirProvider.BadRequestError}
|
|
398
|
+
* @throws {@link phenoml.fhirProvider.UnauthorizedError}
|
|
399
|
+
* @throws {@link phenoml.fhirProvider.ForbiddenError}
|
|
400
|
+
* @throws {@link phenoml.fhirProvider.NotFoundError}
|
|
401
|
+
* @throws {@link phenoml.fhirProvider.InternalServerError}
|
|
402
|
+
*
|
|
403
|
+
* @example
|
|
404
|
+
* await client.fhirProvider.setActiveAuthConfig("1716d214-de93-43a4-aa6b-a878d864e2ad", {
|
|
405
|
+
* auth_config_id: "auth-config-123"
|
|
406
|
+
* })
|
|
407
|
+
*/
|
|
408
|
+
setActiveAuthConfig(fhirProviderId, request, requestOptions) {
|
|
409
|
+
return core.HttpResponsePromise.fromPromise(this.__setActiveAuthConfig(fhirProviderId, request, requestOptions));
|
|
410
|
+
}
|
|
411
|
+
__setActiveAuthConfig(fhirProviderId, request, requestOptions) {
|
|
412
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
413
|
+
var _a, _b, _c, _d;
|
|
414
|
+
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
415
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
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, `fhir-provider/${encodeURIComponent(fhirProviderId)}/set-active-auth-config`),
|
|
417
|
+
method: "PATCH",
|
|
418
|
+
headers: _headers,
|
|
419
|
+
contentType: "application/json",
|
|
420
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
421
|
+
requestType: "json",
|
|
422
|
+
body: request,
|
|
423
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
424
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
425
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
426
|
+
});
|
|
427
|
+
if (_response.ok) {
|
|
428
|
+
return {
|
|
429
|
+
data: _response.body,
|
|
430
|
+
rawResponse: _response.rawResponse,
|
|
431
|
+
};
|
|
432
|
+
}
|
|
433
|
+
if (_response.error.reason === "status-code") {
|
|
434
|
+
switch (_response.error.statusCode) {
|
|
435
|
+
case 400:
|
|
436
|
+
throw new phenoml.fhirProvider.BadRequestError(_response.error.body, _response.rawResponse);
|
|
437
|
+
case 401:
|
|
438
|
+
throw new phenoml.fhirProvider.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
439
|
+
case 403:
|
|
440
|
+
throw new phenoml.fhirProvider.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
441
|
+
case 404:
|
|
442
|
+
throw new phenoml.fhirProvider.NotFoundError(_response.error.body, _response.rawResponse);
|
|
443
|
+
case 500:
|
|
444
|
+
throw new phenoml.fhirProvider.InternalServerError(_response.error.body, _response.rawResponse);
|
|
445
|
+
default:
|
|
446
|
+
throw new errors.phenomlError({
|
|
447
|
+
statusCode: _response.error.statusCode,
|
|
448
|
+
body: _response.error.body,
|
|
449
|
+
rawResponse: _response.rawResponse,
|
|
450
|
+
});
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
switch (_response.error.reason) {
|
|
454
|
+
case "non-json":
|
|
455
|
+
throw new errors.phenomlError({
|
|
456
|
+
statusCode: _response.error.statusCode,
|
|
457
|
+
body: _response.error.rawBody,
|
|
458
|
+
rawResponse: _response.rawResponse,
|
|
459
|
+
});
|
|
460
|
+
case "timeout":
|
|
461
|
+
throw new errors.phenomlTimeoutError("Timeout exceeded when calling PATCH /fhir-provider/{fhir_provider_id}/set-active-auth-config.");
|
|
462
|
+
case "unknown":
|
|
463
|
+
throw new errors.phenomlError({
|
|
464
|
+
message: _response.error.errorMessage,
|
|
465
|
+
rawResponse: _response.rawResponse,
|
|
466
|
+
});
|
|
467
|
+
}
|
|
468
|
+
});
|
|
469
|
+
}
|
|
470
|
+
/**
|
|
471
|
+
* Removes an authentication configuration from a FHIR provider. Cannot remove the currently active auth configuration.
|
|
472
|
+
*
|
|
473
|
+
* @param {string} fhirProviderId - ID of the FHIR provider
|
|
474
|
+
* @param {phenoml.fhirProvider.FhirProviderRemoveAuthConfigRequest} request
|
|
475
|
+
* @param {FhirProvider.RequestOptions} requestOptions - Request-specific configuration.
|
|
476
|
+
*
|
|
477
|
+
* @throws {@link phenoml.fhirProvider.BadRequestError}
|
|
478
|
+
* @throws {@link phenoml.fhirProvider.UnauthorizedError}
|
|
479
|
+
* @throws {@link phenoml.fhirProvider.ForbiddenError}
|
|
480
|
+
* @throws {@link phenoml.fhirProvider.NotFoundError}
|
|
481
|
+
* @throws {@link phenoml.fhirProvider.InternalServerError}
|
|
482
|
+
*
|
|
483
|
+
* @example
|
|
484
|
+
* await client.fhirProvider.removeAuthConfig("1716d214-de93-43a4-aa6b-a878d864e2ad", {
|
|
485
|
+
* auth_config_id: "auth-config-123"
|
|
486
|
+
* })
|
|
487
|
+
*/
|
|
488
|
+
removeAuthConfig(fhirProviderId, request, requestOptions) {
|
|
489
|
+
return core.HttpResponsePromise.fromPromise(this.__removeAuthConfig(fhirProviderId, request, requestOptions));
|
|
490
|
+
}
|
|
491
|
+
__removeAuthConfig(fhirProviderId, request, requestOptions) {
|
|
492
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
493
|
+
var _a, _b, _c, _d;
|
|
494
|
+
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
495
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
496
|
+
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, `fhir-provider/${encodeURIComponent(fhirProviderId)}/remove-auth-config`),
|
|
497
|
+
method: "PATCH",
|
|
498
|
+
headers: _headers,
|
|
499
|
+
contentType: "application/json",
|
|
500
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
501
|
+
requestType: "json",
|
|
502
|
+
body: request,
|
|
503
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
504
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
505
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
506
|
+
});
|
|
507
|
+
if (_response.ok) {
|
|
508
|
+
return {
|
|
509
|
+
data: _response.body,
|
|
510
|
+
rawResponse: _response.rawResponse,
|
|
511
|
+
};
|
|
512
|
+
}
|
|
513
|
+
if (_response.error.reason === "status-code") {
|
|
514
|
+
switch (_response.error.statusCode) {
|
|
515
|
+
case 400:
|
|
516
|
+
throw new phenoml.fhirProvider.BadRequestError(_response.error.body, _response.rawResponse);
|
|
517
|
+
case 401:
|
|
518
|
+
throw new phenoml.fhirProvider.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
519
|
+
case 403:
|
|
520
|
+
throw new phenoml.fhirProvider.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
521
|
+
case 404:
|
|
522
|
+
throw new phenoml.fhirProvider.NotFoundError(_response.error.body, _response.rawResponse);
|
|
523
|
+
case 500:
|
|
524
|
+
throw new phenoml.fhirProvider.InternalServerError(_response.error.body, _response.rawResponse);
|
|
525
|
+
default:
|
|
526
|
+
throw new errors.phenomlError({
|
|
527
|
+
statusCode: _response.error.statusCode,
|
|
528
|
+
body: _response.error.body,
|
|
529
|
+
rawResponse: _response.rawResponse,
|
|
530
|
+
});
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
switch (_response.error.reason) {
|
|
534
|
+
case "non-json":
|
|
535
|
+
throw new errors.phenomlError({
|
|
536
|
+
statusCode: _response.error.statusCode,
|
|
537
|
+
body: _response.error.rawBody,
|
|
538
|
+
rawResponse: _response.rawResponse,
|
|
539
|
+
});
|
|
540
|
+
case "timeout":
|
|
541
|
+
throw new errors.phenomlTimeoutError("Timeout exceeded when calling PATCH /fhir-provider/{fhir_provider_id}/remove-auth-config.");
|
|
542
|
+
case "unknown":
|
|
543
|
+
throw new errors.phenomlError({
|
|
544
|
+
message: _response.error.errorMessage,
|
|
545
|
+
rawResponse: _response.rawResponse,
|
|
546
|
+
});
|
|
547
|
+
}
|
|
548
|
+
});
|
|
549
|
+
}
|
|
550
|
+
_getAuthorizationHeader() {
|
|
551
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
552
|
+
const bearer = yield core.Supplier.get(this._options.token);
|
|
553
|
+
if (bearer != null) {
|
|
554
|
+
return `Bearer ${bearer}`;
|
|
555
|
+
}
|
|
556
|
+
return undefined;
|
|
557
|
+
});
|
|
558
|
+
}
|
|
559
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.mjs";
|
package/dist/esm/api/resources/fhirProvider/client/requests/FhirProviderAddAuthConfigRequest.d.mts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as phenoml from "../../../../index.mjs";
|
|
5
|
+
/**
|
|
6
|
+
* @example
|
|
7
|
+
* {
|
|
8
|
+
* auth_method: "client_secret"
|
|
9
|
+
* }
|
|
10
|
+
*/
|
|
11
|
+
export interface FhirProviderAddAuthConfigRequest {
|
|
12
|
+
auth_method: phenoml.fhirProvider.AuthMethod;
|
|
13
|
+
/** OAuth client secret (required for client_secret and on_behalf_of auth methods) */
|
|
14
|
+
client_secret?: string;
|
|
15
|
+
service_account_key?: phenoml.fhirProvider.ServiceAccountKey;
|
|
16
|
+
/** Expiry time for JWT credentials (only applicable for JWT auth method) */
|
|
17
|
+
credential_expiry?: string;
|
|
18
|
+
/** OAuth scopes to request */
|
|
19
|
+
scopes?: string;
|
|
20
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as phenoml from "../../../../index.mjs";
|
|
5
|
+
/**
|
|
6
|
+
* @example
|
|
7
|
+
* {
|
|
8
|
+
* name: "Epic Sandbox",
|
|
9
|
+
* provider: "athenahealth",
|
|
10
|
+
* auth_method: "client_secret",
|
|
11
|
+
* base_url: "https://fhir.epic.com/interconnect-fhir-oauth/api/FHIR/R4"
|
|
12
|
+
* }
|
|
13
|
+
*/
|
|
14
|
+
export interface FhirProviderCreateRequest {
|
|
15
|
+
/** Display name for the FHIR provider */
|
|
16
|
+
name: string;
|
|
17
|
+
/** Optional description of the FHIR provider */
|
|
18
|
+
description?: string;
|
|
19
|
+
provider: phenoml.fhirProvider.Provider;
|
|
20
|
+
auth_method: phenoml.fhirProvider.AuthMethod;
|
|
21
|
+
/** Base URL of the FHIR server */
|
|
22
|
+
base_url: string;
|
|
23
|
+
/** OAuth client ID (required for most auth methods) */
|
|
24
|
+
client_id?: string;
|
|
25
|
+
/** OAuth client secret (required for client_secret and on_behalf_of auth methods) */
|
|
26
|
+
client_secret?: string;
|
|
27
|
+
service_account_key?: phenoml.fhirProvider.ServiceAccountKey;
|
|
28
|
+
/** OAuth scopes to request */
|
|
29
|
+
scopes?: string;
|
|
30
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* @example
|
|
6
|
+
* {
|
|
7
|
+
* auth_config_id: "auth-config-123"
|
|
8
|
+
* }
|
|
9
|
+
*/
|
|
10
|
+
export interface FhirProviderRemoveAuthConfigRequest {
|
|
11
|
+
/** ID of the auth configuration to remove */
|
|
12
|
+
auth_config_id: string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* @example
|
|
6
|
+
* {
|
|
7
|
+
* auth_config_id: "auth-config-123"
|
|
8
|
+
* }
|
|
9
|
+
*/
|
|
10
|
+
export interface FhirProviderSetActiveAuthConfigRequest {
|
|
11
|
+
/** ID of the auth configuration to set as active */
|
|
12
|
+
auth_config_id: string;
|
|
13
|
+
}
|