@wildix/wim-voicebots-client 1.0.20 → 1.0.21

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.TraceSessionStatus = exports.TraceSegmentStatus = exports.TraceSegmentResult = exports.TraceSegmentInput = exports.TraceGenericInputBlockContent = exports.TraceSegmentCompletionMessageItem = exports.TraceSegmentCompletionMessage = exports.TraceToolCall = exports.TraceActivityTrigger = exports.TraceActivityStatus = exports.TraceActivityResult = exports.VoiceBotCommandType = exports.VoiceBotEndpoint = exports.VoiceBotToolType = exports.VoiceBotFunctionIntegration = exports.VoiceBotFunctionIntegrationMethod = exports.VoiceBotFunctionIntegrationWebhookAuthorization = exports.VoiceBotEmbeddedToolType = exports.VoiceBotEventType = exports.ForbiddenException = exports.ValidationException = void 0;
3
+ exports.VoiceSessionNotFoundException = exports.VoiceBotNotFoundException = exports.TraceSessionStatus = exports.TraceSegmentStatus = exports.TraceSegmentResult = exports.TraceSegmentInput = exports.TraceGenericInputBlockContent = exports.TraceSegmentCompletionMessageItem = exports.TraceSegmentCompletionMessage = exports.TraceToolCall = exports.TraceActivityTrigger = exports.TraceActivityStatus = exports.TraceActivityResult = exports.VoiceBotCommandType = exports.VoiceBotNonUniqueNameException = exports.VoiceBotPipelineTerminateAction = exports.VoiceBotEndpoint = exports.VoiceBotToolType = exports.VoiceBotFunctionIntegration = exports.VoiceBotFunctionIntegrationMethod = exports.VoiceBotFunctionIntegrationWebhookAuthorization = exports.VoiceBotEmbeddedToolType = 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) {
@@ -89,6 +89,30 @@ var VoiceBotEndpoint;
89
89
  return visitor._(value.$unknown[0], value.$unknown[1]);
90
90
  };
91
91
  })(VoiceBotEndpoint = exports.VoiceBotEndpoint || (exports.VoiceBotEndpoint = {}));
92
+ var VoiceBotPipelineTerminateAction;
93
+ (function (VoiceBotPipelineTerminateAction) {
94
+ VoiceBotPipelineTerminateAction.visit = (value, visitor) => {
95
+ if (value.hangup !== undefined)
96
+ return visitor.hangup(value.hangup);
97
+ if (value.transfer !== undefined)
98
+ return visitor.transfer(value.transfer);
99
+ return visitor._(value.$unknown[0], value.$unknown[1]);
100
+ };
101
+ })(VoiceBotPipelineTerminateAction = exports.VoiceBotPipelineTerminateAction || (exports.VoiceBotPipelineTerminateAction = {}));
102
+ class VoiceBotNonUniqueNameException extends VoiceBotsServiceException_1.VoiceBotsServiceException {
103
+ constructor(opts) {
104
+ super({
105
+ name: "VoiceBotNonUniqueNameException",
106
+ $fault: "client",
107
+ ...opts
108
+ });
109
+ this.name = "VoiceBotNonUniqueNameException";
110
+ this.$fault = "client";
111
+ Object.setPrototypeOf(this, VoiceBotNonUniqueNameException.prototype);
112
+ this.type = opts.type;
113
+ }
114
+ }
115
+ exports.VoiceBotNonUniqueNameException = VoiceBotNonUniqueNameException;
92
116
  exports.VoiceBotCommandType = {
93
117
  HANGUP: "hangup",
94
118
  SAY: "say",
@@ -409,6 +409,9 @@ const de_CommandError = async (output, context) => {
409
409
  case "ValidationException":
410
410
  case "smithy.framework#ValidationException":
411
411
  throw await de_ValidationExceptionRes(parsedOutput, context);
412
+ case "VoiceBotNonUniqueNameException":
413
+ case "wildix.wim.voicebots#VoiceBotNonUniqueNameException":
414
+ throw await de_VoiceBotNonUniqueNameExceptionRes(parsedOutput, context);
412
415
  case "VoiceBotNotFoundException":
413
416
  case "wildix.wim.voicebots#VoiceBotNotFoundException":
414
417
  throw await de_VoiceBotNotFoundExceptionRes(parsedOutput, context);
@@ -451,6 +454,20 @@ const de_ValidationExceptionRes = async (parsedOutput, context) => {
451
454
  });
452
455
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
453
456
  };
457
+ const de_VoiceBotNonUniqueNameExceptionRes = async (parsedOutput, context) => {
458
+ const contents = (0, smithy_client_1.map)({});
459
+ const data = parsedOutput.body;
460
+ const doc = (0, smithy_client_1.take)(data, {
461
+ 'message': smithy_client_1.expectString,
462
+ 'type': smithy_client_1.expectString,
463
+ });
464
+ Object.assign(contents, doc);
465
+ const exception = new models_0_1.VoiceBotNonUniqueNameException({
466
+ $metadata: deserializeMetadata(parsedOutput),
467
+ ...contents
468
+ });
469
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
470
+ };
454
471
  const de_VoiceBotNotFoundExceptionRes = async (parsedOutput, context) => {
455
472
  const contents = (0, smithy_client_1.map)({});
456
473
  const data = parsedOutput.body;
@@ -84,6 +84,29 @@ export var VoiceBotEndpoint;
84
84
  return visitor._(value.$unknown[0], value.$unknown[1]);
85
85
  };
86
86
  })(VoiceBotEndpoint || (VoiceBotEndpoint = {}));
87
+ export var VoiceBotPipelineTerminateAction;
88
+ (function (VoiceBotPipelineTerminateAction) {
89
+ VoiceBotPipelineTerminateAction.visit = (value, visitor) => {
90
+ if (value.hangup !== undefined)
91
+ return visitor.hangup(value.hangup);
92
+ if (value.transfer !== undefined)
93
+ return visitor.transfer(value.transfer);
94
+ return visitor._(value.$unknown[0], value.$unknown[1]);
95
+ };
96
+ })(VoiceBotPipelineTerminateAction || (VoiceBotPipelineTerminateAction = {}));
97
+ export class VoiceBotNonUniqueNameException extends __BaseException {
98
+ constructor(opts) {
99
+ super({
100
+ name: "VoiceBotNonUniqueNameException",
101
+ $fault: "client",
102
+ ...opts
103
+ });
104
+ this.name = "VoiceBotNonUniqueNameException";
105
+ this.$fault = "client";
106
+ Object.setPrototypeOf(this, VoiceBotNonUniqueNameException.prototype);
107
+ this.type = opts.type;
108
+ }
109
+ }
87
110
  export const VoiceBotCommandType = {
88
111
  HANGUP: "hangup",
89
112
  SAY: "say",
@@ -1,5 +1,5 @@
1
1
  import { VoiceBotsServiceException as __BaseException } from "../models/VoiceBotsServiceException";
2
- import { ForbiddenException, ValidationException, VoiceBotEndpoint, VoiceBotFunctionIntegration, VoiceBotNotFoundException, VoiceSessionNotFoundException, } from "../models/models_0";
2
+ import { ForbiddenException, ValidationException, VoiceBotEndpoint, VoiceBotFunctionIntegration, VoiceBotNonUniqueNameException, VoiceBotNotFoundException, VoiceSessionNotFoundException, } from "../models/models_0";
3
3
  import { requestBuilder as rb } from "@smithy/core";
4
4
  import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, expectUnion as __expectUnion, limitedParseDouble as __limitedParseDouble, limitedParseFloat32 as __limitedParseFloat32, _json, collectBody, map, take, withBaseException, } from "@smithy/smithy-client";
5
5
  export const se_CreateVoiceBotCommand = async (input, context) => {
@@ -382,6 +382,9 @@ const de_CommandError = async (output, context) => {
382
382
  case "ValidationException":
383
383
  case "smithy.framework#ValidationException":
384
384
  throw await de_ValidationExceptionRes(parsedOutput, context);
385
+ case "VoiceBotNonUniqueNameException":
386
+ case "wildix.wim.voicebots#VoiceBotNonUniqueNameException":
387
+ throw await de_VoiceBotNonUniqueNameExceptionRes(parsedOutput, context);
385
388
  case "VoiceBotNotFoundException":
386
389
  case "wildix.wim.voicebots#VoiceBotNotFoundException":
387
390
  throw await de_VoiceBotNotFoundExceptionRes(parsedOutput, context);
@@ -424,6 +427,20 @@ const de_ValidationExceptionRes = async (parsedOutput, context) => {
424
427
  });
425
428
  return __decorateServiceException(exception, parsedOutput.body);
426
429
  };
430
+ const de_VoiceBotNonUniqueNameExceptionRes = async (parsedOutput, context) => {
431
+ const contents = map({});
432
+ const data = parsedOutput.body;
433
+ const doc = take(data, {
434
+ 'message': __expectString,
435
+ 'type': __expectString,
436
+ });
437
+ Object.assign(contents, doc);
438
+ const exception = new VoiceBotNonUniqueNameException({
439
+ $metadata: deserializeMetadata(parsedOutput),
440
+ ...contents
441
+ });
442
+ return __decorateServiceException(exception, parsedOutput.body);
443
+ };
427
444
  const de_VoiceBotNotFoundExceptionRes = async (parsedOutput, context) => {
428
445
  const contents = map({});
429
446
  const data = parsedOutput.body;
@@ -41,7 +41,21 @@ declare const CreateVoiceBotCommand_base: {
41
41
  * pipeline: { // VoiceBotPipelineSettings
42
42
  * interuptionsEnabled: true || false,
43
43
  * maximumDuration: Number("int"),
44
+ * maximumDurationAction: { // VoiceBotPipelineTerminateAction Union: only one key present
45
+ * hangup: {},
46
+ * transfer: { // VoiceBotTerminateTransferAction
47
+ * context: "STRING_VALUE", // required
48
+ * extension: "STRING_VALUE", // required
49
+ * },
50
+ * },
44
51
  * silenceTimeout: Number("int"),
52
+ * silenceTimeoutAction: {// Union: only one key present
53
+ * hangup: {},
54
+ * transfer: {
55
+ * context: "STRING_VALUE", // required
56
+ * extension: "STRING_VALUE", // required
57
+ * },
58
+ * },
45
59
  * endCallEnabled: true || false,
46
60
  * endCallPhases: "STRING_VALUE",
47
61
  * },
@@ -126,7 +140,21 @@ declare const CreateVoiceBotCommand_base: {
126
140
  * // pipeline: { // VoiceBotPipelineSettings
127
141
  * // interuptionsEnabled: true || false,
128
142
  * // maximumDuration: Number("int"),
143
+ * // maximumDurationAction: { // VoiceBotPipelineTerminateAction Union: only one key present
144
+ * // hangup: {},
145
+ * // transfer: { // VoiceBotTerminateTransferAction
146
+ * // context: "STRING_VALUE", // required
147
+ * // extension: "STRING_VALUE", // required
148
+ * // },
149
+ * // },
129
150
  * // silenceTimeout: Number("int"),
151
+ * // silenceTimeoutAction: {// Union: only one key present
152
+ * // hangup: {},
153
+ * // transfer: {
154
+ * // context: "STRING_VALUE", // required
155
+ * // extension: "STRING_VALUE", // required
156
+ * // },
157
+ * // },
130
158
  * // endCallEnabled: true || false,
131
159
  * // endCallPhases: "STRING_VALUE",
132
160
  * // },
@@ -214,6 +242,8 @@ declare const CreateVoiceBotCommand_base: {
214
242
  * @see {@link CreateVoiceBotCommandOutput} for command's `response` shape.
215
243
  * @see {@link VoiceBotsClientResolvedConfig | config} for VoiceBotsClient's `config` shape.
216
244
  *
245
+ * @throws {@link VoiceBotNonUniqueNameException} (client fault)
246
+ *
217
247
  * @throws {@link ValidationException} (client fault)
218
248
  *
219
249
  * @throws {@link ForbiddenException} (client fault)
@@ -48,7 +48,21 @@ declare const GetVoiceBotCommand_base: {
48
48
  * // pipeline: { // VoiceBotPipelineSettings
49
49
  * // interuptionsEnabled: true || false,
50
50
  * // maximumDuration: Number("int"),
51
+ * // maximumDurationAction: { // VoiceBotPipelineTerminateAction Union: only one key present
52
+ * // hangup: {},
53
+ * // transfer: { // VoiceBotTerminateTransferAction
54
+ * // context: "STRING_VALUE", // required
55
+ * // extension: "STRING_VALUE", // required
56
+ * // },
57
+ * // },
51
58
  * // silenceTimeout: Number("int"),
59
+ * // silenceTimeoutAction: {// Union: only one key present
60
+ * // hangup: {},
61
+ * // transfer: {
62
+ * // context: "STRING_VALUE", // required
63
+ * // extension: "STRING_VALUE", // required
64
+ * // },
65
+ * // },
52
66
  * // endCallEnabled: true || false,
53
67
  * // endCallPhases: "STRING_VALUE",
54
68
  * // },
@@ -48,7 +48,21 @@ declare const ListVoiceBotsCommand_base: {
48
48
  * // pipeline: { // VoiceBotPipelineSettings
49
49
  * // interuptionsEnabled: true || false,
50
50
  * // maximumDuration: Number("int"),
51
+ * // maximumDurationAction: { // VoiceBotPipelineTerminateAction Union: only one key present
52
+ * // hangup: {},
53
+ * // transfer: { // VoiceBotTerminateTransferAction
54
+ * // context: "STRING_VALUE", // required
55
+ * // extension: "STRING_VALUE", // required
56
+ * // },
57
+ * // },
51
58
  * // silenceTimeout: Number("int"),
59
+ * // silenceTimeoutAction: {// Union: only one key present
60
+ * // hangup: {},
61
+ * // transfer: {
62
+ * // context: "STRING_VALUE", // required
63
+ * // extension: "STRING_VALUE", // required
64
+ * // },
65
+ * // },
52
66
  * // endCallEnabled: true || false,
53
67
  * // endCallPhases: "STRING_VALUE",
54
68
  * // },
@@ -41,7 +41,21 @@ declare const UpdateVoiceBotCommand_base: {
41
41
  * pipeline: { // VoiceBotPipelineSettings
42
42
  * interuptionsEnabled: true || false,
43
43
  * maximumDuration: Number("int"),
44
+ * maximumDurationAction: { // VoiceBotPipelineTerminateAction Union: only one key present
45
+ * hangup: {},
46
+ * transfer: { // VoiceBotTerminateTransferAction
47
+ * context: "STRING_VALUE", // required
48
+ * extension: "STRING_VALUE", // required
49
+ * },
50
+ * },
44
51
  * silenceTimeout: Number("int"),
52
+ * silenceTimeoutAction: {// Union: only one key present
53
+ * hangup: {},
54
+ * transfer: {
55
+ * context: "STRING_VALUE", // required
56
+ * extension: "STRING_VALUE", // required
57
+ * },
58
+ * },
45
59
  * endCallEnabled: true || false,
46
60
  * endCallPhases: "STRING_VALUE",
47
61
  * },
@@ -127,7 +141,21 @@ declare const UpdateVoiceBotCommand_base: {
127
141
  * // pipeline: { // VoiceBotPipelineSettings
128
142
  * // interuptionsEnabled: true || false,
129
143
  * // maximumDuration: Number("int"),
144
+ * // maximumDurationAction: { // VoiceBotPipelineTerminateAction Union: only one key present
145
+ * // hangup: {},
146
+ * // transfer: { // VoiceBotTerminateTransferAction
147
+ * // context: "STRING_VALUE", // required
148
+ * // extension: "STRING_VALUE", // required
149
+ * // },
150
+ * // },
130
151
  * // silenceTimeout: Number("int"),
152
+ * // silenceTimeoutAction: {// Union: only one key present
153
+ * // hangup: {},
154
+ * // transfer: {
155
+ * // context: "STRING_VALUE", // required
156
+ * // extension: "STRING_VALUE", // required
157
+ * // },
158
+ * // },
131
159
  * // endCallEnabled: true || false,
132
160
  * // endCallPhases: "STRING_VALUE",
133
161
  * // },
@@ -217,6 +245,8 @@ declare const UpdateVoiceBotCommand_base: {
217
245
  *
218
246
  * @throws {@link VoiceBotNotFoundException} (client fault)
219
247
  *
248
+ * @throws {@link VoiceBotNonUniqueNameException} (client fault)
249
+ *
220
250
  * @throws {@link ValidationException} (client fault)
221
251
  *
222
252
  * @throws {@link ForbiddenException} (client fault)
@@ -384,6 +384,51 @@ export declare namespace VoiceBotEndpoint {
384
384
  }
385
385
  const visit: <T>(value: VoiceBotEndpoint, visitor: Visitor<T>) => T;
386
386
  }
387
+ /**
388
+ * @public
389
+ */
390
+ export interface VoiceBotTerminateHangupAction {
391
+ }
392
+ /**
393
+ * @public
394
+ */
395
+ export interface VoiceBotTerminateTransferAction {
396
+ context: string;
397
+ extension: string;
398
+ }
399
+ /**
400
+ * @public
401
+ */
402
+ export type VoiceBotPipelineTerminateAction = VoiceBotPipelineTerminateAction.HangupMember | VoiceBotPipelineTerminateAction.TransferMember | VoiceBotPipelineTerminateAction.$UnknownMember;
403
+ /**
404
+ * @public
405
+ */
406
+ export declare namespace VoiceBotPipelineTerminateAction {
407
+ interface HangupMember {
408
+ hangup: VoiceBotTerminateHangupAction;
409
+ transfer?: never;
410
+ $unknown?: never;
411
+ }
412
+ interface TransferMember {
413
+ hangup?: never;
414
+ transfer: VoiceBotTerminateTransferAction;
415
+ $unknown?: never;
416
+ }
417
+ /**
418
+ * @public
419
+ */
420
+ interface $UnknownMember {
421
+ hangup?: never;
422
+ transfer?: never;
423
+ $unknown: [string, any];
424
+ }
425
+ interface Visitor<T> {
426
+ hangup: (value: VoiceBotTerminateHangupAction) => T;
427
+ transfer: (value: VoiceBotTerminateTransferAction) => T;
428
+ _: (name: string, value: any) => T;
429
+ }
430
+ const visit: <T>(value: VoiceBotPipelineTerminateAction, visitor: Visitor<T>) => T;
431
+ }
387
432
  /**
388
433
  * @public
389
434
  */
@@ -398,11 +443,21 @@ export interface VoiceBotPipelineSettings {
398
443
  * @public
399
444
  */
400
445
  maximumDuration?: number;
446
+ /**
447
+ * An action that should be performed when max duration reached.
448
+ * @public
449
+ */
450
+ maximumDurationAction?: VoiceBotPipelineTerminateAction;
401
451
  /**
402
452
  * How long to wait before a call is automatically ended due to inactivity.
403
453
  * @public
404
454
  */
405
455
  silenceTimeout?: number;
456
+ /**
457
+ * An action that should be performed when silence timeout reached.
458
+ * @public
459
+ */
460
+ silenceTimeoutAction?: VoiceBotPipelineTerminateAction;
406
461
  /**
407
462
  * If enabled the bot can hangup the call.
408
463
  * @public
@@ -458,6 +513,18 @@ export interface VoiceBot {
458
513
  export interface CreateVoiceBotOutput {
459
514
  bot: VoiceBot;
460
515
  }
516
+ /**
517
+ * @public
518
+ */
519
+ export declare class VoiceBotNonUniqueNameException extends __BaseException {
520
+ readonly name: "VoiceBotNonUniqueNameException";
521
+ readonly $fault: "client";
522
+ type?: string;
523
+ /**
524
+ * @internal
525
+ */
526
+ constructor(opts: __ExceptionOptionType<VoiceBotNonUniqueNameException, __BaseException>);
527
+ }
461
528
  /**
462
529
  * @public
463
530
  */
@@ -16,6 +16,7 @@ export declare const getRuntimeConfig: (config: VoiceBotsClientConfig) => {
16
16
  env: "stage" | "stable" | "prod";
17
17
  token: import("@wildix/smithy-utils").TokenProvider;
18
18
  apiVersion: string;
19
+ cacheMiddleware?: boolean | undefined;
19
20
  urlParser: import("@smithy/types").UrlParser;
20
21
  base64Decoder: import("@smithy/types").Decoder;
21
22
  base64Encoder: (_input: string | Uint8Array) => string;
@@ -16,6 +16,7 @@ export declare const getRuntimeConfig: (config: VoiceBotsClientConfig) => {
16
16
  env: "stage" | "stable" | "prod";
17
17
  token: import("@wildix/smithy-utils").TokenProvider;
18
18
  apiVersion: string;
19
+ cacheMiddleware?: boolean | undefined;
19
20
  urlParser: import("@smithy/types").UrlParser;
20
21
  base64Decoder: import("@smithy/types").Decoder;
21
22
  base64Encoder: (_input: string | Uint8Array) => string;
@@ -9,6 +9,7 @@ export declare const getRuntimeConfig: (config: VoiceBotsClientConfig) => {
9
9
  token: import("@wildix/smithy-utils").TokenProvider;
10
10
  requestHandler: import("@smithy/types").NodeHttpHandlerOptions | import("@smithy/types").FetchHttpHandlerOptions | Record<string, unknown> | import("@smithy/protocol-http").HttpHandler<any> | import("@smithy/fetch-http-handler").FetchHttpHandler;
11
11
  apiVersion: string;
12
+ cacheMiddleware?: boolean | undefined;
12
13
  urlParser: import("@smithy/types").UrlParser;
13
14
  bodyLengthChecker: import("@smithy/types").BodyLengthCalculator;
14
15
  streamCollector: import("@smithy/types").StreamCollector;
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.20",
4
+ "version": "1.0.21",
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",