UNPKG

7.5 kBTypeScriptView Raw
1import type { ChannelIDs, CursorPaginationEnabled, SortDir, TokenOverridable, UserIDs } from '../common';
2interface ChannelID {
3 /** @description Encoded channel ID. */
4 channel_id: string;
5}
6type ChannelType = 'private' | 'private_exclude' | 'archived' | 'exclude_archived' | 'private_exclude_archived' | 'multi_workspace' | 'org_wide' | 'external_shared_exclude' | 'external_shared' | 'external_shared_private' | 'external_shared_archived' | 'exclude_org_shared';
7interface GroupID {
8 /** @description The {@link https://slack.com/help/articles/115001435788-Connect-identity-provider-groups-to-your-Enterprise-Grid-org IDP Group} ID. */
9 group_id: string;
10}
11interface TeamIDs {
12 /** @description A list of team IDs to filter by (must include at least one ID). */
13 team_ids: [string, ...string[]];
14}
15interface RestrictAccessTeamID {
16 /**
17 * @description The workspace where the channel exists. This argument is required for channels only tied to
18 * one workspace, and optional for channels that are shared across an organization.
19 */
20 team_id?: string;
21}
22export interface AdminConversationsArchiveArguments extends ChannelID, TokenOverridable {
23}
24export interface AdminConversationsBulkArchiveArguments extends ChannelIDs, TokenOverridable {
25}
26export interface AdminConversationsBulkDeleteArguments extends ChannelIDs, TokenOverridable {
27}
28export interface AdminConversationsBulkMoveArguments extends ChannelIDs, TokenOverridable {
29 /** @description Target team ID to move channels to. */
30 target_team_id: string;
31}
32export interface AdminConversationsConvertToPrivateArguments extends ChannelID, TokenOverridable {
33 /** @description Name of private channel to create. Only respected when converting an MPIM. */
34 name?: string;
35}
36export interface AdminConversationsConvertToPublicArguments extends ChannelID, TokenOverridable {
37}
38interface OrgWide {
39 /** @description When `true`, the channel will be available org-wide. */
40 org_wide: true;
41 team_id?: never;
42}
43interface SpecificTeam {
44 /**
45 * @description When `false` (the default), the channel will be available to only
46 * the workspace specified by `team_id`.
47 */
48 org_wide?: false;
49 /**
50 * @description The workspace to create the channel in. This argument is required unless you set `org_wide` to `true`.
51 */
52 team_id: string;
53}
54type WorkspaceAccess = OrgWide | SpecificTeam;
55export type AdminConversationsCreateArguments = TokenOverridable & WorkspaceAccess & {
56 /** @description When `true`, creates a private channel instead of a public channel. */
57 is_private: boolean;
58 /** @description Name of the public or private channel to create. */
59 name: string;
60 /** @description Description of the public or private channel to create. */
61 description?: string;
62};
63export interface AdminConversationsDeleteArguments extends ChannelID, TokenOverridable {
64}
65export interface AdminConversationsDisconnectSharedArguments extends ChannelID, TokenOverridable {
66 /** @description Team IDs getting removed from the channel, optional if there are only two teams in the channel. */
67 leaving_team_ids?: string[];
68}
69export interface AdminConversationsEKMListOriginalConnectedChannelInfoArguments extends Partial<TeamIDs>, TokenOverridable, CursorPaginationEnabled {
70 /** @description A comma-separated list of channels to filter to. */
71 channel_ids?: string[];
72}
73export interface AdminConversationsGetConversationPrefsArguments extends ChannelID, TokenOverridable {
74}
75export interface AdminConversationsGetCustomRetentionArguments extends ChannelID, TokenOverridable {
76}
77export interface AdminConversationsGetTeamsArguments extends ChannelID, TokenOverridable, CursorPaginationEnabled {
78}
79export interface AdminConversationsInviteArguments extends ChannelID, UserIDs, TokenOverridable {
80}
81export interface AdminConversationsLookupArguments extends TeamIDs, TokenOverridable, CursorPaginationEnabled {
82 /**
83 * @description UNIX timestamp to filter by public channels where the most recent message
84 * was sent before this parameter.
85 */
86 last_message_activity_before: number;
87 /** @description Filter by public channels with member count equal to or less than the specified number. */
88 max_member_count?: number;
89}
90export interface AdminConversationsRemoveCustomRetentionArguments extends ChannelID, TokenOverridable {
91}
92export interface AdminConversationsRenameArguments extends ChannelID, TokenOverridable {
93 /** @description The new name for the channel. */
94 name: string;
95}
96export interface AdminConversationsRestrictAccessAddGroupArguments extends ChannelID, GroupID, RestrictAccessTeamID, TokenOverridable {
97}
98export interface AdminConversationsRestrictAccessListGroupsArguments extends ChannelID, RestrictAccessTeamID, TokenOverridable {
99}
100export interface AdminConversationsRestrictAccessRemoveGroupArguments extends ChannelID, GroupID, RestrictAccessTeamID, TokenOverridable {
101}
102export interface AdminConversationsSearchArguments extends SortDir, Partial<TeamIDs>, TokenOverridable, CursorPaginationEnabled {
103 /** @description Array of encoded team IDs, signifying the external orgs to search through. */
104 connected_team_ids?: string[];
105 /** @description Name of the channel to query by. */
106 query?: string;
107 /**
108 * @description The type of channels to include or exclude in the search. For example `private` will search
109 * private channels, while `private_exclude` will exclude them.
110 * @see {@link https://api.slack.com/methods/admin.conversations.search#types Full list of channel types}.
111 */
112 search_channel_types?: ChannelType[];
113 /**
114 * @description Possible values are:
115 * - `relevant`: search ranking based on what we think is closest,
116 * - `name`: alphabetical,
117 * - `member_count`: number of users in the channel,
118 * - `created`: date channel was created.
119 * Defaults to `member_count`.
120 * You can optionally pair this with the `sort_dir` argument to change how it is sorted.
121 */
122 sort?: 'relevant' | 'name' | 'member_count' | 'created';
123 /**
124 * @description Only return the total count of channels.
125 * Omits channel data and allows access for admins without channel manager permissions. Defaults to `false`.
126 */
127 total_count_only?: boolean;
128}
129export interface AdminConversationsSetConversationPrefsArguments extends ChannelID, TokenOverridable {
130 /** @description The prefs for this channel. */
131 prefs: Record<string, unknown>;
132}
133export interface AdminConversationsSetCustomRetentionArguments extends ChannelID, TokenOverridable {
134 /** @description The message retention duration in days to set for this conversation. */
135 duration_days: number;
136}
137export interface AdminConversationsSetTeamsArguments extends ChannelID, TokenOverridable {
138 /** @description Set to `true` if channel has to be converted to an org channel. Defaults to `false`. */
139 org_channel?: boolean;
140 /**
141 * @description A list of workspaces to which the channel should be shared.
142 * Not required if the channel is being shared org-wide.
143 */
144 target_team_ids?: string[];
145 /**
146 * @description The workspace to which the channel belongs.
147 * Omit this argument if the channel is a cross-workspace shared channel.
148 */
149 team_id?: string;
150}
151export interface AdminConversationsUnarchiveArguments extends ChannelID, TokenOverridable {
152}
153export {};
154//# sourceMappingURL=conversations.d.ts.map
\No newline at end of file