Skip to content

The open alternative to Salesforce, designed for AI.

Create empty command (#2963)

bosiraphael659405531777
diff --git a/packages/twenty-server/src/command.module.ts b/packages/twenty-server/src/command.module.ts
index 01068663d2c..c13c814c43b 100644
--- a/packages/twenty-server/src/command.module.ts
+++ b/packages/twenty-server/src/command.module.ts
@@ -1,6 +1,7 @@
import { Module } from '@nestjs/common';
import { DatabaseCommandModule } from 'src/database/commands/database-command.module';
+import { FetchWorkspaceMessagesCommand } from 'src/workspace/messaging/commands/fetch-workspace-messages.command';
import { AppModule } from './app.module';
@@ -13,6 +14,7 @@ import { WorkspaceMigrationRunnerCommandsModule } from './workspace/workspace-mi
WorkspaceMigrationRunnerCommandsModule,
WorkspaceSyncMetadataCommandsModule,
DatabaseCommandModule,
+ FetchWorkspaceMessagesCommand,
],
})
export class CommandModule {}
diff --git a/packages/twenty-server/src/workspace/messaging/commands/fetch-workspace-messages-commands.module.ts b/packages/twenty-server/src/workspace/messaging/commands/fetch-workspace-messages-commands.module.ts
new file mode 100644
index 00000000000..ed7324f04b0
--- /dev/null
+++ b/packages/twenty-server/src/workspace/messaging/commands/fetch-workspace-messages-commands.module.ts
@@ -0,0 +1,9 @@
+import { Module } from '@nestjs/common';
+
+import { FetchWorkspaceMessagesCommand } from 'src/workspace/messaging/commands/fetch-workspace-messages.command';
+
+@Module({
+ imports: [],
+ providers: [FetchWorkspaceMessagesCommand],
+})
+export class FetchWorkspaceMessagesCommandsModule {}
diff --git a/packages/twenty-server/src/workspace/messaging/commands/fetch-workspace-messages.command.ts b/packages/twenty-server/src/workspace/messaging/commands/fetch-workspace-messages.command.ts
new file mode 100644
index 00000000000..9a477450918
--- /dev/null
+++ b/packages/twenty-server/src/workspace/messaging/commands/fetch-workspace-messages.command.ts
@@ -0,0 +1,29 @@
+import { Command, CommandRunner, Option } from 'nest-commander';
+
+interface FetchWorkspaceMessagesOptions {
+ workspaceId: string;
+}
+
+@Command({
+ name: 'workspace:fetch-messages',
+ description: 'Fetch messages of all workspaceMembers in a workspace.',
+})
+export class FetchWorkspaceMessagesCommand extends CommandRunner {
+ async run(
+ _passedParam: string[],
+ options: FetchWorkspaceMessagesOptions,
+ ): Promise<void> {
+ console.log('fetching messages for workspace', options.workspaceId);
+
+ return;
+ }
+
+ @Option({
+ flags: '-w, --workspace-id [workspace_id]',
+ description: 'workspace id',
+ required: true,
+ })
+ parseWorkspaceId(value: string): string {
+ return value;
+ }
+}