candidhealth 0.24.0-2a6d412 → 0.24.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Client.d.ts +3 -0
- package/README.md +134 -6
- package/api/resources/auth/client/Client.d.ts +3 -0
- package/api/resources/auth/resources/v2/client/Client.d.ts +4 -1
- package/api/resources/auth/resources/v2/client/Client.js +6 -7
- package/api/resources/billingNotes/client/Client.d.ts +3 -0
- package/api/resources/billingNotes/resources/v2/client/Client.d.ts +4 -1
- package/api/resources/billingNotes/resources/v2/client/Client.js +5 -4
- package/api/resources/contracts/client/Client.d.ts +3 -0
- package/api/resources/contracts/resources/v2/client/Client.d.ts +8 -5
- package/api/resources/contracts/resources/v2/client/Client.js +27 -26
- package/api/resources/eligibility/client/Client.d.ts +3 -0
- package/api/resources/eligibility/resources/v2/client/Client.d.ts +6 -3
- package/api/resources/eligibility/resources/v2/client/Client.js +12 -9
- package/api/resources/encounters/client/Client.d.ts +3 -0
- package/api/resources/encounters/resources/v4/client/Client.d.ts +7 -19
- package/api/resources/encounters/resources/v4/client/Client.js +22 -37
- package/api/resources/encounters/resources/v4/client/requests/EncounterCreate.d.ts +0 -21
- package/api/resources/encounters/resources/v4/types/Encounter.d.ts +0 -1
- package/api/resources/expectedNetworkStatus/client/Client.d.ts +3 -0
- package/api/resources/expectedNetworkStatus/resources/v1/client/Client.d.ts +4 -1
- package/api/resources/expectedNetworkStatus/resources/v1/client/Client.js +5 -4
- package/api/resources/expectedNetworkStatus/resources/v2/client/Client.d.ts +5 -2
- package/api/resources/expectedNetworkStatus/resources/v2/client/Client.js +13 -11
- package/api/resources/exports/client/Client.d.ts +3 -0
- package/api/resources/exports/resources/v3/client/Client.d.ts +4 -1
- package/api/resources/exports/resources/v3/client/Client.js +5 -4
- package/api/resources/externalPaymentAccountConfig/client/Client.d.ts +3 -0
- package/api/resources/externalPaymentAccountConfig/resources/v1/client/Client.d.ts +4 -1
- package/api/resources/externalPaymentAccountConfig/resources/v1/client/Client.js +4 -3
- package/api/resources/feeSchedules/client/Client.d.ts +3 -0
- package/api/resources/feeSchedules/resources/v3/client/Client.d.ts +13 -10
- package/api/resources/feeSchedules/resources/v3/client/Client.js +52 -44
- package/api/resources/guarantor/client/Client.d.ts +3 -0
- package/api/resources/guarantor/resources/v1/client/Client.d.ts +6 -3
- package/api/resources/guarantor/resources/v1/client/Client.js +18 -19
- package/api/resources/importInvoice/client/Client.d.ts +3 -0
- package/api/resources/importInvoice/resources/v1/client/Client.d.ts +7 -4
- package/api/resources/importInvoice/resources/v1/client/Client.js +22 -18
- package/api/resources/insuranceAdjudications/client/Client.d.ts +3 -0
- package/api/resources/insuranceAdjudications/resources/v1/client/Client.d.ts +6 -3
- package/api/resources/insuranceAdjudications/resources/v1/client/Client.js +15 -12
- package/api/resources/insurancePayments/client/Client.d.ts +3 -0
- package/api/resources/insurancePayments/resources/v1/client/Client.d.ts +8 -5
- package/api/resources/insurancePayments/resources/v1/client/Client.js +29 -24
- package/api/resources/insuranceRefunds/client/Client.d.ts +3 -0
- package/api/resources/insuranceRefunds/resources/v1/client/Client.d.ts +8 -5
- package/api/resources/insuranceRefunds/resources/v1/client/Client.js +29 -24
- package/api/resources/organizationProviders/client/Client.d.ts +3 -0
- package/api/resources/organizationProviders/resources/v3/client/Client.d.ts +7 -4
- package/api/resources/organizationProviders/resources/v3/client/Client.js +23 -19
- package/api/resources/organizationServiceFacilities/client/Client.d.ts +3 -0
- package/api/resources/organizationServiceFacilities/resources/v2/client/Client.d.ts +8 -5
- package/api/resources/organizationServiceFacilities/resources/v2/client/Client.js +32 -23
- package/api/resources/patientPayments/client/Client.d.ts +3 -0
- package/api/resources/patientPayments/resources/v4/client/Client.d.ts +8 -5
- package/api/resources/patientPayments/resources/v4/client/Client.js +29 -24
- package/api/resources/patientRefunds/client/Client.d.ts +3 -0
- package/api/resources/patientRefunds/resources/v1/client/Client.d.ts +8 -5
- package/api/resources/patientRefunds/resources/v1/client/Client.js +29 -24
- package/api/resources/payers/client/Client.d.ts +3 -0
- package/api/resources/payers/resources/v3/client/Client.d.ts +5 -2
- package/api/resources/payers/resources/v3/client/Client.js +9 -7
- package/api/resources/preEncounter/client/Client.d.ts +3 -0
- package/api/resources/preEncounter/resources/coverages/client/Client.d.ts +3 -0
- package/api/resources/preEncounter/resources/coverages/resources/v1/client/Client.d.ts +3 -0
- package/api/resources/preEncounter/resources/coverages/resources/v1/resources/coverages/client/Client.d.ts +9 -6
- package/api/resources/preEncounter/resources/coverages/resources/v1/resources/coverages/client/Client.js +31 -25
- package/api/resources/preEncounter/resources/patients/client/Client.d.ts +3 -0
- package/api/resources/preEncounter/resources/patients/resources/v1/client/Client.d.ts +3 -0
- package/api/resources/preEncounter/resources/patients/resources/v1/resources/patients/client/Client.d.ts +10 -7
- package/api/resources/preEncounter/resources/patients/resources/v1/resources/patients/client/Client.js +38 -31
- package/api/resources/serviceFacility/client/Client.d.ts +4 -1
- package/api/resources/serviceFacility/client/Client.js +6 -7
- package/api/resources/tasks/client/Client.d.ts +3 -0
- package/api/resources/tasks/resources/v3/client/Client.d.ts +8 -5
- package/api/resources/tasks/resources/v3/client/Client.js +28 -23
- package/api/resources/writeOffs/client/Client.d.ts +3 -0
- package/api/resources/writeOffs/resources/v1/client/Client.d.ts +7 -4
- package/api/resources/writeOffs/resources/v1/client/Client.js +19 -15
- package/core/fetcher/Fetcher.d.ts +3 -0
- package/core/fetcher/Fetcher.js +22 -153
- package/core/fetcher/createRequestUrl.d.ts +1 -0
- package/core/fetcher/createRequestUrl.js +13 -0
- package/core/fetcher/getFetchFn.d.ts +4 -0
- package/core/fetcher/getFetchFn.js +59 -0
- package/core/fetcher/getRequestBody.d.ts +7 -0
- package/core/fetcher/getRequestBody.js +23 -0
- package/core/fetcher/getResponseBody.d.ts +1 -0
- package/core/fetcher/getResponseBody.js +48 -0
- package/core/fetcher/makeRequest.d.ts +1 -0
- package/core/fetcher/makeRequest.js +42 -0
- package/core/fetcher/requestWithRetries.d.ts +1 -0
- package/core/fetcher/requestWithRetries.js +32 -0
- package/core/fetcher/signals.d.ts +12 -0
- package/core/fetcher/signals.js +37 -0
- package/core/runtime/runtime.d.ts +2 -1
- package/core/runtime/runtime.js +12 -1
- package/core/schemas/Schema.d.ts +7 -4
- package/core/schemas/builders/lazy/lazy.d.ts +2 -2
- package/core/schemas/builders/lazy/lazy.js +8 -19
- package/core/schemas/builders/lazy/lazyObject.js +1 -10
- package/core/schemas/builders/list/list.js +31 -44
- package/core/schemas/builders/object/object.js +90 -111
- package/core/schemas/builders/object/types.d.ts +2 -2
- package/core/schemas/builders/object-like/getObjectLikeUtils.js +3 -12
- package/core/schemas/builders/record/record.js +49 -60
- package/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +2 -2
- package/core/schemas/builders/schema-utils/getSchemaUtils.js +18 -21
- package/core/schemas/builders/set/set.js +6 -15
- package/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +21 -32
- package/core/schemas/builders/union/union.js +51 -62
- package/core/schemas/utils/maybeSkipValidation.js +3 -12
- package/dist/Client.d.ts +3 -0
- package/dist/api/resources/auth/client/Client.d.ts +3 -0
- package/dist/api/resources/auth/resources/v2/client/Client.d.ts +4 -1
- package/dist/api/resources/auth/resources/v2/client/Client.js +6 -7
- package/dist/api/resources/billingNotes/client/Client.d.ts +3 -0
- package/dist/api/resources/billingNotes/resources/v2/client/Client.d.ts +4 -1
- package/dist/api/resources/billingNotes/resources/v2/client/Client.js +5 -4
- package/dist/api/resources/contracts/client/Client.d.ts +3 -0
- package/dist/api/resources/contracts/resources/v2/client/Client.d.ts +8 -5
- package/dist/api/resources/contracts/resources/v2/client/Client.js +27 -26
- package/dist/api/resources/eligibility/client/Client.d.ts +3 -0
- package/dist/api/resources/eligibility/resources/v2/client/Client.d.ts +6 -3
- package/dist/api/resources/eligibility/resources/v2/client/Client.js +12 -9
- package/dist/api/resources/encounters/client/Client.d.ts +3 -0
- package/dist/api/resources/encounters/resources/v4/client/Client.d.ts +7 -19
- package/dist/api/resources/encounters/resources/v4/client/Client.js +22 -37
- package/dist/api/resources/encounters/resources/v4/client/requests/EncounterCreate.d.ts +0 -21
- package/dist/api/resources/encounters/resources/v4/types/Encounter.d.ts +0 -1
- package/dist/api/resources/expectedNetworkStatus/client/Client.d.ts +3 -0
- package/dist/api/resources/expectedNetworkStatus/resources/v1/client/Client.d.ts +4 -1
- package/dist/api/resources/expectedNetworkStatus/resources/v1/client/Client.js +5 -4
- package/dist/api/resources/expectedNetworkStatus/resources/v2/client/Client.d.ts +5 -2
- package/dist/api/resources/expectedNetworkStatus/resources/v2/client/Client.js +13 -11
- package/dist/api/resources/exports/client/Client.d.ts +3 -0
- package/dist/api/resources/exports/resources/v3/client/Client.d.ts +4 -1
- package/dist/api/resources/exports/resources/v3/client/Client.js +5 -4
- package/dist/api/resources/externalPaymentAccountConfig/client/Client.d.ts +3 -0
- package/dist/api/resources/externalPaymentAccountConfig/resources/v1/client/Client.d.ts +4 -1
- package/dist/api/resources/externalPaymentAccountConfig/resources/v1/client/Client.js +4 -3
- package/dist/api/resources/feeSchedules/client/Client.d.ts +3 -0
- package/dist/api/resources/feeSchedules/resources/v3/client/Client.d.ts +13 -10
- package/dist/api/resources/feeSchedules/resources/v3/client/Client.js +52 -44
- package/dist/api/resources/guarantor/client/Client.d.ts +3 -0
- package/dist/api/resources/guarantor/resources/v1/client/Client.d.ts +6 -3
- package/dist/api/resources/guarantor/resources/v1/client/Client.js +18 -19
- package/dist/api/resources/importInvoice/client/Client.d.ts +3 -0
- package/dist/api/resources/importInvoice/resources/v1/client/Client.d.ts +7 -4
- package/dist/api/resources/importInvoice/resources/v1/client/Client.js +22 -18
- package/dist/api/resources/insuranceAdjudications/client/Client.d.ts +3 -0
- package/dist/api/resources/insuranceAdjudications/resources/v1/client/Client.d.ts +6 -3
- package/dist/api/resources/insuranceAdjudications/resources/v1/client/Client.js +15 -12
- package/dist/api/resources/insurancePayments/client/Client.d.ts +3 -0
- package/dist/api/resources/insurancePayments/resources/v1/client/Client.d.ts +8 -5
- package/dist/api/resources/insurancePayments/resources/v1/client/Client.js +29 -24
- package/dist/api/resources/insuranceRefunds/client/Client.d.ts +3 -0
- package/dist/api/resources/insuranceRefunds/resources/v1/client/Client.d.ts +8 -5
- package/dist/api/resources/insuranceRefunds/resources/v1/client/Client.js +29 -24
- package/dist/api/resources/organizationProviders/client/Client.d.ts +3 -0
- package/dist/api/resources/organizationProviders/resources/v3/client/Client.d.ts +7 -4
- package/dist/api/resources/organizationProviders/resources/v3/client/Client.js +23 -19
- package/dist/api/resources/organizationServiceFacilities/client/Client.d.ts +3 -0
- package/dist/api/resources/organizationServiceFacilities/resources/v2/client/Client.d.ts +8 -5
- package/dist/api/resources/organizationServiceFacilities/resources/v2/client/Client.js +32 -23
- package/dist/api/resources/patientPayments/client/Client.d.ts +3 -0
- package/dist/api/resources/patientPayments/resources/v4/client/Client.d.ts +8 -5
- package/dist/api/resources/patientPayments/resources/v4/client/Client.js +29 -24
- package/dist/api/resources/patientRefunds/client/Client.d.ts +3 -0
- package/dist/api/resources/patientRefunds/resources/v1/client/Client.d.ts +8 -5
- package/dist/api/resources/patientRefunds/resources/v1/client/Client.js +29 -24
- package/dist/api/resources/payers/client/Client.d.ts +3 -0
- package/dist/api/resources/payers/resources/v3/client/Client.d.ts +5 -2
- package/dist/api/resources/payers/resources/v3/client/Client.js +9 -7
- package/dist/api/resources/preEncounter/client/Client.d.ts +3 -0
- package/dist/api/resources/preEncounter/resources/coverages/client/Client.d.ts +3 -0
- package/dist/api/resources/preEncounter/resources/coverages/resources/v1/client/Client.d.ts +3 -0
- package/dist/api/resources/preEncounter/resources/coverages/resources/v1/resources/coverages/client/Client.d.ts +9 -6
- package/dist/api/resources/preEncounter/resources/coverages/resources/v1/resources/coverages/client/Client.js +31 -25
- package/dist/api/resources/preEncounter/resources/patients/client/Client.d.ts +3 -0
- package/dist/api/resources/preEncounter/resources/patients/resources/v1/client/Client.d.ts +3 -0
- package/dist/api/resources/preEncounter/resources/patients/resources/v1/resources/patients/client/Client.d.ts +10 -7
- package/dist/api/resources/preEncounter/resources/patients/resources/v1/resources/patients/client/Client.js +38 -31
- package/dist/api/resources/serviceFacility/client/Client.d.ts +4 -1
- package/dist/api/resources/serviceFacility/client/Client.js +6 -7
- package/dist/api/resources/tasks/client/Client.d.ts +3 -0
- package/dist/api/resources/tasks/resources/v3/client/Client.d.ts +8 -5
- package/dist/api/resources/tasks/resources/v3/client/Client.js +28 -23
- package/dist/api/resources/writeOffs/client/Client.d.ts +3 -0
- package/dist/api/resources/writeOffs/resources/v1/client/Client.d.ts +7 -4
- package/dist/api/resources/writeOffs/resources/v1/client/Client.js +19 -15
- package/dist/core/fetcher/Fetcher.d.ts +3 -0
- package/dist/core/fetcher/Fetcher.js +22 -153
- package/dist/core/fetcher/createRequestUrl.d.ts +1 -0
- package/dist/core/fetcher/createRequestUrl.js +13 -0
- package/dist/core/fetcher/getFetchFn.d.ts +4 -0
- package/dist/core/fetcher/getFetchFn.js +59 -0
- package/dist/core/fetcher/getRequestBody.d.ts +7 -0
- package/dist/core/fetcher/getRequestBody.js +23 -0
- package/dist/core/fetcher/getResponseBody.d.ts +1 -0
- package/dist/core/fetcher/getResponseBody.js +48 -0
- package/dist/core/fetcher/makeRequest.d.ts +1 -0
- package/dist/core/fetcher/makeRequest.js +42 -0
- package/dist/core/fetcher/requestWithRetries.d.ts +1 -0
- package/dist/core/fetcher/requestWithRetries.js +32 -0
- package/dist/core/fetcher/signals.d.ts +12 -0
- package/dist/core/fetcher/signals.js +37 -0
- package/dist/core/runtime/runtime.d.ts +2 -1
- package/dist/core/runtime/runtime.js +12 -1
- package/dist/core/schemas/Schema.d.ts +7 -4
- package/dist/core/schemas/builders/lazy/lazy.d.ts +2 -2
- package/dist/core/schemas/builders/lazy/lazy.js +8 -19
- package/dist/core/schemas/builders/lazy/lazyObject.js +1 -10
- package/dist/core/schemas/builders/list/list.js +31 -44
- package/dist/core/schemas/builders/object/object.js +90 -111
- package/dist/core/schemas/builders/object/types.d.ts +2 -2
- package/dist/core/schemas/builders/object-like/getObjectLikeUtils.js +3 -12
- package/dist/core/schemas/builders/record/record.js +49 -60
- package/dist/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +2 -2
- package/dist/core/schemas/builders/schema-utils/getSchemaUtils.js +18 -21
- package/dist/core/schemas/builders/set/set.js +6 -15
- package/dist/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +21 -32
- package/dist/core/schemas/builders/union/union.js +51 -62
- package/dist/core/schemas/utils/maybeSkipValidation.js +3 -12
- package/dist/serialization/resources/encounters/resources/v4/client/requests/EncounterCreate.d.ts +0 -2
- package/dist/serialization/resources/encounters/resources/v4/client/requests/EncounterCreate.js +0 -2
- package/dist/serialization/resources/encounters/resources/v4/types/Encounter.d.ts +0 -1
- package/dist/serialization/resources/encounters/resources/v4/types/Encounter.js +0 -1
- package/package.json +7 -2
- package/reference.md +7177 -0
- package/serialization/resources/encounters/resources/v4/client/requests/EncounterCreate.d.ts +0 -2
- package/serialization/resources/encounters/resources/v4/client/requests/EncounterCreate.js +0 -2
- package/serialization/resources/encounters/resources/v4/types/Encounter.d.ts +0 -1
- 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
|
-
|
|
1
|
+
# Candid TypeScript Library
|
|
2
2
|
|
|
3
|
-
[](https://github.com/fern-api/fern)
|
|
4
|
+
[](https://www.npmjs.com/package/candidhealth)
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
The Candid TypeScript library provides convenient access to the Candid API from TypeScript.
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
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
|
|
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
|
|
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.
|
|
90
|
+
"X-Fern-SDK-Version": "0.24.1",
|
|
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
|
-
|
|
96
|
-
|
|
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:
|
|
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:
|
|
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
|
|
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
|
|
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.
|
|
72
|
+
"X-Fern-SDK-Version": "0.24.1",
|
|
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
|
-
|
|
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:
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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(
|
|
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.
|
|
69
|
+
"X-Fern-SDK-Version": "0.24.1",
|
|
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:
|
|
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:
|
|
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
|
|
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.
|
|
174
|
+
"X-Fern-SDK-Version": "0.24.1",
|
|
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:
|
|
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
|
|
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.
|
|
242
|
+
"X-Fern-SDK-Version": "0.24.1",
|
|
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
|
-
|
|
246
|
-
|
|
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:
|
|
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
|
|
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(
|
|
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.
|
|
288
|
+
"X-Fern-SDK-Version": "0.24.1",
|
|
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:
|
|
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
|
|
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(
|
|
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.
|
|
376
|
+
"X-Fern-SDK-Version": "0.24.1",
|
|
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
|
-
|
|
380
|
-
|
|
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:
|
|
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:
|
|
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
|
|
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
|
|
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
|
|
95
|
+
* await client.eligibility.v2.submitEligibilityCheckAvailityPost({
|
|
93
96
|
* "key": "value"
|
|
94
97
|
* })
|
|
95
98
|
*/
|