@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
@@ -26,14 +26,14 @@ const GetOperation = {
26
26
  route: "/v1/raiz/agents/get",
27
27
  query: { agentId: "agentId" },
28
28
  response: object([["data", null, () => RaizAgentCodec]]),
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 ListOperation = {
32
32
  method: "GET",
33
33
  route: "/v1/raiz/agents",
34
34
  query: { cursor: "cursor", direction: "direction", limit: "limit", modality: "modality", q: "q", status: "status" },
35
35
  response: object([["data", null, () => RaizAgentPageCodec]]),
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 UpdateOperation = {
39
39
  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, UpdateRequest, UpdateResponse, } from "./client.js";
5
- export type { RaizAgent, RaizAgentGreeting, RaizAgentIntegrationToolInput, RaizAgentModelTrial, RaizAgentPage, RaizAgentSettings, RaizAgentSettingsInput, RaizAgentSummary, RaizAgentTurnPolicy, RaizAgentVoiceSettings, } from "./models.js";
5
+ export type { RaizAgent, RaizAgentGreeting, RaizAgentIntegrationToolInput, RaizAgentModelTrial, RaizAgentPage, RaizAgentSettings, RaizAgentSettingsInput, RaizAgentTurnPolicy, RaizAgentVoiceSettings, } from "./models.js";
@@ -126,7 +126,7 @@ export interface RaizAgentPage {
126
126
  /**
127
127
  * Items admitted by this resource contract within the verified organization.
128
128
  */
129
- data: RaizAgentSummary[];
129
+ data: RaizAgent[];
130
130
  /**
131
131
  * Discriminator for a resource list response.
132
132
  */
@@ -181,50 +181,6 @@ export interface RaizAgentSettingsInput {
181
181
  toolDiscovery?: boolean | null;
182
182
  voice?: RaizAgentVoiceSettings | null;
183
183
  }
184
- export interface RaizAgentSummary {
185
- channelCount: number;
186
- /**
187
- * An instant in RFC 3339 format, in UTC.
188
- */
189
- createdAt: Temporal.Instant;
190
- description: string | null;
191
- firstMessage: string | null;
192
- /**
193
- * Agent id.
194
- */
195
- id: string;
196
- /**
197
- * BCP 47 language tag.
198
- */
199
- language: string;
200
- /**
201
- * `voice`: phone calls. `text`: WhatsApp and web chat.
202
- */
203
- modality: "voice" | "text";
204
- name: string;
205
- /**
206
- * Whether the Agent can hold conversations: active, with instructions and,
207
- * for voice, published for calls.
208
- */
209
- ready: boolean;
210
- /**
211
- * A paused Agent answers nothing and places no calls.
212
- */
213
- status: "active" | "paused";
214
- syncErrorCode: string | null;
215
- /**
216
- * Whether calls already use the current version (it is published on the
217
- * Agent's voice channels). Always true for text Agents.
218
- */
219
- synced: boolean;
220
- timeZone: string | null;
221
- toolCount: number;
222
- /**
223
- * An instant in RFC 3339 format, in UTC.
224
- */
225
- updatedAt: Temporal.Instant;
226
- version: number;
227
- }
228
184
  export interface RaizAgentTurnPolicy {
229
185
  /**
230
186
  * Output tokens per model call, reasoning included. Default 4096.
@@ -282,4 +238,3 @@ export interface RaizAgentVoiceSettings {
282
238
  export declare const RaizAgentCodec: import("../../_/codec.js").Codec;
283
239
  export declare const RaizAgentPageCodec: import("../../_/codec.js").Codec;
284
240
  export declare const RaizAgentSettingsInputCodec: import("../../_/codec.js").Codec;
285
- export declare const RaizAgentSummaryCodec: import("../../_/codec.js").Codec;
@@ -7,12 +7,8 @@ export const RaizAgentCodec = object([
7
7
  ["updatedAt", null, instant],
8
8
  ]);
9
9
  export const RaizAgentPageCodec = object([
10
- ["data", null, array(() => RaizAgentSummaryCodec)],
10
+ ["data", null, array(() => RaizAgentCodec)],
11
11
  ]);
12
12
  export const RaizAgentSettingsInputCodec = object([
13
13
  ["businessHours", null, () => RaizBusinessHoursCodec],
14
14
  ]);
15
- export const RaizAgentSummaryCodec = object([
16
- ["createdAt", null, instant],
17
- ["updatedAt", null, instant],
18
- ]);
@@ -0,0 +1,182 @@
1
+ import { type BaseClientOptions, type RequestOptions, Transport } from "../../_/index.js";
2
+ import type { DeletedObject, ResponseMetadata } from "../../models.js";
3
+ import { type RaizBulletin, type RaizBulletinPage } from "./models.js";
4
+ export interface ClientOptions extends BaseClientOptions {
5
+ /**
6
+ * The URL the paths of the API are relative to.
7
+ */
8
+ baseUrl: string;
9
+ }
10
+ export interface Client {
11
+ /**
12
+ * Post a bulletin
13
+ *
14
+ * Post a bulletin: something happening now that the organization's Agents
15
+ * must apply on calls, WhatsApp and web chat while it lasts (for example:
16
+ * there is no nutrition service; no appointments at the North site for four
17
+ * days; closed on Monday the 26th; a promotion). Write `text` as you would
18
+ * tell the Agents, including what they should offer instead. Omit `agentId`
19
+ * for every Agent, or name one Agent. Agents apply it from their next reply
20
+ * or call once `startsAt` (default now) is reached, until `endsAt` (omit it
21
+ * for no end). Resolve phrases such as 'for four days' or 'until Friday' in
22
+ * the organization's time zone (`get_organization`), ending whole days at
23
+ * local midnight. No Agent reads a bulletin before it starts: for Agents to
24
+ * know ahead (so they book nothing on a closed day), start it now and write
25
+ * the dates in the text. Fails with BULLETIN_PERIOD_INVALID when it would end
26
+ * before it starts or is already over, and BULLETIN_LIMIT_REACHED at 30
27
+ * bulletins in force or scheduled.
28
+ */
29
+ create(request: CreateRequest, options?: RequestOptions): Promise<CreateResponse>;
30
+ /**
31
+ * Delete a bulletin
32
+ *
33
+ * Delete a bulletin that was a mistake or is no longer wanted: Agents stop
34
+ * applying it from their next reply or call. The history keeps who deleted it
35
+ * and when. To keep it listed as ended instead, set its `endsAt` to now with
36
+ * `update_bulletin`.
37
+ */
38
+ delete(request: DeleteRequest, options?: RequestOptions): Promise<DeleteResponse>;
39
+ /**
40
+ * Get a bulletin
41
+ *
42
+ * Read one bulletin: its text, the Agent that applies it (null for every
43
+ * Agent), its period and its status.
44
+ */
45
+ get(request: GetRequest, options?: RequestOptions): Promise<GetResponse>;
46
+ /**
47
+ * List bulletins
48
+ *
49
+ * List the organization's bulletins (Settings → Bulletins in the Dashboard;
50
+ * people may call them novedades, avisos or eventos): what is happening now
51
+ * that its Agents apply while it lasts, such as a service that is not
52
+ * available, days without appointments at a site, a closed day or a
53
+ * promotion. Default: those in force (`active`) and those not started yet
54
+ * (`scheduled`); `status=ended` lists ended ones. `agentId` lists what one
55
+ * Agent applies (its own and those for every Agent); `q` searches the text.
56
+ * Use it to find the bulletin a person means before changing or deleting it.
57
+ */
58
+ list(request?: ListRequest, options?: RequestOptions): Promise<ListResponse>;
59
+ /**
60
+ * Update a bulletin
61
+ *
62
+ * Change a bulletin: its text, its Agent (null for every Agent), its start or
63
+ * its end. Omitted fields stay. To end one now, set `endsAt` to the current
64
+ * instant; a scheduled one is deleted instead. Agents apply the change from
65
+ * their next reply or call.
66
+ */
67
+ update(request: UpdateRequest, options?: RequestOptions): Promise<UpdateResponse>;
68
+ }
69
+ export declare function createClient(options: ClientOptions): Client;
70
+ export declare function bind(transport: Transport): Client;
71
+ export interface CreateRequest {
72
+ agentId?: string | null;
73
+ /**
74
+ * When Agents stop applying it, later than its start and than now. Omit it or
75
+ * send null to keep it until it is deleted.
76
+ */
77
+ endsAt?: Temporal.Instant | null;
78
+ /**
79
+ * When Agents start applying it; default now. No Agent reads it before. For
80
+ * Agents to know ahead (so they book no appointment on a closed day), start
81
+ * it now and write the dates in the text.
82
+ */
83
+ startsAt?: Temporal.Instant;
84
+ /**
85
+ * What is happening and what the Agents should do about it, written as you
86
+ * would tell them. One situation per bulletin; long reference material
87
+ * belongs in Knowledge.
88
+ */
89
+ text: string;
90
+ }
91
+ export interface CreateResponse {
92
+ data: RaizBulletin;
93
+ error: null;
94
+ metadata: ResponseMetadata;
95
+ success: true;
96
+ }
97
+ export interface DeleteRequest {
98
+ /**
99
+ * Bulletin id.
100
+ */
101
+ bulletinId: string;
102
+ }
103
+ export interface DeleteResponse {
104
+ data: DeletedObject;
105
+ error: null;
106
+ metadata: ResponseMetadata;
107
+ success: true;
108
+ }
109
+ export interface GetRequest {
110
+ /**
111
+ * Bulletin id.
112
+ */
113
+ bulletinId: string;
114
+ }
115
+ export interface GetResponse {
116
+ data: RaizBulletin;
117
+ error: null;
118
+ metadata: ResponseMetadata;
119
+ success: true;
120
+ }
121
+ export interface ListRequest {
122
+ /**
123
+ * Opaque cursor returned by pageInfo; omit it to request the first page.
124
+ */
125
+ cursor?: string;
126
+ /**
127
+ * Direction to traverse the stable keyset ordering from the supplied cursor.
128
+ */
129
+ direction?: "forward" | "backward";
130
+ /**
131
+ * Maximum items returned in one page. Defaults to 25; larger reads require
132
+ * another cursor.
133
+ */
134
+ limit?: number;
135
+ /**
136
+ * Only the bulletins this Agent applies: its own and those for every Agent.
137
+ */
138
+ agentId?: string;
139
+ /**
140
+ * Text in the bulletin, ignoring case.
141
+ */
142
+ q?: string;
143
+ /**
144
+ * Comma-separated statuses to list. Default `scheduled,active`; ended
145
+ * bulletins appear only when asked for.
146
+ */
147
+ status?: string;
148
+ }
149
+ export interface ListResponse {
150
+ data: RaizBulletinPage;
151
+ error: null;
152
+ metadata: ResponseMetadata;
153
+ success: true;
154
+ }
155
+ export interface UpdateRequest {
156
+ agentId?: string | null;
157
+ /**
158
+ * Bulletin id.
159
+ */
160
+ bulletinId: string;
161
+ /**
162
+ * When Agents stop applying it, later than its start; send the current
163
+ * instant to end it now, or null to keep it until it is deleted.
164
+ */
165
+ endsAt?: Temporal.Instant | null;
166
+ /**
167
+ * When Agents start applying it.
168
+ */
169
+ startsAt?: Temporal.Instant;
170
+ /**
171
+ * What is happening and what the Agents should do about it, written as you
172
+ * would tell them. One situation per bulletin; long reference material
173
+ * belongs in Knowledge.
174
+ */
175
+ text?: string;
176
+ }
177
+ export interface UpdateResponse {
178
+ data: RaizBulletin;
179
+ error: null;
180
+ metadata: ResponseMetadata;
181
+ success: true;
182
+ }
@@ -0,0 +1,53 @@
1
+ // Code generated by forge. DO NOT EDIT.
2
+ /* eslint-disable */
3
+ import { Transport, instant, object, } from "../../_/index.js";
4
+ import { RaizBulletinCodec, RaizBulletinPageCodec, } from "./models.js";
5
+ export function createClient(options) {
6
+ return bind(new Transport(options));
7
+ }
8
+ export function bind(transport) {
9
+ return {
10
+ create: (request, options) => transport.send(CreateOperation, request, options),
11
+ delete: (request, options) => transport.send(DeleteOperation, request, options),
12
+ get: (request, options) => transport.send(GetOperation, request, options),
13
+ list: (request, options) => transport.send(ListOperation, request, options),
14
+ update: (request, options) => transport.send(UpdateOperation, request, options),
15
+ };
16
+ }
17
+ const CreateOperation = {
18
+ method: "POST",
19
+ route: "/v1/raiz/bulletins/create",
20
+ body: "flat",
21
+ request: object([["endsAt", null, instant], ["startsAt", null, instant]]),
22
+ response: object([["data", null, () => RaizBulletinCodec]]),
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 },
24
+ };
25
+ const DeleteOperation = {
26
+ method: "DELETE",
27
+ route: "/v1/raiz/bulletins/delete",
28
+ body: "flat",
29
+ response: null,
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
+ };
32
+ const GetOperation = {
33
+ method: "GET",
34
+ route: "/v1/raiz/bulletins/get",
35
+ query: { bulletinId: "bulletinId" },
36
+ response: object([["data", null, () => RaizBulletinCodec]]),
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
+ };
39
+ const ListOperation = {
40
+ method: "GET",
41
+ route: "/v1/raiz/bulletins",
42
+ query: { cursor: "cursor", direction: "direction", limit: "limit", agentId: "agentId", q: "q", status: "status" },
43
+ response: object([["data", null, () => RaizBulletinPageCodec]]),
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
+ };
46
+ const UpdateOperation = {
47
+ method: "PATCH",
48
+ route: "/v1/raiz/bulletins/update",
49
+ body: "flat",
50
+ request: object([["endsAt", null, instant], ["startsAt", null, instant]]),
51
+ response: object([["data", null, () => RaizBulletinCodec]]),
52
+ 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
+ };
@@ -0,0 +1,5 @@
1
+ export { ApiError } from "../../_/index.js";
2
+ export type { RequestOptions } from "../../_/index.js";
3
+ export { createClient } from "./client.js";
4
+ export type { Client, ClientOptions, CreateRequest, CreateResponse, DeleteRequest, DeleteResponse, GetRequest, GetResponse, ListRequest, ListResponse, UpdateRequest, UpdateResponse, } from "./client.js";
5
+ export type { RaizBulletin, RaizBulletinAgent, RaizBulletinPage, } from "./models.js";
@@ -0,0 +1,4 @@
1
+ // Code generated by forge. DO NOT EDIT.
2
+ /* eslint-disable */
3
+ export { ApiError } from "../../_/index.js";
4
+ export { createClient } from "./client.js";
@@ -0,0 +1,53 @@
1
+ import type { PageInfo } from "../../models.js";
2
+ export interface RaizBulletin {
3
+ agent: RaizBulletinAgent | null;
4
+ /**
5
+ * An instant in RFC 3339 format, in UTC.
6
+ */
7
+ createdAt: Temporal.Instant;
8
+ endsAt: Temporal.Instant | null;
9
+ /**
10
+ * Bulletin id.
11
+ */
12
+ id: string;
13
+ /**
14
+ * When Agents start applying it.
15
+ */
16
+ startsAt: Temporal.Instant;
17
+ /**
18
+ * `scheduled`: it has not started and no Agent reads it yet. `active`: Agents
19
+ * apply it. `ended`: its period is over and no Agent reads it.
20
+ */
21
+ status: "scheduled" | "active" | "ended";
22
+ /**
23
+ * What is happening, in the words the Agents read.
24
+ */
25
+ text: string;
26
+ /**
27
+ * An instant in RFC 3339 format, in UTC.
28
+ */
29
+ updatedAt: Temporal.Instant;
30
+ }
31
+ export interface RaizBulletinAgent {
32
+ /**
33
+ * Agent id.
34
+ */
35
+ id: string;
36
+ name: string;
37
+ }
38
+ export interface RaizBulletinPage {
39
+ /**
40
+ * Items admitted by this resource contract within the verified organization.
41
+ */
42
+ data: RaizBulletin[];
43
+ /**
44
+ * Discriminator for a resource list response.
45
+ */
46
+ object: "list";
47
+ /**
48
+ * Opaque navigation cursors for this page’s stable keyset order.
49
+ */
50
+ pageInfo: PageInfo;
51
+ }
52
+ export declare const RaizBulletinCodec: import("../../_/codec.js").Codec;
53
+ export declare const RaizBulletinPageCodec: import("../../_/codec.js").Codec;
@@ -0,0 +1,12 @@
1
+ // Code generated by forge. DO NOT EDIT.
2
+ /* eslint-disable */
3
+ import { array, instant, object } from "../../_/index.js";
4
+ export const RaizBulletinCodec = object([
5
+ ["createdAt", null, instant],
6
+ ["endsAt", null, instant],
7
+ ["startsAt", null, instant],
8
+ ["updatedAt", null, instant],
9
+ ]);
10
+ export const RaizBulletinPageCodec = object([
11
+ ["data", null, array(() => RaizBulletinCodec)],
12
+ ]);
@@ -26,14 +26,14 @@ const GetOperation = {
26
26
  route: "/v1/raiz/campaigns/get",
27
27
  query: { campaignId: "campaignId", expand: "expand", recipientsCursor: "recipientsCursor", recipientsDirection: "recipientsDirection", recipientsLimit: "recipientsLimit" },
28
28
  response: object([["data", null, () => RaizCampaignCodec]]),
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 ListOperation = {
32
32
  method: "GET",
33
33
  route: "/v1/raiz/campaigns",
34
34
  query: { cursor: "cursor", direction: "direction", limit: "limit", agentId: "agentId", status: "status" },
35
35
  response: object([["data", null, () => RaizCampaignPageCodec]]),
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 UpdateOperation = {
39
39
  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, UpdateRequest, UpdateResponse, } from "./client.js";
5
- export type { RaizCampaign, RaizCampaignPage, RaizCampaignProgress, RaizCampaignRecipientInput, RaizCampaignRecipientPage, RaizCampaignSummary, } from "./models.js";
5
+ export type { RaizCampaign, RaizCampaignPage, RaizCampaignProgress, RaizCampaignRecipientInput, RaizCampaignRecipientPage, } from "./models.js";
@@ -1,5 +1,5 @@
1
1
  import type { PageInfo } from "../../models.js";
2
- import type { RaizContactHoursWindow } from "../models.js";
2
+ import type { RaizContactHoursWindow, RaizPhoneNumber } from "../models.js";
3
3
  export interface RaizCampaign {
4
4
  /**
5
5
  * Agent id.
@@ -61,7 +61,7 @@ export interface RaizCampaignPage {
61
61
  /**
62
62
  * Items admitted by this resource contract within the verified organization.
63
63
  */
64
- data: RaizCampaignSummary[];
64
+ data: RaizCampaign[];
65
65
  /**
66
66
  * Discriminator for a resource list response.
67
67
  */
@@ -86,7 +86,7 @@ export interface RaizCampaignRecipientInput {
86
86
  /**
87
87
  * Phone number in E.164 format.
88
88
  */
89
- address: string;
89
+ address: RaizPhoneNumber;
90
90
  /**
91
91
  * The contact the call is about. Omitted: the contact that owns `address`,
92
92
  * created when the organization has none.
@@ -97,7 +97,9 @@ export interface RaizCampaignRecipientInput {
97
97
  /**
98
98
  * Values for the `{{name}}` variables the Agent's instructions, first message
99
99
  * or this campaign's texts reference. Raíz always provides `contact_name`,
100
- * `contact_given_name`, `contact_id`, `contact_phone` and `conversation_id`.
100
+ * `contact_given_name`, `contact_id`, `contact_phone`, `conversation_id` and
101
+ * `bulletins` (the business bulletins in force), which a recipient's values
102
+ * never replace.
101
103
  */
102
104
  variables?: {
103
105
  [key: string]: unknown;
@@ -138,59 +140,6 @@ export interface RaizCampaignRecipientPage {
138
140
  */
139
141
  pageInfo: PageInfo;
140
142
  }
141
- export interface RaizCampaignSummary {
142
- /**
143
- * Agent id.
144
- */
145
- agentId: string;
146
- channelId: string | null;
147
- /**
148
- * When calls may start, in the campaign's time zone. Empty: any time.
149
- */
150
- contactHours: RaizContactHoursWindow[];
151
- /**
152
- * An instant in RFC 3339 format, in UTC.
153
- */
154
- createdAt: Temporal.Instant;
155
- endedAt: Temporal.Instant | null;
156
- firstMessage: string | null;
157
- /**
158
- * Campaign id.
159
- */
160
- id: string;
161
- instructions: string | null;
162
- maxAttempts: number;
163
- /**
164
- * Your own keys and labels for this resource (up to 50 keys of 40 characters;
165
- * values up to 500 characters). Raíz never interprets them.
166
- */
167
- metadata: {
168
- [key: string]: unknown;
169
- };
170
- name: string;
171
- /**
172
- * How many recipients are in each state.
173
- */
174
- progress: RaizCampaignProgress;
175
- retryAfterMinutes: number;
176
- retryOn: ("no_answer" | "failure")[];
177
- scheduledEndAt: Temporal.Instant | null;
178
- scheduledStartAt: Temporal.Instant | null;
179
- startedAt: Temporal.Instant | null;
180
- /**
181
- * `queued`: not started yet (or its start is scheduled). `running`: calling
182
- * due recipients. `paused`: started, then paused; calls in progress finish.
183
- * `completed`: no recipient is left to call.
184
- */
185
- status: "queued" | "running" | "paused" | "completed" | "cancelled" | "failed";
186
- timeZone: string;
187
- /**
188
- * An instant in RFC 3339 format, in UTC.
189
- */
190
- updatedAt: Temporal.Instant;
191
- version: number;
192
- }
193
143
  export declare const RaizCampaignCodec: import("../../_/codec.js").Codec;
194
144
  export declare const RaizCampaignPageCodec: import("../../_/codec.js").Codec;
195
145
  export declare const RaizCampaignRecipientPageCodec: import("../../_/codec.js").Codec;
196
- export declare const RaizCampaignSummaryCodec: import("../../_/codec.js").Codec;
@@ -11,16 +11,8 @@ export const RaizCampaignCodec = object([
11
11
  ["updatedAt", null, instant],
12
12
  ]);
13
13
  export const RaizCampaignPageCodec = object([
14
- ["data", null, array(() => RaizCampaignSummaryCodec)],
14
+ ["data", null, array(() => RaizCampaignCodec)],
15
15
  ]);
16
16
  export const RaizCampaignRecipientPageCodec = object([
17
17
  ["data", null, array(object([["createdAt", null, instant], ["lastAttempt", null, object([["startedAt", null, instant]])], ["nextAttemptAt", null, instant], ["updatedAt", null, instant]]))],
18
18
  ]);
19
- export const RaizCampaignSummaryCodec = object([
20
- ["createdAt", null, instant],
21
- ["endedAt", null, instant],
22
- ["scheduledEndAt", null, instant],
23
- ["scheduledStartAt", null, instant],
24
- ["startedAt", null, instant],
25
- ["updatedAt", null, instant],
26
- ]);
@@ -15,5 +15,5 @@ const ListOperation = {
15
15
  route: "/v1/raiz/changes",
16
16
  query: { cursor: "cursor", direction: "direction", limit: "limit", authorId: "authorId", contactId: "contactId", createdAfter: "createdAfter", createdBefore: "createdBefore", resourceId: "resourceId", resourceType: "resourceType" },
17
17
  response: object([["data", null, () => RaizChangePageCodec]]),
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
  };
@@ -30,8 +30,8 @@ export interface RaizChange {
30
30
  /**
31
31
  * What changed: `contact`, `contact_point`, `contact_identifier`, `agent`,
32
32
  * `agent_tool` (its id is the Agent's), `channel`, `definition`,
33
- * `knowledge_document`, `campaign`, `suppression`, `provider_account`,
34
- * `fact`, `task` (a person cancelled or retried it).
33
+ * `knowledge_document`, `campaign`, `suppression`, `bulletin`,
34
+ * `provider_account`, `fact`, `task` (a person cancelled or retried it).
35
35
  */
36
36
  resourceType: string;
37
37
  sourceId: string | null;
@@ -1,6 +1,6 @@
1
1
  import { type BaseClientOptions, type RequestOptions, Transport } from "../../_/index.js";
2
2
  import type { ResponseMetadata } from "../../models.js";
3
- import { type RaizBusinessHours } 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
  /**
@@ -175,7 +175,7 @@ export interface VerifyRequest {
175
175
  /**
176
176
  * Phone number in E.164 format.
177
177
  */
178
- phoneNumber?: string;
178
+ phoneNumber?: RaizPhoneNumber;
179
179
  }
180
180
  export interface VerifyResponse {
181
181
  data: RaizChannel;
@@ -1,7 +1,7 @@
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));
@@ -19,14 +19,14 @@ const GetOperation = {
19
19
  route: "/v1/raiz/channels/get",
20
20
  query: { channelId: "channelId", expand: "expand" },
21
21
  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 },
22
+ 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
23
  };
24
24
  const ListOperation = {
25
25
  method: "GET",
26
26
  route: "/v1/raiz/channels",
27
27
  query: { cursor: "cursor", direction: "direction", limit: "limit", agentId: "agentId", channelType: "channelType", status: "status" },
28
28
  response: object([["data", null, () => RaizChannelPageCodec]]),
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 UpdateOperation = {
32
32
  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, 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";
5
+ export type { RaizChannel, RaizChannelAgent, RaizChannelPage, RaizWidgetAgentChoice, RaizWidgetClientTool, RaizWidgetCopy, RaizWidgetField, RaizWidgetSettings, RaizWidgetSettingsInput, RaizWidgetTranslations, } from "./models.js";