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