Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions apps/meteor/client/apps/@types/IOrchestrator.ts

This file was deleted.

9 changes: 5 additions & 4 deletions apps/meteor/client/apps/orchestrator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ import type { IPermission } from '@rocket.chat/apps-engine/definition/permission
import type { ISetting } from '@rocket.chat/apps-engine/definition/settings';
import type { Serialized } from '@rocket.chat/core-typings';

import type { IAppExternalURL, ICategory } from './@types/IOrchestrator';
import { RealAppsEngineUIHost } from './RealAppsEngineUIHost';
import { hasAtLeastOnePermission } from '../../app/authorization/client';
import { sdk } from '../../app/utils/client/lib/SDKClient';
import type { IAppExternalURL } from '../definitions/IAppExternalURL';
import type { ICategory } from '../definitions/ICategory';
import { dispatchToastMessage } from '../lib/toast';
import type { App } from '../views/marketplace/types';

Expand Down Expand Up @@ -51,7 +52,7 @@ class AppClientOrchestrator {

if ('apps' in result) {
// TODO: chapter day: multiple results are returned, but we only need one
return result.apps as App[];
return result.apps;
}
throw new Error('Invalid response from API');
}
Expand All @@ -74,7 +75,7 @@ class AppClientOrchestrator {
return { apps: [], error: 'Invalid response from API' };
}

const apps = (result as App[]).map((app: App) => {
const apps = result.map((app: App) => {
const { latest, appRequestStats, price, pricingPlans, purchaseType, isEnterpriseOnly, modifiedAt, bundledIn, requestedEndUser } = app;
return {
...latest,
Expand Down Expand Up @@ -174,7 +175,7 @@ class AppClientOrchestrator {

if (Array.isArray(result)) {
// TODO: chapter day: multiple results are returned, but we only need one
return result as Serialized<ICategory>[];
return result;
}
throw new Error('Failed to get categories');
}
Expand Down
3 changes: 2 additions & 1 deletion apps/meteor/client/contexts/AppsContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import type { ISetting } from '@rocket.chat/apps-engine/definition/settings';
import type { Serialized } from '@rocket.chat/core-typings';
import { createContext } from 'react';

import type { IAppExternalURL, ICategory } from '../apps/@types/IOrchestrator';
import type { IAppExternalURL } from '../definitions/IAppExternalURL';
import type { ICategory } from '../definitions/ICategory';
import type { App } from '../views/marketplace/types';

export interface IAppsOrchestrator {
Expand Down
3 changes: 3 additions & 0 deletions apps/meteor/client/definitions/IAppExternalURL.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export interface IAppExternalURL {
url: string;
}
8 changes: 8 additions & 0 deletions apps/meteor/client/definitions/ICategory.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export interface ICategory {
createdDate: Date;
description: string;
hidden: boolean;
id: string;
modifiedDate: Date;
title: string;
}
51 changes: 4 additions & 47 deletions apps/meteor/client/definitions/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,54 +3,32 @@ import type { IRocketChatDesktop } from '@rocket.chat/desktop-api';
declare global {
interface Window {
RocketChatDesktop?: IRocketChatDesktop;

/** @deprecated use `window.RTCPeerConnection` */
mozRTCPeerConnection?: RTCPeerConnection;
/** @deprecated use `window.RTCPeerConnection` */
webkitRTCPeerConnection?: RTCPeerConnection;

/** @deprecated use `window.RTCSessionDescription` */
mozRTCSessionDescription?: RTCSessionDescription;
/** @deprecated use `window.RTCSessionDescription` */
webkitRTCSessionDescription?: RTCSessionDescription;
/** @deprecated use `window.RTCIceCandidate` */
mozRTCIceCandidate?: RTCIceCandidate;
/** @deprecated use `window.RTCIceCandidate` */
webkitRTCIceCandidate?: RTCIceCandidate;
/** @deprecated use `window.RTCSessionDescription` */
mozRTCSessionDescription?: RTCSessionDescription;
/** @deprecated use `window.RTCSessionDescription` */
webkitRTCSessionDescription?: RTCSessionDescription;
/** @deprecated use `window.AudioContext` */
mozAudioContext?: AudioContext;
/** @deprecated use `window.AudioContext` */
webkitAudioContext?: AudioContext;
opera?: string;
}

interface Navigator {
/** @deprecated */
/** @deprecated use the newer `navigator.mediaDevices.getUserMedia()` instead */
getUserMedia?: (
this: Navigator,
constraints?: MediaStreamConstraints | undefined,
onSuccess?: (stream: MediaStream) => void,
onError?: (error: any) => void,
) => void;
/** @deprecated */
/** @deprecated use the newer `navigator.mediaDevices.getUserMedia()` instead */
webkitGetUserMedia?: (
this: Navigator,
constraints?: MediaStreamConstraints | undefined,
onSuccess?: (stream: MediaStream) => void,
onError?: (error: any) => void,
) => void;
/** @deprecated */
/** @deprecated use the newer `navigator.mediaDevices.getUserMedia()` instead */
mozGetUserMedia?: (
this: Navigator,
constraints?: MediaStreamConstraints | undefined,
onSuccess?: (stream: MediaStream) => void,
onError?: (error: any) => void,
) => void;
/** @deprecated */
/** @deprecated use the newer `navigator.mediaDevices.getUserMedia()` instead */
msGetUserMedia?: (
this: Navigator,
constraints?: MediaStreamConstraints | undefined,
Expand All @@ -62,27 +40,6 @@ declare global {
};
}

interface RTCPeerConnection {
/** @deprecated use `getReceivers() */
getRemoteStreams(): MediaStream[];
/** @deprecated */
addStream(stream: MediaStream): void;
}

interface MediaTrackConstraints {
/** @deprecated */
mozMediaSource?: string;
/** @deprecated */
mediaSource?: string;
/** @deprecated */
mandatory?: {
chromeMediaSource: string;
chromeMediaSourceId: string;
maxWidth: number;
maxHeight: number;
};
}

interface NotificationEventMap {
reply: { response: string };
}
Expand Down
9 changes: 1 addition & 8 deletions apps/meteor/client/meteor/overrides/oauthRedirectUri.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,9 @@
// clients. Once Meteor's OAuth stack is gone, this file goes with it.
import { OAuth } from 'meteor/oauth';

declare module 'meteor/oauth' {
// eslint-disable-next-line @typescript-eslint/no-namespace
namespace OAuth {
function _redirectUri(serviceName: string, config: any, params: any, absoluteUrlOptions: any): string;
}
}

const { _redirectUri } = OAuth;

OAuth._redirectUri = (serviceName: string, config: any, params: unknown, absoluteUrlOptions: unknown): string => {
OAuth._redirectUri = (serviceName: string, config: any, params?: Record<string, any>, absoluteUrlOptions?: Record<string, any>): string => {
const ret = _redirectUri(serviceName, config, params, absoluteUrlOptions);

// DEPRECATED: Remove in v5.0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Tabs, TabsItem } from '@rocket.chat/fuselage';
import { usePermission, useRouter } from '@rocket.chat/ui-contexts';
import { useTranslation } from 'react-i18next';

import type { ISettings } from '../../../apps/@types/IOrchestrator';
import type { ISettings } from '../definitions/ISettings';

export type AppDetailsPageTabsProps = {
context: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useRouteParameter } from '@rocket.chat/ui-contexts';
import { useMemo } from 'react';

import AppSetting from './AppSetting';
import type { ISettings } from '../../../../../apps/@types/IOrchestrator';
import type { ISettings } from '../../../definitions/ISettings';
import { useAppTranslation } from '../../../hooks/useAppTranslation';

export type AppSettingsProps = { settings: ISettings };
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { IApiEndpointMetadata } from '@rocket.chat/apps-engine/definition/api';
import type { AppScreenshot } from '@rocket.chat/core-typings';

import type { ISettings } from '../../../apps/@types/IOrchestrator';
import type { ISettings } from './ISettings';
import type { App } from '../types';

export type AppInfo = App & {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import type { ISetting } from '@rocket.chat/apps-engine/definition/settings';

export interface ISettings {
[key: string]: ISetting;
}
6 changes: 3 additions & 3 deletions apps/meteor/client/views/marketplace/hooks/useAppInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { useEndpoint } from '@rocket.chat/ui-contexts';
import { useState, useEffect } from 'react';

import { useApps } from './useApps';
import type { ISettings } from '../../../apps/@types/IOrchestrator';
import { AppClientOrchestratorInstance } from '../../../apps/orchestrator';
import type { AppInfo } from '../definitions/AppInfo';
import type { ISettings } from '../definitions/ISettings';

const getBundledInApp = async (app: App): Promise<App['bundledIn']> => {
const { bundledIn = [] } = app;
Expand Down Expand Up @@ -64,8 +64,8 @@ export const useAppInfo = (appId: string, context: string): AppInfo | undefined
appVersion: appId,
})
.then(({ app }: any) => {
(appResult as App).tosLink = app.tosLink;
(appResult as App).privacyLink = app.privacyLink;
appResult.tosLink = app.tosLink;
appResult.privacyLink = app.privacyLink;
return getBundledInApp(app);
})
.catch(() => ({
Expand Down
3 changes: 0 additions & 3 deletions apps/meteor/definition/externals/asterisk-manager.d.ts

This file was deleted.

9 changes: 0 additions & 9 deletions apps/meteor/definition/externals/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,15 @@ declare global {
};

interface Window {
setLanguage?: (language: string) => void;
defaultUserLanguage?: () => string;
DISABLE_ANIMATION?: boolean;
lastMessageWindow?: Record<string, unknown>;
lastMessageWindowHistory?: Record<string, unknown>;
favico?: any;
ServiceConfiguration?: unknown;
__meteor_runtime_config__: {
ROOT_URL_PATH_PREFIX: string;
ROOT_URL: string;
};
}

interface PromiseConstructor {
await<T>(promise: Promise<T>): T;
await<T>(value: T): T;
}

namespace NodeJS {
interface Process {
emit(event: 'message', message: any, sendHandle?: Server | Socket): boolean;
Expand Down

This file was deleted.

5 changes: 0 additions & 5 deletions apps/meteor/definition/externals/less/browser.d.ts

This file was deleted.

19 changes: 0 additions & 19 deletions apps/meteor/definition/externals/meteor/accounts-base.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,6 @@ declare module 'meteor/accounts-base' {

namespace Accounts {
const storageLocation: Window['localStorage'];
function createUser(
options: {
username?: string;
email?: string;
password?: string;
profile?: Record<string, unknown>;
joinDefaultChannelsSilenced?: boolean;
skipEmailValidation?: boolean;
},
callback?: (error?: Error | Meteor.Error | Meteor.TypedError) => void,
): string;

function _expireTokens(oldestValidDate?: Date, userId?: string): Promise<void>;

Expand All @@ -31,10 +20,6 @@ declare module 'meteor/accounts-base' {

function registerLoginHandler(name: string, handler: (options: any) => undefined | object): void;

function _storedLoginToken(): unknown;

function _unstoreLoginToken(): void;

function _setAccountData(connectionId: string, key: string, token: string): void;

function _checkPasswordAsync(user: Meteor.User, password: Password): Promise<{ userId: string; error?: any }>;
Expand All @@ -57,10 +42,6 @@ declare module 'meteor/accounts-base' {
public static readonly numericError: number;
}

const USER_ID_KEY: string;

const LOGIN_TOKEN_KEY: string;

const _accountData: Record<string, any>;

interface AccountsServerOptions {
Expand Down
6 changes: 0 additions & 6 deletions apps/meteor/definition/externals/meteor/babel-compiler.d.ts

This file was deleted.

6 changes: 0 additions & 6 deletions apps/meteor/definition/externals/meteor/base64.d.ts

This file was deleted.

Loading
Loading