@mattermost/types 10.7.0 → 10.9.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.
@@ -0,0 +1,70 @@
1
+ import type { ChannelWithTeamData } from './channels';
2
+ import type { UserProfile } from './users';
3
+ export type AccessControlPolicy = {
4
+ id: string;
5
+ name: string;
6
+ type: string;
7
+ revision?: number;
8
+ created_at?: number;
9
+ version?: string;
10
+ active?: boolean;
11
+ imports?: string[];
12
+ props?: Record<string, unknown[]>;
13
+ rules: AccessControlPolicyRule[];
14
+ };
15
+ export type AccessControlPolicyCursor = {
16
+ id: string;
17
+ };
18
+ export type AccessControlPoliciesResult = {
19
+ policies: AccessControlPolicy[];
20
+ total: number;
21
+ };
22
+ export type AccessControlPolicySearchOpts = {
23
+ term: string;
24
+ type: string;
25
+ cursor: AccessControlPolicyCursor;
26
+ limit: number;
27
+ };
28
+ export type AccessControlPolicyChannelsResult = {
29
+ channels: ChannelWithTeamData[];
30
+ total: number;
31
+ };
32
+ export type AccessControlPolicyRule = {
33
+ actions?: string[];
34
+ expression: string;
35
+ };
36
+ export type CELExpressionError = {
37
+ message: string;
38
+ line: number;
39
+ column: number;
40
+ };
41
+ export type AccessControlTestResult = {
42
+ users: UserProfile[];
43
+ total: number;
44
+ };
45
+ export type AccessControlAttribute = {
46
+ name: string;
47
+ values: string[];
48
+ };
49
+ export type AccessControlVisualAST = {
50
+ conditions: AccessControlVisualASTNode[];
51
+ };
52
+ export type AccessControlVisualASTNode = {
53
+ attribute: string;
54
+ operator: string;
55
+ value: any;
56
+ value_type: number;
57
+ };
58
+ /**
59
+ * Type definition for access control attributes
60
+ */
61
+ export type AccessControlAttributes = Record<string, string[]>;
62
+ /**
63
+ * Interface for entities that can have access control
64
+ */
65
+ export interface AccessControlled {
66
+ /**
67
+ * Whether access control is enforced for this entity
68
+ */
69
+ access_control_enforced?: boolean;
70
+ }
@@ -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/lib/admin.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import type { AccessControlPolicy } from './access_control';
1
2
  import type { Audit } from './audits';
2
3
  import type { Compliance } from './compliance';
3
4
  import type { AdminConfig, ClientLicense, EnvironmentConfig } from './config';
@@ -7,7 +8,7 @@ import type { PluginRedux, PluginStatusRedux } from './plugins';
7
8
  import type { SamlCertificateStatus, SamlMetadataResponse } from './saml';
8
9
  import type { Team } from './teams';
9
10
  import type { UserAccessToken, UserProfile } from './users';
10
- import type { RelationOneToOne } from './utilities';
11
+ import type { RelationOneToOne, IDMappedObjects } from './utilities';
11
12
  export declare enum LogLevelEnum {
12
13
  SILLY = "silly",
13
14
  DEBUG = "debug",
@@ -60,6 +61,8 @@ export type AdminState = {
60
61
  dataRetentionCustomPolicies: DataRetentionCustomPolicies;
61
62
  dataRetentionCustomPoliciesCount: number;
62
63
  prevTrialLicense: ClientLicense;
64
+ accessControlPolicies: IDMappedObjects<AccessControlPolicy>;
65
+ channelsForAccessControlPolicy: Record<string, string[]>;
63
66
  };
64
67
  export type AnalyticsState = {
65
68
  POST_PER_DAY?: AnalyticsRow[];
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,8 @@ export type Channel = {
41
47
  shared?: boolean;
42
48
  props?: Record<string, any>;
43
49
  policy_id?: string | null;
50
+ banner_info?: ChannelBanner;
51
+ policy_enforced?: boolean;
44
52
  };
45
53
  export type ServerChannel = Channel & {
46
54
  /**
@@ -174,4 +182,7 @@ export type ChannelSearchOpts = {
174
182
  deleted?: boolean;
175
183
  page?: number;
176
184
  per_page?: number;
185
+ access_control_policy_enforced?: boolean;
186
+ exclude_access_control_policy_enforced?: boolean;
187
+ parent_access_control_policy_id?: string;
177
188
  };
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/client4.d.ts CHANGED
@@ -32,9 +32,11 @@ export type FetchPaginatedThreadOptions = {
32
32
  fetchThreads?: boolean;
33
33
  collapsedThreads?: boolean;
34
34
  collapsedThreadsExtended?: boolean;
35
+ updatesOnly?: boolean;
35
36
  direction?: 'up' | 'down';
36
37
  fetchAll?: boolean;
37
38
  perPage?: number;
38
39
  fromCreateAt?: number;
40
+ fromUpdateAt?: number;
39
41
  fromPost?: string;
40
42
  };
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;
@@ -121,6 +122,7 @@ export type ClientConfig = {
121
122
  FeatureFlagAppsEnabled: string;
122
123
  FeatureFlagCallsEnabled: string;
123
124
  FeatureFlagCustomProfileAttributes: string;
125
+ FeatureFlagAttributeBasedAccessControl: string;
124
126
  FeatureFlagWebSocketEventScope: string;
125
127
  ForgotPasswordLink: string;
126
128
  GiphySdkKey: string;
@@ -164,6 +166,9 @@ export type ClientConfig = {
164
166
  PostEditTimeLimit: string;
165
167
  PrivacyPolicyLink: string;
166
168
  ReportAProblemLink: string;
169
+ ReportAProblemType: string;
170
+ ReportAProblemMail: string;
171
+ AllowDownloadLogs: string;
167
172
  RequireEmailVerification: string;
168
173
  RestrictDirectMessage: string;
169
174
  RunJobs: string;
@@ -343,6 +348,7 @@ export type ServiceSettings = {
343
348
  GiphySdkKey: string;
344
349
  PostEditTimeLimit: number;
345
350
  TimeBetweenUserTypingUpdatesMilliseconds: number;
351
+ EnableCrossTeamSearch: boolean;
346
352
  EnablePostSearch: boolean;
347
353
  EnableFileSearch: boolean;
348
354
  MinimumHashtagLength: number;
@@ -391,6 +397,8 @@ export type ServiceSettings = {
391
397
  EnableDesktopLandingPage: boolean;
392
398
  MaximumURLLength: number;
393
399
  ScheduledPosts: boolean;
400
+ EnableWebHubChannelIteration: boolean;
401
+ FrameAncestors: string;
394
402
  };
395
403
  export type TeamSettings = {
396
404
  SiteName: string;
@@ -465,6 +473,7 @@ export type ExperimentalAuditSettings = {
465
473
  FileCompress: boolean;
466
474
  FileMaxQueueSize: number;
467
475
  AdvancedLoggingJSON: Record<string, any>;
476
+ Certificate: string;
468
477
  };
469
478
  export type NotificationLogSettings = {
470
479
  EnableConsole: boolean;
@@ -598,6 +607,9 @@ export type SupportSettings = {
598
607
  AboutLink: string;
599
608
  HelpLink: string;
600
609
  ReportAProblemLink: string;
610
+ ReportAProblemType: string;
611
+ ReportAProblemMail: string;
612
+ AllowDownloadLogs: boolean;
601
613
  ForgotPasswordLink: string;
602
614
  SupportEmail: string;
603
615
  CustomTermsOfServiceEnabled: boolean;
@@ -736,6 +748,9 @@ export type NativeAppSettings = {
736
748
  AndroidAppDownloadLink: string;
737
749
  IosAppDownloadLink: string;
738
750
  MobileExternalBrowser: boolean;
751
+ MobileEnableBiometrics: boolean;
752
+ MobilePreventScreenCapture: boolean;
753
+ MobileJailbreakProtection: boolean;
739
754
  };
740
755
  export type ClusterSettings = {
741
756
  Enable: boolean;
@@ -756,6 +771,7 @@ export type MetricsSettings = {
756
771
  ListenAddress: string;
757
772
  EnableClientMetrics: boolean;
758
773
  EnableNotificationMetrics: boolean;
774
+ ClientSideUserIds: string[];
759
775
  };
760
776
  export type ExperimentalSettings = {
761
777
  ClientSideCertEnable: boolean;
@@ -779,6 +795,7 @@ export type CacheSettings = {
779
795
  RedisAddress: string;
780
796
  RedisPassword: string;
781
797
  RedisDB: number;
798
+ RedisCachePrefix: string;
782
799
  DisableClientCache: boolean;
783
800
  };
784
801
  export type ElasticsearchSettings = {
@@ -799,6 +816,7 @@ export type ElasticsearchSettings = {
799
816
  AggregatePostsAfterDays: number;
800
817
  PostsAggregatorJobStartTime: string;
801
818
  IndexPrefix: string;
819
+ GlobalSearchPrefix: string;
802
820
  LiveIndexingBatchSize: number;
803
821
  BatchSize: number;
804
822
  RequestTimeoutSeconds: number;
@@ -906,6 +924,10 @@ export type ExportSettings = {
906
924
  Directory: string;
907
925
  RetentionDays: number;
908
926
  };
927
+ export type AccessControlSettings = {
928
+ EnableAttributeBasedAccessControl: boolean;
929
+ EnableChannelScopeAccessControl: boolean;
930
+ };
909
931
  export type AdminConfig = {
910
932
  ServiceSettings: ServiceSettings;
911
933
  TeamSettings: TeamSettings;
@@ -951,6 +973,7 @@ export type AdminConfig = {
951
973
  ExportSettings: ExportSettings;
952
974
  WranglerSettings: WranglerSettings;
953
975
  ConnectedWorkspacesSettings: ConnectedWorkspacesSettings;
976
+ AccessControlSettings: AccessControlSettings;
954
977
  };
955
978
  export type ReplicaLagSetting = {
956
979
  DataSource: string;
package/lib/groups.d.ts CHANGED
@@ -152,6 +152,12 @@ export type GroupSearchParams = GetGroupsParams & {
152
152
  include_timezones?: string;
153
153
  include_channel_member_count?: string;
154
154
  };
155
+ export type GroupMember = {
156
+ group_id: string;
157
+ user_id: string;
158
+ create_at: number;
159
+ deleted_at: number;
160
+ };
155
161
  export type GroupMembership = {
156
162
  user_id: string;
157
163
  roles: string;
package/lib/jobs.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { IDMappedObjects } from './utilities';
2
- export type JobType = 'data_retention' | 'elasticsearch_post_indexing' | 'bleve_post_indexing' | 'ldap_sync' | 'message_export';
2
+ export type JobType = 'data_retention' | 'elasticsearch_post_indexing' | 'bleve_post_indexing' | 'ldap_sync' | 'message_export' | 'access_control_sync';
3
3
  export type JobStatus = 'pending' | 'in_progress' | 'success' | 'error' | 'cancel_requested' | 'canceled' | 'warning';
4
4
  export type Job = JobTypeBase & {
5
5
  id: string;
@@ -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: string;
6
+ type: FieldType;
6
7
  attrs?: {
7
8
  [key: string]: unknown;
8
9
  };
@@ -22,13 +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;
30
- attrs?: {
31
- sort_order?: number;
38
+ attrs: {
39
+ sort_order: number;
40
+ visibility: FieldVisibility;
41
+ value_type: FieldValueType;
42
+ options?: PropertyFieldOption[];
43
+ ldap?: string;
44
+ saml?: string;
32
45
  };
33
46
  };
34
- export type UserPropertyFieldPatch = Partial<Pick<UserPropertyField, 'name' | 'attrs' | 'type' | 'attrs'>>;
47
+ export type UserPropertyFieldPatch = Partial<Pick<UserPropertyField, 'name' | 'attrs' | 'type'>>;
package/lib/users.d.ts CHANGED
@@ -55,8 +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[]>;
58
59
  failed_attempts?: number;
59
- custom_profile_attributes?: Record<string, string>;
60
60
  };
61
61
  export type UserProfileWithLastViewAt = UserProfile & {
62
62
  last_viewed_at: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mattermost/types",
3
- "version": "10.7.0",
3
+ "version": "10.9.0",
4
4
  "description": "Shared type definitions used by the Mattermost web app",
5
5
  "keywords": [
6
6
  "mattermost"