@wildix/wim-tools-client 0.0.19 → 0.0.21

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.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ToolExecutionServerException = exports.ToolExecutionException = exports.ToolVariableType = exports.ToolHandler = exports.ToolEmailHandler = exports.ToolStringValue = exports.ValidationException = exports.NotFoundException = exports.AlreadyExistException = void 0;
3
+ exports.ToolExecutionServerException = exports.ToolExecutionException = exports.ToolVariableType = exports.ToolHandler = exports.ToolWebhookMethod = exports.ToolWebhookBody = exports.ToolWebhookAuth = exports.ToolEmailHandler = exports.ToolStringValue = exports.ValidationException = exports.NotFoundException = exports.AlreadyExistException = void 0;
4
4
  const ToolsServiceException_1 = require("./ToolsServiceException");
5
5
  class AlreadyExistException extends ToolsServiceException_1.ToolsServiceException {
6
6
  name = "AlreadyExistException";
@@ -63,11 +63,42 @@ var ToolEmailHandler;
63
63
  return visitor._(value.$unknown[0], value.$unknown[1]);
64
64
  };
65
65
  })(ToolEmailHandler || (exports.ToolEmailHandler = ToolEmailHandler = {}));
66
+ var ToolWebhookAuth;
67
+ (function (ToolWebhookAuth) {
68
+ ToolWebhookAuth.visit = (value, visitor) => {
69
+ if (value.basic !== undefined)
70
+ return visitor.basic(value.basic);
71
+ if (value.bearer !== undefined)
72
+ return visitor.bearer(value.bearer);
73
+ if (value.customHeader !== undefined)
74
+ return visitor.customHeader(value.customHeader);
75
+ return visitor._(value.$unknown[0], value.$unknown[1]);
76
+ };
77
+ })(ToolWebhookAuth || (exports.ToolWebhookAuth = ToolWebhookAuth = {}));
78
+ var ToolWebhookBody;
79
+ (function (ToolWebhookBody) {
80
+ ToolWebhookBody.visit = (value, visitor) => {
81
+ if (value.staticJson !== undefined)
82
+ return visitor.staticJson(value.staticJson);
83
+ if (value.template !== undefined)
84
+ return visitor.template(value.template);
85
+ return visitor._(value.$unknown[0], value.$unknown[1]);
86
+ };
87
+ })(ToolWebhookBody || (exports.ToolWebhookBody = ToolWebhookBody = {}));
88
+ exports.ToolWebhookMethod = {
89
+ DELETE: "DELETE",
90
+ GET: "GET",
91
+ PATCH: "PATCH",
92
+ POST: "POST",
93
+ PUT: "PUT",
94
+ };
66
95
  var ToolHandler;
67
96
  (function (ToolHandler) {
68
97
  ToolHandler.visit = (value, visitor) => {
69
98
  if (value.email !== undefined)
70
99
  return visitor.email(value.email);
100
+ if (value.webhook !== undefined)
101
+ return visitor.webhook(value.webhook);
71
102
  return visitor._(value.$unknown[0], value.$unknown[1]);
72
103
  };
73
104
  })(ToolHandler || (exports.ToolHandler = ToolHandler = {}));
@@ -19,7 +19,7 @@ const se_CreateToolCommand = async (input, context) => {
19
19
  body = JSON.stringify((0, smithy_client_1.take)(input, {
20
20
  'category': [],
21
21
  'description': [],
22
- 'handler': _ => (0, smithy_client_1._json)(_),
22
+ 'handler': _ => se_ToolHandler(_, context),
23
23
  'input': _ => (0, smithy_client_1._json)(_),
24
24
  'name': [],
25
25
  }));
@@ -134,7 +134,7 @@ const se_UpdateToolCommand = async (input, context) => {
134
134
  body = JSON.stringify((0, smithy_client_1.take)(input, {
135
135
  'category': [],
136
136
  'description': [],
137
- 'handler': _ => (0, smithy_client_1._json)(_),
137
+ 'handler': _ => se_ToolHandler(_, context),
138
138
  'input': _ => (0, smithy_client_1._json)(_),
139
139
  'name': [],
140
140
  }));
@@ -154,7 +154,7 @@ const de_CreateToolCommand = async (output, context) => {
154
154
  });
155
155
  const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
156
156
  const doc = (0, smithy_client_1.take)(data, {
157
- 'tool': smithy_client_1._json,
157
+ 'tool': _ => de_Tool(_, context),
158
158
  });
159
159
  Object.assign(contents, doc);
160
160
  return contents;
@@ -210,7 +210,7 @@ const de_GetToolCommand = async (output, context) => {
210
210
  });
211
211
  const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
212
212
  const doc = (0, smithy_client_1.take)(data, {
213
- 'tool': smithy_client_1._json,
213
+ 'tool': _ => de_Tool(_, context),
214
214
  });
215
215
  Object.assign(contents, doc);
216
216
  return contents;
@@ -225,7 +225,7 @@ const de_ListToolsCommand = async (output, context) => {
225
225
  });
226
226
  const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
227
227
  const doc = (0, smithy_client_1.take)(data, {
228
- 'tools': smithy_client_1._json,
228
+ 'tools': _ => de_ToolsList(_, context),
229
229
  });
230
230
  Object.assign(contents, doc);
231
231
  return contents;
@@ -240,7 +240,7 @@ const de_UpdateToolCommand = async (output, context) => {
240
240
  });
241
241
  const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
242
242
  const doc = (0, smithy_client_1.take)(data, {
243
- 'tool': smithy_client_1._json,
243
+ 'tool': _ => de_Tool(_, context),
244
244
  });
245
245
  Object.assign(contents, doc);
246
246
  return contents;
@@ -348,9 +348,44 @@ const de_ToolExecutionServerExceptionRes = async (parsedOutput, context) => {
348
348
  const se_Document = (input, context) => {
349
349
  return input;
350
350
  };
351
+ const se_ToolHandler = (input, context) => {
352
+ return models_0_1.ToolHandler.visit(input, {
353
+ email: value => ({ "email": (0, smithy_client_1._json)(value) }),
354
+ webhook: value => ({ "webhook": se_ToolWebhookConfig(value, context) }),
355
+ _: (name, value) => ({ [name]: value })
356
+ });
357
+ };
358
+ const se_ToolWebhookBody = (input, context) => {
359
+ return models_0_1.ToolWebhookBody.visit(input, {
360
+ staticJson: value => ({ "staticJson": se_Document(value, context) }),
361
+ template: value => ({ "template": value }),
362
+ _: (name, value) => ({ [name]: value })
363
+ });
364
+ };
365
+ const se_ToolWebhookConfig = (input, context) => {
366
+ return (0, smithy_client_1.take)(input, {
367
+ 'auth': smithy_client_1._json,
368
+ 'body': _ => se_ToolWebhookBody(_, context),
369
+ 'headers': smithy_client_1._json,
370
+ 'method': [],
371
+ 'queryParams': smithy_client_1._json,
372
+ 'url': smithy_client_1._json,
373
+ });
374
+ };
351
375
  const de_Document = (output, context) => {
352
376
  return output;
353
377
  };
378
+ const de_Tool = (output, context) => {
379
+ return (0, smithy_client_1.take)(output, {
380
+ 'category': smithy_client_1.expectString,
381
+ 'companyId': smithy_client_1.expectString,
382
+ 'description': smithy_client_1.expectString,
383
+ 'handler': (_) => de_ToolHandler((0, core_1.awsExpectUnion)(_), context),
384
+ 'id': smithy_client_1.expectString,
385
+ 'input': smithy_client_1._json,
386
+ 'name': smithy_client_1.expectString,
387
+ });
388
+ };
354
389
  const de_ToolExecutionResult = (output, context) => {
355
390
  return (0, smithy_client_1.take)(output, {
356
391
  'error': smithy_client_1._json,
@@ -358,6 +393,46 @@ const de_ToolExecutionResult = (output, context) => {
358
393
  'statusCode': smithy_client_1.expectInt32,
359
394
  });
360
395
  };
396
+ const de_ToolHandler = (output, context) => {
397
+ if (output.email != null) {
398
+ return {
399
+ email: (0, smithy_client_1._json)((0, core_1.awsExpectUnion)(output.email))
400
+ };
401
+ }
402
+ if (output.webhook != null) {
403
+ return {
404
+ webhook: de_ToolWebhookConfig(output.webhook, context)
405
+ };
406
+ }
407
+ return { $unknown: Object.entries(output)[0] };
408
+ };
409
+ const de_ToolsList = (output, context) => {
410
+ const retVal = (output || []).filter((e) => e != null).map((entry) => {
411
+ return de_Tool(entry, context);
412
+ });
413
+ return retVal;
414
+ };
415
+ const de_ToolWebhookBody = (output, context) => {
416
+ if (output.staticJson != null) {
417
+ return {
418
+ staticJson: de_Document(output.staticJson, context)
419
+ };
420
+ }
421
+ if ((0, smithy_client_1.expectString)(output.template) !== undefined) {
422
+ return { template: (0, smithy_client_1.expectString)(output.template) };
423
+ }
424
+ return { $unknown: Object.entries(output)[0] };
425
+ };
426
+ const de_ToolWebhookConfig = (output, context) => {
427
+ return (0, smithy_client_1.take)(output, {
428
+ 'auth': (_) => (0, smithy_client_1._json)((0, core_1.awsExpectUnion)(_)),
429
+ 'body': (_) => de_ToolWebhookBody((0, core_1.awsExpectUnion)(_), context),
430
+ 'headers': smithy_client_1._json,
431
+ 'method': smithy_client_1.expectString,
432
+ 'queryParams': smithy_client_1._json,
433
+ 'url': (_) => (0, smithy_client_1._json)((0, core_1.awsExpectUnion)(_)),
434
+ });
435
+ };
361
436
  const deserializeMetadata = (output) => ({
362
437
  httpStatusCode: output.statusCode,
363
438
  requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
@@ -57,11 +57,42 @@ export var ToolEmailHandler;
57
57
  return visitor._(value.$unknown[0], value.$unknown[1]);
58
58
  };
59
59
  })(ToolEmailHandler || (ToolEmailHandler = {}));
60
+ export var ToolWebhookAuth;
61
+ (function (ToolWebhookAuth) {
62
+ ToolWebhookAuth.visit = (value, visitor) => {
63
+ if (value.basic !== undefined)
64
+ return visitor.basic(value.basic);
65
+ if (value.bearer !== undefined)
66
+ return visitor.bearer(value.bearer);
67
+ if (value.customHeader !== undefined)
68
+ return visitor.customHeader(value.customHeader);
69
+ return visitor._(value.$unknown[0], value.$unknown[1]);
70
+ };
71
+ })(ToolWebhookAuth || (ToolWebhookAuth = {}));
72
+ export var ToolWebhookBody;
73
+ (function (ToolWebhookBody) {
74
+ ToolWebhookBody.visit = (value, visitor) => {
75
+ if (value.staticJson !== undefined)
76
+ return visitor.staticJson(value.staticJson);
77
+ if (value.template !== undefined)
78
+ return visitor.template(value.template);
79
+ return visitor._(value.$unknown[0], value.$unknown[1]);
80
+ };
81
+ })(ToolWebhookBody || (ToolWebhookBody = {}));
82
+ export const ToolWebhookMethod = {
83
+ DELETE: "DELETE",
84
+ GET: "GET",
85
+ PATCH: "PATCH",
86
+ POST: "POST",
87
+ PUT: "PUT",
88
+ };
60
89
  export var ToolHandler;
61
90
  (function (ToolHandler) {
62
91
  ToolHandler.visit = (value, visitor) => {
63
92
  if (value.email !== undefined)
64
93
  return visitor.email(value.email);
94
+ if (value.webhook !== undefined)
95
+ return visitor.webhook(value.webhook);
65
96
  return visitor._(value.$unknown[0], value.$unknown[1]);
66
97
  };
67
98
  })(ToolHandler || (ToolHandler = {}));
@@ -1,6 +1,6 @@
1
1
  import { ToolsServiceException as __BaseException } from "../models/ToolsServiceException";
2
- import { AlreadyExistException, NotFoundException, ToolExecutionException, ToolExecutionServerException, ValidationException, } from "../models/models_0";
3
- import { loadRestJsonErrorCode, parseJsonBody as parseBody, parseJsonErrorBody as parseErrorBody, } from "@aws-sdk/core";
2
+ import { AlreadyExistException, NotFoundException, ToolExecutionException, ToolExecutionServerException, ToolHandler, ToolWebhookBody, ValidationException, } from "../models/models_0";
3
+ import { awsExpectUnion as __expectUnion, loadRestJsonErrorCode, parseJsonBody as parseBody, parseJsonErrorBody as parseErrorBody, } from "@aws-sdk/core";
4
4
  import { requestBuilder as rb } from "@smithy/core";
5
5
  import { decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, _json, collectBody, map, take, withBaseException, } from "@smithy/smithy-client";
6
6
  export const se_CreateToolCommand = async (input, context) => {
@@ -16,7 +16,7 @@ export const se_CreateToolCommand = async (input, context) => {
16
16
  body = JSON.stringify(take(input, {
17
17
  'category': [],
18
18
  'description': [],
19
- 'handler': _ => _json(_),
19
+ 'handler': _ => se_ToolHandler(_, context),
20
20
  'input': _ => _json(_),
21
21
  'name': [],
22
22
  }));
@@ -125,7 +125,7 @@ export const se_UpdateToolCommand = async (input, context) => {
125
125
  body = JSON.stringify(take(input, {
126
126
  'category': [],
127
127
  'description': [],
128
- 'handler': _ => _json(_),
128
+ 'handler': _ => se_ToolHandler(_, context),
129
129
  'input': _ => _json(_),
130
130
  'name': [],
131
131
  }));
@@ -144,7 +144,7 @@ export const de_CreateToolCommand = async (output, context) => {
144
144
  });
145
145
  const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
146
146
  const doc = take(data, {
147
- 'tool': _json,
147
+ 'tool': _ => de_Tool(_, context),
148
148
  });
149
149
  Object.assign(contents, doc);
150
150
  return contents;
@@ -196,7 +196,7 @@ export const de_GetToolCommand = async (output, context) => {
196
196
  });
197
197
  const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
198
198
  const doc = take(data, {
199
- 'tool': _json,
199
+ 'tool': _ => de_Tool(_, context),
200
200
  });
201
201
  Object.assign(contents, doc);
202
202
  return contents;
@@ -210,7 +210,7 @@ export const de_ListToolsCommand = async (output, context) => {
210
210
  });
211
211
  const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
212
212
  const doc = take(data, {
213
- 'tools': _json,
213
+ 'tools': _ => de_ToolsList(_, context),
214
214
  });
215
215
  Object.assign(contents, doc);
216
216
  return contents;
@@ -224,7 +224,7 @@ export const de_UpdateToolCommand = async (output, context) => {
224
224
  });
225
225
  const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
226
226
  const doc = take(data, {
227
- 'tool': _json,
227
+ 'tool': _ => de_Tool(_, context),
228
228
  });
229
229
  Object.assign(contents, doc);
230
230
  return contents;
@@ -331,9 +331,44 @@ const de_ToolExecutionServerExceptionRes = async (parsedOutput, context) => {
331
331
  const se_Document = (input, context) => {
332
332
  return input;
333
333
  };
334
+ const se_ToolHandler = (input, context) => {
335
+ return ToolHandler.visit(input, {
336
+ email: value => ({ "email": _json(value) }),
337
+ webhook: value => ({ "webhook": se_ToolWebhookConfig(value, context) }),
338
+ _: (name, value) => ({ [name]: value })
339
+ });
340
+ };
341
+ const se_ToolWebhookBody = (input, context) => {
342
+ return ToolWebhookBody.visit(input, {
343
+ staticJson: value => ({ "staticJson": se_Document(value, context) }),
344
+ template: value => ({ "template": value }),
345
+ _: (name, value) => ({ [name]: value })
346
+ });
347
+ };
348
+ const se_ToolWebhookConfig = (input, context) => {
349
+ return take(input, {
350
+ 'auth': _json,
351
+ 'body': _ => se_ToolWebhookBody(_, context),
352
+ 'headers': _json,
353
+ 'method': [],
354
+ 'queryParams': _json,
355
+ 'url': _json,
356
+ });
357
+ };
334
358
  const de_Document = (output, context) => {
335
359
  return output;
336
360
  };
361
+ const de_Tool = (output, context) => {
362
+ return take(output, {
363
+ 'category': __expectString,
364
+ 'companyId': __expectString,
365
+ 'description': __expectString,
366
+ 'handler': (_) => de_ToolHandler(__expectUnion(_), context),
367
+ 'id': __expectString,
368
+ 'input': _json,
369
+ 'name': __expectString,
370
+ });
371
+ };
337
372
  const de_ToolExecutionResult = (output, context) => {
338
373
  return take(output, {
339
374
  'error': _json,
@@ -341,6 +376,46 @@ const de_ToolExecutionResult = (output, context) => {
341
376
  'statusCode': __expectInt32,
342
377
  });
343
378
  };
379
+ const de_ToolHandler = (output, context) => {
380
+ if (output.email != null) {
381
+ return {
382
+ email: _json(__expectUnion(output.email))
383
+ };
384
+ }
385
+ if (output.webhook != null) {
386
+ return {
387
+ webhook: de_ToolWebhookConfig(output.webhook, context)
388
+ };
389
+ }
390
+ return { $unknown: Object.entries(output)[0] };
391
+ };
392
+ const de_ToolsList = (output, context) => {
393
+ const retVal = (output || []).filter((e) => e != null).map((entry) => {
394
+ return de_Tool(entry, context);
395
+ });
396
+ return retVal;
397
+ };
398
+ const de_ToolWebhookBody = (output, context) => {
399
+ if (output.staticJson != null) {
400
+ return {
401
+ staticJson: de_Document(output.staticJson, context)
402
+ };
403
+ }
404
+ if (__expectString(output.template) !== undefined) {
405
+ return { template: __expectString(output.template) };
406
+ }
407
+ return { $unknown: Object.entries(output)[0] };
408
+ };
409
+ const de_ToolWebhookConfig = (output, context) => {
410
+ return take(output, {
411
+ 'auth': (_) => _json(__expectUnion(_)),
412
+ 'body': (_) => de_ToolWebhookBody(__expectUnion(_), context),
413
+ 'headers': _json,
414
+ 'method': __expectString,
415
+ 'queryParams': _json,
416
+ 'url': (_) => _json(__expectUnion(_)),
417
+ });
418
+ };
344
419
  const deserializeMetadata = (output) => ({
345
420
  httpStatusCode: output.statusCode,
346
421
  requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
@@ -86,12 +86,45 @@ declare const CreateToolCommand_base: {
86
86
  * },
87
87
  * subject: "<ToolStringValue>", // required
88
88
  * text: "<ToolStringValue>", // required
89
- * html: "<ToolStringValue>", // required
89
+ * html: "<ToolStringValue>",
90
90
  * cc: "<ToolStringValue>",
91
91
  * bcc: "<ToolStringValue>",
92
92
  * replyTo: "<ToolStringValue>",
93
93
  * },
94
94
  * },
95
+ * webhook: { // ToolWebhookConfig
96
+ * method: "GET" || "POST" || "PUT" || "DELETE" || "PATCH", // required
97
+ * url: "<ToolStringValue>", // required
98
+ * queryParams: [ // ToolWebhookQueryParamsList
99
+ * { // ToolWebhookQueryParam
100
+ * name: "STRING_VALUE", // required
101
+ * value: "<ToolStringValue>", // required
102
+ * },
103
+ * ],
104
+ * headers: [ // ToolWebhookHeadersList
105
+ * { // ToolWebhookHeader
106
+ * name: "STRING_VALUE", // required
107
+ * value: "<ToolStringValue>", // required
108
+ * },
109
+ * ],
110
+ * body: { // ToolWebhookBody Union: only one key present
111
+ * staticJson: "DOCUMENT_VALUE",
112
+ * template: "STRING_VALUE",
113
+ * },
114
+ * auth: { // ToolWebhookAuth Union: only one key present
115
+ * basic: { // ToolWebhookAuthBasic
116
+ * username: "<ToolStringValue>", // required
117
+ * password: "<ToolStringValue>", // required
118
+ * },
119
+ * bearer: { // ToolWebhookAuthBearer
120
+ * token: "<ToolStringValue>", // required
121
+ * },
122
+ * customHeader: { // ToolWebhookAuthCustomHeader
123
+ * headerName: "STRING_VALUE", // required
124
+ * headerValue: "<ToolStringValue>", // required
125
+ * },
126
+ * },
127
+ * },
95
128
  * },
96
129
  * };
97
130
  * const command = new CreateToolCommand(input);
@@ -150,12 +183,45 @@ declare const CreateToolCommand_base: {
150
183
  * // },
151
184
  * // subject: "<ToolStringValue>", // required
152
185
  * // text: "<ToolStringValue>", // required
153
- * // html: "<ToolStringValue>", // required
186
+ * // html: "<ToolStringValue>",
154
187
  * // cc: "<ToolStringValue>",
155
188
  * // bcc: "<ToolStringValue>",
156
189
  * // replyTo: "<ToolStringValue>",
157
190
  * // },
158
191
  * // },
192
+ * // webhook: { // ToolWebhookConfig
193
+ * // method: "GET" || "POST" || "PUT" || "DELETE" || "PATCH", // required
194
+ * // url: "<ToolStringValue>", // required
195
+ * // queryParams: [ // ToolWebhookQueryParamsList
196
+ * // { // ToolWebhookQueryParam
197
+ * // name: "STRING_VALUE", // required
198
+ * // value: "<ToolStringValue>", // required
199
+ * // },
200
+ * // ],
201
+ * // headers: [ // ToolWebhookHeadersList
202
+ * // { // ToolWebhookHeader
203
+ * // name: "STRING_VALUE", // required
204
+ * // value: "<ToolStringValue>", // required
205
+ * // },
206
+ * // ],
207
+ * // body: { // ToolWebhookBody Union: only one key present
208
+ * // staticJson: "DOCUMENT_VALUE",
209
+ * // template: "STRING_VALUE",
210
+ * // },
211
+ * // auth: { // ToolWebhookAuth Union: only one key present
212
+ * // basic: { // ToolWebhookAuthBasic
213
+ * // username: "<ToolStringValue>", // required
214
+ * // password: "<ToolStringValue>", // required
215
+ * // },
216
+ * // bearer: { // ToolWebhookAuthBearer
217
+ * // token: "<ToolStringValue>", // required
218
+ * // },
219
+ * // customHeader: { // ToolWebhookAuthCustomHeader
220
+ * // headerName: "STRING_VALUE", // required
221
+ * // headerValue: "<ToolStringValue>", // required
222
+ * // },
223
+ * // },
224
+ * // },
159
225
  * // },
160
226
  * // },
161
227
  * // };
@@ -94,12 +94,45 @@ declare const GetToolCommand_base: {
94
94
  * // },
95
95
  * // subject: "<ToolStringValue>", // required
96
96
  * // text: "<ToolStringValue>", // required
97
- * // html: "<ToolStringValue>", // required
97
+ * // html: "<ToolStringValue>",
98
98
  * // cc: "<ToolStringValue>",
99
99
  * // bcc: "<ToolStringValue>",
100
100
  * // replyTo: "<ToolStringValue>",
101
101
  * // },
102
102
  * // },
103
+ * // webhook: { // ToolWebhookConfig
104
+ * // method: "GET" || "POST" || "PUT" || "DELETE" || "PATCH", // required
105
+ * // url: "<ToolStringValue>", // required
106
+ * // queryParams: [ // ToolWebhookQueryParamsList
107
+ * // { // ToolWebhookQueryParam
108
+ * // name: "STRING_VALUE", // required
109
+ * // value: "<ToolStringValue>", // required
110
+ * // },
111
+ * // ],
112
+ * // headers: [ // ToolWebhookHeadersList
113
+ * // { // ToolWebhookHeader
114
+ * // name: "STRING_VALUE", // required
115
+ * // value: "<ToolStringValue>", // required
116
+ * // },
117
+ * // ],
118
+ * // body: { // ToolWebhookBody Union: only one key present
119
+ * // staticJson: "DOCUMENT_VALUE",
120
+ * // template: "STRING_VALUE",
121
+ * // },
122
+ * // auth: { // ToolWebhookAuth Union: only one key present
123
+ * // basic: { // ToolWebhookAuthBasic
124
+ * // username: "<ToolStringValue>", // required
125
+ * // password: "<ToolStringValue>", // required
126
+ * // },
127
+ * // bearer: { // ToolWebhookAuthBearer
128
+ * // token: "<ToolStringValue>", // required
129
+ * // },
130
+ * // customHeader: { // ToolWebhookAuthCustomHeader
131
+ * // headerName: "STRING_VALUE", // required
132
+ * // headerValue: "<ToolStringValue>", // required
133
+ * // },
134
+ * // },
135
+ * // },
103
136
  * // },
104
137
  * // },
105
138
  * // };
@@ -94,12 +94,45 @@ declare const ListToolsCommand_base: {
94
94
  * // },
95
95
  * // subject: "<ToolStringValue>", // required
96
96
  * // text: "<ToolStringValue>", // required
97
- * // html: "<ToolStringValue>", // required
97
+ * // html: "<ToolStringValue>",
98
98
  * // cc: "<ToolStringValue>",
99
99
  * // bcc: "<ToolStringValue>",
100
100
  * // replyTo: "<ToolStringValue>",
101
101
  * // },
102
102
  * // },
103
+ * // webhook: { // ToolWebhookConfig
104
+ * // method: "GET" || "POST" || "PUT" || "DELETE" || "PATCH", // required
105
+ * // url: "<ToolStringValue>", // required
106
+ * // queryParams: [ // ToolWebhookQueryParamsList
107
+ * // { // ToolWebhookQueryParam
108
+ * // name: "STRING_VALUE", // required
109
+ * // value: "<ToolStringValue>", // required
110
+ * // },
111
+ * // ],
112
+ * // headers: [ // ToolWebhookHeadersList
113
+ * // { // ToolWebhookHeader
114
+ * // name: "STRING_VALUE", // required
115
+ * // value: "<ToolStringValue>", // required
116
+ * // },
117
+ * // ],
118
+ * // body: { // ToolWebhookBody Union: only one key present
119
+ * // staticJson: "DOCUMENT_VALUE",
120
+ * // template: "STRING_VALUE",
121
+ * // },
122
+ * // auth: { // ToolWebhookAuth Union: only one key present
123
+ * // basic: { // ToolWebhookAuthBasic
124
+ * // username: "<ToolStringValue>", // required
125
+ * // password: "<ToolStringValue>", // required
126
+ * // },
127
+ * // bearer: { // ToolWebhookAuthBearer
128
+ * // token: "<ToolStringValue>", // required
129
+ * // },
130
+ * // customHeader: { // ToolWebhookAuthCustomHeader
131
+ * // headerName: "STRING_VALUE", // required
132
+ * // headerValue: "<ToolStringValue>", // required
133
+ * // },
134
+ * // },
135
+ * // },
103
136
  * // },
104
137
  * // },
105
138
  * // ],
@@ -87,12 +87,45 @@ declare const UpdateToolCommand_base: {
87
87
  * },
88
88
  * subject: "<ToolStringValue>", // required
89
89
  * text: "<ToolStringValue>", // required
90
- * html: "<ToolStringValue>", // required
90
+ * html: "<ToolStringValue>",
91
91
  * cc: "<ToolStringValue>",
92
92
  * bcc: "<ToolStringValue>",
93
93
  * replyTo: "<ToolStringValue>",
94
94
  * },
95
95
  * },
96
+ * webhook: { // ToolWebhookConfig
97
+ * method: "GET" || "POST" || "PUT" || "DELETE" || "PATCH", // required
98
+ * url: "<ToolStringValue>", // required
99
+ * queryParams: [ // ToolWebhookQueryParamsList
100
+ * { // ToolWebhookQueryParam
101
+ * name: "STRING_VALUE", // required
102
+ * value: "<ToolStringValue>", // required
103
+ * },
104
+ * ],
105
+ * headers: [ // ToolWebhookHeadersList
106
+ * { // ToolWebhookHeader
107
+ * name: "STRING_VALUE", // required
108
+ * value: "<ToolStringValue>", // required
109
+ * },
110
+ * ],
111
+ * body: { // ToolWebhookBody Union: only one key present
112
+ * staticJson: "DOCUMENT_VALUE",
113
+ * template: "STRING_VALUE",
114
+ * },
115
+ * auth: { // ToolWebhookAuth Union: only one key present
116
+ * basic: { // ToolWebhookAuthBasic
117
+ * username: "<ToolStringValue>", // required
118
+ * password: "<ToolStringValue>", // required
119
+ * },
120
+ * bearer: { // ToolWebhookAuthBearer
121
+ * token: "<ToolStringValue>", // required
122
+ * },
123
+ * customHeader: { // ToolWebhookAuthCustomHeader
124
+ * headerName: "STRING_VALUE", // required
125
+ * headerValue: "<ToolStringValue>", // required
126
+ * },
127
+ * },
128
+ * },
96
129
  * },
97
130
  * };
98
131
  * const command = new UpdateToolCommand(input);
@@ -151,12 +184,45 @@ declare const UpdateToolCommand_base: {
151
184
  * // },
152
185
  * // subject: "<ToolStringValue>", // required
153
186
  * // text: "<ToolStringValue>", // required
154
- * // html: "<ToolStringValue>", // required
187
+ * // html: "<ToolStringValue>",
155
188
  * // cc: "<ToolStringValue>",
156
189
  * // bcc: "<ToolStringValue>",
157
190
  * // replyTo: "<ToolStringValue>",
158
191
  * // },
159
192
  * // },
193
+ * // webhook: { // ToolWebhookConfig
194
+ * // method: "GET" || "POST" || "PUT" || "DELETE" || "PATCH", // required
195
+ * // url: "<ToolStringValue>", // required
196
+ * // queryParams: [ // ToolWebhookQueryParamsList
197
+ * // { // ToolWebhookQueryParam
198
+ * // name: "STRING_VALUE", // required
199
+ * // value: "<ToolStringValue>", // required
200
+ * // },
201
+ * // ],
202
+ * // headers: [ // ToolWebhookHeadersList
203
+ * // { // ToolWebhookHeader
204
+ * // name: "STRING_VALUE", // required
205
+ * // value: "<ToolStringValue>", // required
206
+ * // },
207
+ * // ],
208
+ * // body: { // ToolWebhookBody Union: only one key present
209
+ * // staticJson: "DOCUMENT_VALUE",
210
+ * // template: "STRING_VALUE",
211
+ * // },
212
+ * // auth: { // ToolWebhookAuth Union: only one key present
213
+ * // basic: { // ToolWebhookAuthBasic
214
+ * // username: "<ToolStringValue>", // required
215
+ * // password: "<ToolStringValue>", // required
216
+ * // },
217
+ * // bearer: { // ToolWebhookAuthBearer
218
+ * // token: "<ToolStringValue>", // required
219
+ * // },
220
+ * // customHeader: { // ToolWebhookAuthCustomHeader
221
+ * // headerName: "STRING_VALUE", // required
222
+ * // headerValue: "<ToolStringValue>", // required
223
+ * // },
224
+ * // },
225
+ * // },
160
226
  * // },
161
227
  * // },
162
228
  * // };
@@ -99,7 +99,7 @@ export interface ToolSmtpConfig {
99
99
  */
100
100
  host: string;
101
101
  /**
102
- * SMTP server port, e.g.: '587'
102
+ * SMTP server port, e.g.: 587
103
103
  * @public
104
104
  */
105
105
  port: number;
@@ -152,7 +152,7 @@ export interface ToolCustomEmailConfig {
152
152
  * HTML content of the email
153
153
  * @public
154
154
  */
155
- html: ToolStringValue;
155
+ html?: ToolStringValue | undefined;
156
156
  /**
157
157
  * CC email addresses
158
158
  * @public
@@ -233,7 +233,223 @@ export declare namespace ToolEmailHandler {
233
233
  /**
234
234
  * @public
235
235
  */
236
- export type ToolHandler = ToolHandler.EmailMember | ToolHandler.$UnknownMember;
236
+ export interface ToolWebhookAuthBasic {
237
+ /**
238
+ * Username for basic authentication
239
+ * @public
240
+ */
241
+ username: ToolStringValue;
242
+ /**
243
+ * Password for basic authentication
244
+ * @public
245
+ */
246
+ password: ToolStringValue;
247
+ }
248
+ /**
249
+ * @public
250
+ */
251
+ export interface ToolWebhookAuthBearer {
252
+ /**
253
+ * Bearer token value, supports static, variable, or template syntax
254
+ * @public
255
+ */
256
+ token: ToolStringValue;
257
+ }
258
+ /**
259
+ * @public
260
+ */
261
+ export interface ToolWebhookAuthCustomHeader {
262
+ /**
263
+ * Header name for custom authentication, e.g.: 'X-API-Key'
264
+ * @public
265
+ */
266
+ headerName: string;
267
+ /**
268
+ * Header value, supports static, variable, or template syntax
269
+ * @public
270
+ */
271
+ headerValue: ToolStringValue;
272
+ }
273
+ /**
274
+ * @public
275
+ */
276
+ export type ToolWebhookAuth = ToolWebhookAuth.BasicMember | ToolWebhookAuth.BearerMember | ToolWebhookAuth.CustomHeaderMember | ToolWebhookAuth.$UnknownMember;
277
+ /**
278
+ * @public
279
+ */
280
+ export declare namespace ToolWebhookAuth {
281
+ /**
282
+ * HTTP Basic Authentication
283
+ * @public
284
+ */
285
+ interface BasicMember {
286
+ basic: ToolWebhookAuthBasic;
287
+ bearer?: never;
288
+ customHeader?: never;
289
+ $unknown?: never;
290
+ }
291
+ /**
292
+ * HTTP Bearer Token Authentication
293
+ * @public
294
+ */
295
+ interface BearerMember {
296
+ basic?: never;
297
+ bearer: ToolWebhookAuthBearer;
298
+ customHeader?: never;
299
+ $unknown?: never;
300
+ }
301
+ /**
302
+ * Custom Header Authentication
303
+ * @public
304
+ */
305
+ interface CustomHeaderMember {
306
+ basic?: never;
307
+ bearer?: never;
308
+ customHeader: ToolWebhookAuthCustomHeader;
309
+ $unknown?: never;
310
+ }
311
+ /**
312
+ * @public
313
+ */
314
+ interface $UnknownMember {
315
+ basic?: never;
316
+ bearer?: never;
317
+ customHeader?: never;
318
+ $unknown: [string, any];
319
+ }
320
+ interface Visitor<T> {
321
+ basic: (value: ToolWebhookAuthBasic) => T;
322
+ bearer: (value: ToolWebhookAuthBearer) => T;
323
+ customHeader: (value: ToolWebhookAuthCustomHeader) => T;
324
+ _: (name: string, value: any) => T;
325
+ }
326
+ const visit: <T>(value: ToolWebhookAuth, visitor: Visitor<T>) => T;
327
+ }
328
+ /**
329
+ * @public
330
+ */
331
+ export type ToolWebhookBody = ToolWebhookBody.StaticJsonMember | ToolWebhookBody.TemplateMember | ToolWebhookBody.$UnknownMember;
332
+ /**
333
+ * @public
334
+ */
335
+ export declare namespace ToolWebhookBody {
336
+ /**
337
+ * Static JSON document body
338
+ * @public
339
+ */
340
+ interface StaticJsonMember {
341
+ staticJson: __DocumentType;
342
+ template?: never;
343
+ $unknown?: never;
344
+ }
345
+ /**
346
+ * Template string body that supports variables and static values
347
+ * @public
348
+ */
349
+ interface TemplateMember {
350
+ staticJson?: never;
351
+ template: string;
352
+ $unknown?: never;
353
+ }
354
+ /**
355
+ * @public
356
+ */
357
+ interface $UnknownMember {
358
+ staticJson?: never;
359
+ template?: never;
360
+ $unknown: [string, any];
361
+ }
362
+ interface Visitor<T> {
363
+ staticJson: (value: __DocumentType) => T;
364
+ template: (value: string) => T;
365
+ _: (name: string, value: any) => T;
366
+ }
367
+ const visit: <T>(value: ToolWebhookBody, visitor: Visitor<T>) => T;
368
+ }
369
+ /**
370
+ * @public
371
+ */
372
+ export interface ToolWebhookHeader {
373
+ /**
374
+ * Header name, e.g.: 'X-Custom-Header'
375
+ * @public
376
+ */
377
+ name: string;
378
+ /**
379
+ * Header value, supports static, variable, or template syntax
380
+ * @public
381
+ */
382
+ value: ToolStringValue;
383
+ }
384
+ /**
385
+ * @public
386
+ * @enum
387
+ */
388
+ export declare const ToolWebhookMethod: {
389
+ readonly DELETE: "DELETE";
390
+ readonly GET: "GET";
391
+ readonly PATCH: "PATCH";
392
+ readonly POST: "POST";
393
+ readonly PUT: "PUT";
394
+ };
395
+ /**
396
+ * @public
397
+ */
398
+ export type ToolWebhookMethod = typeof ToolWebhookMethod[keyof typeof ToolWebhookMethod];
399
+ /**
400
+ * @public
401
+ */
402
+ export interface ToolWebhookQueryParam {
403
+ /**
404
+ * Query parameter name, e.g.: 'filter'
405
+ * @public
406
+ */
407
+ name: string;
408
+ /**
409
+ * Query parameter value, supports static, variable, or template syntax
410
+ * @public
411
+ */
412
+ value: ToolStringValue;
413
+ }
414
+ /**
415
+ * @public
416
+ */
417
+ export interface ToolWebhookConfig {
418
+ /**
419
+ * HTTP method for the webhook request, e.g.: 'POST'
420
+ * @public
421
+ */
422
+ method: ToolWebhookMethod;
423
+ /**
424
+ * URL endpoint for the webhook, supports variables in path using \{\{variable_name\}\}
425
+ * @public
426
+ */
427
+ url: ToolStringValue;
428
+ /**
429
+ * Query parameters for the webhook request
430
+ * @public
431
+ */
432
+ queryParams?: (ToolWebhookQueryParam)[] | undefined;
433
+ /**
434
+ * HTTP headers for the webhook request
435
+ * @public
436
+ */
437
+ headers?: (ToolWebhookHeader)[] | undefined;
438
+ /**
439
+ * Request body for POST, PUT, or PATCH requests
440
+ * @public
441
+ */
442
+ body?: ToolWebhookBody | undefined;
443
+ /**
444
+ * Authentication configuration for the webhook request
445
+ * @public
446
+ */
447
+ auth?: ToolWebhookAuth | undefined;
448
+ }
449
+ /**
450
+ * @public
451
+ */
452
+ export type ToolHandler = ToolHandler.EmailMember | ToolHandler.WebhookMember | ToolHandler.$UnknownMember;
237
453
  /**
238
454
  * @public
239
455
  */
@@ -244,6 +460,16 @@ export declare namespace ToolHandler {
244
460
  */
245
461
  interface EmailMember {
246
462
  email: ToolEmailHandler;
463
+ webhook?: never;
464
+ $unknown?: never;
465
+ }
466
+ /**
467
+ * Webhook handler of the tool.
468
+ * @public
469
+ */
470
+ interface WebhookMember {
471
+ email?: never;
472
+ webhook: ToolWebhookConfig;
247
473
  $unknown?: never;
248
474
  }
249
475
  /**
@@ -251,10 +477,12 @@ export declare namespace ToolHandler {
251
477
  */
252
478
  interface $UnknownMember {
253
479
  email?: never;
480
+ webhook?: never;
254
481
  $unknown: [string, any];
255
482
  }
256
483
  interface Visitor<T> {
257
484
  email: (value: ToolEmailHandler) => T;
485
+ webhook: (value: ToolWebhookConfig) => T;
258
486
  _: (name: string, value: any) => T;
259
487
  }
260
488
  const visit: <T>(value: ToolHandler, visitor: Visitor<T>) => T;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@wildix/wim-tools-client",
3
3
  "description": "@wildix/wim-tools-client client",
4
- "version": "0.0.19",
4
+ "version": "0.0.21",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
7
7
  "build:cjs": "tsc -p tsconfig.cjs.json",