@arbol-ai/sdk 2.1.0 → 2.2.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.
Files changed (58) hide show
  1. package/dist/raiz/agents/client.js +2 -2
  2. package/dist/raiz/agents/index.d.ts +1 -1
  3. package/dist/raiz/agents/models.d.ts +1 -46
  4. package/dist/raiz/agents/models.js +1 -5
  5. package/dist/raiz/bulletins/client.d.ts +182 -0
  6. package/dist/raiz/bulletins/client.js +53 -0
  7. package/dist/raiz/bulletins/index.d.ts +5 -0
  8. package/dist/raiz/bulletins/index.js +4 -0
  9. package/dist/raiz/bulletins/models.d.ts +53 -0
  10. package/dist/raiz/bulletins/models.js +12 -0
  11. package/dist/raiz/campaigns/client.js +2 -2
  12. package/dist/raiz/campaigns/index.d.ts +1 -1
  13. package/dist/raiz/campaigns/models.d.ts +6 -57
  14. package/dist/raiz/campaigns/models.js +1 -9
  15. package/dist/raiz/changes/client.js +1 -1
  16. package/dist/raiz/changes/models.d.ts +2 -2
  17. package/dist/raiz/channels/client.d.ts +2 -2
  18. package/dist/raiz/channels/client.js +3 -3
  19. package/dist/raiz/channels/index.d.ts +1 -1
  20. package/dist/raiz/channels/models.d.ts +23 -96
  21. package/dist/raiz/channels/models.js +2 -8
  22. package/dist/raiz/client.d.ts +2 -0
  23. package/dist/raiz/client.js +5 -0
  24. package/dist/raiz/contacts/client.js +6 -6
  25. package/dist/raiz/contacts/index.d.ts +1 -1
  26. package/dist/raiz/contacts/models.d.ts +4 -40
  27. package/dist/raiz/contacts/models.js +2 -8
  28. package/dist/raiz/conversations/client.d.ts +17 -11
  29. package/dist/raiz/conversations/client.js +5 -5
  30. package/dist/raiz/conversations/index.d.ts +1 -1
  31. package/dist/raiz/conversations/models.d.ts +17 -103
  32. package/dist/raiz/conversations/models.js +5 -12
  33. package/dist/raiz/definitions/client.js +2 -2
  34. package/dist/raiz/evalCases/client.js +2 -2
  35. package/dist/raiz/evalRuns/client.js +1 -1
  36. package/dist/raiz/facts/client.js +1 -1
  37. package/dist/raiz/index.d.ts +1 -1
  38. package/dist/raiz/knowledge/client.d.ts +3 -2
  39. package/dist/raiz/knowledge/client.js +4 -4
  40. package/dist/raiz/knowledge/index.d.ts +1 -1
  41. package/dist/raiz/knowledge/models.d.ts +1 -42
  42. package/dist/raiz/knowledge/models.js +1 -6
  43. package/dist/raiz/members/client.d.ts +3 -2
  44. package/dist/raiz/models.d.ts +17 -0
  45. package/dist/raiz/organization/client.d.ts +4 -2
  46. package/dist/raiz/organization/client.js +2 -2
  47. package/dist/raiz/organization/index.d.ts +1 -1
  48. package/dist/raiz/organization/models.d.ts +6 -4
  49. package/dist/raiz/profiles/client.js +2 -2
  50. package/dist/raiz/reports/client.d.ts +10 -9
  51. package/dist/raiz/reports/client.js +1 -1
  52. package/dist/raiz/reports/models.d.ts +2 -0
  53. package/dist/raiz/suppressions/client.d.ts +2 -1
  54. package/dist/raiz/suppressions/client.js +1 -1
  55. package/dist/raiz/tasks/client.js +4 -4
  56. package/dist/raiz/templates/client.d.ts +2 -1
  57. package/dist/raiz/voices/client.js +1 -1
  58. package/package.json +3 -3
@@ -1,5 +1,5 @@
1
1
  import type { PageInfo } from "../../models.js";
2
- import { type RaizFact } from "../models.js";
2
+ import { type RaizFact, type RaizHttpsUrl } from "../models.js";
3
3
  export interface RaizConversation {
4
4
  agentId: string | null;
5
5
  agentName: string | null;
@@ -14,8 +14,9 @@ export interface RaizConversation {
14
14
  */
15
15
  aiEnabled: boolean;
16
16
  /**
17
- * WhatsApp automatic replies are paused for this recipient, including future
18
- * episodes.
17
+ * WhatsApp automatic replies are paused for this recipient. A pause ends when
18
+ * their open conversation closes, so the next one starts with the AI; a
19
+ * closed conversation keeps the state it ended with.
19
20
  */
20
21
  aiPaused: boolean;
21
22
  aiPausedBy: "agent" | "operator" | null;
@@ -78,10 +79,7 @@ export interface RaizConversation {
78
79
  origin: "inbound" | "manual" | "api" | "campaign" | "import" | "test";
79
80
  outcome: "success" | "failure" | "unknown" | null;
80
81
  profileId: string | null;
81
- recording?: {
82
- expiresAt: Temporal.Instant;
83
- url: string;
84
- } | null;
82
+ recording?: RaizSignedUrl | null;
85
83
  recordingAvailable: boolean;
86
84
  requestedBy: string | null;
87
85
  sentiment: "positive" | "neutral" | "negative" | null;
@@ -113,7 +111,7 @@ export interface RaizConversationPage {
113
111
  /**
114
112
  * Items admitted by this resource contract within the verified organization.
115
113
  */
116
- data: RaizConversationSummary[];
114
+ data: RaizConversation[];
117
115
  /**
118
116
  * Discriminator for a resource list response.
119
117
  */
@@ -123,100 +121,6 @@ export interface RaizConversationPage {
123
121
  */
124
122
  pageInfo: PageInfo;
125
123
  }
126
- export interface RaizConversationSummary {
127
- agentId: string | null;
128
- agentName: string | null;
129
- /**
130
- * The Agent said something to the contact.
131
- */
132
- agentReplied: boolean;
133
- aiCoveragePercent: number;
134
- /**
135
- * AI assignment for this episode. Manual changes affect only this
136
- * conversation; recipient pauses still apply.
137
- */
138
- aiEnabled: boolean;
139
- /**
140
- * WhatsApp automatic replies are paused for this recipient, including future
141
- * episodes.
142
- */
143
- aiPaused: boolean;
144
- aiPausedBy: "agent" | "operator" | null;
145
- analyzedAt: Temporal.Instant | null;
146
- campaignId: string | null;
147
- campaignRecipientId: string | null;
148
- channelAddress: string | null;
149
- channelId: string | null;
150
- channelName: string | null;
151
- channelType: "voice" | "whatsapp" | "web";
152
- closeReason: "completed" | "inactivity" | "handoff" | "migration" | "error" | "manual" | null;
153
- contactId: string | null;
154
- contactName: string | null;
155
- contactProfileName: string | null;
156
- counterpartAddress: string | null;
157
- /**
158
- * An instant in RFC 3339 format, in UTC.
159
- */
160
- createdAt: Temporal.Instant;
161
- deletedAt: Temporal.Instant | null;
162
- direction: "inbound" | "outbound";
163
- durationSeconds: number | null;
164
- endedAt: Temporal.Instant | null;
165
- /**
166
- * Conversation id.
167
- */
168
- id: string;
169
- language: string | null;
170
- lastMessageAt: Temporal.Instant | null;
171
- messageCount: number;
172
- /**
173
- * Your own keys and labels for this resource (up to 50 keys of 40 characters;
174
- * values up to 500 characters). Raíz never interprets them.
175
- */
176
- metadata: {
177
- [key: string]: unknown;
178
- };
179
- /**
180
- * A person of the organization wrote to the contact, in Raíz or in the
181
- * WhatsApp Business app.
182
- */
183
- operatorReplied: boolean;
184
- /**
185
- * How it started: the contact reached out (`inbound`), a person of the
186
- * organization started it (`manual`: in the Dashboard, or on WhatsApp in the
187
- * WhatsApp Business app), a client through the API (`api`), a campaign, an
188
- * import or a person-owned WhatsApp Agent trial (`test`).
189
- */
190
- origin: "inbound" | "manual" | "api" | "campaign" | "import" | "test";
191
- outcome: "success" | "failure" | "unknown" | null;
192
- profileId: string | null;
193
- recordingAvailable: boolean;
194
- requestedBy: string | null;
195
- sentiment: "positive" | "neutral" | "negative" | null;
196
- /**
197
- * An instant in RFC 3339 format, in UTC.
198
- */
199
- startedAt: Temporal.Instant;
200
- status: "open" | "closed";
201
- subjectContactId: string | null;
202
- summary: string | null;
203
- summaryAuthor: "person" | "ai" | "system" | "import" | "provider" | null;
204
- title: string | null;
205
- titleAuthor: "person" | "ai" | "system" | "import" | "provider" | null;
206
- /**
207
- * An instant in RFC 3339 format, in UTC.
208
- */
209
- updatedAt: Temporal.Instant;
210
- version: number;
211
- /**
212
- * Who works the conversation for the organization, in the order each first
213
- * wrote something the contact saw (those who have not yet, last): each Agent
214
- * and the team that wrote in it and, while it is open or when nobody answered
215
- * it, whoever has it (the assigned Agent while the AI handles it, the team
216
- * otherwise). `agentId` is the Agent assigned now.
217
- */
218
- workers: RaizConversationWorker[];
219
- }
220
124
  export type RaizConversationWorker = {
221
125
  agentId: string;
222
126
  answering: boolean;
@@ -374,9 +278,19 @@ export interface RaizMessagePage {
374
278
  */
375
279
  pageInfo: PageInfo;
376
280
  }
281
+ export interface RaizSignedUrl {
282
+ /**
283
+ * When the URL stops working.
284
+ */
285
+ expiresAt: Temporal.Instant;
286
+ /**
287
+ * The signed URL. Anyone holding it has access until it expires.
288
+ */
289
+ url: RaizHttpsUrl;
290
+ }
377
291
  export declare const RaizConversationCodec: import("../../_/codec.js").Codec;
378
292
  export declare const RaizConversationPageCodec: import("../../_/codec.js").Codec;
379
- export declare const RaizConversationSummaryCodec: import("../../_/codec.js").Codec;
380
293
  export declare const RaizConversationWorkerCodec: import("../../_/codec.js").Codec;
381
294
  export declare const RaizMessageCodec: import("../../_/codec.js").Codec;
382
295
  export declare const RaizMessagePageCodec: import("../../_/codec.js").Codec;
296
+ export declare const RaizSignedUrlCodec: import("../../_/codec.js").Codec;
@@ -10,23 +10,13 @@ export const RaizConversationCodec = object([
10
10
  ["facts", null, array(() => RaizFactCodec)],
11
11
  ["lastMessageAt", null, instant],
12
12
  ["messages", null, () => RaizMessagePageCodec],
13
- ["recording", null, object([["expiresAt", null, instant]])],
13
+ ["recording", null, () => RaizSignedUrlCodec],
14
14
  ["startedAt", null, instant],
15
15
  ["updatedAt", null, instant],
16
16
  ["workers", null, array(() => RaizConversationWorkerCodec)],
17
17
  ]);
18
18
  export const RaizConversationPageCodec = object([
19
- ["data", null, array(() => RaizConversationSummaryCodec)],
20
- ]);
21
- export const RaizConversationSummaryCodec = object([
22
- ["analyzedAt", null, instant],
23
- ["createdAt", null, instant],
24
- ["deletedAt", null, instant],
25
- ["endedAt", null, instant],
26
- ["lastMessageAt", null, instant],
27
- ["startedAt", null, instant],
28
- ["updatedAt", null, instant],
29
- ["workers", null, array(() => RaizConversationWorkerCodec)],
19
+ ["data", null, array(() => RaizConversationCodec)],
30
20
  ]);
31
21
  export const RaizConversationWorkerCodec = union([object([["firstMessageAt", null, instant], ["lastMessageAt", null, instant]]), object([["firstMessageAt", null, instant], ["lastMessageAt", null, instant], ["members", null, array(object([["firstMessageAt", null, instant], ["lastMessageAt", null, instant]]))]])]);
32
22
  export const RaizMessageCodec = object([
@@ -39,3 +29,6 @@ export const RaizMessageCodec = object([
39
29
  export const RaizMessagePageCodec = object([
40
30
  ["data", null, array(() => RaizMessageCodec)],
41
31
  ]);
32
+ export const RaizSignedUrlCodec = object([
33
+ ["expiresAt", null, instant],
34
+ ]);
@@ -25,14 +25,14 @@ const GetOperation = {
25
25
  route: "/v1/raiz/definitions/get",
26
26
  query: { definitionId: "definitionId" },
27
27
  response: object([["data", null, () => RaizDefinitionCodec]]),
28
- errors: { "400": true, "401": true, "403": true, "404": true, "405": true, "409": true, "413": true, "415": true, "422": true, "429": true, "500": true, "502": true, "503": true, "504": true },
28
+ 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 },
29
29
  };
30
30
  const ListOperation = {
31
31
  method: "GET",
32
32
  route: "/v1/raiz/definitions",
33
33
  query: { cursor: "cursor", direction: "direction", limit: "limit", kind: "kind", status: "status", subject: "subject" },
34
34
  response: object([["data", null, () => RaizDefinitionPageCodec]]),
35
- errors: { "400": true, "401": true, "403": true, "404": true, "405": true, "409": true, "413": true, "415": true, "422": true, "429": true, "500": true, "502": true, "503": true, "504": true },
35
+ 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 },
36
36
  };
37
37
  const UpdateOperation = {
38
38
  method: "PATCH",
@@ -16,12 +16,12 @@ const ListOperation = {
16
16
  route: "/v1/raiz/eval-cases",
17
17
  query: { cursor: "cursor", direction: "direction", limit: "limit", agentId: "agentId", status: "status" },
18
18
  response: object([["data", null, () => RaizEvalCasePageCodec]]),
19
- errors: { "400": true, "401": true, "403": true, "404": true, "405": true, "409": true, "413": true, "415": true, "422": true, "429": true, "500": true, "502": true, "503": true, "504": true },
19
+ 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 },
20
20
  };
21
21
  const UpdateOperation = {
22
22
  method: "PATCH",
23
23
  route: "/v1/raiz/eval-cases/update",
24
24
  body: "flat",
25
25
  response: object([["data", null, () => RaizEvalCaseCodec]]),
26
- errors: { "400": true, "401": true, "403": true, "404": true, "405": true, "409": true, "413": true, "415": true, "422": true, "429": true, "500": true, "502": true, "503": true, "504": true },
26
+ 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 },
27
27
  };
@@ -23,5 +23,5 @@ const GetOperation = {
23
23
  route: "/v1/raiz/eval-runs/get",
24
24
  query: { evalRunId: "evalRunId" },
25
25
  response: object([["data", null, () => RaizEvalRunCodec]]),
26
- errors: { "400": true, "401": true, "403": true, "404": true, "405": true, "409": true, "413": true, "415": true, "422": true, "429": true, "500": true, "502": true, "503": true, "504": true },
26
+ 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 },
27
27
  };
@@ -24,5 +24,5 @@ const UpdateOperation = {
24
24
  route: "/v1/raiz/facts/update",
25
25
  body: "flat",
26
26
  response: object([["data", null, () => RaizFactCodec]]),
27
- errors: { "400": true, "401": true, "403": true, "404": true, "405": true, "409": true, "413": true, "415": true, "422": true, "429": true, "500": true, "502": true, "503": true, "504": true },
27
+ 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 },
28
28
  };
@@ -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, RaizFact, RaizFailureResponse, RaizTask, } from "./models.js";
5
+ export type { RaizAgentIntegrationSkillInput, RaizAgentSkill, RaizBusinessHours, RaizBusinessHoursWindow, RaizContactHoursWindow, RaizCount, RaizEmailAddress, RaizFact, RaizFailureResponse, RaizHttpsUrl, RaizPhoneNumber, RaizTask, } from "./models.js";
@@ -1,5 +1,6 @@
1
1
  import { type BaseClientOptions, type RequestOptions, Transport } from "../../_/index.js";
2
2
  import type { ResponseMetadata } from "../../models.js";
3
+ import type { RaizHttpsUrl } from "../models.js";
3
4
  import { type RaizCrawlSettings, type RaizKnowledgeDocument, type RaizKnowledgeDocumentPage, type RaizKnowledgeFileInput, type RaizKnowledgePassagePage } from "./models.js";
4
5
  export interface ClientOptions extends BaseClientOptions {
5
6
  /**
@@ -83,7 +84,7 @@ export interface CreateRequest {
83
84
  * approved for this deployment; only same-origin pages under its path are
84
85
  * followed, and robots.txt is respected.
85
86
  */
86
- sourceUrl?: string;
87
+ sourceUrl?: RaizHttpsUrl;
87
88
  /**
88
89
  * A paused document is never searched; its index is kept.
89
90
  */
@@ -215,7 +216,7 @@ export interface UpdateRequest {
215
216
  * approved for this deployment; only same-origin pages under its path are
216
217
  * followed, and robots.txt is respected.
217
218
  */
218
- sourceUrl?: string;
219
+ sourceUrl?: RaizHttpsUrl;
219
220
  /**
220
221
  * A paused document is never searched; its index is kept.
221
222
  */
@@ -20,28 +20,28 @@ const CreateOperation = {
20
20
  body: "flat",
21
21
  request: object([["file", null, () => RaizKnowledgeFileInputCodec]]),
22
22
  response: object([["data", null, () => RaizKnowledgeDocumentCodec]]),
23
- errors: { "400": true, "401": true, "403": true, "404": true, "405": true, "409": true, "413": true, "415": true, "422": true, "429": true, "500": true, "502": true, "503": true, "504": true },
23
+ errors: { "400": true, "401": true, "403": true, "404": true, "405": true, "413": true, "415": true, "422": true, "429": true, "500": true, "502": true, "503": true, "504": true },
24
24
  };
25
25
  const GetOperation = {
26
26
  method: "GET",
27
27
  route: "/v1/raiz/knowledge/get",
28
28
  query: { expand: "expand", knowledgeDocumentId: "knowledgeDocumentId" },
29
29
  response: object([["data", null, () => RaizKnowledgeDocumentCodec]]),
30
- errors: { "400": true, "401": true, "403": true, "404": true, "405": true, "409": true, "413": true, "415": true, "422": true, "429": true, "500": true, "502": true, "503": true, "504": true },
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 },
31
31
  };
32
32
  const ListOperation = {
33
33
  method: "GET",
34
34
  route: "/v1/raiz/knowledge",
35
35
  query: { cursor: "cursor", direction: "direction", limit: "limit", indexStatus: "indexStatus", kind: "kind", q: "q", status: "status" },
36
36
  response: object([["data", null, () => RaizKnowledgeDocumentPageCodec]]),
37
- errors: { "400": true, "401": true, "403": true, "404": true, "405": true, "409": true, "413": true, "415": true, "422": true, "429": true, "500": true, "502": true, "503": true, "504": true },
37
+ 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 },
38
38
  };
39
39
  const SearchOperation = {
40
40
  method: "POST",
41
41
  route: "/v1/raiz/knowledge/search",
42
42
  body: "flat",
43
43
  response: null,
44
- errors: { "400": true, "401": true, "403": true, "404": true, "405": true, "409": true, "413": true, "415": true, "422": true, "429": true, "500": true, "502": true, "503": true, "504": true },
44
+ 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 },
45
45
  };
46
46
  const UpdateOperation = {
47
47
  method: "PATCH",
@@ -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, SearchRequest, SearchResponse, UpdateRequest, UpdateResponse, } from "./client.js";
5
- export type { RaizCrawlSettings, RaizKnowledgeDocument, RaizKnowledgeDocumentPage, RaizKnowledgeDocumentSummary, RaizKnowledgeFileInput, RaizKnowledgePassage, RaizKnowledgePassagePage, } from "./models.js";
5
+ export type { RaizCrawlSettings, RaizKnowledgeDocument, RaizKnowledgeDocumentPage, RaizKnowledgeFileInput, RaizKnowledgePassage, RaizKnowledgePassagePage, } from "./models.js";
@@ -61,7 +61,7 @@ export interface RaizKnowledgeDocumentPage {
61
61
  /**
62
62
  * Items admitted by this resource contract within the verified organization.
63
63
  */
64
- data: RaizKnowledgeDocumentSummary[];
64
+ data: RaizKnowledgeDocument[];
65
65
  /**
66
66
  * Discriminator for a resource list response.
67
67
  */
@@ -71,46 +71,6 @@ export interface RaizKnowledgeDocumentPage {
71
71
  */
72
72
  pageInfo: PageInfo;
73
73
  }
74
- export interface RaizKnowledgeDocumentSummary {
75
- byteSize: number | null;
76
- /**
77
- * An instant in RFC 3339 format, in UTC.
78
- */
79
- createdAt: Temporal.Instant;
80
- description: string | null;
81
- fileName: string | null;
82
- /**
83
- * Knowledge document id.
84
- */
85
- id: string;
86
- indexErrorCode: string | null;
87
- /**
88
- * `pending`: waiting to be crawled or indexed. `indexing`: in progress.
89
- * `ready`: searchable. `failed`: see `indexErrorCode`; failed documents are
90
- * retried automatically.
91
- */
92
- indexStatus: "pending" | "indexing" | "ready" | "failed";
93
- indexedAt: Temporal.Instant | null;
94
- /**
95
- * `text`: written inline. `file`: an uploaded document (PDF, Word, Excel,
96
- * HTML, CSV, plain text or Markdown). `website`: a snapshot of approved web
97
- * pages.
98
- */
99
- kind: "text" | "file" | "website";
100
- mediaType: string | null;
101
- sha256: string | null;
102
- sourceUrl: string | null;
103
- /**
104
- * A paused document is never searched; its index is kept.
105
- */
106
- status: "active" | "paused";
107
- title: string;
108
- /**
109
- * An instant in RFC 3339 format, in UTC.
110
- */
111
- updatedAt: Temporal.Instant;
112
- version: number;
113
- }
114
74
  export interface RaizKnowledgeFileInput {
115
75
  /**
116
76
  * The file's bytes in standard base64, at most 8 MiB decoded.
@@ -159,5 +119,4 @@ export interface RaizKnowledgePassagePage {
159
119
  }
160
120
  export declare const RaizKnowledgeDocumentCodec: import("../../_/codec.js").Codec;
161
121
  export declare const RaizKnowledgeDocumentPageCodec: import("../../_/codec.js").Codec;
162
- export declare const RaizKnowledgeDocumentSummaryCodec: import("../../_/codec.js").Codec;
163
122
  export declare const RaizKnowledgeFileInputCodec: import("../../_/codec.js").Codec;
@@ -7,12 +7,7 @@ export const RaizKnowledgeDocumentCodec = object([
7
7
  ["updatedAt", null, instant],
8
8
  ]);
9
9
  export const RaizKnowledgeDocumentPageCodec = object([
10
- ["data", null, array(() => RaizKnowledgeDocumentSummaryCodec)],
11
- ]);
12
- export const RaizKnowledgeDocumentSummaryCodec = object([
13
- ["createdAt", null, instant],
14
- ["indexedAt", null, instant],
15
- ["updatedAt", null, instant],
10
+ ["data", null, array(() => RaizKnowledgeDocumentCodec)],
16
11
  ]);
17
12
  export const RaizKnowledgeFileInputCodec = object([
18
13
  ["data", null, bytes],
@@ -1,5 +1,6 @@
1
1
  import { type BaseClientOptions, type RequestOptions, Transport } from "../../_/index.js";
2
2
  import type { ResponseMetadata } from "../../models.js";
3
+ import type { RaizEmailAddress } from "../models.js";
3
4
  import { type RaizMember, type RaizMemberPage } from "./models.js";
4
5
  export interface ClientOptions extends BaseClientOptions {
5
6
  /**
@@ -42,9 +43,9 @@ export declare function createClient(options: ClientOptions): Client;
42
43
  export declare function bind(transport: Transport): Client;
43
44
  export interface CreateRequest {
44
45
  /**
45
- * Email address. Stored in lower case.
46
+ * Email address.
46
47
  */
47
- email: string;
48
+ email: RaizEmailAddress;
48
49
  /**
49
50
  * The Raíz roles to give, from `listRoles` (`assignable`).
50
51
  */
@@ -82,6 +82,7 @@ export interface RaizCount {
82
82
  */
83
83
  count: number;
84
84
  }
85
+ export type RaizEmailAddress = string;
85
86
  export interface RaizFact {
86
87
  /**
87
88
  * Who wrote the value.
@@ -707,6 +708,20 @@ export interface RaizFailureResponse {
707
708
  };
708
709
  message: "The settings do not apply to this Agent's modality, or two settings contradict each other.";
709
710
  retryable: false;
711
+ } | {
712
+ code: "BULLETIN_LIMIT_REACHED";
713
+ data: {
714
+ [key: string]: unknown;
715
+ };
716
+ message: "The organization already has 30 bulletins in force or scheduled. End or delete one before adding another.";
717
+ retryable: false;
718
+ } | {
719
+ code: "BULLETIN_PERIOD_INVALID";
720
+ data: {
721
+ [key: string]: unknown;
722
+ };
723
+ message: "A bulletin must end after it starts, and a new one must end in the future.";
724
+ retryable: false;
710
725
  } | {
711
726
  code: "EVAL_CASES_UNAVAILABLE";
712
727
  data: {
@@ -865,6 +880,8 @@ export interface RaizFailureResponse {
865
880
  metadata: ResponseMetadata;
866
881
  success: false;
867
882
  }
883
+ export type RaizHttpsUrl = string;
884
+ export type RaizPhoneNumber = string;
868
885
  export interface RaizTask {
869
886
  /**
870
887
  * Attempts the task has made so far, retries included. A task that works in
@@ -1,5 +1,6 @@
1
1
  import { type BaseClientOptions, type RequestOptions, Transport } from "../../_/index.js";
2
2
  import type { ResponseMetadata } from "../../models.js";
3
+ import type { RaizEmailAddress } from "../models.js";
3
4
  import { type RaizOrganization } from "./models.js";
4
5
  export interface ClientOptions extends BaseClientOptions {
5
6
  /**
@@ -63,14 +64,15 @@ export interface ConfigureRequest {
63
64
  };
64
65
  dailyReport?: {
65
66
  enabled?: boolean | null;
66
- recipients?: string[] | null;
67
+ recipients?: RaizEmailAddress[] | null;
67
68
  sendAt?: string | null;
68
69
  };
69
70
  notifications?: {
70
71
  escalations?: boolean | null;
71
72
  failedOutcomes?: boolean | null;
72
73
  failures?: boolean | null;
73
- recipients?: string[] | null;
74
+ phones?: string[] | null;
75
+ recipients?: RaizEmailAddress[] | null;
74
76
  };
75
77
  whatsapp?: {
76
78
  maxConcurrentReplies?: number | null;
@@ -17,14 +17,14 @@ const ConfigureOperation = {
17
17
  route: "/v1/raiz/organization/update",
18
18
  body: "flat",
19
19
  response: object([["data", null, () => RaizOrganizationCodec]]),
20
- errors: { "400": true, "401": true, "403": true, "404": true, "405": true, "409": true, "413": true, "415": true, "422": true, "429": true, "500": true, "502": true, "503": true, "504": true },
20
+ errors: { "400": true, "401": true, "403": true, "404": true, "405": true, "413": true, "415": true, "422": true, "429": true, "500": true, "502": true, "503": true, "504": true },
21
21
  };
22
22
  const CurrentOperation = {
23
23
  method: "GET",
24
24
  route: "/v1/raiz/organization",
25
25
  query: { expand: "expand" },
26
26
  response: object([["data", null, () => RaizOrganizationCodec]]),
27
- errors: { "400": true, "401": true, "403": true, "404": true, "405": true, "409": true, "413": true, "415": true, "422": true, "429": true, "500": true, "502": true, "503": true, "504": true },
27
+ 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 },
28
28
  };
29
29
  const SendDailyReportOperation = {
30
30
  method: "POST",
@@ -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, ConfigureRequest, ConfigureResponse, CurrentRequest, CurrentResponse, SendDailyReportRequest, SendDailyReportResponse, } from "./client.js";
5
- export type { OrganizationId, RaizOrganization, } from "./models.js";
5
+ export type { RaizOrganization, RaizOrganizationId, } from "./models.js";
@@ -1,4 +1,4 @@
1
- export type OrganizationId = string;
1
+ import type { RaizEmailAddress } from "../models.js";
2
2
  export interface RaizOrganization {
3
3
  /**
4
4
  * With `expand=applications`: Arbol's applications and whether you open each
@@ -20,7 +20,7 @@ export interface RaizOrganization {
20
20
  /**
21
21
  * Verified organization identifier.
22
22
  */
23
- id: OrganizationId;
23
+ id: RaizOrganizationId;
24
24
  /**
25
25
  * Default language of the organization's Agents (BCP 47).
26
26
  */
@@ -33,14 +33,15 @@ export interface RaizOrganization {
33
33
  };
34
34
  dailyReport: {
35
35
  enabled: boolean;
36
- recipients: string[];
36
+ recipients: RaizEmailAddress[];
37
37
  sendAt: string;
38
38
  };
39
39
  notifications: {
40
40
  escalations: boolean;
41
41
  failedOutcomes: boolean;
42
42
  failures: boolean;
43
- recipients: string[];
43
+ phones: string[];
44
+ recipients: RaizEmailAddress[];
44
45
  };
45
46
  whatsapp: {
46
47
  maxConcurrentReplies: number;
@@ -55,4 +56,5 @@ export interface RaizOrganization {
55
56
  */
56
57
  updatedAt: Temporal.Instant;
57
58
  }
59
+ export type RaizOrganizationId = string;
58
60
  export declare const RaizOrganizationCodec: import("../../_/codec.js").Codec;
@@ -25,14 +25,14 @@ const GetOperation = {
25
25
  route: "/v1/raiz/profiles/get",
26
26
  query: { profileId: "profileId" },
27
27
  response: object([["data", null, () => RaizProfileCodec]]),
28
- errors: { "400": true, "401": true, "403": true, "404": true, "405": true, "409": true, "413": true, "415": true, "422": true, "429": true, "500": true, "502": true, "503": true, "504": true },
28
+ 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 },
29
29
  };
30
30
  const ListOperation = {
31
31
  method: "GET",
32
32
  route: "/v1/raiz/profiles",
33
33
  query: { cursor: "cursor", direction: "direction", limit: "limit", agentId: "agentId", channelType: "channelType" },
34
34
  response: object([["data", null, () => RaizProfilePageCodec]]),
35
- errors: { "400": true, "401": true, "403": true, "404": true, "405": true, "409": true, "413": true, "415": true, "422": true, "429": true, "500": true, "502": true, "503": true, "504": true },
35
+ 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 },
36
36
  };
37
37
  const UpdateOperation = {
38
38
  method: "PATCH",
@@ -46,15 +46,16 @@ export interface CurrentRequest {
46
46
  from?: Temporal.PlainDate;
47
47
  /**
48
48
  * `conversations_daily`: conversations the AI took part in per day, Agent,
49
- * channel type and direction, with outcomes (filters `agentId`,
50
- * `channelType`); WhatsApp conversations the organization's people handled on
51
- * their own are left out. `tool_calls_daily`: AI tool calls per day, Agent
52
- * and tool, with failures and durations (filter `agentId`). `tool_calls`: the
53
- * same calls one by one, newest first, each with its conversation, status,
54
- * duration and error code, never its input or output (filter `agentId`).
55
- * `assessment_results_daily`: yes/no assessments per day and definition
56
- * (filter `definitionId`). `campaign_progress`: recipients per campaign by
57
- * status (filter `campaignId`; no date range).
49
+ * channel type and direction, with outcomes, escalations to the team and the
50
+ * conversations to review (filters `agentId`, `channelType`); WhatsApp
51
+ * conversations the organization's people handled on their own are left out.
52
+ * `tool_calls_daily`: AI tool calls per day, Agent and tool, with failures
53
+ * and durations (filter `agentId`). `tool_calls`: the same calls one by one,
54
+ * newest first, each with its conversation, status, duration and error code,
55
+ * never its input or output (filter `agentId`). `assessment_results_daily`:
56
+ * yes/no assessments per day and definition (filter `definitionId`).
57
+ * `campaign_progress`: recipients per campaign by status (filter
58
+ * `campaignId`; no date range).
58
59
  */
59
60
  name: "conversations_daily" | "tool_calls_daily" | "tool_calls" | "assessment_results_daily" | "campaign_progress";
60
61
  /**
@@ -15,5 +15,5 @@ const CurrentOperation = {
15
15
  route: "/v1/raiz/reports",
16
16
  query: { agentId: "agentId", campaignId: "campaignId", channelType: "channelType", definitionId: "definitionId", from: "from", name: "name", to: "to" },
17
17
  response: object([["data", null, () => RaizReportCodec]]),
18
- errors: { "400": true, "401": true, "403": true, "404": true, "405": true, "409": true, "413": true, "415": true, "422": true, "429": true, "500": true, "502": true, "503": true, "504": true },
18
+ 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 },
19
19
  };
@@ -10,9 +10,11 @@ export type RaizReport = {
10
10
  conversationCount: number;
11
11
  day: Temporal.PlainDate;
12
12
  direction: "inbound" | "outbound";
13
+ escalatedCount: number;
13
14
  failureCount: number;
14
15
  negativeCount: number;
15
16
  successCount: number;
17
+ toReviewCount: number;
16
18
  }[];
17
19
  to: Temporal.PlainDate;
18
20
  } | {
@@ -1,5 +1,6 @@
1
1
  import { type BaseClientOptions, type RequestOptions, Transport } from "../../_/index.js";
2
2
  import type { ResponseMetadata } from "../../models.js";
3
+ import type { RaizPhoneNumber } from "../models.js";
3
4
  import { type RaizSuppression, type RaizSuppressionPage } from "./models.js";
4
5
  export interface ClientOptions extends BaseClientOptions {
5
6
  /**
@@ -32,7 +33,7 @@ export declare function createClient(options: ClientOptions): Client;
32
33
  export declare function bind(transport: Transport): Client;
33
34
  export type CreateRequest = {
34
35
  kind: "phone";
35
- phone: string;
36
+ phone: RaizPhoneNumber;
36
37
  reason: string;
37
38
  } | {
38
39
  kind: "phone_prefix";
@@ -23,5 +23,5 @@ const ListOperation = {
23
23
  route: "/v1/raiz/suppressions",
24
24
  query: { cursor: "cursor", direction: "direction", limit: "limit", kind: "kind", phone: "phone", q: "q" },
25
25
  response: object([["data", null, () => RaizSuppressionPageCodec]]),
26
- errors: { "400": true, "401": true, "403": true, "404": true, "405": true, "409": true, "413": true, "415": true, "422": true, "429": true, "500": true, "502": true, "503": true, "504": true },
26
+ 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 },
27
27
  };