@arbol-ai/sdk 4.0.0 → 5.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 (230) hide show
  1. package/README.md +15 -3
  2. package/dist/agenda/appointments/client.d.ts +165 -52
  3. package/dist/agenda/appointments/client.js +19 -11
  4. package/dist/agenda/appointments/index.d.ts +1 -1
  5. package/dist/agenda/availability/client.d.ts +11 -72
  6. package/dist/agenda/availability/client.js +5 -14
  7. package/dist/agenda/availability/index.d.ts +1 -1
  8. package/dist/agenda/bookingLocations/client.d.ts +51 -0
  9. package/dist/agenda/bookingLocations/client.js +19 -0
  10. package/dist/agenda/bookingLocations/index.d.ts +4 -0
  11. package/dist/agenda/bookingLocations/index.js +4 -0
  12. package/dist/agenda/bookingOfferings/client.d.ts +82 -0
  13. package/dist/agenda/bookingOfferings/client.js +18 -0
  14. package/dist/agenda/bookingOfferings/index.d.ts +5 -0
  15. package/dist/agenda/bookingOfferings/index.js +4 -0
  16. package/dist/agenda/bookingOfferings/models.d.ts +92 -0
  17. package/dist/agenda/bookingOfferings/models.js +3 -0
  18. package/dist/agenda/bookingRequirements/client.d.ts +118 -0
  19. package/dist/agenda/bookingRequirements/client.js +18 -0
  20. package/dist/agenda/bookingRequirements/index.d.ts +4 -0
  21. package/dist/agenda/bookingRequirements/index.js +4 -0
  22. package/dist/agenda/bookingSlots/client.d.ts +78 -0
  23. package/dist/agenda/bookingSlots/client.js +19 -0
  24. package/dist/agenda/bookingSlots/index.d.ts +4 -0
  25. package/dist/agenda/bookingSlots/index.js +4 -0
  26. package/dist/agenda/bookings/client.d.ts +44 -375
  27. package/dist/agenda/bookings/client.js +10 -52
  28. package/dist/agenda/bookings/index.d.ts +2 -2
  29. package/dist/agenda/bookings/models.d.ts +0 -92
  30. package/dist/agenda/client.d.ts +14 -0
  31. package/dist/agenda/client.js +35 -0
  32. package/dist/agenda/firstAvailability/client.d.ts +74 -0
  33. package/dist/agenda/firstAvailability/client.js +19 -0
  34. package/dist/agenda/firstAvailability/index.d.ts +5 -0
  35. package/dist/agenda/firstAvailability/index.js +4 -0
  36. package/dist/agenda/firstAvailability/models.d.ts +31 -0
  37. package/dist/agenda/firstAvailability/models.js +7 -0
  38. package/dist/agenda/index.d.ts +1 -1
  39. package/dist/agenda/models.d.ts +19 -94
  40. package/dist/agenda/models.js +0 -3
  41. package/dist/agenda/nearestBookingSlots/client.d.ts +93 -0
  42. package/dist/agenda/nearestBookingSlots/client.js +19 -0
  43. package/dist/agenda/nearestBookingSlots/index.d.ts +5 -0
  44. package/dist/agenda/nearestBookingSlots/index.js +4 -0
  45. package/dist/agenda/nearestBookingSlots/models.d.ts +38 -0
  46. package/dist/agenda/nearestBookingSlots/models.js +7 -0
  47. package/dist/agenda/offerings/client.d.ts +2 -2
  48. package/dist/agenda/offerings/client.js +1 -1
  49. package/dist/agenda/resourceSchedules/client.d.ts +75 -0
  50. package/dist/agenda/resourceSchedules/client.js +19 -0
  51. package/dist/agenda/resourceSchedules/index.d.ts +4 -0
  52. package/dist/agenda/resourceSchedules/index.js +4 -0
  53. package/dist/agenda/resources/client.d.ts +2 -2
  54. package/dist/agenda/resources/client.js +1 -1
  55. package/dist/agenda/scheduleRules/client.d.ts +125 -85
  56. package/dist/agenda/scheduleRules/client.js +17 -16
  57. package/dist/agenda/scheduleRules/index.d.ts +2 -1
  58. package/dist/agenda/scheduleRules/models.d.ts +33 -0
  59. package/dist/agenda/scheduleRules/models.js +6 -0
  60. package/dist/agenda/services/client.d.ts +2 -2
  61. package/dist/agenda/services/client.js +1 -1
  62. package/dist/agenda/waitlist/client.d.ts +40 -29
  63. package/dist/agenda/waitlist/client.js +4 -4
  64. package/dist/agenda/waitlist/index.d.ts +1 -1
  65. package/dist/agenda/waitlist/models.d.ts +17 -0
  66. package/dist/agenda/waitlist/models.js +4 -1
  67. package/dist/axxa/authorizations/client.d.ts +3 -35
  68. package/dist/axxa/authorizations/client.js +1 -1
  69. package/dist/axxa/authorizations/index.d.ts +1 -0
  70. package/dist/axxa/authorizations/models.d.ts +112 -0
  71. package/dist/axxa/authorizations/models.js +3 -0
  72. package/dist/axxa/connections/client.d.ts +19 -45
  73. package/dist/axxa/connections/client.js +10 -11
  74. package/dist/axxa/connections/index.d.ts +1 -0
  75. package/dist/axxa/connections/models.d.ts +269 -0
  76. package/dist/axxa/connections/models.js +3 -0
  77. package/dist/axxa/eligibility/client.d.ts +3 -25
  78. package/dist/axxa/eligibility/client.js +1 -1
  79. package/dist/axxa/eligibility/index.d.ts +1 -0
  80. package/dist/axxa/eligibility/models.d.ts +102 -0
  81. package/dist/axxa/eligibility/models.js +3 -0
  82. package/dist/axxa/index.d.ts +1 -1
  83. package/dist/axxa/models.d.ts +243 -168
  84. package/dist/axxa/provider/client.d.ts +5 -11
  85. package/dist/axxa/provider/client.js +1 -1
  86. package/dist/axxa/provider/index.d.ts +1 -0
  87. package/dist/axxa/provider/models.d.ts +87 -0
  88. package/dist/axxa/provider/models.js +3 -0
  89. package/dist/gmedic/agendaServices/client.d.ts +13 -9
  90. package/dist/gmedic/agendaServices/client.js +2 -2
  91. package/dist/gmedic/agendaServices/index.d.ts +1 -1
  92. package/dist/gmedic/agendaServices/models.d.ts +53 -1
  93. package/dist/gmedic/agendas/client.d.ts +16 -9
  94. package/dist/gmedic/agendas/client.js +2 -2
  95. package/dist/gmedic/agendas/index.d.ts +1 -1
  96. package/dist/gmedic/agendas/models.d.ts +53 -1
  97. package/dist/gmedic/appointments/client.d.ts +34 -241
  98. package/dist/gmedic/appointments/client.js +12 -10
  99. package/dist/gmedic/appointments/index.d.ts +1 -1
  100. package/dist/gmedic/appointments/models.d.ts +518 -1
  101. package/dist/gmedic/appointments/models.js +28 -2
  102. package/dist/gmedic/availability/client.d.ts +24 -10
  103. package/dist/gmedic/availability/client.js +4 -3
  104. package/dist/gmedic/availability/index.d.ts +1 -1
  105. package/dist/gmedic/availability/models.d.ts +57 -1
  106. package/dist/gmedic/availability/models.js +7 -1
  107. package/dist/gmedic/availableDays/client.d.ts +11 -8
  108. package/dist/gmedic/availableDays/client.js +1 -1
  109. package/dist/gmedic/availableDays/index.d.ts +1 -1
  110. package/dist/gmedic/availableDays/models.d.ts +53 -1
  111. package/dist/gmedic/branchOffices/client.d.ts +13 -9
  112. package/dist/gmedic/branchOffices/client.js +2 -2
  113. package/dist/gmedic/branchOffices/index.d.ts +1 -1
  114. package/dist/gmedic/branchOffices/models.d.ts +58 -1
  115. package/dist/gmedic/connections/client.d.ts +19 -42
  116. package/dist/gmedic/connections/client.js +10 -11
  117. package/dist/gmedic/connections/index.d.ts +1 -0
  118. package/dist/gmedic/connections/models.d.ts +162 -0
  119. package/dist/gmedic/connections/models.js +3 -0
  120. package/dist/gmedic/dictionaryEntries/client.d.ts +20 -10
  121. package/dist/gmedic/dictionaryEntries/client.js +2 -2
  122. package/dist/gmedic/dictionaryEntries/index.d.ts +1 -1
  123. package/dist/gmedic/dictionaryEntries/models.d.ts +53 -1
  124. package/dist/gmedic/healthPartners/client.d.ts +19 -9
  125. package/dist/gmedic/healthPartners/client.js +2 -2
  126. package/dist/gmedic/healthPartners/index.d.ts +1 -1
  127. package/dist/gmedic/healthPartners/models.d.ts +53 -1
  128. package/dist/gmedic/healthPromotionEntities/client.d.ts +20 -10
  129. package/dist/gmedic/healthPromotionEntities/client.js +2 -2
  130. package/dist/gmedic/healthPromotionEntities/index.d.ts +1 -1
  131. package/dist/gmedic/healthPromotionEntities/models.d.ts +53 -1
  132. package/dist/gmedic/index.d.ts +1 -1
  133. package/dist/gmedic/laboralRiskManagers/client.d.ts +20 -10
  134. package/dist/gmedic/laboralRiskManagers/client.js +2 -2
  135. package/dist/gmedic/laboralRiskManagers/index.d.ts +1 -1
  136. package/dist/gmedic/laboralRiskManagers/models.d.ts +53 -1
  137. package/dist/gmedic/models.d.ts +194 -133
  138. package/dist/gmedic/occupations/client.d.ts +19 -9
  139. package/dist/gmedic/occupations/client.js +2 -2
  140. package/dist/gmedic/occupations/index.d.ts +1 -1
  141. package/dist/gmedic/occupations/models.d.ts +53 -1
  142. package/dist/gmedic/patientNotes/client.d.ts +25 -55
  143. package/dist/gmedic/patientNotes/client.js +5 -5
  144. package/dist/gmedic/patientNotes/index.d.ts +1 -1
  145. package/dist/gmedic/patientNotes/models.d.ts +232 -1
  146. package/dist/gmedic/patients/client.d.ts +40 -359
  147. package/dist/gmedic/patients/client.js +13 -5
  148. package/dist/gmedic/patients/index.d.ts +2 -2
  149. package/dist/gmedic/patients/models.d.ts +795 -1
  150. package/dist/gmedic/services/client.d.ts +22 -16
  151. package/dist/gmedic/services/client.js +2 -2
  152. package/dist/gmedic/services/index.d.ts +1 -1
  153. package/dist/gmedic/services/models.d.ts +53 -3
  154. package/dist/gmedic/sessionPackages/client.d.ts +21 -58
  155. package/dist/gmedic/sessionPackages/client.js +5 -5
  156. package/dist/gmedic/sessionPackages/index.d.ts +1 -1
  157. package/dist/gmedic/sessionPackages/models.d.ts +183 -1
  158. package/dist/index.d.ts +1 -1
  159. package/dist/models.d.ts +61 -0
  160. package/dist/models.js +6 -0
  161. package/dist/nuevaEps/affiliations/client.js +1 -1
  162. package/dist/nuevaEps/affiliations/models.d.ts +3 -1
  163. package/dist/nuevaEps/connections/client.d.ts +9 -9
  164. package/dist/nuevaEps/connections/client.js +9 -9
  165. package/dist/nuevaEps/connections/index.d.ts +1 -1
  166. package/dist/nuevaEps/connections/models.d.ts +1 -47
  167. package/dist/nuevaEps/connections/models.js +1 -8
  168. package/dist/sura/affiliations/client.d.ts +3 -35
  169. package/dist/sura/affiliations/client.js +6 -6
  170. package/dist/sura/affiliations/index.d.ts +1 -0
  171. package/dist/sura/affiliations/models.d.ts +71 -0
  172. package/dist/sura/affiliations/models.js +8 -0
  173. package/dist/sura/appointments/client.d.ts +27 -327
  174. package/dist/sura/appointments/client.js +15 -21
  175. package/dist/sura/appointments/index.d.ts +2 -1
  176. package/dist/sura/appointments/models.d.ts +310 -0
  177. package/dist/sura/appointments/models.js +22 -0
  178. package/dist/sura/authorizations/client.d.ts +3 -43
  179. package/dist/sura/authorizations/client.js +6 -6
  180. package/dist/sura/authorizations/index.d.ts +1 -0
  181. package/dist/sura/authorizations/models.d.ts +79 -0
  182. package/dist/sura/authorizations/models.js +8 -0
  183. package/dist/sura/availability/client.d.ts +4 -68
  184. package/dist/sura/availability/client.js +9 -9
  185. package/dist/sura/availability/index.d.ts +2 -1
  186. package/dist/sura/availability/models.d.ts +103 -0
  187. package/dist/sura/availability/models.js +8 -0
  188. package/dist/sura/bookingOptions/client.d.ts +35 -0
  189. package/dist/sura/bookingOptions/client.js +19 -0
  190. package/dist/sura/bookingOptions/index.d.ts +5 -0
  191. package/dist/sura/bookingOptions/index.js +4 -0
  192. package/dist/sura/bookingOptions/models.d.ts +143 -0
  193. package/dist/sura/bookingOptions/models.js +8 -0
  194. package/dist/sura/client.d.ts +2 -0
  195. package/dist/sura/client.js +5 -0
  196. package/dist/sura/connections/client.d.ts +20 -98
  197. package/dist/sura/connections/client.js +10 -10
  198. package/dist/sura/connections/index.d.ts +1 -1
  199. package/dist/sura/connections/models.d.ts +102 -1
  200. package/dist/sura/connections/models.js +6 -0
  201. package/dist/sura/copays/client.d.ts +4 -40
  202. package/dist/sura/copays/client.js +9 -9
  203. package/dist/sura/copays/index.d.ts +2 -1
  204. package/dist/sura/copays/models.d.ts +75 -0
  205. package/dist/sura/copays/models.js +8 -0
  206. package/dist/sura/index.d.ts +1 -1
  207. package/dist/sura/models.d.ts +204 -148
  208. package/dist/sura/models.js +20 -1
  209. package/dist/sura/operations/client.d.ts +2 -7
  210. package/dist/sura/operations/client.js +4 -4
  211. package/dist/sura/operations/index.d.ts +1 -0
  212. package/dist/sura/operations/models.d.ts +43 -0
  213. package/dist/sura/operations/models.js +8 -0
  214. package/dist/sura/patients/client.d.ts +3 -40
  215. package/dist/sura/patients/client.js +6 -6
  216. package/dist/sura/patients/index.d.ts +1 -0
  217. package/dist/sura/patients/models.d.ts +76 -0
  218. package/dist/sura/patients/models.js +8 -0
  219. package/dist/sura/professionals/client.d.ts +7 -9
  220. package/dist/sura/professionals/client.js +3 -4
  221. package/dist/sura/professionals/index.d.ts +1 -1
  222. package/dist/sura/professionals/models.d.ts +40 -1
  223. package/dist/sura/services/client.d.ts +7 -8
  224. package/dist/sura/services/client.js +3 -4
  225. package/dist/sura/services/index.d.ts +1 -0
  226. package/dist/sura/services/models.d.ts +40 -0
  227. package/dist/sura/services/models.js +3 -0
  228. package/dist/visoft/index.d.ts +1 -1
  229. package/dist/visoft/models.d.ts +1 -16
  230. package/package.json +3 -3
@@ -1,5 +1,5 @@
1
1
  import { type BaseClientOptions, type RequestOptions, Transport } from "../../_/index.js";
2
- import { type SuraAppointmentPage, type SuraBookedAppointment, type SuraCancelledAppointment, type SuraPatientNotFound, type SuraPendingResult, type SuraPreparationAvailable, type SuraPreparationExistingAppointment, type SuraPreparationNoSlots, type SuraPreparationPatientNotFound, type SuraRefusal, type SuraResponseMetadata } from "../models.js";
2
+ import { type SuraBookAppointmentBody, type SuraBookAppointmentResultResponse, type SuraCancelAppointmentBody, type SuraCancelAppointmentResultResponse, type SuraListAppointmentsBody, type SuraListAppointmentsResultResponse } from "./models.js";
3
3
  export interface ClientOptions extends BaseClientOptions {
4
4
  /**
5
5
  * The URL the paths of the API are relative to.
@@ -10,21 +10,24 @@ export interface Client {
10
10
  /**
11
11
  * Cancel an appointment
12
12
  *
13
- * Cancel one appointment the patient already has, identified by its date and
14
- * time. Confirm with the caller which appointment, in their own words, before
15
- * calling. Only appointments at this clinic can be cancelled here. ok:true
16
- * with cancelled:true means it is gone; anything else means it is not, so
17
- * never tell the caller it was cancelled without that.
13
+ * Cancel one appointment the patient already has, identified by its moment:
14
+ * startsAt, exactly as list_appointments answered it (or the former date and
15
+ * time). Confirm with the caller which appointment, in their own words,
16
+ * before calling. Only appointments at this clinic can be cancelled here.
17
+ * ok:true with cancelled:true means it is gone; anything else means it is
18
+ * not, so never tell the caller it was cancelled without that.
18
19
  */
19
20
  cancel(request: CancelRequest, options?: RequestOptions): Promise<CancelResponse>;
20
21
  /**
21
22
  * Book an appointment
22
23
  *
23
- * Book one appointment at an exact date and time for one patient. Only call
24
- * it after the caller has confirmed the day, the hour and the service out
25
- * loud. The time must be one that find_availability just returned; the tool
26
- * re-checks it against the live agenda and refuses if it was taken in the
27
- * meantime. ok:true with booked:true means the appointment exists.
24
+ * Book one appointment at an exact moment for one patient: startsAt, exactly
25
+ * as an option or the ready booking arguments answered it (or the former date
26
+ * and time). Only call it after the caller has confirmed the day, the hour
27
+ * and the service out loud. The moment must be one that find_availability
28
+ * just returned; the tool re-checks it against the live agenda and refuses if
29
+ * it was taken in the meantime. ok:true with booked:true means the
30
+ * appointment exists.
28
31
  */
29
32
  create(request: CreateRequest, options?: RequestOptions): Promise<CreateResponse>;
30
33
  /**
@@ -36,323 +39,20 @@ export interface Client {
36
39
  * pageInfo.nextCursor to read the rest before telling the caller what they
37
40
  * have. Use it before cancelling, and whenever the caller asks what they
38
41
  * have. Read out only the date, the hour and the service; to cancel one, pass
39
- * that same date and hour to cancel_appointment. Entries with
40
- * cancellable:false belong to a different clinic and cannot be cancelled from
41
- * this line — read them out, but send the caller to that clinic to change
42
- * them. An empty page means the patient has nothing pending (offer to book:
43
- * ask which service and use find_availability); a document the portal does
44
- * not know answers found:false instead, never an empty page.
42
+ * its startsAt to cancel_appointment. Entries with cancellable:false belong
43
+ * to a different clinic and cannot be cancelled from this line — read them
44
+ * out, but send the caller to that clinic to change them. An empty page means
45
+ * the patient has nothing pending (offer to book: ask which service and use
46
+ * find_availability); a document the portal does not know answers found:false
47
+ * instead, never an empty page.
45
48
  */
46
- list(request: ListRequest, options?: RequestOptions): Promise<ListResponse>;
47
- /**
48
- * Prepare an appointment
49
- *
50
- * Prepare a SURA appointment in ONE read-only call. With patient identity and
51
- * the ordered service, first checks existing appointments; if one matches,
52
- * returns it and stops. Otherwise resolves patient, live service/area and
53
- * professional names internally and reads availability, checking bounded date
54
- * and professional alternatives while preserving explicit doctor/date/expiry
55
- * constraints. Returns patient.primaryIps, actual service/professional, times
56
- * and ready booking arguments. Use after the required document review,
57
- * instead of chaining list_appointments, lookup_patient, list_services and
58
- * find_availability. It NEVER books, cancels, changes an appointment or
59
- * verifies the documents for you. Apply clinic eligibility to the result,
60
- * offer up to three chronological verified options from options; nextDates
61
- * are calendar hints that require an hour lookup, never confirmed slots. Use
62
- * fromDate for later alternatives and preserve explicit date, doctor and time
63
- * preferences. Propose an actual slot and obtain one confirmation before the
64
- * separate book_appointment call. Existing-appointment-only questions still
65
- * use list_appointments.
66
- */
67
- prepare(request: PrepareRequest, options?: RequestOptions): Promise<PrepareResponse>;
49
+ lookup(request: LookupRequest, options?: RequestOptions): Promise<LookupResponse>;
68
50
  }
69
51
  export declare function createClient(options: ClientOptions): Client;
70
52
  export declare function bind(transport: Transport): Client;
71
- export interface CancelRequest {
72
- /**
73
- * Set agentMode=true when calling this tool for an AI agent. The answer is
74
- * concise Spanish text instead of JSON. Omit it for structured machine data.
75
- * This changes presentation only, never authorization, consent or
76
- * idempotency.
77
- */
78
- agentMode?: boolean;
79
- /**
80
- * The channel the caller is waiting on, which sets how long it waits before
81
- * an answer comes back pending, and puts a phone call's reads ahead of
82
- * others. Defaults to web.
83
- */
84
- channel?: "voice" | "whatsapp" | "web";
85
- /**
86
- * Which of the organization's SURA connections to run on, by its id. Optional
87
- * while the organization has one; required when it has several.
88
- */
89
- connectionId?: string;
90
- /**
91
- * The appointment's day as YYYY-MM-DD, exactly as list_appointments returned
92
- * it.
93
- */
94
- date: string;
95
- /**
96
- * Complete document number of the patient receiving care, from readable
97
- * original evidence or their message. Normalize separators without changing
98
- * digits. Request correction only for missing, illegible or conflicting
99
- * identity; never guess digits.
100
- */
101
- documentNumber: string;
102
- /**
103
- * Patient document type read legibly from the original or explicitly
104
- * supplied. Ask only if unknown or genuinely conflicting; never infer it from
105
- * age or number length.
106
- */
107
- documentType: "ASI" | "CC" | "CD" | "CE" | "CN" | "DE" | "IFE" | "MS" | "NIT" | "NUIP" | "PA" | "PC" | "PD" | "PE" | "PF" | "PT" | "RC" | "RCP" | "RES" | "SC" | "TE" | "TI";
108
- /**
109
- * Why it is being cancelled. Defaults to patient_request. Use reschedule when
110
- * the caller wants a different time and you are about to book another one.
111
- */
112
- reason?: "patient_request" | "reschedule" | "provider_request" | null;
113
- /**
114
- * Only needed when the patient has more than one appointment at that exact
115
- * date and time, which the tool will tell you.
116
- */
117
- serviceId?: string | null;
118
- /**
119
- * The appointment's hour as HH:MM, exactly as list_appointments returned it.
120
- */
121
- time: string;
122
- }
123
- export interface CancelResponse {
124
- data: SuraPendingResult | SuraRefusal | SuraPatientNotFound | SuraCancelledAppointment;
125
- error: null;
126
- metadata: SuraResponseMetadata;
127
- success: true;
128
- }
129
- export interface CreateRequest {
130
- /**
131
- * Set agentMode=true when calling this tool for an AI agent. The answer is
132
- * concise Spanish text instead of JSON. Omit it for structured machine data.
133
- * This changes presentation only, never authorization, consent or
134
- * idempotency.
135
- */
136
- agentMode?: boolean;
137
- /**
138
- * The areaId list_services returned beside that service. Pass it with an
139
- * exact serviceId to skip a catalog lookup; omit it whenever you are naming
140
- * the service in words.
141
- */
142
- areaId?: string | null;
143
- /**
144
- * The channel the caller is waiting on, which sets how long it waits before
145
- * an answer comes back pending, and puts a phone call's reads ahead of
146
- * others. Defaults to web.
147
- */
148
- channel?: "voice" | "whatsapp" | "web";
149
- /**
150
- * Which of the organization's SURA connections to run on, by its id. Optional
151
- * while the organization has one; required when it has several.
152
- */
153
- connectionId?: string;
154
- /**
155
- * The day the caller agreed to, as YYYY-MM-DD, exactly as find_availability
156
- * returned it.
157
- */
158
- date: string;
159
- /**
160
- * Complete document number of the patient receiving care, from readable
161
- * original evidence or their message. Normalize separators without changing
162
- * digits. Request correction only for missing, illegible or conflicting
163
- * identity; never guess digits.
164
- */
165
- documentNumber: string;
166
- /**
167
- * Patient document type read legibly from the original or explicitly
168
- * supplied. Ask only if unknown or genuinely conflicting; never infer it from
169
- * age or number length.
170
- */
171
- documentType: "ASI" | "CC" | "CD" | "CE" | "CN" | "DE" | "IFE" | "MS" | "NIT" | "NUIP" | "PA" | "PC" | "PD" | "PE" | "PF" | "PT" | "RC" | "RCP" | "RES" | "SC" | "TE" | "TI";
172
- /**
173
- * Stable 32-character lowercase hexadecimal command key supplied by a trusted
174
- * coordinator. Reuse it only for the same accepted offer.
175
- */
176
- idempotencyKey?: string | null;
177
- /**
178
- * Doctor's name when the caller chose one. Pass the same value used in
179
- * find_availability, so the hour booked is that doctor's.
180
- */
181
- professional?: string | null;
182
- /**
183
- * What the appointment is for: either an id from list_services or the
184
- * service's own name, in the caller's words ("neurología", "control"). A name
185
- * that matches more than one service is answered with the choices, so you can
186
- * ask which one instead of guessing.
187
- */
188
- serviceId: string;
189
- /**
190
- * The hour the caller agreed to, as HH:MM on a 24-hour clock, exactly as it
191
- * appeared in find_availability's times[].
192
- */
193
- time: string;
194
- }
195
- export interface CreateResponse {
196
- data: SuraPendingResult | SuraRefusal | SuraPatientNotFound | SuraBookedAppointment;
197
- error: null;
198
- metadata: SuraResponseMetadata;
199
- success: true;
200
- }
201
- export interface ListRequest {
202
- /**
203
- * Complete document number of the patient receiving care, from readable
204
- * original evidence or their message. Normalize separators without changing
205
- * digits. Request correction only for missing, illegible or conflicting
206
- * identity; never guess digits.
207
- */
208
- documentNumber: string;
209
- /**
210
- * Patient document type read legibly from the original or explicitly
211
- * supplied. Ask only if unknown or genuinely conflicting; never infer it from
212
- * age or number length.
213
- */
214
- documentType: "ASI" | "CC" | "CD" | "CE" | "CN" | "DE" | "IFE" | "MS" | "NIT" | "NUIP" | "PA" | "PC" | "PD" | "PE" | "PF" | "PT" | "RC" | "RCP" | "RES" | "SC" | "TE" | "TI";
215
- /**
216
- * Opaque cursor returned by pageInfo; omit it to request the first page.
217
- */
218
- cursor?: string;
219
- /**
220
- * Direction to traverse the stable keyset ordering from the supplied cursor.
221
- */
222
- direction?: "forward" | "backward";
223
- /**
224
- * Maximum items returned in one page. Defaults to 25; larger reads require
225
- * another cursor.
226
- */
227
- limit?: number;
228
- /**
229
- * Set agentMode=true when calling this tool for an AI agent. The answer is
230
- * concise Spanish text instead of JSON. Omit it for structured machine data.
231
- * This changes presentation only, never authorization, consent or
232
- * idempotency.
233
- */
234
- agentMode?: boolean;
235
- /**
236
- * Which of the organization's SURA connections to run on, by its id. Optional
237
- * while the organization has one; required when it has several.
238
- */
239
- connectionId?: string;
240
- /**
241
- * The channel the caller is waiting on, which sets how long it waits before
242
- * an answer comes back pending, and puts a phone call's reads ahead of
243
- * others. Defaults to web.
244
- */
245
- channel?: "voice" | "whatsapp" | "web";
246
- }
247
- export interface ListResponse {
248
- data: SuraPendingResult | SuraRefusal | SuraPatientNotFound | SuraAppointmentPage;
249
- error: null;
250
- metadata: SuraResponseMetadata;
251
- success: true;
252
- }
253
- export interface PrepareRequest {
254
- /**
255
- * The areaId list_services returned beside that service. Pass it with an
256
- * exact serviceId to skip a catalog lookup; omit it whenever you are naming
257
- * the service in words.
258
- */
259
- areaId?: string | null;
260
- /**
261
- * A day the person asked for, as YYYY-MM-DD. Its openings come first; when it
262
- * has none, the openings nearest to it on either side are offered instead and
263
- * requestedDateAvailable is false. Omit it for the soonest openings. Resolve
264
- * relative dates like "mañana" against the clinic's own timezone before
265
- * calling.
266
- */
267
- date?: string | null;
268
- /**
269
- * Complete document number of the patient receiving care, from readable
270
- * original evidence or their message. Normalize separators without changing
271
- * digits. Request correction only for missing, illegible or conflicting
272
- * identity; never guess digits.
273
- */
274
- documentNumber: string;
275
- /**
276
- * Patient document type read legibly from the original or explicitly
277
- * supplied. Ask only if unknown or genuinely conflicting; never infer it from
278
- * age or number length.
279
- */
280
- documentType: "ASI" | "CC" | "CD" | "CE" | "CN" | "DE" | "IFE" | "MS" | "NIT" | "NUIP" | "PA" | "PC" | "PD" | "PE" | "PF" | "PT" | "RC" | "RCP" | "RES" | "SC" | "TE" | "TI";
281
- /**
282
- * Whether other doctors of this service may be offered when the named doctor
283
- * has no opening in the searched window. Defaults to true: the named doctor's
284
- * openings come first, and only when that doctor has none are the other
285
- * doctors' nearest openings returned, with requestedProfessionalAvailable
286
- * false. Name the actual doctor of each option and obtain consent before
287
- * booking. False keeps the named doctor as a strict filter.
288
- */
289
- allowOtherProfessionals?: "true" | "false" | null;
290
- /**
291
- * Search from this day onward (YYYY-MM-DD), using the live calendar. Omit for
292
- * today. Use date for a specific day.
293
- */
294
- fromDate?: string | null;
295
- /**
296
- * Earliest acceptable time, HH:mm, inclusive.
297
- */
298
- timeFrom?: string | null;
299
- /**
300
- * Latest acceptable time, HH:mm, inclusive.
301
- */
302
- timeUntil?: string | null;
303
- /**
304
- * Number of chronological verified slots to return, defaults to 3. Proposals
305
- * never hold capacity.
306
- */
307
- limit?: "1" | "2" | "3" | null;
308
- /**
309
- * Explicit authorization expiry or latest date the person accepts,
310
- * YYYY-MM-DD. Returned slots cannot exceed this date.
311
- */
312
- latestDate?: string | null;
313
- /**
314
- * Defaults to schedule: stop if a matching appointment exists. Use reschedule
315
- * only when the person explicitly requests another date; returns alternatives
316
- * without changing the existing appointment.
317
- */
318
- mode?: "schedule" | "reschedule" | null;
319
- /**
320
- * Doctor's name, or part of it, when the caller asked for someone specific.
321
- * Use list_professionals to check the service's registered doctors
322
- * independently of available slots; absence from an open-agenda selector does
323
- * not mean the doctor does not exist. Omit it to see whoever has room
324
- * soonest.
325
- */
326
- professional?: string | null;
327
- /**
328
- * Exact service in the order or a previously returned service ID. Names are
329
- * resolved internally against the live catalog; do not call list_services
330
- * first or invent IDs. Preserve consultation/control and pediatric
331
- * qualifiers.
332
- */
333
- serviceId: string;
334
- /**
335
- * Set agentMode=true when calling this tool for an AI agent. The answer is
336
- * concise Spanish text instead of JSON. Omit it for structured machine data.
337
- * This changes presentation only, never authorization, consent or
338
- * idempotency.
339
- */
340
- agentMode?: boolean;
341
- /**
342
- * Which of the organization's SURA connections to run on, by its id. Optional
343
- * while the organization has one; required when it has several.
344
- */
345
- connectionId?: string;
346
- /**
347
- * The channel the caller is waiting on, which sets how long it waits before
348
- * an answer comes back pending, and puts a phone call's reads ahead of
349
- * others. Defaults to web.
350
- */
351
- channel?: "voice" | "whatsapp" | "web";
352
- }
353
- export interface PrepareResponse {
354
- data: SuraPendingResult | SuraRefusal | SuraPreparationPatientNotFound | SuraPatientNotFound | SuraPreparationExistingAppointment | SuraPreparationAvailable | SuraPreparationNoSlots;
355
- error: null;
356
- metadata: SuraResponseMetadata;
357
- success: true;
358
- }
53
+ export type CancelRequest = SuraCancelAppointmentBody;
54
+ export type CancelResponse = SuraCancelAppointmentResultResponse;
55
+ export type CreateRequest = SuraBookAppointmentBody;
56
+ export type CreateResponse = SuraBookAppointmentResultResponse;
57
+ export type LookupRequest = SuraListAppointmentsBody;
58
+ export type LookupResponse = SuraListAppointmentsResultResponse;
@@ -1,7 +1,7 @@
1
1
  // Code generated by forge. DO NOT EDIT.
2
2
  /* eslint-disable */
3
- import { Transport, object, union, } from "../../_/index.js";
4
- import { SuraBookedAppointmentCodec, SuraCancelledAppointmentCodec, SuraPatientNotFoundCodec, SuraPendingResultCodec, SuraPreparationAvailableCodec, SuraPreparationExistingAppointmentCodec, SuraPreparationNoSlotsCodec, SuraPreparationPatientNotFoundCodec, SuraRefusalCodec, } from "../models.js";
3
+ import { Transport, } from "../../_/index.js";
4
+ import { SuraBookAppointmentBodyCodec, SuraBookAppointmentResultResponseCodec, SuraCancelAppointmentBodyCodec, SuraCancelAppointmentResultResponseCodec, SuraListAppointmentsResultResponseCodec, } from "./models.js";
5
5
  export function createClient(options) {
6
6
  return bind(new Transport(options));
7
7
  }
@@ -9,35 +9,29 @@ export function bind(transport) {
9
9
  return {
10
10
  cancel: (request, options) => transport.send(CancelOperation, request, options),
11
11
  create: (request, options) => transport.send(CreateOperation, request, options),
12
- list: (request, options) => transport.send(ListOperation, request, options),
13
- prepare: (request, options) => transport.send(PrepareOperation, request, options),
12
+ lookup: (request, options) => transport.send(LookupOperation, request, options),
14
13
  };
15
14
  }
16
15
  const CancelOperation = {
17
16
  method: "POST",
18
17
  route: "/v1/sura/appointments/cancel",
19
18
  body: "flat",
20
- response: object([["data", null, union([() => SuraPendingResultCodec, () => SuraRefusalCodec, () => SuraPatientNotFoundCodec, () => SuraCancelledAppointmentCodec])]]),
21
- 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 },
19
+ request: SuraCancelAppointmentBodyCodec,
20
+ response: SuraCancelAppointmentResultResponseCodec,
21
+ errors: { "400": true, "401": true, "403": true, "404": true, "409": true, "413": true, "415": true, "429": true, "500": true, "502": true, "503": true, "504": true },
22
22
  };
23
23
  const CreateOperation = {
24
24
  method: "POST",
25
25
  route: "/v1/sura/appointments",
26
26
  body: "flat",
27
- response: object([["data", null, union([() => SuraPendingResultCodec, () => SuraRefusalCodec, () => SuraPatientNotFoundCodec, () => SuraBookedAppointmentCodec])]]),
28
- 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 },
27
+ request: SuraBookAppointmentBodyCodec,
28
+ response: SuraBookAppointmentResultResponseCodec,
29
+ errors: { "400": true, "401": true, "403": true, "404": true, "409": true, "413": true, "415": true, "429": true, "500": true, "502": true, "503": true, "504": true },
29
30
  };
30
- const ListOperation = {
31
- method: "GET",
32
- route: "/v1/sura/appointments",
33
- query: { documentNumber: "documentNumber", documentType: "documentType", cursor: "cursor", direction: "direction", limit: "limit", agentMode: "agentMode", connectionId: "connectionId", channel: "channel" },
34
- response: object([["data", null, union([() => SuraPendingResultCodec, () => SuraRefusalCodec, () => SuraPatientNotFoundCodec])]]),
35
- 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 },
36
- };
37
- const PrepareOperation = {
38
- method: "GET",
39
- route: "/v1/sura/appointments/prepare",
40
- query: { areaId: "areaId", date: "date", documentNumber: "documentNumber", documentType: "documentType", allowOtherProfessionals: "allowOtherProfessionals", fromDate: "fromDate", timeFrom: "timeFrom", timeUntil: "timeUntil", limit: "limit", latestDate: "latestDate", mode: "mode", professional: "professional", serviceId: "serviceId", agentMode: "agentMode", connectionId: "connectionId", channel: "channel" },
41
- response: object([["data", null, union([() => SuraPendingResultCodec, () => SuraRefusalCodec, () => SuraPreparationPatientNotFoundCodec, () => SuraPatientNotFoundCodec, () => SuraPreparationExistingAppointmentCodec, () => SuraPreparationAvailableCodec, () => SuraPreparationNoSlotsCodec])]]),
42
- 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 },
31
+ const LookupOperation = {
32
+ method: "POST",
33
+ route: "/v1/sura/appointments/lookup",
34
+ body: "flat",
35
+ response: SuraListAppointmentsResultResponseCodec,
36
+ errors: { "400": true, "401": true, "403": true, "404": true, "409": true, "413": true, "415": true, "429": true, "500": true, "502": true, "503": true, "504": true },
43
37
  };
@@ -1,4 +1,5 @@
1
1
  export { ApiError } from "../../_/index.js";
2
2
  export type { RequestOptions } from "../../_/index.js";
3
3
  export { createClient } from "./client.js";
4
- export type { Client, ClientOptions, CancelRequest, CancelResponse, CreateRequest, CreateResponse, ListRequest, ListResponse, PrepareRequest, PrepareResponse, } from "./client.js";
4
+ export type { Client, ClientOptions, CancelRequest, CancelResponse, CreateRequest, CreateResponse, LookupRequest, LookupResponse, } from "./client.js";
5
+ export type { SuraBookAppointmentBadGatewayError, SuraBookAppointmentBadGatewayFailure, SuraBookAppointmentBody, SuraBookAppointmentConflictError, SuraBookAppointmentConflictFailure, SuraBookAppointmentResult, SuraBookAppointmentResultResponse, SuraCancelAppointmentBadGatewayError, SuraCancelAppointmentBadGatewayFailure, SuraCancelAppointmentBody, SuraCancelAppointmentConflictError, SuraCancelAppointmentConflictFailure, SuraCancelAppointmentResult, SuraCancelAppointmentResultResponse, SuraListAppointmentsBadGatewayError, SuraListAppointmentsBadGatewayFailure, SuraListAppointmentsBody, SuraListAppointmentsConflictError, SuraListAppointmentsConflictFailure, SuraListAppointmentsResult, SuraListAppointmentsResultResponse, } from "./models.js";