@arbol-ai/sdk 5.54.0 → 5.56.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.
@@ -1,5 +1,5 @@
1
1
  import { type BaseClientOptions, type RequestOptions, Transport } from "../../_/index.js";
2
- import { type OficlinicListBookingSlotsResultResponse } from "./models.js";
2
+ import { type OficlinicListBookingSlotsResultResponse, type OficlinicSearchBookingSlotsBody, type OficlinicSearchBookingSlotsResultResponse } from "./models.js";
3
3
  export interface ClientOptions extends BaseClientOptions {
4
4
  /**
5
5
  * The URL the paths of the API are relative to.
@@ -25,6 +25,36 @@ export interface Client {
25
25
  * concise Spanish text instead.
26
26
  */
27
27
  list(request: ListRequest, options?: RequestOptions): Promise<ListResponse>;
28
+ /**
29
+ * Search booking slots
30
+ *
31
+ * Find the nearest real slots e-Oficlinic offers for one payer, service,
32
+ * program and attention type, in one call: it opens an availability flow,
33
+ * reads the professionals the provider schedules for the service, their rooms
34
+ * and each combination's agenda days, then the slots of the earliest days,
35
+ * and answers up to slotsPerRoom future slots for each room with the
36
+ * professional, the room, the day and the flowId and slotId that book it. Use
37
+ * it instead of walking list_booking_professionals, list_booking_rooms,
38
+ * list_booking_days and list_booking_slots. Without from it starts today in
39
+ * Colombia; for one requested day pass that day as both from and to.
40
+ * professionalIds keeps a named professional; roomIds keeps the rooms of one
41
+ * site, since a room is the place of care and this provider names the site
42
+ * only in the room's name. dates lists every agenda day with availability
43
+ * found in those days, at most 60, so another date can be offered and
44
+ * searched next. Slots already past are left out. complete false means a
45
+ * bound stopped the search early (at most 40 professionals, 60 professional
46
+ * and room combinations, 16 agenda days read for slots, and 8 seconds):
47
+ * narrow the filters, and never present the result as the nearest. An empty
48
+ * slots list concerns this payer, service and filters only. The payer must be
49
+ * one list_payers answers, or PAYER_NOT_FOUND; the program and attention type
50
+ * come from list_programs, or BOOKING_OPTION_NOT_FOUND, and an attention type
51
+ * that is not exactly one unit answers PROGRAM_UNITS_NOT_SUPPORTED.
52
+ * Read-only: nothing is locked or reserved. The flow expires 30 minutes after
53
+ * the search; for create_appointment or reschedule_appointment, copy the
54
+ * selected slot's flowId and slotId verbatim. agentMode true answers concise
55
+ * Spanish text instead.
56
+ */
57
+ search(request: SearchRequest, options?: RequestOptions): Promise<SearchResponse>;
28
58
  }
29
59
  export declare function createClient(options: ClientOptions): Client;
30
60
  export declare function bind(transport: Transport): Client;
@@ -64,3 +94,5 @@ export interface ListRequest {
64
94
  agentMode?: boolean;
65
95
  }
66
96
  export type ListResponse = OficlinicListBookingSlotsResultResponse;
97
+ export type SearchRequest = OficlinicSearchBookingSlotsBody;
98
+ export type SearchResponse = OficlinicSearchBookingSlotsResultResponse;
@@ -1,13 +1,14 @@
1
1
  // Code generated by forge. DO NOT EDIT.
2
2
  /* eslint-disable */
3
3
  import { Transport, } from "../../_/index.js";
4
- import { OficlinicListBookingSlotsResultResponseCodec, } from "./models.js";
4
+ import { OficlinicListBookingSlotsResultResponseCodec, OficlinicSearchBookingSlotsResultResponseCodec, } from "./models.js";
5
5
  export function createClient(options) {
6
6
  return bind(new Transport(options));
7
7
  }
8
8
  export function bind(transport) {
9
9
  return {
10
10
  list: (request, options) => transport.send(ListOperation, request, options),
11
+ search: (request, options) => transport.send(SearchOperation, request, options),
11
12
  };
12
13
  }
13
14
  const ListOperation = {
@@ -17,3 +18,10 @@ const ListOperation = {
17
18
  response: OficlinicListBookingSlotsResultResponseCodec,
18
19
  errors: { "400": true, "401": true, "403": true, "404": true, "409": true, "410": true, "422": true, "429": true, "500": true, "502": true, "503": true, "504": true },
19
20
  };
21
+ const SearchOperation = {
22
+ method: "POST",
23
+ route: "/v1/oficlinic/booking-slots/search",
24
+ body: "flat",
25
+ response: OficlinicSearchBookingSlotsResultResponseCodec,
26
+ errors: { "400": true, "401": true, "403": true, "404": true, "409": true, "410": true, "413": true, "415": true, "422": true, "429": true, "500": true, "502": true, "503": true, "504": true },
27
+ };
@@ -1,5 +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, ListRequest, ListResponse, } from "./client.js";
5
- export type { OficlinicBookingSlot, OficlinicBookingSlotPage, OficlinicListBookingSlotsBadGatewayError, OficlinicListBookingSlotsBadGatewayFailure, OficlinicListBookingSlotsBadRequestError, OficlinicListBookingSlotsBadRequestFailure, OficlinicListBookingSlotsConflictError, OficlinicListBookingSlotsConflictFailure, OficlinicListBookingSlotsNotFoundError, OficlinicListBookingSlotsNotFoundFailure, OficlinicListBookingSlotsResult, OficlinicListBookingSlotsResultResponse, OficlinicListBookingSlotsServiceUnavailableError, OficlinicListBookingSlotsServiceUnavailableFailure, OficlinicListBookingSlotsTooManyRequestsError, OficlinicListBookingSlotsTooManyRequestsFailure, OficlinicListBookingSlotsUnprocessableContentError, OficlinicListBookingSlotsUnprocessableContentFailure, } from "./models.js";
4
+ export type { Client, ClientOptions, ListRequest, ListResponse, SearchRequest, SearchResponse, } from "./client.js";
5
+ export type { OficlinicBookingDateOffer, OficlinicBookingSlot, OficlinicBookingSlotOffer, OficlinicBookingSlotPage, OficlinicBookingSlotSearch, OficlinicListBookingSlotsBadGatewayError, OficlinicListBookingSlotsBadGatewayFailure, OficlinicListBookingSlotsBadRequestError, OficlinicListBookingSlotsBadRequestFailure, OficlinicListBookingSlotsConflictError, OficlinicListBookingSlotsConflictFailure, OficlinicListBookingSlotsNotFoundError, OficlinicListBookingSlotsNotFoundFailure, OficlinicListBookingSlotsResult, OficlinicListBookingSlotsResultResponse, OficlinicListBookingSlotsServiceUnavailableError, OficlinicListBookingSlotsServiceUnavailableFailure, OficlinicListBookingSlotsTooManyRequestsError, OficlinicListBookingSlotsTooManyRequestsFailure, OficlinicListBookingSlotsUnprocessableContentError, OficlinicListBookingSlotsUnprocessableContentFailure, OficlinicSearchBookingSlotsBadGatewayError, OficlinicSearchBookingSlotsBadGatewayFailure, OficlinicSearchBookingSlotsBadRequestError, OficlinicSearchBookingSlotsBadRequestFailure, OficlinicSearchBookingSlotsBody, OficlinicSearchBookingSlotsConflictError, OficlinicSearchBookingSlotsConflictFailure, OficlinicSearchBookingSlotsNotFoundError, OficlinicSearchBookingSlotsNotFoundFailure, OficlinicSearchBookingSlotsResult, OficlinicSearchBookingSlotsResultResponse, OficlinicSearchBookingSlotsServiceUnavailableError, OficlinicSearchBookingSlotsServiceUnavailableFailure, OficlinicSearchBookingSlotsTooManyRequestsError, OficlinicSearchBookingSlotsTooManyRequestsFailure, OficlinicSearchBookingSlotsUnprocessableContentError, OficlinicSearchBookingSlotsUnprocessableContentFailure, } from "./models.js";
@@ -1,5 +1,28 @@
1
1
  import type { CredentialsRejectedFailure, InvalidInputFailure, OutcomeUnknownFailure, PageInfo, ProviderProtocolChangedFailure, ProviderUnavailableFailure, RateLimitedFailure, ResponseMetadata, UpstreamUnavailableFailure } from "../../models.js";
2
- import type { OficlinicAgentText, OficlinicConnectionBusyFailure, OficlinicConnectionNotActiveFailure, OficlinicConnectionNotFoundFailure, OficlinicConnectionRequiredFailure, OficlinicContextNotAvailableFailure, OficlinicInvalidCursorFailure, OficlinicLoginCoolingDownFailure, OficlinicPayerNotFoundFailure, OficlinicProviderIdentityMismatchFailure, OficlinicReauthenticationRequiredFailure, OficlinicSelectionNotAvailableFailure, OficlinicSignInOutcomeUnknownFailure } from "../models.js";
2
+ import type { OficlinicAgentText, OficlinicBookingOptionNotFoundFailure, OficlinicConnectionBusyFailure, OficlinicConnectionNotActiveFailure, OficlinicConnectionNotFoundFailure, OficlinicConnectionRequiredFailure, OficlinicContextNotAvailableFailure, OficlinicInvalidCursorFailure, OficlinicLoginCoolingDownFailure, OficlinicPayerNotFoundFailure, OficlinicProgramUnitsNotSupportedFailure, OficlinicProviderIdentityMismatchFailure, OficlinicReauthenticationRequiredFailure, OficlinicSelectionNotAvailableFailure, OficlinicSignInOutcomeUnknownFailure } from "../models.js";
3
+ export interface OficlinicBookingDateOffer {
4
+ /**
5
+ * The provider's Disponibles count; null when not a count.
6
+ */
7
+ availableCount: number | null;
8
+ date: string;
9
+ /**
10
+ * The provider's agenda id (agendaID): pass it as dayId for its slots.
11
+ */
12
+ dayId: string;
13
+ professional: {
14
+ id: string;
15
+ name: string;
16
+ };
17
+ room: {
18
+ id: string;
19
+ name: string;
20
+ };
21
+ /**
22
+ * Whether this search read the day's slots; its future ones are in slots.
23
+ */
24
+ slotsListed: boolean;
25
+ }
3
26
  export interface OficlinicBookingSlot {
4
27
  date: string | null;
5
28
  dayId: string;
@@ -44,6 +67,44 @@ export interface OficlinicBookingSlot {
44
67
  */
45
68
  webBookable: boolean;
46
69
  }
70
+ export interface OficlinicBookingSlotOffer {
71
+ /**
72
+ * The slot's day in Colombia.
73
+ */
74
+ date: string;
75
+ /**
76
+ * The provider's agenda id of the slot's day.
77
+ */
78
+ dayId: string;
79
+ /**
80
+ * The slot's exact end; null if unrecognized.
81
+ */
82
+ endsAt: Temporal.Instant | null;
83
+ /**
84
+ * The availability flow of this slot: pass it with slotId to book.
85
+ */
86
+ flowId: string;
87
+ /**
88
+ * The provider's slot id (citaID): pass it as slotId to book.
89
+ */
90
+ id: string;
91
+ /**
92
+ * The slot as the provider describes it (citaDescripcion), usually its time.
93
+ */
94
+ label: string | null;
95
+ professional: {
96
+ id: string;
97
+ name: string;
98
+ };
99
+ room: {
100
+ id: string;
101
+ name: string;
102
+ };
103
+ /**
104
+ * The slot's exact start in America/Bogota; null if unrecognized.
105
+ */
106
+ startsAt: Temporal.Instant | null;
107
+ }
47
108
  export interface OficlinicBookingSlotPage {
48
109
  /**
49
110
  * Items admitted by this resource contract within the verified organization.
@@ -58,6 +119,38 @@ export interface OficlinicBookingSlotPage {
58
119
  */
59
120
  pageInfo: PageInfo;
60
121
  }
122
+ export interface OficlinicBookingSlotSearch {
123
+ /**
124
+ * false when a bound stopped the search before every matching professional,
125
+ * room and day was read: nearer slots may exist.
126
+ */
127
+ complete: boolean;
128
+ /**
129
+ * The agenda days with availability in the searched days, earliest first.
130
+ */
131
+ dates: OficlinicBookingDateOffer[];
132
+ /**
133
+ * When the flow expires.
134
+ */
135
+ flowExpiresAt: Temporal.Instant;
136
+ /**
137
+ * The availability flow id every booking list item carries (flowId). It
138
+ * expires 30 minutes after the first list.
139
+ */
140
+ flowId: string;
141
+ /**
142
+ * The first day searched.
143
+ */
144
+ from: string;
145
+ /**
146
+ * The nearest future slots of each room, earliest first.
147
+ */
148
+ slots: OficlinicBookingSlotOffer[];
149
+ /**
150
+ * The last day searched; null when open.
151
+ */
152
+ to: string | null;
153
+ }
61
154
  /**
62
155
  * A failed answer.
63
156
  */
@@ -162,6 +255,166 @@ export interface OficlinicListBookingSlotsUnprocessableContentError {
162
255
  success: false;
163
256
  }
164
257
  export type OficlinicListBookingSlotsUnprocessableContentFailure = CredentialsRejectedFailure | OficlinicContextNotAvailableFailure | OficlinicProviderIdentityMismatchFailure;
258
+ /**
259
+ * A failed answer.
260
+ */
261
+ export interface OficlinicSearchBookingSlotsBadGatewayError {
262
+ data: null;
263
+ error: OficlinicSearchBookingSlotsBadGatewayFailure;
264
+ /**
265
+ * What every answer carries besides its data or error.
266
+ */
267
+ metadata: ResponseMetadata;
268
+ success: false;
269
+ }
270
+ export type OficlinicSearchBookingSlotsBadGatewayFailure = OutcomeUnknownFailure | OficlinicSignInOutcomeUnknownFailure | ProviderProtocolChangedFailure;
271
+ /**
272
+ * A failed answer.
273
+ */
274
+ export interface OficlinicSearchBookingSlotsBadRequestError {
275
+ data: null;
276
+ error: OficlinicSearchBookingSlotsBadRequestFailure;
277
+ /**
278
+ * What every answer carries besides its data or error.
279
+ */
280
+ metadata: ResponseMetadata;
281
+ success: false;
282
+ }
283
+ export type OficlinicSearchBookingSlotsBadRequestFailure = InvalidInputFailure | OficlinicInvalidCursorFailure;
284
+ export interface OficlinicSearchBookingSlotsBody {
285
+ /**
286
+ * true answers { text }: concise Spanish facts for a messaging or voice
287
+ * agent, with the short ids and the cursor needed to continue. false, the
288
+ * default, answers the structured object.
289
+ */
290
+ agentMode?: boolean;
291
+ /**
292
+ * An attention type id the program lists in list_programs, with bookable
293
+ * true.
294
+ */
295
+ attentionTypeId: string;
296
+ /**
297
+ * An Account connection id of the caller's organization.
298
+ */
299
+ connectionId?: string;
300
+ /**
301
+ * The first day to search, YYYY-MM-DD in Colombia. Today when absent or in
302
+ * the past.
303
+ */
304
+ from?: string;
305
+ /**
306
+ * A payer id from list_payers.
307
+ */
308
+ payerId: string;
309
+ /**
310
+ * Only these professionals. Empty, the default, searches every professional
311
+ * the provider schedules for the service.
312
+ */
313
+ professionalIds?: string[];
314
+ /**
315
+ * A program id from list_programs.
316
+ */
317
+ programId: string;
318
+ /**
319
+ * Only these rooms, such as the rooms of one site. Empty, the default,
320
+ * searches every room.
321
+ */
322
+ roomIds?: string[];
323
+ /**
324
+ * A service id, such as one search_services answers.
325
+ */
326
+ serviceId: string;
327
+ /**
328
+ * The most slots answered for each room, nearest first.
329
+ */
330
+ slotsPerRoom?: number;
331
+ /**
332
+ * The last day to search, YYYY-MM-DD, not before from. Open when absent. The
333
+ * same day as from searches one day.
334
+ */
335
+ to?: string;
336
+ }
337
+ /**
338
+ * A failed answer.
339
+ */
340
+ export interface OficlinicSearchBookingSlotsConflictError {
341
+ data: null;
342
+ error: OficlinicSearchBookingSlotsConflictFailure;
343
+ /**
344
+ * What every answer carries besides its data or error.
345
+ */
346
+ metadata: ResponseMetadata;
347
+ success: false;
348
+ }
349
+ export type OficlinicSearchBookingSlotsConflictFailure = OficlinicConnectionRequiredFailure | OficlinicConnectionNotActiveFailure | OficlinicConnectionBusyFailure | OficlinicReauthenticationRequiredFailure | OficlinicSelectionNotAvailableFailure;
350
+ /**
351
+ * A failed answer.
352
+ */
353
+ export interface OficlinicSearchBookingSlotsNotFoundError {
354
+ data: null;
355
+ error: OficlinicSearchBookingSlotsNotFoundFailure;
356
+ /**
357
+ * What every answer carries besides its data or error.
358
+ */
359
+ metadata: ResponseMetadata;
360
+ success: false;
361
+ }
362
+ export type OficlinicSearchBookingSlotsNotFoundFailure = OficlinicConnectionNotFoundFailure | OficlinicPayerNotFoundFailure | OficlinicBookingOptionNotFoundFailure;
363
+ export type OficlinicSearchBookingSlotsResult = OficlinicBookingSlotSearch | OficlinicAgentText;
364
+ /**
365
+ * A successful answer.
366
+ */
367
+ export interface OficlinicSearchBookingSlotsResultResponse {
368
+ data: OficlinicSearchBookingSlotsResult;
369
+ error: null;
370
+ /**
371
+ * What every answer carries besides its data or error.
372
+ */
373
+ metadata: ResponseMetadata;
374
+ success: true;
375
+ }
376
+ /**
377
+ * A failed answer.
378
+ */
379
+ export interface OficlinicSearchBookingSlotsServiceUnavailableError {
380
+ data: null;
381
+ error: OficlinicSearchBookingSlotsServiceUnavailableFailure;
382
+ /**
383
+ * What every answer carries besides its data or error.
384
+ */
385
+ metadata: ResponseMetadata;
386
+ success: false;
387
+ }
388
+ export type OficlinicSearchBookingSlotsServiceUnavailableFailure = UpstreamUnavailableFailure | ProviderUnavailableFailure;
389
+ /**
390
+ * A failed answer.
391
+ */
392
+ export interface OficlinicSearchBookingSlotsTooManyRequestsError {
393
+ data: null;
394
+ error: OficlinicSearchBookingSlotsTooManyRequestsFailure;
395
+ /**
396
+ * What every answer carries besides its data or error.
397
+ */
398
+ metadata: ResponseMetadata;
399
+ success: false;
400
+ }
401
+ export type OficlinicSearchBookingSlotsTooManyRequestsFailure = RateLimitedFailure | OficlinicLoginCoolingDownFailure;
402
+ /**
403
+ * A failed answer.
404
+ */
405
+ export interface OficlinicSearchBookingSlotsUnprocessableContentError {
406
+ data: null;
407
+ error: OficlinicSearchBookingSlotsUnprocessableContentFailure;
408
+ /**
409
+ * What every answer carries besides its data or error.
410
+ */
411
+ metadata: ResponseMetadata;
412
+ success: false;
413
+ }
414
+ export type OficlinicSearchBookingSlotsUnprocessableContentFailure = CredentialsRejectedFailure | OficlinicContextNotAvailableFailure | OficlinicProviderIdentityMismatchFailure | OficlinicProgramUnitsNotSupportedFailure;
165
415
  export declare const OficlinicBookingSlotCodec: import("../../_/codec.js").Codec;
416
+ export declare const OficlinicBookingSlotOfferCodec: import("../../_/codec.js").Codec;
166
417
  export declare const OficlinicBookingSlotPageCodec: import("../../_/codec.js").Codec;
418
+ export declare const OficlinicBookingSlotSearchCodec: import("../../_/codec.js").Codec;
167
419
  export declare const OficlinicListBookingSlotsResultResponseCodec: import("../../_/codec.js").Codec;
420
+ export declare const OficlinicSearchBookingSlotsResultResponseCodec: import("../../_/codec.js").Codec;
@@ -5,9 +5,20 @@ export const OficlinicBookingSlotCodec = object([
5
5
  ["endsAt", null, instant],
6
6
  ["startsAt", null, instant],
7
7
  ]);
8
+ export const OficlinicBookingSlotOfferCodec = object([
9
+ ["endsAt", null, instant],
10
+ ["startsAt", null, instant],
11
+ ]);
8
12
  export const OficlinicBookingSlotPageCodec = object([
9
13
  ["data", null, array(() => OficlinicBookingSlotCodec)],
10
14
  ]);
15
+ export const OficlinicBookingSlotSearchCodec = object([
16
+ ["flowExpiresAt", null, instant],
17
+ ["slots", null, array(() => OficlinicBookingSlotOfferCodec)],
18
+ ]);
11
19
  export const OficlinicListBookingSlotsResultResponseCodec = object([
12
20
  ["data", null, () => OficlinicBookingSlotPageCodec],
13
21
  ]);
22
+ export const OficlinicSearchBookingSlotsResultResponseCodec = object([
23
+ ["data", null, () => OficlinicBookingSlotSearchCodec],
24
+ ]);
@@ -1,4 +1,5 @@
1
1
  import { type BaseClientOptions, type RequestOptions, Transport } from "../../_/index.js";
2
+ import type { DeletedObjectResponse } from "../../models.js";
2
3
  import { type RaizAgentPageResponse, type RaizAgentResponse, type RaizCreateAgentBody, type RaizUpdateAgentBody } from "./models.js";
3
4
  export interface ClientOptions extends BaseClientOptions {
4
5
  /**
@@ -29,6 +30,16 @@ export interface Client {
29
30
  * first.
30
31
  */
31
32
  create(request: CreateRequest, options?: RequestOptions): Promise<CreateResponse>;
33
+ /**
34
+ * Delete an Agent
35
+ *
36
+ * Delete an Agent for good; its conversations remain. Refused with
37
+ * AGENT_IN_USE while a channel or an active campaign uses it: unassign its
38
+ * channels (`update_channel` with `agentId: null`) or finish the campaign
39
+ * first. Not an AI tool; to stop an Agent without deleting it, pause it with
40
+ * `update_agent` (`status: paused`).
41
+ */
42
+ delete(request: DeleteRequest, options?: RequestOptions): Promise<DeleteResponse>;
32
43
  /**
33
44
  * Get an Agent
34
45
  *
@@ -76,6 +87,13 @@ export declare function createClient(options: ClientOptions): Client;
76
87
  export declare function bind(transport: Transport): Client;
77
88
  export type CreateRequest = RaizCreateAgentBody;
78
89
  export type CreateResponse = RaizAgentResponse;
90
+ export interface DeleteRequest {
91
+ /**
92
+ * Agent id.
93
+ */
94
+ agentId: string;
95
+ }
96
+ export type DeleteResponse = DeletedObjectResponse;
79
97
  export interface GetRequest {
80
98
  /**
81
99
  * Agent id.
@@ -8,6 +8,7 @@ export function createClient(options) {
8
8
  export function bind(transport) {
9
9
  return {
10
10
  create: (request, options) => transport.send(CreateOperation, request, options),
11
+ delete: (request, options) => transport.send(DeleteOperation, request, options),
11
12
  get: (request, options) => transport.send(GetOperation, request, options),
12
13
  list: (request, options) => transport.send(ListOperation, request, options),
13
14
  update: (request, options) => transport.send(UpdateOperation, request, options),
@@ -21,6 +22,12 @@ const CreateOperation = {
21
22
  response: RaizAgentResponseCodec,
22
23
  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 },
23
24
  };
25
+ const DeleteOperation = {
26
+ method: "DELETE",
27
+ route: "/v1/raiz/agents/{agentId}",
28
+ response: null,
29
+ errors: { "400": true, "401": true, "403": true, "404": true, "409": true, "422": true, "429": true, "500": true, "502": true, "503": true, "504": true },
30
+ };
24
31
  const GetOperation = {
25
32
  method: "GET",
26
33
  route: "/v1/raiz/agents/{agentId}",
@@ -1,5 +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, CreateRequest, CreateResponse, GetRequest, GetResponse, ListRequest, ListResponse, UpdateRequest, UpdateResponse, } from "./client.js";
5
- export type { RaizAgent, RaizAgentGreeting, RaizAgentIntegrationToolInput, RaizAgentModelTrial, RaizAgentPage, RaizAgentPageResponse, RaizAgentProcedure, RaizAgentResponse, RaizAgentSettings, RaizAgentSettingsInput, RaizAgentTurnPolicy, RaizAgentVoiceSettings, RaizAgentWorkflow, RaizCreateAgentBody, RaizCreateAgentConflictError, RaizCreateAgentConflictFailure, RaizCreateAgentServiceUnavailableError, RaizCreateAgentServiceUnavailableFailure, RaizCreateAgentUnprocessableContentError, RaizCreateAgentUnprocessableContentFailure, RaizGetAgentServiceUnavailableError, RaizGetAgentServiceUnavailableFailure, RaizListAgentsBadRequestError, RaizListAgentsBadRequestFailure, RaizListAgentsServiceUnavailableError, RaizListAgentsServiceUnavailableFailure, RaizUpdateAgentBody, RaizUpdateAgentConflictError, RaizUpdateAgentConflictFailure, RaizUpdateAgentServiceUnavailableError, RaizUpdateAgentServiceUnavailableFailure, RaizUpdateAgentUnprocessableContentError, RaizUpdateAgentUnprocessableContentFailure, } from "./models.js";
4
+ export type { Client, ClientOptions, CreateRequest, CreateResponse, DeleteRequest, DeleteResponse, GetRequest, GetResponse, ListRequest, ListResponse, UpdateRequest, UpdateResponse, } from "./client.js";
5
+ export type { RaizAgent, RaizAgentGreeting, RaizAgentIntegrationToolInput, RaizAgentModelTrial, RaizAgentPage, RaizAgentPageResponse, RaizAgentProcedure, RaizAgentResponse, RaizAgentSettings, RaizAgentSettingsInput, RaizAgentTurnPolicy, RaizAgentVoiceSettings, RaizAgentWorkflow, RaizCreateAgentBody, RaizCreateAgentConflictError, RaizCreateAgentConflictFailure, RaizCreateAgentServiceUnavailableError, RaizCreateAgentServiceUnavailableFailure, RaizCreateAgentUnprocessableContentError, RaizCreateAgentUnprocessableContentFailure, RaizDeleteAgentConflictError, RaizDeleteAgentConflictFailure, RaizGetAgentServiceUnavailableError, RaizGetAgentServiceUnavailableFailure, RaizKnowledgeDocumentUnavailableError, RaizListAgentsBadRequestError, RaizListAgentsBadRequestFailure, RaizListAgentsServiceUnavailableError, RaizListAgentsServiceUnavailableFailure, RaizUpdateAgentBody, RaizUpdateAgentConflictError, RaizUpdateAgentConflictFailure, RaizUpdateAgentServiceUnavailableError, RaizUpdateAgentServiceUnavailableFailure, RaizUpdateAgentUnprocessableContentError, RaizUpdateAgentUnprocessableContentFailure, } from "./models.js";
@@ -641,6 +641,19 @@ export interface RaizCreateAgentUnprocessableContentError {
641
641
  success: false;
642
642
  }
643
643
  export type RaizCreateAgentUnprocessableContentFailure = RaizAgentProceduresInvalidFailure | RaizAgentWorkflowInvalidFailure | RaizAgentSettingsInvalidFailure | RaizIntegrationProcedureUnavailableFailure | RaizIntegrationToolUnavailableFailure | RaizKnowledgeDocumentUnavailableFailure;
644
+ /**
645
+ * A failed answer.
646
+ */
647
+ export interface RaizDeleteAgentConflictError {
648
+ data: null;
649
+ error: RaizDeleteAgentConflictFailure;
650
+ /**
651
+ * What every answer carries besides its data or error.
652
+ */
653
+ metadata: ResponseMetadata;
654
+ success: false;
655
+ }
656
+ export type RaizDeleteAgentConflictFailure = RaizAgentInUseFailure | RaizAgentModalityLockedFailure | RaizVersionConflictFailure;
644
657
  /**
645
658
  * A failed answer.
646
659
  */
@@ -654,6 +667,21 @@ export interface RaizGetAgentServiceUnavailableError {
654
667
  success: false;
655
668
  }
656
669
  export type RaizGetAgentServiceUnavailableFailure = UpstreamUnavailableFailure | RaizVoiceUnavailableFailure | RaizIntegrationsUnavailableFailure;
670
+ /**
671
+ * A failed answer.
672
+ */
673
+ export interface RaizKnowledgeDocumentUnavailableError {
674
+ data: null;
675
+ /**
676
+ * A Knowledge document does not exist in this organization.
677
+ */
678
+ error: RaizKnowledgeDocumentUnavailableFailure;
679
+ /**
680
+ * What every answer carries besides its data or error.
681
+ */
682
+ metadata: ResponseMetadata;
683
+ success: false;
684
+ }
657
685
  /**
658
686
  * A failed answer.
659
687
  */
@@ -37,11 +37,11 @@ export interface Client {
37
37
  /**
38
38
  * Update the organization
39
39
  *
40
- * Change the organization's name, default language, time zone or settings.
41
- * Settings merge: an omitted setting stays and `null` returns it to its
42
- * default; `notifications.recipients` is replaced as a whole. Fails with
43
- * TIME_ZONE_UNKNOWN when the time zone is not a valid IANA zone (for example
44
- * `America/Bogota`).
40
+ * Change the organization's default language, time zone or settings. Edit the
41
+ * organization's name in Arbol Account. Settings merge: an omitted setting
42
+ * stays and `null` returns it to its default; `notifications.recipients` is
43
+ * replaced as a whole. Fails with TIME_ZONE_UNKNOWN when the time zone is not
44
+ * a valid IANA zone (for example `America/Bogota`).
45
45
  */
46
46
  update(request?: UpdateRequest, options?: RequestOptions): Promise<UpdateResponse>;
47
47
  }
@@ -177,6 +177,12 @@ export interface RaizUpdateOrganizationBody {
177
177
  * BCP 47 language tag.
178
178
  */
179
179
  language?: string;
180
+ /**
181
+ * Legacy field for clients that echo the existing name. Edit the organization
182
+ * name in Arbol Account.
183
+ *
184
+ * @deprecated
185
+ */
180
186
  name?: string;
181
187
  /**
182
188
  * Settings to change. An omitted setting stays as it is; `null` returns it to
@@ -10,9 +10,10 @@ export interface Client {
10
10
  /**
11
11
  * Look up eligibility
12
12
  *
13
- * Look up affiliate rights by exact document. Eligible coverage does not
14
- * authorize a procedure or determine patient charges. A noContract outcome is
15
- * distinct from inactive or unavailable.
13
+ * Look up affiliate rights by exact document. Verified results for the same
14
+ * document and connection are reused for seven days. Eligible coverage does
15
+ * not authorize a procedure or determine patient charges. A noContract
16
+ * outcome is distinct from inactive or unavailable.
16
17
  */
17
18
  lookup(request: LookupRequest, options?: RequestOptions): Promise<LookupResponse>;
18
19
  }
@@ -37,10 +37,11 @@ export interface SuraLookupEligibilityBody {
37
37
  */
38
38
  documentNumber: string;
39
39
  /**
40
- * Document type. Defaults to CC. CE, RC and TI are read through the same
41
- * form.
40
+ * The patient's document type. Send CC (cédula de ciudadanía) when the person
41
+ * gives only a number; send CE (cédula de extranjería), RC (registro civil)
42
+ * or TI (tarjeta de identidad) when the person or the document names it.
42
43
  */
43
- documentType?: "CC" | "CE" | "RC" | "TI" | null;
44
+ documentType: "CC" | "CE" | "RC" | "TI";
44
45
  }
45
46
  /**
46
47
  * A failed answer.
@@ -41,10 +41,11 @@ export interface SuraLookupAuthorizationBody {
41
41
  */
42
42
  documentNumber: string;
43
43
  /**
44
- * Document type. Defaults to CC. CE, RC and TI are read through the same
45
- * form.
44
+ * The patient's document type. Send CC (cédula de ciudadanía) when the person
45
+ * gives only a number; send CE (cédula de extranjería), RC (registro civil)
46
+ * or TI (tarjeta de identidad) when the person or the document names it.
46
47
  */
47
- documentType?: "CC" | "CE" | "RC" | "TI" | null;
48
+ documentType: "CC" | "CE" | "RC" | "TI";
48
49
  /**
49
50
  * Issuer code before the hyphen in the authorization identifier.
50
51
  */
@@ -6,6 +6,7 @@ import { type Client as AvailabilityClient } from "./availability/client.js";
6
6
  import { type Client as BookingOptionsClient } from "./bookingOptions/client.js";
7
7
  import { type Client as ConnectionsClient } from "./connections/client.js";
8
8
  import { type Client as CopaysClient } from "./copays/client.js";
9
+ import { type Client as OperationTasksClient } from "./operationTasks/client.js";
9
10
  import { type Client as OperationsClient } from "./operations/client.js";
10
11
  import { type Client as PatientsClient } from "./patients/client.js";
11
12
  import { type Client as ProfessionalsClient } from "./professionals/client.js";
@@ -25,6 +26,7 @@ export interface Client {
25
26
  readonly bookingOptions: BookingOptionsClient;
26
27
  readonly connections: ConnectionsClient;
27
28
  readonly copays: CopaysClient;
29
+ readonly operationTasks: OperationTasksClient;
28
30
  readonly operations: OperationsClient;
29
31
  readonly patients: PatientsClient;
30
32
  readonly professionals: ProfessionalsClient;
@@ -8,6 +8,7 @@ import { bind as bindAvailability, } from "./availability/client.js";
8
8
  import { bind as bindBookingOptions, } from "./bookingOptions/client.js";
9
9
  import { bind as bindConnections, } from "./connections/client.js";
10
10
  import { bind as bindCopays, } from "./copays/client.js";
11
+ import { bind as bindOperationTasks, } from "./operationTasks/client.js";
11
12
  import { bind as bindOperations, } from "./operations/client.js";
12
13
  import { bind as bindPatients, } from "./patients/client.js";
13
14
  import { bind as bindProfessionals, } from "./professionals/client.js";
@@ -24,6 +25,7 @@ export function bind(transport) {
24
25
  let bookingOptionsClient;
25
26
  let connectionsClient;
26
27
  let copaysClient;
28
+ let operationTasksClient;
27
29
  let operationsClient;
28
30
  let patientsClient;
29
31
  let professionalsClient;
@@ -51,6 +53,9 @@ export function bind(transport) {
51
53
  get copays() {
52
54
  return (copaysClient ??= bindCopays(transport));
53
55
  },
56
+ get operationTasks() {
57
+ return (operationTasksClient ??= bindOperationTasks(transport));
58
+ },
54
59
  get operations() {
55
60
  return (operationsClient ??= bindOperations(transport));
56
61
  },
@@ -111,8 +111,8 @@ export interface SuraAuthorization {
111
111
  }[] | null;
112
112
  providerCode: string;
113
113
  /**
114
- * ENTREGADA, POR CONVENIO or ANULADA. An ANULADA authorization no longer
115
- * serves.
114
+ * ENTREGADA, POR CONVENIO, ANULADA or PAGADA. An ANULADA authorization no
115
+ * longer serves.
116
116
  */
117
117
  providerStatus: string;
118
118
  receivingProvider: {
@@ -0,0 +1,42 @@
1
+ import { type BaseClientOptions, type RequestOptions, Transport } from "../../_/index.js";
2
+ import type { Empty } from "../../models.js";
3
+ import { type SuraOperationTaskResponse } from "./models.js";
4
+ export interface ClientOptions extends BaseClientOptions {
5
+ /**
6
+ * The URL the paths of the API are relative to.
7
+ */
8
+ baseUrl: string;
9
+ }
10
+ export interface Client {
11
+ /**
12
+ * Cancel a task
13
+ *
14
+ * Cancel a task you started that has not started running; one that has runs
15
+ * to its end.
16
+ */
17
+ cancel(request: CancelRequest, options?: RequestOptions): Promise<CancelResponse>;
18
+ /**
19
+ * Read a task
20
+ *
21
+ * Read a task you started: whether it still works, then the operation's value
22
+ * or failure.
23
+ */
24
+ get(request: GetRequest, options?: RequestOptions): Promise<GetResponse>;
25
+ }
26
+ export declare function createClient(options: ClientOptions): Client;
27
+ export declare function bind(transport: Transport): Client;
28
+ export interface CancelRequest {
29
+ /**
30
+ * The task id.
31
+ */
32
+ taskId: string;
33
+ body: Empty;
34
+ }
35
+ export type CancelResponse = SuraOperationTaskResponse;
36
+ export interface GetRequest {
37
+ /**
38
+ * The task id.
39
+ */
40
+ taskId: string;
41
+ }
42
+ export type GetResponse = SuraOperationTaskResponse;
@@ -0,0 +1,26 @@
1
+ // Code generated by forge. DO NOT EDIT.
2
+ /* eslint-disable */
3
+ import { Transport, } from "../../_/index.js";
4
+ import { SuraOperationTaskResponseCodec, } from "./models.js";
5
+ export function createClient(options) {
6
+ return bind(new Transport(options));
7
+ }
8
+ export function bind(transport) {
9
+ return {
10
+ cancel: (request, options) => transport.send(CancelOperation, request, options),
11
+ get: (request, options) => transport.send(GetOperation, request, options),
12
+ };
13
+ }
14
+ const CancelOperation = {
15
+ method: "POST",
16
+ route: "/v1/sura/operation-tasks/{taskId}/cancel",
17
+ body: "nested",
18
+ response: SuraOperationTaskResponseCodec,
19
+ errors: { "400": true, "401": true, "403": true, "413": true, "415": true, "429": true, "500": true, "502": true, "503": true, "504": true },
20
+ };
21
+ const GetOperation = {
22
+ method: "GET",
23
+ route: "/v1/sura/operation-tasks/{taskId}",
24
+ response: SuraOperationTaskResponseCodec,
25
+ errors: { "400": true, "401": true, "403": true, "429": true, "500": true, "502": true, "503": true, "504": true },
26
+ };
@@ -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, CancelRequest, CancelResponse, GetRequest, GetResponse, } from "./client.js";
5
+ export type { SuraFailure, SuraOperationTask, SuraOperationTaskResponse, } 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,54 @@
1
+ import type { ResponseMetadata } from "../../models.js";
2
+ export interface SuraFailure {
3
+ /**
4
+ * The failure code, stable across releases.
5
+ */
6
+ code: string;
7
+ /**
8
+ * Diagnostics the code declares; empty for most codes.
9
+ */
10
+ data: {
11
+ [key: string]: unknown;
12
+ };
13
+ /**
14
+ * What went wrong, for people; it never contains input values.
15
+ */
16
+ message: string;
17
+ /**
18
+ * Whether repeating the same request may succeed.
19
+ */
20
+ retryable: boolean;
21
+ }
22
+ export interface SuraOperationTask {
23
+ createdAt: Temporal.Instant;
24
+ /**
25
+ * The operation's failure, once failed.
26
+ */
27
+ error?: SuraFailure;
28
+ lastUpdatedAt: Temporal.Instant;
29
+ pollIntervalMs: number;
30
+ /**
31
+ * The operation's value, once completed.
32
+ */
33
+ result?: unknown;
34
+ status: "working" | "completed" | "failed" | "cancelled";
35
+ taskId: string;
36
+ ttlMs: number;
37
+ }
38
+ /**
39
+ * A successful answer.
40
+ */
41
+ export interface SuraOperationTaskResponse {
42
+ /**
43
+ * A call that goes on after it was answered.
44
+ */
45
+ data: SuraOperationTask;
46
+ error: null;
47
+ /**
48
+ * What every answer carries besides its data or error.
49
+ */
50
+ metadata: ResponseMetadata;
51
+ success: true;
52
+ }
53
+ export declare const SuraOperationTaskCodec: import("../../_/codec.js").Codec;
54
+ export declare const SuraOperationTaskResponseCodec: import("../../_/codec.js").Codec;
@@ -0,0 +1,10 @@
1
+ // Code generated by forge. DO NOT EDIT.
2
+ /* eslint-disable */
3
+ import { instant, object } from "../../_/index.js";
4
+ export const SuraOperationTaskCodec = object([
5
+ ["createdAt", null, instant],
6
+ ["lastUpdatedAt", null, instant],
7
+ ]);
8
+ export const SuraOperationTaskResponseCodec = object([
9
+ ["data", null, () => SuraOperationTaskCodec],
10
+ ]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arbol-ai/sdk",
3
- "version": "5.54.0",
3
+ "version": "5.56.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",
@@ -58,8 +58,8 @@
58
58
  "packageManager": "bun@1.4.3",
59
59
  "arbol": {
60
60
  "openapi": {
61
- "release": "1.20261111.205940",
62
- "sha256": "97756a7305948ba3086f980b2109847a2733b03f0245b151dff3aea1e0a6f334"
61
+ "release": "1.20261112.191820",
62
+ "sha256": "2f7c07c79d552e9dc7f380e56101da2571ccb50d22ebd1568c1282c69a0ef313"
63
63
  }
64
64
  }
65
65
  }