3.0.53 • Published 7 days ago

@togethercrew.dev/db v3.0.53

Weekly downloads
-
License
ISC
Repository
github
Last release
7 days ago

mongo-lib

Interactions with mongo database.

Maintainability Test Coverage

Features

Linter

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.

Maintainability Test Coverage

Tests

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 interface

User {
  discordId: Snowflake,
  email?: string,
  communities?: [Types.ObjectId]
  tcaAt?: Date;
  unverifiedTelegramUsername?:string;
}

Community interface

Community {
    name: string,
    avatarURL?: string,
    users?: [Types.ObjectId],
    platforms?: [Types.ObjectId],
    tcaAt?: Date;
    roles?: ICommunityRoles[];
}

Platform interface

Platform {
    name: string,
    community: Types.ObjectId,
    metadata?: Record<string, any>, // dynamic object since structure can change
    disconnectedAt?: Date | null,
    connectedAt?: Date | null;
}

Module interface

Module {
  name: 'hivemind';
    community: Types.ObjectId;
    options?: {
        platforms: Array<{
            platform: Types.ObjectId;
            metadata?: Record<string, any>; // dynamic object since structure can change
        }>;
    }
}

Heatmap interface

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
}

GuildMembers interface

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 interface

Channel {
    id: Snowflake,
    name?: string | null,
    parent_id?: string | null,
    permissionOverwrites?: IOverwrite[],
    deletedAt?: Date | null,
    type: number
}

Role interface

Role {
    id: Snowflake,
    name: string,
    color: number,
    deletedAt?: Date | null
}

Rawinfo interface

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 interface

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 interface

Token {
    token: string,
    user: Types.ObjectId,
    type: string,
    expires: Date,
    blacklisted?: boolean
}
3.0.53

7 days ago

3.0.52

15 days ago

3.0.51

16 days ago

3.0.50

20 days ago

3.0.41

22 days ago

3.0.42

22 days ago

3.0.34

26 days ago

3.0.33

2 months ago

3.0.32

2 months ago

3.0.31

2 months ago

3.0.30

3 months ago

3.0.29

3 months ago

3.0.27

3 months ago

3.0.28

3 months ago

3.0.26

3 months ago

3.0.25

4 months ago

3.0.24

4 months ago

3.0.23

4 months ago

3.0.22

4 months ago

3.0.21

4 months ago

3.0.20

4 months ago

3.0.18

5 months ago

3.0.17

5 months ago

2.4.92

9 months ago

2.4.91

9 months ago

2.5.0

8 months ago

2.5.2

7 months ago

2.4.3

10 months ago

2.5.1

7 months ago

2.4.2

10 months ago

2.4.5

10 months ago

2.4.4

10 months ago

2.4.98

8 months ago

2.4.97

8 months ago

2.4.99

8 months ago

2.4.94

9 months ago

2.4.93

9 months ago

2.4.96

9 months ago

2.4.95

9 months ago

3.0.12

6 months ago

3.0.13

6 months ago

3.0.10

7 months ago

3.0.11

7 months ago

3.0.16

5 months ago

3.0.14

6 months ago

3.0.15

6 months ago

2.4.7

10 months ago

2.4.6

10 months ago

2.4.9

10 months ago

2.4.8

10 months ago

2.4.1

10 months ago

2.4.0

10 months ago

2.3.6

11 months ago

2.3.5

11 months ago

2.3.4

11 months ago