@wildix/wim-voicebots-client 1.0.6 → 1.0.7

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,26 @@ 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
+ 'timeout': [],
461
+ 'url': [],
462
+ });
463
+ };
448
464
  const se_VoiceBotLlmEndpoint = (input, context) => {
449
465
  return (0, smithy_client_1.take)(input, {
450
466
  'embeddedTools': _ => se_VoiceBotEmbeddedToolsList(_, context),
@@ -529,10 +545,28 @@ const de_VoiceBotEndpoint = (output, context) => {
529
545
  const de_VoiceBotFunctionDefinition = (output, context) => {
530
546
  return (0, smithy_client_1.take)(output, {
531
547
  'description': smithy_client_1.expectString,
548
+ 'integration': (_) => de_VoiceBotFunctionIntegration((0, smithy_client_1.expectUnion)(_), context),
532
549
  'name': smithy_client_1.expectString,
533
550
  'parameters': (_) => de_Document(_, context),
534
551
  });
535
552
  };
553
+ const de_VoiceBotFunctionIntegration = (output, context) => {
554
+ if (output.webhook != null) {
555
+ return {
556
+ webhook: de_VoiceBotFunctionIntegrationWebhook(output.webhook, context)
557
+ };
558
+ }
559
+ return { $unknown: Object.entries(output)[0] };
560
+ };
561
+ const de_VoiceBotFunctionIntegrationWebhook = (output, context) => {
562
+ return (0, smithy_client_1.take)(output, {
563
+ 'async': smithy_client_1.expectBoolean,
564
+ 'authorization': (_) => de_Document(_, context),
565
+ 'headers': smithy_client_1._json,
566
+ 'timeout': smithy_client_1.expectInt32,
567
+ 'url': smithy_client_1.expectString,
568
+ });
569
+ };
536
570
  const de_VoiceBotLlmEndpoint = (output, context) => {
537
571
  return (0, smithy_client_1.take)(output, {
538
572
  '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,26 @@ 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
+ 'timeout': [],
438
+ 'url': [],
439
+ });
440
+ };
425
441
  const se_VoiceBotLlmEndpoint = (input, context) => {
426
442
  return take(input, {
427
443
  'embeddedTools': _ => se_VoiceBotEmbeddedToolsList(_, context),
@@ -506,10 +522,28 @@ const de_VoiceBotEndpoint = (output, context) => {
506
522
  const de_VoiceBotFunctionDefinition = (output, context) => {
507
523
  return take(output, {
508
524
  'description': __expectString,
525
+ 'integration': (_) => de_VoiceBotFunctionIntegration(__expectUnion(_), context),
509
526
  'name': __expectString,
510
527
  'parameters': (_) => de_Document(_, context),
511
528
  });
512
529
  };
530
+ const de_VoiceBotFunctionIntegration = (output, context) => {
531
+ if (output.webhook != null) {
532
+ return {
533
+ webhook: de_VoiceBotFunctionIntegrationWebhook(output.webhook, context)
534
+ };
535
+ }
536
+ return { $unknown: Object.entries(output)[0] };
537
+ };
538
+ const de_VoiceBotFunctionIntegrationWebhook = (output, context) => {
539
+ return take(output, {
540
+ 'async': __expectBoolean,
541
+ 'authorization': (_) => de_Document(_, context),
542
+ 'headers': _json,
543
+ 'timeout': __expectInt32,
544
+ 'url': __expectString,
545
+ });
546
+ };
513
547
  const de_VoiceBotLlmEndpoint = (output, context) => {
514
548
  return take(output, {
515
549
  'embeddedTools': (_) => de_VoiceBotEmbeddedToolsList(_, context),
@@ -62,6 +62,20 @@ 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
+ * },
78
+ * },
65
79
  * },
66
80
  * },
67
81
  * ],
@@ -118,6 +132,20 @@ declare const CreateVoiceBotCommand_base: {
118
132
  * // name: "STRING_VALUE", // required
119
133
  * // description: "STRING_VALUE",
120
134
  * // parameters: "DOCUMENT_VALUE",
135
+ * // integration: { // VoiceBotFunctionIntegration Union: only one key present
136
+ * // webhook: { // VoiceBotFunctionIntegrationWebhook
137
+ * // url: "STRING_VALUE", // required
138
+ * // async: true || false,
139
+ * // timeout: Number("int"),
140
+ * // authorization: "DOCUMENT_VALUE",
141
+ * // headers: [ // VoiceBotFunctionIntegrationWebhookHeadersList
142
+ * // { // VoiceBotFunctionIntegrationWebhookHeader
143
+ * // key: "STRING_VALUE", // required
144
+ * // value: "STRING_VALUE", // required
145
+ * // },
146
+ * // ],
147
+ * // },
148
+ * // },
121
149
  * // },
122
150
  * // },
123
151
  * // ],
@@ -69,6 +69,20 @@ 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
+ * // },
85
+ * // },
72
86
  * // },
73
87
  * // },
74
88
  * // ],
@@ -69,6 +69,20 @@ 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
+ * // },
85
+ * // },
72
86
  * // },
73
87
  * // },
74
88
  * // ],
@@ -62,6 +62,20 @@ 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
+ * },
78
+ * },
65
79
  * },
66
80
  * },
67
81
  * ],
@@ -119,6 +133,20 @@ declare const UpdateVoiceBotCommand_base: {
119
133
  * // name: "STRING_VALUE", // required
120
134
  * // description: "STRING_VALUE",
121
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
+ * // },
149
+ * // },
122
150
  * // },
123
151
  * // },
124
152
  * // ],
@@ -113,6 +113,48 @@ 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
+ }
133
+ /**
134
+ * @public
135
+ */
136
+ export type VoiceBotFunctionIntegration = VoiceBotFunctionIntegration.WebhookMember | VoiceBotFunctionIntegration.$UnknownMember;
137
+ /**
138
+ * @public
139
+ */
140
+ export declare namespace VoiceBotFunctionIntegration {
141
+ interface WebhookMember {
142
+ webhook: VoiceBotFunctionIntegrationWebhook;
143
+ $unknown?: never;
144
+ }
145
+ /**
146
+ * @public
147
+ */
148
+ interface $UnknownMember {
149
+ webhook?: never;
150
+ $unknown: [string, any];
151
+ }
152
+ interface Visitor<T> {
153
+ webhook: (value: VoiceBotFunctionIntegrationWebhook) => T;
154
+ _: (name: string, value: any) => T;
155
+ }
156
+ const visit: <T>(value: VoiceBotFunctionIntegration, visitor: Visitor<T>) => T;
157
+ }
116
158
  /**
117
159
  * @public
118
160
  */
@@ -132,6 +174,7 @@ export interface VoiceBotFunctionDefinition {
132
174
  * @public
133
175
  */
134
176
  parameters?: __DocumentType;
177
+ integration?: VoiceBotFunctionIntegration;
135
178
  }
136
179
  /**
137
180
  * @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.7",
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",