@arbol-ai/sdk 5.44.0 → 5.45.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 (231) hide show
  1. package/dist/account/client.d.ts +0 -16
  2. package/dist/account/client.js +0 -40
  3. package/dist/account/index.d.ts +1 -1
  4. package/dist/account/models.d.ts +0 -93
  5. package/dist/agenda/appointments/client.d.ts +14 -243
  6. package/dist/agenda/appointments/client.js +18 -17
  7. package/dist/agenda/appointments/index.d.ts +1 -1
  8. package/dist/agenda/appointments/models.d.ts +612 -2
  9. package/dist/agenda/appointments/models.js +14 -2
  10. package/dist/agenda/availability/client.d.ts +2 -7
  11. package/dist/agenda/availability/client.js +5 -4
  12. package/dist/agenda/availability/index.d.ts +1 -0
  13. package/dist/agenda/availability/models.d.ts +67 -0
  14. package/dist/agenda/bookingLocations/client.d.ts +2 -7
  15. package/dist/agenda/bookingLocations/client.js +4 -4
  16. package/dist/agenda/bookingLocations/index.d.ts +1 -0
  17. package/dist/agenda/bookingLocations/models.d.ts +67 -0
  18. package/dist/agenda/bookingOfferings/client.d.ts +2 -8
  19. package/dist/agenda/bookingOfferings/client.js +1 -1
  20. package/dist/agenda/bookingOfferings/index.d.ts +1 -1
  21. package/dist/agenda/bookingOfferings/models.d.ts +79 -1
  22. package/dist/agenda/bookingRequirements/client.d.ts +2 -75
  23. package/dist/agenda/bookingRequirements/client.js +1 -1
  24. package/dist/agenda/bookingRequirements/index.d.ts +1 -0
  25. package/dist/agenda/bookingRequirements/models.d.ts +182 -0
  26. package/dist/agenda/bookingSlots/client.d.ts +2 -7
  27. package/dist/agenda/bookingSlots/client.js +5 -4
  28. package/dist/agenda/bookingSlots/index.d.ts +1 -0
  29. package/dist/agenda/bookingSlots/models.d.ts +67 -0
  30. package/dist/agenda/bookingSlots/models.js +3 -0
  31. package/dist/agenda/bookings/client.d.ts +13 -188
  32. package/dist/agenda/bookings/client.js +13 -13
  33. package/dist/agenda/bookings/index.d.ts +1 -1
  34. package/dist/agenda/bookings/models.d.ts +526 -1
  35. package/dist/agenda/bookings/models.js +7 -1
  36. package/dist/agenda/firstAvailability/client.d.ts +2 -8
  37. package/dist/agenda/firstAvailability/client.js +4 -4
  38. package/dist/agenda/firstAvailability/index.d.ts +1 -1
  39. package/dist/agenda/firstAvailability/models.d.ts +80 -1
  40. package/dist/agenda/firstAvailability/models.js +4 -1
  41. package/dist/agenda/index.d.ts +1 -1
  42. package/dist/agenda/locations/client.d.ts +2 -7
  43. package/dist/agenda/locations/client.js +4 -4
  44. package/dist/agenda/locations/index.d.ts +1 -0
  45. package/dist/agenda/locations/models.d.ts +67 -0
  46. package/dist/agenda/locations/models.js +3 -0
  47. package/dist/agenda/models.d.ts +2193 -839
  48. package/dist/agenda/models.js +9 -0
  49. package/dist/agenda/nearestBookingSlots/client.d.ts +2 -8
  50. package/dist/agenda/nearestBookingSlots/client.js +4 -4
  51. package/dist/agenda/nearestBookingSlots/index.d.ts +1 -1
  52. package/dist/agenda/nearestBookingSlots/models.d.ts +80 -2
  53. package/dist/agenda/nearestBookingSlots/models.js +4 -1
  54. package/dist/agenda/offerings/client.d.ts +7 -146
  55. package/dist/agenda/offerings/client.js +8 -8
  56. package/dist/agenda/offerings/index.d.ts +1 -1
  57. package/dist/agenda/offerings/models.d.ts +349 -1
  58. package/dist/agenda/offerings/models.js +6 -0
  59. package/dist/agenda/resourceSchedules/client.d.ts +4 -51
  60. package/dist/agenda/resourceSchedules/client.js +5 -4
  61. package/dist/agenda/resourceSchedules/index.d.ts +1 -0
  62. package/dist/agenda/resourceSchedules/models.d.ts +133 -0
  63. package/dist/agenda/resourceSchedules/models.js +12 -0
  64. package/dist/agenda/resources/client.d.ts +7 -99
  65. package/dist/agenda/resources/client.js +8 -8
  66. package/dist/agenda/resources/index.d.ts +1 -1
  67. package/dist/agenda/resources/models.d.ts +302 -1
  68. package/dist/agenda/resources/models.js +6 -0
  69. package/dist/agenda/scheduleRules/client.d.ts +7 -172
  70. package/dist/agenda/scheduleRules/client.js +10 -10
  71. package/dist/agenda/scheduleRules/index.d.ts +1 -1
  72. package/dist/agenda/scheduleRules/models.d.ts +520 -1
  73. package/dist/agenda/scheduleRules/models.js +31 -0
  74. package/dist/agenda/services/client.d.ts +7 -71
  75. package/dist/agenda/services/client.js +8 -8
  76. package/dist/agenda/services/index.d.ts +1 -1
  77. package/dist/agenda/services/models.d.ts +274 -1
  78. package/dist/agenda/services/models.js +6 -0
  79. package/dist/agenda/waitlist/client.d.ts +9 -217
  80. package/dist/agenda/waitlist/client.js +13 -13
  81. package/dist/agenda/waitlist/index.d.ts +1 -1
  82. package/dist/agenda/waitlist/models.d.ts +482 -1
  83. package/dist/agenda/waitlist/models.js +16 -1
  84. package/dist/index.d.ts +1 -1
  85. package/dist/models.d.ts +0 -20
  86. package/dist/raiz/agents/client.d.ts +8 -137
  87. package/dist/raiz/agents/client.js +12 -12
  88. package/dist/raiz/agents/index.d.ts +1 -1
  89. package/dist/raiz/agents/models.d.ts +258 -2
  90. package/dist/raiz/agents/models.js +13 -1
  91. package/dist/raiz/bulletins/client.d.ts +10 -74
  92. package/dist/raiz/bulletins/client.js +13 -14
  93. package/dist/raiz/bulletins/index.d.ts +1 -1
  94. package/dist/raiz/bulletins/models.d.ts +112 -1
  95. package/dist/raiz/bulletins/models.js +14 -0
  96. package/dist/raiz/campaigns/client.d.ts +11 -140
  97. package/dist/raiz/campaigns/client.js +14 -14
  98. package/dist/raiz/campaigns/index.d.ts +1 -1
  99. package/dist/raiz/campaigns/models.d.ts +343 -2
  100. package/dist/raiz/campaigns/models.js +14 -1
  101. package/dist/raiz/changes/client.d.ts +2 -8
  102. package/dist/raiz/changes/client.js +4 -4
  103. package/dist/raiz/changes/index.d.ts +1 -1
  104. package/dist/raiz/changes/models.d.ts +41 -1
  105. package/dist/raiz/changes/models.js +3 -0
  106. package/dist/raiz/channels/client.d.ts +15 -142
  107. package/dist/raiz/channels/client.js +16 -18
  108. package/dist/raiz/channels/index.d.ts +1 -1
  109. package/dist/raiz/channels/models.d.ts +1511 -2
  110. package/dist/raiz/channels/models.js +12 -2
  111. package/dist/raiz/contacts/client.d.ts +12 -117
  112. package/dist/raiz/contacts/client.js +15 -15
  113. package/dist/raiz/contacts/index.d.ts +1 -1
  114. package/dist/raiz/contacts/models.d.ts +305 -2
  115. package/dist/raiz/contacts/models.js +10 -1
  116. package/dist/raiz/conversations/client.d.ts +18 -99
  117. package/dist/raiz/conversations/client.js +12 -13
  118. package/dist/raiz/conversations/index.d.ts +1 -1
  119. package/dist/raiz/conversations/models.d.ts +253 -2
  120. package/dist/raiz/conversations/models.js +8 -2
  121. package/dist/raiz/definitions/client.d.ts +8 -115
  122. package/dist/raiz/definitions/client.js +10 -10
  123. package/dist/raiz/definitions/index.d.ts +1 -1
  124. package/dist/raiz/definitions/models.d.ts +224 -1
  125. package/dist/raiz/definitions/models.js +6 -0
  126. package/dist/raiz/evalCases/client.d.ts +10 -57
  127. package/dist/raiz/evalCases/client.js +8 -8
  128. package/dist/raiz/evalCases/index.d.ts +1 -1
  129. package/dist/raiz/evalCases/models.d.ts +78 -1
  130. package/dist/raiz/evalCases/models.js +6 -0
  131. package/dist/raiz/evalRuns/client.d.ts +4 -45
  132. package/dist/raiz/evalRuns/client.js +6 -6
  133. package/dist/raiz/evalRuns/index.d.ts +1 -1
  134. package/dist/raiz/evalRuns/models.d.ts +85 -0
  135. package/dist/raiz/evalRuns/models.js +3 -0
  136. package/dist/raiz/facts/client.d.ts +6 -65
  137. package/dist/raiz/facts/client.js +7 -7
  138. package/dist/raiz/facts/index.d.ts +1 -0
  139. package/dist/raiz/facts/models.d.ts +120 -0
  140. package/dist/raiz/facts/models.js +10 -0
  141. package/dist/raiz/index.d.ts +1 -1
  142. package/dist/raiz/knowledge/client.d.ts +10 -130
  143. package/dist/raiz/knowledge/client.js +13 -13
  144. package/dist/raiz/knowledge/index.d.ts +1 -1
  145. package/dist/raiz/knowledge/models.d.ts +256 -1
  146. package/dist/raiz/knowledge/models.js +12 -0
  147. package/dist/raiz/models.d.ts +1474 -825
  148. package/dist/raiz/models.js +3 -0
  149. package/dist/raiz/organization/client.d.ts +7 -70
  150. package/dist/raiz/organization/client.js +8 -8
  151. package/dist/raiz/organization/index.d.ts +1 -1
  152. package/dist/raiz/organization/models.d.ts +178 -1
  153. package/dist/raiz/organization/models.js +11 -0
  154. package/dist/raiz/profiles/client.d.ts +8 -87
  155. package/dist/raiz/profiles/client.js +10 -10
  156. package/dist/raiz/profiles/index.d.ts +1 -1
  157. package/dist/raiz/profiles/models.d.ts +206 -2
  158. package/dist/raiz/profiles/models.js +6 -0
  159. package/dist/raiz/reports/client.d.ts +5 -8
  160. package/dist/raiz/reports/client.js +4 -4
  161. package/dist/raiz/reports/index.d.ts +1 -1
  162. package/dist/raiz/reports/models.d.ts +41 -0
  163. package/dist/raiz/reports/models.js +3 -0
  164. package/dist/raiz/suppressions/client.d.ts +4 -31
  165. package/dist/raiz/suppressions/client.js +6 -6
  166. package/dist/raiz/suppressions/index.d.ts +1 -1
  167. package/dist/raiz/suppressions/models.d.ts +114 -1
  168. package/dist/raiz/suppressions/models.js +6 -0
  169. package/dist/raiz/tasks/client.d.ts +12 -32
  170. package/dist/raiz/tasks/client.js +11 -11
  171. package/dist/raiz/tasks/index.d.ts +1 -1
  172. package/dist/raiz/tasks/models.d.ts +108 -2
  173. package/dist/raiz/tasks/models.js +4 -1
  174. package/dist/raiz/templates/client.d.ts +7 -84
  175. package/dist/raiz/templates/client.js +5 -4
  176. package/dist/raiz/templates/index.d.ts +1 -1
  177. package/dist/raiz/templates/models.d.ts +214 -1
  178. package/dist/raiz/templates/models.js +4 -1
  179. package/dist/raiz/voices/client.d.ts +2 -8
  180. package/dist/raiz/voices/client.js +1 -1
  181. package/dist/raiz/voices/index.d.ts +1 -1
  182. package/dist/raiz/voices/models.d.ts +40 -1
  183. package/package.json +3 -3
  184. package/dist/account/billing/client.d.ts +0 -22
  185. package/dist/account/billing/client.js +0 -18
  186. package/dist/account/billing/index.d.ts +0 -5
  187. package/dist/account/billing/index.js +0 -4
  188. package/dist/account/billing/models.d.ts +0 -74
  189. package/dist/account/billing/models.js +0 -10
  190. package/dist/account/billingProfiles/client.d.ts +0 -39
  191. package/dist/account/billingProfiles/client.js +0 -25
  192. package/dist/account/billingProfiles/index.d.ts +0 -5
  193. package/dist/account/billingProfiles/index.js +0 -4
  194. package/dist/account/billingProfiles/models.d.ts +0 -58
  195. package/dist/account/invoiceDocuments/client.d.ts +0 -25
  196. package/dist/account/invoiceDocuments/client.js +0 -17
  197. package/dist/account/invoiceDocuments/index.d.ts +0 -5
  198. package/dist/account/invoiceDocuments/index.js +0 -4
  199. package/dist/account/invoiceDocuments/models.d.ts +0 -35
  200. package/dist/account/invoices/client.d.ts +0 -47
  201. package/dist/account/invoices/client.js +0 -26
  202. package/dist/account/invoices/index.d.ts +0 -5
  203. package/dist/account/invoices/index.js +0 -4
  204. package/dist/account/invoices/models.d.ts +0 -135
  205. package/dist/account/invoices/models.js +0 -24
  206. package/dist/account/payments/client.d.ts +0 -34
  207. package/dist/account/payments/client.js +0 -19
  208. package/dist/account/payments/index.d.ts +0 -5
  209. package/dist/account/payments/index.js +0 -4
  210. package/dist/account/payments/models.d.ts +0 -64
  211. package/dist/account/payments/models.js +0 -12
  212. package/dist/account/usage/client.d.ts +0 -47
  213. package/dist/account/usage/client.js +0 -18
  214. package/dist/account/usage/index.d.ts +0 -5
  215. package/dist/account/usage/index.js +0 -4
  216. package/dist/account/usage/models.d.ts +0 -51
  217. package/dist/account/usageSummary/client.d.ts +0 -26
  218. package/dist/account/usageSummary/client.js +0 -19
  219. package/dist/account/usageSummary/index.d.ts +0 -5
  220. package/dist/account/usageSummary/index.js +0 -4
  221. package/dist/account/usageSummary/models.d.ts +0 -50
  222. package/dist/account/usageSummary/models.js +0 -9
  223. package/dist/account/walletTransactions/client.d.ts +0 -34
  224. package/dist/account/walletTransactions/client.js +0 -19
  225. package/dist/account/walletTransactions/index.d.ts +0 -5
  226. package/dist/account/walletTransactions/index.js +0 -4
  227. package/dist/account/walletTransactions/models.d.ts +0 -58
  228. package/dist/account/walletTransactions/models.js +0 -12
  229. /package/dist/{account/billingProfiles → agenda/availability}/models.js +0 -0
  230. /package/dist/{account/invoiceDocuments → agenda/bookingLocations}/models.js +0 -0
  231. /package/dist/{account/usage → agenda/bookingRequirements}/models.js +0 -0
@@ -1,7 +1,7 @@
1
1
  // Code generated by forge. DO NOT EDIT.
2
2
  /* eslint-disable */
3
- import { array, instant, object } from "../../_/index.js";
4
- import { RaizBusinessHoursCodec } from "../models.js";
3
+ import { array, bytes, instant, object } from "../../_/index.js";
4
+ import { RaizBusinessHoursCodec, } from "../models.js";
5
5
  export const RaizChannelCodec = object([
6
6
  ["businessHours", null, () => RaizBusinessHoursCodec],
7
7
  ["createdAt", null, instant],
@@ -12,3 +12,13 @@ export const RaizChannelCodec = object([
12
12
  export const RaizChannelPageCodec = object([
13
13
  ["data", null, array(() => RaizChannelCodec)],
14
14
  ]);
15
+ export const RaizChannelPageResponseCodec = object([
16
+ ["data", null, () => RaizChannelPageCodec],
17
+ ]);
18
+ export const RaizChannelResponseCodec = object([
19
+ ["data", null, () => RaizChannelCodec],
20
+ ]);
21
+ export const RaizUpdateChannelBodyCodec = object([
22
+ ["businessHours", null, () => RaizBusinessHoursCodec],
23
+ ["widgetLogo", null, object([["data", null, bytes]])],
24
+ ]);
@@ -1,6 +1,6 @@
1
1
  import { type BaseClientOptions, type RequestOptions, Transport } from "../../_/index.js";
2
- import { type RaizResponseMetadata, type RaizTask } from "../models.js";
3
- import { type RaizContact, type RaizContactIdentifierInput, type RaizContactPage, type RaizContactPointInput, type RaizCount, type RaizPostalAddress } from "./models.js";
2
+ import { type RaizTaskResponse } from "../models.js";
3
+ import { type RaizContactPageResponse, type RaizContactResponse, type RaizCountResponse, type RaizCreateContactBody, type RaizImportContactsBody, type RaizUpdateContactBody } from "./models.js";
4
4
  export interface ClientOptions extends BaseClientOptions {
5
5
  /**
6
6
  * The URL the paths of the API are relative to.
@@ -107,41 +107,9 @@ export interface CountRequest {
107
107
  */
108
108
  q?: string;
109
109
  }
110
- export interface CountResponse {
111
- data: RaizCount;
112
- error: null;
113
- metadata: RaizResponseMetadata;
114
- success: true;
115
- }
116
- export interface CreateRequest {
117
- familyName?: string | null;
118
- givenName?: string | null;
119
- /**
120
- * Identity documents. In an update, the complete new set: documents not
121
- * listed are removed.
122
- */
123
- identifiers?: RaizContactIdentifierInput[];
124
- /**
125
- * Your own keys and labels for this resource (up to 50 keys of 40 characters;
126
- * values up to 500 characters). Raíz never interprets them.
127
- */
128
- metadata?: {
129
- [key: string]: unknown;
130
- };
131
- /**
132
- * Phones, emails and other addresses. In an update, the complete new set:
133
- * points not listed are removed; listed ones keep their id and verification.
134
- */
135
- points?: RaizContactPointInput[];
136
- postalAddresses?: RaizPostalAddress[];
137
- summary?: string | null;
138
- }
139
- export interface CreateResponse {
140
- data: RaizContact;
141
- error: null;
142
- metadata: RaizResponseMetadata;
143
- success: true;
144
- }
110
+ export type CountResponse = RaizCountResponse;
111
+ export type CreateRequest = RaizCreateContactBody;
112
+ export type CreateResponse = RaizContactResponse;
145
113
  export interface GetRequest {
146
114
  /**
147
115
  * Contact id.
@@ -165,46 +133,9 @@ export interface GetRequest {
165
133
  */
166
134
  timelineLimit?: number;
167
135
  }
168
- export interface GetResponse {
169
- data: RaizContact;
170
- error: null;
171
- metadata: RaizResponseMetadata;
172
- success: true;
173
- }
174
- export interface ImportRequest {
175
- /**
176
- * Country assumed for phone numbers written without `+` and country code (ISO
177
- * 3166-1 alpha-2).
178
- */
179
- countryCode?: string;
180
- /**
181
- * The CSV as text. UTF-8 CSV with a header row (`,`, `;` or tab). Recognized
182
- * columns: `given_name`, `family_name`, `phone`, `whatsapp`, `email`,
183
- * `document_type`, `document_number`, `summary`; any other column is stored
184
- * as metadata, or as a fact when its header is an active contact definition's
185
- * key. Rows whose phone, WhatsApp, email or document matches an existing
186
- * contact update that contact. Give `csv` or `file`, not both.
187
- */
188
- csv?: string;
189
- /**
190
- * The CSV file as read from disk, in base64, as Knowledge files are sent.
191
- * UTF-8 CSV with a header row (`,`, `;` or tab). Recognized columns:
192
- * `given_name`, `family_name`, `phone`, `whatsapp`, `email`, `document_type`,
193
- * `document_number`, `summary`; any other column is stored as metadata, or as
194
- * a fact when its header is an active contact definition's key. Rows whose
195
- * phone, WhatsApp, email or document matches an existing contact update that
196
- * contact.
197
- */
198
- file?: {
199
- data: Uint8Array;
200
- };
201
- }
202
- export interface ImportResponse {
203
- data: RaizTask;
204
- error: null;
205
- metadata: RaizResponseMetadata;
206
- success: true;
207
- }
136
+ export type GetResponse = RaizContactResponse;
137
+ export type ImportRequest = RaizImportContactsBody;
138
+ export type ImportResponse = RaizTaskResponse;
208
139
  export interface ListRequest {
209
140
  /**
210
141
  * Opaque cursor returned by pageInfo; omit it to request the first page.
@@ -250,47 +181,11 @@ export interface ListRequest {
250
181
  */
251
182
  sort?: "created" | "name" | "last_contacted";
252
183
  }
253
- export interface ListResponse {
254
- data: RaizContactPage;
255
- error: null;
256
- metadata: RaizResponseMetadata;
257
- success: true;
258
- }
259
- export interface UpdateRequest {
184
+ export type ListResponse = RaizContactPageResponse;
185
+ export type UpdateRequest = {
260
186
  /**
261
187
  * Contact id.
262
188
  */
263
189
  contactId: string;
264
- /**
265
- * The `version` you read. When present, the change applies only if nobody
266
- * changed the resource since; otherwise it fails with VERSION_CONFLICT.
267
- */
268
- expectedVersion?: number;
269
- familyName?: string | null;
270
- givenName?: string | null;
271
- /**
272
- * Identity documents. In an update, the complete new set: documents not
273
- * listed are removed.
274
- */
275
- identifiers?: RaizContactIdentifierInput[];
276
- /**
277
- * Your own keys and labels for this resource (up to 50 keys of 40 characters;
278
- * values up to 500 characters). Raíz never interprets them.
279
- */
280
- metadata?: {
281
- [key: string]: unknown;
282
- };
283
- /**
284
- * Phones, emails and other addresses. In an update, the complete new set:
285
- * points not listed are removed; listed ones keep their id and verification.
286
- */
287
- points?: RaizContactPointInput[];
288
- postalAddresses?: RaizPostalAddress[];
289
- summary?: string | null;
290
- }
291
- export interface UpdateResponse {
292
- data: RaizContact;
293
- error: null;
294
- metadata: RaizResponseMetadata;
295
- success: true;
296
- }
190
+ } & RaizUpdateContactBody;
191
+ export type UpdateResponse = RaizContactResponse;
@@ -1,8 +1,8 @@
1
1
  // Code generated by forge. DO NOT EDIT.
2
2
  /* eslint-disable */
3
- import { Transport, bytes, object, } from "../../_/index.js";
4
- import { RaizTaskCodec, } from "../models.js";
5
- import { RaizContactCodec, RaizContactPageCodec, } from "./models.js";
3
+ import { Transport, } from "../../_/index.js";
4
+ import { RaizTaskResponseCodec } from "../models.js";
5
+ import { RaizContactPageResponseCodec, RaizContactResponseCodec, RaizImportContactsBodyCodec, } from "./models.js";
6
6
  export function createClient(options) {
7
7
  return bind(new Transport(options));
8
8
  }
@@ -21,41 +21,41 @@ 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, "413": true, "415": true, "429": true, "500": true, "502": true, "503": true, "504": true },
24
+ errors: { "400": true, "401": true, "403": 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",
29
29
  body: "flat",
30
- response: object([["data", null, () => RaizContactCodec]]),
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 },
30
+ response: RaizContactResponseCodec,
31
+ errors: { "400": true, "401": true, "403": true, "404": 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/{contactId}",
36
36
  query: { expand: "expand", timelineCursor: "timelineCursor", timelineDirection: "timelineDirection", timelineLimit: "timelineLimit" },
37
- response: object([["data", null, () => RaizContactCodec]]),
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 },
37
+ response: RaizContactResponseCodec,
38
+ errors: { "400": true, "401": true, "403": true, "404": true, "429": true, "500": true, "502": true, "503": true, "504": true },
39
39
  };
40
40
  const ImportOperation = {
41
41
  method: "POST",
42
42
  route: "/v1/raiz/contacts/import",
43
43
  body: "flat",
44
- request: object([["file", null, object([["data", null, bytes]])]]),
45
- response: object([["data", null, () => RaizTaskCodec]]),
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 },
44
+ request: RaizImportContactsBodyCodec,
45
+ response: RaizTaskResponseCodec,
46
+ errors: { "400": true, "401": true, "403": 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
- response: object([["data", null, () => RaizContactPageCodec]]),
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 },
52
+ response: RaizContactPageResponseCodec,
53
+ errors: { "400": true, "401": true, "403": 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/{contactId}",
58
58
  body: "flat",
59
- response: object([["data", null, () => RaizContactCodec]]),
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 },
59
+ response: RaizContactResponseCodec,
60
+ errors: { "400": true, "401": true, "403": true, "404": 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, RaizContactTimelinePage, RaizCount, RaizPostalAddress, } from "./models.js";
5
+ export type { RaizContact, RaizContactIdentifierInput, RaizContactLastConversation, RaizContactPage, RaizContactPageResponse, RaizContactPointInput, RaizContactResponse, RaizContactTimelinePage, RaizCount, RaizCountContactsServiceUnavailableError, RaizCountContactsServiceUnavailableFailure, RaizCountResponse, RaizCreateContactBadRequestError, RaizCreateContactBadRequestFailure, RaizCreateContactBody, RaizCreateContactConflictError, RaizCreateContactConflictFailure, RaizCreateContactServiceUnavailableError, RaizCreateContactServiceUnavailableFailure, RaizGetContactBadRequestError, RaizGetContactBadRequestFailure, RaizGetContactServiceUnavailableError, RaizGetContactServiceUnavailableFailure, RaizImportContactsBody, RaizImportContactsContentTooLargeError, RaizImportContactsContentTooLargeFailure, RaizImportContactsServiceUnavailableError, RaizImportContactsServiceUnavailableFailure, RaizImportFileInvalidError, RaizListContactsBadRequestError, RaizListContactsBadRequestFailure, RaizListContactsServiceUnavailableError, RaizListContactsServiceUnavailableFailure, RaizPostalAddress, RaizUpdateContactBadRequestError, RaizUpdateContactBadRequestFailure, RaizUpdateContactBody, RaizUpdateContactConflictError, RaizUpdateContactConflictFailure, RaizUpdateContactServiceUnavailableError, RaizUpdateContactServiceUnavailableFailure, } from "./models.js";
@@ -1,5 +1,5 @@
1
- import type { PageInfo } from "../../models.js";
2
- import { type RaizEmailAddress, type RaizFact, type RaizPhoneNumber } from "../models.js";
1
+ import type { InvalidInputFailure, PageInfo, RequestTooLargeFailure, ResponseMetadata, UpstreamUnavailableFailure } from "../../models.js";
2
+ import { type RaizAddressInUseFailure, type RaizEmailAddress, type RaizFact, type RaizIdentifierInUseFailure, type RaizImportFileInvalidFailure, type RaizImportFileTooLargeFailure, type RaizIntegrationsUnavailableFailure, type RaizInvalidCursorFailure, type RaizPhoneNumber, type RaizVersionConflictFailure } from "../models.js";
3
3
  export interface RaizContact {
4
4
  conversationCount: number;
5
5
  /**
@@ -116,6 +116,18 @@ export interface RaizContactPage {
116
116
  */
117
117
  pageInfo: PageInfo;
118
118
  }
119
+ /**
120
+ * A successful answer.
121
+ */
122
+ export interface RaizContactPageResponse {
123
+ data: RaizContactPage;
124
+ error: null;
125
+ /**
126
+ * What every answer carries besides its data or error.
127
+ */
128
+ metadata: ResponseMetadata;
129
+ success: true;
130
+ }
119
131
  export type RaizContactPointInput = {
120
132
  address: RaizPhoneNumber;
121
133
  kind: "phone";
@@ -132,6 +144,18 @@ export type RaizContactPointInput = {
132
144
  label?: string | null;
133
145
  preferred?: boolean;
134
146
  };
147
+ /**
148
+ * A successful answer.
149
+ */
150
+ export interface RaizContactResponse {
151
+ data: RaizContact;
152
+ error: null;
153
+ /**
154
+ * What every answer carries besides its data or error.
155
+ */
156
+ metadata: ResponseMetadata;
157
+ success: true;
158
+ }
135
159
  export interface RaizContactTimelinePage {
136
160
  /**
137
161
  * Items admitted by this resource contract within the verified organization.
@@ -163,6 +187,215 @@ export interface RaizCount {
163
187
  */
164
188
  count: number;
165
189
  }
190
+ /**
191
+ * A failed answer.
192
+ */
193
+ export interface RaizCountContactsServiceUnavailableError {
194
+ data: null;
195
+ error: RaizCountContactsServiceUnavailableFailure;
196
+ /**
197
+ * What every answer carries besides its data or error.
198
+ */
199
+ metadata: ResponseMetadata;
200
+ success: false;
201
+ }
202
+ export type RaizCountContactsServiceUnavailableFailure = UpstreamUnavailableFailure | RaizIntegrationsUnavailableFailure;
203
+ /**
204
+ * A successful answer.
205
+ */
206
+ export interface RaizCountResponse {
207
+ data: RaizCount;
208
+ error: null;
209
+ /**
210
+ * What every answer carries besides its data or error.
211
+ */
212
+ metadata: ResponseMetadata;
213
+ success: true;
214
+ }
215
+ /**
216
+ * A failed answer.
217
+ */
218
+ export interface RaizCreateContactBadRequestError {
219
+ data: null;
220
+ error: RaizCreateContactBadRequestFailure;
221
+ /**
222
+ * What every answer carries besides its data or error.
223
+ */
224
+ metadata: ResponseMetadata;
225
+ success: false;
226
+ }
227
+ export type RaizCreateContactBadRequestFailure = InvalidInputFailure | RaizInvalidCursorFailure;
228
+ export interface RaizCreateContactBody {
229
+ familyName?: string | null;
230
+ givenName?: string | null;
231
+ /**
232
+ * Identity documents. In an update, the complete new set: documents not
233
+ * listed are removed.
234
+ */
235
+ identifiers?: RaizContactIdentifierInput[];
236
+ /**
237
+ * Your own keys and labels for this resource (up to 50 keys of 40 characters;
238
+ * values up to 500 characters). Raíz never interprets them.
239
+ */
240
+ metadata?: {
241
+ [key: string]: unknown;
242
+ };
243
+ /**
244
+ * Phones, emails and other addresses. In an update, the complete new set:
245
+ * points not listed are removed; listed ones keep their id and verification.
246
+ */
247
+ points?: RaizContactPointInput[];
248
+ postalAddresses?: RaizPostalAddress[];
249
+ summary?: string | null;
250
+ }
251
+ /**
252
+ * A failed answer.
253
+ */
254
+ export interface RaizCreateContactConflictError {
255
+ data: null;
256
+ error: RaizCreateContactConflictFailure;
257
+ /**
258
+ * What every answer carries besides its data or error.
259
+ */
260
+ metadata: ResponseMetadata;
261
+ success: false;
262
+ }
263
+ export type RaizCreateContactConflictFailure = RaizAddressInUseFailure | RaizIdentifierInUseFailure | RaizVersionConflictFailure;
264
+ /**
265
+ * A failed answer.
266
+ */
267
+ export interface RaizCreateContactServiceUnavailableError {
268
+ data: null;
269
+ error: RaizCreateContactServiceUnavailableFailure;
270
+ /**
271
+ * What every answer carries besides its data or error.
272
+ */
273
+ metadata: ResponseMetadata;
274
+ success: false;
275
+ }
276
+ export type RaizCreateContactServiceUnavailableFailure = UpstreamUnavailableFailure | RaizIntegrationsUnavailableFailure;
277
+ /**
278
+ * A failed answer.
279
+ */
280
+ export interface RaizGetContactBadRequestError {
281
+ data: null;
282
+ error: RaizGetContactBadRequestFailure;
283
+ /**
284
+ * What every answer carries besides its data or error.
285
+ */
286
+ metadata: ResponseMetadata;
287
+ success: false;
288
+ }
289
+ export type RaizGetContactBadRequestFailure = InvalidInputFailure | RaizInvalidCursorFailure;
290
+ /**
291
+ * A failed answer.
292
+ */
293
+ export interface RaizGetContactServiceUnavailableError {
294
+ data: null;
295
+ error: RaizGetContactServiceUnavailableFailure;
296
+ /**
297
+ * What every answer carries besides its data or error.
298
+ */
299
+ metadata: ResponseMetadata;
300
+ success: false;
301
+ }
302
+ export type RaizGetContactServiceUnavailableFailure = UpstreamUnavailableFailure | RaizIntegrationsUnavailableFailure;
303
+ export interface RaizImportContactsBody {
304
+ /**
305
+ * Country assumed for phone numbers written without `+` and country code (ISO
306
+ * 3166-1 alpha-2).
307
+ */
308
+ countryCode?: string;
309
+ /**
310
+ * The CSV as text. UTF-8 CSV with a header row (`,`, `;` or tab). Recognized
311
+ * columns: `given_name`, `family_name`, `phone`, `whatsapp`, `email`,
312
+ * `document_type`, `document_number`, `summary`; any other column is stored
313
+ * as metadata, or as a fact when its header is an active contact definition's
314
+ * key. Rows whose phone, WhatsApp, email or document matches an existing
315
+ * contact update that contact. Give `csv` or `file`, not both.
316
+ */
317
+ csv?: string;
318
+ /**
319
+ * The CSV file as read from disk, in base64, as Knowledge files are sent.
320
+ * UTF-8 CSV with a header row (`,`, `;` or tab). Recognized columns:
321
+ * `given_name`, `family_name`, `phone`, `whatsapp`, `email`, `document_type`,
322
+ * `document_number`, `summary`; any other column is stored as metadata, or as
323
+ * a fact when its header is an active contact definition's key. Rows whose
324
+ * phone, WhatsApp, email or document matches an existing contact update that
325
+ * contact.
326
+ */
327
+ file?: {
328
+ data: Uint8Array;
329
+ };
330
+ }
331
+ /**
332
+ * A failed answer.
333
+ */
334
+ export interface RaizImportContactsContentTooLargeError {
335
+ data: null;
336
+ error: RaizImportContactsContentTooLargeFailure;
337
+ /**
338
+ * What every answer carries besides its data or error.
339
+ */
340
+ metadata: ResponseMetadata;
341
+ success: false;
342
+ }
343
+ export type RaizImportContactsContentTooLargeFailure = RequestTooLargeFailure | RaizImportFileTooLargeFailure;
344
+ /**
345
+ * A failed answer.
346
+ */
347
+ export interface RaizImportContactsServiceUnavailableError {
348
+ data: null;
349
+ error: RaizImportContactsServiceUnavailableFailure;
350
+ /**
351
+ * What every answer carries besides its data or error.
352
+ */
353
+ metadata: ResponseMetadata;
354
+ success: false;
355
+ }
356
+ export type RaizImportContactsServiceUnavailableFailure = UpstreamUnavailableFailure | RaizIntegrationsUnavailableFailure;
357
+ /**
358
+ * A failed answer.
359
+ */
360
+ export interface RaizImportFileInvalidError {
361
+ data: null;
362
+ /**
363
+ * The import file is not valid base64 of UTF-8 text. Save the spreadsheet as
364
+ * CSV UTF-8 and try again.
365
+ */
366
+ error: RaizImportFileInvalidFailure;
367
+ /**
368
+ * What every answer carries besides its data or error.
369
+ */
370
+ metadata: ResponseMetadata;
371
+ success: false;
372
+ }
373
+ /**
374
+ * A failed answer.
375
+ */
376
+ export interface RaizListContactsBadRequestError {
377
+ data: null;
378
+ error: RaizListContactsBadRequestFailure;
379
+ /**
380
+ * What every answer carries besides its data or error.
381
+ */
382
+ metadata: ResponseMetadata;
383
+ success: false;
384
+ }
385
+ export type RaizListContactsBadRequestFailure = InvalidInputFailure | RaizInvalidCursorFailure;
386
+ /**
387
+ * A failed answer.
388
+ */
389
+ export interface RaizListContactsServiceUnavailableError {
390
+ data: null;
391
+ error: RaizListContactsServiceUnavailableFailure;
392
+ /**
393
+ * What every answer carries besides its data or error.
394
+ */
395
+ metadata: ResponseMetadata;
396
+ success: false;
397
+ }
398
+ export type RaizListContactsServiceUnavailableFailure = UpstreamUnavailableFailure | RaizIntegrationsUnavailableFailure;
166
399
  export interface RaizPostalAddress {
167
400
  city?: string;
168
401
  /**
@@ -174,7 +407,77 @@ export interface RaizPostalAddress {
174
407
  state?: string;
175
408
  use?: "home" | "work";
176
409
  }
410
+ /**
411
+ * A failed answer.
412
+ */
413
+ export interface RaizUpdateContactBadRequestError {
414
+ data: null;
415
+ error: RaizUpdateContactBadRequestFailure;
416
+ /**
417
+ * What every answer carries besides its data or error.
418
+ */
419
+ metadata: ResponseMetadata;
420
+ success: false;
421
+ }
422
+ export type RaizUpdateContactBadRequestFailure = InvalidInputFailure | RaizInvalidCursorFailure;
423
+ export interface RaizUpdateContactBody {
424
+ /**
425
+ * The `version` you read. When present, the change applies only if nobody
426
+ * changed the resource since; otherwise it fails with VERSION_CONFLICT.
427
+ */
428
+ expectedVersion?: number;
429
+ familyName?: string | null;
430
+ givenName?: string | null;
431
+ /**
432
+ * Identity documents. In an update, the complete new set: documents not
433
+ * listed are removed.
434
+ */
435
+ identifiers?: RaizContactIdentifierInput[];
436
+ /**
437
+ * Your own keys and labels for this resource (up to 50 keys of 40 characters;
438
+ * values up to 500 characters). Raíz never interprets them.
439
+ */
440
+ metadata?: {
441
+ [key: string]: unknown;
442
+ };
443
+ /**
444
+ * Phones, emails and other addresses. In an update, the complete new set:
445
+ * points not listed are removed; listed ones keep their id and verification.
446
+ */
447
+ points?: RaizContactPointInput[];
448
+ postalAddresses?: RaizPostalAddress[];
449
+ summary?: string | null;
450
+ }
451
+ /**
452
+ * A failed answer.
453
+ */
454
+ export interface RaizUpdateContactConflictError {
455
+ data: null;
456
+ error: RaizUpdateContactConflictFailure;
457
+ /**
458
+ * What every answer carries besides its data or error.
459
+ */
460
+ metadata: ResponseMetadata;
461
+ success: false;
462
+ }
463
+ export type RaizUpdateContactConflictFailure = RaizAddressInUseFailure | RaizIdentifierInUseFailure | RaizVersionConflictFailure;
464
+ /**
465
+ * A failed answer.
466
+ */
467
+ export interface RaizUpdateContactServiceUnavailableError {
468
+ data: null;
469
+ error: RaizUpdateContactServiceUnavailableFailure;
470
+ /**
471
+ * What every answer carries besides its data or error.
472
+ */
473
+ metadata: ResponseMetadata;
474
+ success: false;
475
+ }
476
+ export type RaizUpdateContactServiceUnavailableFailure = UpstreamUnavailableFailure | RaizIntegrationsUnavailableFailure;
177
477
  export declare const RaizContactCodec: import("../../_/codec.js").Codec;
178
478
  export declare const RaizContactLastConversationCodec: import("../../_/codec.js").Codec;
179
479
  export declare const RaizContactPageCodec: import("../../_/codec.js").Codec;
480
+ export declare const RaizContactPageResponseCodec: import("../../_/codec.js").Codec;
481
+ export declare const RaizContactResponseCodec: import("../../_/codec.js").Codec;
180
482
  export declare const RaizContactTimelinePageCodec: import("../../_/codec.js").Codec;
483
+ export declare const RaizImportContactsBodyCodec: import("../../_/codec.js").Codec;
@@ -1,6 +1,6 @@
1
1
  // Code generated by forge. DO NOT EDIT.
2
2
  /* eslint-disable */
3
- import { array, instant, object } from "../../_/index.js";
3
+ import { array, bytes, instant, object } from "../../_/index.js";
4
4
  import { RaizFactCodec, } from "../models.js";
5
5
  export const RaizContactCodec = object([
6
6
  ["createdAt", null, instant],
@@ -18,6 +18,15 @@ export const RaizContactLastConversationCodec = object([
18
18
  export const RaizContactPageCodec = object([
19
19
  ["data", null, array(() => RaizContactCodec)],
20
20
  ]);
21
+ export const RaizContactPageResponseCodec = object([
22
+ ["data", null, () => RaizContactPageCodec],
23
+ ]);
24
+ export const RaizContactResponseCodec = object([
25
+ ["data", null, () => RaizContactCodec],
26
+ ]);
21
27
  export const RaizContactTimelinePageCodec = object([
22
28
  ["data", null, array(object([["occurredAt", null, instant]]))],
23
29
  ]);
30
+ export const RaizImportContactsBodyCodec = object([
31
+ ["file", null, object([["data", null, bytes]])],
32
+ ]);