@arbol-ai/sdk 5.33.0 → 5.34.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.
@@ -9,6 +9,7 @@ import { type Client as CopaysClient } from "./copays/client.js";
9
9
  import { type Client as OperationsClient } from "./operations/client.js";
10
10
  import { type Client as PatientsClient } from "./patients/client.js";
11
11
  import { type Client as ProfessionalsClient } from "./professionals/client.js";
12
+ import { type Client as SchedulesClient } from "./schedules/client.js";
12
13
  import { type Client as ServicesClient } from "./services/client.js";
13
14
  export interface ClientOptions extends BaseClientOptions {
14
15
  /**
@@ -27,6 +28,7 @@ export interface Client {
27
28
  readonly operations: OperationsClient;
28
29
  readonly patients: PatientsClient;
29
30
  readonly professionals: ProfessionalsClient;
31
+ readonly schedules: SchedulesClient;
30
32
  readonly services: ServicesClient;
31
33
  }
32
34
  export declare function createClient(options: ClientOptions): Client;
@@ -11,6 +11,7 @@ import { bind as bindCopays, } from "./copays/client.js";
11
11
  import { bind as bindOperations, } from "./operations/client.js";
12
12
  import { bind as bindPatients, } from "./patients/client.js";
13
13
  import { bind as bindProfessionals, } from "./professionals/client.js";
14
+ import { bind as bindSchedules, } from "./schedules/client.js";
14
15
  import { bind as bindServices, } from "./services/client.js";
15
16
  export function createClient(options) {
16
17
  return bind(new Transport(options));
@@ -26,6 +27,7 @@ export function bind(transport) {
26
27
  let operationsClient;
27
28
  let patientsClient;
28
29
  let professionalsClient;
30
+ let schedulesClient;
29
31
  let servicesClient;
30
32
  return {
31
33
  get affiliations() {
@@ -58,6 +60,9 @@ export function bind(transport) {
58
60
  get professionals() {
59
61
  return (professionalsClient ??= bindProfessionals(transport));
60
62
  },
63
+ get schedules() {
64
+ return (schedulesClient ??= bindSchedules(transport));
65
+ },
61
66
  get services() {
62
67
  return (servicesClient ??= bindServices(transport));
63
68
  },
@@ -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 { SuraAffiliation, SuraAppointment, SuraAppointmentPage, SuraAuthorization, SuraAvailability, SuraAvailabilityPatient, SuraAvailableDay, SuraBookedAppointment, SuraCancelledAppointment, SuraConnectionNotConfiguredFailure, SuraCopayEntry, SuraCopayHistory, SuraNoContract, SuraNoCopayHistory, SuraOpening, SuraPatient, SuraPatientFound, SuraPatientNotFound, SuraPendingResult, SuraPortalCredentialsRejectedFailure, SuraPortalSessionConflictFailure, SuraPortalUnavailableFailure, SuraPreparationAvailable, SuraPreparationExistingAppointment, SuraPreparationNoSlots, SuraPreparationPatientNotFound, SuraRefusal, SuraSearchedDay, SuraService, SuraServicePage, SuraToolRefusedError, SuraToolRefusedFailure, SuraToolRefusedFailureData, } from "./models.js";
5
+ export type { SuraAffiliation, SuraAppointment, SuraAppointmentPage, SuraAuthorization, SuraAvailability, SuraAvailabilityPatient, SuraAvailableDay, SuraBookedAppointment, SuraCancelledAppointment, SuraConnectionNotConfiguredFailure, SuraCopayEntry, SuraCopayHistory, SuraNoContract, SuraNoCopayHistory, SuraOpening, SuraPatient, SuraPatientFound, SuraPatientNotFound, SuraPendingResult, SuraPortalCredentialsRejectedFailure, SuraPortalSessionConflictFailure, SuraPortalUnavailableFailure, SuraPreparationAvailable, SuraPreparationExistingAppointment, SuraPreparationNoSlots, SuraPreparationPatientNotFound, SuraRefusal, SuraSchedule, SuraScheduleCapacity, SuraScheduleHours, SuraScheduleStatus, SuraSearchedDay, SuraService, SuraServicePage, SuraServiceSchedule, SuraToolRefusedError, SuraToolRefusedFailure, SuraToolRefusedFailureData, } from "./models.js";
@@ -573,6 +573,36 @@ export interface SuraRefusal {
573
573
  times?: string[];
574
574
  today?: string;
575
575
  }
576
+ export interface SuraSchedule {
577
+ /**
578
+ * Spanish guidance for the model: what to do next.
579
+ */
580
+ aiHint: string;
581
+ capacity: SuraScheduleCapacity;
582
+ date: Temporal.PlainDate;
583
+ institutionId: string;
584
+ observedAt: Temporal.Instant;
585
+ ok: true;
586
+ professional: string;
587
+ services: SuraServiceSchedule[];
588
+ status: SuraScheduleStatus;
589
+ }
590
+ export interface SuraScheduleCapacity {
591
+ assignedCount: number;
592
+ availableCount: number;
593
+ blockedCount: number;
594
+ createdCount: number;
595
+ offeredCount: number;
596
+ }
597
+ export interface SuraScheduleHours {
598
+ dayOfWeek: number;
599
+ durationMinutes: number;
600
+ generated: boolean;
601
+ patientsPerSlot: number;
602
+ timeFrom: string;
603
+ timeUntil: string;
604
+ }
605
+ export type SuraScheduleStatus = "available" | "full" | "blocked" | "not_scheduled" | "not_generated" | "not_offered";
576
606
  export interface SuraSearchedDay {
577
607
  date: string | null;
578
608
  professional: string | null;
@@ -597,6 +627,19 @@ export interface SuraServicePage {
597
627
  */
598
628
  pageInfo: PageInfo;
599
629
  }
630
+ export interface SuraServiceSchedule {
631
+ capacity: SuraScheduleCapacity;
632
+ periods: {
633
+ fromDate: Temporal.PlainDate;
634
+ generated: boolean;
635
+ generationStatus: "generated" | "not_generated" | "partially_generated";
636
+ hours: SuraScheduleHours[];
637
+ untilDate: Temporal.PlainDate;
638
+ }[];
639
+ serviceId: string;
640
+ serviceName: string;
641
+ status: SuraScheduleStatus;
642
+ }
600
643
  /**
601
644
  * A failed answer.
602
645
  */
@@ -676,3 +719,5 @@ export declare const SuraPreparationExistingAppointmentCodec: import("../_/codec
676
719
  export declare const SuraPreparationNoSlotsCodec: import("../_/codec.js").Codec;
677
720
  export declare const SuraPreparationPatientNotFoundCodec: import("../_/codec.js").Codec;
678
721
  export declare const SuraRefusalCodec: import("../_/codec.js").Codec;
722
+ export declare const SuraScheduleCodec: import("../_/codec.js").Codec;
723
+ export declare const SuraServiceScheduleCodec: import("../_/codec.js").Codec;
@@ -1,6 +1,6 @@
1
1
  // Code generated by forge. DO NOT EDIT.
2
2
  /* eslint-disable */
3
- import { array, instant, object } from "../_/index.js";
3
+ import { array, date, instant, object } from "../_/index.js";
4
4
  export const SuraAffiliationCodec = object([
5
5
  ["ai_hint", "aiHint"],
6
6
  ]);
@@ -68,3 +68,12 @@ export const SuraRefusalCodec = object([
68
68
  ["appointments", null, array(() => SuraAppointmentCodec)],
69
69
  ["options", null, array(() => SuraAppointmentCodec)],
70
70
  ]);
71
+ export const SuraScheduleCodec = object([
72
+ ["ai_hint", "aiHint"],
73
+ ["date", null, date],
74
+ ["observedAt", null, instant],
75
+ ["services", null, array(() => SuraServiceScheduleCodec)],
76
+ ]);
77
+ export const SuraServiceScheduleCodec = object([
78
+ ["periods", null, array(object([["fromDate", null, date], ["untilDate", null, date]]))],
79
+ ]);
@@ -1,5 +1,5 @@
1
1
  import type { OutcomeUnknownFailure, ResponseMetadata } from "../../models.js";
2
- import { type SuraAffiliation, type SuraAppointmentPage, type SuraAuthorization, type SuraAvailability, type SuraBookedAppointment, type SuraCancelledAppointment, type SuraConnectionNotConfiguredFailure, type SuraCopayHistory, type SuraNoContract, type SuraNoCopayHistory, type SuraPatientFound, type SuraPatientNotFound, type SuraPendingResult, type SuraPortalCredentialsRejectedFailure, type SuraPortalSessionConflictFailure, type SuraPortalUnavailableFailure, type SuraPreparationAvailable, type SuraPreparationExistingAppointment, type SuraPreparationNoSlots, type SuraPreparationPatientNotFound, type SuraRefusal, type SuraServicePage } from "../models.js";
2
+ import { type SuraAffiliation, type SuraAppointmentPage, type SuraAuthorization, type SuraAvailability, type SuraBookedAppointment, type SuraCancelledAppointment, type SuraConnectionNotConfiguredFailure, type SuraCopayHistory, type SuraNoContract, type SuraNoCopayHistory, type SuraPatientFound, type SuraPatientNotFound, type SuraPendingResult, type SuraPortalCredentialsRejectedFailure, type SuraPortalSessionConflictFailure, type SuraPortalUnavailableFailure, type SuraPreparationAvailable, type SuraPreparationExistingAppointment, type SuraPreparationNoSlots, type SuraPreparationPatientNotFound, type SuraRefusal, type SuraSchedule, type SuraServicePage } from "../models.js";
3
3
  /**
4
4
  * A failed answer.
5
5
  */
@@ -26,7 +26,7 @@ export interface SuraGetOperationConflictError {
26
26
  success: false;
27
27
  }
28
28
  export type SuraGetOperationConflictFailure = SuraPortalSessionConflictFailure | SuraConnectionNotConfiguredFailure;
29
- export type SuraGetOperationResult = SuraPendingResult | SuraRefusal | SuraPatientNotFound | SuraPreparationPatientNotFound | SuraPatientFound | SuraServicePage | SuraAvailability | SuraPreparationExistingAppointment | SuraPreparationAvailable | SuraPreparationNoSlots | SuraBookedAppointment | SuraAppointmentPage | SuraCancelledAppointment | SuraAffiliation | SuraNoContract | SuraAuthorization | SuraCopayHistory | SuraNoCopayHistory;
29
+ export type SuraGetOperationResult = SuraPendingResult | SuraRefusal | SuraPatientNotFound | SuraPreparationPatientNotFound | SuraPatientFound | SuraServicePage | SuraAvailability | SuraSchedule | SuraPreparationExistingAppointment | SuraPreparationAvailable | SuraPreparationNoSlots | SuraBookedAppointment | SuraAppointmentPage | SuraCancelledAppointment | SuraAffiliation | SuraNoContract | SuraAuthorization | SuraCopayHistory | SuraNoCopayHistory;
30
30
  /**
31
31
  * A successful answer.
32
32
  */
@@ -1,8 +1,8 @@
1
1
  // Code generated by forge. DO NOT EDIT.
2
2
  /* eslint-disable */
3
3
  import { object, union } from "../../_/index.js";
4
- import { SuraAffiliationCodec, SuraAppointmentPageCodec, SuraAuthorizationCodec, SuraAvailabilityCodec, SuraBookedAppointmentCodec, SuraCancelledAppointmentCodec, SuraCopayHistoryCodec, SuraNoContractCodec, SuraNoCopayHistoryCodec, SuraPatientFoundCodec, SuraPatientNotFoundCodec, SuraPendingResultCodec, SuraPreparationAvailableCodec, SuraPreparationExistingAppointmentCodec, SuraPreparationNoSlotsCodec, SuraPreparationPatientNotFoundCodec, SuraRefusalCodec, } from "../models.js";
5
- export const SuraGetOperationResultCodec = union([() => SuraPendingResultCodec, () => SuraRefusalCodec, () => SuraPatientNotFoundCodec, () => SuraPreparationPatientNotFoundCodec, () => SuraPatientFoundCodec, () => SuraAvailabilityCodec, () => SuraPreparationExistingAppointmentCodec, () => SuraPreparationAvailableCodec, () => SuraPreparationNoSlotsCodec, () => SuraBookedAppointmentCodec, () => SuraAppointmentPageCodec, () => SuraCancelledAppointmentCodec, () => SuraAffiliationCodec, () => SuraNoContractCodec, () => SuraAuthorizationCodec, () => SuraCopayHistoryCodec, () => SuraNoCopayHistoryCodec]);
4
+ import { SuraAffiliationCodec, SuraAppointmentPageCodec, SuraAuthorizationCodec, SuraAvailabilityCodec, SuraBookedAppointmentCodec, SuraCancelledAppointmentCodec, SuraCopayHistoryCodec, SuraNoContractCodec, SuraNoCopayHistoryCodec, SuraPatientFoundCodec, SuraPatientNotFoundCodec, SuraPendingResultCodec, SuraPreparationAvailableCodec, SuraPreparationExistingAppointmentCodec, SuraPreparationNoSlotsCodec, SuraPreparationPatientNotFoundCodec, SuraRefusalCodec, SuraScheduleCodec, } from "../models.js";
5
+ export const SuraGetOperationResultCodec = union([() => SuraPendingResultCodec, () => SuraRefusalCodec, () => SuraPatientNotFoundCodec, () => SuraPreparationPatientNotFoundCodec, () => SuraPatientFoundCodec, () => SuraAvailabilityCodec, () => SuraScheduleCodec, () => SuraPreparationExistingAppointmentCodec, () => SuraPreparationAvailableCodec, () => SuraPreparationNoSlotsCodec, () => SuraBookedAppointmentCodec, () => SuraAppointmentPageCodec, () => SuraCancelledAppointmentCodec, () => SuraAffiliationCodec, () => SuraNoContractCodec, () => SuraAuthorizationCodec, () => SuraCopayHistoryCodec, () => SuraNoCopayHistoryCodec]);
6
6
  export const SuraGetOperationResultResponseCodec = object([
7
7
  ["data", null, () => SuraGetOperationResultCodec],
8
8
  ]);
@@ -0,0 +1,29 @@
1
+ import { type BaseClientOptions, type RequestOptions, Transport } from "../../_/index.js";
2
+ import { type SuraLookupScheduleBody, type SuraLookupScheduleResultResponse } from "./models.js";
3
+ export interface ClientOptions extends BaseClientOptions {
4
+ /**
5
+ * The URL the paths of the API are relative to.
6
+ */
7
+ baseUrl: string;
8
+ }
9
+ export interface Client {
10
+ /**
11
+ * Look up a professional schedule
12
+ *
13
+ * Read a professional’s generated schedule and capacity on one date without a
14
+ * patient document. Omit serviceId to inspect all their registered services
15
+ * at the connection’s institution. Distinguishes a full day from no schedule,
16
+ * an ungenerated period, blocked capacity and a generated period not offered.
17
+ * Returns real configured hours and created, offered, assigned, available and
18
+ * blocked counts. Counts are administrative capacity, never patient
19
+ * eligibility or a booking proposal. Does not create periods, change hours,
20
+ * book or cancel appointments. Use bookingOptions.lookup with the patient
21
+ * before offering a bookable slot. A technical failure never means no
22
+ * schedule.
23
+ */
24
+ lookup(request: LookupRequest, options?: RequestOptions): Promise<LookupResponse>;
25
+ }
26
+ export declare function createClient(options: ClientOptions): Client;
27
+ export declare function bind(transport: Transport): Client;
28
+ export type LookupRequest = SuraLookupScheduleBody;
29
+ export type LookupResponse = SuraLookupScheduleResultResponse;
@@ -0,0 +1,20 @@
1
+ // Code generated by forge. DO NOT EDIT.
2
+ /* eslint-disable */
3
+ import { Transport, } from "../../_/index.js";
4
+ import { SuraLookupScheduleBodyCodec, SuraLookupScheduleResultResponseCodec, } from "./models.js";
5
+ export function createClient(options) {
6
+ return bind(new Transport(options));
7
+ }
8
+ export function bind(transport) {
9
+ return {
10
+ lookup: (request, options) => transport.send(LookupOperation, request, options),
11
+ };
12
+ }
13
+ const LookupOperation = {
14
+ method: "POST",
15
+ route: "/v1/sura/schedules/lookup",
16
+ body: "flat",
17
+ request: SuraLookupScheduleBodyCodec,
18
+ response: SuraLookupScheduleResultResponseCodec,
19
+ 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 },
20
+ };
@@ -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, LookupRequest, LookupResponse, } from "./client.js";
5
+ export type { SuraLookupScheduleBadGatewayError, SuraLookupScheduleBadGatewayFailure, SuraLookupScheduleBody, SuraLookupScheduleConflictError, SuraLookupScheduleConflictFailure, SuraLookupScheduleResult, SuraLookupScheduleResultResponse, } 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,79 @@
1
+ import type { OutcomeUnknownFailure, ResponseMetadata } from "../../models.js";
2
+ import { type SuraConnectionNotConfiguredFailure, type SuraPendingResult, type SuraPortalCredentialsRejectedFailure, type SuraPortalSessionConflictFailure, type SuraPortalUnavailableFailure, type SuraRefusal, type SuraSchedule } from "../models.js";
3
+ /**
4
+ * A failed answer.
5
+ */
6
+ export interface SuraLookupScheduleBadGatewayError {
7
+ data: null;
8
+ error: SuraLookupScheduleBadGatewayFailure;
9
+ /**
10
+ * What every answer carries besides its data or error.
11
+ */
12
+ metadata: ResponseMetadata;
13
+ success: false;
14
+ }
15
+ export type SuraLookupScheduleBadGatewayFailure = OutcomeUnknownFailure | SuraPortalCredentialsRejectedFailure | SuraPortalUnavailableFailure;
16
+ export interface SuraLookupScheduleBody {
17
+ /**
18
+ * Set agentMode=true when calling this tool for an AI agent. The answer is
19
+ * concise Spanish text instead of JSON. Omit it for structured machine data.
20
+ * This changes presentation only, never authorization, consent or
21
+ * idempotency.
22
+ */
23
+ agentMode?: boolean;
24
+ /**
25
+ * The channel the caller is waiting on, which sets how long it waits before
26
+ * an answer comes back pending, and puts a phone call's reads ahead of
27
+ * others. Defaults to web.
28
+ */
29
+ channel?: "voice" | "whatsapp" | "web";
30
+ /**
31
+ * Which of the organization's SURA connections to run on, by its id. Optional
32
+ * while the organization has one; required when it has several.
33
+ */
34
+ connectionId?: string;
35
+ /**
36
+ * The calendar day to inspect, YYYY-MM-DD, in the clinic’s timezone.
37
+ */
38
+ date: Temporal.PlainDate;
39
+ /**
40
+ * The professional name or an unambiguous part of it. Resolved against this
41
+ * connection’s registered directory; never a patient identity.
42
+ */
43
+ professional: string;
44
+ /**
45
+ * Optional exact service id or unambiguous service name. Omit to inspect
46
+ * every service in which this professional is registered at this connection’s
47
+ * institution.
48
+ */
49
+ serviceId?: string | null;
50
+ }
51
+ /**
52
+ * A failed answer.
53
+ */
54
+ export interface SuraLookupScheduleConflictError {
55
+ data: null;
56
+ error: SuraLookupScheduleConflictFailure;
57
+ /**
58
+ * What every answer carries besides its data or error.
59
+ */
60
+ metadata: ResponseMetadata;
61
+ success: false;
62
+ }
63
+ export type SuraLookupScheduleConflictFailure = SuraPortalSessionConflictFailure | SuraConnectionNotConfiguredFailure;
64
+ export type SuraLookupScheduleResult = SuraPendingResult | SuraRefusal | SuraSchedule;
65
+ /**
66
+ * A successful answer.
67
+ */
68
+ export interface SuraLookupScheduleResultResponse {
69
+ data: SuraLookupScheduleResult;
70
+ error: null;
71
+ /**
72
+ * What every answer carries besides its data or error.
73
+ */
74
+ metadata: ResponseMetadata;
75
+ success: true;
76
+ }
77
+ export declare const SuraLookupScheduleBodyCodec: import("../../_/codec.js").Codec;
78
+ export declare const SuraLookupScheduleResultCodec: import("../../_/codec.js").Codec;
79
+ export declare const SuraLookupScheduleResultResponseCodec: import("../../_/codec.js").Codec;
@@ -0,0 +1,11 @@
1
+ // Code generated by forge. DO NOT EDIT.
2
+ /* eslint-disable */
3
+ import { date, object, union } from "../../_/index.js";
4
+ import { SuraPendingResultCodec, SuraRefusalCodec, SuraScheduleCodec, } from "../models.js";
5
+ export const SuraLookupScheduleBodyCodec = object([
6
+ ["date", null, date],
7
+ ]);
8
+ export const SuraLookupScheduleResultCodec = union([() => SuraPendingResultCodec, () => SuraRefusalCodec, () => SuraScheduleCodec]);
9
+ export const SuraLookupScheduleResultResponseCodec = object([
10
+ ["data", null, () => SuraLookupScheduleResultCodec],
11
+ ]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arbol-ai/sdk",
3
- "version": "5.33.0",
3
+ "version": "5.34.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.20261105.5813",
62
- "sha256": "608afec9826be487c1894d6251251afa6b6f329d8145fb1d1f26a306a8b7be26"
61
+ "release": "1.20261105.15838",
62
+ "sha256": "046bba468060514045acd14deae2d0628d28870dbc10b41c400dfb619bd8b28b"
63
63
  }
64
64
  }
65
65
  }