@arbol-ai/sdk 2.7.0 → 2.9.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.
@@ -138,6 +138,7 @@ export interface RaizAgentPage {
138
138
  }
139
139
  export interface RaizAgentSettings {
140
140
  attachmentReader: "vision" | "ocr" | null;
141
+ automaticKnowledge: boolean | null;
141
142
  budgetExhaustedMessage: string | null;
142
143
  closingMessage: string | null;
143
144
  evalGate: boolean | null;
@@ -160,6 +161,7 @@ export interface RaizAgentSettings {
160
161
  }
161
162
  export interface RaizAgentSettingsInput {
162
163
  attachmentReader?: "vision" | "ocr" | null;
164
+ automaticKnowledge?: boolean | null;
163
165
  budgetExhaustedMessage?: string | null;
164
166
  businessHours?: RaizBusinessHours | null;
165
167
  closingMessage?: string | null;
@@ -1,5 +1,5 @@
1
1
  import { type BaseClientOptions, type RequestOptions, Transport } from "../../_/index.js";
2
- import type { ResponseMetadata } from "../../models.js";
2
+ import type { DeletedObject, ResponseMetadata } from "../../models.js";
3
3
  import type { RaizCount } from "../models.js";
4
4
  import { type RaizConversation, type RaizConversationPage } from "./models.js";
5
5
  export interface ClientOptions extends BaseClientOptions {
@@ -32,6 +32,14 @@ export interface Client {
32
32
  * use `get_report`.
33
33
  */
34
34
  count(request?: CountRequest, options?: RequestOptions): Promise<CountResponse>;
35
+ /**
36
+ * Delete a conversation
37
+ *
38
+ * Delete a closed conversation: it leaves every list and report, its
39
+ * transcript and facts are kept, and the history records who deleted it. Not
40
+ * an AI tool.
41
+ */
42
+ delete(request: DeleteRequest, options?: RequestOptions): Promise<DeleteResponse>;
35
43
  /**
36
44
  * Get a conversation
37
45
  *
@@ -197,6 +205,18 @@ export interface CountResponse {
197
205
  metadata: ResponseMetadata;
198
206
  success: true;
199
207
  }
208
+ export interface DeleteRequest {
209
+ /**
210
+ * Conversation id.
211
+ */
212
+ conversationId: string;
213
+ }
214
+ export interface DeleteResponse {
215
+ data: DeletedObject;
216
+ error: null;
217
+ metadata: ResponseMetadata;
218
+ success: true;
219
+ }
200
220
  export interface GetRequest {
201
221
  /**
202
222
  * Conversation id.
@@ -9,6 +9,7 @@ export function bind(transport) {
9
9
  return {
10
10
  continue: (request, options) => transport.send(ContinueOperation, request, options),
11
11
  count: (request, options) => transport.send(CountOperation, request, options),
12
+ delete: (request, options) => transport.send(DeleteOperation, request, options),
12
13
  get: (request, options) => transport.send(GetOperation, request, options),
13
14
  list: (request, options) => transport.send(ListOperation, request, options),
14
15
  update: (request, options) => transport.send(UpdateOperation, request, options),
@@ -28,6 +29,13 @@ const CountOperation = {
28
29
  response: null,
29
30
  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
31
  };
32
+ const DeleteOperation = {
33
+ method: "DELETE",
34
+ route: "/v1/raiz/conversations/delete",
35
+ body: "flat",
36
+ response: null,
37
+ errors: { "400": true, "401": true, "403": true, "404": true, "405": true, "409": true, "413": true, "415": true, "429": true, "500": true, "502": true, "503": true, "504": true },
38
+ };
31
39
  const GetOperation = {
32
40
  method: "GET",
33
41
  route: "/v1/raiz/conversations/get",
@@ -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, ContinueRequest, ContinueResponse, CountRequest, CountResponse, GetRequest, GetResponse, ListRequest, ListResponse, UpdateRequest, UpdateResponse, } from "./client.js";
4
+ export type { Client, ClientOptions, ContinueRequest, ContinueResponse, CountRequest, CountResponse, DeleteRequest, DeleteResponse, GetRequest, GetResponse, ListRequest, ListResponse, UpdateRequest, UpdateResponse, } from "./client.js";
5
5
  export type { RaizConversation, RaizConversationPage, RaizConversationWorker, RaizMessage, RaizMessagePage, RaizSignedUrl, } from "./models.js";
@@ -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 { RaizAgentIntegrationSkillInput, RaizAgentSkill, RaizBusinessHours, RaizBusinessHoursWindow, RaizContactHoursWindow, RaizCount, RaizEmailAddress, RaizFact, RaizFailureResponse, RaizHttpsUrl, RaizPhoneNumber, RaizTask, } from "./models.js";
5
+ export type { RaizAgentIntegrationSkillInput, RaizAgentSkill, RaizBusinessHours, RaizBusinessHoursWindow, RaizContactHoursWindow, RaizCount, RaizEmailAddress, RaizFact, RaizFailureResponse, RaizHttpsUrl, RaizOutsideHoursTemplate, RaizPhoneNumber, RaizTask, } from "./models.js";
@@ -35,10 +35,22 @@ export interface RaizBusinessHours {
35
35
  /**
36
36
  * What whoever writes outside the hours receives, once per number and closed
37
37
  * period (until the hours open again), whether the conversation's AI is on,
38
- * off or paused. It is never taken as an answer: the AI answers what the
39
- * contact wrote when a person turns it on or resumes it in business hours.
38
+ * off or paused. With `outsideHoursTemplate`, the template goes instead, and
39
+ * this text only when WhatsApp refuses the template. The notice is never
40
+ * taken as an answer: the AI answers what the contact wrote when a person
41
+ * turns it on or resumes it in business hours.
40
42
  */
41
43
  outsideHoursMessage: string;
44
+ /**
45
+ * Send the notice as this approved WhatsApp template instead of
46
+ * `outsideHoursMessage`: a template of the number's account with no variables
47
+ * and no document, image or video header (in `list_templates`: `sendable`,
48
+ * with `parameterCount` 0). WhatsApp's approval is checked when the hours are
49
+ * saved. If WhatsApp refuses the template when a notice goes (deleted, paused
50
+ * or disabled since), `outsideHoursMessage` goes instead. Null or absent: the
51
+ * notice is `outsideHoursMessage`.
52
+ */
53
+ outsideHoursTemplate?: RaizOutsideHoursTemplate | null;
42
54
  timeZone: string | null;
43
55
  /**
44
56
  * Several windows may share a day, for a break at midday or an afternoon
@@ -895,6 +907,16 @@ export interface RaizFailureResponse {
895
907
  success: false;
896
908
  }
897
909
  export type RaizHttpsUrl = string;
910
+ export interface RaizOutsideHoursTemplate {
911
+ /**
912
+ * The template's language in WhatsApp's code, for example `es` or `es_MX`.
913
+ */
914
+ language: string;
915
+ /**
916
+ * The template's name.
917
+ */
918
+ name: string;
919
+ }
898
920
  export type RaizPhoneNumber = string;
899
921
  export interface RaizTask {
900
922
  /**
@@ -20,8 +20,11 @@ export interface Client {
20
20
  * reschedules, cancellations, failures, pending and unverified results
21
21
  * separately), `tool_calls_daily` (Agent tool calls per day), `tool_calls`
22
22
  * (each call, newest first), `assessment_results_daily` (assessment results
23
- * per day), each over days in the organization's time zone (`from`, `to`; the
24
- * last 30 days by default), or `campaign_progress`. Narrow with `agentId`,
23
+ * per day), `pqrsf_daily` (PQRSF classification, confirmed informational
24
+ * resolution and correct referrals from current pqrsf_* facts; unknown and
25
+ * pending analysis remain visible; excludes tests/imports/deleted records),
26
+ * each over days in the organization's time zone (`from`, `to`; the last 30
27
+ * days by default), or `campaign_progress`. Narrow with `agentId`,
25
28
  * `channelType`, `campaignId` or `definitionId`; unsupported filters fail. At
26
29
  * most 1000 rows: `hasMore` means split the range or filter. Booking outcomes
27
30
  * return no partial totals when their evidence scan exceeds its bound.
@@ -64,10 +67,14 @@ export interface CurrentRequest {
64
67
  * `tool_calls_daily`: tool calls per day, Agent and tool with
65
68
  * failures/durations (filter `agentId`). `tool_calls`: individual calls,
66
69
  * never inputs/outputs (filter `agentId`). `assessment_results_daily`:
67
- * assessments per day/definition (filter `definitionId`).
68
- * `campaign_progress`: recipients by status (filter `campaignId`; no dates).
70
+ * assessments per day/definition (filter `definitionId`). `pqrsf_daily`:
71
+ * classification, confirmed resolution and referral-link counts from the
72
+ * pqrsf_* definitions, including pending/unclassified conversations,
73
+ * excluding tests/imports/deleted records (filters `agentId`, `channelType`);
74
+ * no measured filing reduction is inferred. `campaign_progress`: recipients
75
+ * by status (filter `campaignId`; no dates).
69
76
  */
70
- name: "conversations_daily" | "tool_calls_daily" | "tool_calls" | "booking_outcomes" | "assessment_results_daily" | "campaign_progress";
77
+ name: "conversations_daily" | "pqrsf_daily" | "tool_calls_daily" | "tool_calls" | "booking_outcomes" | "assessment_results_daily" | "campaign_progress";
71
78
  /**
72
79
  * Last day (`YYYY-MM-DD`), inclusive, of a daily report. Default: today in
73
80
  * the organization's time zone.
@@ -17,6 +17,25 @@ export type RaizReport = {
17
17
  toReviewCount: number;
18
18
  }[];
19
19
  to: Temporal.PlainDate;
20
+ } | {
21
+ from: Temporal.PlainDate;
22
+ hasMore: boolean;
23
+ name: "pqrsf_daily";
24
+ rows: {
25
+ analyzedCount: number;
26
+ confirmedResolutionCount: number;
27
+ conversationCount: number;
28
+ day: Temporal.PlainDate;
29
+ formalPqrsfCount: number;
30
+ informativeResolvedCount: number;
31
+ informativeUnresolvedCount: number;
32
+ referralCorrectCount: number;
33
+ referralIncorrectCount: number;
34
+ referralPendingCount: number;
35
+ referralRequiredCount: number;
36
+ unclassifiedCount: number;
37
+ }[];
38
+ to: Temporal.PlainDate;
20
39
  } | {
21
40
  from: Temporal.PlainDate;
22
41
  hasMore: boolean;
@@ -1,4 +1,4 @@
1
1
  // Code generated by forge. DO NOT EDIT.
2
2
  /* eslint-disable */
3
3
  import { array, date, instant, object, union } from "../../_/index.js";
4
- export const RaizReportCodec = union([object([["from", null, date], ["rows", null, array(object([["day", null, date]]))], ["to", null, date]]), object([["from", null, date], ["rows", null, array(object([["day", null, date]]))], ["to", null, date]]), object([["from", null, date], ["rows", null, array(object([["occurredAt", null, instant]]))], ["to", null, date]]), object([["from", null, date], ["rows", null, array(object([["day", null, date]]))], ["to", null, date]]), object([["from", null, date], ["rows", null, array(object([["day", null, date]]))], ["to", null, date]])]);
4
+ export const RaizReportCodec = union([object([["from", null, date], ["rows", null, array(object([["day", null, date]]))], ["to", null, date]]), object([["from", null, date], ["rows", null, array(object([["day", null, date]]))], ["to", null, date]]), object([["from", null, date], ["rows", null, array(object([["day", null, date]]))], ["to", null, date]]), object([["from", null, date], ["rows", null, array(object([["occurredAt", null, instant]]))], ["to", null, date]]), object([["from", null, date], ["rows", null, array(object([["day", null, date]]))], ["to", null, date]]), object([["from", null, date], ["rows", null, array(object([["day", null, date]]))], ["to", null, date]])]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arbol-ai/sdk",
3
- "version": "2.7.0",
3
+ "version": "2.9.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.20261022.214640",
54
- "sha256": "7ab911484cc0f05d9a2ef6b4851b369b666ccfdb43cb7086b6f91f60755f855a"
53
+ "release": "1.20261023.34948",
54
+ "sha256": "5e0595dc6bae6f9f6ac64d2a632d1b1d6bf0bfbdbd2bb939a80407b38f69f96a"
55
55
  }
56
56
  }
57
57
  }