@wildix/wim-tools-client 0.0.9 → 0.0.11

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 (31) hide show
  1. package/dist-cjs/Tools.js +4 -2
  2. package/dist-cjs/ToolsClient.js +6 -11
  3. package/dist-cjs/commands/{AddToolCommand.js → CreateToolCommand.js} +7 -7
  4. package/dist-cjs/commands/DescribeToolsCommand.js +21 -0
  5. package/dist-cjs/commands/index.js +2 -1
  6. package/dist-cjs/models/models_0.js +85 -22
  7. package/dist-cjs/protocols/Aws_restJson1.js +70 -84
  8. package/dist-es/Tools.js +4 -2
  9. package/dist-es/ToolsClient.js +6 -11
  10. package/dist-es/commands/{AddToolCommand.js → CreateToolCommand.js} +6 -6
  11. package/dist-es/commands/DescribeToolsCommand.js +17 -0
  12. package/dist-es/commands/index.js +2 -1
  13. package/dist-es/models/models_0.js +82 -19
  14. package/dist-es/protocols/Aws_restJson1.js +67 -83
  15. package/dist-types/Tools.d.ts +12 -5
  16. package/dist-types/ToolsClient.d.ts +5 -3
  17. package/dist-types/commands/CreateToolCommand.d.ts +303 -0
  18. package/dist-types/commands/DeleteToolCommand.d.ts +5 -5
  19. package/dist-types/commands/DescribeToolsCommand.d.ts +97 -0
  20. package/dist-types/commands/ExecuteToolCommand.d.ts +13 -16
  21. package/dist-types/commands/GetToolCommand.d.ts +114 -11
  22. package/dist-types/commands/ListToolsCommand.d.ts +114 -22
  23. package/dist-types/commands/UpdateToolCommand.d.ts +222 -13
  24. package/dist-types/commands/index.d.ts +2 -1
  25. package/dist-types/models/models_0.d.ts +380 -273
  26. package/dist-types/protocols/Aws_restJson1.d.ts +14 -5
  27. package/dist-types/runtimeConfig.browser.d.ts +1 -0
  28. package/dist-types/runtimeConfig.d.ts +1 -0
  29. package/dist-types/runtimeConfig.native.d.ts +1 -0
  30. package/package.json +2 -2
  31. package/dist-types/commands/AddToolCommand.d.ts +0 -98
package/dist-cjs/Tools.js CHANGED
@@ -2,16 +2,18 @@
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");
5
+ const CreateToolCommand_1 = require("./commands/CreateToolCommand");
6
6
  const DeleteToolCommand_1 = require("./commands/DeleteToolCommand");
7
+ const DescribeToolsCommand_1 = require("./commands/DescribeToolsCommand");
7
8
  const ExecuteToolCommand_1 = require("./commands/ExecuteToolCommand");
8
9
  const GetToolCommand_1 = require("./commands/GetToolCommand");
9
10
  const ListToolsCommand_1 = require("./commands/ListToolsCommand");
10
11
  const UpdateToolCommand_1 = require("./commands/UpdateToolCommand");
11
12
  const smithy_client_1 = require("@smithy/smithy-client");
12
13
  const commands = {
13
- AddToolCommand: AddToolCommand_1.AddToolCommand,
14
+ CreateToolCommand: CreateToolCommand_1.CreateToolCommand,
14
15
  DeleteToolCommand: DeleteToolCommand_1.DeleteToolCommand,
16
+ DescribeToolsCommand: DescribeToolsCommand_1.DescribeToolsCommand,
15
17
  ExecuteToolCommand: ExecuteToolCommand_1.ExecuteToolCommand,
16
18
  GetToolCommand: GetToolCommand_1.GetToolCommand,
17
19
  ListToolsCommand: ListToolsCommand_1.ListToolsCommand,
@@ -3,8 +3,6 @@ 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_logger_1 = require("@aws-sdk/middleware-logger");
7
- const middleware_recursion_detection_1 = require("@aws-sdk/middleware-recursion-detection");
8
6
  const middleware_user_agent_1 = require("@aws-sdk/middleware-user-agent");
9
7
  const middleware_content_length_1 = require("@smithy/middleware-content-length");
10
8
  const middleware_retry_1 = require("@smithy/middleware-retry");
@@ -20,23 +18,20 @@ class ToolsClient extends smithy_client_1.Client {
20
18
  let _config_1 = (0, middleware_user_agent_1.resolveUserAgentConfig)(_config_0);
21
19
  let _config_2 = (0, middleware_retry_1.resolveRetryConfig)(_config_1);
22
20
  let _config_3 = (0, runtimeExtensions_1.resolveRuntimeExtensions)(_config_2, configuration?.extensions || []);
23
- const hostname = ['stable', 'stage'].includes(configuration.env || '') ? `tools.wim-${configuration.env}.wildix.com` : 'tools.wim.wildix.com';
24
- const endpoint = () => {
21
+ const endpoint = configuration.endpoint || (() => {
25
22
  return {
26
- hostname,
23
+ hostname: ['stable', 'stage'].includes(configuration.env || '') ? `tools.wim-${configuration.env}.wildix.com` : 'tools.wim.wildix.com',
27
24
  protocol: "https",
28
25
  port: '443',
29
- path: '/'
26
+ path: ''
30
27
  };
31
- };
32
- _config_3.endpoint = endpoint;
33
- this.config = _config_3;
28
+ });
29
+ const config = { ..._config_3, endpoint };
30
+ this.config = config;
34
31
  this.middlewareStack.add(smithy_utils_1.authorizationMiddleware.bind(this, configuration.token), { step: "build" });
35
32
  this.middlewareStack.use((0, middleware_user_agent_1.getUserAgentPlugin)(this.config));
36
33
  this.middlewareStack.use((0, middleware_retry_1.getRetryPlugin)(this.config));
37
34
  this.middlewareStack.use((0, middleware_content_length_1.getContentLengthPlugin)(this.config));
38
- this.middlewareStack.use((0, middleware_logger_1.getLoggerPlugin)(this.config));
39
- this.middlewareStack.use((0, middleware_recursion_detection_1.getRecursionDetectionPlugin)(this.config));
40
35
  }
41
36
  destroy() {
42
37
  super.destroy();
@@ -1,21 +1,21 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AddToolCommand = exports.$Command = void 0;
3
+ exports.CreateToolCommand = exports.$Command = void 0;
4
4
  const Aws_restJson1_1 = require("../protocols/Aws_restJson1");
5
5
  const middleware_serde_1 = require("@smithy/middleware-serde");
6
6
  const smithy_client_1 = require("@smithy/smithy-client");
7
7
  Object.defineProperty(exports, "$Command", { enumerable: true, get: function () { return smithy_client_1.Command; } });
8
- class AddToolCommand extends smithy_client_1.Command.classBuilder()
8
+ class CreateToolCommand extends smithy_client_1.Command.classBuilder()
9
9
  .m(function (Command, cs, config, o) {
10
10
  return [
11
11
  (0, middleware_serde_1.getSerdePlugin)(config, this.serialize, this.deserialize),
12
12
  ];
13
13
  })
14
- .s("Tools", "AddTool", {})
15
- .n("ToolsClient", "AddToolCommand")
14
+ .s("Tools", "CreateTool", {})
15
+ .n("ToolsClient", "CreateToolCommand")
16
16
  .f(void 0, void 0)
17
- .ser(Aws_restJson1_1.se_AddToolCommand)
18
- .de(Aws_restJson1_1.de_AddToolCommand)
17
+ .ser(Aws_restJson1_1.se_CreateToolCommand)
18
+ .de(Aws_restJson1_1.de_CreateToolCommand)
19
19
  .build() {
20
20
  }
21
- exports.AddToolCommand = AddToolCommand;
21
+ exports.CreateToolCommand = CreateToolCommand;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DescribeToolsCommand = 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 DescribeToolsCommand 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", "DescribeTools", {})
15
+ .n("ToolsClient", "DescribeToolsCommand")
16
+ .f(void 0, void 0)
17
+ .ser(Aws_restJson1_1.se_DescribeToolsCommand)
18
+ .de(Aws_restJson1_1.de_DescribeToolsCommand)
19
+ .build() {
20
+ }
21
+ exports.DescribeToolsCommand = DescribeToolsCommand;
@@ -1,8 +1,9 @@
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);
4
+ tslib_1.__exportStar(require("./CreateToolCommand"), exports);
5
5
  tslib_1.__exportStar(require("./DeleteToolCommand"), exports);
6
+ tslib_1.__exportStar(require("./DescribeToolsCommand"), exports);
6
7
  tslib_1.__exportStar(require("./ExecuteToolCommand"), exports);
7
8
  tslib_1.__exportStar(require("./GetToolCommand"), exports);
8
9
  tslib_1.__exportStar(require("./ListToolsCommand"), exports);
@@ -1,7 +1,20 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ToolNotFoundException = exports.ToolExecutionException = exports.ToolAlreadyExistsException = exports.ToolType = exports.ValidationException = void 0;
3
+ exports.ToolExecutionException = exports.ToolHandler = exports.ToolMcpTransport = exports.ToolVariableType = exports.ToolAuthorizationType = exports.ToolEmailHandler = exports.ToolChatHandler = exports.ToolStringValue = exports.AlreadyExistException = exports.ValidationException = exports.NotFoundException = void 0;
4
4
  const ToolsServiceException_1 = require("./ToolsServiceException");
5
+ class NotFoundException extends ToolsServiceException_1.ToolsServiceException {
6
+ name = "NotFoundException";
7
+ $fault = "client";
8
+ constructor(opts) {
9
+ super({
10
+ name: "NotFoundException",
11
+ $fault: "client",
12
+ ...opts
13
+ });
14
+ Object.setPrototypeOf(this, NotFoundException.prototype);
15
+ }
16
+ }
17
+ exports.NotFoundException = NotFoundException;
5
18
  class ValidationException extends ToolsServiceException_1.ToolsServiceException {
6
19
  name = "ValidationException";
7
20
  $fault = "client";
@@ -15,22 +28,85 @@ class ValidationException extends ToolsServiceException_1.ToolsServiceException
15
28
  }
16
29
  }
17
30
  exports.ValidationException = ValidationException;
18
- exports.ToolType = {
19
- EMAIL: "EMAIL",
20
- };
21
- class ToolAlreadyExistsException extends ToolsServiceException_1.ToolsServiceException {
22
- name = "ToolAlreadyExistsException";
31
+ class AlreadyExistException extends ToolsServiceException_1.ToolsServiceException {
32
+ name = "AlreadyExistException";
23
33
  $fault = "client";
24
34
  constructor(opts) {
25
35
  super({
26
- name: "ToolAlreadyExistsException",
36
+ name: "AlreadyExistException",
27
37
  $fault: "client",
28
38
  ...opts
29
39
  });
30
- Object.setPrototypeOf(this, ToolAlreadyExistsException.prototype);
40
+ Object.setPrototypeOf(this, AlreadyExistException.prototype);
31
41
  }
32
42
  }
33
- exports.ToolAlreadyExistsException = ToolAlreadyExistsException;
43
+ exports.AlreadyExistException = AlreadyExistException;
44
+ var ToolStringValue;
45
+ (function (ToolStringValue) {
46
+ ToolStringValue.visit = (value, visitor) => {
47
+ if (value.static !== undefined)
48
+ return visitor.static(value.static);
49
+ if (value.variable !== undefined)
50
+ return visitor.variable(value.variable);
51
+ if (value.template !== undefined)
52
+ return visitor.template(value.template);
53
+ return visitor._(value.$unknown[0], value.$unknown[1]);
54
+ };
55
+ })(ToolStringValue || (exports.ToolStringValue = ToolStringValue = {}));
56
+ var ToolChatHandler;
57
+ (function (ToolChatHandler) {
58
+ ToolChatHandler.visit = (value, visitor) => {
59
+ if (value.direct !== undefined)
60
+ return visitor.direct(value.direct);
61
+ if (value.channel !== undefined)
62
+ return visitor.channel(value.channel);
63
+ return visitor._(value.$unknown[0], value.$unknown[1]);
64
+ };
65
+ })(ToolChatHandler || (exports.ToolChatHandler = ToolChatHandler = {}));
66
+ var ToolEmailHandler;
67
+ (function (ToolEmailHandler) {
68
+ ToolEmailHandler.visit = (value, visitor) => {
69
+ if (value.wns !== undefined)
70
+ return visitor.wns(value.wns);
71
+ if (value.custom !== undefined)
72
+ return visitor.custom(value.custom);
73
+ return visitor._(value.$unknown[0], value.$unknown[1]);
74
+ };
75
+ })(ToolEmailHandler || (exports.ToolEmailHandler = ToolEmailHandler = {}));
76
+ exports.ToolAuthorizationType = {
77
+ API_KEY: "ApiKey",
78
+ BASIC: "Basic",
79
+ BEARER: "Bearer",
80
+ };
81
+ exports.ToolVariableType = {
82
+ BOOLEAN: "boolean",
83
+ NUMBER: "number",
84
+ NUMBER_ARRAY: "number_array",
85
+ OBJECT: "object",
86
+ STRING: "string",
87
+ STRING_ARRAY: "string_array",
88
+ };
89
+ exports.ToolMcpTransport = {
90
+ HTTP: "http",
91
+ SSE: "sse",
92
+ STDIO: "stdio",
93
+ };
94
+ var ToolHandler;
95
+ (function (ToolHandler) {
96
+ ToolHandler.visit = (value, visitor) => {
97
+ if (value.email !== undefined)
98
+ return visitor.email(value.email);
99
+ if (value.sms !== undefined)
100
+ return visitor.sms(value.sms);
101
+ if (value.chat !== undefined)
102
+ return visitor.chat(value.chat);
103
+ if (value.webhook !== undefined)
104
+ return visitor.webhook(value.webhook);
105
+ if (value.mcp !== undefined)
106
+ return visitor.mcp(value.mcp);
107
+ return visitor._(value.$unknown[0], value.$unknown[1]);
108
+ };
109
+ })(ToolHandler || (exports.ToolHandler = ToolHandler = {}));
34
110
  class ToolExecutionException extends ToolsServiceException_1.ToolsServiceException {
35
111
  name = "ToolExecutionException";
36
112
  $fault = "server";
@@ -46,16 +122,3 @@ class ToolExecutionException extends ToolsServiceException_1.ToolsServiceExcepti
46
122
  }
47
123
  }
48
124
  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,12 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.de_UpdateToolCommand = exports.de_ListToolsCommand = exports.de_GetToolCommand = exports.de_ExecuteToolCommand = exports.de_DeleteToolCommand = exports.de_AddToolCommand = exports.se_UpdateToolCommand = exports.se_ListToolsCommand = exports.se_GetToolCommand = exports.se_ExecuteToolCommand = exports.se_DeleteToolCommand = exports.se_AddToolCommand = void 0;
3
+ exports.de_UpdateToolCommand = exports.de_ListToolsCommand = exports.de_GetToolCommand = exports.de_ExecuteToolCommand = exports.de_DescribeToolsCommand = exports.de_DeleteToolCommand = exports.de_CreateToolCommand = exports.se_UpdateToolCommand = exports.se_ListToolsCommand = exports.se_GetToolCommand = exports.se_ExecuteToolCommand = exports.se_DescribeToolsCommand = exports.se_DeleteToolCommand = exports.se_CreateToolCommand = 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) => {
9
+ const se_CreateToolCommand = async (input, context) => {
10
10
  const b = (0, core_2.requestBuilder)(input, context);
11
11
  const headers = (0, smithy_client_1.map)({}, smithy_client_1.isSerializableHeaderValue, {
12
12
  'content-type': 'application/json',
@@ -15,18 +15,17 @@ const se_AddToolCommand = async (input, context) => {
15
15
  b.bp("/v1/tools");
16
16
  let body;
17
17
  body = JSON.stringify((0, smithy_client_1.take)(input, {
18
- 'config': _ => se_Document(_, context),
19
18
  'description': [],
20
- 'jsonSchema': _ => se_Document(_, context),
19
+ 'handler': _ => (0, smithy_client_1._json)(_),
20
+ 'input': _ => (0, smithy_client_1._json)(_),
21
21
  'name': [],
22
- 'type': [],
23
22
  }));
24
23
  b.m("POST")
25
24
  .h(headers)
26
25
  .b(body);
27
26
  return b.build();
28
27
  };
29
- exports.se_AddToolCommand = se_AddToolCommand;
28
+ exports.se_CreateToolCommand = se_CreateToolCommand;
30
29
  const se_DeleteToolCommand = async (input, context) => {
31
30
  const b = (0, core_2.requestBuilder)(input, context);
32
31
  const headers = (0, smithy_client_1.map)({}, smithy_client_1.isSerializableHeaderValue, {
@@ -41,6 +40,23 @@ const se_DeleteToolCommand = async (input, context) => {
41
40
  return b.build();
42
41
  };
43
42
  exports.se_DeleteToolCommand = se_DeleteToolCommand;
43
+ const se_DescribeToolsCommand = async (input, context) => {
44
+ const b = (0, core_2.requestBuilder)(input, context);
45
+ const headers = (0, smithy_client_1.map)({}, smithy_client_1.isSerializableHeaderValue, {
46
+ 'content-type': 'application/json',
47
+ [_xci]: input[_c],
48
+ });
49
+ b.bp("/v1/tools/describe");
50
+ let body;
51
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
52
+ 'ids': _ => (0, smithy_client_1._json)(_),
53
+ }));
54
+ b.m("POST")
55
+ .h(headers)
56
+ .b(body);
57
+ return b.build();
58
+ };
59
+ exports.se_DescribeToolsCommand = se_DescribeToolsCommand;
44
60
  const se_ExecuteToolCommand = async (input, context) => {
45
61
  const b = (0, core_2.requestBuilder)(input, context);
46
62
  const headers = (0, smithy_client_1.map)({}, smithy_client_1.isSerializableHeaderValue, {
@@ -50,9 +66,8 @@ const se_ExecuteToolCommand = async (input, context) => {
50
66
  b.bp("/v1/tools/execute");
51
67
  let body;
52
68
  body = JSON.stringify((0, smithy_client_1.take)(input, {
53
- 'context': _ => (0, smithy_client_1._json)(_),
54
- 'parameters': _ => se_Document(_, context),
55
- 'toolId': [],
69
+ 'id': [],
70
+ 'input': _ => se_Document(_, context),
56
71
  }));
57
72
  b.m("POST")
58
73
  .h(headers)
@@ -78,16 +93,13 @@ const se_GetToolCommand = async (input, context) => {
78
93
  exports.se_GetToolCommand = se_GetToolCommand;
79
94
  const se_ListToolsCommand = async (input, context) => {
80
95
  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]],
96
+ const headers = (0, smithy_client_1.map)({}, smithy_client_1.isSerializableHeaderValue, {
97
+ [_xci]: input[_c],
86
98
  });
99
+ b.bp("/v1/tools");
87
100
  let body;
88
101
  b.m("GET")
89
102
  .h(headers)
90
- .q(query)
91
103
  .b(body);
92
104
  return b.build();
93
105
  };
@@ -102,9 +114,9 @@ const se_UpdateToolCommand = async (input, context) => {
102
114
  b.p('toolId', () => input.toolId, '{toolId}', false);
103
115
  let body;
104
116
  body = JSON.stringify((0, smithy_client_1.take)(input, {
105
- 'config': _ => se_Document(_, context),
106
117
  'description': [],
107
- 'jsonSchema': _ => se_Document(_, context),
118
+ 'handler': _ => (0, smithy_client_1._json)(_),
119
+ 'input': _ => (0, smithy_client_1._json)(_),
108
120
  'name': [],
109
121
  }));
110
122
  b.m("PUT")
@@ -113,7 +125,7 @@ const se_UpdateToolCommand = async (input, context) => {
113
125
  return b.build();
114
126
  };
115
127
  exports.se_UpdateToolCommand = se_UpdateToolCommand;
116
- const de_AddToolCommand = async (output, context) => {
128
+ const de_CreateToolCommand = async (output, context) => {
117
129
  if (output.statusCode !== 201 && output.statusCode >= 300) {
118
130
  return de_CommandError(output, context);
119
131
  }
@@ -122,12 +134,12 @@ const de_AddToolCommand = async (output, context) => {
122
134
  });
123
135
  const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
124
136
  const doc = (0, smithy_client_1.take)(data, {
125
- 'tool': _ => de_Tool(_, context),
137
+ 'tool': smithy_client_1._json,
126
138
  });
127
139
  Object.assign(contents, doc);
128
140
  return contents;
129
141
  };
130
- exports.de_AddToolCommand = de_AddToolCommand;
142
+ exports.de_CreateToolCommand = de_CreateToolCommand;
131
143
  const de_DeleteToolCommand = async (output, context) => {
132
144
  if (output.statusCode !== 204 && output.statusCode >= 300) {
133
145
  return de_CommandError(output, context);
@@ -139,6 +151,21 @@ const de_DeleteToolCommand = async (output, context) => {
139
151
  return contents;
140
152
  };
141
153
  exports.de_DeleteToolCommand = de_DeleteToolCommand;
154
+ const de_DescribeToolsCommand = async (output, context) => {
155
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
156
+ return de_CommandError(output, context);
157
+ }
158
+ const contents = (0, smithy_client_1.map)({
159
+ $metadata: deserializeMetadata(output),
160
+ });
161
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
162
+ const doc = (0, smithy_client_1.take)(data, {
163
+ 'descriptions': smithy_client_1._json,
164
+ });
165
+ Object.assign(contents, doc);
166
+ return contents;
167
+ };
168
+ exports.de_DescribeToolsCommand = de_DescribeToolsCommand;
142
169
  const de_ExecuteToolCommand = async (output, context) => {
143
170
  if (output.statusCode !== 200 && output.statusCode >= 300) {
144
171
  return de_CommandError(output, context);
@@ -148,7 +175,7 @@ const de_ExecuteToolCommand = async (output, context) => {
148
175
  });
149
176
  const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
150
177
  const doc = (0, smithy_client_1.take)(data, {
151
- 'result': _ => de_ExecutionResult(_, context),
178
+ 'result': _ => de_ToolExecutionResult(_, context),
152
179
  });
153
180
  Object.assign(contents, doc);
154
181
  return contents;
@@ -163,7 +190,7 @@ const de_GetToolCommand = async (output, context) => {
163
190
  });
164
191
  const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
165
192
  const doc = (0, smithy_client_1.take)(data, {
166
- 'tool': _ => de_Tool(_, context),
193
+ 'tool': smithy_client_1._json,
167
194
  });
168
195
  Object.assign(contents, doc);
169
196
  return contents;
@@ -178,8 +205,7 @@ const de_ListToolsCommand = async (output, context) => {
178
205
  });
179
206
  const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
180
207
  const doc = (0, smithy_client_1.take)(data, {
181
- 'llmTools': _ => de_LlmToolDefinitionsList(_, context),
182
- 'tools': _ => de_ToolsList(_, context),
208
+ 'tools': smithy_client_1._json,
183
209
  });
184
210
  Object.assign(contents, doc);
185
211
  return contents;
@@ -194,7 +220,7 @@ const de_UpdateToolCommand = async (output, context) => {
194
220
  });
195
221
  const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
196
222
  const doc = (0, smithy_client_1.take)(data, {
197
- 'tool': _ => de_Tool(_, context),
223
+ 'tool': smithy_client_1._json,
198
224
  });
199
225
  Object.assign(contents, doc);
200
226
  return contents;
@@ -207,15 +233,15 @@ const de_CommandError = async (output, context) => {
207
233
  };
208
234
  const errorCode = (0, core_1.loadRestJsonErrorCode)(output, parsedOutput.body);
209
235
  switch (errorCode) {
210
- case "ToolAlreadyExistsException":
211
- case "wildix.wim.tools#ToolAlreadyExistsException":
212
- throw await de_ToolAlreadyExistsExceptionRes(parsedOutput, context);
236
+ case "AlreadyExistException":
237
+ case "smithy.framework#AlreadyExistException":
238
+ throw await de_AlreadyExistExceptionRes(parsedOutput, context);
239
+ case "NotFoundException":
240
+ case "smithy.framework#NotFoundException":
241
+ throw await de_NotFoundExceptionRes(parsedOutput, context);
213
242
  case "ToolExecutionException":
214
243
  case "wildix.wim.tools#ToolExecutionException":
215
244
  throw await de_ToolExecutionExceptionRes(parsedOutput, context);
216
- case "ToolNotFoundException":
217
- case "wildix.wim.tools#ToolNotFoundException":
218
- throw await de_ToolNotFoundExceptionRes(parsedOutput, context);
219
245
  case "ValidationException":
220
246
  case "smithy.framework#ValidationException":
221
247
  throw await de_ValidationExceptionRes(parsedOutput, context);
@@ -229,54 +255,54 @@ const de_CommandError = async (output, context) => {
229
255
  }
230
256
  };
231
257
  const throwDefaultError = (0, smithy_client_1.withBaseException)(ToolsServiceException_1.ToolsServiceException);
232
- const de_ValidationExceptionRes = async (parsedOutput, context) => {
258
+ const de_AlreadyExistExceptionRes = async (parsedOutput, context) => {
233
259
  const contents = (0, smithy_client_1.map)({});
234
260
  const data = parsedOutput.body;
235
261
  const doc = (0, smithy_client_1.take)(data, {
236
262
  'message': smithy_client_1.expectString,
237
263
  });
238
264
  Object.assign(contents, doc);
239
- const exception = new models_0_1.ValidationException({
265
+ const exception = new models_0_1.AlreadyExistException({
240
266
  $metadata: deserializeMetadata(parsedOutput),
241
267
  ...contents
242
268
  });
243
269
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
244
270
  };
245
- const de_ToolAlreadyExistsExceptionRes = async (parsedOutput, context) => {
271
+ const de_NotFoundExceptionRes = async (parsedOutput, context) => {
246
272
  const contents = (0, smithy_client_1.map)({});
247
273
  const data = parsedOutput.body;
248
274
  const doc = (0, smithy_client_1.take)(data, {
249
275
  'message': smithy_client_1.expectString,
250
276
  });
251
277
  Object.assign(contents, doc);
252
- const exception = new models_0_1.ToolAlreadyExistsException({
278
+ const exception = new models_0_1.NotFoundException({
253
279
  $metadata: deserializeMetadata(parsedOutput),
254
280
  ...contents
255
281
  });
256
282
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
257
283
  };
258
- const de_ToolExecutionExceptionRes = async (parsedOutput, context) => {
284
+ const de_ValidationExceptionRes = async (parsedOutput, context) => {
259
285
  const contents = (0, smithy_client_1.map)({});
260
286
  const data = parsedOutput.body;
261
287
  const doc = (0, smithy_client_1.take)(data, {
262
- 'details': _ => de_Document(_, context),
263
288
  'message': smithy_client_1.expectString,
264
289
  });
265
290
  Object.assign(contents, doc);
266
- const exception = new models_0_1.ToolExecutionException({
291
+ const exception = new models_0_1.ValidationException({
267
292
  $metadata: deserializeMetadata(parsedOutput),
268
293
  ...contents
269
294
  });
270
295
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
271
296
  };
272
- const de_ToolNotFoundExceptionRes = async (parsedOutput, context) => {
297
+ const de_ToolExecutionExceptionRes = async (parsedOutput, context) => {
273
298
  const contents = (0, smithy_client_1.map)({});
274
299
  const data = parsedOutput.body;
275
300
  const doc = (0, smithy_client_1.take)(data, {
301
+ 'details': _ => de_Document(_, context),
276
302
  'message': smithy_client_1.expectString,
277
303
  });
278
304
  Object.assign(contents, doc);
279
- const exception = new models_0_1.ToolNotFoundException({
305
+ const exception = new models_0_1.ToolExecutionException({
280
306
  $metadata: deserializeMetadata(parsedOutput),
281
307
  ...contents
282
308
  });
@@ -288,51 +314,12 @@ const se_Document = (input, context) => {
288
314
  const de_Document = (output, context) => {
289
315
  return output;
290
316
  };
291
- const de_ExecutionResult = (output, context) => {
292
- return (0, smithy_client_1.take)(output, {
293
- 'error': smithy_client_1.expectString,
294
- 'result': (_) => de_Document(_, context),
295
- 'success': smithy_client_1.expectBoolean,
296
- 'traceId': smithy_client_1.expectString,
297
- });
298
- };
299
- const de_LlmFunctionDefinition = (output, context) => {
300
- return (0, smithy_client_1.take)(output, {
301
- 'description': smithy_client_1.expectString,
302
- 'name': smithy_client_1.expectString,
303
- 'parameters': (_) => de_Document(_, context),
304
- });
305
- };
306
- const de_LlmToolDefinition = (output, context) => {
317
+ const de_ToolExecutionResult = (output, context) => {
307
318
  return (0, smithy_client_1.take)(output, {
308
- 'function': (_) => de_LlmFunctionDefinition(_, context),
309
- 'type': smithy_client_1.expectString,
310
- });
311
- };
312
- const de_LlmToolDefinitionsList = (output, context) => {
313
- const retVal = (output || []).filter((e) => e != null).map((entry) => {
314
- return de_LlmToolDefinition(entry, context);
315
- });
316
- return retVal;
317
- };
318
- const de_Tool = (output, context) => {
319
- return (0, smithy_client_1.take)(output, {
320
- 'company': smithy_client_1.expectString,
321
- 'config': (_) => de_Document(_, context),
322
- 'createdAt': (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
323
- 'description': smithy_client_1.expectString,
324
- 'id': smithy_client_1.expectString,
325
- 'jsonSchema': (_) => de_Document(_, context),
326
- 'name': smithy_client_1.expectString,
327
- 'type': smithy_client_1.expectString,
328
- 'updatedAt': (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
329
- });
330
- };
331
- const de_ToolsList = (output, context) => {
332
- const retVal = (output || []).filter((e) => e != null).map((entry) => {
333
- return de_Tool(entry, context);
319
+ 'error': smithy_client_1._json,
320
+ 'output': (_) => de_Document(_, context),
321
+ 'statusCode': smithy_client_1.expectInt32,
334
322
  });
335
- return retVal;
336
323
  };
337
324
  const deserializeMetadata = (output) => ({
338
325
  httpStatusCode: output.statusCode,
@@ -342,5 +329,4 @@ const deserializeMetadata = (output) => ({
342
329
  });
343
330
  const collectBodyString = (streamBody, context) => (0, smithy_client_1.collectBody)(streamBody, context).then(body => context.utf8Encoder(body));
344
331
  const _c = "company";
345
- const _f = "format";
346
332
  const _xci = "x-company-id";
package/dist-es/Tools.js CHANGED
@@ -1,14 +1,16 @@
1
1
  import { ToolsClient, } from "./ToolsClient";
2
- import { AddToolCommand, } from "./commands/AddToolCommand";
2
+ import { CreateToolCommand, } from "./commands/CreateToolCommand";
3
3
  import { DeleteToolCommand, } from "./commands/DeleteToolCommand";
4
+ import { DescribeToolsCommand, } from "./commands/DescribeToolsCommand";
4
5
  import { ExecuteToolCommand, } from "./commands/ExecuteToolCommand";
5
6
  import { GetToolCommand, } from "./commands/GetToolCommand";
6
7
  import { ListToolsCommand, } from "./commands/ListToolsCommand";
7
8
  import { UpdateToolCommand, } from "./commands/UpdateToolCommand";
8
9
  import { createAggregatedClient } from "@smithy/smithy-client";
9
10
  const commands = {
10
- AddToolCommand,
11
+ CreateToolCommand,
11
12
  DeleteToolCommand,
13
+ DescribeToolsCommand,
12
14
  ExecuteToolCommand,
13
15
  GetToolCommand,
14
16
  ListToolsCommand,
@@ -1,7 +1,5 @@
1
1
  import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig";
2
2
  import { resolveRuntimeExtensions, } from "./runtimeExtensions";
3
- import { getLoggerPlugin } from "@aws-sdk/middleware-logger";
4
- import { getRecursionDetectionPlugin } from "@aws-sdk/middleware-recursion-detection";
5
3
  import { getUserAgentPlugin, resolveUserAgentConfig, } from "@aws-sdk/middleware-user-agent";
6
4
  import { getContentLengthPlugin } from "@smithy/middleware-content-length";
7
5
  import { getRetryPlugin, resolveRetryConfig, } from "@smithy/middleware-retry";
@@ -17,23 +15,20 @@ export class ToolsClient extends __Client {
17
15
  let _config_1 = resolveUserAgentConfig(_config_0);
18
16
  let _config_2 = resolveRetryConfig(_config_1);
19
17
  let _config_3 = resolveRuntimeExtensions(_config_2, configuration?.extensions || []);
20
- const hostname = ['stable', 'stage'].includes(configuration.env || '') ? `tools.wim-${configuration.env}.wildix.com` : 'tools.wim.wildix.com';
21
- const endpoint = () => {
18
+ const endpoint = configuration.endpoint || (() => {
22
19
  return {
23
- hostname,
20
+ hostname: ['stable', 'stage'].includes(configuration.env || '') ? `tools.wim-${configuration.env}.wildix.com` : 'tools.wim.wildix.com',
24
21
  protocol: "https",
25
22
  port: '443',
26
- path: '/'
23
+ path: ''
27
24
  };
28
- };
29
- _config_3.endpoint = endpoint;
30
- this.config = _config_3;
25
+ });
26
+ const config = { ..._config_3, endpoint };
27
+ this.config = config;
31
28
  this.middlewareStack.add(authorizationMiddleware.bind(this, configuration.token), { step: "build" });
32
29
  this.middlewareStack.use(getUserAgentPlugin(this.config));
33
30
  this.middlewareStack.use(getRetryPlugin(this.config));
34
31
  this.middlewareStack.use(getContentLengthPlugin(this.config));
35
- this.middlewareStack.use(getLoggerPlugin(this.config));
36
- this.middlewareStack.use(getRecursionDetectionPlugin(this.config));
37
32
  }
38
33
  destroy() {
39
34
  super.destroy();