@wildix/wim-voicebots-client 1.0.6 → 1.0.8

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.VoiceBotCommandType = exports.VoiceBotEndpoint = exports.VoiceBotToolType = exports.VoiceBotEmbeddedToolType = exports.VoiceBotEventType = exports.ForbiddenException = exports.ValidationException = void 0;
3
+ exports.VoiceSessionNotFoundException = exports.VoiceBotNotFoundException = exports.VoiceBotCommandType = exports.VoiceBotEndpoint = exports.VoiceBotToolType = exports.VoiceBotFunctionIntegration = 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) {
@@ -41,6 +41,14 @@ exports.VoiceBotEmbeddedToolType = {
41
41
  HANGUP: "HANGUP",
42
42
  TRANSFER: "TRANSFER",
43
43
  };
44
+ var VoiceBotFunctionIntegration;
45
+ (function (VoiceBotFunctionIntegration) {
46
+ VoiceBotFunctionIntegration.visit = (value, visitor) => {
47
+ if (value.webhook !== undefined)
48
+ return visitor.webhook(value.webhook);
49
+ return visitor._(value.$unknown[0], value.$unknown[1]);
50
+ };
51
+ })(VoiceBotFunctionIntegration = exports.VoiceBotFunctionIntegration || (exports.VoiceBotFunctionIntegration = {}));
44
52
  exports.VoiceBotToolType = {
45
53
  FUNCTION: "function",
46
54
  };
@@ -441,10 +441,27 @@ const se_VoiceBotEndpoint = (input, context) => {
441
441
  const se_VoiceBotFunctionDefinition = (input, context) => {
442
442
  return (0, smithy_client_1.take)(input, {
443
443
  'description': [],
444
+ 'integration': _ => se_VoiceBotFunctionIntegration(_, context),
444
445
  'name': [],
445
446
  'parameters': _ => se_Document(_, context),
446
447
  });
447
448
  };
449
+ const se_VoiceBotFunctionIntegration = (input, context) => {
450
+ return models_0_1.VoiceBotFunctionIntegration.visit(input, {
451
+ webhook: value => ({ "webhook": se_VoiceBotFunctionIntegrationWebhook(value, context) }),
452
+ _: (name, value) => ({ name: value })
453
+ });
454
+ };
455
+ const se_VoiceBotFunctionIntegrationWebhook = (input, context) => {
456
+ return (0, smithy_client_1.take)(input, {
457
+ 'async': [],
458
+ 'authorization': _ => se_Document(_, context),
459
+ 'headers': smithy_client_1._json,
460
+ 'parameters': _ => se_Document(_, context),
461
+ 'timeout': [],
462
+ 'url': [],
463
+ });
464
+ };
448
465
  const se_VoiceBotLlmEndpoint = (input, context) => {
449
466
  return (0, smithy_client_1.take)(input, {
450
467
  'embeddedTools': _ => se_VoiceBotEmbeddedToolsList(_, context),
@@ -529,10 +546,29 @@ const de_VoiceBotEndpoint = (output, context) => {
529
546
  const de_VoiceBotFunctionDefinition = (output, context) => {
530
547
  return (0, smithy_client_1.take)(output, {
531
548
  'description': smithy_client_1.expectString,
549
+ 'integration': (_) => de_VoiceBotFunctionIntegration((0, smithy_client_1.expectUnion)(_), context),
532
550
  'name': smithy_client_1.expectString,
533
551
  'parameters': (_) => de_Document(_, context),
534
552
  });
535
553
  };
554
+ const de_VoiceBotFunctionIntegration = (output, context) => {
555
+ if (output.webhook != null) {
556
+ return {
557
+ webhook: de_VoiceBotFunctionIntegrationWebhook(output.webhook, context)
558
+ };
559
+ }
560
+ return { $unknown: Object.entries(output)[0] };
561
+ };
562
+ const de_VoiceBotFunctionIntegrationWebhook = (output, context) => {
563
+ return (0, smithy_client_1.take)(output, {
564
+ 'async': smithy_client_1.expectBoolean,
565
+ 'authorization': (_) => de_Document(_, context),
566
+ 'headers': smithy_client_1._json,
567
+ 'parameters': (_) => de_Document(_, context),
568
+ 'timeout': smithy_client_1.expectInt32,
569
+ 'url': smithy_client_1.expectString,
570
+ });
571
+ };
536
572
  const de_VoiceBotLlmEndpoint = (output, context) => {
537
573
  return (0, smithy_client_1.take)(output, {
538
574
  'embeddedTools': (_) => de_VoiceBotEmbeddedToolsList(_, context),
@@ -36,6 +36,14 @@ export const VoiceBotEmbeddedToolType = {
36
36
  HANGUP: "HANGUP",
37
37
  TRANSFER: "TRANSFER",
38
38
  };
39
+ export var VoiceBotFunctionIntegration;
40
+ (function (VoiceBotFunctionIntegration) {
41
+ VoiceBotFunctionIntegration.visit = (value, visitor) => {
42
+ if (value.webhook !== undefined)
43
+ return visitor.webhook(value.webhook);
44
+ return visitor._(value.$unknown[0], value.$unknown[1]);
45
+ };
46
+ })(VoiceBotFunctionIntegration || (VoiceBotFunctionIntegration = {}));
39
47
  export const VoiceBotToolType = {
40
48
  FUNCTION: "function",
41
49
  };
@@ -1,7 +1,7 @@
1
1
  import { VoiceBotsServiceException as __BaseException } from "../models/VoiceBotsServiceException";
2
- import { ForbiddenException, ValidationException, VoiceBotEndpoint, VoiceBotNotFoundException, VoiceSessionNotFoundException, } from "../models/models_0";
2
+ import { ForbiddenException, ValidationException, VoiceBotEndpoint, VoiceBotFunctionIntegration, VoiceBotNotFoundException, VoiceSessionNotFoundException, } from "../models/models_0";
3
3
  import { requestBuilder as rb } from "@smithy/core";
4
- import { decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, expectUnion as __expectUnion, _json, collectBody, map, take, withBaseException, } from "@smithy/smithy-client";
4
+ import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, expectUnion as __expectUnion, _json, collectBody, map, take, withBaseException, } from "@smithy/smithy-client";
5
5
  export const se_CreateVoiceBotCommand = async (input, context) => {
6
6
  const b = rb(input, context);
7
7
  const headers = {
@@ -418,10 +418,27 @@ const se_VoiceBotEndpoint = (input, context) => {
418
418
  const se_VoiceBotFunctionDefinition = (input, context) => {
419
419
  return take(input, {
420
420
  'description': [],
421
+ 'integration': _ => se_VoiceBotFunctionIntegration(_, context),
421
422
  'name': [],
422
423
  'parameters': _ => se_Document(_, context),
423
424
  });
424
425
  };
426
+ const se_VoiceBotFunctionIntegration = (input, context) => {
427
+ return VoiceBotFunctionIntegration.visit(input, {
428
+ webhook: value => ({ "webhook": se_VoiceBotFunctionIntegrationWebhook(value, context) }),
429
+ _: (name, value) => ({ name: value })
430
+ });
431
+ };
432
+ const se_VoiceBotFunctionIntegrationWebhook = (input, context) => {
433
+ return take(input, {
434
+ 'async': [],
435
+ 'authorization': _ => se_Document(_, context),
436
+ 'headers': _json,
437
+ 'parameters': _ => se_Document(_, context),
438
+ 'timeout': [],
439
+ 'url': [],
440
+ });
441
+ };
425
442
  const se_VoiceBotLlmEndpoint = (input, context) => {
426
443
  return take(input, {
427
444
  'embeddedTools': _ => se_VoiceBotEmbeddedToolsList(_, context),
@@ -506,10 +523,29 @@ const de_VoiceBotEndpoint = (output, context) => {
506
523
  const de_VoiceBotFunctionDefinition = (output, context) => {
507
524
  return take(output, {
508
525
  'description': __expectString,
526
+ 'integration': (_) => de_VoiceBotFunctionIntegration(__expectUnion(_), context),
509
527
  'name': __expectString,
510
528
  'parameters': (_) => de_Document(_, context),
511
529
  });
512
530
  };
531
+ const de_VoiceBotFunctionIntegration = (output, context) => {
532
+ if (output.webhook != null) {
533
+ return {
534
+ webhook: de_VoiceBotFunctionIntegrationWebhook(output.webhook, context)
535
+ };
536
+ }
537
+ return { $unknown: Object.entries(output)[0] };
538
+ };
539
+ const de_VoiceBotFunctionIntegrationWebhook = (output, context) => {
540
+ return take(output, {
541
+ 'async': __expectBoolean,
542
+ 'authorization': (_) => de_Document(_, context),
543
+ 'headers': _json,
544
+ 'parameters': (_) => de_Document(_, context),
545
+ 'timeout': __expectInt32,
546
+ 'url': __expectString,
547
+ });
548
+ };
513
549
  const de_VoiceBotLlmEndpoint = (output, context) => {
514
550
  return take(output, {
515
551
  'embeddedTools': (_) => de_VoiceBotEmbeddedToolsList(_, context),
@@ -62,6 +62,21 @@ declare const CreateVoiceBotCommand_base: {
62
62
  * name: "STRING_VALUE", // required
63
63
  * description: "STRING_VALUE",
64
64
  * parameters: "DOCUMENT_VALUE",
65
+ * integration: { // VoiceBotFunctionIntegration Union: only one key present
66
+ * webhook: { // VoiceBotFunctionIntegrationWebhook
67
+ * url: "STRING_VALUE", // required
68
+ * async: true || false,
69
+ * timeout: Number("int"),
70
+ * authorization: "DOCUMENT_VALUE",
71
+ * headers: [ // VoiceBotFunctionIntegrationWebhookHeadersList
72
+ * { // VoiceBotFunctionIntegrationWebhookHeader
73
+ * key: "STRING_VALUE", // required
74
+ * value: "STRING_VALUE", // required
75
+ * },
76
+ * ],
77
+ * parameters: "DOCUMENT_VALUE",
78
+ * },
79
+ * },
65
80
  * },
66
81
  * },
67
82
  * ],
@@ -118,6 +133,21 @@ declare const CreateVoiceBotCommand_base: {
118
133
  * // name: "STRING_VALUE", // required
119
134
  * // description: "STRING_VALUE",
120
135
  * // parameters: "DOCUMENT_VALUE",
136
+ * // integration: { // VoiceBotFunctionIntegration Union: only one key present
137
+ * // webhook: { // VoiceBotFunctionIntegrationWebhook
138
+ * // url: "STRING_VALUE", // required
139
+ * // async: true || false,
140
+ * // timeout: Number("int"),
141
+ * // authorization: "DOCUMENT_VALUE",
142
+ * // headers: [ // VoiceBotFunctionIntegrationWebhookHeadersList
143
+ * // { // VoiceBotFunctionIntegrationWebhookHeader
144
+ * // key: "STRING_VALUE", // required
145
+ * // value: "STRING_VALUE", // required
146
+ * // },
147
+ * // ],
148
+ * // parameters: "DOCUMENT_VALUE",
149
+ * // },
150
+ * // },
121
151
  * // },
122
152
  * // },
123
153
  * // ],
@@ -69,6 +69,21 @@ declare const GetVoiceBotCommand_base: {
69
69
  * // name: "STRING_VALUE", // required
70
70
  * // description: "STRING_VALUE",
71
71
  * // parameters: "DOCUMENT_VALUE",
72
+ * // integration: { // VoiceBotFunctionIntegration Union: only one key present
73
+ * // webhook: { // VoiceBotFunctionIntegrationWebhook
74
+ * // url: "STRING_VALUE", // required
75
+ * // async: true || false,
76
+ * // timeout: Number("int"),
77
+ * // authorization: "DOCUMENT_VALUE",
78
+ * // headers: [ // VoiceBotFunctionIntegrationWebhookHeadersList
79
+ * // { // VoiceBotFunctionIntegrationWebhookHeader
80
+ * // key: "STRING_VALUE", // required
81
+ * // value: "STRING_VALUE", // required
82
+ * // },
83
+ * // ],
84
+ * // parameters: "DOCUMENT_VALUE",
85
+ * // },
86
+ * // },
72
87
  * // },
73
88
  * // },
74
89
  * // ],
@@ -69,6 +69,21 @@ declare const ListVoiceBotsCommand_base: {
69
69
  * // name: "STRING_VALUE", // required
70
70
  * // description: "STRING_VALUE",
71
71
  * // parameters: "DOCUMENT_VALUE",
72
+ * // integration: { // VoiceBotFunctionIntegration Union: only one key present
73
+ * // webhook: { // VoiceBotFunctionIntegrationWebhook
74
+ * // url: "STRING_VALUE", // required
75
+ * // async: true || false,
76
+ * // timeout: Number("int"),
77
+ * // authorization: "DOCUMENT_VALUE",
78
+ * // headers: [ // VoiceBotFunctionIntegrationWebhookHeadersList
79
+ * // { // VoiceBotFunctionIntegrationWebhookHeader
80
+ * // key: "STRING_VALUE", // required
81
+ * // value: "STRING_VALUE", // required
82
+ * // },
83
+ * // ],
84
+ * // parameters: "DOCUMENT_VALUE",
85
+ * // },
86
+ * // },
72
87
  * // },
73
88
  * // },
74
89
  * // ],
@@ -62,6 +62,21 @@ declare const UpdateVoiceBotCommand_base: {
62
62
  * name: "STRING_VALUE", // required
63
63
  * description: "STRING_VALUE",
64
64
  * parameters: "DOCUMENT_VALUE",
65
+ * integration: { // VoiceBotFunctionIntegration Union: only one key present
66
+ * webhook: { // VoiceBotFunctionIntegrationWebhook
67
+ * url: "STRING_VALUE", // required
68
+ * async: true || false,
69
+ * timeout: Number("int"),
70
+ * authorization: "DOCUMENT_VALUE",
71
+ * headers: [ // VoiceBotFunctionIntegrationWebhookHeadersList
72
+ * { // VoiceBotFunctionIntegrationWebhookHeader
73
+ * key: "STRING_VALUE", // required
74
+ * value: "STRING_VALUE", // required
75
+ * },
76
+ * ],
77
+ * parameters: "DOCUMENT_VALUE",
78
+ * },
79
+ * },
65
80
  * },
66
81
  * },
67
82
  * ],
@@ -119,6 +134,21 @@ declare const UpdateVoiceBotCommand_base: {
119
134
  * // name: "STRING_VALUE", // required
120
135
  * // description: "STRING_VALUE",
121
136
  * // parameters: "DOCUMENT_VALUE",
137
+ * // integration: { // VoiceBotFunctionIntegration Union: only one key present
138
+ * // webhook: { // VoiceBotFunctionIntegrationWebhook
139
+ * // url: "STRING_VALUE", // required
140
+ * // async: true || false,
141
+ * // timeout: Number("int"),
142
+ * // authorization: "DOCUMENT_VALUE",
143
+ * // headers: [ // VoiceBotFunctionIntegrationWebhookHeadersList
144
+ * // { // VoiceBotFunctionIntegrationWebhookHeader
145
+ * // key: "STRING_VALUE", // required
146
+ * // value: "STRING_VALUE", // required
147
+ * // },
148
+ * // ],
149
+ * // parameters: "DOCUMENT_VALUE",
150
+ * // },
151
+ * // },
122
152
  * // },
123
153
  * // },
124
154
  * // ],
@@ -113,6 +113,49 @@ export interface VoiceBotEmbeddedTool {
113
113
  */
114
114
  parameters?: __DocumentType;
115
115
  }
116
+ /**
117
+ * @public
118
+ */
119
+ export interface VoiceBotFunctionIntegrationWebhookHeader {
120
+ key: string;
121
+ value: string;
122
+ }
123
+ /**
124
+ * @public
125
+ */
126
+ export interface VoiceBotFunctionIntegrationWebhook {
127
+ url: string;
128
+ async?: boolean;
129
+ timeout?: number;
130
+ authorization?: __DocumentType;
131
+ headers?: (VoiceBotFunctionIntegrationWebhookHeader)[];
132
+ parameters?: __DocumentType;
133
+ }
134
+ /**
135
+ * @public
136
+ */
137
+ export type VoiceBotFunctionIntegration = VoiceBotFunctionIntegration.WebhookMember | VoiceBotFunctionIntegration.$UnknownMember;
138
+ /**
139
+ * @public
140
+ */
141
+ export declare namespace VoiceBotFunctionIntegration {
142
+ interface WebhookMember {
143
+ webhook: VoiceBotFunctionIntegrationWebhook;
144
+ $unknown?: never;
145
+ }
146
+ /**
147
+ * @public
148
+ */
149
+ interface $UnknownMember {
150
+ webhook?: never;
151
+ $unknown: [string, any];
152
+ }
153
+ interface Visitor<T> {
154
+ webhook: (value: VoiceBotFunctionIntegrationWebhook) => T;
155
+ _: (name: string, value: any) => T;
156
+ }
157
+ const visit: <T>(value: VoiceBotFunctionIntegration, visitor: Visitor<T>) => T;
158
+ }
116
159
  /**
117
160
  * @public
118
161
  */
@@ -132,6 +175,7 @@ export interface VoiceBotFunctionDefinition {
132
175
  * @public
133
176
  */
134
177
  parameters?: __DocumentType;
178
+ integration?: VoiceBotFunctionIntegration;
135
179
  }
136
180
  /**
137
181
  * @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.6",
4
+ "version": "1.0.8",
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",