mattermost-mobile/app/client/rest/index.ts
Felipe Martin f50056f57b
MM-65085: Support Pre Shared Password on server connect (#9082)
* feat: add shared server password to server setup

* feat: allow editing the sever

* refactor: changed password -> secret, styling and tests

* e2e: draft e2e tests

* chore: lint fix

* feat: also send preauth secret header when using native share

* fix: removed unused server database migration

credentials are being stored in the keychain

* i18n: added missing english translations

* test(e2e): simplified connection tests

* test(e2e): rework

* refactor: remove setBearerToken

* chore: restore migrations the way it was

* chore: reverted file to original state

* chore: removed unneeded test and renamed password to secret

* chore: function version

* chore: updated forms i18n keys

* chore: remove if from test

* chore: unneeded variable

* fix: add missing key on object list

* refactor: swift keychain access to retrieve all credentials in one call

* revert: edit server screen

* refactor: credentials use getGenericCredential

* fix: objc code calling old method

* fix: added scroll to login screen

* chore: variable names

* fix: avoid inline styles

* fix: Improved appVersion positioning

* Update app/screens/server/form.tsx

Co-authored-by: Matthew Birtch <mattbirtch@gmail.com>

* feat: show error message on 403

* Revert "feat: show error message on 403"

This reverts commit f41630c767e10211adf1885321ceefd8a0931e32.

---------

Co-authored-by: Matthew Birtch <mattbirtch@gmail.com>
2025-09-01 11:24:15 +02:00

86 lines
3.1 KiB
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
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 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 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,
ClientAppsMix,
ClientCategoriesMix,
ClientChannelsMix,
ClientChannelBookmarksMix,
ClientEmojisMix,
ClientFilesMix,
ClientGeneralMix,
ClientGroupsMix,
ClientIntegrationsMix,
ClientPostsMix,
ClientPreferencesMix,
ClientScheduledPostMix,
ClientTeamsMix,
ClientThreadsMix,
ClientTosMix,
ClientUsersMix,
ClientCallsMix,
ClientPluginsMix,
ClientNPSMix,
ClientCustomAttributesMix,
ClientPlaybooksMix
{}
class Client extends mix(ClientBase).with(
ClientApps,
ClientCategories,
ClientChannels,
ClientChannelBookmarks,
ClientEmojis,
ClientFiles,
ClientGeneral,
ClientGroups,
ClientIntegrations,
ClientPosts,
ClientPreferences,
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};