@arbol-ai/sdk 1.20261017.200040 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +55 -5
- package/dist/account/connections/client.d.ts +25 -2
- package/dist/axxa/authorizations/client.d.ts +54 -0
- package/dist/axxa/authorizations/client.js +18 -0
- package/dist/axxa/authorizations/index.d.ts +4 -0
- package/dist/axxa/authorizations/index.js +4 -0
- package/dist/axxa/client.d.ts +19 -0
- package/dist/axxa/client.js +30 -0
- package/dist/axxa/connections/client.d.ts +104 -0
- package/dist/axxa/connections/client.js +42 -0
- package/dist/axxa/connections/index.d.ts +4 -0
- package/dist/axxa/connections/index.js +4 -0
- package/dist/axxa/eligibility/client.d.ts +44 -0
- package/dist/axxa/eligibility/client.js +18 -0
- package/dist/axxa/eligibility/index.d.ts +4 -0
- package/dist/axxa/eligibility/index.js +4 -0
- package/dist/axxa/index.d.ts +5 -0
- package/dist/axxa/index.js +4 -0
- package/dist/axxa/models.d.ts +168 -0
- package/dist/axxa/models.js +3 -0
- package/dist/axxa/provider/client.d.ts +32 -0
- package/dist/axxa/provider/client.js +18 -0
- package/dist/axxa/provider/index.d.ts +4 -0
- package/dist/axxa/provider/index.js +4 -0
- package/dist/client.d.ts +6 -0
- package/dist/client.js +15 -0
- package/dist/gmedic/agendaServices/client.d.ts +43 -0
- package/dist/gmedic/agendaServices/client.js +18 -0
- package/dist/gmedic/agendaServices/index.d.ts +5 -0
- package/dist/gmedic/agendaServices/index.js +4 -0
- package/dist/gmedic/agendaServices/models.d.ts +28 -0
- package/dist/gmedic/agendaServices/models.js +3 -0
- package/dist/gmedic/agendas/client.d.ts +45 -0
- package/dist/gmedic/agendas/client.js +18 -0
- package/dist/gmedic/agendas/index.d.ts +5 -0
- package/dist/gmedic/agendas/index.js +4 -0
- package/dist/gmedic/agendas/models.d.ts +32 -0
- package/dist/gmedic/agendas/models.js +3 -0
- package/dist/gmedic/appointments/client.d.ts +279 -0
- package/dist/gmedic/appointments/client.js +35 -0
- package/dist/gmedic/appointments/index.d.ts +5 -0
- package/dist/gmedic/appointments/index.js +4 -0
- package/dist/gmedic/appointments/models.d.ts +97 -0
- package/dist/gmedic/appointments/models.js +6 -0
- package/dist/gmedic/availability/client.d.ts +45 -0
- package/dist/gmedic/availability/client.js +18 -0
- package/dist/gmedic/availability/index.d.ts +5 -0
- package/dist/gmedic/availability/index.js +4 -0
- package/dist/gmedic/availability/models.d.ts +30 -0
- package/dist/gmedic/availability/models.js +3 -0
- package/dist/gmedic/availableDays/client.d.ts +44 -0
- package/dist/gmedic/availableDays/client.js +18 -0
- package/dist/gmedic/availableDays/index.d.ts +5 -0
- package/dist/gmedic/availableDays/index.js +4 -0
- package/dist/gmedic/availableDays/models.d.ts +15 -0
- package/dist/gmedic/availableDays/models.js +3 -0
- package/dist/gmedic/branchOffices/client.d.ts +43 -0
- package/dist/gmedic/branchOffices/client.js +18 -0
- package/dist/gmedic/branchOffices/index.d.ts +5 -0
- package/dist/gmedic/branchOffices/index.js +4 -0
- package/dist/gmedic/branchOffices/models.d.ts +51 -0
- package/dist/gmedic/branchOffices/models.js +3 -0
- package/dist/gmedic/client.d.ts +43 -0
- package/dist/gmedic/client.js +90 -0
- package/dist/gmedic/connections/client.d.ts +101 -0
- package/dist/gmedic/connections/client.js +42 -0
- package/dist/gmedic/connections/index.d.ts +4 -0
- package/dist/gmedic/connections/index.js +4 -0
- package/dist/gmedic/dictionaryEntries/client.d.ts +45 -0
- package/dist/gmedic/dictionaryEntries/client.js +18 -0
- package/dist/gmedic/dictionaryEntries/index.d.ts +5 -0
- package/dist/gmedic/dictionaryEntries/index.js +4 -0
- package/dist/gmedic/dictionaryEntries/models.d.ts +20 -0
- package/dist/gmedic/dictionaryEntries/models.js +3 -0
- package/dist/gmedic/healthPartners/client.d.ts +45 -0
- package/dist/gmedic/healthPartners/client.js +18 -0
- package/dist/gmedic/healthPartners/index.d.ts +5 -0
- package/dist/gmedic/healthPartners/index.js +4 -0
- package/dist/gmedic/healthPartners/models.d.ts +22 -0
- package/dist/gmedic/healthPartners/models.js +3 -0
- package/dist/gmedic/healthPromotionEntities/client.d.ts +45 -0
- package/dist/gmedic/healthPromotionEntities/client.js +18 -0
- package/dist/gmedic/healthPromotionEntities/index.d.ts +5 -0
- package/dist/gmedic/healthPromotionEntities/index.js +4 -0
- package/dist/gmedic/healthPromotionEntities/models.d.ts +19 -0
- package/dist/gmedic/healthPromotionEntities/models.js +3 -0
- package/dist/gmedic/index.d.ts +5 -0
- package/dist/gmedic/index.js +4 -0
- package/dist/gmedic/laboralRiskManagers/client.d.ts +45 -0
- package/dist/gmedic/laboralRiskManagers/client.js +18 -0
- package/dist/gmedic/laboralRiskManagers/index.d.ts +5 -0
- package/dist/gmedic/laboralRiskManagers/index.js +4 -0
- package/dist/gmedic/laboralRiskManagers/models.d.ts +19 -0
- package/dist/gmedic/laboralRiskManagers/models.js +3 -0
- package/dist/gmedic/models.d.ts +126 -0
- package/dist/gmedic/models.js +3 -0
- package/dist/gmedic/occupations/client.d.ts +45 -0
- package/dist/gmedic/occupations/client.js +18 -0
- package/dist/gmedic/occupations/index.d.ts +5 -0
- package/dist/gmedic/occupations/index.js +4 -0
- package/dist/gmedic/occupations/models.d.ts +20 -0
- package/dist/gmedic/occupations/models.js +3 -0
- package/dist/gmedic/patientNotes/client.d.ts +104 -0
- package/dist/gmedic/patientNotes/client.js +34 -0
- package/dist/gmedic/patientNotes/index.d.ts +5 -0
- package/dist/gmedic/patientNotes/index.js +4 -0
- package/dist/gmedic/patientNotes/models.d.ts +23 -0
- package/dist/gmedic/patientNotes/models.js +3 -0
- package/dist/gmedic/patients/client.d.ts +408 -0
- package/dist/gmedic/patients/client.js +34 -0
- package/dist/gmedic/patients/index.d.ts +5 -0
- package/dist/gmedic/patients/index.js +4 -0
- package/dist/gmedic/patients/models.d.ts +135 -0
- package/dist/gmedic/patients/models.js +3 -0
- package/dist/gmedic/services/client.d.ts +43 -0
- package/dist/gmedic/services/client.js +18 -0
- package/dist/gmedic/services/index.d.ts +5 -0
- package/dist/gmedic/services/index.js +4 -0
- package/dist/gmedic/services/models.d.ts +28 -0
- package/dist/gmedic/services/models.js +3 -0
- package/dist/gmedic/sessionPackages/client.d.ts +101 -0
- package/dist/gmedic/sessionPackages/client.js +26 -0
- package/dist/gmedic/sessionPackages/index.d.ts +5 -0
- package/dist/gmedic/sessionPackages/index.js +4 -0
- package/dist/gmedic/sessionPackages/models.d.ts +43 -0
- package/dist/gmedic/sessionPackages/models.js +3 -0
- package/dist/index.d.ts +1 -1
- package/dist/models.d.ts +22 -0
- package/dist/models.js +7 -1
- package/dist/nuevaEps/affiliations/client.d.ts +51 -0
- package/dist/nuevaEps/affiliations/client.js +18 -0
- package/dist/nuevaEps/affiliations/index.d.ts +4 -0
- package/dist/nuevaEps/affiliations/index.js +4 -0
- package/dist/nuevaEps/client.d.ts +15 -0
- package/dist/nuevaEps/client.js +20 -0
- package/dist/nuevaEps/connections/client.d.ts +111 -0
- package/dist/nuevaEps/connections/client.js +42 -0
- package/dist/nuevaEps/connections/index.d.ts +4 -0
- package/dist/nuevaEps/connections/index.js +4 -0
- package/dist/nuevaEps/index.d.ts +5 -0
- package/dist/nuevaEps/index.js +4 -0
- package/dist/nuevaEps/models.d.ts +154 -0
- package/dist/nuevaEps/models.js +3 -0
- package/package.json +10 -3
package/README.md
CHANGED
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
The Arbol API for TypeScript and JavaScript, generated by
|
|
4
4
|
[Cloudflare Forge](https://github.com/cloudflare/forge) from the platform's public OpenAPI,
|
|
5
5
|
[`https://api.getarbol.com/openapi.json`](https://api.getarbol.com/openapi.json). Everything in `src/`
|
|
6
|
-
is Forge's TypeScript output, unedited, and
|
|
7
|
-
from (`
|
|
6
|
+
is Forge's TypeScript output, unedited. Versions are semver, and each one records the OpenAPI it was
|
|
7
|
+
generated from: `npm view @arbol-ai/sdk@<version> arbol.openapi` prints its `release` (`info.version`)
|
|
8
|
+
and content hash (`sha256`).
|
|
8
9
|
|
|
9
10
|
```sh
|
|
10
11
|
npm install @arbol-ai/sdk
|
|
@@ -56,14 +57,63 @@ The server authorizes every call: a method in the client is not a grant.
|
|
|
56
57
|
bun install
|
|
57
58
|
bun run forge # build the pinned Cloudflare Forge with cargo into .forge/ (once; needs Rust)
|
|
58
59
|
bun run openapi # download https://api.getarbol.com/openapi.json
|
|
59
|
-
bun run generate # src/ from openapi.json with `forge --target ts`;
|
|
60
|
+
bun run generate # src/ from openapi.json with `forge --target ts`; its release and hash in arbol.openapi
|
|
61
|
+
bun run hash # the OpenAPI's content hash (see Releases)
|
|
60
62
|
bun run verify # typecheck and build dist/
|
|
61
63
|
```
|
|
62
64
|
|
|
63
|
-
`openapi.json` is downloaded at generation time and not committed
|
|
64
|
-
OpenAPI
|
|
65
|
+
`openapi.json` is downloaded at generation time and not committed. `package.json`'s `arbol.openapi`
|
|
66
|
+
records the OpenAPI `src/` was generated from, its `info.version` as `release` and its content hash as
|
|
67
|
+
`sha256`; `version` and `arbol` are release metadata the workflows set. Forge is pinned to its commit
|
|
65
68
|
`7f86447210b7bea3779bfdab3cd5655eade0eadb` (0.1.0) in the `forge` script.
|
|
66
69
|
|
|
70
|
+
## Releases
|
|
71
|
+
|
|
72
|
+
Versions are semver, independent of the OpenAPI's release number. The 1.x versions (`1.YYYYMMDD.n`)
|
|
73
|
+
were the OpenAPI's date releases; 2.x starts at 2.1.0.
|
|
74
|
+
|
|
75
|
+
Releases of a new OpenAPI are automatic, from the API down to the CLI:
|
|
76
|
+
|
|
77
|
+
1. **Gateway.** When the Arbol API ships an OpenAPI release, the gateway sends this repository a
|
|
78
|
+
`repository_dispatch` `openapi-release` with `{ "version": "<release>" }`.
|
|
79
|
+
2. **SDK (this repository).** [Generate](.github/workflows/generate.yml) runs on that dispatch, every
|
|
80
|
+
six hours, and by hand. It downloads the OpenAPI (waiting until the API serves the announced release)
|
|
81
|
+
and hashes its content. When the hash differs from `arbol.openapi.sha256` in `package.json`, it
|
|
82
|
+
regenerates `src/` with Forge, records the OpenAPI in `arbol.openapi`, and takes the highest version
|
|
83
|
+
on npm with the minor raised and the patch at 0 (2.1.0, 2.2.0, 2.3.0, …). It verifies the result,
|
|
84
|
+
commits `Release <version>` to `main` as Arbol, and publishes `@arbol-ai/sdk` to npm with
|
|
85
|
+
[Publish](.github/workflows/publish.yml), with a provenance statement.
|
|
86
|
+
3. **CLI.** After publishing, Publish sends
|
|
87
|
+
[project-arbol-cli](https://github.com/getarbol/project-arbol-cli) a `repository_dispatch`
|
|
88
|
+
`sdk-release` with `{ "version": "<published version>", "openapi": { "release": "…", "sha256": "…" } }`,
|
|
89
|
+
the published `version` and `arbol.openapi`, and the CLI releases itself on it.
|
|
90
|
+
|
|
91
|
+
The hash ([`scripts/release.ts`](scripts/release.ts)) is the SHA-256 hex of the OpenAPI's canonical
|
|
92
|
+
JSON (object keys sorted recursively, arrays in order, no whitespace) with `info.version` removed. A new
|
|
93
|
+
release number with an identical API hashes the same, so Generate commits, publishes, and announces
|
|
94
|
+
nothing. A version on `main` that is not on npm yet, such as one a failed run left behind, is published
|
|
95
|
+
by the next run.
|
|
96
|
+
|
|
97
|
+
Changes to the SDK itself, such as a new Forge pin, are released by hand: commit them to `main`
|
|
98
|
+
(regenerated with `bun run generate` when they change `src/`), then run Publish on `main` with `bump`
|
|
99
|
+
`patch` (the default), `minor` or `major`:
|
|
100
|
+
|
|
101
|
+
```sh
|
|
102
|
+
gh workflow run publish.yml --repo getarbol/project-arbol-sdk-js --ref main -f bump=patch
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
It raises that part of the highest version on npm (while no 2.x version is published, the result is
|
|
106
|
+
2.1.0 whatever the bump), commits `Release <version>` to `main`, publishes it, and announces it to the
|
|
107
|
+
CLI like Generate. It refuses when `main`'s version is not on npm yet (run Generate, which publishes it),
|
|
108
|
+
and when nothing that goes into the package (`src/`, `package.json`, `tsconfig.json`, `bun.lock`,
|
|
109
|
+
`README.md`, `LICENSE`) changed since the commit that released `main`'s version, so the same SDK is
|
|
110
|
+
never published twice. A manual release and Generate wait for each other.
|
|
111
|
+
|
|
112
|
+
Generate and Publish push and dispatch as the Arbol Bot GitHub App, so their commits to `main` run
|
|
113
|
+
[Verify](.github/workflows/verify.yml). They need the organization variable `ARBOL_BOT_APP_ID`, the
|
|
114
|
+
organization secret `ARBOL_BOT_PRIVATE_KEY`, and the App installed with contents write access to this
|
|
115
|
+
repository and project-arbol-cli. npm publishing uses the organization secret `NPM_TOKEN`.
|
|
116
|
+
|
|
67
117
|
## License
|
|
68
118
|
|
|
69
119
|
[Apache License 2.0](LICENSE)
|
|
@@ -11,8 +11,8 @@ export interface Client {
|
|
|
11
11
|
/**
|
|
12
12
|
* Add a connection
|
|
13
13
|
*
|
|
14
|
-
* Add a connection.
|
|
15
|
-
* credentials before anything is sealed; a refused login answers
|
|
14
|
+
* Add a connection. Provider connections: the owner verifies credentials once
|
|
15
|
+
* with the credentials before anything is sealed; a refused login answers
|
|
16
16
|
* LOGIN_REJECTED with each login's result, and one that was not refused stays
|
|
17
17
|
* saved. A SURA account that sees several institutions answers
|
|
18
18
|
* INSTITUTION_REQUIRED with them: send the same request again with
|
|
@@ -68,6 +68,26 @@ export type CreateRequest = {
|
|
|
68
68
|
name: string;
|
|
69
69
|
password: string;
|
|
70
70
|
username: string;
|
|
71
|
+
} | {
|
|
72
|
+
documentType: string;
|
|
73
|
+
integration: "axxa";
|
|
74
|
+
kind: "arbol";
|
|
75
|
+
name: string;
|
|
76
|
+
password: string;
|
|
77
|
+
providerCode: string;
|
|
78
|
+
username: string;
|
|
79
|
+
} | {
|
|
80
|
+
documentType: string;
|
|
81
|
+
integration: "nueva-eps";
|
|
82
|
+
kind: "arbol";
|
|
83
|
+
name: string;
|
|
84
|
+
password: string;
|
|
85
|
+
username: string;
|
|
86
|
+
} | {
|
|
87
|
+
apiToken: string;
|
|
88
|
+
integration: "gmedic";
|
|
89
|
+
kind: "arbol";
|
|
90
|
+
name: string;
|
|
71
91
|
} | {
|
|
72
92
|
authHeader?: string;
|
|
73
93
|
fileArgument?: string;
|
|
@@ -133,12 +153,14 @@ export interface UpdateRequest {
|
|
|
133
153
|
* platform.
|
|
134
154
|
*/
|
|
135
155
|
id: string;
|
|
156
|
+
apiToken?: string;
|
|
136
157
|
authHeader?: string | null;
|
|
137
158
|
/**
|
|
138
159
|
* The clinic whose SIIPS the login belongs to, as visoft.clinics.list names
|
|
139
160
|
* it.
|
|
140
161
|
*/
|
|
141
162
|
clinicId?: string;
|
|
163
|
+
documentType?: string;
|
|
142
164
|
/**
|
|
143
165
|
* false disables the connection (its owner refuses it); true enables it
|
|
144
166
|
* again.
|
|
@@ -163,6 +185,7 @@ export interface UpdateRequest {
|
|
|
163
185
|
* Its password, exactly as typed.
|
|
164
186
|
*/
|
|
165
187
|
password?: string;
|
|
188
|
+
providerCode?: string;
|
|
166
189
|
/**
|
|
167
190
|
* SURA: the logins to remove; at least one login stays.
|
|
168
191
|
*/
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { type BaseClientOptions, type RequestOptions, Transport } from "../../_/index.js";
|
|
2
|
+
import type { ResponseMetadata } from "../../models.js";
|
|
3
|
+
export interface ClientOptions extends BaseClientOptions {
|
|
4
|
+
/**
|
|
5
|
+
* The URL the paths of the API are relative to.
|
|
6
|
+
*/
|
|
7
|
+
baseUrl: string;
|
|
8
|
+
}
|
|
9
|
+
export interface Client {
|
|
10
|
+
/**
|
|
11
|
+
* Look up medical authorizations
|
|
12
|
+
*
|
|
13
|
+
* Read authorizations for the supplied beneficiary document. Only a
|
|
14
|
+
* successful empty array means no matches; provider errors do not establish
|
|
15
|
+
* whether authorizations exist.
|
|
16
|
+
*/
|
|
17
|
+
lookup(request: LookupRequest, options?: RequestOptions): Promise<LookupResponse>;
|
|
18
|
+
}
|
|
19
|
+
export declare function createClient(options: ClientOptions): Client;
|
|
20
|
+
export declare function bind(transport: Transport): Client;
|
|
21
|
+
export interface LookupRequest {
|
|
22
|
+
connectionId?: string;
|
|
23
|
+
documentNumber: string;
|
|
24
|
+
}
|
|
25
|
+
export interface LookupResponse {
|
|
26
|
+
/**
|
|
27
|
+
* Only an empty authorizations array confirms no matches. Provider failures
|
|
28
|
+
* are errors.
|
|
29
|
+
*/
|
|
30
|
+
data: {
|
|
31
|
+
authorizations: {
|
|
32
|
+
authorizationNumber: string;
|
|
33
|
+
authorizedAt: string;
|
|
34
|
+
diagnosis: {
|
|
35
|
+
code: string;
|
|
36
|
+
description: string;
|
|
37
|
+
};
|
|
38
|
+
product: string;
|
|
39
|
+
requestNumber: string;
|
|
40
|
+
requestedAt: string;
|
|
41
|
+
services: {
|
|
42
|
+
code: string;
|
|
43
|
+
description: string;
|
|
44
|
+
}[];
|
|
45
|
+
}[];
|
|
46
|
+
beneficiary: {
|
|
47
|
+
documentNumber: string;
|
|
48
|
+
name: string;
|
|
49
|
+
} | null;
|
|
50
|
+
};
|
|
51
|
+
error: null;
|
|
52
|
+
metadata: ResponseMetadata;
|
|
53
|
+
success: true;
|
|
54
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// Code generated by forge. DO NOT EDIT.
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
import { Transport, } from "../../_/index.js";
|
|
4
|
+
export function createClient(options) {
|
|
5
|
+
return bind(new Transport(options));
|
|
6
|
+
}
|
|
7
|
+
export function bind(transport) {
|
|
8
|
+
return {
|
|
9
|
+
lookup: (request, options) => transport.send(LookupOperation, request, options),
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
const LookupOperation = {
|
|
13
|
+
method: "POST",
|
|
14
|
+
route: "/v1/axxa/authorizations/lookup",
|
|
15
|
+
body: "flat",
|
|
16
|
+
response: null,
|
|
17
|
+
errors: { "400": true, "401": true, "403": true, "404": true, "405": true, "409": true, "413": true, "415": true, "428": true, "429": true, "500": true, "502": true, "503": true, "504": true },
|
|
18
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type BaseClientOptions, Transport } from "../_/index.js";
|
|
2
|
+
import { type Client as AuthorizationsClient } from "./authorizations/client.js";
|
|
3
|
+
import { type Client as ConnectionsClient } from "./connections/client.js";
|
|
4
|
+
import { type Client as EligibilityClient } from "./eligibility/client.js";
|
|
5
|
+
import { type Client as ProviderClient } from "./provider/client.js";
|
|
6
|
+
export interface ClientOptions extends BaseClientOptions {
|
|
7
|
+
/**
|
|
8
|
+
* The URL the paths of the API are relative to.
|
|
9
|
+
*/
|
|
10
|
+
baseUrl: string;
|
|
11
|
+
}
|
|
12
|
+
export interface Client {
|
|
13
|
+
readonly authorizations: AuthorizationsClient;
|
|
14
|
+
readonly connections: ConnectionsClient;
|
|
15
|
+
readonly eligibility: EligibilityClient;
|
|
16
|
+
readonly provider: ProviderClient;
|
|
17
|
+
}
|
|
18
|
+
export declare function createClient(options: ClientOptions): Client;
|
|
19
|
+
export declare function bind(transport: Transport): Client;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// Code generated by forge. DO NOT EDIT.
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
import { Transport } from "../_/index.js";
|
|
4
|
+
import { bind as bindAuthorizations, } from "./authorizations/client.js";
|
|
5
|
+
import { bind as bindConnections, } from "./connections/client.js";
|
|
6
|
+
import { bind as bindEligibility, } from "./eligibility/client.js";
|
|
7
|
+
import { bind as bindProvider, } from "./provider/client.js";
|
|
8
|
+
export function createClient(options) {
|
|
9
|
+
return bind(new Transport(options));
|
|
10
|
+
}
|
|
11
|
+
export function bind(transport) {
|
|
12
|
+
let authorizationsClient;
|
|
13
|
+
let connectionsClient;
|
|
14
|
+
let eligibilityClient;
|
|
15
|
+
let providerClient;
|
|
16
|
+
return {
|
|
17
|
+
get authorizations() {
|
|
18
|
+
return (authorizationsClient ??= bindAuthorizations(transport));
|
|
19
|
+
},
|
|
20
|
+
get connections() {
|
|
21
|
+
return (connectionsClient ??= bindConnections(transport));
|
|
22
|
+
},
|
|
23
|
+
get eligibility() {
|
|
24
|
+
return (eligibilityClient ??= bindEligibility(transport));
|
|
25
|
+
},
|
|
26
|
+
get provider() {
|
|
27
|
+
return (providerClient ??= bindProvider(transport));
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { type BaseClientOptions, type RequestOptions, Transport } from "../../_/index.js";
|
|
2
|
+
import { type Connection, type ConnectionPage, type DeletedObject, type ResponseMetadata } from "../../models.js";
|
|
3
|
+
export interface ClientOptions extends BaseClientOptions {
|
|
4
|
+
/**
|
|
5
|
+
* The URL the paths of the API are relative to.
|
|
6
|
+
*/
|
|
7
|
+
baseUrl: string;
|
|
8
|
+
}
|
|
9
|
+
export interface Client {
|
|
10
|
+
/**
|
|
11
|
+
* Remove a provider connection
|
|
12
|
+
*
|
|
13
|
+
* Remove the provider-owned connection before Account retires its sealed
|
|
14
|
+
* credentials. Login cooldowns remain durable.
|
|
15
|
+
*/
|
|
16
|
+
delete(request: DeleteRequest, options?: RequestOptions): Promise<DeleteResponse>;
|
|
17
|
+
/**
|
|
18
|
+
* Get a provider connection
|
|
19
|
+
*
|
|
20
|
+
* One connection owned by the verified organization. Never a credential or a
|
|
21
|
+
* provider request.
|
|
22
|
+
*/
|
|
23
|
+
get(request: GetRequest, options?: RequestOptions): Promise<GetResponse>;
|
|
24
|
+
/**
|
|
25
|
+
* List provider connections
|
|
26
|
+
*
|
|
27
|
+
* The organization’s Account connections, without reading credentials or
|
|
28
|
+
* contacting the provider.
|
|
29
|
+
*/
|
|
30
|
+
list(request?: ListRequest, options?: RequestOptions): Promise<ListResponse>;
|
|
31
|
+
/**
|
|
32
|
+
* Verify a provider connection
|
|
33
|
+
*
|
|
34
|
+
* Verify these credentials once before Account seals them. A rejected
|
|
35
|
+
* verification changes no active credential. The durable organization-wide
|
|
36
|
+
* budget prevents replacement connections from bypassing login protection.
|
|
37
|
+
*/
|
|
38
|
+
verify(request: VerifyRequest, options?: RequestOptions): Promise<VerifyResponse>;
|
|
39
|
+
}
|
|
40
|
+
export declare function createClient(options: ClientOptions): Client;
|
|
41
|
+
export declare function bind(transport: Transport): Client;
|
|
42
|
+
export interface DeleteRequest {
|
|
43
|
+
id: string;
|
|
44
|
+
body: {
|
|
45
|
+
[key: string]: unknown;
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
export interface DeleteResponse {
|
|
49
|
+
data: DeletedObject;
|
|
50
|
+
error: null;
|
|
51
|
+
metadata: ResponseMetadata;
|
|
52
|
+
success: true;
|
|
53
|
+
}
|
|
54
|
+
export interface GetRequest {
|
|
55
|
+
id: string;
|
|
56
|
+
}
|
|
57
|
+
export interface GetResponse {
|
|
58
|
+
data: Connection;
|
|
59
|
+
error: null;
|
|
60
|
+
metadata: ResponseMetadata;
|
|
61
|
+
success: true;
|
|
62
|
+
}
|
|
63
|
+
export interface ListRequest {
|
|
64
|
+
/**
|
|
65
|
+
* Opaque cursor returned by pageInfo; omit it to request the first page.
|
|
66
|
+
*/
|
|
67
|
+
cursor?: string;
|
|
68
|
+
/**
|
|
69
|
+
* Direction to traverse the stable keyset ordering from the supplied cursor.
|
|
70
|
+
*/
|
|
71
|
+
direction?: "forward" | "backward";
|
|
72
|
+
/**
|
|
73
|
+
* Maximum items returned in one page. Defaults to 25; larger reads require
|
|
74
|
+
* another cursor.
|
|
75
|
+
*/
|
|
76
|
+
limit?: number;
|
|
77
|
+
}
|
|
78
|
+
export interface ListResponse {
|
|
79
|
+
data: ConnectionPage;
|
|
80
|
+
error: null;
|
|
81
|
+
metadata: ResponseMetadata;
|
|
82
|
+
success: true;
|
|
83
|
+
}
|
|
84
|
+
export interface VerifyRequest {
|
|
85
|
+
connectionId: string;
|
|
86
|
+
documentType: "CC" | "CE" | "NIT" | "PA" | "PT";
|
|
87
|
+
name: string;
|
|
88
|
+
password: string;
|
|
89
|
+
providerCode: string;
|
|
90
|
+
username: string;
|
|
91
|
+
}
|
|
92
|
+
export interface VerifyResponse {
|
|
93
|
+
data: {
|
|
94
|
+
stateRef: string;
|
|
95
|
+
status: "active";
|
|
96
|
+
summary: string;
|
|
97
|
+
} | {
|
|
98
|
+
errorCode: string;
|
|
99
|
+
status: "rejected";
|
|
100
|
+
};
|
|
101
|
+
error: null;
|
|
102
|
+
metadata: ResponseMetadata;
|
|
103
|
+
success: true;
|
|
104
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// Code generated by forge. DO NOT EDIT.
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
import { Transport, object, } from "../../_/index.js";
|
|
4
|
+
import { ConnectionCodec, ConnectionPageCodec, } from "../../models.js";
|
|
5
|
+
export function createClient(options) {
|
|
6
|
+
return bind(new Transport(options));
|
|
7
|
+
}
|
|
8
|
+
export function bind(transport) {
|
|
9
|
+
return {
|
|
10
|
+
delete: (request, options) => transport.send(DeleteOperation, request, options),
|
|
11
|
+
get: (request, options) => transport.send(GetOperation, request, options),
|
|
12
|
+
list: (request, options) => transport.send(ListOperation, request, options),
|
|
13
|
+
verify: (request, options) => transport.send(VerifyOperation, request, options),
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
const DeleteOperation = {
|
|
17
|
+
method: "DELETE",
|
|
18
|
+
route: "/v1/axxa/connections/{id}",
|
|
19
|
+
body: "nested",
|
|
20
|
+
response: null,
|
|
21
|
+
errors: { "400": true, "401": true, "403": true, "404": true, "405": true, "409": true, "413": true, "415": true, "428": true, "429": true, "500": true, "502": true, "503": true, "504": true },
|
|
22
|
+
};
|
|
23
|
+
const GetOperation = {
|
|
24
|
+
method: "GET",
|
|
25
|
+
route: "/v1/axxa/connections/{id}",
|
|
26
|
+
response: object([["data", null, () => ConnectionCodec]]),
|
|
27
|
+
errors: { "400": true, "401": true, "403": true, "404": true, "405": true, "409": true, "413": true, "415": true, "428": true, "429": true, "500": true, "502": true, "503": true, "504": true },
|
|
28
|
+
};
|
|
29
|
+
const ListOperation = {
|
|
30
|
+
method: "GET",
|
|
31
|
+
route: "/v1/axxa/connections",
|
|
32
|
+
query: { cursor: "cursor", direction: "direction", limit: "limit" },
|
|
33
|
+
response: object([["data", null, () => ConnectionPageCodec]]),
|
|
34
|
+
errors: { "400": true, "401": true, "403": true, "404": true, "405": true, "409": true, "413": true, "415": true, "428": true, "429": true, "500": true, "502": true, "503": true, "504": true },
|
|
35
|
+
};
|
|
36
|
+
const VerifyOperation = {
|
|
37
|
+
method: "POST",
|
|
38
|
+
route: "/v1/axxa/connections/{connectionId}/verify",
|
|
39
|
+
body: "flat",
|
|
40
|
+
response: null,
|
|
41
|
+
errors: { "400": true, "401": true, "403": true, "404": true, "405": true, "409": true, "413": true, "415": true, "428": true, "429": true, "500": true, "502": true, "503": true, "504": true },
|
|
42
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { ApiError } from "../../_/index.js";
|
|
2
|
+
export type { RequestOptions } from "../../_/index.js";
|
|
3
|
+
export { createClient } from "./client.js";
|
|
4
|
+
export type { Client, ClientOptions, DeleteRequest, DeleteResponse, GetRequest, GetResponse, ListRequest, ListResponse, VerifyRequest, VerifyResponse, } from "./client.js";
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { type BaseClientOptions, type RequestOptions, Transport } from "../../_/index.js";
|
|
2
|
+
import type { ResponseMetadata } from "../../models.js";
|
|
3
|
+
export interface ClientOptions extends BaseClientOptions {
|
|
4
|
+
/**
|
|
5
|
+
* The URL the paths of the API are relative to.
|
|
6
|
+
*/
|
|
7
|
+
baseUrl: string;
|
|
8
|
+
}
|
|
9
|
+
export interface Client {
|
|
10
|
+
/**
|
|
11
|
+
* Look up beneficiary eligibility
|
|
12
|
+
*
|
|
13
|
+
* Read the plans or affiliation validation messages for a document and
|
|
14
|
+
* service category. Plans do not establish coverage for a specific CUPS,
|
|
15
|
+
* authorization, or voucher amount.
|
|
16
|
+
*/
|
|
17
|
+
lookup(request: LookupRequest, options?: RequestOptions): Promise<LookupResponse>;
|
|
18
|
+
}
|
|
19
|
+
export declare function createClient(options: ClientOptions): Client;
|
|
20
|
+
export declare function bind(transport: Transport): Client;
|
|
21
|
+
export interface LookupRequest {
|
|
22
|
+
connectionId?: string;
|
|
23
|
+
documentNumber: string;
|
|
24
|
+
documentType: "CC" | "CE" | "TI" | "RC" | "PA";
|
|
25
|
+
serviceType: "outpatient" | "emergency" | "laboratory" | "therapy" | "radiology" | "other";
|
|
26
|
+
}
|
|
27
|
+
export interface LookupResponse {
|
|
28
|
+
/**
|
|
29
|
+
* Observed plan/validation result for this service category. This does not
|
|
30
|
+
* establish coverage for a CUPS, active authorization, or a voucher amount.
|
|
31
|
+
*/
|
|
32
|
+
data: {
|
|
33
|
+
plans: {
|
|
34
|
+
contractNumber: string;
|
|
35
|
+
name: string;
|
|
36
|
+
notice: string | null;
|
|
37
|
+
}[];
|
|
38
|
+
status: "plans_found" | "validation_required";
|
|
39
|
+
validationMessages: string[];
|
|
40
|
+
};
|
|
41
|
+
error: null;
|
|
42
|
+
metadata: ResponseMetadata;
|
|
43
|
+
success: true;
|
|
44
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// Code generated by forge. DO NOT EDIT.
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
import { Transport, } from "../../_/index.js";
|
|
4
|
+
export function createClient(options) {
|
|
5
|
+
return bind(new Transport(options));
|
|
6
|
+
}
|
|
7
|
+
export function bind(transport) {
|
|
8
|
+
return {
|
|
9
|
+
lookup: (request, options) => transport.send(LookupOperation, request, options),
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
const LookupOperation = {
|
|
13
|
+
method: "POST",
|
|
14
|
+
route: "/v1/axxa/eligibility/lookup",
|
|
15
|
+
body: "flat",
|
|
16
|
+
response: null,
|
|
17
|
+
errors: { "400": true, "401": true, "403": true, "404": true, "405": true, "409": true, "413": true, "415": true, "428": true, "429": true, "500": true, "502": true, "503": true, "504": true },
|
|
18
|
+
};
|