@tryvital/vital-node 3.0.6 → 3.0.8

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 (329) hide show
  1. package/Client.d.ts +1 -0
  2. package/api/errors/BadRequestError.js +1 -0
  3. package/api/errors/UnprocessableEntityError.js +1 -0
  4. package/api/resources/activity/client/Client.d.ts +11 -0
  5. package/api/resources/activity/client/Client.js +22 -11
  6. package/api/resources/activity/client/requests/ActivityGetRawRequest.d.ts +6 -0
  7. package/api/resources/activity/client/requests/ActivityGetRequest.d.ts +6 -0
  8. package/api/resources/body/client/Client.d.ts +11 -0
  9. package/api/resources/body/client/Client.js +22 -11
  10. package/api/resources/body/client/requests/BodyGetRawRequest.d.ts +6 -0
  11. package/api/resources/body/client/requests/BodyGetRequest.d.ts +6 -0
  12. package/api/resources/devices/client/Client.d.ts +4 -0
  13. package/api/resources/devices/client/Client.js +7 -4
  14. package/api/resources/devices/client/requests/DevicesGetRawRequest.d.ts +4 -0
  15. package/api/resources/insurance/client/Client.d.ts +6 -0
  16. package/api/resources/insurance/client/Client.js +11 -5
  17. package/api/resources/insurance/client/requests/InsuranceSearchDiagnosisRequest.d.ts +6 -0
  18. package/api/resources/introspect/client/Client.d.ts +11 -0
  19. package/api/resources/introspect/client/Client.js +24 -13
  20. package/api/resources/introspect/client/requests/IntrospectGetUserHistoricalPullsRequest.d.ts +6 -0
  21. package/api/resources/introspect/client/requests/IntrospectGetUserResourcesRequest.d.ts +6 -0
  22. package/api/resources/labTests/client/Client.d.ts +26 -1
  23. package/api/resources/labTests/client/Client.js +173 -58
  24. package/api/resources/labTests/client/requests/CreateOrderRequestCompatible.d.ts +1 -1
  25. package/api/resources/labTests/client/requests/LabTestsGetMarkersForLabTestRequest.d.ts +4 -0
  26. package/api/resources/labTests/client/requests/LabTestsGetMarkersRequest.d.ts +4 -0
  27. package/api/resources/labTests/client/requests/LabTestsGetOrdersRequest.d.ts +4 -0
  28. package/api/resources/labTests/client/requests/RequestAppointmentRequest.d.ts +9 -0
  29. package/api/resources/labTests/client/requests/index.d.ts +1 -0
  30. package/api/resources/link/client/Client.d.ts +7 -0
  31. package/api/resources/link/client/Client.js +35 -17
  32. package/api/resources/link/client/requests/LinkGetAllProvidersRequest.d.ts +4 -0
  33. package/api/resources/link/client/requests/LinkTokenStateRequest.d.ts +4 -0
  34. package/api/resources/meal/client/Client.d.ts +6 -0
  35. package/api/resources/meal/client/Client.js +11 -6
  36. package/api/resources/meal/client/requests/MealGetRequest.d.ts +6 -0
  37. package/api/resources/profile/client/Client.d.ts +1 -0
  38. package/api/resources/profile/client/Client.js +8 -7
  39. package/api/resources/providers/client/Client.d.ts +4 -0
  40. package/api/resources/providers/client/Client.js +5 -1
  41. package/api/resources/sleep/client/Client.d.ts +19 -0
  42. package/api/resources/sleep/client/Client.js +38 -17
  43. package/api/resources/sleep/client/requests/SleepGetRawRequest.d.ts +6 -0
  44. package/api/resources/sleep/client/requests/SleepGetRequest.d.ts +6 -0
  45. package/api/resources/sleep/client/requests/SleepGetStreamRequest.d.ts +6 -0
  46. package/api/resources/team/client/Client.d.ts +18 -0
  47. package/api/resources/team/client/Client.js +37 -14
  48. package/api/resources/team/client/requests/TeamGetLinkConfigRequest.d.ts +4 -0
  49. package/api/resources/team/client/requests/TeamGetSourcePrioritiesRequest.d.ts +4 -0
  50. package/api/resources/team/client/requests/TeamGetUserByIdRequest.d.ts +4 -0
  51. package/api/resources/team/client/requests/TeamUpdateSourcePrioritiesRequest.d.ts +6 -0
  52. package/api/resources/testkit/client/Client.d.ts +1 -0
  53. package/api/resources/testkit/client/Client.js +4 -2
  54. package/api/resources/user/client/Client.d.ts +8 -1
  55. package/api/resources/user/client/Client.js +38 -16
  56. package/api/resources/user/client/requests/UserPatchBody.d.ts +4 -0
  57. package/api/resources/user/client/requests/UserRefreshRequest.d.ts +6 -0
  58. package/api/resources/user/client/requests/index.d.ts +1 -0
  59. package/api/resources/vitals/client/Client.d.ts +116 -0
  60. package/api/resources/vitals/client/Client.js +253 -116
  61. package/api/resources/vitals/client/requests/VitalsBloodOxygenRequest.d.ts +6 -0
  62. package/api/resources/vitals/client/requests/VitalsBloodPressureRequest.d.ts +6 -0
  63. package/api/resources/vitals/client/requests/VitalsCaffeineRequest.d.ts +6 -0
  64. package/api/resources/vitals/client/requests/VitalsCaloriesActiveRequest.d.ts +6 -0
  65. package/api/resources/vitals/client/requests/VitalsCaloriesBasalRequest.d.ts +6 -0
  66. package/api/resources/vitals/client/requests/VitalsCholesterolHdlRequest.d.ts +6 -0
  67. package/api/resources/vitals/client/requests/VitalsCholesterolLdlRequest.d.ts +6 -0
  68. package/api/resources/vitals/client/requests/VitalsCholesterolRequest.d.ts +6 -0
  69. package/api/resources/vitals/client/requests/VitalsCholesterolTotalRequest.d.ts +6 -0
  70. package/api/resources/vitals/client/requests/VitalsDistanceRequest.d.ts +6 -0
  71. package/api/resources/vitals/client/requests/VitalsElectrocardiogramVoltageRequest.d.ts +6 -0
  72. package/api/resources/vitals/client/requests/VitalsFloorsClimbedRequest.d.ts +6 -0
  73. package/api/resources/vitals/client/requests/VitalsGlucoseRequest.d.ts +6 -0
  74. package/api/resources/vitals/client/requests/VitalsHeartrateRequest.d.ts +6 -0
  75. package/api/resources/vitals/client/requests/VitalsHrvRequest.d.ts +6 -0
  76. package/api/resources/vitals/client/requests/VitalsHypnogramRequest.d.ts +6 -0
  77. package/api/resources/vitals/client/requests/VitalsIgeRequest.d.ts +6 -0
  78. package/api/resources/vitals/client/requests/VitalsIggRequest.d.ts +6 -0
  79. package/api/resources/vitals/client/requests/VitalsMindfulnessMinutesRequest.d.ts +6 -0
  80. package/api/resources/vitals/client/requests/VitalsRespiratoryRateRequest.d.ts +6 -0
  81. package/api/resources/vitals/client/requests/VitalsStepsRequest.d.ts +6 -0
  82. package/api/resources/vitals/client/requests/VitalsTriglyceridesRequest.d.ts +6 -0
  83. package/api/resources/vitals/client/requests/VitalsWaterRequest.d.ts +6 -0
  84. package/api/resources/workouts/client/Client.d.ts +14 -0
  85. package/api/resources/workouts/client/Client.js +27 -12
  86. package/api/resources/workouts/client/requests/WorkoutsGetRawRequest.d.ts +6 -0
  87. package/api/resources/workouts/client/requests/WorkoutsGetRequest.d.ts +6 -0
  88. package/api/types/AppointmentEventStatus.d.ts +2 -1
  89. package/api/types/AppointmentEventStatus.js +1 -0
  90. package/api/types/AppointmentProvider.d.ts +2 -1
  91. package/api/types/AppointmentProvider.js +1 -0
  92. package/api/types/AppointmentServiceType.d.ts +11 -0
  93. package/api/types/AppointmentServiceType.js +10 -0
  94. package/api/types/ClientFacingAppointment.d.ts +3 -3
  95. package/api/types/ClientFacingDiagnosisInformation.d.ts +2 -2
  96. package/api/types/ClientFacingLabTest.d.ts +1 -1
  97. package/api/types/ClientFacingOrder.d.ts +1 -1
  98. package/api/types/ClientFacingPayorSearchResponse.d.ts +3 -3
  99. package/api/types/ClientFacingSleep.d.ts +1 -1
  100. package/api/types/ClientFacingUser.d.ts +0 -1
  101. package/api/types/FallbackTimeZone.d.ts +0 -1
  102. package/api/types/OrderStatus.d.ts +2 -1
  103. package/api/types/OrderStatus.js +1 -0
  104. package/api/types/PhlebotomyAreaInfo.d.ts +2 -0
  105. package/api/types/PhlebotomyProviderInfo.d.ts +8 -0
  106. package/api/types/UserRefreshSuccessResponse.d.ts +1 -0
  107. package/api/types/UserSignInTokenResponse.d.ts +1 -2
  108. package/api/types/index.d.ts +9 -9
  109. package/api/types/index.js +9 -9
  110. package/core/fetcher/APIResponse.d.ts +1 -0
  111. package/core/fetcher/Fetcher.d.ts +3 -6
  112. package/core/fetcher/Fetcher.js +70 -26
  113. package/core/fetcher/getHeader.d.ts +1 -0
  114. package/core/{streaming-fetcher → fetcher}/getHeader.js +2 -2
  115. package/core/fetcher/index.d.ts +1 -0
  116. package/core/fetcher/index.js +3 -1
  117. package/core/index.d.ts +0 -1
  118. package/core/index.js +0 -1
  119. package/core/schemas/Schema.d.ts +1 -0
  120. package/core/schemas/Schema.js +1 -0
  121. package/core/schemas/builders/literals/booleanLiteral.d.ts +2 -0
  122. package/core/schemas/builders/literals/booleanLiteral.js +29 -0
  123. package/core/schemas/builders/literals/index.d.ts +1 -0
  124. package/core/schemas/builders/literals/index.js +3 -1
  125. package/core/schemas/builders/object/index.d.ts +2 -0
  126. package/core/schemas/builders/object/index.js +3 -1
  127. package/core/schemas/builders/object/objectWithoutOptionalProperties.d.ts +6 -0
  128. package/core/schemas/builders/object/objectWithoutOptionalProperties.js +8 -0
  129. package/dist/Client.d.ts +1 -0
  130. package/dist/api/errors/BadRequestError.js +1 -0
  131. package/dist/api/errors/UnprocessableEntityError.js +1 -0
  132. package/dist/api/resources/activity/client/Client.d.ts +11 -0
  133. package/dist/api/resources/activity/client/Client.js +22 -11
  134. package/dist/api/resources/activity/client/requests/ActivityGetRawRequest.d.ts +6 -0
  135. package/dist/api/resources/activity/client/requests/ActivityGetRequest.d.ts +6 -0
  136. package/dist/api/resources/body/client/Client.d.ts +11 -0
  137. package/dist/api/resources/body/client/Client.js +22 -11
  138. package/dist/api/resources/body/client/requests/BodyGetRawRequest.d.ts +6 -0
  139. package/dist/api/resources/body/client/requests/BodyGetRequest.d.ts +6 -0
  140. package/dist/api/resources/devices/client/Client.d.ts +4 -0
  141. package/dist/api/resources/devices/client/Client.js +7 -4
  142. package/dist/api/resources/devices/client/requests/DevicesGetRawRequest.d.ts +4 -0
  143. package/dist/api/resources/insurance/client/Client.d.ts +6 -0
  144. package/dist/api/resources/insurance/client/Client.js +11 -5
  145. package/dist/api/resources/insurance/client/requests/InsuranceSearchDiagnosisRequest.d.ts +6 -0
  146. package/dist/api/resources/introspect/client/Client.d.ts +11 -0
  147. package/dist/api/resources/introspect/client/Client.js +24 -13
  148. package/dist/api/resources/introspect/client/requests/IntrospectGetUserHistoricalPullsRequest.d.ts +6 -0
  149. package/dist/api/resources/introspect/client/requests/IntrospectGetUserResourcesRequest.d.ts +6 -0
  150. package/dist/api/resources/labTests/client/Client.d.ts +26 -1
  151. package/dist/api/resources/labTests/client/Client.js +173 -58
  152. package/dist/api/resources/labTests/client/requests/CreateOrderRequestCompatible.d.ts +1 -1
  153. package/dist/api/resources/labTests/client/requests/LabTestsGetMarkersForLabTestRequest.d.ts +4 -0
  154. package/dist/api/resources/labTests/client/requests/LabTestsGetMarkersRequest.d.ts +4 -0
  155. package/dist/api/resources/labTests/client/requests/LabTestsGetOrdersRequest.d.ts +4 -0
  156. package/dist/api/resources/labTests/client/requests/RequestAppointmentRequest.d.ts +9 -0
  157. package/dist/api/resources/labTests/client/requests/index.d.ts +1 -0
  158. package/dist/api/resources/link/client/Client.d.ts +7 -0
  159. package/dist/api/resources/link/client/Client.js +35 -17
  160. package/dist/api/resources/link/client/requests/LinkGetAllProvidersRequest.d.ts +4 -0
  161. package/dist/api/resources/link/client/requests/LinkTokenStateRequest.d.ts +4 -0
  162. package/dist/api/resources/meal/client/Client.d.ts +6 -0
  163. package/dist/api/resources/meal/client/Client.js +11 -6
  164. package/dist/api/resources/meal/client/requests/MealGetRequest.d.ts +6 -0
  165. package/dist/api/resources/profile/client/Client.d.ts +1 -0
  166. package/dist/api/resources/profile/client/Client.js +8 -7
  167. package/dist/api/resources/providers/client/Client.d.ts +4 -0
  168. package/dist/api/resources/providers/client/Client.js +5 -1
  169. package/dist/api/resources/sleep/client/Client.d.ts +19 -0
  170. package/dist/api/resources/sleep/client/Client.js +38 -17
  171. package/dist/api/resources/sleep/client/requests/SleepGetRawRequest.d.ts +6 -0
  172. package/dist/api/resources/sleep/client/requests/SleepGetRequest.d.ts +6 -0
  173. package/dist/api/resources/sleep/client/requests/SleepGetStreamRequest.d.ts +6 -0
  174. package/dist/api/resources/team/client/Client.d.ts +18 -0
  175. package/dist/api/resources/team/client/Client.js +37 -14
  176. package/dist/api/resources/team/client/requests/TeamGetLinkConfigRequest.d.ts +4 -0
  177. package/dist/api/resources/team/client/requests/TeamGetSourcePrioritiesRequest.d.ts +4 -0
  178. package/dist/api/resources/team/client/requests/TeamGetUserByIdRequest.d.ts +4 -0
  179. package/dist/api/resources/team/client/requests/TeamUpdateSourcePrioritiesRequest.d.ts +6 -0
  180. package/dist/api/resources/testkit/client/Client.d.ts +1 -0
  181. package/dist/api/resources/testkit/client/Client.js +4 -2
  182. package/dist/api/resources/user/client/Client.d.ts +8 -1
  183. package/dist/api/resources/user/client/Client.js +38 -16
  184. package/dist/api/resources/user/client/requests/UserPatchBody.d.ts +4 -0
  185. package/dist/api/resources/user/client/requests/UserRefreshRequest.d.ts +6 -0
  186. package/dist/api/resources/user/client/requests/UserRefreshRequest.js +5 -0
  187. package/dist/api/resources/user/client/requests/index.d.ts +1 -0
  188. package/dist/api/resources/vitals/client/Client.d.ts +116 -0
  189. package/dist/api/resources/vitals/client/Client.js +253 -116
  190. package/dist/api/resources/vitals/client/requests/VitalsBloodOxygenRequest.d.ts +6 -0
  191. package/dist/api/resources/vitals/client/requests/VitalsBloodPressureRequest.d.ts +6 -0
  192. package/dist/api/resources/vitals/client/requests/VitalsCaffeineRequest.d.ts +6 -0
  193. package/dist/api/resources/vitals/client/requests/VitalsCaloriesActiveRequest.d.ts +6 -0
  194. package/dist/api/resources/vitals/client/requests/VitalsCaloriesBasalRequest.d.ts +6 -0
  195. package/dist/api/resources/vitals/client/requests/VitalsCholesterolHdlRequest.d.ts +6 -0
  196. package/dist/api/resources/vitals/client/requests/VitalsCholesterolLdlRequest.d.ts +6 -0
  197. package/dist/api/resources/vitals/client/requests/VitalsCholesterolRequest.d.ts +6 -0
  198. package/dist/api/resources/vitals/client/requests/VitalsCholesterolTotalRequest.d.ts +6 -0
  199. package/dist/api/resources/vitals/client/requests/VitalsDistanceRequest.d.ts +6 -0
  200. package/dist/api/resources/vitals/client/requests/VitalsElectrocardiogramVoltageRequest.d.ts +6 -0
  201. package/dist/api/resources/vitals/client/requests/VitalsFloorsClimbedRequest.d.ts +6 -0
  202. package/dist/api/resources/vitals/client/requests/VitalsGlucoseRequest.d.ts +6 -0
  203. package/dist/api/resources/vitals/client/requests/VitalsHeartrateRequest.d.ts +6 -0
  204. package/dist/api/resources/vitals/client/requests/VitalsHrvRequest.d.ts +6 -0
  205. package/dist/api/resources/vitals/client/requests/VitalsHypnogramRequest.d.ts +6 -0
  206. package/dist/api/resources/vitals/client/requests/VitalsIgeRequest.d.ts +6 -0
  207. package/dist/api/resources/vitals/client/requests/VitalsIggRequest.d.ts +6 -0
  208. package/dist/api/resources/vitals/client/requests/VitalsMindfulnessMinutesRequest.d.ts +6 -0
  209. package/dist/api/resources/vitals/client/requests/VitalsRespiratoryRateRequest.d.ts +6 -0
  210. package/dist/api/resources/vitals/client/requests/VitalsStepsRequest.d.ts +6 -0
  211. package/dist/api/resources/vitals/client/requests/VitalsTriglyceridesRequest.d.ts +6 -0
  212. package/dist/api/resources/vitals/client/requests/VitalsWaterRequest.d.ts +6 -0
  213. package/dist/api/resources/workouts/client/Client.d.ts +14 -0
  214. package/dist/api/resources/workouts/client/Client.js +27 -12
  215. package/dist/api/resources/workouts/client/requests/WorkoutsGetRawRequest.d.ts +6 -0
  216. package/dist/api/resources/workouts/client/requests/WorkoutsGetRequest.d.ts +6 -0
  217. package/dist/api/types/AppointmentEventStatus.d.ts +2 -1
  218. package/dist/api/types/AppointmentEventStatus.js +1 -0
  219. package/dist/api/types/AppointmentProvider.d.ts +2 -1
  220. package/dist/api/types/AppointmentProvider.js +1 -0
  221. package/dist/api/types/AppointmentServiceType.d.ts +11 -0
  222. package/dist/api/types/AppointmentServiceType.js +10 -0
  223. package/dist/api/types/ClientFacingAppointment.d.ts +3 -3
  224. package/dist/api/types/ClientFacingDiagnosisInformation.d.ts +2 -2
  225. package/dist/api/types/ClientFacingLabTest.d.ts +1 -1
  226. package/dist/api/types/ClientFacingOrder.d.ts +1 -1
  227. package/dist/api/types/ClientFacingPayorSearchResponse.d.ts +3 -3
  228. package/dist/api/types/ClientFacingSleep.d.ts +1 -1
  229. package/dist/api/types/ClientFacingUser.d.ts +0 -1
  230. package/dist/api/types/FallbackTimeZone.d.ts +0 -1
  231. package/dist/api/types/OrderStatus.d.ts +2 -1
  232. package/dist/api/types/OrderStatus.js +1 -0
  233. package/dist/api/types/PhlebotomyAreaInfo.d.ts +2 -0
  234. package/dist/api/types/PhlebotomyProviderInfo.d.ts +8 -0
  235. package/dist/api/types/PhlebotomyProviderInfo.js +5 -0
  236. package/dist/api/types/UserRefreshSuccessResponse.d.ts +1 -0
  237. package/dist/api/types/UserSignInTokenResponse.d.ts +1 -2
  238. package/dist/api/types/index.d.ts +9 -9
  239. package/dist/api/types/index.js +9 -9
  240. package/dist/core/fetcher/APIResponse.d.ts +1 -0
  241. package/dist/core/fetcher/Fetcher.d.ts +3 -6
  242. package/dist/core/fetcher/Fetcher.js +70 -26
  243. package/dist/core/fetcher/getHeader.d.ts +1 -0
  244. package/dist/core/{streaming-fetcher → fetcher}/getHeader.js +2 -2
  245. package/dist/core/fetcher/index.d.ts +1 -0
  246. package/dist/core/fetcher/index.js +3 -1
  247. package/dist/core/index.d.ts +0 -1
  248. package/dist/core/index.js +0 -1
  249. package/dist/core/schemas/Schema.d.ts +1 -0
  250. package/dist/core/schemas/Schema.js +1 -0
  251. package/dist/core/schemas/builders/literals/booleanLiteral.d.ts +2 -0
  252. package/dist/core/schemas/builders/literals/booleanLiteral.js +29 -0
  253. package/dist/core/schemas/builders/literals/index.d.ts +1 -0
  254. package/dist/core/schemas/builders/literals/index.js +3 -1
  255. package/dist/core/schemas/builders/object/index.d.ts +2 -0
  256. package/dist/core/schemas/builders/object/index.js +3 -1
  257. package/dist/core/schemas/builders/object/objectWithoutOptionalProperties.d.ts +6 -0
  258. package/dist/core/schemas/builders/object/objectWithoutOptionalProperties.js +8 -0
  259. package/dist/serialization/resources/labTests/client/requests/RequestAppointmentRequest.d.ts +13 -0
  260. package/dist/serialization/resources/labTests/client/requests/RequestAppointmentRequest.js +43 -0
  261. package/dist/serialization/resources/labTests/client/requests/index.d.ts +1 -0
  262. package/dist/serialization/resources/labTests/client/requests/index.js +3 -1
  263. package/dist/serialization/types/AppointmentEventStatus.d.ts +1 -1
  264. package/dist/serialization/types/AppointmentEventStatus.js +1 -1
  265. package/dist/serialization/types/AppointmentProvider.d.ts +1 -1
  266. package/dist/serialization/types/AppointmentProvider.js +1 -1
  267. package/dist/serialization/types/AppointmentServiceType.d.ts +10 -0
  268. package/{serialization/types/UserSignInToken.js → dist/serialization/types/AppointmentServiceType.js} +2 -5
  269. package/dist/serialization/types/ClientFacingAppointment.d.ts +3 -3
  270. package/dist/serialization/types/ClientFacingAppointment.js +3 -3
  271. package/dist/serialization/types/OrderStatus.d.ts +1 -1
  272. package/dist/serialization/types/OrderStatus.js +1 -0
  273. package/dist/serialization/types/PhlebotomyAreaInfo.d.ts +1 -0
  274. package/dist/serialization/types/PhlebotomyAreaInfo.js +10 -0
  275. package/dist/serialization/types/PhlebotomyProviderInfo.d.ts +13 -0
  276. package/{serialization/types/UserSignInTokenResponseSignInToken.js → dist/serialization/types/PhlebotomyProviderInfo.js} +5 -5
  277. package/dist/serialization/types/UserRefreshSuccessResponse.d.ts +1 -0
  278. package/dist/serialization/types/UserRefreshSuccessResponse.js +1 -0
  279. package/dist/serialization/types/UserSignInTokenResponse.d.ts +1 -1
  280. package/dist/serialization/types/UserSignInTokenResponse.js +1 -10
  281. package/dist/serialization/types/index.d.ts +9 -9
  282. package/dist/serialization/types/index.js +9 -9
  283. package/package.json +7 -4
  284. package/serialization/resources/labTests/client/requests/RequestAppointmentRequest.d.ts +13 -0
  285. package/serialization/resources/labTests/client/requests/RequestAppointmentRequest.js +43 -0
  286. package/serialization/resources/labTests/client/requests/index.d.ts +1 -0
  287. package/serialization/resources/labTests/client/requests/index.js +3 -1
  288. package/serialization/types/AppointmentEventStatus.d.ts +1 -1
  289. package/serialization/types/AppointmentEventStatus.js +1 -1
  290. package/serialization/types/AppointmentProvider.d.ts +1 -1
  291. package/serialization/types/AppointmentProvider.js +1 -1
  292. package/serialization/types/AppointmentServiceType.d.ts +10 -0
  293. package/{dist/serialization/types/UserSignInToken.js → serialization/types/AppointmentServiceType.js} +2 -5
  294. package/serialization/types/ClientFacingAppointment.d.ts +3 -3
  295. package/serialization/types/ClientFacingAppointment.js +3 -3
  296. package/serialization/types/OrderStatus.d.ts +1 -1
  297. package/serialization/types/OrderStatus.js +1 -0
  298. package/serialization/types/PhlebotomyAreaInfo.d.ts +1 -0
  299. package/serialization/types/PhlebotomyAreaInfo.js +10 -0
  300. package/serialization/types/PhlebotomyProviderInfo.d.ts +13 -0
  301. package/{dist/serialization/types/UserSignInTokenResponseSignInToken.js → serialization/types/PhlebotomyProviderInfo.js} +5 -5
  302. package/serialization/types/UserRefreshSuccessResponse.d.ts +1 -0
  303. package/serialization/types/UserRefreshSuccessResponse.js +1 -0
  304. package/serialization/types/UserSignInTokenResponse.d.ts +1 -1
  305. package/serialization/types/UserSignInTokenResponse.js +1 -10
  306. package/serialization/types/index.d.ts +9 -9
  307. package/serialization/types/index.js +9 -9
  308. package/api/types/UserSignInToken.d.ts +0 -7
  309. package/api/types/UserSignInTokenResponseSignInToken.d.ts +0 -5
  310. package/core/streaming-fetcher/StreamingFetcher.d.ts +0 -30
  311. package/core/streaming-fetcher/StreamingFetcher.js +0 -79
  312. package/core/streaming-fetcher/getHeader.d.ts +0 -2
  313. package/core/streaming-fetcher/index.d.ts +0 -3
  314. package/core/streaming-fetcher/index.js +0 -7
  315. package/dist/api/types/UserSignInToken.d.ts +0 -7
  316. package/dist/api/types/UserSignInTokenResponseSignInToken.d.ts +0 -5
  317. package/dist/core/streaming-fetcher/StreamingFetcher.d.ts +0 -30
  318. package/dist/core/streaming-fetcher/StreamingFetcher.js +0 -79
  319. package/dist/core/streaming-fetcher/getHeader.d.ts +0 -2
  320. package/dist/core/streaming-fetcher/index.d.ts +0 -3
  321. package/dist/core/streaming-fetcher/index.js +0 -7
  322. package/dist/serialization/types/UserSignInToken.d.ts +0 -13
  323. package/dist/serialization/types/UserSignInTokenResponseSignInToken.d.ts +0 -10
  324. package/serialization/types/UserSignInToken.d.ts +0 -13
  325. package/serialization/types/UserSignInTokenResponseSignInToken.d.ts +0 -10
  326. /package/api/{types/UserSignInToken.js → resources/labTests/client/requests/RequestAppointmentRequest.js} +0 -0
  327. /package/api/{types/UserSignInTokenResponseSignInToken.js → resources/user/client/requests/UserRefreshRequest.js} +0 -0
  328. /package/{dist/api/types/UserSignInToken.js → api/types/PhlebotomyProviderInfo.js} +0 -0
  329. /package/dist/api/{types/UserSignInTokenResponseSignInToken.js → resources/labTests/client/requests/RequestAppointmentRequest.js} +0 -0
@@ -45,13 +45,15 @@ const Vital = __importStar(require("../../.."));
45
45
  const url_join_1 = __importDefault(require("url-join"));
46
46
  const serializers = __importStar(require("../../../../serialization"));
47
47
  const errors = __importStar(require("../../../../errors"));
48
- const url_search_params_1 = __importDefault(require("@ungap/url-search-params"));
49
48
  class LabTests {
50
49
  constructor(_options) {
51
50
  this._options = _options;
52
51
  }
53
52
  /**
54
53
  * GET all the lab tests the team has access to.
54
+ *
55
+ * @example
56
+ * await vital.labTests.get()
55
57
  */
56
58
  get(requestOptions) {
57
59
  var _a;
@@ -63,10 +65,11 @@ class LabTests {
63
65
  "x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
64
66
  "X-Fern-Language": "JavaScript",
65
67
  "X-Fern-SDK-Name": "@tryvital/vital-node",
66
- "X-Fern-SDK-Version": "3.0.6",
68
+ "X-Fern-SDK-Version": "3.0.8",
67
69
  },
68
70
  contentType: "application/json",
69
71
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
72
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
70
73
  });
71
74
  if (_response.ok) {
72
75
  return yield serializers.labTests.get.Response.parseOrThrow(_response.body, {
@@ -110,11 +113,12 @@ class LabTests {
110
113
  "x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
111
114
  "X-Fern-Language": "JavaScript",
112
115
  "X-Fern-SDK-Name": "@tryvital/vital-node",
113
- "X-Fern-SDK-Version": "3.0.6",
116
+ "X-Fern-SDK-Version": "3.0.8",
114
117
  },
115
118
  contentType: "application/json",
116
119
  body: yield serializers.CreateLabTestRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
117
120
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
121
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
118
122
  });
119
123
  if (_response.ok) {
120
124
  return yield serializers.ClientFacingLabTest.parseOrThrow(_response.body, {
@@ -158,30 +162,31 @@ class LabTests {
158
162
  /**
159
163
  * GET all the markers for the given lab.
160
164
  * @throws {@link Vital.UnprocessableEntityError}
165
+ *
166
+ * @example
167
+ * await vital.labTests.getMarkers({})
161
168
  */
162
169
  getMarkers(request = {}, requestOptions) {
163
170
  var _a;
164
171
  return __awaiter(this, void 0, void 0, function* () {
165
172
  const { labId, name, page, size } = request;
166
- const _queryParams = new url_search_params_1.default();
173
+ const _queryParams = {};
167
174
  if (labId != null) {
168
175
  if (Array.isArray(labId)) {
169
- for (const _item of labId) {
170
- _queryParams.append("lab_id", _item.toString());
171
- }
176
+ _queryParams["lab_id"] = labId.map((item) => item.toString());
172
177
  }
173
178
  else {
174
- _queryParams.append("lab_id", labId.toString());
179
+ _queryParams["lab_id"] = labId.toString();
175
180
  }
176
181
  }
177
182
  if (name != null) {
178
- _queryParams.append("name", name);
183
+ _queryParams["name"] = name;
179
184
  }
180
185
  if (page != null) {
181
- _queryParams.append("page", page.toString());
186
+ _queryParams["page"] = page.toString();
182
187
  }
183
188
  if (size != null) {
184
- _queryParams.append("size", size.toString());
189
+ _queryParams["size"] = size.toString();
185
190
  }
186
191
  const _response = yield core.fetcher({
187
192
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, "v3/lab_tests/markers"),
@@ -190,11 +195,12 @@ class LabTests {
190
195
  "x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
191
196
  "X-Fern-Language": "JavaScript",
192
197
  "X-Fern-SDK-Name": "@tryvital/vital-node",
193
- "X-Fern-SDK-Version": "3.0.6",
198
+ "X-Fern-SDK-Version": "3.0.8",
194
199
  },
195
200
  contentType: "application/json",
196
201
  queryParameters: _queryParams,
197
202
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
203
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
198
204
  });
199
205
  if (_response.ok) {
200
206
  return yield serializers.GetMarkersResponse.parseOrThrow(_response.body, {
@@ -237,17 +243,20 @@ class LabTests {
237
243
  }
238
244
  /**
239
245
  * @throws {@link Vital.UnprocessableEntityError}
246
+ *
247
+ * @example
248
+ * await vital.labTests.getMarkersForLabTest("lab-test-id", {})
240
249
  */
241
250
  getMarkersForLabTest(labTestId, request = {}, requestOptions) {
242
251
  var _a;
243
252
  return __awaiter(this, void 0, void 0, function* () {
244
253
  const { page, size } = request;
245
- const _queryParams = new url_search_params_1.default();
254
+ const _queryParams = {};
246
255
  if (page != null) {
247
- _queryParams.append("page", page.toString());
256
+ _queryParams["page"] = page.toString();
248
257
  }
249
258
  if (size != null) {
250
- _queryParams.append("size", size.toString());
259
+ _queryParams["size"] = size.toString();
251
260
  }
252
261
  const _response = yield core.fetcher({
253
262
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/lab_tests/${labTestId}/markers`),
@@ -256,11 +265,12 @@ class LabTests {
256
265
  "x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
257
266
  "X-Fern-Language": "JavaScript",
258
267
  "X-Fern-SDK-Name": "@tryvital/vital-node",
259
- "X-Fern-SDK-Version": "3.0.6",
268
+ "X-Fern-SDK-Version": "3.0.8",
260
269
  },
261
270
  contentType: "application/json",
262
271
  queryParameters: _queryParams,
263
272
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
273
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
264
274
  });
265
275
  if (_response.ok) {
266
276
  return yield serializers.GetMarkersResponse.parseOrThrow(_response.body, {
@@ -315,10 +325,11 @@ class LabTests {
315
325
  "x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
316
326
  "X-Fern-Language": "JavaScript",
317
327
  "X-Fern-SDK-Name": "@tryvital/vital-node",
318
- "X-Fern-SDK-Version": "3.0.6",
328
+ "X-Fern-SDK-Version": "3.0.8",
319
329
  },
320
330
  contentType: "application/json",
321
331
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
332
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
322
333
  });
323
334
  if (_response.ok) {
324
335
  return yield serializers.ClientFacingMarker.parseOrThrow(_response.body, {
@@ -361,6 +372,9 @@ class LabTests {
361
372
  }
362
373
  /**
363
374
  * GET all the labs.
375
+ *
376
+ * @example
377
+ * await vital.labTests.getLabs()
364
378
  */
365
379
  getLabs(requestOptions) {
366
380
  var _a;
@@ -372,10 +386,11 @@ class LabTests {
372
386
  "x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
373
387
  "X-Fern-Language": "JavaScript",
374
388
  "X-Fern-SDK-Name": "@tryvital/vital-node",
375
- "X-Fern-SDK-Version": "3.0.6",
389
+ "X-Fern-SDK-Version": "3.0.8",
376
390
  },
377
391
  contentType: "application/json",
378
392
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
393
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
379
394
  });
380
395
  if (_response.ok) {
381
396
  return yield serializers.labTests.getLabs.Response.parseOrThrow(_response.body, {
@@ -420,10 +435,11 @@ class LabTests {
420
435
  "x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
421
436
  "X-Fern-Language": "JavaScript",
422
437
  "X-Fern-SDK-Name": "@tryvital/vital-node",
423
- "X-Fern-SDK-Version": "3.0.6",
438
+ "X-Fern-SDK-Version": "3.0.8",
424
439
  },
425
440
  contentType: "application/json",
426
441
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
442
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
427
443
  });
428
444
  if (_response.ok) {
429
445
  return yield serializers.ClientFacingLabTest.parseOrThrow(_response.body, {
@@ -479,11 +495,12 @@ class LabTests {
479
495
  "x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
480
496
  "X-Fern-Language": "JavaScript",
481
497
  "X-Fern-SDK-Name": "@tryvital/vital-node",
482
- "X-Fern-SDK-Version": "3.0.6",
498
+ "X-Fern-SDK-Version": "3.0.8",
483
499
  },
484
500
  contentType: "application/json",
485
501
  body: yield serializers.UsAddress.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
486
502
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
503
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
487
504
  });
488
505
  if (_response.ok) {
489
506
  return yield serializers.AppointmentAvailabilitySlots.parseOrThrow(_response.body, {
@@ -538,11 +555,72 @@ class LabTests {
538
555
  "x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
539
556
  "X-Fern-Language": "JavaScript",
540
557
  "X-Fern-SDK-Name": "@tryvital/vital-node",
541
- "X-Fern-SDK-Version": "3.0.6",
558
+ "X-Fern-SDK-Version": "3.0.8",
542
559
  },
543
560
  contentType: "application/json",
544
561
  body: yield serializers.AppointmentBookingRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
545
562
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
563
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
564
+ });
565
+ if (_response.ok) {
566
+ return yield serializers.ClientFacingAppointment.parseOrThrow(_response.body, {
567
+ unrecognizedObjectKeys: "passthrough",
568
+ allowUnrecognizedUnionMembers: true,
569
+ allowUnrecognizedEnumValues: true,
570
+ breadcrumbsPrefix: ["response"],
571
+ });
572
+ }
573
+ if (_response.error.reason === "status-code") {
574
+ switch (_response.error.statusCode) {
575
+ case 422:
576
+ throw new Vital.UnprocessableEntityError(yield serializers.HttpValidationError.parseOrThrow(_response.error.body, {
577
+ unrecognizedObjectKeys: "passthrough",
578
+ allowUnrecognizedUnionMembers: true,
579
+ allowUnrecognizedEnumValues: true,
580
+ breadcrumbsPrefix: ["response"],
581
+ }));
582
+ default:
583
+ throw new errors.VitalError({
584
+ statusCode: _response.error.statusCode,
585
+ body: _response.error.body,
586
+ });
587
+ }
588
+ }
589
+ switch (_response.error.reason) {
590
+ case "non-json":
591
+ throw new errors.VitalError({
592
+ statusCode: _response.error.statusCode,
593
+ body: _response.error.rawBody,
594
+ });
595
+ case "timeout":
596
+ throw new errors.VitalTimeoutError();
597
+ case "unknown":
598
+ throw new errors.VitalError({
599
+ message: _response.error.errorMessage,
600
+ });
601
+ }
602
+ });
603
+ }
604
+ /**
605
+ * Request an at-home phlebotomy appointment.
606
+ * @throws {@link Vital.UnprocessableEntityError}
607
+ */
608
+ requestPhlebotomyAppointment(orderId, request, requestOptions) {
609
+ var _a;
610
+ return __awaiter(this, void 0, void 0, function* () {
611
+ const _response = yield core.fetcher({
612
+ url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/order/${orderId}/phlebotomy/appointment/request`),
613
+ method: "POST",
614
+ headers: {
615
+ "x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
616
+ "X-Fern-Language": "JavaScript",
617
+ "X-Fern-SDK-Name": "@tryvital/vital-node",
618
+ "X-Fern-SDK-Version": "3.0.8",
619
+ },
620
+ contentType: "application/json",
621
+ body: yield serializers.RequestAppointmentRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
622
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
623
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
546
624
  });
547
625
  if (_response.ok) {
548
626
  return yield serializers.ClientFacingAppointment.parseOrThrow(_response.body, {
@@ -597,13 +675,14 @@ class LabTests {
597
675
  "x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
598
676
  "X-Fern-Language": "JavaScript",
599
677
  "X-Fern-SDK-Name": "@tryvital/vital-node",
600
- "X-Fern-SDK-Version": "3.0.6",
678
+ "X-Fern-SDK-Version": "3.0.8",
601
679
  },
602
680
  contentType: "application/json",
603
681
  body: yield serializers.AppointmentRescheduleRequest.jsonOrThrow(request, {
604
682
  unrecognizedObjectKeys: "strip",
605
683
  }),
606
684
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
685
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
607
686
  });
608
687
  if (_response.ok) {
609
688
  return yield serializers.ClientFacingAppointment.parseOrThrow(_response.body, {
@@ -658,11 +737,12 @@ class LabTests {
658
737
  "x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
659
738
  "X-Fern-Language": "JavaScript",
660
739
  "X-Fern-SDK-Name": "@tryvital/vital-node",
661
- "X-Fern-SDK-Version": "3.0.6",
740
+ "X-Fern-SDK-Version": "3.0.8",
662
741
  },
663
742
  contentType: "application/json",
664
743
  body: yield serializers.AppointmentCancelRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
665
744
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
745
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
666
746
  });
667
747
  if (_response.ok) {
668
748
  return yield serializers.ClientFacingAppointment.parseOrThrow(_response.body, {
@@ -705,6 +785,9 @@ class LabTests {
705
785
  }
706
786
  /**
707
787
  * Get the list of reasons for cancelling an at-home phlebotomy appointment.
788
+ *
789
+ * @example
790
+ * await vital.labTests.getPhlebotomyAppointmentCancellationReason()
708
791
  */
709
792
  getPhlebotomyAppointmentCancellationReason(requestOptions) {
710
793
  var _a;
@@ -716,10 +799,11 @@ class LabTests {
716
799
  "x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
717
800
  "X-Fern-Language": "JavaScript",
718
801
  "X-Fern-SDK-Name": "@tryvital/vital-node",
719
- "X-Fern-SDK-Version": "3.0.6",
802
+ "X-Fern-SDK-Version": "3.0.8",
720
803
  },
721
804
  contentType: "application/json",
722
805
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
806
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
723
807
  });
724
808
  if (_response.ok) {
725
809
  return yield serializers.labTests.getPhlebotomyAppointmentCancellationReason.Response.parseOrThrow(_response.body, {
@@ -764,10 +848,11 @@ class LabTests {
764
848
  "x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
765
849
  "X-Fern-Language": "JavaScript",
766
850
  "X-Fern-SDK-Name": "@tryvital/vital-node",
767
- "X-Fern-SDK-Version": "3.0.6",
851
+ "X-Fern-SDK-Version": "3.0.8",
768
852
  },
769
853
  contentType: "application/json",
770
854
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
855
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
771
856
  });
772
857
  if (_response.ok) {
773
858
  return yield serializers.ClientFacingAppointment.parseOrThrow(_response.body, {
@@ -812,15 +897,16 @@ class LabTests {
812
897
  * GET information about an area with respect to lab-testing.
813
898
  *
814
899
  * Information returned:
815
- * * Whether a given zip code is served by our Phlebotomy network.
900
+ *
901
+ * - Whether a given zip code is served by our Phlebotomy network.
816
902
  * @throws {@link Vital.UnprocessableEntityError}
817
903
  */
818
904
  getAreaInfo(request, requestOptions) {
819
905
  var _a;
820
906
  return __awaiter(this, void 0, void 0, function* () {
821
907
  const { zipCode } = request;
822
- const _queryParams = new url_search_params_1.default();
823
- _queryParams.append("zip_code", zipCode);
908
+ const _queryParams = {};
909
+ _queryParams["zip_code"] = zipCode;
824
910
  const _response = yield core.fetcher({
825
911
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, "v3/order/area/info"),
826
912
  method: "GET",
@@ -828,11 +914,12 @@ class LabTests {
828
914
  "x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
829
915
  "X-Fern-Language": "JavaScript",
830
916
  "X-Fern-SDK-Name": "@tryvital/vital-node",
831
- "X-Fern-SDK-Version": "3.0.6",
917
+ "X-Fern-SDK-Version": "3.0.8",
832
918
  },
833
919
  contentType: "application/json",
834
920
  queryParameters: _queryParams,
835
921
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
922
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
836
923
  });
837
924
  if (_response.ok) {
838
925
  return yield serializers.AreaInfo.parseOrThrow(_response.body, {
@@ -879,23 +966,42 @@ class LabTests {
879
966
  getResultPdf(orderId, requestOptions) {
880
967
  var _a;
881
968
  return __awaiter(this, void 0, void 0, function* () {
882
- const _response = yield core.streamingFetcher({
969
+ const _response = yield core.fetcher({
883
970
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/order/${orderId}/result/pdf`),
884
971
  method: "GET",
885
972
  headers: {
886
973
  "x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
887
974
  "X-Fern-Language": "JavaScript",
888
975
  "X-Fern-SDK-Name": "@tryvital/vital-node",
889
- "X-Fern-SDK-Version": "3.0.6",
976
+ "X-Fern-SDK-Version": "3.0.8",
890
977
  },
978
+ contentType: "application/json",
979
+ responseType: "streaming",
891
980
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
892
- onError: (error) => {
981
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
982
+ });
983
+ if (_response.ok) {
984
+ return _response.body;
985
+ }
986
+ if (_response.error.reason === "status-code") {
987
+ throw new errors.VitalError({
988
+ statusCode: _response.error.statusCode,
989
+ body: _response.error.body,
990
+ });
991
+ }
992
+ switch (_response.error.reason) {
993
+ case "non-json":
893
994
  throw new errors.VitalError({
894
- message: error === null || error === void 0 ? void 0 : error.message,
995
+ statusCode: _response.error.statusCode,
996
+ body: _response.error.rawBody,
895
997
  });
896
- },
897
- });
898
- return _response.data;
998
+ case "timeout":
999
+ throw new errors.VitalTimeoutError();
1000
+ case "unknown":
1001
+ throw new errors.VitalError({
1002
+ message: _response.error.errorMessage,
1003
+ });
1004
+ }
899
1005
  });
900
1006
  }
901
1007
  /**
@@ -913,10 +1019,11 @@ class LabTests {
913
1019
  "x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
914
1020
  "X-Fern-Language": "JavaScript",
915
1021
  "X-Fern-SDK-Name": "@tryvital/vital-node",
916
- "X-Fern-SDK-Version": "3.0.6",
1022
+ "X-Fern-SDK-Version": "3.0.8",
917
1023
  },
918
1024
  contentType: "application/json",
919
1025
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
1026
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
920
1027
  });
921
1028
  if (_response.ok) {
922
1029
  return yield serializers.LabResultsMetadata.parseOrThrow(_response.body, {
@@ -971,10 +1078,11 @@ class LabTests {
971
1078
  "x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
972
1079
  "X-Fern-Language": "JavaScript",
973
1080
  "X-Fern-SDK-Name": "@tryvital/vital-node",
974
- "X-Fern-SDK-Version": "3.0.6",
1081
+ "X-Fern-SDK-Version": "3.0.8",
975
1082
  },
976
1083
  contentType: "application/json",
977
1084
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
1085
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
978
1086
  });
979
1087
  if (_response.ok) {
980
1088
  return yield serializers.LabResultsRaw.parseOrThrow(_response.body, {
@@ -1029,10 +1137,11 @@ class LabTests {
1029
1137
  "x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
1030
1138
  "X-Fern-Language": "JavaScript",
1031
1139
  "X-Fern-SDK-Name": "@tryvital/vital-node",
1032
- "X-Fern-SDK-Version": "3.0.6",
1140
+ "X-Fern-SDK-Version": "3.0.8",
1033
1141
  },
1034
1142
  contentType: "application/json",
1035
1143
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
1144
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
1036
1145
  });
1037
1146
  if (_response.ok) {
1038
1147
  return _response.body;
@@ -1082,10 +1191,11 @@ class LabTests {
1082
1191
  "x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
1083
1192
  "X-Fern-Language": "JavaScript",
1084
1193
  "X-Fern-SDK-Name": "@tryvital/vital-node",
1085
- "X-Fern-SDK-Version": "3.0.6",
1194
+ "X-Fern-SDK-Version": "3.0.8",
1086
1195
  },
1087
1196
  contentType: "application/json",
1088
1197
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
1198
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
1089
1199
  });
1090
1200
  if (_response.ok) {
1091
1201
  return yield serializers.ClientFacingOrder.parseOrThrow(_response.body, {
@@ -1140,13 +1250,14 @@ class LabTests {
1140
1250
  "x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
1141
1251
  "X-Fern-Language": "JavaScript",
1142
1252
  "X-Fern-SDK-Name": "@tryvital/vital-node",
1143
- "X-Fern-SDK-Version": "3.0.6",
1253
+ "X-Fern-SDK-Version": "3.0.8",
1144
1254
  },
1145
1255
  contentType: "application/json",
1146
1256
  body: yield serializers.CreateOrderRequestCompatible.jsonOrThrow(request, {
1147
1257
  unrecognizedObjectKeys: "strip",
1148
1258
  }),
1149
1259
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
1260
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
1150
1261
  });
1151
1262
  if (_response.ok) {
1152
1263
  return yield serializers.PostOrderResponse.parseOrThrow(_response.body, {
@@ -1201,10 +1312,11 @@ class LabTests {
1201
1312
  "x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
1202
1313
  "X-Fern-Language": "JavaScript",
1203
1314
  "X-Fern-SDK-Name": "@tryvital/vital-node",
1204
- "X-Fern-SDK-Version": "3.0.6",
1315
+ "X-Fern-SDK-Version": "3.0.8",
1205
1316
  },
1206
1317
  contentType: "application/json",
1207
1318
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
1319
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
1208
1320
  });
1209
1321
  if (_response.ok) {
1210
1322
  return yield serializers.PostOrderResponse.parseOrThrow(_response.body, {
@@ -1253,12 +1365,12 @@ class LabTests {
1253
1365
  var _a;
1254
1366
  return __awaiter(this, void 0, void 0, function* () {
1255
1367
  const { finalStatus, delay } = request;
1256
- const _queryParams = new url_search_params_1.default();
1368
+ const _queryParams = {};
1257
1369
  if (finalStatus != null) {
1258
- _queryParams.append("final_status", finalStatus);
1370
+ _queryParams["final_status"] = finalStatus;
1259
1371
  }
1260
1372
  if (delay != null) {
1261
- _queryParams.append("delay", delay.toString());
1373
+ _queryParams["delay"] = delay.toString();
1262
1374
  }
1263
1375
  const _response = yield core.fetcher({
1264
1376
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/order/${orderId}/test`),
@@ -1267,11 +1379,12 @@ class LabTests {
1267
1379
  "x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
1268
1380
  "X-Fern-Language": "JavaScript",
1269
1381
  "X-Fern-SDK-Name": "@tryvital/vital-node",
1270
- "X-Fern-SDK-Version": "3.0.6",
1382
+ "X-Fern-SDK-Version": "3.0.8",
1271
1383
  },
1272
1384
  contentType: "application/json",
1273
1385
  queryParameters: _queryParams,
1274
1386
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
1387
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
1275
1388
  });
1276
1389
  if (_response.ok) {
1277
1390
  return _response.body;
@@ -1310,39 +1423,40 @@ class LabTests {
1310
1423
  /**
1311
1424
  * GET many orders with filters.
1312
1425
  * @throws {@link Vital.UnprocessableEntityError}
1426
+ *
1427
+ * @example
1428
+ * await vital.labTests.getOrders({})
1313
1429
  */
1314
1430
  getOrders(request = {}, requestOptions) {
1315
1431
  var _a;
1316
1432
  return __awaiter(this, void 0, void 0, function* () {
1317
1433
  const { startDate, endDate, userId, patientName, orderIds, page, size } = request;
1318
- const _queryParams = new url_search_params_1.default();
1434
+ const _queryParams = {};
1319
1435
  if (startDate != null) {
1320
- _queryParams.append("start_date", startDate.toISOString());
1436
+ _queryParams["start_date"] = startDate.toISOString();
1321
1437
  }
1322
1438
  if (endDate != null) {
1323
- _queryParams.append("end_date", endDate.toISOString());
1439
+ _queryParams["end_date"] = endDate.toISOString();
1324
1440
  }
1325
1441
  if (userId != null) {
1326
- _queryParams.append("user_id", userId);
1442
+ _queryParams["user_id"] = userId;
1327
1443
  }
1328
1444
  if (patientName != null) {
1329
- _queryParams.append("patient_name", patientName);
1445
+ _queryParams["patient_name"] = patientName;
1330
1446
  }
1331
1447
  if (orderIds != null) {
1332
1448
  if (Array.isArray(orderIds)) {
1333
- for (const _item of orderIds) {
1334
- _queryParams.append("order_ids", _item);
1335
- }
1449
+ _queryParams["order_ids"] = orderIds.map((item) => item);
1336
1450
  }
1337
1451
  else {
1338
- _queryParams.append("order_ids", orderIds);
1452
+ _queryParams["order_ids"] = orderIds;
1339
1453
  }
1340
1454
  }
1341
1455
  if (page != null) {
1342
- _queryParams.append("page", page.toString());
1456
+ _queryParams["page"] = page.toString();
1343
1457
  }
1344
1458
  if (size != null) {
1345
- _queryParams.append("size", size.toString());
1459
+ _queryParams["size"] = size.toString();
1346
1460
  }
1347
1461
  const _response = yield core.fetcher({
1348
1462
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, "v3/orders"),
@@ -1351,11 +1465,12 @@ class LabTests {
1351
1465
  "x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
1352
1466
  "X-Fern-Language": "JavaScript",
1353
1467
  "X-Fern-SDK-Name": "@tryvital/vital-node",
1354
- "X-Fern-SDK-Version": "3.0.6",
1468
+ "X-Fern-SDK-Version": "3.0.8",
1355
1469
  },
1356
1470
  contentType: "application/json",
1357
1471
  queryParameters: _queryParams,
1358
1472
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
1473
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
1359
1474
  });
1360
1475
  if (_response.ok) {
1361
1476
  return yield serializers.GetOrdersResponse.parseOrThrow(_response.body, {
@@ -7,7 +7,7 @@ export interface CreateOrderRequestCompatible {
7
7
  labTestId: string;
8
8
  physician?: Vital.PhysicianCreateRequest;
9
9
  healthInsurance?: Vital.HealthInsuranceCreateRequest;
10
- /** Defines whether order is priority or not. Only available for Labcorp. For Labcorp, this corresponds to a STAT order. */
10
+ /** Defines whether order is priority or not. For some labs, this refers to a STAT order. */
11
11
  priority?: boolean;
12
12
  consents?: Vital.Consent[];
13
13
  patientDetails: Vital.PatientDetails;
@@ -1,6 +1,10 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
+ /**
5
+ * @example
6
+ * {}
7
+ */
4
8
  export interface LabTestsGetMarkersForLabTestRequest {
5
9
  page?: number;
6
10
  size?: number;
@@ -1,6 +1,10 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
+ /**
5
+ * @example
6
+ * {}
7
+ */
4
8
  export interface LabTestsGetMarkersRequest {
5
9
  /**
6
10
  * The identifier Vital assigned to a lab partner.
@@ -1,6 +1,10 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
+ /**
5
+ * @example
6
+ * {}
7
+ */
4
8
  export interface LabTestsGetOrdersRequest {
5
9
  /**
6
10
  * Date from in YYYY-MM-DD or ISO formatted date time. If a date is provided without a time, the time will be set to 00:00:00
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Vital from "../../../..";
5
+ export interface RequestAppointmentRequest {
6
+ /** At-home phlebotomy appointment address. */
7
+ address: Vital.UsAddress;
8
+ provider: Vital.AppointmentProvider;
9
+ }