Chore: Move services and methods away from rocketchat folder (#4033)
* move services to lib * move methods to lib * fix imports
This commit is contained in:
parent
13a2962fa2
commit
e525392713
|
@ -1,4 +1,4 @@
|
|||
import sdk from '../../../lib/rocketchat/services/sdk';
|
||||
import sdk from '../../../lib/services/sdk';
|
||||
import { IUser } from '../../../definitions';
|
||||
import EventEmitter from '../../../utils/events';
|
||||
import subscribeInquiry from './subscriptions/inquiry';
|
||||
|
|
|
@ -2,7 +2,7 @@ import log from '../../../../utils/log';
|
|||
import { store } from '../../../../lib/store/auxStore';
|
||||
import RocketChat from '../../../../lib/rocketchat';
|
||||
import { inquiryQueueAdd, inquiryQueueRemove, inquiryQueueUpdate, inquiryRequest } from '../../actions/inquiry';
|
||||
import sdk from '../../../../lib/rocketchat/services/sdk';
|
||||
import sdk from '../../../../lib/services/sdk';
|
||||
import { IOmnichannelRoom } from '../../../../definitions';
|
||||
|
||||
interface IArgsQueueOmnichannel extends IOmnichannelRoom {
|
||||
|
|
|
@ -4,7 +4,7 @@ import EventEmitter from '../../utils/events';
|
|||
import fetch from '../../utils/fetch';
|
||||
import random from '../../utils/random';
|
||||
import Navigation from '../navigation/appNavigation';
|
||||
import sdk from '../rocketchat/services/sdk';
|
||||
import sdk from '../services/sdk';
|
||||
|
||||
const triggersId = new Map();
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { ISubscription } from '../../../definitions';
|
||||
import { events, logEvent } from '../../../utils/log';
|
||||
import { store } from '../../store/auxStore';
|
||||
import Navigation from '../../navigation/appNavigation';
|
||||
import { ISubscription } from '../../definitions';
|
||||
import { events, logEvent } from '../../utils/log';
|
||||
import { store } from '../store/auxStore';
|
||||
import Navigation from '../navigation/appNavigation';
|
||||
import sdk from '../services/sdk';
|
||||
|
||||
async function jitsiURL({ room }: { room: ISubscription }) {
|
|
@ -2,7 +2,7 @@ import { ERoomTypes } from '../../definitions';
|
|||
import { store } from '../store/auxStore';
|
||||
import database from '../database';
|
||||
import RocketChat from '../rocketchat';
|
||||
import sdk from '../rocketchat/services/sdk';
|
||||
import sdk from '../services/sdk';
|
||||
|
||||
const restTypes = {
|
||||
channel: 'channels',
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import sdk from '../services/sdk';
|
||||
import { store as reduxStore } from '../../store/auxStore';
|
||||
import database from '../../database';
|
||||
import log from '../../../utils/log';
|
||||
import { clearEnterpriseModules, setEnterpriseModules as setEnterpriseModulesAction } from '../../../actions/enterpriseModules';
|
||||
import { compareServerVersion } from '../../methods/helpers/compareServerVersion';
|
||||
import { store as reduxStore } from '../store/auxStore';
|
||||
import database from '../database';
|
||||
import log from '../../utils/log';
|
||||
import { clearEnterpriseModules, setEnterpriseModules as setEnterpriseModulesAction } from '../../actions/enterpriseModules';
|
||||
import { compareServerVersion } from './helpers/compareServerVersion';
|
||||
|
||||
const LICENSE_OMNICHANNEL_MOBILE_ENTERPRISE = 'omnichannel-mobile-enterprise';
|
||||
const LICENSE_LIVECHAT_ENTERPRISE = 'livechat-enterprise';
|
|
@ -1,14 +1,14 @@
|
|||
import orderBy from 'lodash/orderBy';
|
||||
import { sanitizedRaw } from '@nozbe/watermelondb/RawRecord';
|
||||
|
||||
import { ICustomEmojis } from '../../../reducers/customEmojis';
|
||||
import { store as reduxStore } from '../../store/auxStore';
|
||||
import database from '../../database';
|
||||
import log from '../../../utils/log';
|
||||
import { setCustomEmojis as setCustomEmojisAction } from '../../../actions/customEmojis';
|
||||
import { ICustomEmoji, TCustomEmojiModel } from '../../../definitions';
|
||||
import { ICustomEmojis } from '../../reducers/customEmojis';
|
||||
import { store as reduxStore } from '../store/auxStore';
|
||||
import database from '../database';
|
||||
import log from '../../utils/log';
|
||||
import { setCustomEmojis as setCustomEmojisAction } from '../../actions/customEmojis';
|
||||
import { ICustomEmoji, TCustomEmojiModel } from '../../definitions';
|
||||
import sdk from '../services/sdk';
|
||||
import { compareServerVersion } from '../../methods/helpers/compareServerVersion';
|
||||
import { compareServerVersion } from './helpers/compareServerVersion';
|
||||
|
||||
interface IUpdateEmojis {
|
||||
update: TCustomEmojiModel[];
|
|
@ -1,8 +1,8 @@
|
|||
import log from '../../../utils/log';
|
||||
import { TMessageModel, TSubscriptionModel } from '../../../definitions';
|
||||
import { store } from '../../store/auxStore';
|
||||
import getRoom from '../../methods/getRoom';
|
||||
import log from '../../utils/log';
|
||||
import { TMessageModel, TSubscriptionModel } from '../../definitions';
|
||||
import { store } from '../store/auxStore';
|
||||
import { isGroupChat } from './helpers';
|
||||
import getRoom from './getRoom';
|
||||
|
||||
type TRoomType = 'p' | 'c' | 'd';
|
||||
|
|
@ -2,14 +2,14 @@ import { Q } from '@nozbe/watermelondb';
|
|||
import { sanitizedRaw } from '@nozbe/watermelondb/RawRecord';
|
||||
import orderBy from 'lodash/orderBy';
|
||||
|
||||
import { setPermissions as setPermissionsAction } from '../../../actions/permissions';
|
||||
import { IPermission, TPermissionModel } from '../../../definitions';
|
||||
import log from '../../../utils/log';
|
||||
import { store as reduxStore } from '../../store/auxStore';
|
||||
import database from '../../database';
|
||||
import { setPermissions as setPermissionsAction } from '../../actions/permissions';
|
||||
import { IPermission, TPermissionModel } from '../../definitions';
|
||||
import log from '../../utils/log';
|
||||
import { store as reduxStore } from '../store/auxStore';
|
||||
import database from '../database';
|
||||
import sdk from '../services/sdk';
|
||||
import protectedFunction from '../../methods/helpers/protectedFunction';
|
||||
import { compareServerVersion } from '../../methods/helpers/compareServerVersion';
|
||||
import protectedFunction from './helpers/protectedFunction';
|
||||
import { compareServerVersion } from './helpers/compareServerVersion';
|
||||
|
||||
export const SUPPORTED_PERMISSIONS = [
|
||||
'add-user-to-any-c-room',
|
|
@ -1,14 +1,14 @@
|
|||
import { sanitizedRaw } from '@nozbe/watermelondb/RawRecord';
|
||||
import Model from '@nozbe/watermelondb/Model';
|
||||
|
||||
import database from '../../database';
|
||||
import { getRoleById } from '../../database/services/Role';
|
||||
import log from '../../../utils/log';
|
||||
import { store as reduxStore } from '../../store/auxStore';
|
||||
import { removeRoles, setRoles as setRolesAction, updateRoles } from '../../../actions/roles';
|
||||
import protectedFunction from '../../methods/helpers/protectedFunction';
|
||||
import { TRoleModel } from '../../../definitions';
|
||||
import database from '../database';
|
||||
import { getRoleById } from '../database/services/Role';
|
||||
import log from '../../utils/log';
|
||||
import { store as reduxStore } from '../store/auxStore';
|
||||
import { removeRoles, setRoles as setRolesAction, updateRoles } from '../../actions/roles';
|
||||
import { TRoleModel } from '../../definitions';
|
||||
import sdk from '../services/sdk';
|
||||
import protectedFunction from './helpers/protectedFunction';
|
||||
|
||||
export async function setRoles(): Promise<void> {
|
||||
const db = database.active;
|
|
@ -1,4 +1,4 @@
|
|||
import sdk from '../rocketchat/services/sdk';
|
||||
import sdk from '../services/sdk';
|
||||
|
||||
export default function (updatedSince: Date) {
|
||||
// subscriptions.get: Since RC 0.60.0
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
import { Q } from '@nozbe/watermelondb';
|
||||
import { sanitizedRaw } from '@nozbe/watermelondb/RawRecord';
|
||||
|
||||
import { addSettings, clearSettings } from '../../../actions/settings';
|
||||
import { DEFAULT_AUTO_LOCK, defaultSettings } from '../../constants';
|
||||
import { IPreparedSettings, ISettingsIcon } from '../../../definitions';
|
||||
import fetch from '../../../utils/fetch';
|
||||
import log from '../../../utils/log';
|
||||
import { store as reduxStore } from '../../store/auxStore';
|
||||
import database from '../../database';
|
||||
import RocketChat from '..';
|
||||
import { addSettings, clearSettings } from '../../actions/settings';
|
||||
import { DEFAULT_AUTO_LOCK, defaultSettings } from '../constants';
|
||||
import { IPreparedSettings, ISettingsIcon } from '../../definitions';
|
||||
import fetch from '../../utils/fetch';
|
||||
import log from '../../utils/log';
|
||||
import { store as reduxStore } from '../store/auxStore';
|
||||
import database from '../database';
|
||||
import sdk from '../services/sdk';
|
||||
import protectedFunction from '../../methods/helpers/protectedFunction';
|
||||
import { parseSettings, _prepareSettings } from './helpers';
|
||||
import protectedFunction from './helpers/protectedFunction';
|
||||
|
||||
const serverInfoKeys = [
|
||||
'Site_Name',
|
||||
|
@ -112,7 +112,7 @@ export async function getLoginSettings({ server }: { server: string }): Promise<
|
|||
|
||||
if (result.success && result.settings.length) {
|
||||
reduxStore.dispatch(clearSettings());
|
||||
reduxStore.dispatch(addSettings(RocketChat.parseSettings(RocketChat._prepareSettings(result.settings))));
|
||||
reduxStore.dispatch(addSettings(parseSettings(_prepareSettings(result.settings))));
|
||||
}
|
||||
} catch (e) {
|
||||
log(e);
|
||||
|
@ -131,7 +131,7 @@ export async function setSettings(): Promise<void> {
|
|||
valueAsArray: item.valueAsArray,
|
||||
_updatedAt: item._updatedAt
|
||||
}));
|
||||
reduxStore.dispatch(addSettings(RocketChat.parseSettings(parsed.slice(0, parsed.length))));
|
||||
reduxStore.dispatch(addSettings(parseSettings(parsed.slice(0, parsed.length))));
|
||||
}
|
||||
|
||||
export function subscribeSettings(): void {
|
||||
|
@ -155,10 +155,10 @@ export async function getSettings(): Promise<void> {
|
|||
return;
|
||||
}
|
||||
const data: IData[] = result.settings || [];
|
||||
const filteredSettings: IPreparedSettings[] = RocketChat._prepareSettings(data);
|
||||
const filteredSettings: IPreparedSettings[] = _prepareSettings(data);
|
||||
const filteredSettingsIds = filteredSettings.map(s => s._id);
|
||||
|
||||
reduxStore.dispatch(addSettings(RocketChat.parseSettings(filteredSettings)));
|
||||
reduxStore.dispatch(addSettings(parseSettings(filteredSettings)));
|
||||
|
||||
// filter server info
|
||||
const serverInfo = filteredSettings.filter(i1 => serverInfoKeys.includes(i1._id));
|
|
@ -4,7 +4,7 @@ import database from '../database';
|
|||
import log from '../../utils/log';
|
||||
import protectedFunction from './helpers/protectedFunction';
|
||||
import { ISlashCommandResult, TSlashCommandModel } from '../../definitions';
|
||||
import sdk from '../rocketchat/services/sdk';
|
||||
import sdk from '../services/sdk';
|
||||
|
||||
export default function getSlashCommands() {
|
||||
const db = database.active;
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
import { InteractionManager } from 'react-native';
|
||||
import { sanitizedRaw } from '@nozbe/watermelondb/RawRecord';
|
||||
|
||||
import { IActiveUsers } from '../../../reducers/activeUsers';
|
||||
import { store as reduxStore } from '../../store/auxStore';
|
||||
import { setActiveUsers } from '../../../actions/activeUsers';
|
||||
import { setUser } from '../../../actions/login';
|
||||
import database from '../../database';
|
||||
import { IRocketChat, IUser } from '../../../definitions';
|
||||
import { IActiveUsers } from '../../reducers/activeUsers';
|
||||
import { store as reduxStore } from '../store/auxStore';
|
||||
import { setActiveUsers } from '../../actions/activeUsers';
|
||||
import { setUser } from '../../actions/login';
|
||||
import database from '../database';
|
||||
import { IRocketChat, IUser } from '../../definitions';
|
||||
import sdk from '../services/sdk';
|
||||
import { compareServerVersion } from '../../methods/helpers/compareServerVersion';
|
||||
import { compareServerVersion } from './helpers/compareServerVersion';
|
||||
|
||||
export function subscribeUsersPresence(this: IRocketChat) {
|
||||
const serverVersion = reduxStore.getState().server.version as string;
|
|
@ -1,11 +1,11 @@
|
|||
// @ts-nocheck - TEMP
|
||||
import AsyncStorage from '@react-native-community/async-storage';
|
||||
|
||||
import log from '../../../utils/log';
|
||||
import { store as reduxStore } from '../../store/auxStore';
|
||||
import database from '../../database';
|
||||
import subscribeRoomsTmp from '../../methods/subscriptions/rooms';
|
||||
import { ANALYTICS_EVENTS_KEY, CRASH_REPORT_KEY, defaultSettings } from '../../constants';
|
||||
import log from '../../utils/log';
|
||||
import { store as reduxStore } from '../store/auxStore';
|
||||
import database from '../database';
|
||||
import subscribeRoomsTmp from './subscriptions/rooms';
|
||||
import { ANALYTICS_EVENTS_KEY, CRASH_REPORT_KEY, defaultSettings } from '../constants';
|
||||
|
||||
export function isGroupChat(room): boolean {
|
||||
return ((room.uids && room.uids.length > 2) || (room.usernames && room.usernames.length > 2)) ?? false;
|
|
@ -5,7 +5,7 @@ import { IMessage, TMessageModel } from '../../definitions';
|
|||
import log from '../../utils/log';
|
||||
import { getMessageById } from '../database/services/Message';
|
||||
import roomTypeToApiType, { RoomTypes } from './roomTypeToApiType';
|
||||
import sdk from '../rocketchat/services/sdk';
|
||||
import sdk from '../services/sdk';
|
||||
import updateMessages from './updateMessages';
|
||||
import { generateLoadMoreId } from './helpers/generateLoadMoreId';
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { ILastMessage } from '../../definitions';
|
||||
import log from '../../utils/log';
|
||||
import database from '../database';
|
||||
import sdk from '../rocketchat/services/sdk';
|
||||
import sdk from '../services/sdk';
|
||||
import updateMessages from './updateMessages';
|
||||
|
||||
const getLastUpdate = async (rid: string) => {
|
||||
|
|
|
@ -7,7 +7,7 @@ import { getMessageById } from '../database/services/Message';
|
|||
import { MessageTypeLoad } from '../constants';
|
||||
import updateMessages from './updateMessages';
|
||||
import { TMessageModel } from '../../definitions';
|
||||
import sdk from '../rocketchat/services/sdk';
|
||||
import sdk from '../services/sdk';
|
||||
import { generateLoadMoreId } from './helpers/generateLoadMoreId';
|
||||
|
||||
const COUNT = 50;
|
||||
|
|
|
@ -5,7 +5,7 @@ import orderBy from 'lodash/orderBy';
|
|||
import log from '../../utils/log';
|
||||
import { getMessageById } from '../database/services/Message';
|
||||
import { MessageTypeLoad } from '../constants';
|
||||
import sdk from '../rocketchat/services/sdk';
|
||||
import sdk from '../services/sdk';
|
||||
import { IMessage } from '../../definitions';
|
||||
import updateMessages from './updateMessages';
|
||||
import { generateLoadMoreId } from './helpers/generateLoadMoreId';
|
||||
|
|
|
@ -8,7 +8,7 @@ import { Encryption } from '../encryption';
|
|||
import protectedFunction from './helpers/protectedFunction';
|
||||
import buildMessage from './helpers/buildMessage';
|
||||
import { TThreadMessageModel } from '../../definitions';
|
||||
import sdk from '../rocketchat/services/sdk';
|
||||
import sdk from '../services/sdk';
|
||||
|
||||
async function load({ tmid }: { tmid: string }) {
|
||||
try {
|
||||
|
|
|
@ -2,17 +2,17 @@ import * as FileSystem from 'expo-file-system';
|
|||
import { Rocketchat as RocketchatClient } from '@rocket.chat/sdk';
|
||||
import Model from '@nozbe/watermelondb/Model';
|
||||
|
||||
import { getDeviceToken } from '../../../notifications/push';
|
||||
import { extractHostname } from '../../../utils/server';
|
||||
import { BASIC_AUTH_KEY } from '../../../utils/fetch';
|
||||
import database, { getDatabase } from '../../database';
|
||||
import RocketChat from '..';
|
||||
import { useSsl } from '../../../utils/url';
|
||||
import log from '../../../utils/log';
|
||||
import UserPreferences from '../../methods/userPreferences';
|
||||
import { ICertificate, IRocketChat } from '../../../definitions';
|
||||
import { getDeviceToken } from '../../notifications/push';
|
||||
import { extractHostname } from '../../utils/server';
|
||||
import { BASIC_AUTH_KEY } from '../../utils/fetch';
|
||||
import database, { getDatabase } from '../database';
|
||||
import { useSsl } from '../../utils/url';
|
||||
import log from '../../utils/log';
|
||||
import { ICertificate, IRocketChat } from '../../definitions';
|
||||
import sdk from '../services/sdk';
|
||||
import { E2E_PRIVATE_KEY, E2E_PUBLIC_KEY, E2E_RANDOM_PASSWORD_KEY } from '../../constants';
|
||||
import { E2E_PRIVATE_KEY, E2E_PUBLIC_KEY, E2E_RANDOM_PASSWORD_KEY } from '../constants';
|
||||
import UserPreferences from './userPreferences';
|
||||
import RocketChat from '../rocketchat';
|
||||
|
||||
function removeServerKeys({ server, userId }: { server: string; userId?: string | null }) {
|
||||
UserPreferences.removeItem(`${RocketChat.TOKEN_KEY}-${server}`);
|
|
@ -1,7 +1,7 @@
|
|||
import database from '../database';
|
||||
import log from '../../utils/log';
|
||||
import { TSubscriptionModel } from '../../definitions';
|
||||
import sdk from '../rocketchat/services/sdk';
|
||||
import sdk from '../services/sdk';
|
||||
|
||||
export default async function readMessages(rid: string, ls: Date, updateLastOpen = false): Promise<void> {
|
||||
try {
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { Q } from '@nozbe/watermelondb';
|
||||
|
||||
import { sanitizeLikeString } from '../../database/utils';
|
||||
import database from '../../database/index';
|
||||
import { sanitizeLikeString } from '../database/utils';
|
||||
import database from '../database/index';
|
||||
import { spotlight } from '../services/restApi';
|
||||
import { ISearch, ISearchLocal, SubscriptionType } from '../../../definitions';
|
||||
import { ISearch, ISearchLocal, SubscriptionType } from '../../definitions';
|
||||
import { isGroupChat } from './helpers';
|
||||
|
||||
let debounce: null | ((reason: string) => void) = null;
|
|
@ -3,11 +3,11 @@ import { settings as RocketChatSettings } from '@rocket.chat/sdk';
|
|||
import { FetchBlobResponse, StatefulPromise } from 'rn-fetch-blob';
|
||||
import isEmpty from 'lodash/isEmpty';
|
||||
|
||||
import FileUpload from '../../../utils/fileUpload';
|
||||
import database from '../../database';
|
||||
import log from '../../../utils/log';
|
||||
import { IUpload, IUser, TUploadModel } from '../../../definitions';
|
||||
import { IFileUpload } from '../../../utils/fileUpload/interfaces';
|
||||
import FileUpload from '../../utils/fileUpload';
|
||||
import database from '../database';
|
||||
import log from '../../utils/log';
|
||||
import { IUpload, IUser, TUploadModel } from '../../definitions';
|
||||
import { IFileUpload } from '../../utils/fileUpload/interfaces';
|
||||
|
||||
const uploadQueue: { [index: string]: StatefulPromise<FetchBlobResponse> } = {};
|
||||
|
|
@ -6,7 +6,7 @@ import log from '../../utils/log';
|
|||
import random from '../../utils/random';
|
||||
import { Encryption } from '../encryption';
|
||||
import { E2EType, IMessage, IUser, TMessageModel } from '../../definitions';
|
||||
import sdk from '../rocketchat/services/sdk';
|
||||
import sdk from '../services/sdk';
|
||||
import { E2E_MESSAGE_TYPE, E2E_STATUS, messagesStatus } from '../constants';
|
||||
|
||||
const changeMessageStatus = async (id: string, status: number, tmid?: string, message?: IMessage) => {
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { InteractionManager } from 'react-native';
|
||||
|
||||
import { setActiveUsers } from '../../../actions/activeUsers';
|
||||
import { setUser } from '../../../actions/login';
|
||||
import { store as reduxStore } from '../../store/auxStore';
|
||||
import { compareServerVersion } from '../../methods/helpers/compareServerVersion';
|
||||
import { setActiveUsers } from '../../actions/activeUsers';
|
||||
import { setUser } from '../../actions/login';
|
||||
import { store as reduxStore } from '../store/auxStore';
|
||||
import { compareServerVersion } from './helpers/compareServerVersion';
|
||||
|
||||
// TODO
|
||||
export function _setUser(this: any, ddpMessage: { fields: any; id: any; cleared: any }) {
|
|
@ -17,7 +17,7 @@ import { subscribeRoom, unsubscribeRoom } from '../../../actions/room';
|
|||
import { Encryption } from '../../encryption';
|
||||
import { IMessage, TMessageModel, TSubscriptionModel, TThreadMessageModel, TThreadModel } from '../../../definitions';
|
||||
import { IDDPMessage } from '../../../definitions/IDDPMessage';
|
||||
import sdk from '../../rocketchat/services/sdk';
|
||||
import sdk from '../../services/sdk';
|
||||
|
||||
const WINDOW_TIME = 1000;
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ import {
|
|||
TThreadMessageModel,
|
||||
TThreadModel
|
||||
} from '../../../definitions';
|
||||
import sdk from '../../rocketchat/services/sdk';
|
||||
import sdk from '../../services/sdk';
|
||||
import { IDDPMessage } from '../../../definitions/IDDPMessage';
|
||||
import { getSubscriptionByRoomId } from '../../database/services/Subscription';
|
||||
import { getMessageById } from '../../database/services/Message';
|
||||
|
|
|
@ -4,10 +4,10 @@ import {
|
|||
ITriggerCancel,
|
||||
ITriggerSubmitView,
|
||||
ModalActions
|
||||
} from '../../../containers/UIKit/interfaces';
|
||||
import { TRocketChat } from '../../../definitions';
|
||||
import { triggerAction } from '../../methods/actions';
|
||||
import Navigation from '../../navigation/appNavigation';
|
||||
} from '../../containers/UIKit/interfaces';
|
||||
import { TRocketChat } from '../../definitions';
|
||||
import Navigation from '../navigation/appNavigation';
|
||||
import { triggerAction } from './actions';
|
||||
|
||||
export function triggerBlockAction(this: TRocketChat, options: ITriggerBlockAction) {
|
||||
return triggerAction.call(this, { type: ActionTypes.ACTION, ...options });
|
|
@ -1,5 +1,5 @@
|
|||
import { IPreferences } from '../../../definitions';
|
||||
import userPreferences from '../../methods/userPreferences';
|
||||
import { IPreferences } from '../../definitions';
|
||||
import userPreferences from './userPreferences';
|
||||
|
||||
const SORT_PREFS_KEY = 'RC_SORT_PREFS_KEY';
|
||||
|
|
@ -1,18 +1,18 @@
|
|||
// Methods
|
||||
import canOpenRoom from '../methods/canOpenRoom';
|
||||
import clearCache from '../methods/clearCache';
|
||||
import getRoom from '../methods/getRoom';
|
||||
import getRooms from '../methods/getRooms';
|
||||
import getSlashCommands from '../methods/getSlashCommands';
|
||||
import loadMessagesForRoom from '../methods/loadMessagesForRoom';
|
||||
import loadMissedMessages from '../methods/loadMissedMessages';
|
||||
import loadNextMessages from '../methods/loadNextMessages';
|
||||
import loadSurroundingMessages from '../methods/loadSurroundingMessages';
|
||||
import loadThreadMessages from '../methods/loadThreadMessages';
|
||||
import readMessages from '../methods/readMessages';
|
||||
import roomTypeToApiType from '../methods/roomTypeToApiType';
|
||||
import canOpenRoom from './methods/canOpenRoom';
|
||||
import clearCache from './methods/clearCache';
|
||||
import getRoom from './methods/getRoom';
|
||||
import getRooms from './methods/getRooms';
|
||||
import getSlashCommands from './methods/getSlashCommands';
|
||||
import loadMessagesForRoom from './methods/loadMessagesForRoom';
|
||||
import loadMissedMessages from './methods/loadMissedMessages';
|
||||
import loadNextMessages from './methods/loadNextMessages';
|
||||
import loadSurroundingMessages from './methods/loadSurroundingMessages';
|
||||
import loadThreadMessages from './methods/loadThreadMessages';
|
||||
import readMessages from './methods/readMessages';
|
||||
import roomTypeToApiType from './methods/roomTypeToApiType';
|
||||
// Spread Methods
|
||||
import * as sendMessage from '../methods/sendMessage';
|
||||
import * as sendMessage from './methods/sendMessage';
|
||||
import * as callJitsi from './methods/callJitsi';
|
||||
import * as enterpriseModules from './methods/enterpriseModules';
|
||||
import * as getCustomEmojis from './methods/getCustomEmojis';
|
|
@ -4,26 +4,26 @@ import { sanitizedRaw } from '@nozbe/watermelondb/RawRecord';
|
|||
import { InteractionManager } from 'react-native';
|
||||
import { Q } from '@nozbe/watermelondb';
|
||||
|
||||
import log from '../../../utils/log';
|
||||
import { onRolesChanged } from '../methods/getRoles';
|
||||
import { setActiveUsers } from '../../../actions/activeUsers';
|
||||
import protectedFunction from '../../methods/helpers/protectedFunction';
|
||||
import database from '../../database';
|
||||
import { selectServerFailure } from '../../../actions/server';
|
||||
import { twoFactor } from '../../../utils/twoFactor';
|
||||
import { store } from '../../store/auxStore';
|
||||
import { loginRequest, setLoginServices, setUser } from '../../../actions/login';
|
||||
import log from '../../utils/log';
|
||||
import { setActiveUsers } from '../../actions/activeUsers';
|
||||
import protectedFunction from '../methods/helpers/protectedFunction';
|
||||
import database from '../database';
|
||||
import { selectServerFailure } from '../../actions/server';
|
||||
import { twoFactor } from '../../utils/twoFactor';
|
||||
import { store } from '../store/auxStore';
|
||||
import { loginRequest, setLoginServices, setUser } from '../../actions/login';
|
||||
import sdk from './sdk';
|
||||
import I18n from '../../../i18n';
|
||||
import RocketChat from '..';
|
||||
import { ICredentials, ILoggedUser, IRocketChat, STATUSES } from '../../../definitions';
|
||||
import { isIOS } from '../../../utils/deviceInfo';
|
||||
import { connectRequest, connectSuccess, disconnect as disconnectAction } from '../../../actions/connect';
|
||||
import { updatePermission } from '../../../actions/permissions';
|
||||
import EventEmitter from '../../../utils/events';
|
||||
import { updateSettings } from '../../../actions/settings';
|
||||
import { defaultSettings, MIN_ROCKETCHAT_VERSION } from '../../constants';
|
||||
import { compareServerVersion } from '../../methods/helpers/compareServerVersion';
|
||||
import I18n from '../../i18n';
|
||||
import RocketChat from '../rocketchat';
|
||||
import { ICredentials, ILoggedUser, IRocketChat, STATUSES } from '../../definitions';
|
||||
import { isIOS } from '../../utils/deviceInfo';
|
||||
import { connectRequest, connectSuccess, disconnect as disconnectAction } from '../../actions/connect';
|
||||
import { updatePermission } from '../../actions/permissions';
|
||||
import EventEmitter from '../../utils/events';
|
||||
import { updateSettings } from '../../actions/settings';
|
||||
import { defaultSettings, MIN_ROCKETCHAT_VERSION } from '../constants';
|
||||
import { compareServerVersion } from '../methods/helpers/compareServerVersion';
|
||||
import { onRolesChanged } from '../methods/getRoles';
|
||||
|
||||
interface IServices {
|
||||
[index: string]: string | boolean;
|
|
@ -7,18 +7,18 @@ import {
|
|||
SubscriptionType,
|
||||
IUser,
|
||||
TRocketChat
|
||||
} from '../../../definitions';
|
||||
import { IAvatarSuggestion, IParams } from '../../../definitions/IProfileViewInterfaces';
|
||||
import { ISpotlight } from '../../../definitions/ISpotlight';
|
||||
import { TEAM_TYPE } from '../../../definitions/ITeam';
|
||||
import { Encryption } from '../../encryption';
|
||||
import { TParams } from '../../../definitions/ILivechatEditView';
|
||||
import { store as reduxStore } from '../../store/auxStore';
|
||||
import { getDeviceToken } from '../../../notifications/push';
|
||||
import { getBundleId, isIOS } from '../../../utils/deviceInfo';
|
||||
import roomTypeToApiType, { RoomTypes } from '../../methods/roomTypeToApiType';
|
||||
} from '../../definitions';
|
||||
import { IAvatarSuggestion, IParams } from '../../definitions/IProfileViewInterfaces';
|
||||
import { ISpotlight } from '../../definitions/ISpotlight';
|
||||
import { TEAM_TYPE } from '../../definitions/ITeam';
|
||||
import { Encryption } from '../encryption';
|
||||
import { TParams } from '../../definitions/ILivechatEditView';
|
||||
import { store as reduxStore } from '../store/auxStore';
|
||||
import { getDeviceToken } from '../../notifications/push';
|
||||
import { getBundleId, isIOS } from '../../utils/deviceInfo';
|
||||
import roomTypeToApiType, { RoomTypes } from '../methods/roomTypeToApiType';
|
||||
import sdk from './sdk';
|
||||
import { compareServerVersion } from '../../methods/helpers/compareServerVersion';
|
||||
import { compareServerVersion } from '../methods/helpers/compareServerVersion';
|
||||
|
||||
export const createChannel = ({
|
||||
name,
|
|
@ -2,10 +2,10 @@ import { Rocketchat } from '@rocket.chat/sdk';
|
|||
import EJSON from 'ejson';
|
||||
import isEmpty from 'lodash/isEmpty';
|
||||
|
||||
import { twoFactor } from '../../../utils/twoFactor';
|
||||
import { useSsl } from '../../../utils/url';
|
||||
import { store as reduxStore } from '../../store/auxStore';
|
||||
import { Serialized, MatchPathPattern, OperationParams, PathFor, ResultFor } from '../../../definitions/rest/helpers';
|
||||
import { twoFactor } from '../../utils/twoFactor';
|
||||
import { useSsl } from '../../utils/url';
|
||||
import { store as reduxStore } from '../store/auxStore';
|
||||
import { Serialized, MatchPathPattern, OperationParams, PathFor, ResultFor } from '../../definitions/rest/helpers';
|
||||
|
||||
class Sdk {
|
||||
private sdk: typeof Rocketchat;
|
|
@ -1,14 +1,14 @@
|
|||
import { Q } from '@nozbe/watermelondb';
|
||||
|
||||
import { shareSetSettings, shareSelectServer, shareSetUser } from '../../../actions/share';
|
||||
import SSLPinning from '../../../utils/sslPinning';
|
||||
import log from '../../../utils/log';
|
||||
import { IShareServer, IShareUser } from '../../../reducers/share';
|
||||
import UserPreferences from '../../methods/userPreferences';
|
||||
import database from '../../database';
|
||||
import RocketChat from '..';
|
||||
import { encryptionInit } from '../../../actions/encryption';
|
||||
import { store } from '../../store/auxStore';
|
||||
import { shareSetSettings, shareSelectServer, shareSetUser } from '../../actions/share';
|
||||
import SSLPinning from '../../utils/sslPinning';
|
||||
import log from '../../utils/log';
|
||||
import { IShareServer, IShareUser } from '../../reducers/share';
|
||||
import UserPreferences from '../methods/userPreferences';
|
||||
import database from '../database';
|
||||
import RocketChat from '../rocketchat';
|
||||
import { encryptionInit } from '../../actions/encryption';
|
||||
import { store } from '../store/auxStore';
|
||||
import sdk from './sdk';
|
||||
|
||||
export async function shareExtensionInit(server: string) {
|
|
@ -1,6 +1,6 @@
|
|||
import { PERMISSIONS } from '../actions/actionsTypes';
|
||||
import { TActionPermissions } from '../actions/permissions';
|
||||
import { SUPPORTED_PERMISSIONS } from '../lib/rocketchat/methods/getPermissions';
|
||||
import { SUPPORTED_PERMISSIONS } from '../lib/methods/getPermissions';
|
||||
|
||||
export type TSupportedPermissions = typeof SUPPORTED_PERMISSIONS[number];
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ import UserPreferences from '../lib/methods/userPreferences';
|
|||
import { inquiryRequest, inquiryReset } from '../ee/omnichannel/actions/inquiry';
|
||||
import { isOmnichannelStatusAvailable } from '../ee/omnichannel/lib';
|
||||
import { RootEnum } from '../definitions';
|
||||
import sdk from '../lib/rocketchat/services/sdk';
|
||||
import sdk from '../lib/services/sdk';
|
||||
|
||||
const getServer = state => state.server.server;
|
||||
const loginWithPasswordCall = args => RocketChat.loginWithPassword(args);
|
||||
|
|
|
@ -10,7 +10,7 @@ import UserPreferences from './lib/methods/userPreferences';
|
|||
import Navigation from './lib/navigation/shareNavigation';
|
||||
import store from './lib/store';
|
||||
import { initStore } from './lib/store/auxStore';
|
||||
import { closeShareExtension, shareExtensionInit } from './lib/rocketchat/services/shareExtension';
|
||||
import { closeShareExtension, shareExtensionInit } from './lib/services/shareExtension';
|
||||
import { defaultHeader, getActiveRouteName, navigationTheme, themedHeader } from './utils/navigation';
|
||||
import RocketChat from './lib/rocketchat';
|
||||
import { ThemeContext, TSupportedThemes } from './theme';
|
||||
|
|
|
@ -7,7 +7,7 @@ import moment from 'moment';
|
|||
import UserPreferences from '../lib/methods/userPreferences';
|
||||
import { store } from '../lib/store/auxStore';
|
||||
import database from '../lib/database';
|
||||
import { getServerTimeSync } from '../lib/rocketchat/services/getServerTimeSync';
|
||||
import { getServerTimeSync } from '../lib/services/getServerTimeSync';
|
||||
import {
|
||||
ATTEMPTS_KEY,
|
||||
BIOMETRY_ENABLED_KEY,
|
||||
|
|
|
@ -7,7 +7,7 @@ import { Q, Model } from '@nozbe/watermelondb';
|
|||
import I18n from '../i18n';
|
||||
import StatusBar from '../containers/StatusBar';
|
||||
import ServerItem, { ROW_HEIGHT } from '../presentation/ServerItem';
|
||||
import { shareExtensionInit } from '../lib/rocketchat/services/shareExtension';
|
||||
import { shareExtensionInit } from '../lib/services/shareExtension';
|
||||
import database from '../lib/database';
|
||||
import SafeAreaView from '../containers/SafeAreaView';
|
||||
import * as List from '../containers/List';
|
||||
|
|
Loading…
Reference in New Issue