@wildix/wim-voicebots-client 1.0.2 → 1.0.3

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.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.VoiceSessionNotFoundException = exports.VoiceBotNotFoundException = exports.BotEndpoint = exports.VoiceBotEventType = exports.ForbiddenException = exports.ValidationException = void 0;
3
+ exports.VoiceSessionNotFoundException = exports.VoiceBotNotFoundException = exports.VoiceBotCommandType = exports.BotEndpoint = exports.VoiceBotEventType = exports.ForbiddenException = exports.ValidationException = void 0;
4
4
  const VoiceBotsServiceException_1 = require("./VoiceBotsServiceException");
5
5
  class ValidationException extends VoiceBotsServiceException_1.VoiceBotsServiceException {
6
6
  constructor(opts) {
@@ -50,6 +50,11 @@ var BotEndpoint;
50
50
  return visitor._(value.$unknown[0], value.$unknown[1]);
51
51
  };
52
52
  })(BotEndpoint = exports.BotEndpoint || (exports.BotEndpoint = {}));
53
+ exports.VoiceBotCommandType = {
54
+ HANGUP: "hangup",
55
+ SAY: "say",
56
+ TRANSFER: "transfer",
57
+ };
53
58
  class VoiceBotNotFoundException extends VoiceBotsServiceException_1.VoiceBotsServiceException {
54
59
  constructor(opts) {
55
60
  super({
@@ -17,11 +17,9 @@ const se_CreateVoiceBotCommand = async (input, context) => {
17
17
  let body;
18
18
  body = JSON.stringify((0, smithy_client_1.take)(input, {
19
19
  'endpoint': _ => se_BotEndpoint(_, context),
20
- 'languageCode': [],
21
20
  'maximumDuration': [],
22
21
  'name': [],
23
22
  'silenceTimeout': [],
24
- 'voiceId': [],
25
23
  }));
26
24
  b.m("POST")
27
25
  .h(headers)
@@ -173,11 +171,9 @@ const se_UpdateVoiceBotCommand = async (input, context) => {
173
171
  let body;
174
172
  body = JSON.stringify((0, smithy_client_1.take)(input, {
175
173
  'endpoint': _ => se_BotEndpoint(_, context),
176
- 'languageCode': [],
177
174
  'maximumDuration': [],
178
175
  'name': [],
179
176
  'silenceTimeout': [],
180
- 'voiceId': [],
181
177
  }));
182
178
  b.m("PUT")
183
179
  .h(headers)
@@ -223,14 +219,17 @@ const de_DescribeEventCommand = async (output, context) => {
223
219
  const doc = (0, smithy_client_1.take)(data, {
224
220
  'CompleteWebhookEvent': smithy_client_1._json,
225
221
  'CompleteWebsocketEvent': smithy_client_1._json,
222
+ 'HangupWebsocketCommand': smithy_client_1._json,
226
223
  'InterruptionWebhookEvent': smithy_client_1._json,
227
224
  'InterruptionWebsocketEvent': smithy_client_1._json,
228
225
  'ReplyWebhookEvent': smithy_client_1._json,
229
226
  'ReplyWebsocketEvent': smithy_client_1._json,
227
+ 'SayWebsocketCommand': smithy_client_1._json,
230
228
  'SessionEndedWebhookEvent': smithy_client_1._json,
231
229
  'SessionStartedWebhookEvent': smithy_client_1._json,
232
230
  'TranscriptionWebhookEvent': smithy_client_1._json,
233
231
  'TranscriptionWebsocketEvent': smithy_client_1._json,
232
+ 'TransferWebsocketCommand': smithy_client_1._json,
234
233
  });
235
234
  Object.assign(contents, doc);
236
235
  return contents;
@@ -440,12 +439,10 @@ const de_VoiceBot = (output, context) => {
440
439
  'createdAt': smithy_client_1.expectString,
441
440
  'endpoint': (_) => de_BotEndpoint((0, smithy_client_1.expectUnion)(_), context),
442
441
  'id': smithy_client_1.expectString,
443
- 'languageCode': smithy_client_1.expectString,
444
442
  'maximumDuration': smithy_client_1.expectInt32,
445
443
  'name': smithy_client_1.expectString,
446
444
  'silenceTimeout': smithy_client_1.expectInt32,
447
445
  'updatedAt': smithy_client_1.expectString,
448
- 'voiceId': smithy_client_1.expectString,
449
446
  });
450
447
  };
451
448
  const de_VoiceBotsList = (output, context) => {
@@ -45,6 +45,11 @@ export var BotEndpoint;
45
45
  return visitor._(value.$unknown[0], value.$unknown[1]);
46
46
  };
47
47
  })(BotEndpoint || (BotEndpoint = {}));
48
+ export const VoiceBotCommandType = {
49
+ HANGUP: "hangup",
50
+ SAY: "say",
51
+ TRANSFER: "transfer",
52
+ };
48
53
  export class VoiceBotNotFoundException extends __BaseException {
49
54
  constructor(opts) {
50
55
  super({
@@ -14,11 +14,9 @@ export const se_CreateVoiceBotCommand = async (input, context) => {
14
14
  let body;
15
15
  body = JSON.stringify(take(input, {
16
16
  'endpoint': _ => se_BotEndpoint(_, context),
17
- 'languageCode': [],
18
17
  'maximumDuration': [],
19
18
  'name': [],
20
19
  'silenceTimeout': [],
21
- 'voiceId': [],
22
20
  }));
23
21
  b.m("POST")
24
22
  .h(headers)
@@ -161,11 +159,9 @@ export const se_UpdateVoiceBotCommand = async (input, context) => {
161
159
  let body;
162
160
  body = JSON.stringify(take(input, {
163
161
  'endpoint': _ => se_BotEndpoint(_, context),
164
- 'languageCode': [],
165
162
  'maximumDuration': [],
166
163
  'name': [],
167
164
  'silenceTimeout': [],
168
- 'voiceId': [],
169
165
  }));
170
166
  b.m("PUT")
171
167
  .h(headers)
@@ -208,14 +204,17 @@ export const de_DescribeEventCommand = async (output, context) => {
208
204
  const doc = take(data, {
209
205
  'CompleteWebhookEvent': _json,
210
206
  'CompleteWebsocketEvent': _json,
207
+ 'HangupWebsocketCommand': _json,
211
208
  'InterruptionWebhookEvent': _json,
212
209
  'InterruptionWebsocketEvent': _json,
213
210
  'ReplyWebhookEvent': _json,
214
211
  'ReplyWebsocketEvent': _json,
212
+ 'SayWebsocketCommand': _json,
215
213
  'SessionEndedWebhookEvent': _json,
216
214
  'SessionStartedWebhookEvent': _json,
217
215
  'TranscriptionWebhookEvent': _json,
218
216
  'TranscriptionWebsocketEvent': _json,
217
+ 'TransferWebsocketCommand': _json,
219
218
  });
220
219
  Object.assign(contents, doc);
221
220
  return contents;
@@ -417,12 +416,10 @@ const de_VoiceBot = (output, context) => {
417
416
  'createdAt': __expectString,
418
417
  'endpoint': (_) => de_BotEndpoint(__expectUnion(_), context),
419
418
  'id': __expectString,
420
- 'languageCode': __expectString,
421
419
  'maximumDuration': __expectInt32,
422
420
  'name': __expectString,
423
421
  'silenceTimeout': __expectInt32,
424
422
  'updatedAt': __expectString,
425
- 'voiceId': __expectString,
426
423
  });
427
424
  };
428
425
  const de_VoiceBotsList = (output, context) => {
@@ -37,8 +37,6 @@ declare const CreateVoiceBotCommand_base: {
37
37
  * const client = new VoiceBotsClient(config);
38
38
  * const input = { // CreateVoiceBotInput
39
39
  * name: "STRING_VALUE", // required
40
- * languageCode: "STRING_VALUE", // required
41
- * voiceId: "STRING_VALUE", // required
42
40
  * maximumDuration: Number("int"),
43
41
  * silenceTimeout: Number("int"),
44
42
  * endpoint: { // BotEndpoint Union: only one key present
@@ -69,8 +67,6 @@ declare const CreateVoiceBotCommand_base: {
69
67
  * // { // CreateVoiceBotOutput
70
68
  * // bot: { // VoiceBot
71
69
  * // name: "STRING_VALUE", // required
72
- * // languageCode: "STRING_VALUE", // required
73
- * // voiceId: "STRING_VALUE", // required
74
70
  * // maximumDuration: Number("int"),
75
71
  * // silenceTimeout: Number("int"),
76
72
  * // endpoint: { // BotEndpoint Union: only one key present
@@ -75,6 +75,30 @@ declare const DescribeEventCommand_base: {
75
75
  * // time: Number("long"), // required
76
76
  * // },
77
77
  * // },
78
+ * // SayWebsocketCommand: { // SayWebsocketCommand
79
+ * // type: "STRING_VALUE", // required
80
+ * // command: { // SayWebsocketCommandData
81
+ * // text: "STRING_VALUE", // required
82
+ * // replyId: "STRING_VALUE", // required
83
+ * // interruptible: true || false,
84
+ * // type: "say" || "hangup" || "transfer", // required
85
+ * // },
86
+ * // },
87
+ * // HangupWebsocketCommand: { // HangupWebsocketCommand
88
+ * // type: "STRING_VALUE", // required
89
+ * // command: { // HangupWebsocketCommandData
90
+ * // reason: "STRING_VALUE",
91
+ * // type: "say" || "hangup" || "transfer", // required
92
+ * // },
93
+ * // },
94
+ * // TransferWebsocketCommand: { // TransferWebsocketCommand
95
+ * // type: "STRING_VALUE", // required
96
+ * // command: { // TransferWebsocketCommandData
97
+ * // context: "STRING_VALUE", // required
98
+ * // extension: "STRING_VALUE", // required
99
+ * // type: "say" || "hangup" || "transfer", // required
100
+ * // },
101
+ * // },
78
102
  * // SessionStartedWebhookEvent: { // SessionStartedWebhookEvent
79
103
  * // sessionId: "STRING_VALUE", // required
80
104
  * // botId: "STRING_VALUE", // required
@@ -82,6 +106,7 @@ declare const DescribeEventCommand_base: {
82
106
  * // flowIndex: Number("int"), // required
83
107
  * // event: { // SessionStartedEvent
84
108
  * // type: "started" || "ended" || "reply" || "transcription" || "interruption" || "complete", // required
109
+ * // language: "STRING_VALUE", // required
85
110
  * // time: Number("long"), // required
86
111
  * // },
87
112
  * // },
@@ -44,8 +44,6 @@ declare const GetVoiceBotCommand_base: {
44
44
  * // { // GetVoiceBotOutput
45
45
  * // bot: { // VoiceBot
46
46
  * // name: "STRING_VALUE", // required
47
- * // languageCode: "STRING_VALUE", // required
48
- * // voiceId: "STRING_VALUE", // required
49
47
  * // maximumDuration: Number("int"),
50
48
  * // silenceTimeout: Number("int"),
51
49
  * // endpoint: { // BotEndpoint Union: only one key present
@@ -44,8 +44,6 @@ declare const ListVoiceBotsCommand_base: {
44
44
  * // bots: [ // VoiceBotsList // required
45
45
  * // { // VoiceBot
46
46
  * // name: "STRING_VALUE", // required
47
- * // languageCode: "STRING_VALUE", // required
48
- * // voiceId: "STRING_VALUE", // required
49
47
  * // maximumDuration: Number("int"),
50
48
  * // silenceTimeout: Number("int"),
51
49
  * // endpoint: { // BotEndpoint Union: only one key present
@@ -37,8 +37,6 @@ declare const UpdateVoiceBotCommand_base: {
37
37
  * const client = new VoiceBotsClient(config);
38
38
  * const input = { // UpdateVoiceBotInput
39
39
  * name: "STRING_VALUE", // required
40
- * languageCode: "STRING_VALUE", // required
41
- * voiceId: "STRING_VALUE", // required
42
40
  * maximumDuration: Number("int"),
43
41
  * silenceTimeout: Number("int"),
44
42
  * endpoint: { // BotEndpoint Union: only one key present
@@ -70,8 +68,6 @@ declare const UpdateVoiceBotCommand_base: {
70
68
  * // { // UpdateVoiceBotOutput
71
69
  * // bot: { // VoiceBot
72
70
  * // name: "STRING_VALUE", // required
73
- * // languageCode: "STRING_VALUE", // required
74
- * // voiceId: "STRING_VALUE", // required
75
71
  * // maximumDuration: Number("int"),
76
72
  * // silenceTimeout: Number("int"),
77
73
  * // endpoint: { // BotEndpoint Union: only one key present
@@ -169,16 +169,6 @@ export declare namespace BotEndpoint {
169
169
  */
170
170
  export interface CreateVoiceBotInput {
171
171
  name: string;
172
- /**
173
- * The language code that represents the language spoken in the voice bot.
174
- * @public
175
- */
176
- languageCode: string;
177
- /**
178
- * Voice ID to use for the speech synthesis.
179
- * @public
180
- */
181
- voiceId: string;
182
172
  /**
183
173
  * The maximum number of seconds a call will last.
184
174
  * @public
@@ -201,16 +191,6 @@ export interface CreateVoiceBotInput {
201
191
  */
202
192
  export interface VoiceBot {
203
193
  name: string;
204
- /**
205
- * The language code that represents the language spoken in the voice bot.
206
- * @public
207
- */
208
- languageCode: string;
209
- /**
210
- * Voice ID to use for the speech synthesis.
211
- * @public
212
- */
213
- voiceId: string;
214
194
  /**
215
195
  * The maximum number of seconds a call will last.
216
196
  * @public
@@ -253,6 +233,33 @@ export interface DeleteVoiceBotOutput {
253
233
  */
254
234
  export interface DescribeEventInput {
255
235
  }
236
+ /**
237
+ * @public
238
+ * @enum
239
+ */
240
+ export declare const VoiceBotCommandType: {
241
+ readonly HANGUP: "hangup";
242
+ readonly SAY: "say";
243
+ readonly TRANSFER: "transfer";
244
+ };
245
+ /**
246
+ * @public
247
+ */
248
+ export type VoiceBotCommandType = typeof VoiceBotCommandType[keyof typeof VoiceBotCommandType];
249
+ /**
250
+ * @public
251
+ */
252
+ export interface HangupWebsocketCommandData {
253
+ reason?: string;
254
+ type: VoiceBotCommandType;
255
+ }
256
+ /**
257
+ * @public
258
+ */
259
+ export interface HangupWebsocketCommand {
260
+ type: string;
261
+ command: HangupWebsocketCommandData;
262
+ }
256
263
  /**
257
264
  * @public
258
265
  */
@@ -307,6 +314,22 @@ export interface ReplyWebsocketEvent {
307
314
  type: string;
308
315
  event: ReplyEvent;
309
316
  }
317
+ /**
318
+ * @public
319
+ */
320
+ export interface SayWebsocketCommandData {
321
+ text: string;
322
+ replyId: string;
323
+ interruptible?: boolean;
324
+ type: VoiceBotCommandType;
325
+ }
326
+ /**
327
+ * @public
328
+ */
329
+ export interface SayWebsocketCommand {
330
+ type: string;
331
+ command: SayWebsocketCommandData;
332
+ }
310
333
  /**
311
334
  * @public
312
335
  */
@@ -330,6 +353,11 @@ export interface SessionEndedWebhookEvent {
330
353
  */
331
354
  export interface SessionStartedEvent {
332
355
  type: VoiceBotEventType;
356
+ /**
357
+ * The language code that represents the language spoken in the session.
358
+ * @public
359
+ */
360
+ language: string;
333
361
  time: number;
334
362
  }
335
363
  /**
@@ -368,6 +396,21 @@ export interface TranscriptionWebsocketEvent {
368
396
  type: string;
369
397
  event: TranscriptionEvent;
370
398
  }
399
+ /**
400
+ * @public
401
+ */
402
+ export interface TransferWebsocketCommandData {
403
+ context: string;
404
+ extension: string;
405
+ type: VoiceBotCommandType;
406
+ }
407
+ /**
408
+ * @public
409
+ */
410
+ export interface TransferWebsocketCommand {
411
+ type: string;
412
+ command: TransferWebsocketCommandData;
413
+ }
371
414
  /**
372
415
  * @public
373
416
  */
@@ -376,6 +419,9 @@ export interface DescribeEventOutput {
376
419
  ReplyWebsocketEvent?: ReplyWebsocketEvent;
377
420
  InterruptionWebsocketEvent?: InterruptionWebsocketEvent;
378
421
  CompleteWebsocketEvent?: CompleteWebsocketEvent;
422
+ SayWebsocketCommand?: SayWebsocketCommand;
423
+ HangupWebsocketCommand?: HangupWebsocketCommand;
424
+ TransferWebsocketCommand?: TransferWebsocketCommand;
379
425
  SessionStartedWebhookEvent?: SessionStartedWebhookEvent;
380
426
  SessionEndedWebhookEvent?: SessionEndedWebhookEvent;
381
427
  TranscriptionWebhookEvent?: TranscriptionWebhookEvent;
@@ -495,16 +541,6 @@ export interface SendTransferOutput {
495
541
  */
496
542
  export interface UpdateVoiceBotInput {
497
543
  name: string;
498
- /**
499
- * The language code that represents the language spoken in the voice bot.
500
- * @public
501
- */
502
- languageCode: string;
503
- /**
504
- * Voice ID to use for the speech synthesis.
505
- * @public
506
- */
507
- voiceId: string;
508
544
  /**
509
545
  * The maximum number of seconds a call will last.
510
546
  * @public
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@wildix/wim-voicebots-client",
3
3
  "description": "@wildix/wim-voicebots-client client",
4
- "version": "1.0.2",
4
+ "version": "1.0.3",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
7
7
  "build:cjs": "tsc -p tsconfig.cjs.json",