Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/assistant-search-context-enterprise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@slack/web-api": patch
---

fix(web-api): accept `enterprise` in [`assistant.search.context`](https://docs.slack.dev/reference/methods/assistant.search.context) `content_types` and list its arguments in the reference order
58 changes: 29 additions & 29 deletions packages/web-api/src/types/request/assistant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,61 +7,61 @@ export interface AssistantSearchContextArguments extends TokenOverridable, SortD
query: string;
/** @description Send `action_token` as received in a message event. */
action_token?: string;
/** @description UNIX timestamp filter. If present, filters for results after this date. */
after?: number;
/** @description UNIX timestamp filter. If present, filters for results before this date. */
before?: number;
/**
* @description Mix and match channel types by providing a comma-separated list of any combination of
* `public_channel`, `private_channel`, `mpim`, `im`.
*/
channel_types?: ('public_channel' | 'private_channel' | 'mpim' | 'im')[];
/**
* @description Content types to include, a comma-separated list of any combination of `messages`, `files`,
* `channels`, `users`.
* `enterprise`, `channels`, `users`.
*/
content_types?: ('messages' | 'files' | 'channels' | 'users')[];
content_types?: ('messages' | 'files' | 'enterprise' | 'channels' | 'users')[];
/** @description Whether the results should include bots. */
include_bots?: boolean;
/** @description Whether to include deleted users in the user search results. Defaults to false. */
include_deleted_users?: boolean;
/** @description UNIX timestamp filter. If present, filters for results before this date. */
before?: number;
/** @description UNIX timestamp filter. If present, filters for results after this date. */
after?: number;
/**
* @description Whether to include context messages surrounding the main message result. Defaults to false if
* unspecified.
*/
include_context_messages?: boolean;
/** @description Context channel ID to support scoping the search when applicable. */
context_channel_id?: string;
/**
* @description The cursor returned by the API. Leave this blank for the first request and use this to get the
* next page of results.
*/
cursor?: string;
/**
* @description Whether to disable semantic search. When true, only keyword-based search is used. Defaults to
* false.
*/
disable_semantic_search?: boolean;
/** @description Number of results to return, up to a max of 20. Defaults to 20. */
limit?: number;
/** @description The field to sort the results by. Defaults to score. Can be one of: score, timestamp. */
sort?: 'score' | 'timestamp';
/** @description Whether to return the message blocks in the response. */
include_message_blocks?: boolean;
/** @description Whether to highlight the search query in the results. Defaults to false if unspecified. */
highlight?: boolean;
/** @description Whether to include archived channels in the search results. */
include_archived_channels?: boolean;
/** @description Whether the results should include bots. */
include_bots?: boolean;
/**
* @description Whether to include context messages surrounding the main message result. Defaults to false if
* unspecified.
* @description A list of term clauses. A term clause is a string with search terms. Search results returned will
* match every term clause specified (i.e., conjunctive normal form).
*/
include_context_messages?: boolean;
/** @description Whether to include deleted users in the user search results. Defaults to false. */
include_deleted_users?: boolean;
/** @description Whether to return the message blocks in the response. */
include_message_blocks?: boolean;
/** @description Number of results to return, up to a max of 20. Defaults to 20. */
limit?: number;
term_clauses?: string[];
/**
* @description A string containing only modifiers in the format of `modifier:value`. Search results returned
* will match the modifier value. For now modifiers only affect term clauses.
*/
modifiers?: string;
/** @description The field to sort the results by. Defaults to score. Can be one of: score, timestamp. */
sort?: 'score' | 'timestamp';
/** @description Whether to include archived channels in the search results. */
include_archived_channels?: boolean;
/**
* @description A list of term clauses. A term clause is a string with search terms. Search results returned will
* match every term clause specified (i.e., conjunctive normal form).
* @description Whether to disable semantic search. When true, only keyword-based search is used. Defaults to
* false.
*/
term_clauses?: string[];
disable_semantic_search?: boolean;
}

// https://docs.slack.dev/reference/methods/assistant.search.info
Expand Down
22 changes: 11 additions & 11 deletions packages/web-api/test/types/methods/assistant.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,24 +58,24 @@ expectAssignable<Parameters<typeof web.assistant.search.context>>([
{
query: 'What is the latest on project Gizmo?',
action_token: '12345.98765.abcd2358fdea',
after: 1752512713,
before: 1755191113,
channel_types: ['public_channel', 'private_channel', 'mpim', 'im'],
content_types: ['messages', 'files', 'channels', 'users'],
context_channel_id: 'C1234',
cursor: 'asf91j9jfd',
disable_semantic_search: false,
highlight: true,
include_archived_channels: true,
content_types: ['messages', 'files', 'enterprise', 'channels', 'users'],
Comment thread
zimeg marked this conversation as resolved.
Resolved
include_bots: false,
include_context_messages: true,
include_deleted_users: false,
include_message_blocks: true,
before: 1755191113,
after: 1752512713,
include_context_messages: true,
context_channel_id: 'C1234',
cursor: 'asf91j9jfd',
limit: 20,
modifiers: 'has:pin before:yesterday',
sort: 'timestamp',
sort_dir: 'asc',
include_message_blocks: true,
highlight: true,
term_clauses: ['project gizmo'],
modifiers: 'has:pin before:yesterday',
include_archived_channels: true,
disable_semantic_search: false,
},
]);

Expand Down