UNPKG

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