@arbol-ai/sdk 5.31.0 → 5.32.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.
@@ -301,6 +301,27 @@ export interface AgendaFailureResponse {
301
301
  };
302
302
  message: "The operation may have been applied; check its result before repeating it.";
303
303
  retryable: false;
304
+ } | {
305
+ code: "WAITLIST_SERVICE_UNAVAILABLE";
306
+ data: {
307
+ [key: string]: unknown;
308
+ };
309
+ message: "Correct serviceId using serviceId from bookingOfferings.list. Search a short service term such as neurología, then inspect the matching service name. Never invent an ID. No waiting-list entry was changed; correct this field and retry with the same consent.";
310
+ retryable: false;
311
+ } | {
312
+ code: "WAITLIST_RESOURCE_UNAVAILABLE";
313
+ data: {
314
+ [key: string]: unknown;
315
+ };
316
+ message: "The requested professional is not an active agenda for this service. Use resourceName for the requested professional or copy agendas[].id from bookingOfferings.list, never the offering id. If both are supplied, they must agree. No waiting-list entry was changed. Correct the reference with the same consent. If a verified provider professional is absent from Agenda, omit resourceName, clear resourceId and explicitly restrict the manual request to that professional in note.";
317
+ retryable: false;
318
+ } | {
319
+ code: "WAITLIST_RESOURCE_AMBIGUOUS";
320
+ data: {
321
+ [key: string]: unknown;
322
+ };
323
+ message: "More than one active agenda matches resourceName for this service. Read bookingOfferings.list and provide the complete requested professional name or its agendas[].id. No waiting-list entry was changed.";
324
+ retryable: false;
304
325
  } | {
305
326
  code: "INVALID_APPOINTMENT_INTAKE";
306
327
  data: {
@@ -8,6 +8,18 @@ export interface ClientOptions extends BaseClientOptions {
8
8
  baseUrl: string;
9
9
  }
10
10
  export interface Client {
11
+ /**
12
+ * Create Waitlist Entry
13
+ *
14
+ * An authenticated staff user records a consented waitlist request without
15
+ * sending or queuing messages, emails, offers or patient follow-ups. A repeat
16
+ * for the same patient, service and reason returns the existing open entry
17
+ * without changing it; use update with expectedVersion to amend it. Read the
18
+ * returned entry before claiming any preference was saved. This operation
19
+ * never books an appointment. Requires a user login with
20
+ * agenda:waitlist:write; service tokens and native agents cannot call it.
21
+ */
22
+ create(request: CreateRequest, options?: RequestOptions): Promise<CreateResponse>;
11
23
  /**
12
24
  * Add a patient to the waiting list
13
25
  *
@@ -22,23 +34,37 @@ export interface Client {
22
34
  * from the invoking conversation; omit that field. Direct callers may supply
23
35
  * the referring conversation link so the team can reopen it. Pass the
24
36
  * patient's name, documentNumber and documentType, phone, serviceId and the
25
- * payer as the patient said it. Use resourceId only for the professional the
26
- * person requested. Calling again for the same patient, service and reason
27
- * returns the same open entry. Only a request from the same verified Raíz
28
- * conversation may reconcile manual and priority as one entry; payer_review
29
- * stays separate. A consented reason priority request from the same verified
30
- * Raíz conversation promotes a manual entry created in that same native
31
- * conversation in place to priority urgent, preserving its ID, open status
32
- * and queue date. For an Agenda booking include its verified appointmentId;
33
- * for an external booking omit that ID and retain the verified booking in
34
- * note. Historical entries, another conversation and explicit desk priority
35
- * decisions are preserved; inspect the returned priority and never claim an
36
- * upgrade unless it is urgent. A later manual join never lowers or duplicates
37
- * that priority request. Supplied consented preferences, note, payer,
38
- * conversation and appointment association can be reconciled; omit unchanged
39
- * fields to retain them. A supplied confirmed phone replaces the patient
40
- * contact phone; omitted or null phone preserves it. Omitted fields preserve
41
- * their values; resourceId:null explicitly accepts any professional. When
37
+ * payer as the patient said it. Use resourceName for the requested
38
+ * professional when the Agenda id is unknown. It resolves a unique active
39
+ * agenda for serviceId. If using resourceId, copy agendas[].id from
40
+ * bookingOfferings.list verbatim; its top-level id identifies an offering.
41
+ * Never rewrite a prefix. Search the catalog with a short clinical term, such
42
+ * as neurología, then select the exact serviceId. A
43
+ * WAITLIST_SERVICE_UNAVAILABLE, WAITLIST_RESOURCE_UNAVAILABLE or
44
+ * WAITLIST_RESOURCE_AMBIGUOUS refusal changes no waiting-list entry: correct
45
+ * the reference and retry using the existing consent. For a professional
46
+ * documented in the provider system but absent from Agenda, retain the
47
+ * restriction explicitly in note, omit resourceName and use resourceId:null
48
+ * on the same manual request. This is a manual preference for the team, never
49
+ * permission to offer any other doctor. If the person accepts several named
50
+ * professionals, preserve their names and the complete time window in note
51
+ * rather than inventing one resource ID. Calling again for the same patient,
52
+ * service and reason returns the same open entry. Only a request from the
53
+ * same verified Raíz conversation may reconcile manual and priority as one
54
+ * entry; payer_review stays separate. A consented reason priority request
55
+ * from the same verified Raíz conversation promotes a manual entry created in
56
+ * that same native conversation in place to priority urgent, preserving its
57
+ * ID, open status and queue date. For an Agenda booking include its verified
58
+ * appointmentId; for an external booking omit that ID and retain the verified
59
+ * booking in note. Historical entries, another conversation and explicit desk
60
+ * priority decisions are preserved; inspect the returned priority and never
61
+ * claim an upgrade unless it is urgent. A later manual join never lowers or
62
+ * duplicates that priority request. Supplied consented preferences, note,
63
+ * payer, conversation and appointment association can be reconciled; omit
64
+ * unchanged fields to retain them. A supplied confirmed phone replaces the
65
+ * patient contact phone; omitted or null phone preserves it. Omitted fields
66
+ * preserve their values; resourceId:null clears the Agenda resource filter,
67
+ * but never clears a named-professional restriction recorded in note. When
42
68
  * supplying preferences, send the complete consented date/time window; null
43
69
  * fields clear those limits. Identical repeats do not change the version.
44
70
  * Staff status, explicit desk priority and original queue position are
@@ -57,9 +83,100 @@ export interface Client {
57
83
  * services and agendas were chosen separately.
58
84
  */
59
85
  list(request?: ListRequest, options?: RequestOptions): Promise<ListResponse>;
86
+ /**
87
+ * Update Waitlist Entry
88
+ *
89
+ * An authenticated staff user amends one existing waitlist entry with
90
+ * expectedVersion, preserving its ID, patient, service and queue position.
91
+ * Omitted preferences, professional, priority and appointment association are
92
+ * preserved. Send the complete consented date/time window when replacing
93
+ * preferences. Use resourceId:null only to clear the Agenda resource filter
94
+ * and retain any external or multiple-professional restriction explicitly in
95
+ * note. Sends and queues no messages, emails, offers or patient follow-ups
96
+ * and never changes a booking. Requires a user login with
97
+ * agenda:waitlist:write; service tokens and native agents cannot call it.
98
+ */
99
+ update(request: UpdateRequest, options?: RequestOptions): Promise<UpdateResponse>;
60
100
  }
61
101
  export declare function createClient(options: ClientOptions): Client;
62
102
  export declare function bind(transport: Transport): Client;
103
+ export interface CreateRequest {
104
+ /**
105
+ * The appointment it relates to: a priority to bring forward.
106
+ */
107
+ appointmentId?: string | null;
108
+ /**
109
+ * Agent conversation URL retained so the scheduling team can reopen the
110
+ * referring conversation.
111
+ */
112
+ conversationUrl?: string | null;
113
+ /**
114
+ * Desk note attached to the waiting-list entry; null means no note is
115
+ * recorded.
116
+ */
117
+ note?: string | null;
118
+ patient: {
119
+ document?: string | null;
120
+ documentNumber?: string | null;
121
+ documentType?: string | null;
122
+ name: string;
123
+ };
124
+ /**
125
+ * Registered patient selected by the desk; document resolution remains
126
+ * authoritative for patient identity.
127
+ */
128
+ patientId?: string;
129
+ /**
130
+ * The payer the patient named, as said.
131
+ */
132
+ payer?: string | null;
133
+ /**
134
+ * Patient contact telephone number; null when no number was recorded.
135
+ */
136
+ phone?: string | null;
137
+ /**
138
+ * Patient availability preferences retained with the waiting-list entry.
139
+ */
140
+ preferences?: {
141
+ from?: Temporal.PlainDate | null;
142
+ times?: string | null;
143
+ to?: Temporal.PlainDate | null;
144
+ };
145
+ /**
146
+ * Whether the waiting-list entry requests normal handling or an urgent
147
+ * appointment.
148
+ */
149
+ priority?: "normal" | "urgent";
150
+ /**
151
+ * Why: by hand, a payer only the team books, or a priority to bring forward.
152
+ */
153
+ reason?: "manual" | "payer_review" | "priority";
154
+ /**
155
+ * One professional or agenda: copy agendas[].id from bookingOfferings.list,
156
+ * never the offering id or a rewritten prefix. Null means no Agenda resource
157
+ * filter; retain any external professional restriction explicitly in note.
158
+ */
159
+ resourceId?: string | null;
160
+ /**
161
+ * The requested professional or agenda name. Resolves only one active agenda
162
+ * offering this service, ignoring accents and professional titles. If
163
+ * resourceId is supplied too, it must identify the same agenda. For a
164
+ * documented external professional absent from Agenda, omit
165
+ * resourceName/resourceId and explicitly restrict the manual request to that
166
+ * professional in note.
167
+ */
168
+ resourceName?: string;
169
+ /**
170
+ * Service identifier within the authenticated organization.
171
+ */
172
+ serviceId: string;
173
+ }
174
+ export interface CreateResponse {
175
+ data: AgendaWaitlistEntry;
176
+ error: null;
177
+ metadata: AgendaResponseMetadata;
178
+ success: true;
179
+ }
63
180
  export interface JoinRequest {
64
181
  /**
65
182
  * The appointment it relates to: a priority to bring forward.
@@ -115,9 +232,20 @@ export interface JoinRequest {
115
232
  */
116
233
  reason: "manual" | "payer_review" | "priority";
117
234
  /**
118
- * One professional or agenda; null = any that offers the service.
235
+ * One professional or agenda: copy agendas[].id from bookingOfferings.list,
236
+ * never the offering id or a rewritten prefix. Null means no Agenda resource
237
+ * filter; retain any external professional restriction explicitly in note.
119
238
  */
120
239
  resourceId?: string | null;
240
+ /**
241
+ * The requested professional or agenda name. Resolves only one active agenda
242
+ * offering this service, ignoring accents and professional titles. If
243
+ * resourceId is supplied too, it must identify the same agenda. For a
244
+ * documented external professional absent from Agenda, omit
245
+ * resourceName/resourceId and explicitly restrict the manual request to that
246
+ * professional in note.
247
+ */
248
+ resourceName?: string;
121
249
  /**
122
250
  * Service identifier within the authenticated organization.
123
251
  */
@@ -150,8 +278,9 @@ export interface ListRequest {
150
278
  */
151
279
  offeringId?: string;
152
280
  /**
153
- * Only entries that asked for this professional or agenda; entries open to
154
- * any agenda (resourceId null) are left out.
281
+ * Only entries that asked for this professional or agenda; entries with no
282
+ * Agenda resource filter (resourceId null, including manual professional
283
+ * restrictions in note) are left out.
155
284
  */
156
285
  resourceId?: string;
157
286
  /**
@@ -165,3 +294,59 @@ export interface ListResponse {
165
294
  metadata: AgendaResponseMetadata;
166
295
  success: true;
167
296
  }
297
+ export interface UpdateRequest {
298
+ /**
299
+ * Organization-owned waiting-list entry identifier.
300
+ */
301
+ waitlistEntryId: string;
302
+ /**
303
+ * Appointment associated with this waiting-list entry; null clears the
304
+ * association.
305
+ */
306
+ appointmentId?: string | null;
307
+ /**
308
+ * HTTPS link to the originating Arbol conversation on an admitted product
309
+ * hostname; null when absent.
310
+ */
311
+ conversationUrl?: string | null;
312
+ /**
313
+ * Version last read by the caller. The mutation fails if another writer has
314
+ * changed this record.
315
+ */
316
+ expectedVersion: number;
317
+ /**
318
+ * Desk note attached to the waiting-list entry; null means no note is
319
+ * recorded.
320
+ */
321
+ note?: string | null;
322
+ preferences?: {
323
+ from?: Temporal.PlainDate | null;
324
+ times?: string | null;
325
+ to?: Temporal.PlainDate | null;
326
+ };
327
+ /**
328
+ * Whether the waiting-list entry requests normal handling or an urgent
329
+ * appointment.
330
+ */
331
+ priority?: "normal" | "urgent";
332
+ resourceId?: string | null;
333
+ /**
334
+ * The requested professional or agenda name. Resolves only one active agenda
335
+ * offering this service, ignoring accents and professional titles. If
336
+ * resourceId is supplied too, it must identify the same agenda. For a
337
+ * documented external professional absent from Agenda, omit
338
+ * resourceName/resourceId and explicitly restrict the manual request to that
339
+ * professional in note.
340
+ */
341
+ resourceName?: string;
342
+ /**
343
+ * Current waiting-list state: waiting, contacted, booked, expired or removed.
344
+ */
345
+ status?: "waiting" | "offered" | "booked" | "cancelled";
346
+ }
347
+ export interface UpdateResponse {
348
+ data: AgendaWaitlistEntry;
349
+ error: null;
350
+ metadata: AgendaResponseMetadata;
351
+ success: true;
352
+ }
@@ -7,10 +7,20 @@ export function createClient(options) {
7
7
  }
8
8
  export function bind(transport) {
9
9
  return {
10
+ create: (request, options) => transport.send(CreateOperation, request, options),
10
11
  join: (request, options) => transport.send(JoinOperation, request, options),
11
12
  list: (request, options) => transport.send(ListOperation, request, options),
13
+ update: (request, options) => transport.send(UpdateOperation, request, options),
12
14
  };
13
15
  }
16
+ const CreateOperation = {
17
+ method: "POST",
18
+ route: "/v1/agenda/waitlist",
19
+ body: "flat",
20
+ request: object([["preferences", null, object([["from", null, date], ["to", null, date]])]]),
21
+ response: object([["data", null, () => AgendaWaitlistEntryCodec]]),
22
+ errors: { "400": true, "401": true, "403": true, "404": true, "405": true, "409": true, "413": true, "415": true, "426": true, "429": true, "500": true, "502": true, "503": true, "504": true },
23
+ };
14
24
  const JoinOperation = {
15
25
  method: "POST",
16
26
  route: "/v1/agenda/waitlist/join",
@@ -26,3 +36,11 @@ const ListOperation = {
26
36
  response: object([["data", null, () => AgendaWaitlistEntryPageCodec]]),
27
37
  errors: { "400": true, "401": true, "403": true, "404": true, "405": true, "409": true, "413": true, "415": true, "426": true, "429": true, "500": true, "502": true, "503": true, "504": true },
28
38
  };
39
+ const UpdateOperation = {
40
+ method: "PATCH",
41
+ route: "/v1/agenda/waitlist/{waitlistEntryId}",
42
+ body: "flat",
43
+ request: object([["preferences", null, object([["from", null, date], ["to", null, date]])]]),
44
+ response: object([["data", null, () => AgendaWaitlistEntryCodec]]),
45
+ errors: { "400": true, "401": true, "403": true, "404": true, "405": true, "409": true, "413": true, "415": true, "426": true, "429": true, "500": true, "502": true, "503": true, "504": true },
46
+ };
@@ -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, JoinRequest, JoinResponse, ListRequest, ListResponse, } from "./client.js";
4
+ export type { Client, ClientOptions, CreateRequest, CreateResponse, JoinRequest, JoinResponse, ListRequest, ListResponse, UpdateRequest, UpdateResponse, } from "./client.js";
5
5
  export type { AgendaWaitlistEntry, AgendaWaitlistEntryPage, } from "./models.js";
@@ -35,7 +35,7 @@ export interface RaizOrganization {
35
35
  phones: string[];
36
36
  recipients: RaizEmailAddress[];
37
37
  };
38
- productNotices?: {
38
+ productNotices: {
39
39
  administrators: RaizEmailAddress[];
40
40
  events: ("agent-idle" | "agent-live" | "budget-reached" | "budget-warning" | "campaign-finished" | "channel-disconnected" | "channel-limit" | "channel-quality" | "channel-restored" | "import-finished" | "knowledge-failed" | "milestone" | "monthly-summary" | "outage-resolved" | "template-approved" | "template-rejected" | "weekly-summary")[];
41
41
  recipients: RaizEmailAddress[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arbol-ai/sdk",
3
- "version": "5.31.0",
3
+ "version": "5.32.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",
@@ -57,8 +57,8 @@
57
57
  "packageManager": "bun@1.4.3",
58
58
  "arbol": {
59
59
  "openapi": {
60
- "release": "1.20261104.21009",
61
- "sha256": "831514a41a6ae6b57eb4f86971c3dc87b1ab333f03d62d789f04657c7b19def3"
60
+ "release": "1.20261104.175529",
61
+ "sha256": "1b369c7b1b5ca963a101a6b551fb7382d5e951b750583bd74122c518817ac2d4"
62
62
  }
63
63
  }
64
64
  }