@mattermost/types 10.6.0 → 10.7.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/config.d.ts +1 -0
- package/lib/groups.d.ts +10 -0
- package/lib/groups.js +12 -1
- package/lib/integrations.d.ts +2 -0
- package/lib/properties.d.ts +4 -1
- 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/config.d.ts
CHANGED
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;
|
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
|
@@ -27,5 +27,8 @@ export type UserPropertyFieldGroupID = 'custom_profile_attributes';
|
|
|
27
27
|
export type UserPropertyField = PropertyField & {
|
|
28
28
|
type: UserPropertyFieldType;
|
|
29
29
|
group_id: UserPropertyFieldGroupID;
|
|
30
|
+
attrs?: {
|
|
31
|
+
sort_order?: number;
|
|
32
|
+
};
|
|
30
33
|
};
|
|
31
|
-
export type UserPropertyFieldPatch = Partial<Pick<UserPropertyField, 'name' | 'attrs' | 'type'>>;
|
|
34
|
+
export type UserPropertyFieldPatch = Partial<Pick<UserPropertyField, 'name' | 'attrs' | 'type' | 'attrs'>>;
|
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
|
+
failed_attempts?: number;
|
|
59
|
+
custom_profile_attributes?: Record<string, string>;
|
|
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;
|