@arbol-ai/sdk 5.41.0 → 5.42.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.
@@ -38,7 +38,9 @@ export interface Client {
38
38
  * attempt, error and latest call or message; continue with `recipientsCursor`
39
39
  * (`recipientsDirection` reads the other way). `expand=readiness` says
40
40
  * whether it can start and lists what has to be fixed first, without reaching
41
- * anyone. Read it before `update_campaign` and send `expectedVersion`.
41
+ * anyone. `expand=results` counts what people answered, by the Agent's data
42
+ * definitions with options; each recipient also says their own. Read it
43
+ * before `update_campaign` and send `expectedVersion`.
42
44
  */
43
45
  get(request: GetRequest, options?: RequestOptions): Promise<GetResponse>;
44
46
  /**
@@ -119,7 +121,8 @@ export interface GetRequest {
119
121
  */
120
122
  campaignId: string;
121
123
  /**
122
- * Related data to include, comma-separated: `recipients`, `readiness`.
124
+ * Related data to include, comma-separated: `recipients`, `readiness`,
125
+ * `results`.
123
126
  */
124
127
  expand?: string;
125
128
  /**
@@ -140,6 +143,12 @@ export interface GetRequest {
140
143
  * whose name contains this text.
141
144
  */
142
145
  recipientsQ?: string;
146
+ /**
147
+ * With `expand=recipients`: `definitionKey=optionKey`, only those whose
148
+ * latest answer is that option; `definitionKey=`, only those with no answer
149
+ * yet.
150
+ */
151
+ recipientsResult?: string;
143
152
  /**
144
153
  * `pending`: waiting for its (next) call or message. `in_progress`: being
145
154
  * called, or on WhatsApp waiting for a reply until a reminder is due.
@@ -24,7 +24,7 @@ const CreateOperation = {
24
24
  const GetOperation = {
25
25
  method: "GET",
26
26
  route: "/v1/raiz/campaigns/{campaignId}",
27
- query: { expand: "expand", recipientsCursor: "recipientsCursor", recipientsDirection: "recipientsDirection", recipientsLimit: "recipientsLimit", recipientsQ: "recipientsQ", recipientsStatus: "recipientsStatus" },
27
+ query: { expand: "expand", recipientsCursor: "recipientsCursor", recipientsDirection: "recipientsDirection", recipientsLimit: "recipientsLimit", recipientsQ: "recipientsQ", recipientsResult: "recipientsResult", recipientsStatus: "recipientsStatus" },
28
28
  response: object([["data", null, () => RaizCampaignCodec]]),
29
29
  errors: { "400": true, "401": true, "403": true, "404": true, "405": true, "413": true, "415": true, "429": true, "500": true, "502": true, "503": true, "504": true },
30
30
  };
@@ -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, CreateRequest, CreateResponse, GetRequest, GetResponse, ListRequest, ListResponse, UpdateRequest, UpdateResponse, } from "./client.js";
5
- export type { RaizCampaign, RaizCampaignBlocker, RaizCampaignPage, RaizCampaignProgress, RaizCampaignReadiness, RaizCampaignRecipientInput, RaizCampaignRecipientPage, RaizCampaignTemplate, RaizCampaignTemplateInput, } from "./models.js";
5
+ export type { RaizCampaign, RaizCampaignBlocker, RaizCampaignPage, RaizCampaignProgress, RaizCampaignReadiness, RaizCampaignRecipientInput, RaizCampaignRecipientPage, RaizCampaignResult, RaizCampaignTemplate, RaizCampaignTemplateInput, } from "./models.js";
@@ -52,6 +52,12 @@ export interface RaizCampaign {
52
52
  * latest attempt. Present only when expanded.
53
53
  */
54
54
  recipients?: RaizCampaignRecipientPage;
55
+ /**
56
+ * What people answered, for each data definition with options their Agent
57
+ * collects that has an answer yet. Answers arrive when a conversation closes
58
+ * and is analyzed, so they can keep arriving after the campaign ends.
59
+ */
60
+ results?: RaizCampaignResult[];
55
61
  retryAfterMinutes: number;
56
62
  retryOn: ("no_answer" | "failure" | "not_delivered")[];
57
63
  scheduledEndAt: Temporal.Instant | null;
@@ -164,10 +170,11 @@ export interface RaizCampaignRecipientInput {
164
170
  /**
165
171
  * Values for the `{{name}}` variables a WhatsApp template's parameters, or
166
172
  * the Agent's instructions, first message or this campaign's texts on a call,
167
- * reference. Raíz always provides `contact_name`, `contact_given_name` and
168
- * `contact_phone`, and on a call also `contact_id`, `conversation_id` and
169
- * `bulletins` (the business bulletins in force); a recipient's values never
170
- * replace them.
173
+ * reference. A reference means the variable that is the same word, whatever
174
+ * its accents and case: `{{País}}` reads `pais`, and an exact name wins. Raíz
175
+ * always provides `contact_name`, `contact_given_name` and `contact_phone`,
176
+ * and on a call also `contact_id`, `conversation_id` and `bulletins` (the
177
+ * business bulletins in force); a recipient's values never replace them.
171
178
  */
172
179
  variables?: {
173
180
  [key: string]: unknown;
@@ -180,6 +187,10 @@ export interface RaizCampaignRecipientPage {
180
187
  data: {
181
188
  address: string;
182
189
  attemptCount: number;
190
+ contact: {
191
+ id: string;
192
+ name: string | null;
193
+ } | null;
183
194
  contactId: string | null;
184
195
  createdAt: Temporal.Instant;
185
196
  deliveredAt: Temporal.Instant | null;
@@ -198,6 +209,11 @@ export interface RaizCampaignRecipientPage {
198
209
  nextAttemptAt: Temporal.Instant | null;
199
210
  readAt: Temporal.Instant | null;
200
211
  repliedAt: Temporal.Instant | null;
212
+ results: {
213
+ definitionKey: string;
214
+ label: string;
215
+ value: string;
216
+ }[];
201
217
  status: "pending" | "in_progress" | "completed" | "failed" | "cancelled";
202
218
  updatedAt: Temporal.Instant;
203
219
  variables: {
@@ -213,6 +229,17 @@ export interface RaizCampaignRecipientPage {
213
229
  */
214
230
  pageInfo: PageInfo;
215
231
  }
232
+ export interface RaizCampaignResult {
233
+ definition: {
234
+ key: string;
235
+ name: string;
236
+ };
237
+ values: {
238
+ key: string;
239
+ label: string;
240
+ people: number;
241
+ }[];
242
+ }
216
243
  export interface RaizCampaignTemplate {
217
244
  /**
218
245
  * The template's language: WhatsApp's code (`es`, `es_MX`) or a BCP 47 tag
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arbol-ai/sdk",
3
- "version": "5.41.0",
3
+ "version": "5.42.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.20261106.171439",
62
- "sha256": "e7c2c8058a6f848070f1d5933ea788446ac39acb99aa97b4f6eed2f83162f71f"
61
+ "release": "1.20261106.175459",
62
+ "sha256": "7ce3b52ae65d2f5e08a6fffa59be703c62066678493c5fb3bcc3646d3a39a91f"
63
63
  }
64
64
  }
65
65
  }