@mattermost/types 10.6.0 → 10.8.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/lib/channels.d.ts +7 -0
- package/lib/channels.js +7 -0
- package/lib/config.d.ts +11 -0
- package/lib/groups.d.ts +16 -0
- package/lib/groups.js +12 -1
- package/lib/integrations.d.ts +2 -0
- package/lib/properties.d.ts +19 -3
- package/lib/users.d.ts +6 -0
- package/lib/utilities.d.ts +7 -8
- package/lib/utilities.js +9 -5
- package/package.json +1 -1
package/lib/channels.d.ts
CHANGED
|
@@ -20,6 +20,12 @@ export type ChannelNotifyProps = {
|
|
|
20
20
|
ignore_channel_mentions: 'default' | 'off' | 'on';
|
|
21
21
|
channel_auto_follow_threads: 'off' | 'on';
|
|
22
22
|
};
|
|
23
|
+
export type ChannelBanner = {
|
|
24
|
+
enabled?: boolean;
|
|
25
|
+
text?: string;
|
|
26
|
+
background_color?: string;
|
|
27
|
+
};
|
|
28
|
+
export declare function channelBannerEnabled(banner: ChannelBanner | undefined): boolean;
|
|
23
29
|
export type Channel = {
|
|
24
30
|
id: string;
|
|
25
31
|
create_at: number;
|
|
@@ -41,6 +47,7 @@ export type Channel = {
|
|
|
41
47
|
shared?: boolean;
|
|
42
48
|
props?: Record<string, any>;
|
|
43
49
|
policy_id?: string | null;
|
|
50
|
+
banner_info?: ChannelBanner;
|
|
44
51
|
};
|
|
45
52
|
export type ServerChannel = Channel & {
|
|
46
53
|
/**
|
package/lib/channels.js
CHANGED
|
@@ -2,3 +2,10 @@
|
|
|
2
2
|
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
3
3
|
// See LICENSE.txt for license information.
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.channelBannerEnabled = channelBannerEnabled;
|
|
6
|
+
function channelBannerEnabled(banner) {
|
|
7
|
+
if (!banner) {
|
|
8
|
+
return false;
|
|
9
|
+
}
|
|
10
|
+
return Boolean(banner.enabled) && Boolean(banner.text) && Boolean(banner.background_color);
|
|
11
|
+
}
|
package/lib/config.d.ts
CHANGED
|
@@ -59,6 +59,7 @@ export type ClientConfig = {
|
|
|
59
59
|
EnableUserStatuses: string;
|
|
60
60
|
EnableLastActiveTime: string;
|
|
61
61
|
EnableTimedDND: string;
|
|
62
|
+
EnableCrossTeamSearch: 'true' | 'false';
|
|
62
63
|
EnableCustomTermsOfService: string;
|
|
63
64
|
EnableDeveloper: string;
|
|
64
65
|
EnableDiagnostics: string;
|
|
@@ -343,6 +344,7 @@ export type ServiceSettings = {
|
|
|
343
344
|
GiphySdkKey: string;
|
|
344
345
|
PostEditTimeLimit: number;
|
|
345
346
|
TimeBetweenUserTypingUpdatesMilliseconds: number;
|
|
347
|
+
EnableCrossTeamSearch: boolean;
|
|
346
348
|
EnablePostSearch: boolean;
|
|
347
349
|
EnableFileSearch: boolean;
|
|
348
350
|
MinimumHashtagLength: number;
|
|
@@ -391,6 +393,8 @@ export type ServiceSettings = {
|
|
|
391
393
|
EnableDesktopLandingPage: boolean;
|
|
392
394
|
MaximumURLLength: number;
|
|
393
395
|
ScheduledPosts: boolean;
|
|
396
|
+
EnableWebHubChannelIteration: boolean;
|
|
397
|
+
FrameAncestors: string;
|
|
394
398
|
};
|
|
395
399
|
export type TeamSettings = {
|
|
396
400
|
SiteName: string;
|
|
@@ -680,6 +684,7 @@ export type LdapSettings = {
|
|
|
680
684
|
LoginButtonColor: string;
|
|
681
685
|
LoginButtonBorderColor: string;
|
|
682
686
|
LoginButtonTextColor: string;
|
|
687
|
+
MaximumLoginAttempts: number;
|
|
683
688
|
};
|
|
684
689
|
export type ComplianceSettings = {
|
|
685
690
|
Enable: boolean;
|
|
@@ -735,6 +740,9 @@ export type NativeAppSettings = {
|
|
|
735
740
|
AndroidAppDownloadLink: string;
|
|
736
741
|
IosAppDownloadLink: string;
|
|
737
742
|
MobileExternalBrowser: boolean;
|
|
743
|
+
MobileEnableBiometrics: boolean;
|
|
744
|
+
MobilePreventScreenCapture: boolean;
|
|
745
|
+
MobileJailbreakProtection: boolean;
|
|
738
746
|
};
|
|
739
747
|
export type ClusterSettings = {
|
|
740
748
|
Enable: boolean;
|
|
@@ -755,6 +763,7 @@ export type MetricsSettings = {
|
|
|
755
763
|
ListenAddress: string;
|
|
756
764
|
EnableClientMetrics: boolean;
|
|
757
765
|
EnableNotificationMetrics: boolean;
|
|
766
|
+
ClientSideUserIds: string[];
|
|
758
767
|
};
|
|
759
768
|
export type ExperimentalSettings = {
|
|
760
769
|
ClientSideCertEnable: boolean;
|
|
@@ -778,6 +787,7 @@ export type CacheSettings = {
|
|
|
778
787
|
RedisAddress: string;
|
|
779
788
|
RedisPassword: string;
|
|
780
789
|
RedisDB: number;
|
|
790
|
+
RedisCachePrefix: string;
|
|
781
791
|
DisableClientCache: boolean;
|
|
782
792
|
};
|
|
783
793
|
export type ElasticsearchSettings = {
|
|
@@ -798,6 +808,7 @@ export type ElasticsearchSettings = {
|
|
|
798
808
|
AggregatePostsAfterDays: number;
|
|
799
809
|
PostsAggregatorJobStartTime: string;
|
|
800
810
|
IndexPrefix: string;
|
|
811
|
+
GlobalSearchPrefix: string;
|
|
801
812
|
LiveIndexingBatchSize: number;
|
|
802
813
|
BatchSize: number;
|
|
803
814
|
RequestTimeoutSeconds: number;
|
package/lib/groups.d.ts
CHANGED
|
@@ -34,10 +34,20 @@ export type Group = {
|
|
|
34
34
|
channel_member_timezones_count?: number;
|
|
35
35
|
member_ids?: string[];
|
|
36
36
|
};
|
|
37
|
+
/**
|
|
38
|
+
* Main sources for groups
|
|
39
|
+
*/
|
|
37
40
|
export declare enum GroupSource {
|
|
38
41
|
Ldap = "ldap",
|
|
39
42
|
Custom = "custom"
|
|
40
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* Special prefixes that can be added to group sources when they come from plugins
|
|
46
|
+
* Used for identifying plugin-created groups by checking if source starts with this prefix
|
|
47
|
+
*/
|
|
48
|
+
export declare enum PluginGroupSourcePrefix {
|
|
49
|
+
Plugin = "plugin_"
|
|
50
|
+
}
|
|
41
51
|
export type GroupTeam = {
|
|
42
52
|
team_id: string;
|
|
43
53
|
team_display_name: string;
|
|
@@ -142,6 +152,12 @@ export type GroupSearchParams = GetGroupsParams & {
|
|
|
142
152
|
include_timezones?: string;
|
|
143
153
|
include_channel_member_count?: string;
|
|
144
154
|
};
|
|
155
|
+
export type GroupMember = {
|
|
156
|
+
group_id: string;
|
|
157
|
+
user_id: string;
|
|
158
|
+
create_at: number;
|
|
159
|
+
deleted_at: number;
|
|
160
|
+
};
|
|
145
161
|
export type GroupMembership = {
|
|
146
162
|
user_id: string;
|
|
147
163
|
roles: string;
|
package/lib/groups.js
CHANGED
|
@@ -2,14 +2,25 @@
|
|
|
2
2
|
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
3
3
|
// See LICENSE.txt for license information.
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.GroupSource = exports.SyncableType = void 0;
|
|
5
|
+
exports.PluginGroupSourcePrefix = exports.GroupSource = exports.SyncableType = void 0;
|
|
6
6
|
var SyncableType;
|
|
7
7
|
(function (SyncableType) {
|
|
8
8
|
SyncableType["Team"] = "team";
|
|
9
9
|
SyncableType["Channel"] = "channel";
|
|
10
10
|
})(SyncableType || (exports.SyncableType = SyncableType = {}));
|
|
11
|
+
/**
|
|
12
|
+
* Main sources for groups
|
|
13
|
+
*/
|
|
11
14
|
var GroupSource;
|
|
12
15
|
(function (GroupSource) {
|
|
13
16
|
GroupSource["Ldap"] = "ldap";
|
|
14
17
|
GroupSource["Custom"] = "custom";
|
|
15
18
|
})(GroupSource || (exports.GroupSource = GroupSource = {}));
|
|
19
|
+
/**
|
|
20
|
+
* Special prefixes that can be added to group sources when they come from plugins
|
|
21
|
+
* Used for identifying plugin-created groups by checking if source starts with this prefix
|
|
22
|
+
*/
|
|
23
|
+
var PluginGroupSourcePrefix;
|
|
24
|
+
(function (PluginGroupSourcePrefix) {
|
|
25
|
+
PluginGroupSourcePrefix["Plugin"] = "plugin_";
|
|
26
|
+
})(PluginGroupSourcePrefix || (exports.PluginGroupSourcePrefix = PluginGroupSourcePrefix = {}));
|
package/lib/integrations.d.ts
CHANGED
|
@@ -120,9 +120,11 @@ export type IntegrationsState = {
|
|
|
120
120
|
appsBotIDs: string[];
|
|
121
121
|
systemCommands: IDMappedObjects<Command>;
|
|
122
122
|
commands: IDMappedObjects<Command>;
|
|
123
|
+
dialogTriggerId: string;
|
|
123
124
|
dialog?: {
|
|
124
125
|
url: string;
|
|
125
126
|
dialog: Dialog;
|
|
127
|
+
trigger_id: string;
|
|
126
128
|
};
|
|
127
129
|
};
|
|
128
130
|
type Dialog = {
|
package/lib/properties.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
export type FieldType = ('text' | 'select' | 'multiselect' | 'date' | 'user' | 'multiuser');
|
|
1
2
|
export type PropertyField = {
|
|
2
3
|
id: string;
|
|
3
4
|
group_id: string;
|
|
4
5
|
name: string;
|
|
5
|
-
type:
|
|
6
|
+
type: FieldType;
|
|
6
7
|
attrs?: {
|
|
7
8
|
[key: string]: unknown;
|
|
8
9
|
};
|
|
@@ -22,10 +23,25 @@ export type PropertyValue<T> = {
|
|
|
22
23
|
update_at: number;
|
|
23
24
|
delete_at: number;
|
|
24
25
|
};
|
|
25
|
-
export type UserPropertyFieldType = 'text';
|
|
26
|
+
export type UserPropertyFieldType = 'text' | 'select' | 'multiselect';
|
|
26
27
|
export type UserPropertyFieldGroupID = 'custom_profile_attributes';
|
|
28
|
+
export type UserPropertyValueType = 'phone' | 'url' | '';
|
|
29
|
+
export type FieldVisibility = 'always' | 'hidden' | 'when_set';
|
|
30
|
+
export type FieldValueType = 'email' | 'url' | 'phone' | '';
|
|
31
|
+
export type PropertyFieldOption = {
|
|
32
|
+
id: string;
|
|
33
|
+
name: string;
|
|
34
|
+
color?: string;
|
|
35
|
+
};
|
|
27
36
|
export type UserPropertyField = PropertyField & {
|
|
28
|
-
type: UserPropertyFieldType;
|
|
29
37
|
group_id: UserPropertyFieldGroupID;
|
|
38
|
+
attrs: {
|
|
39
|
+
sort_order: number;
|
|
40
|
+
visibility: FieldVisibility;
|
|
41
|
+
value_type: FieldValueType;
|
|
42
|
+
options?: PropertyFieldOption[];
|
|
43
|
+
ldap?: string;
|
|
44
|
+
saml?: string;
|
|
45
|
+
};
|
|
30
46
|
};
|
|
31
47
|
export type UserPropertyFieldPatch = Partial<Pick<UserPropertyField, 'name' | 'attrs' | 'type'>>;
|
package/lib/users.d.ts
CHANGED
|
@@ -55,6 +55,8 @@ export type UserProfile = {
|
|
|
55
55
|
terms_of_service_create_at: number;
|
|
56
56
|
remote_id?: string;
|
|
57
57
|
status?: string;
|
|
58
|
+
custom_profile_attributes?: Record<string, string | string[]>;
|
|
59
|
+
failed_attempts?: number;
|
|
58
60
|
};
|
|
59
61
|
export type UserProfileWithLastViewAt = UserProfile & {
|
|
60
62
|
last_viewed_at: number;
|
|
@@ -90,6 +92,10 @@ export type UserStatus = {
|
|
|
90
92
|
manual?: boolean;
|
|
91
93
|
last_activity_at?: number;
|
|
92
94
|
active_channel?: string;
|
|
95
|
+
/**
|
|
96
|
+
* The time when a user's timed DND status will expire. Unlike other timestamps in the app, this is in seconds
|
|
97
|
+
* instead of milliseconds.
|
|
98
|
+
*/
|
|
93
99
|
dnd_end_time?: number;
|
|
94
100
|
};
|
|
95
101
|
export declare enum CustomStatusDuration {
|
package/lib/utilities.d.ts
CHANGED
|
@@ -60,21 +60,17 @@ export declare const collectionToArray: <T extends {
|
|
|
60
60
|
}>({ data, order }: IDMappedCollection<T>) => T[];
|
|
61
61
|
export declare const collectionReplaceItem: <T extends {
|
|
62
62
|
id: string;
|
|
63
|
-
}>(collection: IDMappedCollection<T>,
|
|
64
|
-
data: IDMappedObjects<T
|
|
65
|
-
[x: string]: T;
|
|
66
|
-
};
|
|
63
|
+
}>(collection: IDMappedCollection<T>, ...items: T[]) => {
|
|
64
|
+
data: IDMappedObjects<T>;
|
|
67
65
|
order: T["id"][];
|
|
68
66
|
errors?: RelationOneToOne<T, Error> | undefined;
|
|
69
67
|
warnings?: RelationOneToOne<T, { [Key in keyof T]?: string | undefined; }> | undefined;
|
|
70
68
|
};
|
|
71
69
|
export declare const collectionAddItem: <T extends {
|
|
72
70
|
id: string;
|
|
73
|
-
}>(collection: IDMappedCollection<T>,
|
|
74
|
-
data: IDMappedObjects<T> & {
|
|
75
|
-
[x: string]: T;
|
|
76
|
-
};
|
|
71
|
+
}>(collection: IDMappedCollection<T>, ...items: T[]) => {
|
|
77
72
|
order: string[];
|
|
73
|
+
data: IDMappedObjects<T>;
|
|
78
74
|
errors?: RelationOneToOne<T, Error> | undefined;
|
|
79
75
|
warnings?: RelationOneToOne<T, { [Key in keyof T]?: string | undefined; }> | undefined;
|
|
80
76
|
};
|
|
@@ -86,4 +82,7 @@ export declare const collectionRemoveItem: <T extends {
|
|
|
86
82
|
errors?: RelationOneToOne<T, Error> | undefined;
|
|
87
83
|
warnings?: RelationOneToOne<T, { [Key in keyof T]?: string | undefined; }> | undefined;
|
|
88
84
|
};
|
|
85
|
+
export declare const idMappedObjectsFromArr: <T extends {
|
|
86
|
+
id: string;
|
|
87
|
+
}>(items: T[], current?: IDMappedObjects<T>) => IDMappedObjects<T>;
|
|
89
88
|
export {};
|
package/lib/utilities.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
3
3
|
// See LICENSE.txt for license information.
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.collectionRemoveItem = exports.collectionAddItem = exports.collectionReplaceItem = exports.collectionToArray = exports.collectionFromArray = void 0;
|
|
5
|
+
exports.idMappedObjectsFromArr = exports.collectionRemoveItem = exports.collectionAddItem = exports.collectionReplaceItem = exports.collectionToArray = exports.collectionFromArray = void 0;
|
|
6
6
|
exports.isArrayOf = isArrayOf;
|
|
7
7
|
exports.isStringArray = isStringArray;
|
|
8
8
|
exports.isRecordOf = isRecordOf;
|
|
@@ -39,12 +39,12 @@ const collectionToArray = ({ data, order }) => {
|
|
|
39
39
|
return order.map((id) => data[id]);
|
|
40
40
|
};
|
|
41
41
|
exports.collectionToArray = collectionToArray;
|
|
42
|
-
const collectionReplaceItem = (collection,
|
|
43
|
-
return Object.assign(Object.assign({}, collection), { data:
|
|
42
|
+
const collectionReplaceItem = (collection, ...items) => {
|
|
43
|
+
return Object.assign(Object.assign({}, collection), { data: (0, exports.idMappedObjectsFromArr)(items, collection.data) });
|
|
44
44
|
};
|
|
45
45
|
exports.collectionReplaceItem = collectionReplaceItem;
|
|
46
|
-
const collectionAddItem = (collection,
|
|
47
|
-
return Object.assign(Object.assign({},
|
|
46
|
+
const collectionAddItem = (collection, ...items) => {
|
|
47
|
+
return Object.assign(Object.assign({}, (0, exports.collectionReplaceItem)(collection, ...items)), { order: [...collection.order, ...items.map(({ id }) => id)] });
|
|
48
48
|
};
|
|
49
49
|
exports.collectionAddItem = collectionAddItem;
|
|
50
50
|
const collectionRemoveItem = (collection, item) => {
|
|
@@ -54,3 +54,7 @@ const collectionRemoveItem = (collection, item) => {
|
|
|
54
54
|
return Object.assign(Object.assign({}, collection), { data, order });
|
|
55
55
|
};
|
|
56
56
|
exports.collectionRemoveItem = collectionRemoveItem;
|
|
57
|
+
const idMappedObjectsFromArr = (items, current) => {
|
|
58
|
+
return items.reduce((r, item) => (Object.assign(Object.assign({}, r), { [item.id]: item })), Object.assign({}, current));
|
|
59
|
+
};
|
|
60
|
+
exports.idMappedObjectsFromArr = idMappedObjectsFromArr;
|