use super::Registry;
use crate::script::*;
pub(super) fn register(registry: &mut Registry) {
registry
.register_type_with_name::<ScriptGraphTraversalSource>("GraphTraversalSource")
.register_fn_as(
&["to_string", "to_debug"],
|traversal: &mut ScriptGraphTraversalSource| {
if traversal.anonymous {
crate::value::literal::TokenLiteral::token_literal(&*traversal)
} else {
"GraphTraversalSource".to_string()
}
},
)
.register_fn("with", ScriptGraphTraversalSource::with)
.register_fn("with", ScriptGraphTraversalSource::with_option_flag)
.register_fn("with", ScriptGraphTraversalSource::with_option_value)
.register_fn_as(
&["memory_usage", "memoryUsage"],
ScriptGraphTraversalSource::memory_usage,
)
.register_fn("statistics", ScriptGraphTraversalSource::statistics)
.register_fn("mark", ScriptGraphTraversalSource::mark)
.register_fn_as(&["to_list", "toList"], ScriptGraphTraversalSource::to_list)
.register_fn("next", ScriptGraphTraversalSource::next)
.register_fn("iterate", ScriptGraphTraversalSource::iterate)
.register_fn_as(
&["to_graph", "toGraph"],
ScriptGraphTraversalSource::to_graph,
)
.register_fn("profile", ScriptGraphTraversalSource::profile)
.register_fn("profile", ScriptGraphTraversalSource::profile_with)
.register_fn("profile_with", ScriptGraphTraversalSource::profile_with)
.register_fn("execute", ScriptGraphTraversalSource::execute)
.register_fn("execute", ScriptGraphTraversalSource::execute_dynamic)
.register_fn("visualize", ScriptGraphTraversalSource::visualize_default)
.register_fn("visualize", ScriptGraphTraversalSource::visualize)
.register_fn("visualize", ScriptGraphTraversalSource::visualize_dynamic)
.register_fn_as(
&["to_table", "toTable"],
ScriptGraphTraversalSource::to_table,
)
.register_fn_as(
&["to_table", "toTable"],
ScriptGraphTraversalSource::to_table_dynamic,
)
.register_fn_as(
&["to_markdown", "toMarkdown"],
ScriptGraphTraversalSource::to_markdown,
)
.register_fn_as(
&["to_markdown", "toMarkdown"],
ScriptGraphTraversalSource::to_markdown_dynamic,
)
.register_fn_as(
&["to_mermaid", "toMermaid"],
ScriptGraphTraversalSource::to_mermaid,
)
.register_fn_as(
&["to_mermaid", "toMermaid"],
ScriptGraphTraversalSource::to_mermaid_dynamic,
)
.register_fn_as(
&["to_plantuml", "toPlantuml", "toPlantUML"],
ScriptGraphTraversalSource::to_plantuml,
)
.register_fn_as(
&["to_plantuml", "toPlantuml", "toPlantUML"],
ScriptGraphTraversalSource::to_plantuml_dynamic,
)
.register_fn_as(
&["to_json_schema", "toJsonSchema"],
ScriptGraphTraversalSource::to_json_schema,
)
.register_fn_as(
&["to_json_schema", "toJsonSchema"],
ScriptGraphTraversalSource::to_json_schema_dynamic,
)
.register_fn_as(&["to_json", "toJson"], ScriptGraphTraversalSource::to_json)
.register_fn_as(
&["to_json", "toJson"],
ScriptGraphTraversalSource::to_json_dynamic,
)
.register_fn_as(&["to_tree", "toTree"], ScriptGraphTraversalSource::to_tree)
.register_fn_as(
&["to_tree", "toTree"],
ScriptGraphTraversalSource::to_tree_dynamic,
)
.register_fn_as(
&["get_schema", "getSchema"],
ScriptGraphTraversalSource::get_schema,
)
.register_fn_as(
&["set_schema", "setSchema"],
ScriptGraphTraversalSource::set_schema,
)
.register_fn_as(
&["set_schema", "setSchema"],
ScriptGraphTraversalSource::set_schema_with_mode,
)
.register_fn_as(
&["patch_schema", "patchSchema"],
ScriptGraphTraversalSource::patch_schema,
)
.register_fn_as(
&["validate_schema", "validateSchema"],
ScriptGraphTraversalSource::validate_schema,
)
.register_fn_as(
&["validate_schema", "validateSchema"],
ScriptGraphTraversalSource::validate_schema_with_mode,
)
.register_fn_as(
&["validate_schema_patch", "validateSchemaPatch"],
ScriptGraphTraversalSource::validate_schema_patch,
)
.register_fn_as(
&["infer_schema", "inferSchema"],
ScriptGraphTraversalSource::infer_schema,
)
.register_fn_as(
&["diff_schema", "diffSchema"],
ScriptGraphTraversalSource::diff_schema,
)
.register_fn_as(
&["set_visualizer", "setVisualizer"],
ScriptGraphTraversalSource::set_visualizer,
)
.register_fn_as(
&["define_query", "defineQuery"],
ScriptGraphTraversalSource::define_query,
)
.register_fn_as(
&["define_queries", "defineQueries"],
ScriptGraphTraversalSource::define_queries,
)
.register_fn_as(
&["define_queries", "defineQueries"],
ScriptGraphTraversalSource::define_queries_with,
)
.register_fn("query", ScriptGraphTraversalSource::query)
.register_fn("query", ScriptGraphTraversalSource::query_with)
.register_fn("queries", ScriptGraphTraversalSource::queries)
.register_fn("queries", ScriptGraphTraversalSource::queries_in)
.register_fn_as(
&["get_query", "getQuery"],
ScriptGraphTraversalSource::get_query,
)
.register_fn_as(
&["drop_query", "dropQuery"],
ScriptGraphTraversalSource::drop_query,
)
.register_fn_as(
&["move_query", "moveQuery"],
ScriptGraphTraversalSource::move_query,
)
.register_fn_as(
&["describe_query", "describeQuery"],
ScriptGraphTraversalSource::describe_query,
)
.register_fn_as(
&["define_compression", "defineCompression"],
ScriptGraphTraversalSource::define_compression,
)
.register_fn("compressions", ScriptGraphTraversalSource::compressions)
.register_fn_as(
&["drop_compression", "dropCompression"],
ScriptGraphTraversalSource::drop_compression,
)
.register_fn("recompress", ScriptGraphTraversalSource::recompress);
#[cfg(feature = "io")]
registry
.register_fn_as(
&["export_graphml", "exportGraphml"],
ScriptGraphTraversalSource::export_graphml,
)
.register_fn_as(
&["import_graphml", "importGraphml"],
ScriptGraphTraversalSource::import_graphml,
);
#[cfg(feature = "io")]
registry
.register_fn_as(
&["export_graphson", "exportGraphson"],
ScriptGraphTraversalSource::export_graphson,
)
.register_fn_as(
&["import_graphson", "importGraphson"],
ScriptGraphTraversalSource::import_graphson,
);
#[cfg(all(feature = "io", feature = "persist"))]
registry.register_fn_as(
&["export_snapshot", "exportSnapshot"],
ScriptGraphTraversalSource::export_snapshot,
);
}