@wildix/wim-tools-client 0.0.3 → 0.0.5
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 +12 -0
- package/dist-cjs/ToolsClient.js +13 -15
- package/dist-cjs/commands/AddToolCommand.js +21 -0
- package/dist-cjs/commands/DeleteToolCommand.js +21 -0
- package/dist-cjs/commands/ExecuteToolCommand.js +21 -0
- package/dist-cjs/commands/GetToolCommand.js +21 -0
- package/dist-cjs/commands/ListToolsCommand.js +21 -0
- package/dist-cjs/commands/UpdateToolCommand.js +21 -0
- package/dist-cjs/commands/index.js +6 -0
- package/dist-cjs/models/models_0.js +45 -1
- package/dist-cjs/protocols/Aws_restJson1.js +306 -1
- package/dist-es/Tools.js +12 -0
- package/dist-es/ToolsClient.js +13 -15
- package/dist-es/commands/AddToolCommand.js +17 -0
- package/dist-es/commands/DeleteToolCommand.js +17 -0
- package/dist-es/commands/ExecuteToolCommand.js +17 -0
- package/dist-es/commands/GetToolCommand.js +17 -0
- package/dist-es/commands/ListToolsCommand.js +17 -0
- package/dist-es/commands/UpdateToolCommand.js +17 -0
- package/dist-es/commands/index.js +6 -0
- package/dist-es/models/models_0.js +41 -0
- package/dist-es/protocols/Aws_restJson1.js +295 -2
- package/dist-types/Tools.d.ts +43 -0
- package/dist-types/ToolsClient.d.ts +12 -7
- package/dist-types/commands/AddToolCommand.d.ts +98 -0
- package/dist-types/commands/DeleteToolCommand.d.ts +79 -0
- package/dist-types/commands/ExecuteToolCommand.d.ts +93 -0
- package/dist-types/commands/GetToolCommand.d.ts +91 -0
- package/dist-types/commands/ListToolsCommand.d.ts +103 -0
- package/dist-types/commands/TestEndpointCommand.d.ts +9 -3
- package/dist-types/commands/UpdateToolCommand.d.ts +95 -0
- package/dist-types/commands/index.d.ts +6 -0
- package/dist-types/models/models_0.d.ts +396 -0
- package/dist-types/protocols/Aws_restJson1.d.ts +54 -0
- package/dist-types/runtimeConfig.browser.d.ts +5 -2
- package/dist-types/runtimeConfig.d.ts +5 -2
- package/dist-types/runtimeConfig.native.d.ts +5 -2
- package/package.json +3 -4
package/dist-es/ToolsClient.js
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
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";
|
|
3
6
|
import { getUserAgentPlugin, resolveUserAgentConfig, } from "@aws-sdk/middleware-user-agent";
|
|
7
|
+
import { resolveCustomEndpointsConfig, resolveRegionConfig, } from "@smithy/config-resolver";
|
|
4
8
|
import { getContentLengthPlugin } from "@smithy/middleware-content-length";
|
|
5
9
|
import { getRetryPlugin, resolveRetryConfig, } from "@smithy/middleware-retry";
|
|
6
10
|
import { Client as __Client, } from "@smithy/smithy-client";
|
|
7
|
-
import { authorizationMiddleware } from '@wildix/smithy-utils';
|
|
8
11
|
export { __Client };
|
|
9
12
|
export class ToolsClient extends __Client {
|
|
10
13
|
config;
|
|
@@ -13,23 +16,18 @@ export class ToolsClient extends __Client {
|
|
|
13
16
|
super(_config_0);
|
|
14
17
|
this.initConfig = _config_0;
|
|
15
18
|
let _config_1 = resolveUserAgentConfig(_config_0);
|
|
16
|
-
let _config_2 =
|
|
17
|
-
let _config_3 =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
protocol: "https",
|
|
23
|
-
port: '443',
|
|
24
|
-
path: ''
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
const config = { ..._config_3, endpoint };
|
|
28
|
-
this.config = config;
|
|
29
|
-
this.middlewareStack.add(authorizationMiddleware.bind(this, configuration.token), { step: "build" });
|
|
19
|
+
let _config_2 = resolveCustomEndpointsConfig(_config_1);
|
|
20
|
+
let _config_3 = resolveRetryConfig(_config_2);
|
|
21
|
+
let _config_4 = resolveRegionConfig(_config_3);
|
|
22
|
+
let _config_5 = resolveHostHeaderConfig(_config_4);
|
|
23
|
+
let _config_6 = resolveRuntimeExtensions(_config_5, configuration?.extensions || []);
|
|
24
|
+
this.config = _config_6;
|
|
30
25
|
this.middlewareStack.use(getUserAgentPlugin(this.config));
|
|
31
26
|
this.middlewareStack.use(getRetryPlugin(this.config));
|
|
32
27
|
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));
|
|
33
31
|
}
|
|
34
32
|
destroy() {
|
|
35
33
|
super.destroy();
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { de_AddToolCommand, se_AddToolCommand, } 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 AddToolCommand extends $Command.classBuilder()
|
|
6
|
+
.m(function (Command, cs, config, o) {
|
|
7
|
+
return [
|
|
8
|
+
getSerdePlugin(config, this.serialize, this.deserialize),
|
|
9
|
+
];
|
|
10
|
+
})
|
|
11
|
+
.s("Tools", "AddTool", {})
|
|
12
|
+
.n("ToolsClient", "AddToolCommand")
|
|
13
|
+
.f(void 0, void 0)
|
|
14
|
+
.ser(se_AddToolCommand)
|
|
15
|
+
.de(de_AddToolCommand)
|
|
16
|
+
.build() {
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { de_DeleteToolCommand, se_DeleteToolCommand, } 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 DeleteToolCommand extends $Command.classBuilder()
|
|
6
|
+
.m(function (Command, cs, config, o) {
|
|
7
|
+
return [
|
|
8
|
+
getSerdePlugin(config, this.serialize, this.deserialize),
|
|
9
|
+
];
|
|
10
|
+
})
|
|
11
|
+
.s("Tools", "DeleteTool", {})
|
|
12
|
+
.n("ToolsClient", "DeleteToolCommand")
|
|
13
|
+
.f(void 0, void 0)
|
|
14
|
+
.ser(se_DeleteToolCommand)
|
|
15
|
+
.de(de_DeleteToolCommand)
|
|
16
|
+
.build() {
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { de_ExecuteToolCommand, se_ExecuteToolCommand, } 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 ExecuteToolCommand extends $Command.classBuilder()
|
|
6
|
+
.m(function (Command, cs, config, o) {
|
|
7
|
+
return [
|
|
8
|
+
getSerdePlugin(config, this.serialize, this.deserialize),
|
|
9
|
+
];
|
|
10
|
+
})
|
|
11
|
+
.s("Tools", "ExecuteTool", {})
|
|
12
|
+
.n("ToolsClient", "ExecuteToolCommand")
|
|
13
|
+
.f(void 0, void 0)
|
|
14
|
+
.ser(se_ExecuteToolCommand)
|
|
15
|
+
.de(de_ExecuteToolCommand)
|
|
16
|
+
.build() {
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { de_GetToolCommand, se_GetToolCommand, } 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 GetToolCommand extends $Command.classBuilder()
|
|
6
|
+
.m(function (Command, cs, config, o) {
|
|
7
|
+
return [
|
|
8
|
+
getSerdePlugin(config, this.serialize, this.deserialize),
|
|
9
|
+
];
|
|
10
|
+
})
|
|
11
|
+
.s("Tools", "GetTool", {})
|
|
12
|
+
.n("ToolsClient", "GetToolCommand")
|
|
13
|
+
.f(void 0, void 0)
|
|
14
|
+
.ser(se_GetToolCommand)
|
|
15
|
+
.de(de_GetToolCommand)
|
|
16
|
+
.build() {
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { de_ListToolsCommand, se_ListToolsCommand, } 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 ListToolsCommand extends $Command.classBuilder()
|
|
6
|
+
.m(function (Command, cs, config, o) {
|
|
7
|
+
return [
|
|
8
|
+
getSerdePlugin(config, this.serialize, this.deserialize),
|
|
9
|
+
];
|
|
10
|
+
})
|
|
11
|
+
.s("Tools", "ListTools", {})
|
|
12
|
+
.n("ToolsClient", "ListToolsCommand")
|
|
13
|
+
.f(void 0, void 0)
|
|
14
|
+
.ser(se_ListToolsCommand)
|
|
15
|
+
.de(de_ListToolsCommand)
|
|
16
|
+
.build() {
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { de_UpdateToolCommand, se_UpdateToolCommand, } 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 UpdateToolCommand extends $Command.classBuilder()
|
|
6
|
+
.m(function (Command, cs, config, o) {
|
|
7
|
+
return [
|
|
8
|
+
getSerdePlugin(config, this.serialize, this.deserialize),
|
|
9
|
+
];
|
|
10
|
+
})
|
|
11
|
+
.s("Tools", "UpdateTool", {})
|
|
12
|
+
.n("ToolsClient", "UpdateToolCommand")
|
|
13
|
+
.f(void 0, void 0)
|
|
14
|
+
.ser(se_UpdateToolCommand)
|
|
15
|
+
.de(de_UpdateToolCommand)
|
|
16
|
+
.build() {
|
|
17
|
+
}
|
|
@@ -11,3 +11,44 @@ export class ValidationException extends __BaseException {
|
|
|
11
11
|
Object.setPrototypeOf(this, ValidationException.prototype);
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
+
export const ToolType = {
|
|
15
|
+
EMAIL: "EMAIL",
|
|
16
|
+
};
|
|
17
|
+
export class ToolAlreadyExistsException extends __BaseException {
|
|
18
|
+
name = "ToolAlreadyExistsException";
|
|
19
|
+
$fault = "client";
|
|
20
|
+
constructor(opts) {
|
|
21
|
+
super({
|
|
22
|
+
name: "ToolAlreadyExistsException",
|
|
23
|
+
$fault: "client",
|
|
24
|
+
...opts
|
|
25
|
+
});
|
|
26
|
+
Object.setPrototypeOf(this, ToolAlreadyExistsException.prototype);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export class ToolExecutionException extends __BaseException {
|
|
30
|
+
name = "ToolExecutionException";
|
|
31
|
+
$fault = "server";
|
|
32
|
+
details;
|
|
33
|
+
constructor(opts) {
|
|
34
|
+
super({
|
|
35
|
+
name: "ToolExecutionException",
|
|
36
|
+
$fault: "server",
|
|
37
|
+
...opts
|
|
38
|
+
});
|
|
39
|
+
Object.setPrototypeOf(this, ToolExecutionException.prototype);
|
|
40
|
+
this.details = opts.details;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
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,8 +1,89 @@
|
|
|
1
1
|
import { ToolsServiceException as __BaseException } from "../models/ToolsServiceException";
|
|
2
|
-
import { ValidationException } from "../models/models_0";
|
|
2
|
+
import { ToolAlreadyExistsException, ToolExecutionException, ToolNotFoundException, 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, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, parseEpochTimestamp as __parseEpochTimestamp, collectBody, map, take, withBaseException, } from "@smithy/smithy-client";
|
|
5
|
+
import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, parseEpochTimestamp as __parseEpochTimestamp, collectBody, isSerializableHeaderValue, map, take, withBaseException, } from "@smithy/smithy-client";
|
|
6
|
+
export const se_AddToolCommand = async (input, context) => {
|
|
7
|
+
const b = rb(input, context);
|
|
8
|
+
const headers = map({}, isSerializableHeaderValue, {
|
|
9
|
+
'content-type': 'application/json',
|
|
10
|
+
[_xci]: input[_c],
|
|
11
|
+
});
|
|
12
|
+
b.bp("/v1/tools");
|
|
13
|
+
let body;
|
|
14
|
+
body = JSON.stringify(take(input, {
|
|
15
|
+
'config': _ => se_Document(_, context),
|
|
16
|
+
'description': [],
|
|
17
|
+
'jsonSchema': _ => se_Document(_, context),
|
|
18
|
+
'name': [],
|
|
19
|
+
'type': [],
|
|
20
|
+
}));
|
|
21
|
+
b.m("POST")
|
|
22
|
+
.h(headers)
|
|
23
|
+
.b(body);
|
|
24
|
+
return b.build();
|
|
25
|
+
};
|
|
26
|
+
export const se_DeleteToolCommand = async (input, context) => {
|
|
27
|
+
const b = rb(input, context);
|
|
28
|
+
const headers = map({}, isSerializableHeaderValue, {
|
|
29
|
+
[_xci]: input[_c],
|
|
30
|
+
});
|
|
31
|
+
b.bp("/v1/tools/{toolId}");
|
|
32
|
+
b.p('toolId', () => input.toolId, '{toolId}', false);
|
|
33
|
+
let body;
|
|
34
|
+
b.m("DELETE")
|
|
35
|
+
.h(headers)
|
|
36
|
+
.b(body);
|
|
37
|
+
return b.build();
|
|
38
|
+
};
|
|
39
|
+
export const se_ExecuteToolCommand = async (input, context) => {
|
|
40
|
+
const b = rb(input, context);
|
|
41
|
+
const headers = map({}, isSerializableHeaderValue, {
|
|
42
|
+
'content-type': 'application/json',
|
|
43
|
+
[_xci]: input[_c],
|
|
44
|
+
});
|
|
45
|
+
b.bp("/v1/tools/execute");
|
|
46
|
+
let body;
|
|
47
|
+
body = JSON.stringify(take(input, {
|
|
48
|
+
'context': _ => se_ExecutionContext(_, context),
|
|
49
|
+
'parameters': _ => se_Document(_, context),
|
|
50
|
+
'toolId': [],
|
|
51
|
+
}));
|
|
52
|
+
b.m("POST")
|
|
53
|
+
.h(headers)
|
|
54
|
+
.b(body);
|
|
55
|
+
return b.build();
|
|
56
|
+
};
|
|
57
|
+
export const se_GetToolCommand = async (input, context) => {
|
|
58
|
+
const b = rb(input, context);
|
|
59
|
+
const headers = {};
|
|
60
|
+
b.bp("/v1/tools/{toolId}");
|
|
61
|
+
b.p('toolId', () => input.toolId, '{toolId}', false);
|
|
62
|
+
const query = map({
|
|
63
|
+
[_c]: [, input[_c]],
|
|
64
|
+
});
|
|
65
|
+
let body;
|
|
66
|
+
b.m("GET")
|
|
67
|
+
.h(headers)
|
|
68
|
+
.q(query)
|
|
69
|
+
.b(body);
|
|
70
|
+
return b.build();
|
|
71
|
+
};
|
|
72
|
+
export const se_ListToolsCommand = async (input, context) => {
|
|
73
|
+
const b = rb(input, context);
|
|
74
|
+
const headers = {};
|
|
75
|
+
b.bp("/v1/tools");
|
|
76
|
+
const query = map({
|
|
77
|
+
[_c]: [, input[_c]],
|
|
78
|
+
[_f]: [, input[_f]],
|
|
79
|
+
});
|
|
80
|
+
let body;
|
|
81
|
+
b.m("GET")
|
|
82
|
+
.h(headers)
|
|
83
|
+
.q(query)
|
|
84
|
+
.b(body);
|
|
85
|
+
return b.build();
|
|
86
|
+
};
|
|
6
87
|
export const se_TestEndpointCommand = async (input, context) => {
|
|
7
88
|
const b = rb(input, context);
|
|
8
89
|
const headers = {};
|
|
@@ -17,6 +98,93 @@ export const se_TestEndpointCommand = async (input, context) => {
|
|
|
17
98
|
.b(body);
|
|
18
99
|
return b.build();
|
|
19
100
|
};
|
|
101
|
+
export const se_UpdateToolCommand = async (input, context) => {
|
|
102
|
+
const b = rb(input, context);
|
|
103
|
+
const headers = map({}, isSerializableHeaderValue, {
|
|
104
|
+
'content-type': 'application/json',
|
|
105
|
+
[_xci]: input[_c],
|
|
106
|
+
});
|
|
107
|
+
b.bp("/v1/tools/{toolId}");
|
|
108
|
+
b.p('toolId', () => input.toolId, '{toolId}', false);
|
|
109
|
+
let body;
|
|
110
|
+
body = JSON.stringify(take(input, {
|
|
111
|
+
'config': _ => se_Document(_, context),
|
|
112
|
+
'description': [],
|
|
113
|
+
'jsonSchema': _ => se_Document(_, context),
|
|
114
|
+
'name': [],
|
|
115
|
+
}));
|
|
116
|
+
b.m("PUT")
|
|
117
|
+
.h(headers)
|
|
118
|
+
.b(body);
|
|
119
|
+
return b.build();
|
|
120
|
+
};
|
|
121
|
+
export const de_AddToolCommand = async (output, context) => {
|
|
122
|
+
if (output.statusCode !== 201 && output.statusCode >= 300) {
|
|
123
|
+
return de_CommandError(output, context);
|
|
124
|
+
}
|
|
125
|
+
const contents = map({
|
|
126
|
+
$metadata: deserializeMetadata(output),
|
|
127
|
+
});
|
|
128
|
+
const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
|
|
129
|
+
const doc = take(data, {
|
|
130
|
+
'tool': _ => de_Tool(_, context),
|
|
131
|
+
});
|
|
132
|
+
Object.assign(contents, doc);
|
|
133
|
+
return contents;
|
|
134
|
+
};
|
|
135
|
+
export const de_DeleteToolCommand = async (output, context) => {
|
|
136
|
+
if (output.statusCode !== 204 && output.statusCode >= 300) {
|
|
137
|
+
return de_CommandError(output, context);
|
|
138
|
+
}
|
|
139
|
+
const contents = map({
|
|
140
|
+
$metadata: deserializeMetadata(output),
|
|
141
|
+
});
|
|
142
|
+
await collectBody(output.body, context);
|
|
143
|
+
return contents;
|
|
144
|
+
};
|
|
145
|
+
export const de_ExecuteToolCommand = async (output, context) => {
|
|
146
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
147
|
+
return de_CommandError(output, context);
|
|
148
|
+
}
|
|
149
|
+
const contents = map({
|
|
150
|
+
$metadata: deserializeMetadata(output),
|
|
151
|
+
});
|
|
152
|
+
const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
|
|
153
|
+
const doc = take(data, {
|
|
154
|
+
'result': _ => de_ExecutionResult(_, context),
|
|
155
|
+
});
|
|
156
|
+
Object.assign(contents, doc);
|
|
157
|
+
return contents;
|
|
158
|
+
};
|
|
159
|
+
export const de_GetToolCommand = async (output, context) => {
|
|
160
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
161
|
+
return de_CommandError(output, context);
|
|
162
|
+
}
|
|
163
|
+
const contents = map({
|
|
164
|
+
$metadata: deserializeMetadata(output),
|
|
165
|
+
});
|
|
166
|
+
const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
|
|
167
|
+
const doc = take(data, {
|
|
168
|
+
'tool': _ => de_Tool(_, context),
|
|
169
|
+
});
|
|
170
|
+
Object.assign(contents, doc);
|
|
171
|
+
return contents;
|
|
172
|
+
};
|
|
173
|
+
export const de_ListToolsCommand = async (output, context) => {
|
|
174
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
175
|
+
return de_CommandError(output, context);
|
|
176
|
+
}
|
|
177
|
+
const contents = map({
|
|
178
|
+
$metadata: deserializeMetadata(output),
|
|
179
|
+
});
|
|
180
|
+
const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
|
|
181
|
+
const doc = take(data, {
|
|
182
|
+
'llmTools': _ => de_LlmToolDefinitionsList(_, context),
|
|
183
|
+
'tools': _ => de_ToolsList(_, context),
|
|
184
|
+
});
|
|
185
|
+
Object.assign(contents, doc);
|
|
186
|
+
return contents;
|
|
187
|
+
};
|
|
20
188
|
export const de_TestEndpointCommand = async (output, context) => {
|
|
21
189
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
22
190
|
return de_CommandError(output, context);
|
|
@@ -32,6 +200,20 @@ export const de_TestEndpointCommand = async (output, context) => {
|
|
|
32
200
|
Object.assign(contents, doc);
|
|
33
201
|
return contents;
|
|
34
202
|
};
|
|
203
|
+
export const de_UpdateToolCommand = async (output, context) => {
|
|
204
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
205
|
+
return de_CommandError(output, context);
|
|
206
|
+
}
|
|
207
|
+
const contents = map({
|
|
208
|
+
$metadata: deserializeMetadata(output),
|
|
209
|
+
});
|
|
210
|
+
const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
|
|
211
|
+
const doc = take(data, {
|
|
212
|
+
'tool': _ => de_Tool(_, context),
|
|
213
|
+
});
|
|
214
|
+
Object.assign(contents, doc);
|
|
215
|
+
return contents;
|
|
216
|
+
};
|
|
35
217
|
const de_CommandError = async (output, context) => {
|
|
36
218
|
const parsedOutput = {
|
|
37
219
|
...output,
|
|
@@ -39,6 +221,15 @@ const de_CommandError = async (output, context) => {
|
|
|
39
221
|
};
|
|
40
222
|
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
41
223
|
switch (errorCode) {
|
|
224
|
+
case "ToolAlreadyExistsException":
|
|
225
|
+
case "wildix.wim.tools#ToolAlreadyExistsException":
|
|
226
|
+
throw await de_ToolAlreadyExistsExceptionRes(parsedOutput, context);
|
|
227
|
+
case "ToolExecutionException":
|
|
228
|
+
case "wildix.wim.tools#ToolExecutionException":
|
|
229
|
+
throw await de_ToolExecutionExceptionRes(parsedOutput, context);
|
|
230
|
+
case "ToolNotFoundException":
|
|
231
|
+
case "wildix.wim.tools#ToolNotFoundException":
|
|
232
|
+
throw await de_ToolNotFoundExceptionRes(parsedOutput, context);
|
|
42
233
|
case "ValidationException":
|
|
43
234
|
case "smithy.framework#ValidationException":
|
|
44
235
|
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
@@ -65,6 +256,106 @@ const de_ValidationExceptionRes = async (parsedOutput, context) => {
|
|
|
65
256
|
});
|
|
66
257
|
return __decorateServiceException(exception, parsedOutput.body);
|
|
67
258
|
};
|
|
259
|
+
const de_ToolAlreadyExistsExceptionRes = async (parsedOutput, context) => {
|
|
260
|
+
const contents = map({});
|
|
261
|
+
const data = parsedOutput.body;
|
|
262
|
+
const doc = take(data, {
|
|
263
|
+
'message': __expectString,
|
|
264
|
+
});
|
|
265
|
+
Object.assign(contents, doc);
|
|
266
|
+
const exception = new ToolAlreadyExistsException({
|
|
267
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
268
|
+
...contents
|
|
269
|
+
});
|
|
270
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
271
|
+
};
|
|
272
|
+
const de_ToolExecutionExceptionRes = async (parsedOutput, context) => {
|
|
273
|
+
const contents = map({});
|
|
274
|
+
const data = parsedOutput.body;
|
|
275
|
+
const doc = take(data, {
|
|
276
|
+
'details': _ => de_Document(_, context),
|
|
277
|
+
'message': __expectString,
|
|
278
|
+
});
|
|
279
|
+
Object.assign(contents, doc);
|
|
280
|
+
const exception = new ToolExecutionException({
|
|
281
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
282
|
+
...contents
|
|
283
|
+
});
|
|
284
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
285
|
+
};
|
|
286
|
+
const de_ToolNotFoundExceptionRes = async (parsedOutput, context) => {
|
|
287
|
+
const contents = map({});
|
|
288
|
+
const data = parsedOutput.body;
|
|
289
|
+
const doc = take(data, {
|
|
290
|
+
'message': __expectString,
|
|
291
|
+
});
|
|
292
|
+
Object.assign(contents, doc);
|
|
293
|
+
const exception = new ToolNotFoundException({
|
|
294
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
295
|
+
...contents
|
|
296
|
+
});
|
|
297
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
298
|
+
};
|
|
299
|
+
const se_Document = (input, context) => {
|
|
300
|
+
return input;
|
|
301
|
+
};
|
|
302
|
+
const se_ExecutionContext = (input, context) => {
|
|
303
|
+
return take(input, {
|
|
304
|
+
'company': [],
|
|
305
|
+
'metadata': _ => se_Document(_, context),
|
|
306
|
+
'sessionId': [],
|
|
307
|
+
'userId': [],
|
|
308
|
+
});
|
|
309
|
+
};
|
|
310
|
+
const de_Document = (output, context) => {
|
|
311
|
+
return output;
|
|
312
|
+
};
|
|
313
|
+
const de_ExecutionResult = (output, context) => {
|
|
314
|
+
return take(output, {
|
|
315
|
+
'error': __expectString,
|
|
316
|
+
'result': (_) => de_Document(_, context),
|
|
317
|
+
'success': __expectBoolean,
|
|
318
|
+
'traceId': __expectString,
|
|
319
|
+
});
|
|
320
|
+
};
|
|
321
|
+
const de_LlmFunctionDefinition = (output, context) => {
|
|
322
|
+
return take(output, {
|
|
323
|
+
'description': __expectString,
|
|
324
|
+
'name': __expectString,
|
|
325
|
+
'parameters': (_) => de_Document(_, context),
|
|
326
|
+
});
|
|
327
|
+
};
|
|
328
|
+
const de_LlmToolDefinition = (output, context) => {
|
|
329
|
+
return take(output, {
|
|
330
|
+
'function': (_) => de_LlmFunctionDefinition(_, context),
|
|
331
|
+
'type': __expectString,
|
|
332
|
+
});
|
|
333
|
+
};
|
|
334
|
+
const de_LlmToolDefinitionsList = (output, context) => {
|
|
335
|
+
const retVal = (output || []).filter((e) => e != null).map((entry) => {
|
|
336
|
+
return de_LlmToolDefinition(entry, context);
|
|
337
|
+
});
|
|
338
|
+
return retVal;
|
|
339
|
+
};
|
|
340
|
+
const de_Tool = (output, context) => {
|
|
341
|
+
return take(output, {
|
|
342
|
+
'company': __expectString,
|
|
343
|
+
'config': (_) => de_Document(_, context),
|
|
344
|
+
'createdAt': (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
|
|
345
|
+
'description': __expectString,
|
|
346
|
+
'id': __expectString,
|
|
347
|
+
'jsonSchema': (_) => de_Document(_, context),
|
|
348
|
+
'name': __expectString,
|
|
349
|
+
'type': __expectString,
|
|
350
|
+
'updatedAt': (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
|
|
351
|
+
});
|
|
352
|
+
};
|
|
353
|
+
const de_ToolsList = (output, context) => {
|
|
354
|
+
const retVal = (output || []).filter((e) => e != null).map((entry) => {
|
|
355
|
+
return de_Tool(entry, context);
|
|
356
|
+
});
|
|
357
|
+
return retVal;
|
|
358
|
+
};
|
|
68
359
|
const deserializeMetadata = (output) => ({
|
|
69
360
|
httpStatusCode: output.statusCode,
|
|
70
361
|
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
|
|
@@ -73,3 +364,5 @@ const deserializeMetadata = (output) => ({
|
|
|
73
364
|
});
|
|
74
365
|
const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then(body => context.utf8Encoder(body));
|
|
75
366
|
const _c = "company";
|
|
367
|
+
const _f = "format";
|
|
368
|
+
const _xci = "x-company-id";
|
package/dist-types/Tools.d.ts
CHANGED
|
@@ -1,7 +1,44 @@
|
|
|
1
1
|
import { ToolsClient } from "./ToolsClient";
|
|
2
|
+
import { AddToolCommandInput, AddToolCommandOutput } from "./commands/AddToolCommand";
|
|
3
|
+
import { DeleteToolCommandInput, DeleteToolCommandOutput } from "./commands/DeleteToolCommand";
|
|
4
|
+
import { ExecuteToolCommandInput, ExecuteToolCommandOutput } from "./commands/ExecuteToolCommand";
|
|
5
|
+
import { GetToolCommandInput, GetToolCommandOutput } from "./commands/GetToolCommand";
|
|
6
|
+
import { ListToolsCommandInput, ListToolsCommandOutput } from "./commands/ListToolsCommand";
|
|
2
7
|
import { TestEndpointCommandInput, TestEndpointCommandOutput } from "./commands/TestEndpointCommand";
|
|
8
|
+
import { UpdateToolCommandInput, UpdateToolCommandOutput } from "./commands/UpdateToolCommand";
|
|
3
9
|
import { HttpHandlerOptions as __HttpHandlerOptions } from "@smithy/types";
|
|
4
10
|
export interface Tools {
|
|
11
|
+
/**
|
|
12
|
+
* @see {@link AddToolCommand}
|
|
13
|
+
*/
|
|
14
|
+
addTool(args: AddToolCommandInput, options?: __HttpHandlerOptions): Promise<AddToolCommandOutput>;
|
|
15
|
+
addTool(args: AddToolCommandInput, cb: (err: any, data?: AddToolCommandOutput) => void): void;
|
|
16
|
+
addTool(args: AddToolCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: AddToolCommandOutput) => void): void;
|
|
17
|
+
/**
|
|
18
|
+
* @see {@link DeleteToolCommand}
|
|
19
|
+
*/
|
|
20
|
+
deleteTool(args: DeleteToolCommandInput, options?: __HttpHandlerOptions): Promise<DeleteToolCommandOutput>;
|
|
21
|
+
deleteTool(args: DeleteToolCommandInput, cb: (err: any, data?: DeleteToolCommandOutput) => void): void;
|
|
22
|
+
deleteTool(args: DeleteToolCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: DeleteToolCommandOutput) => void): void;
|
|
23
|
+
/**
|
|
24
|
+
* @see {@link ExecuteToolCommand}
|
|
25
|
+
*/
|
|
26
|
+
executeTool(args: ExecuteToolCommandInput, options?: __HttpHandlerOptions): Promise<ExecuteToolCommandOutput>;
|
|
27
|
+
executeTool(args: ExecuteToolCommandInput, cb: (err: any, data?: ExecuteToolCommandOutput) => void): void;
|
|
28
|
+
executeTool(args: ExecuteToolCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: ExecuteToolCommandOutput) => void): void;
|
|
29
|
+
/**
|
|
30
|
+
* @see {@link GetToolCommand}
|
|
31
|
+
*/
|
|
32
|
+
getTool(args: GetToolCommandInput, options?: __HttpHandlerOptions): Promise<GetToolCommandOutput>;
|
|
33
|
+
getTool(args: GetToolCommandInput, cb: (err: any, data?: GetToolCommandOutput) => void): void;
|
|
34
|
+
getTool(args: GetToolCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: GetToolCommandOutput) => void): void;
|
|
35
|
+
/**
|
|
36
|
+
* @see {@link ListToolsCommand}
|
|
37
|
+
*/
|
|
38
|
+
listTools(): Promise<ListToolsCommandOutput>;
|
|
39
|
+
listTools(args: ListToolsCommandInput, options?: __HttpHandlerOptions): Promise<ListToolsCommandOutput>;
|
|
40
|
+
listTools(args: ListToolsCommandInput, cb: (err: any, data?: ListToolsCommandOutput) => void): void;
|
|
41
|
+
listTools(args: ListToolsCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: ListToolsCommandOutput) => void): void;
|
|
5
42
|
/**
|
|
6
43
|
* @see {@link TestEndpointCommand}
|
|
7
44
|
*/
|
|
@@ -9,6 +46,12 @@ export interface Tools {
|
|
|
9
46
|
testEndpoint(args: TestEndpointCommandInput, options?: __HttpHandlerOptions): Promise<TestEndpointCommandOutput>;
|
|
10
47
|
testEndpoint(args: TestEndpointCommandInput, cb: (err: any, data?: TestEndpointCommandOutput) => void): void;
|
|
11
48
|
testEndpoint(args: TestEndpointCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: TestEndpointCommandOutput) => void): void;
|
|
49
|
+
/**
|
|
50
|
+
* @see {@link UpdateToolCommand}
|
|
51
|
+
*/
|
|
52
|
+
updateTool(args: UpdateToolCommandInput, options?: __HttpHandlerOptions): Promise<UpdateToolCommandOutput>;
|
|
53
|
+
updateTool(args: UpdateToolCommandInput, cb: (err: any, data?: UpdateToolCommandOutput) => void): void;
|
|
54
|
+
updateTool(args: UpdateToolCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: UpdateToolCommandOutput) => void): void;
|
|
12
55
|
}
|
|
13
56
|
/**
|
|
14
57
|
* @public
|
|
@@ -1,20 +1,27 @@
|
|
|
1
|
+
import { AddToolCommandInput, AddToolCommandOutput } from "./commands/AddToolCommand";
|
|
2
|
+
import { DeleteToolCommandInput, DeleteToolCommandOutput } from "./commands/DeleteToolCommand";
|
|
3
|
+
import { ExecuteToolCommandInput, ExecuteToolCommandOutput } from "./commands/ExecuteToolCommand";
|
|
4
|
+
import { GetToolCommandInput, GetToolCommandOutput } from "./commands/GetToolCommand";
|
|
5
|
+
import { ListToolsCommandInput, ListToolsCommandOutput } from "./commands/ListToolsCommand";
|
|
1
6
|
import { TestEndpointCommandInput, TestEndpointCommandOutput } from "./commands/TestEndpointCommand";
|
|
7
|
+
import { UpdateToolCommandInput, UpdateToolCommandOutput } from "./commands/UpdateToolCommand";
|
|
2
8
|
import { RuntimeExtension, RuntimeExtensionsConfig } from "./runtimeExtensions";
|
|
9
|
+
import { HostHeaderInputConfig, HostHeaderResolvedConfig } from "@aws-sdk/middleware-host-header";
|
|
3
10
|
import { UserAgentInputConfig, UserAgentResolvedConfig } from "@aws-sdk/middleware-user-agent";
|
|
11
|
+
import { CustomEndpointsInputConfig, CustomEndpointsResolvedConfig, RegionInputConfig, RegionResolvedConfig } from "@smithy/config-resolver";
|
|
4
12
|
import { RetryInputConfig, RetryResolvedConfig } from "@smithy/middleware-retry";
|
|
5
13
|
import { HttpHandlerUserInput as __HttpHandlerUserInput } from "@smithy/protocol-http";
|
|
6
14
|
import { Client as __Client, DefaultsMode as __DefaultsMode, SmithyConfiguration as __SmithyConfiguration, SmithyResolvedConfiguration as __SmithyResolvedConfiguration } from "@smithy/smithy-client";
|
|
7
15
|
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";
|
|
8
|
-
import { TokenProvider } from '@wildix/smithy-utils';
|
|
9
16
|
export { __Client };
|
|
10
17
|
/**
|
|
11
18
|
* @public
|
|
12
19
|
*/
|
|
13
|
-
export type ServiceInputTypes = TestEndpointCommandInput;
|
|
20
|
+
export type ServiceInputTypes = AddToolCommandInput | DeleteToolCommandInput | ExecuteToolCommandInput | GetToolCommandInput | ListToolsCommandInput | TestEndpointCommandInput | UpdateToolCommandInput;
|
|
14
21
|
/**
|
|
15
22
|
* @public
|
|
16
23
|
*/
|
|
17
|
-
export type ServiceOutputTypes = TestEndpointCommandOutput;
|
|
24
|
+
export type ServiceOutputTypes = AddToolCommandOutput | DeleteToolCommandOutput | ExecuteToolCommandOutput | GetToolCommandOutput | ListToolsCommandOutput | TestEndpointCommandOutput | UpdateToolCommandOutput;
|
|
18
25
|
/**
|
|
19
26
|
* @public
|
|
20
27
|
*/
|
|
@@ -105,20 +112,18 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand
|
|
|
105
112
|
/**
|
|
106
113
|
* @public
|
|
107
114
|
*/
|
|
108
|
-
export type ToolsClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & ClientDefaults & UserAgentInputConfig & RetryInputConfig;
|
|
115
|
+
export type ToolsClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & ClientDefaults & UserAgentInputConfig & CustomEndpointsInputConfig & RetryInputConfig & RegionInputConfig & HostHeaderInputConfig;
|
|
109
116
|
/**
|
|
110
117
|
* @public
|
|
111
118
|
*
|
|
112
119
|
* The configuration interface of ToolsClient class constructor that set the region, credentials and other options.
|
|
113
120
|
*/
|
|
114
121
|
export interface ToolsClientConfig extends ToolsClientConfigType {
|
|
115
|
-
env?: 'stage' | 'stable' | 'prod';
|
|
116
|
-
token: TokenProvider;
|
|
117
122
|
}
|
|
118
123
|
/**
|
|
119
124
|
* @public
|
|
120
125
|
*/
|
|
121
|
-
export type ToolsClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required<ClientDefaults> & RuntimeExtensionsConfig & UserAgentResolvedConfig & RetryResolvedConfig;
|
|
126
|
+
export type ToolsClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required<ClientDefaults> & RuntimeExtensionsConfig & UserAgentResolvedConfig & CustomEndpointsResolvedConfig & RetryResolvedConfig & RegionResolvedConfig & HostHeaderResolvedConfig;
|
|
122
127
|
/**
|
|
123
128
|
* @public
|
|
124
129
|
*
|