diff --git a/README.md b/README.md index c7d2e60..8989ee3 100644 --- a/README.md +++ b/README.md @@ -13,13 +13,10 @@ docker run -e RUN_LOCAL=true -e TYPESCRIPT_DEFAULT_STYLE=prettier -e VALIDATE_DO ``` Note: We have disabled HADOLINT for now as we are getting an error: `qemu: uncaught target signal 11 (Segmentation fault) - core dumped`. -======= + [![Maintainability](https://api.codeclimate.com/v1/badges/52d516c2ad7c262adb37/maintainability)](https://codeclimate.com/github/RnDAO/tc-dbComm/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/52d516c2ad7c262adb37/test_coverage)](https://codeclimate.com/github/RnDAO/tc-dbComm/test_coverage) - -## Schema for rawinfo - ### Tests The CI Pipeline uses the `test` target from the Dockerfile to run the tests. You can run it locally with the following command: @@ -30,7 +27,9 @@ 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. -## Schema for rawinfo +## Schema + +### rawinfo ```ts rawinfo { @@ -50,7 +49,7 @@ rawinfo { } ``` -### Schema for user +### user ```ts User { @@ -72,7 +71,7 @@ User { } ``` -### Schema for heatmap +### heatmap ```ts HeatMap { @@ -93,7 +92,7 @@ HeatMap { } ``` -### Schema for guildMembers +### guildMembers ```ts GuildMember { @@ -108,7 +107,7 @@ GuildMember { ``` -### Schema for memberactivities +### memberactivities ```ts memberactivities { @@ -132,7 +131,7 @@ memberactivities { } ``` -### Schema for channels +### channels ```ts Channels { @@ -142,7 +141,7 @@ Channels { } ``` -### Schema for token +### token ```ts Token { @@ -154,7 +153,7 @@ Token { } ``` -### Schema for guild +### guild ```ts Guild { diff --git a/__tests__/unit/models/guild.model.test.ts b/__tests__/unit/models/guild.model.test.ts index e4e3de2..5c56d2e 100644 --- a/__tests__/unit/models/guild.model.test.ts +++ b/__tests__/unit/models/guild.model.test.ts @@ -22,7 +22,7 @@ describe('Guild model', () => { isInProgress: false, icon: null, window: [7, 1], - action: [1, 1, 1, 4, 3, 5, 5, 4, 3, 3, 2], + action: [1, 1, 1, 4, 3, 5, 5, 4, 3, 3, 2, 2, 1], }; }); diff --git a/package.json b/package.json index 120b24f..0e71ebc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@togethercrew.dev/db", - "version": "2.3.1", + "version": "2.3.2", "description": "All interactions with DB", "main": "./dist/index.js", "scripts": { diff --git a/src/interfaces/RawInfo.interface.ts b/src/interfaces/RawInfo.interface.ts index c5001ee..5b10298 100644 --- a/src/interfaces/RawInfo.interface.ts +++ b/src/interfaces/RawInfo.interface.ts @@ -2,27 +2,27 @@ import { type Model } from 'mongoose'; import { type Snowflake } from 'discord.js'; export interface IRawInfo { - type: number, - author: Snowflake, - content: string, - createdDate: Date, - user_mentions: Array, - role_mentions: Array, - reactions: Array, - replied_user: Snowflake | null | undefined, - messageId: Snowflake, - channelId: Snowflake, - channelName: string | null, - threadId: Snowflake | null, - threadName: string | null, + type: number; + author: Snowflake; + content: string; + createdDate: Date; + user_mentions: Snowflake[]; + role_mentions: Snowflake[]; + reactions: Snowflake[]; + replied_user: Snowflake | null | undefined; + messageId: Snowflake; + channelId: Snowflake; + channelName: string | null; + threadId: Snowflake | null; + threadName: string | null; } export interface IRawInfoUpdateBody { - channelId?: Snowflake, - channelName?: string | null, - threadId?: Snowflake | null, - threadName?: string | null, - content?: string, + channelId?: Snowflake; + channelName?: string | null; + threadId?: Snowflake | null; + threadName?: string | null; + content?: string; } export interface RawInfoModel extends Model { diff --git a/src/models/schemas/Guild.schema.ts b/src/models/schemas/Guild.schema.ts index bf6a9c7..f0761a3 100644 --- a/src/models/schemas/Guild.schema.ts +++ b/src/models/schemas/Guild.schema.ts @@ -56,10 +56,10 @@ const guildSchema = new Schema({ }, action: { type: Array, - default: [1, 1, 1, 4, 3, 5, 5, 4, 3, 3, 2], + default: [1, 1, 1, 4, 3, 5, 5, 4, 3, 3, 2, 2, 1], validate: { validator: function (arr: Array) { - return arr.length === 11; + return arr.length === 13; }, message: 'Action must be an array with exactly 11 numbers', }, diff --git a/src/models/schemas/RawInfo.schema.ts b/src/models/schemas/RawInfo.schema.ts index 1e47a4c..bfa8495 100644 --- a/src/models/schemas/RawInfo.schema.ts +++ b/src/models/schemas/RawInfo.schema.ts @@ -42,7 +42,7 @@ const rawInfoSchema = new Schema({ type: String, }, channelName: { - type: String + type: String, }, threadId: {