UNPKG

5.44 kBTypeScriptView Raw
1import type { ChannelIDs, CursorPaginationEnabled, OptionalTeamAssignable, TeamID, TokenOverridable, UserIDs } from '../common';
2interface UserID {
3 /** @description The ID of the user. */
4 user_id: string;
5}
6interface IsRestricted {
7 /** @description Set to `true` if user should be added to the workspace as a guest. */
8 is_restricted?: boolean;
9}
10interface IsUltraRestricted {
11 /** @description Set to `true` if user should be added to the workspace as a guest. */
12 is_ultra_restricted?: boolean;
13}
14interface SessionExpirationTarget {
15 /** @description Only expire mobile sessions. Defaults to `false`. */
16 mobile_only?: boolean;
17 /** @description Only expire web sessions. Defaults to `false`. */
18 web_only?: boolean;
19}
20interface TeamIDWithoutDeactivatedWorkspaces extends TeamID {
21 include_deactivated_user_workspaces?: false;
22}
23interface DeactivatedWorkspacesWithoutTeamID {
24 team_id?: never;
25 /**
26 * @description Only applies when using an org token and when no `team_id` is provided. If `true`, return workspaces
27 * for a user even if they may be deactivated on them. If `false`, return workspaces for a user only when user is
28 * active on them. Default is `false`.
29 */
30 include_deactivated_user_workspaces?: true;
31}
32type TeamIDOrDeactivatedWorkspaces = TeamIDWithoutDeactivatedWorkspaces | DeactivatedWorkspacesWithoutTeamID;
33interface BothTeamAndUserID extends TeamID, UserID {
34}
35interface NeitherTeamNorUserID {
36 team_id?: never;
37 user_id?: never;
38}
39type EitherTeamAndUserIDOrNeither = BothTeamAndUserID | NeitherTeamNorUserID;
40export interface AdminUsersAssignArguments extends TeamID, UserID, Partial<ChannelIDs>, IsRestricted, IsUltraRestricted, TokenOverridable {
41}
42export interface AdminUsersInviteArguments extends ChannelIDs, TeamID, IsRestricted, IsUltraRestricted, TokenOverridable {
43 /** @description The email address of the person to invite. */
44 email: string;
45 /** @description An optional message to send to the user in the invite email. */
46 custom_message?: string;
47 /**
48 * @description Allow invited user to sign in via email and password. Only available for Enterprise Grid teams via
49 * admin invite.
50 */
51 email_password_policy_enabled?: boolean;
52 /**
53 * @description Timestamp when guest account should be disabled. Only include this timestamp if you are inviting a
54 * guest user and you want their account to expire on a certain date.
55 */
56 guest_expiration_ts?: string;
57 /** @description Full name of the user. */
58 real_name?: string;
59 /**
60 * @description Allow this invite to be resent in the future if a user has not signed up yet.
61 * Resending can only be done via the UI and has no expiration. Defaults to `false`.
62 */
63 resend?: boolean;
64}
65export type AdminUsersListArguments = TeamIDOrDeactivatedWorkspaces & TokenOverridable & CursorPaginationEnabled & {
66 /**
67 * @description If `true`, only active users will be returned. If `false`, only deactivated users will be returned.
68 * Default is `true`.
69 */
70 is_active?: boolean;
71};
72export interface AdminUsersRemoveArguments extends TeamID, UserID, TokenOverridable {
73}
74export interface AdminUsersSessionClearSettingsArguments extends UserIDs, TokenOverridable {
75}
76export interface AdminUsersSessionGetSettingsArguments extends UserIDs, TokenOverridable {
77}
78export interface AdminUsersSessionInvalidateArguments extends TeamID, TokenOverridable {
79 /** @description ID of the session to invalidate. */
80 session_id: string;
81}
82export type AdminUsersSessionListArguments = EitherTeamAndUserIDOrNeither & TokenOverridable & CursorPaginationEnabled;
83export interface AdminUsersSessionResetArguments extends UserID, SessionExpirationTarget, TokenOverridable {
84}
85export interface AdminUsersSessionResetBulkArguments extends UserIDs, SessionExpirationTarget, TokenOverridable {
86}
87export interface AdminUsersSessionSetSettingsArguments extends UserIDs, TokenOverridable {
88 /** @description Terminate the session when the client—either the desktop app or a browser window—is closed. */
89 desktop_app_browser_quit?: boolean;
90 /**
91 * @description The session duration in seconds. The minimum value is 28800, which represents 8 hours;
92 * the max value is 315569520 or 10 years (that's a long Slack session).
93 */
94 duration?: number;
95}
96export interface AdminUsersSetAdminArguments extends TeamID, UserID, TokenOverridable {
97}
98export interface AdminUsersSetExpirationArguments extends UserID, TokenOverridable, OptionalTeamAssignable {
99 /** @description Epoch timestamp in seconds when guest account should be disabled. */
100 expiration_ts: number;
101}
102export interface AdminUsersSetOwnerArguments extends TeamID, UserID, TokenOverridable {
103}
104export interface AdminUsersSetRegularArguments extends TeamID, UserID, TokenOverridable {
105}
106export interface AdminUsersUnsupportedVersionsExportArguments extends TokenOverridable {
107 /**
108 * @description Unix timestamp of the date of past or upcoming end of support cycles.
109 * If not provided will include all announced end of support cycles. Defaults to `0`.
110 */
111 date_end_of_support?: number;
112 /**
113 * @description Unix timestamp of a date to start looking for user sessions.
114 * If not provided will start six months ago.
115 */
116 date_sessions_started?: number;
117}
118export {};
119//# sourceMappingURL=users.d.ts.map
\No newline at end of file