mattermost-mobile-upstream/app/client/rest/index.ts
Carlos Garcia ad6b834d34
Mm 68296 audit ephemeral mode events (#10139)
* consider all error paths when wiping server artifacts

* log events related to ephemeral mode to keep an audit log server side

* adds playbook run delete count to cleanup audit events

* sends signature as proof for auditing wipe events

* fixes some missed data in audit events

* throw and log errors while enqueuing audit events

* report exact deleted count on audit event

* test terminate session prunes audit event queue in all cases

* assert on queue lenght in tests

* fetch count inside write transaction to return accurate value

* remove delete count expectations from tests since unsafe where clauses are not supported by loki
2026-09-23 13:48:14 +02:00

99 lines
3.6 KiB
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import ClientAgents, {type ClientAgentsMix} from '@agents/client/rest';
import ClientCalls, {type ClientCallsMix} from '@calls/client/rest';
import ClientPlugins, {type ClientPluginsMix} from '@client/rest/plugins';
import ClientPlaybooks, {type ClientPlaybooksMix} from '@playbooks/client/rest';
import mix from '@utils/mix';
import ClientApps, {type ClientAppsMix} from './apps';
import ClientBase from './base';
import ClientCategories, {type ClientCategoriesMix} from './categories';
import ClientChannelBookmarks, {type ClientChannelBookmarksMix} from './channel_bookmark';
import ClientChannels, {type ClientChannelsMix} from './channels';
import {DEFAULT_LIMIT_AFTER, DEFAULT_LIMIT_BEFORE, HEADER_X_VERSION_ID} from './constants';
import ClientCustomAttributes, {type ClientCustomAttributesMix} from './custom_profile_attributes';
import ClientEmojis, {type ClientEmojisMix} from './emojis';
import ClientEphemeralMode, {type ClientEphemeralModeMix} from './ephemeral_mode';
import ClientFiles, {type ClientFilesMix} from './files';
import ClientGeneral, {type ClientGeneralMix} from './general';
import ClientGroups, {type ClientGroupsMix} from './groups';
import ClientIntegrations, {type ClientIntegrationsMix} from './integrations';
import ClientNPS, {type ClientNPSMix} from './nps';
import ClientPosts, {type ClientPostsMix} from './posts';
import ClientPreferences, {type ClientPreferencesMix} from './preferences';
import ClientProperties, {type ClientPropertiesMix} from './properties';
import ClientScheduledPost, {type ClientScheduledPostMix} from './scheduled_post';
import ClientTeams, {type ClientTeamsMix} from './teams';
import ClientThreads, {type ClientThreadsMix} from './threads';
import ClientTos, {type ClientTosMix} from './tos';
import ClientUsers, {type ClientUsersMix} from './users';
import type {APIClientInterface} from '@mattermost/react-native-network-client';
interface Client extends ClientBase,
ClientAgentsMix,
ClientAppsMix,
ClientCategoriesMix,
ClientChannelsMix,
ClientChannelBookmarksMix,
ClientEmojisMix,
ClientEphemeralModeMix,
ClientFilesMix,
ClientGeneralMix,
ClientGroupsMix,
ClientIntegrationsMix,
ClientPostsMix,
ClientPreferencesMix,
ClientPropertiesMix,
ClientScheduledPostMix,
ClientTeamsMix,
ClientThreadsMix,
ClientTosMix,
ClientUsersMix,
ClientCallsMix,
ClientPluginsMix,
ClientNPSMix,
ClientCustomAttributesMix,
ClientPlaybooksMix
{
setClientCredentials: (token: string, preauthSecret?: string) => void;
setCSRFToken: (csrfToken: string) => void;
}
class Client extends mix(ClientBase).with(
ClientAgents,
ClientApps,
ClientCategories,
ClientChannels,
ClientChannelBookmarks,
ClientEmojis,
ClientEphemeralMode,
ClientFiles,
ClientGeneral,
ClientGroups,
ClientIntegrations,
ClientPosts,
ClientPreferences,
ClientProperties,
ClientScheduledPost,
ClientTeams,
ClientThreads,
ClientTos,
ClientUsers,
ClientCalls,
ClientPlugins,
ClientNPS,
ClientCustomAttributes,
ClientScheduledPost,
ClientPlaybooks,
) {
// eslint-disable-next-line no-useless-constructor
constructor(apiClient: APIClientInterface, serverUrl: string, bearerToken?: string, csrfToken?: string, preauthSecret?: string) {
super(apiClient, serverUrl, bearerToken, csrfToken, preauthSecret);
}
}
export {Client, DEFAULT_LIMIT_AFTER, DEFAULT_LIMIT_BEFORE, HEADER_X_VERSION_ID};