From cac4933ddb5ca1e4ea7f7d5ae7d1f3c08f231dc1 Mon Sep 17 00:00:00 2001 From: peefy Date: Tue, 19 Mar 2024 13:35:53 +0800 Subject: [PATCH] docs: sync ListOptions and Validate API definitions Signed-off-by: peefy --- docs/reference/xlang-api/rest-api.md | 28 ++++++++++++++----- .../current/reference/xlang-api/rest-api.md | 28 ++++++++++++++----- .../reference/xlang-api/rest-api.md | 28 ++++++++++++++----- .../reference/xlang-api/rest-api.md | 28 ++++++++++++++----- .../package-management/4-how-to/9-kpm_oci.md | 6 ++-- 5 files changed, 87 insertions(+), 31 deletions(-) diff --git a/docs/reference/xlang-api/rest-api.md b/docs/reference/xlang-api/rest-api.md index 10be5a94..3f7ca652 100644 --- a/docs/reference/xlang-api/rest-api.md +++ b/docs/reference/xlang-api/rest-api.md @@ -178,6 +178,7 @@ service KclvmService { rpc ParseFile(ParseFile_Args) returns(ParseFile_Result); rpc ParseProgram(ParseProgram_Args) returns(ParseProgram_Result); rpc LoadPackage(LoadPackage_Args) returns(LoadPackage_Result); + rpc ListOptions(ParseProgram_Args) returns(ListOptions_Result); rpc FormatCode(FormatCode_Args) returns(FormatCode_Result); rpc FormatPath(FormatPath_Args) returns(FormatPath_Result); @@ -256,6 +257,18 @@ message LoadPackage_Result { map pkg_scope_map = 10; // Map key is the package path. } +message ListOptions_Result { + repeated OptionHelp options = 2; // Returns the files in the order they should be compiled +} + +message OptionHelp { + string name = 1; + string type = 2; + bool required = 3; + string default_value = 4; + string help = 5; +} + message Symbol { KclType ty = 1; string name = 2; @@ -290,7 +303,7 @@ message ExecProgram_Args { repeated string k_filename_list = 2; repeated string k_code_list = 3; - + repeated CmdArgSpec args = 4; repeated CmdOverrideSpec overrides = 5; @@ -414,12 +427,13 @@ message GetSchemaTypeMapping_Result { } message ValidateCode_Args { - string data = 1; - string file = 2; - string code = 3; - string schema = 4; - string attribute_name = 5; - string format = 6; + string datafile = 1; + string data = 2; + string file = 3; + string code = 4; + string schema = 5; + string attribute_name = 6; + string format = 7; } message ValidateCode_Result { diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/reference/xlang-api/rest-api.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/reference/xlang-api/rest-api.md index 0723d390..cd062e98 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/reference/xlang-api/rest-api.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/reference/xlang-api/rest-api.md @@ -190,6 +190,7 @@ service KclvmService { rpc ParseFile(ParseFile_Args) returns(ParseFile_Result); rpc ParseProgram(ParseProgram_Args) returns(ParseProgram_Result); rpc LoadPackage(LoadPackage_Args) returns(LoadPackage_Result); + rpc ListOptions(ParseProgram_Args) returns(ListOptions_Result); rpc FormatCode(FormatCode_Args) returns(FormatCode_Result); rpc FormatPath(FormatPath_Args) returns(FormatPath_Result); @@ -268,6 +269,18 @@ message LoadPackage_Result { map pkg_scope_map = 10; // Map key is the package path. } +message ListOptions_Result { + repeated OptionHelp options = 2; // Returns the files in the order they should be compiled +} + +message OptionHelp { + string name = 1; + string type = 2; + bool required = 3; + string default_value = 4; + string help = 5; +} + message Symbol { KclType ty = 1; string name = 2; @@ -302,7 +315,7 @@ message ExecProgram_Args { repeated string k_filename_list = 2; repeated string k_code_list = 3; - + repeated CmdArgSpec args = 4; repeated CmdOverrideSpec overrides = 5; @@ -426,12 +439,13 @@ message GetSchemaTypeMapping_Result { } message ValidateCode_Args { - string data = 1; - string file = 2; - string code = 3; - string schema = 4; - string attribute_name = 5; - string format = 6; + string datafile = 1; + string data = 2; + string file = 3; + string code = 4; + string schema = 5; + string attribute_name = 6; + string format = 7; } message ValidateCode_Result { diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.8/reference/xlang-api/rest-api.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.8/reference/xlang-api/rest-api.md index 0723d390..cd062e98 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.8/reference/xlang-api/rest-api.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.8/reference/xlang-api/rest-api.md @@ -190,6 +190,7 @@ service KclvmService { rpc ParseFile(ParseFile_Args) returns(ParseFile_Result); rpc ParseProgram(ParseProgram_Args) returns(ParseProgram_Result); rpc LoadPackage(LoadPackage_Args) returns(LoadPackage_Result); + rpc ListOptions(ParseProgram_Args) returns(ListOptions_Result); rpc FormatCode(FormatCode_Args) returns(FormatCode_Result); rpc FormatPath(FormatPath_Args) returns(FormatPath_Result); @@ -268,6 +269,18 @@ message LoadPackage_Result { map pkg_scope_map = 10; // Map key is the package path. } +message ListOptions_Result { + repeated OptionHelp options = 2; // Returns the files in the order they should be compiled +} + +message OptionHelp { + string name = 1; + string type = 2; + bool required = 3; + string default_value = 4; + string help = 5; +} + message Symbol { KclType ty = 1; string name = 2; @@ -302,7 +315,7 @@ message ExecProgram_Args { repeated string k_filename_list = 2; repeated string k_code_list = 3; - + repeated CmdArgSpec args = 4; repeated CmdOverrideSpec overrides = 5; @@ -426,12 +439,13 @@ message GetSchemaTypeMapping_Result { } message ValidateCode_Args { - string data = 1; - string file = 2; - string code = 3; - string schema = 4; - string attribute_name = 5; - string format = 6; + string datafile = 1; + string data = 2; + string file = 3; + string code = 4; + string schema = 5; + string attribute_name = 6; + string format = 7; } message ValidateCode_Result { diff --git a/versioned_docs/version-0.8/reference/xlang-api/rest-api.md b/versioned_docs/version-0.8/reference/xlang-api/rest-api.md index 10be5a94..3f7ca652 100644 --- a/versioned_docs/version-0.8/reference/xlang-api/rest-api.md +++ b/versioned_docs/version-0.8/reference/xlang-api/rest-api.md @@ -178,6 +178,7 @@ service KclvmService { rpc ParseFile(ParseFile_Args) returns(ParseFile_Result); rpc ParseProgram(ParseProgram_Args) returns(ParseProgram_Result); rpc LoadPackage(LoadPackage_Args) returns(LoadPackage_Result); + rpc ListOptions(ParseProgram_Args) returns(ListOptions_Result); rpc FormatCode(FormatCode_Args) returns(FormatCode_Result); rpc FormatPath(FormatPath_Args) returns(FormatPath_Result); @@ -256,6 +257,18 @@ message LoadPackage_Result { map pkg_scope_map = 10; // Map key is the package path. } +message ListOptions_Result { + repeated OptionHelp options = 2; // Returns the files in the order they should be compiled +} + +message OptionHelp { + string name = 1; + string type = 2; + bool required = 3; + string default_value = 4; + string help = 5; +} + message Symbol { KclType ty = 1; string name = 2; @@ -290,7 +303,7 @@ message ExecProgram_Args { repeated string k_filename_list = 2; repeated string k_code_list = 3; - + repeated CmdArgSpec args = 4; repeated CmdOverrideSpec overrides = 5; @@ -414,12 +427,13 @@ message GetSchemaTypeMapping_Result { } message ValidateCode_Args { - string data = 1; - string file = 2; - string code = 3; - string schema = 4; - string attribute_name = 5; - string format = 6; + string datafile = 1; + string data = 2; + string file = 3; + string code = 4; + string schema = 5; + string attribute_name = 6; + string format = 7; } message ValidateCode_Result { diff --git a/versioned_docs/version-0.8/user_docs/guides/package-management/4-how-to/9-kpm_oci.md b/versioned_docs/version-0.8/user_docs/guides/package-management/4-how-to/9-kpm_oci.md index 583fe28b..5f8eb483 100644 --- a/versioned_docs/version-0.8/user_docs/guides/package-management/4-how-to/9-kpm_oci.md +++ b/versioned_docs/version-0.8/user_docs/guides/package-management/4-how-to/9-kpm_oci.md @@ -15,11 +15,11 @@ You can adjust the registry and repository name of the OCI registry by the follo You can adjust the configuration of OCI Registry by setting the three environment variables `KPM_REG`, `KPM_REGO`, and `OCI_REG_PLAIN_HTTP`. ```shell -# set the kpm default registry +# set default registry export KPM_REG="ghcr.io" -# set the kpm default repository +# set default repository export KPM_REPO="kcl-lang" -# set the kpm support for 'http' +# set support for 'http' export OCI_REG_PLAIN_HTTP=off ```