@wildix/wim-tools-client 0.0.17 → 0.0.18
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.
- package/dist-cjs/models/models_0.js +18 -31
- package/dist-cjs/protocols/Aws_restJson1.js +30 -110
- package/dist-es/models/models_0.js +16 -30
- package/dist-es/protocols/Aws_restJson1.js +32 -112
- package/dist-types/commands/CreateToolCommand.d.ts +16 -98
- package/dist-types/commands/DeleteToolCommand.d.ts +6 -4
- package/dist-types/commands/DescribeToolsCommand.d.ts +6 -5
- package/dist-types/commands/ExecuteToolCommand.d.ts +6 -4
- package/dist-types/commands/GetToolCommand.d.ts +11 -51
- package/dist-types/commands/ListToolsCommand.d.ts +11 -51
- package/dist-types/commands/UpdateToolCommand.d.ts +16 -98
- package/dist-types/models/models_0.d.ts +317 -189
- package/dist-types/runtimeConfig.browser.d.ts +6 -1
- package/dist-types/runtimeConfig.d.ts +6 -1
- package/dist-types/runtimeConfig.native.d.ts +6 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.ToolExecutionServerException = exports.ToolExecutionException = exports.ToolVariableType = exports.ToolHandler = exports.ToolEmailHandler = exports.ToolStringValue = exports.ValidationException = exports.NotFoundException = exports.AlreadyExistException = void 0;
|
|
4
4
|
const ToolsServiceException_1 = require("./ToolsServiceException");
|
|
5
5
|
class AlreadyExistException extends ToolsServiceException_1.ToolsServiceException {
|
|
6
6
|
name = "AlreadyExistException";
|
|
@@ -53,16 +53,6 @@ var ToolStringValue;
|
|
|
53
53
|
return visitor._(value.$unknown[0], value.$unknown[1]);
|
|
54
54
|
};
|
|
55
55
|
})(ToolStringValue || (exports.ToolStringValue = ToolStringValue = {}));
|
|
56
|
-
var ToolChatHandler;
|
|
57
|
-
(function (ToolChatHandler) {
|
|
58
|
-
ToolChatHandler.visit = (value, visitor) => {
|
|
59
|
-
if (value.direct !== undefined)
|
|
60
|
-
return visitor.direct(value.direct);
|
|
61
|
-
if (value.channel !== undefined)
|
|
62
|
-
return visitor.channel(value.channel);
|
|
63
|
-
return visitor._(value.$unknown[0], value.$unknown[1]);
|
|
64
|
-
};
|
|
65
|
-
})(ToolChatHandler || (exports.ToolChatHandler = ToolChatHandler = {}));
|
|
66
56
|
var ToolEmailHandler;
|
|
67
57
|
(function (ToolEmailHandler) {
|
|
68
58
|
ToolEmailHandler.visit = (value, visitor) => {
|
|
@@ -73,29 +63,11 @@ var ToolEmailHandler;
|
|
|
73
63
|
return visitor._(value.$unknown[0], value.$unknown[1]);
|
|
74
64
|
};
|
|
75
65
|
})(ToolEmailHandler || (exports.ToolEmailHandler = ToolEmailHandler = {}));
|
|
76
|
-
exports.ToolAuthorizationType = {
|
|
77
|
-
API_KEY: "ApiKey",
|
|
78
|
-
BASIC: "Basic",
|
|
79
|
-
BEARER: "Bearer",
|
|
80
|
-
};
|
|
81
|
-
exports.ToolMcpTransport = {
|
|
82
|
-
HTTP: "http",
|
|
83
|
-
SSE: "sse",
|
|
84
|
-
STDIO: "stdio",
|
|
85
|
-
};
|
|
86
66
|
var ToolHandler;
|
|
87
67
|
(function (ToolHandler) {
|
|
88
68
|
ToolHandler.visit = (value, visitor) => {
|
|
89
69
|
if (value.email !== undefined)
|
|
90
70
|
return visitor.email(value.email);
|
|
91
|
-
if (value.sms !== undefined)
|
|
92
|
-
return visitor.sms(value.sms);
|
|
93
|
-
if (value.chat !== undefined)
|
|
94
|
-
return visitor.chat(value.chat);
|
|
95
|
-
if (value.webhook !== undefined)
|
|
96
|
-
return visitor.webhook(value.webhook);
|
|
97
|
-
if (value.mcp !== undefined)
|
|
98
|
-
return visitor.mcp(value.mcp);
|
|
99
71
|
return visitor._(value.$unknown[0], value.$unknown[1]);
|
|
100
72
|
};
|
|
101
73
|
})(ToolHandler || (exports.ToolHandler = ToolHandler = {}));
|
|
@@ -108,12 +80,12 @@ exports.ToolVariableType = {
|
|
|
108
80
|
};
|
|
109
81
|
class ToolExecutionException extends ToolsServiceException_1.ToolsServiceException {
|
|
110
82
|
name = "ToolExecutionException";
|
|
111
|
-
$fault = "
|
|
83
|
+
$fault = "client";
|
|
112
84
|
details;
|
|
113
85
|
constructor(opts) {
|
|
114
86
|
super({
|
|
115
87
|
name: "ToolExecutionException",
|
|
116
|
-
$fault: "
|
|
88
|
+
$fault: "client",
|
|
117
89
|
...opts
|
|
118
90
|
});
|
|
119
91
|
Object.setPrototypeOf(this, ToolExecutionException.prototype);
|
|
@@ -121,3 +93,18 @@ class ToolExecutionException extends ToolsServiceException_1.ToolsServiceExcepti
|
|
|
121
93
|
}
|
|
122
94
|
}
|
|
123
95
|
exports.ToolExecutionException = ToolExecutionException;
|
|
96
|
+
class ToolExecutionServerException extends ToolsServiceException_1.ToolsServiceException {
|
|
97
|
+
name = "ToolExecutionServerException";
|
|
98
|
+
$fault = "server";
|
|
99
|
+
details;
|
|
100
|
+
constructor(opts) {
|
|
101
|
+
super({
|
|
102
|
+
name: "ToolExecutionServerException",
|
|
103
|
+
$fault: "server",
|
|
104
|
+
...opts
|
|
105
|
+
});
|
|
106
|
+
Object.setPrototypeOf(this, ToolExecutionServerException.prototype);
|
|
107
|
+
this.details = opts.details;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
exports.ToolExecutionServerException = ToolExecutionServerException;
|
|
@@ -13,13 +13,13 @@ const se_CreateToolCommand = async (input, context) => {
|
|
|
13
13
|
};
|
|
14
14
|
b.bp("/v1/tools");
|
|
15
15
|
const query = (0, smithy_client_1.map)({
|
|
16
|
-
[_c]: [, input[
|
|
16
|
+
[_c]: [, input[_cI]],
|
|
17
17
|
});
|
|
18
18
|
let body;
|
|
19
19
|
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
20
20
|
'category': [],
|
|
21
21
|
'description': [],
|
|
22
|
-
'handler': _ =>
|
|
22
|
+
'handler': _ => (0, smithy_client_1._json)(_),
|
|
23
23
|
'input': _ => (0, smithy_client_1._json)(_),
|
|
24
24
|
'name': [],
|
|
25
25
|
}));
|
|
@@ -36,7 +36,7 @@ const se_DeleteToolCommand = async (input, context) => {
|
|
|
36
36
|
b.bp("/v1/tools/{toolId}");
|
|
37
37
|
b.p('toolId', () => input.toolId, '{toolId}', false);
|
|
38
38
|
const query = (0, smithy_client_1.map)({
|
|
39
|
-
[_c]: [, input[
|
|
39
|
+
[_c]: [, input[_cI]],
|
|
40
40
|
});
|
|
41
41
|
let body;
|
|
42
42
|
b.m("DELETE")
|
|
@@ -53,7 +53,7 @@ const se_DescribeToolsCommand = async (input, context) => {
|
|
|
53
53
|
};
|
|
54
54
|
b.bp("/v1/tools/describe");
|
|
55
55
|
const query = (0, smithy_client_1.map)({
|
|
56
|
-
[_c]: [, input[
|
|
56
|
+
[_c]: [, input[_cI]],
|
|
57
57
|
});
|
|
58
58
|
let body;
|
|
59
59
|
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
@@ -73,7 +73,7 @@ const se_ExecuteToolCommand = async (input, context) => {
|
|
|
73
73
|
};
|
|
74
74
|
b.bp("/v1/tools/execute");
|
|
75
75
|
const query = (0, smithy_client_1.map)({
|
|
76
|
-
[_c]: [, input[
|
|
76
|
+
[_c]: [, input[_cI]],
|
|
77
77
|
});
|
|
78
78
|
let body;
|
|
79
79
|
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
@@ -95,7 +95,7 @@ const se_GetToolCommand = async (input, context) => {
|
|
|
95
95
|
b.bp("/v1/tools/{toolId}");
|
|
96
96
|
b.p('toolId', () => input.toolId, '{toolId}', false);
|
|
97
97
|
const query = (0, smithy_client_1.map)({
|
|
98
|
-
[_c]: [, input[
|
|
98
|
+
[_c]: [, input[_cI]],
|
|
99
99
|
});
|
|
100
100
|
let body;
|
|
101
101
|
b.m("GET")
|
|
@@ -110,7 +110,7 @@ const se_ListToolsCommand = async (input, context) => {
|
|
|
110
110
|
const headers = {};
|
|
111
111
|
b.bp("/v1/tools");
|
|
112
112
|
const query = (0, smithy_client_1.map)({
|
|
113
|
-
[_c]: [, input[
|
|
113
|
+
[_c]: [, input[_cI]],
|
|
114
114
|
});
|
|
115
115
|
let body;
|
|
116
116
|
b.m("GET")
|
|
@@ -128,13 +128,13 @@ const se_UpdateToolCommand = async (input, context) => {
|
|
|
128
128
|
b.bp("/v1/tools/{toolId}");
|
|
129
129
|
b.p('toolId', () => input.toolId, '{toolId}', false);
|
|
130
130
|
const query = (0, smithy_client_1.map)({
|
|
131
|
-
[_c]: [, input[
|
|
131
|
+
[_c]: [, input[_cI]],
|
|
132
132
|
});
|
|
133
133
|
let body;
|
|
134
134
|
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
135
135
|
'category': [],
|
|
136
136
|
'description': [],
|
|
137
|
-
'handler': _ =>
|
|
137
|
+
'handler': _ => (0, smithy_client_1._json)(_),
|
|
138
138
|
'input': _ => (0, smithy_client_1._json)(_),
|
|
139
139
|
'name': [],
|
|
140
140
|
}));
|
|
@@ -154,7 +154,7 @@ const de_CreateToolCommand = async (output, context) => {
|
|
|
154
154
|
});
|
|
155
155
|
const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
|
|
156
156
|
const doc = (0, smithy_client_1.take)(data, {
|
|
157
|
-
'tool':
|
|
157
|
+
'tool': smithy_client_1._json,
|
|
158
158
|
});
|
|
159
159
|
Object.assign(contents, doc);
|
|
160
160
|
return contents;
|
|
@@ -210,7 +210,7 @@ const de_GetToolCommand = async (output, context) => {
|
|
|
210
210
|
});
|
|
211
211
|
const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
|
|
212
212
|
const doc = (0, smithy_client_1.take)(data, {
|
|
213
|
-
'tool':
|
|
213
|
+
'tool': smithy_client_1._json,
|
|
214
214
|
});
|
|
215
215
|
Object.assign(contents, doc);
|
|
216
216
|
return contents;
|
|
@@ -225,7 +225,7 @@ const de_ListToolsCommand = async (output, context) => {
|
|
|
225
225
|
});
|
|
226
226
|
const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
|
|
227
227
|
const doc = (0, smithy_client_1.take)(data, {
|
|
228
|
-
'tools':
|
|
228
|
+
'tools': smithy_client_1._json,
|
|
229
229
|
});
|
|
230
230
|
Object.assign(contents, doc);
|
|
231
231
|
return contents;
|
|
@@ -240,7 +240,7 @@ const de_UpdateToolCommand = async (output, context) => {
|
|
|
240
240
|
});
|
|
241
241
|
const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
|
|
242
242
|
const doc = (0, smithy_client_1.take)(data, {
|
|
243
|
-
'tool':
|
|
243
|
+
'tool': smithy_client_1._json,
|
|
244
244
|
});
|
|
245
245
|
Object.assign(contents, doc);
|
|
246
246
|
return contents;
|
|
@@ -262,6 +262,9 @@ const de_CommandError = async (output, context) => {
|
|
|
262
262
|
case "ToolExecutionException":
|
|
263
263
|
case "wildix.wim.tools#ToolExecutionException":
|
|
264
264
|
throw await de_ToolExecutionExceptionRes(parsedOutput, context);
|
|
265
|
+
case "ToolExecutionServerException":
|
|
266
|
+
case "wildix.wim.tools#ToolExecutionServerException":
|
|
267
|
+
throw await de_ToolExecutionServerExceptionRes(parsedOutput, context);
|
|
265
268
|
case "ValidationException":
|
|
266
269
|
case "smithy.framework#ValidationException":
|
|
267
270
|
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
@@ -328,54 +331,26 @@ const de_ToolExecutionExceptionRes = async (parsedOutput, context) => {
|
|
|
328
331
|
});
|
|
329
332
|
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
330
333
|
};
|
|
331
|
-
const
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
const
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
email: value => ({ "email": (0, smithy_client_1._json)(value) }),
|
|
338
|
-
mcp: value => ({ "mcp": se_ToolMcpHandler(value, context) }),
|
|
339
|
-
sms: value => ({ "sms": (0, smithy_client_1._json)(value) }),
|
|
340
|
-
webhook: value => ({ "webhook": (0, smithy_client_1._json)(value) }),
|
|
341
|
-
_: (name, value) => ({ [name]: value })
|
|
342
|
-
});
|
|
343
|
-
};
|
|
344
|
-
const se_ToolMcpHandler = (input, context) => {
|
|
345
|
-
return (0, smithy_client_1.take)(input, {
|
|
346
|
-
'authentication': smithy_client_1._json,
|
|
347
|
-
'serverUrl': [],
|
|
348
|
-
'timeout': [],
|
|
349
|
-
'tools': _ => se_ToolMcpToolConfigList(_, context),
|
|
350
|
-
'transport': [],
|
|
334
|
+
const de_ToolExecutionServerExceptionRes = async (parsedOutput, context) => {
|
|
335
|
+
const contents = (0, smithy_client_1.map)({});
|
|
336
|
+
const data = parsedOutput.body;
|
|
337
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
338
|
+
'details': _ => de_Document(_, context),
|
|
339
|
+
'message': smithy_client_1.expectString,
|
|
351
340
|
});
|
|
352
|
-
|
|
353
|
-
const
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
'mcpToolId': [],
|
|
357
|
-
'parameters': _ => se_Document(_, context),
|
|
341
|
+
Object.assign(contents, doc);
|
|
342
|
+
const exception = new models_0_1.ToolExecutionServerException({
|
|
343
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
344
|
+
...contents
|
|
358
345
|
});
|
|
346
|
+
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
359
347
|
};
|
|
360
|
-
const
|
|
361
|
-
return input
|
|
362
|
-
return se_ToolMcpToolConfig(entry, context);
|
|
363
|
-
});
|
|
348
|
+
const se_Document = (input, context) => {
|
|
349
|
+
return input;
|
|
364
350
|
};
|
|
365
351
|
const de_Document = (output, context) => {
|
|
366
352
|
return output;
|
|
367
353
|
};
|
|
368
|
-
const de_Tool = (output, context) => {
|
|
369
|
-
return (0, smithy_client_1.take)(output, {
|
|
370
|
-
'category': smithy_client_1.expectString,
|
|
371
|
-
'company': smithy_client_1.expectString,
|
|
372
|
-
'description': smithy_client_1.expectString,
|
|
373
|
-
'handler': (_) => de_ToolHandler((0, core_1.awsExpectUnion)(_), context),
|
|
374
|
-
'id': smithy_client_1.expectString,
|
|
375
|
-
'input': smithy_client_1._json,
|
|
376
|
-
'name': smithy_client_1.expectString,
|
|
377
|
-
});
|
|
378
|
-
};
|
|
379
354
|
const de_ToolExecutionResult = (output, context) => {
|
|
380
355
|
return (0, smithy_client_1.take)(output, {
|
|
381
356
|
'error': smithy_client_1._json,
|
|
@@ -383,62 +358,6 @@ const de_ToolExecutionResult = (output, context) => {
|
|
|
383
358
|
'statusCode': smithy_client_1.expectInt32,
|
|
384
359
|
});
|
|
385
360
|
};
|
|
386
|
-
const de_ToolHandler = (output, context) => {
|
|
387
|
-
if (output.chat != null) {
|
|
388
|
-
return {
|
|
389
|
-
chat: (0, smithy_client_1._json)((0, core_1.awsExpectUnion)(output.chat))
|
|
390
|
-
};
|
|
391
|
-
}
|
|
392
|
-
if (output.email != null) {
|
|
393
|
-
return {
|
|
394
|
-
email: (0, smithy_client_1._json)((0, core_1.awsExpectUnion)(output.email))
|
|
395
|
-
};
|
|
396
|
-
}
|
|
397
|
-
if (output.mcp != null) {
|
|
398
|
-
return {
|
|
399
|
-
mcp: de_ToolMcpHandler(output.mcp, context)
|
|
400
|
-
};
|
|
401
|
-
}
|
|
402
|
-
if (output.sms != null) {
|
|
403
|
-
return {
|
|
404
|
-
sms: (0, smithy_client_1._json)(output.sms)
|
|
405
|
-
};
|
|
406
|
-
}
|
|
407
|
-
if (output.webhook != null) {
|
|
408
|
-
return {
|
|
409
|
-
webhook: (0, smithy_client_1._json)(output.webhook)
|
|
410
|
-
};
|
|
411
|
-
}
|
|
412
|
-
return { $unknown: Object.entries(output)[0] };
|
|
413
|
-
};
|
|
414
|
-
const de_ToolMcpHandler = (output, context) => {
|
|
415
|
-
return (0, smithy_client_1.take)(output, {
|
|
416
|
-
'authentication': smithy_client_1._json,
|
|
417
|
-
'serverUrl': smithy_client_1.expectString,
|
|
418
|
-
'timeout': smithy_client_1.expectInt32,
|
|
419
|
-
'tools': (_) => de_ToolMcpToolConfigList(_, context),
|
|
420
|
-
'transport': smithy_client_1.expectString,
|
|
421
|
-
});
|
|
422
|
-
};
|
|
423
|
-
const de_ToolMcpToolConfig = (output, context) => {
|
|
424
|
-
return (0, smithy_client_1.take)(output, {
|
|
425
|
-
'description': smithy_client_1.expectString,
|
|
426
|
-
'mcpToolId': smithy_client_1.expectString,
|
|
427
|
-
'parameters': (_) => de_Document(_, context),
|
|
428
|
-
});
|
|
429
|
-
};
|
|
430
|
-
const de_ToolMcpToolConfigList = (output, context) => {
|
|
431
|
-
const retVal = (output || []).filter((e) => e != null).map((entry) => {
|
|
432
|
-
return de_ToolMcpToolConfig(entry, context);
|
|
433
|
-
});
|
|
434
|
-
return retVal;
|
|
435
|
-
};
|
|
436
|
-
const de_ToolsList = (output, context) => {
|
|
437
|
-
const retVal = (output || []).filter((e) => e != null).map((entry) => {
|
|
438
|
-
return de_Tool(entry, context);
|
|
439
|
-
});
|
|
440
|
-
return retVal;
|
|
441
|
-
};
|
|
442
361
|
const deserializeMetadata = (output) => ({
|
|
443
362
|
httpStatusCode: output.statusCode,
|
|
444
363
|
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
|
|
@@ -447,3 +366,4 @@ const deserializeMetadata = (output) => ({
|
|
|
447
366
|
});
|
|
448
367
|
const collectBodyString = (streamBody, context) => (0, smithy_client_1.collectBody)(streamBody, context).then(body => context.utf8Encoder(body));
|
|
449
368
|
const _c = "company";
|
|
369
|
+
const _cI = "companyId";
|
|
@@ -47,16 +47,6 @@ export var ToolStringValue;
|
|
|
47
47
|
return visitor._(value.$unknown[0], value.$unknown[1]);
|
|
48
48
|
};
|
|
49
49
|
})(ToolStringValue || (ToolStringValue = {}));
|
|
50
|
-
export var ToolChatHandler;
|
|
51
|
-
(function (ToolChatHandler) {
|
|
52
|
-
ToolChatHandler.visit = (value, visitor) => {
|
|
53
|
-
if (value.direct !== undefined)
|
|
54
|
-
return visitor.direct(value.direct);
|
|
55
|
-
if (value.channel !== undefined)
|
|
56
|
-
return visitor.channel(value.channel);
|
|
57
|
-
return visitor._(value.$unknown[0], value.$unknown[1]);
|
|
58
|
-
};
|
|
59
|
-
})(ToolChatHandler || (ToolChatHandler = {}));
|
|
60
50
|
export var ToolEmailHandler;
|
|
61
51
|
(function (ToolEmailHandler) {
|
|
62
52
|
ToolEmailHandler.visit = (value, visitor) => {
|
|
@@ -67,29 +57,11 @@ export var ToolEmailHandler;
|
|
|
67
57
|
return visitor._(value.$unknown[0], value.$unknown[1]);
|
|
68
58
|
};
|
|
69
59
|
})(ToolEmailHandler || (ToolEmailHandler = {}));
|
|
70
|
-
export const ToolAuthorizationType = {
|
|
71
|
-
API_KEY: "ApiKey",
|
|
72
|
-
BASIC: "Basic",
|
|
73
|
-
BEARER: "Bearer",
|
|
74
|
-
};
|
|
75
|
-
export const ToolMcpTransport = {
|
|
76
|
-
HTTP: "http",
|
|
77
|
-
SSE: "sse",
|
|
78
|
-
STDIO: "stdio",
|
|
79
|
-
};
|
|
80
60
|
export var ToolHandler;
|
|
81
61
|
(function (ToolHandler) {
|
|
82
62
|
ToolHandler.visit = (value, visitor) => {
|
|
83
63
|
if (value.email !== undefined)
|
|
84
64
|
return visitor.email(value.email);
|
|
85
|
-
if (value.sms !== undefined)
|
|
86
|
-
return visitor.sms(value.sms);
|
|
87
|
-
if (value.chat !== undefined)
|
|
88
|
-
return visitor.chat(value.chat);
|
|
89
|
-
if (value.webhook !== undefined)
|
|
90
|
-
return visitor.webhook(value.webhook);
|
|
91
|
-
if (value.mcp !== undefined)
|
|
92
|
-
return visitor.mcp(value.mcp);
|
|
93
65
|
return visitor._(value.$unknown[0], value.$unknown[1]);
|
|
94
66
|
};
|
|
95
67
|
})(ToolHandler || (ToolHandler = {}));
|
|
@@ -102,15 +74,29 @@ export const ToolVariableType = {
|
|
|
102
74
|
};
|
|
103
75
|
export class ToolExecutionException extends __BaseException {
|
|
104
76
|
name = "ToolExecutionException";
|
|
105
|
-
$fault = "
|
|
77
|
+
$fault = "client";
|
|
106
78
|
details;
|
|
107
79
|
constructor(opts) {
|
|
108
80
|
super({
|
|
109
81
|
name: "ToolExecutionException",
|
|
110
|
-
$fault: "
|
|
82
|
+
$fault: "client",
|
|
111
83
|
...opts
|
|
112
84
|
});
|
|
113
85
|
Object.setPrototypeOf(this, ToolExecutionException.prototype);
|
|
114
86
|
this.details = opts.details;
|
|
115
87
|
}
|
|
116
88
|
}
|
|
89
|
+
export class ToolExecutionServerException extends __BaseException {
|
|
90
|
+
name = "ToolExecutionServerException";
|
|
91
|
+
$fault = "server";
|
|
92
|
+
details;
|
|
93
|
+
constructor(opts) {
|
|
94
|
+
super({
|
|
95
|
+
name: "ToolExecutionServerException",
|
|
96
|
+
$fault: "server",
|
|
97
|
+
...opts
|
|
98
|
+
});
|
|
99
|
+
Object.setPrototypeOf(this, ToolExecutionServerException.prototype);
|
|
100
|
+
this.details = opts.details;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ToolsServiceException as __BaseException } from "../models/ToolsServiceException";
|
|
2
|
-
import { AlreadyExistException, NotFoundException, ToolExecutionException,
|
|
3
|
-
import {
|
|
2
|
+
import { AlreadyExistException, NotFoundException, ToolExecutionException, ToolExecutionServerException, ValidationException, } from "../models/models_0";
|
|
3
|
+
import { loadRestJsonErrorCode, parseJsonBody as parseBody, parseJsonErrorBody as parseErrorBody, } from "@aws-sdk/core";
|
|
4
4
|
import { requestBuilder as rb } from "@smithy/core";
|
|
5
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) => {
|
|
@@ -10,13 +10,13 @@ export const se_CreateToolCommand = async (input, context) => {
|
|
|
10
10
|
};
|
|
11
11
|
b.bp("/v1/tools");
|
|
12
12
|
const query = map({
|
|
13
|
-
[_c]: [, input[
|
|
13
|
+
[_c]: [, input[_cI]],
|
|
14
14
|
});
|
|
15
15
|
let body;
|
|
16
16
|
body = JSON.stringify(take(input, {
|
|
17
17
|
'category': [],
|
|
18
18
|
'description': [],
|
|
19
|
-
'handler': _ =>
|
|
19
|
+
'handler': _ => _json(_),
|
|
20
20
|
'input': _ => _json(_),
|
|
21
21
|
'name': [],
|
|
22
22
|
}));
|
|
@@ -32,7 +32,7 @@ export const se_DeleteToolCommand = async (input, context) => {
|
|
|
32
32
|
b.bp("/v1/tools/{toolId}");
|
|
33
33
|
b.p('toolId', () => input.toolId, '{toolId}', false);
|
|
34
34
|
const query = map({
|
|
35
|
-
[_c]: [, input[
|
|
35
|
+
[_c]: [, input[_cI]],
|
|
36
36
|
});
|
|
37
37
|
let body;
|
|
38
38
|
b.m("DELETE")
|
|
@@ -48,7 +48,7 @@ export const se_DescribeToolsCommand = async (input, context) => {
|
|
|
48
48
|
};
|
|
49
49
|
b.bp("/v1/tools/describe");
|
|
50
50
|
const query = map({
|
|
51
|
-
[_c]: [, input[
|
|
51
|
+
[_c]: [, input[_cI]],
|
|
52
52
|
});
|
|
53
53
|
let body;
|
|
54
54
|
body = JSON.stringify(take(input, {
|
|
@@ -67,7 +67,7 @@ export const se_ExecuteToolCommand = async (input, context) => {
|
|
|
67
67
|
};
|
|
68
68
|
b.bp("/v1/tools/execute");
|
|
69
69
|
const query = map({
|
|
70
|
-
[_c]: [, input[
|
|
70
|
+
[_c]: [, input[_cI]],
|
|
71
71
|
});
|
|
72
72
|
let body;
|
|
73
73
|
body = JSON.stringify(take(input, {
|
|
@@ -88,7 +88,7 @@ export const se_GetToolCommand = async (input, context) => {
|
|
|
88
88
|
b.bp("/v1/tools/{toolId}");
|
|
89
89
|
b.p('toolId', () => input.toolId, '{toolId}', false);
|
|
90
90
|
const query = map({
|
|
91
|
-
[_c]: [, input[
|
|
91
|
+
[_c]: [, input[_cI]],
|
|
92
92
|
});
|
|
93
93
|
let body;
|
|
94
94
|
b.m("GET")
|
|
@@ -102,7 +102,7 @@ export const se_ListToolsCommand = async (input, context) => {
|
|
|
102
102
|
const headers = {};
|
|
103
103
|
b.bp("/v1/tools");
|
|
104
104
|
const query = map({
|
|
105
|
-
[_c]: [, input[
|
|
105
|
+
[_c]: [, input[_cI]],
|
|
106
106
|
});
|
|
107
107
|
let body;
|
|
108
108
|
b.m("GET")
|
|
@@ -119,13 +119,13 @@ export const se_UpdateToolCommand = async (input, context) => {
|
|
|
119
119
|
b.bp("/v1/tools/{toolId}");
|
|
120
120
|
b.p('toolId', () => input.toolId, '{toolId}', false);
|
|
121
121
|
const query = map({
|
|
122
|
-
[_c]: [, input[
|
|
122
|
+
[_c]: [, input[_cI]],
|
|
123
123
|
});
|
|
124
124
|
let body;
|
|
125
125
|
body = JSON.stringify(take(input, {
|
|
126
126
|
'category': [],
|
|
127
127
|
'description': [],
|
|
128
|
-
'handler': _ =>
|
|
128
|
+
'handler': _ => _json(_),
|
|
129
129
|
'input': _ => _json(_),
|
|
130
130
|
'name': [],
|
|
131
131
|
}));
|
|
@@ -144,7 +144,7 @@ export const de_CreateToolCommand = async (output, context) => {
|
|
|
144
144
|
});
|
|
145
145
|
const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
|
|
146
146
|
const doc = take(data, {
|
|
147
|
-
'tool':
|
|
147
|
+
'tool': _json,
|
|
148
148
|
});
|
|
149
149
|
Object.assign(contents, doc);
|
|
150
150
|
return contents;
|
|
@@ -196,7 +196,7 @@ export const de_GetToolCommand = async (output, context) => {
|
|
|
196
196
|
});
|
|
197
197
|
const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
|
|
198
198
|
const doc = take(data, {
|
|
199
|
-
'tool':
|
|
199
|
+
'tool': _json,
|
|
200
200
|
});
|
|
201
201
|
Object.assign(contents, doc);
|
|
202
202
|
return contents;
|
|
@@ -210,7 +210,7 @@ export const de_ListToolsCommand = async (output, context) => {
|
|
|
210
210
|
});
|
|
211
211
|
const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
|
|
212
212
|
const doc = take(data, {
|
|
213
|
-
'tools':
|
|
213
|
+
'tools': _json,
|
|
214
214
|
});
|
|
215
215
|
Object.assign(contents, doc);
|
|
216
216
|
return contents;
|
|
@@ -224,7 +224,7 @@ export const de_UpdateToolCommand = async (output, context) => {
|
|
|
224
224
|
});
|
|
225
225
|
const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
|
|
226
226
|
const doc = take(data, {
|
|
227
|
-
'tool':
|
|
227
|
+
'tool': _json,
|
|
228
228
|
});
|
|
229
229
|
Object.assign(contents, doc);
|
|
230
230
|
return contents;
|
|
@@ -245,6 +245,9 @@ const de_CommandError = async (output, context) => {
|
|
|
245
245
|
case "ToolExecutionException":
|
|
246
246
|
case "wildix.wim.tools#ToolExecutionException":
|
|
247
247
|
throw await de_ToolExecutionExceptionRes(parsedOutput, context);
|
|
248
|
+
case "ToolExecutionServerException":
|
|
249
|
+
case "wildix.wim.tools#ToolExecutionServerException":
|
|
250
|
+
throw await de_ToolExecutionServerExceptionRes(parsedOutput, context);
|
|
248
251
|
case "ValidationException":
|
|
249
252
|
case "smithy.framework#ValidationException":
|
|
250
253
|
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
@@ -311,54 +314,26 @@ const de_ToolExecutionExceptionRes = async (parsedOutput, context) => {
|
|
|
311
314
|
});
|
|
312
315
|
return __decorateServiceException(exception, parsedOutput.body);
|
|
313
316
|
};
|
|
314
|
-
const
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
const
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
email: value => ({ "email": _json(value) }),
|
|
321
|
-
mcp: value => ({ "mcp": se_ToolMcpHandler(value, context) }),
|
|
322
|
-
sms: value => ({ "sms": _json(value) }),
|
|
323
|
-
webhook: value => ({ "webhook": _json(value) }),
|
|
324
|
-
_: (name, value) => ({ [name]: value })
|
|
325
|
-
});
|
|
326
|
-
};
|
|
327
|
-
const se_ToolMcpHandler = (input, context) => {
|
|
328
|
-
return take(input, {
|
|
329
|
-
'authentication': _json,
|
|
330
|
-
'serverUrl': [],
|
|
331
|
-
'timeout': [],
|
|
332
|
-
'tools': _ => se_ToolMcpToolConfigList(_, context),
|
|
333
|
-
'transport': [],
|
|
317
|
+
const de_ToolExecutionServerExceptionRes = async (parsedOutput, context) => {
|
|
318
|
+
const contents = map({});
|
|
319
|
+
const data = parsedOutput.body;
|
|
320
|
+
const doc = take(data, {
|
|
321
|
+
'details': _ => de_Document(_, context),
|
|
322
|
+
'message': __expectString,
|
|
334
323
|
});
|
|
335
|
-
|
|
336
|
-
const
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
'mcpToolId': [],
|
|
340
|
-
'parameters': _ => se_Document(_, context),
|
|
324
|
+
Object.assign(contents, doc);
|
|
325
|
+
const exception = new ToolExecutionServerException({
|
|
326
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
327
|
+
...contents
|
|
341
328
|
});
|
|
329
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
342
330
|
};
|
|
343
|
-
const
|
|
344
|
-
return input
|
|
345
|
-
return se_ToolMcpToolConfig(entry, context);
|
|
346
|
-
});
|
|
331
|
+
const se_Document = (input, context) => {
|
|
332
|
+
return input;
|
|
347
333
|
};
|
|
348
334
|
const de_Document = (output, context) => {
|
|
349
335
|
return output;
|
|
350
336
|
};
|
|
351
|
-
const de_Tool = (output, context) => {
|
|
352
|
-
return take(output, {
|
|
353
|
-
'category': __expectString,
|
|
354
|
-
'company': __expectString,
|
|
355
|
-
'description': __expectString,
|
|
356
|
-
'handler': (_) => de_ToolHandler(__expectUnion(_), context),
|
|
357
|
-
'id': __expectString,
|
|
358
|
-
'input': _json,
|
|
359
|
-
'name': __expectString,
|
|
360
|
-
});
|
|
361
|
-
};
|
|
362
337
|
const de_ToolExecutionResult = (output, context) => {
|
|
363
338
|
return take(output, {
|
|
364
339
|
'error': _json,
|
|
@@ -366,62 +341,6 @@ const de_ToolExecutionResult = (output, context) => {
|
|
|
366
341
|
'statusCode': __expectInt32,
|
|
367
342
|
});
|
|
368
343
|
};
|
|
369
|
-
const de_ToolHandler = (output, context) => {
|
|
370
|
-
if (output.chat != null) {
|
|
371
|
-
return {
|
|
372
|
-
chat: _json(__expectUnion(output.chat))
|
|
373
|
-
};
|
|
374
|
-
}
|
|
375
|
-
if (output.email != null) {
|
|
376
|
-
return {
|
|
377
|
-
email: _json(__expectUnion(output.email))
|
|
378
|
-
};
|
|
379
|
-
}
|
|
380
|
-
if (output.mcp != null) {
|
|
381
|
-
return {
|
|
382
|
-
mcp: de_ToolMcpHandler(output.mcp, context)
|
|
383
|
-
};
|
|
384
|
-
}
|
|
385
|
-
if (output.sms != null) {
|
|
386
|
-
return {
|
|
387
|
-
sms: _json(output.sms)
|
|
388
|
-
};
|
|
389
|
-
}
|
|
390
|
-
if (output.webhook != null) {
|
|
391
|
-
return {
|
|
392
|
-
webhook: _json(output.webhook)
|
|
393
|
-
};
|
|
394
|
-
}
|
|
395
|
-
return { $unknown: Object.entries(output)[0] };
|
|
396
|
-
};
|
|
397
|
-
const de_ToolMcpHandler = (output, context) => {
|
|
398
|
-
return take(output, {
|
|
399
|
-
'authentication': _json,
|
|
400
|
-
'serverUrl': __expectString,
|
|
401
|
-
'timeout': __expectInt32,
|
|
402
|
-
'tools': (_) => de_ToolMcpToolConfigList(_, context),
|
|
403
|
-
'transport': __expectString,
|
|
404
|
-
});
|
|
405
|
-
};
|
|
406
|
-
const de_ToolMcpToolConfig = (output, context) => {
|
|
407
|
-
return take(output, {
|
|
408
|
-
'description': __expectString,
|
|
409
|
-
'mcpToolId': __expectString,
|
|
410
|
-
'parameters': (_) => de_Document(_, context),
|
|
411
|
-
});
|
|
412
|
-
};
|
|
413
|
-
const de_ToolMcpToolConfigList = (output, context) => {
|
|
414
|
-
const retVal = (output || []).filter((e) => e != null).map((entry) => {
|
|
415
|
-
return de_ToolMcpToolConfig(entry, context);
|
|
416
|
-
});
|
|
417
|
-
return retVal;
|
|
418
|
-
};
|
|
419
|
-
const de_ToolsList = (output, context) => {
|
|
420
|
-
const retVal = (output || []).filter((e) => e != null).map((entry) => {
|
|
421
|
-
return de_Tool(entry, context);
|
|
422
|
-
});
|
|
423
|
-
return retVal;
|
|
424
|
-
};
|
|
425
344
|
const deserializeMetadata = (output) => ({
|
|
426
345
|
httpStatusCode: output.statusCode,
|
|
427
346
|
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
|
|
@@ -430,3 +349,4 @@ const deserializeMetadata = (output) => ({
|
|
|
430
349
|
});
|
|
431
350
|
const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then(body => context.utf8Encoder(body));
|
|
432
351
|
const _c = "company";
|
|
352
|
+
const _cI = "companyId";
|