snapshot of https://github.com/RocketChat/Rocket.Chat.git (develop, 2026-09-16; blobs > 131072B omitted)
Some checks failed
Create issues from TODOs / todos (push) Failing after 3s
Close inactive issues / close-issues (push) Has been cancelled
Deploy GitHub Pages / deploy-preview (push) Has been cancelled
CI / ⚙️ Variables Setup (push) Has been cancelled
CI / ⚙️ Test Guard (push) Has been cancelled
CI / 🚀 Notify external services - draft (push) Has been cancelled
CI / 📦 Build Packages (push) Has been cancelled
CI / 📦 Meteor Build (coverage) (push) Has been cancelled
CI / 📦 Meteor Build (production) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [account-service presence-service omnichannel-transcript-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [account-service presence-service omnichannel-transcript-service], fips) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [authorization-service queue-worker-service ddp-streamer-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [authorization-service queue-worker-service ddp-streamer-service], fips) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [rocketchat], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [rocketchat], coverage) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [rocketchat], fips) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [account-service presence-service omnichannel-transcript-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [authorization-service queue-worker-service ddp-streamer-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [rocketchat], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [rocketchat], coverage) (push) Has been cancelled
CI / 🚢 Publish Docker Images (ghcr.io) (push) Has been cancelled
CI / 📦 Track Image Sizes (push) Has been cancelled
CI / 🔎 Code Check - Action Lint (push) Has been cancelled
CI / 🔎 Code Check (push) Has been cancelled
CI / 🔨 Test Storybook (push) Has been cancelled
CI / 🔨 Test Unit (push) Has been cancelled
CI / 🔨 Test API (CE) (push) Has been cancelled
CI / 🔨 Test API Livechat (CE) (push) Has been cancelled
CI / 🔨 Test UI (CE) (push) Has been cancelled
CI / 🔨 Test API (EE) (push) Has been cancelled
CI / 🔨 Test API Livechat (EE) (push) Has been cancelled
CI / 🔨 Test API Apps (deno-runtime - EE) (push) Has been cancelled
CI / 🔨 Test UI (EE) (push) Has been cancelled
CI / 🔨 Test API (FIPS) (push) Has been cancelled
CI / 🔨 Test API Livechat (FIPS) (push) Has been cancelled
CI / 🔨 Test UI (FIPS) (push) Has been cancelled
CI / 🔨 Test Federation Matrix (push) Has been cancelled
CI / 📊 Report Coverage (push) Has been cancelled
CI / ✅ Tests Done (push) Has been cancelled
CI / 🚀 Publish build assets (push) Has been cancelled
CI / 🚀 Publish Docker Images (DockerHub) (push) Has been cancelled
CI / 🚀 Notify external services (push) Has been cancelled
CI / Update Version Durability (push) Has been cancelled
Release / Release (push) Has been cancelled
Auto-close duplicate issues / auto-close-duplicates (push) Failing after 1s
Code scanning - action / CodeQL-Build (push) Failing after 1s
Some checks failed
Create issues from TODOs / todos (push) Failing after 3s
Close inactive issues / close-issues (push) Has been cancelled
Deploy GitHub Pages / deploy-preview (push) Has been cancelled
CI / ⚙️ Variables Setup (push) Has been cancelled
CI / ⚙️ Test Guard (push) Has been cancelled
CI / 🚀 Notify external services - draft (push) Has been cancelled
CI / 📦 Build Packages (push) Has been cancelled
CI / 📦 Meteor Build (coverage) (push) Has been cancelled
CI / 📦 Meteor Build (production) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [account-service presence-service omnichannel-transcript-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [account-service presence-service omnichannel-transcript-service], fips) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [authorization-service queue-worker-service ddp-streamer-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [authorization-service queue-worker-service ddp-streamer-service], fips) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [rocketchat], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [rocketchat], coverage) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [rocketchat], fips) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [account-service presence-service omnichannel-transcript-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [authorization-service queue-worker-service ddp-streamer-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [rocketchat], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [rocketchat], coverage) (push) Has been cancelled
CI / 🚢 Publish Docker Images (ghcr.io) (push) Has been cancelled
CI / 📦 Track Image Sizes (push) Has been cancelled
CI / 🔎 Code Check - Action Lint (push) Has been cancelled
CI / 🔎 Code Check (push) Has been cancelled
CI / 🔨 Test Storybook (push) Has been cancelled
CI / 🔨 Test Unit (push) Has been cancelled
CI / 🔨 Test API (CE) (push) Has been cancelled
CI / 🔨 Test API Livechat (CE) (push) Has been cancelled
CI / 🔨 Test UI (CE) (push) Has been cancelled
CI / 🔨 Test API (EE) (push) Has been cancelled
CI / 🔨 Test API Livechat (EE) (push) Has been cancelled
CI / 🔨 Test API Apps (deno-runtime - EE) (push) Has been cancelled
CI / 🔨 Test UI (EE) (push) Has been cancelled
CI / 🔨 Test API (FIPS) (push) Has been cancelled
CI / 🔨 Test API Livechat (FIPS) (push) Has been cancelled
CI / 🔨 Test UI (FIPS) (push) Has been cancelled
CI / 🔨 Test Federation Matrix (push) Has been cancelled
CI / 📊 Report Coverage (push) Has been cancelled
CI / ✅ Tests Done (push) Has been cancelled
CI / 🚀 Publish build assets (push) Has been cancelled
CI / 🚀 Publish Docker Images (DockerHub) (push) Has been cancelled
CI / 🚀 Notify external services (push) Has been cancelled
CI / Update Version Durability (push) Has been cancelled
Release / Release (push) Has been cancelled
Auto-close duplicate issues / auto-close-duplicates (push) Failing after 1s
Code scanning - action / CodeQL-Build (push) Failing after 1s
This commit is contained in:
29
packages/apps/tests/test-data/bridges/OAuthAppsBridge.ts
Normal file
29
packages/apps/tests/test-data/bridges/OAuthAppsBridge.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import type { IOAuthApp, IOAuthAppParams } from '@rocket.chat/apps-engine/definition/accessors/IOAuthApp';
|
||||
|
||||
import { OAuthAppsBridge } from '../../../src/server/bridges/OAuthAppsBridge';
|
||||
|
||||
export class TestOAuthAppsBridge extends OAuthAppsBridge {
|
||||
protected create(oAuthApp: IOAuthAppParams, appId: string): Promise<string> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
protected getById(id: string, appId: string): Promise<IOAuthApp> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
protected getByName(name: string, appId: string): Promise<Array<IOAuthApp>> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
protected update(oAuthApp: IOAuthAppParams, id: string, appId: string): Promise<void> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
protected delete(id: string, appId: string): Promise<void> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
protected purge(appId: string): Promise<void> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
}
|
||||
26
packages/apps/tests/test-data/bridges/activationBridge.ts
Normal file
26
packages/apps/tests/test-data/bridges/activationBridge.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import type { AppStatus } from '@rocket.chat/apps-engine/definition/AppStatus';
|
||||
|
||||
import type { ProxiedApp } from '../../../src/server/ProxiedApp';
|
||||
import { AppActivationBridge } from '../../../src/server/bridges';
|
||||
|
||||
export class TestsActivationBridge extends AppActivationBridge {
|
||||
public async appAdded(app: ProxiedApp): Promise<void> {
|
||||
console.log(`The App ${app.getName()} (${app.getID()}) has been added.`);
|
||||
}
|
||||
|
||||
public async appUpdated(app: ProxiedApp): Promise<void> {
|
||||
console.log(`The App ${app.getName()} (${app.getID()}) has been updated.`);
|
||||
}
|
||||
|
||||
public async appRemoved(app: ProxiedApp): Promise<void> {
|
||||
console.log(`The App ${app.getName()} (${app.getID()}) has been removed.`);
|
||||
}
|
||||
|
||||
public async appStatusChanged(app: ProxiedApp, status: AppStatus): Promise<void> {
|
||||
console.log(`The App ${app.getName()} (${app.getID()}) status has changed to: ${status}`);
|
||||
}
|
||||
|
||||
protected async actionsChanged(): Promise<void> {
|
||||
console.log('The actions have changed.');
|
||||
}
|
||||
}
|
||||
38
packages/apps/tests/test-data/bridges/apiBridge.ts
Normal file
38
packages/apps/tests/test-data/bridges/apiBridge.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
import type { IApi } from '@rocket.chat/apps-engine/definition/api';
|
||||
|
||||
import { ApiBridge } from '../../../src/server/bridges';
|
||||
import type { AppApi } from '../../../src/server/managers/AppApi';
|
||||
import { TestData } from '../utilities';
|
||||
|
||||
export class TestsApiBridge extends ApiBridge {
|
||||
public apis: Map<string, Map<string, IApi>>;
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
this.apis = new Map<string, Map<string, IApi>>();
|
||||
this.apis.set('appId', new Map<string, IApi>());
|
||||
this.apis.get('appId').set('it-exists', TestData.getApi('it-exists'));
|
||||
}
|
||||
|
||||
public async registerApi(api: AppApi, appId: string): Promise<void> {
|
||||
if (!this.apis.has(appId)) {
|
||||
this.apis.set(appId, new Map<string, IApi>());
|
||||
}
|
||||
|
||||
if (this.apis.get(appId)) {
|
||||
api.api.endpoints.forEach((endpoint) => {
|
||||
if (this.apis.get(appId).has(endpoint.path)) {
|
||||
throw new Error(`Api "${api.endpoint.path}" has already been registered for app ${appId}.`);
|
||||
}
|
||||
});
|
||||
|
||||
api.api.endpoints.forEach((endpoint) => {
|
||||
this.apis.get(appId).set(api.endpoint.path, api.api);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public async unregisterApis(appId: string): Promise<void> {
|
||||
this.apis.delete(appId);
|
||||
}
|
||||
}
|
||||
255
packages/apps/tests/test-data/bridges/appBridges.ts
Normal file
255
packages/apps/tests/test-data/bridges/appBridges.ts
Normal file
@@ -0,0 +1,255 @@
|
||||
import { TestOAuthAppsBridge } from './OAuthAppsBridge';
|
||||
import { TestsActivationBridge } from './activationBridge';
|
||||
import { TestsApiBridge } from './apiBridge';
|
||||
import { TestsAppDetailChangesBridge } from './appDetailChanges';
|
||||
import { TestAppCloudWorkspaceBridge } from './cloudBridge';
|
||||
import { TestsCommandBridge } from './commandBridge';
|
||||
import { TestContactBridge } from './contactBridge';
|
||||
import { TestsEmailBridge } from './emailBridge';
|
||||
import { TestsEnvironmentalVariableBridge } from './environmentalVariableBridge';
|
||||
import { TestExperimentalBridge } from './experimentalBridge';
|
||||
import { TestsHttpBridge } from './httpBridge';
|
||||
import { TestsInternalBridge } from './internalBridge';
|
||||
import { TestsInternalFederationBridge } from './internalFederationBridge';
|
||||
import { TestLivechatBridge } from './livechatBridge';
|
||||
import { TestsMessageBridge } from './messageBridge';
|
||||
import { TestsModerationBridge } from './moderationBridge';
|
||||
import { TestOutboundCommunicationBridge } from './outboundComms';
|
||||
import { TestsPersisBridge } from './persisBridge';
|
||||
import { TestsRoleBridge } from './roleBridge';
|
||||
import { TestsRoomBridge } from './roomBridge';
|
||||
import { TestSchedulerBridge } from './schedulerBridge';
|
||||
import { TestsServerSettingBridge } from './serverSettingBridge';
|
||||
import { TestsThreadBridge } from './threadBridge';
|
||||
import { TestsUiIntegrationBridge } from './uiIntegrationBridge';
|
||||
import { TestUploadBridge } from './uploadBridge';
|
||||
import { TestsUserBridge } from './userBridge';
|
||||
import { TestsVideoConferenceBridge } from './videoConferenceBridge';
|
||||
import { AppBridges } from '../../../src/server/bridges';
|
||||
import type {
|
||||
AppActivationBridge,
|
||||
AppDetailChangesBridge,
|
||||
ContactBridge,
|
||||
EnvironmentalVariableBridge,
|
||||
ExperimentalBridge,
|
||||
HttpBridge,
|
||||
IInternalBridge,
|
||||
IListenerBridge,
|
||||
LivechatBridge,
|
||||
MessageBridge,
|
||||
ModerationBridge,
|
||||
OutboundMessageBridge,
|
||||
PersistenceBridge,
|
||||
RoleBridge,
|
||||
RoomBridge,
|
||||
SchedulerBridge,
|
||||
ServerSettingBridge,
|
||||
UiInteractionBridge,
|
||||
UploadBridge,
|
||||
UserBridge,
|
||||
VideoConferenceBridge,
|
||||
} from '../../../src/server/bridges';
|
||||
import type { CloudWorkspaceBridge } from '../../../src/server/bridges/CloudWorkspaceBridge';
|
||||
import type { EmailBridge } from '../../../src/server/bridges/EmailBridge';
|
||||
import type { IInternalFederationBridge } from '../../../src/server/bridges/IInternalFederationBridge';
|
||||
import type { OAuthAppsBridge } from '../../../src/server/bridges/OAuthAppsBridge';
|
||||
import type { ThreadBridge } from '../../../src/server/bridges/ThreadBridge';
|
||||
|
||||
export class TestsAppBridges extends AppBridges {
|
||||
private readonly appDetails: TestsAppDetailChangesBridge;
|
||||
|
||||
private readonly cmdBridge: TestsCommandBridge;
|
||||
|
||||
private readonly apiBridge: TestsApiBridge;
|
||||
|
||||
private readonly setsBridge: TestsServerSettingBridge;
|
||||
|
||||
private readonly envBridge: TestsEnvironmentalVariableBridge;
|
||||
|
||||
private readonly rlActBridge: TestsActivationBridge;
|
||||
|
||||
private readonly msgBridge: TestsMessageBridge;
|
||||
|
||||
private readonly moderationBridge: TestsModerationBridge;
|
||||
|
||||
private readonly persisBridge: TestsPersisBridge;
|
||||
|
||||
private readonly roleBridge: TestsRoleBridge;
|
||||
|
||||
private readonly roomBridge: TestsRoomBridge;
|
||||
|
||||
private readonly internalBridge: TestsInternalBridge;
|
||||
|
||||
private readonly userBridge: TestsUserBridge;
|
||||
|
||||
private readonly httpBridge: TestsHttpBridge;
|
||||
|
||||
private readonly livechatBridge: TestLivechatBridge;
|
||||
|
||||
private readonly uploadBridge: TestUploadBridge;
|
||||
|
||||
private readonly emailBridge: EmailBridge;
|
||||
|
||||
private readonly contactBridge: ContactBridge;
|
||||
|
||||
private readonly uiIntegrationBridge: TestsUiIntegrationBridge;
|
||||
|
||||
private readonly schedulerBridge: TestSchedulerBridge;
|
||||
|
||||
private readonly cloudWorkspaceBridge: TestAppCloudWorkspaceBridge;
|
||||
|
||||
private readonly videoConfBridge: TestsVideoConferenceBridge;
|
||||
|
||||
private readonly oauthBridge: OAuthAppsBridge;
|
||||
|
||||
private readonly internalFederationBridge: IInternalFederationBridge;
|
||||
|
||||
private readonly threadBridge: ThreadBridge;
|
||||
|
||||
private readonly outboundCommsBridge: TestOutboundCommunicationBridge;
|
||||
|
||||
private readonly experimentalBridge: TestExperimentalBridge;
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
this.appDetails = new TestsAppDetailChangesBridge();
|
||||
this.cmdBridge = new TestsCommandBridge();
|
||||
this.apiBridge = new TestsApiBridge();
|
||||
this.setsBridge = new TestsServerSettingBridge();
|
||||
this.envBridge = new TestsEnvironmentalVariableBridge();
|
||||
this.rlActBridge = new TestsActivationBridge();
|
||||
this.msgBridge = new TestsMessageBridge();
|
||||
this.moderationBridge = new TestsModerationBridge();
|
||||
this.persisBridge = new TestsPersisBridge();
|
||||
this.roleBridge = new TestsRoleBridge();
|
||||
this.roomBridge = new TestsRoomBridge();
|
||||
this.internalBridge = new TestsInternalBridge();
|
||||
this.userBridge = new TestsUserBridge();
|
||||
this.httpBridge = new TestsHttpBridge();
|
||||
this.livechatBridge = new TestLivechatBridge();
|
||||
this.uploadBridge = new TestUploadBridge();
|
||||
this.uiIntegrationBridge = new TestsUiIntegrationBridge();
|
||||
this.schedulerBridge = new TestSchedulerBridge();
|
||||
this.cloudWorkspaceBridge = new TestAppCloudWorkspaceBridge();
|
||||
this.videoConfBridge = new TestsVideoConferenceBridge();
|
||||
this.oauthBridge = new TestOAuthAppsBridge();
|
||||
this.internalFederationBridge = new TestsInternalFederationBridge();
|
||||
this.threadBridge = new TestsThreadBridge();
|
||||
this.emailBridge = new TestsEmailBridge();
|
||||
this.contactBridge = new TestContactBridge();
|
||||
this.outboundCommsBridge = new TestOutboundCommunicationBridge();
|
||||
this.experimentalBridge = new TestExperimentalBridge();
|
||||
}
|
||||
|
||||
public getCommandBridge(): TestsCommandBridge {
|
||||
return this.cmdBridge;
|
||||
}
|
||||
|
||||
public getApiBridge(): TestsApiBridge {
|
||||
return this.apiBridge;
|
||||
}
|
||||
|
||||
public getServerSettingBridge(): ServerSettingBridge {
|
||||
return this.setsBridge;
|
||||
}
|
||||
|
||||
public getEnvironmentalVariableBridge(): EnvironmentalVariableBridge {
|
||||
return this.envBridge;
|
||||
}
|
||||
|
||||
public getAppDetailChangesBridge(): AppDetailChangesBridge {
|
||||
return this.appDetails;
|
||||
}
|
||||
|
||||
public getHttpBridge(): HttpBridge {
|
||||
return this.httpBridge;
|
||||
}
|
||||
|
||||
public getListenerBridge(): IListenerBridge {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
public getMessageBridge(): MessageBridge {
|
||||
return this.msgBridge;
|
||||
}
|
||||
|
||||
public getModerationBridge(): ModerationBridge {
|
||||
return this.moderationBridge;
|
||||
}
|
||||
|
||||
public getPersistenceBridge(): PersistenceBridge {
|
||||
return this.persisBridge;
|
||||
}
|
||||
|
||||
public getAppActivationBridge(): AppActivationBridge {
|
||||
return this.rlActBridge;
|
||||
}
|
||||
|
||||
public getThreadBridge(): ThreadBridge {
|
||||
return this.threadBridge;
|
||||
}
|
||||
|
||||
public getRoleBridge(): RoleBridge {
|
||||
return this.roleBridge;
|
||||
}
|
||||
|
||||
public getRoomBridge(): RoomBridge {
|
||||
return this.roomBridge;
|
||||
}
|
||||
|
||||
public getInternalBridge(): IInternalBridge {
|
||||
return this.internalBridge;
|
||||
}
|
||||
|
||||
public getUserBridge(): UserBridge {
|
||||
return this.userBridge;
|
||||
}
|
||||
|
||||
public getLivechatBridge(): LivechatBridge {
|
||||
return this.livechatBridge;
|
||||
}
|
||||
|
||||
public getEmailBridge(): EmailBridge {
|
||||
return this.emailBridge;
|
||||
}
|
||||
|
||||
public getUploadBridge(): UploadBridge {
|
||||
return this.uploadBridge;
|
||||
}
|
||||
|
||||
public getUiInteractionBridge(): UiInteractionBridge {
|
||||
return this.uiIntegrationBridge;
|
||||
}
|
||||
|
||||
public getSchedulerBridge(): SchedulerBridge {
|
||||
return this.schedulerBridge;
|
||||
}
|
||||
|
||||
public getCloudWorkspaceBridge(): CloudWorkspaceBridge {
|
||||
return this.cloudWorkspaceBridge;
|
||||
}
|
||||
|
||||
public getVideoConferenceBridge(): VideoConferenceBridge {
|
||||
return this.videoConfBridge;
|
||||
}
|
||||
|
||||
public getOAuthAppsBridge(): OAuthAppsBridge {
|
||||
return this.oauthBridge;
|
||||
}
|
||||
|
||||
public getInternalFederationBridge(): IInternalFederationBridge {
|
||||
return this.internalFederationBridge;
|
||||
}
|
||||
|
||||
public getContactBridge(): ContactBridge {
|
||||
return this.contactBridge;
|
||||
}
|
||||
|
||||
public getOutboundMessageBridge(): OutboundMessageBridge {
|
||||
return this.outboundCommsBridge;
|
||||
}
|
||||
|
||||
public getExperimentalBridge(): ExperimentalBridge {
|
||||
return this.experimentalBridge;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
import type { ISetting } from '@rocket.chat/apps-engine/definition/settings';
|
||||
|
||||
import { AppDetailChangesBridge } from '../../../src/server/bridges';
|
||||
|
||||
export class TestsAppDetailChangesBridge extends AppDetailChangesBridge {
|
||||
public onAppSettingsChange(appId: string, setting: ISetting): void {}
|
||||
}
|
||||
16
packages/apps/tests/test-data/bridges/cloudBridge.ts
Normal file
16
packages/apps/tests/test-data/bridges/cloudBridge.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import type { IWorkspaceToken } from '@rocket.chat/apps-engine/definition/cloud/IWorkspaceToken';
|
||||
|
||||
import { CloudWorkspaceBridge } from '../../../src/server/bridges/CloudWorkspaceBridge';
|
||||
|
||||
export class TestAppCloudWorkspaceBridge extends CloudWorkspaceBridge {
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
|
||||
public async getWorkspaceToken(scope: string, appId: string): Promise<IWorkspaceToken> {
|
||||
return {
|
||||
token: 'mock-workspace-token',
|
||||
expiresAt: new Date(Date.now() + 10000),
|
||||
};
|
||||
}
|
||||
}
|
||||
42
packages/apps/tests/test-data/bridges/commandBridge.ts
Normal file
42
packages/apps/tests/test-data/bridges/commandBridge.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
import type { IHttp, IModify, IPersistence, IRead } from '@rocket.chat/apps-engine/definition/accessors';
|
||||
import type { ISlashCommand, SlashCommandContext } from '@rocket.chat/apps-engine/definition/slashcommands';
|
||||
|
||||
import { CommandBridge } from '../../../src/server/bridges';
|
||||
import { TestData } from '../utilities';
|
||||
|
||||
export class TestsCommandBridge extends CommandBridge {
|
||||
public commands: Map<string, (context: SlashCommandContext, read: IRead, modify: IModify, http: IHttp, persis: IPersistence) => void>;
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
this.commands = new Map<
|
||||
string,
|
||||
(context: SlashCommandContext, read: IRead, modify: IModify, http: IHttp, persis: IPersistence) => void
|
||||
>();
|
||||
this.commands.set('it-exists', TestData.getSlashCommand('it-exists').executor);
|
||||
}
|
||||
|
||||
public async doesCommandExist(command: string, appId: string): Promise<boolean> {
|
||||
return this.commands.has(command);
|
||||
}
|
||||
|
||||
public async enableCommand(command: string, appId: string): Promise<void> {}
|
||||
|
||||
public async disableCommand(command: string, appId: string): Promise<void> {}
|
||||
|
||||
public async modifyCommand(command: ISlashCommand, appId: string): Promise<void> {}
|
||||
|
||||
public restoreCommand(comand: string, appId: string): void {}
|
||||
|
||||
public async registerCommand(command: ISlashCommand, appId: string): Promise<void> {
|
||||
if (this.commands.has(command.command)) {
|
||||
throw new Error(`Command "${command.command}" has already been registered.`);
|
||||
}
|
||||
|
||||
this.commands.set(command.command, command.executor);
|
||||
}
|
||||
|
||||
public async unregisterCommand(command: string, appId: string): Promise<void> {
|
||||
this.commands.delete(command);
|
||||
}
|
||||
}
|
||||
23
packages/apps/tests/test-data/bridges/contactBridge.ts
Normal file
23
packages/apps/tests/test-data/bridges/contactBridge.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import type { ILivechatContact } from '@rocket.chat/apps-engine/definition/livechat';
|
||||
|
||||
import { ContactBridge } from '../../../src/server/bridges';
|
||||
|
||||
export class TestContactBridge extends ContactBridge {
|
||||
protected addContactEmail(contactId: ILivechatContact['_id'], email: string, appId: string): Promise<ILivechatContact> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
protected getById(id: ILivechatContact['_id']): Promise<ILivechatContact> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
protected verifyContact(verifyContactChannelParams: {
|
||||
contactId: string;
|
||||
field: string;
|
||||
value: string;
|
||||
visitorId: string;
|
||||
roomId: string;
|
||||
}): Promise<void> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
}
|
||||
9
packages/apps/tests/test-data/bridges/emailBridge.ts
Normal file
9
packages/apps/tests/test-data/bridges/emailBridge.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import type { IEmail } from '@rocket.chat/apps-engine/definition/email';
|
||||
|
||||
import { EmailBridge } from '../../../src/server/bridges/EmailBridge';
|
||||
|
||||
export class TestsEmailBridge extends EmailBridge {
|
||||
protected sendEmail(email: IEmail, appId: string): Promise<void> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
import { EnvironmentalVariableBridge } from '../../../src/server/bridges/EnvironmentalVariableBridge';
|
||||
|
||||
export class TestsEnvironmentalVariableBridge extends EnvironmentalVariableBridge {
|
||||
public getValueByName(envVarName: string, appId: string): Promise<string> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
public isReadable(envVarName: string, appId: string): Promise<boolean> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
public isSet(envVarName: string, appId: string): Promise<boolean> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
import { ExperimentalBridge } from '../../../src/server/bridges';
|
||||
|
||||
export class TestExperimentalBridge extends ExperimentalBridge {}
|
||||
16
packages/apps/tests/test-data/bridges/httpBridge.ts
Normal file
16
packages/apps/tests/test-data/bridges/httpBridge.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import type { IHttpResponse } from '@rocket.chat/apps-engine/definition/accessors';
|
||||
|
||||
import type { IHttpBridgeRequestInfo } from '../../../src/server/bridges';
|
||||
import { HttpBridge } from '../../../src/server/bridges';
|
||||
|
||||
export class TestsHttpBridge extends HttpBridge {
|
||||
public call(info: IHttpBridgeRequestInfo): Promise<IHttpResponse> {
|
||||
return Promise.resolve({
|
||||
url: info.url,
|
||||
method: info.method,
|
||||
statusCode: 200,
|
||||
headers: info.request.headers,
|
||||
content: info.request.content,
|
||||
});
|
||||
}
|
||||
}
|
||||
17
packages/apps/tests/test-data/bridges/internalBridge.ts
Normal file
17
packages/apps/tests/test-data/bridges/internalBridge.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import type { ISetting } from '@rocket.chat/apps-engine/definition/settings';
|
||||
|
||||
import type { IInternalBridge } from '../../../src/server/bridges';
|
||||
|
||||
export class TestsInternalBridge implements IInternalBridge {
|
||||
public doGetUsernamesOfRoomByIdSync(roomId: string): Array<string> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
public doGetUsernamesOfRoomById(roomId: string): Promise<Array<string>> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
public doGetWorkspacePublicKey(): Promise<ISetting> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
import type { IInternalFederationBridge } from '../../../src/server/bridges';
|
||||
|
||||
export class TestsInternalFederationBridge implements IInternalFederationBridge {
|
||||
public async getPrivateKey(): Promise<string> {
|
||||
return 'fake_private-key';
|
||||
}
|
||||
|
||||
public async getPublicKey(): Promise<string> {
|
||||
return 'fake_public-key';
|
||||
}
|
||||
}
|
||||
124
packages/apps/tests/test-data/bridges/livechatBridge.ts
Normal file
124
packages/apps/tests/test-data/bridges/livechatBridge.ts
Normal file
@@ -0,0 +1,124 @@
|
||||
import type { IExtraRoomParams } from '@rocket.chat/apps-engine/definition/accessors/ILivechatCreator';
|
||||
import type {
|
||||
IDepartment,
|
||||
IVisitorExternalIdentifier,
|
||||
ILivechatMessage,
|
||||
ILivechatRoom,
|
||||
ILivechatTransferData,
|
||||
IVisitor,
|
||||
ResolveVisitorContactData,
|
||||
} from '@rocket.chat/apps-engine/definition/livechat';
|
||||
import type { IMessage } from '@rocket.chat/apps-engine/definition/messages';
|
||||
import type { IUser } from '@rocket.chat/apps-engine/definition/users';
|
||||
|
||||
import { LivechatBridge } from '../../../src/server/bridges/LivechatBridge';
|
||||
|
||||
export class TestLivechatBridge extends LivechatBridge {
|
||||
public findDepartmentsEnabledWithAgents(appId: string): Promise<Array<IDepartment>> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
public isOnline(departmentId?: string): boolean {
|
||||
throw new Error('Method not implemented');
|
||||
}
|
||||
|
||||
public isOnlineAsync(departmentId?: string): Promise<boolean> {
|
||||
throw new Error('Method not implemented');
|
||||
}
|
||||
|
||||
public createMessage(message: ILivechatMessage, appId: string): Promise<string> {
|
||||
throw new Error('Method not implemented');
|
||||
}
|
||||
|
||||
public getMessageById(messageId: string, appId: string): Promise<ILivechatMessage> {
|
||||
throw new Error('Method not implemented');
|
||||
}
|
||||
|
||||
public updateMessage(message: ILivechatMessage, appId: string): Promise<void> {
|
||||
throw new Error('Method not implemented');
|
||||
}
|
||||
|
||||
public createVisitor(visitor: IVisitor, appId: string): Promise<string> {
|
||||
throw new Error('Method not implemented');
|
||||
}
|
||||
|
||||
public createAndReturnVisitor(visitor: IVisitor, appId: string): Promise<IVisitor | undefined> {
|
||||
throw new Error('Method not implemented');
|
||||
}
|
||||
|
||||
public transferVisitor(visitor: IVisitor, transferData: ILivechatTransferData, appId: string): Promise<boolean> {
|
||||
throw new Error('Method not implemented');
|
||||
}
|
||||
|
||||
public findVisitors(query: object, appId: string): Promise<Array<IVisitor>> {
|
||||
console.warn('The method AppLivechatBridge.findVisitors is deprecated. Please consider using its alternatives');
|
||||
throw new Error('Method not implemented');
|
||||
}
|
||||
|
||||
public findVisitorById(id: string, appId: string): Promise<IVisitor | undefined> {
|
||||
throw new Error('Method not implemented');
|
||||
}
|
||||
|
||||
public findVisitorByEmail(email: string, appId: string): Promise<IVisitor | undefined> {
|
||||
throw new Error('Method not implemented');
|
||||
}
|
||||
|
||||
public findVisitorByToken(token: string, appId: string): Promise<IVisitor | undefined> {
|
||||
throw new Error('Method not implemented');
|
||||
}
|
||||
|
||||
public findVisitorByPhoneNumber(phoneNumber: string, appId: string): Promise<IVisitor | undefined> {
|
||||
throw new Error('Method not implemented');
|
||||
}
|
||||
|
||||
public resolveVisitor(
|
||||
externalId: IVisitorExternalIdentifier,
|
||||
contactData: ResolveVisitorContactData | undefined,
|
||||
appId: string,
|
||||
): Promise<IVisitor | undefined> {
|
||||
throw new Error('Method not implemented');
|
||||
}
|
||||
|
||||
public updateVisitorExternalId(
|
||||
visitorId: string,
|
||||
externalId: Omit<IVisitorExternalIdentifier, 'appId'>,
|
||||
appId: string,
|
||||
): Promise<IVisitor | undefined> {
|
||||
throw new Error('Method not implemented');
|
||||
}
|
||||
|
||||
public createRoom(visitor: IVisitor, agent: IUser, appId: string, extraParams?: IExtraRoomParams): Promise<ILivechatRoom> {
|
||||
throw new Error('Method not implemented');
|
||||
}
|
||||
|
||||
public closeRoom(room: ILivechatRoom, comment: string, closer: IUser | undefined, appId: string): Promise<boolean> {
|
||||
throw new Error('Method not implemented');
|
||||
}
|
||||
|
||||
public findRooms(visitor: IVisitor, departmentId: string | null, appId: string): Promise<Array<ILivechatRoom>> {
|
||||
throw new Error('Method not implemented');
|
||||
}
|
||||
|
||||
public findOpenRoomsByAgentId(agentId: string, appId: string): Promise<ILivechatRoom[]> {
|
||||
throw new Error('Method not implemented');
|
||||
}
|
||||
|
||||
public countOpenRoomsByAgentId(agentId: string, appId: string): Promise<number> {
|
||||
throw new Error('Method not implemented');
|
||||
}
|
||||
|
||||
public findDepartmentByIdOrName(value: string, appId: string): Promise<IDepartment | undefined> {
|
||||
throw new Error('Method not implemented');
|
||||
}
|
||||
|
||||
public _fetchLivechatRoomMessages(appId: string, roomId: string): Promise<Array<IMessage>> {
|
||||
throw new Error('Method not implemented');
|
||||
}
|
||||
|
||||
public setCustomFields(
|
||||
data: { token: IVisitor['token']; key: string; value: string; overwrite: boolean },
|
||||
appId: string,
|
||||
): Promise<number> {
|
||||
throw new Error('Method not implemented');
|
||||
}
|
||||
}
|
||||
44
packages/apps/tests/test-data/bridges/messageBridge.ts
Normal file
44
packages/apps/tests/test-data/bridges/messageBridge.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
import type { IMessage, Reaction } from '@rocket.chat/apps-engine/definition/messages';
|
||||
import type { IRoom } from '@rocket.chat/apps-engine/definition/rooms';
|
||||
import type { IUser } from '@rocket.chat/apps-engine/definition/users';
|
||||
|
||||
import { MessageBridge } from '../../../src/server/bridges';
|
||||
import type { ITypingDescriptor } from '../../../src/server/bridges/MessageBridge';
|
||||
|
||||
export class TestsMessageBridge extends MessageBridge {
|
||||
public create(message: IMessage, appId: string): Promise<string> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
public getById(messageId: string, appId: string): Promise<IMessage> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
public update(message: IMessage, appId: string): Promise<void> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
public notifyUser(user: IUser, message: IMessage, appId: string): Promise<void> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
public notifyRoom(room: IRoom, message: IMessage, appId: string): Promise<void> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
public delete(message: IMessage, user: IUser, appId: string): Promise<void> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
public typing(options: ITypingDescriptor): Promise<void> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
public addReaction(_messageId: string, _userId: string, _reaction: Reaction): Promise<void> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
public removeReaction(_messageId: string, _userId: string, _reaction: Reaction): Promise<void> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
}
|
||||
18
packages/apps/tests/test-data/bridges/moderationBridge.ts
Normal file
18
packages/apps/tests/test-data/bridges/moderationBridge.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import type { IMessage } from '@rocket.chat/apps-engine/definition/messages';
|
||||
import type { IUser } from '@rocket.chat/apps-engine/definition/users';
|
||||
|
||||
import { ModerationBridge } from '../../../src/server/bridges';
|
||||
|
||||
export class TestsModerationBridge extends ModerationBridge {
|
||||
public report(messageId: string, description: string, userId: string, appId: string): Promise<void> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
public dismissReportsByMessageId(messageId: IMessage['id'], reason: string, action: string, appId: string): Promise<void> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
public dismissReportsByUserId(userId: IUser['id'], reason: string, action: string, appId: string): Promise<void> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
}
|
||||
21
packages/apps/tests/test-data/bridges/outboundComms.ts
Normal file
21
packages/apps/tests/test-data/bridges/outboundComms.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import type {
|
||||
IOutboundEmailMessageProvider,
|
||||
IOutboundMessageProviders,
|
||||
IOutboundPhoneMessageProvider,
|
||||
} from '@rocket.chat/apps-engine/definition/outboundCommunication';
|
||||
|
||||
import { OutboundMessageBridge } from '../../../src/server/bridges';
|
||||
|
||||
export class TestOutboundCommunicationBridge extends OutboundMessageBridge {
|
||||
protected async registerPhoneProvider(provider: IOutboundPhoneMessageProvider, appId: string): Promise<void> {
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
protected async registerEmailProvider(provider: IOutboundEmailMessageProvider, appId: string): Promise<void> {
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
protected async unRegisterProvider(provider: IOutboundMessageProviders, appId: string): Promise<void> {
|
||||
return Promise.resolve();
|
||||
}
|
||||
}
|
||||
46
packages/apps/tests/test-data/bridges/persisBridge.ts
Normal file
46
packages/apps/tests/test-data/bridges/persisBridge.ts
Normal file
@@ -0,0 +1,46 @@
|
||||
import type { RocketChatAssociationRecord } from '@rocket.chat/apps-engine/definition/metadata';
|
||||
|
||||
import { PersistenceBridge } from '../../../src/server/bridges';
|
||||
|
||||
export class TestsPersisBridge extends PersistenceBridge {
|
||||
public purge(appId: string): Promise<void> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
public create(data: any, appId: string): Promise<string> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
public createWithAssociations(data: object, associations: Array<RocketChatAssociationRecord>, appId: string): Promise<string> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
public readById(id: string, appId: string): Promise<object> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
public readByAssociations(associations: Array<RocketChatAssociationRecord>, appId: string): Promise<Array<object>> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
public remove(id: string, appId: string): Promise<object> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
public removeByAssociations(associations: Array<RocketChatAssociationRecord>, appId: string): Promise<Array<object>> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
public update(id: string, data: object, upsert: boolean, appId: string): Promise<string> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
public updateByAssociations(
|
||||
associations: Array<RocketChatAssociationRecord>,
|
||||
data: object,
|
||||
upsert: boolean,
|
||||
appId: string,
|
||||
): Promise<string> {
|
||||
throw new Error('Method not implemented');
|
||||
}
|
||||
}
|
||||
13
packages/apps/tests/test-data/bridges/roleBridge.ts
Normal file
13
packages/apps/tests/test-data/bridges/roleBridge.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import type { IRole } from '@rocket.chat/apps-engine/definition/roles';
|
||||
|
||||
import { RoleBridge } from '../../../src/server/bridges';
|
||||
|
||||
export class TestsRoleBridge extends RoleBridge {
|
||||
public getOneByIdOrName(idOrName: IRole['id'] | IRole['name'], appId: string): Promise<IRole | null> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
public getCustomRoles(appId: string): Promise<Array<IRole>> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
}
|
||||
81
packages/apps/tests/test-data/bridges/roomBridge.ts
Normal file
81
packages/apps/tests/test-data/bridges/roomBridge.ts
Normal file
@@ -0,0 +1,81 @@
|
||||
import type { IMessage, IMessageRaw } from '@rocket.chat/apps-engine/definition/messages';
|
||||
import type { IRoom } from '@rocket.chat/apps-engine/definition/rooms';
|
||||
import type { IRoomRaw } from '@rocket.chat/apps-engine/definition/rooms/IRoomRaw';
|
||||
import type { IUser } from '@rocket.chat/apps-engine/definition/users';
|
||||
|
||||
import { RoomBridge } from '../../../src/server/bridges';
|
||||
import type { GetMessagesOptions, GetRoomsOptions, GetRoomsFilters } from '../../../src/server/bridges/RoomBridge';
|
||||
|
||||
export class TestsRoomBridge extends RoomBridge {
|
||||
public create(room: IRoom, members: Array<string>, appId: string): Promise<string> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
public getById(roomId: string, appId: string): Promise<IRoom> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
public getCreatorById(roomId: string, appId: string): Promise<IUser> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
public getByName(roomName: string, appId: string): Promise<IRoom> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
public getCreatorByName(roomName: string, appId: string): Promise<IUser> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
public getDirectByUsernames(username: Array<string>, appId: string): Promise<IRoom> {
|
||||
throw new Error('Method not implemented');
|
||||
}
|
||||
|
||||
public getMembers(roomName: string, appId: string): Promise<Array<IUser>> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
public getAllRooms(filter: GetRoomsFilters, options: GetRoomsOptions, appId: string): Promise<IRoomRaw[]> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
public getMessages(roomId: string, options: GetMessagesOptions, appId: string): Promise<IMessageRaw[]> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
public update(room: IRoom, members: Array<string>, appId: string): Promise<void> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
public createDiscussion(room: IRoom, parentMessage: IMessage, reply: string, members: Array<string>, appId: string): Promise<string> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
public delete(roomId: string, appId: string): Promise<void> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
public getLeaders(roomId: string, appId: string): Promise<Array<IUser>> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
public getModerators(roomId: string, appId: string): Promise<Array<IUser>> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
public getOwners(roomId: string, appId: string): Promise<Array<IUser>> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
public removeUsers(roomId: string, usernames: string[], appId: string): Promise<void> {
|
||||
throw new Error('Method not implemented');
|
||||
}
|
||||
|
||||
public getUnreadByUser(roomId: string, uid: string, options: GetMessagesOptions, appId: string): Promise<IMessageRaw[]> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
protected getUserUnreadMessageCount(roomId: string, uid: string, appId: string): Promise<number> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
}
|
||||
25
packages/apps/tests/test-data/bridges/schedulerBridge.ts
Normal file
25
packages/apps/tests/test-data/bridges/schedulerBridge.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import type { IOnetimeSchedule, IProcessor, IRecurringSchedule } from '@rocket.chat/apps-engine/definition/scheduler';
|
||||
|
||||
import { SchedulerBridge } from '../../../src/server/bridges';
|
||||
|
||||
export class TestSchedulerBridge extends SchedulerBridge {
|
||||
public async registerProcessors(processors: Array<IProcessor>, appId: string): Promise<void> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
public async scheduleOnce(job: IOnetimeSchedule, appId: string): Promise<void> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
public async scheduleRecurring(job: IRecurringSchedule, appId: string): Promise<void> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
public async cancelJob(jobId: string, appId: string): Promise<void> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
public async cancelAllJobs(appId: string): Promise<void> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
}
|
||||
42
packages/apps/tests/test-data/bridges/serverSettingBridge.ts
Normal file
42
packages/apps/tests/test-data/bridges/serverSettingBridge.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
import { SettingType, type ISetting } from '@rocket.chat/apps-engine/definition/settings';
|
||||
|
||||
import { ServerSettingBridge } from '../../../src/server/bridges';
|
||||
|
||||
export class TestsServerSettingBridge extends ServerSettingBridge {
|
||||
public getAll(appId: string): Promise<Array<ISetting>> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
public getOneById(id: string, appId: string): Promise<ISetting> {
|
||||
return Promise.resolve({
|
||||
id,
|
||||
packageValue: 'packageValue',
|
||||
value: 'value',
|
||||
i18nLabel: 'i18nLabel',
|
||||
i18nDescription: 'i18nDescription',
|
||||
required: true,
|
||||
public: true,
|
||||
type: SettingType.STRING,
|
||||
});
|
||||
}
|
||||
|
||||
public hideGroup(name: string): Promise<void> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
public hideSetting(id: string): Promise<void> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
public isReadableById(id: string, appId: string): Promise<boolean> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
public updateOne(setting: ISetting, appId: string): Promise<void> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
public incrementValue(id: ISetting['id'], value: number, appId: string): Promise<void> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
}
|
||||
9
packages/apps/tests/test-data/bridges/threadBridge.ts
Normal file
9
packages/apps/tests/test-data/bridges/threadBridge.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import type { IMessage } from '@rocket.chat/apps-engine/definition/messages';
|
||||
|
||||
import { ThreadBridge } from '../../../src/server/bridges/ThreadBridge';
|
||||
|
||||
export class TestsThreadBridge extends ThreadBridge {
|
||||
public getById(messageId: string, appId: string): Promise<Array<IMessage>> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
}
|
||||
10
packages/apps/tests/test-data/bridges/uiIntegrationBridge.ts
Normal file
10
packages/apps/tests/test-data/bridges/uiIntegrationBridge.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import type { IUIKitInteractionParam } from '@rocket.chat/apps-engine/definition/accessors/IUIController';
|
||||
import type { IUser } from '@rocket.chat/apps-engine/definition/users';
|
||||
|
||||
import { UiInteractionBridge } from '../../../src/server/bridges';
|
||||
|
||||
export class TestsUiIntegrationBridge extends UiInteractionBridge {
|
||||
public async notifyUser(user: IUser, interaction: IUIKitInteractionParam, appId: string) {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
}
|
||||
18
packages/apps/tests/test-data/bridges/uploadBridge.ts
Normal file
18
packages/apps/tests/test-data/bridges/uploadBridge.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import type { IUpload } from '@rocket.chat/apps-engine/definition/uploads';
|
||||
import type { IUploadDetails } from '@rocket.chat/apps-engine/definition/uploads/IUploadDetails';
|
||||
|
||||
import { UploadBridge } from '../../../src/server/bridges/UploadBridge';
|
||||
|
||||
export class TestUploadBridge extends UploadBridge {
|
||||
public getById(id: string, appId: string): Promise<IUpload> {
|
||||
throw new Error('Method not implemented');
|
||||
}
|
||||
|
||||
public getBuffer(upload: IUpload, appId: string): Promise<Buffer> {
|
||||
throw new Error('Method not implemented');
|
||||
}
|
||||
|
||||
public createUpload(details: IUploadDetails, buffer: Buffer, appId: string): Promise<IUpload> {
|
||||
throw new Error('Method not implemented');
|
||||
}
|
||||
}
|
||||
61
packages/apps/tests/test-data/bridges/userBridge.ts
Normal file
61
packages/apps/tests/test-data/bridges/userBridge.ts
Normal file
@@ -0,0 +1,61 @@
|
||||
import type { IUser, UserType } from '@rocket.chat/apps-engine/definition/users';
|
||||
|
||||
import { UserBridge } from '../../../src/server/bridges';
|
||||
|
||||
export class TestsUserBridge extends UserBridge {
|
||||
public getById(id: string, appId: string): Promise<IUser> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
public getByUsername(username: string, appId: string): Promise<IUser> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
public create(user: Partial<IUser>): Promise<string> {
|
||||
throw new Error('Method not implemented');
|
||||
}
|
||||
|
||||
public getActiveUserCount(): Promise<number> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
public remove(user: IUser, appId: string): Promise<boolean> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
public getAppUser(appId?: string): Promise<IUser> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
public async update(user: IUser, updates: Partial<IUser>, appId: string): Promise<boolean> {
|
||||
throw new Error('Method not implemented');
|
||||
}
|
||||
|
||||
public async deleteUsersCreatedByApp(appId: string, type: UserType.BOT): Promise<boolean> {
|
||||
throw new Error('Method not implemented');
|
||||
}
|
||||
|
||||
protected getUserUnreadMessageCount(uid: string, appId: string): Promise<number> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
protected getUserRoomIds(userId: string, appId: string): Promise<string[]> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
protected deactivate(userId: IUser['id'], confirmRelinquish: boolean, appId: string): Promise<boolean> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
protected setActiveState(
|
||||
userId: IUser['id'],
|
||||
state: Pick<IUser, 'statusDefault' | 'statusSource' | 'statusText' | 'statusExpiresAt' | 'statusId'>,
|
||||
appId: string,
|
||||
): Promise<void> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
protected endActiveState(userId: IUser['id'], appId: string, statusId?: string): Promise<void> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
import type { IVideoConfProvider } from '@rocket.chat/apps-engine/definition/videoConfProviders';
|
||||
import type { VideoConference, AppVideoConference } from '@rocket.chat/apps-engine/definition/videoConferences';
|
||||
|
||||
import { VideoConferenceBridge } from '../../../src/server/bridges';
|
||||
|
||||
export class TestsVideoConferenceBridge extends VideoConferenceBridge {
|
||||
public getById(callId: string, appId: string): Promise<VideoConference> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
public create(call: AppVideoConference, appId: string): Promise<string> {
|
||||
throw new Error('Method not implemented');
|
||||
}
|
||||
|
||||
public update(call: VideoConference, appId: string): Promise<void> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
protected registerProvider(info: IVideoConfProvider, appId: string): Promise<void> {
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
protected unRegisterProvider(info: IVideoConfProvider, appId: string): Promise<void> {
|
||||
return Promise.resolve();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user