Skip to content

Commit

Permalink
docs: sync ListOptions and Validate API definitions
Browse files Browse the repository at this point in the history
Signed-off-by: peefy <[email protected]>
  • Loading branch information
Peefy committed Mar 19, 2024
1 parent 588a9ac commit cac4933
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 31 deletions.
28 changes: 21 additions & 7 deletions docs/reference/xlang-api/rest-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -256,6 +257,18 @@ message LoadPackage_Result {
map<string, ScopeIndex> 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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -268,6 +269,18 @@ message LoadPackage_Result {
map<string, ScopeIndex> 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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -268,6 +269,18 @@ message LoadPackage_Result {
map<string, ScopeIndex> 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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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 {
Expand Down
28 changes: 21 additions & 7 deletions versioned_docs/version-0.8/reference/xlang-api/rest-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -256,6 +257,18 @@ message LoadPackage_Result {
map<string, ScopeIndex> 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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand Down

0 comments on commit cac4933

Please sign in to comment.