From eb86979283bd74f4f30e4428a779cb201032eed2 Mon Sep 17 00:00:00 2001 From: Behzad Rabiei <53224485+Behzad-rabiei@users.noreply.github.com> Date: Tue, 23 Apr 2024 10:14:10 +0400 Subject: [PATCH] add google support for hivemind module --- package.json | 2 +- src/interfaces/Module.interface.ts | 4 ++-- src/models/schemas/Module.schema.ts | 2 +- src/models/schemas/Platform.schema.ts | 1 + 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 83cb1c5..673b9de 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@togethercrew.dev/db", - "version": "3.0.52", + "version": "3.0.53", "description": "All interactions with DB", "main": "./dist/index.js", "types": "./dist/index.d.ts", diff --git a/src/interfaces/Module.interface.ts b/src/interfaces/Module.interface.ts index 2480638..6395687 100644 --- a/src/interfaces/Module.interface.ts +++ b/src/interfaces/Module.interface.ts @@ -6,7 +6,7 @@ export interface IModule { options?: { platforms: Array<{ platform: Types.ObjectId; - name: 'discord'; + name: 'discord' | 'google'; metadata?: Record; // dynamic object since structure can change }>; }; @@ -15,7 +15,7 @@ export interface IModuleUpdateBody { options?: { platforms: Array<{ platform: Types.ObjectId; - name: 'discord'; + name: 'discord' | 'google'; metadata?: Record; // dynamic object since structure can change }>; }; diff --git a/src/models/schemas/Module.schema.ts b/src/models/schemas/Module.schema.ts index 68e4574..1dbc748 100644 --- a/src/models/schemas/Module.schema.ts +++ b/src/models/schemas/Module.schema.ts @@ -28,7 +28,7 @@ const moduleSchema = new Schema( name: { type: String, required: true, - enum: ['discord'], + enum: ['discord', 'google'], }, }, ], diff --git a/src/models/schemas/Platform.schema.ts b/src/models/schemas/Platform.schema.ts index 0d6e4d2..b837ab9 100644 --- a/src/models/schemas/Platform.schema.ts +++ b/src/models/schemas/Platform.schema.ts @@ -8,6 +8,7 @@ const platformSchema = new Schema( name: { type: String, required: true, + enum: ['google', 'discord', 'twitter'], }, metadata: { type: Schema.Types.Mixed,