@mattermost/types 11.1.0-0 → 11.1.0-1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/lib/access_control.d.ts +71 -0
  2. package/lib/admin.d.ts +147 -0
  3. package/lib/apps.d.ts +191 -0
  4. package/lib/audits.d.ts +9 -0
  5. package/lib/autocomplete.d.ts +12 -0
  6. package/lib/bots.d.ts +15 -0
  7. package/lib/channel_bookmarks.d.ts +51 -0
  8. package/lib/channel_categories.d.ts +30 -0
  9. package/lib/channels.d.ts +190 -0
  10. package/lib/client4.d.ts +42 -0
  11. package/lib/cloud.d.ts +187 -0
  12. package/lib/compliance.d.ts +13 -0
  13. package/lib/config.d.ts +1035 -0
  14. package/lib/content_flagging.d.ts +24 -0
  15. package/lib/data_retention.d.ts +30 -0
  16. package/lib/drafts.d.ts +14 -0
  17. package/lib/emojis.d.ts +44 -0
  18. package/lib/errors.d.ts +8 -0
  19. package/lib/files.d.ts +41 -0
  20. package/lib/general.d.ts +16 -0
  21. package/lib/groups.d.ts +169 -0
  22. package/lib/hosted_customer.d.ts +7 -0
  23. package/lib/integration_actions.d.ts +20 -0
  24. package/lib/integrations.d.ts +187 -0
  25. package/lib/jobs.d.ts +23 -0
  26. package/lib/limits.d.ts +10 -0
  27. package/lib/marketplace.d.ts +42 -0
  28. package/lib/message_attachments.d.ts +24 -0
  29. package/lib/mfa.d.ts +4 -0
  30. package/lib/plugins.d.ts +136 -0
  31. package/lib/posts.d.ts +182 -0
  32. package/lib/preferences.d.ts +9 -0
  33. package/lib/product_notices.d.ts +26 -0
  34. package/lib/products.d.ts +8 -0
  35. package/lib/properties.d.ts +60 -0
  36. package/lib/reactions.d.ts +6 -0
  37. package/lib/remote_clusters.d.ts +35 -0
  38. package/lib/reports.d.ts +65 -0
  39. package/lib/requests.d.ts +53 -0
  40. package/lib/roles.d.ts +12 -0
  41. package/lib/saml.d.ts +10 -0
  42. package/lib/schedule_post.d.ts +27 -0
  43. package/lib/schemes.d.ts +29 -0
  44. package/lib/search.d.ts +29 -0
  45. package/lib/sessions.d.ts +15 -0
  46. package/lib/setup.d.ts +4 -0
  47. package/lib/shared_channels.d.ts +26 -0
  48. package/lib/store.d.ts +97 -0
  49. package/lib/teams.d.ts +99 -0
  50. package/lib/terms_of_service.d.ts +6 -0
  51. package/lib/threads.d.ts +63 -0
  52. package/lib/typing.d.ts +5 -0
  53. package/lib/users.d.ts +140 -0
  54. package/package.json +1 -1
@@ -0,0 +1,71 @@
1
+ import type { ChannelWithTeamData } from './channels';
2
+ import type { UserProfile } from './users';
3
+ export type AccessControlPolicy = {
4
+ id: string;
5
+ name: string;
6
+ type: string;
7
+ revision?: number;
8
+ created_at?: number;
9
+ version?: string;
10
+ active?: boolean;
11
+ imports?: string[];
12
+ props?: Record<string, unknown[]>;
13
+ rules: AccessControlPolicyRule[];
14
+ };
15
+ export type AccessControlPolicyCursor = {
16
+ id: string;
17
+ };
18
+ export type AccessControlPoliciesResult = {
19
+ policies: AccessControlPolicy[];
20
+ total: number;
21
+ };
22
+ export type AccessControlPolicySearchOpts = {
23
+ term: string;
24
+ type: string;
25
+ cursor: AccessControlPolicyCursor;
26
+ limit: number;
27
+ };
28
+ export type AccessControlPolicyChannelsResult = {
29
+ channels: ChannelWithTeamData[];
30
+ total: number;
31
+ };
32
+ export type AccessControlPolicyRule = {
33
+ actions?: string[];
34
+ expression: string;
35
+ };
36
+ export type CELExpressionError = {
37
+ message: string;
38
+ line: number;
39
+ column: number;
40
+ };
41
+ export type AccessControlTestResult = {
42
+ users: UserProfile[];
43
+ total: number;
44
+ };
45
+ export type AccessControlAttribute = {
46
+ name: string;
47
+ values: string[];
48
+ };
49
+ export type AccessControlVisualAST = {
50
+ conditions: AccessControlVisualASTNode[];
51
+ };
52
+ export type AccessControlVisualASTNode = {
53
+ attribute: string;
54
+ operator: string;
55
+ value: any;
56
+ value_type: number;
57
+ attribute_type: string;
58
+ };
59
+ /**
60
+ * Type definition for access control attributes
61
+ */
62
+ export type AccessControlAttributes = Record<string, string[]>;
63
+ /**
64
+ * Interface for entities that can have access control
65
+ */
66
+ export interface AccessControlled {
67
+ /**
68
+ * Whether access control is enforced for this entity
69
+ */
70
+ access_control_enforced?: boolean;
71
+ }
package/lib/admin.d.ts ADDED
@@ -0,0 +1,147 @@
1
+ import type { AccessControlPolicy } from './access_control';
2
+ import type { Audit } from './audits';
3
+ import type { Compliance } from './compliance';
4
+ import type { AdminConfig, ClientLicense, EnvironmentConfig } from './config';
5
+ import type { DataRetentionCustomPolicies } from './data_retention';
6
+ import type { MixedUnlinkedGroupRedux } from './groups';
7
+ import type { PluginRedux, PluginStatusRedux } from './plugins';
8
+ import type { SamlCertificateStatus, SamlMetadataResponse } from './saml';
9
+ import type { Team } from './teams';
10
+ import type { UserAccessToken, UserProfile } from './users';
11
+ import type { RelationOneToOne, IDMappedObjects } from './utilities';
12
+ export declare enum LogLevelEnum {
13
+ SILLY = "silly",
14
+ DEBUG = "debug",
15
+ INFO = "info",
16
+ WARN = "warn",
17
+ ERROR = "error"
18
+ }
19
+ export type LogServerNames = string[];
20
+ export type LogLevels = LogLevelEnum[];
21
+ export type LogDateFrom = string;
22
+ export type LogDateTo = string;
23
+ export type LogObject = {
24
+ caller: string;
25
+ job_id: string;
26
+ level: LogLevelEnum;
27
+ msg: string;
28
+ timestamp: string;
29
+ worker: string;
30
+ };
31
+ export type LogFilter = {
32
+ serverNames: LogServerNames;
33
+ logLevels: LogLevels;
34
+ dateFrom: LogDateFrom;
35
+ dateTo: LogDateTo;
36
+ };
37
+ export type LogFilterQuery = {
38
+ server_names: LogServerNames;
39
+ log_levels: LogLevels;
40
+ date_from: LogDateFrom;
41
+ date_to: LogDateTo;
42
+ };
43
+ export type AdminState = {
44
+ logs: LogObject[];
45
+ plainLogs: string[];
46
+ audits: Record<string, Audit>;
47
+ config: Partial<AdminConfig>;
48
+ environmentConfig: Partial<EnvironmentConfig>;
49
+ complianceReports: Record<string, Compliance>;
50
+ ldapGroups: Record<string, MixedUnlinkedGroupRedux>;
51
+ ldapGroupsCount: number;
52
+ userAccessTokens: Record<string, UserAccessToken>;
53
+ clusterInfo: ClusterInfo[];
54
+ samlCertStatus?: SamlCertificateStatus;
55
+ analytics: AnalyticsState;
56
+ teamAnalytics: RelationOneToOne<Team, AnalyticsState>;
57
+ userAccessTokensByUser?: RelationOneToOne<UserProfile, Record<string, UserAccessToken>>;
58
+ plugins?: Record<string, PluginRedux>;
59
+ pluginStatuses?: Record<string, PluginStatusRedux>;
60
+ samlMetadataResponse?: SamlMetadataResponse;
61
+ dataRetentionCustomPolicies: DataRetentionCustomPolicies;
62
+ dataRetentionCustomPoliciesCount: number;
63
+ prevTrialLicense: ClientLicense;
64
+ accessControlPolicies: IDMappedObjects<AccessControlPolicy>;
65
+ channelsForAccessControlPolicy: Record<string, string[]>;
66
+ };
67
+ export type AnalyticsState = {
68
+ POST_PER_DAY?: AnalyticsRow[];
69
+ BOT_POST_PER_DAY?: AnalyticsRow[];
70
+ USERS_WITH_POSTS_PER_DAY?: AnalyticsRow[];
71
+ TOTAL_PUBLIC_CHANNELS?: number;
72
+ TOTAL_PRIVATE_GROUPS?: number;
73
+ TOTAL_POSTS?: number;
74
+ TOTAL_USERS?: number;
75
+ TOTAL_INACTIVE_USERS?: number;
76
+ TOTAL_TEAMS?: number;
77
+ TOTAL_WEBSOCKET_CONNECTIONS?: number;
78
+ TOTAL_MASTER_DB_CONNECTIONS?: number;
79
+ TOTAL_READ_DB_CONNECTIONS?: number;
80
+ DAILY_ACTIVE_USERS?: number;
81
+ MONTHLY_ACTIVE_USERS?: number;
82
+ TOTAL_IHOOKS?: number;
83
+ TOTAL_OHOOKS?: number;
84
+ TOTAL_COMMANDS?: number;
85
+ TOTAL_SESSIONS?: number;
86
+ REGISTERED_USERS?: number;
87
+ TOTAL_FILE_COUNT?: number;
88
+ TOTAL_FILE_SIZE?: number;
89
+ };
90
+ export type ClusterInfo = {
91
+ id: string;
92
+ version: string;
93
+ config_hash: string;
94
+ ipaddress: string;
95
+ hostname: string;
96
+ schema_version: string;
97
+ };
98
+ export type AnalyticsRow = {
99
+ name: string;
100
+ value: number;
101
+ };
102
+ export type IndexedPluginAnalyticsRow = {
103
+ [key: string]: PluginAnalyticsRow;
104
+ };
105
+ export declare enum AnalyticsVisualizationType {
106
+ Count = "count",
107
+ LineChart = "line_chart",
108
+ DoughnutChart = "doughnut_chart"
109
+ }
110
+ export type PluginAnalyticsRow = {
111
+ id: string;
112
+ name: React.ReactNode;
113
+ icon?: string;
114
+ value: any;
115
+ visualizationType?: AnalyticsVisualizationType;
116
+ };
117
+ export type SchemaMigration = {
118
+ version: number;
119
+ name: string;
120
+ };
121
+ export type SupportPacketContent = {
122
+ id: string;
123
+ translation_id?: string;
124
+ label: string;
125
+ selected: boolean;
126
+ mandatory: boolean;
127
+ };
128
+ export type LdapSampleEntry = {
129
+ dn: string;
130
+ username?: string;
131
+ email?: string;
132
+ first_name?: string;
133
+ last_name?: string;
134
+ id?: string;
135
+ display_name?: string;
136
+ available_attributes?: Record<string, string>;
137
+ };
138
+ export type LdapDiagnosticResult = {
139
+ test_name: string;
140
+ test_value: string;
141
+ total_count: number;
142
+ entries_with_value: number;
143
+ message?: string;
144
+ error?: string;
145
+ sample_results: LdapSampleEntry[];
146
+ };
147
+ export type TestLdapFiltersResponse = LdapDiagnosticResult[];
package/lib/apps.d.ts ADDED
@@ -0,0 +1,191 @@
1
+ import { type ProductScope } from './products';
2
+ export declare enum Permission {
3
+ UserJoinedChannelNotification = "user_joined_channel_notification",
4
+ ActAsBot = "act_as_bot",
5
+ ActAsUser = "act_as_user",
6
+ PermissionActAsAdmin = "act_as_admin",
7
+ RemoteOAuth2 = "remote_oauth2",
8
+ RemoteWebhooks = "remote_webhooks"
9
+ }
10
+ export declare enum Locations {
11
+ PostMenu = "/post_menu",
12
+ ChannelHeader = "/channel_header",
13
+ Command = "/command",
14
+ InPost = "/in_post"
15
+ }
16
+ export type AppManifest = {
17
+ app_id: string;
18
+ version?: string;
19
+ homepage_url?: string;
20
+ icon?: string;
21
+ display_name: string;
22
+ description?: string;
23
+ requested_permissions?: Permission[];
24
+ requested_locations?: Locations[];
25
+ };
26
+ export type AppModalState = {
27
+ form: AppForm;
28
+ call: AppCallRequest;
29
+ };
30
+ export type AppCommandFormMap = {
31
+ [location: string]: AppForm;
32
+ };
33
+ export type BindingsInfo = {
34
+ bindings: AppBinding[];
35
+ forms: AppCommandFormMap;
36
+ };
37
+ export type AppsState = {
38
+ main: BindingsInfo;
39
+ rhs: BindingsInfo;
40
+ pluginEnabled: boolean;
41
+ };
42
+ export type AppBinding = {
43
+ app_id: string;
44
+ location?: string;
45
+ supported_product_ids?: ProductScope;
46
+ icon?: string;
47
+ label: string;
48
+ hint?: string;
49
+ description?: string;
50
+ role_id?: string;
51
+ depends_on_team?: boolean;
52
+ depends_on_channel?: boolean;
53
+ depends_on_user?: boolean;
54
+ depends_on_post?: boolean;
55
+ bindings?: AppBinding[];
56
+ form?: AppForm;
57
+ submit?: AppCall;
58
+ };
59
+ export declare function isAppBinding(obj: unknown): obj is AppBinding;
60
+ export type AppCallValues = {
61
+ [name: string]: any;
62
+ };
63
+ export type AppCall = {
64
+ path: string;
65
+ expand?: AppExpand;
66
+ state?: any;
67
+ };
68
+ export type AppCallRequest = AppCall & {
69
+ context: AppContext;
70
+ values?: AppCallValues;
71
+ raw_command?: string;
72
+ selected_field?: string;
73
+ query?: string;
74
+ };
75
+ export type AppCallResponseType = string;
76
+ export type AppCallResponse<Res = unknown> = {
77
+ type: AppCallResponseType;
78
+ text?: string;
79
+ data?: Res;
80
+ navigate_to_url?: string;
81
+ use_external_browser?: boolean;
82
+ call?: AppCall;
83
+ form?: AppForm;
84
+ app_metadata?: AppMetadataForClient;
85
+ };
86
+ export type AppMetadataForClient = {
87
+ bot_user_id: string;
88
+ bot_username: string;
89
+ };
90
+ export type AppContext = {
91
+ app_id: string;
92
+ location?: string;
93
+ acting_user_id?: string;
94
+ user_id?: string;
95
+ channel_id?: string;
96
+ team_id?: string;
97
+ post_id?: string;
98
+ root_id?: string;
99
+ props?: AppContextProps;
100
+ user_agent?: string;
101
+ track_as_submit?: boolean;
102
+ };
103
+ export type AppContextProps = {
104
+ [name: string]: string;
105
+ };
106
+ export type AppExpandLevel = '' | 'none' | 'summary' | '+summary' | 'all' | '+all' | 'id';
107
+ export type AppExpand = {
108
+ app?: AppExpandLevel;
109
+ acting_user?: AppExpandLevel;
110
+ acting_user_access_token?: AppExpandLevel;
111
+ channel?: AppExpandLevel;
112
+ config?: AppExpandLevel;
113
+ mentioned?: AppExpandLevel;
114
+ parent_post?: AppExpandLevel;
115
+ post?: AppExpandLevel;
116
+ root_post?: AppExpandLevel;
117
+ team?: AppExpandLevel;
118
+ user?: AppExpandLevel;
119
+ locale?: AppExpandLevel;
120
+ };
121
+ export type AppForm = {
122
+ title?: string;
123
+ header?: string;
124
+ footer?: string;
125
+ icon?: string;
126
+ submit_label?: string;
127
+ submit_buttons?: string;
128
+ cancel_button?: boolean;
129
+ submit_on_cancel?: boolean;
130
+ fields?: AppField[];
131
+ source?: AppCall;
132
+ submit?: AppCall;
133
+ depends_on?: string[];
134
+ };
135
+ export type AppFormValue = string | AppSelectOption | AppSelectOption[] | boolean | null;
136
+ export type AppFormValues = {
137
+ [name: string]: AppFormValue;
138
+ };
139
+ export type AppSelectOption = {
140
+ label: string;
141
+ value: string;
142
+ icon_data?: string;
143
+ };
144
+ export type AppFieldType = string;
145
+ export type AppField = {
146
+ name: string;
147
+ type: AppFieldType;
148
+ is_required?: boolean;
149
+ readonly?: boolean;
150
+ value?: AppFormValue;
151
+ description?: string;
152
+ label?: string;
153
+ hint?: string;
154
+ position?: number;
155
+ modal_label?: string;
156
+ refresh?: boolean;
157
+ options?: AppSelectOption[];
158
+ multiselect?: boolean;
159
+ lookup?: AppCall;
160
+ subtype?: string;
161
+ min_length?: number;
162
+ max_length?: number;
163
+ min_date?: string;
164
+ max_date?: string;
165
+ time_interval?: number;
166
+ };
167
+ export type AutocompleteSuggestion = {
168
+ suggestion: string;
169
+ complete?: string;
170
+ description?: string;
171
+ hint?: string;
172
+ iconData?: string;
173
+ };
174
+ export type AutocompleteSuggestionWithComplete = AutocompleteSuggestion & {
175
+ complete: string;
176
+ };
177
+ export type AutocompleteElement = AppField;
178
+ export type AutocompleteStaticSelect = AutocompleteElement & {
179
+ options: AppSelectOption[];
180
+ };
181
+ export type AutocompleteDynamicSelect = AutocompleteElement;
182
+ export type AutocompleteUserSelect = AutocompleteElement;
183
+ export type AutocompleteChannelSelect = AutocompleteElement;
184
+ export type FormResponseData = {
185
+ errors?: {
186
+ [field: string]: string;
187
+ };
188
+ };
189
+ export type AppLookupResponse = {
190
+ items: AppSelectOption[];
191
+ };
@@ -0,0 +1,9 @@
1
+ export type Audit = {
2
+ id: string;
3
+ create_at: number;
4
+ user_id: string;
5
+ action: string;
6
+ extra_info: string;
7
+ ip_address: string;
8
+ session_id: string;
9
+ };
@@ -0,0 +1,12 @@
1
+ import type { UserProfile } from './users';
2
+ export type UserAutocomplete = {
3
+ users: UserProfile[];
4
+ out_of_channel?: UserProfile[];
5
+ };
6
+ export type AutocompleteSuggestion = {
7
+ Complete: string;
8
+ Suggestion: string;
9
+ Hint: string;
10
+ Description: string;
11
+ IconData: string;
12
+ };
package/lib/bots.d.ts ADDED
@@ -0,0 +1,15 @@
1
+ export type Bot = {
2
+ user_id: string;
3
+ username: string;
4
+ display_name?: string;
5
+ description?: string;
6
+ owner_id: string;
7
+ create_at: number;
8
+ update_at: number;
9
+ delete_at: number;
10
+ };
11
+ export type BotPatch = {
12
+ username: string;
13
+ display_name: string;
14
+ description: string;
15
+ };
@@ -0,0 +1,51 @@
1
+ import type { Channel } from './channels';
2
+ import type { FileInfo } from './files';
3
+ import type { IDMappedObjects } from './utilities';
4
+ type ChannelBookmarkType = 'link' | 'file';
5
+ export type ChannelBookmark = {
6
+ id: string;
7
+ create_at: number;
8
+ update_at: number;
9
+ delete_at: number;
10
+ channel_id: string;
11
+ owner_id: string;
12
+ file_id?: string;
13
+ file?: FileInfo;
14
+ display_name: string;
15
+ sort_order: number;
16
+ link_url?: string;
17
+ image_url?: string;
18
+ emoji?: string;
19
+ type: ChannelBookmarkType;
20
+ original_id?: string;
21
+ parent_id?: string;
22
+ };
23
+ export type ChannelBookmarkCreate = {
24
+ display_name: string;
25
+ image_url?: string;
26
+ emoji?: string;
27
+ type: ChannelBookmarkType;
28
+ } & ({
29
+ type: 'link';
30
+ link_url: string;
31
+ } | {
32
+ type: 'file';
33
+ file_id: string;
34
+ });
35
+ export type ChannelBookmarkPatch = {
36
+ file_id?: string;
37
+ display_name?: string;
38
+ sort_order?: number;
39
+ link_url?: string;
40
+ image_url?: string;
41
+ emoji?: string;
42
+ };
43
+ export type ChannelBookmarkWithFileInfo = ChannelBookmark & {
44
+ file: FileInfo;
45
+ };
46
+ export type ChannelBookmarksState = {
47
+ byChannelId: {
48
+ [channelId: Channel['id']]: IDMappedObjects<ChannelBookmark>;
49
+ };
50
+ };
51
+ export {};
@@ -0,0 +1,30 @@
1
+ import type { Channel } from './channels';
2
+ import type { Team } from './teams';
3
+ import type { UserProfile } from './users';
4
+ import type { IDMappedObjects, RelationOneToOne } from './utilities';
5
+ export type ChannelCategoryType = 'favorites' | 'channels' | 'direct_messages' | 'custom';
6
+ export declare enum CategorySorting {
7
+ Alphabetical = "alpha",
8
+ Default = "",// behaves the same as manual
9
+ Recency = "recent",
10
+ Manual = "manual"
11
+ }
12
+ export type ChannelCategory = {
13
+ id: string;
14
+ user_id: UserProfile['id'];
15
+ team_id: Team['id'];
16
+ type: ChannelCategoryType;
17
+ display_name: string;
18
+ sorting: CategorySorting;
19
+ channel_ids: Array<Channel['id']>;
20
+ muted: boolean;
21
+ collapsed: boolean;
22
+ };
23
+ export type OrderedChannelCategories = {
24
+ categories: ChannelCategory[];
25
+ order: string[];
26
+ };
27
+ export type ChannelCategoriesState = {
28
+ byId: IDMappedObjects<ChannelCategory>;
29
+ orderByTeam: RelationOneToOne<Team, Array<ChannelCategory['id']>>;
30
+ };