@mattermost/types 11.1.0-0 → 11.1.0-1

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.
Files changed (54) hide show
  1. package/lib/access_control.d.ts +71 -0
  2. package/lib/admin.d.ts +147 -0
  3. package/lib/apps.d.ts +191 -0
  4. package/lib/audits.d.ts +9 -0
  5. package/lib/autocomplete.d.ts +12 -0
  6. package/lib/bots.d.ts +15 -0
  7. package/lib/channel_bookmarks.d.ts +51 -0
  8. package/lib/channel_categories.d.ts +30 -0
  9. package/lib/channels.d.ts +190 -0
  10. package/lib/client4.d.ts +42 -0
  11. package/lib/cloud.d.ts +187 -0
  12. package/lib/compliance.d.ts +13 -0
  13. package/lib/config.d.ts +1035 -0
  14. package/lib/content_flagging.d.ts +24 -0
  15. package/lib/data_retention.d.ts +30 -0
  16. package/lib/drafts.d.ts +14 -0
  17. package/lib/emojis.d.ts +44 -0
  18. package/lib/errors.d.ts +8 -0
  19. package/lib/files.d.ts +41 -0
  20. package/lib/general.d.ts +16 -0
  21. package/lib/groups.d.ts +169 -0
  22. package/lib/hosted_customer.d.ts +7 -0
  23. package/lib/integration_actions.d.ts +20 -0
  24. package/lib/integrations.d.ts +187 -0
  25. package/lib/jobs.d.ts +23 -0
  26. package/lib/limits.d.ts +10 -0
  27. package/lib/marketplace.d.ts +42 -0
  28. package/lib/message_attachments.d.ts +24 -0
  29. package/lib/mfa.d.ts +4 -0
  30. package/lib/plugins.d.ts +136 -0
  31. package/lib/posts.d.ts +182 -0
  32. package/lib/preferences.d.ts +9 -0
  33. package/lib/product_notices.d.ts +26 -0
  34. package/lib/products.d.ts +8 -0
  35. package/lib/properties.d.ts +60 -0
  36. package/lib/reactions.d.ts +6 -0
  37. package/lib/remote_clusters.d.ts +35 -0
  38. package/lib/reports.d.ts +65 -0
  39. package/lib/requests.d.ts +53 -0
  40. package/lib/roles.d.ts +12 -0
  41. package/lib/saml.d.ts +10 -0
  42. package/lib/schedule_post.d.ts +27 -0
  43. package/lib/schemes.d.ts +29 -0
  44. package/lib/search.d.ts +29 -0
  45. package/lib/sessions.d.ts +15 -0
  46. package/lib/setup.d.ts +4 -0
  47. package/lib/shared_channels.d.ts +26 -0
  48. package/lib/store.d.ts +97 -0
  49. package/lib/teams.d.ts +99 -0
  50. package/lib/terms_of_service.d.ts +6 -0
  51. package/lib/threads.d.ts +63 -0
  52. package/lib/typing.d.ts +5 -0
  53. package/lib/users.d.ts +140 -0
  54. package/package.json +1 -1
@@ -0,0 +1,190 @@
1
+ import type { Team } from './teams';
2
+ import type { IDMappedObjects, RelationOneToManyUnique, RelationOneToOne } from './utilities';
3
+ export type ChannelType = 'O' | 'P' | 'D' | 'G' | 'threads';
4
+ export 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 type ChannelNotifyProps = {
12
+ desktop_threads: 'default' | 'all' | 'mention' | 'none';
13
+ desktop: 'default' | 'all' | 'mention' | 'none';
14
+ desktop_sound: 'default' | 'on' | 'off';
15
+ desktop_notification_sound?: 'default' | 'Bing' | 'Crackle' | 'Down' | 'Hello' | 'Ripple' | 'Upstairs';
16
+ email: 'default' | 'all' | 'mention' | 'none';
17
+ mark_unread: 'all' | 'mention';
18
+ push: 'default' | 'all' | 'mention' | 'none';
19
+ push_threads: 'default' | 'all' | 'mention' | 'none';
20
+ ignore_channel_mentions: 'default' | 'off' | 'on';
21
+ channel_auto_follow_threads: 'off' | 'on';
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;
29
+ export type Channel = {
30
+ id: string;
31
+ create_at: number;
32
+ update_at: number;
33
+ delete_at: number;
34
+ team_id: string;
35
+ type: ChannelType;
36
+ display_name: string;
37
+ name: string;
38
+ header: string;
39
+ purpose: string;
40
+ last_post_at: number;
41
+ last_root_post_at: number;
42
+ creator_id: string;
43
+ scheme_id: string;
44
+ teammate_id?: string;
45
+ status?: string;
46
+ group_constrained: boolean;
47
+ shared?: boolean;
48
+ props?: Record<string, any>;
49
+ policy_id?: string | null;
50
+ banner_info?: ChannelBanner;
51
+ policy_enforced?: boolean;
52
+ default_category_name?: string;
53
+ };
54
+ export type ServerChannel = Channel & {
55
+ /**
56
+ * The total number of posts in this channel, not including join/leave messages
57
+ *
58
+ * @remarks This field will be moved to a {@link ChannelMessageCount} object when this channel is stored in Redux.
59
+ */
60
+ total_msg_count: number;
61
+ /**
62
+ * The number of root posts in this channel, not including join/leave messages
63
+ *
64
+ * @remarks This field will be moved to a {@link ChannelMessageCount} object when this channel is stored in Redux.
65
+ */
66
+ total_msg_count_root: number;
67
+ };
68
+ export type ChannelMessageCount = {
69
+ /** The total number of posts in this channel, not including join/leave messages */
70
+ total: number;
71
+ /** The number of root posts in this channel, not including join/leave messages */
72
+ root: number;
73
+ };
74
+ export type ChannelWithTeamData = Channel & {
75
+ team_display_name: string;
76
+ team_name: string;
77
+ team_update_at: number;
78
+ };
79
+ export type ChannelsWithTotalCount = {
80
+ channels: ChannelWithTeamData[];
81
+ total_count: number;
82
+ };
83
+ export type ChannelMembership = {
84
+ channel_id: string;
85
+ user_id: string;
86
+ roles: string;
87
+ last_viewed_at: number;
88
+ /** The number of posts in this channel which have been read by the user */
89
+ msg_count: number;
90
+ /** The number of root posts in this channel which have been read by the user */
91
+ msg_count_root: number;
92
+ /** The number of unread mentions in this channel */
93
+ mention_count: number;
94
+ /** The number of unread mentions in root posts in this channel */
95
+ mention_count_root: number;
96
+ /** The number of unread urgent mentions in this channel */
97
+ urgent_mention_count: number;
98
+ notify_props: Partial<ChannelNotifyProps>;
99
+ last_update_at: number;
100
+ scheme_user: boolean;
101
+ scheme_admin: boolean;
102
+ post_root_id?: string;
103
+ };
104
+ export type ChannelUnread = {
105
+ channel_id: string;
106
+ user_id: string;
107
+ team_id: string;
108
+ /** The number of posts which have been read by the user */
109
+ msg_count: number;
110
+ /** The number of root posts which have been read by the user */
111
+ msg_count_root: number;
112
+ /** The number of unread mentions in this channel */
113
+ mention_count: number;
114
+ /** The number of unread urgent mentions in this channel */
115
+ urgent_mention_count: number;
116
+ /** The number of unread mentions in root posts in this channel */
117
+ mention_count_root: number;
118
+ last_viewed_at: number;
119
+ deltaMsgs: number;
120
+ };
121
+ export type ChannelsState = {
122
+ currentChannelId: string;
123
+ channels: IDMappedObjects<Channel>;
124
+ channelsInTeam: RelationOneToManyUnique<Team, Channel>;
125
+ myMembers: RelationOneToOne<Channel, ChannelMembership>;
126
+ roles: RelationOneToOne<Channel, Set<string>>;
127
+ membersInChannel: RelationOneToOne<Channel, Record<string, ChannelMembership>>;
128
+ stats: RelationOneToOne<Channel, ChannelStats>;
129
+ groupsAssociatedToChannel: any;
130
+ totalCount: number;
131
+ manuallyUnread: RelationOneToOne<Channel, boolean>;
132
+ channelModerations: RelationOneToOne<Channel, ChannelModeration[]>;
133
+ channelMemberCountsByGroup: RelationOneToOne<Channel, ChannelMemberCountsByGroup>;
134
+ messageCounts: RelationOneToOne<Channel, ChannelMessageCount>;
135
+ channelsMemberCount: Record<string, number>;
136
+ restrictedDMs: RelationOneToOne<Channel, boolean>;
137
+ };
138
+ export type ChannelModeration = {
139
+ name: string;
140
+ roles: {
141
+ guests?: {
142
+ value: boolean;
143
+ enabled: boolean;
144
+ };
145
+ members: {
146
+ value: boolean;
147
+ enabled: boolean;
148
+ };
149
+ admins: {
150
+ value: boolean;
151
+ enabled: boolean;
152
+ };
153
+ };
154
+ };
155
+ export type ChannelModerationPatch = {
156
+ name: string;
157
+ roles: {
158
+ guests?: boolean;
159
+ members?: boolean;
160
+ };
161
+ };
162
+ export type ChannelMemberCountByGroup = {
163
+ group_id: string;
164
+ channel_member_count: number;
165
+ channel_member_timezones_count: number;
166
+ };
167
+ export type ChannelMemberCountsByGroup = Record<string, ChannelMemberCountByGroup>;
168
+ export type ChannelViewResponse = {
169
+ status: string;
170
+ last_viewed_at_times: RelationOneToOne<Channel, number>;
171
+ };
172
+ export type ChannelSearchOpts = {
173
+ nonAdminSearch?: boolean;
174
+ exclude_default_channels?: boolean;
175
+ not_associated_to_group?: string;
176
+ team_ids?: string[];
177
+ group_constrained?: boolean;
178
+ exclude_group_constrained?: boolean;
179
+ public?: boolean;
180
+ private?: boolean;
181
+ include_deleted?: boolean;
182
+ include_search_by_id?: boolean;
183
+ exclude_remote?: boolean;
184
+ deleted?: boolean;
185
+ page?: number;
186
+ per_page?: number;
187
+ access_control_policy_enforced?: boolean;
188
+ exclude_access_control_policy_enforced?: boolean;
189
+ parent_access_control_policy_id?: string;
190
+ };
@@ -0,0 +1,42 @@
1
+ export declare enum LogLevel {
2
+ Error = "ERROR",
3
+ Warning = "WARNING",
4
+ Info = "INFO",
5
+ Debug = "DEBUG"
6
+ }
7
+ export type ClientResponse<T> = {
8
+ response: Response;
9
+ headers: Map<string, string>;
10
+ data: T;
11
+ };
12
+ export type Options = {
13
+ headers?: {
14
+ [x: string]: string;
15
+ };
16
+ method?: string;
17
+ url?: string;
18
+ credentials?: 'omit' | 'same-origin' | 'include';
19
+ body?: any;
20
+ signal?: RequestInit['signal'];
21
+ ignoreStatus?: boolean; /** If true, status codes > 300 are ignored and don't cause an error */
22
+ duplex?: 'half'; /** Optional, but required for node clients. Must be 'half' for half-duplex fetch; 'full' is reserved for future use. See https://fetch.spec.whatwg.org/#dom-requestinit-duplex */
23
+ };
24
+ export type OptsSignalExt = {
25
+ signal?: AbortSignal;
26
+ };
27
+ export type StatusOK = {
28
+ status: 'OK';
29
+ };
30
+ export declare const isStatusOK: (x: StatusOK | Record<string, unknown>) => x is StatusOK;
31
+ export type FetchPaginatedThreadOptions = {
32
+ fetchThreads?: boolean;
33
+ collapsedThreads?: boolean;
34
+ collapsedThreadsExtended?: boolean;
35
+ updatesOnly?: boolean;
36
+ direction?: 'up' | 'down';
37
+ fetchAll?: boolean;
38
+ perPage?: number;
39
+ fromCreateAt?: number;
40
+ fromUpdateAt?: number;
41
+ fromPost?: string;
42
+ };
package/lib/cloud.d.ts ADDED
@@ -0,0 +1,187 @@
1
+ import type { AllowedIPRange } from './config';
2
+ export type CloudState = {
3
+ subscription?: Subscription;
4
+ products?: Record<string, Product>;
5
+ customer?: CloudCustomer;
6
+ invoices?: Record<string, Invoice>;
7
+ limits: {
8
+ limitsLoaded: boolean;
9
+ limits: Limits;
10
+ };
11
+ errors: {
12
+ subscription?: true;
13
+ products?: true;
14
+ customer?: true;
15
+ invoices?: true;
16
+ limits?: true;
17
+ trueUpReview?: true;
18
+ };
19
+ };
20
+ export type Installation = {
21
+ id: string;
22
+ state: string;
23
+ allowed_ip_ranges: AllowedIPRange[];
24
+ };
25
+ export type Subscription = {
26
+ id: string;
27
+ customer_id: string;
28
+ product_id: string;
29
+ add_ons: string[];
30
+ start_at: number;
31
+ end_at: number;
32
+ create_at: number;
33
+ seats: number;
34
+ last_invoice?: Invoice;
35
+ upcoming_invoice?: Invoice;
36
+ trial_end_at: number;
37
+ is_free_trial: string;
38
+ delinquent_since?: number;
39
+ compliance_blocked?: string;
40
+ billing_type?: string;
41
+ cancel_at?: number;
42
+ will_renew?: string;
43
+ simulated_current_time_ms?: number;
44
+ is_cloud_preview?: boolean;
45
+ };
46
+ export type Product = {
47
+ id: string;
48
+ name: string;
49
+ description: string;
50
+ price_per_seat: number;
51
+ add_ons: AddOn[];
52
+ product_family: string;
53
+ sku: string;
54
+ billing_scheme: string;
55
+ recurring_interval: string;
56
+ cross_sells_to: string;
57
+ };
58
+ export type AddOn = {
59
+ id: string;
60
+ name: string;
61
+ display_name: string;
62
+ price_per_seat: number;
63
+ };
64
+ export type CloudCustomer = {
65
+ id: string;
66
+ creator_id: string;
67
+ create_at: number;
68
+ email: string;
69
+ name: string;
70
+ num_employees: number;
71
+ contact_first_name: string;
72
+ contact_last_name: string;
73
+ billing_address: Address;
74
+ company_address: Address;
75
+ payment_method: PaymentMethod;
76
+ };
77
+ export type CloudCustomerPatch = {
78
+ email?: string;
79
+ name?: string;
80
+ num_employees?: number;
81
+ contact_first_name?: string;
82
+ contact_last_name?: string;
83
+ };
84
+ export type Address = {
85
+ city: string;
86
+ country: string;
87
+ line1: string;
88
+ line2: string;
89
+ postal_code: string;
90
+ state: string;
91
+ };
92
+ export type PaymentMethod = {
93
+ type: string;
94
+ last_four: string;
95
+ exp_month: number;
96
+ exp_year: number;
97
+ card_brand: string;
98
+ name: string;
99
+ };
100
+ export type NotifyAdminRequest = {
101
+ trial_notification: boolean;
102
+ required_plan: string;
103
+ required_feature: string;
104
+ };
105
+ export type Invoice = {
106
+ id: string;
107
+ number: string;
108
+ create_at: number;
109
+ total: number;
110
+ tax: number;
111
+ status: string;
112
+ description: string;
113
+ period_start: number;
114
+ period_end: number;
115
+ subscription_id: string;
116
+ line_items: InvoiceLineItem[];
117
+ current_product_name: string;
118
+ };
119
+ export declare const InvoiceLineItemType: {
120
+ readonly Full: "full";
121
+ readonly Partial: "partial";
122
+ readonly OnPremise: "onpremise";
123
+ readonly Metered: "metered";
124
+ };
125
+ export type InvoiceLineItem = {
126
+ price_id: string;
127
+ total: number;
128
+ quantity: number;
129
+ price_per_unit: number;
130
+ description: string;
131
+ type: typeof InvoiceLineItemType[keyof typeof InvoiceLineItemType];
132
+ metadata: Record<string, string>;
133
+ period_start: number;
134
+ period_end: number;
135
+ };
136
+ export type Limits = {
137
+ messages?: {
138
+ history?: number;
139
+ };
140
+ files?: {
141
+ total_storage?: number;
142
+ };
143
+ teams?: {
144
+ active?: number;
145
+ };
146
+ };
147
+ export interface CloudUsage {
148
+ files: {
149
+ totalStorage: number;
150
+ totalStorageLoaded: boolean;
151
+ };
152
+ messages: {
153
+ history: number;
154
+ historyLoaded: boolean;
155
+ };
156
+ teams: TeamsUsage;
157
+ }
158
+ export type TeamsUsage = {
159
+ active: number;
160
+ cloudArchived: number;
161
+ teamsLoaded: boolean;
162
+ };
163
+ export type ValidBusinessEmail = {
164
+ is_valid: boolean;
165
+ };
166
+ export interface NewsletterRequestBody {
167
+ email: string;
168
+ subscribed_content: string;
169
+ }
170
+ export declare const areShippingDetailsValid: (address: Address | null | undefined) => boolean;
171
+ export type Feedback = {
172
+ reason: string;
173
+ comments: string;
174
+ };
175
+ export type MessageDescriptor = {
176
+ id: string;
177
+ defaultMessage: string;
178
+ values?: Record<string, any>;
179
+ };
180
+ export type PreviewModalContentData = {
181
+ skuLabel: MessageDescriptor;
182
+ title: MessageDescriptor;
183
+ subtitle: MessageDescriptor;
184
+ videoUrl: string;
185
+ videoPoster?: string;
186
+ useCase: string;
187
+ };
@@ -0,0 +1,13 @@
1
+ export type Compliance = {
2
+ id: string;
3
+ create_at: number;
4
+ user_id: string;
5
+ status: string;
6
+ count: number;
7
+ desc: string;
8
+ type: string;
9
+ start_at: number;
10
+ end_at: number;
11
+ keywords: string;
12
+ emails: string;
13
+ };