@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.
- package/README.md +53 -0
- package/lib/admin.d.ts +50 -0
- package/lib/admin.js +4 -0
- package/lib/apps.d.ts +182 -0
- package/lib/apps.js +24 -0
- package/lib/audits.d.ts +9 -0
- package/lib/audits.js +4 -0
- package/lib/autocomplete.d.ts +12 -0
- package/lib/autocomplete.js +4 -0
- package/lib/bots.d.ts +15 -0
- package/lib/bots.js +4 -0
- package/lib/channel_categories.d.ts +30 -0
- package/lib/channel_categories.js +12 -0
- package/lib/channels.d.ts +165 -0
- package/lib/channels.js +4 -0
- package/lib/client4.d.ts +41 -0
- package/lib/client4.js +12 -0
- package/lib/cloud.d.ts +102 -0
- package/lib/cloud.js +12 -0
- package/lib/compliance.d.ts +13 -0
- package/lib/compliance.js +4 -0
- package/lib/config.d.ts +781 -0
- package/lib/config.js +11 -0
- package/lib/data_retention.d.ts +30 -0
- package/lib/data_retention.js +4 -0
- package/lib/emojis.d.ts +28 -0
- package/lib/emojis.js +4 -0
- package/lib/errors.d.ts +12 -0
- package/lib/errors.js +4 -0
- package/lib/files.d.ts +37 -0
- package/lib/files.js +4 -0
- package/lib/general.d.ts +26 -0
- package/lib/general.js +24 -0
- package/lib/groups.d.ts +132 -0
- package/lib/groups.js +4 -0
- package/lib/integration_actions.d.ts +24 -0
- package/lib/integration_actions.js +4 -0
- package/lib/integrations.d.ts +150 -0
- package/lib/integrations.js +4 -0
- package/lib/jobs.d.ts +23 -0
- package/lib/jobs.js +2 -0
- package/lib/marketplace.d.ts +43 -0
- package/lib/marketplace.js +22 -0
- package/lib/message_attachments.d.ts +25 -0
- package/lib/message_attachments.js +4 -0
- package/lib/mfa.d.ts +4 -0
- package/lib/mfa.js +4 -0
- package/lib/plugins.d.ts +119 -0
- package/lib/plugins.js +22 -0
- package/lib/posts.d.ts +126 -0
- package/lib/posts.js +4 -0
- package/lib/preferences.d.ts +9 -0
- package/lib/preferences.js +4 -0
- package/lib/product_notices.d.ts +26 -0
- package/lib/product_notices.js +9 -0
- package/lib/reactions.d.ts +6 -0
- package/lib/reactions.js +2 -0
- package/lib/requests.d.ts +102 -0
- package/lib/requests.js +4 -0
- package/lib/roles.d.ts +13 -0
- package/lib/roles.js +2 -0
- package/lib/saml.d.ts +10 -0
- package/lib/saml.js +4 -0
- package/lib/schemes.d.ts +29 -0
- package/lib/schemes.js +2 -0
- package/lib/search.d.ts +27 -0
- package/lib/search.js +4 -0
- package/lib/sessions.d.ts +15 -0
- package/lib/sessions.js +4 -0
- package/lib/setup.d.ts +3 -0
- package/lib/setup.js +4 -0
- package/lib/store.d.ts +76 -0
- package/lib/store.js +4 -0
- package/lib/teams.d.ts +90 -0
- package/lib/teams.js +4 -0
- package/lib/terms_of_service.d.ts +6 -0
- package/lib/terms_of_service.js +4 -0
- package/lib/themes.d.ts +34 -0
- package/lib/themes.js +4 -0
- package/lib/threads.d.ts +59 -0
- package/lib/threads.js +13 -0
- package/lib/typing.d.ts +5 -0
- package/lib/typing.js +2 -0
- package/lib/users.d.ts +134 -0
- package/lib/users.js +16 -0
- package/lib/utilities.d.ts +25 -0
- package/lib/utilities.js +4 -0
- package/lib/websocket.d.ts +17 -0
- package/lib/websocket.js +4 -0
- package/package.json +34 -0
package/README.md
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Mattermost Types
|
|
2
|
+
|
|
3
|
+
This package contains shared type definitions used by [the Mattermost web app](https://github.com/mattermost/mattermost-webapp) and related projects.
|
|
4
|
+
|
|
5
|
+
**It is currently a work in progress and contains internal types that will be removed in a followup release.**
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
For technologies that support [subpath exports](https://nodejs.org/api/packages.html#subpath-exports), such as Node.js, Webpack, and Babel, you can import these types directly from individual files.
|
|
10
|
+
|
|
11
|
+
```javascript
|
|
12
|
+
import {UserProfile} from '@mattermost/types/users';
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
For technologies that don't support that yet, you can add an alias in its package resolution settings to support that.
|
|
16
|
+
|
|
17
|
+
### TypeScript
|
|
18
|
+
|
|
19
|
+
In the `tsconfig.json`, you can use `compilerOptions.paths` to add that alias. This also requires a `compilerOptions.baseUrl` if you haven't set that already.
|
|
20
|
+
|
|
21
|
+
```json
|
|
22
|
+
{
|
|
23
|
+
"compilerOptions": {
|
|
24
|
+
"baseUrl": ".",
|
|
25
|
+
"paths": {
|
|
26
|
+
"@mattermost/types/*": ["node_modules/@mattermost/types/lib/*"]
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Jest
|
|
33
|
+
|
|
34
|
+
In your Jest config, you can use the `moduleNameMapper` field to add that alias.
|
|
35
|
+
|
|
36
|
+
```json
|
|
37
|
+
{
|
|
38
|
+
"moduleNameMapper": {
|
|
39
|
+
"^@mattermost/types/(.*)$": "<rootDir>/node_modules/@mattermost/types/lib/$1"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Compilation and Packaging
|
|
45
|
+
|
|
46
|
+
As a member of Mattermost with write access to our NPM organization, you can build and publish this package by running the following commands:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
npm run build --workspace=packages/types
|
|
50
|
+
npm publish --workspace=packages/types
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Make sure to increment the version number in `package.json` first! You can add `-0`, `-1`, etc for pre-release versions.
|
package/lib/admin.d.ts
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Audit } from './audits';
|
|
2
|
+
import { Compliance } from './compliance';
|
|
3
|
+
import { AdminConfig, ClientLicense, EnvironmentConfig } from './config';
|
|
4
|
+
import { DataRetentionCustomPolicies } from './data_retention';
|
|
5
|
+
import { MixedUnlinkedGroupRedux } from './groups';
|
|
6
|
+
import { PluginRedux, PluginStatusRedux } from './plugins';
|
|
7
|
+
import { SamlCertificateStatus, SamlMetadataResponse } from './saml';
|
|
8
|
+
import { Team } from './teams';
|
|
9
|
+
import { UserAccessToken, UserProfile } from './users';
|
|
10
|
+
import { RelationOneToOne } from './utilities';
|
|
11
|
+
export declare type ConsoleAccess = {
|
|
12
|
+
read: Record<string, boolean>;
|
|
13
|
+
write: Record<string, boolean>;
|
|
14
|
+
};
|
|
15
|
+
export declare type AdminState = {
|
|
16
|
+
logs: string[];
|
|
17
|
+
audits: Record<string, Audit>;
|
|
18
|
+
config: Partial<AdminConfig>;
|
|
19
|
+
environmentConfig: Partial<EnvironmentConfig>;
|
|
20
|
+
complianceReports: Record<string, Compliance>;
|
|
21
|
+
ldapGroups: Record<string, MixedUnlinkedGroupRedux>;
|
|
22
|
+
ldapGroupsCount: number;
|
|
23
|
+
userAccessTokens: Record<string, UserAccessToken>;
|
|
24
|
+
clusterInfo: ClusterInfo[];
|
|
25
|
+
samlCertStatus?: SamlCertificateStatus;
|
|
26
|
+
analytics?: Record<string, number | AnalyticsRow[]>;
|
|
27
|
+
teamAnalytics?: RelationOneToOne<Team, Record<string, number | AnalyticsRow[]>>;
|
|
28
|
+
userAccessTokensByUser?: RelationOneToOne<UserProfile, Record<string, UserAccessToken>>;
|
|
29
|
+
plugins?: Record<string, PluginRedux>;
|
|
30
|
+
pluginStatuses?: Record<string, PluginStatusRedux>;
|
|
31
|
+
samlMetadataResponse?: SamlMetadataResponse;
|
|
32
|
+
dataRetentionCustomPolicies: DataRetentionCustomPolicies;
|
|
33
|
+
dataRetentionCustomPoliciesCount: number;
|
|
34
|
+
prevTrialLicense: ClientLicense;
|
|
35
|
+
};
|
|
36
|
+
export declare type ClusterInfo = {
|
|
37
|
+
id: string;
|
|
38
|
+
version: string;
|
|
39
|
+
config_hash: string;
|
|
40
|
+
ipaddress: string;
|
|
41
|
+
hostname: string;
|
|
42
|
+
};
|
|
43
|
+
export declare type AnalyticsRow = {
|
|
44
|
+
name: string;
|
|
45
|
+
value: number;
|
|
46
|
+
};
|
|
47
|
+
export declare type SchemaMigration = {
|
|
48
|
+
version: number;
|
|
49
|
+
name: string;
|
|
50
|
+
};
|
package/lib/admin.js
ADDED
package/lib/apps.d.ts
ADDED
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
export declare enum Permission {
|
|
2
|
+
UserJoinedChannelNotification = "user_joined_channel_notification",
|
|
3
|
+
ActAsBot = "act_as_bot",
|
|
4
|
+
ActAsUser = "act_as_user",
|
|
5
|
+
PermissionActAsAdmin = "act_as_admin",
|
|
6
|
+
RemoteOAuth2 = "remote_oauth2",
|
|
7
|
+
RemoteWebhooks = "remote_webhooks"
|
|
8
|
+
}
|
|
9
|
+
export declare enum Locations {
|
|
10
|
+
PostMenu = "/post_menu",
|
|
11
|
+
ChannelHeader = "/channel_header",
|
|
12
|
+
Command = "/command",
|
|
13
|
+
InPost = "/in_post"
|
|
14
|
+
}
|
|
15
|
+
export declare type AppManifest = {
|
|
16
|
+
app_id: string;
|
|
17
|
+
version?: string;
|
|
18
|
+
homepage_url?: string;
|
|
19
|
+
icon?: string;
|
|
20
|
+
display_name: string;
|
|
21
|
+
description?: string;
|
|
22
|
+
requested_permissions?: Permission[];
|
|
23
|
+
requested_locations?: Locations[];
|
|
24
|
+
};
|
|
25
|
+
export declare type AppModalState = {
|
|
26
|
+
form: AppForm;
|
|
27
|
+
call: AppCallRequest;
|
|
28
|
+
};
|
|
29
|
+
export declare type AppCommandFormMap = {
|
|
30
|
+
[location: string]: AppForm;
|
|
31
|
+
};
|
|
32
|
+
export declare type BindingsInfo = {
|
|
33
|
+
bindings: AppBinding[];
|
|
34
|
+
forms: AppCommandFormMap;
|
|
35
|
+
};
|
|
36
|
+
export declare type AppsState = {
|
|
37
|
+
main: BindingsInfo;
|
|
38
|
+
rhs: BindingsInfo;
|
|
39
|
+
pluginEnabled: boolean;
|
|
40
|
+
};
|
|
41
|
+
export declare type AppBinding = {
|
|
42
|
+
app_id: string;
|
|
43
|
+
location?: string;
|
|
44
|
+
icon?: string;
|
|
45
|
+
label: string;
|
|
46
|
+
hint?: string;
|
|
47
|
+
description?: string;
|
|
48
|
+
role_id?: string;
|
|
49
|
+
depends_on_team?: boolean;
|
|
50
|
+
depends_on_channel?: boolean;
|
|
51
|
+
depends_on_user?: boolean;
|
|
52
|
+
depends_on_post?: boolean;
|
|
53
|
+
bindings?: AppBinding[];
|
|
54
|
+
form?: AppForm;
|
|
55
|
+
submit?: AppCall;
|
|
56
|
+
};
|
|
57
|
+
export declare type AppCallValues = {
|
|
58
|
+
[name: string]: any;
|
|
59
|
+
};
|
|
60
|
+
export declare type AppCall = {
|
|
61
|
+
path: string;
|
|
62
|
+
expand?: AppExpand;
|
|
63
|
+
state?: any;
|
|
64
|
+
};
|
|
65
|
+
export declare type AppCallRequest = AppCall & {
|
|
66
|
+
context: AppContext;
|
|
67
|
+
values?: AppCallValues;
|
|
68
|
+
raw_command?: string;
|
|
69
|
+
selected_field?: string;
|
|
70
|
+
query?: string;
|
|
71
|
+
};
|
|
72
|
+
export declare type AppCallResponseType = string;
|
|
73
|
+
export declare type AppCallResponse<Res = unknown> = {
|
|
74
|
+
type: AppCallResponseType;
|
|
75
|
+
text?: string;
|
|
76
|
+
data?: Res;
|
|
77
|
+
navigate_to_url?: string;
|
|
78
|
+
use_external_browser?: boolean;
|
|
79
|
+
call?: AppCall;
|
|
80
|
+
form?: AppForm;
|
|
81
|
+
app_metadata?: AppMetadataForClient;
|
|
82
|
+
};
|
|
83
|
+
export declare type AppMetadataForClient = {
|
|
84
|
+
bot_user_id: string;
|
|
85
|
+
bot_username: string;
|
|
86
|
+
};
|
|
87
|
+
export declare type AppContext = {
|
|
88
|
+
app_id: string;
|
|
89
|
+
location?: string;
|
|
90
|
+
acting_user_id?: string;
|
|
91
|
+
user_id?: string;
|
|
92
|
+
channel_id?: string;
|
|
93
|
+
team_id?: string;
|
|
94
|
+
post_id?: string;
|
|
95
|
+
root_id?: string;
|
|
96
|
+
props?: AppContextProps;
|
|
97
|
+
user_agent?: string;
|
|
98
|
+
track_as_submit?: boolean;
|
|
99
|
+
};
|
|
100
|
+
export declare type AppContextProps = {
|
|
101
|
+
[name: string]: string;
|
|
102
|
+
};
|
|
103
|
+
export declare type AppExpandLevel = string;
|
|
104
|
+
export declare type AppExpand = {
|
|
105
|
+
app?: AppExpandLevel;
|
|
106
|
+
acting_user?: AppExpandLevel;
|
|
107
|
+
channel?: AppExpandLevel;
|
|
108
|
+
config?: AppExpandLevel;
|
|
109
|
+
mentioned?: AppExpandLevel;
|
|
110
|
+
parent_post?: AppExpandLevel;
|
|
111
|
+
post?: AppExpandLevel;
|
|
112
|
+
root_post?: AppExpandLevel;
|
|
113
|
+
team?: AppExpandLevel;
|
|
114
|
+
user?: AppExpandLevel;
|
|
115
|
+
};
|
|
116
|
+
export declare type AppForm = {
|
|
117
|
+
title?: string;
|
|
118
|
+
header?: string;
|
|
119
|
+
footer?: string;
|
|
120
|
+
icon?: string;
|
|
121
|
+
submit_buttons?: string;
|
|
122
|
+
cancel_button?: boolean;
|
|
123
|
+
submit_on_cancel?: boolean;
|
|
124
|
+
fields?: AppField[];
|
|
125
|
+
source?: AppCall;
|
|
126
|
+
submit?: AppCall;
|
|
127
|
+
depends_on?: string[];
|
|
128
|
+
};
|
|
129
|
+
export declare type AppFormValue = string | AppSelectOption | boolean | null;
|
|
130
|
+
export declare type AppFormValues = {
|
|
131
|
+
[name: string]: AppFormValue;
|
|
132
|
+
};
|
|
133
|
+
export declare type AppSelectOption = {
|
|
134
|
+
label: string;
|
|
135
|
+
value: string;
|
|
136
|
+
icon_data?: string;
|
|
137
|
+
};
|
|
138
|
+
export declare type AppFieldType = string;
|
|
139
|
+
export declare type AppField = {
|
|
140
|
+
name: string;
|
|
141
|
+
type: AppFieldType;
|
|
142
|
+
is_required?: boolean;
|
|
143
|
+
readonly?: boolean;
|
|
144
|
+
value?: AppFormValue;
|
|
145
|
+
description?: string;
|
|
146
|
+
label?: string;
|
|
147
|
+
hint?: string;
|
|
148
|
+
position?: number;
|
|
149
|
+
modal_label?: string;
|
|
150
|
+
refresh?: boolean;
|
|
151
|
+
options?: AppSelectOption[];
|
|
152
|
+
multiselect?: boolean;
|
|
153
|
+
lookup?: AppCall;
|
|
154
|
+
subtype?: string;
|
|
155
|
+
min_length?: number;
|
|
156
|
+
max_length?: number;
|
|
157
|
+
};
|
|
158
|
+
export declare type AutocompleteSuggestion = {
|
|
159
|
+
suggestion: string;
|
|
160
|
+
complete?: string;
|
|
161
|
+
description?: string;
|
|
162
|
+
hint?: string;
|
|
163
|
+
iconData?: string;
|
|
164
|
+
};
|
|
165
|
+
export declare type AutocompleteSuggestionWithComplete = AutocompleteSuggestion & {
|
|
166
|
+
complete: string;
|
|
167
|
+
};
|
|
168
|
+
export declare type AutocompleteElement = AppField;
|
|
169
|
+
export declare type AutocompleteStaticSelect = AutocompleteElement & {
|
|
170
|
+
options: AppSelectOption[];
|
|
171
|
+
};
|
|
172
|
+
export declare type AutocompleteDynamicSelect = AutocompleteElement;
|
|
173
|
+
export declare type AutocompleteUserSelect = AutocompleteElement;
|
|
174
|
+
export declare type AutocompleteChannelSelect = AutocompleteElement;
|
|
175
|
+
export declare type FormResponseData = {
|
|
176
|
+
errors?: {
|
|
177
|
+
[field: string]: string;
|
|
178
|
+
};
|
|
179
|
+
};
|
|
180
|
+
export declare type AppLookupResponse = {
|
|
181
|
+
items: AppSelectOption[];
|
|
182
|
+
};
|
package/lib/apps.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
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.Locations = exports.Permission = void 0;
|
|
6
|
+
// This file's contents belong to the Apps Framework feature.
|
|
7
|
+
// Apps Framework feature is experimental, and the contents of this file are
|
|
8
|
+
// susceptible to breaking changes without pushing the major version of this package.
|
|
9
|
+
var Permission;
|
|
10
|
+
(function (Permission) {
|
|
11
|
+
Permission["UserJoinedChannelNotification"] = "user_joined_channel_notification";
|
|
12
|
+
Permission["ActAsBot"] = "act_as_bot";
|
|
13
|
+
Permission["ActAsUser"] = "act_as_user";
|
|
14
|
+
Permission["PermissionActAsAdmin"] = "act_as_admin";
|
|
15
|
+
Permission["RemoteOAuth2"] = "remote_oauth2";
|
|
16
|
+
Permission["RemoteWebhooks"] = "remote_webhooks";
|
|
17
|
+
})(Permission = exports.Permission || (exports.Permission = {}));
|
|
18
|
+
var Locations;
|
|
19
|
+
(function (Locations) {
|
|
20
|
+
Locations["PostMenu"] = "/post_menu";
|
|
21
|
+
Locations["ChannelHeader"] = "/channel_header";
|
|
22
|
+
Locations["Command"] = "/command";
|
|
23
|
+
Locations["InPost"] = "/in_post";
|
|
24
|
+
})(Locations = exports.Locations || (exports.Locations = {}));
|
package/lib/audits.d.ts
ADDED
package/lib/audits.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { UserProfile } from './users';
|
|
2
|
+
export declare type UserAutocomplete = {
|
|
3
|
+
users: UserProfile[];
|
|
4
|
+
out_of_channel?: UserProfile[];
|
|
5
|
+
};
|
|
6
|
+
export declare 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 declare 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 declare type BotPatch = {
|
|
12
|
+
username: string;
|
|
13
|
+
display_name: string;
|
|
14
|
+
description: string;
|
|
15
|
+
};
|
package/lib/bots.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Channel } from './channels';
|
|
2
|
+
import { Team } from './teams';
|
|
3
|
+
import { UserProfile } from './users';
|
|
4
|
+
import { IDMappedObjects, RelationOneToOne } from './utilities';
|
|
5
|
+
export declare type ChannelCategoryType = 'favorites' | 'channels' | 'direct_messages' | 'custom';
|
|
6
|
+
export declare enum CategorySorting {
|
|
7
|
+
Alphabetical = "alpha",
|
|
8
|
+
Default = "",
|
|
9
|
+
Recency = "recent",
|
|
10
|
+
Manual = "manual"
|
|
11
|
+
}
|
|
12
|
+
export declare 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 declare type OrderedChannelCategories = {
|
|
24
|
+
categories: ChannelCategory[];
|
|
25
|
+
order: string[];
|
|
26
|
+
};
|
|
27
|
+
export declare type ChannelCategoriesState = {
|
|
28
|
+
byId: IDMappedObjects<ChannelCategory>;
|
|
29
|
+
orderByTeam: RelationOneToOne<Team, Array<ChannelCategory['id']>>;
|
|
30
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
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.CategorySorting = void 0;
|
|
6
|
+
var CategorySorting;
|
|
7
|
+
(function (CategorySorting) {
|
|
8
|
+
CategorySorting["Alphabetical"] = "alpha";
|
|
9
|
+
CategorySorting["Default"] = "";
|
|
10
|
+
CategorySorting["Recency"] = "recent";
|
|
11
|
+
CategorySorting["Manual"] = "manual";
|
|
12
|
+
})(CategorySorting = exports.CategorySorting || (exports.CategorySorting = {}));
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { IDMappedObjects, RelationOneToMany, RelationOneToOne } from './utilities';
|
|
2
|
+
import { Team } from './teams';
|
|
3
|
+
export declare type ChannelType = 'O' | 'P' | 'D' | 'G';
|
|
4
|
+
export declare type ChannelStats = {
|
|
5
|
+
channel_id: string;
|
|
6
|
+
member_count: number;
|
|
7
|
+
guest_count: number;
|
|
8
|
+
pinnedpost_count: number;
|
|
9
|
+
files_count: number;
|
|
10
|
+
};
|
|
11
|
+
export declare type ChannelNotifyProps = {
|
|
12
|
+
desktop: 'default' | 'all' | 'mention' | 'none';
|
|
13
|
+
email: 'default' | 'all' | 'mention' | 'none';
|
|
14
|
+
mark_unread: 'all' | 'mention';
|
|
15
|
+
push: 'default' | 'all' | 'mention' | 'none';
|
|
16
|
+
ignore_channel_mentions: 'default' | 'off' | 'on';
|
|
17
|
+
};
|
|
18
|
+
export declare type Channel = {
|
|
19
|
+
id: string;
|
|
20
|
+
create_at: number;
|
|
21
|
+
update_at: number;
|
|
22
|
+
delete_at: number;
|
|
23
|
+
team_id: string;
|
|
24
|
+
type: ChannelType;
|
|
25
|
+
display_name: string;
|
|
26
|
+
name: string;
|
|
27
|
+
header: string;
|
|
28
|
+
purpose: string;
|
|
29
|
+
last_post_at: number;
|
|
30
|
+
last_root_post_at: number;
|
|
31
|
+
creator_id: string;
|
|
32
|
+
scheme_id: string;
|
|
33
|
+
teammate_id?: string;
|
|
34
|
+
status?: string;
|
|
35
|
+
group_constrained: boolean;
|
|
36
|
+
shared?: boolean;
|
|
37
|
+
props?: Record<string, any>;
|
|
38
|
+
policy_id?: string | null;
|
|
39
|
+
};
|
|
40
|
+
export declare type ServerChannel = Channel & {
|
|
41
|
+
/**
|
|
42
|
+
* The total number of posts in this channel, not including join/leave messages
|
|
43
|
+
*
|
|
44
|
+
* @remarks This field will be moved to a {@link ChannelMessageCount} object when this channel is stored in Redux.
|
|
45
|
+
*/
|
|
46
|
+
total_msg_count: number;
|
|
47
|
+
/**
|
|
48
|
+
* The number of root posts in this channel, not including join/leave messages
|
|
49
|
+
*
|
|
50
|
+
* @remarks This field will be moved to a {@link ChannelMessageCount} object when this channel is stored in Redux.
|
|
51
|
+
*/
|
|
52
|
+
total_msg_count_root: number;
|
|
53
|
+
};
|
|
54
|
+
export declare type ChannelMessageCount = {
|
|
55
|
+
/** The total number of posts in this channel, not including join/leave messages */
|
|
56
|
+
total: number;
|
|
57
|
+
/** The number of root posts in this channel, not including join/leave messages */
|
|
58
|
+
root: number;
|
|
59
|
+
};
|
|
60
|
+
export declare type ChannelWithTeamData = Channel & {
|
|
61
|
+
team_display_name: string;
|
|
62
|
+
team_name: string;
|
|
63
|
+
team_update_at: number;
|
|
64
|
+
};
|
|
65
|
+
export declare type ChannelsWithTotalCount = {
|
|
66
|
+
channels: ChannelWithTeamData[];
|
|
67
|
+
total_count: number;
|
|
68
|
+
};
|
|
69
|
+
export declare type ChannelMembership = {
|
|
70
|
+
channel_id: string;
|
|
71
|
+
user_id: string;
|
|
72
|
+
roles: string;
|
|
73
|
+
last_viewed_at: number;
|
|
74
|
+
/** The number of posts in this channel which have been read by the user */
|
|
75
|
+
msg_count: number;
|
|
76
|
+
/** The number of root posts in this channel which have been read by the user */
|
|
77
|
+
msg_count_root: number;
|
|
78
|
+
/** The number of unread mentions in this channel */
|
|
79
|
+
mention_count: number;
|
|
80
|
+
/** The number of unread mentions in root posts in this channel */
|
|
81
|
+
mention_count_root: number;
|
|
82
|
+
notify_props: Partial<ChannelNotifyProps>;
|
|
83
|
+
last_update_at: number;
|
|
84
|
+
scheme_user: boolean;
|
|
85
|
+
scheme_admin: boolean;
|
|
86
|
+
post_root_id?: string;
|
|
87
|
+
};
|
|
88
|
+
export declare type ChannelUnread = {
|
|
89
|
+
channel_id: string;
|
|
90
|
+
user_id: string;
|
|
91
|
+
team_id: string;
|
|
92
|
+
/** The number of posts which have been read by the user */
|
|
93
|
+
msg_count: number;
|
|
94
|
+
/** The number of root posts which have been read by the user */
|
|
95
|
+
msg_count_root: number;
|
|
96
|
+
/** The number of unread mentions in this channel */
|
|
97
|
+
mention_count: number;
|
|
98
|
+
/** The number of unread mentions in root posts in this channel */
|
|
99
|
+
mention_count_root: number;
|
|
100
|
+
last_viewed_at: number;
|
|
101
|
+
deltaMsgs: number;
|
|
102
|
+
};
|
|
103
|
+
export declare type ChannelsState = {
|
|
104
|
+
currentChannelId: string;
|
|
105
|
+
channels: IDMappedObjects<Channel>;
|
|
106
|
+
channelsInTeam: RelationOneToMany<Team, Channel>;
|
|
107
|
+
myMembers: RelationOneToOne<Channel, ChannelMembership>;
|
|
108
|
+
roles: RelationOneToOne<Channel, Set<string>>;
|
|
109
|
+
membersInChannel: RelationOneToOne<Channel, Record<string, ChannelMembership>>;
|
|
110
|
+
stats: RelationOneToOne<Channel, ChannelStats>;
|
|
111
|
+
groupsAssociatedToChannel: any;
|
|
112
|
+
totalCount: number;
|
|
113
|
+
manuallyUnread: RelationOneToOne<Channel, boolean>;
|
|
114
|
+
channelModerations: RelationOneToOne<Channel, ChannelModeration[]>;
|
|
115
|
+
channelMemberCountsByGroup: RelationOneToOne<Channel, ChannelMemberCountsByGroup>;
|
|
116
|
+
messageCounts: RelationOneToOne<Channel, ChannelMessageCount>;
|
|
117
|
+
};
|
|
118
|
+
export declare type ChannelModeration = {
|
|
119
|
+
name: string;
|
|
120
|
+
roles: {
|
|
121
|
+
guests?: {
|
|
122
|
+
value: boolean;
|
|
123
|
+
enabled: boolean;
|
|
124
|
+
};
|
|
125
|
+
members: {
|
|
126
|
+
value: boolean;
|
|
127
|
+
enabled: boolean;
|
|
128
|
+
};
|
|
129
|
+
admins: {
|
|
130
|
+
value: boolean;
|
|
131
|
+
enabled: boolean;
|
|
132
|
+
};
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
export declare type ChannelModerationPatch = {
|
|
136
|
+
name: string;
|
|
137
|
+
roles: {
|
|
138
|
+
guests?: boolean;
|
|
139
|
+
members?: boolean;
|
|
140
|
+
};
|
|
141
|
+
};
|
|
142
|
+
export declare type ChannelMemberCountByGroup = {
|
|
143
|
+
group_id: string;
|
|
144
|
+
channel_member_count: number;
|
|
145
|
+
channel_member_timezones_count: number;
|
|
146
|
+
};
|
|
147
|
+
export declare type ChannelMemberCountsByGroup = Record<string, ChannelMemberCountByGroup>;
|
|
148
|
+
export declare type ChannelViewResponse = {
|
|
149
|
+
status: string;
|
|
150
|
+
last_viewed_at_times: RelationOneToOne<Channel, number>;
|
|
151
|
+
};
|
|
152
|
+
export declare type ChannelSearchOpts = {
|
|
153
|
+
nonAdminSearch?: boolean;
|
|
154
|
+
exclude_default_channels?: boolean;
|
|
155
|
+
not_associated_to_group?: string;
|
|
156
|
+
team_ids?: string[];
|
|
157
|
+
group_constrained?: boolean;
|
|
158
|
+
exclude_group_constrained?: boolean;
|
|
159
|
+
public?: boolean;
|
|
160
|
+
private?: boolean;
|
|
161
|
+
include_deleted?: boolean;
|
|
162
|
+
deleted?: boolean;
|
|
163
|
+
page?: number;
|
|
164
|
+
per_page?: number;
|
|
165
|
+
};
|
package/lib/channels.js
ADDED
package/lib/client4.d.ts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export declare enum LogLevel {
|
|
2
|
+
Error = "ERROR",
|
|
3
|
+
Warning = "WARNING",
|
|
4
|
+
Info = "INFO",
|
|
5
|
+
Debug = "DEBUG"
|
|
6
|
+
}
|
|
7
|
+
export declare type ClientResponse<T> = {
|
|
8
|
+
response: Response;
|
|
9
|
+
headers: Map<string, string>;
|
|
10
|
+
data: T;
|
|
11
|
+
};
|
|
12
|
+
declare type ErrorOffline = {
|
|
13
|
+
message: string;
|
|
14
|
+
url: string;
|
|
15
|
+
};
|
|
16
|
+
declare type ErrorInvalidResponse = {
|
|
17
|
+
intl: {
|
|
18
|
+
id: string;
|
|
19
|
+
defaultMessage: string;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export declare type ErrorApi = {
|
|
23
|
+
message: string;
|
|
24
|
+
server_error_id: string;
|
|
25
|
+
status_code: number;
|
|
26
|
+
url: string;
|
|
27
|
+
};
|
|
28
|
+
export declare type Client4Error = ErrorOffline | ErrorInvalidResponse | ErrorApi;
|
|
29
|
+
export declare type Options = {
|
|
30
|
+
headers?: {
|
|
31
|
+
[x: string]: string;
|
|
32
|
+
};
|
|
33
|
+
method?: string;
|
|
34
|
+
url?: string;
|
|
35
|
+
credentials?: 'omit' | 'same-origin' | 'include';
|
|
36
|
+
body?: any;
|
|
37
|
+
};
|
|
38
|
+
export declare type StatusOK = {
|
|
39
|
+
status: 'OK';
|
|
40
|
+
};
|
|
41
|
+
export {};
|
package/lib/client4.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
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.LogLevel = void 0;
|
|
6
|
+
var LogLevel;
|
|
7
|
+
(function (LogLevel) {
|
|
8
|
+
LogLevel["Error"] = "ERROR";
|
|
9
|
+
LogLevel["Warning"] = "WARNING";
|
|
10
|
+
LogLevel["Info"] = "INFO";
|
|
11
|
+
LogLevel["Debug"] = "DEBUG";
|
|
12
|
+
})(LogLevel = exports.LogLevel || (exports.LogLevel = {}));
|