@wildix/wim-tools-client 0.0.24 → 0.0.26

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.ToolWebhookAuth = exports.ToolEmailHandler = exports.ToolStringValue = exports.ValidationException = exports.NotFoundException = exports.AlreadyExistException = void 0;
3
+ exports.ForbiddenException = exports.ToolExecutionServerException = exports.ToolExecutionException = exports.ToolVariableType = exports.ToolHandler = exports.ToolWebhookMethod = exports.ToolWebhookAuth = exports.ToolEmailHandler = exports.ToolChatHandler = exports.ToolChatRecipient = 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";
@@ -53,6 +53,24 @@ var ToolStringValue;
53
53
  return visitor._(value.$unknown[0], value.$unknown[1]);
54
54
  };
55
55
  })(ToolStringValue || (exports.ToolStringValue = ToolStringValue = {}));
56
+ var ToolChatRecipient;
57
+ (function (ToolChatRecipient) {
58
+ ToolChatRecipient.visit = (value, visitor) => {
59
+ if (value.channelId !== undefined)
60
+ return visitor.channelId(value.channelId);
61
+ if (value.userId !== undefined)
62
+ return visitor.userId(value.userId);
63
+ return visitor._(value.$unknown[0], value.$unknown[1]);
64
+ };
65
+ })(ToolChatRecipient || (exports.ToolChatRecipient = ToolChatRecipient = {}));
66
+ var ToolChatHandler;
67
+ (function (ToolChatHandler) {
68
+ ToolChatHandler.visit = (value, visitor) => {
69
+ if (value.config !== undefined)
70
+ return visitor.config(value.config);
71
+ return visitor._(value.$unknown[0], value.$unknown[1]);
72
+ };
73
+ })(ToolChatHandler || (exports.ToolChatHandler = ToolChatHandler = {}));
56
74
  var ToolEmailHandler;
57
75
  (function (ToolEmailHandler) {
58
76
  ToolEmailHandler.visit = (value, visitor) => {
@@ -91,6 +109,8 @@ var ToolHandler;
91
109
  return visitor.webhook(value.webhook);
92
110
  if (value.search !== undefined)
93
111
  return visitor.search(value.search);
112
+ if (value.chat !== undefined)
113
+ return visitor.chat(value.chat);
94
114
  return visitor._(value.$unknown[0], value.$unknown[1]);
95
115
  };
96
116
  })(ToolHandler || (exports.ToolHandler = ToolHandler = {}));
@@ -131,3 +151,18 @@ class ToolExecutionServerException extends ToolsServiceException_1.ToolsServiceE
131
151
  }
132
152
  }
133
153
  exports.ToolExecutionServerException = ToolExecutionServerException;
154
+ class ForbiddenException extends ToolsServiceException_1.ToolsServiceException {
155
+ name = "ForbiddenException";
156
+ $fault = "client";
157
+ details;
158
+ constructor(opts) {
159
+ super({
160
+ name: "ForbiddenException",
161
+ $fault: "client",
162
+ ...opts
163
+ });
164
+ Object.setPrototypeOf(this, ForbiddenException.prototype);
165
+ this.details = opts.details;
166
+ }
167
+ }
168
+ exports.ForbiddenException = ForbiddenException;
@@ -268,6 +268,9 @@ const de_CommandError = async (output, context) => {
268
268
  case "ValidationException":
269
269
  case "smithy.framework#ValidationException":
270
270
  throw await de_ValidationExceptionRes(parsedOutput, context);
271
+ case "ForbiddenException":
272
+ case "wildix.wim.tools#ForbiddenException":
273
+ throw await de_ForbiddenExceptionRes(parsedOutput, context);
271
274
  default:
272
275
  const parsedBody = parsedOutput.body;
273
276
  return throwDefaultError({
@@ -317,6 +320,20 @@ const de_ValidationExceptionRes = async (parsedOutput, context) => {
317
320
  });
318
321
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
319
322
  };
323
+ const de_ForbiddenExceptionRes = async (parsedOutput, context) => {
324
+ const contents = (0, smithy_client_1.map)({});
325
+ const data = parsedOutput.body;
326
+ const doc = (0, smithy_client_1.take)(data, {
327
+ 'details': _ => de_Document(_, context),
328
+ 'message': smithy_client_1.expectString,
329
+ });
330
+ Object.assign(contents, doc);
331
+ const exception = new models_0_1.ForbiddenException({
332
+ $metadata: deserializeMetadata(parsedOutput),
333
+ ...contents
334
+ });
335
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
336
+ };
320
337
  const de_ToolExecutionExceptionRes = async (parsedOutput, context) => {
321
338
  const contents = (0, smithy_client_1.map)({});
322
339
  const data = parsedOutput.body;
@@ -47,6 +47,24 @@ export var ToolStringValue;
47
47
  return visitor._(value.$unknown[0], value.$unknown[1]);
48
48
  };
49
49
  })(ToolStringValue || (ToolStringValue = {}));
50
+ export var ToolChatRecipient;
51
+ (function (ToolChatRecipient) {
52
+ ToolChatRecipient.visit = (value, visitor) => {
53
+ if (value.channelId !== undefined)
54
+ return visitor.channelId(value.channelId);
55
+ if (value.userId !== undefined)
56
+ return visitor.userId(value.userId);
57
+ return visitor._(value.$unknown[0], value.$unknown[1]);
58
+ };
59
+ })(ToolChatRecipient || (ToolChatRecipient = {}));
60
+ export var ToolChatHandler;
61
+ (function (ToolChatHandler) {
62
+ ToolChatHandler.visit = (value, visitor) => {
63
+ if (value.config !== undefined)
64
+ return visitor.config(value.config);
65
+ return visitor._(value.$unknown[0], value.$unknown[1]);
66
+ };
67
+ })(ToolChatHandler || (ToolChatHandler = {}));
50
68
  export var ToolEmailHandler;
51
69
  (function (ToolEmailHandler) {
52
70
  ToolEmailHandler.visit = (value, visitor) => {
@@ -85,6 +103,8 @@ export var ToolHandler;
85
103
  return visitor.webhook(value.webhook);
86
104
  if (value.search !== undefined)
87
105
  return visitor.search(value.search);
106
+ if (value.chat !== undefined)
107
+ return visitor.chat(value.chat);
88
108
  return visitor._(value.$unknown[0], value.$unknown[1]);
89
109
  };
90
110
  })(ToolHandler || (ToolHandler = {}));
@@ -123,3 +143,17 @@ export class ToolExecutionServerException extends __BaseException {
123
143
  this.details = opts.details;
124
144
  }
125
145
  }
146
+ export class ForbiddenException extends __BaseException {
147
+ name = "ForbiddenException";
148
+ $fault = "client";
149
+ details;
150
+ constructor(opts) {
151
+ super({
152
+ name: "ForbiddenException",
153
+ $fault: "client",
154
+ ...opts
155
+ });
156
+ Object.setPrototypeOf(this, ForbiddenException.prototype);
157
+ this.details = opts.details;
158
+ }
159
+ }
@@ -1,5 +1,5 @@
1
1
  import { ToolsServiceException as __BaseException } from "../models/ToolsServiceException";
2
- import { AlreadyExistException, NotFoundException, ToolExecutionException, ToolExecutionServerException, ValidationException, } from "../models/models_0";
2
+ import { AlreadyExistException, ForbiddenException, NotFoundException, ToolExecutionException, ToolExecutionServerException, ValidationException, } from "../models/models_0";
3
3
  import { loadRestJsonErrorCode, parseJsonBody as parseBody, parseJsonErrorBody as parseErrorBody, } from "@aws-sdk/core";
4
4
  import { requestBuilder as rb } from "@smithy/core";
5
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";
@@ -251,6 +251,9 @@ const de_CommandError = async (output, context) => {
251
251
  case "ValidationException":
252
252
  case "smithy.framework#ValidationException":
253
253
  throw await de_ValidationExceptionRes(parsedOutput, context);
254
+ case "ForbiddenException":
255
+ case "wildix.wim.tools#ForbiddenException":
256
+ throw await de_ForbiddenExceptionRes(parsedOutput, context);
254
257
  default:
255
258
  const parsedBody = parsedOutput.body;
256
259
  return throwDefaultError({
@@ -300,6 +303,20 @@ const de_ValidationExceptionRes = async (parsedOutput, context) => {
300
303
  });
301
304
  return __decorateServiceException(exception, parsedOutput.body);
302
305
  };
306
+ const de_ForbiddenExceptionRes = async (parsedOutput, context) => {
307
+ const contents = map({});
308
+ const data = parsedOutput.body;
309
+ const doc = take(data, {
310
+ 'details': _ => de_Document(_, context),
311
+ 'message': __expectString,
312
+ });
313
+ Object.assign(contents, doc);
314
+ const exception = new ForbiddenException({
315
+ $metadata: deserializeMetadata(parsedOutput),
316
+ ...contents
317
+ });
318
+ return __decorateServiceException(exception, parsedOutput.body);
319
+ };
303
320
  const de_ToolExecutionExceptionRes = async (parsedOutput, context) => {
304
321
  const contents = map({});
305
322
  const data = parsedOutput.body;
@@ -120,6 +120,17 @@ declare const CreateToolCommand_base: {
120
120
  * },
121
121
  * },
122
122
  * search: {},
123
+ * chat: { // ToolChatHandler Union: only one key present
124
+ * config: { // ToolChatConfig
125
+ * recipient: { // ToolChatRecipient Union: only one key present
126
+ * channelId: "<ToolStringValue>",
127
+ * userId: "<ToolStringValue>",
128
+ * },
129
+ * text: "<ToolStringValue>", // required
130
+ * mentions: "<ToolStringValue>",
131
+ * botName: "<ToolStringValue>", // required
132
+ * },
133
+ * },
123
134
  * },
124
135
  * };
125
136
  * const command = new CreateToolCommand(input);
@@ -212,6 +223,17 @@ declare const CreateToolCommand_base: {
212
223
  * // },
213
224
  * // },
214
225
  * // search: {},
226
+ * // chat: { // ToolChatHandler Union: only one key present
227
+ * // config: { // ToolChatConfig
228
+ * // recipient: { // ToolChatRecipient Union: only one key present
229
+ * // channelId: "<ToolStringValue>",
230
+ * // userId: "<ToolStringValue>",
231
+ * // },
232
+ * // text: "<ToolStringValue>", // required
233
+ * // mentions: "<ToolStringValue>",
234
+ * // botName: "<ToolStringValue>", // required
235
+ * // },
236
+ * // },
215
237
  * // },
216
238
  * // },
217
239
  * // };
@@ -65,6 +65,8 @@ declare const ExecuteToolCommand_base: {
65
65
  *
66
66
  * @throws {@link NotFoundException} (client fault)
67
67
  *
68
+ * @throws {@link ForbiddenException} (client fault)
69
+ *
68
70
  * @throws {@link ToolExecutionException} (client fault)
69
71
  *
70
72
  * @throws {@link ToolExecutionServerException} (server fault)
@@ -128,6 +128,17 @@ declare const GetToolCommand_base: {
128
128
  * // },
129
129
  * // },
130
130
  * // search: {},
131
+ * // chat: { // ToolChatHandler Union: only one key present
132
+ * // config: { // ToolChatConfig
133
+ * // recipient: { // ToolChatRecipient Union: only one key present
134
+ * // channelId: "<ToolStringValue>",
135
+ * // userId: "<ToolStringValue>",
136
+ * // },
137
+ * // text: "<ToolStringValue>", // required
138
+ * // mentions: "<ToolStringValue>",
139
+ * // botName: "<ToolStringValue>", // required
140
+ * // },
141
+ * // },
131
142
  * // },
132
143
  * // },
133
144
  * // };
@@ -128,6 +128,17 @@ declare const ListToolsCommand_base: {
128
128
  * // },
129
129
  * // },
130
130
  * // search: {},
131
+ * // chat: { // ToolChatHandler Union: only one key present
132
+ * // config: { // ToolChatConfig
133
+ * // recipient: { // ToolChatRecipient Union: only one key present
134
+ * // channelId: "<ToolStringValue>",
135
+ * // userId: "<ToolStringValue>",
136
+ * // },
137
+ * // text: "<ToolStringValue>", // required
138
+ * // mentions: "<ToolStringValue>",
139
+ * // botName: "<ToolStringValue>", // required
140
+ * // },
141
+ * // },
131
142
  * // },
132
143
  * // },
133
144
  * // ],
@@ -121,6 +121,17 @@ declare const UpdateToolCommand_base: {
121
121
  * },
122
122
  * },
123
123
  * search: {},
124
+ * chat: { // ToolChatHandler Union: only one key present
125
+ * config: { // ToolChatConfig
126
+ * recipient: { // ToolChatRecipient Union: only one key present
127
+ * channelId: "<ToolStringValue>",
128
+ * userId: "<ToolStringValue>",
129
+ * },
130
+ * text: "<ToolStringValue>", // required
131
+ * mentions: "<ToolStringValue>",
132
+ * botName: "<ToolStringValue>", // required
133
+ * },
134
+ * },
124
135
  * },
125
136
  * };
126
137
  * const command = new UpdateToolCommand(input);
@@ -213,6 +224,17 @@ declare const UpdateToolCommand_base: {
213
224
  * // },
214
225
  * // },
215
226
  * // search: {},
227
+ * // chat: { // ToolChatHandler Union: only one key present
228
+ * // config: { // ToolChatConfig
229
+ * // recipient: { // ToolChatRecipient Union: only one key present
230
+ * // channelId: "<ToolStringValue>",
231
+ * // userId: "<ToolStringValue>",
232
+ * // },
233
+ * // text: "<ToolStringValue>", // required
234
+ * // mentions: "<ToolStringValue>",
235
+ * // botName: "<ToolStringValue>", // required
236
+ * // },
237
+ * // },
216
238
  * // },
217
239
  * // },
218
240
  * // };
@@ -89,6 +89,101 @@ export declare namespace ToolStringValue {
89
89
  }
90
90
  const visit: <T>(value: ToolStringValue, visitor: Visitor<T>) => T;
91
91
  }
92
+ /**
93
+ * @public
94
+ */
95
+ export type ToolChatRecipient = ToolChatRecipient.ChannelIdMember | ToolChatRecipient.UserIdMember | ToolChatRecipient.$UnknownMember;
96
+ /**
97
+ * @public
98
+ */
99
+ export declare namespace ToolChatRecipient {
100
+ /**
101
+ * Channel ID for group channels.
102
+ * @public
103
+ */
104
+ interface ChannelIdMember {
105
+ channelId: ToolStringValue;
106
+ userId?: never;
107
+ $unknown?: never;
108
+ }
109
+ /**
110
+ * User email address for direct messages.
111
+ * @public
112
+ */
113
+ interface UserIdMember {
114
+ channelId?: never;
115
+ userId: ToolStringValue;
116
+ $unknown?: never;
117
+ }
118
+ /**
119
+ * @public
120
+ */
121
+ interface $UnknownMember {
122
+ channelId?: never;
123
+ userId?: never;
124
+ $unknown: [string, any];
125
+ }
126
+ interface Visitor<T> {
127
+ channelId: (value: ToolStringValue) => T;
128
+ userId: (value: ToolStringValue) => T;
129
+ _: (name: string, value: any) => T;
130
+ }
131
+ const visit: <T>(value: ToolChatRecipient, visitor: Visitor<T>) => T;
132
+ }
133
+ /**
134
+ * @public
135
+ */
136
+ export interface ToolChatConfig {
137
+ /**
138
+ * Recipient of the message - either a channel ID for group channels or user email for direct messages.
139
+ * @public
140
+ */
141
+ recipient: ToolChatRecipient;
142
+ /**
143
+ * Message text to send.
144
+ * @public
145
+ */
146
+ text: ToolStringValue;
147
+ /**
148
+ * User IDs to mention in the message, comma-separated.
149
+ * @public
150
+ */
151
+ mentions?: ToolStringValue | undefined;
152
+ /**
153
+ * Name of the system bot that will send the message. If not provided, defaults to 'WIM Tools'.
154
+ * @public
155
+ */
156
+ botName: ToolStringValue;
157
+ }
158
+ /**
159
+ * @public
160
+ */
161
+ export type ToolChatHandler = ToolChatHandler.ConfigMember | ToolChatHandler.$UnknownMember;
162
+ /**
163
+ * @public
164
+ */
165
+ export declare namespace ToolChatHandler {
166
+ /**
167
+ * Chat handler configuration for sending messages via xbees-conversations.
168
+ * @public
169
+ */
170
+ interface ConfigMember {
171
+ config: ToolChatConfig;
172
+ $unknown?: never;
173
+ }
174
+ /**
175
+ * @public
176
+ */
177
+ interface $UnknownMember {
178
+ config?: never;
179
+ $unknown: [string, any];
180
+ }
181
+ interface Visitor<T> {
182
+ config: (value: ToolChatConfig) => T;
183
+ _: (name: string, value: any) => T;
184
+ }
185
+ const visit: <T>(value: ToolChatHandler, visitor: Visitor<T>) => T;
186
+ }
92
187
  /**
93
188
  * @public
94
189
  */
@@ -404,7 +499,7 @@ export interface ToolWebhookConfig {
404
499
  /**
405
500
  * @public
406
501
  */
407
- export type ToolHandler = ToolHandler.EmailMember | ToolHandler.SearchMember | ToolHandler.WebhookMember | ToolHandler.$UnknownMember;
502
+ export type ToolHandler = ToolHandler.ChatMember | ToolHandler.EmailMember | ToolHandler.SearchMember | ToolHandler.WebhookMember | ToolHandler.$UnknownMember;
408
503
  /**
409
504
  * @public
410
505
  */
@@ -417,6 +512,7 @@ export declare namespace ToolHandler {
417
512
  email: ToolEmailHandler;
418
513
  webhook?: never;
419
514
  search?: never;
515
+ chat?: never;
420
516
  $unknown?: never;
421
517
  }
422
518
  /**
@@ -427,6 +523,7 @@ export declare namespace ToolHandler {
427
523
  email?: never;
428
524
  webhook: ToolWebhookConfig;
429
525
  search?: never;
526
+ chat?: never;
430
527
  $unknown?: never;
431
528
  }
432
529
  /**
@@ -437,6 +534,18 @@ export declare namespace ToolHandler {
437
534
  email?: never;
438
535
  webhook?: never;
439
536
  search: ToolSearchConfig;
537
+ chat?: never;
538
+ $unknown?: never;
539
+ }
540
+ /**
541
+ * Chat handler of the tool.
542
+ * @public
543
+ */
544
+ interface ChatMember {
545
+ email?: never;
546
+ webhook?: never;
547
+ search?: never;
548
+ chat: ToolChatHandler;
440
549
  $unknown?: never;
441
550
  }
442
551
  /**
@@ -446,12 +555,14 @@ export declare namespace ToolHandler {
446
555
  email?: never;
447
556
  webhook?: never;
448
557
  search?: never;
558
+ chat?: never;
449
559
  $unknown: [string, any];
450
560
  }
451
561
  interface Visitor<T> {
452
562
  email: (value: ToolEmailHandler) => T;
453
563
  webhook: (value: ToolWebhookConfig) => T;
454
564
  search: (value: ToolSearchConfig) => T;
565
+ chat: (value: ToolChatHandler) => T;
455
566
  _: (name: string, value: any) => T;
456
567
  }
457
568
  const visit: <T>(value: ToolHandler, visitor: Visitor<T>) => T;
@@ -754,6 +865,22 @@ export interface ExecuteToolOutput {
754
865
  */
755
866
  result: ToolExecutionResult;
756
867
  }
868
+ /**
869
+ * @public
870
+ */
871
+ export declare class ForbiddenException extends __BaseException {
872
+ readonly name: "ForbiddenException";
873
+ readonly $fault: "client";
874
+ /**
875
+ * Indicates that the request is forbidden, typically due to insufficient permissions or access restrictions
876
+ * @public
877
+ */
878
+ details?: __DocumentType | undefined;
879
+ /**
880
+ * @internal
881
+ */
882
+ constructor(opts: __ExceptionOptionType<ForbiddenException, __BaseException>);
883
+ }
757
884
  /**
758
885
  * @public
759
886
  */
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.24",
4
+ "version": "0.0.26",
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",