@wildix/wim-voicebots-client 1.1.9 → 4.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/dist-cjs/VoiceBots.js +3 -3
- package/dist-cjs/VoiceBotsClient.js +34 -26
- package/dist-cjs/auth/httpAuthExtensionConfiguration.js +43 -0
- package/dist-cjs/auth/httpAuthSchemeProvider.js +65 -0
- package/dist-cjs/commands/CreateVoiceBotCommand.js +10 -11
- package/dist-cjs/commands/DeleteVoiceBotCommand.js +10 -11
- package/dist-cjs/commands/DescribeEventCommand.js +10 -11
- package/dist-cjs/commands/GetTraceCommand.js +10 -11
- package/dist-cjs/commands/GetVoiceBotCommand.js +10 -11
- package/dist-cjs/commands/ListTracesCommand.js +10 -11
- package/dist-cjs/commands/ListVoiceBotsCommand.js +10 -11
- package/dist-cjs/commands/ListVoiceBotsNamesCommand.js +10 -11
- package/dist-cjs/commands/SendHangupCommand.js +10 -11
- package/dist-cjs/commands/SendPlayCommand.js +10 -11
- package/dist-cjs/commands/SendSayCommand.js +10 -11
- package/dist-cjs/commands/SendStopCommand.js +10 -11
- package/dist-cjs/commands/SendTransferCommand.js +10 -11
- package/dist-cjs/commands/UpdateVoiceBotCommand.js +10 -11
- package/dist-cjs/endpoint/EndpointParameters.js +16 -0
- package/dist-cjs/endpoint/bdd.js +28 -0
- package/dist-cjs/endpoint/endpointResolver.js +16 -0
- package/dist-cjs/index.js +4 -1
- package/dist-cjs/models/VoiceBotsServiceException.js +3 -3
- package/dist-cjs/models/enums.js +64 -0
- package/dist-cjs/models/errors.js +75 -0
- package/dist-cjs/models/models_0.js +0 -350
- package/dist-cjs/runtimeConfig.browser.js +11 -11
- package/dist-cjs/runtimeConfig.js +22 -18
- package/dist-cjs/runtimeConfig.shared.js +30 -10
- package/dist-cjs/runtimeExtensions.js +6 -5
- package/dist-cjs/schemas/schemas_0.js +1247 -0
- package/dist-es/VoiceBots.js +6 -6
- package/dist-es/VoiceBotsClient.js +30 -22
- package/dist-es/auth/httpAuthExtensionConfiguration.js +38 -0
- package/dist-es/auth/httpAuthSchemeProvider.js +59 -0
- package/dist-es/commands/CreateVoiceBotCommand.js +9 -10
- package/dist-es/commands/DeleteVoiceBotCommand.js +9 -10
- package/dist-es/commands/DescribeEventCommand.js +9 -10
- package/dist-es/commands/GetTraceCommand.js +9 -10
- package/dist-es/commands/GetVoiceBotCommand.js +9 -10
- package/dist-es/commands/ListTracesCommand.js +9 -10
- package/dist-es/commands/ListVoiceBotsCommand.js +9 -10
- package/dist-es/commands/ListVoiceBotsNamesCommand.js +9 -10
- package/dist-es/commands/SendHangupCommand.js +9 -10
- package/dist-es/commands/SendPlayCommand.js +9 -10
- package/dist-es/commands/SendSayCommand.js +9 -10
- package/dist-es/commands/SendStopCommand.js +9 -10
- package/dist-es/commands/SendTransferCommand.js +9 -10
- package/dist-es/commands/UpdateVoiceBotCommand.js +9 -10
- package/dist-es/endpoint/EndpointParameters.js +12 -0
- package/dist-es/endpoint/bdd.js +25 -0
- package/dist-es/endpoint/endpointResolver.js +12 -0
- package/dist-es/index.js +4 -1
- package/dist-es/models/VoiceBotsServiceException.js +1 -1
- package/dist-es/models/enums.js +61 -0
- package/dist-es/models/errors.js +67 -0
- package/dist-es/models/models_0.js +1 -344
- package/dist-es/runtimeConfig.browser.js +7 -7
- package/dist-es/runtimeConfig.js +17 -13
- package/dist-es/runtimeConfig.shared.js +24 -4
- package/dist-es/runtimeExtensions.js +6 -5
- package/dist-es/schemas/schemas_0.js +1241 -0
- package/dist-types/VoiceBots.d.ts +15 -15
- package/dist-types/VoiceBotsClient.d.ts +44 -26
- package/dist-types/auth/httpAuthExtensionConfiguration.d.ts +29 -0
- package/dist-types/auth/httpAuthSchemeProvider.d.ts +81 -0
- package/dist-types/commands/CreateVoiceBotCommand.d.ts +11 -7
- package/dist-types/commands/DeleteVoiceBotCommand.d.ts +11 -7
- package/dist-types/commands/DescribeEventCommand.d.ts +11 -7
- package/dist-types/commands/GetTraceCommand.d.ts +11 -7
- package/dist-types/commands/GetVoiceBotCommand.d.ts +11 -7
- package/dist-types/commands/ListTracesCommand.d.ts +11 -7
- package/dist-types/commands/ListVoiceBotsCommand.d.ts +11 -7
- package/dist-types/commands/ListVoiceBotsNamesCommand.d.ts +11 -7
- package/dist-types/commands/SendHangupCommand.d.ts +11 -7
- package/dist-types/commands/SendPlayCommand.d.ts +11 -7
- package/dist-types/commands/SendSayCommand.d.ts +11 -7
- package/dist-types/commands/SendStopCommand.d.ts +11 -7
- package/dist-types/commands/SendTransferCommand.d.ts +11 -7
- package/dist-types/commands/UpdateVoiceBotCommand.d.ts +11 -7
- package/dist-types/endpoint/EndpointParameters.d.ts +41 -0
- package/dist-types/endpoint/bdd.d.ts +2 -0
- package/dist-types/endpoint/endpointResolver.d.ts +8 -0
- package/dist-types/extensionConfiguration.d.ts +4 -3
- package/dist-types/index.d.ts +5 -1
- package/dist-types/models/VoiceBotsServiceException.d.ts +1 -1
- package/dist-types/models/enums.d.ts +141 -0
- package/dist-types/models/errors.d.ts +60 -0
- package/dist-types/models/models_0.d.ts +92 -244
- package/dist-types/runtimeConfig.browser.d.ts +34 -15
- package/dist-types/runtimeConfig.d.ts +33 -14
- package/dist-types/runtimeConfig.native.d.ts +35 -16
- package/dist-types/runtimeConfig.shared.d.ts +20 -3
- package/dist-types/runtimeExtensions.d.ts +1 -1
- package/dist-types/schemas/schemas_0.d.ts +175 -0
- package/package.json +13 -39
- package/dist-cjs/models/index.js +0 -4
- package/dist-cjs/protocols/Aws_restJson1.js +0 -1106
- package/dist-es/models/index.js +0 -1
- package/dist-es/protocols/Aws_restJson1.js +0 -1075
- package/dist-types/models/index.d.ts +0 -1
- package/dist-types/protocols/Aws_restJson1.d.ts +0 -128
|
@@ -1,1075 +0,0 @@
|
|
|
1
|
-
import { VoiceBotsServiceException as __BaseException } from "../models/VoiceBotsServiceException";
|
|
2
|
-
import { ForbiddenException, ValidationException, VoiceBotEndpoint, VoiceBotFunctionIntegration, VoiceBotNonUniqueNameException, VoiceBotNotFoundException, VoiceSessionNotFoundException, } from "../models/models_0";
|
|
3
|
-
import { awsExpectUnion as __expectUnion, loadRestJsonErrorCode, parseJsonBody as parseBody, parseJsonErrorBody as parseErrorBody, } from "@aws-sdk/core";
|
|
4
|
-
import { requestBuilder as rb } from "@smithy/core";
|
|
5
|
-
import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectLong as __expectLong, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, limitedParseDouble as __limitedParseDouble, limitedParseFloat32 as __limitedParseFloat32, _json, collectBody, map, take, withBaseException, } from "@smithy/smithy-client";
|
|
6
|
-
export const se_CreateVoiceBotCommand = async (input, context) => {
|
|
7
|
-
const b = rb(input, context);
|
|
8
|
-
const headers = {
|
|
9
|
-
'content-type': 'application/json',
|
|
10
|
-
};
|
|
11
|
-
b.bp("/v2/voicebots/bots");
|
|
12
|
-
const query = map({
|
|
13
|
-
[_c]: [, input[_c]],
|
|
14
|
-
});
|
|
15
|
-
let body;
|
|
16
|
-
body = JSON.stringify(take(input, {
|
|
17
|
-
'capabilities': _ => _json(_),
|
|
18
|
-
'category': [],
|
|
19
|
-
'endpoint': _ => se_VoiceBotEndpoint(_, context),
|
|
20
|
-
'groupId': [],
|
|
21
|
-
'message': [],
|
|
22
|
-
'name': [],
|
|
23
|
-
'pipeline': _ => _json(_),
|
|
24
|
-
}));
|
|
25
|
-
b.m("POST")
|
|
26
|
-
.h(headers)
|
|
27
|
-
.q(query)
|
|
28
|
-
.b(body);
|
|
29
|
-
return b.build();
|
|
30
|
-
};
|
|
31
|
-
export const se_DeleteVoiceBotCommand = async (input, context) => {
|
|
32
|
-
const b = rb(input, context);
|
|
33
|
-
const headers = {};
|
|
34
|
-
b.bp("/v2/voicebots/bots/{botId}");
|
|
35
|
-
b.p('botId', () => input.botId, '{botId}', false);
|
|
36
|
-
const query = map({
|
|
37
|
-
[_c]: [, input[_c]],
|
|
38
|
-
});
|
|
39
|
-
let body;
|
|
40
|
-
b.m("DELETE")
|
|
41
|
-
.h(headers)
|
|
42
|
-
.q(query)
|
|
43
|
-
.b(body);
|
|
44
|
-
return b.build();
|
|
45
|
-
};
|
|
46
|
-
export const se_DescribeEventCommand = async (input, context) => {
|
|
47
|
-
const b = rb(input, context);
|
|
48
|
-
const headers = {};
|
|
49
|
-
b.bp("/v2/voicebots/describe");
|
|
50
|
-
let body;
|
|
51
|
-
b.m("POST")
|
|
52
|
-
.h(headers)
|
|
53
|
-
.b(body);
|
|
54
|
-
return b.build();
|
|
55
|
-
};
|
|
56
|
-
export const se_GetTraceCommand = async (input, context) => {
|
|
57
|
-
const b = rb(input, context);
|
|
58
|
-
const headers = {};
|
|
59
|
-
b.bp("/v2/voicebots/traces/{sessionId}");
|
|
60
|
-
b.p('sessionId', () => input.sessionId, '{sessionId}', false);
|
|
61
|
-
const query = map({
|
|
62
|
-
[_c]: [, input[_c]],
|
|
63
|
-
});
|
|
64
|
-
let body;
|
|
65
|
-
b.m("GET")
|
|
66
|
-
.h(headers)
|
|
67
|
-
.q(query)
|
|
68
|
-
.b(body);
|
|
69
|
-
return b.build();
|
|
70
|
-
};
|
|
71
|
-
export const se_GetVoiceBotCommand = async (input, context) => {
|
|
72
|
-
const b = rb(input, context);
|
|
73
|
-
const headers = {};
|
|
74
|
-
b.bp("/v2/voicebots/bots/{botId}");
|
|
75
|
-
b.p('botId', () => input.botId, '{botId}', false);
|
|
76
|
-
const query = map({
|
|
77
|
-
[_c]: [, input[_c]],
|
|
78
|
-
});
|
|
79
|
-
let body;
|
|
80
|
-
b.m("GET")
|
|
81
|
-
.h(headers)
|
|
82
|
-
.q(query)
|
|
83
|
-
.b(body);
|
|
84
|
-
return b.build();
|
|
85
|
-
};
|
|
86
|
-
export const se_ListTracesCommand = async (input, context) => {
|
|
87
|
-
const b = rb(input, context);
|
|
88
|
-
const headers = {};
|
|
89
|
-
b.bp("/v2/voicebots/traces");
|
|
90
|
-
const query = map({
|
|
91
|
-
[_c]: [, input[_c]],
|
|
92
|
-
[_s]: [, input[_s]],
|
|
93
|
-
});
|
|
94
|
-
let body;
|
|
95
|
-
b.m("GET")
|
|
96
|
-
.h(headers)
|
|
97
|
-
.q(query)
|
|
98
|
-
.b(body);
|
|
99
|
-
return b.build();
|
|
100
|
-
};
|
|
101
|
-
export const se_ListVoiceBotsCommand = async (input, context) => {
|
|
102
|
-
const b = rb(input, context);
|
|
103
|
-
const headers = {};
|
|
104
|
-
b.bp("/v2/voicebots/bots");
|
|
105
|
-
const query = map({
|
|
106
|
-
[_c]: [, input[_c]],
|
|
107
|
-
});
|
|
108
|
-
let body;
|
|
109
|
-
b.m("GET")
|
|
110
|
-
.h(headers)
|
|
111
|
-
.q(query)
|
|
112
|
-
.b(body);
|
|
113
|
-
return b.build();
|
|
114
|
-
};
|
|
115
|
-
export const se_ListVoiceBotsNamesCommand = async (input, context) => {
|
|
116
|
-
const b = rb(input, context);
|
|
117
|
-
const headers = {};
|
|
118
|
-
b.bp("/v2/voicebots/names");
|
|
119
|
-
const query = map({
|
|
120
|
-
[_c]: [, input[_c]],
|
|
121
|
-
});
|
|
122
|
-
let body;
|
|
123
|
-
b.m("GET")
|
|
124
|
-
.h(headers)
|
|
125
|
-
.q(query)
|
|
126
|
-
.b(body);
|
|
127
|
-
return b.build();
|
|
128
|
-
};
|
|
129
|
-
export const se_SendHangupCommand = async (input, context) => {
|
|
130
|
-
const b = rb(input, context);
|
|
131
|
-
const headers = {
|
|
132
|
-
'content-type': 'application/json',
|
|
133
|
-
};
|
|
134
|
-
b.bp("/v2/voicebots/sessions/{sessionId}/hangup");
|
|
135
|
-
b.p('sessionId', () => input.sessionId, '{sessionId}', false);
|
|
136
|
-
let body;
|
|
137
|
-
body = JSON.stringify(take(input, {
|
|
138
|
-
'reason': [],
|
|
139
|
-
}));
|
|
140
|
-
b.m("POST")
|
|
141
|
-
.h(headers)
|
|
142
|
-
.b(body);
|
|
143
|
-
return b.build();
|
|
144
|
-
};
|
|
145
|
-
export const se_SendPlayCommand = async (input, context) => {
|
|
146
|
-
const b = rb(input, context);
|
|
147
|
-
const headers = {
|
|
148
|
-
'content-type': 'application/json',
|
|
149
|
-
};
|
|
150
|
-
b.bp("/v2/voicebots/sessions/{sessionId}/play");
|
|
151
|
-
b.p('sessionId', () => input.sessionId, '{sessionId}', false);
|
|
152
|
-
let body;
|
|
153
|
-
body = JSON.stringify(take(input, {
|
|
154
|
-
'data': [],
|
|
155
|
-
'replyId': [],
|
|
156
|
-
'streamId': [],
|
|
157
|
-
}));
|
|
158
|
-
b.m("POST")
|
|
159
|
-
.h(headers)
|
|
160
|
-
.b(body);
|
|
161
|
-
return b.build();
|
|
162
|
-
};
|
|
163
|
-
export const se_SendSayCommand = async (input, context) => {
|
|
164
|
-
const b = rb(input, context);
|
|
165
|
-
const headers = {
|
|
166
|
-
'content-type': 'application/json',
|
|
167
|
-
};
|
|
168
|
-
b.bp("/v2/voicebots/sessions/{sessionId}/say");
|
|
169
|
-
b.p('sessionId', () => input.sessionId, '{sessionId}', false);
|
|
170
|
-
let body;
|
|
171
|
-
body = JSON.stringify(take(input, {
|
|
172
|
-
'audio': _ => _json(_),
|
|
173
|
-
'interruptible': [],
|
|
174
|
-
'replyId': [],
|
|
175
|
-
'text': [],
|
|
176
|
-
}));
|
|
177
|
-
b.m("POST")
|
|
178
|
-
.h(headers)
|
|
179
|
-
.b(body);
|
|
180
|
-
return b.build();
|
|
181
|
-
};
|
|
182
|
-
export const se_SendStopCommand = async (input, context) => {
|
|
183
|
-
const b = rb(input, context);
|
|
184
|
-
const headers = {};
|
|
185
|
-
b.bp("/v2/voicebots/sessions/{sessionId}/stop");
|
|
186
|
-
b.p('sessionId', () => input.sessionId, '{sessionId}', false);
|
|
187
|
-
let body;
|
|
188
|
-
b.m("POST")
|
|
189
|
-
.h(headers)
|
|
190
|
-
.b(body);
|
|
191
|
-
return b.build();
|
|
192
|
-
};
|
|
193
|
-
export const se_SendTransferCommand = async (input, context) => {
|
|
194
|
-
const b = rb(input, context);
|
|
195
|
-
const headers = {
|
|
196
|
-
'content-type': 'application/json',
|
|
197
|
-
};
|
|
198
|
-
b.bp("/v2/voicebots/sessions/{sessionId}/transfer");
|
|
199
|
-
b.p('sessionId', () => input.sessionId, '{sessionId}', false);
|
|
200
|
-
let body;
|
|
201
|
-
body = JSON.stringify(take(input, {
|
|
202
|
-
'context': [],
|
|
203
|
-
'extension': [],
|
|
204
|
-
}));
|
|
205
|
-
b.m("POST")
|
|
206
|
-
.h(headers)
|
|
207
|
-
.b(body);
|
|
208
|
-
return b.build();
|
|
209
|
-
};
|
|
210
|
-
export const se_UpdateVoiceBotCommand = async (input, context) => {
|
|
211
|
-
const b = rb(input, context);
|
|
212
|
-
const headers = {
|
|
213
|
-
'content-type': 'application/json',
|
|
214
|
-
};
|
|
215
|
-
b.bp("/v2/voicebots/bots/{botId}");
|
|
216
|
-
b.p('botId', () => input.botId, '{botId}', false);
|
|
217
|
-
const query = map({
|
|
218
|
-
[_c]: [, input[_c]],
|
|
219
|
-
});
|
|
220
|
-
let body;
|
|
221
|
-
body = JSON.stringify(take(input, {
|
|
222
|
-
'capabilities': _ => _json(_),
|
|
223
|
-
'category': [],
|
|
224
|
-
'endpoint': _ => se_VoiceBotEndpoint(_, context),
|
|
225
|
-
'groupId': [],
|
|
226
|
-
'message': [],
|
|
227
|
-
'name': [],
|
|
228
|
-
'pipeline': _ => _json(_),
|
|
229
|
-
}));
|
|
230
|
-
b.m("PUT")
|
|
231
|
-
.h(headers)
|
|
232
|
-
.q(query)
|
|
233
|
-
.b(body);
|
|
234
|
-
return b.build();
|
|
235
|
-
};
|
|
236
|
-
export const de_CreateVoiceBotCommand = async (output, context) => {
|
|
237
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
238
|
-
return de_CommandError(output, context);
|
|
239
|
-
}
|
|
240
|
-
const contents = map({
|
|
241
|
-
$metadata: deserializeMetadata(output),
|
|
242
|
-
});
|
|
243
|
-
const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
|
|
244
|
-
const doc = take(data, {
|
|
245
|
-
'bot': _ => de_VoiceBot(_, context),
|
|
246
|
-
});
|
|
247
|
-
Object.assign(contents, doc);
|
|
248
|
-
return contents;
|
|
249
|
-
};
|
|
250
|
-
export const de_DeleteVoiceBotCommand = async (output, context) => {
|
|
251
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
252
|
-
return de_CommandError(output, context);
|
|
253
|
-
}
|
|
254
|
-
const contents = map({
|
|
255
|
-
$metadata: deserializeMetadata(output),
|
|
256
|
-
});
|
|
257
|
-
await collectBody(output.body, context);
|
|
258
|
-
return contents;
|
|
259
|
-
};
|
|
260
|
-
export const de_DescribeEventCommand = async (output, context) => {
|
|
261
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
262
|
-
return de_CommandError(output, context);
|
|
263
|
-
}
|
|
264
|
-
const contents = map({
|
|
265
|
-
$metadata: deserializeMetadata(output),
|
|
266
|
-
});
|
|
267
|
-
const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
|
|
268
|
-
const doc = take(data, {
|
|
269
|
-
'AudioWebhookEvent': _json,
|
|
270
|
-
'CompleteWebhookEvent': _json,
|
|
271
|
-
'CompleteWebsocketEvent': _json,
|
|
272
|
-
'HangupWebsocketCommand': _json,
|
|
273
|
-
'InterruptionWebhookEvent': _json,
|
|
274
|
-
'InterruptionWebsocketEvent': _json,
|
|
275
|
-
'PlayWebsocketCommand': _json,
|
|
276
|
-
'PlaybackWebhookEvent': _json,
|
|
277
|
-
'PlaybackWebsocketEvent': _json,
|
|
278
|
-
'PubSubBroadcastWebsocketEvent': _ => de_PubSubBroadcastWebsocketEvent(_, context),
|
|
279
|
-
'PubSubSubscribeWebsocketCommand': _json,
|
|
280
|
-
'PubSubSubscribedWebsocketEvent': _json,
|
|
281
|
-
'PubSubUnsubscribeWebsocketCommand': _json,
|
|
282
|
-
'PubSubUnsubscribedWebsocketEvent': _json,
|
|
283
|
-
'ReplyWebhookEvent': _json,
|
|
284
|
-
'ReplyWebsocketEvent': _json,
|
|
285
|
-
'SayWebsocketCommand': _json,
|
|
286
|
-
'SessionEndedWebhookEvent': _json,
|
|
287
|
-
'SessionStartedWebhookEvent': _json,
|
|
288
|
-
'StopWebsocketCommand': _json,
|
|
289
|
-
'TranscriptionWebhookEvent': _ => de_TranscriptionWebhookEvent(_, context),
|
|
290
|
-
'TranscriptionWebsocketEvent': _ => de_TranscriptionWebsocketEvent(_, context),
|
|
291
|
-
'TransferWebsocketCommand': _json,
|
|
292
|
-
});
|
|
293
|
-
Object.assign(contents, doc);
|
|
294
|
-
return contents;
|
|
295
|
-
};
|
|
296
|
-
export const de_GetTraceCommand = async (output, context) => {
|
|
297
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
298
|
-
return de_CommandError(output, context);
|
|
299
|
-
}
|
|
300
|
-
const contents = map({
|
|
301
|
-
$metadata: deserializeMetadata(output),
|
|
302
|
-
});
|
|
303
|
-
const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
|
|
304
|
-
const doc = take(data, {
|
|
305
|
-
'trace': _ => de_Trace(_, context),
|
|
306
|
-
});
|
|
307
|
-
Object.assign(contents, doc);
|
|
308
|
-
return contents;
|
|
309
|
-
};
|
|
310
|
-
export const de_GetVoiceBotCommand = async (output, context) => {
|
|
311
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
312
|
-
return de_CommandError(output, context);
|
|
313
|
-
}
|
|
314
|
-
const contents = map({
|
|
315
|
-
$metadata: deserializeMetadata(output),
|
|
316
|
-
});
|
|
317
|
-
const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
|
|
318
|
-
const doc = take(data, {
|
|
319
|
-
'bot': _ => de_VoiceBot(_, context),
|
|
320
|
-
});
|
|
321
|
-
Object.assign(contents, doc);
|
|
322
|
-
return contents;
|
|
323
|
-
};
|
|
324
|
-
export const de_ListTracesCommand = async (output, context) => {
|
|
325
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
326
|
-
return de_CommandError(output, context);
|
|
327
|
-
}
|
|
328
|
-
const contents = map({
|
|
329
|
-
$metadata: deserializeMetadata(output),
|
|
330
|
-
});
|
|
331
|
-
const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
|
|
332
|
-
const doc = take(data, {
|
|
333
|
-
'traces': _ => de_TraceSessionsList(_, context),
|
|
334
|
-
});
|
|
335
|
-
Object.assign(contents, doc);
|
|
336
|
-
return contents;
|
|
337
|
-
};
|
|
338
|
-
export const de_ListVoiceBotsCommand = async (output, context) => {
|
|
339
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
340
|
-
return de_CommandError(output, context);
|
|
341
|
-
}
|
|
342
|
-
const contents = map({
|
|
343
|
-
$metadata: deserializeMetadata(output),
|
|
344
|
-
});
|
|
345
|
-
const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
|
|
346
|
-
const doc = take(data, {
|
|
347
|
-
'bots': _ => de_VoiceBotsList(_, context),
|
|
348
|
-
});
|
|
349
|
-
Object.assign(contents, doc);
|
|
350
|
-
return contents;
|
|
351
|
-
};
|
|
352
|
-
export const de_ListVoiceBotsNamesCommand = async (output, context) => {
|
|
353
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
354
|
-
return de_CommandError(output, context);
|
|
355
|
-
}
|
|
356
|
-
const contents = map({
|
|
357
|
-
$metadata: deserializeMetadata(output),
|
|
358
|
-
});
|
|
359
|
-
const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
|
|
360
|
-
const doc = take(data, {
|
|
361
|
-
'bots': _json,
|
|
362
|
-
});
|
|
363
|
-
Object.assign(contents, doc);
|
|
364
|
-
return contents;
|
|
365
|
-
};
|
|
366
|
-
export const de_SendHangupCommand = async (output, context) => {
|
|
367
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
368
|
-
return de_CommandError(output, context);
|
|
369
|
-
}
|
|
370
|
-
const contents = map({
|
|
371
|
-
$metadata: deserializeMetadata(output),
|
|
372
|
-
});
|
|
373
|
-
await collectBody(output.body, context);
|
|
374
|
-
return contents;
|
|
375
|
-
};
|
|
376
|
-
export const de_SendPlayCommand = async (output, context) => {
|
|
377
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
378
|
-
return de_CommandError(output, context);
|
|
379
|
-
}
|
|
380
|
-
const contents = map({
|
|
381
|
-
$metadata: deserializeMetadata(output),
|
|
382
|
-
});
|
|
383
|
-
await collectBody(output.body, context);
|
|
384
|
-
return contents;
|
|
385
|
-
};
|
|
386
|
-
export const de_SendSayCommand = async (output, context) => {
|
|
387
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
388
|
-
return de_CommandError(output, context);
|
|
389
|
-
}
|
|
390
|
-
const contents = map({
|
|
391
|
-
$metadata: deserializeMetadata(output),
|
|
392
|
-
});
|
|
393
|
-
await collectBody(output.body, context);
|
|
394
|
-
return contents;
|
|
395
|
-
};
|
|
396
|
-
export const de_SendStopCommand = async (output, context) => {
|
|
397
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
398
|
-
return de_CommandError(output, context);
|
|
399
|
-
}
|
|
400
|
-
const contents = map({
|
|
401
|
-
$metadata: deserializeMetadata(output),
|
|
402
|
-
});
|
|
403
|
-
await collectBody(output.body, context);
|
|
404
|
-
return contents;
|
|
405
|
-
};
|
|
406
|
-
export const de_SendTransferCommand = async (output, context) => {
|
|
407
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
408
|
-
return de_CommandError(output, context);
|
|
409
|
-
}
|
|
410
|
-
const contents = map({
|
|
411
|
-
$metadata: deserializeMetadata(output),
|
|
412
|
-
});
|
|
413
|
-
await collectBody(output.body, context);
|
|
414
|
-
return contents;
|
|
415
|
-
};
|
|
416
|
-
export const de_UpdateVoiceBotCommand = async (output, context) => {
|
|
417
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
418
|
-
return de_CommandError(output, context);
|
|
419
|
-
}
|
|
420
|
-
const contents = map({
|
|
421
|
-
$metadata: deserializeMetadata(output),
|
|
422
|
-
});
|
|
423
|
-
const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
|
|
424
|
-
const doc = take(data, {
|
|
425
|
-
'bot': _ => de_VoiceBot(_, context),
|
|
426
|
-
});
|
|
427
|
-
Object.assign(contents, doc);
|
|
428
|
-
return contents;
|
|
429
|
-
};
|
|
430
|
-
const de_CommandError = async (output, context) => {
|
|
431
|
-
const parsedOutput = {
|
|
432
|
-
...output,
|
|
433
|
-
body: await parseErrorBody(output.body, context)
|
|
434
|
-
};
|
|
435
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
436
|
-
switch (errorCode) {
|
|
437
|
-
case "ForbiddenException":
|
|
438
|
-
case "smithy.framework#ForbiddenException":
|
|
439
|
-
throw await de_ForbiddenExceptionRes(parsedOutput, context);
|
|
440
|
-
case "ValidationException":
|
|
441
|
-
case "smithy.framework#ValidationException":
|
|
442
|
-
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
443
|
-
case "VoiceBotNonUniqueNameException":
|
|
444
|
-
case "wildix.wim.voicebots#VoiceBotNonUniqueNameException":
|
|
445
|
-
throw await de_VoiceBotNonUniqueNameExceptionRes(parsedOutput, context);
|
|
446
|
-
case "VoiceBotNotFoundException":
|
|
447
|
-
case "wildix.wim.voicebots#VoiceBotNotFoundException":
|
|
448
|
-
throw await de_VoiceBotNotFoundExceptionRes(parsedOutput, context);
|
|
449
|
-
case "VoiceSessionNotFoundException":
|
|
450
|
-
case "wildix.wim.voicebots#VoiceSessionNotFoundException":
|
|
451
|
-
throw await de_VoiceSessionNotFoundExceptionRes(parsedOutput, context);
|
|
452
|
-
default:
|
|
453
|
-
const parsedBody = parsedOutput.body;
|
|
454
|
-
return throwDefaultError({
|
|
455
|
-
output,
|
|
456
|
-
parsedBody,
|
|
457
|
-
errorCode
|
|
458
|
-
});
|
|
459
|
-
}
|
|
460
|
-
};
|
|
461
|
-
const throwDefaultError = withBaseException(__BaseException);
|
|
462
|
-
const de_ForbiddenExceptionRes = async (parsedOutput, context) => {
|
|
463
|
-
const contents = map({});
|
|
464
|
-
const data = parsedOutput.body;
|
|
465
|
-
const doc = take(data, {
|
|
466
|
-
'message': __expectString,
|
|
467
|
-
});
|
|
468
|
-
Object.assign(contents, doc);
|
|
469
|
-
const exception = new ForbiddenException({
|
|
470
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
471
|
-
...contents
|
|
472
|
-
});
|
|
473
|
-
return __decorateServiceException(exception, parsedOutput.body);
|
|
474
|
-
};
|
|
475
|
-
const de_ValidationExceptionRes = async (parsedOutput, context) => {
|
|
476
|
-
const contents = map({});
|
|
477
|
-
const data = parsedOutput.body;
|
|
478
|
-
const doc = take(data, {
|
|
479
|
-
'message': __expectString,
|
|
480
|
-
});
|
|
481
|
-
Object.assign(contents, doc);
|
|
482
|
-
const exception = new ValidationException({
|
|
483
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
484
|
-
...contents
|
|
485
|
-
});
|
|
486
|
-
return __decorateServiceException(exception, parsedOutput.body);
|
|
487
|
-
};
|
|
488
|
-
const de_VoiceBotNonUniqueNameExceptionRes = async (parsedOutput, context) => {
|
|
489
|
-
const contents = map({});
|
|
490
|
-
const data = parsedOutput.body;
|
|
491
|
-
const doc = take(data, {
|
|
492
|
-
'message': __expectString,
|
|
493
|
-
'type': __expectString,
|
|
494
|
-
});
|
|
495
|
-
Object.assign(contents, doc);
|
|
496
|
-
const exception = new VoiceBotNonUniqueNameException({
|
|
497
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
498
|
-
...contents
|
|
499
|
-
});
|
|
500
|
-
return __decorateServiceException(exception, parsedOutput.body);
|
|
501
|
-
};
|
|
502
|
-
const de_VoiceBotNotFoundExceptionRes = async (parsedOutput, context) => {
|
|
503
|
-
const contents = map({});
|
|
504
|
-
const data = parsedOutput.body;
|
|
505
|
-
const doc = take(data, {
|
|
506
|
-
'message': __expectString,
|
|
507
|
-
'type': __expectString,
|
|
508
|
-
});
|
|
509
|
-
Object.assign(contents, doc);
|
|
510
|
-
const exception = new VoiceBotNotFoundException({
|
|
511
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
512
|
-
...contents
|
|
513
|
-
});
|
|
514
|
-
return __decorateServiceException(exception, parsedOutput.body);
|
|
515
|
-
};
|
|
516
|
-
const de_VoiceSessionNotFoundExceptionRes = async (parsedOutput, context) => {
|
|
517
|
-
const contents = map({});
|
|
518
|
-
const data = parsedOutput.body;
|
|
519
|
-
const doc = take(data, {
|
|
520
|
-
'message': __expectString,
|
|
521
|
-
'type': __expectString,
|
|
522
|
-
});
|
|
523
|
-
Object.assign(contents, doc);
|
|
524
|
-
const exception = new VoiceSessionNotFoundException({
|
|
525
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
526
|
-
...contents
|
|
527
|
-
});
|
|
528
|
-
return __decorateServiceException(exception, parsedOutput.body);
|
|
529
|
-
};
|
|
530
|
-
const se_Document = (input, context) => {
|
|
531
|
-
return input;
|
|
532
|
-
};
|
|
533
|
-
const se_VoiceBotEmbeddedTool = (input, context) => {
|
|
534
|
-
return take(input, {
|
|
535
|
-
'annotations': _json,
|
|
536
|
-
'name': [],
|
|
537
|
-
'parameters': _ => se_Document(_, context),
|
|
538
|
-
'type': [],
|
|
539
|
-
});
|
|
540
|
-
};
|
|
541
|
-
const se_VoiceBotEmbeddedToolsList = (input, context) => {
|
|
542
|
-
return input.filter((e) => e != null).map(entry => {
|
|
543
|
-
return se_VoiceBotEmbeddedTool(entry, context);
|
|
544
|
-
});
|
|
545
|
-
};
|
|
546
|
-
const se_VoiceBotEndpoint = (input, context) => {
|
|
547
|
-
return VoiceBotEndpoint.visit(input, {
|
|
548
|
-
dialogflowCx: value => ({ "dialogflowCx": se_BotDialogflowCxEndpoint(value, context) }),
|
|
549
|
-
llm: value => ({ "llm": se_VoiceBotLlmEndpoint(value, context) }),
|
|
550
|
-
openAiAssistant: value => ({ "openAiAssistant": _json(value) }),
|
|
551
|
-
sqs: value => ({ "sqs": _json(value) }),
|
|
552
|
-
webhook: value => ({ "webhook": _json(value) }),
|
|
553
|
-
_: (name, value) => ({ [name]: value })
|
|
554
|
-
});
|
|
555
|
-
};
|
|
556
|
-
const se_VoiceBotFunctionDefinition = (input, context) => {
|
|
557
|
-
return take(input, {
|
|
558
|
-
'description': [],
|
|
559
|
-
'integration': _ => se_VoiceBotFunctionIntegration(_, context),
|
|
560
|
-
'name': [],
|
|
561
|
-
'parameters': _ => se_Document(_, context),
|
|
562
|
-
});
|
|
563
|
-
};
|
|
564
|
-
const se_VoiceBotFunctionIntegration = (input, context) => {
|
|
565
|
-
return VoiceBotFunctionIntegration.visit(input, {
|
|
566
|
-
webhook: value => ({ "webhook": se_VoiceBotFunctionIntegrationWebhook(value, context) }),
|
|
567
|
-
_: (name, value) => ({ [name]: value })
|
|
568
|
-
});
|
|
569
|
-
};
|
|
570
|
-
const se_VoiceBotFunctionIntegrationWebhook = (input, context) => {
|
|
571
|
-
return take(input, {
|
|
572
|
-
'async': [],
|
|
573
|
-
'authorization': _json,
|
|
574
|
-
'headers': _json,
|
|
575
|
-
'method': [],
|
|
576
|
-
'parameters': _ => se_Document(_, context),
|
|
577
|
-
'startMessage': [],
|
|
578
|
-
'timeout': [],
|
|
579
|
-
'url': [],
|
|
580
|
-
});
|
|
581
|
-
};
|
|
582
|
-
const se_VoiceBotLlmEndpoint = (input, context) => {
|
|
583
|
-
return take(input, {
|
|
584
|
-
'capabilities': _json,
|
|
585
|
-
'embeddedTools': _ => se_VoiceBotEmbeddedToolsList(_, context),
|
|
586
|
-
'guidelines': _json,
|
|
587
|
-
'metadata': _json,
|
|
588
|
-
'model': [],
|
|
589
|
-
'prompt': [],
|
|
590
|
-
'tools': _ => se_VoiceBotToolsList(_, context),
|
|
591
|
-
'variables': _json,
|
|
592
|
-
});
|
|
593
|
-
};
|
|
594
|
-
const se_VoiceBotTool = (input, context) => {
|
|
595
|
-
return take(input, {
|
|
596
|
-
'annotations': _json,
|
|
597
|
-
'function': _ => se_VoiceBotFunctionDefinition(_, context),
|
|
598
|
-
'type': [],
|
|
599
|
-
});
|
|
600
|
-
};
|
|
601
|
-
const se_VoiceBotToolsList = (input, context) => {
|
|
602
|
-
return input.filter((e) => e != null).map(entry => {
|
|
603
|
-
return se_VoiceBotTool(entry, context);
|
|
604
|
-
});
|
|
605
|
-
};
|
|
606
|
-
const se_BotDialogflowCxEndpoint = (input, context) => {
|
|
607
|
-
return take(input, {
|
|
608
|
-
'agent': [],
|
|
609
|
-
'credentials': _ => se_Document(_, context),
|
|
610
|
-
'language': [],
|
|
611
|
-
'location': [],
|
|
612
|
-
});
|
|
613
|
-
};
|
|
614
|
-
const de_Document = (output, context) => {
|
|
615
|
-
return output;
|
|
616
|
-
};
|
|
617
|
-
const de_Annotation = (output, context) => {
|
|
618
|
-
return take(output, {
|
|
619
|
-
'id': __expectString,
|
|
620
|
-
'payload': (_) => de_AnnotationPayload(__expectUnion(_), context),
|
|
621
|
-
'source': _json,
|
|
622
|
-
'time': __expectLong,
|
|
623
|
-
});
|
|
624
|
-
};
|
|
625
|
-
const de_AnnotationPayload = (output, context) => {
|
|
626
|
-
if (output.result != null) {
|
|
627
|
-
return {
|
|
628
|
-
result: de_AnnotationResultValue(output.result, context)
|
|
629
|
-
};
|
|
630
|
-
}
|
|
631
|
-
if (__expectString(output.tag) !== undefined) {
|
|
632
|
-
return { tag: __expectString(output.tag) };
|
|
633
|
-
}
|
|
634
|
-
if (__expectString(output.text) !== undefined) {
|
|
635
|
-
return { text: __expectString(output.text) };
|
|
636
|
-
}
|
|
637
|
-
if (output.variables != null) {
|
|
638
|
-
return {
|
|
639
|
-
variables: de_AnnotationVariablesValue(output.variables, context)
|
|
640
|
-
};
|
|
641
|
-
}
|
|
642
|
-
return { $unknown: Object.entries(output)[0] };
|
|
643
|
-
};
|
|
644
|
-
const de_AnnotationResultValue = (output, context) => {
|
|
645
|
-
return take(output, {
|
|
646
|
-
'value': (_) => de_Document(_, context),
|
|
647
|
-
});
|
|
648
|
-
};
|
|
649
|
-
const de_AnnotationVariablesValue = (output, context) => {
|
|
650
|
-
return take(output, {
|
|
651
|
-
'value': (_) => de_Document(_, context),
|
|
652
|
-
});
|
|
653
|
-
};
|
|
654
|
-
const de_PubSubBroadcastItem = (output, context) => {
|
|
655
|
-
return take(output, {
|
|
656
|
-
'activity': (_) => de_TraceActivity(_, context),
|
|
657
|
-
'segment': (_) => de_TraceSegment(_, context),
|
|
658
|
-
'session': (_) => de_TraceSession(_, context),
|
|
659
|
-
'sessionId': __expectString,
|
|
660
|
-
});
|
|
661
|
-
};
|
|
662
|
-
const de_PubSubBroadcastItems = (output, context) => {
|
|
663
|
-
const retVal = (output || []).filter((e) => e != null).map((entry) => {
|
|
664
|
-
return de_PubSubBroadcastItem(entry, context);
|
|
665
|
-
});
|
|
666
|
-
return retVal;
|
|
667
|
-
};
|
|
668
|
-
const de_PubSubBroadcastWebsocketEvent = (output, context) => {
|
|
669
|
-
return take(output, {
|
|
670
|
-
'event': __expectString,
|
|
671
|
-
'items': (_) => de_PubSubBroadcastItems(_, context),
|
|
672
|
-
'topic': __expectString,
|
|
673
|
-
});
|
|
674
|
-
};
|
|
675
|
-
const de_Trace = (output, context) => {
|
|
676
|
-
return take(output, {
|
|
677
|
-
'activities': (_) => de_TraceActivitiesList(_, context),
|
|
678
|
-
'cost': __limitedParseFloat32,
|
|
679
|
-
'segments': (_) => de_TraceSegmentsList(_, context),
|
|
680
|
-
'session': (_) => de_TraceSession(_, context),
|
|
681
|
-
'usage': _json,
|
|
682
|
-
});
|
|
683
|
-
};
|
|
684
|
-
const de_TraceActivitiesList = (output, context) => {
|
|
685
|
-
const retVal = (output || []).filter((e) => e != null).map((entry) => {
|
|
686
|
-
return de_TraceActivity(entry, context);
|
|
687
|
-
});
|
|
688
|
-
return retVal;
|
|
689
|
-
};
|
|
690
|
-
const de_TraceActivity = (output, context) => {
|
|
691
|
-
return take(output, {
|
|
692
|
-
'duration': __expectInt32,
|
|
693
|
-
'id': __expectString,
|
|
694
|
-
'result': (_) => _json(__expectUnion(_)),
|
|
695
|
-
'start': __limitedParseDouble,
|
|
696
|
-
'status': __expectString,
|
|
697
|
-
'timings': (_) => de_TraceTimings(_, context),
|
|
698
|
-
'trigger': (_) => de_TraceActivityTrigger(__expectUnion(_), context),
|
|
699
|
-
'usage': _json,
|
|
700
|
-
'version': __expectInt32,
|
|
701
|
-
});
|
|
702
|
-
};
|
|
703
|
-
const de_TraceActivityTrigger = (output, context) => {
|
|
704
|
-
if (output.annotationCommand != null) {
|
|
705
|
-
return {
|
|
706
|
-
annotationCommand: de_TraceAnnotationCommand(output.annotationCommand, context)
|
|
707
|
-
};
|
|
708
|
-
}
|
|
709
|
-
if (output.completeEvent != null) {
|
|
710
|
-
return {
|
|
711
|
-
completeEvent: _json(output.completeEvent)
|
|
712
|
-
};
|
|
713
|
-
}
|
|
714
|
-
if (output.connectEvent != null) {
|
|
715
|
-
return {
|
|
716
|
-
connectEvent: de_TraceConnectEventTrigger(output.connectEvent, context)
|
|
717
|
-
};
|
|
718
|
-
}
|
|
719
|
-
if (output.disconnectEvent != null) {
|
|
720
|
-
return {
|
|
721
|
-
disconnectEvent: de_TraceDisconnectEventTrigger(output.disconnectEvent, context)
|
|
722
|
-
};
|
|
723
|
-
}
|
|
724
|
-
if (output.durationTimeoutTask != null) {
|
|
725
|
-
return {
|
|
726
|
-
durationTimeoutTask: de_TraceDurationTimeoutTaskTrigger(output.durationTimeoutTask, context)
|
|
727
|
-
};
|
|
728
|
-
}
|
|
729
|
-
if (output.hangupCommand != null) {
|
|
730
|
-
return {
|
|
731
|
-
hangupCommand: _json(output.hangupCommand)
|
|
732
|
-
};
|
|
733
|
-
}
|
|
734
|
-
if (output.interruptionEvent != null) {
|
|
735
|
-
return {
|
|
736
|
-
interruptionEvent: _json(output.interruptionEvent)
|
|
737
|
-
};
|
|
738
|
-
}
|
|
739
|
-
if (output.playbackEvent != null) {
|
|
740
|
-
return {
|
|
741
|
-
playbackEvent: _json(output.playbackEvent)
|
|
742
|
-
};
|
|
743
|
-
}
|
|
744
|
-
if (output.replyEvent != null) {
|
|
745
|
-
return {
|
|
746
|
-
replyEvent: _json(output.replyEvent)
|
|
747
|
-
};
|
|
748
|
-
}
|
|
749
|
-
if (output.sayCommand != null) {
|
|
750
|
-
return {
|
|
751
|
-
sayCommand: _json(output.sayCommand)
|
|
752
|
-
};
|
|
753
|
-
}
|
|
754
|
-
if (output.silenceTimeoutTask != null) {
|
|
755
|
-
return {
|
|
756
|
-
silenceTimeoutTask: de_TraceSilenceTimeoutTaskTrigger(output.silenceTimeoutTask, context)
|
|
757
|
-
};
|
|
758
|
-
}
|
|
759
|
-
if (output.transcriptionEvent != null) {
|
|
760
|
-
return {
|
|
761
|
-
transcriptionEvent: de_TranscriptionWebsocketEvent(output.transcriptionEvent, context)
|
|
762
|
-
};
|
|
763
|
-
}
|
|
764
|
-
if (output.transferCommand != null) {
|
|
765
|
-
return {
|
|
766
|
-
transferCommand: _json(output.transferCommand)
|
|
767
|
-
};
|
|
768
|
-
}
|
|
769
|
-
return { $unknown: Object.entries(output)[0] };
|
|
770
|
-
};
|
|
771
|
-
const de_TraceAnnotationCommand = (output, context) => {
|
|
772
|
-
return take(output, {
|
|
773
|
-
'annotation': (_) => de_Annotation(_, context),
|
|
774
|
-
});
|
|
775
|
-
};
|
|
776
|
-
const de_TraceConnectEventTrigger = (output, context) => {
|
|
777
|
-
return take(output, {
|
|
778
|
-
'parameters': (_) => de_Document(_, context),
|
|
779
|
-
});
|
|
780
|
-
};
|
|
781
|
-
const de_TraceDisconnectEventTrigger = (output, context) => {
|
|
782
|
-
return take(output, {
|
|
783
|
-
'parameters': (_) => de_Document(_, context),
|
|
784
|
-
});
|
|
785
|
-
};
|
|
786
|
-
const de_TraceDurationTimeoutTaskTrigger = (output, context) => {
|
|
787
|
-
return take(output, {
|
|
788
|
-
'parameters': (_) => de_Document(_, context),
|
|
789
|
-
});
|
|
790
|
-
};
|
|
791
|
-
const de_TraceGenericInput = (output, context) => {
|
|
792
|
-
return take(output, {
|
|
793
|
-
'blocks': (_) => de_TraceGenericInputBlocksList(_, context),
|
|
794
|
-
'title': __expectString,
|
|
795
|
-
});
|
|
796
|
-
};
|
|
797
|
-
const de_TraceGenericInputBlock = (output, context) => {
|
|
798
|
-
return take(output, {
|
|
799
|
-
'content': (_) => de_TraceGenericInputBlockContent(__expectUnion(_), context),
|
|
800
|
-
'title': __expectString,
|
|
801
|
-
});
|
|
802
|
-
};
|
|
803
|
-
const de_TraceGenericInputBlockContent = (output, context) => {
|
|
804
|
-
if (output.json != null) {
|
|
805
|
-
return {
|
|
806
|
-
json: de_Document(output.json, context)
|
|
807
|
-
};
|
|
808
|
-
}
|
|
809
|
-
if (__expectString(output.text) !== undefined) {
|
|
810
|
-
return { text: __expectString(output.text) };
|
|
811
|
-
}
|
|
812
|
-
return { $unknown: Object.entries(output)[0] };
|
|
813
|
-
};
|
|
814
|
-
const de_TraceGenericInputBlocksList = (output, context) => {
|
|
815
|
-
const retVal = (output || []).filter((e) => e != null).map((entry) => {
|
|
816
|
-
return de_TraceGenericInputBlock(entry, context);
|
|
817
|
-
});
|
|
818
|
-
return retVal;
|
|
819
|
-
};
|
|
820
|
-
const de_TraceSegment = (output, context) => {
|
|
821
|
-
return take(output, {
|
|
822
|
-
'activityId': __expectString,
|
|
823
|
-
'duration': __expectInt32,
|
|
824
|
-
'id': __expectString,
|
|
825
|
-
'input': (_) => de_TraceSegmentInput(__expectUnion(_), context),
|
|
826
|
-
'result': (_) => de_TraceSegmentResult(__expectUnion(_), context),
|
|
827
|
-
'start': __limitedParseDouble,
|
|
828
|
-
'status': __expectString,
|
|
829
|
-
'version': __expectInt32,
|
|
830
|
-
});
|
|
831
|
-
};
|
|
832
|
-
const de_TraceSegmentInput = (output, context) => {
|
|
833
|
-
if (output.completion != null) {
|
|
834
|
-
return {
|
|
835
|
-
completion: _json(output.completion)
|
|
836
|
-
};
|
|
837
|
-
}
|
|
838
|
-
if (output.generic != null) {
|
|
839
|
-
return {
|
|
840
|
-
generic: de_TraceGenericInput(output.generic, context)
|
|
841
|
-
};
|
|
842
|
-
}
|
|
843
|
-
if (output.oauth != null) {
|
|
844
|
-
return {
|
|
845
|
-
oauth: _json(output.oauth)
|
|
846
|
-
};
|
|
847
|
-
}
|
|
848
|
-
if (output.tool != null) {
|
|
849
|
-
return {
|
|
850
|
-
tool: _json(__expectUnion(output.tool))
|
|
851
|
-
};
|
|
852
|
-
}
|
|
853
|
-
return { $unknown: Object.entries(output)[0] };
|
|
854
|
-
};
|
|
855
|
-
const de_TraceSegmentResult = (output, context) => {
|
|
856
|
-
if (output.error != null) {
|
|
857
|
-
return {
|
|
858
|
-
error: _json(output.error)
|
|
859
|
-
};
|
|
860
|
-
}
|
|
861
|
-
if (output.json != null) {
|
|
862
|
-
return {
|
|
863
|
-
json: de_Document(output.json, context)
|
|
864
|
-
};
|
|
865
|
-
}
|
|
866
|
-
if (__expectString(output.text) !== undefined) {
|
|
867
|
-
return { text: __expectString(output.text) };
|
|
868
|
-
}
|
|
869
|
-
if (output.tools != null) {
|
|
870
|
-
return {
|
|
871
|
-
tools: _json(output.tools)
|
|
872
|
-
};
|
|
873
|
-
}
|
|
874
|
-
return { $unknown: Object.entries(output)[0] };
|
|
875
|
-
};
|
|
876
|
-
const de_TraceSegmentsList = (output, context) => {
|
|
877
|
-
const retVal = (output || []).filter((e) => e != null).map((entry) => {
|
|
878
|
-
return de_TraceSegment(entry, context);
|
|
879
|
-
});
|
|
880
|
-
return retVal;
|
|
881
|
-
};
|
|
882
|
-
const de_TraceSession = (output, context) => {
|
|
883
|
-
return take(output, {
|
|
884
|
-
'botId': __expectString,
|
|
885
|
-
'botName': __expectString,
|
|
886
|
-
'callId': __expectString,
|
|
887
|
-
'callerName': __expectString,
|
|
888
|
-
'callerNumber': __expectString,
|
|
889
|
-
'company': __expectString,
|
|
890
|
-
'connectionId': __expectString,
|
|
891
|
-
'duration': __expectInt32,
|
|
892
|
-
'flowIndex': __expectInt32,
|
|
893
|
-
'language': __expectString,
|
|
894
|
-
'sessionId': __expectString,
|
|
895
|
-
'start': __limitedParseDouble,
|
|
896
|
-
'status': __expectString,
|
|
897
|
-
});
|
|
898
|
-
};
|
|
899
|
-
const de_TraceSessionsList = (output, context) => {
|
|
900
|
-
const retVal = (output || []).filter((e) => e != null).map((entry) => {
|
|
901
|
-
return de_TraceSession(entry, context);
|
|
902
|
-
});
|
|
903
|
-
return retVal;
|
|
904
|
-
};
|
|
905
|
-
const de_TraceSilenceTimeoutTaskTrigger = (output, context) => {
|
|
906
|
-
return take(output, {
|
|
907
|
-
'parameters': (_) => de_Document(_, context),
|
|
908
|
-
});
|
|
909
|
-
};
|
|
910
|
-
const de_TraceTimings = (output, context) => {
|
|
911
|
-
return Object.entries(output).reduce((acc, [key, value]) => {
|
|
912
|
-
if (value === null) {
|
|
913
|
-
return acc;
|
|
914
|
-
}
|
|
915
|
-
acc[key] = __limitedParseDouble(value);
|
|
916
|
-
return acc;
|
|
917
|
-
}, {});
|
|
918
|
-
};
|
|
919
|
-
const de_TranscriptionEvent = (output, context) => {
|
|
920
|
-
return take(output, {
|
|
921
|
-
'confidence': __limitedParseDouble,
|
|
922
|
-
'final': __expectBoolean,
|
|
923
|
-
'id': __expectString,
|
|
924
|
-
'text': __expectString,
|
|
925
|
-
'time': __expectLong,
|
|
926
|
-
'type': __expectString,
|
|
927
|
-
});
|
|
928
|
-
};
|
|
929
|
-
const de_TranscriptionWebhookEvent = (output, context) => {
|
|
930
|
-
return take(output, {
|
|
931
|
-
'botId': __expectString,
|
|
932
|
-
'callId': __expectString,
|
|
933
|
-
'event': (_) => de_TranscriptionEvent(_, context),
|
|
934
|
-
'flowIndex': __expectInt32,
|
|
935
|
-
'sessionId': __expectString,
|
|
936
|
-
});
|
|
937
|
-
};
|
|
938
|
-
const de_TranscriptionWebsocketEvent = (output, context) => {
|
|
939
|
-
return take(output, {
|
|
940
|
-
'event': (_) => de_TranscriptionEvent(_, context),
|
|
941
|
-
'type': __expectString,
|
|
942
|
-
});
|
|
943
|
-
};
|
|
944
|
-
const de_VoiceBot = (output, context) => {
|
|
945
|
-
return take(output, {
|
|
946
|
-
'capabilities': _json,
|
|
947
|
-
'category': __expectString,
|
|
948
|
-
'createdAt': __expectString,
|
|
949
|
-
'endpoint': (_) => de_VoiceBotEndpoint(__expectUnion(_), context),
|
|
950
|
-
'groupId': __expectString,
|
|
951
|
-
'id': __expectString,
|
|
952
|
-
'message': __expectString,
|
|
953
|
-
'name': __expectString,
|
|
954
|
-
'pipeline': _json,
|
|
955
|
-
'updatedAt': __expectString,
|
|
956
|
-
});
|
|
957
|
-
};
|
|
958
|
-
const de_VoiceBotEmbeddedTool = (output, context) => {
|
|
959
|
-
return take(output, {
|
|
960
|
-
'annotations': _json,
|
|
961
|
-
'name': __expectString,
|
|
962
|
-
'parameters': (_) => de_Document(_, context),
|
|
963
|
-
'type': __expectString,
|
|
964
|
-
});
|
|
965
|
-
};
|
|
966
|
-
const de_VoiceBotEmbeddedToolsList = (output, context) => {
|
|
967
|
-
const retVal = (output || []).filter((e) => e != null).map((entry) => {
|
|
968
|
-
return de_VoiceBotEmbeddedTool(entry, context);
|
|
969
|
-
});
|
|
970
|
-
return retVal;
|
|
971
|
-
};
|
|
972
|
-
const de_VoiceBotEndpoint = (output, context) => {
|
|
973
|
-
if (output.dialogflowCx != null) {
|
|
974
|
-
return {
|
|
975
|
-
dialogflowCx: de_BotDialogflowCxEndpoint(output.dialogflowCx, context)
|
|
976
|
-
};
|
|
977
|
-
}
|
|
978
|
-
if (output.llm != null) {
|
|
979
|
-
return {
|
|
980
|
-
llm: de_VoiceBotLlmEndpoint(output.llm, context)
|
|
981
|
-
};
|
|
982
|
-
}
|
|
983
|
-
if (output.openAiAssistant != null) {
|
|
984
|
-
return {
|
|
985
|
-
openAiAssistant: _json(output.openAiAssistant)
|
|
986
|
-
};
|
|
987
|
-
}
|
|
988
|
-
if (output.sqs != null) {
|
|
989
|
-
return {
|
|
990
|
-
sqs: _json(output.sqs)
|
|
991
|
-
};
|
|
992
|
-
}
|
|
993
|
-
if (output.webhook != null) {
|
|
994
|
-
return {
|
|
995
|
-
webhook: _json(output.webhook)
|
|
996
|
-
};
|
|
997
|
-
}
|
|
998
|
-
return { $unknown: Object.entries(output)[0] };
|
|
999
|
-
};
|
|
1000
|
-
const de_VoiceBotFunctionDefinition = (output, context) => {
|
|
1001
|
-
return take(output, {
|
|
1002
|
-
'description': __expectString,
|
|
1003
|
-
'integration': (_) => de_VoiceBotFunctionIntegration(__expectUnion(_), context),
|
|
1004
|
-
'name': __expectString,
|
|
1005
|
-
'parameters': (_) => de_Document(_, context),
|
|
1006
|
-
});
|
|
1007
|
-
};
|
|
1008
|
-
const de_VoiceBotFunctionIntegration = (output, context) => {
|
|
1009
|
-
if (output.webhook != null) {
|
|
1010
|
-
return {
|
|
1011
|
-
webhook: de_VoiceBotFunctionIntegrationWebhook(output.webhook, context)
|
|
1012
|
-
};
|
|
1013
|
-
}
|
|
1014
|
-
return { $unknown: Object.entries(output)[0] };
|
|
1015
|
-
};
|
|
1016
|
-
const de_VoiceBotFunctionIntegrationWebhook = (output, context) => {
|
|
1017
|
-
return take(output, {
|
|
1018
|
-
'async': __expectBoolean,
|
|
1019
|
-
'authorization': (_) => _json(__expectUnion(_)),
|
|
1020
|
-
'headers': _json,
|
|
1021
|
-
'method': __expectString,
|
|
1022
|
-
'parameters': (_) => de_Document(_, context),
|
|
1023
|
-
'startMessage': __expectString,
|
|
1024
|
-
'timeout': __expectInt32,
|
|
1025
|
-
'url': __expectString,
|
|
1026
|
-
});
|
|
1027
|
-
};
|
|
1028
|
-
const de_VoiceBotLlmEndpoint = (output, context) => {
|
|
1029
|
-
return take(output, {
|
|
1030
|
-
'capabilities': _json,
|
|
1031
|
-
'embeddedTools': (_) => de_VoiceBotEmbeddedToolsList(_, context),
|
|
1032
|
-
'guidelines': _json,
|
|
1033
|
-
'metadata': _json,
|
|
1034
|
-
'model': __expectString,
|
|
1035
|
-
'prompt': __expectString,
|
|
1036
|
-
'tools': (_) => de_VoiceBotToolsList(_, context),
|
|
1037
|
-
'variables': _json,
|
|
1038
|
-
});
|
|
1039
|
-
};
|
|
1040
|
-
const de_VoiceBotsList = (output, context) => {
|
|
1041
|
-
const retVal = (output || []).filter((e) => e != null).map((entry) => {
|
|
1042
|
-
return de_VoiceBot(entry, context);
|
|
1043
|
-
});
|
|
1044
|
-
return retVal;
|
|
1045
|
-
};
|
|
1046
|
-
const de_VoiceBotTool = (output, context) => {
|
|
1047
|
-
return take(output, {
|
|
1048
|
-
'annotations': _json,
|
|
1049
|
-
'function': (_) => de_VoiceBotFunctionDefinition(_, context),
|
|
1050
|
-
'type': __expectString,
|
|
1051
|
-
});
|
|
1052
|
-
};
|
|
1053
|
-
const de_VoiceBotToolsList = (output, context) => {
|
|
1054
|
-
const retVal = (output || []).filter((e) => e != null).map((entry) => {
|
|
1055
|
-
return de_VoiceBotTool(entry, context);
|
|
1056
|
-
});
|
|
1057
|
-
return retVal;
|
|
1058
|
-
};
|
|
1059
|
-
const de_BotDialogflowCxEndpoint = (output, context) => {
|
|
1060
|
-
return take(output, {
|
|
1061
|
-
'agent': __expectString,
|
|
1062
|
-
'credentials': (_) => de_Document(_, context),
|
|
1063
|
-
'language': __expectString,
|
|
1064
|
-
'location': __expectString,
|
|
1065
|
-
});
|
|
1066
|
-
};
|
|
1067
|
-
const deserializeMetadata = (output) => ({
|
|
1068
|
-
httpStatusCode: output.statusCode,
|
|
1069
|
-
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
|
|
1070
|
-
extendedRequestId: output.headers["x-amz-id-2"],
|
|
1071
|
-
cfId: output.headers["x-amz-cf-id"],
|
|
1072
|
-
});
|
|
1073
|
-
const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then(body => context.utf8Encoder(body));
|
|
1074
|
-
const _c = "company";
|
|
1075
|
-
const _s = "search";
|