@slates/proto 1.0.0-rc.11 → 1.0.0-rc.13
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 +44 -4
- package/dist/index.d.cts +360 -1
- package/dist/index.d.ts +360 -1
- package/dist/index.module.js +41 -4
- package/package.json +2 -2
- package/src/messages/action.ts +17 -2
- package/src/messages/auth.ts +2 -1
- package/src/types/action.ts +36 -1
package/dist/index.module.js
CHANGED
|
@@ -29,6 +29,7 @@ var slatesActionBase = z.object({
|
|
|
29
29
|
}).optional(),
|
|
30
30
|
metadata: z.record(z.string(), z.any()).optional(),
|
|
31
31
|
scopes: slatesActionScopes.optional(),
|
|
32
|
+
authMethods: z.array(z.string()).optional(),
|
|
32
33
|
inputSchema: z.record(z.string(), z.any()),
|
|
33
34
|
outputSchema: z.record(z.string(), z.any()),
|
|
34
35
|
docs: z.array(
|
|
@@ -43,6 +44,27 @@ var slatesActionTool = slatesActionBase.extend({
|
|
|
43
44
|
type: z.literal("action.tool"),
|
|
44
45
|
capabilities: z.object({})
|
|
45
46
|
});
|
|
47
|
+
var slatesWebhookRequestMatcher = z.object({
|
|
48
|
+
method: z.string().optional(),
|
|
49
|
+
hasQueryParam: z.string().optional(),
|
|
50
|
+
hasHeader: z.string().optional(),
|
|
51
|
+
jsonBodyField: z.object({
|
|
52
|
+
path: z.string(),
|
|
53
|
+
equals: z.string().optional()
|
|
54
|
+
}).optional(),
|
|
55
|
+
formBodyField: z.object({
|
|
56
|
+
path: z.string(),
|
|
57
|
+
equals: z.string().optional()
|
|
58
|
+
}).optional()
|
|
59
|
+
});
|
|
60
|
+
var slatesWebhookHttp = z.object({
|
|
61
|
+
methods: z.array(z.enum(["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"])).optional(),
|
|
62
|
+
sync: z.object({
|
|
63
|
+
mode: z.enum(["never", "match", "always"]),
|
|
64
|
+
match: z.array(slatesWebhookRequestMatcher).optional(),
|
|
65
|
+
timeoutMs: z.number().int().positive().max(15e3).optional()
|
|
66
|
+
}).optional()
|
|
67
|
+
});
|
|
46
68
|
var slatesActionTrigger = slatesActionBase.extend({
|
|
47
69
|
type: z.literal("action.trigger"),
|
|
48
70
|
capabilities: z.object({}),
|
|
@@ -54,7 +76,8 @@ var slatesActionTrigger = slatesActionBase.extend({
|
|
|
54
76
|
z.object({
|
|
55
77
|
type: z.literal("webhook"),
|
|
56
78
|
autoRegistration: z.boolean(),
|
|
57
|
-
autoUnregistration: z.boolean()
|
|
79
|
+
autoUnregistration: z.boolean(),
|
|
80
|
+
http: slatesWebhookHttp.optional()
|
|
58
81
|
})
|
|
59
82
|
])
|
|
60
83
|
});
|
|
@@ -145,6 +168,14 @@ var withRequestTraces = (shape) => z4.object({
|
|
|
145
168
|
});
|
|
146
169
|
|
|
147
170
|
// src/messages/action.ts
|
|
171
|
+
var slatesWebhookHttpResponse = z5.object({
|
|
172
|
+
status: z5.number().int().min(100).max(599),
|
|
173
|
+
headers: z5.record(z5.string(), z5.string()),
|
|
174
|
+
body: z5.object({
|
|
175
|
+
encoding: z5.literal("base64"),
|
|
176
|
+
content: z5.string()
|
|
177
|
+
}).nullable()
|
|
178
|
+
});
|
|
148
179
|
var slatesMessageActionsListRequest = z5.object({
|
|
149
180
|
jsonrpc: z5.literal("2.0"),
|
|
150
181
|
method: z5.literal("slates/actions.list"),
|
|
@@ -254,7 +285,8 @@ var slatesMessageActionTriggerWebhookHandleRequest = z5.object({
|
|
|
254
285
|
encoding: z5.literal("base64"),
|
|
255
286
|
content: z5.string()
|
|
256
287
|
}).nullable(),
|
|
257
|
-
state: z5.any().nullable()
|
|
288
|
+
state: z5.any().nullable(),
|
|
289
|
+
registrationDetails: z5.any().nullable().optional()
|
|
258
290
|
})
|
|
259
291
|
});
|
|
260
292
|
var slatesMessageActionTriggerWebhookHandleResponse = z5.object({
|
|
@@ -262,7 +294,8 @@ var slatesMessageActionTriggerWebhookHandleResponse = z5.object({
|
|
|
262
294
|
id: z5.string(),
|
|
263
295
|
result: withRequestTraces({
|
|
264
296
|
inputs: z5.array(z5.record(z5.string(), z5.any())),
|
|
265
|
-
updatedState: z5.any().nullable().optional()
|
|
297
|
+
updatedState: z5.any().nullable().optional(),
|
|
298
|
+
response: slatesWebhookHttpResponse.nullable().optional()
|
|
266
299
|
})
|
|
267
300
|
});
|
|
268
301
|
var slatesMessageActionTriggerWebhookRegisterRequest = z5.object({
|
|
@@ -490,7 +523,8 @@ var slatesMessageAuthOutputGetResponse = z6.object({
|
|
|
490
523
|
jsonrpc: z6.literal("2.0"),
|
|
491
524
|
id: z6.string(),
|
|
492
525
|
result: withRequestTraces({
|
|
493
|
-
output: z6.record(z6.string(), z6.any())
|
|
526
|
+
output: z6.record(z6.string(), z6.any()),
|
|
527
|
+
scopes: z6.array(z6.string()).optional()
|
|
494
528
|
})
|
|
495
529
|
});
|
|
496
530
|
var slatesAuthResponsesByMethod = {
|
|
@@ -1019,5 +1053,8 @@ export {
|
|
|
1019
1053
|
slatesRequestTraceTextBody,
|
|
1020
1054
|
slatesRequestsByMethod,
|
|
1021
1055
|
slatesResponsesByMethod,
|
|
1056
|
+
slatesWebhookHttp,
|
|
1057
|
+
slatesWebhookHttpResponse,
|
|
1058
|
+
slatesWebhookRequestMatcher,
|
|
1022
1059
|
withRequestTraces
|
|
1023
1060
|
};
|
package/package.json
CHANGED
package/src/messages/action.ts
CHANGED
|
@@ -2,6 +2,19 @@ import z from 'zod';
|
|
|
2
2
|
import { slatesAction } from '../types';
|
|
3
3
|
import { withRequestTraces } from './tracing';
|
|
4
4
|
|
|
5
|
+
export let slatesWebhookHttpResponse = z.object({
|
|
6
|
+
status: z.number().int().min(100).max(599),
|
|
7
|
+
headers: z.record(z.string(), z.string()),
|
|
8
|
+
body: z
|
|
9
|
+
.object({
|
|
10
|
+
encoding: z.literal('base64'),
|
|
11
|
+
content: z.string()
|
|
12
|
+
})
|
|
13
|
+
.nullable()
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export type SlatesWebhookHttpResponse = z.infer<typeof slatesWebhookHttpResponse>;
|
|
17
|
+
|
|
5
18
|
/**
|
|
6
19
|
* List Actions
|
|
7
20
|
*/
|
|
@@ -177,7 +190,8 @@ export let slatesMessageActionTriggerWebhookHandleRequest = z.object({
|
|
|
177
190
|
content: z.string()
|
|
178
191
|
})
|
|
179
192
|
.nullable(),
|
|
180
|
-
state: z.any().nullable()
|
|
193
|
+
state: z.any().nullable(),
|
|
194
|
+
registrationDetails: z.any().nullable().optional()
|
|
181
195
|
})
|
|
182
196
|
});
|
|
183
197
|
|
|
@@ -190,7 +204,8 @@ export let slatesMessageActionTriggerWebhookHandleResponse = z.object({
|
|
|
190
204
|
id: z.string(),
|
|
191
205
|
result: withRequestTraces({
|
|
192
206
|
inputs: z.array(z.record(z.string(), z.any())),
|
|
193
|
-
updatedState: z.any().nullable().optional()
|
|
207
|
+
updatedState: z.any().nullable().optional(),
|
|
208
|
+
response: slatesWebhookHttpResponse.nullable().optional()
|
|
194
209
|
})
|
|
195
210
|
});
|
|
196
211
|
|
package/src/messages/auth.ts
CHANGED
|
@@ -296,7 +296,8 @@ export let slatesMessageAuthOutputGetResponse = z.object({
|
|
|
296
296
|
jsonrpc: z.literal('2.0'),
|
|
297
297
|
id: z.string(),
|
|
298
298
|
result: withRequestTraces({
|
|
299
|
-
output: z.record(z.string(), z.any())
|
|
299
|
+
output: z.record(z.string(), z.any()),
|
|
300
|
+
scopes: z.array(z.string()).optional()
|
|
300
301
|
})
|
|
301
302
|
});
|
|
302
303
|
|
package/src/types/action.ts
CHANGED
|
@@ -23,6 +23,7 @@ export let slatesActionBase = z.object({
|
|
|
23
23
|
.optional(),
|
|
24
24
|
metadata: z.record(z.string(), z.any()).optional(),
|
|
25
25
|
scopes: slatesActionScopes.optional(),
|
|
26
|
+
authMethods: z.array(z.string()).optional(),
|
|
26
27
|
|
|
27
28
|
inputSchema: z.record(z.string(), z.any()),
|
|
28
29
|
outputSchema: z.record(z.string(), z.any()),
|
|
@@ -41,6 +42,37 @@ export let slatesActionTool = slatesActionBase.extend({
|
|
|
41
42
|
capabilities: z.object({})
|
|
42
43
|
});
|
|
43
44
|
|
|
45
|
+
export let slatesWebhookRequestMatcher = z.object({
|
|
46
|
+
method: z.string().optional(),
|
|
47
|
+
hasQueryParam: z.string().optional(),
|
|
48
|
+
hasHeader: z.string().optional(),
|
|
49
|
+
jsonBodyField: z
|
|
50
|
+
.object({
|
|
51
|
+
path: z.string(),
|
|
52
|
+
equals: z.string().optional()
|
|
53
|
+
})
|
|
54
|
+
.optional(),
|
|
55
|
+
formBodyField: z
|
|
56
|
+
.object({
|
|
57
|
+
path: z.string(),
|
|
58
|
+
equals: z.string().optional()
|
|
59
|
+
})
|
|
60
|
+
.optional()
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
export let slatesWebhookHttp = z.object({
|
|
64
|
+
methods: z
|
|
65
|
+
.array(z.enum(['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS']))
|
|
66
|
+
.optional(),
|
|
67
|
+
sync: z
|
|
68
|
+
.object({
|
|
69
|
+
mode: z.enum(['never', 'match', 'always']),
|
|
70
|
+
match: z.array(slatesWebhookRequestMatcher).optional(),
|
|
71
|
+
timeoutMs: z.number().int().positive().max(15_000).optional()
|
|
72
|
+
})
|
|
73
|
+
.optional()
|
|
74
|
+
});
|
|
75
|
+
|
|
44
76
|
export let slatesActionTrigger = slatesActionBase.extend({
|
|
45
77
|
type: z.literal('action.trigger'),
|
|
46
78
|
capabilities: z.object({}),
|
|
@@ -53,7 +85,8 @@ export let slatesActionTrigger = slatesActionBase.extend({
|
|
|
53
85
|
z.object({
|
|
54
86
|
type: z.literal('webhook'),
|
|
55
87
|
autoRegistration: z.boolean(),
|
|
56
|
-
autoUnregistration: z.boolean()
|
|
88
|
+
autoUnregistration: z.boolean(),
|
|
89
|
+
http: slatesWebhookHttp.optional()
|
|
57
90
|
})
|
|
58
91
|
])
|
|
59
92
|
});
|
|
@@ -64,3 +97,5 @@ export type SlatesAction = z.infer<typeof slatesAction>;
|
|
|
64
97
|
export type SlatesActionTool = z.infer<typeof slatesActionTool>;
|
|
65
98
|
export type SlatesActionTrigger = z.infer<typeof slatesActionTrigger>;
|
|
66
99
|
export type SlatesActionScopes = z.infer<typeof slatesActionScopes>;
|
|
100
|
+
export type SlatesWebhookRequestMatcher = z.infer<typeof slatesWebhookRequestMatcher>;
|
|
101
|
+
export type SlatesWebhookHttp = z.infer<typeof slatesWebhookHttp>;
|