@mattermost/types 11.6.0 → 11.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/lib/access_control.d.ts +14 -0
- package/lib/access_control.js +30 -0
- package/lib/apps.d.ts +1 -0
- package/lib/apps.js +1 -0
- package/lib/channel_categories.d.ts +2 -1
- package/lib/channels.d.ts +1 -0
- package/lib/config.d.ts +7 -0
- package/lib/posts.d.ts +1 -0
- package/lib/properties.d.ts +49 -2
- package/lib/shared_channels.d.ts +2 -0
- package/lib/store.d.ts +2 -0
- package/package.json +1 -1
package/lib/access_control.d.ts
CHANGED
|
@@ -8,9 +8,12 @@ export type AccessControlPolicy = {
|
|
|
8
8
|
created_at?: number;
|
|
9
9
|
version?: string;
|
|
10
10
|
active?: boolean;
|
|
11
|
+
roles?: string[];
|
|
11
12
|
imports?: string[];
|
|
12
13
|
props?: Record<string, unknown[]>;
|
|
13
14
|
rules: AccessControlPolicyRule[];
|
|
15
|
+
scope?: string;
|
|
16
|
+
scope_id?: string;
|
|
14
17
|
};
|
|
15
18
|
export type AccessControlPolicyCursor = {
|
|
16
19
|
id: string;
|
|
@@ -33,6 +36,17 @@ export type AccessControlPolicyRule = {
|
|
|
33
36
|
actions?: string[];
|
|
34
37
|
expression: string;
|
|
35
38
|
};
|
|
39
|
+
/**
|
|
40
|
+
* Returns the first rule with a "membership" action, falling back to rules[0]
|
|
41
|
+
* only when it carries a wildcard action (legacy v0.2 policies).
|
|
42
|
+
*/
|
|
43
|
+
export declare function getMembershipRule(rules?: AccessControlPolicyRule[]): AccessControlPolicyRule | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* Replaces or inserts the membership rule in an existing rules array while
|
|
46
|
+
* preserving all non-membership rules (e.g. file_upload, file_download).
|
|
47
|
+
* If expression is empty the membership rule is removed.
|
|
48
|
+
*/
|
|
49
|
+
export declare function buildRulesWithMembership(existingRules: AccessControlPolicyRule[], expression: string): AccessControlPolicyRule[];
|
|
36
50
|
export type CELExpressionError = {
|
|
37
51
|
message: string;
|
|
38
52
|
line: number;
|
package/lib/access_control.js
CHANGED
|
@@ -2,3 +2,33 @@
|
|
|
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.getMembershipRule = getMembershipRule;
|
|
6
|
+
exports.buildRulesWithMembership = buildRulesWithMembership;
|
|
7
|
+
/**
|
|
8
|
+
* Returns the first rule with a "membership" action, falling back to rules[0]
|
|
9
|
+
* only when it carries a wildcard action (legacy v0.2 policies).
|
|
10
|
+
*/
|
|
11
|
+
function getMembershipRule(rules) {
|
|
12
|
+
var _a;
|
|
13
|
+
const membership = rules === null || rules === void 0 ? void 0 : rules.find((r) => { var _a; return (_a = r.actions) === null || _a === void 0 ? void 0 : _a.includes('membership'); });
|
|
14
|
+
if (membership) {
|
|
15
|
+
return membership;
|
|
16
|
+
}
|
|
17
|
+
const first = rules === null || rules === void 0 ? void 0 : rules[0];
|
|
18
|
+
if ((_a = first === null || first === void 0 ? void 0 : first.actions) === null || _a === void 0 ? void 0 : _a.includes('*')) {
|
|
19
|
+
return first;
|
|
20
|
+
}
|
|
21
|
+
return undefined;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Replaces or inserts the membership rule in an existing rules array while
|
|
25
|
+
* preserving all non-membership rules (e.g. file_upload, file_download).
|
|
26
|
+
* If expression is empty the membership rule is removed.
|
|
27
|
+
*/
|
|
28
|
+
function buildRulesWithMembership(existingRules, expression) {
|
|
29
|
+
const otherRules = existingRules.filter((r) => { var _a; return !((_a = r.actions) === null || _a === void 0 ? void 0 : _a.includes('membership')); });
|
|
30
|
+
if (!expression.trim()) {
|
|
31
|
+
return otherRules;
|
|
32
|
+
}
|
|
33
|
+
return [{ actions: ['membership'], expression: expression.trim() }, ...otherRules];
|
|
34
|
+
}
|
package/lib/apps.d.ts
CHANGED
|
@@ -141,6 +141,7 @@ export type AppSelectOption = {
|
|
|
141
141
|
value: string;
|
|
142
142
|
icon_data?: string;
|
|
143
143
|
};
|
|
144
|
+
export declare function isAppSelectOption(v: unknown): v is AppSelectOption;
|
|
144
145
|
export type AppFieldType = string;
|
|
145
146
|
export type DateTimeConfig = {
|
|
146
147
|
time_interval?: number;
|
package/lib/apps.js
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
exports.Locations = exports.Permission = void 0;
|
|
6
6
|
exports.isAppBinding = isAppBinding;
|
|
7
|
+
exports.isAppSelectOption = isAppSelectOption;
|
|
7
8
|
const products_1 = require("./products");
|
|
8
9
|
const utilities_1 = require("./utilities");
|
|
9
10
|
var Permission;
|
|
@@ -2,7 +2,7 @@ import type { Channel } from './channels';
|
|
|
2
2
|
import type { Team } from './teams';
|
|
3
3
|
import type { UserProfile } from './users';
|
|
4
4
|
import type { IDMappedObjects, RelationOneToOne } from './utilities';
|
|
5
|
-
export type ChannelCategoryType = 'favorites' | 'channels' | 'direct_messages' | 'custom';
|
|
5
|
+
export type ChannelCategoryType = 'favorites' | 'channels' | 'direct_messages' | 'custom' | 'managed';
|
|
6
6
|
export declare enum CategorySorting {
|
|
7
7
|
Alphabetical = "alpha",
|
|
8
8
|
Default = "",// behaves the same as manual
|
|
@@ -27,4 +27,5 @@ export type OrderedChannelCategories = {
|
|
|
27
27
|
export type ChannelCategoriesState = {
|
|
28
28
|
byId: IDMappedObjects<ChannelCategory>;
|
|
29
29
|
orderByTeam: RelationOneToOne<Team, Array<ChannelCategory['id']>>;
|
|
30
|
+
managedCategoryMappings: RelationOneToOne<Team, Record<Channel['id'], string>>;
|
|
30
31
|
};
|
package/lib/channels.d.ts
CHANGED
package/lib/config.d.ts
CHANGED
|
@@ -60,6 +60,7 @@ export type ClientConfig = {
|
|
|
60
60
|
EnableExperimentalLocales: string;
|
|
61
61
|
EnableUserStatuses: string;
|
|
62
62
|
EnableLastActiveTime: string;
|
|
63
|
+
EnableManagedChannelCategories: string;
|
|
63
64
|
EnableTimedDND: string;
|
|
64
65
|
EnableCrossTeamSearch: 'true' | 'false';
|
|
65
66
|
EnableCustomTermsOfService: string;
|
|
@@ -124,6 +125,7 @@ export type ClientConfig = {
|
|
|
124
125
|
FeatureFlagCallsEnabled: string;
|
|
125
126
|
FeatureFlagCustomProfileAttributes: string;
|
|
126
127
|
FeatureFlagAttributeBasedAccessControl: string;
|
|
128
|
+
FeatureFlagPermissionPolicies: string;
|
|
127
129
|
FeatureFlagWebSocketEventScope: string;
|
|
128
130
|
FeatureFlagInteractiveDialogAppsForm: string;
|
|
129
131
|
FeatureFlagContentFlagging: string;
|
|
@@ -201,6 +203,7 @@ export type ClientConfig = {
|
|
|
201
203
|
WebsocketSecurePort: string;
|
|
202
204
|
WebsocketURL: string;
|
|
203
205
|
ExperimentalSharedChannels: string;
|
|
206
|
+
ExperimentalRemoteClusterService: string;
|
|
204
207
|
DisableAppBar: string;
|
|
205
208
|
EnableComplianceExport: string;
|
|
206
209
|
PostPriority: string;
|
|
@@ -465,6 +468,7 @@ export type SqlSettings = {
|
|
|
465
468
|
Trace: boolean;
|
|
466
469
|
AtRestEncryptKey: string;
|
|
467
470
|
QueryTimeout: number;
|
|
471
|
+
AnalyticsQueryTimeout: number;
|
|
468
472
|
DisableDatabaseSearch: boolean;
|
|
469
473
|
MigrationsStatementTimeoutSeconds: number;
|
|
470
474
|
ReplicaLagSettings: ReplicaLagSetting[];
|
|
@@ -654,6 +658,7 @@ export type SSOSettings = {
|
|
|
654
658
|
DiscoveryEndpoint: string;
|
|
655
659
|
ButtonText: string;
|
|
656
660
|
ButtonColor: string;
|
|
661
|
+
UsePreferredUsername: boolean;
|
|
657
662
|
};
|
|
658
663
|
export type Office365Settings = {
|
|
659
664
|
Enable: boolean;
|
|
@@ -665,6 +670,7 @@ export type Office365Settings = {
|
|
|
665
670
|
UserAPIEndpoint: string;
|
|
666
671
|
DiscoveryEndpoint: string;
|
|
667
672
|
DirectoryId: string;
|
|
673
|
+
UsePreferredUsername: boolean;
|
|
668
674
|
};
|
|
669
675
|
export type LdapSettings = {
|
|
670
676
|
Enable: boolean;
|
|
@@ -820,6 +826,7 @@ export type ExperimentalSettings = {
|
|
|
820
826
|
UsersStatusAndProfileFetchingPollIntervalMilliseconds: number;
|
|
821
827
|
YoutubeReferrerPolicy: boolean;
|
|
822
828
|
ExperimentalChannelCategorySorting: boolean;
|
|
829
|
+
EnableWatermark: boolean;
|
|
823
830
|
};
|
|
824
831
|
export type AnalyticsSettings = {
|
|
825
832
|
MaxUsersForStatistics: number;
|
package/lib/posts.d.ts
CHANGED
package/lib/properties.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { IDMappedObjects } from './utilities';
|
|
1
2
|
export type FieldType = ('text' | 'select' | 'multiselect' | 'date' | 'user' | 'multiuser');
|
|
2
3
|
export type PropertyField = {
|
|
3
4
|
id: string;
|
|
@@ -8,11 +9,18 @@ export type PropertyField = {
|
|
|
8
9
|
subType?: string;
|
|
9
10
|
[key: string]: unknown;
|
|
10
11
|
};
|
|
11
|
-
target_id
|
|
12
|
-
target_type
|
|
12
|
+
target_id: string;
|
|
13
|
+
target_type: string;
|
|
14
|
+
object_type: string;
|
|
13
15
|
create_at: number;
|
|
14
16
|
update_at: number;
|
|
15
17
|
delete_at: number;
|
|
18
|
+
created_by: string;
|
|
19
|
+
updated_by: string;
|
|
20
|
+
};
|
|
21
|
+
export type PropertyGroup = {
|
|
22
|
+
id: string;
|
|
23
|
+
name: string;
|
|
16
24
|
};
|
|
17
25
|
export type NameMappedPropertyFields = {
|
|
18
26
|
[key: PropertyField['name']]: PropertyField;
|
|
@@ -27,6 +35,8 @@ export type PropertyValue<T> = {
|
|
|
27
35
|
create_at: number;
|
|
28
36
|
update_at: number;
|
|
29
37
|
delete_at: number;
|
|
38
|
+
created_by: string;
|
|
39
|
+
updated_by: string;
|
|
30
40
|
};
|
|
31
41
|
export type UserPropertyFieldType = 'text' | 'select' | 'multiselect';
|
|
32
42
|
export type UserPropertyFieldGroupID = 'custom_profile_attributes';
|
|
@@ -61,3 +71,40 @@ export type SelectPropertyField = PropertyField & {
|
|
|
61
71
|
};
|
|
62
72
|
export declare const supportsOptions: (field: UserPropertyField) => boolean;
|
|
63
73
|
export type UserPropertyFieldPatch = Partial<Pick<UserPropertyField, 'name' | 'attrs' | 'type'>>;
|
|
74
|
+
export type PropertiesState = {
|
|
75
|
+
fields: PropertyFieldsState;
|
|
76
|
+
values: PropertyValuesState;
|
|
77
|
+
groups: PropertyGroupsState;
|
|
78
|
+
};
|
|
79
|
+
export type PropertyFieldsState = {
|
|
80
|
+
byObjectType: {
|
|
81
|
+
[objectType: string]: {
|
|
82
|
+
[groupId: string]: IDMappedObjects<PropertyField>;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
byId: IDMappedObjects<PropertyField>;
|
|
86
|
+
};
|
|
87
|
+
export type PropertyValuesState = {
|
|
88
|
+
byTargetId: {
|
|
89
|
+
[targetId: string]: {
|
|
90
|
+
[fieldId: string]: PropertyValue<unknown>;
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
byFieldId: {
|
|
94
|
+
[fieldId: string]: {
|
|
95
|
+
[targetId: string]: PropertyValue<unknown>;
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
export type PropertyGroupsState = {
|
|
100
|
+
byId: IDMappedObjects<PropertyGroup>;
|
|
101
|
+
byName: {
|
|
102
|
+
[name: string]: PropertyGroup;
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
export type PropertyValuesUpdated<T> = {
|
|
106
|
+
object_type?: string;
|
|
107
|
+
target_id?: string;
|
|
108
|
+
field_id?: string;
|
|
109
|
+
values: Array<PropertyValue<T>>;
|
|
110
|
+
};
|
package/lib/shared_channels.d.ts
CHANGED
|
@@ -14,11 +14,13 @@ export type SharedChannelRemote = {
|
|
|
14
14
|
last_post_create_id: string;
|
|
15
15
|
};
|
|
16
16
|
export type RemoteClusterInfo = {
|
|
17
|
+
remote_id: string;
|
|
17
18
|
name: string;
|
|
18
19
|
display_name: string;
|
|
19
20
|
create_at: number;
|
|
20
21
|
delete_at: number;
|
|
21
22
|
last_ping_at: number;
|
|
23
|
+
site_url?: string;
|
|
22
24
|
};
|
|
23
25
|
export type SharedChannelsState = {
|
|
24
26
|
remotes: Record<string, RemoteClusterInfo[]>;
|
package/lib/store.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ import type { JobsState } from './jobs';
|
|
|
17
17
|
import type { LimitsState } from './limits';
|
|
18
18
|
import type { PostsState } from './posts';
|
|
19
19
|
import type { PreferenceType } from './preferences';
|
|
20
|
+
import type { PropertiesState } from './properties';
|
|
20
21
|
import type { Recap } from './recaps';
|
|
21
22
|
import type { AdminRequestsStatuses, ChannelsRequestsStatuses, FilesRequestsStatuses, GeneralRequestsStatuses, PostsRequestsStatuses, RolesRequestsStatuses, TeamsRequestsStatuses, UsersRequestsStatuses } from './requests';
|
|
22
23
|
import type { Role } from './roles';
|
|
@@ -95,6 +96,7 @@ export type GlobalState = {
|
|
|
95
96
|
remotesByRemoteId?: Record<string, RemoteClusterInfo>;
|
|
96
97
|
};
|
|
97
98
|
contentFlagging: ContentFlaggingState;
|
|
99
|
+
properties: PropertiesState;
|
|
98
100
|
};
|
|
99
101
|
errors: any[];
|
|
100
102
|
requests: {
|