@wildix/wim-tools-client 0.0.11 → 0.0.12

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.ToolExecutionException = exports.ToolHandler = exports.ToolMcpTransport = exports.ToolVariableType = exports.ToolAuthorizationType = exports.ToolEmailHandler = exports.ToolChatHandler = exports.ToolStringValue = exports.AlreadyExistException = exports.ValidationException = exports.NotFoundException = void 0;
3
+ exports.ToolExecutionException = exports.ToolVariableType = exports.ToolHandler = exports.ToolMcpTransport = exports.ToolAuthorizationType = exports.ToolEmailHandler = exports.ToolChatHandler = exports.ToolStringValue = exports.AlreadyExistException = exports.ValidationException = exports.NotFoundException = void 0;
4
4
  const ToolsServiceException_1 = require("./ToolsServiceException");
5
5
  class NotFoundException extends ToolsServiceException_1.ToolsServiceException {
6
6
  name = "NotFoundException";
@@ -78,14 +78,6 @@ exports.ToolAuthorizationType = {
78
78
  BASIC: "Basic",
79
79
  BEARER: "Bearer",
80
80
  };
81
- exports.ToolVariableType = {
82
- BOOLEAN: "boolean",
83
- NUMBER: "number",
84
- NUMBER_ARRAY: "number_array",
85
- OBJECT: "object",
86
- STRING: "string",
87
- STRING_ARRAY: "string_array",
88
- };
89
81
  exports.ToolMcpTransport = {
90
82
  HTTP: "http",
91
83
  SSE: "sse",
@@ -107,6 +99,13 @@ var ToolHandler;
107
99
  return visitor._(value.$unknown[0], value.$unknown[1]);
108
100
  };
109
101
  })(ToolHandler || (exports.ToolHandler = ToolHandler = {}));
102
+ exports.ToolVariableType = {
103
+ BOOLEAN: "boolean",
104
+ NUMBER: "number",
105
+ NUMBER_ARRAY: "number_array",
106
+ STRING: "string",
107
+ STRING_ARRAY: "string_array",
108
+ };
110
109
  class ToolExecutionException extends ToolsServiceException_1.ToolsServiceException {
111
110
  name = "ToolExecutionException";
112
111
  $fault = "server";
@@ -8,62 +8,72 @@ const core_2 = require("@smithy/core");
8
8
  const smithy_client_1 = require("@smithy/smithy-client");
9
9
  const se_CreateToolCommand = async (input, context) => {
10
10
  const b = (0, core_2.requestBuilder)(input, context);
11
- const headers = (0, smithy_client_1.map)({}, smithy_client_1.isSerializableHeaderValue, {
11
+ const headers = {
12
12
  'content-type': 'application/json',
13
- [_xci]: input[_c],
14
- });
13
+ };
15
14
  b.bp("/v1/tools");
15
+ const query = (0, smithy_client_1.map)({
16
+ [_c]: [, input[_c]],
17
+ });
16
18
  let body;
17
19
  body = JSON.stringify((0, smithy_client_1.take)(input, {
18
20
  'description': [],
19
- 'handler': _ => (0, smithy_client_1._json)(_),
21
+ 'handler': _ => se_ToolHandler(_, context),
20
22
  'input': _ => (0, smithy_client_1._json)(_),
21
23
  'name': [],
22
24
  }));
23
25
  b.m("POST")
24
26
  .h(headers)
27
+ .q(query)
25
28
  .b(body);
26
29
  return b.build();
27
30
  };
28
31
  exports.se_CreateToolCommand = se_CreateToolCommand;
29
32
  const se_DeleteToolCommand = async (input, context) => {
30
33
  const b = (0, core_2.requestBuilder)(input, context);
31
- const headers = (0, smithy_client_1.map)({}, smithy_client_1.isSerializableHeaderValue, {
32
- [_xci]: input[_c],
33
- });
34
+ const headers = {};
34
35
  b.bp("/v1/tools/{toolId}");
35
36
  b.p('toolId', () => input.toolId, '{toolId}', false);
37
+ const query = (0, smithy_client_1.map)({
38
+ [_c]: [, input[_c]],
39
+ });
36
40
  let body;
37
41
  b.m("DELETE")
38
42
  .h(headers)
43
+ .q(query)
39
44
  .b(body);
40
45
  return b.build();
41
46
  };
42
47
  exports.se_DeleteToolCommand = se_DeleteToolCommand;
43
48
  const se_DescribeToolsCommand = async (input, context) => {
44
49
  const b = (0, core_2.requestBuilder)(input, context);
45
- const headers = (0, smithy_client_1.map)({}, smithy_client_1.isSerializableHeaderValue, {
50
+ const headers = {
46
51
  'content-type': 'application/json',
47
- [_xci]: input[_c],
48
- });
52
+ };
49
53
  b.bp("/v1/tools/describe");
54
+ const query = (0, smithy_client_1.map)({
55
+ [_c]: [, input[_c]],
56
+ });
50
57
  let body;
51
58
  body = JSON.stringify((0, smithy_client_1.take)(input, {
52
59
  'ids': _ => (0, smithy_client_1._json)(_),
53
60
  }));
54
61
  b.m("POST")
55
62
  .h(headers)
63
+ .q(query)
56
64
  .b(body);
57
65
  return b.build();
58
66
  };
59
67
  exports.se_DescribeToolsCommand = se_DescribeToolsCommand;
60
68
  const se_ExecuteToolCommand = async (input, context) => {
61
69
  const b = (0, core_2.requestBuilder)(input, context);
62
- const headers = (0, smithy_client_1.map)({}, smithy_client_1.isSerializableHeaderValue, {
70
+ const headers = {
63
71
  'content-type': 'application/json',
64
- [_xci]: input[_c],
65
- });
72
+ };
66
73
  b.bp("/v1/tools/execute");
74
+ const query = (0, smithy_client_1.map)({
75
+ [_c]: [, input[_c]],
76
+ });
67
77
  let body;
68
78
  body = JSON.stringify((0, smithy_client_1.take)(input, {
69
79
  'id': [],
@@ -71,6 +81,7 @@ const se_ExecuteToolCommand = async (input, context) => {
71
81
  }));
72
82
  b.m("POST")
73
83
  .h(headers)
84
+ .q(query)
74
85
  .b(body);
75
86
  return b.build();
76
87
  };
@@ -93,34 +104,39 @@ const se_GetToolCommand = async (input, context) => {
93
104
  exports.se_GetToolCommand = se_GetToolCommand;
94
105
  const se_ListToolsCommand = async (input, context) => {
95
106
  const b = (0, core_2.requestBuilder)(input, context);
96
- const headers = (0, smithy_client_1.map)({}, smithy_client_1.isSerializableHeaderValue, {
97
- [_xci]: input[_c],
98
- });
107
+ const headers = {};
99
108
  b.bp("/v1/tools");
109
+ const query = (0, smithy_client_1.map)({
110
+ [_c]: [, input[_c]],
111
+ });
100
112
  let body;
101
113
  b.m("GET")
102
114
  .h(headers)
115
+ .q(query)
103
116
  .b(body);
104
117
  return b.build();
105
118
  };
106
119
  exports.se_ListToolsCommand = se_ListToolsCommand;
107
120
  const se_UpdateToolCommand = async (input, context) => {
108
121
  const b = (0, core_2.requestBuilder)(input, context);
109
- const headers = (0, smithy_client_1.map)({}, smithy_client_1.isSerializableHeaderValue, {
122
+ const headers = {
110
123
  'content-type': 'application/json',
111
- [_xci]: input[_c],
112
- });
124
+ };
113
125
  b.bp("/v1/tools/{toolId}");
114
126
  b.p('toolId', () => input.toolId, '{toolId}', false);
127
+ const query = (0, smithy_client_1.map)({
128
+ [_c]: [, input[_c]],
129
+ });
115
130
  let body;
116
131
  body = JSON.stringify((0, smithy_client_1.take)(input, {
117
132
  'description': [],
118
- 'handler': _ => (0, smithy_client_1._json)(_),
133
+ 'handler': _ => se_ToolHandler(_, context),
119
134
  'input': _ => (0, smithy_client_1._json)(_),
120
135
  'name': [],
121
136
  }));
122
137
  b.m("PUT")
123
138
  .h(headers)
139
+ .q(query)
124
140
  .b(body);
125
141
  return b.build();
126
142
  };
@@ -134,7 +150,7 @@ const de_CreateToolCommand = async (output, context) => {
134
150
  });
135
151
  const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
136
152
  const doc = (0, smithy_client_1.take)(data, {
137
- 'tool': smithy_client_1._json,
153
+ 'tool': _ => de_Tool(_, context),
138
154
  });
139
155
  Object.assign(contents, doc);
140
156
  return contents;
@@ -190,7 +206,7 @@ const de_GetToolCommand = async (output, context) => {
190
206
  });
191
207
  const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
192
208
  const doc = (0, smithy_client_1.take)(data, {
193
- 'tool': smithy_client_1._json,
209
+ 'tool': _ => de_Tool(_, context),
194
210
  });
195
211
  Object.assign(contents, doc);
196
212
  return contents;
@@ -205,7 +221,7 @@ const de_ListToolsCommand = async (output, context) => {
205
221
  });
206
222
  const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
207
223
  const doc = (0, smithy_client_1.take)(data, {
208
- 'tools': smithy_client_1._json,
224
+ 'tools': _ => de_ToolsList(_, context),
209
225
  });
210
226
  Object.assign(contents, doc);
211
227
  return contents;
@@ -220,7 +236,7 @@ const de_UpdateToolCommand = async (output, context) => {
220
236
  });
221
237
  const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
222
238
  const doc = (0, smithy_client_1.take)(data, {
223
- 'tool': smithy_client_1._json,
239
+ 'tool': _ => de_Tool(_, context),
224
240
  });
225
241
  Object.assign(contents, doc);
226
242
  return contents;
@@ -311,9 +327,50 @@ const de_ToolExecutionExceptionRes = async (parsedOutput, context) => {
311
327
  const se_Document = (input, context) => {
312
328
  return input;
313
329
  };
330
+ const se_ToolHandler = (input, context) => {
331
+ return models_0_1.ToolHandler.visit(input, {
332
+ chat: value => ({ "chat": (0, smithy_client_1._json)(value) }),
333
+ email: value => ({ "email": (0, smithy_client_1._json)(value) }),
334
+ mcp: value => ({ "mcp": se_ToolMcpHandler(value, context) }),
335
+ sms: value => ({ "sms": (0, smithy_client_1._json)(value) }),
336
+ webhook: value => ({ "webhook": (0, smithy_client_1._json)(value) }),
337
+ _: (name, value) => ({ [name]: value })
338
+ });
339
+ };
340
+ const se_ToolMcpHandler = (input, context) => {
341
+ return (0, smithy_client_1.take)(input, {
342
+ 'authentication': smithy_client_1._json,
343
+ 'serverUrl': [],
344
+ 'timeout': [],
345
+ 'tools': _ => se_ToolMcpToolConfigList(_, context),
346
+ 'transport': [],
347
+ });
348
+ };
349
+ const se_ToolMcpToolConfig = (input, context) => {
350
+ return (0, smithy_client_1.take)(input, {
351
+ 'description': [],
352
+ 'mcpToolId': [],
353
+ 'parameters': _ => se_Document(_, context),
354
+ });
355
+ };
356
+ const se_ToolMcpToolConfigList = (input, context) => {
357
+ return input.filter((e) => e != null).map(entry => {
358
+ return se_ToolMcpToolConfig(entry, context);
359
+ });
360
+ };
314
361
  const de_Document = (output, context) => {
315
362
  return output;
316
363
  };
364
+ const de_Tool = (output, context) => {
365
+ return (0, smithy_client_1.take)(output, {
366
+ 'company': smithy_client_1.expectString,
367
+ 'description': smithy_client_1.expectString,
368
+ 'handler': (_) => de_ToolHandler((0, core_1.awsExpectUnion)(_), context),
369
+ 'id': smithy_client_1.expectString,
370
+ 'input': smithy_client_1._json,
371
+ 'name': smithy_client_1.expectString,
372
+ });
373
+ };
317
374
  const de_ToolExecutionResult = (output, context) => {
318
375
  return (0, smithy_client_1.take)(output, {
319
376
  'error': smithy_client_1._json,
@@ -321,6 +378,62 @@ const de_ToolExecutionResult = (output, context) => {
321
378
  'statusCode': smithy_client_1.expectInt32,
322
379
  });
323
380
  };
381
+ const de_ToolHandler = (output, context) => {
382
+ if (output.chat != null) {
383
+ return {
384
+ chat: (0, smithy_client_1._json)((0, core_1.awsExpectUnion)(output.chat))
385
+ };
386
+ }
387
+ if (output.email != null) {
388
+ return {
389
+ email: (0, smithy_client_1._json)((0, core_1.awsExpectUnion)(output.email))
390
+ };
391
+ }
392
+ if (output.mcp != null) {
393
+ return {
394
+ mcp: de_ToolMcpHandler(output.mcp, context)
395
+ };
396
+ }
397
+ if (output.sms != null) {
398
+ return {
399
+ sms: (0, smithy_client_1._json)(output.sms)
400
+ };
401
+ }
402
+ if (output.webhook != null) {
403
+ return {
404
+ webhook: (0, smithy_client_1._json)(output.webhook)
405
+ };
406
+ }
407
+ return { $unknown: Object.entries(output)[0] };
408
+ };
409
+ const de_ToolMcpHandler = (output, context) => {
410
+ return (0, smithy_client_1.take)(output, {
411
+ 'authentication': smithy_client_1._json,
412
+ 'serverUrl': smithy_client_1.expectString,
413
+ 'timeout': smithy_client_1.expectInt32,
414
+ 'tools': (_) => de_ToolMcpToolConfigList(_, context),
415
+ 'transport': smithy_client_1.expectString,
416
+ });
417
+ };
418
+ const de_ToolMcpToolConfig = (output, context) => {
419
+ return (0, smithy_client_1.take)(output, {
420
+ 'description': smithy_client_1.expectString,
421
+ 'mcpToolId': smithy_client_1.expectString,
422
+ 'parameters': (_) => de_Document(_, context),
423
+ });
424
+ };
425
+ const de_ToolMcpToolConfigList = (output, context) => {
426
+ const retVal = (output || []).filter((e) => e != null).map((entry) => {
427
+ return de_ToolMcpToolConfig(entry, context);
428
+ });
429
+ return retVal;
430
+ };
431
+ const de_ToolsList = (output, context) => {
432
+ const retVal = (output || []).filter((e) => e != null).map((entry) => {
433
+ return de_Tool(entry, context);
434
+ });
435
+ return retVal;
436
+ };
324
437
  const deserializeMetadata = (output) => ({
325
438
  httpStatusCode: output.statusCode,
326
439
  requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
@@ -329,4 +442,3 @@ const deserializeMetadata = (output) => ({
329
442
  });
330
443
  const collectBodyString = (streamBody, context) => (0, smithy_client_1.collectBody)(streamBody, context).then(body => context.utf8Encoder(body));
331
444
  const _c = "company";
332
- const _xci = "x-company-id";
@@ -72,14 +72,6 @@ export const ToolAuthorizationType = {
72
72
  BASIC: "Basic",
73
73
  BEARER: "Bearer",
74
74
  };
75
- export const ToolVariableType = {
76
- BOOLEAN: "boolean",
77
- NUMBER: "number",
78
- NUMBER_ARRAY: "number_array",
79
- OBJECT: "object",
80
- STRING: "string",
81
- STRING_ARRAY: "string_array",
82
- };
83
75
  export const ToolMcpTransport = {
84
76
  HTTP: "http",
85
77
  SSE: "sse",
@@ -101,6 +93,13 @@ export var ToolHandler;
101
93
  return visitor._(value.$unknown[0], value.$unknown[1]);
102
94
  };
103
95
  })(ToolHandler || (ToolHandler = {}));
96
+ export const ToolVariableType = {
97
+ BOOLEAN: "boolean",
98
+ NUMBER: "number",
99
+ NUMBER_ARRAY: "number_array",
100
+ STRING: "string",
101
+ STRING_ARRAY: "string_array",
102
+ };
104
103
  export class ToolExecutionException extends __BaseException {
105
104
  name = "ToolExecutionException";
106
105
  $fault = "server";
@@ -1,63 +1,73 @@
1
1
  import { ToolsServiceException as __BaseException } from "../models/ToolsServiceException";
2
- import { AlreadyExistException, NotFoundException, ToolExecutionException, ValidationException, } from "../models/models_0";
3
- import { loadRestJsonErrorCode, parseJsonBody as parseBody, parseJsonErrorBody as parseErrorBody, } from "@aws-sdk/core";
2
+ import { AlreadyExistException, NotFoundException, ToolExecutionException, ToolHandler, ValidationException, } from "../models/models_0";
3
+ import { awsExpectUnion as __expectUnion, loadRestJsonErrorCode, parseJsonBody as parseBody, parseJsonErrorBody as parseErrorBody, } from "@aws-sdk/core";
4
4
  import { requestBuilder as rb } from "@smithy/core";
5
- import { decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, _json, collectBody, isSerializableHeaderValue, map, take, withBaseException, } from "@smithy/smithy-client";
5
+ import { decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, _json, collectBody, map, take, withBaseException, } from "@smithy/smithy-client";
6
6
  export const se_CreateToolCommand = async (input, context) => {
7
7
  const b = rb(input, context);
8
- const headers = map({}, isSerializableHeaderValue, {
8
+ const headers = {
9
9
  'content-type': 'application/json',
10
- [_xci]: input[_c],
11
- });
10
+ };
12
11
  b.bp("/v1/tools");
12
+ const query = map({
13
+ [_c]: [, input[_c]],
14
+ });
13
15
  let body;
14
16
  body = JSON.stringify(take(input, {
15
17
  'description': [],
16
- 'handler': _ => _json(_),
18
+ 'handler': _ => se_ToolHandler(_, context),
17
19
  'input': _ => _json(_),
18
20
  'name': [],
19
21
  }));
20
22
  b.m("POST")
21
23
  .h(headers)
24
+ .q(query)
22
25
  .b(body);
23
26
  return b.build();
24
27
  };
25
28
  export const se_DeleteToolCommand = async (input, context) => {
26
29
  const b = rb(input, context);
27
- const headers = map({}, isSerializableHeaderValue, {
28
- [_xci]: input[_c],
29
- });
30
+ const headers = {};
30
31
  b.bp("/v1/tools/{toolId}");
31
32
  b.p('toolId', () => input.toolId, '{toolId}', false);
33
+ const query = map({
34
+ [_c]: [, input[_c]],
35
+ });
32
36
  let body;
33
37
  b.m("DELETE")
34
38
  .h(headers)
39
+ .q(query)
35
40
  .b(body);
36
41
  return b.build();
37
42
  };
38
43
  export const se_DescribeToolsCommand = async (input, context) => {
39
44
  const b = rb(input, context);
40
- const headers = map({}, isSerializableHeaderValue, {
45
+ const headers = {
41
46
  'content-type': 'application/json',
42
- [_xci]: input[_c],
43
- });
47
+ };
44
48
  b.bp("/v1/tools/describe");
49
+ const query = map({
50
+ [_c]: [, input[_c]],
51
+ });
45
52
  let body;
46
53
  body = JSON.stringify(take(input, {
47
54
  'ids': _ => _json(_),
48
55
  }));
49
56
  b.m("POST")
50
57
  .h(headers)
58
+ .q(query)
51
59
  .b(body);
52
60
  return b.build();
53
61
  };
54
62
  export const se_ExecuteToolCommand = async (input, context) => {
55
63
  const b = rb(input, context);
56
- const headers = map({}, isSerializableHeaderValue, {
64
+ const headers = {
57
65
  'content-type': 'application/json',
58
- [_xci]: input[_c],
59
- });
66
+ };
60
67
  b.bp("/v1/tools/execute");
68
+ const query = map({
69
+ [_c]: [, input[_c]],
70
+ });
61
71
  let body;
62
72
  body = JSON.stringify(take(input, {
63
73
  'id': [],
@@ -65,6 +75,7 @@ export const se_ExecuteToolCommand = async (input, context) => {
65
75
  }));
66
76
  b.m("POST")
67
77
  .h(headers)
78
+ .q(query)
68
79
  .b(body);
69
80
  return b.build();
70
81
  };
@@ -85,33 +96,38 @@ export const se_GetToolCommand = async (input, context) => {
85
96
  };
86
97
  export const se_ListToolsCommand = async (input, context) => {
87
98
  const b = rb(input, context);
88
- const headers = map({}, isSerializableHeaderValue, {
89
- [_xci]: input[_c],
90
- });
99
+ const headers = {};
91
100
  b.bp("/v1/tools");
101
+ const query = map({
102
+ [_c]: [, input[_c]],
103
+ });
92
104
  let body;
93
105
  b.m("GET")
94
106
  .h(headers)
107
+ .q(query)
95
108
  .b(body);
96
109
  return b.build();
97
110
  };
98
111
  export const se_UpdateToolCommand = async (input, context) => {
99
112
  const b = rb(input, context);
100
- const headers = map({}, isSerializableHeaderValue, {
113
+ const headers = {
101
114
  'content-type': 'application/json',
102
- [_xci]: input[_c],
103
- });
115
+ };
104
116
  b.bp("/v1/tools/{toolId}");
105
117
  b.p('toolId', () => input.toolId, '{toolId}', false);
118
+ const query = map({
119
+ [_c]: [, input[_c]],
120
+ });
106
121
  let body;
107
122
  body = JSON.stringify(take(input, {
108
123
  'description': [],
109
- 'handler': _ => _json(_),
124
+ 'handler': _ => se_ToolHandler(_, context),
110
125
  'input': _ => _json(_),
111
126
  'name': [],
112
127
  }));
113
128
  b.m("PUT")
114
129
  .h(headers)
130
+ .q(query)
115
131
  .b(body);
116
132
  return b.build();
117
133
  };
@@ -124,7 +140,7 @@ export const de_CreateToolCommand = async (output, context) => {
124
140
  });
125
141
  const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
126
142
  const doc = take(data, {
127
- 'tool': _json,
143
+ 'tool': _ => de_Tool(_, context),
128
144
  });
129
145
  Object.assign(contents, doc);
130
146
  return contents;
@@ -176,7 +192,7 @@ export const de_GetToolCommand = async (output, context) => {
176
192
  });
177
193
  const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
178
194
  const doc = take(data, {
179
- 'tool': _json,
195
+ 'tool': _ => de_Tool(_, context),
180
196
  });
181
197
  Object.assign(contents, doc);
182
198
  return contents;
@@ -190,7 +206,7 @@ export const de_ListToolsCommand = async (output, context) => {
190
206
  });
191
207
  const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
192
208
  const doc = take(data, {
193
- 'tools': _json,
209
+ 'tools': _ => de_ToolsList(_, context),
194
210
  });
195
211
  Object.assign(contents, doc);
196
212
  return contents;
@@ -204,7 +220,7 @@ export const de_UpdateToolCommand = async (output, context) => {
204
220
  });
205
221
  const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
206
222
  const doc = take(data, {
207
- 'tool': _json,
223
+ 'tool': _ => de_Tool(_, context),
208
224
  });
209
225
  Object.assign(contents, doc);
210
226
  return contents;
@@ -294,9 +310,50 @@ const de_ToolExecutionExceptionRes = async (parsedOutput, context) => {
294
310
  const se_Document = (input, context) => {
295
311
  return input;
296
312
  };
313
+ const se_ToolHandler = (input, context) => {
314
+ return ToolHandler.visit(input, {
315
+ chat: value => ({ "chat": _json(value) }),
316
+ email: value => ({ "email": _json(value) }),
317
+ mcp: value => ({ "mcp": se_ToolMcpHandler(value, context) }),
318
+ sms: value => ({ "sms": _json(value) }),
319
+ webhook: value => ({ "webhook": _json(value) }),
320
+ _: (name, value) => ({ [name]: value })
321
+ });
322
+ };
323
+ const se_ToolMcpHandler = (input, context) => {
324
+ return take(input, {
325
+ 'authentication': _json,
326
+ 'serverUrl': [],
327
+ 'timeout': [],
328
+ 'tools': _ => se_ToolMcpToolConfigList(_, context),
329
+ 'transport': [],
330
+ });
331
+ };
332
+ const se_ToolMcpToolConfig = (input, context) => {
333
+ return take(input, {
334
+ 'description': [],
335
+ 'mcpToolId': [],
336
+ 'parameters': _ => se_Document(_, context),
337
+ });
338
+ };
339
+ const se_ToolMcpToolConfigList = (input, context) => {
340
+ return input.filter((e) => e != null).map(entry => {
341
+ return se_ToolMcpToolConfig(entry, context);
342
+ });
343
+ };
297
344
  const de_Document = (output, context) => {
298
345
  return output;
299
346
  };
347
+ const de_Tool = (output, context) => {
348
+ return take(output, {
349
+ 'company': __expectString,
350
+ 'description': __expectString,
351
+ 'handler': (_) => de_ToolHandler(__expectUnion(_), context),
352
+ 'id': __expectString,
353
+ 'input': _json,
354
+ 'name': __expectString,
355
+ });
356
+ };
300
357
  const de_ToolExecutionResult = (output, context) => {
301
358
  return take(output, {
302
359
  'error': _json,
@@ -304,6 +361,62 @@ const de_ToolExecutionResult = (output, context) => {
304
361
  'statusCode': __expectInt32,
305
362
  });
306
363
  };
364
+ const de_ToolHandler = (output, context) => {
365
+ if (output.chat != null) {
366
+ return {
367
+ chat: _json(__expectUnion(output.chat))
368
+ };
369
+ }
370
+ if (output.email != null) {
371
+ return {
372
+ email: _json(__expectUnion(output.email))
373
+ };
374
+ }
375
+ if (output.mcp != null) {
376
+ return {
377
+ mcp: de_ToolMcpHandler(output.mcp, context)
378
+ };
379
+ }
380
+ if (output.sms != null) {
381
+ return {
382
+ sms: _json(output.sms)
383
+ };
384
+ }
385
+ if (output.webhook != null) {
386
+ return {
387
+ webhook: _json(output.webhook)
388
+ };
389
+ }
390
+ return { $unknown: Object.entries(output)[0] };
391
+ };
392
+ const de_ToolMcpHandler = (output, context) => {
393
+ return take(output, {
394
+ 'authentication': _json,
395
+ 'serverUrl': __expectString,
396
+ 'timeout': __expectInt32,
397
+ 'tools': (_) => de_ToolMcpToolConfigList(_, context),
398
+ 'transport': __expectString,
399
+ });
400
+ };
401
+ const de_ToolMcpToolConfig = (output, context) => {
402
+ return take(output, {
403
+ 'description': __expectString,
404
+ 'mcpToolId': __expectString,
405
+ 'parameters': (_) => de_Document(_, context),
406
+ });
407
+ };
408
+ const de_ToolMcpToolConfigList = (output, context) => {
409
+ const retVal = (output || []).filter((e) => e != null).map((entry) => {
410
+ return de_ToolMcpToolConfig(entry, context);
411
+ });
412
+ return retVal;
413
+ };
414
+ const de_ToolsList = (output, context) => {
415
+ const retVal = (output || []).filter((e) => e != null).map((entry) => {
416
+ return de_Tool(entry, context);
417
+ });
418
+ return retVal;
419
+ };
307
420
  const deserializeMetadata = (output) => ({
308
421
  httpStatusCode: output.statusCode,
309
422
  requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
@@ -312,4 +425,3 @@ const deserializeMetadata = (output) => ({
312
425
  });
313
426
  const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then(body => context.utf8Encoder(body));
314
427
  const _c = "company";
315
- const _xci = "x-company-id";
@@ -38,12 +38,12 @@ declare const CreateToolCommand_base: {
38
38
  * const input = { // CreateToolInput
39
39
  * company: "STRING_VALUE",
40
40
  * name: "STRING_VALUE", // required
41
- * description: "STRING_VALUE", // required
41
+ * description: "STRING_VALUE",
42
42
  * input: { // ToolInput
43
43
  * variables: [ // ToolVariableList // required
44
44
  * { // ToolVariable
45
45
  * name: "STRING_VALUE", // required
46
- * type: "string" || "number" || "boolean" || "string_array" || "number_array" || "object", // required
46
+ * type: "string" || "number" || "boolean" || "string_array" || "number_array", // required
47
47
  * description: "STRING_VALUE", // required
48
48
  * required: true || false,
49
49
  * },
@@ -127,22 +127,11 @@ declare const CreateToolCommand_base: {
127
127
  * token: "STRING_VALUE", // required
128
128
  * },
129
129
  * timeout: Number("int"),
130
- * tools: [ // ToolMcpToolList // required
131
- * { // ToolMcpTool
132
- * name: "STRING_VALUE", // required
133
- * input: {
134
- * variables: [ // required
135
- * {
136
- * name: "STRING_VALUE", // required
137
- * type: "string" || "number" || "boolean" || "string_array" || "number_array" || "object", // required
138
- * description: "STRING_VALUE", // required
139
- * required: true || false,
140
- * },
141
- * ],
142
- * },
143
- * params: { // ToolMcpToolParams // required
144
- * "<keys>": "<ToolStringValue>",
145
- * },
130
+ * tools: [ // ToolMcpToolConfigList
131
+ * { // ToolMcpToolConfig
132
+ * mcpToolId: "STRING_VALUE", // required
133
+ * description: "STRING_VALUE",
134
+ * parameters: "DOCUMENT_VALUE",
146
135
  * },
147
136
  * ],
148
137
  * },
@@ -160,7 +149,7 @@ declare const CreateToolCommand_base: {
160
149
  * // variables: [ // ToolVariableList // required
161
150
  * // { // ToolVariable
162
151
  * // name: "STRING_VALUE", // required
163
- * // type: "string" || "number" || "boolean" || "string_array" || "number_array" || "object", // required
152
+ * // type: "string" || "number" || "boolean" || "string_array" || "number_array", // required
164
153
  * // description: "STRING_VALUE", // required
165
154
  * // required: true || false,
166
155
  * // },
@@ -244,22 +233,11 @@ declare const CreateToolCommand_base: {
244
233
  * // token: "STRING_VALUE", // required
245
234
  * // },
246
235
  * // timeout: Number("int"),
247
- * // tools: [ // ToolMcpToolList // required
248
- * // { // ToolMcpTool
249
- * // name: "STRING_VALUE", // required
250
- * // input: {
251
- * // variables: [ // required
252
- * // {
253
- * // name: "STRING_VALUE", // required
254
- * // type: "string" || "number" || "boolean" || "string_array" || "number_array" || "object", // required
255
- * // description: "STRING_VALUE", // required
256
- * // required: true || false,
257
- * // },
258
- * // ],
259
- * // },
260
- * // params: { // ToolMcpToolParams // required
261
- * // "<keys>": "<ToolStringValue>",
262
- * // },
236
+ * // tools: [ // ToolMcpToolConfigList
237
+ * // { // ToolMcpToolConfig
238
+ * // mcpToolId: "STRING_VALUE", // required
239
+ * // description: "STRING_VALUE",
240
+ * // parameters: "DOCUMENT_VALUE",
263
241
  * // },
264
242
  * // ],
265
243
  * // },
@@ -52,7 +52,7 @@ declare const DescribeToolsCommand_base: {
52
52
  * // variables: [ // ToolVariableList // required
53
53
  * // { // ToolVariable
54
54
  * // name: "STRING_VALUE", // required
55
- * // type: "string" || "number" || "boolean" || "string_array" || "number_array" || "object", // required
55
+ * // type: "string" || "number" || "boolean" || "string_array" || "number_array", // required
56
56
  * // description: "STRING_VALUE", // required
57
57
  * // required: true || false,
58
58
  * // },
@@ -51,7 +51,7 @@ declare const GetToolCommand_base: {
51
51
  * // variables: [ // ToolVariableList // required
52
52
  * // { // ToolVariable
53
53
  * // name: "STRING_VALUE", // required
54
- * // type: "string" || "number" || "boolean" || "string_array" || "number_array" || "object", // required
54
+ * // type: "string" || "number" || "boolean" || "string_array" || "number_array", // required
55
55
  * // description: "STRING_VALUE", // required
56
56
  * // required: true || false,
57
57
  * // },
@@ -135,22 +135,11 @@ declare const GetToolCommand_base: {
135
135
  * // token: "STRING_VALUE", // required
136
136
  * // },
137
137
  * // timeout: Number("int"),
138
- * // tools: [ // ToolMcpToolList // required
139
- * // { // ToolMcpTool
140
- * // name: "STRING_VALUE", // required
141
- * // input: {
142
- * // variables: [ // required
143
- * // {
144
- * // name: "STRING_VALUE", // required
145
- * // type: "string" || "number" || "boolean" || "string_array" || "number_array" || "object", // required
146
- * // description: "STRING_VALUE", // required
147
- * // required: true || false,
148
- * // },
149
- * // ],
150
- * // },
151
- * // params: { // ToolMcpToolParams // required
152
- * // "<keys>": "<ToolStringValue>",
153
- * // },
138
+ * // tools: [ // ToolMcpToolConfigList
139
+ * // { // ToolMcpToolConfig
140
+ * // mcpToolId: "STRING_VALUE", // required
141
+ * // description: "STRING_VALUE",
142
+ * // parameters: "DOCUMENT_VALUE",
154
143
  * // },
155
144
  * // ],
156
145
  * // },
@@ -51,7 +51,7 @@ declare const ListToolsCommand_base: {
51
51
  * // variables: [ // ToolVariableList // required
52
52
  * // { // ToolVariable
53
53
  * // name: "STRING_VALUE", // required
54
- * // type: "string" || "number" || "boolean" || "string_array" || "number_array" || "object", // required
54
+ * // type: "string" || "number" || "boolean" || "string_array" || "number_array", // required
55
55
  * // description: "STRING_VALUE", // required
56
56
  * // required: true || false,
57
57
  * // },
@@ -135,22 +135,11 @@ declare const ListToolsCommand_base: {
135
135
  * // token: "STRING_VALUE", // required
136
136
  * // },
137
137
  * // timeout: Number("int"),
138
- * // tools: [ // ToolMcpToolList // required
139
- * // { // ToolMcpTool
140
- * // name: "STRING_VALUE", // required
141
- * // input: {
142
- * // variables: [ // required
143
- * // {
144
- * // name: "STRING_VALUE", // required
145
- * // type: "string" || "number" || "boolean" || "string_array" || "number_array" || "object", // required
146
- * // description: "STRING_VALUE", // required
147
- * // required: true || false,
148
- * // },
149
- * // ],
150
- * // },
151
- * // params: { // ToolMcpToolParams // required
152
- * // "<keys>": "<ToolStringValue>",
153
- * // },
138
+ * // tools: [ // ToolMcpToolConfigList
139
+ * // { // ToolMcpToolConfig
140
+ * // mcpToolId: "STRING_VALUE", // required
141
+ * // description: "STRING_VALUE",
142
+ * // parameters: "DOCUMENT_VALUE",
154
143
  * // },
155
144
  * // ],
156
145
  * // },
@@ -39,12 +39,12 @@ declare const UpdateToolCommand_base: {
39
39
  * company: "STRING_VALUE",
40
40
  * toolId: "STRING_VALUE", // required
41
41
  * name: "STRING_VALUE", // required
42
- * description: "STRING_VALUE", // required
42
+ * description: "STRING_VALUE",
43
43
  * input: { // ToolInput
44
44
  * variables: [ // ToolVariableList // required
45
45
  * { // ToolVariable
46
46
  * name: "STRING_VALUE", // required
47
- * type: "string" || "number" || "boolean" || "string_array" || "number_array" || "object", // required
47
+ * type: "string" || "number" || "boolean" || "string_array" || "number_array", // required
48
48
  * description: "STRING_VALUE", // required
49
49
  * required: true || false,
50
50
  * },
@@ -128,22 +128,11 @@ declare const UpdateToolCommand_base: {
128
128
  * token: "STRING_VALUE", // required
129
129
  * },
130
130
  * timeout: Number("int"),
131
- * tools: [ // ToolMcpToolList // required
132
- * { // ToolMcpTool
133
- * name: "STRING_VALUE", // required
134
- * input: {
135
- * variables: [ // required
136
- * {
137
- * name: "STRING_VALUE", // required
138
- * type: "string" || "number" || "boolean" || "string_array" || "number_array" || "object", // required
139
- * description: "STRING_VALUE", // required
140
- * required: true || false,
141
- * },
142
- * ],
143
- * },
144
- * params: { // ToolMcpToolParams // required
145
- * "<keys>": "<ToolStringValue>",
146
- * },
131
+ * tools: [ // ToolMcpToolConfigList
132
+ * { // ToolMcpToolConfig
133
+ * mcpToolId: "STRING_VALUE", // required
134
+ * description: "STRING_VALUE",
135
+ * parameters: "DOCUMENT_VALUE",
147
136
  * },
148
137
  * ],
149
138
  * },
@@ -161,7 +150,7 @@ declare const UpdateToolCommand_base: {
161
150
  * // variables: [ // ToolVariableList // required
162
151
  * // { // ToolVariable
163
152
  * // name: "STRING_VALUE", // required
164
- * // type: "string" || "number" || "boolean" || "string_array" || "number_array" || "object", // required
153
+ * // type: "string" || "number" || "boolean" || "string_array" || "number_array", // required
165
154
  * // description: "STRING_VALUE", // required
166
155
  * // required: true || false,
167
156
  * // },
@@ -245,22 +234,11 @@ declare const UpdateToolCommand_base: {
245
234
  * // token: "STRING_VALUE", // required
246
235
  * // },
247
236
  * // timeout: Number("int"),
248
- * // tools: [ // ToolMcpToolList // required
249
- * // { // ToolMcpTool
250
- * // name: "STRING_VALUE", // required
251
- * // input: {
252
- * // variables: [ // required
253
- * // {
254
- * // name: "STRING_VALUE", // required
255
- * // type: "string" || "number" || "boolean" || "string_array" || "number_array" || "object", // required
256
- * // description: "STRING_VALUE", // required
257
- * // required: true || false,
258
- * // },
259
- * // ],
260
- * // },
261
- * // params: { // ToolMcpToolParams // required
262
- * // "<keys>": "<ToolStringValue>",
263
- * // },
237
+ * // tools: [ // ToolMcpToolConfigList
238
+ * // { // ToolMcpToolConfig
239
+ * // mcpToolId: "STRING_VALUE", // required
240
+ * // description: "STRING_VALUE",
241
+ * // parameters: "DOCUMENT_VALUE",
264
242
  * // },
265
243
  * // ],
266
244
  * // },
@@ -211,44 +211,21 @@ export interface ToolAuthentication {
211
211
  type: ToolAuthorizationType;
212
212
  token: string;
213
213
  }
214
- /**
215
- * @public
216
- * @enum
217
- */
218
- export declare const ToolVariableType: {
219
- readonly BOOLEAN: "boolean";
220
- readonly NUMBER: "number";
221
- readonly NUMBER_ARRAY: "number_array";
222
- readonly OBJECT: "object";
223
- readonly STRING: "string";
224
- readonly STRING_ARRAY: "string_array";
225
- };
226
- /**
227
- * @public
228
- */
229
- export type ToolVariableType = typeof ToolVariableType[keyof typeof ToolVariableType];
230
- /**
231
- * @public
232
- */
233
- export interface ToolVariable {
234
- name: string;
235
- type: ToolVariableType;
236
- description: string;
237
- required?: boolean | undefined;
238
- }
239
214
  /**
240
215
  * @public
241
216
  */
242
- export interface ToolInput {
243
- variables: (ToolVariable)[];
244
- }
245
- /**
246
- * @public
247
- */
248
- export interface ToolMcpTool {
249
- name: string;
250
- input: ToolInput;
251
- params: Record<string, ToolStringValue>;
217
+ export interface ToolMcpToolConfig {
218
+ mcpToolId: string;
219
+ /**
220
+ * Optional description override for the tool
221
+ * @public
222
+ */
223
+ description?: string | undefined;
224
+ /**
225
+ * Parameter mappings for the MCP tool
226
+ * @public
227
+ */
228
+ parameters?: __DocumentType | undefined;
252
229
  }
253
230
  /**
254
231
  * @public
@@ -271,7 +248,11 @@ export interface ToolMcpHandler {
271
248
  transport: ToolMcpTransport;
272
249
  authentication?: ToolAuthentication | undefined;
273
250
  timeout?: number | undefined;
274
- tools: (ToolMcpTool)[];
251
+ /**
252
+ * List of MCP tools to expose from this server
253
+ * @public
254
+ */
255
+ tools?: (ToolMcpToolConfig)[] | undefined;
275
256
  }
276
257
  /**
277
258
  * @public
@@ -361,13 +342,43 @@ export declare namespace ToolHandler {
361
342
  }
362
343
  const visit: <T>(value: ToolHandler, visitor: Visitor<T>) => T;
363
344
  }
345
+ /**
346
+ * @public
347
+ * @enum
348
+ */
349
+ export declare const ToolVariableType: {
350
+ readonly BOOLEAN: "boolean";
351
+ readonly NUMBER: "number";
352
+ readonly NUMBER_ARRAY: "number_array";
353
+ readonly STRING: "string";
354
+ readonly STRING_ARRAY: "string_array";
355
+ };
356
+ /**
357
+ * @public
358
+ */
359
+ export type ToolVariableType = typeof ToolVariableType[keyof typeof ToolVariableType];
360
+ /**
361
+ * @public
362
+ */
363
+ export interface ToolVariable {
364
+ name: string;
365
+ type: ToolVariableType;
366
+ description: string;
367
+ required?: boolean | undefined;
368
+ }
369
+ /**
370
+ * @public
371
+ */
372
+ export interface ToolInput {
373
+ variables: (ToolVariable)[];
374
+ }
364
375
  /**
365
376
  * @public
366
377
  */
367
378
  export interface CreateToolInput {
368
379
  company?: string | undefined;
369
380
  name: string;
370
- description: string;
381
+ description?: string | undefined;
371
382
  input: ToolInput;
372
383
  handler: ToolHandler;
373
384
  }
@@ -494,7 +505,7 @@ export interface UpdateToolInput {
494
505
  company?: string | undefined;
495
506
  toolId: string;
496
507
  name: string;
497
- description: string;
508
+ description?: string | undefined;
498
509
  input: ToolInput;
499
510
  handler: ToolHandler;
500
511
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@wildix/wim-tools-client",
3
3
  "description": "@wildix/wim-tools-client client",
4
- "version": "0.0.11",
4
+ "version": "0.0.12",
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",