@wildix/wim-tools-client 0.0.23 → 0.0.25
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.
- package/dist-cjs/models/models_0.js +23 -1
- package/dist-es/models/models_0.js +22 -0
- package/dist-types/commands/CreateToolCommand.d.ts +22 -0
- package/dist-types/commands/GetToolCommand.d.ts +11 -0
- package/dist-types/commands/ListToolsCommand.d.ts +11 -0
- package/dist-types/commands/UpdateToolCommand.d.ts +22 -0
- package/dist-types/models/models_0.d.ts +127 -1
- package/package.json +1 -1
|
@@ -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.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) => {
|
|
@@ -89,6 +107,10 @@ var ToolHandler;
|
|
|
89
107
|
return visitor.email(value.email);
|
|
90
108
|
if (value.webhook !== undefined)
|
|
91
109
|
return visitor.webhook(value.webhook);
|
|
110
|
+
if (value.search !== undefined)
|
|
111
|
+
return visitor.search(value.search);
|
|
112
|
+
if (value.chat !== undefined)
|
|
113
|
+
return visitor.chat(value.chat);
|
|
92
114
|
return visitor._(value.$unknown[0], value.$unknown[1]);
|
|
93
115
|
};
|
|
94
116
|
})(ToolHandler || (exports.ToolHandler = ToolHandler = {}));
|
|
@@ -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) => {
|
|
@@ -83,6 +101,10 @@ export var ToolHandler;
|
|
|
83
101
|
return visitor.email(value.email);
|
|
84
102
|
if (value.webhook !== undefined)
|
|
85
103
|
return visitor.webhook(value.webhook);
|
|
104
|
+
if (value.search !== undefined)
|
|
105
|
+
return visitor.search(value.search);
|
|
106
|
+
if (value.chat !== undefined)
|
|
107
|
+
return visitor.chat(value.chat);
|
|
86
108
|
return visitor._(value.$unknown[0], value.$unknown[1]);
|
|
87
109
|
};
|
|
88
110
|
})(ToolHandler || (ToolHandler = {}));
|
|
@@ -119,6 +119,17 @@ declare const CreateToolCommand_base: {
|
|
|
119
119
|
* },
|
|
120
120
|
* },
|
|
121
121
|
* },
|
|
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
|
+
* },
|
|
132
|
+
* },
|
|
122
133
|
* },
|
|
123
134
|
* };
|
|
124
135
|
* const command = new CreateToolCommand(input);
|
|
@@ -210,6 +221,17 @@ declare const CreateToolCommand_base: {
|
|
|
210
221
|
* // },
|
|
211
222
|
* // },
|
|
212
223
|
* // },
|
|
224
|
+
* // search: {},
|
|
225
|
+
* // chat: { // ToolChatHandler Union: only one key present
|
|
226
|
+
* // config: { // ToolChatConfig
|
|
227
|
+
* // recipient: { // ToolChatRecipient Union: only one key present
|
|
228
|
+
* // channelId: "<ToolStringValue>",
|
|
229
|
+
* // userId: "<ToolStringValue>",
|
|
230
|
+
* // },
|
|
231
|
+
* // text: "<ToolStringValue>", // required
|
|
232
|
+
* // mentions: "<ToolStringValue>",
|
|
233
|
+
* // },
|
|
234
|
+
* // },
|
|
213
235
|
* // },
|
|
214
236
|
* // },
|
|
215
237
|
* // };
|
|
@@ -127,6 +127,17 @@ declare const GetToolCommand_base: {
|
|
|
127
127
|
* // },
|
|
128
128
|
* // },
|
|
129
129
|
* // },
|
|
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
|
+
* // },
|
|
140
|
+
* // },
|
|
130
141
|
* // },
|
|
131
142
|
* // },
|
|
132
143
|
* // };
|
|
@@ -127,6 +127,17 @@ declare const ListToolsCommand_base: {
|
|
|
127
127
|
* // },
|
|
128
128
|
* // },
|
|
129
129
|
* // },
|
|
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
|
+
* // },
|
|
140
|
+
* // },
|
|
130
141
|
* // },
|
|
131
142
|
* // },
|
|
132
143
|
* // ],
|
|
@@ -120,6 +120,17 @@ declare const UpdateToolCommand_base: {
|
|
|
120
120
|
* },
|
|
121
121
|
* },
|
|
122
122
|
* },
|
|
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
|
+
* },
|
|
133
|
+
* },
|
|
123
134
|
* },
|
|
124
135
|
* };
|
|
125
136
|
* const command = new UpdateToolCommand(input);
|
|
@@ -211,6 +222,17 @@ declare const UpdateToolCommand_base: {
|
|
|
211
222
|
* // },
|
|
212
223
|
* // },
|
|
213
224
|
* // },
|
|
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
|
+
* // },
|
|
235
|
+
* // },
|
|
214
236
|
* // },
|
|
215
237
|
* // },
|
|
216
238
|
* // };
|
|
@@ -89,6 +89,96 @@ 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
|
+
/**
|
|
154
|
+
* @public
|
|
155
|
+
*/
|
|
156
|
+
export type ToolChatHandler = ToolChatHandler.ConfigMember | ToolChatHandler.$UnknownMember;
|
|
157
|
+
/**
|
|
158
|
+
* @public
|
|
159
|
+
*/
|
|
160
|
+
export declare namespace ToolChatHandler {
|
|
161
|
+
/**
|
|
162
|
+
* Chat handler configuration for sending messages via xbees-conversations.
|
|
163
|
+
* @public
|
|
164
|
+
*/
|
|
165
|
+
interface ConfigMember {
|
|
166
|
+
config: ToolChatConfig;
|
|
167
|
+
$unknown?: never;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* @public
|
|
171
|
+
*/
|
|
172
|
+
interface $UnknownMember {
|
|
173
|
+
config?: never;
|
|
174
|
+
$unknown: [string, any];
|
|
175
|
+
}
|
|
176
|
+
interface Visitor<T> {
|
|
177
|
+
config: (value: ToolChatConfig) => T;
|
|
178
|
+
_: (name: string, value: any) => T;
|
|
179
|
+
}
|
|
180
|
+
const visit: <T>(value: ToolChatHandler, visitor: Visitor<T>) => T;
|
|
181
|
+
}
|
|
92
182
|
/**
|
|
93
183
|
* @public
|
|
94
184
|
*/
|
|
@@ -230,6 +320,12 @@ export declare namespace ToolEmailHandler {
|
|
|
230
320
|
}
|
|
231
321
|
const visit: <T>(value: ToolEmailHandler, visitor: Visitor<T>) => T;
|
|
232
322
|
}
|
|
323
|
+
/**
|
|
324
|
+
* Search handler configuration. The search tool requires no configuration - API key comes from AppConfig and query comes from tool input.
|
|
325
|
+
* @public
|
|
326
|
+
*/
|
|
327
|
+
export interface ToolSearchConfig {
|
|
328
|
+
}
|
|
233
329
|
/**
|
|
234
330
|
* @public
|
|
235
331
|
*/
|
|
@@ -398,7 +494,7 @@ export interface ToolWebhookConfig {
|
|
|
398
494
|
/**
|
|
399
495
|
* @public
|
|
400
496
|
*/
|
|
401
|
-
export type ToolHandler = ToolHandler.EmailMember | ToolHandler.WebhookMember | ToolHandler.$UnknownMember;
|
|
497
|
+
export type ToolHandler = ToolHandler.ChatMember | ToolHandler.EmailMember | ToolHandler.SearchMember | ToolHandler.WebhookMember | ToolHandler.$UnknownMember;
|
|
402
498
|
/**
|
|
403
499
|
* @public
|
|
404
500
|
*/
|
|
@@ -410,6 +506,8 @@ export declare namespace ToolHandler {
|
|
|
410
506
|
interface EmailMember {
|
|
411
507
|
email: ToolEmailHandler;
|
|
412
508
|
webhook?: never;
|
|
509
|
+
search?: never;
|
|
510
|
+
chat?: never;
|
|
413
511
|
$unknown?: never;
|
|
414
512
|
}
|
|
415
513
|
/**
|
|
@@ -419,6 +517,30 @@ export declare namespace ToolHandler {
|
|
|
419
517
|
interface WebhookMember {
|
|
420
518
|
email?: never;
|
|
421
519
|
webhook: ToolWebhookConfig;
|
|
520
|
+
search?: never;
|
|
521
|
+
chat?: never;
|
|
522
|
+
$unknown?: never;
|
|
523
|
+
}
|
|
524
|
+
/**
|
|
525
|
+
* Search handler of the tool.
|
|
526
|
+
* @public
|
|
527
|
+
*/
|
|
528
|
+
interface SearchMember {
|
|
529
|
+
email?: never;
|
|
530
|
+
webhook?: never;
|
|
531
|
+
search: ToolSearchConfig;
|
|
532
|
+
chat?: never;
|
|
533
|
+
$unknown?: never;
|
|
534
|
+
}
|
|
535
|
+
/**
|
|
536
|
+
* Chat handler of the tool.
|
|
537
|
+
* @public
|
|
538
|
+
*/
|
|
539
|
+
interface ChatMember {
|
|
540
|
+
email?: never;
|
|
541
|
+
webhook?: never;
|
|
542
|
+
search?: never;
|
|
543
|
+
chat: ToolChatHandler;
|
|
422
544
|
$unknown?: never;
|
|
423
545
|
}
|
|
424
546
|
/**
|
|
@@ -427,11 +549,15 @@ export declare namespace ToolHandler {
|
|
|
427
549
|
interface $UnknownMember {
|
|
428
550
|
email?: never;
|
|
429
551
|
webhook?: never;
|
|
552
|
+
search?: never;
|
|
553
|
+
chat?: never;
|
|
430
554
|
$unknown: [string, any];
|
|
431
555
|
}
|
|
432
556
|
interface Visitor<T> {
|
|
433
557
|
email: (value: ToolEmailHandler) => T;
|
|
434
558
|
webhook: (value: ToolWebhookConfig) => T;
|
|
559
|
+
search: (value: ToolSearchConfig) => T;
|
|
560
|
+
chat: (value: ToolChatHandler) => T;
|
|
435
561
|
_: (name: string, value: any) => T;
|
|
436
562
|
}
|
|
437
563
|
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.
|
|
4
|
+
"version": "0.0.25",
|
|
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",
|