@arbol-ai/sdk 2.18.0 → 3.0.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.
Files changed (207) hide show
  1. package/README.md +19 -1
  2. package/dist/client.d.ts +4 -0
  3. package/dist/client.js +10 -0
  4. package/dist/index.d.ts +1 -1
  5. package/dist/models.d.ts +396 -0
  6. package/dist/models.js +5 -1
  7. package/dist/nuevaEps/affiliations/models.d.ts +6 -5
  8. package/dist/nuevaEps/connections/models.d.ts +18 -18
  9. package/dist/nuevaEps/index.d.ts +1 -1
  10. package/dist/nuevaEps/models.d.ts +16 -232
  11. package/dist/{visoft/tools → orsovision/agencies}/client.d.ts +13 -19
  12. package/dist/{visoft/tools → orsovision/agencies}/client.js +2 -2
  13. package/dist/orsovision/agencies/index.d.ts +5 -0
  14. package/dist/orsovision/agencies/models.d.ts +107 -0
  15. package/dist/orsovision/appointments/client.d.ts +39 -0
  16. package/dist/orsovision/appointments/client.js +29 -0
  17. package/dist/orsovision/appointments/index.d.ts +5 -0
  18. package/dist/orsovision/appointments/models.d.ts +206 -0
  19. package/dist/orsovision/appointments/models.js +9 -0
  20. package/dist/orsovision/availability/client.d.ts +32 -0
  21. package/dist/orsovision/availability/client.js +19 -0
  22. package/dist/orsovision/availability/index.d.ts +5 -0
  23. package/dist/orsovision/availability/models.d.ts +239 -0
  24. package/dist/orsovision/availability/models.js +15 -0
  25. package/dist/orsovision/client.d.ts +27 -0
  26. package/dist/orsovision/client.js +50 -0
  27. package/dist/orsovision/clinic/client.d.ts +34 -0
  28. package/dist/{visoft/specialtyRules → orsovision/clinic}/client.js +3 -3
  29. package/dist/orsovision/clinic/index.d.ts +5 -0
  30. package/dist/orsovision/clinic/models.d.ts +89 -0
  31. package/dist/orsovision/contracts/client.d.ts +69 -0
  32. package/dist/orsovision/contracts/client.js +18 -0
  33. package/dist/orsovision/contracts/index.d.ts +5 -0
  34. package/dist/orsovision/contracts/models.d.ts +108 -0
  35. package/dist/orsovision/index.d.ts +5 -0
  36. package/dist/orsovision/index.js +4 -0
  37. package/dist/orsovision/models.d.ts +227 -0
  38. package/dist/orsovision/patients/client.d.ts +52 -0
  39. package/dist/orsovision/patients/client.js +34 -0
  40. package/dist/orsovision/patients/index.d.ts +5 -0
  41. package/dist/orsovision/patients/models.d.ts +297 -0
  42. package/dist/orsovision/patients/models.js +3 -0
  43. package/dist/orsovision/services/client.d.ts +74 -0
  44. package/dist/orsovision/services/client.js +18 -0
  45. package/dist/orsovision/services/index.d.ts +5 -0
  46. package/dist/orsovision/services/index.js +4 -0
  47. package/dist/orsovision/services/models.d.ts +105 -0
  48. package/dist/orsovision/services/models.js +3 -0
  49. package/dist/orsovision/tools/client.d.ts +44 -0
  50. package/dist/{raiz/roles → orsovision/tools}/client.js +3 -3
  51. package/dist/orsovision/tools/index.d.ts +5 -0
  52. package/dist/orsovision/tools/index.js +4 -0
  53. package/dist/orsovision/tools/models.d.ts +101 -0
  54. package/dist/orsovision/tools/models.js +3 -0
  55. package/dist/raiz/agents/models.d.ts +1 -0
  56. package/dist/raiz/client.d.ts +0 -4
  57. package/dist/raiz/client.js +0 -10
  58. package/dist/raiz/conversations/client.d.ts +7 -3
  59. package/dist/raiz/conversations/index.d.ts +1 -1
  60. package/dist/raiz/conversations/models.d.ts +22 -0
  61. package/dist/raiz/organization/client.d.ts +40 -40
  62. package/dist/raiz/organization/client.js +10 -10
  63. package/dist/raiz/organization/index.d.ts +1 -1
  64. package/dist/raiz/reports/client.d.ts +3 -3
  65. package/dist/raiz/reports/client.js +2 -2
  66. package/dist/raiz/reports/index.d.ts +1 -1
  67. package/dist/somos/appointments/client.d.ts +40 -0
  68. package/dist/somos/appointments/client.js +29 -0
  69. package/dist/somos/appointments/index.d.ts +5 -0
  70. package/dist/somos/appointments/index.js +4 -0
  71. package/dist/somos/appointments/models.d.ts +301 -0
  72. package/dist/somos/appointments/models.js +9 -0
  73. package/dist/somos/availability/client.d.ts +33 -0
  74. package/dist/somos/availability/client.js +19 -0
  75. package/dist/somos/availability/index.d.ts +5 -0
  76. package/dist/somos/availability/index.js +4 -0
  77. package/dist/somos/availability/models.d.ts +340 -0
  78. package/dist/somos/availability/models.js +15 -0
  79. package/dist/somos/client.d.ts +29 -0
  80. package/dist/somos/client.js +55 -0
  81. package/dist/somos/clinic/client.d.ts +33 -0
  82. package/dist/somos/clinic/client.js +18 -0
  83. package/dist/somos/clinic/index.d.ts +5 -0
  84. package/dist/somos/clinic/index.js +4 -0
  85. package/dist/somos/clinic/models.d.ts +89 -0
  86. package/dist/somos/clinic/models.js +3 -0
  87. package/dist/somos/contracts/client.d.ts +74 -0
  88. package/dist/somos/contracts/client.js +18 -0
  89. package/dist/somos/contracts/index.d.ts +5 -0
  90. package/dist/somos/contracts/index.js +4 -0
  91. package/dist/somos/contracts/models.d.ts +107 -0
  92. package/dist/somos/contracts/models.js +3 -0
  93. package/dist/somos/groups/client.d.ts +67 -0
  94. package/dist/{visoft → somos}/groups/client.js +2 -2
  95. package/dist/somos/groups/index.d.ts +5 -0
  96. package/dist/somos/groups/index.js +4 -0
  97. package/dist/somos/groups/models.d.ts +117 -0
  98. package/dist/somos/groups/models.js +3 -0
  99. package/dist/somos/index.d.ts +5 -0
  100. package/dist/somos/index.js +4 -0
  101. package/dist/somos/models.d.ts +227 -0
  102. package/dist/somos/models.js +3 -0
  103. package/dist/somos/patients/client.d.ts +51 -0
  104. package/dist/somos/patients/client.js +34 -0
  105. package/dist/somos/patients/index.d.ts +5 -0
  106. package/dist/somos/patients/index.js +4 -0
  107. package/dist/somos/patients/models.d.ts +327 -0
  108. package/dist/somos/patients/models.js +3 -0
  109. package/dist/somos/services/client.d.ts +117 -0
  110. package/dist/somos/services/client.js +26 -0
  111. package/dist/somos/services/index.d.ts +5 -0
  112. package/dist/somos/services/index.js +4 -0
  113. package/dist/somos/services/models.d.ts +272 -0
  114. package/dist/somos/services/models.js +3 -0
  115. package/dist/somos/specialtyRules/client.d.ts +44 -0
  116. package/dist/somos/specialtyRules/client.js +18 -0
  117. package/dist/somos/specialtyRules/index.d.ts +5 -0
  118. package/dist/somos/specialtyRules/index.js +4 -0
  119. package/dist/somos/specialtyRules/models.d.ts +54 -0
  120. package/dist/somos/specialtyRules/models.js +3 -0
  121. package/dist/{raiz/roles → somos/tools}/client.d.ts +14 -12
  122. package/dist/{visoft/agencies → somos/tools}/client.js +3 -3
  123. package/dist/somos/tools/index.d.ts +5 -0
  124. package/dist/somos/tools/index.js +4 -0
  125. package/dist/somos/tools/models.d.ts +101 -0
  126. package/dist/somos/tools/models.js +3 -0
  127. package/dist/visoft/appointments/client.d.ts +20 -194
  128. package/dist/visoft/appointments/client.js +5 -4
  129. package/dist/visoft/appointments/index.d.ts +1 -0
  130. package/dist/visoft/appointments/models.d.ts +391 -0
  131. package/dist/visoft/appointments/models.js +15 -0
  132. package/dist/visoft/availability/client.d.ts +10 -164
  133. package/dist/visoft/availability/client.js +9 -9
  134. package/dist/visoft/availability/index.d.ts +2 -2
  135. package/dist/visoft/availability/models.d.ts +154 -64
  136. package/dist/visoft/availability/models.js +10 -8
  137. package/dist/visoft/client.d.ts +6 -8
  138. package/dist/visoft/client.js +15 -20
  139. package/dist/visoft/clinic/client.d.ts +30 -0
  140. package/dist/visoft/clinic/client.js +18 -0
  141. package/dist/visoft/{specialtyRules → clinic}/index.d.ts +1 -0
  142. package/dist/visoft/clinic/index.js +4 -0
  143. package/dist/visoft/clinic/models.d.ts +13 -0
  144. package/dist/visoft/clinic/models.js +3 -0
  145. package/dist/visoft/clinics/client.d.ts +2 -31
  146. package/dist/visoft/clinics/client.js +1 -8
  147. package/dist/visoft/clinics/index.d.ts +2 -2
  148. package/dist/visoft/clinics/models.d.ts +13 -24
  149. package/dist/visoft/connections/client.d.ts +17 -74
  150. package/dist/visoft/connections/client.js +10 -11
  151. package/dist/visoft/connections/index.d.ts +1 -1
  152. package/dist/visoft/connections/models.d.ts +93 -1
  153. package/dist/visoft/connections/models.js +6 -0
  154. package/dist/visoft/contracts/client.d.ts +14 -49
  155. package/dist/visoft/contracts/client.js +2 -2
  156. package/dist/visoft/contracts/index.d.ts +1 -1
  157. package/dist/visoft/contracts/models.d.ts +43 -7
  158. package/dist/visoft/index.d.ts +1 -1
  159. package/dist/visoft/models.d.ts +311 -139
  160. package/dist/visoft/patients/client.d.ts +24 -264
  161. package/dist/visoft/patients/client.js +7 -6
  162. package/dist/visoft/patients/index.d.ts +1 -0
  163. package/dist/visoft/patients/models.d.ts +737 -0
  164. package/dist/visoft/patients/models.js +15 -0
  165. package/dist/visoft/professionals/client.d.ts +56 -0
  166. package/dist/visoft/professionals/client.js +18 -0
  167. package/dist/visoft/professionals/index.d.ts +5 -0
  168. package/dist/visoft/professionals/index.js +4 -0
  169. package/dist/visoft/professionals/models.d.ts +54 -0
  170. package/dist/visoft/professionals/models.js +3 -0
  171. package/dist/visoft/serviceCatalogs/client.d.ts +45 -0
  172. package/dist/visoft/serviceCatalogs/client.js +18 -0
  173. package/dist/visoft/serviceCatalogs/index.d.ts +5 -0
  174. package/dist/visoft/serviceCatalogs/index.js +4 -0
  175. package/dist/visoft/serviceCatalogs/models.d.ts +68 -0
  176. package/dist/visoft/serviceCatalogs/models.js +3 -0
  177. package/dist/visoft/services/client.d.ts +25 -61
  178. package/dist/visoft/services/client.js +2 -2
  179. package/dist/visoft/services/index.d.ts +1 -1
  180. package/dist/visoft/services/models.d.ts +52 -15
  181. package/package.json +9 -3
  182. package/dist/raiz/members/client.d.ts +0 -102
  183. package/dist/raiz/members/client.js +0 -35
  184. package/dist/raiz/members/index.d.ts +0 -5
  185. package/dist/raiz/members/models.d.ts +0 -48
  186. package/dist/raiz/members/models.js +0 -10
  187. package/dist/raiz/roles/index.d.ts +0 -5
  188. package/dist/raiz/roles/models.d.ts +0 -32
  189. package/dist/visoft/agencies/client.d.ts +0 -58
  190. package/dist/visoft/agencies/index.d.ts +0 -5
  191. package/dist/visoft/agencies/models.d.ts +0 -29
  192. package/dist/visoft/groups/client.d.ts +0 -69
  193. package/dist/visoft/groups/index.d.ts +0 -5
  194. package/dist/visoft/groups/models.d.ts +0 -39
  195. package/dist/visoft/specialtyRules/client.d.ts +0 -50
  196. package/dist/visoft/tools/index.d.ts +0 -5
  197. package/dist/visoft/tools/models.d.ts +0 -37
  198. /package/dist/{raiz/members → orsovision/agencies}/index.js +0 -0
  199. /package/dist/{raiz/roles → orsovision/agencies}/models.js +0 -0
  200. /package/dist/{raiz/roles → orsovision/appointments}/index.js +0 -0
  201. /package/dist/{visoft/agencies → orsovision/availability}/index.js +0 -0
  202. /package/dist/{visoft/groups → orsovision/clinic}/index.js +0 -0
  203. /package/dist/{visoft/agencies → orsovision/clinic}/models.js +0 -0
  204. /package/dist/{visoft/specialtyRules → orsovision/contracts}/index.js +0 -0
  205. /package/dist/{visoft/groups → orsovision/contracts}/models.js +0 -0
  206. /package/dist/{visoft/tools → orsovision}/models.js +0 -0
  207. /package/dist/{visoft/tools → orsovision/patients}/index.js +0 -0
package/README.md CHANGED
@@ -16,13 +16,31 @@ import { ApiError, createClient } from '@arbol-ai/sdk';
16
16
 
17
17
  const arbol = createClient({ baseUrl: 'https://api.getarbol.com', token });
18
18
 
19
- const { data } = await arbol.agenda.appointments.get({ id: 'apt_…' });
19
+ const { data } = await arbol.agenda.appointments.get({ id: 'eng_…' });
20
20
  data.startsAt; // Temporal.Instant
21
21
  ```
22
22
 
23
23
  Every operation is `client.<service>.<resource>.<verb>(request, options?)`, with its request and
24
24
  response types beside it (`agenda/appointments`: `GetRequest`, `GetResponse`, …).
25
25
 
26
+ ### Only the clients you use
27
+
28
+ Each service and each of its resources is also an entry of its own, with its own `createClient`, so
29
+ an application bundles only what it calls instead of every service's:
30
+
31
+ ```ts
32
+ import { createClient } from '@arbol-ai/sdk/account/organizations';
33
+ import type { AccountCurrentOrganization } from '@arbol-ai/sdk/account/organizations';
34
+
35
+ const organizations = createClient({ baseUrl: 'https://api.getarbol.com', token });
36
+
37
+ const { data } = await organizations.current();
38
+ ```
39
+
40
+ `@arbol-ai/sdk/<service>` is one service (`client.<resource>.<verb>`) and
41
+ `@arbol-ai/sdk/<service>/<resource>` one resource (`client.<verb>`), named as in `src/`
42
+ (`account/members`, `agenda/appointments`, `nuevaEps/…`); each exports its types and `ApiError`.
43
+
26
44
  ## Credentials
27
45
 
28
46
  `token` is sent as `Authorization: Bearer <token>`. It is one of:
package/dist/client.d.ts CHANGED
@@ -4,7 +4,9 @@ import { type Client as AgendaClient } from "./agenda/client.js";
4
4
  import { type Client as AxxaClient } from "./axxa/client.js";
5
5
  import { type Client as GmedicClient } from "./gmedic/client.js";
6
6
  import { type Client as NuevaEpsClient } from "./nuevaEps/client.js";
7
+ import { type Client as OrsovisionClient } from "./orsovision/client.js";
7
8
  import { type Client as RaizClient } from "./raiz/client.js";
9
+ import { type Client as SomosClient } from "./somos/client.js";
8
10
  import { type Client as SuraClient } from "./sura/client.js";
9
11
  import { type Client as VisoftClient } from "./visoft/client.js";
10
12
  export interface ClientOptions extends BaseClientOptions {
@@ -19,7 +21,9 @@ export interface Client {
19
21
  readonly axxa: AxxaClient;
20
22
  readonly gmedic: GmedicClient;
21
23
  readonly nuevaEps: NuevaEpsClient;
24
+ readonly orsovision: OrsovisionClient;
22
25
  readonly raiz: RaizClient;
26
+ readonly somos: SomosClient;
23
27
  readonly sura: SuraClient;
24
28
  readonly visoft: VisoftClient;
25
29
  }
package/dist/client.js CHANGED
@@ -6,7 +6,9 @@ import { bind as bindAgenda, } from "./agenda/client.js";
6
6
  import { bind as bindAxxa } from "./axxa/client.js";
7
7
  import { bind as bindGmedic, } from "./gmedic/client.js";
8
8
  import { bind as bindNuevaEps, } from "./nuevaEps/client.js";
9
+ import { bind as bindOrsovision, } from "./orsovision/client.js";
9
10
  import { bind as bindRaiz } from "./raiz/client.js";
11
+ import { bind as bindSomos, } from "./somos/client.js";
10
12
  import { bind as bindSura } from "./sura/client.js";
11
13
  import { bind as bindVisoft, } from "./visoft/client.js";
12
14
  export function createClient(options) {
@@ -18,7 +20,9 @@ export function bind(transport) {
18
20
  let axxaClient;
19
21
  let gmedicClient;
20
22
  let nuevaEpsClient;
23
+ let orsovisionClient;
21
24
  let raizClient;
25
+ let somosClient;
22
26
  let suraClient;
23
27
  let visoftClient;
24
28
  return {
@@ -37,9 +41,15 @@ export function bind(transport) {
37
41
  get nuevaEps() {
38
42
  return (nuevaEpsClient ??= bindNuevaEps(transport));
39
43
  },
44
+ get orsovision() {
45
+ return (orsovisionClient ??= bindOrsovision(transport));
46
+ },
40
47
  get raiz() {
41
48
  return (raizClient ??= bindRaiz(transport));
42
49
  },
50
+ get somos() {
51
+ return (somosClient ??= bindSomos(transport));
52
+ },
43
53
  get sura() {
44
54
  return (suraClient ??= bindSura(transport));
45
55
  },
package/dist/index.d.ts CHANGED
@@ -2,4 +2,4 @@ export { ApiError } from "./_/index.js";
2
2
  export type { RequestOptions } from "./_/index.js";
3
3
  export { createClient } from "./client.js";
4
4
  export type { Client, ClientOptions, } from "./client.js";
5
- export type { Connection, ConnectionPage, DeletedObject, Failure, PageInfo, ResponseMetadata, ValidationIssue, } from "./models.js";
5
+ export type { AvailabilityBookingInput, CancelAppointmentBadGatewayFailure, Connection, ConnectionNotConfiguredFailure, ConnectionNotFoundFailure, ConnectionPage, CorrectPatientBadGatewayFailure, CreateAppointmentBadGatewayFailure, CreatePatientBadGatewayFailure, CredentialsRejectedFailure, DeletedObject, Empty, Failure, ForbiddenFailure, GetClinicBadGatewayFailure, InternalFailure, InvalidInputFailure, InvalidInputFailureData, ListAvailabilityBadGatewayFailure, ListAvailabilityUnprocessableContentFailure, ListContractsBadGatewayFailure, ListContractsUnprocessableContentFailure, ListServicesBadGatewayFailure, ListServicesUnprocessableContentFailure, ListToolsBadGatewayFailure, LookupPatientBadGatewayFailure, OutcomeUnknownFailure, PageInfo, ProviderUnavailableFailure, RateLimitedFailure, RequestTooLargeFailure, ResponseMetadata, ToolRefusedFailure, ToolRefusedFailureData, ToolResult, UnauthorizedFailure, UnsupportedMediaTypeFailure, UpstreamTimeoutFailure, UpstreamUnavailableFailure, ValidationIssue, } from "./models.js";
package/dist/models.d.ts CHANGED
@@ -1,9 +1,85 @@
1
+ export interface AvailabilityBookingInput {
2
+ agency: string;
3
+ authorizationService?: string;
4
+ contract: string;
5
+ /**
6
+ * Deprecated: use `startsAt`. Answered until 2027-01-28.
7
+ *
8
+ * @deprecated
9
+ */
10
+ date: Temporal.PlainDate;
11
+ fonoGroup?: string;
12
+ intent?: string;
13
+ medicName: string;
14
+ modality?: string;
15
+ pairWithNext?: boolean;
16
+ patientAgeMonths?: string;
17
+ professionalChangeConfirmed?: boolean;
18
+ sala?: string;
19
+ service: string;
20
+ specialty?: string;
21
+ /**
22
+ * The slot's moment, with the clinic's offset: book it with this value.
23
+ */
24
+ startsAt?: Temporal.Instant;
25
+ /**
26
+ * Deprecated: use `startsAt`. Answered until 2027-01-28.
27
+ *
28
+ * @deprecated
29
+ */
30
+ time: string;
31
+ toGroup?: string;
32
+ }
33
+ export type CancelAppointmentBadGatewayFailure = OutcomeUnknownFailure | ProviderUnavailableFailure;
1
34
  export interface Connection {
2
35
  id: string;
3
36
  name: string;
4
37
  status: "active" | "disabled" | "failed" | "not_configured";
5
38
  verifiedAt: Temporal.Instant | null;
6
39
  }
40
+ /**
41
+ * The organization has no active Visoft connection for this call; an
42
+ * administrator connects Visoft in Account.
43
+ */
44
+ export interface ConnectionNotConfiguredFailure {
45
+ /**
46
+ * The failure code, stable across releases.
47
+ */
48
+ code: "CONNECTION_NOT_CONFIGURED";
49
+ /**
50
+ * No fields.
51
+ */
52
+ data: Empty;
53
+ /**
54
+ * What went wrong, for people; it never contains input values.
55
+ */
56
+ message: string;
57
+ /**
58
+ * Whether repeating the same request may succeed.
59
+ */
60
+ retryable: false;
61
+ }
62
+ /**
63
+ * The organization has no such connection.
64
+ */
65
+ export interface ConnectionNotFoundFailure {
66
+ /**
67
+ * The failure code, stable across releases.
68
+ */
69
+ code: "CONNECTION_NOT_FOUND";
70
+ /**
71
+ * No fields.
72
+ */
73
+ data: Empty;
74
+ /**
75
+ * What went wrong, for people; it never contains input values.
76
+ */
77
+ message: string;
78
+ /**
79
+ * Whether repeating the same request may succeed.
80
+ */
81
+ retryable: false;
82
+ }
7
83
  export interface ConnectionPage {
8
84
  /**
9
85
  * Items admitted by this resource contract within the verified organization.
@@ -18,6 +94,31 @@ export interface ConnectionPage {
18
94
  */
19
95
  pageInfo: PageInfo;
20
96
  }
97
+ export type CorrectPatientBadGatewayFailure = OutcomeUnknownFailure | ProviderUnavailableFailure;
98
+ export type CreateAppointmentBadGatewayFailure = OutcomeUnknownFailure | ProviderUnavailableFailure;
99
+ export type CreatePatientBadGatewayFailure = OutcomeUnknownFailure | ProviderUnavailableFailure;
100
+ /**
101
+ * The clinical system rejected the username or password, or the user is
102
+ * blocked.
103
+ */
104
+ export interface CredentialsRejectedFailure {
105
+ /**
106
+ * The failure code, stable across releases.
107
+ */
108
+ code: "CREDENTIALS_REJECTED";
109
+ /**
110
+ * No fields.
111
+ */
112
+ data: Empty;
113
+ /**
114
+ * What went wrong, for people; it never contains input values.
115
+ */
116
+ message: string;
117
+ /**
118
+ * Whether repeating the same request may succeed.
119
+ */
120
+ retryable: false;
121
+ }
21
122
  export interface DeletedObject {
22
123
  deleted: true;
23
124
  /**
@@ -25,6 +126,12 @@ export interface DeletedObject {
25
126
  */
26
127
  id: string;
27
128
  }
129
+ /**
130
+ * No fields.
131
+ */
132
+ export type Empty = {
133
+ [key: string]: unknown;
134
+ };
28
135
  export interface Failure {
29
136
  /**
30
137
  * The failure code, stable across releases.
@@ -45,6 +152,99 @@ export interface Failure {
45
152
  */
46
153
  retryable: boolean;
47
154
  }
155
+ /**
156
+ * The token does not authorize this operation.
157
+ */
158
+ export interface ForbiddenFailure {
159
+ /**
160
+ * The failure code, stable across releases.
161
+ */
162
+ code: "FORBIDDEN";
163
+ /**
164
+ * No fields.
165
+ */
166
+ data: Empty;
167
+ /**
168
+ * What went wrong, for people; it never contains input values.
169
+ */
170
+ message: string;
171
+ /**
172
+ * Whether repeating the same request may succeed.
173
+ */
174
+ retryable: false;
175
+ }
176
+ export type GetClinicBadGatewayFailure = OutcomeUnknownFailure | ProviderUnavailableFailure;
177
+ /**
178
+ * The service could not complete the operation.
179
+ */
180
+ export interface InternalFailure {
181
+ /**
182
+ * The failure code, stable across releases.
183
+ */
184
+ code: "INTERNAL_ERROR";
185
+ /**
186
+ * No fields.
187
+ */
188
+ data: Empty;
189
+ /**
190
+ * What went wrong, for people; it never contains input values.
191
+ */
192
+ message: string;
193
+ /**
194
+ * Whether repeating the same request may succeed.
195
+ */
196
+ retryable: false;
197
+ }
198
+ /**
199
+ * The request does not match the published schema.
200
+ */
201
+ export interface InvalidInputFailure {
202
+ /**
203
+ * The failure code, stable across releases.
204
+ */
205
+ code: "INVALID_INPUT";
206
+ data: InvalidInputFailureData;
207
+ /**
208
+ * What went wrong, for people; it never contains input values.
209
+ */
210
+ message: string;
211
+ /**
212
+ * Whether repeating the same request may succeed.
213
+ */
214
+ retryable: false;
215
+ }
216
+ export interface InvalidInputFailureData {
217
+ issues?: ValidationIssue[];
218
+ }
219
+ export type ListAvailabilityBadGatewayFailure = OutcomeUnknownFailure | ProviderUnavailableFailure;
220
+ export type ListAvailabilityUnprocessableContentFailure = CredentialsRejectedFailure | ToolRefusedFailure;
221
+ export type ListContractsBadGatewayFailure = OutcomeUnknownFailure | ProviderUnavailableFailure;
222
+ export type ListContractsUnprocessableContentFailure = CredentialsRejectedFailure | ToolRefusedFailure;
223
+ export type ListServicesBadGatewayFailure = OutcomeUnknownFailure | ProviderUnavailableFailure;
224
+ export type ListServicesUnprocessableContentFailure = CredentialsRejectedFailure | ToolRefusedFailure;
225
+ export type ListToolsBadGatewayFailure = OutcomeUnknownFailure | ProviderUnavailableFailure;
226
+ export type LookupPatientBadGatewayFailure = OutcomeUnknownFailure | ProviderUnavailableFailure;
227
+ /**
228
+ * The operation may have been applied; check its result before repeating it.
229
+ */
230
+ export interface OutcomeUnknownFailure {
231
+ /**
232
+ * The failure code, stable across releases.
233
+ */
234
+ code: "OUTCOME_UNKNOWN";
235
+ /**
236
+ * No fields.
237
+ */
238
+ data: Empty;
239
+ /**
240
+ * What went wrong, for people; it never contains input values.
241
+ */
242
+ message: string;
243
+ /**
244
+ * Whether repeating the same request may succeed.
245
+ */
246
+ retryable: false;
247
+ }
48
248
  export interface PageInfo {
49
249
  /**
50
250
  * Whether a later page exists in the current ordering.
@@ -63,12 +263,207 @@ export interface PageInfo {
63
263
  */
64
264
  previousCursor: string | null;
65
265
  }
266
+ /**
267
+ * The clinical system did not answer or could not complete the request.
268
+ */
269
+ export interface ProviderUnavailableFailure {
270
+ /**
271
+ * The failure code, stable across releases.
272
+ */
273
+ code: "PROVIDER_UNAVAILABLE";
274
+ /**
275
+ * No fields.
276
+ */
277
+ data: Empty;
278
+ /**
279
+ * What went wrong, for people; it never contains input values.
280
+ */
281
+ message: string;
282
+ /**
283
+ * Whether repeating the same request may succeed.
284
+ */
285
+ retryable: true;
286
+ }
287
+ /**
288
+ * The request rate limit was exceeded. Try again later.
289
+ */
290
+ export interface RateLimitedFailure {
291
+ /**
292
+ * The failure code, stable across releases.
293
+ */
294
+ code: "RATE_LIMITED";
295
+ /**
296
+ * No fields.
297
+ */
298
+ data: Empty;
299
+ /**
300
+ * What went wrong, for people; it never contains input values.
301
+ */
302
+ message: string;
303
+ /**
304
+ * Whether repeating the same request may succeed.
305
+ */
306
+ retryable: true;
307
+ }
308
+ /**
309
+ * The request exceeds the allowed size.
310
+ */
311
+ export interface RequestTooLargeFailure {
312
+ /**
313
+ * The failure code, stable across releases.
314
+ */
315
+ code: "REQUEST_TOO_LARGE";
316
+ /**
317
+ * No fields.
318
+ */
319
+ data: Empty;
320
+ /**
321
+ * What went wrong, for people; it never contains input values.
322
+ */
323
+ message: string;
324
+ /**
325
+ * Whether repeating the same request may succeed.
326
+ */
327
+ retryable: false;
328
+ }
66
329
  export interface ResponseMetadata {
67
330
  /**
68
331
  * Request correlation identifier, also sent as X-Request-Id.
69
332
  */
70
333
  requestId: string;
71
334
  }
335
+ /**
336
+ * The clinic's rules did not answer the request as asked: data.reason says why
337
+ * and data.guidance what to do next. Nothing was changed.
338
+ */
339
+ export interface ToolRefusedFailure {
340
+ /**
341
+ * The failure code, stable across releases.
342
+ */
343
+ code: "TOOL_REFUSED";
344
+ data: ToolRefusedFailureData;
345
+ /**
346
+ * What went wrong, for people; it never contains input values.
347
+ */
348
+ message: string;
349
+ /**
350
+ * Whether repeating the same request may succeed.
351
+ */
352
+ retryable: false;
353
+ }
354
+ export interface ToolRefusedFailureData {
355
+ /**
356
+ * What was refused, in English, for logs and people.
357
+ */
358
+ detail: string;
359
+ /**
360
+ * What the refusal offers to continue (suggested names, accepted values,
361
+ * missing fields), as the guidance names it.
362
+ */
363
+ details: {
364
+ [key: string]: unknown;
365
+ };
366
+ /**
367
+ * What an Agent does next, in the language it speaks to the person.
368
+ */
369
+ guidance?: string;
370
+ /**
371
+ * Why, as a stable code: CONTRACT_NOT_FOUND, MISSING_ARGUMENT,
372
+ * NO_AVAILABILITY…
373
+ */
374
+ reason: string;
375
+ /**
376
+ * A sentence an Agent may say to the person as it is.
377
+ */
378
+ say?: string;
379
+ }
380
+ export type ToolResult = {
381
+ [key: string]: unknown;
382
+ };
383
+ /**
384
+ * A valid access token is required.
385
+ */
386
+ export interface UnauthorizedFailure {
387
+ /**
388
+ * The failure code, stable across releases.
389
+ */
390
+ code: "UNAUTHORIZED";
391
+ /**
392
+ * No fields.
393
+ */
394
+ data: Empty;
395
+ /**
396
+ * What went wrong, for people; it never contains input values.
397
+ */
398
+ message: string;
399
+ /**
400
+ * Whether repeating the same request may succeed.
401
+ */
402
+ retryable: false;
403
+ }
404
+ /**
405
+ * The request content type is not supported.
406
+ */
407
+ export interface UnsupportedMediaTypeFailure {
408
+ /**
409
+ * The failure code, stable across releases.
410
+ */
411
+ code: "UNSUPPORTED_MEDIA_TYPE";
412
+ /**
413
+ * No fields.
414
+ */
415
+ data: Empty;
416
+ /**
417
+ * What went wrong, for people; it never contains input values.
418
+ */
419
+ message: string;
420
+ /**
421
+ * Whether repeating the same request may succeed.
422
+ */
423
+ retryable: false;
424
+ }
425
+ /**
426
+ * The upstream service did not respond before its deadline.
427
+ */
428
+ export interface UpstreamTimeoutFailure {
429
+ /**
430
+ * The failure code, stable across releases.
431
+ */
432
+ code: "UPSTREAM_TIMEOUT";
433
+ /**
434
+ * No fields.
435
+ */
436
+ data: Empty;
437
+ /**
438
+ * What went wrong, for people; it never contains input values.
439
+ */
440
+ message: string;
441
+ /**
442
+ * Whether repeating the same request may succeed.
443
+ */
444
+ retryable: true;
445
+ }
446
+ /**
447
+ * The upstream service could not complete the request.
448
+ */
449
+ export interface UpstreamUnavailableFailure {
450
+ /**
451
+ * The failure code, stable across releases.
452
+ */
453
+ code: "UPSTREAM_UNAVAILABLE";
454
+ /**
455
+ * No fields.
456
+ */
457
+ data: Empty;
458
+ /**
459
+ * What went wrong, for people; it never contains input values.
460
+ */
461
+ message: string;
462
+ /**
463
+ * Whether repeating the same request may succeed.
464
+ */
465
+ retryable: true;
466
+ }
72
467
  export interface ValidationIssue {
73
468
  message: string;
74
469
  /**
@@ -76,5 +471,6 @@ export interface ValidationIssue {
76
471
  */
77
472
  path: string;
78
473
  }
474
+ export declare const AvailabilityBookingInputCodec: import("./_/codec.js").Codec;
79
475
  export declare const ConnectionCodec: import("./_/codec.js").Codec;
80
476
  export declare const ConnectionPageCodec: import("./_/codec.js").Codec;
package/dist/models.js CHANGED
@@ -1,6 +1,10 @@
1
1
  // Code generated by forge. DO NOT EDIT.
2
2
  /* eslint-disable */
3
- import { array, instant, object } from "./_/index.js";
3
+ import { array, date, instant, object } from "./_/index.js";
4
+ export const AvailabilityBookingInputCodec = object([
5
+ ["date", null, date],
6
+ ["startsAt", null, instant],
7
+ ]);
4
8
  export const ConnectionCodec = object([
5
9
  ["verifiedAt", null, instant],
6
10
  ]);
@@ -1,4 +1,5 @@
1
- import type { NuevaEpsForbiddenFailure, NuevaEpsLoginCooldownFailure, NuevaEpsLoginRejectedFailure, NuevaEpsNotConfiguredFailure, NuevaEpsOutcomeUnknownFailure, NuevaEpsPortalChangedFailure, NuevaEpsPortalUnavailableFailure, NuevaEpsRateLimitedFailure, NuevaEpsRegionBlockedFailure, NuevaEpsResponseMetadata, NuevaEpsSessionBusyFailure, NuevaEpsSessionRequiredFailure, NuevaEpsUpstreamUnavailableFailure } from "../models.js";
1
+ import type { ForbiddenFailure, OutcomeUnknownFailure, RateLimitedFailure, UpstreamUnavailableFailure } from "../../models.js";
2
+ import type { NuevaEpsLoginCooldownFailure, NuevaEpsLoginRejectedFailure, NuevaEpsNotConfiguredFailure, NuevaEpsPortalChangedFailure, NuevaEpsPortalUnavailableFailure, NuevaEpsRegionBlockedFailure, NuevaEpsResponseMetadata, NuevaEpsSessionBusyFailure, NuevaEpsSessionRequiredFailure } from "../models.js";
2
3
  /**
3
4
  * A failed answer.
4
5
  */
@@ -11,7 +12,7 @@ export interface NuevaEpsLookupAffiliationBadGatewayError {
11
12
  metadata: NuevaEpsResponseMetadata;
12
13
  success: false;
13
14
  }
14
- export type NuevaEpsLookupAffiliationBadGatewayFailure = NuevaEpsOutcomeUnknownFailure | NuevaEpsPortalChangedFailure;
15
+ export type NuevaEpsLookupAffiliationBadGatewayFailure = OutcomeUnknownFailure | NuevaEpsPortalChangedFailure;
15
16
  export interface NuevaEpsLookupAffiliationBody {
16
17
  /**
17
18
  * True: concise Spanish text in data.text (HTTP) and MCP text content. False
@@ -69,7 +70,7 @@ export interface NuevaEpsLookupAffiliationForbiddenError {
69
70
  metadata: NuevaEpsResponseMetadata;
70
71
  success: false;
71
72
  }
72
- export type NuevaEpsLookupAffiliationForbiddenFailure = NuevaEpsForbiddenFailure | NuevaEpsLoginRejectedFailure;
73
+ export type NuevaEpsLookupAffiliationForbiddenFailure = ForbiddenFailure | NuevaEpsLoginRejectedFailure;
73
74
  export type NuevaEpsLookupAffiliationResult = {
74
75
  affiliated?: boolean;
75
76
  callerIsPrimaryProvider?: boolean;
@@ -130,7 +131,7 @@ export interface NuevaEpsLookupAffiliationServiceUnavailableError {
130
131
  metadata: NuevaEpsResponseMetadata;
131
132
  success: false;
132
133
  }
133
- export type NuevaEpsLookupAffiliationServiceUnavailableFailure = NuevaEpsUpstreamUnavailableFailure | NuevaEpsPortalUnavailableFailure | NuevaEpsRegionBlockedFailure;
134
+ export type NuevaEpsLookupAffiliationServiceUnavailableFailure = UpstreamUnavailableFailure | NuevaEpsPortalUnavailableFailure | NuevaEpsRegionBlockedFailure;
134
135
  /**
135
136
  * A failed answer.
136
137
  */
@@ -143,4 +144,4 @@ export interface NuevaEpsLookupAffiliationTooManyRequestsError {
143
144
  metadata: NuevaEpsResponseMetadata;
144
145
  success: false;
145
146
  }
146
- export type NuevaEpsLookupAffiliationTooManyRequestsFailure = NuevaEpsRateLimitedFailure | NuevaEpsLoginCooldownFailure;
147
+ export type NuevaEpsLookupAffiliationTooManyRequestsFailure = RateLimitedFailure | NuevaEpsLoginCooldownFailure;