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.
Files changed (502) hide show
  1. package/dist/cjs/BaseClient.d.ts +13 -4
  2. package/dist/cjs/BaseClient.js +59 -0
  3. package/dist/cjs/Client.d.ts +34 -34
  4. package/dist/cjs/Client.js +13 -54
  5. package/dist/cjs/api/resources/agent/client/Client.d.ts +26 -27
  6. package/dist/cjs/api/resources/agent/client/Client.js +56 -185
  7. package/dist/cjs/api/resources/agent/errors/BadRequestError.js +5 -1
  8. package/dist/cjs/api/resources/agent/errors/ForbiddenError.js +5 -1
  9. package/dist/cjs/api/resources/agent/errors/InternalServerError.js +5 -1
  10. package/dist/cjs/api/resources/agent/errors/NotFoundError.js +5 -1
  11. package/dist/cjs/api/resources/agent/errors/UnauthorizedError.js +5 -1
  12. package/dist/cjs/api/resources/agent/exports.d.ts +3 -0
  13. package/dist/cjs/api/resources/agent/exports.js +22 -0
  14. package/dist/cjs/api/resources/agent/resources/prompts/client/Client.d.ts +20 -21
  15. package/dist/cjs/api/resources/agent/resources/prompts/client/Client.js +35 -129
  16. package/dist/cjs/api/resources/agent/resources/prompts/exports.d.ts +2 -0
  17. package/dist/cjs/api/resources/agent/resources/prompts/exports.js +21 -0
  18. package/dist/cjs/api/resources/agent/resources/prompts/types/PromptsDeleteResponse.d.ts +2 -2
  19. package/dist/cjs/api/resources/agent/resources/prompts/types/PromptsListResponse.d.ts +3 -3
  20. package/dist/cjs/api/resources/agent/types/AgentChatResponse.d.ts +4 -4
  21. package/dist/cjs/api/resources/agent/types/AgentChatStreamEvent.d.ts +8 -8
  22. package/dist/cjs/api/resources/agent/types/AgentCreateRequest.d.ts +4 -4
  23. package/dist/cjs/api/resources/agent/types/AgentDeleteResponse.d.ts +2 -2
  24. package/dist/cjs/api/resources/agent/types/AgentGetChatMessagesResponse.d.ts +3 -3
  25. package/dist/cjs/api/resources/agent/types/AgentListResponse.d.ts +3 -3
  26. package/dist/cjs/api/resources/agent/types/AgentPromptsResponse.d.ts +3 -3
  27. package/dist/cjs/api/resources/agent/types/AgentResponse.d.ts +3 -3
  28. package/dist/cjs/api/resources/agent/types/AgentTemplate.d.ts +8 -8
  29. package/dist/cjs/api/resources/agent/types/ChatMessageTemplate.d.ts +10 -10
  30. package/dist/cjs/api/resources/agent/types/ChatSessionTemplate.d.ts +9 -9
  31. package/dist/cjs/api/resources/agent/types/JsonPatchOperation.d.ts +2 -2
  32. package/dist/cjs/api/resources/agent/types/PromptTemplate.d.ts +6 -6
  33. package/dist/cjs/api/resources/agent/types/SuccessResponse.d.ts +2 -2
  34. package/dist/cjs/api/resources/authtoken/client/Client.d.ts +9 -9
  35. package/dist/cjs/api/resources/authtoken/client/Client.js +7 -6
  36. package/dist/cjs/api/resources/authtoken/errors/BadRequestError.js +5 -1
  37. package/dist/cjs/api/resources/authtoken/errors/InternalServerError.d.ts +5 -0
  38. package/dist/cjs/api/resources/authtoken/errors/InternalServerError.js +54 -0
  39. package/dist/cjs/api/resources/authtoken/errors/UnauthorizedError.js +5 -1
  40. package/dist/cjs/api/resources/authtoken/errors/index.d.ts +1 -0
  41. package/dist/cjs/api/resources/authtoken/errors/index.js +1 -0
  42. package/dist/cjs/api/resources/authtoken/exports.d.ts +3 -0
  43. package/dist/cjs/api/resources/authtoken/exports.js +22 -0
  44. package/dist/cjs/api/resources/authtoken/resources/auth/client/Client.d.ts +28 -30
  45. package/dist/cjs/api/resources/authtoken/resources/auth/client/Client.js +76 -43
  46. package/dist/cjs/api/resources/authtoken/resources/auth/client/requests/ClientCredentialsRequest.d.ts +12 -0
  47. package/dist/cjs/api/resources/authtoken/resources/auth/client/requests/ClientCredentialsRequest.js +3 -0
  48. package/dist/cjs/api/resources/authtoken/resources/auth/client/requests/index.d.ts +1 -0
  49. package/dist/cjs/api/resources/authtoken/resources/auth/exports.d.ts +2 -0
  50. package/dist/cjs/api/resources/authtoken/resources/auth/exports.js +21 -0
  51. package/dist/cjs/api/resources/authtoken/types/BadRequestErrorBody.d.ts +3 -3
  52. package/dist/cjs/api/resources/authtoken/types/OAuthError.d.ts +19 -0
  53. package/dist/cjs/api/resources/authtoken/types/OAuthError.js +14 -0
  54. package/dist/cjs/api/resources/authtoken/types/TokenResponse.d.ts +8 -0
  55. package/dist/cjs/api/resources/authtoken/types/TokenResponse.js +3 -0
  56. package/dist/cjs/api/resources/authtoken/types/UnauthorizedErrorBody.d.ts +3 -3
  57. package/dist/cjs/api/resources/authtoken/types/index.d.ts +2 -0
  58. package/dist/cjs/api/resources/authtoken/types/index.js +2 -0
  59. package/dist/cjs/api/resources/cohort/client/Client.d.ts +8 -9
  60. package/dist/cjs/api/resources/cohort/client/Client.js +11 -27
  61. package/dist/cjs/api/resources/cohort/errors/BadRequestError.js +5 -1
  62. package/dist/cjs/api/resources/cohort/errors/InternalServerError.js +5 -1
  63. package/dist/cjs/api/resources/cohort/errors/UnauthorizedError.js +5 -1
  64. package/dist/cjs/api/resources/cohort/exports.d.ts +2 -0
  65. package/dist/cjs/api/resources/cohort/exports.js +21 -0
  66. package/dist/cjs/api/resources/cohort/types/CohortResponse.d.ts +3 -3
  67. package/dist/cjs/api/resources/cohort/types/SearchConcept.d.ts +4 -4
  68. package/dist/cjs/api/resources/construe/client/Client.d.ts +28 -29
  69. package/dist/cjs/api/resources/construe/client/Client.js +78 -239
  70. package/dist/cjs/api/resources/construe/client/requests/index.d.ts +1 -1
  71. package/dist/cjs/api/resources/construe/client/requests/index.js +3 -0
  72. package/dist/cjs/api/resources/construe/errors/BadRequestError.js +5 -1
  73. package/dist/cjs/api/resources/construe/errors/ConflictError.js +5 -1
  74. package/dist/cjs/api/resources/construe/errors/FailedDependencyError.js +5 -1
  75. package/dist/cjs/api/resources/construe/errors/ForbiddenError.js +5 -1
  76. package/dist/cjs/api/resources/construe/errors/GatewayTimeoutError.js +5 -1
  77. package/dist/cjs/api/resources/construe/errors/InternalServerError.js +5 -1
  78. package/dist/cjs/api/resources/construe/errors/NotFoundError.js +5 -1
  79. package/dist/cjs/api/resources/construe/errors/NotImplementedError.js +5 -1
  80. package/dist/cjs/api/resources/construe/errors/ServiceUnavailableError.js +5 -1
  81. package/dist/cjs/api/resources/construe/errors/UnauthorizedError.js +5 -1
  82. package/dist/cjs/api/resources/construe/exports.d.ts +2 -0
  83. package/dist/cjs/api/resources/construe/exports.js +21 -0
  84. package/dist/cjs/api/resources/construe/types/CodeResponse.d.ts +1 -1
  85. package/dist/cjs/api/resources/construe/types/ConstrueUploadCodeSystemResponse.d.ts +3 -3
  86. package/dist/cjs/api/resources/construe/types/ExtractRequestConfig.d.ts +8 -8
  87. package/dist/cjs/api/resources/construe/types/ExtractRequestSystem.d.ts +2 -2
  88. package/dist/cjs/api/resources/construe/types/ExtractedCodeResult.d.ts +3 -3
  89. package/dist/cjs/api/resources/construe/types/GetCodeResponse.d.ts +1 -1
  90. package/dist/cjs/api/resources/construe/types/ListCodesResponse.d.ts +1 -1
  91. package/dist/cjs/api/resources/fhir/client/Client.d.ts +18 -19
  92. package/dist/cjs/api/resources/fhir/client/Client.js +46 -134
  93. package/dist/cjs/api/resources/fhir/client/requests/FhirSearchRequest.d.ts +0 -6
  94. package/dist/cjs/api/resources/fhir/errors/BadGatewayError.js +5 -1
  95. package/dist/cjs/api/resources/fhir/errors/BadRequestError.js +5 -1
  96. package/dist/cjs/api/resources/fhir/errors/InternalServerError.js +5 -1
  97. package/dist/cjs/api/resources/fhir/errors/NotFoundError.js +5 -1
  98. package/dist/cjs/api/resources/fhir/errors/UnauthorizedError.js +5 -1
  99. package/dist/cjs/api/resources/fhir/exports.d.ts +2 -0
  100. package/dist/cjs/api/resources/fhir/exports.js +21 -0
  101. package/dist/cjs/api/resources/fhir/types/ErrorResponse.d.ts +2 -2
  102. package/dist/cjs/api/resources/fhir/types/FhirBundle.d.ts +8 -8
  103. package/dist/cjs/api/resources/fhir/types/FhirPatchRequestBodyItem.d.ts +2 -2
  104. package/dist/cjs/api/resources/fhir/types/FhirResource.d.ts +5 -5
  105. package/dist/cjs/api/resources/fhirProvider/client/Client.d.ts +20 -21
  106. package/dist/cjs/api/resources/fhirProvider/client/Client.js +35 -129
  107. package/dist/cjs/api/resources/fhirProvider/errors/BadRequestError.js +5 -1
  108. package/dist/cjs/api/resources/fhirProvider/errors/ForbiddenError.js +5 -1
  109. package/dist/cjs/api/resources/fhirProvider/errors/InternalServerError.js +5 -1
  110. package/dist/cjs/api/resources/fhirProvider/errors/NotFoundError.js +5 -1
  111. package/dist/cjs/api/resources/fhirProvider/errors/UnauthorizedError.js +5 -1
  112. package/dist/cjs/api/resources/fhirProvider/exports.d.ts +2 -0
  113. package/dist/cjs/api/resources/fhirProvider/exports.js +21 -0
  114. package/dist/cjs/api/resources/fhirProvider/types/ClientSecretAuth.d.ts +2 -2
  115. package/dist/cjs/api/resources/fhirProvider/types/FhirProviderAuthConfig.d.ts +12 -12
  116. package/dist/cjs/api/resources/fhirProvider/types/FhirProviderDeleteResponse.d.ts +2 -2
  117. package/dist/cjs/api/resources/fhirProvider/types/FhirProviderListResponse.d.ts +3 -3
  118. package/dist/cjs/api/resources/fhirProvider/types/FhirProviderRemoveAuthConfigResponse.d.ts +3 -3
  119. package/dist/cjs/api/resources/fhirProvider/types/FhirProviderResponse.d.ts +3 -3
  120. package/dist/cjs/api/resources/fhirProvider/types/FhirProviderSandboxInfo.d.ts +4 -4
  121. package/dist/cjs/api/resources/fhirProvider/types/FhirProviderTemplate.d.ts +8 -8
  122. package/dist/cjs/api/resources/fhirProvider/types/FhirQueryResponse.d.ts +4 -4
  123. package/dist/cjs/api/resources/fhirProvider/types/JsonWebKey.d.ts +6 -6
  124. package/dist/cjs/api/resources/fhirProvider/types/JwtAuth.d.ts +3 -3
  125. package/dist/cjs/api/resources/fhirProvider/types/OnBehalfOfAuth.d.ts +2 -2
  126. package/dist/cjs/api/resources/fhirProvider/types/ServiceAccountMetadata.d.ts +4 -4
  127. package/dist/cjs/api/resources/fhirProvider/types/SmartConfiguration.d.ts +5 -5
  128. package/dist/cjs/api/resources/lang2Fhir/client/Client.d.ts +18 -19
  129. package/dist/cjs/api/resources/lang2Fhir/client/Client.js +31 -112
  130. package/dist/cjs/api/resources/lang2Fhir/client/requests/index.d.ts +1 -1
  131. package/dist/cjs/api/resources/lang2Fhir/client/requests/index.js +3 -0
  132. package/dist/cjs/api/resources/lang2Fhir/errors/BadRequestError.js +5 -1
  133. package/dist/cjs/api/resources/lang2Fhir/errors/FailedDependencyError.js +5 -1
  134. package/dist/cjs/api/resources/lang2Fhir/errors/ForbiddenError.js +5 -1
  135. package/dist/cjs/api/resources/lang2Fhir/errors/InternalServerError.js +5 -1
  136. package/dist/cjs/api/resources/lang2Fhir/errors/UnauthorizedError.js +5 -1
  137. package/dist/cjs/api/resources/lang2Fhir/errors/UnprocessableEntityError.js +5 -1
  138. package/dist/cjs/api/resources/lang2Fhir/exports.d.ts +2 -0
  139. package/dist/cjs/api/resources/lang2Fhir/exports.js +21 -0
  140. package/dist/cjs/api/resources/lang2Fhir/types/CreateMultiResponse.d.ts +15 -15
  141. package/dist/cjs/api/resources/lang2Fhir/types/Lang2FhirUploadProfileResponse.d.ts +4 -4
  142. package/dist/cjs/api/resources/lang2Fhir/types/SearchResponse.d.ts +2 -2
  143. package/dist/cjs/api/resources/summary/client/Client.d.ts +18 -19
  144. package/dist/cjs/api/resources/summary/client/Client.js +31 -112
  145. package/dist/cjs/api/resources/summary/client/requests/index.d.ts +1 -1
  146. package/dist/cjs/api/resources/summary/client/requests/index.js +3 -0
  147. package/dist/cjs/api/resources/summary/errors/BadRequestError.js +5 -1
  148. package/dist/cjs/api/resources/summary/errors/ForbiddenError.js +5 -1
  149. package/dist/cjs/api/resources/summary/errors/InternalServerError.js +5 -1
  150. package/dist/cjs/api/resources/summary/errors/NotFoundError.js +5 -1
  151. package/dist/cjs/api/resources/summary/errors/UnauthorizedError.js +5 -1
  152. package/dist/cjs/api/resources/summary/exports.d.ts +2 -0
  153. package/dist/cjs/api/resources/summary/exports.js +21 -0
  154. package/dist/cjs/api/resources/summary/types/CreateSummaryResponse.d.ts +4 -4
  155. package/dist/cjs/api/resources/summary/types/CreateSummaryTemplateResponse.d.ts +4 -4
  156. package/dist/cjs/api/resources/summary/types/ErrorResponse.d.ts +2 -2
  157. package/dist/cjs/api/resources/summary/types/FhirBundle.d.ts +1 -1
  158. package/dist/cjs/api/resources/summary/types/SummaryDeleteTemplateResponse.d.ts +2 -2
  159. package/dist/cjs/api/resources/summary/types/SummaryGetTemplateResponse.d.ts +2 -2
  160. package/dist/cjs/api/resources/summary/types/SummaryListTemplatesResponse.d.ts +2 -2
  161. package/dist/cjs/api/resources/summary/types/SummaryTemplate.d.ts +9 -9
  162. package/dist/cjs/api/resources/summary/types/SummaryUpdateTemplateResponse.d.ts +3 -3
  163. package/dist/cjs/api/resources/tools/client/Client.d.ts +17 -18
  164. package/dist/cjs/api/resources/tools/client/Client.js +32 -91
  165. package/dist/cjs/api/resources/tools/client/requests/index.d.ts +1 -1
  166. package/dist/cjs/api/resources/tools/client/requests/index.js +3 -0
  167. package/dist/cjs/api/resources/tools/errors/BadRequestError.js +5 -1
  168. package/dist/cjs/api/resources/tools/errors/FailedDependencyError.js +5 -1
  169. package/dist/cjs/api/resources/tools/errors/ForbiddenError.js +5 -1
  170. package/dist/cjs/api/resources/tools/errors/InternalServerError.js +5 -1
  171. package/dist/cjs/api/resources/tools/errors/UnauthorizedError.js +5 -1
  172. package/dist/cjs/api/resources/tools/exports.d.ts +3 -0
  173. package/dist/cjs/api/resources/tools/exports.js +22 -0
  174. package/dist/cjs/api/resources/tools/resources/mcpServer/client/Client.d.ts +17 -18
  175. package/dist/cjs/api/resources/tools/resources/mcpServer/client/Client.js +24 -79
  176. package/dist/cjs/api/resources/tools/resources/mcpServer/exports.d.ts +3 -0
  177. package/dist/cjs/api/resources/tools/resources/mcpServer/exports.js +22 -0
  178. package/dist/cjs/api/resources/tools/resources/mcpServer/resources/tools/client/Client.d.ts +14 -15
  179. package/dist/cjs/api/resources/tools/resources/mcpServer/resources/tools/client/Client.js +23 -78
  180. package/dist/cjs/api/resources/tools/resources/mcpServer/resources/tools/exports.d.ts +2 -0
  181. package/dist/cjs/api/resources/tools/resources/mcpServer/resources/tools/exports.js +21 -0
  182. package/dist/cjs/api/resources/tools/types/CohortResponse.d.ts +5 -5
  183. package/dist/cjs/api/resources/tools/types/Lang2FhirAndCreateMultiResponse.d.ts +10 -10
  184. package/dist/cjs/api/resources/tools/types/Lang2FhirAndCreateResponse.d.ts +4 -4
  185. package/dist/cjs/api/resources/tools/types/Lang2FhirAndSearchResponse.d.ts +5 -5
  186. package/dist/cjs/api/resources/tools/types/McpServerResponse.d.ts +7 -7
  187. package/dist/cjs/api/resources/tools/types/McpServerToolCallResponse.d.ts +4 -4
  188. package/dist/cjs/api/resources/tools/types/McpServerToolResponse.d.ts +9 -9
  189. package/dist/cjs/api/resources/tools/types/SearchConcept.d.ts +4 -4
  190. package/dist/cjs/api/resources/workflows/client/Client.d.ts +18 -19
  191. package/dist/cjs/api/resources/workflows/client/Client.js +43 -128
  192. package/dist/cjs/api/resources/workflows/errors/BadRequestError.js +5 -1
  193. package/dist/cjs/api/resources/workflows/errors/ForbiddenError.js +5 -1
  194. package/dist/cjs/api/resources/workflows/errors/InternalServerError.js +5 -1
  195. package/dist/cjs/api/resources/workflows/errors/NotFoundError.js +5 -1
  196. package/dist/cjs/api/resources/workflows/errors/UnauthorizedError.js +5 -1
  197. package/dist/cjs/api/resources/workflows/exports.d.ts +2 -0
  198. package/dist/cjs/api/resources/workflows/exports.js +21 -0
  199. package/dist/cjs/api/resources/workflows/types/CreateWorkflowResponse.d.ts +5 -5
  200. package/dist/cjs/api/resources/workflows/types/DecisionNodeDefinition.d.ts +3 -3
  201. package/dist/cjs/api/resources/workflows/types/ExecuteWorkflowResponse.d.ts +4 -4
  202. package/dist/cjs/api/resources/workflows/types/Lang2FhirCreateDefinition.d.ts +4 -4
  203. package/dist/cjs/api/resources/workflows/types/Lang2FhirSearchDefinition.d.ts +5 -5
  204. package/dist/cjs/api/resources/workflows/types/ListWorkflowsResponse.d.ts +4 -4
  205. package/dist/cjs/api/resources/workflows/types/StepOperation.d.ts +4 -4
  206. package/dist/cjs/api/resources/workflows/types/SubWorkflowDefinition.d.ts +3 -3
  207. package/dist/cjs/api/resources/workflows/types/WorkflowConfig.d.ts +2 -2
  208. package/dist/cjs/api/resources/workflows/types/WorkflowDefinition.d.ts +8 -8
  209. package/dist/cjs/api/resources/workflows/types/WorkflowGraph.d.ts +1 -1
  210. package/dist/cjs/api/resources/workflows/types/WorkflowResponse.d.ts +9 -9
  211. package/dist/cjs/api/resources/workflows/types/WorkflowStep.d.ts +8 -8
  212. package/dist/cjs/api/resources/workflows/types/WorkflowStepSummary.d.ts +5 -5
  213. package/dist/cjs/api/resources/workflows/types/WorkflowsDeleteResponse.d.ts +2 -2
  214. package/dist/cjs/api/resources/workflows/types/WorkflowsGetResponse.d.ts +3 -3
  215. package/dist/cjs/api/resources/workflows/types/WorkflowsUpdateResponse.d.ts +4 -4
  216. package/dist/cjs/auth/OAuthAuthProvider.d.ts +45 -0
  217. package/dist/cjs/auth/OAuthAuthProvider.js +190 -0
  218. package/dist/cjs/auth/index.d.ts +1 -0
  219. package/dist/cjs/auth/index.js +5 -0
  220. package/dist/cjs/core/auth/AuthProvider.d.ts +4 -1
  221. package/dist/cjs/core/auth/BearerToken.d.ts +3 -1
  222. package/dist/cjs/core/auth/BearerToken.js +7 -6
  223. package/dist/cjs/core/auth/NoOpAuthProvider.d.ts +5 -0
  224. package/dist/cjs/core/auth/NoOpAuthProvider.js +9 -0
  225. package/dist/cjs/core/auth/index.d.ts +1 -0
  226. package/dist/cjs/core/auth/index.js +3 -1
  227. package/dist/cjs/core/fetcher/BinaryResponse.d.ts +6 -7
  228. package/dist/cjs/core/fetcher/EndpointSupplier.d.ts +2 -2
  229. package/dist/cjs/core/fetcher/Fetcher.d.ts +6 -3
  230. package/dist/cjs/core/fetcher/Fetcher.js +10 -3
  231. package/dist/cjs/core/fetcher/getResponseBody.js +18 -4
  232. package/dist/cjs/core/fetcher/makeRequest.d.ts +6 -1
  233. package/dist/cjs/core/fetcher/makeRequest.js +30 -9
  234. package/dist/cjs/core/fetcher/signals.d.ts +1 -1
  235. package/dist/cjs/core/headers.d.ts +2 -2
  236. package/dist/cjs/core/runtime/runtime.js +17 -15
  237. package/dist/cjs/core/stream/Stream.d.ts +9 -0
  238. package/dist/cjs/core/stream/Stream.js +100 -5
  239. package/dist/cjs/errors/handleNonStatusCodeError.d.ts +2 -0
  240. package/dist/cjs/errors/handleNonStatusCodeError.js +65 -0
  241. package/dist/cjs/errors/phenomlError.js +5 -1
  242. package/dist/cjs/errors/phenomlTimeoutError.js +5 -1
  243. package/dist/cjs/index.d.ts +4 -2
  244. package/dist/cjs/index.js +9 -5
  245. package/dist/cjs/version.d.ts +1 -1
  246. package/dist/cjs/version.js +1 -1
  247. package/dist/esm/BaseClient.d.mts +13 -4
  248. package/dist/esm/BaseClient.mjs +24 -1
  249. package/dist/esm/Client.d.mts +34 -34
  250. package/dist/esm/Client.mjs +23 -31
  251. package/dist/esm/api/resources/agent/client/Client.d.mts +26 -27
  252. package/dist/esm/api/resources/agent/client/Client.mjs +55 -184
  253. package/dist/esm/api/resources/agent/errors/BadRequestError.mjs +5 -1
  254. package/dist/esm/api/resources/agent/errors/ForbiddenError.mjs +5 -1
  255. package/dist/esm/api/resources/agent/errors/InternalServerError.mjs +5 -1
  256. package/dist/esm/api/resources/agent/errors/NotFoundError.mjs +5 -1
  257. package/dist/esm/api/resources/agent/errors/UnauthorizedError.mjs +5 -1
  258. package/dist/esm/api/resources/agent/exports.d.mts +3 -0
  259. package/dist/esm/api/resources/agent/exports.mjs +4 -0
  260. package/dist/esm/api/resources/agent/resources/prompts/client/Client.d.mts +20 -21
  261. package/dist/esm/api/resources/agent/resources/prompts/client/Client.mjs +34 -128
  262. package/dist/esm/api/resources/agent/resources/prompts/exports.d.mts +2 -0
  263. package/dist/esm/api/resources/agent/resources/prompts/exports.mjs +3 -0
  264. package/dist/esm/api/resources/agent/resources/prompts/types/PromptsDeleteResponse.d.mts +2 -2
  265. package/dist/esm/api/resources/agent/resources/prompts/types/PromptsListResponse.d.mts +3 -3
  266. package/dist/esm/api/resources/agent/types/AgentChatResponse.d.mts +4 -4
  267. package/dist/esm/api/resources/agent/types/AgentChatStreamEvent.d.mts +8 -8
  268. package/dist/esm/api/resources/agent/types/AgentCreateRequest.d.mts +4 -4
  269. package/dist/esm/api/resources/agent/types/AgentDeleteResponse.d.mts +2 -2
  270. package/dist/esm/api/resources/agent/types/AgentGetChatMessagesResponse.d.mts +3 -3
  271. package/dist/esm/api/resources/agent/types/AgentListResponse.d.mts +3 -3
  272. package/dist/esm/api/resources/agent/types/AgentPromptsResponse.d.mts +3 -3
  273. package/dist/esm/api/resources/agent/types/AgentResponse.d.mts +3 -3
  274. package/dist/esm/api/resources/agent/types/AgentTemplate.d.mts +8 -8
  275. package/dist/esm/api/resources/agent/types/ChatMessageTemplate.d.mts +10 -10
  276. package/dist/esm/api/resources/agent/types/ChatSessionTemplate.d.mts +9 -9
  277. package/dist/esm/api/resources/agent/types/JsonPatchOperation.d.mts +2 -2
  278. package/dist/esm/api/resources/agent/types/PromptTemplate.d.mts +6 -6
  279. package/dist/esm/api/resources/agent/types/SuccessResponse.d.mts +2 -2
  280. package/dist/esm/api/resources/authtoken/client/Client.d.mts +9 -9
  281. package/dist/esm/api/resources/authtoken/client/Client.mjs +6 -5
  282. package/dist/esm/api/resources/authtoken/errors/BadRequestError.mjs +5 -1
  283. package/dist/esm/api/resources/authtoken/errors/InternalServerError.d.mts +5 -0
  284. package/dist/esm/api/resources/authtoken/errors/InternalServerError.mjs +17 -0
  285. package/dist/esm/api/resources/authtoken/errors/UnauthorizedError.mjs +5 -1
  286. package/dist/esm/api/resources/authtoken/errors/index.d.mts +1 -0
  287. package/dist/esm/api/resources/authtoken/errors/index.mjs +1 -0
  288. package/dist/esm/api/resources/authtoken/exports.d.mts +3 -0
  289. package/dist/esm/api/resources/authtoken/exports.mjs +4 -0
  290. package/dist/esm/api/resources/authtoken/resources/auth/client/Client.d.mts +28 -30
  291. package/dist/esm/api/resources/authtoken/resources/auth/client/Client.mjs +74 -41
  292. package/dist/esm/api/resources/authtoken/resources/auth/client/requests/ClientCredentialsRequest.d.mts +12 -0
  293. package/dist/esm/api/resources/authtoken/resources/auth/client/requests/ClientCredentialsRequest.mjs +2 -0
  294. package/dist/esm/api/resources/authtoken/resources/auth/client/requests/index.d.mts +1 -0
  295. package/dist/esm/api/resources/authtoken/resources/auth/exports.d.mts +2 -0
  296. package/dist/esm/api/resources/authtoken/resources/auth/exports.mjs +3 -0
  297. package/dist/esm/api/resources/authtoken/types/BadRequestErrorBody.d.mts +3 -3
  298. package/dist/esm/api/resources/authtoken/types/OAuthError.d.mts +19 -0
  299. package/dist/esm/api/resources/authtoken/types/OAuthError.mjs +11 -0
  300. package/dist/esm/api/resources/authtoken/types/TokenResponse.d.mts +8 -0
  301. package/dist/esm/api/resources/authtoken/types/TokenResponse.mjs +2 -0
  302. package/dist/esm/api/resources/authtoken/types/UnauthorizedErrorBody.d.mts +3 -3
  303. package/dist/esm/api/resources/authtoken/types/index.d.mts +2 -0
  304. package/dist/esm/api/resources/authtoken/types/index.mjs +2 -0
  305. package/dist/esm/api/resources/cohort/client/Client.d.mts +8 -9
  306. package/dist/esm/api/resources/cohort/client/Client.mjs +10 -26
  307. package/dist/esm/api/resources/cohort/errors/BadRequestError.mjs +5 -1
  308. package/dist/esm/api/resources/cohort/errors/InternalServerError.mjs +5 -1
  309. package/dist/esm/api/resources/cohort/errors/UnauthorizedError.mjs +5 -1
  310. package/dist/esm/api/resources/cohort/exports.d.mts +2 -0
  311. package/dist/esm/api/resources/cohort/exports.mjs +3 -0
  312. package/dist/esm/api/resources/cohort/types/CohortResponse.d.mts +3 -3
  313. package/dist/esm/api/resources/cohort/types/SearchConcept.d.mts +4 -4
  314. package/dist/esm/api/resources/construe/client/Client.d.mts +28 -29
  315. package/dist/esm/api/resources/construe/client/Client.mjs +77 -238
  316. package/dist/esm/api/resources/construe/client/requests/index.d.mts +1 -1
  317. package/dist/esm/api/resources/construe/client/requests/index.mjs +1 -1
  318. package/dist/esm/api/resources/construe/errors/BadRequestError.mjs +5 -1
  319. package/dist/esm/api/resources/construe/errors/ConflictError.mjs +5 -1
  320. package/dist/esm/api/resources/construe/errors/FailedDependencyError.mjs +5 -1
  321. package/dist/esm/api/resources/construe/errors/ForbiddenError.mjs +5 -1
  322. package/dist/esm/api/resources/construe/errors/GatewayTimeoutError.mjs +5 -1
  323. package/dist/esm/api/resources/construe/errors/InternalServerError.mjs +5 -1
  324. package/dist/esm/api/resources/construe/errors/NotFoundError.mjs +5 -1
  325. package/dist/esm/api/resources/construe/errors/NotImplementedError.mjs +5 -1
  326. package/dist/esm/api/resources/construe/errors/ServiceUnavailableError.mjs +5 -1
  327. package/dist/esm/api/resources/construe/errors/UnauthorizedError.mjs +5 -1
  328. package/dist/esm/api/resources/construe/exports.d.mts +2 -0
  329. package/dist/esm/api/resources/construe/exports.mjs +3 -0
  330. package/dist/esm/api/resources/construe/types/CodeResponse.d.mts +1 -1
  331. package/dist/esm/api/resources/construe/types/ConstrueUploadCodeSystemResponse.d.mts +3 -3
  332. package/dist/esm/api/resources/construe/types/ExtractRequestConfig.d.mts +8 -8
  333. package/dist/esm/api/resources/construe/types/ExtractRequestSystem.d.mts +2 -2
  334. package/dist/esm/api/resources/construe/types/ExtractedCodeResult.d.mts +3 -3
  335. package/dist/esm/api/resources/construe/types/GetCodeResponse.d.mts +1 -1
  336. package/dist/esm/api/resources/construe/types/ListCodesResponse.d.mts +1 -1
  337. package/dist/esm/api/resources/fhir/client/Client.d.mts +18 -19
  338. package/dist/esm/api/resources/fhir/client/Client.mjs +44 -132
  339. package/dist/esm/api/resources/fhir/client/requests/FhirSearchRequest.d.mts +0 -6
  340. package/dist/esm/api/resources/fhir/errors/BadGatewayError.mjs +5 -1
  341. package/dist/esm/api/resources/fhir/errors/BadRequestError.mjs +5 -1
  342. package/dist/esm/api/resources/fhir/errors/InternalServerError.mjs +5 -1
  343. package/dist/esm/api/resources/fhir/errors/NotFoundError.mjs +5 -1
  344. package/dist/esm/api/resources/fhir/errors/UnauthorizedError.mjs +5 -1
  345. package/dist/esm/api/resources/fhir/exports.d.mts +2 -0
  346. package/dist/esm/api/resources/fhir/exports.mjs +3 -0
  347. package/dist/esm/api/resources/fhir/types/ErrorResponse.d.mts +2 -2
  348. package/dist/esm/api/resources/fhir/types/FhirBundle.d.mts +8 -8
  349. package/dist/esm/api/resources/fhir/types/FhirPatchRequestBodyItem.d.mts +2 -2
  350. package/dist/esm/api/resources/fhir/types/FhirResource.d.mts +5 -5
  351. package/dist/esm/api/resources/fhirProvider/client/Client.d.mts +20 -21
  352. package/dist/esm/api/resources/fhirProvider/client/Client.mjs +34 -128
  353. package/dist/esm/api/resources/fhirProvider/errors/BadRequestError.mjs +5 -1
  354. package/dist/esm/api/resources/fhirProvider/errors/ForbiddenError.mjs +5 -1
  355. package/dist/esm/api/resources/fhirProvider/errors/InternalServerError.mjs +5 -1
  356. package/dist/esm/api/resources/fhirProvider/errors/NotFoundError.mjs +5 -1
  357. package/dist/esm/api/resources/fhirProvider/errors/UnauthorizedError.mjs +5 -1
  358. package/dist/esm/api/resources/fhirProvider/exports.d.mts +2 -0
  359. package/dist/esm/api/resources/fhirProvider/exports.mjs +3 -0
  360. package/dist/esm/api/resources/fhirProvider/types/ClientSecretAuth.d.mts +2 -2
  361. package/dist/esm/api/resources/fhirProvider/types/FhirProviderAuthConfig.d.mts +12 -12
  362. package/dist/esm/api/resources/fhirProvider/types/FhirProviderDeleteResponse.d.mts +2 -2
  363. package/dist/esm/api/resources/fhirProvider/types/FhirProviderListResponse.d.mts +3 -3
  364. package/dist/esm/api/resources/fhirProvider/types/FhirProviderRemoveAuthConfigResponse.d.mts +3 -3
  365. package/dist/esm/api/resources/fhirProvider/types/FhirProviderResponse.d.mts +3 -3
  366. package/dist/esm/api/resources/fhirProvider/types/FhirProviderSandboxInfo.d.mts +4 -4
  367. package/dist/esm/api/resources/fhirProvider/types/FhirProviderTemplate.d.mts +8 -8
  368. package/dist/esm/api/resources/fhirProvider/types/FhirQueryResponse.d.mts +4 -4
  369. package/dist/esm/api/resources/fhirProvider/types/JsonWebKey.d.mts +6 -6
  370. package/dist/esm/api/resources/fhirProvider/types/JwtAuth.d.mts +3 -3
  371. package/dist/esm/api/resources/fhirProvider/types/OnBehalfOfAuth.d.mts +2 -2
  372. package/dist/esm/api/resources/fhirProvider/types/ServiceAccountMetadata.d.mts +4 -4
  373. package/dist/esm/api/resources/fhirProvider/types/SmartConfiguration.d.mts +5 -5
  374. package/dist/esm/api/resources/lang2Fhir/client/Client.d.mts +18 -19
  375. package/dist/esm/api/resources/lang2Fhir/client/Client.mjs +30 -111
  376. package/dist/esm/api/resources/lang2Fhir/client/requests/index.d.mts +1 -1
  377. package/dist/esm/api/resources/lang2Fhir/client/requests/index.mjs +1 -1
  378. package/dist/esm/api/resources/lang2Fhir/errors/BadRequestError.mjs +5 -1
  379. package/dist/esm/api/resources/lang2Fhir/errors/FailedDependencyError.mjs +5 -1
  380. package/dist/esm/api/resources/lang2Fhir/errors/ForbiddenError.mjs +5 -1
  381. package/dist/esm/api/resources/lang2Fhir/errors/InternalServerError.mjs +5 -1
  382. package/dist/esm/api/resources/lang2Fhir/errors/UnauthorizedError.mjs +5 -1
  383. package/dist/esm/api/resources/lang2Fhir/errors/UnprocessableEntityError.mjs +5 -1
  384. package/dist/esm/api/resources/lang2Fhir/exports.d.mts +2 -0
  385. package/dist/esm/api/resources/lang2Fhir/exports.mjs +3 -0
  386. package/dist/esm/api/resources/lang2Fhir/types/CreateMultiResponse.d.mts +15 -15
  387. package/dist/esm/api/resources/lang2Fhir/types/Lang2FhirUploadProfileResponse.d.mts +4 -4
  388. package/dist/esm/api/resources/lang2Fhir/types/SearchResponse.d.mts +2 -2
  389. package/dist/esm/api/resources/summary/client/Client.d.mts +18 -19
  390. package/dist/esm/api/resources/summary/client/Client.mjs +30 -111
  391. package/dist/esm/api/resources/summary/client/requests/index.d.mts +1 -1
  392. package/dist/esm/api/resources/summary/client/requests/index.mjs +1 -1
  393. package/dist/esm/api/resources/summary/errors/BadRequestError.mjs +5 -1
  394. package/dist/esm/api/resources/summary/errors/ForbiddenError.mjs +5 -1
  395. package/dist/esm/api/resources/summary/errors/InternalServerError.mjs +5 -1
  396. package/dist/esm/api/resources/summary/errors/NotFoundError.mjs +5 -1
  397. package/dist/esm/api/resources/summary/errors/UnauthorizedError.mjs +5 -1
  398. package/dist/esm/api/resources/summary/exports.d.mts +2 -0
  399. package/dist/esm/api/resources/summary/exports.mjs +3 -0
  400. package/dist/esm/api/resources/summary/types/CreateSummaryResponse.d.mts +4 -4
  401. package/dist/esm/api/resources/summary/types/CreateSummaryTemplateResponse.d.mts +4 -4
  402. package/dist/esm/api/resources/summary/types/ErrorResponse.d.mts +2 -2
  403. package/dist/esm/api/resources/summary/types/FhirBundle.d.mts +1 -1
  404. package/dist/esm/api/resources/summary/types/SummaryDeleteTemplateResponse.d.mts +2 -2
  405. package/dist/esm/api/resources/summary/types/SummaryGetTemplateResponse.d.mts +2 -2
  406. package/dist/esm/api/resources/summary/types/SummaryListTemplatesResponse.d.mts +2 -2
  407. package/dist/esm/api/resources/summary/types/SummaryTemplate.d.mts +9 -9
  408. package/dist/esm/api/resources/summary/types/SummaryUpdateTemplateResponse.d.mts +3 -3
  409. package/dist/esm/api/resources/tools/client/Client.d.mts +17 -18
  410. package/dist/esm/api/resources/tools/client/Client.mjs +31 -90
  411. package/dist/esm/api/resources/tools/client/requests/index.d.mts +1 -1
  412. package/dist/esm/api/resources/tools/client/requests/index.mjs +1 -1
  413. package/dist/esm/api/resources/tools/errors/BadRequestError.mjs +5 -1
  414. package/dist/esm/api/resources/tools/errors/FailedDependencyError.mjs +5 -1
  415. package/dist/esm/api/resources/tools/errors/ForbiddenError.mjs +5 -1
  416. package/dist/esm/api/resources/tools/errors/InternalServerError.mjs +5 -1
  417. package/dist/esm/api/resources/tools/errors/UnauthorizedError.mjs +5 -1
  418. package/dist/esm/api/resources/tools/exports.d.mts +3 -0
  419. package/dist/esm/api/resources/tools/exports.mjs +4 -0
  420. package/dist/esm/api/resources/tools/resources/mcpServer/client/Client.d.mts +17 -18
  421. package/dist/esm/api/resources/tools/resources/mcpServer/client/Client.mjs +24 -79
  422. package/dist/esm/api/resources/tools/resources/mcpServer/exports.d.mts +3 -0
  423. package/dist/esm/api/resources/tools/resources/mcpServer/exports.mjs +4 -0
  424. package/dist/esm/api/resources/tools/resources/mcpServer/resources/tools/client/Client.d.mts +14 -15
  425. package/dist/esm/api/resources/tools/resources/mcpServer/resources/tools/client/Client.mjs +22 -77
  426. package/dist/esm/api/resources/tools/resources/mcpServer/resources/tools/exports.d.mts +2 -0
  427. package/dist/esm/api/resources/tools/resources/mcpServer/resources/tools/exports.mjs +3 -0
  428. package/dist/esm/api/resources/tools/types/CohortResponse.d.mts +5 -5
  429. package/dist/esm/api/resources/tools/types/Lang2FhirAndCreateMultiResponse.d.mts +10 -10
  430. package/dist/esm/api/resources/tools/types/Lang2FhirAndCreateResponse.d.mts +4 -4
  431. package/dist/esm/api/resources/tools/types/Lang2FhirAndSearchResponse.d.mts +5 -5
  432. package/dist/esm/api/resources/tools/types/McpServerResponse.d.mts +7 -7
  433. package/dist/esm/api/resources/tools/types/McpServerToolCallResponse.d.mts +4 -4
  434. package/dist/esm/api/resources/tools/types/McpServerToolResponse.d.mts +9 -9
  435. package/dist/esm/api/resources/tools/types/SearchConcept.d.mts +4 -4
  436. package/dist/esm/api/resources/workflows/client/Client.d.mts +18 -19
  437. package/dist/esm/api/resources/workflows/client/Client.mjs +42 -127
  438. package/dist/esm/api/resources/workflows/errors/BadRequestError.mjs +5 -1
  439. package/dist/esm/api/resources/workflows/errors/ForbiddenError.mjs +5 -1
  440. package/dist/esm/api/resources/workflows/errors/InternalServerError.mjs +5 -1
  441. package/dist/esm/api/resources/workflows/errors/NotFoundError.mjs +5 -1
  442. package/dist/esm/api/resources/workflows/errors/UnauthorizedError.mjs +5 -1
  443. package/dist/esm/api/resources/workflows/exports.d.mts +2 -0
  444. package/dist/esm/api/resources/workflows/exports.mjs +3 -0
  445. package/dist/esm/api/resources/workflows/types/CreateWorkflowResponse.d.mts +5 -5
  446. package/dist/esm/api/resources/workflows/types/DecisionNodeDefinition.d.mts +3 -3
  447. package/dist/esm/api/resources/workflows/types/ExecuteWorkflowResponse.d.mts +4 -4
  448. package/dist/esm/api/resources/workflows/types/Lang2FhirCreateDefinition.d.mts +4 -4
  449. package/dist/esm/api/resources/workflows/types/Lang2FhirSearchDefinition.d.mts +5 -5
  450. package/dist/esm/api/resources/workflows/types/ListWorkflowsResponse.d.mts +4 -4
  451. package/dist/esm/api/resources/workflows/types/StepOperation.d.mts +4 -4
  452. package/dist/esm/api/resources/workflows/types/SubWorkflowDefinition.d.mts +3 -3
  453. package/dist/esm/api/resources/workflows/types/WorkflowConfig.d.mts +2 -2
  454. package/dist/esm/api/resources/workflows/types/WorkflowDefinition.d.mts +8 -8
  455. package/dist/esm/api/resources/workflows/types/WorkflowGraph.d.mts +1 -1
  456. package/dist/esm/api/resources/workflows/types/WorkflowResponse.d.mts +9 -9
  457. package/dist/esm/api/resources/workflows/types/WorkflowStep.d.mts +8 -8
  458. package/dist/esm/api/resources/workflows/types/WorkflowStepSummary.d.mts +5 -5
  459. package/dist/esm/api/resources/workflows/types/WorkflowsDeleteResponse.d.mts +2 -2
  460. package/dist/esm/api/resources/workflows/types/WorkflowsGetResponse.d.mts +3 -3
  461. package/dist/esm/api/resources/workflows/types/WorkflowsUpdateResponse.d.mts +4 -4
  462. package/dist/esm/auth/OAuthAuthProvider.d.mts +45 -0
  463. package/dist/esm/auth/OAuthAuthProvider.mjs +152 -0
  464. package/dist/esm/auth/index.d.mts +1 -0
  465. package/dist/esm/auth/index.mjs +1 -0
  466. package/dist/esm/core/auth/AuthProvider.d.mts +4 -1
  467. package/dist/esm/core/auth/BearerToken.d.mts +3 -1
  468. package/dist/esm/core/auth/BearerToken.mjs +7 -6
  469. package/dist/esm/core/auth/NoOpAuthProvider.d.mts +5 -0
  470. package/dist/esm/core/auth/NoOpAuthProvider.mjs +5 -0
  471. package/dist/esm/core/auth/index.d.mts +1 -0
  472. package/dist/esm/core/auth/index.mjs +1 -0
  473. package/dist/esm/core/fetcher/BinaryResponse.d.mts +6 -7
  474. package/dist/esm/core/fetcher/EndpointSupplier.d.mts +2 -2
  475. package/dist/esm/core/fetcher/Fetcher.d.mts +6 -3
  476. package/dist/esm/core/fetcher/Fetcher.mjs +10 -3
  477. package/dist/esm/core/fetcher/getResponseBody.mjs +18 -4
  478. package/dist/esm/core/fetcher/makeRequest.d.mts +6 -1
  479. package/dist/esm/core/fetcher/makeRequest.mjs +28 -9
  480. package/dist/esm/core/fetcher/signals.d.mts +1 -1
  481. package/dist/esm/core/headers.d.mts +2 -2
  482. package/dist/esm/core/runtime/runtime.mjs +17 -15
  483. package/dist/esm/core/stream/Stream.d.mts +9 -0
  484. package/dist/esm/core/stream/Stream.mjs +100 -5
  485. package/dist/esm/errors/handleNonStatusCodeError.d.mts +2 -0
  486. package/dist/esm/errors/handleNonStatusCodeError.mjs +29 -0
  487. package/dist/esm/errors/phenomlError.mjs +5 -1
  488. package/dist/esm/errors/phenomlTimeoutError.mjs +5 -1
  489. package/dist/esm/index.d.mts +4 -2
  490. package/dist/esm/index.mjs +3 -2
  491. package/dist/esm/version.d.mts +1 -1
  492. package/dist/esm/version.mjs +1 -1
  493. package/package.json +162 -5
  494. package/reference.md +141 -74
  495. package/dist/cjs/WrapperClient.d.ts +0 -21
  496. package/dist/cjs/WrapperClient.js +0 -111
  497. package/dist/cjs/core/fetcher/ResponseWithBody.d.ts +0 -4
  498. package/dist/cjs/core/fetcher/ResponseWithBody.js +0 -6
  499. package/dist/esm/WrapperClient.d.mts +0 -21
  500. package/dist/esm/WrapperClient.mjs +0 -75
  501. package/dist/esm/core/fetcher/ResponseWithBody.d.mts +0 -4
  502. package/dist/esm/core/fetcher/ResponseWithBody.mjs +0 -3
@@ -1,22 +1,22 @@
1
1
  import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js";
2
+ import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js";
2
3
  import * as core from "../../../../core/index.js";
3
4
  import * as phenoml from "../../../index.js";
4
- export declare namespace FhirProvider {
5
- interface Options extends BaseClientOptions {
6
- }
5
+ export declare namespace FhirProviderClient {
6
+ type Options = BaseClientOptions;
7
7
  interface RequestOptions extends BaseRequestOptions {
8
8
  }
9
9
  }
10
- export declare class FhirProvider {
11
- protected readonly _options: FhirProvider.Options;
12
- constructor(_options: FhirProvider.Options);
10
+ export declare class FhirProviderClient {
11
+ protected readonly _options: NormalizedClientOptionsWithAuth<FhirProviderClient.Options>;
12
+ constructor(options?: FhirProviderClient.Options);
13
13
  /**
14
14
  * Creates a new FHIR provider configuration with authentication credentials.
15
15
  *
16
16
  * Note: The "sandbox" provider type cannot be created via this API - it is managed internally.
17
17
  *
18
18
  * @param {phenoml.fhirProvider.FhirProviderCreateRequest} request
19
- * @param {FhirProvider.RequestOptions} requestOptions - Request-specific configuration.
19
+ * @param {FhirProviderClient.RequestOptions} requestOptions - Request-specific configuration.
20
20
  *
21
21
  * @throws {@link phenoml.fhirProvider.BadRequestError}
22
22
  * @throws {@link phenoml.fhirProvider.UnauthorizedError}
@@ -34,7 +34,7 @@ export declare class FhirProvider {
34
34
  * }
35
35
  * })
36
36
  */
37
- create(request: phenoml.fhirProvider.FhirProviderCreateRequest, requestOptions?: FhirProvider.RequestOptions): core.HttpResponsePromise<phenoml.fhirProvider.FhirProviderResponse>;
37
+ create(request: phenoml.fhirProvider.FhirProviderCreateRequest, requestOptions?: FhirProviderClient.RequestOptions): core.HttpResponsePromise<phenoml.fhirProvider.FhirProviderResponse>;
38
38
  private __create;
39
39
  /**
40
40
  * Retrieves a list of all active FHIR providers for the authenticated user.
@@ -42,7 +42,7 @@ export declare class FhirProvider {
42
42
  * On shared instances, only sandbox providers are returned.
43
43
  * Sandbox providers return FhirProviderSandboxInfo.
44
44
  *
45
- * @param {FhirProvider.RequestOptions} requestOptions - Request-specific configuration.
45
+ * @param {FhirProviderClient.RequestOptions} requestOptions - Request-specific configuration.
46
46
  *
47
47
  * @throws {@link phenoml.fhirProvider.UnauthorizedError}
48
48
  * @throws {@link phenoml.fhirProvider.InternalServerError}
@@ -50,7 +50,7 @@ export declare class FhirProvider {
50
50
  * @example
51
51
  * await client.fhirProvider.list()
52
52
  */
53
- list(requestOptions?: FhirProvider.RequestOptions): core.HttpResponsePromise<phenoml.fhirProvider.FhirProviderListResponse>;
53
+ list(requestOptions?: FhirProviderClient.RequestOptions): core.HttpResponsePromise<phenoml.fhirProvider.FhirProviderListResponse>;
54
54
  private __list;
55
55
  /**
56
56
  * Retrieves a specific FHIR provider configuration by its ID.
@@ -59,7 +59,7 @@ export declare class FhirProvider {
59
59
  * On shared instances, only sandbox providers can be accessed.
60
60
  *
61
61
  * @param {string} fhir_provider_id - ID of the FHIR provider to retrieve
62
- * @param {FhirProvider.RequestOptions} requestOptions - Request-specific configuration.
62
+ * @param {FhirProviderClient.RequestOptions} requestOptions - Request-specific configuration.
63
63
  *
64
64
  * @throws {@link phenoml.fhirProvider.UnauthorizedError}
65
65
  * @throws {@link phenoml.fhirProvider.NotFoundError}
@@ -68,7 +68,7 @@ export declare class FhirProvider {
68
68
  * @example
69
69
  * await client.fhirProvider.get("fhir_provider_id")
70
70
  */
71
- get(fhir_provider_id: string, requestOptions?: FhirProvider.RequestOptions): core.HttpResponsePromise<phenoml.fhirProvider.FhirProviderResponse>;
71
+ get(fhir_provider_id: string, requestOptions?: FhirProviderClient.RequestOptions): core.HttpResponsePromise<phenoml.fhirProvider.FhirProviderResponse>;
72
72
  private __get;
73
73
  /**
74
74
  * Deletes a FHIR provider.
@@ -76,7 +76,7 @@ export declare class FhirProvider {
76
76
  * Note: Sandbox providers cannot be deleted.
77
77
  *
78
78
  * @param {string} fhir_provider_id - ID of the FHIR provider to delete
79
- * @param {FhirProvider.RequestOptions} requestOptions - Request-specific configuration.
79
+ * @param {FhirProviderClient.RequestOptions} requestOptions - Request-specific configuration.
80
80
  *
81
81
  * @throws {@link phenoml.fhirProvider.UnauthorizedError}
82
82
  * @throws {@link phenoml.fhirProvider.ForbiddenError}
@@ -86,7 +86,7 @@ export declare class FhirProvider {
86
86
  * @example
87
87
  * await client.fhirProvider.delete("fhir_provider_id")
88
88
  */
89
- delete(fhir_provider_id: string, requestOptions?: FhirProvider.RequestOptions): core.HttpResponsePromise<phenoml.fhirProvider.FhirProviderDeleteResponse>;
89
+ delete(fhir_provider_id: string, requestOptions?: FhirProviderClient.RequestOptions): core.HttpResponsePromise<phenoml.fhirProvider.FhirProviderDeleteResponse>;
90
90
  private __delete;
91
91
  /**
92
92
  * Adds a new authentication configuration to an existing FHIR provider.
@@ -96,7 +96,7 @@ export declare class FhirProvider {
96
96
  *
97
97
  * @param {string} fhir_provider_id - ID of the FHIR provider to add auth config to
98
98
  * @param {phenoml.fhirProvider.FhirProviderAddAuthConfigRequest} request
99
- * @param {FhirProvider.RequestOptions} requestOptions - Request-specific configuration.
99
+ * @param {FhirProviderClient.RequestOptions} requestOptions - Request-specific configuration.
100
100
  *
101
101
  * @throws {@link phenoml.fhirProvider.BadRequestError}
102
102
  * @throws {@link phenoml.fhirProvider.UnauthorizedError}
@@ -110,7 +110,7 @@ export declare class FhirProvider {
110
110
  * client_id: "your-client-id"
111
111
  * })
112
112
  */
113
- addAuthConfig(fhir_provider_id: string, request: phenoml.fhirProvider.FhirProviderAddAuthConfigRequest, requestOptions?: FhirProvider.RequestOptions): core.HttpResponsePromise<phenoml.fhirProvider.FhirProviderResponse>;
113
+ addAuthConfig(fhir_provider_id: string, request: phenoml.fhirProvider.FhirProviderAddAuthConfigRequest, requestOptions?: FhirProviderClient.RequestOptions): core.HttpResponsePromise<phenoml.fhirProvider.FhirProviderResponse>;
114
114
  private __addAuthConfig;
115
115
  /**
116
116
  * Sets which authentication configuration should be active for a FHIR provider.
@@ -123,7 +123,7 @@ export declare class FhirProvider {
123
123
  *
124
124
  * @param {string} fhir_provider_id - ID of the FHIR provider
125
125
  * @param {phenoml.fhirProvider.FhirProviderSetActiveAuthConfigRequest} request
126
- * @param {FhirProvider.RequestOptions} requestOptions - Request-specific configuration.
126
+ * @param {FhirProviderClient.RequestOptions} requestOptions - Request-specific configuration.
127
127
  *
128
128
  * @throws {@link phenoml.fhirProvider.BadRequestError}
129
129
  * @throws {@link phenoml.fhirProvider.UnauthorizedError}
@@ -136,7 +136,7 @@ export declare class FhirProvider {
136
136
  * auth_config_id: "auth-config-123"
137
137
  * })
138
138
  */
139
- setActiveAuthConfig(fhir_provider_id: string, request: phenoml.fhirProvider.FhirProviderSetActiveAuthConfigRequest, requestOptions?: FhirProvider.RequestOptions): core.HttpResponsePromise<phenoml.fhirProvider.FhirProviderResponse>;
139
+ setActiveAuthConfig(fhir_provider_id: string, request: phenoml.fhirProvider.FhirProviderSetActiveAuthConfigRequest, requestOptions?: FhirProviderClient.RequestOptions): core.HttpResponsePromise<phenoml.fhirProvider.FhirProviderResponse>;
140
140
  private __setActiveAuthConfig;
141
141
  /**
142
142
  * Removes an authentication configuration from a FHIR provider.
@@ -146,7 +146,7 @@ export declare class FhirProvider {
146
146
  *
147
147
  * @param {string} fhir_provider_id - ID of the FHIR provider
148
148
  * @param {phenoml.fhirProvider.FhirProviderRemoveAuthConfigRequest} request
149
- * @param {FhirProvider.RequestOptions} requestOptions - Request-specific configuration.
149
+ * @param {FhirProviderClient.RequestOptions} requestOptions - Request-specific configuration.
150
150
  *
151
151
  * @throws {@link phenoml.fhirProvider.BadRequestError}
152
152
  * @throws {@link phenoml.fhirProvider.UnauthorizedError}
@@ -159,7 +159,6 @@ export declare class FhirProvider {
159
159
  * auth_config_id: "auth-config-123"
160
160
  * })
161
161
  */
162
- removeAuthConfig(fhir_provider_id: string, request: phenoml.fhirProvider.FhirProviderRemoveAuthConfigRequest, requestOptions?: FhirProvider.RequestOptions): core.HttpResponsePromise<phenoml.fhirProvider.FhirProviderRemoveAuthConfigResponse>;
162
+ removeAuthConfig(fhir_provider_id: string, request: phenoml.fhirProvider.FhirProviderRemoveAuthConfigRequest, requestOptions?: FhirProviderClient.RequestOptions): core.HttpResponsePromise<phenoml.fhirProvider.FhirProviderRemoveAuthConfigResponse>;
163
163
  private __removeAuthConfig;
164
- protected _getAuthorizationHeader(): Promise<string>;
165
164
  }
@@ -43,15 +43,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
43
43
  });
44
44
  };
45
45
  Object.defineProperty(exports, "__esModule", { value: true });
46
- exports.FhirProvider = void 0;
46
+ exports.FhirProviderClient = void 0;
47
+ const BaseClient_js_1 = require("../../../../BaseClient.js");
47
48
  const headers_js_1 = require("../../../../core/headers.js");
48
49
  const core = __importStar(require("../../../../core/index.js"));
49
50
  const environments = __importStar(require("../../../../environments.js"));
51
+ const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatusCodeError.js");
50
52
  const errors = __importStar(require("../../../../errors/index.js"));
51
53
  const phenoml = __importStar(require("../../../index.js"));
52
- class FhirProvider {
53
- constructor(_options) {
54
- this._options = _options;
54
+ class FhirProviderClient {
55
+ constructor(options = {}) {
56
+ this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
55
57
  }
56
58
  /**
57
59
  * Creates a new FHIR provider configuration with authentication credentials.
@@ -59,7 +61,7 @@ class FhirProvider {
59
61
  * Note: The "sandbox" provider type cannot be created via this API - it is managed internally.
60
62
  *
61
63
  * @param {phenoml.fhirProvider.FhirProviderCreateRequest} request
62
- * @param {FhirProvider.RequestOptions} requestOptions - Request-specific configuration.
64
+ * @param {FhirProviderClient.RequestOptions} requestOptions - Request-specific configuration.
63
65
  *
64
66
  * @throws {@link phenoml.fhirProvider.BadRequestError}
65
67
  * @throws {@link phenoml.fhirProvider.UnauthorizedError}
@@ -83,7 +85,8 @@ class FhirProvider {
83
85
  __create(request, requestOptions) {
84
86
  return __awaiter(this, void 0, void 0, function* () {
85
87
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
86
- 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);
88
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
89
+ 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);
87
90
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
88
91
  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"),
89
92
  method: "POST",
@@ -122,21 +125,7 @@ class FhirProvider {
122
125
  });
123
126
  }
124
127
  }
125
- switch (_response.error.reason) {
126
- case "non-json":
127
- throw new errors.phenomlError({
128
- statusCode: _response.error.statusCode,
129
- body: _response.error.rawBody,
130
- rawResponse: _response.rawResponse,
131
- });
132
- case "timeout":
133
- throw new errors.phenomlTimeoutError("Timeout exceeded when calling POST /fhir-provider.");
134
- case "unknown":
135
- throw new errors.phenomlError({
136
- message: _response.error.errorMessage,
137
- rawResponse: _response.rawResponse,
138
- });
139
- }
128
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/fhir-provider");
140
129
  });
141
130
  }
142
131
  /**
@@ -145,7 +134,7 @@ class FhirProvider {
145
134
  * On shared instances, only sandbox providers are returned.
146
135
  * Sandbox providers return FhirProviderSandboxInfo.
147
136
  *
148
- * @param {FhirProvider.RequestOptions} requestOptions - Request-specific configuration.
137
+ * @param {FhirProviderClient.RequestOptions} requestOptions - Request-specific configuration.
149
138
  *
150
139
  * @throws {@link phenoml.fhirProvider.UnauthorizedError}
151
140
  * @throws {@link phenoml.fhirProvider.InternalServerError}
@@ -159,7 +148,8 @@ class FhirProvider {
159
148
  __list(requestOptions) {
160
149
  return __awaiter(this, void 0, void 0, function* () {
161
150
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
162
- 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);
151
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
152
+ 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);
163
153
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
164
154
  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"),
165
155
  method: "GET",
@@ -191,21 +181,7 @@ class FhirProvider {
191
181
  });
192
182
  }
193
183
  }
194
- switch (_response.error.reason) {
195
- case "non-json":
196
- throw new errors.phenomlError({
197
- statusCode: _response.error.statusCode,
198
- body: _response.error.rawBody,
199
- rawResponse: _response.rawResponse,
200
- });
201
- case "timeout":
202
- throw new errors.phenomlTimeoutError("Timeout exceeded when calling GET /fhir-provider/list.");
203
- case "unknown":
204
- throw new errors.phenomlError({
205
- message: _response.error.errorMessage,
206
- rawResponse: _response.rawResponse,
207
- });
208
- }
184
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/fhir-provider/list");
209
185
  });
210
186
  }
211
187
  /**
@@ -215,7 +191,7 @@ class FhirProvider {
215
191
  * On shared instances, only sandbox providers can be accessed.
216
192
  *
217
193
  * @param {string} fhir_provider_id - ID of the FHIR provider to retrieve
218
- * @param {FhirProvider.RequestOptions} requestOptions - Request-specific configuration.
194
+ * @param {FhirProviderClient.RequestOptions} requestOptions - Request-specific configuration.
219
195
  *
220
196
  * @throws {@link phenoml.fhirProvider.UnauthorizedError}
221
197
  * @throws {@link phenoml.fhirProvider.NotFoundError}
@@ -230,7 +206,8 @@ class FhirProvider {
230
206
  __get(fhir_provider_id, requestOptions) {
231
207
  return __awaiter(this, void 0, void 0, function* () {
232
208
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
233
- 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);
209
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
210
+ 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);
234
211
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
235
212
  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/${core.url.encodePathParam(fhir_provider_id)}`),
236
213
  method: "GET",
@@ -264,21 +241,7 @@ class FhirProvider {
264
241
  });
265
242
  }
266
243
  }
267
- switch (_response.error.reason) {
268
- case "non-json":
269
- throw new errors.phenomlError({
270
- statusCode: _response.error.statusCode,
271
- body: _response.error.rawBody,
272
- rawResponse: _response.rawResponse,
273
- });
274
- case "timeout":
275
- throw new errors.phenomlTimeoutError("Timeout exceeded when calling GET /fhir-provider/{fhir_provider_id}.");
276
- case "unknown":
277
- throw new errors.phenomlError({
278
- message: _response.error.errorMessage,
279
- rawResponse: _response.rawResponse,
280
- });
281
- }
244
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/fhir-provider/{fhir_provider_id}");
282
245
  });
283
246
  }
284
247
  /**
@@ -287,7 +250,7 @@ class FhirProvider {
287
250
  * Note: Sandbox providers cannot be deleted.
288
251
  *
289
252
  * @param {string} fhir_provider_id - ID of the FHIR provider to delete
290
- * @param {FhirProvider.RequestOptions} requestOptions - Request-specific configuration.
253
+ * @param {FhirProviderClient.RequestOptions} requestOptions - Request-specific configuration.
291
254
  *
292
255
  * @throws {@link phenoml.fhirProvider.UnauthorizedError}
293
256
  * @throws {@link phenoml.fhirProvider.ForbiddenError}
@@ -303,7 +266,8 @@ class FhirProvider {
303
266
  __delete(fhir_provider_id, requestOptions) {
304
267
  return __awaiter(this, void 0, void 0, function* () {
305
268
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
306
- 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);
269
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
270
+ 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);
307
271
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
308
272
  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/${core.url.encodePathParam(fhir_provider_id)}`),
309
273
  method: "DELETE",
@@ -339,21 +303,7 @@ class FhirProvider {
339
303
  });
340
304
  }
341
305
  }
342
- switch (_response.error.reason) {
343
- case "non-json":
344
- throw new errors.phenomlError({
345
- statusCode: _response.error.statusCode,
346
- body: _response.error.rawBody,
347
- rawResponse: _response.rawResponse,
348
- });
349
- case "timeout":
350
- throw new errors.phenomlTimeoutError("Timeout exceeded when calling DELETE /fhir-provider/{fhir_provider_id}.");
351
- case "unknown":
352
- throw new errors.phenomlError({
353
- message: _response.error.errorMessage,
354
- rawResponse: _response.rawResponse,
355
- });
356
- }
306
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/fhir-provider/{fhir_provider_id}");
357
307
  });
358
308
  }
359
309
  /**
@@ -364,7 +314,7 @@ class FhirProvider {
364
314
  *
365
315
  * @param {string} fhir_provider_id - ID of the FHIR provider to add auth config to
366
316
  * @param {phenoml.fhirProvider.FhirProviderAddAuthConfigRequest} request
367
- * @param {FhirProvider.RequestOptions} requestOptions - Request-specific configuration.
317
+ * @param {FhirProviderClient.RequestOptions} requestOptions - Request-specific configuration.
368
318
  *
369
319
  * @throws {@link phenoml.fhirProvider.BadRequestError}
370
320
  * @throws {@link phenoml.fhirProvider.UnauthorizedError}
@@ -384,7 +334,8 @@ class FhirProvider {
384
334
  __addAuthConfig(fhir_provider_id, request, requestOptions) {
385
335
  return __awaiter(this, void 0, void 0, function* () {
386
336
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
387
- 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);
337
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
338
+ 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);
388
339
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
389
340
  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/${core.url.encodePathParam(fhir_provider_id)}/add-auth-config`),
390
341
  method: "PATCH",
@@ -425,21 +376,7 @@ class FhirProvider {
425
376
  });
426
377
  }
427
378
  }
428
- switch (_response.error.reason) {
429
- case "non-json":
430
- throw new errors.phenomlError({
431
- statusCode: _response.error.statusCode,
432
- body: _response.error.rawBody,
433
- rawResponse: _response.rawResponse,
434
- });
435
- case "timeout":
436
- throw new errors.phenomlTimeoutError("Timeout exceeded when calling PATCH /fhir-provider/{fhir_provider_id}/add-auth-config.");
437
- case "unknown":
438
- throw new errors.phenomlError({
439
- message: _response.error.errorMessage,
440
- rawResponse: _response.rawResponse,
441
- });
442
- }
379
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PATCH", "/fhir-provider/{fhir_provider_id}/add-auth-config");
443
380
  });
444
381
  }
445
382
  /**
@@ -453,7 +390,7 @@ class FhirProvider {
453
390
  *
454
391
  * @param {string} fhir_provider_id - ID of the FHIR provider
455
392
  * @param {phenoml.fhirProvider.FhirProviderSetActiveAuthConfigRequest} request
456
- * @param {FhirProvider.RequestOptions} requestOptions - Request-specific configuration.
393
+ * @param {FhirProviderClient.RequestOptions} requestOptions - Request-specific configuration.
457
394
  *
458
395
  * @throws {@link phenoml.fhirProvider.BadRequestError}
459
396
  * @throws {@link phenoml.fhirProvider.UnauthorizedError}
@@ -472,7 +409,8 @@ class FhirProvider {
472
409
  __setActiveAuthConfig(fhir_provider_id, request, requestOptions) {
473
410
  return __awaiter(this, void 0, void 0, function* () {
474
411
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
475
- 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);
412
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
413
+ 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);
476
414
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
477
415
  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/${core.url.encodePathParam(fhir_provider_id)}/set-active-auth-config`),
478
416
  method: "PATCH",
@@ -513,21 +451,7 @@ class FhirProvider {
513
451
  });
514
452
  }
515
453
  }
516
- switch (_response.error.reason) {
517
- case "non-json":
518
- throw new errors.phenomlError({
519
- statusCode: _response.error.statusCode,
520
- body: _response.error.rawBody,
521
- rawResponse: _response.rawResponse,
522
- });
523
- case "timeout":
524
- throw new errors.phenomlTimeoutError("Timeout exceeded when calling PATCH /fhir-provider/{fhir_provider_id}/set-active-auth-config.");
525
- case "unknown":
526
- throw new errors.phenomlError({
527
- message: _response.error.errorMessage,
528
- rawResponse: _response.rawResponse,
529
- });
530
- }
454
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PATCH", "/fhir-provider/{fhir_provider_id}/set-active-auth-config");
531
455
  });
532
456
  }
533
457
  /**
@@ -538,7 +462,7 @@ class FhirProvider {
538
462
  *
539
463
  * @param {string} fhir_provider_id - ID of the FHIR provider
540
464
  * @param {phenoml.fhirProvider.FhirProviderRemoveAuthConfigRequest} request
541
- * @param {FhirProvider.RequestOptions} requestOptions - Request-specific configuration.
465
+ * @param {FhirProviderClient.RequestOptions} requestOptions - Request-specific configuration.
542
466
  *
543
467
  * @throws {@link phenoml.fhirProvider.BadRequestError}
544
468
  * @throws {@link phenoml.fhirProvider.UnauthorizedError}
@@ -557,7 +481,8 @@ class FhirProvider {
557
481
  __removeAuthConfig(fhir_provider_id, request, requestOptions) {
558
482
  return __awaiter(this, void 0, void 0, function* () {
559
483
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
560
- 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);
484
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
485
+ 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);
561
486
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
562
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, `fhir-provider/${core.url.encodePathParam(fhir_provider_id)}/remove-auth-config`),
563
488
  method: "PATCH",
@@ -598,27 +523,8 @@ class FhirProvider {
598
523
  });
599
524
  }
600
525
  }
601
- switch (_response.error.reason) {
602
- case "non-json":
603
- throw new errors.phenomlError({
604
- statusCode: _response.error.statusCode,
605
- body: _response.error.rawBody,
606
- rawResponse: _response.rawResponse,
607
- });
608
- case "timeout":
609
- throw new errors.phenomlTimeoutError("Timeout exceeded when calling PATCH /fhir-provider/{fhir_provider_id}/remove-auth-config.");
610
- case "unknown":
611
- throw new errors.phenomlError({
612
- message: _response.error.errorMessage,
613
- rawResponse: _response.rawResponse,
614
- });
615
- }
616
- });
617
- }
618
- _getAuthorizationHeader() {
619
- return __awaiter(this, void 0, void 0, function* () {
620
- return `Bearer ${yield core.Supplier.get(this._options.token)}`;
526
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PATCH", "/fhir-provider/{fhir_provider_id}/remove-auth-config");
621
527
  });
622
528
  }
623
529
  }
624
- exports.FhirProvider = FhirProvider;
530
+ exports.FhirProviderClient = FhirProviderClient;
@@ -44,7 +44,11 @@ class BadRequestError extends errors.phenomlError {
44
44
  body: body,
45
45
  rawResponse: rawResponse,
46
46
  });
47
- Object.setPrototypeOf(this, BadRequestError.prototype);
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, ForbiddenError.prototype);
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, InternalServerError.prototype);
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, NotFoundError.prototype);
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, UnauthorizedError.prototype);
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,2 @@
1
+ export { FhirProviderClient } from "./client/Client.js";
2
+ export * from "./client/index.js";
@@ -0,0 +1,21 @@
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.FhirProviderClient = void 0;
19
+ var Client_js_1 = require("./client/Client.js");
20
+ Object.defineProperty(exports, "FhirProviderClient", { enumerable: true, get: function () { return Client_js_1.FhirProviderClient; } });
21
+ __exportStar(require("./client/index.js"), exports);
@@ -4,7 +4,7 @@ export interface ClientSecretAuth {
4
4
  client_id: string;
5
5
  /** OAuth client secret */
6
6
  client_secret: string;
7
- role?: phenoml.fhirProvider.Role;
7
+ role?: phenoml.fhirProvider.Role | undefined;
8
8
  /** OAuth scopes to request. Cannot be specified with role. If neither role nor scopes are specified, the provider-specific default role will be used. */
9
- scopes?: string;
9
+ scopes?: string | undefined;
10
10
  }
@@ -4,23 +4,23 @@ import type * as phenoml from "../../../index.js";
4
4
  */
5
5
  export interface FhirProviderAuthConfig {
6
6
  /** Unique identifier for this auth configuration */
7
- auth_config_id?: string;
8
- auth_method?: phenoml.fhirProvider.AuthMethod;
7
+ auth_config_id?: string | undefined;
8
+ auth_method?: phenoml.fhirProvider.AuthMethod | undefined;
9
9
  /** Whether this auth configuration is currently active */
10
- is_active_auth_config?: boolean;
10
+ is_active_auth_config?: boolean | undefined;
11
11
  /** Timestamp when this auth configuration was created */
12
- created_at?: string;
12
+ created_at?: string | undefined;
13
13
  /** Timestamp when this auth configuration was last updated */
14
- updated_at?: string;
14
+ updated_at?: string | undefined;
15
15
  /** Public key certificate in PEM format (visible for JWT auth) */
16
- public_key_cert_pem?: string;
17
- json_web_key?: phenoml.fhirProvider.JsonWebKey;
16
+ public_key_cert_pem?: string | undefined;
17
+ json_web_key?: phenoml.fhirProvider.JsonWebKey | undefined;
18
18
  /** Expiry time for credentials (JWT auth only) */
19
- credential_expiry?: string;
20
- smart_configuration?: phenoml.fhirProvider.SmartConfiguration;
21
- service_account_metadata?: phenoml.fhirProvider.ServiceAccountMetadata;
19
+ credential_expiry?: string | undefined;
20
+ smart_configuration?: phenoml.fhirProvider.SmartConfiguration | undefined;
21
+ service_account_metadata?: phenoml.fhirProvider.ServiceAccountMetadata | undefined;
22
22
  /** OAuth scopes */
23
- scopes?: string;
23
+ scopes?: string | undefined;
24
24
  /** OAuth client ID for this auth configuration. When set, takes precedence over the provider-level client_id. */
25
- client_id?: string;
25
+ client_id?: string | undefined;
26
26
  }
@@ -1,4 +1,4 @@
1
1
  export interface FhirProviderDeleteResponse {
2
- success?: boolean;
3
- message?: string;
2
+ success?: boolean | undefined;
3
+ message?: string | undefined;
4
4
  }
@@ -5,13 +5,13 @@ import type * as phenoml from "../../../index.js";
5
5
  * On dedicated instances, full provider details are returned (as FhirProviderTemplate).
6
6
  */
7
7
  export interface FhirProviderListResponse {
8
- success?: boolean;
9
- message?: string;
8
+ success?: boolean | undefined;
9
+ message?: string | undefined;
10
10
  /**
11
11
  * List of FHIR providers. Sandbox providers return FhirProviderSandboxInfo,
12
12
  * other providers return FhirProviderTemplate.
13
13
  */
14
- fhir_providers?: FhirProviderListResponse.FhirProviders.Item[];
14
+ fhir_providers?: FhirProviderListResponse.FhirProviders.Item[] | undefined;
15
15
  }
16
16
  export declare namespace FhirProviderListResponse {
17
17
  type FhirProviders = FhirProviders.Item[];