@replicer/sdk 0.0.0-stage → 0.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.
@@ -0,0 +1,602 @@
1
+ import { C as CreatePhoneCallInput, E as EnqueueCallResponse, O as OkResponse, a as CancelCampaignPendingResponse, L as ListCallsParams, P as Page, b as Call, c as CreateCampaignInput, d as Campaign, G as GetCampaignResponse, e as ListCampaignsParams, S as StartCampaignResponse, f as PageParams, g as PhoneNumber, h as ProvisionInboundInput, i as ProvisionInboundResponse, K as KnowledgeBaseCreateInput, j as KnowledgeBaseSourcesResponse, k as KnowledgeBaseResponse, l as KnowledgeBaseListResponse, m as KnowledgeBaseAddSourcesInput, n as KnowledgeBaseUpdateInput, o as PresignFileInput, p as PresignFileResponse, F as FailFileInput, U as UpdateSourceInput, q as UpdateChunkInput, r as KnowledgeBaseSourceDetail, s as PresignFileDownloadResponse, t as ListContactsParams, u as Contact, v as CreateContactInput, w as CreateContactResponse, A as Agent, x as Calendar, y as ListCalendarEventsParams, z as CalendarEvent, B as CreateCalendarEventInput, D as CreateCalendarEventResponse, H as UpdateCalendarEventInput, I as ListMessagesParams, M as Message, J as SendSmsInput, N as SendMessageResponse, Q as SendWhatsappInput, R as SendEmailInput, T as CreateTtsInput, V as CreateTtsResponse, W as ListTtsParams, X as TtsGeneration, Y as CreateWebhookEndpointInput, Z as WebhookEndpointWithSecret, _ as WebhookEndpoint, $ as UpdateWebhookEndpointInput, a0 as TestWebhookEndpointInput, a1 as TestWebhookEndpointResponse, a2 as ListWebhookDeliveriesParams, a3 as WebhookDelivery, a4 as ListWebhookDeliveryAttemptsParams, a5 as WebhookDeliveryAttempt, a6 as ListEventsParams, a7 as WebhookEvent } from './types-CmxwElVc.js';
2
+ export { a8 as AgentType, a9 as AnyWebhookEvent, aa as ApiErrorCode, ab as CalendarEventStatus, ac as CalendarType, ad as CallDirection, ae as CallSentiment, af as CallStatus, ag as CampaignListItem, ah as CampaignStatus, ai as CancelCallInput, aj as CancelCampaignPendingInput, ak as ContactIdentityConflict, al as ContactIdentityType, am as Conversation, an as ConversationChannel, ao as ConversationStatus, ap as CreateCampaignResponse, aq as DeleteKnowledgeBaseSourceParams, ar as DeletedResource, as as DeprovisionInboundParams, at as DeprovisionInboundRemaining, au as EventType, av as Int, aw as KnowledgeBaseChunk, ax as KnowledgeBaseRejectedUrl, ay as KnowledgeBaseSourceSummary, az as KnowledgeBaseStatus, aA as KnowledgeBaseTextSource, aB as KnowledgeSourceStatus, aC as KnowledgeSourceType, aD as MessageChannel, aE as MessageDirection, aF as MessageStatus, aG as OptOut, aH as OptOutSource, aI as Pagination, aJ as PhoneNumberType, aK as TtsStatus, aL as WebhookDeliveryErrorClass, aM as WebhookDeliveryStatus, aN as WebhookEndpointCreatedBy, aO as WebhookEndpointDisabledReason, aP as WebhookEventDataMap, aQ as WebhookEventEnvelope, aR as WebhookEventType, aS as WebhookTestData } from './types-CmxwElVc.js';
3
+
4
+ declare const DEFAULT_BASE_URL = "https://api.replicer.ai";
5
+ interface ReplicerOptions {
6
+ /** Your API key. Keep it server-side. */
7
+ apiKey: string;
8
+ /** Override the API host. Defaults to `https://api.replicer.ai`. */
9
+ baseURL?: string;
10
+ /** Custom `fetch` (tests, proxies, older runtimes). Defaults to the global `fetch`. */
11
+ fetch?: typeof fetch;
12
+ }
13
+ declare class Replicer {
14
+ private readonly apiKey;
15
+ private readonly baseURL;
16
+ private readonly fetchImpl;
17
+ constructor(options: ReplicerOptions);
18
+ readonly call: {
19
+ createPhoneCall: (input: CreatePhoneCallInput) => Promise<EnqueueCallResponse>;
20
+ cancel: (call_id: string) => Promise<OkResponse>;
21
+ cancelCampaignPending: (campaign_id: string) => Promise<CancelCampaignPendingResponse>;
22
+ list: (params?: ListCallsParams) => Promise<Page<Call>>;
23
+ get: (id: string) => Promise<Call>;
24
+ };
25
+ readonly campaign: {
26
+ create: (input: CreateCampaignInput) => Promise<Campaign>;
27
+ /** Includes up to 1,000 contacts (`contacts_truncated` tells whether there are more). */
28
+ get: (id: string) => Promise<GetCampaignResponse>;
29
+ list: (params?: ListCampaignsParams) => Promise<Page<Campaign>>;
30
+ /** Starts a campaign, or resumes one paused by `call.cancelCampaignPending`. */
31
+ start: (id: string) => Promise<StartCampaignResponse>;
32
+ };
33
+ readonly phoneNumber: {
34
+ /** Your organization's phone numbers; `id` is the `from_number_id` for `call.createPhoneCall`. */
35
+ list: (params?: PageParams) => Promise<Page<PhoneNumber>>;
36
+ provisionInbound: (input: ProvisionInboundInput) => Promise<ProvisionInboundResponse>;
37
+ deprovisionInbound: (id: string, trunk_id: string, rule_id: string) => Promise<OkResponse>;
38
+ };
39
+ readonly knowledgeBase: {
40
+ create: (input: KnowledgeBaseCreateInput) => Promise<KnowledgeBaseSourcesResponse>;
41
+ retrieve: (knowledgeBaseId: string) => Promise<KnowledgeBaseResponse>;
42
+ list: () => Promise<KnowledgeBaseListResponse>;
43
+ delete: (knowledgeBaseId: string) => Promise<void>;
44
+ addSources: (knowledgeBaseId: string, input: KnowledgeBaseAddSourcesInput) => Promise<KnowledgeBaseSourcesResponse>;
45
+ deleteSource: (sourceId: string, knowledgeBaseId: string) => Promise<KnowledgeBaseResponse>;
46
+ update: (knowledgeBaseId: string, input: KnowledgeBaseUpdateInput) => Promise<KnowledgeBaseResponse>;
47
+ presignFile: (knowledgeBaseId: string, input: PresignFileInput) => Promise<PresignFileResponse>;
48
+ completeFile: (knowledgeBaseId: string, sourceId: string) => Promise<KnowledgeBaseResponse>;
49
+ failFile: (knowledgeBaseId: string, sourceId: string, input?: FailFileInput) => Promise<KnowledgeBaseResponse>;
50
+ reindex: (knowledgeBaseId: string) => Promise<KnowledgeBaseResponse>;
51
+ updateSource: (knowledgeBaseId: string, sourceId: string, input: UpdateSourceInput) => Promise<KnowledgeBaseResponse>;
52
+ updateChunk: (knowledgeBaseId: string, chunkId: string, input: UpdateChunkInput) => Promise<OkResponse>;
53
+ getSource: (knowledgeBaseId: string, sourceId: string) => Promise<KnowledgeBaseSourceDetail>;
54
+ presignFileDownload: (knowledgeBaseId: string, sourceId: string) => Promise<PresignFileDownloadResponse>;
55
+ };
56
+ readonly contact: {
57
+ list: (params?: ListContactsParams) => Promise<Page<Contact>>;
58
+ create: (input: CreateContactInput) => Promise<CreateContactResponse>;
59
+ };
60
+ readonly agent: {
61
+ list: (params?: PageParams) => Promise<Page<Agent>>;
62
+ };
63
+ readonly calendar: {
64
+ /** Active calendars with their active event types: the source of `calendar_id` and `event_type_id`. */
65
+ listCalendars: (params?: PageParams) => Promise<Page<Calendar>>;
66
+ listEvents: (params?: ListCalendarEventsParams) => Promise<Page<CalendarEvent>>;
67
+ createEvent: (input: CreateCalendarEventInput) => Promise<CreateCalendarEventResponse>;
68
+ /** Reschedules a confirmed event (`start_time`) and/or edits customer fields, notes and metadata. */
69
+ updateEvent: (id: string, input: UpdateCalendarEventInput) => Promise<CalendarEvent>;
70
+ /** Soft cancel: the event stays listed with status `cancelled`. Cancelling twice is a no-op. */
71
+ cancelEvent: (id: string) => Promise<CalendarEvent>;
72
+ };
73
+ readonly message: {
74
+ list: (params?: ListMessagesParams) => Promise<Page<Message>>;
75
+ /** One message by id (the `id` of a send response), with its current delivery `status`. */
76
+ get: (id: string) => Promise<Message>;
77
+ sendSms: (input: SendSmsInput) => Promise<SendMessageResponse>;
78
+ sendWhatsapp: (input: SendWhatsappInput) => Promise<SendMessageResponse>;
79
+ sendEmail: (input: SendEmailInput) => Promise<SendMessageResponse>;
80
+ };
81
+ readonly tts: {
82
+ create: (input: CreateTtsInput) => Promise<CreateTtsResponse>;
83
+ list: (params?: ListTtsParams) => Promise<Page<TtsGeneration>>;
84
+ get: (id: string) => Promise<TtsGeneration>;
85
+ };
86
+ readonly webhookEndpoint: {
87
+ /** Resolves with the signing `secret`, shown only here and in `rotateSecret`. */
88
+ create: (input: CreateWebhookEndpointInput) => Promise<WebhookEndpointWithSecret>;
89
+ list: (params?: PageParams) => Promise<Page<WebhookEndpoint>>;
90
+ get: (id: string) => Promise<WebhookEndpoint>;
91
+ update: (id: string, input: UpdateWebhookEndpointInput) => Promise<WebhookEndpoint>;
92
+ delete: (id: string) => Promise<OkResponse>;
93
+ /** New secret now; the previous one keeps signing deliveries for 24 hours. */
94
+ rotateSecret: (id: string) => Promise<WebhookEndpointWithSecret>;
95
+ /** Sends a test event (`livemode: false`) and waits up to 12 seconds for its first attempt. */
96
+ test: (id: string, input?: TestWebhookEndpointInput) => Promise<TestWebhookEndpointResponse>;
97
+ listDeliveries: (params?: ListWebhookDeliveriesParams) => Promise<Page<WebhookDelivery>>;
98
+ /** HTTP attempts of one delivery, oldest first. */
99
+ listDeliveryAttempts: (params: ListWebhookDeliveryAttemptsParams) => Promise<Page<WebhookDeliveryAttempt>>;
100
+ /** Sends the event of a delivery again (same event id and body) as a new delivery. Events from the last 30 days only. */
101
+ redeliver: (deliveryId: string) => Promise<WebhookDelivery>;
102
+ };
103
+ readonly event: {
104
+ /** Events of the last 30 days as delivered (each item is the parsed envelope). */
105
+ list: (params?: ListEventsParams) => Promise<Page<WebhookEvent<Record<string, unknown>>>>;
106
+ get: (id: string) => Promise<WebhookEvent<Record<string, unknown>>>;
107
+ };
108
+ private request;
109
+ }
110
+
111
+ /** Thrown for every non-2xx response, network failure or unparseable 2xx response. */
112
+ declare class ReplicerError extends Error {
113
+ /** HTTP status code (0 when the request never produced a response). */
114
+ readonly status: number;
115
+ /** `body.code` when the API sent one, else `network_error`, `invalid_response` or `http_<status>`. */
116
+ readonly code: string;
117
+ /** Parsed JSON error body, or the raw response text when it was not JSON. */
118
+ readonly body: unknown;
119
+ /** Request path (without the base URL or query string). */
120
+ readonly path: string;
121
+ /** `x-request-id` response header, when present. */
122
+ readonly requestId: string | undefined;
123
+ /** Seconds to wait before retrying (from `Retry-After` on a 429), when provided. */
124
+ readonly retryAfter: number | undefined;
125
+ constructor(init: {
126
+ status: number;
127
+ code: string;
128
+ message: string;
129
+ body?: unknown;
130
+ path?: string;
131
+ requestId?: string;
132
+ retryAfter?: number;
133
+ cause?: unknown;
134
+ });
135
+ /** Best human-readable message: the API's `error` string, else the raw text body, else `message`. */
136
+ get errorMessage(): string;
137
+ }
138
+
139
+ /**
140
+ * HTTP surface of the SDK. Every SDK method is driven by one entry (looked up by `sdk`), and
141
+ * `test/contract.test.ts` checks this table against the public route list
142
+ * (`microservices/internal/apiserver/proxy_routes.json`) so the two cannot drift. `:name` segments
143
+ * are path params (URL-encoded by the client).
144
+ *
145
+ * Each entry also names its wire types, which `docs-site/scripts/gen.mjs` turns into the OpenAPI
146
+ * request/response schemas (generated from `types.ts`):
147
+ * - `request`: the JSON body type (POST/PATCH/PUT) or the query-parameter type (GET/DELETE), or
148
+ * `'none'` when the route takes neither
149
+ * - `response`: the success body type (`Page<T>` for lists), or `'none'` for an empty body
150
+ * - `status`: the success HTTP status (creates and webhook redelivery 201, asynchronous sends and
151
+ * call placement 202, empty body 204)
152
+ * - `errors`: every error the route can answer, as `[status, code]` pairs (flat `{ error, code }` body):
153
+ * gateway errors (401 unauthorized, 403 insufficient_scope, 429 rate_limit_exceeded) plus what the
154
+ * engine returns for this route. Emitted as the OpenAPI error responses (429 with `Retry-After`).
155
+ * `test/contract.test.ts` checks that every entry has all four, that the types exist and that the
156
+ * errors match the engine sources.
157
+ */
158
+ declare const ROUTES: readonly [{
159
+ readonly method: "POST";
160
+ readonly path: "/v1/create-phone-call";
161
+ readonly sdk: "call.createPhoneCall";
162
+ readonly request: "CreatePhoneCallInput";
163
+ readonly response: "EnqueueCallResponse";
164
+ readonly status: 202;
165
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [404, "not_found"], readonly [422, "idempotency_key_reuse"], readonly [429, "rate_limit_exceeded"], readonly [429, "rate_limited"], readonly [502, "bad_gateway"]];
166
+ }, {
167
+ readonly method: "POST";
168
+ readonly path: "/v1/cancel-call";
169
+ readonly sdk: "call.cancel";
170
+ readonly request: "CancelCallInput";
171
+ readonly response: "OkResponse";
172
+ readonly status: 200;
173
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [404, "not_found"], readonly [429, "rate_limit_exceeded"], readonly [502, "bad_gateway"]];
174
+ }, {
175
+ readonly method: "POST";
176
+ readonly path: "/v1/cancel-campaign-pending";
177
+ readonly sdk: "call.cancelCampaignPending";
178
+ readonly request: "CancelCampaignPendingInput";
179
+ readonly response: "CancelCampaignPendingResponse";
180
+ readonly status: 200;
181
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [404, "not_found"], readonly [429, "rate_limit_exceeded"]];
182
+ }, {
183
+ readonly method: "GET";
184
+ readonly path: "/v1/list-calls";
185
+ readonly sdk: "call.list";
186
+ readonly request: "ListCallsParams";
187
+ readonly response: "Page<Call>";
188
+ readonly status: 200;
189
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [429, "rate_limit_exceeded"]];
190
+ }, {
191
+ readonly method: "GET";
192
+ readonly path: "/v1/get-call/:id";
193
+ readonly sdk: "call.get";
194
+ readonly request: "none";
195
+ readonly response: "Call";
196
+ readonly status: 200;
197
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [404, "not_found"], readonly [429, "rate_limit_exceeded"]];
198
+ }, {
199
+ readonly method: "POST";
200
+ readonly path: "/v1/campaigns";
201
+ readonly sdk: "campaign.create";
202
+ readonly request: "CreateCampaignInput";
203
+ readonly response: "CreateCampaignResponse";
204
+ readonly status: 201;
205
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "forbidden"], readonly [403, "insufficient_scope"], readonly [404, "not_found"], readonly [409, "conflict"], readonly [422, "idempotency_key_reuse"], readonly [422, "validation_error"], readonly [429, "rate_limit_exceeded"]];
206
+ }, {
207
+ readonly method: "GET";
208
+ readonly path: "/v1/campaigns/:id";
209
+ readonly sdk: "campaign.get";
210
+ readonly request: "none";
211
+ readonly response: "GetCampaignResponse";
212
+ readonly status: 200;
213
+ readonly errors: readonly [readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [404, "not_found"], readonly [429, "rate_limit_exceeded"]];
214
+ }, {
215
+ readonly method: "GET";
216
+ readonly path: "/v1/list-campaigns";
217
+ readonly sdk: "campaign.list";
218
+ readonly request: "ListCampaignsParams";
219
+ readonly response: "Page<Campaign>";
220
+ readonly status: 200;
221
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [429, "rate_limit_exceeded"]];
222
+ }, {
223
+ readonly method: "POST";
224
+ readonly path: "/v1/start-campaign/:id";
225
+ readonly sdk: "campaign.start";
226
+ readonly request: "none";
227
+ readonly response: "StartCampaignResponse";
228
+ readonly status: 200;
229
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [402, "insufficient_balance"], readonly [403, "forbidden"], readonly [403, "insufficient_scope"], readonly [404, "not_found"], readonly [429, "rate_limit_exceeded"]];
230
+ }, {
231
+ readonly method: "GET";
232
+ readonly path: "/v1/list-phone-numbers";
233
+ readonly sdk: "phoneNumber.list";
234
+ readonly request: "PageParams";
235
+ readonly response: "Page<PhoneNumber>";
236
+ readonly status: 200;
237
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [429, "rate_limit_exceeded"]];
238
+ }, {
239
+ readonly method: "POST";
240
+ readonly path: "/v1/phone-numbers/inbound";
241
+ readonly sdk: "phoneNumber.provisionInbound";
242
+ readonly request: "ProvisionInboundInput";
243
+ readonly response: "ProvisionInboundResponse";
244
+ readonly status: 200;
245
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [403, "test_mode_unsupported"], readonly [404, "not_found"], readonly [409, "conflict"], readonly [429, "rate_limit_exceeded"], readonly [502, "bad_gateway"]];
246
+ }, {
247
+ readonly method: "DELETE";
248
+ readonly path: "/v1/phone-numbers/inbound/:id";
249
+ readonly sdk: "phoneNumber.deprovisionInbound";
250
+ readonly request: "DeprovisionInboundParams";
251
+ readonly response: "OkResponse";
252
+ readonly status: 200;
253
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [403, "test_mode_unsupported"], readonly [404, "not_found"], readonly [429, "rate_limit_exceeded"], readonly [502, "bad_gateway"]];
254
+ }, {
255
+ readonly method: "POST";
256
+ readonly path: "/v1/create-knowledge-base";
257
+ readonly sdk: "knowledgeBase.create";
258
+ readonly request: "KnowledgeBaseCreateInput";
259
+ readonly response: "KnowledgeBaseSourcesResponse";
260
+ readonly status: 201;
261
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [403, "quota_exceeded"], readonly [429, "rate_limit_exceeded"], readonly [503, "internal_error"]];
262
+ }, {
263
+ readonly method: "GET";
264
+ readonly path: "/v1/get-knowledge-base/:id";
265
+ readonly sdk: "knowledgeBase.retrieve";
266
+ readonly request: "none";
267
+ readonly response: "KnowledgeBaseResponse";
268
+ readonly status: 200;
269
+ readonly errors: readonly [readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [404, "not_found"], readonly [429, "rate_limit_exceeded"], readonly [503, "internal_error"]];
270
+ }, {
271
+ readonly method: "GET";
272
+ readonly path: "/v1/list-knowledge-bases";
273
+ readonly sdk: "knowledgeBase.list";
274
+ readonly request: "none";
275
+ readonly response: "KnowledgeBaseListResponse";
276
+ readonly status: 200;
277
+ readonly errors: readonly [readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [429, "rate_limit_exceeded"], readonly [503, "internal_error"]];
278
+ }, {
279
+ readonly method: "DELETE";
280
+ readonly path: "/v1/delete-knowledge-base/:id";
281
+ readonly sdk: "knowledgeBase.delete";
282
+ readonly request: "none";
283
+ readonly response: "none";
284
+ readonly status: 204;
285
+ readonly errors: readonly [readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [404, "not_found"], readonly [429, "rate_limit_exceeded"], readonly [503, "internal_error"]];
286
+ }, {
287
+ readonly method: "POST";
288
+ readonly path: "/v1/add-knowledge-base-sources/:id";
289
+ readonly sdk: "knowledgeBase.addSources";
290
+ readonly request: "KnowledgeBaseAddSourcesInput";
291
+ readonly response: "KnowledgeBaseSourcesResponse";
292
+ readonly status: 200;
293
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [403, "quota_exceeded"], readonly [404, "not_found"], readonly [429, "rate_limit_exceeded"], readonly [503, "internal_error"]];
294
+ }, {
295
+ readonly method: "DELETE";
296
+ readonly path: "/v1/delete-knowledge-base-source/:source_id";
297
+ readonly sdk: "knowledgeBase.deleteSource";
298
+ readonly request: "DeleteKnowledgeBaseSourceParams";
299
+ readonly response: "KnowledgeBaseResponse";
300
+ readonly status: 200;
301
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [404, "not_found"], readonly [429, "rate_limit_exceeded"], readonly [503, "internal_error"]];
302
+ }, {
303
+ readonly method: "PATCH";
304
+ readonly path: "/v1/update-knowledge-base/:id";
305
+ readonly sdk: "knowledgeBase.update";
306
+ readonly request: "KnowledgeBaseUpdateInput";
307
+ readonly response: "KnowledgeBaseResponse";
308
+ readonly status: 200;
309
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [404, "not_found"], readonly [429, "rate_limit_exceeded"], readonly [503, "internal_error"]];
310
+ }, {
311
+ readonly method: "POST";
312
+ readonly path: "/v1/presign-knowledge-base-file/:id";
313
+ readonly sdk: "knowledgeBase.presignFile";
314
+ readonly request: "PresignFileInput";
315
+ readonly response: "PresignFileResponse";
316
+ readonly status: 200;
317
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [403, "quota_exceeded"], readonly [404, "not_found"], readonly [429, "rate_limit_exceeded"], readonly [503, "internal_error"]];
318
+ }, {
319
+ readonly method: "POST";
320
+ readonly path: "/v1/complete-knowledge-base-file/:id/:source_id";
321
+ readonly sdk: "knowledgeBase.completeFile";
322
+ readonly request: "none";
323
+ readonly response: "KnowledgeBaseResponse";
324
+ readonly status: 200;
325
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [404, "not_found"], readonly [409, "conflict"], readonly [429, "rate_limit_exceeded"], readonly [503, "internal_error"]];
326
+ }, {
327
+ readonly method: "POST";
328
+ readonly path: "/v1/fail-knowledge-base-file/:id/:source_id";
329
+ readonly sdk: "knowledgeBase.failFile";
330
+ readonly request: "FailFileInput";
331
+ readonly response: "KnowledgeBaseResponse";
332
+ readonly status: 200;
333
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [404, "not_found"], readonly [409, "conflict"], readonly [429, "rate_limit_exceeded"], readonly [503, "internal_error"]];
334
+ }, {
335
+ readonly method: "PUT";
336
+ readonly path: "/v1/reindex-knowledge-base/:id";
337
+ readonly sdk: "knowledgeBase.reindex";
338
+ readonly request: "none";
339
+ readonly response: "KnowledgeBaseResponse";
340
+ readonly status: 200;
341
+ readonly errors: readonly [readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [404, "not_found"], readonly [409, "conflict"], readonly [429, "rate_limit_exceeded"], readonly [503, "internal_error"]];
342
+ }, {
343
+ readonly method: "PATCH";
344
+ readonly path: "/v1/update-knowledge-base-source/:id/:source_id";
345
+ readonly sdk: "knowledgeBase.updateSource";
346
+ readonly request: "UpdateSourceInput";
347
+ readonly response: "KnowledgeBaseResponse";
348
+ readonly status: 200;
349
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [404, "not_found"], readonly [429, "rate_limit_exceeded"], readonly [503, "internal_error"]];
350
+ }, {
351
+ readonly method: "PATCH";
352
+ readonly path: "/v1/update-knowledge-base-chunk/:id/:chunk_id";
353
+ readonly sdk: "knowledgeBase.updateChunk";
354
+ readonly request: "UpdateChunkInput";
355
+ readonly response: "OkResponse";
356
+ readonly status: 200;
357
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [404, "not_found"], readonly [429, "rate_limit_exceeded"], readonly [503, "internal_error"]];
358
+ }, {
359
+ readonly method: "GET";
360
+ readonly path: "/v1/get-knowledge-base-source/:id/:source_id";
361
+ readonly sdk: "knowledgeBase.getSource";
362
+ readonly request: "none";
363
+ readonly response: "KnowledgeBaseSourceDetail";
364
+ readonly status: 200;
365
+ readonly errors: readonly [readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [404, "not_found"], readonly [429, "rate_limit_exceeded"], readonly [503, "internal_error"]];
366
+ }, {
367
+ readonly method: "GET";
368
+ readonly path: "/v1/presign-knowledge-base-file-download/:id/:source_id";
369
+ readonly sdk: "knowledgeBase.presignFileDownload";
370
+ readonly request: "none";
371
+ readonly response: "PresignFileDownloadResponse";
372
+ readonly status: 200;
373
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [404, "not_found"], readonly [409, "conflict"], readonly [429, "rate_limit_exceeded"], readonly [503, "internal_error"]];
374
+ }, {
375
+ readonly method: "GET";
376
+ readonly path: "/v1/list-contacts";
377
+ readonly sdk: "contact.list";
378
+ readonly request: "ListContactsParams";
379
+ readonly response: "Page<Contact>";
380
+ readonly status: 200;
381
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [429, "rate_limit_exceeded"]];
382
+ }, {
383
+ readonly method: "POST";
384
+ readonly path: "/v1/create-contact";
385
+ readonly sdk: "contact.create";
386
+ readonly request: "CreateContactInput";
387
+ readonly response: "CreateContactResponse";
388
+ readonly status: 201;
389
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [429, "rate_limit_exceeded"]];
390
+ }, {
391
+ readonly method: "GET";
392
+ readonly path: "/v1/list-agents";
393
+ readonly sdk: "agent.list";
394
+ readonly request: "PageParams";
395
+ readonly response: "Page<Agent>";
396
+ readonly status: 200;
397
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [429, "rate_limit_exceeded"]];
398
+ }, {
399
+ readonly method: "GET";
400
+ readonly path: "/v1/list-calendars";
401
+ readonly sdk: "calendar.listCalendars";
402
+ readonly request: "PageParams";
403
+ readonly response: "Page<Calendar>";
404
+ readonly status: 200;
405
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [429, "rate_limit_exceeded"]];
406
+ }, {
407
+ readonly method: "GET";
408
+ readonly path: "/v1/list-calendar-events";
409
+ readonly sdk: "calendar.listEvents";
410
+ readonly request: "ListCalendarEventsParams";
411
+ readonly response: "Page<CalendarEvent>";
412
+ readonly status: 200;
413
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [429, "rate_limit_exceeded"]];
414
+ }, {
415
+ readonly method: "POST";
416
+ readonly path: "/v1/create-calendar-event";
417
+ readonly sdk: "calendar.createEvent";
418
+ readonly request: "CreateCalendarEventInput";
419
+ readonly response: "CreateCalendarEventResponse";
420
+ readonly status: 201;
421
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [409, "conflict"], readonly [429, "rate_limit_exceeded"]];
422
+ }, {
423
+ readonly method: "PATCH";
424
+ readonly path: "/v1/update-calendar-event/:id";
425
+ readonly sdk: "calendar.updateEvent";
426
+ readonly request: "UpdateCalendarEventInput";
427
+ readonly response: "CalendarEvent";
428
+ readonly status: 200;
429
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [404, "not_found"], readonly [409, "conflict"], readonly [429, "rate_limit_exceeded"]];
430
+ }, {
431
+ readonly method: "POST";
432
+ readonly path: "/v1/cancel-calendar-event/:id";
433
+ readonly sdk: "calendar.cancelEvent";
434
+ readonly request: "none";
435
+ readonly response: "CalendarEvent";
436
+ readonly status: 200;
437
+ readonly errors: readonly [readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [404, "not_found"], readonly [409, "conflict"], readonly [429, "rate_limit_exceeded"]];
438
+ }, {
439
+ readonly method: "GET";
440
+ readonly path: "/v1/list-messages";
441
+ readonly sdk: "message.list";
442
+ readonly request: "ListMessagesParams";
443
+ readonly response: "Page<Message>";
444
+ readonly status: 200;
445
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [429, "rate_limit_exceeded"]];
446
+ }, {
447
+ readonly method: "GET";
448
+ readonly path: "/v1/get-message/:id";
449
+ readonly sdk: "message.get";
450
+ readonly request: "none";
451
+ readonly response: "Message";
452
+ readonly status: 200;
453
+ readonly errors: readonly [readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [404, "not_found"], readonly [429, "rate_limit_exceeded"]];
454
+ }, {
455
+ readonly method: "POST";
456
+ readonly path: "/v1/send-sms";
457
+ readonly sdk: "message.sendSms";
458
+ readonly request: "SendSmsInput";
459
+ readonly response: "SendMessageResponse";
460
+ readonly status: 202;
461
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [409, "conflict"], readonly [422, "channel_not_configured"], readonly [422, "idempotency_key_reuse"], readonly [422, "sender_not_supported"], readonly [422, "validation_error"], readonly [429, "rate_limit_exceeded"], readonly [502, "bad_gateway"]];
462
+ }, {
463
+ readonly method: "POST";
464
+ readonly path: "/v1/send-whatsapp";
465
+ readonly sdk: "message.sendWhatsapp";
466
+ readonly request: "SendWhatsappInput";
467
+ readonly response: "SendMessageResponse";
468
+ readonly status: 202;
469
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [409, "conflict"], readonly [422, "channel_not_configured"], readonly [422, "idempotency_key_reuse"], readonly [422, "media_not_supported"], readonly [422, "validation_error"], readonly [429, "rate_limit_exceeded"], readonly [502, "bad_gateway"]];
470
+ }, {
471
+ readonly method: "POST";
472
+ readonly path: "/v1/send-email";
473
+ readonly sdk: "message.sendEmail";
474
+ readonly request: "SendEmailInput";
475
+ readonly response: "SendMessageResponse";
476
+ readonly status: 202;
477
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [409, "conflict"], readonly [422, "channel_not_configured"], readonly [422, "email_provider_not_supported"], readonly [422, "idempotency_key_reuse"], readonly [422, "validation_error"], readonly [429, "rate_limit_exceeded"], readonly [502, "bad_gateway"]];
478
+ }, {
479
+ readonly method: "POST";
480
+ readonly path: "/v1/create-tts";
481
+ readonly sdk: "tts.create";
482
+ readonly request: "CreateTtsInput";
483
+ readonly response: "CreateTtsResponse";
484
+ readonly status: 201;
485
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [409, "conflict"], readonly [422, "idempotency_key_reuse"], readonly [422, "validation_error"], readonly [429, "rate_limit_exceeded"], readonly [502, "bad_gateway"], readonly [503, "service_unavailable"]];
486
+ }, {
487
+ readonly method: "GET";
488
+ readonly path: "/v1/list-tts";
489
+ readonly sdk: "tts.list";
490
+ readonly request: "ListTtsParams";
491
+ readonly response: "Page<TtsGeneration>";
492
+ readonly status: 200;
493
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [429, "rate_limit_exceeded"]];
494
+ }, {
495
+ readonly method: "GET";
496
+ readonly path: "/v1/get-tts/:id";
497
+ readonly sdk: "tts.get";
498
+ readonly request: "none";
499
+ readonly response: "TtsGeneration";
500
+ readonly status: 200;
501
+ readonly errors: readonly [readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [404, "not_found"], readonly [429, "rate_limit_exceeded"]];
502
+ }, {
503
+ readonly method: "POST";
504
+ readonly path: "/v1/create-webhook-endpoint";
505
+ readonly sdk: "webhookEndpoint.create";
506
+ readonly request: "CreateWebhookEndpointInput";
507
+ readonly response: "WebhookEndpointWithSecret";
508
+ readonly status: 201;
509
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [409, "conflict"], readonly [409, "webhook_endpoint_limit"], readonly [422, "idempotency_key_reuse"], readonly [422, "validation_error"], readonly [429, "rate_limit_exceeded"], readonly [503, "service_unavailable"]];
510
+ }, {
511
+ readonly method: "GET";
512
+ readonly path: "/v1/list-webhook-endpoints";
513
+ readonly sdk: "webhookEndpoint.list";
514
+ readonly request: "PageParams";
515
+ readonly response: "Page<WebhookEndpoint>";
516
+ readonly status: 200;
517
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [429, "rate_limit_exceeded"]];
518
+ }, {
519
+ readonly method: "GET";
520
+ readonly path: "/v1/get-webhook-endpoint/:id";
521
+ readonly sdk: "webhookEndpoint.get";
522
+ readonly request: "none";
523
+ readonly response: "WebhookEndpoint";
524
+ readonly status: 200;
525
+ readonly errors: readonly [readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [404, "not_found"], readonly [429, "rate_limit_exceeded"]];
526
+ }, {
527
+ readonly method: "PATCH";
528
+ readonly path: "/v1/update-webhook-endpoint/:id";
529
+ readonly sdk: "webhookEndpoint.update";
530
+ readonly request: "UpdateWebhookEndpointInput";
531
+ readonly response: "WebhookEndpoint";
532
+ readonly status: 200;
533
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [404, "not_found"], readonly [409, "webhook_endpoint_key_revoked"], readonly [409, "webhook_endpoint_admin_disabled"], readonly [429, "rate_limit_exceeded"]];
534
+ }, {
535
+ readonly method: "DELETE";
536
+ readonly path: "/v1/delete-webhook-endpoint/:id";
537
+ readonly sdk: "webhookEndpoint.delete";
538
+ readonly request: "none";
539
+ readonly response: "OkResponse";
540
+ readonly status: 200;
541
+ readonly errors: readonly [readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [404, "not_found"], readonly [429, "rate_limit_exceeded"]];
542
+ }, {
543
+ readonly method: "POST";
544
+ readonly path: "/v1/rotate-webhook-endpoint-secret/:id";
545
+ readonly sdk: "webhookEndpoint.rotateSecret";
546
+ readonly request: "none";
547
+ readonly response: "WebhookEndpointWithSecret";
548
+ readonly status: 200;
549
+ readonly errors: readonly [readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [404, "not_found"], readonly [409, "conflict"], readonly [429, "rate_limit_exceeded"], readonly [503, "service_unavailable"]];
550
+ }, {
551
+ readonly method: "POST";
552
+ readonly path: "/v1/test-webhook-endpoint/:id";
553
+ readonly sdk: "webhookEndpoint.test";
554
+ readonly request: "TestWebhookEndpointInput";
555
+ readonly response: "TestWebhookEndpointResponse";
556
+ readonly status: 200;
557
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [404, "not_found"], readonly [409, "conflict"], readonly [429, "rate_limit_exceeded"], readonly [429, "rate_limited"]];
558
+ }, {
559
+ readonly method: "GET";
560
+ readonly path: "/v1/list-webhook-deliveries";
561
+ readonly sdk: "webhookEndpoint.listDeliveries";
562
+ readonly request: "ListWebhookDeliveriesParams";
563
+ readonly response: "Page<WebhookDelivery>";
564
+ readonly status: 200;
565
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [429, "rate_limit_exceeded"]];
566
+ }, {
567
+ readonly method: "GET";
568
+ readonly path: "/v1/list-webhook-delivery-attempts";
569
+ readonly sdk: "webhookEndpoint.listDeliveryAttempts";
570
+ readonly request: "ListWebhookDeliveryAttemptsParams";
571
+ readonly response: "Page<WebhookDeliveryAttempt>";
572
+ readonly status: 200;
573
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [404, "not_found"], readonly [429, "rate_limit_exceeded"]];
574
+ }, {
575
+ readonly method: "POST";
576
+ readonly path: "/v1/redeliver-webhook-delivery/:id";
577
+ readonly sdk: "webhookEndpoint.redeliver";
578
+ readonly request: "none";
579
+ readonly response: "WebhookDelivery";
580
+ readonly status: 201;
581
+ readonly errors: readonly [readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [404, "not_found"], readonly [409, "conflict"], readonly [409, "redelivery_limit"], readonly [409, "webhook_endpoint_key_revoked"], readonly [429, "rate_limit_exceeded"]];
582
+ }, {
583
+ readonly method: "GET";
584
+ readonly path: "/v1/list-events";
585
+ readonly sdk: "event.list";
586
+ readonly request: "ListEventsParams";
587
+ readonly response: "Page<WebhookEventEnvelope>";
588
+ readonly status: 200;
589
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [429, "rate_limit_exceeded"]];
590
+ }, {
591
+ readonly method: "GET";
592
+ readonly path: "/v1/get-event/:id";
593
+ readonly sdk: "event.get";
594
+ readonly request: "none";
595
+ readonly response: "WebhookEventEnvelope";
596
+ readonly status: 200;
597
+ readonly errors: readonly [readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [404, "not_found"], readonly [429, "rate_limit_exceeded"]];
598
+ }];
599
+ type RouteDef = (typeof ROUTES)[number];
600
+ type SdkMethodName = RouteDef['sdk'];
601
+
602
+ export { Agent, Calendar, CalendarEvent, Call, Campaign, CancelCampaignPendingResponse, Contact, CreateCalendarEventInput, CreateCalendarEventResponse, CreateCampaignInput, CreateContactInput, CreateContactResponse, CreatePhoneCallInput, CreateTtsInput, CreateTtsResponse, CreateWebhookEndpointInput, DEFAULT_BASE_URL, EnqueueCallResponse, FailFileInput, GetCampaignResponse, KnowledgeBaseAddSourcesInput, KnowledgeBaseCreateInput, KnowledgeBaseListResponse, KnowledgeBaseResponse, KnowledgeBaseSourceDetail, KnowledgeBaseSourcesResponse, KnowledgeBaseUpdateInput, ListCalendarEventsParams, ListCallsParams, ListCampaignsParams, ListContactsParams, ListEventsParams, ListMessagesParams, ListTtsParams, ListWebhookDeliveriesParams, ListWebhookDeliveryAttemptsParams, Message, OkResponse, Page, PageParams, PhoneNumber, PresignFileDownloadResponse, PresignFileInput, PresignFileResponse, ProvisionInboundInput, ProvisionInboundResponse, ROUTES, Replicer, ReplicerError, type ReplicerOptions, type RouteDef, type SdkMethodName, SendEmailInput, SendMessageResponse, SendSmsInput, SendWhatsappInput, StartCampaignResponse, TestWebhookEndpointInput, TestWebhookEndpointResponse, TtsGeneration, UpdateCalendarEventInput, UpdateChunkInput, UpdateSourceInput, UpdateWebhookEndpointInput, WebhookDelivery, WebhookDeliveryAttempt, WebhookEndpoint, WebhookEndpointWithSecret, WebhookEvent };