7f1e69740a
First PR to implement application tokens - add new application role in twenty-server - move duplicated constants and types to twenty-shared - will add role configuration utils into twenty-sdk in another PR
20 lines
597 B
TypeScript
20 lines
597 B
TypeScript
import chalk from 'chalk';
|
|
import { GenerateService } from '@/cli/services/generate.service';
|
|
import { CURRENT_EXECUTION_DIRECTORY } from '@/cli/constants/current-execution-directory';
|
|
|
|
export class AppGenerateCommand {
|
|
private generateService = new GenerateService();
|
|
|
|
async execute(appPath: string = CURRENT_EXECUTION_DIRECTORY) {
|
|
try {
|
|
await this.generateService.generateClient(appPath);
|
|
} catch (error) {
|
|
console.error(
|
|
chalk.red('Generate Twenty client failed:'),
|
|
error instanceof Error ? error.message : error,
|
|
);
|
|
throw error;
|
|
}
|
|
}
|
|
}
|