@arbol-ai/sdk 2.1.0 → 2.3.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 (59) hide show
  1. package/README.md +2 -1
  2. package/dist/raiz/agents/client.js +2 -2
  3. package/dist/raiz/agents/index.d.ts +1 -1
  4. package/dist/raiz/agents/models.d.ts +1 -46
  5. package/dist/raiz/agents/models.js +1 -5
  6. package/dist/raiz/bulletins/client.d.ts +182 -0
  7. package/dist/raiz/bulletins/client.js +53 -0
  8. package/dist/raiz/bulletins/index.d.ts +5 -0
  9. package/dist/raiz/bulletins/index.js +4 -0
  10. package/dist/raiz/bulletins/models.d.ts +53 -0
  11. package/dist/raiz/bulletins/models.js +12 -0
  12. package/dist/raiz/campaigns/client.js +2 -2
  13. package/dist/raiz/campaigns/index.d.ts +1 -1
  14. package/dist/raiz/campaigns/models.d.ts +6 -57
  15. package/dist/raiz/campaigns/models.js +1 -9
  16. package/dist/raiz/changes/client.js +1 -1
  17. package/dist/raiz/changes/models.d.ts +2 -2
  18. package/dist/raiz/channels/client.d.ts +100 -3
  19. package/dist/raiz/channels/client.js +26 -2
  20. package/dist/raiz/channels/index.d.ts +2 -2
  21. package/dist/raiz/channels/models.d.ts +23 -96
  22. package/dist/raiz/channels/models.js +2 -8
  23. package/dist/raiz/client.d.ts +2 -0
  24. package/dist/raiz/client.js +5 -0
  25. package/dist/raiz/contacts/client.js +6 -6
  26. package/dist/raiz/contacts/index.d.ts +1 -1
  27. package/dist/raiz/contacts/models.d.ts +4 -40
  28. package/dist/raiz/contacts/models.js +2 -8
  29. package/dist/raiz/conversations/client.d.ts +17 -11
  30. package/dist/raiz/conversations/client.js +5 -5
  31. package/dist/raiz/conversations/index.d.ts +1 -1
  32. package/dist/raiz/conversations/models.d.ts +17 -103
  33. package/dist/raiz/conversations/models.js +5 -12
  34. package/dist/raiz/definitions/client.js +2 -2
  35. package/dist/raiz/evalCases/client.js +2 -2
  36. package/dist/raiz/evalRuns/client.js +1 -1
  37. package/dist/raiz/facts/client.js +1 -1
  38. package/dist/raiz/index.d.ts +1 -1
  39. package/dist/raiz/knowledge/client.d.ts +3 -2
  40. package/dist/raiz/knowledge/client.js +4 -4
  41. package/dist/raiz/knowledge/index.d.ts +1 -1
  42. package/dist/raiz/knowledge/models.d.ts +1 -42
  43. package/dist/raiz/knowledge/models.js +1 -6
  44. package/dist/raiz/members/client.d.ts +3 -2
  45. package/dist/raiz/models.d.ts +17 -0
  46. package/dist/raiz/organization/client.d.ts +4 -2
  47. package/dist/raiz/organization/client.js +2 -2
  48. package/dist/raiz/organization/index.d.ts +1 -1
  49. package/dist/raiz/organization/models.d.ts +6 -4
  50. package/dist/raiz/profiles/client.js +2 -2
  51. package/dist/raiz/reports/client.d.ts +10 -9
  52. package/dist/raiz/reports/client.js +1 -1
  53. package/dist/raiz/reports/models.d.ts +2 -0
  54. package/dist/raiz/suppressions/client.d.ts +2 -1
  55. package/dist/raiz/suppressions/client.js +1 -1
  56. package/dist/raiz/tasks/client.js +4 -4
  57. package/dist/raiz/templates/client.d.ts +2 -1
  58. package/dist/raiz/voices/client.js +1 -1
  59. package/package.json +4 -4
@@ -73,10 +73,10 @@ export interface Client {
73
73
  * (CALL_IN_PROGRESS); a web chat cannot close while the Agent is replying
74
74
  * (REPLY_IN_PROGRESS, retry shortly). On WhatsApp, `aiEnabled` activates or
75
75
  * pauses AI only for this open conversation and leaves future episodes
76
- * unchanged; `aiPaused` pauses or resumes the Agent for this person, and
77
- * survives closing. Activating or resuming answers what the contact wrote
78
- * after the last real answer, the team's or the Agent's (a wait notice is not
79
- * one).
76
+ * unchanged; `aiPaused` pauses or resumes the Agent for this person until
77
+ * their open conversation closes. Activating or resuming answers what the
78
+ * contact wrote after the last real answer, the team's or the Agent's (a wait
79
+ * notice is not one).
80
80
  */
81
81
  update(request: UpdateRequest, options?: RequestOptions): Promise<UpdateResponse>;
82
82
  }
@@ -132,8 +132,11 @@ export interface CountRequest {
132
132
  * `ai`: conversations the AI takes part in (calls and web chats, and WhatsApp
133
133
  * conversations the AI handles or answered). `team`: WhatsApp conversations
134
134
  * the organization's people handle on their own. `escalated`: conversations
135
- * the AI handed to the team, still paused (an escalation or a requested
136
- * transfer).
135
+ * the AI handed to the team (a request it could not resolve, a contact who
136
+ * asked for a person, or a spent budget), also once the team gave them back
137
+ * to the AI; the ones `conversations_daily` counts in `escalatedCount`. A
138
+ * trial is not one, nor a conversation that opens while the AI is still
139
+ * paused for the number after an earlier handoff.
137
140
  */
138
141
  handling?: "ai" | "team" | "escalated";
139
142
  /**
@@ -268,8 +271,11 @@ export interface ListRequest {
268
271
  * `ai`: conversations the AI takes part in (calls and web chats, and WhatsApp
269
272
  * conversations the AI handles or answered). `team`: WhatsApp conversations
270
273
  * the organization's people handle on their own. `escalated`: conversations
271
- * the AI handed to the team, still paused (an escalation or a requested
272
- * transfer).
274
+ * the AI handed to the team (a request it could not resolve, a contact who
275
+ * asked for a person, or a spent budget), also once the team gave them back
276
+ * to the AI; the ones `conversations_daily` counts in `escalatedCount`. A
277
+ * trial is not one, nor a conversation that opens while the AI is still
278
+ * paused for the number after an earlier handoff.
273
279
  */
274
280
  handling?: "ai" | "team" | "escalated";
275
281
  /**
@@ -345,9 +351,9 @@ export interface UpdateRequest {
345
351
  */
346
352
  aiEnabled?: boolean;
347
353
  /**
348
- * WhatsApp only: pause or resume automatic replies for this recipient.
349
- * Resuming answers what the contact wrote in this conversation after the last
350
- * real answer.
354
+ * WhatsApp only: pause or resume automatic replies for this recipient until
355
+ * their open conversation closes. Resuming answers what the contact wrote in
356
+ * this conversation after the last real answer.
351
357
  */
352
358
  aiPaused?: boolean;
353
359
  contactId?: string | null;
@@ -19,33 +19,33 @@ const ContinueOperation = {
19
19
  route: "/v1/raiz/conversations/continue",
20
20
  body: "flat",
21
21
  response: object([["data", null, () => RaizConversationCodec]]),
22
- 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 },
22
+ 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 },
23
23
  };
24
24
  const CountOperation = {
25
25
  method: "GET",
26
26
  route: "/v1/raiz/conversations/count",
27
27
  query: { agentId: "agentId", campaignId: "campaignId", channelId: "channelId", channelType: "channelType", contactId: "contactId", conversationDirection: "conversationDirection", handling: "handling", worker: "worker", origin: "origin", outcome: "outcome", metadataReference: "metadataReference", profileId: "profileId", q: "q", requestedBy: "requestedBy", startedAfter: "startedAfter", startedBefore: "startedBefore", status: "status" },
28
28
  response: null,
29
- 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 },
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
  };
31
31
  const GetOperation = {
32
32
  method: "GET",
33
33
  route: "/v1/raiz/conversations/get",
34
34
  query: { conversationId: "conversationId", expand: "expand", messagesCursor: "messagesCursor", messagesDirection: "messagesDirection", messagesLimit: "messagesLimit" },
35
35
  response: object([["data", null, () => RaizConversationCodec]]),
36
- 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 },
36
+ 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 },
37
37
  };
38
38
  const ListOperation = {
39
39
  method: "GET",
40
40
  route: "/v1/raiz/conversations",
41
41
  query: { cursor: "cursor", direction: "direction", limit: "limit", agentId: "agentId", campaignId: "campaignId", channelId: "channelId", channelType: "channelType", contactId: "contactId", conversationDirection: "conversationDirection", handling: "handling", worker: "worker", origin: "origin", outcome: "outcome", metadataReference: "metadataReference", profileId: "profileId", q: "q", requestedBy: "requestedBy", startedAfter: "startedAfter", startedBefore: "startedBefore", status: "status", sort: "sort" },
42
42
  response: object([["data", null, () => RaizConversationPageCodec]]),
43
- 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 },
43
+ 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 },
44
44
  };
45
45
  const UpdateOperation = {
46
46
  method: "PATCH",
47
47
  route: "/v1/raiz/conversations/update",
48
48
  body: "flat",
49
49
  response: object([["data", null, () => RaizConversationCodec]]),
50
- 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 },
50
+ 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 },
51
51
  };
@@ -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, ContinueRequest, ContinueResponse, CountRequest, CountResponse, GetRequest, GetResponse, ListRequest, ListResponse, UpdateRequest, UpdateResponse, } from "./client.js";
5
- export type { RaizConversation, RaizConversationPage, RaizConversationSummary, RaizConversationWorker, RaizMessage, RaizMessagePage, } from "./models.js";
5
+ export type { RaizConversation, RaizConversationPage, RaizConversationWorker, RaizMessage, RaizMessagePage, RaizSignedUrl, } from "./models.js";
@@ -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";