@wildix/wim-tools-client 0.0.21 → 0.0.23

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.ToolWebhookMethod = exports.ToolWebhookBody = exports.ToolWebhookAuth = exports.ToolEmailHandler = exports.ToolStringValue = exports.ValidationException = exports.NotFoundException = exports.AlreadyExistException = void 0;
3
+ exports.ToolExecutionServerException = exports.ToolExecutionException = exports.ToolVariableType = exports.ToolHandler = exports.ToolWebhookMethod = 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";
@@ -70,21 +70,11 @@ var ToolWebhookAuth;
70
70
  return visitor.basic(value.basic);
71
71
  if (value.bearer !== undefined)
72
72
  return visitor.bearer(value.bearer);
73
- if (value.customHeader !== undefined)
74
- return visitor.customHeader(value.customHeader);
73
+ if (value.oauth !== undefined)
74
+ return visitor.oauth(value.oauth);
75
75
  return visitor._(value.$unknown[0], value.$unknown[1]);
76
76
  };
77
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
78
  exports.ToolWebhookMethod = {
89
79
  DELETE: "DELETE",
90
80
  GET: "GET",
@@ -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': _ => se_ToolHandler(_, context),
22
+ 'handler': _ => (0, smithy_client_1._json)(_),
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': _ => se_ToolHandler(_, context),
137
+ 'handler': _ => (0, smithy_client_1._json)(_),
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': _ => de_Tool(_, context),
157
+ 'tool': smithy_client_1._json,
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': _ => de_Tool(_, context),
213
+ 'tool': smithy_client_1._json,
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': _ => de_ToolsList(_, context),
228
+ 'tools': smithy_client_1._json,
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': _ => de_Tool(_, context),
243
+ 'tool': smithy_client_1._json,
244
244
  });
245
245
  Object.assign(contents, doc);
246
246
  return contents;
@@ -348,44 +348,9 @@ 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
- };
375
351
  const de_Document = (output, context) => {
376
352
  return output;
377
353
  };
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
- };
389
354
  const de_ToolExecutionResult = (output, context) => {
390
355
  return (0, smithy_client_1.take)(output, {
391
356
  'error': smithy_client_1._json,
@@ -393,46 +358,6 @@ const de_ToolExecutionResult = (output, context) => {
393
358
  'statusCode': smithy_client_1.expectInt32,
394
359
  });
395
360
  };
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
- };
436
361
  const deserializeMetadata = (output) => ({
437
362
  httpStatusCode: output.statusCode,
438
363
  requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
@@ -64,21 +64,11 @@ export var ToolWebhookAuth;
64
64
  return visitor.basic(value.basic);
65
65
  if (value.bearer !== undefined)
66
66
  return visitor.bearer(value.bearer);
67
- if (value.customHeader !== undefined)
68
- return visitor.customHeader(value.customHeader);
67
+ if (value.oauth !== undefined)
68
+ return visitor.oauth(value.oauth);
69
69
  return visitor._(value.$unknown[0], value.$unknown[1]);
70
70
  };
71
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
72
  export const ToolWebhookMethod = {
83
73
  DELETE: "DELETE",
84
74
  GET: "GET",
@@ -1,6 +1,6 @@
1
1
  import { ToolsServiceException as __BaseException } from "../models/ToolsServiceException";
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";
2
+ import { AlreadyExistException, NotFoundException, ToolExecutionException, ToolExecutionServerException, ValidationException, } from "../models/models_0";
3
+ import { 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': _ => se_ToolHandler(_, context),
19
+ 'handler': _ => _json(_),
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': _ => se_ToolHandler(_, context),
128
+ 'handler': _ => _json(_),
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': _ => de_Tool(_, context),
147
+ 'tool': _json,
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': _ => de_Tool(_, context),
199
+ 'tool': _json,
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': _ => de_ToolsList(_, context),
213
+ 'tools': _json,
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': _ => de_Tool(_, context),
227
+ 'tool': _json,
228
228
  });
229
229
  Object.assign(contents, doc);
230
230
  return contents;
@@ -331,44 +331,9 @@ 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
- };
358
334
  const de_Document = (output, context) => {
359
335
  return output;
360
336
  };
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
- };
372
337
  const de_ToolExecutionResult = (output, context) => {
373
338
  return take(output, {
374
339
  'error': _json,
@@ -376,46 +341,6 @@ const de_ToolExecutionResult = (output, context) => {
376
341
  'statusCode': __expectInt32,
377
342
  });
378
343
  };
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
- };
419
344
  const deserializeMetadata = (output) => ({
420
345
  httpStatusCode: output.statusCode,
421
346
  requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
@@ -44,6 +44,7 @@ declare const CreateToolCommand_base: {
44
44
  * { // ToolVariable
45
45
  * name: "STRING_VALUE", // required
46
46
  * type: "string" || "number" || "boolean" || "string_array" || "number_array", // required
47
+ * optional: true || false, // required
47
48
  * },
48
49
  * ],
49
50
  * },
@@ -95,22 +96,13 @@ declare const CreateToolCommand_base: {
95
96
  * webhook: { // ToolWebhookConfig
96
97
  * method: "GET" || "POST" || "PUT" || "DELETE" || "PATCH", // required
97
98
  * url: "<ToolStringValue>", // required
98
- * queryParams: [ // ToolWebhookQueryParamsList
99
- * { // ToolWebhookQueryParam
100
- * name: "STRING_VALUE", // required
101
- * value: "<ToolStringValue>", // required
102
- * },
103
- * ],
104
99
  * headers: [ // ToolWebhookHeadersList
105
100
  * { // ToolWebhookHeader
106
101
  * name: "STRING_VALUE", // required
107
102
  * value: "<ToolStringValue>", // required
108
103
  * },
109
104
  * ],
110
- * body: { // ToolWebhookBody Union: only one key present
111
- * staticJson: "DOCUMENT_VALUE",
112
- * template: "STRING_VALUE",
113
- * },
105
+ * body: "<ToolStringValue>",
114
106
  * auth: { // ToolWebhookAuth Union: only one key present
115
107
  * basic: { // ToolWebhookAuthBasic
116
108
  * username: "<ToolStringValue>", // required
@@ -119,9 +111,11 @@ declare const CreateToolCommand_base: {
119
111
  * bearer: { // ToolWebhookAuthBearer
120
112
  * token: "<ToolStringValue>", // required
121
113
  * },
122
- * customHeader: { // ToolWebhookAuthCustomHeader
123
- * headerName: "STRING_VALUE", // required
124
- * headerValue: "<ToolStringValue>", // required
114
+ * oauth: { // ToolWebhookAuthOAuth
115
+ * clientId: "STRING_VALUE", // required
116
+ * clientSecret: "STRING_VALUE", // required
117
+ * endpointUrl: "STRING_VALUE", // required
118
+ * scope: "STRING_VALUE",
125
119
  * },
126
120
  * },
127
121
  * },
@@ -141,6 +135,7 @@ declare const CreateToolCommand_base: {
141
135
  * // { // ToolVariable
142
136
  * // name: "STRING_VALUE", // required
143
137
  * // type: "string" || "number" || "boolean" || "string_array" || "number_array", // required
138
+ * // optional: true || false, // required
144
139
  * // },
145
140
  * // ],
146
141
  * // },
@@ -192,22 +187,13 @@ declare const CreateToolCommand_base: {
192
187
  * // webhook: { // ToolWebhookConfig
193
188
  * // method: "GET" || "POST" || "PUT" || "DELETE" || "PATCH", // required
194
189
  * // url: "<ToolStringValue>", // required
195
- * // queryParams: [ // ToolWebhookQueryParamsList
196
- * // { // ToolWebhookQueryParam
197
- * // name: "STRING_VALUE", // required
198
- * // value: "<ToolStringValue>", // required
199
- * // },
200
- * // ],
201
190
  * // headers: [ // ToolWebhookHeadersList
202
191
  * // { // ToolWebhookHeader
203
192
  * // name: "STRING_VALUE", // required
204
193
  * // value: "<ToolStringValue>", // required
205
194
  * // },
206
195
  * // ],
207
- * // body: { // ToolWebhookBody Union: only one key present
208
- * // staticJson: "DOCUMENT_VALUE",
209
- * // template: "STRING_VALUE",
210
- * // },
196
+ * // body: "<ToolStringValue>",
211
197
  * // auth: { // ToolWebhookAuth Union: only one key present
212
198
  * // basic: { // ToolWebhookAuthBasic
213
199
  * // username: "<ToolStringValue>", // required
@@ -216,9 +202,11 @@ declare const CreateToolCommand_base: {
216
202
  * // bearer: { // ToolWebhookAuthBearer
217
203
  * // token: "<ToolStringValue>", // required
218
204
  * // },
219
- * // customHeader: { // ToolWebhookAuthCustomHeader
220
- * // headerName: "STRING_VALUE", // required
221
- * // headerValue: "<ToolStringValue>", // required
205
+ * // oauth: { // ToolWebhookAuthOAuth
206
+ * // clientId: "STRING_VALUE", // required
207
+ * // clientSecret: "STRING_VALUE", // required
208
+ * // endpointUrl: "STRING_VALUE", // required
209
+ * // scope: "STRING_VALUE",
222
210
  * // },
223
211
  * // },
224
212
  * // },
@@ -52,6 +52,7 @@ declare const DescribeToolsCommand_base: {
52
52
  * // { // ToolVariable
53
53
  * // name: "STRING_VALUE", // required
54
54
  * // type: "string" || "number" || "boolean" || "string_array" || "number_array", // required
55
+ * // optional: true || false, // required
55
56
  * // },
56
57
  * // ],
57
58
  * // },
@@ -52,6 +52,7 @@ declare const GetToolCommand_base: {
52
52
  * // { // ToolVariable
53
53
  * // name: "STRING_VALUE", // required
54
54
  * // type: "string" || "number" || "boolean" || "string_array" || "number_array", // required
55
+ * // optional: true || false, // required
55
56
  * // },
56
57
  * // ],
57
58
  * // },
@@ -103,22 +104,13 @@ declare const GetToolCommand_base: {
103
104
  * // webhook: { // ToolWebhookConfig
104
105
  * // method: "GET" || "POST" || "PUT" || "DELETE" || "PATCH", // required
105
106
  * // url: "<ToolStringValue>", // required
106
- * // queryParams: [ // ToolWebhookQueryParamsList
107
- * // { // ToolWebhookQueryParam
108
- * // name: "STRING_VALUE", // required
109
- * // value: "<ToolStringValue>", // required
110
- * // },
111
- * // ],
112
107
  * // headers: [ // ToolWebhookHeadersList
113
108
  * // { // ToolWebhookHeader
114
109
  * // name: "STRING_VALUE", // required
115
110
  * // value: "<ToolStringValue>", // required
116
111
  * // },
117
112
  * // ],
118
- * // body: { // ToolWebhookBody Union: only one key present
119
- * // staticJson: "DOCUMENT_VALUE",
120
- * // template: "STRING_VALUE",
121
- * // },
113
+ * // body: "<ToolStringValue>",
122
114
  * // auth: { // ToolWebhookAuth Union: only one key present
123
115
  * // basic: { // ToolWebhookAuthBasic
124
116
  * // username: "<ToolStringValue>", // required
@@ -127,9 +119,11 @@ declare const GetToolCommand_base: {
127
119
  * // bearer: { // ToolWebhookAuthBearer
128
120
  * // token: "<ToolStringValue>", // required
129
121
  * // },
130
- * // customHeader: { // ToolWebhookAuthCustomHeader
131
- * // headerName: "STRING_VALUE", // required
132
- * // headerValue: "<ToolStringValue>", // required
122
+ * // oauth: { // ToolWebhookAuthOAuth
123
+ * // clientId: "STRING_VALUE", // required
124
+ * // clientSecret: "STRING_VALUE", // required
125
+ * // endpointUrl: "STRING_VALUE", // required
126
+ * // scope: "STRING_VALUE",
133
127
  * // },
134
128
  * // },
135
129
  * // },
@@ -52,6 +52,7 @@ declare const ListToolsCommand_base: {
52
52
  * // { // ToolVariable
53
53
  * // name: "STRING_VALUE", // required
54
54
  * // type: "string" || "number" || "boolean" || "string_array" || "number_array", // required
55
+ * // optional: true || false, // required
55
56
  * // },
56
57
  * // ],
57
58
  * // },
@@ -103,22 +104,13 @@ declare const ListToolsCommand_base: {
103
104
  * // webhook: { // ToolWebhookConfig
104
105
  * // method: "GET" || "POST" || "PUT" || "DELETE" || "PATCH", // required
105
106
  * // url: "<ToolStringValue>", // required
106
- * // queryParams: [ // ToolWebhookQueryParamsList
107
- * // { // ToolWebhookQueryParam
108
- * // name: "STRING_VALUE", // required
109
- * // value: "<ToolStringValue>", // required
110
- * // },
111
- * // ],
112
107
  * // headers: [ // ToolWebhookHeadersList
113
108
  * // { // ToolWebhookHeader
114
109
  * // name: "STRING_VALUE", // required
115
110
  * // value: "<ToolStringValue>", // required
116
111
  * // },
117
112
  * // ],
118
- * // body: { // ToolWebhookBody Union: only one key present
119
- * // staticJson: "DOCUMENT_VALUE",
120
- * // template: "STRING_VALUE",
121
- * // },
113
+ * // body: "<ToolStringValue>",
122
114
  * // auth: { // ToolWebhookAuth Union: only one key present
123
115
  * // basic: { // ToolWebhookAuthBasic
124
116
  * // username: "<ToolStringValue>", // required
@@ -127,9 +119,11 @@ declare const ListToolsCommand_base: {
127
119
  * // bearer: { // ToolWebhookAuthBearer
128
120
  * // token: "<ToolStringValue>", // required
129
121
  * // },
130
- * // customHeader: { // ToolWebhookAuthCustomHeader
131
- * // headerName: "STRING_VALUE", // required
132
- * // headerValue: "<ToolStringValue>", // required
122
+ * // oauth: { // ToolWebhookAuthOAuth
123
+ * // clientId: "STRING_VALUE", // required
124
+ * // clientSecret: "STRING_VALUE", // required
125
+ * // endpointUrl: "STRING_VALUE", // required
126
+ * // scope: "STRING_VALUE",
133
127
  * // },
134
128
  * // },
135
129
  * // },
@@ -45,6 +45,7 @@ declare const UpdateToolCommand_base: {
45
45
  * { // ToolVariable
46
46
  * name: "STRING_VALUE", // required
47
47
  * type: "string" || "number" || "boolean" || "string_array" || "number_array", // required
48
+ * optional: true || false, // required
48
49
  * },
49
50
  * ],
50
51
  * },
@@ -96,22 +97,13 @@ declare const UpdateToolCommand_base: {
96
97
  * webhook: { // ToolWebhookConfig
97
98
  * method: "GET" || "POST" || "PUT" || "DELETE" || "PATCH", // required
98
99
  * url: "<ToolStringValue>", // required
99
- * queryParams: [ // ToolWebhookQueryParamsList
100
- * { // ToolWebhookQueryParam
101
- * name: "STRING_VALUE", // required
102
- * value: "<ToolStringValue>", // required
103
- * },
104
- * ],
105
100
  * headers: [ // ToolWebhookHeadersList
106
101
  * { // ToolWebhookHeader
107
102
  * name: "STRING_VALUE", // required
108
103
  * value: "<ToolStringValue>", // required
109
104
  * },
110
105
  * ],
111
- * body: { // ToolWebhookBody Union: only one key present
112
- * staticJson: "DOCUMENT_VALUE",
113
- * template: "STRING_VALUE",
114
- * },
106
+ * body: "<ToolStringValue>",
115
107
  * auth: { // ToolWebhookAuth Union: only one key present
116
108
  * basic: { // ToolWebhookAuthBasic
117
109
  * username: "<ToolStringValue>", // required
@@ -120,9 +112,11 @@ declare const UpdateToolCommand_base: {
120
112
  * bearer: { // ToolWebhookAuthBearer
121
113
  * token: "<ToolStringValue>", // required
122
114
  * },
123
- * customHeader: { // ToolWebhookAuthCustomHeader
124
- * headerName: "STRING_VALUE", // required
125
- * headerValue: "<ToolStringValue>", // required
115
+ * oauth: { // ToolWebhookAuthOAuth
116
+ * clientId: "STRING_VALUE", // required
117
+ * clientSecret: "STRING_VALUE", // required
118
+ * endpointUrl: "STRING_VALUE", // required
119
+ * scope: "STRING_VALUE",
126
120
  * },
127
121
  * },
128
122
  * },
@@ -142,6 +136,7 @@ declare const UpdateToolCommand_base: {
142
136
  * // { // ToolVariable
143
137
  * // name: "STRING_VALUE", // required
144
138
  * // type: "string" || "number" || "boolean" || "string_array" || "number_array", // required
139
+ * // optional: true || false, // required
145
140
  * // },
146
141
  * // ],
147
142
  * // },
@@ -193,22 +188,13 @@ declare const UpdateToolCommand_base: {
193
188
  * // webhook: { // ToolWebhookConfig
194
189
  * // method: "GET" || "POST" || "PUT" || "DELETE" || "PATCH", // required
195
190
  * // url: "<ToolStringValue>", // required
196
- * // queryParams: [ // ToolWebhookQueryParamsList
197
- * // { // ToolWebhookQueryParam
198
- * // name: "STRING_VALUE", // required
199
- * // value: "<ToolStringValue>", // required
200
- * // },
201
- * // ],
202
191
  * // headers: [ // ToolWebhookHeadersList
203
192
  * // { // ToolWebhookHeader
204
193
  * // name: "STRING_VALUE", // required
205
194
  * // value: "<ToolStringValue>", // required
206
195
  * // },
207
196
  * // ],
208
- * // body: { // ToolWebhookBody Union: only one key present
209
- * // staticJson: "DOCUMENT_VALUE",
210
- * // template: "STRING_VALUE",
211
- * // },
197
+ * // body: "<ToolStringValue>",
212
198
  * // auth: { // ToolWebhookAuth Union: only one key present
213
199
  * // basic: { // ToolWebhookAuthBasic
214
200
  * // username: "<ToolStringValue>", // required
@@ -217,9 +203,11 @@ declare const UpdateToolCommand_base: {
217
203
  * // bearer: { // ToolWebhookAuthBearer
218
204
  * // token: "<ToolStringValue>", // required
219
205
  * // },
220
- * // customHeader: { // ToolWebhookAuthCustomHeader
221
- * // headerName: "STRING_VALUE", // required
222
- * // headerValue: "<ToolStringValue>", // required
206
+ * // oauth: { // ToolWebhookAuthOAuth
207
+ * // clientId: "STRING_VALUE", // required
208
+ * // clientSecret: "STRING_VALUE", // required
209
+ * // endpointUrl: "STRING_VALUE", // required
210
+ * // scope: "STRING_VALUE",
223
211
  * // },
224
212
  * // },
225
213
  * // },
@@ -258,22 +258,32 @@ export interface ToolWebhookAuthBearer {
258
258
  /**
259
259
  * @public
260
260
  */
261
- export interface ToolWebhookAuthCustomHeader {
261
+ export interface ToolWebhookAuthOAuth {
262
262
  /**
263
- * Header name for custom authentication, e.g.: 'X-API-Key'
263
+ * OAuth client ID
264
264
  * @public
265
265
  */
266
- headerName: string;
266
+ clientId: string;
267
267
  /**
268
- * Header value, supports static, variable, or template syntax
268
+ * OAuth client secret
269
+ * @public
270
+ */
271
+ clientSecret: string;
272
+ /**
273
+ * OAuth token endpoint URL
274
+ * @public
275
+ */
276
+ endpointUrl: string;
277
+ /**
278
+ * OAuth scope
269
279
  * @public
270
280
  */
271
- headerValue: ToolStringValue;
281
+ scope?: string | undefined;
272
282
  }
273
283
  /**
274
284
  * @public
275
285
  */
276
- export type ToolWebhookAuth = ToolWebhookAuth.BasicMember | ToolWebhookAuth.BearerMember | ToolWebhookAuth.CustomHeaderMember | ToolWebhookAuth.$UnknownMember;
286
+ export type ToolWebhookAuth = ToolWebhookAuth.BasicMember | ToolWebhookAuth.BearerMember | ToolWebhookAuth.OauthMember | ToolWebhookAuth.$UnknownMember;
277
287
  /**
278
288
  * @public
279
289
  */
@@ -285,7 +295,7 @@ export declare namespace ToolWebhookAuth {
285
295
  interface BasicMember {
286
296
  basic: ToolWebhookAuthBasic;
287
297
  bearer?: never;
288
- customHeader?: never;
298
+ oauth?: never;
289
299
  $unknown?: never;
290
300
  }
291
301
  /**
@@ -295,17 +305,17 @@ export declare namespace ToolWebhookAuth {
295
305
  interface BearerMember {
296
306
  basic?: never;
297
307
  bearer: ToolWebhookAuthBearer;
298
- customHeader?: never;
308
+ oauth?: never;
299
309
  $unknown?: never;
300
310
  }
301
311
  /**
302
- * Custom Header Authentication
312
+ * HTTP OAuth Authentication
303
313
  * @public
304
314
  */
305
- interface CustomHeaderMember {
315
+ interface OauthMember {
306
316
  basic?: never;
307
317
  bearer?: never;
308
- customHeader: ToolWebhookAuthCustomHeader;
318
+ oauth: ToolWebhookAuthOAuth;
309
319
  $unknown?: never;
310
320
  }
311
321
  /**
@@ -314,58 +324,17 @@ export declare namespace ToolWebhookAuth {
314
324
  interface $UnknownMember {
315
325
  basic?: never;
316
326
  bearer?: never;
317
- customHeader?: never;
327
+ oauth?: never;
318
328
  $unknown: [string, any];
319
329
  }
320
330
  interface Visitor<T> {
321
331
  basic: (value: ToolWebhookAuthBasic) => T;
322
332
  bearer: (value: ToolWebhookAuthBearer) => T;
323
- customHeader: (value: ToolWebhookAuthCustomHeader) => T;
333
+ oauth: (value: ToolWebhookAuthOAuth) => T;
324
334
  _: (name: string, value: any) => T;
325
335
  }
326
336
  const visit: <T>(value: ToolWebhookAuth, visitor: Visitor<T>) => T;
327
337
  }
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
338
  /**
370
339
  * @public
371
340
  */
@@ -396,21 +365,6 @@ export declare const ToolWebhookMethod: {
396
365
  * @public
397
366
  */
398
367
  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
368
  /**
415
369
  * @public
416
370
  */
@@ -421,17 +375,12 @@ export interface ToolWebhookConfig {
421
375
  */
422
376
  method: ToolWebhookMethod;
423
377
  /**
424
- * URL endpoint for the webhook, supports variables in path using \{\{variable_name\}\}
378
+ * URL endpoint for the webhook, supports variables in path and query parameters using \{\{variable_name\}\}, e.g.: 'https://api.example.com/users/\{\{userId\}\}?filter=\{\{filter\}\}&page=\{\{page\}\}'
425
379
  * @public
426
380
  */
427
381
  url: ToolStringValue;
428
382
  /**
429
- * Query parameters for the webhook request
430
- * @public
431
- */
432
- queryParams?: (ToolWebhookQueryParam)[] | undefined;
433
- /**
434
- * HTTP headers for the webhook request
383
+ * HTTP headers for the webhook request. For custom authentication headers (e.g., X-API-Key), add them here instead of using auth.customHeader
435
384
  * @public
436
385
  */
437
386
  headers?: (ToolWebhookHeader)[] | undefined;
@@ -439,9 +388,9 @@ export interface ToolWebhookConfig {
439
388
  * Request body for POST, PUT, or PATCH requests
440
389
  * @public
441
390
  */
442
- body?: ToolWebhookBody | undefined;
391
+ body?: ToolStringValue | undefined;
443
392
  /**
444
- * Authentication configuration for the webhook request
393
+ * Authentication configuration for the webhook request. For custom header authentication, use the headers field instead
445
394
  * @public
446
395
  */
447
396
  auth?: ToolWebhookAuth | undefined;
@@ -516,6 +465,11 @@ export interface ToolVariable {
516
465
  * @public
517
466
  */
518
467
  type: ToolVariableType;
468
+ /**
469
+ * Whether the variable is optional
470
+ * @public
471
+ */
472
+ optional: boolean;
519
473
  }
520
474
  /**
521
475
  * @public
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.21",
4
+ "version": "0.0.23",
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",