candidhealth 0.24.0-2a6d412 → 0.24.2

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 (235) hide show
  1. package/Client.d.ts +3 -0
  2. package/README.md +134 -6
  3. package/api/resources/auth/client/Client.d.ts +3 -0
  4. package/api/resources/auth/resources/v2/client/Client.d.ts +4 -1
  5. package/api/resources/auth/resources/v2/client/Client.js +6 -7
  6. package/api/resources/billingNotes/client/Client.d.ts +3 -0
  7. package/api/resources/billingNotes/resources/v2/client/Client.d.ts +4 -1
  8. package/api/resources/billingNotes/resources/v2/client/Client.js +5 -4
  9. package/api/resources/contracts/client/Client.d.ts +3 -0
  10. package/api/resources/contracts/resources/v2/client/Client.d.ts +8 -5
  11. package/api/resources/contracts/resources/v2/client/Client.js +27 -26
  12. package/api/resources/eligibility/client/Client.d.ts +3 -0
  13. package/api/resources/eligibility/resources/v2/client/Client.d.ts +6 -3
  14. package/api/resources/eligibility/resources/v2/client/Client.js +12 -9
  15. package/api/resources/encounters/client/Client.d.ts +3 -0
  16. package/api/resources/encounters/resources/v4/client/Client.d.ts +7 -19
  17. package/api/resources/encounters/resources/v4/client/Client.js +22 -37
  18. package/api/resources/encounters/resources/v4/client/requests/EncounterCreate.d.ts +0 -21
  19. package/api/resources/encounters/resources/v4/types/Encounter.d.ts +0 -1
  20. package/api/resources/expectedNetworkStatus/client/Client.d.ts +3 -0
  21. package/api/resources/expectedNetworkStatus/resources/v1/client/Client.d.ts +4 -1
  22. package/api/resources/expectedNetworkStatus/resources/v1/client/Client.js +5 -4
  23. package/api/resources/expectedNetworkStatus/resources/v2/client/Client.d.ts +5 -2
  24. package/api/resources/expectedNetworkStatus/resources/v2/client/Client.js +13 -11
  25. package/api/resources/exports/client/Client.d.ts +3 -0
  26. package/api/resources/exports/resources/v3/client/Client.d.ts +4 -1
  27. package/api/resources/exports/resources/v3/client/Client.js +5 -4
  28. package/api/resources/externalPaymentAccountConfig/client/Client.d.ts +3 -0
  29. package/api/resources/externalPaymentAccountConfig/resources/v1/client/Client.d.ts +4 -1
  30. package/api/resources/externalPaymentAccountConfig/resources/v1/client/Client.js +4 -3
  31. package/api/resources/feeSchedules/client/Client.d.ts +3 -0
  32. package/api/resources/feeSchedules/resources/v3/client/Client.d.ts +13 -10
  33. package/api/resources/feeSchedules/resources/v3/client/Client.js +52 -44
  34. package/api/resources/guarantor/client/Client.d.ts +3 -0
  35. package/api/resources/guarantor/resources/v1/client/Client.d.ts +6 -3
  36. package/api/resources/guarantor/resources/v1/client/Client.js +18 -19
  37. package/api/resources/importInvoice/client/Client.d.ts +3 -0
  38. package/api/resources/importInvoice/resources/v1/client/Client.d.ts +7 -4
  39. package/api/resources/importInvoice/resources/v1/client/Client.js +22 -18
  40. package/api/resources/insuranceAdjudications/client/Client.d.ts +3 -0
  41. package/api/resources/insuranceAdjudications/resources/v1/client/Client.d.ts +6 -3
  42. package/api/resources/insuranceAdjudications/resources/v1/client/Client.js +15 -12
  43. package/api/resources/insurancePayments/client/Client.d.ts +3 -0
  44. package/api/resources/insurancePayments/resources/v1/client/Client.d.ts +8 -5
  45. package/api/resources/insurancePayments/resources/v1/client/Client.js +29 -24
  46. package/api/resources/insuranceRefunds/client/Client.d.ts +3 -0
  47. package/api/resources/insuranceRefunds/resources/v1/client/Client.d.ts +8 -5
  48. package/api/resources/insuranceRefunds/resources/v1/client/Client.js +29 -24
  49. package/api/resources/organizationProviders/client/Client.d.ts +3 -0
  50. package/api/resources/organizationProviders/resources/v3/client/Client.d.ts +7 -4
  51. package/api/resources/organizationProviders/resources/v3/client/Client.js +23 -19
  52. package/api/resources/organizationServiceFacilities/client/Client.d.ts +3 -0
  53. package/api/resources/organizationServiceFacilities/resources/v2/client/Client.d.ts +8 -5
  54. package/api/resources/organizationServiceFacilities/resources/v2/client/Client.js +32 -23
  55. package/api/resources/patientPayments/client/Client.d.ts +3 -0
  56. package/api/resources/patientPayments/resources/v4/client/Client.d.ts +8 -5
  57. package/api/resources/patientPayments/resources/v4/client/Client.js +29 -24
  58. package/api/resources/patientRefunds/client/Client.d.ts +3 -0
  59. package/api/resources/patientRefunds/resources/v1/client/Client.d.ts +8 -5
  60. package/api/resources/patientRefunds/resources/v1/client/Client.js +29 -24
  61. package/api/resources/payers/client/Client.d.ts +3 -0
  62. package/api/resources/payers/resources/v3/client/Client.d.ts +5 -2
  63. package/api/resources/payers/resources/v3/client/Client.js +9 -7
  64. package/api/resources/preEncounter/client/Client.d.ts +3 -0
  65. package/api/resources/preEncounter/resources/coverages/client/Client.d.ts +3 -0
  66. package/api/resources/preEncounter/resources/coverages/resources/v1/client/Client.d.ts +3 -0
  67. package/api/resources/preEncounter/resources/coverages/resources/v1/resources/coverages/client/Client.d.ts +9 -6
  68. package/api/resources/preEncounter/resources/coverages/resources/v1/resources/coverages/client/Client.js +31 -25
  69. package/api/resources/preEncounter/resources/patients/client/Client.d.ts +3 -0
  70. package/api/resources/preEncounter/resources/patients/resources/v1/client/Client.d.ts +3 -0
  71. package/api/resources/preEncounter/resources/patients/resources/v1/resources/patients/client/Client.d.ts +10 -7
  72. package/api/resources/preEncounter/resources/patients/resources/v1/resources/patients/client/Client.js +38 -31
  73. package/api/resources/serviceFacility/client/Client.d.ts +4 -1
  74. package/api/resources/serviceFacility/client/Client.js +6 -7
  75. package/api/resources/tasks/client/Client.d.ts +3 -0
  76. package/api/resources/tasks/resources/v3/client/Client.d.ts +8 -5
  77. package/api/resources/tasks/resources/v3/client/Client.js +28 -23
  78. package/api/resources/writeOffs/client/Client.d.ts +3 -0
  79. package/api/resources/writeOffs/resources/v1/client/Client.d.ts +7 -4
  80. package/api/resources/writeOffs/resources/v1/client/Client.js +19 -15
  81. package/core/fetcher/Fetcher.d.ts +3 -0
  82. package/core/fetcher/Fetcher.js +22 -153
  83. package/core/fetcher/createRequestUrl.d.ts +1 -0
  84. package/core/fetcher/createRequestUrl.js +13 -0
  85. package/core/fetcher/getFetchFn.d.ts +4 -0
  86. package/core/fetcher/getFetchFn.js +59 -0
  87. package/core/fetcher/getRequestBody.d.ts +7 -0
  88. package/core/fetcher/getRequestBody.js +23 -0
  89. package/core/fetcher/getResponseBody.d.ts +1 -0
  90. package/core/fetcher/getResponseBody.js +48 -0
  91. package/core/fetcher/makeRequest.d.ts +1 -0
  92. package/core/fetcher/makeRequest.js +42 -0
  93. package/core/fetcher/requestWithRetries.d.ts +1 -0
  94. package/core/fetcher/requestWithRetries.js +32 -0
  95. package/core/fetcher/signals.d.ts +12 -0
  96. package/core/fetcher/signals.js +37 -0
  97. package/core/runtime/runtime.d.ts +2 -1
  98. package/core/runtime/runtime.js +12 -1
  99. package/core/schemas/Schema.d.ts +7 -4
  100. package/core/schemas/builders/lazy/lazy.d.ts +2 -2
  101. package/core/schemas/builders/lazy/lazy.js +8 -19
  102. package/core/schemas/builders/lazy/lazyObject.js +1 -10
  103. package/core/schemas/builders/list/list.js +31 -44
  104. package/core/schemas/builders/object/object.js +90 -111
  105. package/core/schemas/builders/object/types.d.ts +2 -2
  106. package/core/schemas/builders/object-like/getObjectLikeUtils.js +3 -12
  107. package/core/schemas/builders/record/record.js +49 -60
  108. package/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +2 -2
  109. package/core/schemas/builders/schema-utils/getSchemaUtils.js +18 -21
  110. package/core/schemas/builders/set/set.js +6 -15
  111. package/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +21 -32
  112. package/core/schemas/builders/union/union.js +51 -62
  113. package/core/schemas/utils/maybeSkipValidation.js +3 -12
  114. package/dist/Client.d.ts +3 -0
  115. package/dist/api/resources/auth/client/Client.d.ts +3 -0
  116. package/dist/api/resources/auth/resources/v2/client/Client.d.ts +4 -1
  117. package/dist/api/resources/auth/resources/v2/client/Client.js +6 -7
  118. package/dist/api/resources/billingNotes/client/Client.d.ts +3 -0
  119. package/dist/api/resources/billingNotes/resources/v2/client/Client.d.ts +4 -1
  120. package/dist/api/resources/billingNotes/resources/v2/client/Client.js +5 -4
  121. package/dist/api/resources/contracts/client/Client.d.ts +3 -0
  122. package/dist/api/resources/contracts/resources/v2/client/Client.d.ts +8 -5
  123. package/dist/api/resources/contracts/resources/v2/client/Client.js +27 -26
  124. package/dist/api/resources/eligibility/client/Client.d.ts +3 -0
  125. package/dist/api/resources/eligibility/resources/v2/client/Client.d.ts +6 -3
  126. package/dist/api/resources/eligibility/resources/v2/client/Client.js +12 -9
  127. package/dist/api/resources/encounters/client/Client.d.ts +3 -0
  128. package/dist/api/resources/encounters/resources/v4/client/Client.d.ts +7 -19
  129. package/dist/api/resources/encounters/resources/v4/client/Client.js +22 -37
  130. package/dist/api/resources/encounters/resources/v4/client/requests/EncounterCreate.d.ts +0 -21
  131. package/dist/api/resources/encounters/resources/v4/types/Encounter.d.ts +0 -1
  132. package/dist/api/resources/expectedNetworkStatus/client/Client.d.ts +3 -0
  133. package/dist/api/resources/expectedNetworkStatus/resources/v1/client/Client.d.ts +4 -1
  134. package/dist/api/resources/expectedNetworkStatus/resources/v1/client/Client.js +5 -4
  135. package/dist/api/resources/expectedNetworkStatus/resources/v2/client/Client.d.ts +5 -2
  136. package/dist/api/resources/expectedNetworkStatus/resources/v2/client/Client.js +13 -11
  137. package/dist/api/resources/exports/client/Client.d.ts +3 -0
  138. package/dist/api/resources/exports/resources/v3/client/Client.d.ts +4 -1
  139. package/dist/api/resources/exports/resources/v3/client/Client.js +5 -4
  140. package/dist/api/resources/externalPaymentAccountConfig/client/Client.d.ts +3 -0
  141. package/dist/api/resources/externalPaymentAccountConfig/resources/v1/client/Client.d.ts +4 -1
  142. package/dist/api/resources/externalPaymentAccountConfig/resources/v1/client/Client.js +4 -3
  143. package/dist/api/resources/feeSchedules/client/Client.d.ts +3 -0
  144. package/dist/api/resources/feeSchedules/resources/v3/client/Client.d.ts +13 -10
  145. package/dist/api/resources/feeSchedules/resources/v3/client/Client.js +52 -44
  146. package/dist/api/resources/guarantor/client/Client.d.ts +3 -0
  147. package/dist/api/resources/guarantor/resources/v1/client/Client.d.ts +6 -3
  148. package/dist/api/resources/guarantor/resources/v1/client/Client.js +18 -19
  149. package/dist/api/resources/importInvoice/client/Client.d.ts +3 -0
  150. package/dist/api/resources/importInvoice/resources/v1/client/Client.d.ts +7 -4
  151. package/dist/api/resources/importInvoice/resources/v1/client/Client.js +22 -18
  152. package/dist/api/resources/insuranceAdjudications/client/Client.d.ts +3 -0
  153. package/dist/api/resources/insuranceAdjudications/resources/v1/client/Client.d.ts +6 -3
  154. package/dist/api/resources/insuranceAdjudications/resources/v1/client/Client.js +15 -12
  155. package/dist/api/resources/insurancePayments/client/Client.d.ts +3 -0
  156. package/dist/api/resources/insurancePayments/resources/v1/client/Client.d.ts +8 -5
  157. package/dist/api/resources/insurancePayments/resources/v1/client/Client.js +29 -24
  158. package/dist/api/resources/insuranceRefunds/client/Client.d.ts +3 -0
  159. package/dist/api/resources/insuranceRefunds/resources/v1/client/Client.d.ts +8 -5
  160. package/dist/api/resources/insuranceRefunds/resources/v1/client/Client.js +29 -24
  161. package/dist/api/resources/organizationProviders/client/Client.d.ts +3 -0
  162. package/dist/api/resources/organizationProviders/resources/v3/client/Client.d.ts +7 -4
  163. package/dist/api/resources/organizationProviders/resources/v3/client/Client.js +23 -19
  164. package/dist/api/resources/organizationServiceFacilities/client/Client.d.ts +3 -0
  165. package/dist/api/resources/organizationServiceFacilities/resources/v2/client/Client.d.ts +8 -5
  166. package/dist/api/resources/organizationServiceFacilities/resources/v2/client/Client.js +32 -23
  167. package/dist/api/resources/patientPayments/client/Client.d.ts +3 -0
  168. package/dist/api/resources/patientPayments/resources/v4/client/Client.d.ts +8 -5
  169. package/dist/api/resources/patientPayments/resources/v4/client/Client.js +29 -24
  170. package/dist/api/resources/patientRefunds/client/Client.d.ts +3 -0
  171. package/dist/api/resources/patientRefunds/resources/v1/client/Client.d.ts +8 -5
  172. package/dist/api/resources/patientRefunds/resources/v1/client/Client.js +29 -24
  173. package/dist/api/resources/payers/client/Client.d.ts +3 -0
  174. package/dist/api/resources/payers/resources/v3/client/Client.d.ts +5 -2
  175. package/dist/api/resources/payers/resources/v3/client/Client.js +9 -7
  176. package/dist/api/resources/preEncounter/client/Client.d.ts +3 -0
  177. package/dist/api/resources/preEncounter/resources/coverages/client/Client.d.ts +3 -0
  178. package/dist/api/resources/preEncounter/resources/coverages/resources/v1/client/Client.d.ts +3 -0
  179. package/dist/api/resources/preEncounter/resources/coverages/resources/v1/resources/coverages/client/Client.d.ts +9 -6
  180. package/dist/api/resources/preEncounter/resources/coverages/resources/v1/resources/coverages/client/Client.js +31 -25
  181. package/dist/api/resources/preEncounter/resources/patients/client/Client.d.ts +3 -0
  182. package/dist/api/resources/preEncounter/resources/patients/resources/v1/client/Client.d.ts +3 -0
  183. package/dist/api/resources/preEncounter/resources/patients/resources/v1/resources/patients/client/Client.d.ts +10 -7
  184. package/dist/api/resources/preEncounter/resources/patients/resources/v1/resources/patients/client/Client.js +38 -31
  185. package/dist/api/resources/serviceFacility/client/Client.d.ts +4 -1
  186. package/dist/api/resources/serviceFacility/client/Client.js +6 -7
  187. package/dist/api/resources/tasks/client/Client.d.ts +3 -0
  188. package/dist/api/resources/tasks/resources/v3/client/Client.d.ts +8 -5
  189. package/dist/api/resources/tasks/resources/v3/client/Client.js +28 -23
  190. package/dist/api/resources/writeOffs/client/Client.d.ts +3 -0
  191. package/dist/api/resources/writeOffs/resources/v1/client/Client.d.ts +7 -4
  192. package/dist/api/resources/writeOffs/resources/v1/client/Client.js +19 -15
  193. package/dist/core/fetcher/Fetcher.d.ts +3 -0
  194. package/dist/core/fetcher/Fetcher.js +22 -153
  195. package/dist/core/fetcher/createRequestUrl.d.ts +1 -0
  196. package/dist/core/fetcher/createRequestUrl.js +13 -0
  197. package/dist/core/fetcher/getFetchFn.d.ts +4 -0
  198. package/dist/core/fetcher/getFetchFn.js +59 -0
  199. package/dist/core/fetcher/getRequestBody.d.ts +7 -0
  200. package/dist/core/fetcher/getRequestBody.js +23 -0
  201. package/dist/core/fetcher/getResponseBody.d.ts +1 -0
  202. package/dist/core/fetcher/getResponseBody.js +48 -0
  203. package/dist/core/fetcher/makeRequest.d.ts +1 -0
  204. package/dist/core/fetcher/makeRequest.js +42 -0
  205. package/dist/core/fetcher/requestWithRetries.d.ts +1 -0
  206. package/dist/core/fetcher/requestWithRetries.js +32 -0
  207. package/dist/core/fetcher/signals.d.ts +12 -0
  208. package/dist/core/fetcher/signals.js +37 -0
  209. package/dist/core/runtime/runtime.d.ts +2 -1
  210. package/dist/core/runtime/runtime.js +12 -1
  211. package/dist/core/schemas/Schema.d.ts +7 -4
  212. package/dist/core/schemas/builders/lazy/lazy.d.ts +2 -2
  213. package/dist/core/schemas/builders/lazy/lazy.js +8 -19
  214. package/dist/core/schemas/builders/lazy/lazyObject.js +1 -10
  215. package/dist/core/schemas/builders/list/list.js +31 -44
  216. package/dist/core/schemas/builders/object/object.js +90 -111
  217. package/dist/core/schemas/builders/object/types.d.ts +2 -2
  218. package/dist/core/schemas/builders/object-like/getObjectLikeUtils.js +3 -12
  219. package/dist/core/schemas/builders/record/record.js +49 -60
  220. package/dist/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +2 -2
  221. package/dist/core/schemas/builders/schema-utils/getSchemaUtils.js +18 -21
  222. package/dist/core/schemas/builders/set/set.js +6 -15
  223. package/dist/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +21 -32
  224. package/dist/core/schemas/builders/union/union.js +51 -62
  225. package/dist/core/schemas/utils/maybeSkipValidation.js +3 -12
  226. package/dist/serialization/resources/encounters/resources/v4/client/requests/EncounterCreate.d.ts +0 -2
  227. package/dist/serialization/resources/encounters/resources/v4/client/requests/EncounterCreate.js +0 -2
  228. package/dist/serialization/resources/encounters/resources/v4/types/Encounter.d.ts +0 -1
  229. package/dist/serialization/resources/encounters/resources/v4/types/Encounter.js +0 -1
  230. package/package.json +7 -2
  231. package/reference.md +7177 -0
  232. package/serialization/resources/encounters/resources/v4/client/requests/EncounterCreate.d.ts +0 -2
  233. package/serialization/resources/encounters/resources/v4/client/requests/EncounterCreate.js +0 -2
  234. package/serialization/resources/encounters/resources/v4/types/Encounter.d.ts +0 -1
  235. package/serialization/resources/encounters/resources/v4/types/Encounter.js +0 -1
package/Client.d.ts CHANGED
@@ -33,8 +33,11 @@ export declare namespace CandidApiClient {
33
33
  clientSecret: core.Supplier<string>;
34
34
  }
35
35
  interface RequestOptions {
36
+ /** The maximum time to wait for a response in seconds. */
36
37
  timeoutInSeconds?: number;
38
+ /** The number of times to retry the request. Defaults to 2. */
37
39
  maxRetries?: number;
40
+ /** A hook to abort the request. */
38
41
  abortSignal?: AbortSignal;
39
42
  }
40
43
  }
package/README.md CHANGED
@@ -1,10 +1,138 @@
1
- ## candid-node: A [Candid Health](https://joincandidhealth.com) TypeScript client
1
+ # Candid TypeScript Library
2
2
 
3
- [![npm](https://img.shields.io/npm/v/candidhealth)](https://www.npmjs.com/package/candidhealth)
4
- [![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-SDK%20generated%20by%20Fern-brightgreen)](https://buildwithfern.com/?utm_source=candidhealth/candid-node/readme)
3
+ [![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-SDK%20generated%20by%20Fern-brightgreen)](https://github.com/fern-api/fern)
4
+ [![npm shield](https://img.shields.io/npm/v/candidhealth)](https://www.npmjs.com/package/candidhealth)
5
5
 
6
- ### Installation
6
+ The Candid TypeScript library provides convenient access to the Candid API from TypeScript.
7
7
 
8
- ```bash
9
- yarn add candidhealth # or npm install, pnpm i, etc.
8
+ ## Installation
9
+
10
+ ```sh
11
+ npm i -s candidhealth
12
+ ```
13
+
14
+ ## Usage
15
+
16
+ Instantiate and use the client with the following:
17
+
18
+ ```typescript
19
+ import { CandidApiClient } from "candidhealth";
20
+
21
+ const client = new CandidApiClient({ clientId: "YOUR_CLIENT_ID", clientSecret: "YOUR_CLIENT_SECRET" });
22
+ await client.auth.v2.getToken({
23
+ clientId: "YOUR_CLIENT_ID",
24
+ clientSecret: "YOUR_CLIENT_SECRET",
25
+ });
26
+ ```
27
+
28
+ ## Request And Response Types
29
+
30
+ The SDK exports all request and response types as TypeScript interfaces. Simply import them with the
31
+ following namespace:
32
+
33
+ ```typescript
34
+ import { CandidApi } from "candidhealth";
35
+
36
+ const request: CandidApi.AuthGetTokenRequest = {
37
+ ...
38
+ };
10
39
  ```
40
+
41
+ ## Exception Handling
42
+
43
+ When the API returns a non-success status code (4xx or 5xx response), a subclass of the following error
44
+ will be thrown.
45
+
46
+ ```typescript
47
+ import { CandidApiError } from "candidhealth";
48
+
49
+ try {
50
+ await client.auth.v2.getToken(...);
51
+ } catch (err) {
52
+ if (err instanceof CandidApiError) {
53
+ console.log(err.statusCode);
54
+ console.log(err.message);
55
+ console.log(err.body);
56
+ }
57
+ }
58
+ ```
59
+
60
+ ## Advanced
61
+
62
+ ### Retries
63
+
64
+ The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long
65
+ as the request is deemed retriable and the number of retry attempts has not grown larger than the configured
66
+ retry limit (default: 2).
67
+
68
+ A request is deemed retriable when any of the following HTTP status codes is returned:
69
+
70
+ - [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
71
+ - [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
72
+ - [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500) (Internal Server Errors)
73
+
74
+ Use the `maxRetries` request option to configure this behavior.
75
+
76
+ ```typescript
77
+ const response = await client.auth.v2.getToken(..., {
78
+ maxRetries: 0 // override maxRetries at the request level
79
+ });
80
+ ```
81
+
82
+ ### Timeouts
83
+
84
+ The SDK defaults to a 60 second timeout. Use the `timeoutInSeconds` option to configure this behavior.
85
+
86
+ ```typescript
87
+ const response = await client.auth.v2.getToken(..., {
88
+ timeoutInSeconds: 30 // override timeout to 30s
89
+ });
90
+ ```
91
+
92
+ ### Aborting Requests
93
+
94
+ The SDK allows users to abort requests at any point by passing in an abort signal.
95
+
96
+ ```typescript
97
+ const controller = new AbortController();
98
+ const response = await client.auth.v2.getToken(..., {
99
+ abortSignal: controller.signal
100
+ });
101
+ controller.abort(); // aborts the request
102
+ ```
103
+
104
+ ### Runtime Compatibility
105
+
106
+ The SDK defaults to `node-fetch` but will use the global fetch client if present. The SDK works in the following
107
+ runtimes:
108
+
109
+ - Node.js 18+
110
+ - Vercel
111
+ - Cloudflare Workers
112
+ - Deno v1.25+
113
+ - Bun 1.0+
114
+ - React Native
115
+
116
+ ### Customizing Fetch Client
117
+
118
+ The SDK provides a way for your to customize the underlying HTTP client / Fetch function. If you're running in an
119
+ unsupported environment, this provides a way for you to break glass and ensure the SDK works.
120
+
121
+ ```typescript
122
+ import { CandidApiClient } from "candidhealth";
123
+
124
+ const client = new CandidApiClient({
125
+ ...
126
+ fetcher: // provide your implementation here
127
+ });
128
+ ```
129
+
130
+ ## Contributing
131
+
132
+ While we value open-source contributions to this SDK, this library is generated programmatically.
133
+ Additions made directly to this library would have to be moved over to our generation code,
134
+ otherwise they would be overwritten upon the next generated release. Feel free to open a PR as
135
+ a proof of concept, but know that we will not be able to merge it as-is. We suggest opening
136
+ an issue first to discuss with us!
137
+
138
+ On the other hand, contributions to the README are always very welcome!
@@ -10,8 +10,11 @@ export declare namespace Auth {
10
10
  token?: core.Supplier<core.BearerToken | undefined>;
11
11
  }
12
12
  interface RequestOptions {
13
+ /** The maximum time to wait for a response in seconds. */
13
14
  timeoutInSeconds?: number;
15
+ /** The number of times to retry the request. Defaults to 2. */
14
16
  maxRetries?: number;
17
+ /** A hook to abort the request. */
15
18
  abortSignal?: AbortSignal;
16
19
  }
17
20
  }
@@ -10,8 +10,11 @@ export declare namespace V2 {
10
10
  token?: core.Supplier<core.BearerToken | undefined>;
11
11
  }
12
12
  interface RequestOptions {
13
+ /** The maximum time to wait for a response in seconds. */
13
14
  timeoutInSeconds?: number;
15
+ /** The number of times to retry the request. Defaults to 2. */
14
16
  maxRetries?: number;
17
+ /** A hook to abort the request. */
15
18
  abortSignal?: AbortSignal;
16
19
  }
17
20
  }
@@ -41,7 +44,7 @@ export declare class V2 {
41
44
  * @param {V2.RequestOptions} requestOptions - Request-specific configuration.
42
45
  *
43
46
  * @example
44
- * await candidApi.auth.v2.getToken({
47
+ * await client.auth.v2.getToken({
45
48
  * clientId: "YOUR_CLIENT_ID",
46
49
  * clientSecret: "YOUR_CLIENT_SECRET"
47
50
  * })
@@ -71,7 +71,7 @@ class V2 {
71
71
  * @param {V2.RequestOptions} requestOptions - Request-specific configuration.
72
72
  *
73
73
  * @example
74
- * await candidApi.auth.v2.getToken({
74
+ * await client.auth.v2.getToken({
75
75
  * clientId: "YOUR_CLIENT_ID",
76
76
  * clientSecret: "YOUR_CLIENT_SECRET"
77
77
  * })
@@ -87,14 +87,13 @@ class V2 {
87
87
  Authorization: yield this._getAuthorizationHeader(),
88
88
  "X-Fern-Language": "JavaScript",
89
89
  "X-Fern-SDK-Name": "candidhealth",
90
- "X-Fern-SDK-Version": "0.24.0-2a6d412",
90
+ "X-Fern-SDK-Version": "0.24.2",
91
91
  "X-Fern-Runtime": core.RUNTIME.type,
92
92
  "X-Fern-Runtime-Version": core.RUNTIME.version,
93
93
  },
94
94
  contentType: "application/json",
95
- body: yield serializers.auth.v2.AuthGetTokenRequest.jsonOrThrow(request, {
96
- unrecognizedObjectKeys: "strip",
97
- }),
95
+ requestType: "json",
96
+ body: serializers.auth.v2.AuthGetTokenRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
98
97
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
99
98
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
100
99
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -102,7 +101,7 @@ class V2 {
102
101
  if (_response.ok) {
103
102
  return {
104
103
  ok: true,
105
- body: yield serializers.auth.v2.AuthGetTokenResponse.parseOrThrow(_response.body, {
104
+ body: serializers.auth.v2.AuthGetTokenResponse.parseOrThrow(_response.body, {
106
105
  unrecognizedObjectKeys: "passthrough",
107
106
  allowUnrecognizedUnionMembers: true,
108
107
  allowUnrecognizedEnumValues: true,
@@ -115,7 +114,7 @@ class V2 {
115
114
  case "TooManyRequestsError":
116
115
  return {
117
116
  ok: false,
118
- error: yield serializers.auth.v2.getToken.Error.parseOrThrow(_response.error.body, {
117
+ error: serializers.auth.v2.getToken.Error.parseOrThrow(_response.error.body, {
119
118
  unrecognizedObjectKeys: "passthrough",
120
119
  allowUnrecognizedUnionMembers: true,
121
120
  allowUnrecognizedEnumValues: true,
@@ -10,8 +10,11 @@ export declare namespace BillingNotes {
10
10
  token?: core.Supplier<core.BearerToken | undefined>;
11
11
  }
12
12
  interface RequestOptions {
13
+ /** The maximum time to wait for a response in seconds. */
13
14
  timeoutInSeconds?: number;
15
+ /** The number of times to retry the request. Defaults to 2. */
14
16
  maxRetries?: number;
17
+ /** A hook to abort the request. */
15
18
  abortSignal?: AbortSignal;
16
19
  }
17
20
  }
@@ -10,8 +10,11 @@ export declare namespace V2 {
10
10
  token?: core.Supplier<core.BearerToken | undefined>;
11
11
  }
12
12
  interface RequestOptions {
13
+ /** The maximum time to wait for a response in seconds. */
13
14
  timeoutInSeconds?: number;
15
+ /** The number of times to retry the request. Defaults to 2. */
14
16
  maxRetries?: number;
17
+ /** A hook to abort the request. */
15
18
  abortSignal?: AbortSignal;
16
19
  }
17
20
  }
@@ -23,7 +26,7 @@ export declare class V2 {
23
26
  * @param {V2.RequestOptions} requestOptions - Request-specific configuration.
24
27
  *
25
28
  * @example
26
- * await candidApi.billingNotes.v2.create({
29
+ * await client.billingNotes.v2.create({
27
30
  * encounterId: CandidApi.EncounterId("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32"),
28
31
  * text: "string"
29
32
  * })
@@ -53,7 +53,7 @@ class V2 {
53
53
  * @param {V2.RequestOptions} requestOptions - Request-specific configuration.
54
54
  *
55
55
  * @example
56
- * await candidApi.billingNotes.v2.create({
56
+ * await client.billingNotes.v2.create({
57
57
  * encounterId: CandidApi.EncounterId("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32"),
58
58
  * text: "string"
59
59
  * })
@@ -69,12 +69,13 @@ class V2 {
69
69
  Authorization: yield this._getAuthorizationHeader(),
70
70
  "X-Fern-Language": "JavaScript",
71
71
  "X-Fern-SDK-Name": "candidhealth",
72
- "X-Fern-SDK-Version": "0.24.0-2a6d412",
72
+ "X-Fern-SDK-Version": "0.24.2",
73
73
  "X-Fern-Runtime": core.RUNTIME.type,
74
74
  "X-Fern-Runtime-Version": core.RUNTIME.version,
75
75
  },
76
76
  contentType: "application/json",
77
- body: yield serializers.billingNotes.v2.StandaloneBillingNoteCreate.jsonOrThrow(request, {
77
+ requestType: "json",
78
+ body: serializers.billingNotes.v2.StandaloneBillingNoteCreate.jsonOrThrow(request, {
78
79
  unrecognizedObjectKeys: "strip",
79
80
  }),
80
81
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -84,7 +85,7 @@ class V2 {
84
85
  if (_response.ok) {
85
86
  return {
86
87
  ok: true,
87
- body: yield serializers.billingNotes.v2.BillingNote.parseOrThrow(_response.body, {
88
+ body: serializers.billingNotes.v2.BillingNote.parseOrThrow(_response.body, {
88
89
  unrecognizedObjectKeys: "passthrough",
89
90
  allowUnrecognizedUnionMembers: true,
90
91
  allowUnrecognizedEnumValues: true,
@@ -10,8 +10,11 @@ export declare namespace Contracts {
10
10
  token?: core.Supplier<core.BearerToken | undefined>;
11
11
  }
12
12
  interface RequestOptions {
13
+ /** The maximum time to wait for a response in seconds. */
13
14
  timeoutInSeconds?: number;
15
+ /** The number of times to retry the request. Defaults to 2. */
14
16
  maxRetries?: number;
17
+ /** A hook to abort the request. */
15
18
  abortSignal?: AbortSignal;
16
19
  }
17
20
  }
@@ -10,8 +10,11 @@ export declare namespace V2 {
10
10
  token?: core.Supplier<core.BearerToken | undefined>;
11
11
  }
12
12
  interface RequestOptions {
13
+ /** The maximum time to wait for a response in seconds. */
13
14
  timeoutInSeconds?: number;
15
+ /** The number of times to retry the request. Defaults to 2. */
14
16
  maxRetries?: number;
17
+ /** A hook to abort the request. */
15
18
  abortSignal?: AbortSignal;
16
19
  }
17
20
  }
@@ -23,7 +26,7 @@ export declare class V2 {
23
26
  * @param {V2.RequestOptions} requestOptions - Request-specific configuration.
24
27
  *
25
28
  * @example
26
- * await candidApi.contracts.v2.get(CandidApi.contracts.v2.ContractId("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32"))
29
+ * await client.contracts.v2.get(CandidApi.contracts.v2.ContractId("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32"))
27
30
  */
28
31
  get(contractId: CandidApi.contracts.v2.ContractId, requestOptions?: V2.RequestOptions): Promise<core.APIResponse<CandidApi.contracts.v2.ContractWithProviders, CandidApi.contracts.v2.get.Error>>;
29
32
  /**
@@ -31,7 +34,7 @@ export declare class V2 {
31
34
  * @param {V2.RequestOptions} requestOptions - Request-specific configuration.
32
35
  *
33
36
  * @example
34
- * await candidApi.contracts.v2.getMulti({
37
+ * await client.contracts.v2.getMulti({
35
38
  * pageToken: CandidApi.PageToken("eyJ0b2tlbiI6IjEiLCJwYWdlX3Rva2VuIjoiMiJ9"),
36
39
  * limit: 1,
37
40
  * contractingProviderId: CandidApi.contracts.v2.ContractingProviderId("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32"),
@@ -49,7 +52,7 @@ export declare class V2 {
49
52
  * @param {V2.RequestOptions} requestOptions - Request-specific configuration.
50
53
  *
51
54
  * @example
52
- * await candidApi.contracts.v2.create({
55
+ * await client.contracts.v2.create({
53
56
  * contractingProviderId: CandidApi.contracts.v2.ContractingProviderId("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32"),
54
57
  * renderingProviderIds: new Set([CandidApi.contracts.v2.RenderingProviderid("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")]),
55
58
  * payerUuid: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
@@ -77,7 +80,7 @@ export declare class V2 {
77
80
  * @param {V2.RequestOptions} requestOptions - Request-specific configuration.
78
81
  *
79
82
  * @example
80
- * await candidApi.contracts.v2.delete(CandidApi.contracts.v2.ContractId("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32"))
83
+ * await client.contracts.v2.delete(CandidApi.contracts.v2.ContractId("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32"))
81
84
  */
82
85
  delete(contractId: CandidApi.contracts.v2.ContractId, requestOptions?: V2.RequestOptions): Promise<core.APIResponse<void, CandidApi.contracts.v2.delete.Error>>;
83
86
  /**
@@ -86,7 +89,7 @@ export declare class V2 {
86
89
  * @param {V2.RequestOptions} requestOptions - Request-specific configuration.
87
90
  *
88
91
  * @example
89
- * await candidApi.contracts.v2.update(CandidApi.contracts.v2.ContractId("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32"), {
92
+ * await client.contracts.v2.update(CandidApi.contracts.v2.ContractId("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32"), {
90
93
  * renderingProviderIds: new Set([CandidApi.contracts.v2.RenderingProviderid("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")]),
91
94
  * effectiveDate: CandidApi.Date_("string"),
92
95
  * expirationDate: {
@@ -53,24 +53,25 @@ class V2 {
53
53
  * @param {V2.RequestOptions} requestOptions - Request-specific configuration.
54
54
  *
55
55
  * @example
56
- * await candidApi.contracts.v2.get(CandidApi.contracts.v2.ContractId("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32"))
56
+ * await client.contracts.v2.get(CandidApi.contracts.v2.ContractId("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32"))
57
57
  */
58
58
  get(contractId, requestOptions) {
59
59
  var _a, _b;
60
60
  return __awaiter(this, void 0, void 0, function* () {
61
61
  const _response = yield core.fetcher({
62
62
  url: (0, url_join_1.default)(((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.CandidApiEnvironment.Production)
63
- .candidApi, `/api/contracts/v2/${encodeURIComponent(yield serializers.contracts.v2.ContractId.jsonOrThrow(contractId))}`),
63
+ .candidApi, `/api/contracts/v2/${encodeURIComponent(serializers.contracts.v2.ContractId.jsonOrThrow(contractId))}`),
64
64
  method: "GET",
65
65
  headers: {
66
66
  Authorization: yield this._getAuthorizationHeader(),
67
67
  "X-Fern-Language": "JavaScript",
68
68
  "X-Fern-SDK-Name": "candidhealth",
69
- "X-Fern-SDK-Version": "0.24.0-2a6d412",
69
+ "X-Fern-SDK-Version": "0.24.2",
70
70
  "X-Fern-Runtime": core.RUNTIME.type,
71
71
  "X-Fern-Runtime-Version": core.RUNTIME.version,
72
72
  },
73
73
  contentType: "application/json",
74
+ requestType: "json",
74
75
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
75
76
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
76
77
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -78,7 +79,7 @@ class V2 {
78
79
  if (_response.ok) {
79
80
  return {
80
81
  ok: true,
81
- body: yield serializers.contracts.v2.ContractWithProviders.parseOrThrow(_response.body, {
82
+ body: serializers.contracts.v2.ContractWithProviders.parseOrThrow(_response.body, {
82
83
  unrecognizedObjectKeys: "passthrough",
83
84
  allowUnrecognizedUnionMembers: true,
84
85
  allowUnrecognizedEnumValues: true,
@@ -91,7 +92,7 @@ class V2 {
91
92
  case "EntityNotFoundError":
92
93
  return {
93
94
  ok: false,
94
- error: yield serializers.contracts.v2.get.Error.parseOrThrow(_response.error.body, {
95
+ error: serializers.contracts.v2.get.Error.parseOrThrow(_response.error.body, {
95
96
  unrecognizedObjectKeys: "passthrough",
96
97
  allowUnrecognizedUnionMembers: true,
97
98
  allowUnrecognizedEnumValues: true,
@@ -111,7 +112,7 @@ class V2 {
111
112
  * @param {V2.RequestOptions} requestOptions - Request-specific configuration.
112
113
  *
113
114
  * @example
114
- * await candidApi.contracts.v2.getMulti({
115
+ * await client.contracts.v2.getMulti({
115
116
  * pageToken: CandidApi.PageToken("eyJ0b2tlbiI6IjEiLCJwYWdlX3Rva2VuIjoiMiJ9"),
116
117
  * limit: 1,
117
118
  * contractingProviderId: CandidApi.contracts.v2.ContractingProviderId("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32"),
@@ -170,12 +171,13 @@ class V2 {
170
171
  Authorization: yield this._getAuthorizationHeader(),
171
172
  "X-Fern-Language": "JavaScript",
172
173
  "X-Fern-SDK-Name": "candidhealth",
173
- "X-Fern-SDK-Version": "0.24.0-2a6d412",
174
+ "X-Fern-SDK-Version": "0.24.2",
174
175
  "X-Fern-Runtime": core.RUNTIME.type,
175
176
  "X-Fern-Runtime-Version": core.RUNTIME.version,
176
177
  },
177
178
  contentType: "application/json",
178
179
  queryParameters: _queryParams,
180
+ requestType: "json",
179
181
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
180
182
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
181
183
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -183,7 +185,7 @@ class V2 {
183
185
  if (_response.ok) {
184
186
  return {
185
187
  ok: true,
186
- body: yield serializers.contracts.v2.ContractsPage.parseOrThrow(_response.body, {
188
+ body: serializers.contracts.v2.ContractsPage.parseOrThrow(_response.body, {
187
189
  unrecognizedObjectKeys: "passthrough",
188
190
  allowUnrecognizedUnionMembers: true,
189
191
  allowUnrecognizedEnumValues: true,
@@ -204,7 +206,7 @@ class V2 {
204
206
  * @param {V2.RequestOptions} requestOptions - Request-specific configuration.
205
207
  *
206
208
  * @example
207
- * await candidApi.contracts.v2.create({
209
+ * await client.contracts.v2.create({
208
210
  * contractingProviderId: CandidApi.contracts.v2.ContractingProviderId("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32"),
209
211
  * renderingProviderIds: new Set([CandidApi.contracts.v2.RenderingProviderid("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")]),
210
212
  * payerUuid: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
@@ -237,14 +239,13 @@ class V2 {
237
239
  Authorization: yield this._getAuthorizationHeader(),
238
240
  "X-Fern-Language": "JavaScript",
239
241
  "X-Fern-SDK-Name": "candidhealth",
240
- "X-Fern-SDK-Version": "0.24.0-2a6d412",
242
+ "X-Fern-SDK-Version": "0.24.2",
241
243
  "X-Fern-Runtime": core.RUNTIME.type,
242
244
  "X-Fern-Runtime-Version": core.RUNTIME.version,
243
245
  },
244
246
  contentType: "application/json",
245
- body: yield serializers.contracts.v2.ContractCreate.jsonOrThrow(request, {
246
- unrecognizedObjectKeys: "strip",
247
- }),
247
+ requestType: "json",
248
+ body: serializers.contracts.v2.ContractCreate.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
248
249
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
249
250
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
250
251
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -252,7 +253,7 @@ class V2 {
252
253
  if (_response.ok) {
253
254
  return {
254
255
  ok: true,
255
- body: yield serializers.contracts.v2.ContractWithProviders.parseOrThrow(_response.body, {
256
+ body: serializers.contracts.v2.ContractWithProviders.parseOrThrow(_response.body, {
256
257
  unrecognizedObjectKeys: "passthrough",
257
258
  allowUnrecognizedUnionMembers: true,
258
259
  allowUnrecognizedEnumValues: true,
@@ -271,24 +272,25 @@ class V2 {
271
272
  * @param {V2.RequestOptions} requestOptions - Request-specific configuration.
272
273
  *
273
274
  * @example
274
- * await candidApi.contracts.v2.delete(CandidApi.contracts.v2.ContractId("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32"))
275
+ * await client.contracts.v2.delete(CandidApi.contracts.v2.ContractId("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32"))
275
276
  */
276
277
  delete(contractId, requestOptions) {
277
278
  var _a, _b;
278
279
  return __awaiter(this, void 0, void 0, function* () {
279
280
  const _response = yield core.fetcher({
280
281
  url: (0, url_join_1.default)(((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.CandidApiEnvironment.Production)
281
- .candidApi, `/api/contracts/v2/${encodeURIComponent(yield serializers.contracts.v2.ContractId.jsonOrThrow(contractId))}`),
282
+ .candidApi, `/api/contracts/v2/${encodeURIComponent(serializers.contracts.v2.ContractId.jsonOrThrow(contractId))}`),
282
283
  method: "DELETE",
283
284
  headers: {
284
285
  Authorization: yield this._getAuthorizationHeader(),
285
286
  "X-Fern-Language": "JavaScript",
286
287
  "X-Fern-SDK-Name": "candidhealth",
287
- "X-Fern-SDK-Version": "0.24.0-2a6d412",
288
+ "X-Fern-SDK-Version": "0.24.2",
288
289
  "X-Fern-Runtime": core.RUNTIME.type,
289
290
  "X-Fern-Runtime-Version": core.RUNTIME.version,
290
291
  },
291
292
  contentType: "application/json",
293
+ requestType: "json",
292
294
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
293
295
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
294
296
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -304,7 +306,7 @@ class V2 {
304
306
  case "ContractIsLinkedToFeeScheduleHttpError":
305
307
  return {
306
308
  ok: false,
307
- error: yield serializers.contracts.v2.delete.Error.parseOrThrow(_response.error.body, {
309
+ error: serializers.contracts.v2.delete.Error.parseOrThrow(_response.error.body, {
308
310
  unrecognizedObjectKeys: "passthrough",
309
311
  allowUnrecognizedUnionMembers: true,
310
312
  allowUnrecognizedEnumValues: true,
@@ -325,7 +327,7 @@ class V2 {
325
327
  * @param {V2.RequestOptions} requestOptions - Request-specific configuration.
326
328
  *
327
329
  * @example
328
- * await candidApi.contracts.v2.update(CandidApi.contracts.v2.ContractId("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32"), {
330
+ * await client.contracts.v2.update(CandidApi.contracts.v2.ContractId("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32"), {
329
331
  * renderingProviderIds: new Set([CandidApi.contracts.v2.RenderingProviderid("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")]),
330
332
  * effectiveDate: CandidApi.Date_("string"),
331
333
  * expirationDate: {
@@ -365,20 +367,19 @@ class V2 {
365
367
  return __awaiter(this, void 0, void 0, function* () {
366
368
  const _response = yield core.fetcher({
367
369
  url: (0, url_join_1.default)(((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.CandidApiEnvironment.Production)
368
- .candidApi, `/api/contracts/v2/${encodeURIComponent(yield serializers.contracts.v2.ContractId.jsonOrThrow(contractId))}`),
370
+ .candidApi, `/api/contracts/v2/${encodeURIComponent(serializers.contracts.v2.ContractId.jsonOrThrow(contractId))}`),
369
371
  method: "PATCH",
370
372
  headers: {
371
373
  Authorization: yield this._getAuthorizationHeader(),
372
374
  "X-Fern-Language": "JavaScript",
373
375
  "X-Fern-SDK-Name": "candidhealth",
374
- "X-Fern-SDK-Version": "0.24.0-2a6d412",
376
+ "X-Fern-SDK-Version": "0.24.2",
375
377
  "X-Fern-Runtime": core.RUNTIME.type,
376
378
  "X-Fern-Runtime-Version": core.RUNTIME.version,
377
379
  },
378
380
  contentType: "application/json",
379
- body: yield serializers.contracts.v2.ContractUpdate.jsonOrThrow(request, {
380
- unrecognizedObjectKeys: "strip",
381
- }),
381
+ requestType: "json",
382
+ body: serializers.contracts.v2.ContractUpdate.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
382
383
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
383
384
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
384
385
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -386,7 +387,7 @@ class V2 {
386
387
  if (_response.ok) {
387
388
  return {
388
389
  ok: true,
389
- body: yield serializers.contracts.v2.ContractWithProviders.parseOrThrow(_response.body, {
390
+ body: serializers.contracts.v2.ContractWithProviders.parseOrThrow(_response.body, {
390
391
  unrecognizedObjectKeys: "passthrough",
391
392
  allowUnrecognizedUnionMembers: true,
392
393
  allowUnrecognizedEnumValues: true,
@@ -399,7 +400,7 @@ class V2 {
399
400
  case "UnprocessableEntityError":
400
401
  return {
401
402
  ok: false,
402
- error: yield serializers.contracts.v2.update.Error.parseOrThrow(_response.error.body, {
403
+ error: serializers.contracts.v2.update.Error.parseOrThrow(_response.error.body, {
403
404
  unrecognizedObjectKeys: "passthrough",
404
405
  allowUnrecognizedUnionMembers: true,
405
406
  allowUnrecognizedEnumValues: true,
@@ -10,8 +10,11 @@ export declare namespace Eligibility {
10
10
  token?: core.Supplier<core.BearerToken | undefined>;
11
11
  }
12
12
  interface RequestOptions {
13
+ /** The maximum time to wait for a response in seconds. */
13
14
  timeoutInSeconds?: number;
15
+ /** The number of times to retry the request. Defaults to 2. */
14
16
  maxRetries?: number;
17
+ /** A hook to abort the request. */
15
18
  abortSignal?: AbortSignal;
16
19
  }
17
20
  }
@@ -10,8 +10,11 @@ export declare namespace V2 {
10
10
  token?: core.Supplier<core.BearerToken | undefined>;
11
11
  }
12
12
  interface RequestOptions {
13
+ /** The maximum time to wait for a response in seconds. */
13
14
  timeoutInSeconds?: number;
15
+ /** The number of times to retry the request. Defaults to 2. */
14
16
  maxRetries?: number;
17
+ /** A hook to abort the request. */
15
18
  abortSignal?: AbortSignal;
16
19
  }
17
20
  }
@@ -38,7 +41,7 @@ export declare class V2 {
38
41
  * @param {V2.RequestOptions} requestOptions - Request-specific configuration.
39
42
  *
40
43
  * @example
41
- * await candidApi.eligibility.v2.submitEligibilityCheck({
44
+ * await client.eligibility.v2.submitEligibilityCheck({
42
45
  * "key": "value"
43
46
  * })
44
47
  */
@@ -66,7 +69,7 @@ export declare class V2 {
66
69
  * @param {V2.RequestOptions} requestOptions - Request-specific configuration.
67
70
  *
68
71
  * @example
69
- * await candidApi.eligibility.v2.submitEligibilityCheckAvaility()
72
+ * await client.eligibility.v2.submitEligibilityCheckAvaility()
70
73
  */
71
74
  submitEligibilityCheckAvaility(requestOptions?: V2.RequestOptions): Promise<core.APIResponse<unknown, CandidApi.eligibility.v2.submitEligibilityCheckAvaility.Error>>;
72
75
  /**
@@ -89,7 +92,7 @@ export declare class V2 {
89
92
  * @param {V2.RequestOptions} requestOptions - Request-specific configuration.
90
93
  *
91
94
  * @example
92
- * await candidApi.eligibility.v2.submitEligibilityCheckAvailityPost({
95
+ * await client.eligibility.v2.submitEligibilityCheckAvailityPost({
93
96
  * "key": "value"
94
97
  * })
95
98
  */