@gtmi/ramp-api-client 0.0.1
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.
- package/LICENSE +21 -0
- package/README.md +59 -0
- package/dist/es/index.d.mts +3615 -0
- package/dist/es/index.mjs +2173 -0
- package/package.json +46 -0
- package/src/client.test.ts +50 -0
- package/src/client.ts +15 -0
- package/src/client.types.ts +11 -0
- package/src/generated/client/client.gen.ts +277 -0
- package/src/generated/client/index.ts +27 -0
- package/src/generated/client/types.gen.ts +214 -0
- package/src/generated/client/utils.gen.ts +316 -0
- package/src/generated/client.gen.ts +18 -0
- package/src/generated/core/auth.gen.ts +48 -0
- package/src/generated/core/bodySerializer.gen.ts +82 -0
- package/src/generated/core/params.gen.ts +178 -0
- package/src/generated/core/pathSerializer.gen.ts +171 -0
- package/src/generated/core/queryKeySerializer.gen.ts +117 -0
- package/src/generated/core/serverSentEvents.gen.ts +242 -0
- package/src/generated/core/types.gen.ts +110 -0
- package/src/generated/core/utils.gen.ts +140 -0
- package/src/generated/index.ts +268 -0
- package/src/generated/sdk.gen.ts +1590 -0
- package/src/generated/types.gen.ts +2089 -0
- package/src/generated/zod.gen.ts +358 -0
- package/src/index.ts +7 -0
|
@@ -0,0 +1,2173 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
// This file is auto-generated by @hey-api/openapi-ts
|
|
4
|
+
const jsonBodySerializer = {
|
|
5
|
+
bodySerializer: (body)=>JSON.stringify(body, (_key, value)=>typeof value === 'bigint' ? value.toString() : value)
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
// This file is auto-generated by @hey-api/openapi-ts
|
|
9
|
+
function createSseClient({ onRequest, onSseError, onSseEvent, responseTransformer, responseValidator, sseDefaultRetryDelay, sseMaxRetryAttempts, sseMaxRetryDelay, sseSleepFn, url, ...options }) {
|
|
10
|
+
let lastEventId;
|
|
11
|
+
const sleep = sseSleepFn ?? ((ms)=>new Promise((resolve)=>setTimeout(resolve, ms)));
|
|
12
|
+
const createStream = async function*() {
|
|
13
|
+
let retryDelay = sseDefaultRetryDelay ?? 3000;
|
|
14
|
+
let attempt = 0;
|
|
15
|
+
const signal = options.signal ?? new AbortController().signal;
|
|
16
|
+
while(true){
|
|
17
|
+
if (signal.aborted) break;
|
|
18
|
+
attempt++;
|
|
19
|
+
const headers = options.headers instanceof Headers ? options.headers : new Headers(options.headers);
|
|
20
|
+
if (lastEventId !== undefined) {
|
|
21
|
+
headers.set('Last-Event-ID', lastEventId);
|
|
22
|
+
}
|
|
23
|
+
try {
|
|
24
|
+
const requestInit = {
|
|
25
|
+
redirect: 'follow',
|
|
26
|
+
...options,
|
|
27
|
+
body: options.serializedBody,
|
|
28
|
+
headers,
|
|
29
|
+
signal
|
|
30
|
+
};
|
|
31
|
+
let request = new Request(url, requestInit);
|
|
32
|
+
if (onRequest) {
|
|
33
|
+
request = await onRequest(url, requestInit);
|
|
34
|
+
}
|
|
35
|
+
// fetch must be assigned here, otherwise it would throw the error:
|
|
36
|
+
// TypeError: Failed to execute 'fetch' on 'Window': Illegal invocation
|
|
37
|
+
const _fetch = options.fetch ?? globalThis.fetch;
|
|
38
|
+
const response = await _fetch(request);
|
|
39
|
+
if (!response.ok) throw new Error(`SSE failed: ${response.status} ${response.statusText}`);
|
|
40
|
+
if (!response.body) throw new Error('No body in SSE response');
|
|
41
|
+
const reader = response.body.pipeThrough(new TextDecoderStream()).getReader();
|
|
42
|
+
let buffer = '';
|
|
43
|
+
const abortHandler = ()=>{
|
|
44
|
+
try {
|
|
45
|
+
reader.cancel();
|
|
46
|
+
} catch {
|
|
47
|
+
// noop
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
signal.addEventListener('abort', abortHandler);
|
|
51
|
+
try {
|
|
52
|
+
while(true){
|
|
53
|
+
const { done, value } = await reader.read();
|
|
54
|
+
if (done) break;
|
|
55
|
+
buffer += value;
|
|
56
|
+
buffer = buffer.replace(/\r\n?/g, '\n'); // normalize line endings
|
|
57
|
+
const chunks = buffer.split('\n\n');
|
|
58
|
+
buffer = chunks.pop() ?? '';
|
|
59
|
+
for (const chunk of chunks){
|
|
60
|
+
const lines = chunk.split('\n');
|
|
61
|
+
const dataLines = [];
|
|
62
|
+
let eventName;
|
|
63
|
+
for (const line of lines){
|
|
64
|
+
if (line.startsWith('data:')) {
|
|
65
|
+
dataLines.push(line.replace(/^data:\s*/, ''));
|
|
66
|
+
} else if (line.startsWith('event:')) {
|
|
67
|
+
eventName = line.replace(/^event:\s*/, '');
|
|
68
|
+
} else if (line.startsWith('id:')) {
|
|
69
|
+
lastEventId = line.replace(/^id:\s*/, '');
|
|
70
|
+
} else if (line.startsWith('retry:')) {
|
|
71
|
+
const parsed = Number.parseInt(line.replace(/^retry:\s*/, ''), 10);
|
|
72
|
+
if (!Number.isNaN(parsed)) {
|
|
73
|
+
retryDelay = parsed;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
let data;
|
|
78
|
+
let parsedJson = false;
|
|
79
|
+
if (dataLines.length) {
|
|
80
|
+
const rawData = dataLines.join('\n');
|
|
81
|
+
try {
|
|
82
|
+
data = JSON.parse(rawData);
|
|
83
|
+
parsedJson = true;
|
|
84
|
+
} catch {
|
|
85
|
+
data = rawData;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
if (parsedJson) {
|
|
89
|
+
if (responseValidator) {
|
|
90
|
+
await responseValidator(data);
|
|
91
|
+
}
|
|
92
|
+
if (responseTransformer) {
|
|
93
|
+
data = await responseTransformer(data);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
onSseEvent?.({
|
|
97
|
+
data,
|
|
98
|
+
event: eventName,
|
|
99
|
+
id: lastEventId,
|
|
100
|
+
retry: retryDelay
|
|
101
|
+
});
|
|
102
|
+
if (dataLines.length) {
|
|
103
|
+
yield data;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
} finally{
|
|
108
|
+
signal.removeEventListener('abort', abortHandler);
|
|
109
|
+
reader.releaseLock();
|
|
110
|
+
}
|
|
111
|
+
break; // exit loop on normal completion
|
|
112
|
+
} catch (error) {
|
|
113
|
+
// connection failed or aborted; retry after delay
|
|
114
|
+
onSseError?.(error);
|
|
115
|
+
if (sseMaxRetryAttempts !== undefined && attempt >= sseMaxRetryAttempts) {
|
|
116
|
+
break; // stop after firing error
|
|
117
|
+
}
|
|
118
|
+
// exponential backoff: double retry each attempt, cap at 30s
|
|
119
|
+
const backoff = Math.min(retryDelay * 2 ** (attempt - 1), sseMaxRetryDelay ?? 30000);
|
|
120
|
+
await sleep(backoff);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
const stream = createStream();
|
|
125
|
+
return {
|
|
126
|
+
stream
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// This file is auto-generated by @hey-api/openapi-ts
|
|
131
|
+
const separatorArrayExplode = (style)=>{
|
|
132
|
+
switch(style){
|
|
133
|
+
case 'label':
|
|
134
|
+
return '.';
|
|
135
|
+
case 'matrix':
|
|
136
|
+
return ';';
|
|
137
|
+
case 'simple':
|
|
138
|
+
return ',';
|
|
139
|
+
default:
|
|
140
|
+
return '&';
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
const separatorArrayNoExplode = (style)=>{
|
|
144
|
+
switch(style){
|
|
145
|
+
case 'form':
|
|
146
|
+
return ',';
|
|
147
|
+
case 'pipeDelimited':
|
|
148
|
+
return '|';
|
|
149
|
+
case 'spaceDelimited':
|
|
150
|
+
return '%20';
|
|
151
|
+
default:
|
|
152
|
+
return ',';
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
const separatorObjectExplode = (style)=>{
|
|
156
|
+
switch(style){
|
|
157
|
+
case 'label':
|
|
158
|
+
return '.';
|
|
159
|
+
case 'matrix':
|
|
160
|
+
return ';';
|
|
161
|
+
case 'simple':
|
|
162
|
+
return ',';
|
|
163
|
+
default:
|
|
164
|
+
return '&';
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
const serializeArrayParam = ({ allowReserved, explode, name, style, value })=>{
|
|
168
|
+
if (!explode) {
|
|
169
|
+
const joinedValues = (allowReserved ? value : value.map((v)=>encodeURIComponent(v))).join(separatorArrayNoExplode(style));
|
|
170
|
+
switch(style){
|
|
171
|
+
case 'label':
|
|
172
|
+
return `.${joinedValues}`;
|
|
173
|
+
case 'matrix':
|
|
174
|
+
return `;${name}=${joinedValues}`;
|
|
175
|
+
case 'simple':
|
|
176
|
+
return joinedValues;
|
|
177
|
+
default:
|
|
178
|
+
return `${name}=${joinedValues}`;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
const separator = separatorArrayExplode(style);
|
|
182
|
+
const joinedValues = value.map((v)=>{
|
|
183
|
+
if (style === 'label' || style === 'simple') {
|
|
184
|
+
return allowReserved ? v : encodeURIComponent(v);
|
|
185
|
+
}
|
|
186
|
+
return serializePrimitiveParam({
|
|
187
|
+
allowReserved,
|
|
188
|
+
name,
|
|
189
|
+
value: v
|
|
190
|
+
});
|
|
191
|
+
}).join(separator);
|
|
192
|
+
return style === 'label' || style === 'matrix' ? separator + joinedValues : joinedValues;
|
|
193
|
+
};
|
|
194
|
+
const serializePrimitiveParam = ({ allowReserved, name, value })=>{
|
|
195
|
+
if (value === undefined || value === null) {
|
|
196
|
+
return '';
|
|
197
|
+
}
|
|
198
|
+
if (typeof value === 'object') {
|
|
199
|
+
throw new Error('Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.');
|
|
200
|
+
}
|
|
201
|
+
return `${name}=${allowReserved ? value : encodeURIComponent(value)}`;
|
|
202
|
+
};
|
|
203
|
+
const serializeObjectParam = ({ allowReserved, explode, name, style, value, valueOnly })=>{
|
|
204
|
+
if (value instanceof Date) {
|
|
205
|
+
return valueOnly ? value.toISOString() : `${name}=${value.toISOString()}`;
|
|
206
|
+
}
|
|
207
|
+
if (style !== 'deepObject' && !explode) {
|
|
208
|
+
let values = [];
|
|
209
|
+
Object.entries(value).forEach(([key, v])=>{
|
|
210
|
+
values = [
|
|
211
|
+
...values,
|
|
212
|
+
key,
|
|
213
|
+
allowReserved ? v : encodeURIComponent(v)
|
|
214
|
+
];
|
|
215
|
+
});
|
|
216
|
+
const joinedValues = values.join(',');
|
|
217
|
+
switch(style){
|
|
218
|
+
case 'form':
|
|
219
|
+
return `${name}=${joinedValues}`;
|
|
220
|
+
case 'label':
|
|
221
|
+
return `.${joinedValues}`;
|
|
222
|
+
case 'matrix':
|
|
223
|
+
return `;${name}=${joinedValues}`;
|
|
224
|
+
default:
|
|
225
|
+
return joinedValues;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
const separator = separatorObjectExplode(style);
|
|
229
|
+
const joinedValues = Object.entries(value).map(([key, v])=>serializePrimitiveParam({
|
|
230
|
+
allowReserved,
|
|
231
|
+
name: style === 'deepObject' ? `${name}[${key}]` : key,
|
|
232
|
+
value: v
|
|
233
|
+
})).join(separator);
|
|
234
|
+
return style === 'label' || style === 'matrix' ? separator + joinedValues : joinedValues;
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
// This file is auto-generated by @hey-api/openapi-ts
|
|
238
|
+
const PATH_PARAM_RE = /\{[^{}]+\}/g;
|
|
239
|
+
const defaultPathSerializer = ({ path, url: _url })=>{
|
|
240
|
+
let url = _url;
|
|
241
|
+
const matches = _url.match(PATH_PARAM_RE);
|
|
242
|
+
if (matches) {
|
|
243
|
+
for (const match of matches){
|
|
244
|
+
let explode = false;
|
|
245
|
+
let name = match.substring(1, match.length - 1);
|
|
246
|
+
let style = 'simple';
|
|
247
|
+
if (name.endsWith('*')) {
|
|
248
|
+
explode = true;
|
|
249
|
+
name = name.substring(0, name.length - 1);
|
|
250
|
+
}
|
|
251
|
+
if (name.startsWith('.')) {
|
|
252
|
+
name = name.substring(1);
|
|
253
|
+
style = 'label';
|
|
254
|
+
} else if (name.startsWith(';')) {
|
|
255
|
+
name = name.substring(1);
|
|
256
|
+
style = 'matrix';
|
|
257
|
+
}
|
|
258
|
+
const value = path[name];
|
|
259
|
+
if (value === undefined || value === null) {
|
|
260
|
+
continue;
|
|
261
|
+
}
|
|
262
|
+
if (Array.isArray(value)) {
|
|
263
|
+
url = url.replace(match, serializeArrayParam({
|
|
264
|
+
explode,
|
|
265
|
+
name,
|
|
266
|
+
style,
|
|
267
|
+
value
|
|
268
|
+
}));
|
|
269
|
+
continue;
|
|
270
|
+
}
|
|
271
|
+
if (typeof value === 'object') {
|
|
272
|
+
url = url.replace(match, serializeObjectParam({
|
|
273
|
+
explode,
|
|
274
|
+
name,
|
|
275
|
+
style,
|
|
276
|
+
value: value,
|
|
277
|
+
valueOnly: true
|
|
278
|
+
}));
|
|
279
|
+
continue;
|
|
280
|
+
}
|
|
281
|
+
if (style === 'matrix') {
|
|
282
|
+
url = url.replace(match, `;${serializePrimitiveParam({
|
|
283
|
+
name,
|
|
284
|
+
value: value
|
|
285
|
+
})}`);
|
|
286
|
+
continue;
|
|
287
|
+
}
|
|
288
|
+
const replaceValue = encodeURIComponent(style === 'label' ? `.${value}` : value);
|
|
289
|
+
url = url.replace(match, replaceValue);
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
return url;
|
|
293
|
+
};
|
|
294
|
+
const getUrl = ({ baseUrl, path, query, querySerializer, url: _url })=>{
|
|
295
|
+
const pathUrl = _url.startsWith('/') ? _url : `/${_url}`;
|
|
296
|
+
let url = (baseUrl ?? '') + pathUrl;
|
|
297
|
+
if (path) {
|
|
298
|
+
url = defaultPathSerializer({
|
|
299
|
+
path,
|
|
300
|
+
url
|
|
301
|
+
});
|
|
302
|
+
}
|
|
303
|
+
let search = query ? querySerializer(query) : '';
|
|
304
|
+
if (search.startsWith('?')) {
|
|
305
|
+
search = search.substring(1);
|
|
306
|
+
}
|
|
307
|
+
if (search) {
|
|
308
|
+
url += `?${search}`;
|
|
309
|
+
}
|
|
310
|
+
return url;
|
|
311
|
+
};
|
|
312
|
+
function getValidRequestBody(options) {
|
|
313
|
+
const hasBody = options.body !== undefined;
|
|
314
|
+
const isSerializedBody = hasBody && options.bodySerializer;
|
|
315
|
+
if (isSerializedBody) {
|
|
316
|
+
if ('serializedBody' in options) {
|
|
317
|
+
const hasSerializedBody = options.serializedBody !== undefined && options.serializedBody !== '';
|
|
318
|
+
return hasSerializedBody ? options.serializedBody : null;
|
|
319
|
+
}
|
|
320
|
+
// not all clients implement a serializedBody property (i.e., client-axios)
|
|
321
|
+
return options.body !== '' ? options.body : null;
|
|
322
|
+
}
|
|
323
|
+
// plain/text body
|
|
324
|
+
if (hasBody) {
|
|
325
|
+
return options.body;
|
|
326
|
+
}
|
|
327
|
+
// no body was provided
|
|
328
|
+
return undefined;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
// This file is auto-generated by @hey-api/openapi-ts
|
|
332
|
+
const getAuthToken = async (auth, callback)=>{
|
|
333
|
+
const token = typeof callback === 'function' ? await callback(auth) : callback;
|
|
334
|
+
if (!token) {
|
|
335
|
+
return;
|
|
336
|
+
}
|
|
337
|
+
if (auth.scheme === 'bearer') {
|
|
338
|
+
return `Bearer ${token}`;
|
|
339
|
+
}
|
|
340
|
+
if (auth.scheme === 'basic') {
|
|
341
|
+
return `Basic ${btoa(token)}`;
|
|
342
|
+
}
|
|
343
|
+
return token;
|
|
344
|
+
};
|
|
345
|
+
|
|
346
|
+
// This file is auto-generated by @hey-api/openapi-ts
|
|
347
|
+
const createQuerySerializer = ({ parameters = {}, ...args } = {})=>{
|
|
348
|
+
const querySerializer = (queryParams)=>{
|
|
349
|
+
const search = [];
|
|
350
|
+
if (queryParams && typeof queryParams === 'object') {
|
|
351
|
+
for(const name in queryParams){
|
|
352
|
+
const value = queryParams[name];
|
|
353
|
+
if (value === undefined || value === null) {
|
|
354
|
+
continue;
|
|
355
|
+
}
|
|
356
|
+
const options = parameters[name] || args;
|
|
357
|
+
if (Array.isArray(value)) {
|
|
358
|
+
const serializedArray = serializeArrayParam({
|
|
359
|
+
allowReserved: options.allowReserved,
|
|
360
|
+
explode: true,
|
|
361
|
+
name,
|
|
362
|
+
style: 'form',
|
|
363
|
+
value,
|
|
364
|
+
...options.array
|
|
365
|
+
});
|
|
366
|
+
if (serializedArray) search.push(serializedArray);
|
|
367
|
+
} else if (typeof value === 'object') {
|
|
368
|
+
const serializedObject = serializeObjectParam({
|
|
369
|
+
allowReserved: options.allowReserved,
|
|
370
|
+
explode: true,
|
|
371
|
+
name,
|
|
372
|
+
style: 'deepObject',
|
|
373
|
+
value: value,
|
|
374
|
+
...options.object
|
|
375
|
+
});
|
|
376
|
+
if (serializedObject) search.push(serializedObject);
|
|
377
|
+
} else {
|
|
378
|
+
const serializedPrimitive = serializePrimitiveParam({
|
|
379
|
+
allowReserved: options.allowReserved,
|
|
380
|
+
name,
|
|
381
|
+
value: value
|
|
382
|
+
});
|
|
383
|
+
if (serializedPrimitive) search.push(serializedPrimitive);
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
return search.join('&');
|
|
388
|
+
};
|
|
389
|
+
return querySerializer;
|
|
390
|
+
};
|
|
391
|
+
/**
|
|
392
|
+
* Infers parseAs value from provided Content-Type header.
|
|
393
|
+
*/ const getParseAs = (contentType)=>{
|
|
394
|
+
if (!contentType) {
|
|
395
|
+
// If no Content-Type header is provided, the best we can do is return the raw response body,
|
|
396
|
+
// which is effectively the same as the 'stream' option.
|
|
397
|
+
return 'stream';
|
|
398
|
+
}
|
|
399
|
+
const cleanContent = contentType.split(';')[0]?.trim();
|
|
400
|
+
if (!cleanContent) {
|
|
401
|
+
return;
|
|
402
|
+
}
|
|
403
|
+
if (cleanContent.startsWith('application/json') || cleanContent.endsWith('+json')) {
|
|
404
|
+
return 'json';
|
|
405
|
+
}
|
|
406
|
+
if (cleanContent === 'multipart/form-data') {
|
|
407
|
+
return 'formData';
|
|
408
|
+
}
|
|
409
|
+
if ([
|
|
410
|
+
'application/',
|
|
411
|
+
'audio/',
|
|
412
|
+
'image/',
|
|
413
|
+
'video/'
|
|
414
|
+
].some((type)=>cleanContent.startsWith(type))) {
|
|
415
|
+
return 'blob';
|
|
416
|
+
}
|
|
417
|
+
if (cleanContent.startsWith('text/')) {
|
|
418
|
+
return 'text';
|
|
419
|
+
}
|
|
420
|
+
return;
|
|
421
|
+
};
|
|
422
|
+
const checkForExistence = (options, name)=>{
|
|
423
|
+
if (!name) {
|
|
424
|
+
return false;
|
|
425
|
+
}
|
|
426
|
+
if (options.headers.has(name) || options.query?.[name] || options.headers.get('Cookie')?.includes(`${name}=`)) {
|
|
427
|
+
return true;
|
|
428
|
+
}
|
|
429
|
+
return false;
|
|
430
|
+
};
|
|
431
|
+
async function setAuthParams(options) {
|
|
432
|
+
for (const auth of options.security ?? []){
|
|
433
|
+
if (checkForExistence(options, auth.name)) {
|
|
434
|
+
continue;
|
|
435
|
+
}
|
|
436
|
+
const token = await getAuthToken(auth, options.auth);
|
|
437
|
+
if (!token) {
|
|
438
|
+
continue;
|
|
439
|
+
}
|
|
440
|
+
const name = auth.name ?? 'Authorization';
|
|
441
|
+
switch(auth.in){
|
|
442
|
+
case 'query':
|
|
443
|
+
if (!options.query) {
|
|
444
|
+
options.query = {};
|
|
445
|
+
}
|
|
446
|
+
options.query[name] = token;
|
|
447
|
+
break;
|
|
448
|
+
case 'cookie':
|
|
449
|
+
options.headers.append('Cookie', `${name}=${token}`);
|
|
450
|
+
break;
|
|
451
|
+
case 'header':
|
|
452
|
+
default:
|
|
453
|
+
options.headers.set(name, token);
|
|
454
|
+
break;
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
const buildUrl = (options)=>getUrl({
|
|
459
|
+
baseUrl: options.baseUrl,
|
|
460
|
+
path: options.path,
|
|
461
|
+
query: options.query,
|
|
462
|
+
querySerializer: typeof options.querySerializer === 'function' ? options.querySerializer : createQuerySerializer(options.querySerializer),
|
|
463
|
+
url: options.url
|
|
464
|
+
});
|
|
465
|
+
const mergeConfigs = (a, b)=>{
|
|
466
|
+
const config = {
|
|
467
|
+
...a,
|
|
468
|
+
...b
|
|
469
|
+
};
|
|
470
|
+
if (config.baseUrl?.endsWith('/')) {
|
|
471
|
+
config.baseUrl = config.baseUrl.substring(0, config.baseUrl.length - 1);
|
|
472
|
+
}
|
|
473
|
+
config.headers = mergeHeaders(a.headers, b.headers);
|
|
474
|
+
return config;
|
|
475
|
+
};
|
|
476
|
+
const headersEntries = (headers)=>{
|
|
477
|
+
const entries = [];
|
|
478
|
+
headers.forEach((value, key)=>{
|
|
479
|
+
entries.push([
|
|
480
|
+
key,
|
|
481
|
+
value
|
|
482
|
+
]);
|
|
483
|
+
});
|
|
484
|
+
return entries;
|
|
485
|
+
};
|
|
486
|
+
const mergeHeaders = (...headers)=>{
|
|
487
|
+
const mergedHeaders = new Headers();
|
|
488
|
+
for (const header of headers){
|
|
489
|
+
if (!header) {
|
|
490
|
+
continue;
|
|
491
|
+
}
|
|
492
|
+
const iterator = header instanceof Headers ? headersEntries(header) : Object.entries(header);
|
|
493
|
+
for (const [key, value] of iterator){
|
|
494
|
+
if (value === null) {
|
|
495
|
+
mergedHeaders.delete(key);
|
|
496
|
+
} else if (Array.isArray(value)) {
|
|
497
|
+
for (const v of value){
|
|
498
|
+
mergedHeaders.append(key, v);
|
|
499
|
+
}
|
|
500
|
+
} else if (value !== undefined) {
|
|
501
|
+
// assume object headers are meant to be JSON stringified, i.e., their
|
|
502
|
+
// content value in OpenAPI specification is 'application/json'
|
|
503
|
+
mergedHeaders.set(key, typeof value === 'object' ? JSON.stringify(value) : value);
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
return mergedHeaders;
|
|
508
|
+
};
|
|
509
|
+
class Interceptors {
|
|
510
|
+
clear() {
|
|
511
|
+
this.fns = [];
|
|
512
|
+
}
|
|
513
|
+
eject(id) {
|
|
514
|
+
const index = this.getInterceptorIndex(id);
|
|
515
|
+
if (this.fns[index]) {
|
|
516
|
+
this.fns[index] = null;
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
exists(id) {
|
|
520
|
+
const index = this.getInterceptorIndex(id);
|
|
521
|
+
return Boolean(this.fns[index]);
|
|
522
|
+
}
|
|
523
|
+
getInterceptorIndex(id) {
|
|
524
|
+
if (typeof id === 'number') {
|
|
525
|
+
return this.fns[id] ? id : -1;
|
|
526
|
+
}
|
|
527
|
+
return this.fns.indexOf(id);
|
|
528
|
+
}
|
|
529
|
+
update(id, fn) {
|
|
530
|
+
const index = this.getInterceptorIndex(id);
|
|
531
|
+
if (this.fns[index]) {
|
|
532
|
+
this.fns[index] = fn;
|
|
533
|
+
return id;
|
|
534
|
+
}
|
|
535
|
+
return false;
|
|
536
|
+
}
|
|
537
|
+
use(fn) {
|
|
538
|
+
this.fns.push(fn);
|
|
539
|
+
return this.fns.length - 1;
|
|
540
|
+
}
|
|
541
|
+
constructor(){
|
|
542
|
+
this.fns = [];
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
const createInterceptors = ()=>({
|
|
546
|
+
error: new Interceptors(),
|
|
547
|
+
request: new Interceptors(),
|
|
548
|
+
response: new Interceptors()
|
|
549
|
+
});
|
|
550
|
+
const defaultQuerySerializer = createQuerySerializer({
|
|
551
|
+
allowReserved: false,
|
|
552
|
+
array: {
|
|
553
|
+
explode: true,
|
|
554
|
+
style: 'form'
|
|
555
|
+
},
|
|
556
|
+
object: {
|
|
557
|
+
explode: true,
|
|
558
|
+
style: 'deepObject'
|
|
559
|
+
}
|
|
560
|
+
});
|
|
561
|
+
const defaultHeaders = {
|
|
562
|
+
'Content-Type': 'application/json'
|
|
563
|
+
};
|
|
564
|
+
const createConfig = (override = {})=>({
|
|
565
|
+
...jsonBodySerializer,
|
|
566
|
+
headers: defaultHeaders,
|
|
567
|
+
parseAs: 'auto',
|
|
568
|
+
querySerializer: defaultQuerySerializer,
|
|
569
|
+
...override
|
|
570
|
+
});
|
|
571
|
+
|
|
572
|
+
// This file is auto-generated by @hey-api/openapi-ts
|
|
573
|
+
const createClient = (config = {})=>{
|
|
574
|
+
let _config = mergeConfigs(createConfig(), config);
|
|
575
|
+
const getConfig = ()=>({
|
|
576
|
+
..._config
|
|
577
|
+
});
|
|
578
|
+
const setConfig = (config)=>{
|
|
579
|
+
_config = mergeConfigs(_config, config);
|
|
580
|
+
return getConfig();
|
|
581
|
+
};
|
|
582
|
+
const interceptors = createInterceptors();
|
|
583
|
+
const beforeRequest = async (options)=>{
|
|
584
|
+
const opts = {
|
|
585
|
+
..._config,
|
|
586
|
+
...options,
|
|
587
|
+
fetch: options.fetch ?? _config.fetch ?? globalThis.fetch,
|
|
588
|
+
headers: mergeHeaders(_config.headers, options.headers),
|
|
589
|
+
serializedBody: undefined
|
|
590
|
+
};
|
|
591
|
+
if (opts.security) {
|
|
592
|
+
await setAuthParams(opts);
|
|
593
|
+
}
|
|
594
|
+
if (opts.requestValidator) {
|
|
595
|
+
await opts.requestValidator(opts);
|
|
596
|
+
}
|
|
597
|
+
if (opts.body !== undefined && opts.bodySerializer) {
|
|
598
|
+
opts.serializedBody = opts.bodySerializer(opts.body);
|
|
599
|
+
}
|
|
600
|
+
// remove Content-Type header if body is empty to avoid sending invalid requests
|
|
601
|
+
if (opts.body === undefined || opts.serializedBody === '') {
|
|
602
|
+
opts.headers.delete('Content-Type');
|
|
603
|
+
}
|
|
604
|
+
const resolvedOpts = opts;
|
|
605
|
+
const url = buildUrl(resolvedOpts);
|
|
606
|
+
return {
|
|
607
|
+
opts: resolvedOpts,
|
|
608
|
+
url
|
|
609
|
+
};
|
|
610
|
+
};
|
|
611
|
+
const request = async (options)=>{
|
|
612
|
+
const throwOnError = options.throwOnError ?? _config.throwOnError;
|
|
613
|
+
const responseStyle = options.responseStyle ?? _config.responseStyle;
|
|
614
|
+
let request;
|
|
615
|
+
let response;
|
|
616
|
+
try {
|
|
617
|
+
const { opts, url } = await beforeRequest(options);
|
|
618
|
+
const requestInit = {
|
|
619
|
+
redirect: 'follow',
|
|
620
|
+
...opts,
|
|
621
|
+
body: getValidRequestBody(opts)
|
|
622
|
+
};
|
|
623
|
+
request = new Request(url, requestInit);
|
|
624
|
+
for (const fn of interceptors.request.fns){
|
|
625
|
+
if (fn) {
|
|
626
|
+
request = await fn(request, opts);
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
// fetch must be assigned here, otherwise it would throw the error:
|
|
630
|
+
// TypeError: Failed to execute 'fetch' on 'Window': Illegal invocation
|
|
631
|
+
const _fetch = opts.fetch;
|
|
632
|
+
response = await _fetch(request);
|
|
633
|
+
for (const fn of interceptors.response.fns){
|
|
634
|
+
if (fn) {
|
|
635
|
+
response = await fn(response, request, opts);
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
const result = {
|
|
639
|
+
request,
|
|
640
|
+
response
|
|
641
|
+
};
|
|
642
|
+
if (response.ok) {
|
|
643
|
+
const parseAs = (opts.parseAs === 'auto' ? getParseAs(response.headers.get('Content-Type')) : opts.parseAs) ?? 'json';
|
|
644
|
+
if (response.status === 204 || response.headers.get('Content-Length') === '0') {
|
|
645
|
+
let emptyData;
|
|
646
|
+
switch(parseAs){
|
|
647
|
+
case 'arrayBuffer':
|
|
648
|
+
case 'blob':
|
|
649
|
+
case 'text':
|
|
650
|
+
emptyData = await response[parseAs]();
|
|
651
|
+
break;
|
|
652
|
+
case 'formData':
|
|
653
|
+
emptyData = new FormData();
|
|
654
|
+
break;
|
|
655
|
+
case 'stream':
|
|
656
|
+
emptyData = response.body;
|
|
657
|
+
break;
|
|
658
|
+
case 'json':
|
|
659
|
+
default:
|
|
660
|
+
emptyData = {};
|
|
661
|
+
break;
|
|
662
|
+
}
|
|
663
|
+
return opts.responseStyle === 'data' ? emptyData : {
|
|
664
|
+
data: emptyData,
|
|
665
|
+
...result
|
|
666
|
+
};
|
|
667
|
+
}
|
|
668
|
+
let data;
|
|
669
|
+
switch(parseAs){
|
|
670
|
+
case 'arrayBuffer':
|
|
671
|
+
case 'blob':
|
|
672
|
+
case 'formData':
|
|
673
|
+
case 'text':
|
|
674
|
+
data = await response[parseAs]();
|
|
675
|
+
break;
|
|
676
|
+
case 'json':
|
|
677
|
+
{
|
|
678
|
+
// Some servers return 200 with no Content-Length and empty body.
|
|
679
|
+
// response.json() would throw; read as text and parse if non-empty.
|
|
680
|
+
const text = await response.text();
|
|
681
|
+
data = text ? JSON.parse(text) : {};
|
|
682
|
+
break;
|
|
683
|
+
}
|
|
684
|
+
case 'stream':
|
|
685
|
+
return opts.responseStyle === 'data' ? response.body : {
|
|
686
|
+
data: response.body,
|
|
687
|
+
...result
|
|
688
|
+
};
|
|
689
|
+
}
|
|
690
|
+
if (parseAs === 'json') {
|
|
691
|
+
if (opts.responseValidator) {
|
|
692
|
+
await opts.responseValidator(data);
|
|
693
|
+
}
|
|
694
|
+
if (opts.responseTransformer) {
|
|
695
|
+
data = await opts.responseTransformer(data);
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
return opts.responseStyle === 'data' ? data : {
|
|
699
|
+
data,
|
|
700
|
+
...result
|
|
701
|
+
};
|
|
702
|
+
}
|
|
703
|
+
const textError = await response.text();
|
|
704
|
+
let jsonError;
|
|
705
|
+
try {
|
|
706
|
+
jsonError = JSON.parse(textError);
|
|
707
|
+
} catch {
|
|
708
|
+
// noop
|
|
709
|
+
}
|
|
710
|
+
throw jsonError ?? textError;
|
|
711
|
+
} catch (error) {
|
|
712
|
+
let finalError = error;
|
|
713
|
+
for (const fn of interceptors.error.fns){
|
|
714
|
+
if (fn) {
|
|
715
|
+
finalError = await fn(finalError, response, request, options);
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
finalError = finalError || {};
|
|
719
|
+
if (throwOnError) {
|
|
720
|
+
throw finalError;
|
|
721
|
+
}
|
|
722
|
+
// TODO: we probably want to return error and improve types
|
|
723
|
+
return responseStyle === 'data' ? undefined : {
|
|
724
|
+
error: finalError,
|
|
725
|
+
request,
|
|
726
|
+
response
|
|
727
|
+
};
|
|
728
|
+
}
|
|
729
|
+
};
|
|
730
|
+
const makeMethodFn = (method)=>(options)=>request({
|
|
731
|
+
...options,
|
|
732
|
+
method
|
|
733
|
+
});
|
|
734
|
+
const makeSseFn = (method)=>async (options)=>{
|
|
735
|
+
const { opts, url } = await beforeRequest(options);
|
|
736
|
+
return createSseClient({
|
|
737
|
+
...opts,
|
|
738
|
+
body: opts.body,
|
|
739
|
+
method,
|
|
740
|
+
onRequest: async (url, init)=>{
|
|
741
|
+
let request = new Request(url, init);
|
|
742
|
+
for (const fn of interceptors.request.fns){
|
|
743
|
+
if (fn) {
|
|
744
|
+
request = await fn(request, opts);
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
return request;
|
|
748
|
+
},
|
|
749
|
+
serializedBody: getValidRequestBody(opts),
|
|
750
|
+
url
|
|
751
|
+
});
|
|
752
|
+
};
|
|
753
|
+
const _buildUrl = (options)=>buildUrl({
|
|
754
|
+
..._config,
|
|
755
|
+
...options
|
|
756
|
+
});
|
|
757
|
+
return {
|
|
758
|
+
buildUrl: _buildUrl,
|
|
759
|
+
connect: makeMethodFn('CONNECT'),
|
|
760
|
+
delete: makeMethodFn('DELETE'),
|
|
761
|
+
get: makeMethodFn('GET'),
|
|
762
|
+
getConfig,
|
|
763
|
+
head: makeMethodFn('HEAD'),
|
|
764
|
+
interceptors,
|
|
765
|
+
options: makeMethodFn('OPTIONS'),
|
|
766
|
+
patch: makeMethodFn('PATCH'),
|
|
767
|
+
post: makeMethodFn('POST'),
|
|
768
|
+
put: makeMethodFn('PUT'),
|
|
769
|
+
request,
|
|
770
|
+
setConfig,
|
|
771
|
+
sse: {
|
|
772
|
+
connect: makeSseFn('CONNECT'),
|
|
773
|
+
delete: makeSseFn('DELETE'),
|
|
774
|
+
get: makeSseFn('GET'),
|
|
775
|
+
head: makeSseFn('HEAD'),
|
|
776
|
+
options: makeSseFn('OPTIONS'),
|
|
777
|
+
patch: makeSseFn('PATCH'),
|
|
778
|
+
post: makeSseFn('POST'),
|
|
779
|
+
put: makeSseFn('PUT'),
|
|
780
|
+
trace: makeSseFn('TRACE')
|
|
781
|
+
},
|
|
782
|
+
trace: makeMethodFn('TRACE')
|
|
783
|
+
};
|
|
784
|
+
};
|
|
785
|
+
|
|
786
|
+
const createRampApiClient = ({ baseUrl, getAuthToken, ...config })=>createClient(createConfig({
|
|
787
|
+
baseUrl,
|
|
788
|
+
...getAuthToken ? {
|
|
789
|
+
auth: getAuthToken
|
|
790
|
+
} : {},
|
|
791
|
+
...config
|
|
792
|
+
}));
|
|
793
|
+
|
|
794
|
+
// This file is auto-generated by @hey-api/openapi-ts
|
|
795
|
+
const client = createClient(createConfig());
|
|
796
|
+
|
|
797
|
+
// This file is auto-generated by @hey-api/openapi-ts
|
|
798
|
+
/**
|
|
799
|
+
* GET /health
|
|
800
|
+
*
|
|
801
|
+
* Health check endpoint for the API service
|
|
802
|
+
*/ const getHealth = (options)=>(options?.client ?? client).get({
|
|
803
|
+
url: '/health',
|
|
804
|
+
...options
|
|
805
|
+
});
|
|
806
|
+
/**
|
|
807
|
+
* POST /conversations/token
|
|
808
|
+
*
|
|
809
|
+
* Generates a Twilio Access Token with Chat Grant for Conversations API access
|
|
810
|
+
*/ const postConversationsToken = (options)=>(options.client ?? client).post({
|
|
811
|
+
url: '/conversations/token',
|
|
812
|
+
...options,
|
|
813
|
+
headers: {
|
|
814
|
+
'Content-Type': 'application/json',
|
|
815
|
+
...options.headers
|
|
816
|
+
}
|
|
817
|
+
});
|
|
818
|
+
/**
|
|
819
|
+
* GET /sync/token
|
|
820
|
+
*
|
|
821
|
+
* Generates a Twilio Access Token with a SyncGrant so frontends
|
|
822
|
+
* can subscribe to Sync Streams via the twilio-sync JS SDK.
|
|
823
|
+
*/ const getSyncToken = (options)=>(options?.client ?? client).get({
|
|
824
|
+
security: [
|
|
825
|
+
{
|
|
826
|
+
scheme: 'bearer',
|
|
827
|
+
type: 'http'
|
|
828
|
+
}
|
|
829
|
+
],
|
|
830
|
+
url: '/sync/token',
|
|
831
|
+
...options
|
|
832
|
+
});
|
|
833
|
+
/**
|
|
834
|
+
* GET /voice/token
|
|
835
|
+
*
|
|
836
|
+
* Generates a Twilio Access Token with a VoiceGrant so browser clients
|
|
837
|
+
* can place outbound calls via the Twilio Voice SDK (WebRTC).
|
|
838
|
+
*/ const getVoiceToken = (options)=>(options?.client ?? client).get({
|
|
839
|
+
url: '/voice/token',
|
|
840
|
+
...options
|
|
841
|
+
});
|
|
842
|
+
/**
|
|
843
|
+
* POST /ui-config
|
|
844
|
+
*
|
|
845
|
+
* uiConfigPost
|
|
846
|
+
* TODO: Add description
|
|
847
|
+
*/ const postUiConfig = (options)=>(options.client ?? client).post({
|
|
848
|
+
url: '/ui-config',
|
|
849
|
+
...options,
|
|
850
|
+
headers: {
|
|
851
|
+
'Content-Type': 'application/json',
|
|
852
|
+
...options.headers
|
|
853
|
+
}
|
|
854
|
+
});
|
|
855
|
+
/**
|
|
856
|
+
* POST /create-external-flex-connection
|
|
857
|
+
*
|
|
858
|
+
* Creates an external Flex connection by setting up Studio Flow, TwiML App, and webhook configurations
|
|
859
|
+
* for handoff from RAMP to an external Twilio Flex account
|
|
860
|
+
*/ const postCreateExternalFlexConnection = (options)=>(options.client ?? client).post({
|
|
861
|
+
security: [
|
|
862
|
+
{
|
|
863
|
+
scheme: 'bearer',
|
|
864
|
+
type: 'http'
|
|
865
|
+
}
|
|
866
|
+
],
|
|
867
|
+
url: '/create-external-flex-connection',
|
|
868
|
+
...options,
|
|
869
|
+
headers: {
|
|
870
|
+
'Content-Type': 'application/json',
|
|
871
|
+
...options.headers
|
|
872
|
+
}
|
|
873
|
+
});
|
|
874
|
+
/**
|
|
875
|
+
* POST /install-flex-plugin
|
|
876
|
+
*
|
|
877
|
+
* Installs and deploys a Twilio Flex plugin from a configured registry repository
|
|
878
|
+
*/ const postInstallFlexPlugin = (options)=>(options.client ?? client).post({
|
|
879
|
+
security: [
|
|
880
|
+
{
|
|
881
|
+
scheme: 'bearer',
|
|
882
|
+
type: 'http'
|
|
883
|
+
}
|
|
884
|
+
],
|
|
885
|
+
url: '/install-flex-plugin',
|
|
886
|
+
...options,
|
|
887
|
+
headers: {
|
|
888
|
+
'Content-Type': 'application/json',
|
|
889
|
+
...options.headers
|
|
890
|
+
}
|
|
891
|
+
});
|
|
892
|
+
/**
|
|
893
|
+
* POST /live-agent-webchat-connect
|
|
894
|
+
*
|
|
895
|
+
* Creates a Flex Interaction for live agent webchat handoff from RAMP
|
|
896
|
+
*/ const postLiveAgentWebchatConnect = (options)=>(options.client ?? client).post({
|
|
897
|
+
url: '/live-agent-webchat-connect',
|
|
898
|
+
...options,
|
|
899
|
+
headers: {
|
|
900
|
+
'Content-Type': 'application/json',
|
|
901
|
+
...options.headers
|
|
902
|
+
}
|
|
903
|
+
});
|
|
904
|
+
/**
|
|
905
|
+
* POST /live-agent-webchat-send
|
|
906
|
+
*
|
|
907
|
+
* Sends a message to a Twilio Conversation for live agent webchat
|
|
908
|
+
*/ const postLiveAgentWebchatSend = (options)=>(options.client ?? client).post({
|
|
909
|
+
security: [
|
|
910
|
+
{
|
|
911
|
+
scheme: 'bearer',
|
|
912
|
+
type: 'http'
|
|
913
|
+
}
|
|
914
|
+
],
|
|
915
|
+
url: '/live-agent-webchat-send',
|
|
916
|
+
...options,
|
|
917
|
+
headers: {
|
|
918
|
+
'Content-Type': 'application/json',
|
|
919
|
+
...options.headers
|
|
920
|
+
}
|
|
921
|
+
});
|
|
922
|
+
/**
|
|
923
|
+
* POST /live-agent-webchat-end
|
|
924
|
+
*
|
|
925
|
+
* Ends a live agent webchat session by closing the Flex Interaction Channel and Conversation
|
|
926
|
+
*/ const postLiveAgentWebchatEnd = (options)=>(options.client ?? client).post({
|
|
927
|
+
url: '/live-agent-webchat-end',
|
|
928
|
+
...options,
|
|
929
|
+
headers: {
|
|
930
|
+
'Content-Type': 'application/json',
|
|
931
|
+
...options.headers
|
|
932
|
+
}
|
|
933
|
+
});
|
|
934
|
+
/**
|
|
935
|
+
* DELETE /lead-gen
|
|
936
|
+
*
|
|
937
|
+
* Deletes a lead generation entry by removing the associated phone number from Twilio
|
|
938
|
+
* and the template record from Algolia
|
|
939
|
+
*/ const deleteLeadGen = (options)=>(options?.client ?? client).delete({
|
|
940
|
+
security: [
|
|
941
|
+
{
|
|
942
|
+
scheme: 'bearer',
|
|
943
|
+
type: 'http'
|
|
944
|
+
}
|
|
945
|
+
],
|
|
946
|
+
url: '/lead-gen',
|
|
947
|
+
...options
|
|
948
|
+
});
|
|
949
|
+
/**
|
|
950
|
+
* PATCH /lead-gen
|
|
951
|
+
*
|
|
952
|
+
* Updates the expiration date of an existing lead generation entry
|
|
953
|
+
*/ const patchLeadGen = (options)=>(options.client ?? client).patch({
|
|
954
|
+
security: [
|
|
955
|
+
{
|
|
956
|
+
scheme: 'bearer',
|
|
957
|
+
type: 'http'
|
|
958
|
+
}
|
|
959
|
+
],
|
|
960
|
+
url: '/lead-gen',
|
|
961
|
+
...options,
|
|
962
|
+
headers: {
|
|
963
|
+
'Content-Type': 'application/json',
|
|
964
|
+
...options.headers
|
|
965
|
+
}
|
|
966
|
+
});
|
|
967
|
+
/**
|
|
968
|
+
* POST /lead-gen
|
|
969
|
+
*
|
|
970
|
+
* Creates a new lead generation entry by purchasing a toll-free phone number from Twilio,
|
|
971
|
+
* configuring it with voice and SMS webhooks, and storing the mapping in Algolia
|
|
972
|
+
*/ const postLeadGen = (options)=>(options.client ?? client).post({
|
|
973
|
+
security: [
|
|
974
|
+
{
|
|
975
|
+
scheme: 'bearer',
|
|
976
|
+
type: 'http'
|
|
977
|
+
}
|
|
978
|
+
],
|
|
979
|
+
url: '/lead-gen',
|
|
980
|
+
...options,
|
|
981
|
+
headers: {
|
|
982
|
+
'Content-Type': 'application/json',
|
|
983
|
+
...options.headers
|
|
984
|
+
}
|
|
985
|
+
});
|
|
986
|
+
/**
|
|
987
|
+
* POST /lead-gen-monitor
|
|
988
|
+
*
|
|
989
|
+
* Monitors and cleans up expired lead generation entries by automatically deleting
|
|
990
|
+
* templates that have passed their expiration date
|
|
991
|
+
*/ const postLeadGenMonitor = (options)=>(options?.client ?? client).post({
|
|
992
|
+
security: [
|
|
993
|
+
{
|
|
994
|
+
scheme: 'bearer',
|
|
995
|
+
type: 'http'
|
|
996
|
+
}
|
|
997
|
+
],
|
|
998
|
+
url: '/lead-gen-monitor',
|
|
999
|
+
...options
|
|
1000
|
+
});
|
|
1001
|
+
/**
|
|
1002
|
+
* POST /conversations-communications/:conversationId
|
|
1003
|
+
*
|
|
1004
|
+
* POST handler for creating a Communication within a Conversation
|
|
1005
|
+
*/ const postConversationsCommunicationsByConversationId = (options)=>(options.client ?? client).post({
|
|
1006
|
+
security: [
|
|
1007
|
+
{
|
|
1008
|
+
scheme: 'bearer',
|
|
1009
|
+
type: 'http'
|
|
1010
|
+
}
|
|
1011
|
+
],
|
|
1012
|
+
url: '/conversations-communications/{conversationId}',
|
|
1013
|
+
...options,
|
|
1014
|
+
headers: {
|
|
1015
|
+
'Content-Type': 'application/json',
|
|
1016
|
+
...options.headers
|
|
1017
|
+
}
|
|
1018
|
+
});
|
|
1019
|
+
/**
|
|
1020
|
+
* GET /conversations-fetch
|
|
1021
|
+
*
|
|
1022
|
+
* GET handler for fetching Twilio conversation data
|
|
1023
|
+
*/ const getConversationsFetch = (options)=>(options?.client ?? client).get({
|
|
1024
|
+
security: [
|
|
1025
|
+
{
|
|
1026
|
+
scheme: 'bearer',
|
|
1027
|
+
type: 'http'
|
|
1028
|
+
}
|
|
1029
|
+
],
|
|
1030
|
+
url: '/conversations-fetch',
|
|
1031
|
+
...options
|
|
1032
|
+
});
|
|
1033
|
+
/**
|
|
1034
|
+
* POST /conversations
|
|
1035
|
+
*
|
|
1036
|
+
* POST handler for creating a new Twilio conversation
|
|
1037
|
+
*/ const postConversations = (options)=>(options.client ?? client).post({
|
|
1038
|
+
security: [
|
|
1039
|
+
{
|
|
1040
|
+
scheme: 'bearer',
|
|
1041
|
+
type: 'http'
|
|
1042
|
+
}
|
|
1043
|
+
],
|
|
1044
|
+
url: '/conversations',
|
|
1045
|
+
...options,
|
|
1046
|
+
headers: {
|
|
1047
|
+
'Content-Type': 'application/json',
|
|
1048
|
+
...options.headers
|
|
1049
|
+
}
|
|
1050
|
+
});
|
|
1051
|
+
/**
|
|
1052
|
+
* PUT /conversations
|
|
1053
|
+
*
|
|
1054
|
+
* PUT handler for updating a Twilio conversation
|
|
1055
|
+
*/ const putConversations = (options)=>(options.client ?? client).put({
|
|
1056
|
+
security: [
|
|
1057
|
+
{
|
|
1058
|
+
scheme: 'bearer',
|
|
1059
|
+
type: 'http'
|
|
1060
|
+
}
|
|
1061
|
+
],
|
|
1062
|
+
url: '/conversations',
|
|
1063
|
+
...options,
|
|
1064
|
+
headers: {
|
|
1065
|
+
'Content-Type': 'application/json',
|
|
1066
|
+
...options.headers
|
|
1067
|
+
}
|
|
1068
|
+
});
|
|
1069
|
+
/**
|
|
1070
|
+
* GET /participants
|
|
1071
|
+
*
|
|
1072
|
+
* Retrieves participants from a Twilio conversation
|
|
1073
|
+
*/ const getParticipants = (options)=>(options?.client ?? client).get({
|
|
1074
|
+
security: [
|
|
1075
|
+
{
|
|
1076
|
+
scheme: 'bearer',
|
|
1077
|
+
type: 'http'
|
|
1078
|
+
}
|
|
1079
|
+
],
|
|
1080
|
+
url: '/participants',
|
|
1081
|
+
...options
|
|
1082
|
+
});
|
|
1083
|
+
/**
|
|
1084
|
+
* POST /participants
|
|
1085
|
+
*
|
|
1086
|
+
* POST handler for adding a participant to a Twilio conversation
|
|
1087
|
+
*/ const postParticipants = (options)=>(options.client ?? client).post({
|
|
1088
|
+
security: [
|
|
1089
|
+
{
|
|
1090
|
+
scheme: 'bearer',
|
|
1091
|
+
type: 'http'
|
|
1092
|
+
}
|
|
1093
|
+
],
|
|
1094
|
+
url: '/participants',
|
|
1095
|
+
...options,
|
|
1096
|
+
headers: {
|
|
1097
|
+
'Content-Type': 'application/json',
|
|
1098
|
+
...options.headers
|
|
1099
|
+
}
|
|
1100
|
+
});
|
|
1101
|
+
/**
|
|
1102
|
+
* PUT /participants
|
|
1103
|
+
*
|
|
1104
|
+
* PUT handler for updating a participant in a Twilio conversation
|
|
1105
|
+
*/ const putParticipants = (options)=>(options.client ?? client).put({
|
|
1106
|
+
security: [
|
|
1107
|
+
{
|
|
1108
|
+
scheme: 'bearer',
|
|
1109
|
+
type: 'http'
|
|
1110
|
+
}
|
|
1111
|
+
],
|
|
1112
|
+
url: '/participants',
|
|
1113
|
+
...options,
|
|
1114
|
+
headers: {
|
|
1115
|
+
'Content-Type': 'application/json',
|
|
1116
|
+
...options.headers
|
|
1117
|
+
}
|
|
1118
|
+
});
|
|
1119
|
+
/**
|
|
1120
|
+
* DELETE /conversational-intelligence-operator
|
|
1121
|
+
*
|
|
1122
|
+
* DELETE handler for removing a Twilio Conversational Intelligence Operator
|
|
1123
|
+
*/ const deleteConversationalIntelligenceOperator = (options)=>(options.client ?? client).delete({
|
|
1124
|
+
security: [
|
|
1125
|
+
{
|
|
1126
|
+
scheme: 'bearer',
|
|
1127
|
+
type: 'http'
|
|
1128
|
+
}
|
|
1129
|
+
],
|
|
1130
|
+
url: '/conversational-intelligence-operator',
|
|
1131
|
+
...options,
|
|
1132
|
+
headers: {
|
|
1133
|
+
'Content-Type': 'application/json',
|
|
1134
|
+
...options.headers
|
|
1135
|
+
}
|
|
1136
|
+
});
|
|
1137
|
+
/**
|
|
1138
|
+
* GET /conversational-intelligence-operator
|
|
1139
|
+
*
|
|
1140
|
+
* GET handler for retrieving Twilio Conversational Intelligence Operators
|
|
1141
|
+
*/ const getConversationalIntelligenceOperator = (options)=>(options?.client ?? client).get({
|
|
1142
|
+
security: [
|
|
1143
|
+
{
|
|
1144
|
+
scheme: 'bearer',
|
|
1145
|
+
type: 'http'
|
|
1146
|
+
}
|
|
1147
|
+
],
|
|
1148
|
+
url: '/conversational-intelligence-operator',
|
|
1149
|
+
...options
|
|
1150
|
+
});
|
|
1151
|
+
/**
|
|
1152
|
+
* POST /conversational-intelligence-operator
|
|
1153
|
+
*
|
|
1154
|
+
* POST handler for creating a Twilio Conversational Intelligence Operator
|
|
1155
|
+
*/ const postConversationalIntelligenceOperator = (options)=>(options.client ?? client).post({
|
|
1156
|
+
security: [
|
|
1157
|
+
{
|
|
1158
|
+
scheme: 'bearer',
|
|
1159
|
+
type: 'http'
|
|
1160
|
+
}
|
|
1161
|
+
],
|
|
1162
|
+
url: '/conversational-intelligence-operator',
|
|
1163
|
+
...options,
|
|
1164
|
+
headers: {
|
|
1165
|
+
'Content-Type': 'application/json',
|
|
1166
|
+
...options.headers
|
|
1167
|
+
}
|
|
1168
|
+
});
|
|
1169
|
+
/**
|
|
1170
|
+
* PUT /conversational-intelligence-operator
|
|
1171
|
+
*
|
|
1172
|
+
* PUT handler for updating a Twilio Conversational Intelligence Operator
|
|
1173
|
+
*/ const putConversationalIntelligenceOperator = (options)=>(options.client ?? client).put({
|
|
1174
|
+
security: [
|
|
1175
|
+
{
|
|
1176
|
+
scheme: 'bearer',
|
|
1177
|
+
type: 'http'
|
|
1178
|
+
}
|
|
1179
|
+
],
|
|
1180
|
+
url: '/conversational-intelligence-operator',
|
|
1181
|
+
...options,
|
|
1182
|
+
headers: {
|
|
1183
|
+
'Content-Type': 'application/json',
|
|
1184
|
+
...options.headers
|
|
1185
|
+
}
|
|
1186
|
+
});
|
|
1187
|
+
/**
|
|
1188
|
+
* GET /intelligence-configuration
|
|
1189
|
+
*
|
|
1190
|
+
* GET handler for retrieving Twilio Intelligence Configurations
|
|
1191
|
+
*/ const getIntelligenceConfiguration = (options)=>(options?.client ?? client).get({
|
|
1192
|
+
security: [
|
|
1193
|
+
{
|
|
1194
|
+
scheme: 'bearer',
|
|
1195
|
+
type: 'http'
|
|
1196
|
+
}
|
|
1197
|
+
],
|
|
1198
|
+
url: '/intelligence-configuration',
|
|
1199
|
+
...options
|
|
1200
|
+
});
|
|
1201
|
+
/**
|
|
1202
|
+
* POST /intelligence-configuration
|
|
1203
|
+
*
|
|
1204
|
+
* Twilio Conversational Intelligence Operators API endpoint.
|
|
1205
|
+
*/ const postIntelligenceConfiguration = (options)=>(options.client ?? client).post({
|
|
1206
|
+
security: [
|
|
1207
|
+
{
|
|
1208
|
+
scheme: 'bearer',
|
|
1209
|
+
type: 'http'
|
|
1210
|
+
}
|
|
1211
|
+
],
|
|
1212
|
+
url: '/intelligence-configuration',
|
|
1213
|
+
...options,
|
|
1214
|
+
headers: {
|
|
1215
|
+
'Content-Type': 'application/json',
|
|
1216
|
+
...options.headers
|
|
1217
|
+
}
|
|
1218
|
+
});
|
|
1219
|
+
/**
|
|
1220
|
+
* PUT /intelligence-configuration
|
|
1221
|
+
*
|
|
1222
|
+
* PUT handler for updating a Twilio Intelligence Configuration
|
|
1223
|
+
*/ const putIntelligenceConfiguration = (options)=>(options.client ?? client).put({
|
|
1224
|
+
security: [
|
|
1225
|
+
{
|
|
1226
|
+
scheme: 'bearer',
|
|
1227
|
+
type: 'http'
|
|
1228
|
+
}
|
|
1229
|
+
],
|
|
1230
|
+
url: '/intelligence-configuration',
|
|
1231
|
+
...options,
|
|
1232
|
+
headers: {
|
|
1233
|
+
'Content-Type': 'application/json',
|
|
1234
|
+
...options.headers
|
|
1235
|
+
}
|
|
1236
|
+
});
|
|
1237
|
+
/**
|
|
1238
|
+
* DELETE /conversation-memory-profiles
|
|
1239
|
+
*
|
|
1240
|
+
* DELETE handler for removing a profile from Conversation Memory
|
|
1241
|
+
*/ const deleteConversationMemoryProfiles = (options)=>(options?.client ?? client).delete({
|
|
1242
|
+
security: [
|
|
1243
|
+
{
|
|
1244
|
+
scheme: 'bearer',
|
|
1245
|
+
type: 'http'
|
|
1246
|
+
}
|
|
1247
|
+
],
|
|
1248
|
+
url: '/conversation-memory-profiles',
|
|
1249
|
+
...options
|
|
1250
|
+
});
|
|
1251
|
+
/**
|
|
1252
|
+
* GET /conversation-memory-profiles
|
|
1253
|
+
*
|
|
1254
|
+
* GET handler for retrieving profiles from Conversation Memory
|
|
1255
|
+
*/ const getConversationMemoryProfiles = (options)=>(options?.client ?? client).get({
|
|
1256
|
+
security: [
|
|
1257
|
+
{
|
|
1258
|
+
scheme: 'bearer',
|
|
1259
|
+
type: 'http'
|
|
1260
|
+
}
|
|
1261
|
+
],
|
|
1262
|
+
url: '/conversation-memory-profiles',
|
|
1263
|
+
...options
|
|
1264
|
+
});
|
|
1265
|
+
/**
|
|
1266
|
+
* PATCH /conversation-memory-profiles
|
|
1267
|
+
*
|
|
1268
|
+
* PATCH handler for updating profile traits in Conversation Memory
|
|
1269
|
+
*/ const patchConversationMemoryProfiles = (options)=>(options.client ?? client).patch({
|
|
1270
|
+
security: [
|
|
1271
|
+
{
|
|
1272
|
+
scheme: 'bearer',
|
|
1273
|
+
type: 'http'
|
|
1274
|
+
}
|
|
1275
|
+
],
|
|
1276
|
+
url: '/conversation-memory-profiles',
|
|
1277
|
+
...options,
|
|
1278
|
+
headers: {
|
|
1279
|
+
'Content-Type': 'application/json',
|
|
1280
|
+
...options.headers
|
|
1281
|
+
}
|
|
1282
|
+
});
|
|
1283
|
+
/**
|
|
1284
|
+
* POST /conversation-memory-profiles
|
|
1285
|
+
*
|
|
1286
|
+
* POST handler for creating a profile in Conversation Memory
|
|
1287
|
+
*/ const postConversationMemoryProfiles = (options)=>(options.client ?? client).post({
|
|
1288
|
+
security: [
|
|
1289
|
+
{
|
|
1290
|
+
scheme: 'bearer',
|
|
1291
|
+
type: 'http'
|
|
1292
|
+
}
|
|
1293
|
+
],
|
|
1294
|
+
url: '/conversation-memory-profiles',
|
|
1295
|
+
...options,
|
|
1296
|
+
headers: {
|
|
1297
|
+
'Content-Type': 'application/json',
|
|
1298
|
+
...options.headers
|
|
1299
|
+
}
|
|
1300
|
+
});
|
|
1301
|
+
/**
|
|
1302
|
+
* POST /conversation-memory-profiles-lookup
|
|
1303
|
+
*
|
|
1304
|
+
* POST handler for looking up profiles by identifier in Conversation Memory
|
|
1305
|
+
*/ const postConversationMemoryProfilesLookup = (options)=>(options.client ?? client).post({
|
|
1306
|
+
security: [
|
|
1307
|
+
{
|
|
1308
|
+
scheme: 'bearer',
|
|
1309
|
+
type: 'http'
|
|
1310
|
+
}
|
|
1311
|
+
],
|
|
1312
|
+
url: '/conversation-memory-profiles-lookup',
|
|
1313
|
+
...options,
|
|
1314
|
+
headers: {
|
|
1315
|
+
'Content-Type': 'application/json',
|
|
1316
|
+
...options.headers
|
|
1317
|
+
}
|
|
1318
|
+
});
|
|
1319
|
+
/**
|
|
1320
|
+
* POST /conversation-memory-recall
|
|
1321
|
+
*
|
|
1322
|
+
* POST handler for retrieving memories from a Conversation Memory profile
|
|
1323
|
+
*/ const postConversationMemoryRecall = (options)=>(options.client ?? client).post({
|
|
1324
|
+
security: [
|
|
1325
|
+
{
|
|
1326
|
+
scheme: 'bearer',
|
|
1327
|
+
type: 'http'
|
|
1328
|
+
}
|
|
1329
|
+
],
|
|
1330
|
+
url: '/conversation-memory-recall',
|
|
1331
|
+
...options,
|
|
1332
|
+
headers: {
|
|
1333
|
+
'Content-Type': 'application/json',
|
|
1334
|
+
...options.headers
|
|
1335
|
+
}
|
|
1336
|
+
});
|
|
1337
|
+
/**
|
|
1338
|
+
* DELETE /conversation-memory-identifiers
|
|
1339
|
+
*
|
|
1340
|
+
* DELETE handler for removing a profile identifier from Conversation Memory
|
|
1341
|
+
*/ const deleteConversationMemoryIdentifiers = (options)=>(options?.client ?? client).delete({
|
|
1342
|
+
security: [
|
|
1343
|
+
{
|
|
1344
|
+
scheme: 'bearer',
|
|
1345
|
+
type: 'http'
|
|
1346
|
+
}
|
|
1347
|
+
],
|
|
1348
|
+
url: '/conversation-memory-identifiers',
|
|
1349
|
+
...options
|
|
1350
|
+
});
|
|
1351
|
+
/**
|
|
1352
|
+
* GET /conversation-memory-identifiers
|
|
1353
|
+
*
|
|
1354
|
+
* GET handler for retrieving profile identifiers from Conversation Memory
|
|
1355
|
+
*/ const getConversationMemoryIdentifiers = (options)=>(options?.client ?? client).get({
|
|
1356
|
+
security: [
|
|
1357
|
+
{
|
|
1358
|
+
scheme: 'bearer',
|
|
1359
|
+
type: 'http'
|
|
1360
|
+
}
|
|
1361
|
+
],
|
|
1362
|
+
url: '/conversation-memory-identifiers',
|
|
1363
|
+
...options
|
|
1364
|
+
});
|
|
1365
|
+
/**
|
|
1366
|
+
* PATCH /conversation-memory-identifiers
|
|
1367
|
+
*
|
|
1368
|
+
* PATCH handler for modifying a profile identifier in Conversation Memory
|
|
1369
|
+
*/ const patchConversationMemoryIdentifiers = (options)=>(options.client ?? client).patch({
|
|
1370
|
+
security: [
|
|
1371
|
+
{
|
|
1372
|
+
scheme: 'bearer',
|
|
1373
|
+
type: 'http'
|
|
1374
|
+
}
|
|
1375
|
+
],
|
|
1376
|
+
url: '/conversation-memory-identifiers',
|
|
1377
|
+
...options,
|
|
1378
|
+
headers: {
|
|
1379
|
+
'Content-Type': 'application/json',
|
|
1380
|
+
...options.headers
|
|
1381
|
+
}
|
|
1382
|
+
});
|
|
1383
|
+
/**
|
|
1384
|
+
* POST /conversation-memory-identifiers
|
|
1385
|
+
*
|
|
1386
|
+
* POST handler for adding an identifier to a Conversation Memory profile
|
|
1387
|
+
*/ const postConversationMemoryIdentifiers = (options)=>(options.client ?? client).post({
|
|
1388
|
+
security: [
|
|
1389
|
+
{
|
|
1390
|
+
scheme: 'bearer',
|
|
1391
|
+
type: 'http'
|
|
1392
|
+
}
|
|
1393
|
+
],
|
|
1394
|
+
url: '/conversation-memory-identifiers',
|
|
1395
|
+
...options,
|
|
1396
|
+
headers: {
|
|
1397
|
+
'Content-Type': 'application/json',
|
|
1398
|
+
...options.headers
|
|
1399
|
+
}
|
|
1400
|
+
});
|
|
1401
|
+
/**
|
|
1402
|
+
* DELETE /conversation-memory-trait-groups
|
|
1403
|
+
*
|
|
1404
|
+
* DELETE handler for removing a Trait Group from Conversation Memory
|
|
1405
|
+
*/ const deleteConversationMemoryTraitGroups = (options)=>(options?.client ?? client).delete({
|
|
1406
|
+
security: [
|
|
1407
|
+
{
|
|
1408
|
+
scheme: 'bearer',
|
|
1409
|
+
type: 'http'
|
|
1410
|
+
}
|
|
1411
|
+
],
|
|
1412
|
+
url: '/conversation-memory-trait-groups',
|
|
1413
|
+
...options
|
|
1414
|
+
});
|
|
1415
|
+
/**
|
|
1416
|
+
* GET /conversation-memory-trait-groups
|
|
1417
|
+
*
|
|
1418
|
+
* GET handler for retrieving Trait Groups from Conversation Memory
|
|
1419
|
+
*/ const getConversationMemoryTraitGroups = (options)=>(options?.client ?? client).get({
|
|
1420
|
+
security: [
|
|
1421
|
+
{
|
|
1422
|
+
scheme: 'bearer',
|
|
1423
|
+
type: 'http'
|
|
1424
|
+
}
|
|
1425
|
+
],
|
|
1426
|
+
url: '/conversation-memory-trait-groups',
|
|
1427
|
+
...options
|
|
1428
|
+
});
|
|
1429
|
+
/**
|
|
1430
|
+
* PATCH /conversation-memory-trait-groups
|
|
1431
|
+
*
|
|
1432
|
+
* PATCH handler for updating a Trait Group in Conversation Memory
|
|
1433
|
+
*/ const patchConversationMemoryTraitGroups = (options)=>(options.client ?? client).patch({
|
|
1434
|
+
security: [
|
|
1435
|
+
{
|
|
1436
|
+
scheme: 'bearer',
|
|
1437
|
+
type: 'http'
|
|
1438
|
+
}
|
|
1439
|
+
],
|
|
1440
|
+
url: '/conversation-memory-trait-groups',
|
|
1441
|
+
...options,
|
|
1442
|
+
headers: {
|
|
1443
|
+
'Content-Type': 'application/json',
|
|
1444
|
+
...options.headers
|
|
1445
|
+
}
|
|
1446
|
+
});
|
|
1447
|
+
/**
|
|
1448
|
+
* POST /conversation-memory-trait-groups
|
|
1449
|
+
*
|
|
1450
|
+
* POST handler for creating a Trait Group in Conversation Memory
|
|
1451
|
+
*/ const postConversationMemoryTraitGroups = (options)=>(options.client ?? client).post({
|
|
1452
|
+
security: [
|
|
1453
|
+
{
|
|
1454
|
+
scheme: 'bearer',
|
|
1455
|
+
type: 'http'
|
|
1456
|
+
}
|
|
1457
|
+
],
|
|
1458
|
+
url: '/conversation-memory-trait-groups',
|
|
1459
|
+
...options,
|
|
1460
|
+
headers: {
|
|
1461
|
+
'Content-Type': 'application/json',
|
|
1462
|
+
...options.headers
|
|
1463
|
+
}
|
|
1464
|
+
});
|
|
1465
|
+
/**
|
|
1466
|
+
* GET /conversation-memory-traits
|
|
1467
|
+
*
|
|
1468
|
+
* GET handler for retrieving profile traits from Conversation Memory
|
|
1469
|
+
*/ const getConversationMemoryTraits = (options)=>(options?.client ?? client).get({
|
|
1470
|
+
security: [
|
|
1471
|
+
{
|
|
1472
|
+
scheme: 'bearer',
|
|
1473
|
+
type: 'http'
|
|
1474
|
+
}
|
|
1475
|
+
],
|
|
1476
|
+
url: '/conversation-memory-traits',
|
|
1477
|
+
...options
|
|
1478
|
+
});
|
|
1479
|
+
/**
|
|
1480
|
+
* DELETE /conversation-memory-observations
|
|
1481
|
+
*
|
|
1482
|
+
* DELETE handler for removing an observation from a Conversation Memory profile
|
|
1483
|
+
*/ const deleteConversationMemoryObservations = (options)=>(options?.client ?? client).delete({
|
|
1484
|
+
security: [
|
|
1485
|
+
{
|
|
1486
|
+
scheme: 'bearer',
|
|
1487
|
+
type: 'http'
|
|
1488
|
+
}
|
|
1489
|
+
],
|
|
1490
|
+
url: '/conversation-memory-observations',
|
|
1491
|
+
...options
|
|
1492
|
+
});
|
|
1493
|
+
/**
|
|
1494
|
+
* GET /conversation-memory-observations
|
|
1495
|
+
*
|
|
1496
|
+
* GET handler for retrieving observations from a Conversation Memory profile
|
|
1497
|
+
*/ const getConversationMemoryObservations = (options)=>(options?.client ?? client).get({
|
|
1498
|
+
security: [
|
|
1499
|
+
{
|
|
1500
|
+
scheme: 'bearer',
|
|
1501
|
+
type: 'http'
|
|
1502
|
+
}
|
|
1503
|
+
],
|
|
1504
|
+
url: '/conversation-memory-observations',
|
|
1505
|
+
...options
|
|
1506
|
+
});
|
|
1507
|
+
/**
|
|
1508
|
+
* PATCH /conversation-memory-observations
|
|
1509
|
+
*
|
|
1510
|
+
* PATCH handler for updating an observation on a Conversation Memory profile
|
|
1511
|
+
*/ const patchConversationMemoryObservations = (options)=>(options.client ?? client).patch({
|
|
1512
|
+
security: [
|
|
1513
|
+
{
|
|
1514
|
+
scheme: 'bearer',
|
|
1515
|
+
type: 'http'
|
|
1516
|
+
}
|
|
1517
|
+
],
|
|
1518
|
+
url: '/conversation-memory-observations',
|
|
1519
|
+
...options,
|
|
1520
|
+
headers: {
|
|
1521
|
+
'Content-Type': 'application/json',
|
|
1522
|
+
...options.headers
|
|
1523
|
+
}
|
|
1524
|
+
});
|
|
1525
|
+
/**
|
|
1526
|
+
* POST /conversation-memory-observations
|
|
1527
|
+
*
|
|
1528
|
+
* POST handler for creating observations on a Conversation Memory profile
|
|
1529
|
+
*/ const postConversationMemoryObservations = (options)=>(options.client ?? client).post({
|
|
1530
|
+
security: [
|
|
1531
|
+
{
|
|
1532
|
+
scheme: 'bearer',
|
|
1533
|
+
type: 'http'
|
|
1534
|
+
}
|
|
1535
|
+
],
|
|
1536
|
+
url: '/conversation-memory-observations',
|
|
1537
|
+
...options,
|
|
1538
|
+
headers: {
|
|
1539
|
+
'Content-Type': 'application/json',
|
|
1540
|
+
...options.headers
|
|
1541
|
+
}
|
|
1542
|
+
});
|
|
1543
|
+
/**
|
|
1544
|
+
* DELETE /conversation-memory-conversation-summaries
|
|
1545
|
+
*
|
|
1546
|
+
* DELETE handler for removing a conversation summary from a Conversation Memory profile
|
|
1547
|
+
*/ const deleteConversationMemoryConversationSummaries = (options)=>(options?.client ?? client).delete({
|
|
1548
|
+
security: [
|
|
1549
|
+
{
|
|
1550
|
+
scheme: 'bearer',
|
|
1551
|
+
type: 'http'
|
|
1552
|
+
}
|
|
1553
|
+
],
|
|
1554
|
+
url: '/conversation-memory-conversation-summaries',
|
|
1555
|
+
...options
|
|
1556
|
+
});
|
|
1557
|
+
/**
|
|
1558
|
+
* GET /conversation-memory-conversation-summaries
|
|
1559
|
+
*
|
|
1560
|
+
* GET handler for retrieving conversation summaries from a Conversation Memory profile
|
|
1561
|
+
*/ const getConversationMemoryConversationSummaries = (options)=>(options?.client ?? client).get({
|
|
1562
|
+
security: [
|
|
1563
|
+
{
|
|
1564
|
+
scheme: 'bearer',
|
|
1565
|
+
type: 'http'
|
|
1566
|
+
}
|
|
1567
|
+
],
|
|
1568
|
+
url: '/conversation-memory-conversation-summaries',
|
|
1569
|
+
...options
|
|
1570
|
+
});
|
|
1571
|
+
/**
|
|
1572
|
+
* PATCH /conversation-memory-conversation-summaries
|
|
1573
|
+
*
|
|
1574
|
+
* PATCH handler for updating a conversation summary on a Conversation Memory profile
|
|
1575
|
+
*/ const patchConversationMemoryConversationSummaries = (options)=>(options.client ?? client).patch({
|
|
1576
|
+
security: [
|
|
1577
|
+
{
|
|
1578
|
+
scheme: 'bearer',
|
|
1579
|
+
type: 'http'
|
|
1580
|
+
}
|
|
1581
|
+
],
|
|
1582
|
+
url: '/conversation-memory-conversation-summaries',
|
|
1583
|
+
...options,
|
|
1584
|
+
headers: {
|
|
1585
|
+
'Content-Type': 'application/json',
|
|
1586
|
+
...options.headers
|
|
1587
|
+
}
|
|
1588
|
+
});
|
|
1589
|
+
/**
|
|
1590
|
+
* POST /conversation-memory-conversation-summaries
|
|
1591
|
+
*
|
|
1592
|
+
* POST handler for creating conversation summaries on a Conversation Memory profile
|
|
1593
|
+
*/ const postConversationMemoryConversationSummaries = (options)=>(options.client ?? client).post({
|
|
1594
|
+
security: [
|
|
1595
|
+
{
|
|
1596
|
+
scheme: 'bearer',
|
|
1597
|
+
type: 'http'
|
|
1598
|
+
}
|
|
1599
|
+
],
|
|
1600
|
+
url: '/conversation-memory-conversation-summaries',
|
|
1601
|
+
...options,
|
|
1602
|
+
headers: {
|
|
1603
|
+
'Content-Type': 'application/json',
|
|
1604
|
+
...options.headers
|
|
1605
|
+
}
|
|
1606
|
+
});
|
|
1607
|
+
/**
|
|
1608
|
+
* DELETE /conversation-memory-reset
|
|
1609
|
+
*/ const deleteConversationMemoryReset = (options)=>(options?.client ?? client).delete({
|
|
1610
|
+
security: [
|
|
1611
|
+
{
|
|
1612
|
+
scheme: 'bearer',
|
|
1613
|
+
type: 'http'
|
|
1614
|
+
}
|
|
1615
|
+
],
|
|
1616
|
+
url: '/conversation-memory-reset',
|
|
1617
|
+
...options
|
|
1618
|
+
});
|
|
1619
|
+
/**
|
|
1620
|
+
* POST /assign-demo
|
|
1621
|
+
*
|
|
1622
|
+
* Assigns a phone number to a target demo template, removing it from any
|
|
1623
|
+
* other templates that currently have it
|
|
1624
|
+
*/ const postAssignDemo = (options)=>(options.client ?? client).post({
|
|
1625
|
+
security: [
|
|
1626
|
+
{
|
|
1627
|
+
scheme: 'bearer',
|
|
1628
|
+
type: 'http'
|
|
1629
|
+
}
|
|
1630
|
+
],
|
|
1631
|
+
url: '/assign-demo',
|
|
1632
|
+
...options,
|
|
1633
|
+
headers: {
|
|
1634
|
+
'Content-Type': 'application/json',
|
|
1635
|
+
...options.headers
|
|
1636
|
+
}
|
|
1637
|
+
});
|
|
1638
|
+
/**
|
|
1639
|
+
* GET /lookup-demo
|
|
1640
|
+
*
|
|
1641
|
+
* Returns the demo template(s) a phone number is currently assigned to
|
|
1642
|
+
*/ const getLookupDemo = (options)=>(options?.client ?? client).get({
|
|
1643
|
+
security: [
|
|
1644
|
+
{
|
|
1645
|
+
scheme: 'bearer',
|
|
1646
|
+
type: 'http'
|
|
1647
|
+
}
|
|
1648
|
+
],
|
|
1649
|
+
url: '/lookup-demo',
|
|
1650
|
+
...options
|
|
1651
|
+
});
|
|
1652
|
+
/**
|
|
1653
|
+
* POST /template-autogen
|
|
1654
|
+
*
|
|
1655
|
+
* Creates AI-generated RAMP templates from a list of requests, one template for each request
|
|
1656
|
+
*/ const postTemplateAutogen = (options)=>(options.client ?? client).post({
|
|
1657
|
+
security: [
|
|
1658
|
+
{
|
|
1659
|
+
scheme: 'bearer',
|
|
1660
|
+
type: 'http'
|
|
1661
|
+
}
|
|
1662
|
+
],
|
|
1663
|
+
url: '/template-autogen',
|
|
1664
|
+
...options,
|
|
1665
|
+
headers: {
|
|
1666
|
+
'Content-Type': 'application/json',
|
|
1667
|
+
...options.headers
|
|
1668
|
+
}
|
|
1669
|
+
});
|
|
1670
|
+
/**
|
|
1671
|
+
* DELETE /template
|
|
1672
|
+
*
|
|
1673
|
+
* Expects JSON body: { ids: string[] }
|
|
1674
|
+
* If campaign=true, deletes campaigns from Snowflake
|
|
1675
|
+
*/ const deleteTemplate = (options)=>(options?.client ?? client).delete({
|
|
1676
|
+
security: [
|
|
1677
|
+
{
|
|
1678
|
+
scheme: 'bearer',
|
|
1679
|
+
type: 'http'
|
|
1680
|
+
}
|
|
1681
|
+
],
|
|
1682
|
+
url: '/template',
|
|
1683
|
+
...options
|
|
1684
|
+
});
|
|
1685
|
+
/**
|
|
1686
|
+
* POST /template
|
|
1687
|
+
*
|
|
1688
|
+
* Creates a template
|
|
1689
|
+
*/ const postTemplate = (options)=>(options.client ?? client).post({
|
|
1690
|
+
security: [
|
|
1691
|
+
{
|
|
1692
|
+
scheme: 'bearer',
|
|
1693
|
+
type: 'http'
|
|
1694
|
+
}
|
|
1695
|
+
],
|
|
1696
|
+
url: '/template',
|
|
1697
|
+
...options,
|
|
1698
|
+
headers: {
|
|
1699
|
+
'Content-Type': 'application/json',
|
|
1700
|
+
...options.headers
|
|
1701
|
+
}
|
|
1702
|
+
});
|
|
1703
|
+
/**
|
|
1704
|
+
* GET /campaign
|
|
1705
|
+
*
|
|
1706
|
+
* Gets all campaign templates based off of search arguments
|
|
1707
|
+
*/ const getCampaign = (options)=>(options?.client ?? client).get({
|
|
1708
|
+
security: [
|
|
1709
|
+
{
|
|
1710
|
+
scheme: 'bearer',
|
|
1711
|
+
type: 'http'
|
|
1712
|
+
}
|
|
1713
|
+
],
|
|
1714
|
+
url: '/campaign',
|
|
1715
|
+
...options
|
|
1716
|
+
});
|
|
1717
|
+
/**
|
|
1718
|
+
* GET /supported-regions
|
|
1719
|
+
*
|
|
1720
|
+
* Returns the regions in which a phone number can currently be purchased,
|
|
1721
|
+
* derived from the account's Twilio-approved regulatory bundles plus US/CA toll-free
|
|
1722
|
+
*/ const getSupportedRegions = (options)=>(options?.client ?? client).get({
|
|
1723
|
+
security: [
|
|
1724
|
+
{
|
|
1725
|
+
scheme: 'bearer',
|
|
1726
|
+
type: 'http'
|
|
1727
|
+
}
|
|
1728
|
+
],
|
|
1729
|
+
url: '/supported-regions',
|
|
1730
|
+
...options
|
|
1731
|
+
});
|
|
1732
|
+
/**
|
|
1733
|
+
* GET /link-shortener
|
|
1734
|
+
*
|
|
1735
|
+
* Returns all short links stored in the link.twilioramp.com account
|
|
1736
|
+
*/ const getLinkShortener = (options)=>(options?.client ?? client).get({
|
|
1737
|
+
security: [
|
|
1738
|
+
{
|
|
1739
|
+
scheme: 'bearer',
|
|
1740
|
+
type: 'http'
|
|
1741
|
+
}
|
|
1742
|
+
],
|
|
1743
|
+
url: '/link-shortener',
|
|
1744
|
+
...options
|
|
1745
|
+
});
|
|
1746
|
+
/**
|
|
1747
|
+
* PATCH /link-shortener
|
|
1748
|
+
*
|
|
1749
|
+
* Persists a generated short link onto the Algolia `conversationAdmin` record and
|
|
1750
|
+
* upserts the Snowflake `GENERATED_TEMPLATES` row so the link survives a page refresh
|
|
1751
|
+
*/ const patchLinkShortener = (options)=>(options.client ?? client).patch({
|
|
1752
|
+
security: [
|
|
1753
|
+
{
|
|
1754
|
+
scheme: 'bearer',
|
|
1755
|
+
type: 'http'
|
|
1756
|
+
}
|
|
1757
|
+
],
|
|
1758
|
+
url: '/link-shortener',
|
|
1759
|
+
...options,
|
|
1760
|
+
headers: {
|
|
1761
|
+
'Content-Type': 'application/json',
|
|
1762
|
+
...options.headers
|
|
1763
|
+
}
|
|
1764
|
+
});
|
|
1765
|
+
/**
|
|
1766
|
+
* POST /link-shortener
|
|
1767
|
+
*
|
|
1768
|
+
* Shortens one or more URLs via the link.twilioramp.com API
|
|
1769
|
+
*/ const postLinkShortener = (options)=>(options.client ?? client).post({
|
|
1770
|
+
security: [
|
|
1771
|
+
{
|
|
1772
|
+
scheme: 'bearer',
|
|
1773
|
+
type: 'http'
|
|
1774
|
+
}
|
|
1775
|
+
],
|
|
1776
|
+
url: '/link-shortener',
|
|
1777
|
+
...options,
|
|
1778
|
+
headers: {
|
|
1779
|
+
'Content-Type': 'application/json',
|
|
1780
|
+
...options.headers
|
|
1781
|
+
}
|
|
1782
|
+
});
|
|
1783
|
+
/**
|
|
1784
|
+
* DELETE /link-shortener/:code
|
|
1785
|
+
*
|
|
1786
|
+
* Deletes a short link by its code via the link.twilioramp.com API
|
|
1787
|
+
*/ const deleteLinkShortenerByCode = (options)=>(options.client ?? client).delete({
|
|
1788
|
+
security: [
|
|
1789
|
+
{
|
|
1790
|
+
scheme: 'bearer',
|
|
1791
|
+
type: 'http'
|
|
1792
|
+
}
|
|
1793
|
+
],
|
|
1794
|
+
url: '/link-shortener/{code}',
|
|
1795
|
+
...options
|
|
1796
|
+
});
|
|
1797
|
+
/**
|
|
1798
|
+
* GET /docs/openapi.json
|
|
1799
|
+
*
|
|
1800
|
+
* docsSpecGet
|
|
1801
|
+
* Serves the generated OpenAPI JSON spec
|
|
1802
|
+
*/ const getDocsOpenapiJson = (options)=>(options?.client ?? client).get({
|
|
1803
|
+
security: [
|
|
1804
|
+
{
|
|
1805
|
+
scheme: 'bearer',
|
|
1806
|
+
type: 'http'
|
|
1807
|
+
}
|
|
1808
|
+
],
|
|
1809
|
+
url: '/docs/openapi.json',
|
|
1810
|
+
...options
|
|
1811
|
+
});
|
|
1812
|
+
|
|
1813
|
+
// This file is auto-generated by @hey-api/openapi-ts
|
|
1814
|
+
const zAutogenRequest = z.object({
|
|
1815
|
+
email: z.string().optional(),
|
|
1816
|
+
company: z.string().optional(),
|
|
1817
|
+
information: z.string().optional(),
|
|
1818
|
+
language: z.string().optional(),
|
|
1819
|
+
voice: z.string().optional(),
|
|
1820
|
+
speechModel: z.string().optional(),
|
|
1821
|
+
transcriptionProvider: z.string().optional(),
|
|
1822
|
+
ttsProvider: z.string().optional(),
|
|
1823
|
+
logoSmall: z.string().optional(),
|
|
1824
|
+
logoFull: z.string().optional(),
|
|
1825
|
+
websiteUrl: z.string().optional()
|
|
1826
|
+
});
|
|
1827
|
+
const zSupportedRegion = z.object({
|
|
1828
|
+
isoCountry: z.string().optional(),
|
|
1829
|
+
numberType: z.string().optional(),
|
|
1830
|
+
bundleSid: z.string().optional(),
|
|
1831
|
+
label: z.string().optional(),
|
|
1832
|
+
flag: z.string().optional(),
|
|
1833
|
+
capabilities: z.string().optional()
|
|
1834
|
+
});
|
|
1835
|
+
const zShortenUrlInput = z.record(z.unknown());
|
|
1836
|
+
const zPostConversationsTokenBody = z.record(z.unknown());
|
|
1837
|
+
const zGetSyncTokenQuery = z.object({
|
|
1838
|
+
identity: z.string().optional()
|
|
1839
|
+
});
|
|
1840
|
+
const zGetVoiceTokenQuery = z.object({
|
|
1841
|
+
identity: z.string().optional()
|
|
1842
|
+
});
|
|
1843
|
+
const zPostUiConfigBody = z.record(z.unknown());
|
|
1844
|
+
const zPostCreateExternalFlexConnectionBody = z.object({
|
|
1845
|
+
seAccountSid: z.string(),
|
|
1846
|
+
seApiKeySid: z.string(),
|
|
1847
|
+
seApiKeySecret: z.string()
|
|
1848
|
+
});
|
|
1849
|
+
const zPostInstallFlexPluginBody = z.object({
|
|
1850
|
+
seAccountSid: z.string(),
|
|
1851
|
+
seApiKeySid: z.string(),
|
|
1852
|
+
seApiKeySecret: z.string(),
|
|
1853
|
+
pluginName: z.string()
|
|
1854
|
+
});
|
|
1855
|
+
const zPostLiveAgentWebchatConnectBody = z.record(z.unknown());
|
|
1856
|
+
const zPostLiveAgentWebchatSendBody = z.object({
|
|
1857
|
+
conversationSid: z.string(),
|
|
1858
|
+
identity: z.string(),
|
|
1859
|
+
message: z.string()
|
|
1860
|
+
});
|
|
1861
|
+
const zPostLiveAgentWebchatEndBody = z.record(z.unknown());
|
|
1862
|
+
const zPatchLeadGenBody = z.record(z.unknown());
|
|
1863
|
+
const zPostLeadGenBody = z.object({
|
|
1864
|
+
objectID: z.string(),
|
|
1865
|
+
userEmail: z.string()
|
|
1866
|
+
});
|
|
1867
|
+
const zPostConversationsCommunicationsByConversationIdBody = z.object({
|
|
1868
|
+
author: z.string(),
|
|
1869
|
+
content: z.string(),
|
|
1870
|
+
recipients: z.string()
|
|
1871
|
+
});
|
|
1872
|
+
const zPostConversationsCommunicationsByConversationIdPath = z.object({
|
|
1873
|
+
conversationId: z.string()
|
|
1874
|
+
});
|
|
1875
|
+
const zGetConversationsFetchQuery = z.object({
|
|
1876
|
+
conversationId: z.string().optional(),
|
|
1877
|
+
status: z.string().optional()
|
|
1878
|
+
});
|
|
1879
|
+
const zPostConversationsBody = z.object({
|
|
1880
|
+
configurationId: z.string()
|
|
1881
|
+
});
|
|
1882
|
+
const zPutConversationsBody = z.object({
|
|
1883
|
+
conversationsId: z.string(),
|
|
1884
|
+
status: z.string()
|
|
1885
|
+
});
|
|
1886
|
+
const zGetParticipantsQuery = z.object({
|
|
1887
|
+
conversationId: z.string().optional(),
|
|
1888
|
+
participantId: z.string().optional()
|
|
1889
|
+
});
|
|
1890
|
+
const zPostParticipantsBody = z.object({
|
|
1891
|
+
conversationId: z.string(),
|
|
1892
|
+
participantType: z.string(),
|
|
1893
|
+
addresses: z.string()
|
|
1894
|
+
});
|
|
1895
|
+
const zPutParticipantsBody = z.object({
|
|
1896
|
+
conversationId: z.string(),
|
|
1897
|
+
participantId: z.string()
|
|
1898
|
+
});
|
|
1899
|
+
const zDeleteConversationalIntelligenceOperatorBody = z.object({
|
|
1900
|
+
intelligenceOperatorId: z.string()
|
|
1901
|
+
});
|
|
1902
|
+
const zGetConversationalIntelligenceOperatorQuery = z.object({
|
|
1903
|
+
intelligenceOperatorId: z.string().optional(),
|
|
1904
|
+
pageToken: z.string().optional()
|
|
1905
|
+
});
|
|
1906
|
+
const zPostConversationalIntelligenceOperatorBody = z.object({
|
|
1907
|
+
author: z.string(),
|
|
1908
|
+
displayName: z.string(),
|
|
1909
|
+
description: z.string(),
|
|
1910
|
+
prompt: z.string(),
|
|
1911
|
+
valueType: z.string(),
|
|
1912
|
+
uiType: z.string()
|
|
1913
|
+
});
|
|
1914
|
+
const zPutConversationalIntelligenceOperatorBody = z.object({
|
|
1915
|
+
displayName: z.string(),
|
|
1916
|
+
description: z.string(),
|
|
1917
|
+
prompt: z.string(),
|
|
1918
|
+
valueType: z.string(),
|
|
1919
|
+
uiType: z.string(),
|
|
1920
|
+
intelligenceOperatorId: z.string()
|
|
1921
|
+
});
|
|
1922
|
+
const zGetIntelligenceConfigurationQuery = z.object({
|
|
1923
|
+
intelligenceConfigurationId: z.string().optional(),
|
|
1924
|
+
pageToken: z.string().optional()
|
|
1925
|
+
});
|
|
1926
|
+
const zPostIntelligenceConfigurationBody = z.record(z.unknown());
|
|
1927
|
+
const zPutIntelligenceConfigurationBody = z.object({
|
|
1928
|
+
intelligenceConfigurationId: z.string()
|
|
1929
|
+
});
|
|
1930
|
+
const zDeleteConversationMemoryProfilesQuery = z.object({
|
|
1931
|
+
storeId: z.string().optional(),
|
|
1932
|
+
profileId: z.string().optional()
|
|
1933
|
+
});
|
|
1934
|
+
const zGetConversationMemoryProfilesQuery = z.object({
|
|
1935
|
+
storeId: z.string().optional(),
|
|
1936
|
+
profileId: z.string().optional(),
|
|
1937
|
+
traitGroups: z.string().optional(),
|
|
1938
|
+
pageSize: z.string().optional(),
|
|
1939
|
+
pageToken: z.string().optional(),
|
|
1940
|
+
orderBy: z.string().optional()
|
|
1941
|
+
});
|
|
1942
|
+
const zPatchConversationMemoryProfilesBody = z.object({
|
|
1943
|
+
storeId: z.string(),
|
|
1944
|
+
profileId: z.string(),
|
|
1945
|
+
traits: z.string()
|
|
1946
|
+
});
|
|
1947
|
+
const zPostConversationMemoryProfilesBody = z.object({
|
|
1948
|
+
storeId: z.string(),
|
|
1949
|
+
traits: z.string()
|
|
1950
|
+
});
|
|
1951
|
+
const zPostConversationMemoryProfilesLookupBody = z.object({
|
|
1952
|
+
storeId: z.string(),
|
|
1953
|
+
idType: z.string(),
|
|
1954
|
+
value: z.string()
|
|
1955
|
+
});
|
|
1956
|
+
const zPostConversationMemoryRecallBody = z.object({
|
|
1957
|
+
storeId: z.string(),
|
|
1958
|
+
profileId: z.string()
|
|
1959
|
+
});
|
|
1960
|
+
const zDeleteConversationMemoryIdentifiersQuery = z.object({
|
|
1961
|
+
storeId: z.string().optional(),
|
|
1962
|
+
profileId: z.string().optional(),
|
|
1963
|
+
idType: z.string().optional(),
|
|
1964
|
+
removeAll: z.string().optional()
|
|
1965
|
+
});
|
|
1966
|
+
const zGetConversationMemoryIdentifiersQuery = z.object({
|
|
1967
|
+
storeId: z.string().optional(),
|
|
1968
|
+
profileId: z.string().optional(),
|
|
1969
|
+
idType: z.string().optional()
|
|
1970
|
+
});
|
|
1971
|
+
const zPatchConversationMemoryIdentifiersBody = z.object({
|
|
1972
|
+
storeId: z.string(),
|
|
1973
|
+
profileId: z.string(),
|
|
1974
|
+
idType: z.string(),
|
|
1975
|
+
oldValue: z.string(),
|
|
1976
|
+
newValue: z.string()
|
|
1977
|
+
});
|
|
1978
|
+
const zPostConversationMemoryIdentifiersBody = z.object({
|
|
1979
|
+
storeId: z.string(),
|
|
1980
|
+
profileId: z.string(),
|
|
1981
|
+
idType: z.string(),
|
|
1982
|
+
value: z.string()
|
|
1983
|
+
});
|
|
1984
|
+
const zDeleteConversationMemoryTraitGroupsQuery = z.object({
|
|
1985
|
+
storeId: z.string().optional(),
|
|
1986
|
+
traitGroupName: z.string().optional()
|
|
1987
|
+
});
|
|
1988
|
+
const zGetConversationMemoryTraitGroupsQuery = z.object({
|
|
1989
|
+
storeId: z.string().optional(),
|
|
1990
|
+
traitGroupName: z.string().optional(),
|
|
1991
|
+
includeTraits: z.string().optional(),
|
|
1992
|
+
pageSize: z.string().optional(),
|
|
1993
|
+
pageToken: z.string().optional(),
|
|
1994
|
+
orderBy: z.string().optional()
|
|
1995
|
+
});
|
|
1996
|
+
const zPatchConversationMemoryTraitGroupsBody = z.object({
|
|
1997
|
+
storeId: z.string(),
|
|
1998
|
+
traitGroupName: z.string()
|
|
1999
|
+
});
|
|
2000
|
+
const zPostConversationMemoryTraitGroupsBody = z.object({
|
|
2001
|
+
storeId: z.string(),
|
|
2002
|
+
displayName: z.string()
|
|
2003
|
+
});
|
|
2004
|
+
const zGetConversationMemoryTraitsQuery = z.object({
|
|
2005
|
+
storeId: z.string().optional(),
|
|
2006
|
+
profileId: z.string().optional(),
|
|
2007
|
+
pageSize: z.string().optional(),
|
|
2008
|
+
pageToken: z.string().optional(),
|
|
2009
|
+
orderBy: z.string().optional(),
|
|
2010
|
+
traitGroups: z.string().optional()
|
|
2011
|
+
});
|
|
2012
|
+
const zDeleteConversationMemoryObservationsQuery = z.object({
|
|
2013
|
+
storeId: z.string().optional(),
|
|
2014
|
+
profileId: z.string().optional(),
|
|
2015
|
+
observationId: z.string().optional()
|
|
2016
|
+
});
|
|
2017
|
+
const zGetConversationMemoryObservationsQuery = z.object({
|
|
2018
|
+
storeId: z.string().optional(),
|
|
2019
|
+
profileId: z.string().optional(),
|
|
2020
|
+
observationId: z.string().optional(),
|
|
2021
|
+
pageSize: z.string().optional(),
|
|
2022
|
+
pageToken: z.string().optional(),
|
|
2023
|
+
orderBy: z.string().optional(),
|
|
2024
|
+
source: z.string().optional(),
|
|
2025
|
+
createdAfter: z.string().optional(),
|
|
2026
|
+
createdBefore: z.string().optional()
|
|
2027
|
+
});
|
|
2028
|
+
const zPatchConversationMemoryObservationsBody = z.object({
|
|
2029
|
+
storeId: z.string(),
|
|
2030
|
+
profileId: z.string(),
|
|
2031
|
+
observationId: z.string(),
|
|
2032
|
+
content: z.string(),
|
|
2033
|
+
source: z.string(),
|
|
2034
|
+
occurredAt: z.string()
|
|
2035
|
+
});
|
|
2036
|
+
const zPostConversationMemoryObservationsBody = z.object({
|
|
2037
|
+
storeId: z.string(),
|
|
2038
|
+
profileId: z.string(),
|
|
2039
|
+
observations: z.string()
|
|
2040
|
+
});
|
|
2041
|
+
const zDeleteConversationMemoryConversationSummariesQuery = z.object({
|
|
2042
|
+
storeId: z.string().optional(),
|
|
2043
|
+
profileId: z.string().optional(),
|
|
2044
|
+
summaryId: z.string().optional()
|
|
2045
|
+
});
|
|
2046
|
+
const zGetConversationMemoryConversationSummariesQuery = z.object({
|
|
2047
|
+
storeId: z.string().optional(),
|
|
2048
|
+
profileId: z.string().optional(),
|
|
2049
|
+
summaryId: z.string().optional(),
|
|
2050
|
+
pageSize: z.string().optional(),
|
|
2051
|
+
pageToken: z.string().optional()
|
|
2052
|
+
});
|
|
2053
|
+
const zPatchConversationMemoryConversationSummariesBody = z.object({
|
|
2054
|
+
storeId: z.string(),
|
|
2055
|
+
profileId: z.string(),
|
|
2056
|
+
summaryId: z.string()
|
|
2057
|
+
});
|
|
2058
|
+
const zPostConversationMemoryConversationSummariesBody = z.object({
|
|
2059
|
+
storeId: z.string(),
|
|
2060
|
+
profileId: z.string(),
|
|
2061
|
+
summaries: z.string()
|
|
2062
|
+
});
|
|
2063
|
+
const zPostAssignDemoBody = z.object({
|
|
2064
|
+
phoneNumber: z.string(),
|
|
2065
|
+
targetObjectID: z.string()
|
|
2066
|
+
});
|
|
2067
|
+
const zGetLookupDemoQuery = z.object({
|
|
2068
|
+
phoneNumber: z.string().optional()
|
|
2069
|
+
});
|
|
2070
|
+
const zPostTemplateAutogenBody = z.object({
|
|
2071
|
+
requests: z.array(zAutogenRequest),
|
|
2072
|
+
tags: z.array(z.string()),
|
|
2073
|
+
createTemplates: z.boolean(),
|
|
2074
|
+
bindPhoneNumber: z.boolean(),
|
|
2075
|
+
countryCode: z.string(),
|
|
2076
|
+
tools: z.array(z.string())
|
|
2077
|
+
});
|
|
2078
|
+
const zDeleteTemplateQuery = z.object({
|
|
2079
|
+
campaign: z.string().optional()
|
|
2080
|
+
});
|
|
2081
|
+
const zPostTemplateBody = z.record(z.unknown());
|
|
2082
|
+
const zGetCampaignQuery = z.object({
|
|
2083
|
+
limit: z.string().optional(),
|
|
2084
|
+
offset: z.string().optional(),
|
|
2085
|
+
page: z.string().optional(),
|
|
2086
|
+
tag: z.string().optional(),
|
|
2087
|
+
objectId: z.string().optional(),
|
|
2088
|
+
company: z.string().optional(),
|
|
2089
|
+
includeCalledBy: z.string().optional()
|
|
2090
|
+
});
|
|
2091
|
+
/**
|
|
2092
|
+
* Success
|
|
2093
|
+
*/ const zGetSupportedRegionsResponse = z.object({
|
|
2094
|
+
regions: z.array(zSupportedRegion)
|
|
2095
|
+
});
|
|
2096
|
+
const zPatchLinkShortenerBody = z.object({
|
|
2097
|
+
objectID: z.string(),
|
|
2098
|
+
shortLink: z.string()
|
|
2099
|
+
});
|
|
2100
|
+
const zPostLinkShortenerBody = z.object({
|
|
2101
|
+
urls: z.array(zShortenUrlInput)
|
|
2102
|
+
});
|
|
2103
|
+
const zDeleteLinkShortenerByCodePath = z.object({
|
|
2104
|
+
code: z.string()
|
|
2105
|
+
});
|
|
2106
|
+
|
|
2107
|
+
var zod_gen = {
|
|
2108
|
+
__proto__: null,
|
|
2109
|
+
zAutogenRequest: zAutogenRequest,
|
|
2110
|
+
zDeleteConversationMemoryConversationSummariesQuery: zDeleteConversationMemoryConversationSummariesQuery,
|
|
2111
|
+
zDeleteConversationMemoryIdentifiersQuery: zDeleteConversationMemoryIdentifiersQuery,
|
|
2112
|
+
zDeleteConversationMemoryObservationsQuery: zDeleteConversationMemoryObservationsQuery,
|
|
2113
|
+
zDeleteConversationMemoryProfilesQuery: zDeleteConversationMemoryProfilesQuery,
|
|
2114
|
+
zDeleteConversationMemoryTraitGroupsQuery: zDeleteConversationMemoryTraitGroupsQuery,
|
|
2115
|
+
zDeleteConversationalIntelligenceOperatorBody: zDeleteConversationalIntelligenceOperatorBody,
|
|
2116
|
+
zDeleteLinkShortenerByCodePath: zDeleteLinkShortenerByCodePath,
|
|
2117
|
+
zDeleteTemplateQuery: zDeleteTemplateQuery,
|
|
2118
|
+
zGetCampaignQuery: zGetCampaignQuery,
|
|
2119
|
+
zGetConversationMemoryConversationSummariesQuery: zGetConversationMemoryConversationSummariesQuery,
|
|
2120
|
+
zGetConversationMemoryIdentifiersQuery: zGetConversationMemoryIdentifiersQuery,
|
|
2121
|
+
zGetConversationMemoryObservationsQuery: zGetConversationMemoryObservationsQuery,
|
|
2122
|
+
zGetConversationMemoryProfilesQuery: zGetConversationMemoryProfilesQuery,
|
|
2123
|
+
zGetConversationMemoryTraitGroupsQuery: zGetConversationMemoryTraitGroupsQuery,
|
|
2124
|
+
zGetConversationMemoryTraitsQuery: zGetConversationMemoryTraitsQuery,
|
|
2125
|
+
zGetConversationalIntelligenceOperatorQuery: zGetConversationalIntelligenceOperatorQuery,
|
|
2126
|
+
zGetConversationsFetchQuery: zGetConversationsFetchQuery,
|
|
2127
|
+
zGetIntelligenceConfigurationQuery: zGetIntelligenceConfigurationQuery,
|
|
2128
|
+
zGetLookupDemoQuery: zGetLookupDemoQuery,
|
|
2129
|
+
zGetParticipantsQuery: zGetParticipantsQuery,
|
|
2130
|
+
zGetSupportedRegionsResponse: zGetSupportedRegionsResponse,
|
|
2131
|
+
zGetSyncTokenQuery: zGetSyncTokenQuery,
|
|
2132
|
+
zGetVoiceTokenQuery: zGetVoiceTokenQuery,
|
|
2133
|
+
zPatchConversationMemoryConversationSummariesBody: zPatchConversationMemoryConversationSummariesBody,
|
|
2134
|
+
zPatchConversationMemoryIdentifiersBody: zPatchConversationMemoryIdentifiersBody,
|
|
2135
|
+
zPatchConversationMemoryObservationsBody: zPatchConversationMemoryObservationsBody,
|
|
2136
|
+
zPatchConversationMemoryProfilesBody: zPatchConversationMemoryProfilesBody,
|
|
2137
|
+
zPatchConversationMemoryTraitGroupsBody: zPatchConversationMemoryTraitGroupsBody,
|
|
2138
|
+
zPatchLeadGenBody: zPatchLeadGenBody,
|
|
2139
|
+
zPatchLinkShortenerBody: zPatchLinkShortenerBody,
|
|
2140
|
+
zPostAssignDemoBody: zPostAssignDemoBody,
|
|
2141
|
+
zPostConversationMemoryConversationSummariesBody: zPostConversationMemoryConversationSummariesBody,
|
|
2142
|
+
zPostConversationMemoryIdentifiersBody: zPostConversationMemoryIdentifiersBody,
|
|
2143
|
+
zPostConversationMemoryObservationsBody: zPostConversationMemoryObservationsBody,
|
|
2144
|
+
zPostConversationMemoryProfilesBody: zPostConversationMemoryProfilesBody,
|
|
2145
|
+
zPostConversationMemoryProfilesLookupBody: zPostConversationMemoryProfilesLookupBody,
|
|
2146
|
+
zPostConversationMemoryRecallBody: zPostConversationMemoryRecallBody,
|
|
2147
|
+
zPostConversationMemoryTraitGroupsBody: zPostConversationMemoryTraitGroupsBody,
|
|
2148
|
+
zPostConversationalIntelligenceOperatorBody: zPostConversationalIntelligenceOperatorBody,
|
|
2149
|
+
zPostConversationsBody: zPostConversationsBody,
|
|
2150
|
+
zPostConversationsCommunicationsByConversationIdBody: zPostConversationsCommunicationsByConversationIdBody,
|
|
2151
|
+
zPostConversationsCommunicationsByConversationIdPath: zPostConversationsCommunicationsByConversationIdPath,
|
|
2152
|
+
zPostConversationsTokenBody: zPostConversationsTokenBody,
|
|
2153
|
+
zPostCreateExternalFlexConnectionBody: zPostCreateExternalFlexConnectionBody,
|
|
2154
|
+
zPostInstallFlexPluginBody: zPostInstallFlexPluginBody,
|
|
2155
|
+
zPostIntelligenceConfigurationBody: zPostIntelligenceConfigurationBody,
|
|
2156
|
+
zPostLeadGenBody: zPostLeadGenBody,
|
|
2157
|
+
zPostLinkShortenerBody: zPostLinkShortenerBody,
|
|
2158
|
+
zPostLiveAgentWebchatConnectBody: zPostLiveAgentWebchatConnectBody,
|
|
2159
|
+
zPostLiveAgentWebchatEndBody: zPostLiveAgentWebchatEndBody,
|
|
2160
|
+
zPostLiveAgentWebchatSendBody: zPostLiveAgentWebchatSendBody,
|
|
2161
|
+
zPostParticipantsBody: zPostParticipantsBody,
|
|
2162
|
+
zPostTemplateAutogenBody: zPostTemplateAutogenBody,
|
|
2163
|
+
zPostTemplateBody: zPostTemplateBody,
|
|
2164
|
+
zPostUiConfigBody: zPostUiConfigBody,
|
|
2165
|
+
zPutConversationalIntelligenceOperatorBody: zPutConversationalIntelligenceOperatorBody,
|
|
2166
|
+
zPutConversationsBody: zPutConversationsBody,
|
|
2167
|
+
zPutIntelligenceConfigurationBody: zPutIntelligenceConfigurationBody,
|
|
2168
|
+
zPutParticipantsBody: zPutParticipantsBody,
|
|
2169
|
+
zShortenUrlInput: zShortenUrlInput,
|
|
2170
|
+
zSupportedRegion: zSupportedRegion
|
|
2171
|
+
};
|
|
2172
|
+
|
|
2173
|
+
export { createRampApiClient, deleteConversationMemoryConversationSummaries, deleteConversationMemoryIdentifiers, deleteConversationMemoryObservations, deleteConversationMemoryProfiles, deleteConversationMemoryReset, deleteConversationMemoryTraitGroups, deleteConversationalIntelligenceOperator, deleteLeadGen, deleteLinkShortenerByCode, deleteTemplate, getCampaign, getConversationMemoryConversationSummaries, getConversationMemoryIdentifiers, getConversationMemoryObservations, getConversationMemoryProfiles, getConversationMemoryTraitGroups, getConversationMemoryTraits, getConversationalIntelligenceOperator, getConversationsFetch, getDocsOpenapiJson, getHealth, getIntelligenceConfiguration, getLinkShortener, getLookupDemo, getParticipants, getSupportedRegions, getSyncToken, getVoiceToken, patchConversationMemoryConversationSummaries, patchConversationMemoryIdentifiers, patchConversationMemoryObservations, patchConversationMemoryProfiles, patchConversationMemoryTraitGroups, patchLeadGen, patchLinkShortener, postAssignDemo, postConversationMemoryConversationSummaries, postConversationMemoryIdentifiers, postConversationMemoryObservations, postConversationMemoryProfiles, postConversationMemoryProfilesLookup, postConversationMemoryRecall, postConversationMemoryTraitGroups, postConversationalIntelligenceOperator, postConversations, postConversationsCommunicationsByConversationId, postConversationsToken, postCreateExternalFlexConnection, postInstallFlexPlugin, postIntelligenceConfiguration, postLeadGen, postLeadGenMonitor, postLinkShortener, postLiveAgentWebchatConnect, postLiveAgentWebchatEnd, postLiveAgentWebchatSend, postParticipants, postTemplate, postTemplateAutogen, postUiConfig, putConversationalIntelligenceOperator, putConversations, putIntelligenceConfiguration, putParticipants, zod_gen as schemas };
|