@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.
Files changed (38) hide show
  1. package/dist-cjs/Tools.js +12 -0
  2. package/dist-cjs/ToolsClient.js +13 -15
  3. package/dist-cjs/commands/AddToolCommand.js +21 -0
  4. package/dist-cjs/commands/DeleteToolCommand.js +21 -0
  5. package/dist-cjs/commands/ExecuteToolCommand.js +21 -0
  6. package/dist-cjs/commands/GetToolCommand.js +21 -0
  7. package/dist-cjs/commands/ListToolsCommand.js +21 -0
  8. package/dist-cjs/commands/UpdateToolCommand.js +21 -0
  9. package/dist-cjs/commands/index.js +6 -0
  10. package/dist-cjs/models/models_0.js +45 -1
  11. package/dist-cjs/protocols/Aws_restJson1.js +306 -1
  12. package/dist-es/Tools.js +12 -0
  13. package/dist-es/ToolsClient.js +13 -15
  14. package/dist-es/commands/AddToolCommand.js +17 -0
  15. package/dist-es/commands/DeleteToolCommand.js +17 -0
  16. package/dist-es/commands/ExecuteToolCommand.js +17 -0
  17. package/dist-es/commands/GetToolCommand.js +17 -0
  18. package/dist-es/commands/ListToolsCommand.js +17 -0
  19. package/dist-es/commands/UpdateToolCommand.js +17 -0
  20. package/dist-es/commands/index.js +6 -0
  21. package/dist-es/models/models_0.js +41 -0
  22. package/dist-es/protocols/Aws_restJson1.js +295 -2
  23. package/dist-types/Tools.d.ts +43 -0
  24. package/dist-types/ToolsClient.d.ts +12 -7
  25. package/dist-types/commands/AddToolCommand.d.ts +98 -0
  26. package/dist-types/commands/DeleteToolCommand.d.ts +79 -0
  27. package/dist-types/commands/ExecuteToolCommand.d.ts +93 -0
  28. package/dist-types/commands/GetToolCommand.d.ts +91 -0
  29. package/dist-types/commands/ListToolsCommand.d.ts +103 -0
  30. package/dist-types/commands/TestEndpointCommand.d.ts +9 -3
  31. package/dist-types/commands/UpdateToolCommand.d.ts +95 -0
  32. package/dist-types/commands/index.d.ts +6 -0
  33. package/dist-types/models/models_0.d.ts +396 -0
  34. package/dist-types/protocols/Aws_restJson1.d.ts +54 -0
  35. package/dist-types/runtimeConfig.browser.d.ts +5 -2
  36. package/dist-types/runtimeConfig.d.ts +5 -2
  37. package/dist-types/runtimeConfig.native.d.ts +5 -2
  38. package/package.json +3 -4
package/dist-cjs/Tools.js CHANGED
@@ -2,10 +2,22 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Tools = void 0;
4
4
  const ToolsClient_1 = require("./ToolsClient");
5
+ const AddToolCommand_1 = require("./commands/AddToolCommand");
6
+ const DeleteToolCommand_1 = require("./commands/DeleteToolCommand");
7
+ const ExecuteToolCommand_1 = require("./commands/ExecuteToolCommand");
8
+ const GetToolCommand_1 = require("./commands/GetToolCommand");
9
+ const ListToolsCommand_1 = require("./commands/ListToolsCommand");
5
10
  const TestEndpointCommand_1 = require("./commands/TestEndpointCommand");
11
+ const UpdateToolCommand_1 = require("./commands/UpdateToolCommand");
6
12
  const smithy_client_1 = require("@smithy/smithy-client");
7
13
  const commands = {
14
+ AddToolCommand: AddToolCommand_1.AddToolCommand,
15
+ DeleteToolCommand: DeleteToolCommand_1.DeleteToolCommand,
16
+ ExecuteToolCommand: ExecuteToolCommand_1.ExecuteToolCommand,
17
+ GetToolCommand: GetToolCommand_1.GetToolCommand,
18
+ ListToolsCommand: ListToolsCommand_1.ListToolsCommand,
8
19
  TestEndpointCommand: TestEndpointCommand_1.TestEndpointCommand,
20
+ UpdateToolCommand: UpdateToolCommand_1.UpdateToolCommand,
9
21
  };
10
22
  class Tools extends ToolsClient_1.ToolsClient {
11
23
  }
@@ -3,12 +3,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ToolsClient = exports.__Client = void 0;
4
4
  const runtimeConfig_1 = require("./runtimeConfig");
5
5
  const runtimeExtensions_1 = require("./runtimeExtensions");
6
+ const middleware_host_header_1 = require("@aws-sdk/middleware-host-header");
7
+ const middleware_logger_1 = require("@aws-sdk/middleware-logger");
8
+ const middleware_recursion_detection_1 = require("@aws-sdk/middleware-recursion-detection");
6
9
  const middleware_user_agent_1 = require("@aws-sdk/middleware-user-agent");
10
+ const config_resolver_1 = require("@smithy/config-resolver");
7
11
  const middleware_content_length_1 = require("@smithy/middleware-content-length");
8
12
  const middleware_retry_1 = require("@smithy/middleware-retry");
9
13
  const smithy_client_1 = require("@smithy/smithy-client");
10
14
  Object.defineProperty(exports, "__Client", { enumerable: true, get: function () { return smithy_client_1.Client; } });
11
- const smithy_utils_1 = require("@wildix/smithy-utils");
12
15
  class ToolsClient extends smithy_client_1.Client {
13
16
  config;
14
17
  constructor(...[configuration]) {
@@ -16,23 +19,18 @@ class ToolsClient extends smithy_client_1.Client {
16
19
  super(_config_0);
17
20
  this.initConfig = _config_0;
18
21
  let _config_1 = (0, middleware_user_agent_1.resolveUserAgentConfig)(_config_0);
19
- let _config_2 = (0, middleware_retry_1.resolveRetryConfig)(_config_1);
20
- let _config_3 = (0, runtimeExtensions_1.resolveRuntimeExtensions)(_config_2, configuration?.extensions || []);
21
- const hostname = ['stable', 'stage'].includes(configuration.env || '') ? `tools.wim-${configuration.env}.wildix.com` : 'tools.wim.wildix.com';
22
- const endpoint = () => {
23
- return {
24
- hostname,
25
- protocol: "https",
26
- port: '443',
27
- path: ''
28
- };
29
- };
30
- const config = { ..._config_3, endpoint };
31
- this.config = config;
32
- this.middlewareStack.add(smithy_utils_1.authorizationMiddleware.bind(this, configuration.token), { step: "build" });
22
+ let _config_2 = (0, config_resolver_1.resolveCustomEndpointsConfig)(_config_1);
23
+ let _config_3 = (0, middleware_retry_1.resolveRetryConfig)(_config_2);
24
+ let _config_4 = (0, config_resolver_1.resolveRegionConfig)(_config_3);
25
+ let _config_5 = (0, middleware_host_header_1.resolveHostHeaderConfig)(_config_4);
26
+ let _config_6 = (0, runtimeExtensions_1.resolveRuntimeExtensions)(_config_5, configuration?.extensions || []);
27
+ this.config = _config_6;
33
28
  this.middlewareStack.use((0, middleware_user_agent_1.getUserAgentPlugin)(this.config));
34
29
  this.middlewareStack.use((0, middleware_retry_1.getRetryPlugin)(this.config));
35
30
  this.middlewareStack.use((0, middleware_content_length_1.getContentLengthPlugin)(this.config));
31
+ this.middlewareStack.use((0, middleware_host_header_1.getHostHeaderPlugin)(this.config));
32
+ this.middlewareStack.use((0, middleware_logger_1.getLoggerPlugin)(this.config));
33
+ this.middlewareStack.use((0, middleware_recursion_detection_1.getRecursionDetectionPlugin)(this.config));
36
34
  }
37
35
  destroy() {
38
36
  super.destroy();
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AddToolCommand = exports.$Command = void 0;
4
+ const Aws_restJson1_1 = require("../protocols/Aws_restJson1");
5
+ const middleware_serde_1 = require("@smithy/middleware-serde");
6
+ const smithy_client_1 = require("@smithy/smithy-client");
7
+ Object.defineProperty(exports, "$Command", { enumerable: true, get: function () { return smithy_client_1.Command; } });
8
+ class AddToolCommand extends smithy_client_1.Command.classBuilder()
9
+ .m(function (Command, cs, config, o) {
10
+ return [
11
+ (0, middleware_serde_1.getSerdePlugin)(config, this.serialize, this.deserialize),
12
+ ];
13
+ })
14
+ .s("Tools", "AddTool", {})
15
+ .n("ToolsClient", "AddToolCommand")
16
+ .f(void 0, void 0)
17
+ .ser(Aws_restJson1_1.se_AddToolCommand)
18
+ .de(Aws_restJson1_1.de_AddToolCommand)
19
+ .build() {
20
+ }
21
+ exports.AddToolCommand = AddToolCommand;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DeleteToolCommand = exports.$Command = void 0;
4
+ const Aws_restJson1_1 = require("../protocols/Aws_restJson1");
5
+ const middleware_serde_1 = require("@smithy/middleware-serde");
6
+ const smithy_client_1 = require("@smithy/smithy-client");
7
+ Object.defineProperty(exports, "$Command", { enumerable: true, get: function () { return smithy_client_1.Command; } });
8
+ class DeleteToolCommand extends smithy_client_1.Command.classBuilder()
9
+ .m(function (Command, cs, config, o) {
10
+ return [
11
+ (0, middleware_serde_1.getSerdePlugin)(config, this.serialize, this.deserialize),
12
+ ];
13
+ })
14
+ .s("Tools", "DeleteTool", {})
15
+ .n("ToolsClient", "DeleteToolCommand")
16
+ .f(void 0, void 0)
17
+ .ser(Aws_restJson1_1.se_DeleteToolCommand)
18
+ .de(Aws_restJson1_1.de_DeleteToolCommand)
19
+ .build() {
20
+ }
21
+ exports.DeleteToolCommand = DeleteToolCommand;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ExecuteToolCommand = exports.$Command = void 0;
4
+ const Aws_restJson1_1 = require("../protocols/Aws_restJson1");
5
+ const middleware_serde_1 = require("@smithy/middleware-serde");
6
+ const smithy_client_1 = require("@smithy/smithy-client");
7
+ Object.defineProperty(exports, "$Command", { enumerable: true, get: function () { return smithy_client_1.Command; } });
8
+ class ExecuteToolCommand extends smithy_client_1.Command.classBuilder()
9
+ .m(function (Command, cs, config, o) {
10
+ return [
11
+ (0, middleware_serde_1.getSerdePlugin)(config, this.serialize, this.deserialize),
12
+ ];
13
+ })
14
+ .s("Tools", "ExecuteTool", {})
15
+ .n("ToolsClient", "ExecuteToolCommand")
16
+ .f(void 0, void 0)
17
+ .ser(Aws_restJson1_1.se_ExecuteToolCommand)
18
+ .de(Aws_restJson1_1.de_ExecuteToolCommand)
19
+ .build() {
20
+ }
21
+ exports.ExecuteToolCommand = ExecuteToolCommand;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetToolCommand = exports.$Command = void 0;
4
+ const Aws_restJson1_1 = require("../protocols/Aws_restJson1");
5
+ const middleware_serde_1 = require("@smithy/middleware-serde");
6
+ const smithy_client_1 = require("@smithy/smithy-client");
7
+ Object.defineProperty(exports, "$Command", { enumerable: true, get: function () { return smithy_client_1.Command; } });
8
+ class GetToolCommand extends smithy_client_1.Command.classBuilder()
9
+ .m(function (Command, cs, config, o) {
10
+ return [
11
+ (0, middleware_serde_1.getSerdePlugin)(config, this.serialize, this.deserialize),
12
+ ];
13
+ })
14
+ .s("Tools", "GetTool", {})
15
+ .n("ToolsClient", "GetToolCommand")
16
+ .f(void 0, void 0)
17
+ .ser(Aws_restJson1_1.se_GetToolCommand)
18
+ .de(Aws_restJson1_1.de_GetToolCommand)
19
+ .build() {
20
+ }
21
+ exports.GetToolCommand = GetToolCommand;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ListToolsCommand = exports.$Command = void 0;
4
+ const Aws_restJson1_1 = require("../protocols/Aws_restJson1");
5
+ const middleware_serde_1 = require("@smithy/middleware-serde");
6
+ const smithy_client_1 = require("@smithy/smithy-client");
7
+ Object.defineProperty(exports, "$Command", { enumerable: true, get: function () { return smithy_client_1.Command; } });
8
+ class ListToolsCommand extends smithy_client_1.Command.classBuilder()
9
+ .m(function (Command, cs, config, o) {
10
+ return [
11
+ (0, middleware_serde_1.getSerdePlugin)(config, this.serialize, this.deserialize),
12
+ ];
13
+ })
14
+ .s("Tools", "ListTools", {})
15
+ .n("ToolsClient", "ListToolsCommand")
16
+ .f(void 0, void 0)
17
+ .ser(Aws_restJson1_1.se_ListToolsCommand)
18
+ .de(Aws_restJson1_1.de_ListToolsCommand)
19
+ .build() {
20
+ }
21
+ exports.ListToolsCommand = ListToolsCommand;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UpdateToolCommand = exports.$Command = void 0;
4
+ const Aws_restJson1_1 = require("../protocols/Aws_restJson1");
5
+ const middleware_serde_1 = require("@smithy/middleware-serde");
6
+ const smithy_client_1 = require("@smithy/smithy-client");
7
+ Object.defineProperty(exports, "$Command", { enumerable: true, get: function () { return smithy_client_1.Command; } });
8
+ class UpdateToolCommand extends smithy_client_1.Command.classBuilder()
9
+ .m(function (Command, cs, config, o) {
10
+ return [
11
+ (0, middleware_serde_1.getSerdePlugin)(config, this.serialize, this.deserialize),
12
+ ];
13
+ })
14
+ .s("Tools", "UpdateTool", {})
15
+ .n("ToolsClient", "UpdateToolCommand")
16
+ .f(void 0, void 0)
17
+ .ser(Aws_restJson1_1.se_UpdateToolCommand)
18
+ .de(Aws_restJson1_1.de_UpdateToolCommand)
19
+ .build() {
20
+ }
21
+ exports.UpdateToolCommand = UpdateToolCommand;
@@ -1,4 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./AddToolCommand"), exports);
5
+ tslib_1.__exportStar(require("./DeleteToolCommand"), exports);
6
+ tslib_1.__exportStar(require("./ExecuteToolCommand"), exports);
7
+ tslib_1.__exportStar(require("./GetToolCommand"), exports);
8
+ tslib_1.__exportStar(require("./ListToolsCommand"), exports);
4
9
  tslib_1.__exportStar(require("./TestEndpointCommand"), exports);
10
+ tslib_1.__exportStar(require("./UpdateToolCommand"), exports);
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ValidationException = void 0;
3
+ exports.ToolNotFoundException = exports.ToolExecutionException = exports.ToolAlreadyExistsException = exports.ToolType = exports.ValidationException = void 0;
4
4
  const ToolsServiceException_1 = require("./ToolsServiceException");
5
5
  class ValidationException extends ToolsServiceException_1.ToolsServiceException {
6
6
  name = "ValidationException";
@@ -15,3 +15,47 @@ class ValidationException extends ToolsServiceException_1.ToolsServiceException
15
15
  }
16
16
  }
17
17
  exports.ValidationException = ValidationException;
18
+ exports.ToolType = {
19
+ EMAIL: "EMAIL",
20
+ };
21
+ class ToolAlreadyExistsException extends ToolsServiceException_1.ToolsServiceException {
22
+ name = "ToolAlreadyExistsException";
23
+ $fault = "client";
24
+ constructor(opts) {
25
+ super({
26
+ name: "ToolAlreadyExistsException",
27
+ $fault: "client",
28
+ ...opts
29
+ });
30
+ Object.setPrototypeOf(this, ToolAlreadyExistsException.prototype);
31
+ }
32
+ }
33
+ exports.ToolAlreadyExistsException = ToolAlreadyExistsException;
34
+ class ToolExecutionException extends ToolsServiceException_1.ToolsServiceException {
35
+ name = "ToolExecutionException";
36
+ $fault = "server";
37
+ details;
38
+ constructor(opts) {
39
+ super({
40
+ name: "ToolExecutionException",
41
+ $fault: "server",
42
+ ...opts
43
+ });
44
+ Object.setPrototypeOf(this, ToolExecutionException.prototype);
45
+ this.details = opts.details;
46
+ }
47
+ }
48
+ exports.ToolExecutionException = ToolExecutionException;
49
+ class ToolNotFoundException extends ToolsServiceException_1.ToolsServiceException {
50
+ name = "ToolNotFoundException";
51
+ $fault = "client";
52
+ constructor(opts) {
53
+ super({
54
+ name: "ToolNotFoundException",
55
+ $fault: "client",
56
+ ...opts
57
+ });
58
+ Object.setPrototypeOf(this, ToolNotFoundException.prototype);
59
+ }
60
+ }
61
+ exports.ToolNotFoundException = ToolNotFoundException;
@@ -1,11 +1,97 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.de_TestEndpointCommand = exports.se_TestEndpointCommand = void 0;
3
+ exports.de_UpdateToolCommand = exports.de_TestEndpointCommand = exports.de_ListToolsCommand = exports.de_GetToolCommand = exports.de_ExecuteToolCommand = exports.de_DeleteToolCommand = exports.de_AddToolCommand = exports.se_UpdateToolCommand = exports.se_TestEndpointCommand = exports.se_ListToolsCommand = exports.se_GetToolCommand = exports.se_ExecuteToolCommand = exports.se_DeleteToolCommand = exports.se_AddToolCommand = void 0;
4
4
  const ToolsServiceException_1 = require("../models/ToolsServiceException");
5
5
  const models_0_1 = require("../models/models_0");
6
6
  const core_1 = require("@aws-sdk/core");
7
7
  const core_2 = require("@smithy/core");
8
8
  const smithy_client_1 = require("@smithy/smithy-client");
9
+ const se_AddToolCommand = async (input, context) => {
10
+ const b = (0, core_2.requestBuilder)(input, context);
11
+ const headers = (0, smithy_client_1.map)({}, smithy_client_1.isSerializableHeaderValue, {
12
+ 'content-type': 'application/json',
13
+ [_xci]: input[_c],
14
+ });
15
+ b.bp("/v1/tools");
16
+ let body;
17
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
18
+ 'config': _ => se_Document(_, context),
19
+ 'description': [],
20
+ 'jsonSchema': _ => se_Document(_, context),
21
+ 'name': [],
22
+ 'type': [],
23
+ }));
24
+ b.m("POST")
25
+ .h(headers)
26
+ .b(body);
27
+ return b.build();
28
+ };
29
+ exports.se_AddToolCommand = se_AddToolCommand;
30
+ const se_DeleteToolCommand = async (input, context) => {
31
+ const b = (0, core_2.requestBuilder)(input, context);
32
+ const headers = (0, smithy_client_1.map)({}, smithy_client_1.isSerializableHeaderValue, {
33
+ [_xci]: input[_c],
34
+ });
35
+ b.bp("/v1/tools/{toolId}");
36
+ b.p('toolId', () => input.toolId, '{toolId}', false);
37
+ let body;
38
+ b.m("DELETE")
39
+ .h(headers)
40
+ .b(body);
41
+ return b.build();
42
+ };
43
+ exports.se_DeleteToolCommand = se_DeleteToolCommand;
44
+ const se_ExecuteToolCommand = async (input, context) => {
45
+ const b = (0, core_2.requestBuilder)(input, context);
46
+ const headers = (0, smithy_client_1.map)({}, smithy_client_1.isSerializableHeaderValue, {
47
+ 'content-type': 'application/json',
48
+ [_xci]: input[_c],
49
+ });
50
+ b.bp("/v1/tools/execute");
51
+ let body;
52
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
53
+ 'context': _ => se_ExecutionContext(_, context),
54
+ 'parameters': _ => se_Document(_, context),
55
+ 'toolId': [],
56
+ }));
57
+ b.m("POST")
58
+ .h(headers)
59
+ .b(body);
60
+ return b.build();
61
+ };
62
+ exports.se_ExecuteToolCommand = se_ExecuteToolCommand;
63
+ const se_GetToolCommand = async (input, context) => {
64
+ const b = (0, core_2.requestBuilder)(input, context);
65
+ const headers = {};
66
+ b.bp("/v1/tools/{toolId}");
67
+ b.p('toolId', () => input.toolId, '{toolId}', false);
68
+ const query = (0, smithy_client_1.map)({
69
+ [_c]: [, input[_c]],
70
+ });
71
+ let body;
72
+ b.m("GET")
73
+ .h(headers)
74
+ .q(query)
75
+ .b(body);
76
+ return b.build();
77
+ };
78
+ exports.se_GetToolCommand = se_GetToolCommand;
79
+ const se_ListToolsCommand = async (input, context) => {
80
+ const b = (0, core_2.requestBuilder)(input, context);
81
+ const headers = {};
82
+ b.bp("/v1/tools");
83
+ const query = (0, smithy_client_1.map)({
84
+ [_c]: [, input[_c]],
85
+ [_f]: [, input[_f]],
86
+ });
87
+ let body;
88
+ b.m("GET")
89
+ .h(headers)
90
+ .q(query)
91
+ .b(body);
92
+ return b.build();
93
+ };
94
+ exports.se_ListToolsCommand = se_ListToolsCommand;
9
95
  const se_TestEndpointCommand = async (input, context) => {
10
96
  const b = (0, core_2.requestBuilder)(input, context);
11
97
  const headers = {};
@@ -21,6 +107,99 @@ const se_TestEndpointCommand = async (input, context) => {
21
107
  return b.build();
22
108
  };
23
109
  exports.se_TestEndpointCommand = se_TestEndpointCommand;
110
+ const se_UpdateToolCommand = async (input, context) => {
111
+ const b = (0, core_2.requestBuilder)(input, context);
112
+ const headers = (0, smithy_client_1.map)({}, smithy_client_1.isSerializableHeaderValue, {
113
+ 'content-type': 'application/json',
114
+ [_xci]: input[_c],
115
+ });
116
+ b.bp("/v1/tools/{toolId}");
117
+ b.p('toolId', () => input.toolId, '{toolId}', false);
118
+ let body;
119
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
120
+ 'config': _ => se_Document(_, context),
121
+ 'description': [],
122
+ 'jsonSchema': _ => se_Document(_, context),
123
+ 'name': [],
124
+ }));
125
+ b.m("PUT")
126
+ .h(headers)
127
+ .b(body);
128
+ return b.build();
129
+ };
130
+ exports.se_UpdateToolCommand = se_UpdateToolCommand;
131
+ const de_AddToolCommand = async (output, context) => {
132
+ if (output.statusCode !== 201 && output.statusCode >= 300) {
133
+ return de_CommandError(output, context);
134
+ }
135
+ const contents = (0, smithy_client_1.map)({
136
+ $metadata: deserializeMetadata(output),
137
+ });
138
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
139
+ const doc = (0, smithy_client_1.take)(data, {
140
+ 'tool': _ => de_Tool(_, context),
141
+ });
142
+ Object.assign(contents, doc);
143
+ return contents;
144
+ };
145
+ exports.de_AddToolCommand = de_AddToolCommand;
146
+ const de_DeleteToolCommand = async (output, context) => {
147
+ if (output.statusCode !== 204 && output.statusCode >= 300) {
148
+ return de_CommandError(output, context);
149
+ }
150
+ const contents = (0, smithy_client_1.map)({
151
+ $metadata: deserializeMetadata(output),
152
+ });
153
+ await (0, smithy_client_1.collectBody)(output.body, context);
154
+ return contents;
155
+ };
156
+ exports.de_DeleteToolCommand = de_DeleteToolCommand;
157
+ const de_ExecuteToolCommand = async (output, context) => {
158
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
159
+ return de_CommandError(output, context);
160
+ }
161
+ const contents = (0, smithy_client_1.map)({
162
+ $metadata: deserializeMetadata(output),
163
+ });
164
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
165
+ const doc = (0, smithy_client_1.take)(data, {
166
+ 'result': _ => de_ExecutionResult(_, context),
167
+ });
168
+ Object.assign(contents, doc);
169
+ return contents;
170
+ };
171
+ exports.de_ExecuteToolCommand = de_ExecuteToolCommand;
172
+ const de_GetToolCommand = async (output, context) => {
173
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
174
+ return de_CommandError(output, context);
175
+ }
176
+ const contents = (0, smithy_client_1.map)({
177
+ $metadata: deserializeMetadata(output),
178
+ });
179
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
180
+ const doc = (0, smithy_client_1.take)(data, {
181
+ 'tool': _ => de_Tool(_, context),
182
+ });
183
+ Object.assign(contents, doc);
184
+ return contents;
185
+ };
186
+ exports.de_GetToolCommand = de_GetToolCommand;
187
+ const de_ListToolsCommand = async (output, context) => {
188
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
189
+ return de_CommandError(output, context);
190
+ }
191
+ const contents = (0, smithy_client_1.map)({
192
+ $metadata: deserializeMetadata(output),
193
+ });
194
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
195
+ const doc = (0, smithy_client_1.take)(data, {
196
+ 'llmTools': _ => de_LlmToolDefinitionsList(_, context),
197
+ 'tools': _ => de_ToolsList(_, context),
198
+ });
199
+ Object.assign(contents, doc);
200
+ return contents;
201
+ };
202
+ exports.de_ListToolsCommand = de_ListToolsCommand;
24
203
  const de_TestEndpointCommand = async (output, context) => {
25
204
  if (output.statusCode !== 200 && output.statusCode >= 300) {
26
205
  return de_CommandError(output, context);
@@ -37,6 +216,21 @@ const de_TestEndpointCommand = async (output, context) => {
37
216
  return contents;
38
217
  };
39
218
  exports.de_TestEndpointCommand = de_TestEndpointCommand;
219
+ const de_UpdateToolCommand = async (output, context) => {
220
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
221
+ return de_CommandError(output, context);
222
+ }
223
+ const contents = (0, smithy_client_1.map)({
224
+ $metadata: deserializeMetadata(output),
225
+ });
226
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
227
+ const doc = (0, smithy_client_1.take)(data, {
228
+ 'tool': _ => de_Tool(_, context),
229
+ });
230
+ Object.assign(contents, doc);
231
+ return contents;
232
+ };
233
+ exports.de_UpdateToolCommand = de_UpdateToolCommand;
40
234
  const de_CommandError = async (output, context) => {
41
235
  const parsedOutput = {
42
236
  ...output,
@@ -44,6 +238,15 @@ const de_CommandError = async (output, context) => {
44
238
  };
45
239
  const errorCode = (0, core_1.loadRestJsonErrorCode)(output, parsedOutput.body);
46
240
  switch (errorCode) {
241
+ case "ToolAlreadyExistsException":
242
+ case "wildix.wim.tools#ToolAlreadyExistsException":
243
+ throw await de_ToolAlreadyExistsExceptionRes(parsedOutput, context);
244
+ case "ToolExecutionException":
245
+ case "wildix.wim.tools#ToolExecutionException":
246
+ throw await de_ToolExecutionExceptionRes(parsedOutput, context);
247
+ case "ToolNotFoundException":
248
+ case "wildix.wim.tools#ToolNotFoundException":
249
+ throw await de_ToolNotFoundExceptionRes(parsedOutput, context);
47
250
  case "ValidationException":
48
251
  case "smithy.framework#ValidationException":
49
252
  throw await de_ValidationExceptionRes(parsedOutput, context);
@@ -70,6 +273,106 @@ const de_ValidationExceptionRes = async (parsedOutput, context) => {
70
273
  });
71
274
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
72
275
  };
276
+ const de_ToolAlreadyExistsExceptionRes = async (parsedOutput, context) => {
277
+ const contents = (0, smithy_client_1.map)({});
278
+ const data = parsedOutput.body;
279
+ const doc = (0, smithy_client_1.take)(data, {
280
+ 'message': smithy_client_1.expectString,
281
+ });
282
+ Object.assign(contents, doc);
283
+ const exception = new models_0_1.ToolAlreadyExistsException({
284
+ $metadata: deserializeMetadata(parsedOutput),
285
+ ...contents
286
+ });
287
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
288
+ };
289
+ const de_ToolExecutionExceptionRes = async (parsedOutput, context) => {
290
+ const contents = (0, smithy_client_1.map)({});
291
+ const data = parsedOutput.body;
292
+ const doc = (0, smithy_client_1.take)(data, {
293
+ 'details': _ => de_Document(_, context),
294
+ 'message': smithy_client_1.expectString,
295
+ });
296
+ Object.assign(contents, doc);
297
+ const exception = new models_0_1.ToolExecutionException({
298
+ $metadata: deserializeMetadata(parsedOutput),
299
+ ...contents
300
+ });
301
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
302
+ };
303
+ const de_ToolNotFoundExceptionRes = async (parsedOutput, context) => {
304
+ const contents = (0, smithy_client_1.map)({});
305
+ const data = parsedOutput.body;
306
+ const doc = (0, smithy_client_1.take)(data, {
307
+ 'message': smithy_client_1.expectString,
308
+ });
309
+ Object.assign(contents, doc);
310
+ const exception = new models_0_1.ToolNotFoundException({
311
+ $metadata: deserializeMetadata(parsedOutput),
312
+ ...contents
313
+ });
314
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
315
+ };
316
+ const se_Document = (input, context) => {
317
+ return input;
318
+ };
319
+ const se_ExecutionContext = (input, context) => {
320
+ return (0, smithy_client_1.take)(input, {
321
+ 'company': [],
322
+ 'metadata': _ => se_Document(_, context),
323
+ 'sessionId': [],
324
+ 'userId': [],
325
+ });
326
+ };
327
+ const de_Document = (output, context) => {
328
+ return output;
329
+ };
330
+ const de_ExecutionResult = (output, context) => {
331
+ return (0, smithy_client_1.take)(output, {
332
+ 'error': smithy_client_1.expectString,
333
+ 'result': (_) => de_Document(_, context),
334
+ 'success': smithy_client_1.expectBoolean,
335
+ 'traceId': smithy_client_1.expectString,
336
+ });
337
+ };
338
+ const de_LlmFunctionDefinition = (output, context) => {
339
+ return (0, smithy_client_1.take)(output, {
340
+ 'description': smithy_client_1.expectString,
341
+ 'name': smithy_client_1.expectString,
342
+ 'parameters': (_) => de_Document(_, context),
343
+ });
344
+ };
345
+ const de_LlmToolDefinition = (output, context) => {
346
+ return (0, smithy_client_1.take)(output, {
347
+ 'function': (_) => de_LlmFunctionDefinition(_, context),
348
+ 'type': smithy_client_1.expectString,
349
+ });
350
+ };
351
+ const de_LlmToolDefinitionsList = (output, context) => {
352
+ const retVal = (output || []).filter((e) => e != null).map((entry) => {
353
+ return de_LlmToolDefinition(entry, context);
354
+ });
355
+ return retVal;
356
+ };
357
+ const de_Tool = (output, context) => {
358
+ return (0, smithy_client_1.take)(output, {
359
+ 'company': smithy_client_1.expectString,
360
+ 'config': (_) => de_Document(_, context),
361
+ 'createdAt': (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
362
+ 'description': smithy_client_1.expectString,
363
+ 'id': smithy_client_1.expectString,
364
+ 'jsonSchema': (_) => de_Document(_, context),
365
+ 'name': smithy_client_1.expectString,
366
+ 'type': smithy_client_1.expectString,
367
+ 'updatedAt': (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
368
+ });
369
+ };
370
+ const de_ToolsList = (output, context) => {
371
+ const retVal = (output || []).filter((e) => e != null).map((entry) => {
372
+ return de_Tool(entry, context);
373
+ });
374
+ return retVal;
375
+ };
73
376
  const deserializeMetadata = (output) => ({
74
377
  httpStatusCode: output.statusCode,
75
378
  requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
@@ -78,3 +381,5 @@ const deserializeMetadata = (output) => ({
78
381
  });
79
382
  const collectBodyString = (streamBody, context) => (0, smithy_client_1.collectBody)(streamBody, context).then(body => context.utf8Encoder(body));
80
383
  const _c = "company";
384
+ const _f = "format";
385
+ const _xci = "x-company-id";
package/dist-es/Tools.js CHANGED
@@ -1,8 +1,20 @@
1
1
  import { ToolsClient, } from "./ToolsClient";
2
+ import { AddToolCommand, } from "./commands/AddToolCommand";
3
+ import { DeleteToolCommand, } from "./commands/DeleteToolCommand";
4
+ import { ExecuteToolCommand, } from "./commands/ExecuteToolCommand";
5
+ import { GetToolCommand, } from "./commands/GetToolCommand";
6
+ import { ListToolsCommand, } from "./commands/ListToolsCommand";
2
7
  import { TestEndpointCommand, } from "./commands/TestEndpointCommand";
8
+ import { UpdateToolCommand, } from "./commands/UpdateToolCommand";
3
9
  import { createAggregatedClient } from "@smithy/smithy-client";
4
10
  const commands = {
11
+ AddToolCommand,
12
+ DeleteToolCommand,
13
+ ExecuteToolCommand,
14
+ GetToolCommand,
15
+ ListToolsCommand,
5
16
  TestEndpointCommand,
17
+ UpdateToolCommand,
6
18
  };
7
19
  export class Tools extends ToolsClient {
8
20
  }