@@ -3,6 +3,81 @@ import { WebClient } from '../../../src/WebClient';
33
44const web = new WebClient ( 'TOKEN' ) ;
55
6+ // assistant.search.context
7+ // -- sad path
8+ expectError ( web . assistant . search . context ( ) ) ; // lacking argument
9+ expectError ( web . assistant . search . context ( { } ) ) ; // empty argument
10+ expectError (
11+ web . assistant . search . context ( {
12+ query : 123 , // not a string
13+ } ) ,
14+ web . assistant . search . context ( {
15+ query : 'What is project gizmo?' ,
16+ channel_types : [ 'public_channel' , 'channel' ] , // unsupported channel type
17+ } ) ,
18+ web . assistant . search . context ( {
19+ query : 'What is project gizmo?' ,
20+ content_types : [ 'messages' , 'posts' ] , // unsupported content type
21+ } ) ,
22+ web . assistant . search . context ( {
23+ query : 'What is project gizmo?' ,
24+ include_bots : 'false' , // not a boolean
25+ } ) ,
26+ web . assistant . search . context ( {
27+ query : 'What is project gizmo?' ,
28+ keywords_clauses : [ 'project' ] , // not an array of string arrays
29+ } ) ,
30+ web . assistant . search . context ( {
31+ query : 'What is project gizmo?' ,
32+ sort : 'date' , // unsupported sort field
33+ } ) ,
34+ web . assistant . search . context ( {
35+ query : 'What is project gizmo?' ,
36+ sort_dir : 'down' , // unsupported sort direction
37+ } ) ,
38+ ) ;
39+ // -- happy path
40+ expectAssignable < Parameters < typeof web . assistant . search . context > > ( [
41+ {
42+ query : 'What is project gizmo?' ,
43+ } ,
44+ ] ) ;
45+ expectAssignable < Parameters < typeof web . assistant . search . context > > ( [
46+ {
47+ query : 'What is the latest on project Gizmo?' ,
48+ action_token : '12345.98765.abcd2358fdea' ,
49+ after : 1752512713 ,
50+ before : 1755191113 ,
51+ channel_types : [ 'public_channel' , 'private_channel' , 'mpim' , 'im' ] ,
52+ content_types : [ 'messages' , 'files' , 'channels' , 'users' ] ,
53+ context_channel_id : 'C1234' ,
54+ cursor : 'asf91j9jfd' ,
55+ disable_semantic_search : false ,
56+ highlight : true ,
57+ include_archived_channels : true ,
58+ include_bots : false ,
59+ include_context_messages : true ,
60+ include_deleted_users : false ,
61+ include_message_blocks : true ,
62+ keywords_clauses : [ [ 'project' , 'gizmo' ] ] ,
63+ limit : 20 ,
64+ modifiers : 'has:pin before:yesterday' ,
65+ sort : 'timestamp' ,
66+ sort_dir : 'asc' ,
67+ term_clauses : [ 'project gizmo' ] ,
68+ } ,
69+ ] ) ;
70+
71+ // assistant.search.info
72+ // -- happy path
73+ expectAssignable < Parameters < typeof web . assistant . search . info > > ( [ ] ) ;
74+ expectAssignable < Parameters < typeof web . assistant . search . info > > ( [ { } ] ) ;
75+ expectAssignable < Parameters < typeof web . assistant . search . info > > ( [
76+ {
77+ token : 'TOKEN' ,
78+ } ,
79+ ] ) ;
80+
681// assistant.threads.setStatus
782// -- sad path
883expectError ( web . assistant . threads . setStatus ( ) ) ; // lacking argument
0 commit comments