From ab02b010c1b1da60cda54256a9ec81025c76cf02 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 28 Sep 2026 21:06:08 +0000 Subject: [PATCH] feat: Updated OpenAPI spec --- .../Commands/AddContentCommandApiCommand.g.cs | 3 +++ .../Commands/AddGlossaryCommandApiCommand.g.cs | 3 +++ src/cli/ModernMT.CLI/Commands/ApiCommand.g.cs | 5 ++++- .../Commands/CreateMemoryCommandApiCommand.g.cs | 3 +++ .../ModernMT.CLI/Commands/DefaultApiGroupCommand.g.cs | 5 ++++- .../Commands/DeleteMemoryCommandApiCommand.g.cs | 3 +++ .../Commands/DetectLanguageCommandApiCommand.g.cs | 3 +++ .../Commands/GetContextVectorCommandApiCommand.g.cs | 3 +++ .../Commands/GetImportJobCommandApiCommand.g.cs | 3 +++ .../Commands/GetMemoryCommandApiCommand.g.cs | 3 +++ .../Commands/ListLanguagesCommandApiCommand.g.cs | 3 +++ .../Commands/ListMemoriesCommandApiCommand.g.cs | 3 +++ .../Commands/QualityEstimationCommandApiCommand.g.cs | 3 +++ .../Commands/TranslateBatchCommandApiCommand.g.cs | 3 +++ .../Commands/TranslateCommandApiCommand.g.cs | 3 +++ .../Commands/UpdateMemoryCommandApiCommand.g.cs | 3 +++ src/cli/ModernMT.CLI/README.md | 11 +++++++++-- 17 files changed, 59 insertions(+), 4 deletions(-) diff --git a/src/cli/ModernMT.CLI/Commands/AddContentCommandApiCommand.g.cs b/src/cli/ModernMT.CLI/Commands/AddContentCommandApiCommand.g.cs index c639e1d..39a77ae 100644 --- a/src/cli/ModernMT.CLI/Commands/AddContentCommandApiCommand.g.cs +++ b/src/cli/ModernMT.CLI/Commands/AddContentCommandApiCommand.g.cs @@ -89,6 +89,8 @@ private static string FormatResponse(ParseResult parseResult, global::ModernMT.I static partial void CustomizeResponseFormatHints(Dictionary hints); + static partial void CustomizeCommand(ref Command command); + public static Command Create() { var command = new Command(@"add-content", @"Add content to a translation memory"); @@ -152,6 +154,7 @@ await CliRuntime.WriteResponseAsync( FormatResponse, cancellationToken).ConfigureAwait(false); }, cancellationToken).ConfigureAwait(false)); + CustomizeCommand(ref command); return command; } } \ No newline at end of file diff --git a/src/cli/ModernMT.CLI/Commands/AddGlossaryCommandApiCommand.g.cs b/src/cli/ModernMT.CLI/Commands/AddGlossaryCommandApiCommand.g.cs index dad8006..1712465 100644 --- a/src/cli/ModernMT.CLI/Commands/AddGlossaryCommandApiCommand.g.cs +++ b/src/cli/ModernMT.CLI/Commands/AddGlossaryCommandApiCommand.g.cs @@ -69,6 +69,8 @@ private static string FormatResponse(ParseResult parseResult, global::ModernMT.I static partial void CustomizeResponseFormatHints(Dictionary hints); + static partial void CustomizeCommand(ref Command command); + public static Command Create() { var command = new Command(@"add-glossary", @"Add glossary terms to a memory"); @@ -123,6 +125,7 @@ await CliRuntime.WriteResponseAsync( FormatResponse, cancellationToken).ConfigureAwait(false); }, cancellationToken).ConfigureAwait(false)); + CustomizeCommand(ref command); return command; } } \ No newline at end of file diff --git a/src/cli/ModernMT.CLI/Commands/ApiCommand.g.cs b/src/cli/ModernMT.CLI/Commands/ApiCommand.g.cs index 5868401..f13fd0e 100644 --- a/src/cli/ModernMT.CLI/Commands/ApiCommand.g.cs +++ b/src/cli/ModernMT.CLI/Commands/ApiCommand.g.cs @@ -4,13 +4,16 @@ namespace ModernMT.CLI.Commands; -internal static class ApiCommand +internal static partial class ApiCommand { + static partial void CustomizeCommand(ref Command command); + public static Command Create() { var command = new Command("api", "Generated endpoint commands."); command.Subcommands.Add(DefaultApiGroupCommand.Create()); + CustomizeCommand(ref command); return command; } } \ No newline at end of file diff --git a/src/cli/ModernMT.CLI/Commands/CreateMemoryCommandApiCommand.g.cs b/src/cli/ModernMT.CLI/Commands/CreateMemoryCommandApiCommand.g.cs index d1e1be3..9848797 100644 --- a/src/cli/ModernMT.CLI/Commands/CreateMemoryCommandApiCommand.g.cs +++ b/src/cli/ModernMT.CLI/Commands/CreateMemoryCommandApiCommand.g.cs @@ -61,6 +61,8 @@ private static string FormatResponse(ParseResult parseResult, global::ModernMT.M static partial void CustomizeResponseFormatHints(Dictionary hints); + static partial void CustomizeCommand(ref Command command); + public static Command Create() { var command = new Command(@"create-memory", @"Create a translation memory"); @@ -112,6 +114,7 @@ await CliRuntime.WriteResponseAsync( FormatResponse, cancellationToken).ConfigureAwait(false); }, cancellationToken).ConfigureAwait(false)); + CustomizeCommand(ref command); return command; } } \ No newline at end of file diff --git a/src/cli/ModernMT.CLI/Commands/DefaultApiGroupCommand.g.cs b/src/cli/ModernMT.CLI/Commands/DefaultApiGroupCommand.g.cs index d88a76e..2c47081 100644 --- a/src/cli/ModernMT.CLI/Commands/DefaultApiGroupCommand.g.cs +++ b/src/cli/ModernMT.CLI/Commands/DefaultApiGroupCommand.g.cs @@ -4,8 +4,10 @@ namespace ModernMT.CLI.Commands; -internal static class DefaultApiGroupCommand +internal static partial class DefaultApiGroupCommand { + static partial void CustomizeCommand(ref Command command); + public static Command Create() { var command = new Command(@"default", @"default endpoint commands."); @@ -23,6 +25,7 @@ public static Command Create() command.Subcommands.Add(TranslateCommandApiCommand.Create()); command.Subcommands.Add(TranslateBatchCommandApiCommand.Create()); command.Subcommands.Add(UpdateMemoryCommandApiCommand.Create()); + CustomizeCommand(ref command); return command; } } \ No newline at end of file diff --git a/src/cli/ModernMT.CLI/Commands/DeleteMemoryCommandApiCommand.g.cs b/src/cli/ModernMT.CLI/Commands/DeleteMemoryCommandApiCommand.g.cs index 98b5829..f7958fe 100644 --- a/src/cli/ModernMT.CLI/Commands/DeleteMemoryCommandApiCommand.g.cs +++ b/src/cli/ModernMT.CLI/Commands/DeleteMemoryCommandApiCommand.g.cs @@ -33,6 +33,8 @@ private static string FormatResponse(ParseResult parseResult, global::ModernMT.M static partial void CustomizeResponseFormatHints(Dictionary hints); + static partial void CustomizeCommand(ref Command command); + public static Command Create() { var command = new Command(@"delete-memory", @"Delete a translation memory"); @@ -58,6 +60,7 @@ await CliRuntime.WriteResponseAsync( FormatResponse, cancellationToken).ConfigureAwait(false); }, cancellationToken).ConfigureAwait(false)); + CustomizeCommand(ref command); return command; } } \ No newline at end of file diff --git a/src/cli/ModernMT.CLI/Commands/DetectLanguageCommandApiCommand.g.cs b/src/cli/ModernMT.CLI/Commands/DetectLanguageCommandApiCommand.g.cs index fd080e2..92ffc39 100644 --- a/src/cli/ModernMT.CLI/Commands/DetectLanguageCommandApiCommand.g.cs +++ b/src/cli/ModernMT.CLI/Commands/DetectLanguageCommandApiCommand.g.cs @@ -56,6 +56,8 @@ private static string FormatResponse(ParseResult parseResult, global::ModernMT.D static partial void CustomizeResponseFormatHints(Dictionary hints); + static partial void CustomizeCommand(ref Command command); + public static Command Create() { var command = new Command(@"detect-language", @"Detect language of text"); @@ -104,6 +106,7 @@ await CliRuntime.WriteResponseAsync( FormatResponse, cancellationToken).ConfigureAwait(false); }, cancellationToken).ConfigureAwait(false)); + CustomizeCommand(ref command); return command; } } \ No newline at end of file diff --git a/src/cli/ModernMT.CLI/Commands/GetContextVectorCommandApiCommand.g.cs b/src/cli/ModernMT.CLI/Commands/GetContextVectorCommandApiCommand.g.cs index 4cae231..fa0ca02 100644 --- a/src/cli/ModernMT.CLI/Commands/GetContextVectorCommandApiCommand.g.cs +++ b/src/cli/ModernMT.CLI/Commands/GetContextVectorCommandApiCommand.g.cs @@ -76,6 +76,8 @@ private static string FormatResponse(ParseResult parseResult, global::ModernMT.C static partial void CustomizeResponseFormatHints(Dictionary hints); + static partial void CustomizeCommand(ref Command command); + public static Command Create() { var command = new Command(@"get-context-vector", @"Generate context vector for adaptive translation"); @@ -133,6 +135,7 @@ await CliRuntime.WriteResponseAsync( FormatResponse, cancellationToken).ConfigureAwait(false); }, cancellationToken).ConfigureAwait(false)); + CustomizeCommand(ref command); return command; } } \ No newline at end of file diff --git a/src/cli/ModernMT.CLI/Commands/GetImportJobCommandApiCommand.g.cs b/src/cli/ModernMT.CLI/Commands/GetImportJobCommandApiCommand.g.cs index 4670acf..409c5d1 100644 --- a/src/cli/ModernMT.CLI/Commands/GetImportJobCommandApiCommand.g.cs +++ b/src/cli/ModernMT.CLI/Commands/GetImportJobCommandApiCommand.g.cs @@ -33,6 +33,8 @@ private static string FormatResponse(ParseResult parseResult, global::ModernMT.I static partial void CustomizeResponseFormatHints(Dictionary hints); + static partial void CustomizeCommand(ref Command command); + public static Command Create() { var command = new Command(@"get-import-job", @"Get import job status"); @@ -58,6 +60,7 @@ await CliRuntime.WriteResponseAsync( FormatResponse, cancellationToken).ConfigureAwait(false); }, cancellationToken).ConfigureAwait(false)); + CustomizeCommand(ref command); return command; } } \ No newline at end of file diff --git a/src/cli/ModernMT.CLI/Commands/GetMemoryCommandApiCommand.g.cs b/src/cli/ModernMT.CLI/Commands/GetMemoryCommandApiCommand.g.cs index 9d0dff9..ab094b3 100644 --- a/src/cli/ModernMT.CLI/Commands/GetMemoryCommandApiCommand.g.cs +++ b/src/cli/ModernMT.CLI/Commands/GetMemoryCommandApiCommand.g.cs @@ -33,6 +33,8 @@ private static string FormatResponse(ParseResult parseResult, global::ModernMT.M static partial void CustomizeResponseFormatHints(Dictionary hints); + static partial void CustomizeCommand(ref Command command); + public static Command Create() { var command = new Command(@"get-memory", @"Get a translation memory"); @@ -58,6 +60,7 @@ await CliRuntime.WriteResponseAsync( FormatResponse, cancellationToken).ConfigureAwait(false); }, cancellationToken).ConfigureAwait(false)); + CustomizeCommand(ref command); return command; } } \ No newline at end of file diff --git a/src/cli/ModernMT.CLI/Commands/ListLanguagesCommandApiCommand.g.cs b/src/cli/ModernMT.CLI/Commands/ListLanguagesCommandApiCommand.g.cs index 012ab3b..c358ce8 100644 --- a/src/cli/ModernMT.CLI/Commands/ListLanguagesCommandApiCommand.g.cs +++ b/src/cli/ModernMT.CLI/Commands/ListLanguagesCommandApiCommand.g.cs @@ -29,6 +29,8 @@ private static string FormatResponse(ParseResult parseResult, global::ModernMT.L static partial void CustomizeResponseFormatHints(Dictionary hints); + static partial void CustomizeCommand(ref Command command); + public static Command Create() { var command = new Command(@"list-languages", @"List supported languages"); @@ -62,6 +64,7 @@ await CliRuntime.WriteResponseAsync( cancellationToken).ConfigureAwait(false); } }, cancellationToken).ConfigureAwait(false)); + CustomizeCommand(ref command); return command; } } \ No newline at end of file diff --git a/src/cli/ModernMT.CLI/Commands/ListMemoriesCommandApiCommand.g.cs b/src/cli/ModernMT.CLI/Commands/ListMemoriesCommandApiCommand.g.cs index 397ecd1..003f774 100644 --- a/src/cli/ModernMT.CLI/Commands/ListMemoriesCommandApiCommand.g.cs +++ b/src/cli/ModernMT.CLI/Commands/ListMemoriesCommandApiCommand.g.cs @@ -29,6 +29,8 @@ private static string FormatResponse(ParseResult parseResult, global::ModernMT.M static partial void CustomizeResponseFormatHints(Dictionary hints); + static partial void CustomizeCommand(ref Command command); + public static Command Create() { var command = new Command(@"list-memories", @"List translation memories"); @@ -62,6 +64,7 @@ await CliRuntime.WriteResponseAsync( cancellationToken).ConfigureAwait(false); } }, cancellationToken).ConfigureAwait(false)); + CustomizeCommand(ref command); return command; } } \ No newline at end of file diff --git a/src/cli/ModernMT.CLI/Commands/QualityEstimationCommandApiCommand.g.cs b/src/cli/ModernMT.CLI/Commands/QualityEstimationCommandApiCommand.g.cs index 761ce00..0178f14 100644 --- a/src/cli/ModernMT.CLI/Commands/QualityEstimationCommandApiCommand.g.cs +++ b/src/cli/ModernMT.CLI/Commands/QualityEstimationCommandApiCommand.g.cs @@ -55,6 +55,8 @@ private static string FormatResponse(ParseResult parseResult, global::ModernMT.Q static partial void CustomizeResponseFormatHints(Dictionary hints); + static partial void CustomizeCommand(ref Command command); + public static Command Create() { var command = new Command(@"quality-estimation", @"Estimate translation quality"); @@ -89,6 +91,7 @@ await CliRuntime.WriteResponseAsync( FormatResponse, cancellationToken).ConfigureAwait(false); }, cancellationToken).ConfigureAwait(false)); + CustomizeCommand(ref command); return command; } } \ No newline at end of file diff --git a/src/cli/ModernMT.CLI/Commands/TranslateBatchCommandApiCommand.g.cs b/src/cli/ModernMT.CLI/Commands/TranslateBatchCommandApiCommand.g.cs index 52b54a5..69b627e 100644 --- a/src/cli/ModernMT.CLI/Commands/TranslateBatchCommandApiCommand.g.cs +++ b/src/cli/ModernMT.CLI/Commands/TranslateBatchCommandApiCommand.g.cs @@ -89,6 +89,8 @@ private static string FormatResponse(ParseResult parseResult, global::ModernMT.B static partial void CustomizeResponseFormatHints(Dictionary hints); + static partial void CustomizeCommand(ref Command command); + public static Command Create() { var command = new Command(@"translate-batch", @"Submit batch translation"); @@ -152,6 +154,7 @@ await CliRuntime.WriteResponseAsync( FormatResponse, cancellationToken).ConfigureAwait(false); }, cancellationToken).ConfigureAwait(false)); + CustomizeCommand(ref command); return command; } } \ No newline at end of file diff --git a/src/cli/ModernMT.CLI/Commands/TranslateCommandApiCommand.g.cs b/src/cli/ModernMT.CLI/Commands/TranslateCommandApiCommand.g.cs index 1dc77ce..9c10cd8 100644 --- a/src/cli/ModernMT.CLI/Commands/TranslateCommandApiCommand.g.cs +++ b/src/cli/ModernMT.CLI/Commands/TranslateCommandApiCommand.g.cs @@ -96,6 +96,8 @@ private static string FormatResponse(ParseResult parseResult, global::ModernMT.T static partial void CustomizeResponseFormatHints(Dictionary hints); + static partial void CustomizeCommand(ref Command command); + public static Command Create() { var command = new Command(@"translate", @"Translate text"); @@ -165,6 +167,7 @@ await CliRuntime.WriteResponseAsync( FormatResponse, cancellationToken).ConfigureAwait(false); }, cancellationToken).ConfigureAwait(false)); + CustomizeCommand(ref command); return command; } } \ No newline at end of file diff --git a/src/cli/ModernMT.CLI/Commands/UpdateMemoryCommandApiCommand.g.cs b/src/cli/ModernMT.CLI/Commands/UpdateMemoryCommandApiCommand.g.cs index 8751816..9dfcac9 100644 --- a/src/cli/ModernMT.CLI/Commands/UpdateMemoryCommandApiCommand.g.cs +++ b/src/cli/ModernMT.CLI/Commands/UpdateMemoryCommandApiCommand.g.cs @@ -61,6 +61,8 @@ private static string FormatResponse(ParseResult parseResult, global::ModernMT.M static partial void CustomizeResponseFormatHints(Dictionary hints); + static partial void CustomizeCommand(ref Command command); + public static Command Create() { var command = new Command(@"update-memory", @"Update a translation memory"); @@ -112,6 +114,7 @@ await CliRuntime.WriteResponseAsync( FormatResponse, cancellationToken).ConfigureAwait(false); }, cancellationToken).ConfigureAwait(false)); + CustomizeCommand(ref command); return command; } } \ No newline at end of file diff --git a/src/cli/ModernMT.CLI/README.md b/src/cli/ModernMT.CLI/README.md index d32bf47..e9a5706 100644 --- a/src/cli/ModernMT.CLI/README.md +++ b/src/cli/ModernMT.CLI/README.md @@ -12,5 +12,12 @@ dotnet tool install --global ModernMT.CLI --prerelease ```bash modern-mt --help -modern-mt api --help -``` \ No newline at end of file +modern-mt default --help +``` + +## Customization + +Generated operation, tag, and API group command classes are partial. Implement +`static partial void CustomizeCommand(ref Command command)` in a separate source +file to add aliases or validators, change the action, or replace a command. The +hook runs after the generated command has been configured. \ No newline at end of file