@arbol-ai/sdk 2.19.0 → 3.0.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.
Files changed (233) 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/client.js +3 -4
  56. package/dist/raiz/agents/models.d.ts +1 -0
  57. package/dist/raiz/bulletins/client.d.ts +4 -1
  58. package/dist/raiz/bulletins/client.js +5 -6
  59. package/dist/raiz/campaigns/client.d.ts +6 -5
  60. package/dist/raiz/campaigns/client.js +4 -4
  61. package/dist/raiz/channels/client.d.ts +19 -5
  62. package/dist/raiz/channels/client.js +9 -9
  63. package/dist/raiz/client.d.ts +0 -4
  64. package/dist/raiz/client.js +0 -10
  65. package/dist/raiz/contacts/client.js +4 -4
  66. package/dist/raiz/conversations/client.d.ts +7 -4
  67. package/dist/raiz/conversations/client.js +6 -6
  68. package/dist/raiz/definitions/client.d.ts +4 -4
  69. package/dist/raiz/definitions/client.js +3 -4
  70. package/dist/raiz/evalCases/client.d.ts +13 -12
  71. package/dist/raiz/evalCases/client.js +2 -2
  72. package/dist/raiz/evalRuns/client.d.ts +7 -4
  73. package/dist/raiz/evalRuns/client.js +2 -3
  74. package/dist/raiz/evalRuns/models.d.ts +7 -1
  75. package/dist/raiz/facts/client.js +2 -2
  76. package/dist/raiz/knowledge/client.d.ts +17 -11
  77. package/dist/raiz/knowledge/client.js +4 -4
  78. package/dist/raiz/models.d.ts +0 -42
  79. package/dist/raiz/organization/client.d.ts +38 -42
  80. package/dist/raiz/organization/client.js +11 -12
  81. package/dist/raiz/organization/index.d.ts +1 -1
  82. package/dist/raiz/organization/models.d.ts +0 -10
  83. package/dist/raiz/profiles/client.d.ts +4 -4
  84. package/dist/raiz/profiles/client.js +3 -4
  85. package/dist/raiz/reports/client.d.ts +3 -3
  86. package/dist/raiz/reports/client.js +2 -2
  87. package/dist/raiz/reports/index.d.ts +1 -1
  88. package/dist/raiz/suppressions/client.js +1 -1
  89. package/dist/raiz/tasks/client.d.ts +6 -0
  90. package/dist/raiz/tasks/client.js +5 -6
  91. package/dist/raiz/templates/client.d.ts +2 -1
  92. package/dist/raiz/templates/client.js +1 -1
  93. package/dist/somos/appointments/client.d.ts +40 -0
  94. package/dist/somos/appointments/client.js +29 -0
  95. package/dist/somos/appointments/index.d.ts +5 -0
  96. package/dist/somos/appointments/index.js +4 -0
  97. package/dist/somos/appointments/models.d.ts +301 -0
  98. package/dist/somos/appointments/models.js +9 -0
  99. package/dist/somos/availability/client.d.ts +33 -0
  100. package/dist/somos/availability/client.js +19 -0
  101. package/dist/somos/availability/index.d.ts +5 -0
  102. package/dist/somos/availability/index.js +4 -0
  103. package/dist/somos/availability/models.d.ts +340 -0
  104. package/dist/somos/availability/models.js +15 -0
  105. package/dist/somos/client.d.ts +29 -0
  106. package/dist/somos/client.js +55 -0
  107. package/dist/somos/clinic/client.d.ts +33 -0
  108. package/dist/somos/clinic/client.js +18 -0
  109. package/dist/somos/clinic/index.d.ts +5 -0
  110. package/dist/somos/clinic/index.js +4 -0
  111. package/dist/somos/clinic/models.d.ts +89 -0
  112. package/dist/somos/clinic/models.js +3 -0
  113. package/dist/somos/contracts/client.d.ts +74 -0
  114. package/dist/somos/contracts/client.js +18 -0
  115. package/dist/somos/contracts/index.d.ts +5 -0
  116. package/dist/somos/contracts/index.js +4 -0
  117. package/dist/somos/contracts/models.d.ts +107 -0
  118. package/dist/somos/contracts/models.js +3 -0
  119. package/dist/somos/groups/client.d.ts +67 -0
  120. package/dist/{visoft → somos}/groups/client.js +2 -2
  121. package/dist/somos/groups/index.d.ts +5 -0
  122. package/dist/somos/groups/index.js +4 -0
  123. package/dist/somos/groups/models.d.ts +117 -0
  124. package/dist/somos/groups/models.js +3 -0
  125. package/dist/somos/index.d.ts +5 -0
  126. package/dist/somos/index.js +4 -0
  127. package/dist/somos/models.d.ts +227 -0
  128. package/dist/somos/models.js +3 -0
  129. package/dist/somos/patients/client.d.ts +51 -0
  130. package/dist/somos/patients/client.js +34 -0
  131. package/dist/somos/patients/index.d.ts +5 -0
  132. package/dist/somos/patients/index.js +4 -0
  133. package/dist/somos/patients/models.d.ts +327 -0
  134. package/dist/somos/patients/models.js +3 -0
  135. package/dist/somos/services/client.d.ts +117 -0
  136. package/dist/somos/services/client.js +26 -0
  137. package/dist/somos/services/index.d.ts +5 -0
  138. package/dist/somos/services/index.js +4 -0
  139. package/dist/somos/services/models.d.ts +272 -0
  140. package/dist/somos/services/models.js +3 -0
  141. package/dist/somos/specialtyRules/client.d.ts +44 -0
  142. package/dist/somos/specialtyRules/client.js +18 -0
  143. package/dist/somos/specialtyRules/index.d.ts +5 -0
  144. package/dist/somos/specialtyRules/index.js +4 -0
  145. package/dist/somos/specialtyRules/models.d.ts +54 -0
  146. package/dist/somos/specialtyRules/models.js +3 -0
  147. package/dist/{raiz/roles → somos/tools}/client.d.ts +14 -12
  148. package/dist/{visoft/agencies → somos/tools}/client.js +3 -3
  149. package/dist/somos/tools/index.d.ts +5 -0
  150. package/dist/somos/tools/index.js +4 -0
  151. package/dist/somos/tools/models.d.ts +101 -0
  152. package/dist/somos/tools/models.js +3 -0
  153. package/dist/visoft/appointments/client.d.ts +20 -194
  154. package/dist/visoft/appointments/client.js +5 -4
  155. package/dist/visoft/appointments/index.d.ts +1 -0
  156. package/dist/visoft/appointments/models.d.ts +391 -0
  157. package/dist/visoft/appointments/models.js +15 -0
  158. package/dist/visoft/availability/client.d.ts +10 -164
  159. package/dist/visoft/availability/client.js +9 -9
  160. package/dist/visoft/availability/index.d.ts +2 -2
  161. package/dist/visoft/availability/models.d.ts +154 -64
  162. package/dist/visoft/availability/models.js +10 -8
  163. package/dist/visoft/client.d.ts +6 -8
  164. package/dist/visoft/client.js +15 -20
  165. package/dist/visoft/clinic/client.d.ts +30 -0
  166. package/dist/visoft/clinic/client.js +18 -0
  167. package/dist/visoft/{specialtyRules → clinic}/index.d.ts +1 -0
  168. package/dist/visoft/clinic/index.js +4 -0
  169. package/dist/visoft/clinic/models.d.ts +13 -0
  170. package/dist/visoft/clinic/models.js +3 -0
  171. package/dist/visoft/clinics/client.d.ts +2 -31
  172. package/dist/visoft/clinics/client.js +1 -8
  173. package/dist/visoft/clinics/index.d.ts +2 -2
  174. package/dist/visoft/clinics/models.d.ts +13 -24
  175. package/dist/visoft/connections/client.d.ts +17 -74
  176. package/dist/visoft/connections/client.js +10 -11
  177. package/dist/visoft/connections/index.d.ts +1 -1
  178. package/dist/visoft/connections/models.d.ts +93 -1
  179. package/dist/visoft/connections/models.js +6 -0
  180. package/dist/visoft/contracts/client.d.ts +14 -49
  181. package/dist/visoft/contracts/client.js +2 -2
  182. package/dist/visoft/contracts/index.d.ts +1 -1
  183. package/dist/visoft/contracts/models.d.ts +43 -7
  184. package/dist/visoft/index.d.ts +1 -1
  185. package/dist/visoft/models.d.ts +311 -139
  186. package/dist/visoft/patients/client.d.ts +24 -264
  187. package/dist/visoft/patients/client.js +7 -6
  188. package/dist/visoft/patients/index.d.ts +1 -0
  189. package/dist/visoft/patients/models.d.ts +737 -0
  190. package/dist/visoft/patients/models.js +15 -0
  191. package/dist/visoft/professionals/client.d.ts +56 -0
  192. package/dist/visoft/professionals/client.js +18 -0
  193. package/dist/visoft/professionals/index.d.ts +5 -0
  194. package/dist/visoft/professionals/index.js +4 -0
  195. package/dist/visoft/professionals/models.d.ts +54 -0
  196. package/dist/visoft/professionals/models.js +3 -0
  197. package/dist/visoft/serviceCatalogs/client.d.ts +45 -0
  198. package/dist/visoft/serviceCatalogs/client.js +18 -0
  199. package/dist/visoft/serviceCatalogs/index.d.ts +5 -0
  200. package/dist/visoft/serviceCatalogs/index.js +4 -0
  201. package/dist/visoft/serviceCatalogs/models.d.ts +68 -0
  202. package/dist/visoft/serviceCatalogs/models.js +3 -0
  203. package/dist/visoft/services/client.d.ts +25 -61
  204. package/dist/visoft/services/client.js +2 -2
  205. package/dist/visoft/services/index.d.ts +1 -1
  206. package/dist/visoft/services/models.d.ts +52 -15
  207. package/package.json +9 -3
  208. package/dist/raiz/members/client.d.ts +0 -102
  209. package/dist/raiz/members/client.js +0 -35
  210. package/dist/raiz/members/index.d.ts +0 -5
  211. package/dist/raiz/members/models.d.ts +0 -48
  212. package/dist/raiz/members/models.js +0 -10
  213. package/dist/raiz/roles/index.d.ts +0 -5
  214. package/dist/raiz/roles/models.d.ts +0 -32
  215. package/dist/visoft/agencies/client.d.ts +0 -58
  216. package/dist/visoft/agencies/index.d.ts +0 -5
  217. package/dist/visoft/agencies/models.d.ts +0 -29
  218. package/dist/visoft/groups/client.d.ts +0 -69
  219. package/dist/visoft/groups/index.d.ts +0 -5
  220. package/dist/visoft/groups/models.d.ts +0 -39
  221. package/dist/visoft/specialtyRules/client.d.ts +0 -50
  222. package/dist/visoft/tools/index.d.ts +0 -5
  223. package/dist/visoft/tools/models.d.ts +0 -37
  224. /package/dist/{raiz/members → orsovision/agencies}/index.js +0 -0
  225. /package/dist/{raiz/roles → orsovision/agencies}/models.js +0 -0
  226. /package/dist/{raiz/roles → orsovision/appointments}/index.js +0 -0
  227. /package/dist/{visoft/agencies → orsovision/availability}/index.js +0 -0
  228. /package/dist/{visoft/groups → orsovision/clinic}/index.js +0 -0
  229. /package/dist/{visoft/agencies → orsovision/clinic}/models.js +0 -0
  230. /package/dist/{visoft/specialtyRules → orsovision/contracts}/index.js +0 -0
  231. /package/dist/{visoft/groups → orsovision/contracts}/models.js +0 -0
  232. /package/dist/{visoft/tools → orsovision}/models.js +0 -0
  233. /package/dist/{visoft/tools → orsovision/patients}/index.js +0 -0
@@ -1,6 +1,5 @@
1
1
  import { type BaseClientOptions, type RequestOptions, Transport } from "../../_/index.js";
2
- import type { ResponseMetadata } from "../../models.js";
3
- import type { VisoftToolResult } from "../models.js";
2
+ import { type VisoftBookingResponse, type VisoftCancelAppointmentBody, type VisoftCancellationResponse, type VisoftCreateAppointmentBody } from "./models.js";
4
3
  export interface ClientOptions extends BaseClientOptions {
5
4
  /**
6
5
  * The URL the paths of the API are relative to.
@@ -11,205 +10,32 @@ export interface Client {
11
10
  /**
12
11
  * Cancel an appointment
13
12
  *
14
- * Cancel one exact future appointment, only after the person explicitly
15
- * confirmed it, with the cancellation reference from a fresh patient lookup.
16
- * Never repeat a cancellation whose outcome is unknown. The connection's
17
- * clinic sets this tool's rules, parameters and accepted values:
18
- * visoft.tools.list answers them for the connection, and every call is
19
- * checked against them.
13
+ * Cancel one of the patient's appointments, by the reference a fresh
14
+ * visoft.patients.lookup answered in history.appointments. The patient's
15
+ * agenda is read again right before the write, and an appointment no longer
16
+ * in it is APPOINTMENT_NOT_CANCELLABLE. minimumNoticeMinutes refuses one that
17
+ * starts sooner (CANCEL_NOTICE_REQUIRED). CANCELLATION_REFUSED: SIIPS did not
18
+ * confirm it (data.message says why). A cancellation whose outcome is unknown
19
+ * answers OUTCOME_UNKNOWN: read the patient's agenda before anything else,
20
+ * never repeat it blindly.
20
21
  */
21
22
  cancel(request: CancelRequest, options?: RequestOptions): Promise<CancelResponse>;
22
23
  /**
23
24
  * Book an appointment
24
25
  *
25
- * Book one slot visoft.availability.list returned, only after the person
26
- * explicitly confirmed that exact appointment. Pass its reference unchanged.
27
- * Never repeat a booking whose outcome is unknown. The connection's clinic
28
- * sets this tool's rules, parameters and accepted values: visoft.tools.list
29
- * answers them for the connection, and every call is checked against them.
26
+ * Book one free slot visoft.availability.lookup answered, by its reference
27
+ * and the contract and service of that search, for the patient with that
28
+ * document. APPOINTMENT_REQUEST_EXISTS: the patient already has a requested
29
+ * appointment for the service. BOOKING_REFUSED: SIIPS refused it
30
+ * (data.message says why). Nothing is booked in either case. A booking whose
31
+ * outcome is unknown answers OUTCOME_UNKNOWN: read the patient's agenda
32
+ * before anything else, never book it again blindly.
30
33
  */
31
34
  create(request: CreateRequest, options?: RequestOptions): Promise<CreateResponse>;
32
35
  }
33
36
  export declare function createClient(options: ClientOptions): Client;
34
37
  export declare function bind(transport: Transport): Client;
35
- export interface CancelRequest {
36
- /**
37
- * As the connection's clinic defines it: visoft.tools.list answers its
38
- * meaning, accepted values and whether it is required.
39
- */
40
- cancelToken?: string;
41
- /**
42
- * The channel the conversation happens on: voice, whatsapp or web (the
43
- * default).
44
- */
45
- channel?: "voice" | "web" | "whatsapp";
46
- /**
47
- * The connection to run on. Optional when the organization has one Visoft
48
- * connection; required when it has several. Another organization's connection
49
- * is NOT_FOUND.
50
- */
51
- connectionId?: string;
52
- /**
53
- * As the connection's clinic defines it: visoft.tools.list answers its
54
- * meaning, accepted values and whether it is required.
55
- */
56
- date?: string;
57
- /**
58
- * As the connection's clinic defines it: visoft.tools.list answers its
59
- * meaning, accepted values and whether it is required.
60
- */
61
- documentNumber: string;
62
- /**
63
- * As the connection's clinic defines it: visoft.tools.list answers its
64
- * meaning, accepted values and whether it is required.
65
- */
66
- time?: string;
67
- }
68
- export interface CancelResponse {
69
- /**
70
- * The tool's clinical answer. ok:false is a conversational refusal the Agent
71
- * reads (error, errorCode, ai_hint), not a failure.
72
- */
73
- data: VisoftToolResult;
74
- error: null;
75
- metadata: ResponseMetadata;
76
- success: true;
77
- }
78
- export interface CreateRequest {
79
- /**
80
- * As the connection's clinic defines it: visoft.tools.list answers its
81
- * meaning, accepted values and whether it is required.
82
- */
83
- authorizationService?: string;
84
- /**
85
- * The channel the conversation happens on: voice, whatsapp or web (the
86
- * default).
87
- */
88
- channel?: "voice" | "web" | "whatsapp";
89
- /**
90
- * As the connection's clinic defines it: visoft.tools.list answers its
91
- * meaning, accepted values and whether it is required.
92
- */
93
- companionToken?: string;
94
- /**
95
- * The connection to run on. Optional when the organization has one Visoft
96
- * connection; required when it has several. Another organization's connection
97
- * is NOT_FOUND.
98
- */
99
- connectionId?: string;
100
- /**
101
- * As the connection's clinic defines it: visoft.tools.list answers its
102
- * meaning, accepted values and whether it is required.
103
- */
104
- contract?: string;
105
- /**
106
- * As the connection's clinic defines it: visoft.tools.list answers its
107
- * meaning, accepted values and whether it is required.
108
- */
109
- date?: string;
110
- /**
111
- * As the connection's clinic defines it: visoft.tools.list answers its
112
- * meaning, accepted values and whether it is required.
113
- */
114
- documentNumber: string;
115
- /**
116
- * As the connection's clinic defines it: visoft.tools.list answers its
117
- * meaning, accepted values and whether it is required.
118
- */
119
- documentType?: string;
120
- /**
121
- * As the connection's clinic defines it: visoft.tools.list answers its
122
- * meaning, accepted values and whether it is required.
123
- */
124
- eps?: string;
125
- /**
126
- * As the connection's clinic defines it: visoft.tools.list answers its
127
- * meaning, accepted values and whether it is required.
128
- */
129
- fonoGroup?: string;
130
- /**
131
- * As the connection's clinic defines it: visoft.tools.list answers its
132
- * meaning, accepted values and whether it is required.
133
- */
134
- intent?: string;
135
- /**
136
- * As the connection's clinic defines it: visoft.tools.list answers its
137
- * meaning, accepted values and whether it is required.
138
- */
139
- medicName?: string;
140
- /**
141
- * As the connection's clinic defines it: visoft.tools.list answers its
142
- * meaning, accepted values and whether it is required.
143
- */
144
- modality?: string;
145
- /**
146
- * As the connection's clinic defines it: visoft.tools.list answers its
147
- * meaning, accepted values and whether it is required.
148
- */
149
- pairWithNext?: boolean;
150
- /**
151
- * As the connection's clinic defines it: visoft.tools.list answers its
152
- * meaning, accepted values and whether it is required.
153
- */
154
- patientAgeMonths?: string;
155
- /**
156
- * As the connection's clinic defines it: visoft.tools.list answers its
157
- * meaning, accepted values and whether it is required.
158
- */
159
- professionalChangeConfirmed?: boolean;
160
- /**
161
- * As the connection's clinic defines it: visoft.tools.list answers its
162
- * meaning, accepted values and whether it is required.
163
- */
164
- regimen?: string;
165
- /**
166
- * As the connection's clinic defines it: visoft.tools.list answers its
167
- * meaning, accepted values and whether it is required.
168
- */
169
- sala?: string;
170
- /**
171
- * As the connection's clinic defines it: visoft.tools.list answers its
172
- * meaning, accepted values and whether it is required.
173
- */
174
- series?: boolean;
175
- /**
176
- * As the connection's clinic defines it: visoft.tools.list answers its
177
- * meaning, accepted values and whether it is required.
178
- */
179
- service?: string;
180
- /**
181
- * As the connection's clinic defines it: visoft.tools.list answers its
182
- * meaning, accepted values and whether it is required.
183
- */
184
- specialty?: string;
185
- /**
186
- * As the connection's clinic defines it: visoft.tools.list answers its
187
- * meaning, accepted values and whether it is required.
188
- */
189
- time?: string;
190
- /**
191
- * As the connection's clinic defines it: visoft.tools.list answers its
192
- * meaning, accepted values and whether it is required.
193
- */
194
- toGroup?: string;
195
- /**
196
- * As the connection's clinic defines it: visoft.tools.list answers its
197
- * meaning, accepted values and whether it is required.
198
- */
199
- token?: string;
200
- /**
201
- * As the connection's clinic defines it: visoft.tools.list answers its
202
- * meaning, accepted values and whether it is required.
203
- */
204
- visitType?: string;
205
- }
206
- export interface CreateResponse {
207
- /**
208
- * The tool's clinical answer. ok:false is a conversational refusal the Agent
209
- * reads (error, errorCode, ai_hint), not a failure.
210
- */
211
- data: VisoftToolResult;
212
- error: null;
213
- metadata: ResponseMetadata;
214
- success: true;
215
- }
38
+ export type CancelRequest = VisoftCancelAppointmentBody;
39
+ export type CancelResponse = VisoftCancellationResponse;
40
+ export type CreateRequest = VisoftCreateAppointmentBody;
41
+ export type CreateResponse = VisoftBookingResponse;
@@ -1,6 +1,7 @@
1
1
  // Code generated by forge. DO NOT EDIT.
2
2
  /* eslint-disable */
3
3
  import { Transport, } from "../../_/index.js";
4
+ import { VisoftBookingResponseCodec, VisoftCancellationResponseCodec, } from "./models.js";
4
5
  export function createClient(options) {
5
6
  return bind(new Transport(options));
6
7
  }
@@ -14,13 +15,13 @@ const CancelOperation = {
14
15
  method: "POST",
15
16
  route: "/v1/visoft/appointments/cancel",
16
17
  body: "flat",
17
- response: null,
18
- errors: { "400": true, "401": true, "403": true, "404": true, "405": true, "409": true, "413": true, "415": true, "422": true, "429": true, "500": true, "502": true, "503": true, "504": true },
18
+ response: VisoftCancellationResponseCodec,
19
+ errors: { "400": true, "401": true, "403": true, "404": true, "409": true, "413": true, "415": true, "422": true, "429": true, "500": true, "502": true, "503": true, "504": true },
19
20
  };
20
21
  const CreateOperation = {
21
22
  method: "POST",
22
23
  route: "/v1/visoft/appointments",
23
24
  body: "flat",
24
- response: null,
25
- errors: { "400": true, "401": true, "403": true, "404": true, "405": true, "409": true, "413": true, "415": true, "422": true, "429": true, "500": true, "502": true, "503": true, "504": true },
25
+ response: VisoftBookingResponseCodec,
26
+ errors: { "400": true, "401": true, "403": true, "404": true, "409": true, "413": true, "415": true, "422": true, "429": true, "500": true, "502": true, "503": true, "504": true },
26
27
  };
@@ -2,3 +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, CancelRequest, CancelResponse, CreateRequest, CreateResponse, } from "./client.js";
5
+ export type { VisoftAppointmentNotCancellableFailure, VisoftAppointmentReferenceInvalidFailure, VisoftAppointmentRequestExistsFailure, VisoftAppointmentRequestExistsFailureData, VisoftBooking, VisoftBookingRefusedFailure, VisoftBookingRefusedFailureData, VisoftBookingResponse, VisoftCancelAppointmentBadGatewayError, VisoftCancelAppointmentBody, VisoftCancelAppointmentConflictError, VisoftCancelAppointmentConflictFailure, VisoftCancelAppointmentUnprocessableContentError, VisoftCancelAppointmentUnprocessableContentFailure, VisoftCancelNoticeRequiredFailure, VisoftCancelTimeUnverifiedFailure, VisoftCancellation, VisoftCancellationRefusedFailure, VisoftCancellationRefusedFailureData, VisoftCancellationResponse, VisoftCreateAppointmentBadGatewayError, VisoftCreateAppointmentBody, VisoftCreateAppointmentConflictError, VisoftCreateAppointmentConflictFailure, VisoftCreateAppointmentUnprocessableContentError, VisoftCreateAppointmentUnprocessableContentFailure, } from "./models.js";
@@ -0,0 +1,391 @@
1
+ import type { CancelAppointmentBadGatewayFailure, ConnectionNotConfiguredFailure, CreateAppointmentBadGatewayFailure, CredentialsRejectedFailure, Empty } from "../../models.js";
2
+ import type { VisoftAgencyNotServedFailure, VisoftResponseMetadata } from "../models.js";
3
+ /**
4
+ * The appointment is no longer cancellable in the patient's current agenda;
5
+ * read the patient again. Nothing was cancelled.
6
+ */
7
+ export interface VisoftAppointmentNotCancellableFailure {
8
+ /**
9
+ * The failure code, stable across releases.
10
+ */
11
+ code: "APPOINTMENT_NOT_CANCELLABLE";
12
+ /**
13
+ * No fields.
14
+ */
15
+ data: Empty;
16
+ /**
17
+ * What went wrong, for people; it never contains input values.
18
+ */
19
+ message: string;
20
+ /**
21
+ * Whether repeating the same request may succeed.
22
+ */
23
+ retryable: false;
24
+ }
25
+ /**
26
+ * The reference is not one a patient's appointments answered. Nothing was
27
+ * cancelled.
28
+ */
29
+ export interface VisoftAppointmentReferenceInvalidFailure {
30
+ /**
31
+ * The failure code, stable across releases.
32
+ */
33
+ code: "APPOINTMENT_REFERENCE_INVALID";
34
+ /**
35
+ * No fields.
36
+ */
37
+ data: Empty;
38
+ /**
39
+ * What went wrong, for people; it never contains input values.
40
+ */
41
+ message: string;
42
+ /**
43
+ * Whether repeating the same request may succeed.
44
+ */
45
+ retryable: false;
46
+ }
47
+ /**
48
+ * The patient already has a requested appointment for that service. Nothing was
49
+ * booked.
50
+ */
51
+ export interface VisoftAppointmentRequestExistsFailure {
52
+ /**
53
+ * The failure code, stable across releases.
54
+ */
55
+ code: "APPOINTMENT_REQUEST_EXISTS";
56
+ data: VisoftAppointmentRequestExistsFailureData;
57
+ /**
58
+ * What went wrong, for people; it never contains input values.
59
+ */
60
+ message: string;
61
+ /**
62
+ * Whether repeating the same request may succeed.
63
+ */
64
+ retryable: false;
65
+ }
66
+ export interface VisoftAppointmentRequestExistsFailureData {
67
+ /**
68
+ * SIIPS's own message, without markup, as its form answered it. Never a
69
+ * credential; read it, never show it to a patient as it is.
70
+ */
71
+ message: string;
72
+ }
73
+ export interface VisoftBooking {
74
+ /**
75
+ * The professional's SIIPS id.
76
+ */
77
+ professionalId: string;
78
+ /**
79
+ * The agenda block the appointment was booked in.
80
+ */
81
+ scheduleId: string;
82
+ /**
83
+ * The moment, as an RFC 3339 instant written in the clinic's own offset (for
84
+ * example "2026-11-04T08:50:00-05:00"), so its first ten characters are the
85
+ * clinic's day and the next eight its hour.
86
+ */
87
+ startsAt: Temporal.Instant;
88
+ /**
89
+ * The appointment's ticket, a PDF SIIPS publishes, when SIIPS answered its
90
+ * number; null otherwise.
91
+ */
92
+ ticketUrl: string | null;
93
+ /**
94
+ * How SIIPS classified the visit.
95
+ */
96
+ visitType: string;
97
+ }
98
+ /**
99
+ * SIIPS refused the booking (data.message says why). Nothing was booked.
100
+ */
101
+ export interface VisoftBookingRefusedFailure {
102
+ /**
103
+ * The failure code, stable across releases.
104
+ */
105
+ code: "BOOKING_REFUSED";
106
+ data: VisoftBookingRefusedFailureData;
107
+ /**
108
+ * What went wrong, for people; it never contains input values.
109
+ */
110
+ message: string;
111
+ /**
112
+ * Whether repeating the same request may succeed.
113
+ */
114
+ retryable: false;
115
+ }
116
+ export interface VisoftBookingRefusedFailureData {
117
+ /**
118
+ * SIIPS's own message, without markup, as its form answered it. Never a
119
+ * credential; read it, never show it to a patient as it is.
120
+ */
121
+ message: string;
122
+ }
123
+ /**
124
+ * A successful answer.
125
+ */
126
+ export interface VisoftBookingResponse {
127
+ data: VisoftBooking;
128
+ error: null;
129
+ /**
130
+ * What every answer carries besides its data or error.
131
+ */
132
+ metadata: VisoftResponseMetadata;
133
+ success: true;
134
+ }
135
+ /**
136
+ * A failed answer.
137
+ */
138
+ export interface VisoftCancelAppointmentBadGatewayError {
139
+ data: null;
140
+ error: CancelAppointmentBadGatewayFailure;
141
+ /**
142
+ * What every answer carries besides its data or error.
143
+ */
144
+ metadata: VisoftResponseMetadata;
145
+ success: false;
146
+ }
147
+ export interface VisoftCancelAppointmentBody {
148
+ /**
149
+ * The connection to run on. Optional when the organization has one Visoft
150
+ * connection; required when it has several. Another organization's connection
151
+ * is CONNECTION_NOT_FOUND.
152
+ */
153
+ connectionId?: string;
154
+ /**
155
+ * The patient's document number: letters and digits only, without dots,
156
+ * spaces or hyphens.
157
+ */
158
+ documentNumber: string;
159
+ /**
160
+ * The document's type, as SIIPS codes it: CC (Cédula de Ciudadanía), TI
161
+ * (Tarjeta de Identidad), RC (Registro Civil), AS (Adulto sin
162
+ * Identificación), CD (Carné Diplomático), CE (Cédula de Extranjería), DE
163
+ * (Documento de Extranjero), CN (Certificado de Nacido Vivo), MS (Menor sin
164
+ * Identificación), SC (Salvoconducto), PE (Permiso Especial de Permanencia),
165
+ * PT (Permiso de Protección Temporal), SI (Sin Identificación), PA
166
+ * (Pasaporte). The patient's own by default.
167
+ */
168
+ documentType?: "CC" | "TI" | "RC" | "AS" | "CD" | "CE" | "DE" | "CN" | "MS" | "SC" | "PE" | "PT" | "SI" | "PA";
169
+ /**
170
+ * Refuse (CANCEL_NOTICE_REQUIRED) when the appointment starts sooner than
171
+ * this: checked against SIIPS's own day and hour, before reading and again
172
+ * right before the write.
173
+ */
174
+ minimumNoticeMinutes?: number;
175
+ /**
176
+ * What SIIPS records with the cancellation; "Peticion cliente" by default.
177
+ */
178
+ observation?: string;
179
+ /**
180
+ * SIIPS's cancellation cause; 06 (Petición cliente) by default.
181
+ */
182
+ reasonCode?: string;
183
+ /**
184
+ * The appointment's reference, exactly as visoft.patients.lookup answered it
185
+ * in history.appointments.
186
+ */
187
+ reference: string;
188
+ }
189
+ /**
190
+ * A failed answer.
191
+ */
192
+ export interface VisoftCancelAppointmentConflictError {
193
+ data: null;
194
+ error: VisoftCancelAppointmentConflictFailure;
195
+ /**
196
+ * What every answer carries besides its data or error.
197
+ */
198
+ metadata: VisoftResponseMetadata;
199
+ success: false;
200
+ }
201
+ export type VisoftCancelAppointmentConflictFailure = ConnectionNotConfiguredFailure | VisoftAppointmentNotCancellableFailure | VisoftCancelNoticeRequiredFailure | VisoftCancelTimeUnverifiedFailure;
202
+ /**
203
+ * A failed answer.
204
+ */
205
+ export interface VisoftCancelAppointmentUnprocessableContentError {
206
+ data: null;
207
+ error: VisoftCancelAppointmentUnprocessableContentFailure;
208
+ /**
209
+ * What every answer carries besides its data or error.
210
+ */
211
+ metadata: VisoftResponseMetadata;
212
+ success: false;
213
+ }
214
+ export type VisoftCancelAppointmentUnprocessableContentFailure = CredentialsRejectedFailure | VisoftAgencyNotServedFailure | VisoftAppointmentReferenceInvalidFailure | VisoftCancellationRefusedFailure;
215
+ /**
216
+ * The appointment starts sooner than the minimum notice the call asked for.
217
+ * Nothing was cancelled.
218
+ */
219
+ export interface VisoftCancelNoticeRequiredFailure {
220
+ /**
221
+ * The failure code, stable across releases.
222
+ */
223
+ code: "CANCEL_NOTICE_REQUIRED";
224
+ /**
225
+ * No fields.
226
+ */
227
+ data: Empty;
228
+ /**
229
+ * What went wrong, for people; it never contains input values.
230
+ */
231
+ message: string;
232
+ /**
233
+ * Whether repeating the same request may succeed.
234
+ */
235
+ retryable: false;
236
+ }
237
+ /**
238
+ * The appointment's day and hour could not be verified against the minimum
239
+ * notice. Nothing was cancelled.
240
+ */
241
+ export interface VisoftCancelTimeUnverifiedFailure {
242
+ /**
243
+ * The failure code, stable across releases.
244
+ */
245
+ code: "CANCEL_TIME_UNVERIFIED";
246
+ /**
247
+ * No fields.
248
+ */
249
+ data: Empty;
250
+ /**
251
+ * What went wrong, for people; it never contains input values.
252
+ */
253
+ message: string;
254
+ /**
255
+ * Whether repeating the same request may succeed.
256
+ */
257
+ retryable: false;
258
+ }
259
+ export interface VisoftCancellation {
260
+ /**
261
+ * The professional's SIIPS id.
262
+ */
263
+ professionalId: string;
264
+ /**
265
+ * The agenda block the appointment was in.
266
+ */
267
+ scheduleId: string;
268
+ /**
269
+ * The moment, as an RFC 3339 instant written in the clinic's own offset (for
270
+ * example "2026-11-04T08:50:00-05:00"), so its first ten characters are the
271
+ * clinic's day and the next eight its hour.
272
+ */
273
+ startsAt: Temporal.Instant;
274
+ }
275
+ /**
276
+ * SIIPS did not confirm the cancellation (data.message says why). Nothing is
277
+ * retried.
278
+ */
279
+ export interface VisoftCancellationRefusedFailure {
280
+ /**
281
+ * The failure code, stable across releases.
282
+ */
283
+ code: "CANCELLATION_REFUSED";
284
+ data: VisoftCancellationRefusedFailureData;
285
+ /**
286
+ * What went wrong, for people; it never contains input values.
287
+ */
288
+ message: string;
289
+ /**
290
+ * Whether repeating the same request may succeed.
291
+ */
292
+ retryable: false;
293
+ }
294
+ export interface VisoftCancellationRefusedFailureData {
295
+ /**
296
+ * SIIPS's own message, without markup, as its form answered it. Never a
297
+ * credential; read it, never show it to a patient as it is.
298
+ */
299
+ message: string;
300
+ }
301
+ /**
302
+ * A successful answer.
303
+ */
304
+ export interface VisoftCancellationResponse {
305
+ data: VisoftCancellation;
306
+ error: null;
307
+ /**
308
+ * What every answer carries besides its data or error.
309
+ */
310
+ metadata: VisoftResponseMetadata;
311
+ success: true;
312
+ }
313
+ /**
314
+ * A failed answer.
315
+ */
316
+ export interface VisoftCreateAppointmentBadGatewayError {
317
+ data: null;
318
+ error: CreateAppointmentBadGatewayFailure;
319
+ /**
320
+ * What every answer carries besides its data or error.
321
+ */
322
+ metadata: VisoftResponseMetadata;
323
+ success: false;
324
+ }
325
+ export interface VisoftCreateAppointmentBody {
326
+ /**
327
+ * The connection to run on. Optional when the organization has one Visoft
328
+ * connection; required when it has several. Another organization's connection
329
+ * is CONNECTION_NOT_FOUND.
330
+ */
331
+ connectionId?: string;
332
+ /**
333
+ * The patient's document number: letters and digits only, without dots,
334
+ * spaces or hyphens.
335
+ */
336
+ documentNumber: string;
337
+ /**
338
+ * The document's type, as SIIPS codes it: CC (Cédula de Ciudadanía), TI
339
+ * (Tarjeta de Identidad), RC (Registro Civil), AS (Adulto sin
340
+ * Identificación), CD (Carné Diplomático), CE (Cédula de Extranjería), DE
341
+ * (Documento de Extranjero), CN (Certificado de Nacido Vivo), MS (Menor sin
342
+ * Identificación), SC (Salvoconducto), PE (Permiso Especial de Permanencia),
343
+ * PT (Permiso de Protección Temporal), SI (Sin Identificación), PA
344
+ * (Pasaporte). CC by default.
345
+ */
346
+ documentType?: "CC" | "TI" | "RC" | "AS" | "CD" | "CE" | "DE" | "CN" | "MS" | "SC" | "PE" | "PT" | "SI" | "PA";
347
+ /**
348
+ * The free slot, by its reference, and the contract and service the search
349
+ * that found it named.
350
+ */
351
+ slot: {
352
+ contractCode: string;
353
+ reference: string;
354
+ serviceCode: string;
355
+ };
356
+ /**
357
+ * How SIIPS classifies the visit: 1 (1ra Vez), C (Control), G (General), R
358
+ * (Remision), S (Sesion), V (Valoracion). 1 by default.
359
+ */
360
+ visitType?: "1" | "C" | "G" | "R" | "S" | "V";
361
+ }
362
+ /**
363
+ * A failed answer.
364
+ */
365
+ export interface VisoftCreateAppointmentConflictError {
366
+ data: null;
367
+ error: VisoftCreateAppointmentConflictFailure;
368
+ /**
369
+ * What every answer carries besides its data or error.
370
+ */
371
+ metadata: VisoftResponseMetadata;
372
+ success: false;
373
+ }
374
+ export type VisoftCreateAppointmentConflictFailure = ConnectionNotConfiguredFailure | VisoftAppointmentRequestExistsFailure;
375
+ /**
376
+ * A failed answer.
377
+ */
378
+ export interface VisoftCreateAppointmentUnprocessableContentError {
379
+ data: null;
380
+ error: VisoftCreateAppointmentUnprocessableContentFailure;
381
+ /**
382
+ * What every answer carries besides its data or error.
383
+ */
384
+ metadata: VisoftResponseMetadata;
385
+ success: false;
386
+ }
387
+ export type VisoftCreateAppointmentUnprocessableContentFailure = CredentialsRejectedFailure | VisoftAgencyNotServedFailure | VisoftBookingRefusedFailure;
388
+ export declare const VisoftBookingCodec: import("../../_/codec.js").Codec;
389
+ export declare const VisoftBookingResponseCodec: import("../../_/codec.js").Codec;
390
+ export declare const VisoftCancellationCodec: import("../../_/codec.js").Codec;
391
+ export declare const VisoftCancellationResponseCodec: import("../../_/codec.js").Codec;
@@ -0,0 +1,15 @@
1
+ // Code generated by forge. DO NOT EDIT.
2
+ /* eslint-disable */
3
+ import { instant, object } from "../../_/index.js";
4
+ export const VisoftBookingCodec = object([
5
+ ["startsAt", null, instant],
6
+ ]);
7
+ export const VisoftBookingResponseCodec = object([
8
+ ["data", null, () => VisoftBookingCodec],
9
+ ]);
10
+ export const VisoftCancellationCodec = object([
11
+ ["startsAt", null, instant],
12
+ ]);
13
+ export const VisoftCancellationResponseCodec = object([
14
+ ["data", null, () => VisoftCancellationCodec],
15
+ ]);