🚧 #46 Shared with me (#67)

* 🚧 #46 Shared with me
This commit is contained in:
Anton Shepilov
2023-06-07 10:48:44 +02:00
committed by GitHub
parent 49ec20d60e
commit f1bf507865
42 changed files with 1122 additions and 867 deletions
+6 -2
View File
@@ -13,6 +13,7 @@ import config from "config";
import globalResolver from "../../../src/services/global-resolver";
import {FileServiceImpl} from "../../../src/services/files/services";
import StorageAPI from "../../../src/core/platform/services/storage/provider";
import {SearchServiceAPI} from "../../../src/core/platform/services/search/api";
type TokenPayload = {
sub: string;
@@ -23,7 +24,7 @@ type TokenPayload = {
};
};
type User = {
export type User = {
id: string;
isWorkspaceModerator?: boolean;
};
@@ -42,6 +43,7 @@ export interface TestPlatform {
getJWTToken(payload?: TokenPayload): Promise<string>;
};
tearDown(): Promise<void>;
search: SearchServiceAPI;
}
export interface TestPlatformConfiguration {
@@ -76,6 +78,7 @@ export async function init(
const messageQueue = platform.getProvider<MessageQueueServiceAPI>("message-queue");
const auth = platform.getProvider<AuthServiceAPI>("auth");
const storage: StorageAPI = platform.getProvider<StorageAPI>("storage");
const search: SearchServiceAPI = platform.getProvider<SearchServiceAPI>("search");
testPlatform = {
platform,
@@ -91,6 +94,7 @@ export async function init(
getJWTToken,
},
tearDown,
search,
};
}
@@ -112,7 +116,7 @@ export async function init(
payload.sub = testPlatform.currentUser.id;
}
if (testPlatform .currentUser.isWorkspaceModerator) {
if (testPlatform.currentUser.isWorkspaceModerator) {
payload.org = {};
payload.org[testPlatform.workspace.company_id] = {
role: "",
@@ -6,6 +6,12 @@
"level": "warn"
}
},
"search": {
"type": "elasticsearch",
"elasticsearch": {
"endpoint": "http://localhost:9200"
}
},
"websocket": {
"path": "/socket",
"adapters": {