UNPKG

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