@arbol-ai/sdk 2.6.0 → 2.8.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 (34) hide show
  1. package/dist/raiz/agents/models.d.ts +2 -0
  2. package/dist/raiz/index.d.ts +1 -1
  3. package/dist/raiz/models.d.ts +24 -2
  4. package/dist/raiz/reports/client.d.ts +12 -5
  5. package/dist/raiz/reports/models.d.ts +19 -0
  6. package/dist/raiz/reports/models.js +1 -1
  7. package/dist/sura/affiliations/client.d.ts +7 -0
  8. package/dist/sura/affiliations/client.js +1 -1
  9. package/dist/sura/appointments/client.d.ts +44 -8
  10. package/dist/sura/appointments/client.js +2 -2
  11. package/dist/sura/authorizations/client.d.ts +7 -0
  12. package/dist/sura/authorizations/client.js +1 -1
  13. package/dist/sura/availability/client.d.ts +11 -1
  14. package/dist/sura/availability/client.js +1 -1
  15. package/dist/sura/client.d.ts +2 -0
  16. package/dist/sura/client.js +5 -0
  17. package/dist/sura/connections/client.d.ts +28 -3
  18. package/dist/sura/connections/client.js +3 -2
  19. package/dist/sura/copays/client.d.ts +7 -0
  20. package/dist/sura/copays/client.js +1 -1
  21. package/dist/sura/models.d.ts +22 -0
  22. package/dist/sura/operations/client.d.ts +7 -0
  23. package/dist/sura/operations/client.js +1 -1
  24. package/dist/sura/patients/client.d.ts +7 -0
  25. package/dist/sura/patients/client.js +1 -1
  26. package/dist/sura/professionals/client.d.ts +80 -0
  27. package/dist/sura/professionals/client.js +19 -0
  28. package/dist/sura/professionals/index.d.ts +5 -0
  29. package/dist/sura/professionals/index.js +4 -0
  30. package/dist/sura/professionals/models.d.ts +28 -0
  31. package/dist/sura/professionals/models.js +3 -0
  32. package/dist/sura/services/client.d.ts +7 -0
  33. package/dist/sura/services/client.js +1 -1
  34. package/package.json +3 -3
@@ -138,6 +138,7 @@ export interface RaizAgentPage {
138
138
  }
139
139
  export interface RaizAgentSettings {
140
140
  attachmentReader: "vision" | "ocr" | null;
141
+ automaticKnowledge: boolean | null;
141
142
  budgetExhaustedMessage: string | null;
142
143
  closingMessage: string | null;
143
144
  evalGate: boolean | null;
@@ -160,6 +161,7 @@ export interface RaizAgentSettings {
160
161
  }
161
162
  export interface RaizAgentSettingsInput {
162
163
  attachmentReader?: "vision" | "ocr" | null;
164
+ automaticKnowledge?: boolean | null;
163
165
  budgetExhaustedMessage?: string | null;
164
166
  businessHours?: RaizBusinessHours | null;
165
167
  closingMessage?: string | null;
@@ -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 { RaizAgentIntegrationSkillInput, RaizAgentSkill, RaizBusinessHours, RaizBusinessHoursWindow, RaizContactHoursWindow, RaizCount, RaizEmailAddress, RaizFact, RaizFailureResponse, RaizHttpsUrl, RaizPhoneNumber, RaizTask, } from "./models.js";
5
+ export type { RaizAgentIntegrationSkillInput, RaizAgentSkill, RaizBusinessHours, RaizBusinessHoursWindow, RaizContactHoursWindow, RaizCount, RaizEmailAddress, RaizFact, RaizFailureResponse, RaizHttpsUrl, RaizOutsideHoursTemplate, RaizPhoneNumber, RaizTask, } from "./models.js";
@@ -35,10 +35,22 @@ export interface RaizBusinessHours {
35
35
  /**
36
36
  * What whoever writes outside the hours receives, once per number and closed
37
37
  * period (until the hours open again), whether the conversation's AI is on,
38
- * off or paused. It is never taken as an answer: the AI answers what the
39
- * contact wrote when a person turns it on or resumes it in business hours.
38
+ * off or paused. With `outsideHoursTemplate`, the template goes instead, and
39
+ * this text only when WhatsApp refuses the template. The notice is never
40
+ * taken as an answer: the AI answers what the contact wrote when a person
41
+ * turns it on or resumes it in business hours.
40
42
  */
41
43
  outsideHoursMessage: string;
44
+ /**
45
+ * Send the notice as this approved WhatsApp template instead of
46
+ * `outsideHoursMessage`: a template of the number's account with no variables
47
+ * and no document, image or video header (in `list_templates`: `sendable`,
48
+ * with `parameterCount` 0). WhatsApp's approval is checked when the hours are
49
+ * saved. If WhatsApp refuses the template when a notice goes (deleted, paused
50
+ * or disabled since), `outsideHoursMessage` goes instead. Null or absent: the
51
+ * notice is `outsideHoursMessage`.
52
+ */
53
+ outsideHoursTemplate?: RaizOutsideHoursTemplate | null;
42
54
  timeZone: string | null;
43
55
  /**
44
56
  * Several windows may share a day, for a break at midday or an afternoon
@@ -895,6 +907,16 @@ export interface RaizFailureResponse {
895
907
  success: false;
896
908
  }
897
909
  export type RaizHttpsUrl = string;
910
+ export interface RaizOutsideHoursTemplate {
911
+ /**
912
+ * The template's language in WhatsApp's code, for example `es` or `es_MX`.
913
+ */
914
+ language: string;
915
+ /**
916
+ * The template's name.
917
+ */
918
+ name: string;
919
+ }
898
920
  export type RaizPhoneNumber = string;
899
921
  export interface RaizTask {
900
922
  /**
@@ -20,8 +20,11 @@ export interface Client {
20
20
  * reschedules, cancellations, failures, pending and unverified results
21
21
  * separately), `tool_calls_daily` (Agent tool calls per day), `tool_calls`
22
22
  * (each call, newest first), `assessment_results_daily` (assessment results
23
- * per day), each over days in the organization's time zone (`from`, `to`; the
24
- * last 30 days by default), or `campaign_progress`. Narrow with `agentId`,
23
+ * per day), `pqrsf_daily` (PQRSF classification, confirmed informational
24
+ * resolution and correct referrals from current pqrsf_* facts; unknown and
25
+ * pending analysis remain visible; excludes tests/imports/deleted records),
26
+ * each over days in the organization's time zone (`from`, `to`; the last 30
27
+ * days by default), or `campaign_progress`. Narrow with `agentId`,
25
28
  * `channelType`, `campaignId` or `definitionId`; unsupported filters fail. At
26
29
  * most 1000 rows: `hasMore` means split the range or filter. Booking outcomes
27
30
  * return no partial totals when their evidence scan exceeds its bound.
@@ -64,10 +67,14 @@ export interface CurrentRequest {
64
67
  * `tool_calls_daily`: tool calls per day, Agent and tool with
65
68
  * failures/durations (filter `agentId`). `tool_calls`: individual calls,
66
69
  * never inputs/outputs (filter `agentId`). `assessment_results_daily`:
67
- * assessments per day/definition (filter `definitionId`).
68
- * `campaign_progress`: recipients by status (filter `campaignId`; no dates).
70
+ * assessments per day/definition (filter `definitionId`). `pqrsf_daily`:
71
+ * classification, confirmed resolution and referral-link counts from the
72
+ * pqrsf_* definitions, including pending/unclassified conversations,
73
+ * excluding tests/imports/deleted records (filters `agentId`, `channelType`);
74
+ * no measured filing reduction is inferred. `campaign_progress`: recipients
75
+ * by status (filter `campaignId`; no dates).
69
76
  */
70
- name: "conversations_daily" | "tool_calls_daily" | "tool_calls" | "booking_outcomes" | "assessment_results_daily" | "campaign_progress";
77
+ name: "conversations_daily" | "pqrsf_daily" | "tool_calls_daily" | "tool_calls" | "booking_outcomes" | "assessment_results_daily" | "campaign_progress";
71
78
  /**
72
79
  * Last day (`YYYY-MM-DD`), inclusive, of a daily report. Default: today in
73
80
  * the organization's time zone.
@@ -17,6 +17,25 @@ export type RaizReport = {
17
17
  toReviewCount: number;
18
18
  }[];
19
19
  to: Temporal.PlainDate;
20
+ } | {
21
+ from: Temporal.PlainDate;
22
+ hasMore: boolean;
23
+ name: "pqrsf_daily";
24
+ rows: {
25
+ analyzedCount: number;
26
+ confirmedResolutionCount: number;
27
+ conversationCount: number;
28
+ day: Temporal.PlainDate;
29
+ formalPqrsfCount: number;
30
+ informativeResolvedCount: number;
31
+ informativeUnresolvedCount: number;
32
+ referralCorrectCount: number;
33
+ referralIncorrectCount: number;
34
+ referralPendingCount: number;
35
+ referralRequiredCount: number;
36
+ unclassifiedCount: number;
37
+ }[];
38
+ to: Temporal.PlainDate;
20
39
  } | {
21
40
  from: Temporal.PlainDate;
22
41
  hasMore: boolean;
@@ -1,4 +1,4 @@
1
1
  // Code generated by forge. DO NOT EDIT.
2
2
  /* eslint-disable */
3
3
  import { array, date, instant, object, union } from "../../_/index.js";
4
- export const RaizReportCodec = union([object([["from", null, date], ["rows", null, array(object([["day", null, date]]))], ["to", null, date]]), object([["from", null, date], ["rows", null, array(object([["day", null, date]]))], ["to", null, date]]), object([["from", null, date], ["rows", null, array(object([["occurredAt", null, instant]]))], ["to", null, date]]), object([["from", null, date], ["rows", null, array(object([["day", null, date]]))], ["to", null, date]]), object([["from", null, date], ["rows", null, array(object([["day", null, date]]))], ["to", null, date]])]);
4
+ export const RaizReportCodec = union([object([["from", null, date], ["rows", null, array(object([["day", null, date]]))], ["to", null, date]]), object([["from", null, date], ["rows", null, array(object([["day", null, date]]))], ["to", null, date]]), object([["from", null, date], ["rows", null, array(object([["day", null, date]]))], ["to", null, date]]), object([["from", null, date], ["rows", null, array(object([["occurredAt", null, instant]]))], ["to", null, date]]), object([["from", null, date], ["rows", null, array(object([["day", null, date]]))], ["to", null, date]]), object([["from", null, date], ["rows", null, array(object([["day", null, date]]))], ["to", null, date]])]);
@@ -28,6 +28,13 @@ export interface LookupRequest {
28
28
  * Document type. Defaults to CC.
29
29
  */
30
30
  documentType?: "CC" | null;
31
+ /**
32
+ * Set agentMode=true when calling this tool for an AI agent. The answer is
33
+ * concise Spanish text instead of JSON. Omit it for structured machine data.
34
+ * This changes presentation only, never authorization, consent or
35
+ * idempotency.
36
+ */
37
+ agentMode?: boolean;
31
38
  /**
32
39
  * Which of the organization's SURA connections to run on, by its id. Optional
33
40
  * while the organization has one; required when it has several.
@@ -13,7 +13,7 @@ export function bind(transport) {
13
13
  const LookupOperation = {
14
14
  method: "GET",
15
15
  route: "/v1/sura/affiliations/lookup",
16
- query: { documentNumber: "documentNumber", documentType: "documentType", connectionId: "connectionId", channel: "channel" },
16
+ query: { documentNumber: "documentNumber", documentType: "documentType", agentMode: "agentMode", connectionId: "connectionId", channel: "channel" },
17
17
  response: object([["data", null, union([() => SuraPendingResultCodec, () => SuraRefusalCodec, () => SuraAffiliationCodec, () => SuraNoContractCodec])]]),
18
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 },
19
19
  };
@@ -70,6 +70,13 @@ export interface Client {
70
70
  export declare function createClient(options: ClientOptions): Client;
71
71
  export declare function bind(transport: Transport): Client;
72
72
  export interface CancelRequest {
73
+ /**
74
+ * Set agentMode=true when calling this tool for an AI agent. The answer is
75
+ * concise Spanish text instead of JSON. Omit it for structured machine data.
76
+ * This changes presentation only, never authorization, consent or
77
+ * idempotency.
78
+ */
79
+ agentMode?: boolean;
73
80
  /**
74
81
  * The channel the caller is waiting on, which sets how long it waits before
75
82
  * an answer comes back pending, and puts a phone call's reads ahead of
@@ -121,6 +128,13 @@ export interface CancelResponse {
121
128
  success: true;
122
129
  }
123
130
  export interface CreateRequest {
131
+ /**
132
+ * Set agentMode=true when calling this tool for an AI agent. The answer is
133
+ * concise Spanish text instead of JSON. Omit it for structured machine data.
134
+ * This changes presentation only, never authorization, consent or
135
+ * idempotency.
136
+ */
137
+ agentMode?: boolean;
124
138
  /**
125
139
  * The areaId list_services returned beside that service. Pass it with an
126
140
  * exact serviceId to skip a catalog lookup; omit it whenever you are naming
@@ -212,6 +226,13 @@ export interface ListRequest {
212
226
  * another cursor.
213
227
  */
214
228
  limit?: number;
229
+ /**
230
+ * Set agentMode=true when calling this tool for an AI agent. The answer is
231
+ * concise Spanish text instead of JSON. Omit it for structured machine data.
232
+ * This changes presentation only, never authorization, consent or
233
+ * idempotency.
234
+ */
235
+ agentMode?: boolean;
215
236
  /**
216
237
  * Which of the organization's SURA connections to run on, by its id. Optional
217
238
  * while the organization has one; required when it has several.
@@ -238,9 +259,11 @@ export interface PrepareRequest {
238
259
  */
239
260
  areaId?: string | null;
240
261
  /**
241
- * A day to look at, as YYYY-MM-DD. Omit it for the soonest day with room.
242
- * Resolve relative dates like "mañana" against the clinic's own timezone
243
- * before calling.
262
+ * A day the person asked for, as YYYY-MM-DD. Its openings come first; when it
263
+ * has none, the openings nearest to it on either side are offered instead and
264
+ * requestedDateAvailable is false. Omit it for the soonest openings. Resolve
265
+ * relative dates like "mañana" against the clinic's own timezone before
266
+ * calling.
244
267
  */
245
268
  date?: string | null;
246
269
  /**
@@ -257,14 +280,17 @@ export interface PrepareRequest {
257
280
  */
258
281
  documentType: "ASI" | "CC" | "CD" | "CE" | "CN" | "DE" | "IFE" | "MS" | "NIT" | "NUIP" | "PA" | "PC" | "PD" | "PE" | "PF" | "PT" | "RC" | "RCP" | "RES" | "SC" | "TE" | "TI";
259
282
  /**
260
- * When true, a requested doctor with no openings falls back automatically to
261
- * other doctors of the same service. Present their names and obtain consent
262
- * before booking.
283
+ * Whether other doctors of this service may be offered when the named doctor
284
+ * has no opening in the searched window. Defaults to true: the named doctor's
285
+ * openings come first, and only when that doctor has none are the other
286
+ * doctors' nearest openings returned, with requestedProfessionalAvailable
287
+ * false. Name the actual doctor of each option and obtain consent before
288
+ * booking. False keeps the named doctor as a strict filter.
263
289
  */
264
290
  allowOtherProfessionals?: "true" | "false" | null;
265
291
  /**
266
292
  * Search from this day onward (YYYY-MM-DD), using the live calendar. Omit for
267
- * today. Use date only for an exact day.
293
+ * today. Use date for a specific day.
268
294
  */
269
295
  fromDate?: string | null;
270
296
  /**
@@ -293,7 +319,10 @@ export interface PrepareRequest {
293
319
  mode?: "schedule" | "reschedule" | null;
294
320
  /**
295
321
  * Doctor's name, or part of it, when the caller asked for someone specific.
296
- * Omit it to see whoever has room soonest.
322
+ * Use list_professionals to check the service's registered doctors
323
+ * independently of available slots; absence from an open-agenda selector does
324
+ * not mean the doctor does not exist. Omit it to see whoever has room
325
+ * soonest.
297
326
  */
298
327
  professional?: string | null;
299
328
  /**
@@ -303,6 +332,13 @@ export interface PrepareRequest {
303
332
  * qualifiers.
304
333
  */
305
334
  serviceId: string;
335
+ /**
336
+ * Set agentMode=true when calling this tool for an AI agent. The answer is
337
+ * concise Spanish text instead of JSON. Omit it for structured machine data.
338
+ * This changes presentation only, never authorization, consent or
339
+ * idempotency.
340
+ */
341
+ agentMode?: boolean;
306
342
  /**
307
343
  * Which of the organization's SURA connections to run on, by its id. Optional
308
344
  * while the organization has one; required when it has several.
@@ -30,14 +30,14 @@ const CreateOperation = {
30
30
  const ListOperation = {
31
31
  method: "GET",
32
32
  route: "/v1/sura/appointments",
33
- query: { documentNumber: "documentNumber", documentType: "documentType", cursor: "cursor", direction: "direction", limit: "limit", connectionId: "connectionId", channel: "channel" },
33
+ query: { documentNumber: "documentNumber", documentType: "documentType", cursor: "cursor", direction: "direction", limit: "limit", agentMode: "agentMode", connectionId: "connectionId", channel: "channel" },
34
34
  response: object([["data", null, union([() => SuraPendingResultCodec, () => SuraRefusalCodec, () => SuraPatientNotFoundCodec])]]),
35
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
36
  };
37
37
  const PrepareOperation = {
38
38
  method: "GET",
39
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", connectionId: "connectionId", channel: "channel" },
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
41
  response: object([["data", null, union([() => SuraPendingResultCodec, () => SuraRefusalCodec, () => SuraPreparationPatientNotFoundCodec, () => SuraPatientNotFoundCodec, () => SuraPreparationExistingAppointmentCodec, () => SuraPreparationAvailableCodec, () => SuraPreparationNoSlotsCodec])]]),
42
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 },
43
43
  };
@@ -38,6 +38,13 @@ export interface LookupRequest {
38
38
  * Issuer code before the hyphen in the authorization identifier.
39
39
  */
40
40
  issuerCode: string;
41
+ /**
42
+ * Set agentMode=true when calling this tool for an AI agent. The answer is
43
+ * concise Spanish text instead of JSON. Omit it for structured machine data.
44
+ * This changes presentation only, never authorization, consent or
45
+ * idempotency.
46
+ */
47
+ agentMode?: boolean;
41
48
  /**
42
49
  * Which of the organization's SURA connections to run on, by its id. Optional
43
50
  * while the organization has one; required when it has several.
@@ -13,7 +13,7 @@ export function bind(transport) {
13
13
  const LookupOperation = {
14
14
  method: "GET",
15
15
  route: "/v1/sura/authorizations/lookup",
16
- query: { authorizationNumber: "authorizationNumber", documentNumber: "documentNumber", documentType: "documentType", issuerCode: "issuerCode", connectionId: "connectionId", channel: "channel" },
16
+ query: { authorizationNumber: "authorizationNumber", documentNumber: "documentNumber", documentType: "documentType", issuerCode: "issuerCode", agentMode: "agentMode", connectionId: "connectionId", channel: "channel" },
17
17
  response: object([["data", null, union([() => SuraPendingResultCodec, () => SuraRefusalCodec, () => SuraAuthorizationCodec])]]),
18
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 },
19
19
  };
@@ -49,7 +49,10 @@ export interface ListRequest {
49
49
  documentType: "ASI" | "CC" | "CD" | "CE" | "CN" | "DE" | "IFE" | "MS" | "NIT" | "NUIP" | "PA" | "PC" | "PD" | "PE" | "PF" | "PT" | "RC" | "RCP" | "RES" | "SC" | "TE" | "TI";
50
50
  /**
51
51
  * Doctor's name, or part of it, when the caller asked for someone specific.
52
- * Omit it to see whoever has room soonest.
52
+ * Use list_professionals to check the service's registered doctors
53
+ * independently of available slots; absence from an open-agenda selector does
54
+ * not mean the doctor does not exist. Omit it to see whoever has room
55
+ * soonest.
53
56
  */
54
57
  professional?: string | null;
55
58
  /**
@@ -59,6 +62,13 @@ export interface ListRequest {
59
62
  * ask which one instead of guessing.
60
63
  */
61
64
  serviceId: string;
65
+ /**
66
+ * Set agentMode=true when calling this tool for an AI agent. The answer is
67
+ * concise Spanish text instead of JSON. Omit it for structured machine data.
68
+ * This changes presentation only, never authorization, consent or
69
+ * idempotency.
70
+ */
71
+ agentMode?: boolean;
62
72
  /**
63
73
  * Which of the organization's SURA connections to run on, by its id. Optional
64
74
  * while the organization has one; required when it has several.
@@ -13,7 +13,7 @@ export function bind(transport) {
13
13
  const ListOperation = {
14
14
  method: "GET",
15
15
  route: "/v1/sura/availability",
16
- query: { areaId: "areaId", date: "date", documentNumber: "documentNumber", documentType: "documentType", professional: "professional", serviceId: "serviceId", connectionId: "connectionId", channel: "channel" },
16
+ query: { areaId: "areaId", date: "date", documentNumber: "documentNumber", documentType: "documentType", professional: "professional", serviceId: "serviceId", agentMode: "agentMode", connectionId: "connectionId", channel: "channel" },
17
17
  response: object([["data", null, union([() => SuraPendingResultCodec, () => SuraRefusalCodec, () => SuraPatientNotFoundCodec, () => SuraAvailabilityCodec])]]),
18
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 },
19
19
  };
@@ -7,6 +7,7 @@ import { type Client as ConnectionsClient } from "./connections/client.js";
7
7
  import { type Client as CopaysClient } from "./copays/client.js";
8
8
  import { type Client as OperationsClient } from "./operations/client.js";
9
9
  import { type Client as PatientsClient } from "./patients/client.js";
10
+ import { type Client as ProfessionalsClient } from "./professionals/client.js";
10
11
  import { type Client as ServicesClient } from "./services/client.js";
11
12
  export interface ClientOptions extends BaseClientOptions {
12
13
  /**
@@ -23,6 +24,7 @@ export interface Client {
23
24
  readonly copays: CopaysClient;
24
25
  readonly operations: OperationsClient;
25
26
  readonly patients: PatientsClient;
27
+ readonly professionals: ProfessionalsClient;
26
28
  readonly services: ServicesClient;
27
29
  }
28
30
  export declare function createClient(options: ClientOptions): Client;
@@ -9,6 +9,7 @@ import { bind as bindConnections, } from "./connections/client.js";
9
9
  import { bind as bindCopays, } from "./copays/client.js";
10
10
  import { bind as bindOperations, } from "./operations/client.js";
11
11
  import { bind as bindPatients, } from "./patients/client.js";
12
+ import { bind as bindProfessionals, } from "./professionals/client.js";
12
13
  import { bind as bindServices, } from "./services/client.js";
13
14
  export function createClient(options) {
14
15
  return bind(new Transport(options));
@@ -22,6 +23,7 @@ export function bind(transport) {
22
23
  let copaysClient;
23
24
  let operationsClient;
24
25
  let patientsClient;
26
+ let professionalsClient;
25
27
  let servicesClient;
26
28
  return {
27
29
  get affiliations() {
@@ -48,6 +50,9 @@ export function bind(transport) {
48
50
  get patients() {
49
51
  return (patientsClient ??= bindPatients(transport));
50
52
  },
53
+ get professionals() {
54
+ return (professionalsClient ??= bindProfessionals(transport));
55
+ },
51
56
  get services() {
52
57
  return (servicesClient ??= bindServices(transport));
53
58
  },
@@ -54,9 +54,13 @@ export interface DeleteRequest {
54
54
  * own organization's.
55
55
  */
56
56
  id: string;
57
- body: {
58
- [key: string]: unknown;
59
- };
57
+ /**
58
+ * Set agentMode=true when calling this tool for an AI agent. The answer is
59
+ * concise Spanish text instead of JSON. Omit it for structured machine data.
60
+ * This changes presentation only, never authorization, consent or
61
+ * idempotency.
62
+ */
63
+ agentMode?: boolean;
60
64
  }
61
65
  export interface DeleteResponse {
62
66
  data: DeletedObject;
@@ -70,6 +74,13 @@ export interface GetRequest {
70
74
  * own organization's.
71
75
  */
72
76
  id: string;
77
+ /**
78
+ * Set agentMode=true when calling this tool for an AI agent. The answer is
79
+ * concise Spanish text instead of JSON. Omit it for structured machine data.
80
+ * This changes presentation only, never authorization, consent or
81
+ * idempotency.
82
+ */
83
+ agentMode?: boolean;
73
84
  }
74
85
  export interface GetResponse {
75
86
  /**
@@ -94,6 +105,13 @@ export interface ListRequest {
94
105
  * another cursor.
95
106
  */
96
107
  limit?: number;
108
+ /**
109
+ * Set agentMode=true when calling this tool for an AI agent. The answer is
110
+ * concise Spanish text instead of JSON. Omit it for structured machine data.
111
+ * This changes presentation only, never authorization, consent or
112
+ * idempotency.
113
+ */
114
+ agentMode?: boolean;
97
115
  }
98
116
  export interface ListResponse {
99
117
  data: SuraConnectionPage;
@@ -107,6 +125,13 @@ export interface VerifyRequest {
107
125
  * own organization's.
108
126
  */
109
127
  connectionId: string;
128
+ /**
129
+ * Set agentMode=true when calling this tool for an AI agent. The answer is
130
+ * concise Spanish text instead of JSON. Omit it for structured machine data.
131
+ * This changes presentation only, never authorization, consent or
132
+ * idempotency.
133
+ */
134
+ agentMode?: boolean;
110
135
  /**
111
136
  * Agenda only: the institution (IPS) the connection schedules in, which every
112
137
  * login must see. Without it, the connection keeps its own, or takes the one
@@ -16,20 +16,21 @@ export function bind(transport) {
16
16
  const DeleteOperation = {
17
17
  method: "DELETE",
18
18
  route: "/v1/sura/connections/{id}",
19
- body: "nested",
19
+ body: "flat",
20
20
  response: null,
21
21
  errors: { "400": true, "401": true, "403": true, "404": true, "405": true, "413": true, "415": true, "429": true, "500": true, "502": true, "503": true, "504": true },
22
22
  };
23
23
  const GetOperation = {
24
24
  method: "GET",
25
25
  route: "/v1/sura/connections/{id}",
26
+ query: { agentMode: "agentMode" },
26
27
  response: object([["data", null, () => SuraConnectionCodec]]),
27
28
  errors: { "400": true, "401": true, "403": true, "404": true, "405": true, "413": true, "415": true, "429": true, "500": true, "502": true, "503": true, "504": true },
28
29
  };
29
30
  const ListOperation = {
30
31
  method: "GET",
31
32
  route: "/v1/sura/connections",
32
- query: { cursor: "cursor", direction: "direction", limit: "limit" },
33
+ query: { cursor: "cursor", direction: "direction", limit: "limit", agentMode: "agentMode" },
33
34
  response: object([["data", null, () => SuraConnectionPageCodec]]),
34
35
  errors: { "400": true, "401": true, "403": true, "404": true, "405": true, "413": true, "415": true, "429": true, "500": true, "502": true, "503": true, "504": true },
35
36
  };
@@ -33,6 +33,13 @@ export interface ListRequest {
33
33
  * Explicit four-digit year for copay history, from 2000 to 2099.
34
34
  */
35
35
  year: string;
36
+ /**
37
+ * Set agentMode=true when calling this tool for an AI agent. The answer is
38
+ * concise Spanish text instead of JSON. Omit it for structured machine data.
39
+ * This changes presentation only, never authorization, consent or
40
+ * idempotency.
41
+ */
42
+ agentMode?: boolean;
36
43
  /**
37
44
  * Which of the organization's SURA connections to run on, by its id. Optional
38
45
  * while the organization has one; required when it has several.
@@ -13,7 +13,7 @@ export function bind(transport) {
13
13
  const ListOperation = {
14
14
  method: "GET",
15
15
  route: "/v1/sura/copays",
16
- query: { documentNumber: "documentNumber", documentType: "documentType", year: "year", connectionId: "connectionId", channel: "channel" },
16
+ query: { documentNumber: "documentNumber", documentType: "documentType", year: "year", agentMode: "agentMode", connectionId: "connectionId", channel: "channel" },
17
17
  response: object([["data", null, union([() => SuraPendingResultCodec, () => SuraRefusalCodec, () => SuraCopayHistoryCodec, () => SuraNoCopayHistoryCodec])]]),
18
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 },
19
19
  };
@@ -449,6 +449,17 @@ export interface SuraPreparationAvailable {
449
449
  patient: SuraAvailabilityPatient;
450
450
  plan: string | null;
451
451
  professional: string | null;
452
+ /**
453
+ * Present when a date was given: true when an option falls on that day, false
454
+ * when it had none and any options are the nearest days to it.
455
+ */
456
+ requestedDateAvailable?: boolean;
457
+ /**
458
+ * Present when a professional was named: true when the options are that
459
+ * doctor's, false when that doctor had no opening in the searched window and
460
+ * any options are other doctors' of the same service.
461
+ */
462
+ requestedProfessionalAvailable?: boolean;
452
463
  /**
453
464
  * False when the bounded search stopped before establishing the requested
454
465
  * nearest options.
@@ -501,6 +512,17 @@ export interface SuraPreparationNoSlots {
501
512
  patient: SuraAvailabilityPatient;
502
513
  plan: string | null;
503
514
  professional: string | null;
515
+ /**
516
+ * Present when a date was given: true when an option falls on that day, false
517
+ * when it had none and any options are the nearest days to it.
518
+ */
519
+ requestedDateAvailable?: boolean;
520
+ /**
521
+ * Present when a professional was named: true when the options are that
522
+ * doctor's, false when that doctor had no opening in the searched window and
523
+ * any options are other doctors' of the same service.
524
+ */
525
+ requestedProfessionalAvailable?: boolean;
504
526
  /**
505
527
  * False when the bounded search stopped before establishing the requested
506
528
  * nearest options.
@@ -27,6 +27,13 @@ export interface GetRequest {
27
27
  * The operationId of the pending answer, exactly as it was returned.
28
28
  */
29
29
  operationId: string;
30
+ /**
31
+ * Set agentMode=true when calling this tool for an AI agent. The answer is
32
+ * concise Spanish text instead of JSON. Omit it for structured machine data.
33
+ * This changes presentation only, never authorization, consent or
34
+ * idempotency.
35
+ */
36
+ agentMode?: boolean;
30
37
  /**
31
38
  * Which of the organization's SURA connections to run on, by its id. Optional
32
39
  * while the organization has one; required when it has several.
@@ -13,7 +13,7 @@ export function bind(transport) {
13
13
  const GetOperation = {
14
14
  method: "GET",
15
15
  route: "/v1/sura/operations/{operationId}",
16
- query: { connectionId: "connectionId", channel: "channel" },
16
+ query: { agentMode: "agentMode", connectionId: "connectionId", channel: "channel" },
17
17
  response: object([["data", null, union([() => SuraPendingResultCodec, () => SuraRefusalCodec, () => SuraPatientNotFoundCodec, () => SuraPreparationPatientNotFoundCodec, () => SuraPatientFoundCodec, () => SuraAvailabilityCodec, () => SuraPreparationExistingAppointmentCodec, () => SuraPreparationAvailableCodec, () => SuraPreparationNoSlotsCodec, () => SuraBookedAppointmentCodec, () => SuraCancelledAppointmentCodec, () => SuraAffiliationCodec, () => SuraNoContractCodec, () => SuraAuthorizationCodec, () => SuraCopayHistoryCodec, () => SuraNoCopayHistoryCodec])]]),
18
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 },
19
19
  };
@@ -39,6 +39,13 @@ export interface LookupRequest {
39
39
  * age or number length.
40
40
  */
41
41
  documentType: "ASI" | "CC" | "CD" | "CE" | "CN" | "DE" | "IFE" | "MS" | "NIT" | "NUIP" | "PA" | "PC" | "PD" | "PE" | "PF" | "PT" | "RC" | "RCP" | "RES" | "SC" | "TE" | "TI";
42
+ /**
43
+ * Set agentMode=true when calling this tool for an AI agent. The answer is
44
+ * concise Spanish text instead of JSON. Omit it for structured machine data.
45
+ * This changes presentation only, never authorization, consent or
46
+ * idempotency.
47
+ */
48
+ agentMode?: boolean;
42
49
  /**
43
50
  * Which of the organization's SURA connections to run on, by its id. Optional
44
51
  * while the organization has one; required when it has several.
@@ -13,7 +13,7 @@ export function bind(transport) {
13
13
  const LookupOperation = {
14
14
  method: "GET",
15
15
  route: "/v1/sura/patients/lookup",
16
- query: { documentNumber: "documentNumber", documentType: "documentType", connectionId: "connectionId", channel: "channel" },
16
+ query: { documentNumber: "documentNumber", documentType: "documentType", agentMode: "agentMode", connectionId: "connectionId", channel: "channel" },
17
17
  response: object([["data", null, union([() => SuraPendingResultCodec, () => SuraRefusalCodec, () => SuraPatientNotFoundCodec, () => SuraPatientFoundCodec])]]),
18
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 },
19
19
  };
@@ -0,0 +1,80 @@
1
+ import { type BaseClientOptions, type RequestOptions, Transport } from "../../_/index.js";
2
+ import type { ResponseMetadata } from "../../models.js";
3
+ import { type SuraPendingResult, type SuraRefusal } from "../models.js";
4
+ import type { SuraProfessionalPage } from "./models.js";
5
+ export interface ClientOptions extends BaseClientOptions {
6
+ /**
7
+ * The URL the paths of the API are relative to.
8
+ */
9
+ baseUrl: string;
10
+ }
11
+ export interface Client {
12
+ /**
13
+ * List registered professionals
14
+ *
15
+ * List SURA's registered professionals for a service at this connection's
16
+ * institution, including doctors without published or free appointments.
17
+ * First obtain serviceId and optionally areaId from list_services. No patient
18
+ * identity is needed. Follow pageInfo.nextCursor while hasNextPage is true
19
+ * before concluding a name is absent from this scoped directory. Absence does
20
+ * not establish that a doctor does not exist or works nowhere else.
21
+ * Registration does not establish coverage, authorization, or availability:
22
+ * use prepare_appointment with the patient's evidence and the requested
23
+ * professional name to find actual slots. Never substitute another doctor
24
+ * without the patient's agreement. An unreadable or incomplete provider
25
+ * directory is a technical failure, not an empty list.
26
+ */
27
+ list(request: ListRequest, options?: RequestOptions): Promise<ListResponse>;
28
+ }
29
+ export declare function createClient(options: ClientOptions): Client;
30
+ export declare function bind(transport: Transport): Client;
31
+ export interface ListRequest {
32
+ /**
33
+ * The areaId list_services returned beside that service. Pass it with an
34
+ * exact serviceId to skip a catalog lookup; omit it whenever you are naming
35
+ * the service in words.
36
+ */
37
+ areaId?: string | null;
38
+ /**
39
+ * Exact numeric service id returned by list_services. This directory is not
40
+ * filtered by patient coverage or available appointments.
41
+ */
42
+ serviceId: string;
43
+ /**
44
+ * Opaque cursor returned by pageInfo; omit it to request the first page.
45
+ */
46
+ cursor?: string;
47
+ /**
48
+ * Direction to traverse the stable keyset ordering from the supplied cursor.
49
+ */
50
+ direction?: "forward" | "backward";
51
+ /**
52
+ * Maximum items returned in one page. Defaults to 25; larger reads require
53
+ * another cursor.
54
+ */
55
+ limit?: number;
56
+ /**
57
+ * Set agentMode=true when calling this tool for an AI agent. The answer is
58
+ * concise Spanish text instead of JSON. Omit it for structured machine data.
59
+ * This changes presentation only, never authorization, consent or
60
+ * idempotency.
61
+ */
62
+ agentMode?: boolean;
63
+ /**
64
+ * Which of the organization's SURA connections to run on, by its id. Optional
65
+ * while the organization has one; required when it has several.
66
+ */
67
+ connectionId?: string;
68
+ /**
69
+ * The channel the caller is waiting on, which sets how long it waits before
70
+ * an answer comes back pending, and puts a phone call's reads ahead of
71
+ * others. Defaults to web.
72
+ */
73
+ channel?: "voice" | "whatsapp" | "web";
74
+ }
75
+ export interface ListResponse {
76
+ data: SuraPendingResult | SuraRefusal | SuraProfessionalPage;
77
+ error: null;
78
+ metadata: ResponseMetadata;
79
+ success: true;
80
+ }
@@ -0,0 +1,19 @@
1
+ // Code generated by forge. DO NOT EDIT.
2
+ /* eslint-disable */
3
+ import { Transport, object, union, } from "../../_/index.js";
4
+ import { SuraPendingResultCodec, SuraRefusalCodec, } from "../models.js";
5
+ export function createClient(options) {
6
+ return bind(new Transport(options));
7
+ }
8
+ export function bind(transport) {
9
+ return {
10
+ list: (request, options) => transport.send(ListOperation, request, options),
11
+ };
12
+ }
13
+ const ListOperation = {
14
+ method: "GET",
15
+ route: "/v1/sura/professionals",
16
+ query: { areaId: "areaId", serviceId: "serviceId", cursor: "cursor", direction: "direction", limit: "limit", agentMode: "agentMode", connectionId: "connectionId", channel: "channel" },
17
+ response: object([["data", null, union([() => SuraPendingResultCodec, () => SuraRefusalCodec])]]),
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 },
19
+ };
@@ -0,0 +1,5 @@
1
+ export { ApiError } from "../../_/index.js";
2
+ export type { RequestOptions } from "../../_/index.js";
3
+ export { createClient } from "./client.js";
4
+ export type { Client, ClientOptions, ListRequest, ListResponse, } from "./client.js";
5
+ export type { SuraProfessional, SuraProfessionalPage, } from "./models.js";
@@ -0,0 +1,4 @@
1
+ // Code generated by forge. DO NOT EDIT.
2
+ /* eslint-disable */
3
+ export { ApiError } from "../../_/index.js";
4
+ export { createClient } from "./client.js";
@@ -0,0 +1,28 @@
1
+ import type { PageInfo } from "../../models.js";
2
+ export interface SuraProfessional {
3
+ areaId: string;
4
+ availabilityChecked: false;
5
+ /**
6
+ * Opaque directory identity. Use name, not this id, when requesting
7
+ * availability.
8
+ */
9
+ id: string;
10
+ name: string;
11
+ registered: true;
12
+ serviceId: string;
13
+ serviceName: string;
14
+ }
15
+ export interface SuraProfessionalPage {
16
+ /**
17
+ * Items admitted by this resource contract within the verified organization.
18
+ */
19
+ data: SuraProfessional[];
20
+ /**
21
+ * Discriminator for a resource list response.
22
+ */
23
+ object: "list";
24
+ /**
25
+ * Opaque navigation cursors for this page’s stable keyset order.
26
+ */
27
+ pageInfo: PageInfo;
28
+ }
@@ -0,0 +1,3 @@
1
+ // Code generated by forge. DO NOT EDIT.
2
+ /* eslint-disable */
3
+ export {};
@@ -47,6 +47,13 @@ export interface ListRequest {
47
47
  * another cursor.
48
48
  */
49
49
  limit?: number;
50
+ /**
51
+ * Set agentMode=true when calling this tool for an AI agent. The answer is
52
+ * concise Spanish text instead of JSON. Omit it for structured machine data.
53
+ * This changes presentation only, never authorization, consent or
54
+ * idempotency.
55
+ */
56
+ agentMode?: boolean;
50
57
  /**
51
58
  * Which of the organization's SURA connections to run on, by its id. Optional
52
59
  * while the organization has one; required when it has several.
@@ -13,7 +13,7 @@ export function bind(transport) {
13
13
  const ListOperation = {
14
14
  method: "GET",
15
15
  route: "/v1/sura/services",
16
- query: { areaId: "areaId", cursor: "cursor", direction: "direction", limit: "limit", connectionId: "connectionId", channel: "channel" },
16
+ query: { areaId: "areaId", cursor: "cursor", direction: "direction", limit: "limit", agentMode: "agentMode", connectionId: "connectionId", channel: "channel" },
17
17
  response: object([["data", null, union([() => SuraPendingResultCodec, () => SuraRefusalCodec])]]),
18
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 },
19
19
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arbol-ai/sdk",
3
- "version": "2.6.0",
3
+ "version": "2.8.0",
4
4
  "description": "The Arbol API for TypeScript and JavaScript, generated by Cloudflare Forge from the platform's public OpenAPI.",
5
5
  "keywords": [
6
6
  "arbol",
@@ -50,8 +50,8 @@
50
50
  "packageManager": "bun@1.4.3",
51
51
  "arbol": {
52
52
  "openapi": {
53
- "release": "1.20261021.142621",
54
- "sha256": "38b2a1f8990668b3b55c4da7ee4ecc6b906464cb5fd58e3dd448889b6145fd36"
53
+ "release": "1.20261023.13947",
54
+ "sha256": "1c5faf8f909599f3c67cb00c9370946d6ffd505ee2885a7d62170f253b3c736d"
55
55
  }
56
56
  }
57
57
  }