@wildix/wim-tools-client 0.0.8 → 0.0.10
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/Tools.js +4 -2
- package/dist-cjs/ToolsClient.js +14 -13
- package/dist-cjs/commands/{AddToolCommand.js → CreateToolCommand.js} +7 -7
- package/dist-cjs/commands/DescribeToolsCommand.js +21 -0
- package/dist-cjs/commands/index.js +2 -1
- package/dist-cjs/models/models_0.js +85 -22
- package/dist-cjs/protocols/Aws_restJson1.js +70 -84
- package/dist-es/Tools.js +4 -2
- package/dist-es/ToolsClient.js +14 -13
- package/dist-es/commands/{AddToolCommand.js → CreateToolCommand.js} +6 -6
- package/dist-es/commands/DescribeToolsCommand.js +17 -0
- package/dist-es/commands/index.js +2 -1
- package/dist-es/models/models_0.js +82 -19
- package/dist-es/protocols/Aws_restJson1.js +67 -83
- package/dist-types/Tools.d.ts +12 -5
- package/dist-types/ToolsClient.d.ts +10 -7
- package/dist-types/commands/CreateToolCommand.d.ts +303 -0
- package/dist-types/commands/DeleteToolCommand.d.ts +5 -5
- package/dist-types/commands/DescribeToolsCommand.d.ts +97 -0
- package/dist-types/commands/ExecuteToolCommand.d.ts +13 -16
- package/dist-types/commands/GetToolCommand.d.ts +114 -11
- package/dist-types/commands/ListToolsCommand.d.ts +114 -22
- package/dist-types/commands/UpdateToolCommand.d.ts +222 -13
- package/dist-types/commands/index.d.ts +2 -1
- package/dist-types/models/models_0.d.ts +380 -273
- package/dist-types/protocols/Aws_restJson1.d.ts +14 -5
- package/dist-types/runtimeConfig.browser.d.ts +3 -5
- package/dist-types/runtimeConfig.d.ts +3 -5
- package/dist-types/runtimeConfig.native.d.ts +3 -5
- package/package.json +1 -1
- package/dist-types/commands/AddToolCommand.d.ts +0 -98
package/dist-es/ToolsClient.js
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig";
|
|
2
2
|
import { resolveRuntimeExtensions, } from "./runtimeExtensions";
|
|
3
|
-
import { getHostHeaderPlugin, resolveHostHeaderConfig, } from "@aws-sdk/middleware-host-header";
|
|
4
|
-
import { getLoggerPlugin } from "@aws-sdk/middleware-logger";
|
|
5
|
-
import { getRecursionDetectionPlugin } from "@aws-sdk/middleware-recursion-detection";
|
|
6
3
|
import { getUserAgentPlugin, resolveUserAgentConfig, } from "@aws-sdk/middleware-user-agent";
|
|
7
|
-
import { resolveCustomEndpointsConfig, resolveRegionConfig, } from "@smithy/config-resolver";
|
|
8
4
|
import { getContentLengthPlugin } from "@smithy/middleware-content-length";
|
|
9
5
|
import { getRetryPlugin, resolveRetryConfig, } from "@smithy/middleware-retry";
|
|
10
6
|
import { Client as __Client, } from "@smithy/smithy-client";
|
|
7
|
+
import { authorizationMiddleware } from '@wildix/smithy-utils';
|
|
11
8
|
export { __Client };
|
|
12
9
|
export class ToolsClient extends __Client {
|
|
13
10
|
config;
|
|
@@ -16,18 +13,22 @@ export class ToolsClient extends __Client {
|
|
|
16
13
|
super(_config_0);
|
|
17
14
|
this.initConfig = _config_0;
|
|
18
15
|
let _config_1 = resolveUserAgentConfig(_config_0);
|
|
19
|
-
let _config_2 =
|
|
20
|
-
let _config_3 =
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
16
|
+
let _config_2 = resolveRetryConfig(_config_1);
|
|
17
|
+
let _config_3 = resolveRuntimeExtensions(_config_2, configuration?.extensions || []);
|
|
18
|
+
const endpoint = configuration.endpoint || (() => {
|
|
19
|
+
return {
|
|
20
|
+
hostname: ['stable', 'stage'].includes(configuration.env || '') ? `tools.wim-${configuration.env}.wildix.com` : 'tools.wim.wildix.com',
|
|
21
|
+
protocol: "https",
|
|
22
|
+
port: '443',
|
|
23
|
+
path: ''
|
|
24
|
+
};
|
|
25
|
+
});
|
|
26
|
+
const config = { ..._config_3, endpoint };
|
|
27
|
+
this.config = config;
|
|
28
|
+
this.middlewareStack.add(authorizationMiddleware.bind(this, configuration.token), { step: "build" });
|
|
25
29
|
this.middlewareStack.use(getUserAgentPlugin(this.config));
|
|
26
30
|
this.middlewareStack.use(getRetryPlugin(this.config));
|
|
27
31
|
this.middlewareStack.use(getContentLengthPlugin(this.config));
|
|
28
|
-
this.middlewareStack.use(getHostHeaderPlugin(this.config));
|
|
29
|
-
this.middlewareStack.use(getLoggerPlugin(this.config));
|
|
30
|
-
this.middlewareStack.use(getRecursionDetectionPlugin(this.config));
|
|
31
32
|
}
|
|
32
33
|
destroy() {
|
|
33
34
|
super.destroy();
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { de_CreateToolCommand, se_CreateToolCommand, } from "../protocols/Aws_restJson1";
|
|
2
2
|
import { getSerdePlugin } from "@smithy/middleware-serde";
|
|
3
3
|
import { Command as $Command } from "@smithy/smithy-client";
|
|
4
4
|
export { $Command };
|
|
5
|
-
export class
|
|
5
|
+
export class CreateToolCommand extends $Command.classBuilder()
|
|
6
6
|
.m(function (Command, cs, config, o) {
|
|
7
7
|
return [
|
|
8
8
|
getSerdePlugin(config, this.serialize, this.deserialize),
|
|
9
9
|
];
|
|
10
10
|
})
|
|
11
|
-
.s("Tools", "
|
|
12
|
-
.n("ToolsClient", "
|
|
11
|
+
.s("Tools", "CreateTool", {})
|
|
12
|
+
.n("ToolsClient", "CreateToolCommand")
|
|
13
13
|
.f(void 0, void 0)
|
|
14
|
-
.ser(
|
|
15
|
-
.de(
|
|
14
|
+
.ser(se_CreateToolCommand)
|
|
15
|
+
.de(de_CreateToolCommand)
|
|
16
16
|
.build() {
|
|
17
17
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { de_DescribeToolsCommand, se_DescribeToolsCommand, } from "../protocols/Aws_restJson1";
|
|
2
|
+
import { getSerdePlugin } from "@smithy/middleware-serde";
|
|
3
|
+
import { Command as $Command } from "@smithy/smithy-client";
|
|
4
|
+
export { $Command };
|
|
5
|
+
export class DescribeToolsCommand extends $Command.classBuilder()
|
|
6
|
+
.m(function (Command, cs, config, o) {
|
|
7
|
+
return [
|
|
8
|
+
getSerdePlugin(config, this.serialize, this.deserialize),
|
|
9
|
+
];
|
|
10
|
+
})
|
|
11
|
+
.s("Tools", "DescribeTools", {})
|
|
12
|
+
.n("ToolsClient", "DescribeToolsCommand")
|
|
13
|
+
.f(void 0, void 0)
|
|
14
|
+
.ser(se_DescribeToolsCommand)
|
|
15
|
+
.de(de_DescribeToolsCommand)
|
|
16
|
+
.build() {
|
|
17
|
+
}
|
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
import { ToolsServiceException as __BaseException } from "./ToolsServiceException";
|
|
2
|
+
export class NotFoundException extends __BaseException {
|
|
3
|
+
name = "NotFoundException";
|
|
4
|
+
$fault = "client";
|
|
5
|
+
constructor(opts) {
|
|
6
|
+
super({
|
|
7
|
+
name: "NotFoundException",
|
|
8
|
+
$fault: "client",
|
|
9
|
+
...opts
|
|
10
|
+
});
|
|
11
|
+
Object.setPrototypeOf(this, NotFoundException.prototype);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
2
14
|
export class ValidationException extends __BaseException {
|
|
3
15
|
name = "ValidationException";
|
|
4
16
|
$fault = "client";
|
|
@@ -11,21 +23,84 @@ export class ValidationException extends __BaseException {
|
|
|
11
23
|
Object.setPrototypeOf(this, ValidationException.prototype);
|
|
12
24
|
}
|
|
13
25
|
}
|
|
14
|
-
export
|
|
15
|
-
|
|
16
|
-
};
|
|
17
|
-
export class ToolAlreadyExistsException extends __BaseException {
|
|
18
|
-
name = "ToolAlreadyExistsException";
|
|
26
|
+
export class AlreadyExistException extends __BaseException {
|
|
27
|
+
name = "AlreadyExistException";
|
|
19
28
|
$fault = "client";
|
|
20
29
|
constructor(opts) {
|
|
21
30
|
super({
|
|
22
|
-
name: "
|
|
31
|
+
name: "AlreadyExistException",
|
|
23
32
|
$fault: "client",
|
|
24
33
|
...opts
|
|
25
34
|
});
|
|
26
|
-
Object.setPrototypeOf(this,
|
|
35
|
+
Object.setPrototypeOf(this, AlreadyExistException.prototype);
|
|
27
36
|
}
|
|
28
37
|
}
|
|
38
|
+
export var ToolStringValue;
|
|
39
|
+
(function (ToolStringValue) {
|
|
40
|
+
ToolStringValue.visit = (value, visitor) => {
|
|
41
|
+
if (value.static !== undefined)
|
|
42
|
+
return visitor.static(value.static);
|
|
43
|
+
if (value.variable !== undefined)
|
|
44
|
+
return visitor.variable(value.variable);
|
|
45
|
+
if (value.template !== undefined)
|
|
46
|
+
return visitor.template(value.template);
|
|
47
|
+
return visitor._(value.$unknown[0], value.$unknown[1]);
|
|
48
|
+
};
|
|
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
|
+
export var ToolEmailHandler;
|
|
61
|
+
(function (ToolEmailHandler) {
|
|
62
|
+
ToolEmailHandler.visit = (value, visitor) => {
|
|
63
|
+
if (value.wns !== undefined)
|
|
64
|
+
return visitor.wns(value.wns);
|
|
65
|
+
if (value.custom !== undefined)
|
|
66
|
+
return visitor.custom(value.custom);
|
|
67
|
+
return visitor._(value.$unknown[0], value.$unknown[1]);
|
|
68
|
+
};
|
|
69
|
+
})(ToolEmailHandler || (ToolEmailHandler = {}));
|
|
70
|
+
export const ToolAuthorizationType = {
|
|
71
|
+
API_KEY: "ApiKey",
|
|
72
|
+
BASIC: "Basic",
|
|
73
|
+
BEARER: "Bearer",
|
|
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
|
+
export const ToolMcpTransport = {
|
|
84
|
+
HTTP: "http",
|
|
85
|
+
SSE: "sse",
|
|
86
|
+
STDIO: "stdio",
|
|
87
|
+
};
|
|
88
|
+
export var ToolHandler;
|
|
89
|
+
(function (ToolHandler) {
|
|
90
|
+
ToolHandler.visit = (value, visitor) => {
|
|
91
|
+
if (value.email !== undefined)
|
|
92
|
+
return visitor.email(value.email);
|
|
93
|
+
if (value.sms !== undefined)
|
|
94
|
+
return visitor.sms(value.sms);
|
|
95
|
+
if (value.chat !== undefined)
|
|
96
|
+
return visitor.chat(value.chat);
|
|
97
|
+
if (value.webhook !== undefined)
|
|
98
|
+
return visitor.webhook(value.webhook);
|
|
99
|
+
if (value.mcp !== undefined)
|
|
100
|
+
return visitor.mcp(value.mcp);
|
|
101
|
+
return visitor._(value.$unknown[0], value.$unknown[1]);
|
|
102
|
+
};
|
|
103
|
+
})(ToolHandler || (ToolHandler = {}));
|
|
29
104
|
export class ToolExecutionException extends __BaseException {
|
|
30
105
|
name = "ToolExecutionException";
|
|
31
106
|
$fault = "server";
|
|
@@ -40,15 +115,3 @@ export class ToolExecutionException extends __BaseException {
|
|
|
40
115
|
this.details = opts.details;
|
|
41
116
|
}
|
|
42
117
|
}
|
|
43
|
-
export class ToolNotFoundException extends __BaseException {
|
|
44
|
-
name = "ToolNotFoundException";
|
|
45
|
-
$fault = "client";
|
|
46
|
-
constructor(opts) {
|
|
47
|
-
super({
|
|
48
|
-
name: "ToolNotFoundException",
|
|
49
|
-
$fault: "client",
|
|
50
|
-
...opts
|
|
51
|
-
});
|
|
52
|
-
Object.setPrototypeOf(this, ToolNotFoundException.prototype);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ToolsServiceException as __BaseException } from "../models/ToolsServiceException";
|
|
2
|
-
import {
|
|
2
|
+
import { AlreadyExistException, NotFoundException, ToolExecutionException, ValidationException, } from "../models/models_0";
|
|
3
3
|
import { 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,
|
|
6
|
-
export const
|
|
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";
|
|
6
|
+
export const se_CreateToolCommand = async (input, context) => {
|
|
7
7
|
const b = rb(input, context);
|
|
8
8
|
const headers = map({}, isSerializableHeaderValue, {
|
|
9
9
|
'content-type': 'application/json',
|
|
@@ -12,11 +12,10 @@ export const se_AddToolCommand = async (input, context) => {
|
|
|
12
12
|
b.bp("/v1/tools");
|
|
13
13
|
let body;
|
|
14
14
|
body = JSON.stringify(take(input, {
|
|
15
|
-
'config': _ => se_Document(_, context),
|
|
16
15
|
'description': [],
|
|
17
|
-
'
|
|
16
|
+
'handler': _ => _json(_),
|
|
17
|
+
'input': _ => _json(_),
|
|
18
18
|
'name': [],
|
|
19
|
-
'type': [],
|
|
20
19
|
}));
|
|
21
20
|
b.m("POST")
|
|
22
21
|
.h(headers)
|
|
@@ -36,6 +35,22 @@ export const se_DeleteToolCommand = async (input, context) => {
|
|
|
36
35
|
.b(body);
|
|
37
36
|
return b.build();
|
|
38
37
|
};
|
|
38
|
+
export const se_DescribeToolsCommand = async (input, context) => {
|
|
39
|
+
const b = rb(input, context);
|
|
40
|
+
const headers = map({}, isSerializableHeaderValue, {
|
|
41
|
+
'content-type': 'application/json',
|
|
42
|
+
[_xci]: input[_c],
|
|
43
|
+
});
|
|
44
|
+
b.bp("/v1/tools/describe");
|
|
45
|
+
let body;
|
|
46
|
+
body = JSON.stringify(take(input, {
|
|
47
|
+
'ids': _ => _json(_),
|
|
48
|
+
}));
|
|
49
|
+
b.m("POST")
|
|
50
|
+
.h(headers)
|
|
51
|
+
.b(body);
|
|
52
|
+
return b.build();
|
|
53
|
+
};
|
|
39
54
|
export const se_ExecuteToolCommand = async (input, context) => {
|
|
40
55
|
const b = rb(input, context);
|
|
41
56
|
const headers = map({}, isSerializableHeaderValue, {
|
|
@@ -45,9 +60,8 @@ export const se_ExecuteToolCommand = async (input, context) => {
|
|
|
45
60
|
b.bp("/v1/tools/execute");
|
|
46
61
|
let body;
|
|
47
62
|
body = JSON.stringify(take(input, {
|
|
48
|
-
'
|
|
49
|
-
'
|
|
50
|
-
'toolId': [],
|
|
63
|
+
'id': [],
|
|
64
|
+
'input': _ => se_Document(_, context),
|
|
51
65
|
}));
|
|
52
66
|
b.m("POST")
|
|
53
67
|
.h(headers)
|
|
@@ -71,16 +85,13 @@ export const se_GetToolCommand = async (input, context) => {
|
|
|
71
85
|
};
|
|
72
86
|
export const se_ListToolsCommand = async (input, context) => {
|
|
73
87
|
const b = rb(input, context);
|
|
74
|
-
const headers = {}
|
|
75
|
-
|
|
76
|
-
const query = map({
|
|
77
|
-
[_c]: [, input[_c]],
|
|
78
|
-
[_f]: [, input[_f]],
|
|
88
|
+
const headers = map({}, isSerializableHeaderValue, {
|
|
89
|
+
[_xci]: input[_c],
|
|
79
90
|
});
|
|
91
|
+
b.bp("/v1/tools");
|
|
80
92
|
let body;
|
|
81
93
|
b.m("GET")
|
|
82
94
|
.h(headers)
|
|
83
|
-
.q(query)
|
|
84
95
|
.b(body);
|
|
85
96
|
return b.build();
|
|
86
97
|
};
|
|
@@ -94,9 +105,9 @@ export const se_UpdateToolCommand = async (input, context) => {
|
|
|
94
105
|
b.p('toolId', () => input.toolId, '{toolId}', false);
|
|
95
106
|
let body;
|
|
96
107
|
body = JSON.stringify(take(input, {
|
|
97
|
-
'config': _ => se_Document(_, context),
|
|
98
108
|
'description': [],
|
|
99
|
-
'
|
|
109
|
+
'handler': _ => _json(_),
|
|
110
|
+
'input': _ => _json(_),
|
|
100
111
|
'name': [],
|
|
101
112
|
}));
|
|
102
113
|
b.m("PUT")
|
|
@@ -104,7 +115,7 @@ export const se_UpdateToolCommand = async (input, context) => {
|
|
|
104
115
|
.b(body);
|
|
105
116
|
return b.build();
|
|
106
117
|
};
|
|
107
|
-
export const
|
|
118
|
+
export const de_CreateToolCommand = async (output, context) => {
|
|
108
119
|
if (output.statusCode !== 201 && output.statusCode >= 300) {
|
|
109
120
|
return de_CommandError(output, context);
|
|
110
121
|
}
|
|
@@ -113,7 +124,7 @@ export const de_AddToolCommand = async (output, context) => {
|
|
|
113
124
|
});
|
|
114
125
|
const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
|
|
115
126
|
const doc = take(data, {
|
|
116
|
-
'tool':
|
|
127
|
+
'tool': _json,
|
|
117
128
|
});
|
|
118
129
|
Object.assign(contents, doc);
|
|
119
130
|
return contents;
|
|
@@ -128,6 +139,20 @@ export const de_DeleteToolCommand = async (output, context) => {
|
|
|
128
139
|
await collectBody(output.body, context);
|
|
129
140
|
return contents;
|
|
130
141
|
};
|
|
142
|
+
export const de_DescribeToolsCommand = async (output, context) => {
|
|
143
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
144
|
+
return de_CommandError(output, context);
|
|
145
|
+
}
|
|
146
|
+
const contents = map({
|
|
147
|
+
$metadata: deserializeMetadata(output),
|
|
148
|
+
});
|
|
149
|
+
const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
|
|
150
|
+
const doc = take(data, {
|
|
151
|
+
'descriptions': _json,
|
|
152
|
+
});
|
|
153
|
+
Object.assign(contents, doc);
|
|
154
|
+
return contents;
|
|
155
|
+
};
|
|
131
156
|
export const de_ExecuteToolCommand = async (output, context) => {
|
|
132
157
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
133
158
|
return de_CommandError(output, context);
|
|
@@ -137,7 +162,7 @@ export const de_ExecuteToolCommand = async (output, context) => {
|
|
|
137
162
|
});
|
|
138
163
|
const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
|
|
139
164
|
const doc = take(data, {
|
|
140
|
-
'result': _ =>
|
|
165
|
+
'result': _ => de_ToolExecutionResult(_, context),
|
|
141
166
|
});
|
|
142
167
|
Object.assign(contents, doc);
|
|
143
168
|
return contents;
|
|
@@ -151,7 +176,7 @@ export const de_GetToolCommand = async (output, context) => {
|
|
|
151
176
|
});
|
|
152
177
|
const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
|
|
153
178
|
const doc = take(data, {
|
|
154
|
-
'tool':
|
|
179
|
+
'tool': _json,
|
|
155
180
|
});
|
|
156
181
|
Object.assign(contents, doc);
|
|
157
182
|
return contents;
|
|
@@ -165,8 +190,7 @@ export const de_ListToolsCommand = async (output, context) => {
|
|
|
165
190
|
});
|
|
166
191
|
const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
|
|
167
192
|
const doc = take(data, {
|
|
168
|
-
'
|
|
169
|
-
'tools': _ => de_ToolsList(_, context),
|
|
193
|
+
'tools': _json,
|
|
170
194
|
});
|
|
171
195
|
Object.assign(contents, doc);
|
|
172
196
|
return contents;
|
|
@@ -180,7 +204,7 @@ export const de_UpdateToolCommand = async (output, context) => {
|
|
|
180
204
|
});
|
|
181
205
|
const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
|
|
182
206
|
const doc = take(data, {
|
|
183
|
-
'tool':
|
|
207
|
+
'tool': _json,
|
|
184
208
|
});
|
|
185
209
|
Object.assign(contents, doc);
|
|
186
210
|
return contents;
|
|
@@ -192,15 +216,15 @@ const de_CommandError = async (output, context) => {
|
|
|
192
216
|
};
|
|
193
217
|
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
194
218
|
switch (errorCode) {
|
|
195
|
-
case "
|
|
196
|
-
case "
|
|
197
|
-
throw await
|
|
219
|
+
case "AlreadyExistException":
|
|
220
|
+
case "smithy.framework#AlreadyExistException":
|
|
221
|
+
throw await de_AlreadyExistExceptionRes(parsedOutput, context);
|
|
222
|
+
case "NotFoundException":
|
|
223
|
+
case "smithy.framework#NotFoundException":
|
|
224
|
+
throw await de_NotFoundExceptionRes(parsedOutput, context);
|
|
198
225
|
case "ToolExecutionException":
|
|
199
226
|
case "wildix.wim.tools#ToolExecutionException":
|
|
200
227
|
throw await de_ToolExecutionExceptionRes(parsedOutput, context);
|
|
201
|
-
case "ToolNotFoundException":
|
|
202
|
-
case "wildix.wim.tools#ToolNotFoundException":
|
|
203
|
-
throw await de_ToolNotFoundExceptionRes(parsedOutput, context);
|
|
204
228
|
case "ValidationException":
|
|
205
229
|
case "smithy.framework#ValidationException":
|
|
206
230
|
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
@@ -214,54 +238,54 @@ const de_CommandError = async (output, context) => {
|
|
|
214
238
|
}
|
|
215
239
|
};
|
|
216
240
|
const throwDefaultError = withBaseException(__BaseException);
|
|
217
|
-
const
|
|
241
|
+
const de_AlreadyExistExceptionRes = async (parsedOutput, context) => {
|
|
218
242
|
const contents = map({});
|
|
219
243
|
const data = parsedOutput.body;
|
|
220
244
|
const doc = take(data, {
|
|
221
245
|
'message': __expectString,
|
|
222
246
|
});
|
|
223
247
|
Object.assign(contents, doc);
|
|
224
|
-
const exception = new
|
|
248
|
+
const exception = new AlreadyExistException({
|
|
225
249
|
$metadata: deserializeMetadata(parsedOutput),
|
|
226
250
|
...contents
|
|
227
251
|
});
|
|
228
252
|
return __decorateServiceException(exception, parsedOutput.body);
|
|
229
253
|
};
|
|
230
|
-
const
|
|
254
|
+
const de_NotFoundExceptionRes = async (parsedOutput, context) => {
|
|
231
255
|
const contents = map({});
|
|
232
256
|
const data = parsedOutput.body;
|
|
233
257
|
const doc = take(data, {
|
|
234
258
|
'message': __expectString,
|
|
235
259
|
});
|
|
236
260
|
Object.assign(contents, doc);
|
|
237
|
-
const exception = new
|
|
261
|
+
const exception = new NotFoundException({
|
|
238
262
|
$metadata: deserializeMetadata(parsedOutput),
|
|
239
263
|
...contents
|
|
240
264
|
});
|
|
241
265
|
return __decorateServiceException(exception, parsedOutput.body);
|
|
242
266
|
};
|
|
243
|
-
const
|
|
267
|
+
const de_ValidationExceptionRes = async (parsedOutput, context) => {
|
|
244
268
|
const contents = map({});
|
|
245
269
|
const data = parsedOutput.body;
|
|
246
270
|
const doc = take(data, {
|
|
247
|
-
'details': _ => de_Document(_, context),
|
|
248
271
|
'message': __expectString,
|
|
249
272
|
});
|
|
250
273
|
Object.assign(contents, doc);
|
|
251
|
-
const exception = new
|
|
274
|
+
const exception = new ValidationException({
|
|
252
275
|
$metadata: deserializeMetadata(parsedOutput),
|
|
253
276
|
...contents
|
|
254
277
|
});
|
|
255
278
|
return __decorateServiceException(exception, parsedOutput.body);
|
|
256
279
|
};
|
|
257
|
-
const
|
|
280
|
+
const de_ToolExecutionExceptionRes = async (parsedOutput, context) => {
|
|
258
281
|
const contents = map({});
|
|
259
282
|
const data = parsedOutput.body;
|
|
260
283
|
const doc = take(data, {
|
|
284
|
+
'details': _ => de_Document(_, context),
|
|
261
285
|
'message': __expectString,
|
|
262
286
|
});
|
|
263
287
|
Object.assign(contents, doc);
|
|
264
|
-
const exception = new
|
|
288
|
+
const exception = new ToolExecutionException({
|
|
265
289
|
$metadata: deserializeMetadata(parsedOutput),
|
|
266
290
|
...contents
|
|
267
291
|
});
|
|
@@ -273,51 +297,12 @@ const se_Document = (input, context) => {
|
|
|
273
297
|
const de_Document = (output, context) => {
|
|
274
298
|
return output;
|
|
275
299
|
};
|
|
276
|
-
const
|
|
277
|
-
return take(output, {
|
|
278
|
-
'error': __expectString,
|
|
279
|
-
'result': (_) => de_Document(_, context),
|
|
280
|
-
'success': __expectBoolean,
|
|
281
|
-
'traceId': __expectString,
|
|
282
|
-
});
|
|
283
|
-
};
|
|
284
|
-
const de_LlmFunctionDefinition = (output, context) => {
|
|
285
|
-
return take(output, {
|
|
286
|
-
'description': __expectString,
|
|
287
|
-
'name': __expectString,
|
|
288
|
-
'parameters': (_) => de_Document(_, context),
|
|
289
|
-
});
|
|
290
|
-
};
|
|
291
|
-
const de_LlmToolDefinition = (output, context) => {
|
|
300
|
+
const de_ToolExecutionResult = (output, context) => {
|
|
292
301
|
return take(output, {
|
|
293
|
-
'
|
|
294
|
-
'
|
|
295
|
-
|
|
296
|
-
};
|
|
297
|
-
const de_LlmToolDefinitionsList = (output, context) => {
|
|
298
|
-
const retVal = (output || []).filter((e) => e != null).map((entry) => {
|
|
299
|
-
return de_LlmToolDefinition(entry, context);
|
|
300
|
-
});
|
|
301
|
-
return retVal;
|
|
302
|
-
};
|
|
303
|
-
const de_Tool = (output, context) => {
|
|
304
|
-
return take(output, {
|
|
305
|
-
'company': __expectString,
|
|
306
|
-
'config': (_) => de_Document(_, context),
|
|
307
|
-
'createdAt': (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
|
|
308
|
-
'description': __expectString,
|
|
309
|
-
'id': __expectString,
|
|
310
|
-
'jsonSchema': (_) => de_Document(_, context),
|
|
311
|
-
'name': __expectString,
|
|
312
|
-
'type': __expectString,
|
|
313
|
-
'updatedAt': (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
|
|
314
|
-
});
|
|
315
|
-
};
|
|
316
|
-
const de_ToolsList = (output, context) => {
|
|
317
|
-
const retVal = (output || []).filter((e) => e != null).map((entry) => {
|
|
318
|
-
return de_Tool(entry, context);
|
|
302
|
+
'error': _json,
|
|
303
|
+
'output': (_) => de_Document(_, context),
|
|
304
|
+
'statusCode': __expectInt32,
|
|
319
305
|
});
|
|
320
|
-
return retVal;
|
|
321
306
|
};
|
|
322
307
|
const deserializeMetadata = (output) => ({
|
|
323
308
|
httpStatusCode: output.statusCode,
|
|
@@ -327,5 +312,4 @@ const deserializeMetadata = (output) => ({
|
|
|
327
312
|
});
|
|
328
313
|
const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then(body => context.utf8Encoder(body));
|
|
329
314
|
const _c = "company";
|
|
330
|
-
const _f = "format";
|
|
331
315
|
const _xci = "x-company-id";
|
package/dist-types/Tools.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ToolsClient } from "./ToolsClient";
|
|
2
|
-
import {
|
|
2
|
+
import { CreateToolCommandInput, CreateToolCommandOutput } from "./commands/CreateToolCommand";
|
|
3
3
|
import { DeleteToolCommandInput, DeleteToolCommandOutput } from "./commands/DeleteToolCommand";
|
|
4
|
+
import { DescribeToolsCommandInput, DescribeToolsCommandOutput } from "./commands/DescribeToolsCommand";
|
|
4
5
|
import { ExecuteToolCommandInput, ExecuteToolCommandOutput } from "./commands/ExecuteToolCommand";
|
|
5
6
|
import { GetToolCommandInput, GetToolCommandOutput } from "./commands/GetToolCommand";
|
|
6
7
|
import { ListToolsCommandInput, ListToolsCommandOutput } from "./commands/ListToolsCommand";
|
|
@@ -8,17 +9,23 @@ import { UpdateToolCommandInput, UpdateToolCommandOutput } from "./commands/Upda
|
|
|
8
9
|
import { HttpHandlerOptions as __HttpHandlerOptions } from "@smithy/types";
|
|
9
10
|
export interface Tools {
|
|
10
11
|
/**
|
|
11
|
-
* @see {@link
|
|
12
|
+
* @see {@link CreateToolCommand}
|
|
12
13
|
*/
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
createTool(args: CreateToolCommandInput, options?: __HttpHandlerOptions): Promise<CreateToolCommandOutput>;
|
|
15
|
+
createTool(args: CreateToolCommandInput, cb: (err: any, data?: CreateToolCommandOutput) => void): void;
|
|
16
|
+
createTool(args: CreateToolCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: CreateToolCommandOutput) => void): void;
|
|
16
17
|
/**
|
|
17
18
|
* @see {@link DeleteToolCommand}
|
|
18
19
|
*/
|
|
19
20
|
deleteTool(args: DeleteToolCommandInput, options?: __HttpHandlerOptions): Promise<DeleteToolCommandOutput>;
|
|
20
21
|
deleteTool(args: DeleteToolCommandInput, cb: (err: any, data?: DeleteToolCommandOutput) => void): void;
|
|
21
22
|
deleteTool(args: DeleteToolCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: DeleteToolCommandOutput) => void): void;
|
|
23
|
+
/**
|
|
24
|
+
* @see {@link DescribeToolsCommand}
|
|
25
|
+
*/
|
|
26
|
+
describeTools(args: DescribeToolsCommandInput, options?: __HttpHandlerOptions): Promise<DescribeToolsCommandOutput>;
|
|
27
|
+
describeTools(args: DescribeToolsCommandInput, cb: (err: any, data?: DescribeToolsCommandOutput) => void): void;
|
|
28
|
+
describeTools(args: DescribeToolsCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: DescribeToolsCommandOutput) => void): void;
|
|
22
29
|
/**
|
|
23
30
|
* @see {@link ExecuteToolCommand}
|
|
24
31
|
*/
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CreateToolCommandInput, CreateToolCommandOutput } from "./commands/CreateToolCommand";
|
|
2
2
|
import { DeleteToolCommandInput, DeleteToolCommandOutput } from "./commands/DeleteToolCommand";
|
|
3
|
+
import { DescribeToolsCommandInput, DescribeToolsCommandOutput } from "./commands/DescribeToolsCommand";
|
|
3
4
|
import { ExecuteToolCommandInput, ExecuteToolCommandOutput } from "./commands/ExecuteToolCommand";
|
|
4
5
|
import { GetToolCommandInput, GetToolCommandOutput } from "./commands/GetToolCommand";
|
|
5
6
|
import { ListToolsCommandInput, ListToolsCommandOutput } from "./commands/ListToolsCommand";
|
|
6
7
|
import { UpdateToolCommandInput, UpdateToolCommandOutput } from "./commands/UpdateToolCommand";
|
|
7
8
|
import { RuntimeExtension, RuntimeExtensionsConfig } from "./runtimeExtensions";
|
|
8
|
-
import { HostHeaderInputConfig, HostHeaderResolvedConfig } from "@aws-sdk/middleware-host-header";
|
|
9
9
|
import { UserAgentInputConfig, UserAgentResolvedConfig } from "@aws-sdk/middleware-user-agent";
|
|
10
|
-
import { CustomEndpointsInputConfig, CustomEndpointsResolvedConfig, RegionInputConfig, RegionResolvedConfig } from "@smithy/config-resolver";
|
|
11
10
|
import { RetryInputConfig, RetryResolvedConfig } from "@smithy/middleware-retry";
|
|
12
11
|
import { HttpHandlerUserInput as __HttpHandlerUserInput } from "@smithy/protocol-http";
|
|
13
12
|
import { Client as __Client, DefaultsMode as __DefaultsMode, SmithyConfiguration as __SmithyConfiguration, SmithyResolvedConfiguration as __SmithyResolvedConfiguration } from "@smithy/smithy-client";
|
|
14
13
|
import { Provider, BodyLengthCalculator as __BodyLengthCalculator, CheckOptionalClientConfig as __CheckOptionalClientConfig, ChecksumConstructor as __ChecksumConstructor, Decoder as __Decoder, Encoder as __Encoder, HashConstructor as __HashConstructor, HttpHandlerOptions as __HttpHandlerOptions, Logger as __Logger, Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, UserAgent as __UserAgent } from "@smithy/types";
|
|
14
|
+
import { TokenProvider } from '@wildix/smithy-utils';
|
|
15
15
|
export { __Client };
|
|
16
16
|
/**
|
|
17
17
|
* @public
|
|
18
18
|
*/
|
|
19
|
-
export type ServiceInputTypes =
|
|
19
|
+
export type ServiceInputTypes = CreateToolCommandInput | DeleteToolCommandInput | DescribeToolsCommandInput | ExecuteToolCommandInput | GetToolCommandInput | ListToolsCommandInput | UpdateToolCommandInput;
|
|
20
20
|
/**
|
|
21
21
|
* @public
|
|
22
22
|
*/
|
|
23
|
-
export type ServiceOutputTypes =
|
|
23
|
+
export type ServiceOutputTypes = CreateToolCommandOutput | DeleteToolCommandOutput | DescribeToolsCommandOutput | ExecuteToolCommandOutput | GetToolCommandOutput | ListToolsCommandOutput | UpdateToolCommandOutput;
|
|
24
24
|
/**
|
|
25
25
|
* @public
|
|
26
26
|
*/
|
|
@@ -111,18 +111,21 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand
|
|
|
111
111
|
/**
|
|
112
112
|
* @public
|
|
113
113
|
*/
|
|
114
|
-
export type ToolsClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & ClientDefaults & UserAgentInputConfig &
|
|
114
|
+
export type ToolsClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & ClientDefaults & UserAgentInputConfig & RetryInputConfig;
|
|
115
115
|
/**
|
|
116
116
|
* @public
|
|
117
117
|
*
|
|
118
118
|
* The configuration interface of ToolsClient class constructor that set the region, credentials and other options.
|
|
119
119
|
*/
|
|
120
120
|
export interface ToolsClientConfig extends ToolsClientConfigType {
|
|
121
|
+
env?: 'stage' | 'stable' | 'prod';
|
|
122
|
+
token: TokenProvider;
|
|
123
|
+
endpoint?: () => Record<string, string>;
|
|
121
124
|
}
|
|
122
125
|
/**
|
|
123
126
|
* @public
|
|
124
127
|
*/
|
|
125
|
-
export type ToolsClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required<ClientDefaults> & RuntimeExtensionsConfig & UserAgentResolvedConfig &
|
|
128
|
+
export type ToolsClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required<ClientDefaults> & RuntimeExtensionsConfig & UserAgentResolvedConfig & RetryResolvedConfig;
|
|
126
129
|
/**
|
|
127
130
|
* @public
|
|
128
131
|
*
|