@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
@@ -1,6 +1,6 @@
1
1
  import { type BaseClientOptions, type RequestOptions, Transport } from "../../_/index.js";
2
- import type { ResponseMetadata } from "../../models.js";
3
- import { type RaizBusinessHours } from "../models.js";
2
+ import type { DeletedObject, ResponseMetadata } from "../../models.js";
3
+ import { type RaizBusinessHours, type RaizPhoneNumber } from "../models.js";
4
4
  import { type RaizChannel, type RaizChannelPage, type RaizWidgetSettingsInput } from "./models.js";
5
5
  export interface ClientOptions extends BaseClientOptions {
6
6
  /**
@@ -9,6 +9,28 @@ export interface ClientOptions extends BaseClientOptions {
9
9
  baseUrl: string;
10
10
  }
11
11
  export interface Client {
12
+ /**
13
+ * Add a channel
14
+ *
15
+ * Add a channel. `whatsapp` creates a pending channel and a setup link
16
+ * (`setup.url`) where the business connects its WhatsApp number; call
17
+ * `verify_channel` once that is done. `voice` connects a platform phone
18
+ * number (`platform_number`) or the organization's own carrier over SIP
19
+ * (`sip_trunk`) at once (SIP credentials are passed on once and never
20
+ * stored). `web` creates the chat widget with its configuration. With an
21
+ * Agent, traffic is on by default. Done in Settings → Channels or the REST
22
+ * API; not an AI tool.
23
+ */
24
+ create(request: CreateRequest, options?: RequestOptions): Promise<CreateResponse>;
25
+ /**
26
+ * Delete a channel
27
+ *
28
+ * Remove a channel; its conversations remain. A phone number stops receiving
29
+ * and placing calls (the number stays in the platform account, where Arbol
30
+ * staff can release it); a WhatsApp number stops sending messages to Raíz. To
31
+ * pause traffic instead, switch it off with `update_channel`. Not an AI tool.
32
+ */
33
+ delete(request: DeleteRequest, options?: RequestOptions): Promise<DeleteResponse>;
12
34
  /**
13
35
  * Get a channel
14
36
  *
@@ -34,6 +56,17 @@ export interface Client {
34
56
  * and assignment.
35
57
  */
36
58
  list(request?: ListRequest, options?: RequestOptions): Promise<ListResponse>;
59
+ /**
60
+ * Renew a WhatsApp setup link
61
+ *
62
+ * Issue a new setup link for a pending WhatsApp channel, returned in `setup`,
63
+ * when the previous one was lost or must go to someone else; the previous
64
+ * link stops working. The setup is checked first: if the business already
65
+ * connected its number, the channel is completed as `verify_channel` does and
66
+ * no link is returned. A channel that is not a pending WhatsApp number fails
67
+ * with INVALID_STATE or CHANNEL_TYPE_MISMATCH. Not an AI tool.
68
+ */
69
+ renewSetup(request: RenewSetupRequest, options?: RequestOptions): Promise<RenewSetupResponse>;
37
70
  /**
38
71
  * Update a channel
39
72
  *
@@ -61,6 +94,58 @@ export interface Client {
61
94
  }
62
95
  export declare function createClient(options: ClientOptions): Client;
63
96
  export declare function bind(transport: Transport): Client;
97
+ export type CreateRequest = {
98
+ agentId?: string;
99
+ channelType: "whatsapp";
100
+ inboundEnabled?: boolean;
101
+ name?: string;
102
+ outboundEnabled?: boolean;
103
+ } | {
104
+ agentId?: string;
105
+ channelType: "voice";
106
+ endpoint: {
107
+ kind: "platform_number";
108
+ label?: string;
109
+ phoneNumber: RaizPhoneNumber;
110
+ } | {
111
+ address: string;
112
+ kind: "sip_trunk";
113
+ label?: string;
114
+ mediaEncryption?: "disabled" | "allowed" | "required";
115
+ password?: string;
116
+ phoneNumber: RaizPhoneNumber;
117
+ transport?: "auto" | "udp" | "tcp" | "tls";
118
+ username?: string;
119
+ };
120
+ inboundEnabled?: boolean;
121
+ name?: string;
122
+ outboundEnabled?: boolean;
123
+ } | {
124
+ agentId?: string;
125
+ channelType: "web";
126
+ inboundEnabled?: boolean;
127
+ name?: string;
128
+ outboundEnabled?: boolean;
129
+ widget: RaizWidgetSettingsInput;
130
+ };
131
+ export interface CreateResponse {
132
+ data: RaizChannel;
133
+ error: null;
134
+ metadata: ResponseMetadata;
135
+ success: true;
136
+ }
137
+ export interface DeleteRequest {
138
+ /**
139
+ * Channel id.
140
+ */
141
+ channelId: string;
142
+ }
143
+ export interface DeleteResponse {
144
+ data: DeletedObject;
145
+ error: null;
146
+ metadata: ResponseMetadata;
147
+ success: true;
148
+ }
64
149
  export interface GetRequest {
65
150
  /**
66
151
  * Channel id.
@@ -114,6 +199,18 @@ export interface ListResponse {
114
199
  metadata: ResponseMetadata;
115
200
  success: true;
116
201
  }
202
+ export interface RenewSetupRequest {
203
+ /**
204
+ * Channel id.
205
+ */
206
+ channelId: string;
207
+ }
208
+ export interface RenewSetupResponse {
209
+ data: RaizChannel;
210
+ error: null;
211
+ metadata: ResponseMetadata;
212
+ success: true;
213
+ }
117
214
  export interface UpdateRequest {
118
215
  agentId?: string | null;
119
216
  aiCoveragePercent?: number;
@@ -175,7 +272,7 @@ export interface VerifyRequest {
175
272
  /**
176
273
  * Phone number in E.164 format.
177
274
  */
178
- phoneNumber?: string;
275
+ phoneNumber?: RaizPhoneNumber;
179
276
  }
180
277
  export interface VerifyResponse {
181
278
  data: RaizChannel;
@@ -1,31 +1,55 @@
1
1
  // Code generated by forge. DO NOT EDIT.
2
2
  /* eslint-disable */
3
3
  import { Transport, bytes, object, } from "../../_/index.js";
4
- import { RaizBusinessHoursCodec } from "../models.js";
4
+ import { RaizBusinessHoursCodec, } from "../models.js";
5
5
  import { RaizChannelCodec, RaizChannelPageCodec, } from "./models.js";
6
6
  export function createClient(options) {
7
7
  return bind(new Transport(options));
8
8
  }
9
9
  export function bind(transport) {
10
10
  return {
11
+ create: (request, options) => transport.send(CreateOperation, request, options),
12
+ delete: (request, options) => transport.send(DeleteOperation, request, options),
11
13
  get: (request, options) => transport.send(GetOperation, request, options),
12
14
  list: (request, options) => transport.send(ListOperation, request, options),
15
+ renewSetup: (request, options) => transport.send(RenewSetupOperation, request, options),
13
16
  update: (request, options) => transport.send(UpdateOperation, request, options),
14
17
  verify: (request, options) => transport.send(VerifyOperation, request, options),
15
18
  };
16
19
  }
20
+ const CreateOperation = {
21
+ method: "POST",
22
+ route: "/v1/raiz/channels/create",
23
+ body: "flat",
24
+ response: object([["data", null, () => RaizChannelCodec]]),
25
+ 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
+ };
27
+ const DeleteOperation = {
28
+ method: "DELETE",
29
+ route: "/v1/raiz/channels/delete",
30
+ body: "flat",
31
+ response: null,
32
+ 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 },
33
+ };
17
34
  const GetOperation = {
18
35
  method: "GET",
19
36
  route: "/v1/raiz/channels/get",
20
37
  query: { channelId: "channelId", expand: "expand" },
21
38
  response: object([["data", null, () => RaizChannelCodec]]),
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 },
39
+ 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 },
23
40
  };
24
41
  const ListOperation = {
25
42
  method: "GET",
26
43
  route: "/v1/raiz/channels",
27
44
  query: { cursor: "cursor", direction: "direction", limit: "limit", agentId: "agentId", channelType: "channelType", status: "status" },
28
45
  response: object([["data", null, () => RaizChannelPageCodec]]),
46
+ 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 },
47
+ };
48
+ const RenewSetupOperation = {
49
+ method: "POST",
50
+ route: "/v1/raiz/channels/renew-setup",
51
+ body: "flat",
52
+ response: object([["data", null, () => RaizChannelCodec]]),
29
53
  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
54
  };
31
55
  const UpdateOperation = {
@@ -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, GetRequest, GetResponse, ListRequest, ListResponse, UpdateRequest, UpdateResponse, VerifyRequest, VerifyResponse, } from "./client.js";
5
- export type { RaizChannel, RaizChannelAgent, RaizChannelPage, RaizChannelSummary, RaizWidgetAgentChoice, RaizWidgetClientTool, RaizWidgetField, RaizWidgetSettings, RaizWidgetSettingsInput, RaizWidgetTranslations, } from "./models.js";
4
+ export type { Client, ClientOptions, CreateRequest, CreateResponse, DeleteRequest, DeleteResponse, GetRequest, GetResponse, ListRequest, ListResponse, RenewSetupRequest, RenewSetupResponse, UpdateRequest, UpdateResponse, VerifyRequest, VerifyResponse, } from "./client.js";
5
+ export type { RaizChannel, RaizChannelAgent, RaizChannelPage, RaizWidgetAgentChoice, RaizWidgetClientTool, RaizWidgetCopy, RaizWidgetField, RaizWidgetSettings, RaizWidgetSettingsInput, RaizWidgetTranslations, } from "./models.js";
@@ -1,5 +1,5 @@
1
1
  import type { PageInfo } from "../../models.js";
2
- import { type RaizBusinessHours } from "../models.js";
2
+ import { type RaizBusinessHours, type RaizHttpsUrl } from "../models.js";
3
3
  export interface RaizChannel {
4
4
  address: string | null;
5
5
  agent: RaizChannelAgent | null;
@@ -91,7 +91,7 @@ export interface RaizChannelPage {
91
91
  /**
92
92
  * Items admitted by this resource contract within the verified organization.
93
93
  */
94
- data: RaizChannelSummary[];
94
+ data: RaizChannel[];
95
95
  /**
96
96
  * Discriminator for a resource list response.
97
97
  */
@@ -101,67 +101,6 @@ export interface RaizChannelPage {
101
101
  */
102
102
  pageInfo: PageInfo;
103
103
  }
104
- export interface RaizChannelSummary {
105
- address: string | null;
106
- agent: RaizChannelAgent | null;
107
- /**
108
- * Percentage of new inbound WhatsApp conversations assigned to AI. Zero keeps
109
- * conversations human-managed until explicitly activated. Existing
110
- * assignments stay unchanged.
111
- */
112
- aiCoveragePercent: number;
113
- businessHours: RaizBusinessHours | null;
114
- /**
115
- * `voice`: a phone number or the organization's own carrier, for calls.
116
- * `whatsapp`: a WhatsApp number. `web`: the chat widget on the organization's
117
- * sites.
118
- */
119
- channelType: "voice" | "whatsapp" | "web";
120
- /**
121
- * An instant in RFC 3339 format, in UTC.
122
- */
123
- createdAt: Temporal.Instant;
124
- /**
125
- * Channel id.
126
- */
127
- id: string;
128
- /**
129
- * Calls and messages from people are answered. Off: inbound traffic is
130
- * ignored (a web widget is switched off).
131
- */
132
- inboundEnabled: boolean;
133
- name: string | null;
134
- /**
135
- * The organization may start calls or WhatsApp conversations from this
136
- * channel.
137
- */
138
- outboundEnabled: boolean;
139
- /**
140
- * What the endpoint is: `phone` (a phone number: the platform's, or one on
141
- * the organization's own telephony account when `providerAccountId` is set),
142
- * `sip` (the organization's own number and carrier, over SIP), `whatsapp` (a
143
- * WhatsApp number) or `web` (the chat widget, served by Raíz).
144
- */
145
- provider: "phone" | "sip" | "whatsapp" | "web";
146
- providerAccountId: string | null;
147
- /**
148
- * Active with enabled traffic; WhatsApp outbound notifications do not need an
149
- * Agent.
150
- */
151
- ready: boolean;
152
- setupExpiresAt: Temporal.Instant | null;
153
- /**
154
- * `pending`: a WhatsApp number whose setup the customer has not finished.
155
- * `active`: connected. `degraded`: connected, but the last provider check
156
- * failed; `verifyChannel` checks again.
157
- */
158
- status: "pending" | "active" | "degraded";
159
- /**
160
- * An instant in RFC 3339 format, in UTC.
161
- */
162
- updatedAt: Temporal.Instant;
163
- version: number;
164
- }
165
104
  export interface RaizWidgetAgentChoice {
166
105
  /**
167
106
  * A text Agent of the same organization.
@@ -179,6 +118,19 @@ export interface RaizWidgetClientTool {
179
118
  type: "string" | "number" | "boolean";
180
119
  }[];
181
120
  }
121
+ export interface RaizWidgetCopy {
122
+ consentText?: string;
123
+ firstMessageLabel?: string;
124
+ formTitle?: string;
125
+ greeting?: string;
126
+ launcherLabel?: string;
127
+ submitLabel?: string;
128
+ subtitle?: string;
129
+ thankYou?: string;
130
+ title?: string;
131
+ welcomeText?: string;
132
+ welcomeTitle?: string;
133
+ }
182
134
  export interface RaizWidgetField {
183
135
  label: string;
184
136
  name: string;
@@ -213,7 +165,7 @@ export interface RaizWidgetSettings {
213
165
  assistantColor?: string;
214
166
  attachmentTypes?: ("image/png" | "image/jpeg" | "application/pdf" | "text/plain")[];
215
167
  attachmentsEnabled?: boolean;
216
- avatarUrl?: string | null;
168
+ avatarUrl?: RaizHttpsUrl | null;
217
169
  /**
218
170
  * A color in `#RRGGBB` form.
219
171
  */
@@ -241,7 +193,7 @@ export interface RaizWidgetSettings {
241
193
  font?: "arbol" | "system" | "serif" | "rounded" | "page" | "custom";
242
194
  fontFamily?: string;
243
195
  fontSize?: number;
244
- fontUrl?: string | null;
196
+ fontUrl?: RaizHttpsUrl | null;
245
197
  formTitle?: string;
246
198
  greeting?: string;
247
199
  /**
@@ -285,7 +237,7 @@ export interface RaizWidgetSettings {
285
237
  * A color in `#RRGGBB` form.
286
238
  */
287
239
  primaryColor?: string;
288
- privacyUrl?: string | null;
240
+ privacyUrl?: RaizHttpsUrl | null;
289
241
  /**
290
242
  * Also serve the widget on its own hosted page, outside any embedding site.
291
243
  */
@@ -355,7 +307,7 @@ export interface RaizWidgetSettingsInput {
355
307
  assistantColor?: string;
356
308
  attachmentTypes?: ("image/png" | "image/jpeg" | "application/pdf" | "text/plain")[];
357
309
  attachmentsEnabled?: boolean;
358
- avatarUrl?: string | null;
310
+ avatarUrl?: RaizHttpsUrl | null;
359
311
  /**
360
312
  * A color in `#RRGGBB` form.
361
313
  */
@@ -383,7 +335,7 @@ export interface RaizWidgetSettingsInput {
383
335
  font?: "arbol" | "system" | "serif" | "rounded" | "page" | "custom";
384
336
  fontFamily?: string;
385
337
  fontSize?: number;
386
- fontUrl?: string | null;
338
+ fontUrl?: RaizHttpsUrl | null;
387
339
  formTitle?: string;
388
340
  greeting?: string;
389
341
  /**
@@ -422,7 +374,7 @@ export interface RaizWidgetSettingsInput {
422
374
  * A color in `#RRGGBB` form.
423
375
  */
424
376
  primaryColor?: string;
425
- privacyUrl?: string | null;
377
+ privacyUrl?: RaizHttpsUrl | null;
426
378
  /**
427
379
  * Also serve the widget on its own hosted page, outside any embedding site.
428
380
  */
@@ -467,33 +419,8 @@ export interface RaizWidgetSettingsInput {
467
419
  welcomeTitle?: string;
468
420
  }
469
421
  export interface RaizWidgetTranslations {
470
- en?: {
471
- consentText?: string;
472
- firstMessageLabel?: string;
473
- formTitle?: string;
474
- greeting?: string;
475
- launcherLabel?: string;
476
- submitLabel?: string;
477
- subtitle?: string;
478
- thankYou?: string;
479
- title?: string;
480
- welcomeText?: string;
481
- welcomeTitle?: string;
482
- };
483
- es?: {
484
- consentText?: string;
485
- firstMessageLabel?: string;
486
- formTitle?: string;
487
- greeting?: string;
488
- launcherLabel?: string;
489
- submitLabel?: string;
490
- subtitle?: string;
491
- thankYou?: string;
492
- title?: string;
493
- welcomeText?: string;
494
- welcomeTitle?: string;
495
- };
422
+ en?: RaizWidgetCopy;
423
+ es?: RaizWidgetCopy;
496
424
  }
497
425
  export declare const RaizChannelCodec: import("../../_/codec.js").Codec;
498
426
  export declare const RaizChannelPageCodec: import("../../_/codec.js").Codec;
499
- export declare const RaizChannelSummaryCodec: import("../../_/codec.js").Codec;
@@ -1,7 +1,7 @@
1
1
  // Code generated by forge. DO NOT EDIT.
2
2
  /* eslint-disable */
3
3
  import { array, instant, object } from "../../_/index.js";
4
- import { RaizBusinessHoursCodec } from "../models.js";
4
+ import { RaizBusinessHoursCodec, } from "../models.js";
5
5
  export const RaizChannelCodec = object([
6
6
  ["businessHours", null, () => RaizBusinessHoursCodec],
7
7
  ["createdAt", null, instant],
@@ -10,11 +10,5 @@ export const RaizChannelCodec = object([
10
10
  ["updatedAt", null, instant],
11
11
  ]);
12
12
  export const RaizChannelPageCodec = object([
13
- ["data", null, array(() => RaizChannelSummaryCodec)],
14
- ]);
15
- export const RaizChannelSummaryCodec = object([
16
- ["businessHours", null, () => RaizBusinessHoursCodec],
17
- ["createdAt", null, instant],
18
- ["setupExpiresAt", null, instant],
19
- ["updatedAt", null, instant],
13
+ ["data", null, array(() => RaizChannelCodec)],
20
14
  ]);
@@ -1,5 +1,6 @@
1
1
  import { type BaseClientOptions, Transport } from "../_/index.js";
2
2
  import { type Client as AgentsClient } from "./agents/client.js";
3
+ import { type Client as BulletinsClient } from "./bulletins/client.js";
3
4
  import { type Client as CampaignsClient } from "./campaigns/client.js";
4
5
  import { type Client as ChangesClient } from "./changes/client.js";
5
6
  import { type Client as ChannelsClient } from "./channels/client.js";
@@ -27,6 +28,7 @@ export interface ClientOptions extends BaseClientOptions {
27
28
  }
28
29
  export interface Client {
29
30
  readonly agents: AgentsClient;
31
+ readonly bulletins: BulletinsClient;
30
32
  readonly campaigns: CampaignsClient;
31
33
  readonly changes: ChangesClient;
32
34
  readonly channels: ChannelsClient;
@@ -2,6 +2,7 @@
2
2
  /* eslint-disable */
3
3
  import { Transport } from "../_/index.js";
4
4
  import { bind as bindAgents, } from "./agents/client.js";
5
+ import { bind as bindBulletins, } from "./bulletins/client.js";
5
6
  import { bind as bindCampaigns, } from "./campaigns/client.js";
6
7
  import { bind as bindChanges, } from "./changes/client.js";
7
8
  import { bind as bindChannels, } from "./channels/client.js";
@@ -26,6 +27,7 @@ export function createClient(options) {
26
27
  }
27
28
  export function bind(transport) {
28
29
  let agentsClient;
30
+ let bulletinsClient;
29
31
  let campaignsClient;
30
32
  let changesClient;
31
33
  let channelsClient;
@@ -49,6 +51,9 @@ export function bind(transport) {
49
51
  get agents() {
50
52
  return (agentsClient ??= bindAgents(transport));
51
53
  },
54
+ get bulletins() {
55
+ return (bulletinsClient ??= bindBulletins(transport));
56
+ },
52
57
  get campaigns() {
53
58
  return (campaignsClient ??= bindCampaigns(transport));
54
59
  },
@@ -21,21 +21,21 @@ const CountOperation = {
21
21
  route: "/v1/raiz/contacts/count",
22
22
  query: { agentId: "agentId", channelType: "channelType", handling: "handling", lastContactedAfter: "lastContactedAfter", q: "q" },
23
23
  response: null,
24
- 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 },
24
+ 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 },
25
25
  };
26
26
  const CreateOperation = {
27
27
  method: "POST",
28
28
  route: "/v1/raiz/contacts/create",
29
29
  body: "flat",
30
30
  response: object([["data", null, () => RaizContactCodec]]),
31
- 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 },
31
+ 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 },
32
32
  };
33
33
  const GetOperation = {
34
34
  method: "GET",
35
35
  route: "/v1/raiz/contacts/get",
36
36
  query: { contactId: "contactId", expand: "expand", timelineCursor: "timelineCursor", timelineDirection: "timelineDirection", timelineLimit: "timelineLimit" },
37
37
  response: object([["data", null, () => RaizContactCodec]]),
38
- 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 },
38
+ 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 },
39
39
  };
40
40
  const ImportOperation = {
41
41
  method: "POST",
@@ -43,19 +43,19 @@ const ImportOperation = {
43
43
  body: "flat",
44
44
  request: object([["file", null, object([["data", null, bytes]])]]),
45
45
  response: object([["data", null, () => RaizTaskCodec]]),
46
- 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 },
46
+ 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 },
47
47
  };
48
48
  const ListOperation = {
49
49
  method: "GET",
50
50
  route: "/v1/raiz/contacts",
51
51
  query: { cursor: "cursor", direction: "direction", limit: "limit", agentId: "agentId", channelType: "channelType", handling: "handling", lastContactedAfter: "lastContactedAfter", q: "q", sort: "sort" },
52
52
  response: object([["data", null, () => RaizContactPageCodec]]),
53
- 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 },
53
+ 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 },
54
54
  };
55
55
  const UpdateOperation = {
56
56
  method: "PATCH",
57
57
  route: "/v1/raiz/contacts/update",
58
58
  body: "flat",
59
59
  response: object([["data", null, () => RaizContactCodec]]),
60
- 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 },
60
+ 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 },
61
61
  };
@@ -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, CountRequest, CountResponse, CreateRequest, CreateResponse, GetRequest, GetResponse, ImportRequest, ImportResponse, ListRequest, ListResponse, UpdateRequest, UpdateResponse, } from "./client.js";
5
- export type { RaizContact, RaizContactIdentifierInput, RaizContactLastConversation, RaizContactPage, RaizContactPointInput, RaizContactSummary, RaizContactTimelinePage, RaizPostalAddress, } from "./models.js";
5
+ export type { RaizContact, RaizContactIdentifierInput, RaizContactLastConversation, RaizContactPage, RaizContactPointInput, RaizContactTimelinePage, RaizPostalAddress, } 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 RaizEmailAddress, type RaizFact, type RaizPhoneNumber } from "../models.js";
3
3
  export interface RaizContact {
4
4
  conversationCount: number;
5
5
  /**
@@ -106,7 +106,7 @@ export interface RaizContactPage {
106
106
  /**
107
107
  * Items admitted by this resource contract within the verified organization.
108
108
  */
109
- data: RaizContactSummary[];
109
+ data: RaizContact[];
110
110
  /**
111
111
  * Discriminator for a resource list response.
112
112
  */
@@ -117,12 +117,12 @@ export interface RaizContactPage {
117
117
  pageInfo: PageInfo;
118
118
  }
119
119
  export type RaizContactPointInput = {
120
- address: string;
120
+ address: RaizPhoneNumber;
121
121
  kind: "phone";
122
122
  label?: string | null;
123
123
  preferred?: boolean;
124
124
  } | {
125
- address: string;
125
+ address: RaizEmailAddress;
126
126
  kind: "email";
127
127
  label?: string | null;
128
128
  preferred?: boolean;
@@ -132,41 +132,6 @@ export type RaizContactPointInput = {
132
132
  label?: string | null;
133
133
  preferred?: boolean;
134
134
  };
135
- export interface RaizContactSummary {
136
- conversationCount: number;
137
- /**
138
- * An instant in RFC 3339 format, in UTC.
139
- */
140
- createdAt: Temporal.Instant;
141
- email: string | null;
142
- familyName: string | null;
143
- fullName: string | null;
144
- givenName: string | null;
145
- /**
146
- * Contact id.
147
- */
148
- id: string;
149
- lastContactedAt: Temporal.Instant | null;
150
- lastConversation: RaizContactLastConversation | null;
151
- /**
152
- * Your own keys and labels for this resource (up to 50 keys of 40 characters;
153
- * values up to 500 characters). Raíz never interprets them.
154
- */
155
- metadata: {
156
- [key: string]: unknown;
157
- };
158
- nameAuthor: "person" | "ai" | "system" | "import" | "provider" | null;
159
- phone: string | null;
160
- postalAddresses: RaizPostalAddress[];
161
- profileName: string | null;
162
- summary: string | null;
163
- summaryAuthor: "person" | "ai" | "system" | "import" | "provider" | null;
164
- /**
165
- * An instant in RFC 3339 format, in UTC.
166
- */
167
- updatedAt: Temporal.Instant;
168
- version: number;
169
- }
170
135
  export interface RaizContactTimelinePage {
171
136
  /**
172
137
  * Items admitted by this resource contract within the verified organization.
@@ -202,5 +167,4 @@ export interface RaizPostalAddress {
202
167
  export declare const RaizContactCodec: import("../../_/codec.js").Codec;
203
168
  export declare const RaizContactLastConversationCodec: import("../../_/codec.js").Codec;
204
169
  export declare const RaizContactPageCodec: import("../../_/codec.js").Codec;
205
- export declare const RaizContactSummaryCodec: import("../../_/codec.js").Codec;
206
170
  export declare const RaizContactTimelinePageCodec: import("../../_/codec.js").Codec;
@@ -1,7 +1,7 @@
1
1
  // Code generated by forge. DO NOT EDIT.
2
2
  /* eslint-disable */
3
3
  import { array, instant, object } from "../../_/index.js";
4
- import { RaizFactCodec } from "../models.js";
4
+ import { RaizFactCodec, } from "../models.js";
5
5
  export const RaizContactCodec = object([
6
6
  ["createdAt", null, instant],
7
7
  ["facts", null, array(() => RaizFactCodec)],
@@ -16,13 +16,7 @@ export const RaizContactLastConversationCodec = object([
16
16
  ["startedAt", null, instant],
17
17
  ]);
18
18
  export const RaizContactPageCodec = object([
19
- ["data", null, array(() => RaizContactSummaryCodec)],
20
- ]);
21
- export const RaizContactSummaryCodec = object([
22
- ["createdAt", null, instant],
23
- ["lastContactedAt", null, instant],
24
- ["lastConversation", null, () => RaizContactLastConversationCodec],
25
- ["updatedAt", null, instant],
19
+ ["data", null, array(() => RaizContactCodec)],
26
20
  ]);
27
21
  export const RaizContactTimelinePageCodec = object([
28
22
  ["data", null, array(object([["occurredAt", null, instant]]))],