@arbol-ai/sdk 2.14.0 → 2.16.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.
package/README.md CHANGED
@@ -118,3 +118,9 @@ repository and project-arbol-cli. npm publishing uses the organization secret `N
118
118
  ## License
119
119
 
120
120
  [Apache License 2.0](LICENSE)
121
+
122
+ ### Publishing a prepared source commit
123
+
124
+ The Publish workflow accepts an existing main-branch `ref` to publish without creating
125
+ a release commit. Set `announce` to false when coordinating the CLI release separately.
126
+ This path uses the existing npm publisher and static verification; it does not run tests.
@@ -62,7 +62,7 @@ export interface AccountConnection {
62
62
  path: string;
63
63
  };
64
64
  rpcMethod?: string | null;
65
- runtimeInputs?: ("connectionId" | "channel")[];
65
+ runtimeInputs?: ("connectionId" | "channel" | "conversationUrl")[];
66
66
  writesThrough?: string[];
67
67
  }[];
68
68
  /**
@@ -11,10 +11,10 @@ export interface Client {
11
11
  /**
12
12
  * Invite someone to a product
13
13
  *
14
- * Invites someone not yet in the organization by email with a role in Raíz,
14
+ * Invites someone without an Arbol account by email with a role in Raíz,
15
15
  * Agenda, Ámbar or Account. The invitation email comes from the product's own
16
- * application, so its link opens that product. Someone already in the
17
- * organization is given the role with `members.create`.
16
+ * application. Existing accounts receive access with `members.create` and
17
+ * sign in with their current password.
18
18
  */
19
19
  create(request: CreateRequest, options?: RequestOptions): Promise<CreateResponse>;
20
20
  /**
@@ -36,7 +36,7 @@ export declare function createClient(options: ClientOptions): Client;
36
36
  export declare function bind(transport: Transport): Client;
37
37
  export interface CreateRequest {
38
38
  /**
39
- * Who to invite: someone not yet in the organization.
39
+ * Who to invite: someone who does not have an Arbol account yet.
40
40
  */
41
41
  email: string;
42
42
  /**
@@ -11,8 +11,10 @@ export interface Client {
11
11
  /**
12
12
  * Give a member a role in a product
13
13
  *
14
- * Gives someone already in the organization a role in Raíz, Agenda, Ámbar or
15
- * Account, by their email. Anyone else is invited with `invitations.create`.
14
+ * Gives someone with an existing Arbol account a role in Raíz, Agenda, Ámbar
15
+ * or Account, joining them to this organization when needed. They sign in
16
+ * with their current password. Someone without an account is invited with
17
+ * `invitations.create`.
16
18
  */
17
19
  create(request: CreateRequest, options?: RequestOptions): Promise<CreateResponse>;
18
20
  /**
@@ -41,7 +43,8 @@ export declare function createClient(options: ClientOptions): Client;
41
43
  export declare function bind(transport: Transport): Client;
42
44
  export interface CreateRequest {
43
45
  /**
44
- * The email of someone already in the organization.
46
+ * The email of someone with an existing Arbol account, in this organization
47
+ * or another.
45
48
  */
46
49
  email: string;
47
50
  /**
@@ -141,6 +141,13 @@ export interface AccountFailureResponse {
141
141
  };
142
142
  message: "This person is already a member.";
143
143
  retryable: false;
144
+ } | {
145
+ code: "ACCOUNT_EXISTS";
146
+ data: {
147
+ [key: string]: unknown;
148
+ };
149
+ message: "This person already has an Arbol account. Give them access with members.create.";
150
+ retryable: false;
144
151
  } | {
145
152
  code: "INVITATION_EXISTS";
146
153
  data: {
@@ -160,7 +167,7 @@ export interface AccountFailureResponse {
160
167
  data: {
161
168
  [key: string]: unknown;
162
169
  };
163
- message: "This person is not a member.";
170
+ message: "No existing Arbol account was found.";
164
171
  retryable: false;
165
172
  } | {
166
173
  code: "INVITATION_NOT_FOUND";
@@ -8,7 +8,7 @@ export interface AccountPermission {
8
8
  /**
9
9
  * The product or integration the permission belongs to.
10
10
  */
11
- group: "raiz" | "agenda" | "ambar" | "sura" | "visoft" | "account";
11
+ group: "raiz" | "agenda" | "ambar" | "sura" | "visoft" | "nueva-eps" | "account";
12
12
  value: string;
13
13
  }
14
14
  export interface AccountPermissionPage {
@@ -70,6 +70,16 @@ export interface AgendaBookableOffering {
70
70
  * duration; null means no separate duration.
71
71
  */
72
72
  occupationMinutes: number | null;
73
+ /**
74
+ * Human-readable service hours and closures. Availability remains
75
+ * authoritative.
76
+ */
77
+ scheduleSummary: string;
78
+ /**
79
+ * IANA timezones of the agendas in this bounded projection; hours are
80
+ * interpreted locally.
81
+ */
82
+ scheduleTimezones: string[];
73
83
  /**
74
84
  * Current service policy and patient instructions; this projection does not
75
85
  * establish payer coverage.
@@ -243,7 +243,7 @@ export interface AgendaFailureResponse {
243
243
  data: {
244
244
  [key: string]: unknown;
245
245
  };
246
- message: "The requested operation does not exist.";
246
+ message: "The requested resource does not exist.";
247
247
  retryable: false;
248
248
  } | {
249
249
  code: "HTTP_METHOD_NOT_ALLOWED";
@@ -377,13 +377,6 @@ export interface AgendaFailureResponse {
377
377
  };
378
378
  message: "The integration service is temporarily unavailable. Retry later.";
379
379
  retryable: true;
380
- } | {
381
- code: "AUTHORIZATION_FAILED";
382
- data: {
383
- [key: string]: unknown;
384
- };
385
- message: "The identity provider could not authorize this action.";
386
- retryable: false;
387
380
  } | {
388
381
  code: "DURATION_CHANGE_OFF";
389
382
  data: {
@@ -496,13 +489,6 @@ export interface AgendaFailureResponse {
496
489
  };
497
490
  message: "Configure the required organization role before inviting a member.";
498
491
  retryable: false;
499
- } | {
500
- code: "SCHEDULING_CONFLICT";
501
- data: {
502
- [key: string]: unknown;
503
- };
504
- message: "The schedule changed or this action conflicts with its current state. Refresh before retrying.";
505
- retryable: false;
506
492
  } | {
507
493
  code: "SELF_DEMOTION";
508
494
  data: {
@@ -846,6 +832,20 @@ export interface AgendaFailureResponse {
846
832
  };
847
833
  message: "The waitlist entry changed; reload before saving.";
848
834
  retryable: false;
835
+ } | {
836
+ code: "REMOVAL_WORKFLOW_UNAVAILABLE";
837
+ data: {
838
+ [key: string]: unknown;
839
+ };
840
+ message: "Durable removal is unavailable here; use the bounded manual removal operations.";
841
+ retryable: false;
842
+ } | {
843
+ code: "REMOVAL_JOB_CONFLICT";
844
+ data: {
845
+ [key: string]: unknown;
846
+ };
847
+ message: "A removal is already active, or this idempotency key belongs to another decision.";
848
+ retryable: false;
849
849
  } | {
850
850
  code: "INVALID_BODY";
851
851
  data: {
@@ -45,7 +45,8 @@ export interface CreateRequest {
45
45
  */
46
46
  bufferBeforeMinutes?: number;
47
47
  /**
48
- * Maximum concurrent units this resource or offering can accept.
48
+ * Legacy concurrent-session limit above 1; details.maxConcurrent takes
49
+ * precedence. The historical default 1 delegates to resource capacity.
49
50
  */
50
51
  capacity?: number;
51
52
  /**
@@ -149,7 +150,8 @@ export interface UpdateRequest {
149
150
  */
150
151
  bufferBeforeMinutes?: number;
151
152
  /**
152
- * Maximum concurrent units this resource or offering can accept.
153
+ * Legacy concurrent-session limit above 1; details.maxConcurrent takes
154
+ * precedence. The historical default 1 delegates to resource capacity.
153
155
  */
154
156
  capacity?: number;
155
157
  /**
@@ -177,6 +179,16 @@ export interface UpdateRequest {
177
179
  * Display name of this catalog or configuration record.
178
180
  */
179
181
  name?: string;
182
+ /**
183
+ * Complete replacement for future bookings. Existing appointment and hold
184
+ * allocations stay unchanged.
185
+ */
186
+ resourceRequirements?: {
187
+ alternatives?: string[];
188
+ kind: "practitioner" | "assistant" | "room" | "chair" | "equipment" | "location" | "team" | "generic";
189
+ quantity?: number;
190
+ required?: boolean;
191
+ }[];
180
192
  /**
181
193
  * Minute spacing between candidate appointment start times.
182
194
  */
@@ -13,7 +13,8 @@ export interface AgendaOffering {
13
13
  */
14
14
  bufferBeforeMinutes: number;
15
15
  /**
16
- * Maximum concurrent units this resource or offering can accept.
16
+ * Legacy offering concurrency limit when above one and details.maxConcurrent
17
+ * is absent; one defers to resource capacity.
17
18
  */
18
19
  capacity: number;
19
20
  /**
@@ -12,22 +12,41 @@ export interface Client {
12
12
  /**
13
13
  * Add a patient to the waiting list
14
14
  *
15
- * Put a patient on the clinic's waiting list for the team to act on. Use
16
- * reason 'payer_review' instead of booking when the patient's payer (EPS) has
17
- * bookingPolicy 'staff_only' in get_intake_settings (create_appointment
18
- * refuses them): the team coordinates with the doctor and books it. Use
19
- * reason 'priority' right after create_appointment when the patient asked for
20
- * a priority (urgent) appointment: pass that appointment's id as
21
- * appointmentId so the team can bring it forward. Always pass
22
- * conversationUrl: this conversation's link in Arbol's Contactabilidad
23
- * (https://raiz.getarbol.com/conversations/…), so the team opens it there.
24
- * Pass the patient's name, document and documentType, phone, serviceId (and
25
- * resourceId only when the patient asked for one professional) and the payer
26
- * as the patient said it. Calling again for the same patient, service and
27
- * reason returns the same entry. Then tell the patient the clinic's team will
15
+ * Put a patient on the clinic's waiting list for the team to act on, only
16
+ * with the person's consent. Use reason 'payer_review' instead of booking
17
+ * when the patient's payer (EPS) has bookingPolicy 'staff_only' in
18
+ * get_intake_settings (create_appointment refuses them): the team coordinates
19
+ * with the doctor and books it. Use reason 'priority' right after
20
+ * create_appointment when the patient asked for a priority (urgent)
21
+ * appointment: pass that appointment's id as appointmentId so the team can
22
+ * bring it forward. For agent calls, the platform supplies conversationUrl
23
+ * from the invoking conversation; omit that field. Direct callers may supply
24
+ * the referring conversation link so the team can reopen it. Pass the
25
+ * patient's name, document and documentType, phone, serviceId and the payer
26
+ * as the patient said it. Use resourceId only for the professional the person
27
+ * requested. Calling again for the same patient, service and reason returns
28
+ * the same open entry and updates supplied consented preferences, note,
29
+ * payer, conversation or appointment association. A supplied confirmed phone
30
+ * replaces the patient contact phone; omitted or null phone preserves it.
31
+ * Omitted fields preserve their values; resourceId:null explicitly accepts
32
+ * any professional. When supplying preferences, send the complete consented
33
+ * date/time window; null fields clear those limits. Identical repeats do not
34
+ * change the version. Staff status, priority and original queue position are
35
+ * preserved. A closed entry is not reopened. This registers a waiting-list
36
+ * request, never an appointment. Then tell the patient the clinic's team will
28
37
  * contact them.
29
38
  */
30
39
  join(request: JoinRequest, options?: RequestOptions): Promise<JoinResponse>;
40
+ /**
41
+ * List Waitlist
42
+ *
43
+ * List the organization’s waitlist entries: open ones first (urgent, then the
44
+ * longest waiting), then closed ones, most recently changed first, up to 500.
45
+ * Narrow them by serviceId and resourceId (the agenda an entry asked for);
46
+ * offeringId finds only entries from before services and agendas were chosen
47
+ * separately.
48
+ */
49
+ list(request?: ListRequest, options?: RequestOptions): Promise<ListResponse>;
31
50
  }
32
51
  export declare function createClient(options: ClientOptions): Client;
33
52
  export declare function bind(transport: Transport): Client;
@@ -66,9 +85,18 @@ export interface JoinRequest {
66
85
  */
67
86
  payer?: string | null;
68
87
  /**
69
- * Patient contact telephone number; null when no number was recorded.
88
+ * The contact phone supplied or confirmed by the person for this request.
89
+ * Replaces their stored contact phone; omitted or null preserves it.
70
90
  */
71
91
  phone?: string | null;
92
+ /**
93
+ * Patient availability preferences retained with the waiting-list entry.
94
+ */
95
+ preferences?: {
96
+ from?: Temporal.PlainDate | null;
97
+ times?: string | null;
98
+ to?: Temporal.PlainDate | null;
99
+ };
72
100
  /**
73
101
  * manual records a consented waitlist request after no suitable availability;
74
102
  * payer_review asks staff to coordinate a restricted payer; priority asks
@@ -90,3 +118,29 @@ export interface JoinResponse {
90
118
  metadata: ResponseMetadata;
91
119
  success: true;
92
120
  }
121
+ export interface ListRequest {
122
+ /**
123
+ * Only entries recorded for this exact offering, which only entries from
124
+ * before services and agendas were chosen separately have; newer entries
125
+ * carry serviceId and resourceId instead.
126
+ */
127
+ offeringId?: string;
128
+ /**
129
+ * Only entries that asked for this professional or agenda; entries open to
130
+ * any agenda (resourceId null) are left out.
131
+ */
132
+ resourceId?: string;
133
+ /**
134
+ * Only entries for this service, whichever agenda they asked for.
135
+ */
136
+ serviceId?: string;
137
+ }
138
+ export interface ListResponse {
139
+ data: {
140
+ data: AgendaWaitlistEntry[];
141
+ object: "list";
142
+ };
143
+ error: null;
144
+ metadata: ResponseMetadata;
145
+ success: true;
146
+ }
@@ -1,6 +1,6 @@
1
1
  // Code generated by forge. DO NOT EDIT.
2
2
  /* eslint-disable */
3
- import { Transport, object, } from "../../_/index.js";
3
+ import { Transport, array, date, object, } from "../../_/index.js";
4
4
  import { AgendaWaitlistEntryCodec, } from "./models.js";
5
5
  export function createClient(options) {
6
6
  return bind(new Transport(options));
@@ -8,12 +8,21 @@ export function createClient(options) {
8
8
  export function bind(transport) {
9
9
  return {
10
10
  join: (request, options) => transport.send(JoinOperation, request, options),
11
+ list: (request, options) => transport.send(ListOperation, request, options),
11
12
  };
12
13
  }
13
14
  const JoinOperation = {
14
15
  method: "POST",
15
16
  route: "/v1/agenda/waitlist/join",
16
17
  body: "flat",
18
+ request: object([["preferences", null, object([["from", null, date], ["to", null, date]])]]),
17
19
  response: object([["data", null, () => AgendaWaitlistEntryCodec]]),
18
20
  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 },
19
21
  };
22
+ const ListOperation = {
23
+ method: "GET",
24
+ route: "/v1/agenda/waitlist",
25
+ query: { offeringId: "offeringId", resourceId: "resourceId", serviceId: "serviceId" },
26
+ response: object([["data", null, object([["data", null, array(() => AgendaWaitlistEntryCodec)]])]]),
27
+ 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
+ };
@@ -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, } from "./client.js";
4
+ export type { Client, ClientOptions, JoinRequest, JoinResponse, ListRequest, ListResponse, } from "./client.js";
5
5
  export type { AgendaWaitlistEntry } from "./models.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arbol-ai/sdk",
3
- "version": "2.14.0",
3
+ "version": "2.16.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.20261028.154640",
54
- "sha256": "472217811eecc0bec1e867938c2520765a603f3c97917a2523904bb68e072998"
53
+ "release": "1.20261028.230100",
54
+ "sha256": "821b642463ce46413eb98de5ae447705d8d3559284cfda5e63341c7bcf56d1f8"
55
55
  }
56
56
  }
57
57
  }