Interactions with mongo database.
The CI Pipeline uses super-linter. You can run it locally with the following command:
docker run -e RUN_LOCAL=true -e TYPESCRIPT_DEFAULT_STYLE=prettier -e VALIDATE_DOCKERFILE_HADOLINT=false -v $(pwd):/tmp/lint github/super-linter:slim-latest
Windows: docker run -e RUN_LOCAL=true -e TYPESCRIPT_DEFAULT_STYLE=prettier -e VALIDATE_DOCKERFILE_HADOLINT=false -v "$(Resolve-Path .):/tmp/lint" github/super-linter:slim-latest
Note: We have disabled HADOLINT for now as we are getting an error: qemu: uncaught target signal 11 (Segmentation fault) - core dumped
.
The CI Pipeline uses the test
target from the Dockerfile to run the tests. You can run it locally with the following command:
docker compose -f docker-compose.test.yml up --exit-code-from app --build
Note: This will create a /coverage folder where you can review the coverage details.
User {
discordId: Snowflake,
email?: string,
communities?: [Types.ObjectId]
tcaAt?: Date;
unverifiedTelegramUsername?:string;
}
Community {
name: string,
avatarURL?: string,
users?: [Types.ObjectId],
platforms?: [Types.ObjectId],
tcaAt?: Date;
roles?: ICommunityRoles[];
}
Platform {
name: string,
community: Types.ObjectId,
metadata?: Record<string, any>, // dynamic object since structure can change
disconnectedAt?: Date | null,
connectedAt?: Date | null;
}
Module {
name: 'hivemind';
community: Types.ObjectId;
options?: {
platforms: Array<{
platform: Types.ObjectId;
metadata?: Record<string, any>; // dynamic object since structure can change
}>;
}
}
HeatMap {
date?: string,(format: "YYYY-MM-DD")
thr_messages: Array<number>,
lone_messages: Array<number>,
replier: Array<number>,
replied_per_acc: Array<objects> [{account: "account name", count: "count of reply"}],
replied: Array<number>,
mentioner: Array<number>,
mentioner_per_acc: Array<objects> [{account: "account name", count: "count of mention"}],
mentioned: Array<number>,
reacter: Array<number>,
reacted_per_acc: Array<objects> [{account: "account name", count: "count of reaction"}],
reacted: Array<number>,
channelId: string,
account_name: string
}
GuildMember {
discordId: Snowflake,
username: string,
avatar?: string | null,
roles: Snowflake[],
joinedAt: Date | null,
isBot?: boolean,
discriminator?: string,
permissions?: string,
deletedAt?: Date | null,
globalName?: string | null;
nickname?: string | null;
}
Channel {
id: Snowflake,
name?: string | null,
parent_id?: string | null,
permissionOverwrites?: IOverwrite[],
deletedAt?: Date | null,
type: number
}
Role {
id: Snowflake,
name: string,
color: number,
deletedAt?: Date | null
}
rawinfo {
type: number,
author: Snowflake,
content: string,
createdDate: Date,
user_mentions: Array<Snowflake>,
role_mentions: Array<Snowflake>,
reactions: Array<Snowflake>,
replied_user: Snowflake | null | undefined,
messageId: Snowflake,
channelId: Snowflake,
channelName: string | null,
threadId: Snowflake | null,
threadName: string | null,
isGeneratedByWebhook: boolean
}
memberactivities {
date: Date,
all_active: Array<string>,
all_consistent: Array<string>,
all_vital: Array<string>,
all_connected: Array<string>,
all_paused: Array<string>,
all_new_disengaged: Array<string>,
all_disengaged: Array<string>,
all_unpaused: Array<string>,
all_returned: Array<string>,
all_new_active: Array<string>,
all_still_active: Array<string>,
all_dropped: Array<string>,
all_joined: Array<string>,
all_disengaged_were_newly_active: Array<string>,
all_disengaged_were_consistently_active: Array<string>,
all_disengaged_were_vital: Array<string>,
all_lurker: Array<string>,
all_about_to_disengage: Array<string>,
all_disengaged_in_past: Array<string>,
all_joined_day: Array<string>,
}
Token {
token: string,
user: Types.ObjectId,
type: string,
expires: Date,
blacklisted?: boolean
}