@slates/client 1.0.0-rc.2 → 1.0.0-rc.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.
- package/dist/index.cjs +5 -2
- package/dist/index.d.cts +64 -565
- package/dist/index.d.ts +64 -565
- package/dist/index.module.js +5 -2
- package/package.json +6 -6
- package/src/client.test.ts +593 -8
- package/src/client.ts +71 -32
- package/src/error.ts +11 -9
- package/src/index.ts +1 -1
- package/src/transport.ts +6 -6
- package/src/types.ts +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { SlatesProtocolVersion, SlatesParticipant, SlatesNotifications, SlatesRequests, SlatesResponses,
|
|
2
|
-
import z from 'zod';
|
|
1
|
+
import { SlatesProtocolVersion, SlatesParticipant, SlatesNotifications, SlatesRequests, SlatesResponses, SlatesResponsesByMethod, SlatesMessageProviderIdentifyResponse, SlatesMessageActionsListResponse, SlatesActionTool, SlatesAction, SlatesMessageActionGetResponse, SlatesMessageConfigSchemaGetResponse, SlatesMessageConfigDefaultGetResponse, SlatesMessageConfigChangedResponse, SlateAuthenticationMethod, SlatesMessageAuthMethodGetResponse, SlatesMessageAuthDefaultInputGetResponse, SlatesMessageAuthInputChangedResponse, SlatesMessageAuthOutputGetResponse, SlatesMessageAuthAuthorizationUrlGetResponse, SlatesMessageAuthTokenRefreshHandleResponse, SlatesMessageAuthProfileGetResponse, SlatesMessageActionInvokeResponse, SlatesMessageActionTriggerEventMapResponse, SlatesMessageActionTriggerWebhookRegisterResponse, SlatesMessageActionTriggerWebhookHandleResponse, SlatesMessageActionTriggerWebhookUnregisterResponse } from '@slates/proto';
|
|
3
2
|
import { Slate, SlateLogListener } from '@slates/provider';
|
|
4
3
|
|
|
5
4
|
type SlatesJsonObject = Record<string, any>;
|
|
@@ -42,128 +41,27 @@ declare class SlatesProtocolClient {
|
|
|
42
41
|
state: SlatesJsonObject;
|
|
43
42
|
};
|
|
44
43
|
private buildStateMessages;
|
|
45
|
-
request<Key extends keyof
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
name: string;
|
|
52
|
-
description?: string | undefined;
|
|
53
|
-
metadata?: Record<string, any> | undefined;
|
|
54
|
-
};
|
|
55
|
-
}>;
|
|
56
|
-
listActions(): Promise<{
|
|
57
|
-
actions: ({
|
|
58
|
-
id: string;
|
|
59
|
-
name: string;
|
|
60
|
-
inputSchema: Record<string, any>;
|
|
61
|
-
outputSchema: Record<string, any>;
|
|
62
|
-
type: "action.tool";
|
|
63
|
-
capabilities: Record<string, never>;
|
|
64
|
-
description?: string | undefined;
|
|
65
|
-
instructions?: string[] | undefined;
|
|
66
|
-
constraints?: string[] | undefined;
|
|
67
|
-
tags?: {
|
|
68
|
-
destructive?: boolean | undefined;
|
|
69
|
-
readOnly?: boolean | undefined;
|
|
70
|
-
} | undefined;
|
|
71
|
-
metadata?: Record<string, any> | undefined;
|
|
72
|
-
scopes?: {
|
|
73
|
-
AND: {
|
|
74
|
-
OR: string[];
|
|
75
|
-
}[];
|
|
76
|
-
} | undefined;
|
|
77
|
-
} | {
|
|
78
|
-
id: string;
|
|
79
|
-
name: string;
|
|
80
|
-
inputSchema: Record<string, any>;
|
|
81
|
-
outputSchema: Record<string, any>;
|
|
82
|
-
type: "action.trigger";
|
|
83
|
-
capabilities: Record<string, never>;
|
|
84
|
-
invocation: {
|
|
85
|
-
type: "polling";
|
|
86
|
-
intervalSeconds: number;
|
|
87
|
-
} | {
|
|
88
|
-
type: "webhook";
|
|
89
|
-
autoRegistration: boolean;
|
|
90
|
-
autoUnregistration: boolean;
|
|
91
|
-
};
|
|
92
|
-
description?: string | undefined;
|
|
93
|
-
instructions?: string[] | undefined;
|
|
94
|
-
constraints?: string[] | undefined;
|
|
95
|
-
tags?: {
|
|
96
|
-
destructive?: boolean | undefined;
|
|
97
|
-
readOnly?: boolean | undefined;
|
|
98
|
-
} | undefined;
|
|
99
|
-
metadata?: Record<string, any> | undefined;
|
|
100
|
-
scopes?: {
|
|
101
|
-
AND: {
|
|
102
|
-
OR: string[];
|
|
103
|
-
}[];
|
|
104
|
-
} | undefined;
|
|
105
|
-
})[];
|
|
106
|
-
}>;
|
|
107
|
-
listTools(): Promise<SlatesAction[]>;
|
|
44
|
+
request<Key extends keyof SlatesResponsesByMethod & SlatesRequests['method']>(method: Key, params: Extract<SlatesRequests, {
|
|
45
|
+
method: Key;
|
|
46
|
+
}>['params']): Promise<SlatesResponsesByMethod[Key]['result']>;
|
|
47
|
+
identify(): Promise<SlatesMessageProviderIdentifyResponse['result']>;
|
|
48
|
+
listActions(): Promise<SlatesMessageActionsListResponse['result']>;
|
|
49
|
+
listTools(): Promise<SlatesActionTool[]>;
|
|
108
50
|
listTriggers(): Promise<SlatesAction[]>;
|
|
109
|
-
getAction(actionId: string): Promise<
|
|
110
|
-
action: {
|
|
111
|
-
id: string;
|
|
112
|
-
name: string;
|
|
113
|
-
inputSchema: Record<string, any>;
|
|
114
|
-
outputSchema: Record<string, any>;
|
|
115
|
-
type: "action.tool";
|
|
116
|
-
capabilities: Record<string, never>;
|
|
117
|
-
description?: string | undefined;
|
|
118
|
-
instructions?: string[] | undefined;
|
|
119
|
-
constraints?: string[] | undefined;
|
|
120
|
-
tags?: {
|
|
121
|
-
destructive?: boolean | undefined;
|
|
122
|
-
readOnly?: boolean | undefined;
|
|
123
|
-
} | undefined;
|
|
124
|
-
metadata?: Record<string, any> | undefined;
|
|
125
|
-
scopes?: {
|
|
126
|
-
AND: {
|
|
127
|
-
OR: string[];
|
|
128
|
-
}[];
|
|
129
|
-
} | undefined;
|
|
130
|
-
} | {
|
|
131
|
-
id: string;
|
|
132
|
-
name: string;
|
|
133
|
-
inputSchema: Record<string, any>;
|
|
134
|
-
outputSchema: Record<string, any>;
|
|
135
|
-
type: "action.trigger";
|
|
136
|
-
capabilities: Record<string, never>;
|
|
137
|
-
invocation: {
|
|
138
|
-
type: "polling";
|
|
139
|
-
intervalSeconds: number;
|
|
140
|
-
} | {
|
|
141
|
-
type: "webhook";
|
|
142
|
-
autoRegistration: boolean;
|
|
143
|
-
autoUnregistration: boolean;
|
|
144
|
-
};
|
|
145
|
-
description?: string | undefined;
|
|
146
|
-
instructions?: string[] | undefined;
|
|
147
|
-
constraints?: string[] | undefined;
|
|
148
|
-
tags?: {
|
|
149
|
-
destructive?: boolean | undefined;
|
|
150
|
-
readOnly?: boolean | undefined;
|
|
151
|
-
} | undefined;
|
|
152
|
-
metadata?: Record<string, any> | undefined;
|
|
153
|
-
scopes?: {
|
|
154
|
-
AND: {
|
|
155
|
-
OR: string[];
|
|
156
|
-
}[];
|
|
157
|
-
} | undefined;
|
|
158
|
-
};
|
|
159
|
-
}>;
|
|
51
|
+
getAction(actionId: string): Promise<SlatesMessageActionGetResponse['result']>;
|
|
160
52
|
getTool(actionId: string): Promise<{
|
|
161
53
|
id: string;
|
|
162
54
|
name: string;
|
|
163
55
|
inputSchema: Record<string, any>;
|
|
164
56
|
outputSchema: Record<string, any>;
|
|
57
|
+
docs: {
|
|
58
|
+
name: string;
|
|
59
|
+
url: string;
|
|
60
|
+
type?: "docs.action.general" | undefined;
|
|
61
|
+
}[];
|
|
165
62
|
type: "action.tool";
|
|
166
63
|
capabilities: Record<string, never>;
|
|
64
|
+
isPublic: boolean;
|
|
167
65
|
description?: string | undefined;
|
|
168
66
|
instructions?: string[] | undefined;
|
|
169
67
|
constraints?: string[] | undefined;
|
|
@@ -177,12 +75,19 @@ declare class SlatesProtocolClient {
|
|
|
177
75
|
OR: string[];
|
|
178
76
|
}[];
|
|
179
77
|
} | undefined;
|
|
78
|
+
authMethods?: string[] | undefined;
|
|
79
|
+
adapter?: string | null | undefined;
|
|
180
80
|
}>;
|
|
181
81
|
getTrigger(actionId: string): Promise<{
|
|
182
82
|
id: string;
|
|
183
83
|
name: string;
|
|
184
84
|
inputSchema: Record<string, any>;
|
|
185
85
|
outputSchema: Record<string, any>;
|
|
86
|
+
docs: {
|
|
87
|
+
name: string;
|
|
88
|
+
url: string;
|
|
89
|
+
type?: "docs.action.general" | undefined;
|
|
90
|
+
}[];
|
|
186
91
|
type: "action.trigger";
|
|
187
92
|
capabilities: Record<string, never>;
|
|
188
93
|
invocation: {
|
|
@@ -192,6 +97,26 @@ declare class SlatesProtocolClient {
|
|
|
192
97
|
type: "webhook";
|
|
193
98
|
autoRegistration: boolean;
|
|
194
99
|
autoUnregistration: boolean;
|
|
100
|
+
http?: {
|
|
101
|
+
methods?: ("GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS")[] | undefined;
|
|
102
|
+
sync?: {
|
|
103
|
+
mode: "match" | "never" | "always";
|
|
104
|
+
match?: {
|
|
105
|
+
method?: string | undefined;
|
|
106
|
+
hasQueryParam?: string | undefined;
|
|
107
|
+
hasHeader?: string | undefined;
|
|
108
|
+
jsonBodyField?: {
|
|
109
|
+
path: string;
|
|
110
|
+
equals?: string | undefined;
|
|
111
|
+
} | undefined;
|
|
112
|
+
formBodyField?: {
|
|
113
|
+
path: string;
|
|
114
|
+
equals?: string | undefined;
|
|
115
|
+
} | undefined;
|
|
116
|
+
}[] | undefined;
|
|
117
|
+
timeoutMs?: number | undefined;
|
|
118
|
+
} | undefined;
|
|
119
|
+
} | undefined;
|
|
195
120
|
};
|
|
196
121
|
description?: string | undefined;
|
|
197
122
|
instructions?: string[] | undefined;
|
|
@@ -206,209 +131,26 @@ declare class SlatesProtocolClient {
|
|
|
206
131
|
OR: string[];
|
|
207
132
|
}[];
|
|
208
133
|
} | undefined;
|
|
134
|
+
authMethods?: string[] | undefined;
|
|
135
|
+
adapter?: string | null | undefined;
|
|
209
136
|
}>;
|
|
210
|
-
getConfigSchema(): Promise<
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
getDefaultConfig(): Promise<{
|
|
214
|
-
config: Record<string, any> | null;
|
|
215
|
-
requestTraces?: {
|
|
216
|
-
startedAt: string;
|
|
217
|
-
durationMs: number;
|
|
218
|
-
request: {
|
|
219
|
-
method: string;
|
|
220
|
-
url: string;
|
|
221
|
-
headers?: Record<string, string> | undefined;
|
|
222
|
-
body?: {
|
|
223
|
-
text: string;
|
|
224
|
-
contentType?: string | undefined;
|
|
225
|
-
truncated?: boolean | undefined;
|
|
226
|
-
} | undefined;
|
|
227
|
-
};
|
|
228
|
-
response?: {
|
|
229
|
-
status: number;
|
|
230
|
-
statusText?: string | undefined;
|
|
231
|
-
headers?: Record<string, string> | undefined;
|
|
232
|
-
body?: {
|
|
233
|
-
text: string;
|
|
234
|
-
contentType?: string | undefined;
|
|
235
|
-
truncated?: boolean | undefined;
|
|
236
|
-
} | undefined;
|
|
237
|
-
} | undefined;
|
|
238
|
-
error?: {
|
|
239
|
-
message: string;
|
|
240
|
-
code?: string | undefined;
|
|
241
|
-
} | undefined;
|
|
242
|
-
}[] | undefined;
|
|
243
|
-
}>;
|
|
244
|
-
updateConfig(previousConfig: Record<string, any> | null, newConfig: Record<string, any>): Promise<{
|
|
245
|
-
success: boolean;
|
|
246
|
-
config?: Record<string, any> | undefined;
|
|
247
|
-
errors?: {
|
|
248
|
-
code: string;
|
|
249
|
-
message: string;
|
|
250
|
-
path?: string[] | undefined;
|
|
251
|
-
}[] | undefined;
|
|
252
|
-
requestTraces?: {
|
|
253
|
-
startedAt: string;
|
|
254
|
-
durationMs: number;
|
|
255
|
-
request: {
|
|
256
|
-
method: string;
|
|
257
|
-
url: string;
|
|
258
|
-
headers?: Record<string, string> | undefined;
|
|
259
|
-
body?: {
|
|
260
|
-
text: string;
|
|
261
|
-
contentType?: string | undefined;
|
|
262
|
-
truncated?: boolean | undefined;
|
|
263
|
-
} | undefined;
|
|
264
|
-
};
|
|
265
|
-
response?: {
|
|
266
|
-
status: number;
|
|
267
|
-
statusText?: string | undefined;
|
|
268
|
-
headers?: Record<string, string> | undefined;
|
|
269
|
-
body?: {
|
|
270
|
-
text: string;
|
|
271
|
-
contentType?: string | undefined;
|
|
272
|
-
truncated?: boolean | undefined;
|
|
273
|
-
} | undefined;
|
|
274
|
-
} | undefined;
|
|
275
|
-
error?: {
|
|
276
|
-
message: string;
|
|
277
|
-
code?: string | undefined;
|
|
278
|
-
} | undefined;
|
|
279
|
-
}[] | undefined;
|
|
280
|
-
}>;
|
|
137
|
+
getConfigSchema(): Promise<SlatesMessageConfigSchemaGetResponse['result']>;
|
|
138
|
+
getDefaultConfig(): Promise<SlatesMessageConfigDefaultGetResponse['result']>;
|
|
139
|
+
updateConfig(previousConfig: Record<string, any> | null, newConfig: Record<string, any>): Promise<SlatesMessageConfigChangedResponse['result']>;
|
|
281
140
|
listAuthMethods(): Promise<{
|
|
282
141
|
authenticationMethods: SlateAuthenticationMethod[];
|
|
283
142
|
}>;
|
|
284
|
-
getAuthMethod(authenticationMethodId: string): Promise<
|
|
285
|
-
|
|
286
|
-
id: string;
|
|
287
|
-
name: string;
|
|
288
|
-
type: "auth.oauth" | "auth.token" | "auth.service_account" | "auth.custom";
|
|
289
|
-
inputSchema: Record<string, any>;
|
|
290
|
-
outputSchema: Record<string, any>;
|
|
291
|
-
capabilities: {
|
|
292
|
-
getDefaultInput?: {
|
|
293
|
-
enabled: boolean;
|
|
294
|
-
} | undefined;
|
|
295
|
-
handleChangedInput?: {
|
|
296
|
-
enabled: boolean;
|
|
297
|
-
} | undefined;
|
|
298
|
-
handleTokenRefresh?: {
|
|
299
|
-
enabled: boolean;
|
|
300
|
-
} | undefined;
|
|
301
|
-
getProfile?: {
|
|
302
|
-
enabled: boolean;
|
|
303
|
-
} | undefined;
|
|
304
|
-
};
|
|
305
|
-
scopes?: {
|
|
306
|
-
id: string;
|
|
307
|
-
title: string;
|
|
308
|
-
description?: string | undefined;
|
|
309
|
-
}[] | undefined;
|
|
310
|
-
};
|
|
311
|
-
}>;
|
|
312
|
-
getDefaultAuthInput(authenticationMethodId: string): Promise<{
|
|
313
|
-
input: Record<string, any>;
|
|
314
|
-
requestTraces?: {
|
|
315
|
-
startedAt: string;
|
|
316
|
-
durationMs: number;
|
|
317
|
-
request: {
|
|
318
|
-
method: string;
|
|
319
|
-
url: string;
|
|
320
|
-
headers?: Record<string, string> | undefined;
|
|
321
|
-
body?: {
|
|
322
|
-
text: string;
|
|
323
|
-
contentType?: string | undefined;
|
|
324
|
-
truncated?: boolean | undefined;
|
|
325
|
-
} | undefined;
|
|
326
|
-
};
|
|
327
|
-
response?: {
|
|
328
|
-
status: number;
|
|
329
|
-
statusText?: string | undefined;
|
|
330
|
-
headers?: Record<string, string> | undefined;
|
|
331
|
-
body?: {
|
|
332
|
-
text: string;
|
|
333
|
-
contentType?: string | undefined;
|
|
334
|
-
truncated?: boolean | undefined;
|
|
335
|
-
} | undefined;
|
|
336
|
-
} | undefined;
|
|
337
|
-
error?: {
|
|
338
|
-
message: string;
|
|
339
|
-
code?: string | undefined;
|
|
340
|
-
} | undefined;
|
|
341
|
-
}[] | undefined;
|
|
342
|
-
}>;
|
|
143
|
+
getAuthMethod(authenticationMethodId: string): Promise<SlatesMessageAuthMethodGetResponse['result']>;
|
|
144
|
+
getDefaultAuthInput(authenticationMethodId: string): Promise<SlatesMessageAuthDefaultInputGetResponse['result']>;
|
|
343
145
|
updateAuthInput(d: {
|
|
344
146
|
authenticationMethodId: string;
|
|
345
147
|
previousInput: Record<string, any> | null;
|
|
346
148
|
newInput: Record<string, any>;
|
|
347
|
-
}): Promise<
|
|
348
|
-
input?: Record<string, any> | undefined;
|
|
349
|
-
requestTraces?: {
|
|
350
|
-
startedAt: string;
|
|
351
|
-
durationMs: number;
|
|
352
|
-
request: {
|
|
353
|
-
method: string;
|
|
354
|
-
url: string;
|
|
355
|
-
headers?: Record<string, string> | undefined;
|
|
356
|
-
body?: {
|
|
357
|
-
text: string;
|
|
358
|
-
contentType?: string | undefined;
|
|
359
|
-
truncated?: boolean | undefined;
|
|
360
|
-
} | undefined;
|
|
361
|
-
};
|
|
362
|
-
response?: {
|
|
363
|
-
status: number;
|
|
364
|
-
statusText?: string | undefined;
|
|
365
|
-
headers?: Record<string, string> | undefined;
|
|
366
|
-
body?: {
|
|
367
|
-
text: string;
|
|
368
|
-
contentType?: string | undefined;
|
|
369
|
-
truncated?: boolean | undefined;
|
|
370
|
-
} | undefined;
|
|
371
|
-
} | undefined;
|
|
372
|
-
error?: {
|
|
373
|
-
message: string;
|
|
374
|
-
code?: string | undefined;
|
|
375
|
-
} | undefined;
|
|
376
|
-
}[] | undefined;
|
|
377
|
-
}>;
|
|
149
|
+
}): Promise<SlatesMessageAuthInputChangedResponse['result']>;
|
|
378
150
|
getAuthOutput(d: {
|
|
379
151
|
authenticationMethodId: string;
|
|
380
152
|
input: Record<string, any>;
|
|
381
|
-
}): Promise<
|
|
382
|
-
output: Record<string, any>;
|
|
383
|
-
requestTraces?: {
|
|
384
|
-
startedAt: string;
|
|
385
|
-
durationMs: number;
|
|
386
|
-
request: {
|
|
387
|
-
method: string;
|
|
388
|
-
url: string;
|
|
389
|
-
headers?: Record<string, string> | undefined;
|
|
390
|
-
body?: {
|
|
391
|
-
text: string;
|
|
392
|
-
contentType?: string | undefined;
|
|
393
|
-
truncated?: boolean | undefined;
|
|
394
|
-
} | undefined;
|
|
395
|
-
};
|
|
396
|
-
response?: {
|
|
397
|
-
status: number;
|
|
398
|
-
statusText?: string | undefined;
|
|
399
|
-
headers?: Record<string, string> | undefined;
|
|
400
|
-
body?: {
|
|
401
|
-
text: string;
|
|
402
|
-
contentType?: string | undefined;
|
|
403
|
-
truncated?: boolean | undefined;
|
|
404
|
-
} | undefined;
|
|
405
|
-
} | undefined;
|
|
406
|
-
error?: {
|
|
407
|
-
message: string;
|
|
408
|
-
code?: string | undefined;
|
|
409
|
-
} | undefined;
|
|
410
|
-
}[] | undefined;
|
|
411
|
-
}>;
|
|
153
|
+
}): Promise<SlatesMessageAuthOutputGetResponse['result']>;
|
|
412
154
|
getAuthorizationUrl(d: {
|
|
413
155
|
authenticationMethodId: string;
|
|
414
156
|
redirectUri: string;
|
|
@@ -417,39 +159,7 @@ declare class SlatesProtocolClient {
|
|
|
417
159
|
clientId: string;
|
|
418
160
|
clientSecret: string;
|
|
419
161
|
scopes: string[];
|
|
420
|
-
}): Promise<
|
|
421
|
-
authorizationUrl: string;
|
|
422
|
-
input?: Record<string, any> | undefined;
|
|
423
|
-
callbackState?: Record<string, any> | undefined;
|
|
424
|
-
requestTraces?: {
|
|
425
|
-
startedAt: string;
|
|
426
|
-
durationMs: number;
|
|
427
|
-
request: {
|
|
428
|
-
method: string;
|
|
429
|
-
url: string;
|
|
430
|
-
headers?: Record<string, string> | undefined;
|
|
431
|
-
body?: {
|
|
432
|
-
text: string;
|
|
433
|
-
contentType?: string | undefined;
|
|
434
|
-
truncated?: boolean | undefined;
|
|
435
|
-
} | undefined;
|
|
436
|
-
};
|
|
437
|
-
response?: {
|
|
438
|
-
status: number;
|
|
439
|
-
statusText?: string | undefined;
|
|
440
|
-
headers?: Record<string, string> | undefined;
|
|
441
|
-
body?: {
|
|
442
|
-
text: string;
|
|
443
|
-
contentType?: string | undefined;
|
|
444
|
-
truncated?: boolean | undefined;
|
|
445
|
-
} | undefined;
|
|
446
|
-
} | undefined;
|
|
447
|
-
error?: {
|
|
448
|
-
message: string;
|
|
449
|
-
code?: string | undefined;
|
|
450
|
-
} | undefined;
|
|
451
|
-
}[] | undefined;
|
|
452
|
-
}>;
|
|
162
|
+
}): Promise<SlatesMessageAuthAuthorizationUrlGetResponse['result']>;
|
|
453
163
|
handleAuthorizationCallback(d: {
|
|
454
164
|
authenticationMethodId: string;
|
|
455
165
|
code: string;
|
|
@@ -459,6 +169,7 @@ declare class SlatesProtocolClient {
|
|
|
459
169
|
clientId: string;
|
|
460
170
|
clientSecret: string;
|
|
461
171
|
scopes: string[];
|
|
172
|
+
callbackParams?: Record<string, string>;
|
|
462
173
|
callbackState?: Record<string, any>;
|
|
463
174
|
}): Promise<{
|
|
464
175
|
output: Record<string, any>;
|
|
@@ -472,171 +183,16 @@ declare class SlatesProtocolClient {
|
|
|
472
183
|
clientId: string;
|
|
473
184
|
clientSecret: string;
|
|
474
185
|
scopes: string[];
|
|
475
|
-
}): Promise<
|
|
476
|
-
output: Record<string, any>;
|
|
477
|
-
input?: Record<string, any> | undefined;
|
|
478
|
-
requestTraces?: {
|
|
479
|
-
startedAt: string;
|
|
480
|
-
durationMs: number;
|
|
481
|
-
request: {
|
|
482
|
-
method: string;
|
|
483
|
-
url: string;
|
|
484
|
-
headers?: Record<string, string> | undefined;
|
|
485
|
-
body?: {
|
|
486
|
-
text: string;
|
|
487
|
-
contentType?: string | undefined;
|
|
488
|
-
truncated?: boolean | undefined;
|
|
489
|
-
} | undefined;
|
|
490
|
-
};
|
|
491
|
-
response?: {
|
|
492
|
-
status: number;
|
|
493
|
-
statusText?: string | undefined;
|
|
494
|
-
headers?: Record<string, string> | undefined;
|
|
495
|
-
body?: {
|
|
496
|
-
text: string;
|
|
497
|
-
contentType?: string | undefined;
|
|
498
|
-
truncated?: boolean | undefined;
|
|
499
|
-
} | undefined;
|
|
500
|
-
} | undefined;
|
|
501
|
-
error?: {
|
|
502
|
-
message: string;
|
|
503
|
-
code?: string | undefined;
|
|
504
|
-
} | undefined;
|
|
505
|
-
}[] | undefined;
|
|
506
|
-
}>;
|
|
186
|
+
}): Promise<SlatesMessageAuthTokenRefreshHandleResponse['result']>;
|
|
507
187
|
getAuthProfile(d: {
|
|
508
188
|
authenticationMethodId: string;
|
|
509
189
|
output: Record<string, any>;
|
|
510
190
|
input: Record<string, any>;
|
|
511
191
|
scopes: string[];
|
|
512
|
-
}): Promise<
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
durationMs: number;
|
|
517
|
-
request: {
|
|
518
|
-
method: string;
|
|
519
|
-
url: string;
|
|
520
|
-
headers?: Record<string, string> | undefined;
|
|
521
|
-
body?: {
|
|
522
|
-
text: string;
|
|
523
|
-
contentType?: string | undefined;
|
|
524
|
-
truncated?: boolean | undefined;
|
|
525
|
-
} | undefined;
|
|
526
|
-
};
|
|
527
|
-
response?: {
|
|
528
|
-
status: number;
|
|
529
|
-
statusText?: string | undefined;
|
|
530
|
-
headers?: Record<string, string> | undefined;
|
|
531
|
-
body?: {
|
|
532
|
-
text: string;
|
|
533
|
-
contentType?: string | undefined;
|
|
534
|
-
truncated?: boolean | undefined;
|
|
535
|
-
} | undefined;
|
|
536
|
-
} | undefined;
|
|
537
|
-
error?: {
|
|
538
|
-
message: string;
|
|
539
|
-
code?: string | undefined;
|
|
540
|
-
} | undefined;
|
|
541
|
-
}[] | undefined;
|
|
542
|
-
}>;
|
|
543
|
-
invokeTool(actionId: string, input: Record<string, any>): Promise<{
|
|
544
|
-
output: Record<string, any>;
|
|
545
|
-
message?: string | undefined;
|
|
546
|
-
requestTraces?: {
|
|
547
|
-
startedAt: string;
|
|
548
|
-
durationMs: number;
|
|
549
|
-
request: {
|
|
550
|
-
method: string;
|
|
551
|
-
url: string;
|
|
552
|
-
headers?: Record<string, string> | undefined;
|
|
553
|
-
body?: {
|
|
554
|
-
text: string;
|
|
555
|
-
contentType?: string | undefined;
|
|
556
|
-
truncated?: boolean | undefined;
|
|
557
|
-
} | undefined;
|
|
558
|
-
};
|
|
559
|
-
response?: {
|
|
560
|
-
status: number;
|
|
561
|
-
statusText?: string | undefined;
|
|
562
|
-
headers?: Record<string, string> | undefined;
|
|
563
|
-
body?: {
|
|
564
|
-
text: string;
|
|
565
|
-
contentType?: string | undefined;
|
|
566
|
-
truncated?: boolean | undefined;
|
|
567
|
-
} | undefined;
|
|
568
|
-
} | undefined;
|
|
569
|
-
error?: {
|
|
570
|
-
message: string;
|
|
571
|
-
code?: string | undefined;
|
|
572
|
-
} | undefined;
|
|
573
|
-
}[] | undefined;
|
|
574
|
-
}>;
|
|
575
|
-
mapTriggerEvent(actionId: string, input: Record<string, any>): Promise<{
|
|
576
|
-
type: string;
|
|
577
|
-
id: string;
|
|
578
|
-
output: Record<string, any>;
|
|
579
|
-
requestTraces?: {
|
|
580
|
-
startedAt: string;
|
|
581
|
-
durationMs: number;
|
|
582
|
-
request: {
|
|
583
|
-
method: string;
|
|
584
|
-
url: string;
|
|
585
|
-
headers?: Record<string, string> | undefined;
|
|
586
|
-
body?: {
|
|
587
|
-
text: string;
|
|
588
|
-
contentType?: string | undefined;
|
|
589
|
-
truncated?: boolean | undefined;
|
|
590
|
-
} | undefined;
|
|
591
|
-
};
|
|
592
|
-
response?: {
|
|
593
|
-
status: number;
|
|
594
|
-
statusText?: string | undefined;
|
|
595
|
-
headers?: Record<string, string> | undefined;
|
|
596
|
-
body?: {
|
|
597
|
-
text: string;
|
|
598
|
-
contentType?: string | undefined;
|
|
599
|
-
truncated?: boolean | undefined;
|
|
600
|
-
} | undefined;
|
|
601
|
-
} | undefined;
|
|
602
|
-
error?: {
|
|
603
|
-
message: string;
|
|
604
|
-
code?: string | undefined;
|
|
605
|
-
} | undefined;
|
|
606
|
-
}[] | undefined;
|
|
607
|
-
}>;
|
|
608
|
-
registerTriggerWebhook(actionId: string, webhookBaseUrl: string): Promise<{
|
|
609
|
-
registrationDetails: any;
|
|
610
|
-
state?: any;
|
|
611
|
-
requestTraces?: {
|
|
612
|
-
startedAt: string;
|
|
613
|
-
durationMs: number;
|
|
614
|
-
request: {
|
|
615
|
-
method: string;
|
|
616
|
-
url: string;
|
|
617
|
-
headers?: Record<string, string> | undefined;
|
|
618
|
-
body?: {
|
|
619
|
-
text: string;
|
|
620
|
-
contentType?: string | undefined;
|
|
621
|
-
truncated?: boolean | undefined;
|
|
622
|
-
} | undefined;
|
|
623
|
-
};
|
|
624
|
-
response?: {
|
|
625
|
-
status: number;
|
|
626
|
-
statusText?: string | undefined;
|
|
627
|
-
headers?: Record<string, string> | undefined;
|
|
628
|
-
body?: {
|
|
629
|
-
text: string;
|
|
630
|
-
contentType?: string | undefined;
|
|
631
|
-
truncated?: boolean | undefined;
|
|
632
|
-
} | undefined;
|
|
633
|
-
} | undefined;
|
|
634
|
-
error?: {
|
|
635
|
-
message: string;
|
|
636
|
-
code?: string | undefined;
|
|
637
|
-
} | undefined;
|
|
638
|
-
}[] | undefined;
|
|
639
|
-
}>;
|
|
192
|
+
}): Promise<SlatesMessageAuthProfileGetResponse['result']>;
|
|
193
|
+
invokeTool(actionId: string, input: Record<string, any>): Promise<SlatesMessageActionInvokeResponse['result']>;
|
|
194
|
+
mapTriggerEvent(actionId: string, input: Record<string, any>): Promise<SlatesMessageActionTriggerEventMapResponse['result']>;
|
|
195
|
+
registerTriggerWebhook(actionId: string, webhookBaseUrl: string): Promise<SlatesMessageActionTriggerWebhookRegisterResponse['result']>;
|
|
640
196
|
handleTriggerWebhook(d: {
|
|
641
197
|
actionId: string;
|
|
642
198
|
url: string;
|
|
@@ -644,73 +200,14 @@ declare class SlatesProtocolClient {
|
|
|
644
200
|
headers?: Record<string, string>;
|
|
645
201
|
body?: string | Uint8Array | null;
|
|
646
202
|
state?: any;
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
updatedState?: any;
|
|
650
|
-
requestTraces?: {
|
|
651
|
-
startedAt: string;
|
|
652
|
-
durationMs: number;
|
|
653
|
-
request: {
|
|
654
|
-
method: string;
|
|
655
|
-
url: string;
|
|
656
|
-
headers?: Record<string, string> | undefined;
|
|
657
|
-
body?: {
|
|
658
|
-
text: string;
|
|
659
|
-
contentType?: string | undefined;
|
|
660
|
-
truncated?: boolean | undefined;
|
|
661
|
-
} | undefined;
|
|
662
|
-
};
|
|
663
|
-
response?: {
|
|
664
|
-
status: number;
|
|
665
|
-
statusText?: string | undefined;
|
|
666
|
-
headers?: Record<string, string> | undefined;
|
|
667
|
-
body?: {
|
|
668
|
-
text: string;
|
|
669
|
-
contentType?: string | undefined;
|
|
670
|
-
truncated?: boolean | undefined;
|
|
671
|
-
} | undefined;
|
|
672
|
-
} | undefined;
|
|
673
|
-
error?: {
|
|
674
|
-
message: string;
|
|
675
|
-
code?: string | undefined;
|
|
676
|
-
} | undefined;
|
|
677
|
-
}[] | undefined;
|
|
678
|
-
}>;
|
|
203
|
+
registrationDetails?: any;
|
|
204
|
+
}): Promise<SlatesMessageActionTriggerWebhookHandleResponse['result']>;
|
|
679
205
|
unregisterTriggerWebhook(d: {
|
|
680
206
|
actionId: string;
|
|
681
207
|
webhookBaseUrl: string;
|
|
682
208
|
registrationDetails: any;
|
|
683
209
|
state?: any;
|
|
684
|
-
}): Promise<
|
|
685
|
-
requestTraces?: {
|
|
686
|
-
startedAt: string;
|
|
687
|
-
durationMs: number;
|
|
688
|
-
request: {
|
|
689
|
-
method: string;
|
|
690
|
-
url: string;
|
|
691
|
-
headers?: Record<string, string> | undefined;
|
|
692
|
-
body?: {
|
|
693
|
-
text: string;
|
|
694
|
-
contentType?: string | undefined;
|
|
695
|
-
truncated?: boolean | undefined;
|
|
696
|
-
} | undefined;
|
|
697
|
-
};
|
|
698
|
-
response?: {
|
|
699
|
-
status: number;
|
|
700
|
-
statusText?: string | undefined;
|
|
701
|
-
headers?: Record<string, string> | undefined;
|
|
702
|
-
body?: {
|
|
703
|
-
text: string;
|
|
704
|
-
contentType?: string | undefined;
|
|
705
|
-
truncated?: boolean | undefined;
|
|
706
|
-
} | undefined;
|
|
707
|
-
} | undefined;
|
|
708
|
-
error?: {
|
|
709
|
-
message: string;
|
|
710
|
-
code?: string | undefined;
|
|
711
|
-
} | undefined;
|
|
712
|
-
}[] | undefined;
|
|
713
|
-
}>;
|
|
210
|
+
}): Promise<SlatesMessageActionTriggerWebhookUnregisterResponse['result']>;
|
|
714
211
|
close(): Promise<void>;
|
|
715
212
|
}
|
|
716
213
|
|
|
@@ -722,10 +219,11 @@ interface SlateProtocolErrorResponse {
|
|
|
722
219
|
kind: SlateProtocolErrorKind;
|
|
723
220
|
retryable?: boolean;
|
|
724
221
|
status?: number;
|
|
725
|
-
issues?:
|
|
222
|
+
issues?: Record<string, unknown>[];
|
|
726
223
|
provider?: Record<string, unknown>;
|
|
727
224
|
upstream?: Record<string, unknown>;
|
|
728
225
|
baggage?: Record<string, unknown>;
|
|
226
|
+
requestTraces?: Record<string, unknown>[];
|
|
729
227
|
[key: string]: unknown;
|
|
730
228
|
}
|
|
731
229
|
declare class SlateProtocolError extends Error {
|
|
@@ -744,10 +242,11 @@ declare class SlateProtocolError extends Error {
|
|
|
744
242
|
kind: SlateProtocolErrorKind;
|
|
745
243
|
retryable?: boolean;
|
|
746
244
|
status?: number;
|
|
747
|
-
issues?:
|
|
245
|
+
issues?: Record<string, unknown>[];
|
|
748
246
|
provider?: Record<string, unknown>;
|
|
749
247
|
upstream?: Record<string, unknown>;
|
|
750
248
|
baggage?: Record<string, unknown>;
|
|
249
|
+
requestTraces?: Record<string, unknown>[];
|
|
751
250
|
};
|
|
752
251
|
static is(error: unknown): error is SlateProtocolError;
|
|
753
252
|
static fromResponse(error: unknown, source?: SlateProtocolErrorSource): SlateProtocolError;
|