@mattermost/types 6.7.0-0

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 (90) hide show
  1. package/README.md +53 -0
  2. package/lib/admin.d.ts +50 -0
  3. package/lib/admin.js +4 -0
  4. package/lib/apps.d.ts +182 -0
  5. package/lib/apps.js +24 -0
  6. package/lib/audits.d.ts +9 -0
  7. package/lib/audits.js +4 -0
  8. package/lib/autocomplete.d.ts +12 -0
  9. package/lib/autocomplete.js +4 -0
  10. package/lib/bots.d.ts +15 -0
  11. package/lib/bots.js +4 -0
  12. package/lib/channel_categories.d.ts +30 -0
  13. package/lib/channel_categories.js +12 -0
  14. package/lib/channels.d.ts +165 -0
  15. package/lib/channels.js +4 -0
  16. package/lib/client4.d.ts +41 -0
  17. package/lib/client4.js +12 -0
  18. package/lib/cloud.d.ts +102 -0
  19. package/lib/cloud.js +12 -0
  20. package/lib/compliance.d.ts +13 -0
  21. package/lib/compliance.js +4 -0
  22. package/lib/config.d.ts +781 -0
  23. package/lib/config.js +11 -0
  24. package/lib/data_retention.d.ts +30 -0
  25. package/lib/data_retention.js +4 -0
  26. package/lib/emojis.d.ts +28 -0
  27. package/lib/emojis.js +4 -0
  28. package/lib/errors.d.ts +12 -0
  29. package/lib/errors.js +4 -0
  30. package/lib/files.d.ts +37 -0
  31. package/lib/files.js +4 -0
  32. package/lib/general.d.ts +26 -0
  33. package/lib/general.js +24 -0
  34. package/lib/groups.d.ts +132 -0
  35. package/lib/groups.js +4 -0
  36. package/lib/integration_actions.d.ts +24 -0
  37. package/lib/integration_actions.js +4 -0
  38. package/lib/integrations.d.ts +150 -0
  39. package/lib/integrations.js +4 -0
  40. package/lib/jobs.d.ts +23 -0
  41. package/lib/jobs.js +2 -0
  42. package/lib/marketplace.d.ts +43 -0
  43. package/lib/marketplace.js +22 -0
  44. package/lib/message_attachments.d.ts +25 -0
  45. package/lib/message_attachments.js +4 -0
  46. package/lib/mfa.d.ts +4 -0
  47. package/lib/mfa.js +4 -0
  48. package/lib/plugins.d.ts +119 -0
  49. package/lib/plugins.js +22 -0
  50. package/lib/posts.d.ts +126 -0
  51. package/lib/posts.js +4 -0
  52. package/lib/preferences.d.ts +9 -0
  53. package/lib/preferences.js +4 -0
  54. package/lib/product_notices.d.ts +26 -0
  55. package/lib/product_notices.js +9 -0
  56. package/lib/reactions.d.ts +6 -0
  57. package/lib/reactions.js +2 -0
  58. package/lib/requests.d.ts +102 -0
  59. package/lib/requests.js +4 -0
  60. package/lib/roles.d.ts +13 -0
  61. package/lib/roles.js +2 -0
  62. package/lib/saml.d.ts +10 -0
  63. package/lib/saml.js +4 -0
  64. package/lib/schemes.d.ts +29 -0
  65. package/lib/schemes.js +2 -0
  66. package/lib/search.d.ts +27 -0
  67. package/lib/search.js +4 -0
  68. package/lib/sessions.d.ts +15 -0
  69. package/lib/sessions.js +4 -0
  70. package/lib/setup.d.ts +3 -0
  71. package/lib/setup.js +4 -0
  72. package/lib/store.d.ts +76 -0
  73. package/lib/store.js +4 -0
  74. package/lib/teams.d.ts +90 -0
  75. package/lib/teams.js +4 -0
  76. package/lib/terms_of_service.d.ts +6 -0
  77. package/lib/terms_of_service.js +4 -0
  78. package/lib/themes.d.ts +34 -0
  79. package/lib/themes.js +4 -0
  80. package/lib/threads.d.ts +59 -0
  81. package/lib/threads.js +13 -0
  82. package/lib/typing.d.ts +5 -0
  83. package/lib/typing.js +2 -0
  84. package/lib/users.d.ts +134 -0
  85. package/lib/users.js +16 -0
  86. package/lib/utilities.d.ts +25 -0
  87. package/lib/utilities.js +4 -0
  88. package/lib/websocket.d.ts +17 -0
  89. package/lib/websocket.js +4 -0
  90. package/package.json +34 -0
package/lib/teams.d.ts ADDED
@@ -0,0 +1,90 @@
1
+ import { ServerError } from './errors';
2
+ import { UserProfile } from './users';
3
+ import { RelationOneToOne } from './utilities';
4
+ export declare type TeamMembership = TeamUnread & {
5
+ user_id: string;
6
+ roles: string;
7
+ delete_at: number;
8
+ scheme_admin: boolean;
9
+ scheme_guest: boolean;
10
+ scheme_user: boolean;
11
+ };
12
+ export declare type TeamMemberWithError = {
13
+ member: TeamMembership;
14
+ user_id: string;
15
+ error: ServerError;
16
+ };
17
+ export declare type TeamType = 'O' | 'I';
18
+ export declare type Team = {
19
+ id: string;
20
+ create_at: number;
21
+ update_at: number;
22
+ delete_at: number;
23
+ display_name: string;
24
+ name: string;
25
+ description: string;
26
+ email: string;
27
+ type: TeamType;
28
+ company_name: string;
29
+ allowed_domains: string;
30
+ invite_id: string;
31
+ allow_open_invite: boolean;
32
+ scheme_id: string;
33
+ group_constrained: boolean;
34
+ policy_id?: string | null;
35
+ };
36
+ export declare type TeamsState = {
37
+ currentTeamId: string;
38
+ teams: Record<string, Team>;
39
+ myMembers: Record<string, TeamMembership>;
40
+ membersInTeam: RelationOneToOne<Team, RelationOneToOne<UserProfile, TeamMembership>>;
41
+ stats: RelationOneToOne<Team, TeamStats>;
42
+ groupsAssociatedToTeam: any;
43
+ totalCount: number;
44
+ };
45
+ export declare type TeamUnread = {
46
+ team_id: string;
47
+ /** The number of unread mentions in channels on this team, not including DMs and GMs */
48
+ mention_count: number;
49
+ /** The number of unread mentions in root posts in channels on this team, not including DMs and GMs */
50
+ mention_count_root: number;
51
+ /**
52
+ * The number of unread posts in channels on this team, not including DMs and GMs
53
+ *
54
+ * @remarks Note that this differs from ChannelMembership.msg_count and ChannelUnread.msg_count since it tracks
55
+ * unread posts instead of read posts.
56
+ */
57
+ msg_count: number;
58
+ /**
59
+ * The number of unread root posts in channels on this team, not including DMs and GMs
60
+ *
61
+ * @remarks Note that this differs from ChannelMember.msg_count_root and ChannelUnread.msg_count_root since it
62
+ * tracks unread posts instead of read posts.
63
+ */
64
+ msg_count_root: number;
65
+ thread_count?: number;
66
+ thread_mention_count?: number;
67
+ };
68
+ export declare type GetTeamMembersOpts = {
69
+ sort?: 'Username';
70
+ exclude_deleted_users?: boolean;
71
+ };
72
+ export declare type TeamsWithCount = {
73
+ teams: Team[];
74
+ total_count: number;
75
+ };
76
+ export declare type TeamStats = {
77
+ team_id: string;
78
+ total_member_count: number;
79
+ active_member_count: number;
80
+ };
81
+ export declare type TeamSearchOpts = {
82
+ page?: number;
83
+ per_page?: number;
84
+ allow_open_invite?: boolean;
85
+ group_constrained?: boolean;
86
+ };
87
+ export declare type TeamInviteWithError = {
88
+ email: string;
89
+ error: ServerError;
90
+ };
package/lib/teams.js ADDED
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
3
+ // See LICENSE.txt for license information.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,6 @@
1
+ export declare type TermsOfService = {
2
+ id: string;
3
+ create_at: number;
4
+ user_id: string;
5
+ text: string;
6
+ };
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
3
+ // See LICENSE.txt for license information.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,34 @@
1
+ export declare type LegacyThemeKey = 'default' | 'organization' | 'mattermostDark' | 'windows10';
2
+ export declare type ThemeKey = 'denim' | 'sapphire' | 'quartz' | 'indigo' | 'onyx';
3
+ export declare type LegacyThemeType = 'Mattermost' | 'Organization' | 'Mattermost Dark' | 'Windows Dark';
4
+ export declare type ThemeType = 'Denim' | 'Sapphire' | 'Quartz' | 'Indigo' | 'Onyx';
5
+ export declare type Theme = {
6
+ [key: string]: string | undefined;
7
+ type?: ThemeType | 'custom';
8
+ sidebarBg: string;
9
+ sidebarText: string;
10
+ sidebarUnreadText: string;
11
+ sidebarTextHoverBg: string;
12
+ sidebarTextActiveBorder: string;
13
+ sidebarTextActiveColor: string;
14
+ sidebarHeaderBg: string;
15
+ sidebarTeamBarBg: string;
16
+ sidebarHeaderTextColor: string;
17
+ onlineIndicator: string;
18
+ awayIndicator: string;
19
+ dndIndicator: string;
20
+ mentionBg: string;
21
+ mentionBj: string;
22
+ mentionColor: string;
23
+ centerChannelBg: string;
24
+ centerChannelColor: string;
25
+ newMessageSeparator: string;
26
+ linkColor: string;
27
+ buttonBg: string;
28
+ buttonColor: string;
29
+ errorTextColor: string;
30
+ mentionHighlightBg: string;
31
+ mentionHighlightLink: string;
32
+ codeTheme: string;
33
+ };
34
+ export declare type ThemeTypeMap = Record<ThemeType | LegacyThemeType, ThemeKey>;
package/lib/themes.js ADDED
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
3
+ // See LICENSE.txt for license information.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,59 @@
1
+ import type { Post } from './posts';
2
+ import type { Team } from './teams';
3
+ import type { Channel } from './channels';
4
+ import type { UserProfile } from './users';
5
+ import type { IDMappedObjects, RelationOneToMany, RelationOneToOne } from './utilities';
6
+ export declare enum UserThreadType {
7
+ Synthetic = "S"
8
+ }
9
+ export declare type UserThread = {
10
+ id: string;
11
+ reply_count: number;
12
+ last_reply_at: number;
13
+ last_viewed_at: number;
14
+ participants: Array<{
15
+ id: UserProfile['id'];
16
+ } | UserProfile>;
17
+ unread_replies: number;
18
+ unread_mentions: number;
19
+ is_following: boolean;
20
+ type?: UserThreadType;
21
+ /**
22
+ * only depend on channel_id and user_id for UserThread<>Channel/User mapping,
23
+ * use normalized post store/selectors as those are kept up-to-date in the store
24
+ */
25
+ post: {
26
+ channel_id: Channel['id'];
27
+ user_id: UserProfile['id'];
28
+ };
29
+ };
30
+ declare type SyntheticMissingKeys = 'unread_replies' | 'unread_mentions' | 'last_viewed_at';
31
+ export declare type UserThreadSynthetic = Omit<UserThread, SyntheticMissingKeys> & {
32
+ type: UserThreadType.Synthetic;
33
+ };
34
+ export declare function threadIsSynthetic(thread: UserThread | UserThreadSynthetic): thread is UserThreadSynthetic;
35
+ export declare type UserThreadWithPost = UserThread & {
36
+ post: Post;
37
+ };
38
+ export declare type UserThreadList = {
39
+ total: number;
40
+ total_unread_threads: number;
41
+ total_unread_mentions: number;
42
+ threads: UserThreadWithPost[];
43
+ };
44
+ export declare type ThreadsState = {
45
+ threadsInTeam: RelationOneToMany<Team, UserThread>;
46
+ unreadThreadsInTeam: RelationOneToMany<Team, UserThread>;
47
+ threads: IDMappedObjects<UserThread>;
48
+ counts: RelationOneToOne<Team, {
49
+ total: number;
50
+ total_unread_threads: number;
51
+ total_unread_mentions: number;
52
+ }>;
53
+ countsIncludingDirect: RelationOneToOne<Team, {
54
+ total: number;
55
+ total_unread_threads: number;
56
+ total_unread_mentions: number;
57
+ }>;
58
+ };
59
+ export {};
package/lib/threads.js ADDED
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
3
+ // See LICENSE.txt for license information.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.threadIsSynthetic = exports.UserThreadType = void 0;
6
+ var UserThreadType;
7
+ (function (UserThreadType) {
8
+ UserThreadType["Synthetic"] = "S"; // derived from post
9
+ })(UserThreadType = exports.UserThreadType || (exports.UserThreadType = {}));
10
+ function threadIsSynthetic(thread) {
11
+ return thread.type === UserThreadType.Synthetic;
12
+ }
13
+ exports.threadIsSynthetic = threadIsSynthetic;
@@ -0,0 +1,5 @@
1
+ export declare type Typing = {
2
+ [x: string]: {
3
+ [x: string]: number;
4
+ };
5
+ };
package/lib/typing.js ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/lib/users.d.ts ADDED
@@ -0,0 +1,134 @@
1
+ import { Audit } from './audits';
2
+ import { Channel } from './channels';
3
+ import { Group } from './groups';
4
+ import { PostType } from './posts';
5
+ import { Session } from './sessions';
6
+ import { Team } from './teams';
7
+ import { IDMappedObjects, RelationOneToMany, RelationOneToManyUnique, RelationOneToOne } from './utilities';
8
+ export declare type UserNotifyProps = {
9
+ desktop: 'default' | 'all' | 'mention' | 'none';
10
+ desktop_sound: 'true' | 'false';
11
+ email: 'true' | 'false';
12
+ mark_unread: 'all' | 'mention';
13
+ push: 'default' | 'all' | 'mention' | 'none';
14
+ push_status: 'ooo' | 'offline' | 'away' | 'dnd' | 'online';
15
+ comments: 'never' | 'root' | 'any';
16
+ first_name: 'true' | 'false';
17
+ channel: 'true' | 'false';
18
+ mention_keys: string;
19
+ };
20
+ export declare type UserProfile = {
21
+ id: string;
22
+ create_at: number;
23
+ update_at: number;
24
+ delete_at: number;
25
+ username: string;
26
+ password: string;
27
+ auth_data: string;
28
+ auth_service: string;
29
+ email: string;
30
+ email_verified: boolean;
31
+ nickname: string;
32
+ first_name: string;
33
+ last_name: string;
34
+ position: string;
35
+ roles: string;
36
+ allow_marketing: boolean;
37
+ props: Record<string, string>;
38
+ notify_props: UserNotifyProps;
39
+ last_password_update: number;
40
+ last_picture_update: number;
41
+ failed_attempts: number;
42
+ locale: string;
43
+ timezone?: UserTimezone;
44
+ mfa_active: boolean;
45
+ mfa_secret: string;
46
+ last_activity_at: number;
47
+ is_bot: boolean;
48
+ bot_description: string;
49
+ bot_last_icon_update: number;
50
+ terms_of_service_id: string;
51
+ terms_of_service_create_at: number;
52
+ remote_id?: string;
53
+ status?: string;
54
+ };
55
+ export declare type UserProfileWithLastViewAt = UserProfile & {
56
+ last_viewed_at: number;
57
+ };
58
+ export declare type UsersState = {
59
+ currentUserId: string;
60
+ isManualStatus: RelationOneToOne<UserProfile, boolean>;
61
+ mySessions: Session[];
62
+ myAudits: Audit[];
63
+ profiles: IDMappedObjects<UserProfile>;
64
+ profilesInTeam: RelationOneToMany<Team, UserProfile>;
65
+ profilesNotInTeam: RelationOneToMany<Team, UserProfile>;
66
+ profilesWithoutTeam: Set<string>;
67
+ profilesInChannel: RelationOneToManyUnique<Channel, UserProfile>;
68
+ profilesNotInChannel: RelationOneToManyUnique<Channel, UserProfile>;
69
+ profilesInGroup: RelationOneToMany<Group, UserProfile>;
70
+ profilesNotInGroup: RelationOneToMany<Group, UserProfile>;
71
+ statuses: RelationOneToOne<UserProfile, string>;
72
+ stats: RelationOneToOne<UserProfile, UsersStats>;
73
+ filteredStats?: UsersStats;
74
+ myUserAccessTokens: Record<string, UserAccessToken>;
75
+ };
76
+ export declare type UserTimezone = {
77
+ useAutomaticTimezone: boolean | string;
78
+ automaticTimezone: string;
79
+ manualTimezone: string;
80
+ };
81
+ export declare type UserActivity = {
82
+ [postType in PostType]: {
83
+ [userId in UserProfile['id']]: {
84
+ ids: Array<UserProfile['id']>;
85
+ usernames: Array<UserProfile['username']>;
86
+ } | Array<UserProfile['id']>;
87
+ };
88
+ };
89
+ export declare type UserStatus = {
90
+ user_id: string;
91
+ status: string;
92
+ manual?: boolean;
93
+ last_activity_at?: number;
94
+ active_channel?: string;
95
+ dnd_end_time?: number;
96
+ };
97
+ export declare enum CustomStatusDuration {
98
+ DONT_CLEAR = "",
99
+ THIRTY_MINUTES = "thirty_minutes",
100
+ ONE_HOUR = "one_hour",
101
+ FOUR_HOURS = "four_hours",
102
+ TODAY = "today",
103
+ THIS_WEEK = "this_week",
104
+ DATE_AND_TIME = "date_and_time",
105
+ CUSTOM_DATE_TIME = "custom_date_time"
106
+ }
107
+ export declare type UserCustomStatus = {
108
+ emoji: string;
109
+ text: string;
110
+ duration: CustomStatusDuration;
111
+ expires_at?: string;
112
+ };
113
+ export declare type UserAccessToken = {
114
+ id: string;
115
+ token?: string;
116
+ user_id: string;
117
+ description: string;
118
+ is_active: boolean;
119
+ };
120
+ export declare type UsersStats = {
121
+ total_users_count: number;
122
+ };
123
+ export declare type GetFilteredUsersStatsOpts = {
124
+ in_team?: string;
125
+ in_channel?: string;
126
+ include_deleted?: boolean;
127
+ include_bots?: boolean;
128
+ roles?: string[];
129
+ channel_roles?: string[];
130
+ team_roles?: string[];
131
+ };
132
+ export declare type AuthChangeResponse = {
133
+ follow_link: string;
134
+ };
package/lib/users.js ADDED
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
3
+ // See LICENSE.txt for license information.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.CustomStatusDuration = void 0;
6
+ var CustomStatusDuration;
7
+ (function (CustomStatusDuration) {
8
+ CustomStatusDuration["DONT_CLEAR"] = "";
9
+ CustomStatusDuration["THIRTY_MINUTES"] = "thirty_minutes";
10
+ CustomStatusDuration["ONE_HOUR"] = "one_hour";
11
+ CustomStatusDuration["FOUR_HOURS"] = "four_hours";
12
+ CustomStatusDuration["TODAY"] = "today";
13
+ CustomStatusDuration["THIS_WEEK"] = "this_week";
14
+ CustomStatusDuration["DATE_AND_TIME"] = "date_and_time";
15
+ CustomStatusDuration["CUSTOM_DATE_TIME"] = "custom_date_time";
16
+ })(CustomStatusDuration = exports.CustomStatusDuration || (exports.CustomStatusDuration = {}));
@@ -0,0 +1,25 @@
1
+ export declare type RelationOneToOne<E extends {
2
+ id: string;
3
+ }, T> = {
4
+ [x in E['id']]: T;
5
+ };
6
+ export declare type RelationOneToMany<E1 extends {
7
+ id: string;
8
+ }, E2 extends {
9
+ id: string;
10
+ }> = {
11
+ [x in E1['id']]: Array<E2['id']>;
12
+ };
13
+ export declare type RelationOneToManyUnique<E1 extends {
14
+ id: string;
15
+ }, E2 extends {
16
+ id: string;
17
+ }> = {
18
+ [x in E1['id']]: Set<E2['id']>;
19
+ };
20
+ export declare type IDMappedObjects<E extends {
21
+ id: string;
22
+ }> = RelationOneToOne<E, E>;
23
+ export declare type DeepPartial<T> = {
24
+ [P in keyof T]?: DeepPartial<T[P]>;
25
+ };
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
3
+ // See LICENSE.txt for license information.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,17 @@
1
+ export declare type WebSocketBroadcast = {
2
+ omit_users: Record<string, boolean>;
3
+ user_id: string;
4
+ channel_id: string;
5
+ team_id: string;
6
+ };
7
+ export declare type WebSocketMessage<T> = {
8
+ event: string;
9
+ data: T;
10
+ broadcast: WebSocketBroadcast;
11
+ seq: number;
12
+ };
13
+ export declare type WebsocketStatus = {
14
+ connected: boolean;
15
+ lastConnectAt: number;
16
+ lastDisconnectAt: number;
17
+ };
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
3
+ // See LICENSE.txt for license information.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json ADDED
@@ -0,0 +1,34 @@
1
+ {
2
+ "name": "@mattermost/types",
3
+ "version": "6.7.0-0",
4
+ "description": "Shared type definitions used by the Mattermost web app",
5
+ "keywords": [
6
+ "mattermost"
7
+ ],
8
+ "homepage": "https://github.com/mattermost/mattermost-webapp/tree/master/packages/types#readme",
9
+ "license": "MIT",
10
+ "files": [
11
+ "lib"
12
+ ],
13
+ "exports": {
14
+ "./*": "./lib/*.js"
15
+ },
16
+ "types": "./lib/*.d.ts",
17
+ "respository": {
18
+ "type": "git",
19
+ "url": "github:mattermost/mattermost-webapp",
20
+ "directory": "packages/types"
21
+ },
22
+ "peerDependencies": {
23
+ "typescript": "^4.3"
24
+ },
25
+ "peerDependenciesMeta": {
26
+ "typescript": {
27
+ "optional": true
28
+ }
29
+ },
30
+ "scripts": {
31
+ "build": "tsc -b -v",
32
+ "clean": "rm -rf tsconfig.tsbuildinfo ./lib"
33
+ }
34
+ }