From 79bee8920265bae5e3f8abfa8ede2a671036127a Mon Sep 17 00:00:00 2001 From: Raphael Date: Thu, 14 Aug 2025 19:37:30 +0200 Subject: [PATCH 01/20] feat: added wip analyser for data types --- cli/src/analyser/mod.rs | 182 ++++++++++++++++++++++++++++++++++++++ cli/src/command/report.rs | 55 ++++++++++++ cli/src/main.rs | 1 + cli/src/table.rs | 23 ++--- 4 files changed, 243 insertions(+), 18 deletions(-) create mode 100644 cli/src/analyser/mod.rs diff --git a/cli/src/analyser/mod.rs b/cli/src/analyser/mod.rs new file mode 100644 index 0000000..87f6832 --- /dev/null +++ b/cli/src/analyser/mod.rs @@ -0,0 +1,182 @@ +use tucana::shared::{DataTypeIdentifier, DefinitionDataType, FlowType, RuntimeFunctionDefinition}; +use tucana::shared::data_type_identifier::Type; +use tucana::shared::definition_data_type_rule::Config; + +#[derive(Clone)] +pub struct AnalysableDataType { + pub definition_data_type: DefinitionDataType, + pub id: i16 +} + + +pub struct AnalysableFlowType { + pub flow_type: FlowType, + pub id: i16 +} + + +pub struct AnalysableFunction { + pub function: RuntimeFunctionDefinition, + pub id: i16 +} + +pub struct Analyser { + pub data_types: Vec, + pub flow_types: Vec, + pub functions: Vec +} + +impl Analyser { + + pub fn data_type_identifier_exists(&self, identifier: String, id: i16) -> bool { + + for data_types in &self.data_types { + if id == data_types.id { + continue + } + + if data_types.definition_data_type.identifier.to_lowercase() != identifier.to_lowercase() { + continue; + } + return true; + } + false + } + + pub fn handle_data_type(&self, analysable_data_type: AnalysableDataType, data_type_identifier: DataTypeIdentifier) -> Vec { + + let data_type = analysable_data_type.definition_data_type.clone(); + + let id = analysable_data_type.id; + let mut result = vec![]; + if let Some(r#type) = data_type_identifier.r#type { + match r#type { + Type::DataTypeIdentifier(identifier) => { + if !self.data_type_identifier_exists(identifier.clone(), id) { + println!("A Unknown DataType inside a rule was detected: {}", identifier) + } + } + Type::GenericType(generic) => { + if !self.data_type_identifier_exists(generic.data_type_identifier.clone(), id) { + println!("A Unknown DataType inside a rule was detected: {}", generic.data_type_identifier) + } + + for mapper in generic.generic_mappers { + if data_type.generic_keys.contains(&mapper.target) { + result.push(mapper.target.clone()) + } else { + println!("A GenericKey was used that did not exists in this DataType: {}", mapper.target) + } + + for source in mapper.source { + result.append(&mut self.handle_data_type(analysable_data_type.clone(), source)) + } + } + } + Type::GenericKey(key) => { + result.push(key.clone()) + } + } + } else { + println!("Type is undefined!") + } + + result + } + + pub fn analyse_data_type(&self, analysable_data_type: AnalysableDataType) { + let id = analysable_data_type.id; + let data_type = analysable_data_type.definition_data_type.clone(); + println!("Checking: {}", data_type.identifier.clone()); + // Check if Identifier is duplicate + if self.data_type_identifier_exists(data_type.identifier.clone(), id) { + println!("Duplicate definition of type {}", data_type.identifier) + } + + // The variant 0 never should occur + if data_type.variant == 0 { + println!("Type {} detected varriant 0", data_type.identifier) + } + + // Generic Keys are present. Search if they are referenced! + if !data_type.generic_keys.is_empty() { + let mut detected_generic_keys: Vec = vec![]; + if data_type.rules.is_empty() { + println!("Generic Keys are defined but never used!") + } + + for optional_rule in &data_type.rules { + if let Some(config) = optional_rule.clone().config { + match config { + Config::ContainsKey(rule) => { + if let Some(data_type_identifier) = rule.data_type_identifier { + detected_generic_keys.append(&mut self.handle_data_type(analysable_data_type.clone(), data_type_identifier)) + } else { + println!("DataTypeIdentifier is undefined!") + } + } + Config::ContainsType(rule) => { + if let Some(data_type_identifier) = rule.data_type_identifier { + detected_generic_keys.append(&mut self.handle_data_type(analysable_data_type.clone(), data_type_identifier)) + } else { + println!("DataTypeIdentifier is undefined!") + } + } + Config::ItemOfCollection(rule) => { + if rule.items.is_empty() { + println!("ItemOfCollection is defined but does not have any items!") + } + } + Config::NumberRange(_) => {} + Config::Regex(_) => {} + Config::InputTypes(rule) => { + if rule.input_types.is_empty() { + println!("InputTypes is defined but does not have any inputs!") + } + + for input_type in &rule.input_types { + if let Some(data_type_identifier) = &input_type.data_type_identifier { + detected_generic_keys.append(&mut self.handle_data_type(analysable_data_type.clone(), data_type_identifier.clone())) + } else { + println!("DataTypeIdentifier is undefined!") + } + } + } + Config::ReturnType(rule) => { + if let Some(data_type_identifier) = &rule.data_type_identifier { + detected_generic_keys.append(&mut self.handle_data_type(analysable_data_type.clone(), data_type_identifier.clone())) + } else { + println!("DataTypeIdentifier is undefined!") + } + } + Config::ParentType(rule) => { + if let Some(data_type_identifier) = &rule.parent_type { + detected_generic_keys.append(&mut self.handle_data_type(analysable_data_type.clone(), data_type_identifier.clone())) + } else { + println!("DataTypeIdentifier is undefined!") + } + } + } + } + } + + //TODO: Handle key not present/not exissting + for key in &detected_generic_keys { + println!("Detected key: {}", key); + } + } else { + // Check here for any empty configs! + for rule in &data_type.rules { + if rule.config.is_none() { + println!("found empty rule!") + } + } + } + + // Check if at least one Translation is present + if data_type.name.is_empty() { + println!("At least one translation should be defined") + } + + } +} diff --git a/cli/src/command/report.rs b/cli/src/command/report.rs index a16010b..24ad650 100644 --- a/cli/src/command/report.rs +++ b/cli/src/command/report.rs @@ -1,5 +1,6 @@ use crate::table::{error_table, summary_table}; use code0_definition_reader::parser::Parser; +use crate::analyser::{AnalysableDataType, AnalysableFlowType, AnalysableFunction, Analyser}; pub fn report_errors(path: Option) { let dir_path = path.unwrap_or_else(|| "./definitions".to_string()); @@ -10,6 +11,60 @@ pub fn report_errors(path: Option) { panic!("Error reading definitions"); } }; + + let mut index = 0; + let collected_data_types = parser + .features + .iter() + .map(|f| f.data_types.clone()) + .flatten() + .map(|d| { + index = index + 1; + return AnalysableDataType { + definition_data_type: d.clone(), + id: index + } + }) + .collect::>(); + + let collected_functions = parser + .features + .iter() + .map(|f| f.runtime_functions.clone()) + .flatten() + .map(|d| { + index = index + 1; + return AnalysableFunction { + function: d.clone(), + id: index + } + }) + .collect::>(); + + let collected_flow_types = parser + .features + .iter() + .map(|f| f.flow_types.clone()) + .flatten() + .map(|d| { + index = index + 1; + return AnalysableFlowType { + flow_type: d.clone(), + id: index + } + }) + .collect::>(); + + let analyser = Analyser { + data_types: collected_data_types.clone(), + functions: collected_functions, + flow_types: collected_flow_types, + }; + + for data_type in collected_data_types { + analyser.analyse_data_type(data_type); + } + error_table(&parser.features); summary_table(&parser.features); } diff --git a/cli/src/main.rs b/cli/src/main.rs index c9f8ea1..ae6ad74 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -2,6 +2,7 @@ use clap::{Parser as ClapParser, Subcommand}; mod command; mod table; +mod analyser; /// Top-level CLI for 'definition' #[derive(ClapParser)] diff --git a/cli/src/table.rs b/cli/src/table.rs index dd8d836..0852b51 100644 --- a/cli/src/table.rs +++ b/cli/src/table.rs @@ -281,18 +281,7 @@ pub fn error_table(features: &Vec) { pub fn summary_table(features: &[Feature]) { println!( "\n{}", - "╔══════════════════════════════════════════════════════════════════════════════╗" - .bright_cyan() - ); - println!( - "{} {} {}", - "║".bright_cyan(), - "CONCLUSION".bright_white().bold().on_blue(), - "║".bright_cyan() - ); - println!( - "{}", - "╚══════════════════════════════════════════════════════════════════════════════╝" + "╔═══════════════════════════════ CONCLUSION ═══════════════════════════════╗" .bright_cyan() ); @@ -302,9 +291,9 @@ pub fn summary_table(features: &[Feature]) { .map(|feature| { let is_successful = feature.errors.is_empty(); let status = if is_successful { - "✅ SUCCESS".to_string() + "SUCCESS".to_string() } else { - "❌ FAILED".to_string() + "FAILED".to_string() }; FeatureSummaryRow { @@ -329,13 +318,11 @@ pub fn summary_table(features: &[Feature]) { let total_features = features.len(); let successful_features = features.iter().filter(|f| f.errors.is_empty()).count(); - println!("\n{}", "OVERALL SUMMARY".bright_blue().bold()); - if total_errors == 0 { println!( "{}", format!( - "PROCESS SUCCESSFUL! All {total_features} feature(s) processed without errors.", + "[SUCCESSFUL]! All {total_features} feature(s) processed without errors.", ) .bright_green() .bold() @@ -344,7 +331,7 @@ pub fn summary_table(features: &[Feature]) { println!( "{}", format!( - "PROCESS FAILED! {total_errors} error(s) found across {total_features} feature(s)." + "[FAILED]! {total_errors} error(s) found across {total_features} feature(s)." ) .bright_red() .bold() From 35eb54dfbdf121861d31845956de14331ee1f435 Mon Sep 17 00:00:00 2001 From: Raphael Date: Sat, 16 Aug 2025 11:52:28 +0200 Subject: [PATCH 02/20] feat: added path to meta of one definition --- reader/rust/src/parser.rs | 3 ++- reader/rust/src/reader.rs | 35 ++++++++++++++++++++++++++++------- 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/reader/rust/src/parser.rs b/reader/rust/src/parser.rs index 8873243..29b1a79 100644 --- a/reader/rust/src/parser.rs +++ b/reader/rust/src/parser.rs @@ -60,7 +60,7 @@ impl Parser { Parser { features } } - fn extract_identifier(definition: &str, meta_type: MetaType) -> String { + pub fn extract_identifier(definition: &str, meta_type: MetaType) -> String { let field_name = match meta_type { MetaType::DataType | MetaType::FlowType => "identifier", MetaType::RuntimeFunction => "runtime_name", @@ -89,6 +89,7 @@ impl Parser { fn append_meta(feature: &mut Feature, meta: &crate::reader::Meta) { for definition in &meta.data { + let definition = definition.definition_string.as_str(); match meta.r#type { MetaType::DataType => { match serde_json::from_str::(definition) { diff --git a/reader/rust/src/reader.rs b/reader/rust/src/reader.rs index 5523d65..0b98faa 100644 --- a/reader/rust/src/reader.rs +++ b/reader/rust/src/reader.rs @@ -22,16 +22,21 @@ impl std::fmt::Display for MetaType { } } -#[derive(Debug)] pub struct Reader { pub meta: Vec, } -#[derive(Debug)] +#[derive(Clone)] +pub struct ParsableDefinition { + pub path: Option, + pub starting_line: i32, + pub definition_string: String, +} + pub struct Meta { pub name: String, pub r#type: MetaType, - pub data: Vec, + pub data: Vec, } impl Meta { @@ -39,11 +44,19 @@ impl Meta { where P: AsRef, { + + let mut current_line = 0; + let mut current_starting_line = 0; let mut inside_code = false; let mut current_block = vec![]; - let mut code_snippets = vec![]; + let mut code_snippets: Vec = vec![]; - let content = match fs::read_to_string(file_path) { + let path = match file_path.as_ref().to_str() { + Some(str) => Some(str.to_string()), + None => None, + }; + + let content = match fs::read_to_string(&file_path) { Ok(content) => content, Err(err) => { println!("Error reading file: {err}"); @@ -52,18 +65,26 @@ impl Meta { }; for line in content.lines() { + current_line += 1; if line.contains("```") { inside_code = !inside_code; if !inside_code { let code_snippet = current_block.join(" "); - code_snippets.push(code_snippet); + code_snippets.push( + ParsableDefinition { + path: path.clone(), + starting_line: current_starting_line, + definition_string: code_snippet, + } + ); current_block.clear(); } } if inside_code { if line.starts_with("```") { + current_starting_line = current_line; continue; } @@ -81,7 +102,7 @@ impl Meta { /// Reader /// -/// Expecting the file system too look like: +/// Expecting the file system to look like: /// - /// - /// - From e306352396f7bc5f8836e352b8334c3993b92701 Mon Sep 17 00:00:00 2001 From: Raphael Date: Sat, 16 Aug 2025 12:19:30 +0200 Subject: [PATCH 03/20] feat: (wip) compiler error and warnings --- cli/src/analyser/mod.rs | 151 +++++++++++++++++++++++++++++++------- cli/src/command/report.rs | 53 +------------ cli/src/formatter.rs | 76 +++++++++++++++++++ cli/src/main.rs | 1 + 4 files changed, 204 insertions(+), 77 deletions(-) create mode 100644 cli/src/formatter.rs diff --git a/cli/src/analyser/mod.rs b/cli/src/analyser/mod.rs index 87f6832..4cb53e1 100644 --- a/cli/src/analyser/mod.rs +++ b/cli/src/analyser/mod.rs @@ -1,21 +1,25 @@ +use std::path::Path; use tucana::shared::{DataTypeIdentifier, DefinitionDataType, FlowType, RuntimeFunctionDefinition}; use tucana::shared::data_type_identifier::Type; use tucana::shared::definition_data_type_rule::Config; +use code0_definition_reader::reader::{MetaType, ParsableDefinition, Reader}; +use crate::formatter::{error, warning}; #[derive(Clone)] pub struct AnalysableDataType { - pub definition_data_type: DefinitionDataType, + pub original_definition: ParsableDefinition, + pub definition_data_type: DefinitionDataType, pub id: i16 } - pub struct AnalysableFlowType { + pub original_definition: ParsableDefinition, pub flow_type: FlowType, pub id: i16 } - pub struct AnalysableFunction { + pub original_definition: ParsableDefinition, pub function: RuntimeFunctionDefinition, pub id: i16 } @@ -28,6 +32,85 @@ pub struct Analyser { impl Analyser { + pub fn new(path: &str) -> Analyser { + let reader = match Reader::from_path(path) { + Some(res) => res, + None => { + panic!("No definitions behind this path"); + } + }; + + let mut current_index = 0; + let mut collected_data_types: Vec = vec![]; + let mut collected_flow_types: Vec = vec![]; + let mut collected_functions: Vec = vec![]; + + for features in reader.meta { + match features.r#type { + MetaType::FlowType => { + for p_flow_type in &features.data { + current_index += 1; + match serde_json::from_str::(p_flow_type.definition_string.as_str()) { + Ok(flow_type) => collected_flow_types.push(AnalysableFlowType { + original_definition: p_flow_type.clone(), + flow_type, + id: current_index, + }), + Err(err) => { + if let Some(str_path) = &p_flow_type.path { + let path = Path::new(str_path); + error(err.to_string(), format!("{:?}:{}:{}", path.display(), p_flow_type.starting_line, 1)); + } + }, + } + } + }, + MetaType::DataType => { + for p_data_type in &features.data { + current_index += 1; + match serde_json::from_str::(p_data_type.definition_string.as_str()) { + Ok(data_type) => collected_data_types.push(AnalysableDataType { + original_definition: p_data_type.clone(), + definition_data_type: data_type, + id: current_index, + }), + Err(err) => { + if let Some(str_path) = &p_data_type.path { + let path = Path::new(str_path); + error(err.to_string(), format!("{}:{}:{}", path.display(), p_data_type.starting_line, 1)); + } + }, + } + } + } + MetaType::RuntimeFunction => { + for p_function in &features.data { + current_index += 1; + match serde_json::from_str::(p_function.definition_string.as_str()) { + Ok(function) => collected_functions.push(AnalysableFunction { + original_definition: p_function.clone(), + function, + id: current_index, + }), + Err(err) => { + if let Some(str_path) = &p_function.path { + let path = Path::new(str_path); + error(err.to_string(), format!("{:?}:{}:{}", path.display(), p_function.starting_line, 1)); + } + }, + } + } + } + } + } + + Self { + data_types: collected_data_types, + functions: collected_functions, + flow_types: collected_flow_types, + } + } + pub fn data_type_identifier_exists(&self, identifier: String, id: i16) -> bool { for data_types in &self.data_types { @@ -43,29 +126,33 @@ impl Analyser { false } + /// Checks (recursively) if the defined DataTypes are correct pub fn handle_data_type(&self, analysable_data_type: AnalysableDataType, data_type_identifier: DataTypeIdentifier) -> Vec { - let data_type = analysable_data_type.definition_data_type.clone(); - + let path = format!( + "{:?}:{}:{}", + Path::new(&analysable_data_type.clone().original_definition.path.unwrap_or_default()).display(), + analysable_data_type.original_definition.starting_line, + 1 + ); let id = analysable_data_type.id; let mut result = vec![]; + if let Some(r#type) = data_type_identifier.r#type { match r#type { Type::DataTypeIdentifier(identifier) => { if !self.data_type_identifier_exists(identifier.clone(), id) { - println!("A Unknown DataType inside a rule was detected: {}", identifier) + error(format!("`{}` uses a undefined data_type: `{}`!", analysable_data_type.definition_data_type.identifier, identifier), path); } } Type::GenericType(generic) => { if !self.data_type_identifier_exists(generic.data_type_identifier.clone(), id) { - println!("A Unknown DataType inside a rule was detected: {}", generic.data_type_identifier) + error(format!("`{}` uses a undefined data_type: `{}`!", analysable_data_type.definition_data_type.identifier, generic.data_type_identifier), path); } for mapper in generic.generic_mappers { if data_type.generic_keys.contains(&mapper.target) { result.push(mapper.target.clone()) - } else { - println!("A GenericKey was used that did not exists in this DataType: {}", mapper.target) } for source in mapper.source { @@ -78,7 +165,7 @@ impl Analyser { } } } else { - println!("Type is undefined!") + error(format!("`{}` has a data_type that's null!", analysable_data_type.definition_data_type.identifier), path); } result @@ -87,22 +174,27 @@ impl Analyser { pub fn analyse_data_type(&self, analysable_data_type: AnalysableDataType) { let id = analysable_data_type.id; let data_type = analysable_data_type.definition_data_type.clone(); - println!("Checking: {}", data_type.identifier.clone()); + let path = format!( + "{:?}:{}:{}", + Path::new(&analysable_data_type.clone().original_definition.path.unwrap_or_default()).display(), + analysable_data_type.original_definition.starting_line, + 1 + ); // Check if Identifier is duplicate if self.data_type_identifier_exists(data_type.identifier.clone(), id) { - println!("Duplicate definition of type {}", data_type.identifier) + error(format!("The data_type `{}` is already defined!", data_type.identifier), path.clone()); } // The variant 0 never should occur if data_type.variant == 0 { - println!("Type {} detected varriant 0", data_type.identifier) + error(format!("The variant of `{}` is 0 and thus incorrect!", data_type.identifier), path.clone()); } // Generic Keys are present. Search if they are referenced! if !data_type.generic_keys.is_empty() { let mut detected_generic_keys: Vec = vec![]; if data_type.rules.is_empty() { - println!("Generic Keys are defined but never used!") + error(format!("`{}` defined generic_keys but never uses one!", data_type.identifier), path.clone()); } for optional_rule in &data_type.rules { @@ -112,33 +204,33 @@ impl Analyser { if let Some(data_type_identifier) = rule.data_type_identifier { detected_generic_keys.append(&mut self.handle_data_type(analysable_data_type.clone(), data_type_identifier)) } else { - println!("DataTypeIdentifier is undefined!") + error(format!("`{}` uses a definition_data_type_contains_key_rule that is null!", data_type.identifier), path.clone()); } } Config::ContainsType(rule) => { if let Some(data_type_identifier) = rule.data_type_identifier { detected_generic_keys.append(&mut self.handle_data_type(analysable_data_type.clone(), data_type_identifier)) } else { - println!("DataTypeIdentifier is undefined!") + error(format!("`{}` uses a definition_data_type_contains_type_rule that is null!", data_type.identifier), path.clone()); } } Config::ItemOfCollection(rule) => { if rule.items.is_empty() { - println!("ItemOfCollection is defined but does not have any items!") + error(format!("`{}` uses a definition_data_type_item_of_collection_rule without any defined items!", data_type.identifier), path.clone()); } } Config::NumberRange(_) => {} Config::Regex(_) => {} Config::InputTypes(rule) => { if rule.input_types.is_empty() { - println!("InputTypes is defined but does not have any inputs!") + error(format!("`{}` uses a definition_data_type_input_types_rule without any defined inputs!", data_type.identifier), path.clone()); } for input_type in &rule.input_types { if let Some(data_type_identifier) = &input_type.data_type_identifier { detected_generic_keys.append(&mut self.handle_data_type(analysable_data_type.clone(), data_type_identifier.clone())) } else { - println!("DataTypeIdentifier is undefined!") + error(format!("`{}` uses a definition_data_type_input_types_rule that has a undefined data_type!", data_type.identifier), path.clone()); } } } @@ -146,37 +238,42 @@ impl Analyser { if let Some(data_type_identifier) = &rule.data_type_identifier { detected_generic_keys.append(&mut self.handle_data_type(analysable_data_type.clone(), data_type_identifier.clone())) } else { - println!("DataTypeIdentifier is undefined!") + error(format!("`{}` uses a definition_data_type_return_type_rule that is null!", data_type.identifier), path.clone()); } } Config::ParentType(rule) => { if let Some(data_type_identifier) = &rule.parent_type { detected_generic_keys.append(&mut self.handle_data_type(analysable_data_type.clone(), data_type_identifier.clone())) } else { - println!("DataTypeIdentifier is undefined!") + error(format!("`{}` uses a definition_data_type_parent_type_rule that is null!", data_type.identifier), path.clone()); } } } } } - //TODO: Handle key not present/not exissting - for key in &detected_generic_keys { - println!("Detected key: {}", key); + let defined_but_unused = data_type.generic_keys.iter().filter(|key| !detected_generic_keys.contains(key)).collect::>(); + let used_but_undefined = detected_generic_keys.iter().filter(|key| !data_type.generic_keys.contains(key)).collect::>(); + + for key in defined_but_unused { + error(format!("`{}` uses a generic_key (`{}`) that's never used!", analysable_data_type.definition_data_type.identifier, key), path.clone()); + } + + for key in used_but_undefined { + error(format!("`{}` uses a generic_key (`{}`) that's not defined!", analysable_data_type.definition_data_type.identifier, key), path.clone()); } } else { // Check here for any empty configs! for rule in &data_type.rules { if rule.config.is_none() { - println!("found empty rule!") + error(format!("`{}` uses a rule that is null!", analysable_data_type.definition_data_type.identifier), path.clone()); } } } // Check if at least one Translation is present if data_type.name.is_empty() { - println!("At least one translation should be defined") + warning(format!("`{}` has no name defined!", analysable_data_type.definition_data_type.identifier), path.clone()); } - } } diff --git a/cli/src/command/report.rs b/cli/src/command/report.rs index 24ad650..a9266f5 100644 --- a/cli/src/command/report.rs +++ b/cli/src/command/report.rs @@ -12,57 +12,10 @@ pub fn report_errors(path: Option) { } }; - let mut index = 0; - let collected_data_types = parser - .features - .iter() - .map(|f| f.data_types.clone()) - .flatten() - .map(|d| { - index = index + 1; - return AnalysableDataType { - definition_data_type: d.clone(), - id: index - } - }) - .collect::>(); + let analyser = Analyser::new(dir_path.as_str()); - let collected_functions = parser - .features - .iter() - .map(|f| f.runtime_functions.clone()) - .flatten() - .map(|d| { - index = index + 1; - return AnalysableFunction { - function: d.clone(), - id: index - } - }) - .collect::>(); - - let collected_flow_types = parser - .features - .iter() - .map(|f| f.flow_types.clone()) - .flatten() - .map(|d| { - index = index + 1; - return AnalysableFlowType { - flow_type: d.clone(), - id: index - } - }) - .collect::>(); - - let analyser = Analyser { - data_types: collected_data_types.clone(), - functions: collected_functions, - flow_types: collected_flow_types, - }; - - for data_type in collected_data_types { - analyser.analyse_data_type(data_type); + for data_type in &analyser.data_types { + analyser.analyse_data_type(data_type.clone()); } error_table(&parser.features); diff --git a/cli/src/formatter.rs b/cli/src/formatter.rs new file mode 100644 index 0000000..e66f1b0 --- /dev/null +++ b/cli/src/formatter.rs @@ -0,0 +1,76 @@ +use colored::Colorize; +use tabled::settings::Style; +use tabled::{Table, Tabled}; + +pub fn default(string: String) { + println!("{}", string); +} + +pub fn default_table(iter: I) +where + I: IntoIterator, + T: Tabled, +{ + println!("{}", print_table(iter)); +} + +pub fn success(string: String) { + println!("\n{}: {}", "success".green(), string); +} + +pub fn success_highlight(highlight: String,string: String) { + println!("{} {}", highlight.green(), string); +} + +pub fn success_table(iter: I) + where + I: IntoIterator, + T: Tabled, +{ + println!("{}", print_table(iter).green()); +} + +pub fn error(string: String, path: String) { + println!("\n{}: {} {}", "error".red(), string, print_path(path)); +} + +pub fn error_highlight(highlight: String,string: String) { + println!("{} {}", highlight.red(), string); +} + +pub fn error_table(iter: I) +where + I: IntoIterator, + T: Tabled, +{ + println!("{}", print_table(iter).red()); +} + +pub fn warning(string: String, path: String) { + println!("\n{}: {} {}", "warning".yellow(), string, print_path(path)); +} + +pub fn warning_highlight(highlight: String,string: String) { + println!("{} {}", highlight.yellow(), string); +} + + +pub fn warning_table(iter: I) +where + I: IntoIterator, + T: Tabled, +{ + println!("{}", print_table(iter).yellow()); +} + +fn print_table(iter: I) -> String +where + I: IntoIterator, + T: Tabled, +{ + Table::new(iter).with(Style::rounded()).to_string() +} + +fn print_path(path: String) -> String { + format!("\n --> {}", path.underline()).blue().to_string() +} \ No newline at end of file diff --git a/cli/src/main.rs b/cli/src/main.rs index ae6ad74..7df8b7b 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -3,6 +3,7 @@ use clap::{Parser as ClapParser, Subcommand}; mod command; mod table; mod analyser; +mod formatter; /// Top-level CLI for 'definition' #[derive(ClapParser)] From a24fe90fa5299f05140f2c801962ad359d16b7fd Mon Sep 17 00:00:00 2001 From: Raphael Date: Sat, 16 Aug 2025 14:25:09 +0200 Subject: [PATCH 04/20] feat: added typed errors --- cli/src/analyser/diagnostics.rs | 151 ++++++++++++++++++++++++++++++++ cli/src/analyser/mod.rs | 150 +++++++++++++++++++++---------- cli/src/command/report.rs | 10 ++- cli/src/formatter.rs | 12 +-- 4 files changed, 266 insertions(+), 57 deletions(-) create mode 100644 cli/src/analyser/diagnostics.rs diff --git a/cli/src/analyser/diagnostics.rs b/cli/src/analyser/diagnostics.rs new file mode 100644 index 0000000..d42aeaa --- /dev/null +++ b/cli/src/analyser/diagnostics.rs @@ -0,0 +1,151 @@ +use std::cmp::PartialEq; +use std::path::Path; +use std::process::exit; +use code0_definition_reader::reader::ParsableDefinition; +use crate::formatter::{error, warning}; + +#[derive(Default)] +pub struct Reporter { + diagnose: Vec +} + +impl PartialEq for Severity { + fn eq(&self, other: &Self) -> bool { + match self { + Severity::Error => { + if let Severity::Error = other { + return true; + } + false + } + Severity::Warning => { + if let Severity::Warning = other { + return true; + } + false + } + Severity::Debug => { + if let Severity::Debug = other { + return true; + } + false + } + } + } +} + +impl Reporter { + + pub fn add_report(&mut self, diagnose: Diagnose) { + self.diagnose.push(diagnose); + } + + pub fn run_report(&self) { + + for error in &self.get_errors() { + println!("{}", error.print()); + } + + for warning in &self.get_warnings() { + println!("{}", warning.print()); + } + + if !self.get_errors().is_empty() { + exit(1) + } + + } + + pub fn get_errors(&self) -> Vec<&Diagnose> { + self.diagnose.iter().filter(|p| p.kind.severity() == Severity::Error).collect() + } + + pub fn get_warnings(&self) -> Vec<&Diagnose> { + self.diagnose.iter().filter(|p| p.kind.severity() == Severity::Warning).collect() + } + + pub fn get_debug(&self) -> Vec<&Diagnose> { + self.diagnose.iter().filter(|p| p.kind.severity() == Severity::Debug).collect() + } + +} + +pub enum Severity { + Error, + Warning, + Debug +} + +pub struct Diagnose { + kind: DiagnosticKind, + definition_name: String, + definition: ParsableDefinition, +} + +pub enum DiagnosticKind { + DeserializationError { description: String }, + DuplicateDataTypeIdentifier { identifier: String }, + UndefinedDataTypeIdentifier { identifier: String }, + NullField { field_name: String }, + ForbiddenVariant, + UnusedGenericKey { key: String }, + UndefinedGenericKey { key: String }, + UndefinedTranslation { translation_field: String }, +} + +impl DiagnosticKind { + pub fn severity(&self) -> Severity { + use DiagnosticKind::*; + match self { + DeserializationError { .. } + | DuplicateDataTypeIdentifier { .. } + | UndefinedDataTypeIdentifier { .. } + | NullField { .. } + | ForbiddenVariant { .. } + | UnusedGenericKey { .. } + | UndefinedGenericKey { .. } => Severity::Error, + UndefinedTranslation { .. } => Severity::Warning, + } + } +} + +impl Diagnose { + + pub fn new(definition_name: String, definition: ParsableDefinition, kind: DiagnosticKind) -> Self { + Self { + definition_name, + definition, + kind, + } + } + + pub fn print(&self) -> String { + + let path = format!( + "{}:{}:{}", + Path::new(&self.definition.path.clone().unwrap_or_default()).display(), + &self.definition.starting_line, + 1 + ); + + use DiagnosticKind::*; + match &self.kind { + DeserializationError { description } => + error(format!("A JSON paring error occurred: `{}`", description), &path), + DuplicateDataTypeIdentifier { identifier } => + error(format!("The data_type `{}` is already defined resulting in a duplicate!", identifier), &path), + UndefinedDataTypeIdentifier { identifier } => + error(format!("`{}` uses an undefined data_type_identifier: `{}`!", self.definition_name, identifier), &path), + NullField { field_name } => + error ( format!("`{}` has a field (`{}`) that is null!", self.definition_name, field_name), &path), + ForbiddenVariant => + error(format!("The data_type variant of `{}` is 0 and thus incorrect!", self.definition_name), &path), + UnusedGenericKey { key } => + error(format!("`{}` defined a generic_key (`{}`) that is never used!", self.definition_name, key), &path), + UndefinedGenericKey { key } => + error(format!("`{}` uses a generic_key (`{}`) that's not defined!", self.definition_name, key), &path), + UndefinedTranslation { translation_field } => + warning(format!("`{}` has an empty field (`{}`) of translations!", self.definition_name, translation_field), &path), + } + } +} diff --git a/cli/src/analyser/mod.rs b/cli/src/analyser/mod.rs index 4cb53e1..9967465 100644 --- a/cli/src/analyser/mod.rs +++ b/cli/src/analyser/mod.rs @@ -1,9 +1,12 @@ -use std::path::Path; +mod diagnostics; + use tucana::shared::{DataTypeIdentifier, DefinitionDataType, FlowType, RuntimeFunctionDefinition}; use tucana::shared::data_type_identifier::Type; use tucana::shared::definition_data_type_rule::Config; +use code0_definition_reader::parser::Parser; use code0_definition_reader::reader::{MetaType, ParsableDefinition, Reader}; -use crate::formatter::{error, warning}; +use crate::analyser::diagnostics::{Diagnose, DiagnosticKind, Reporter}; +use crate::analyser::diagnostics::DiagnosticKind::{DuplicateDataTypeIdentifier, NullField, UndefinedDataTypeIdentifier, UndefinedGenericKey, UndefinedTranslation, UnusedGenericKey}; #[derive(Clone)] pub struct AnalysableDataType { @@ -25,6 +28,7 @@ pub struct AnalysableFunction { } pub struct Analyser { + reporter: Reporter, pub data_types: Vec, pub flow_types: Vec, pub functions: Vec @@ -33,6 +37,7 @@ pub struct Analyser { impl Analyser { pub fn new(path: &str) -> Analyser { + let mut reporter = Reporter::default(); let reader = match Reader::from_path(path) { Some(res) => res, None => { @@ -57,10 +62,9 @@ impl Analyser { id: current_index, }), Err(err) => { - if let Some(str_path) = &p_flow_type.path { - let path = Path::new(str_path); - error(err.to_string(), format!("{:?}:{}:{}", path.display(), p_flow_type.starting_line, 1)); - } + let name = Parser::extract_identifier(p_flow_type.definition_string.as_str(), MetaType::FlowType); + let diagnose = Diagnose::new(name, p_flow_type.clone(), DiagnosticKind::DeserializationError {description: err.to_string()}); + reporter.add_report(diagnose); }, } } @@ -75,10 +79,9 @@ impl Analyser { id: current_index, }), Err(err) => { - if let Some(str_path) = &p_data_type.path { - let path = Path::new(str_path); - error(err.to_string(), format!("{}:{}:{}", path.display(), p_data_type.starting_line, 1)); - } + let name = Parser::extract_identifier(p_data_type.definition_string.as_str(), MetaType::DataType); + let diagnose = Diagnose::new(name, p_data_type.clone(), DiagnosticKind::DeserializationError {description: err.to_string()}); + reporter.add_report(diagnose); }, } } @@ -93,10 +96,9 @@ impl Analyser { id: current_index, }), Err(err) => { - if let Some(str_path) = &p_function.path { - let path = Path::new(str_path); - error(err.to_string(), format!("{:?}:{}:{}", path.display(), p_function.starting_line, 1)); - } + let name = Parser::extract_identifier(p_function.definition_string.as_str(), MetaType::RuntimeFunction); + let diagnose = Diagnose::new(name, p_function.clone(), DiagnosticKind::DeserializationError {description: err.to_string()}); + reporter.add_report(diagnose); }, } } @@ -105,6 +107,7 @@ impl Analyser { } Self { + reporter, data_types: collected_data_types, functions: collected_functions, flow_types: collected_flow_types, @@ -127,14 +130,8 @@ impl Analyser { } /// Checks (recursively) if the defined DataTypes are correct - pub fn handle_data_type(&self, analysable_data_type: AnalysableDataType, data_type_identifier: DataTypeIdentifier) -> Vec { + pub fn handle_data_type(&mut self, analysable_data_type: AnalysableDataType, data_type_identifier: DataTypeIdentifier) -> Vec { let data_type = analysable_data_type.definition_data_type.clone(); - let path = format!( - "{:?}:{}:{}", - Path::new(&analysable_data_type.clone().original_definition.path.unwrap_or_default()).display(), - analysable_data_type.original_definition.starting_line, - 1 - ); let id = analysable_data_type.id; let mut result = vec![]; @@ -142,12 +139,20 @@ impl Analyser { match r#type { Type::DataTypeIdentifier(identifier) => { if !self.data_type_identifier_exists(identifier.clone(), id) { - error(format!("`{}` uses a undefined data_type: `{}`!", analysable_data_type.definition_data_type.identifier, identifier), path); + self.reporter.add_report(Diagnose::new( + analysable_data_type.definition_data_type.identifier, + analysable_data_type.original_definition, + UndefinedDataTypeIdentifier { identifier } + )); } } Type::GenericType(generic) => { if !self.data_type_identifier_exists(generic.data_type_identifier.clone(), id) { - error(format!("`{}` uses a undefined data_type: `{}`!", analysable_data_type.definition_data_type.identifier, generic.data_type_identifier), path); + self.reporter.add_report(Diagnose::new( + analysable_data_type.definition_data_type.clone().identifier, + analysable_data_type.original_definition.clone(), + UndefinedDataTypeIdentifier {identifier: generic.data_type_identifier} + )); } for mapper in generic.generic_mappers { @@ -165,37 +170,40 @@ impl Analyser { } } } else { - error(format!("`{}` has a data_type that's null!", analysable_data_type.definition_data_type.identifier), path); + self.reporter.add_report(Diagnose::new( + analysable_data_type.definition_data_type.clone().identifier, + analysable_data_type.original_definition.clone(), + NullField { field_name: String::from("data_type") } + )); } result } - pub fn analyse_data_type(&self, analysable_data_type: AnalysableDataType) { + pub fn analyse_data_type(&mut self, analysable_data_type: AnalysableDataType) { let id = analysable_data_type.id; let data_type = analysable_data_type.definition_data_type.clone(); - let path = format!( - "{:?}:{}:{}", - Path::new(&analysable_data_type.clone().original_definition.path.unwrap_or_default()).display(), - analysable_data_type.original_definition.starting_line, - 1 - ); // Check if Identifier is duplicate if self.data_type_identifier_exists(data_type.identifier.clone(), id) { - error(format!("The data_type `{}` is already defined!", data_type.identifier), path.clone()); + self.reporter.add_report(Diagnose::new( + analysable_data_type.definition_data_type.clone().identifier, + analysable_data_type.original_definition.clone(), + DuplicateDataTypeIdentifier { identifier: data_type.identifier.clone() } + )); } // The variant 0 never should occur if data_type.variant == 0 { - error(format!("The variant of `{}` is 0 and thus incorrect!", data_type.identifier), path.clone()); + self.reporter.add_report(Diagnose::new( + analysable_data_type.definition_data_type.clone().identifier, + analysable_data_type.original_definition.clone(), + DiagnosticKind::ForbiddenVariant + )); } // Generic Keys are present. Search if they are referenced! if !data_type.generic_keys.is_empty() { let mut detected_generic_keys: Vec = vec![]; - if data_type.rules.is_empty() { - error(format!("`{}` defined generic_keys but never uses one!", data_type.identifier), path.clone()); - } for optional_rule in &data_type.rules { if let Some(config) = optional_rule.clone().config { @@ -204,33 +212,53 @@ impl Analyser { if let Some(data_type_identifier) = rule.data_type_identifier { detected_generic_keys.append(&mut self.handle_data_type(analysable_data_type.clone(), data_type_identifier)) } else { - error(format!("`{}` uses a definition_data_type_contains_key_rule that is null!", data_type.identifier), path.clone()); + self.reporter.add_report(Diagnose::new( + analysable_data_type.definition_data_type.clone().identifier, + analysable_data_type.original_definition.clone(), + NullField { field_name: String::from("definition_data_type_contains_key_rule") } + )); } } Config::ContainsType(rule) => { if let Some(data_type_identifier) = rule.data_type_identifier { detected_generic_keys.append(&mut self.handle_data_type(analysable_data_type.clone(), data_type_identifier)) } else { - error(format!("`{}` uses a definition_data_type_contains_type_rule that is null!", data_type.identifier), path.clone()); + self.reporter.add_report(Diagnose::new( + analysable_data_type.definition_data_type.clone().identifier, + analysable_data_type.original_definition.clone(), + NullField { field_name: String::from("definition_data_type_contains_type_rule") } + )); } } Config::ItemOfCollection(rule) => { if rule.items.is_empty() { - error(format!("`{}` uses a definition_data_type_item_of_collection_rule without any defined items!", data_type.identifier), path.clone()); + self.reporter.add_report(Diagnose::new( + analysable_data_type.definition_data_type.clone().identifier, + analysable_data_type.original_definition.clone(), + NullField { field_name: String::from("definition_data_type_item_of_collection_rule") } + )); } } Config::NumberRange(_) => {} Config::Regex(_) => {} Config::InputTypes(rule) => { if rule.input_types.is_empty() { - error(format!("`{}` uses a definition_data_type_input_types_rule without any defined inputs!", data_type.identifier), path.clone()); + self.reporter.add_report(Diagnose::new( + analysable_data_type.definition_data_type.clone().identifier, + analysable_data_type.original_definition.clone(), + NullField { field_name: String::from("definition_data_type_input_types_rule") } + )); } for input_type in &rule.input_types { if let Some(data_type_identifier) = &input_type.data_type_identifier { detected_generic_keys.append(&mut self.handle_data_type(analysable_data_type.clone(), data_type_identifier.clone())) } else { - error(format!("`{}` uses a definition_data_type_input_types_rule that has a undefined data_type!", data_type.identifier), path.clone()); + self.reporter.add_report(Diagnose::new( + analysable_data_type.definition_data_type.clone().identifier, + analysable_data_type.original_definition.clone(), + UndefinedDataTypeIdentifier { identifier: data_type.identifier.clone() } + )); } } } @@ -238,14 +266,22 @@ impl Analyser { if let Some(data_type_identifier) = &rule.data_type_identifier { detected_generic_keys.append(&mut self.handle_data_type(analysable_data_type.clone(), data_type_identifier.clone())) } else { - error(format!("`{}` uses a definition_data_type_return_type_rule that is null!", data_type.identifier), path.clone()); + self.reporter.add_report(Diagnose::new( + analysable_data_type.definition_data_type.clone().identifier, + analysable_data_type.original_definition.clone(), + NullField { field_name: String::from("definition_data_type_return_type_rule") } + )); } } Config::ParentType(rule) => { if let Some(data_type_identifier) = &rule.parent_type { detected_generic_keys.append(&mut self.handle_data_type(analysable_data_type.clone(), data_type_identifier.clone())) } else { - error(format!("`{}` uses a definition_data_type_parent_type_rule that is null!", data_type.identifier), path.clone()); + self.reporter.add_report(Diagnose::new( + analysable_data_type.definition_data_type.clone().identifier, + analysable_data_type.original_definition.clone(), + NullField { field_name: String::from("definition_data_type_parent_type_rule") } + )); } } } @@ -256,24 +292,44 @@ impl Analyser { let used_but_undefined = detected_generic_keys.iter().filter(|key| !data_type.generic_keys.contains(key)).collect::>(); for key in defined_but_unused { - error(format!("`{}` uses a generic_key (`{}`) that's never used!", analysable_data_type.definition_data_type.identifier, key), path.clone()); + self.reporter.add_report(Diagnose::new( + analysable_data_type.definition_data_type.clone().identifier, + analysable_data_type.original_definition.clone(), + UnusedGenericKey { key: key.clone() } + )); } for key in used_but_undefined { - error(format!("`{}` uses a generic_key (`{}`) that's not defined!", analysable_data_type.definition_data_type.identifier, key), path.clone()); + self.reporter.add_report(Diagnose::new( + analysable_data_type.definition_data_type.clone().identifier, + analysable_data_type.original_definition.clone(), + UndefinedGenericKey { key: key.clone() } + )); } } else { // Check here for any empty configs! for rule in &data_type.rules { if rule.config.is_none() { - error(format!("`{}` uses a rule that is null!", analysable_data_type.definition_data_type.identifier), path.clone()); + self.reporter.add_report(Diagnose::new( + analysable_data_type.definition_data_type.clone().identifier, + analysable_data_type.original_definition.clone(), + NullField { field_name: String::from("rule") } + )); } } } // Check if at least one Translation is present if data_type.name.is_empty() { - warning(format!("`{}` has no name defined!", analysable_data_type.definition_data_type.identifier), path.clone()); + self.reporter.add_report(Diagnose::new( + analysable_data_type.definition_data_type.clone().identifier, + analysable_data_type.original_definition.clone(), + UndefinedTranslation { translation_field: String::from("name") } + )); } } + + pub fn report(&self) { + self.reporter.run_report() + } } diff --git a/cli/src/command/report.rs b/cli/src/command/report.rs index a9266f5..667c38f 100644 --- a/cli/src/command/report.rs +++ b/cli/src/command/report.rs @@ -1,6 +1,6 @@ use crate::table::{error_table, summary_table}; use code0_definition_reader::parser::Parser; -use crate::analyser::{AnalysableDataType, AnalysableFlowType, AnalysableFunction, Analyser}; +use crate::analyser::{Analyser}; pub fn report_errors(path: Option) { let dir_path = path.unwrap_or_else(|| "./definitions".to_string()); @@ -12,12 +12,14 @@ pub fn report_errors(path: Option) { } }; - let analyser = Analyser::new(dir_path.as_str()); + let mut analyser = Analyser::new(dir_path.as_str()); - for data_type in &analyser.data_types { - analyser.analyse_data_type(data_type.clone()); + for data_type in analyser.data_types.clone() { + analyser.analyse_data_type(data_type.clone()); } + analyser.report(); + error_table(&parser.features); summary_table(&parser.features); } diff --git a/cli/src/formatter.rs b/cli/src/formatter.rs index e66f1b0..474d2df 100644 --- a/cli/src/formatter.rs +++ b/cli/src/formatter.rs @@ -30,8 +30,8 @@ pub fn success_table(iter: I) println!("{}", print_table(iter).green()); } -pub fn error(string: String, path: String) { - println!("\n{}: {} {}", "error".red(), string, print_path(path)); +pub fn error(string: String, path: &String) -> String { + format!("\n{}: {} {}", "error".red(), string, print_path(path)) } pub fn error_highlight(highlight: String,string: String) { @@ -46,8 +46,8 @@ where println!("{}", print_table(iter).red()); } -pub fn warning(string: String, path: String) { - println!("\n{}: {} {}", "warning".yellow(), string, print_path(path)); +pub fn warning(string: String, path: &String) -> String { + format!("\n{}: {} {}", "warning".yellow(), string, print_path(&path)) } pub fn warning_highlight(highlight: String,string: String) { @@ -71,6 +71,6 @@ where Table::new(iter).with(Style::rounded()).to_string() } -fn print_path(path: String) -> String { - format!("\n --> {}", path.underline()).blue().to_string() +fn print_path(path: &String) -> String { + format!("\n --> {}", &path.underline()).blue().to_string() } \ No newline at end of file From c02d688183c3b99bc4809159d68c14d69a2e6e25 Mon Sep 17 00:00:00 2001 From: Raphael Date: Sat, 16 Aug 2025 14:38:22 +0200 Subject: [PATCH 05/20] feat: added diagnostics for flow type --- cli/src/analyser/diagnostics.rs | 4 ++ cli/src/analyser/mod.rs | 73 ++++++++++++++++++++++++++++++++- cli/src/command/report.rs | 4 ++ 3 files changed, 80 insertions(+), 1 deletion(-) diff --git a/cli/src/analyser/diagnostics.rs b/cli/src/analyser/diagnostics.rs index d42aeaa..8e3efa3 100644 --- a/cli/src/analyser/diagnostics.rs +++ b/cli/src/analyser/diagnostics.rs @@ -85,6 +85,7 @@ pub struct Diagnose { pub enum DiagnosticKind { DeserializationError { description: String }, DuplicateDataTypeIdentifier { identifier: String }, + DuplicateFlowTypeIdentifier { identifier: String }, UndefinedDataTypeIdentifier { identifier: String }, NullField { field_name: String }, ForbiddenVariant, @@ -99,6 +100,7 @@ impl DiagnosticKind { match self { DeserializationError { .. } | DuplicateDataTypeIdentifier { .. } + | DuplicateFlowTypeIdentifier { .. } | UndefinedDataTypeIdentifier { .. } | NullField { .. } | ForbiddenVariant { .. } @@ -134,6 +136,8 @@ impl Diagnose { error(format!("A JSON paring error occurred: `{}`", description), &path), DuplicateDataTypeIdentifier { identifier } => error(format!("The data_type `{}` is already defined resulting in a duplicate!", identifier), &path), + DuplicateFlowTypeIdentifier { identifier } => + error(format!("The flow_type `{}` is already defined resulting in a duplicate!", identifier), &path), UndefinedDataTypeIdentifier { identifier } => error(format!("`{}` uses an undefined data_type_identifier: `{}`!", self.definition_name, identifier), &path), NullField { field_name } => diff --git a/cli/src/analyser/mod.rs b/cli/src/analyser/mod.rs index 9967465..8e203af 100644 --- a/cli/src/analyser/mod.rs +++ b/cli/src/analyser/mod.rs @@ -6,7 +6,7 @@ use tucana::shared::definition_data_type_rule::Config; use code0_definition_reader::parser::Parser; use code0_definition_reader::reader::{MetaType, ParsableDefinition, Reader}; use crate::analyser::diagnostics::{Diagnose, DiagnosticKind, Reporter}; -use crate::analyser::diagnostics::DiagnosticKind::{DuplicateDataTypeIdentifier, NullField, UndefinedDataTypeIdentifier, UndefinedGenericKey, UndefinedTranslation, UnusedGenericKey}; +use crate::analyser::diagnostics::DiagnosticKind::{DuplicateDataTypeIdentifier, DuplicateFlowTypeIdentifier, NullField, UndefinedDataTypeIdentifier, UndefinedGenericKey, UndefinedTranslation, UnusedGenericKey}; #[derive(Clone)] pub struct AnalysableDataType { @@ -15,6 +15,7 @@ pub struct AnalysableDataType { pub id: i16 } +#[derive(Clone)] pub struct AnalysableFlowType { pub original_definition: ParsableDefinition, pub flow_type: FlowType, @@ -329,6 +330,76 @@ impl Analyser { } } + pub fn analyse_flow_type(&mut self, analysable_flow_type: AnalysableFlowType) { + let flow= analysable_flow_type.flow_type.clone(); + let original_definition = analysable_flow_type.original_definition; + let name = flow.identifier; + + // Check if at least one Translation is present + if flow.name.is_empty() { + self.reporter.add_report(Diagnose::new( + name.clone(), + original_definition.clone(), + UndefinedTranslation { translation_field: String::from("name") } + )); + } + + if flow.description.is_empty() { + self.reporter.add_report(Diagnose::new( + name.clone(), + original_definition.clone(), + UndefinedTranslation { translation_field: String::from("description") } + )); + } + + if flow.documentation.is_empty() { + self.reporter.add_report(Diagnose::new( + name.clone(), + original_definition.clone(), + UndefinedTranslation { translation_field: String::from("documentation") } + )); + } + + // Check if input identifier exists + if let Some(identifier) = flow.input_type_identifier { + if !self.data_type_identifier_exists(identifier.clone(), -1) { + self.reporter.add_report(Diagnose::new( + name.clone(), + original_definition.clone(), + UndefinedDataTypeIdentifier {identifier} + )); + } + } + + // Check if return identifier exists + if let Some(identifier) = flow.return_type_identifier { + if !self.data_type_identifier_exists(identifier.clone(), -1) { + self.reporter.add_report(Diagnose::new( + name.clone(), + original_definition.clone(), + UndefinedDataTypeIdentifier {identifier} + )); + } + } + + // Check if flow type identifier already exists + for flow_type in &self.flow_types { + if analysable_flow_type.id == flow_type.id { + continue + } + + if flow_type.flow_type.identifier.to_lowercase() == name.clone().to_lowercase() { + self.reporter.add_report(Diagnose::new( + name.clone(), + original_definition.clone(), + DuplicateFlowTypeIdentifier { identifier: name } + )); + break; + } + } + + } + pub fn report(&self) { self.reporter.run_report() } diff --git a/cli/src/command/report.rs b/cli/src/command/report.rs index 667c38f..7fbec50 100644 --- a/cli/src/command/report.rs +++ b/cli/src/command/report.rs @@ -18,6 +18,10 @@ pub fn report_errors(path: Option) { analyser.analyse_data_type(data_type.clone()); } + for flow_type in analyser.flow_types.clone() { + analyser.analyse_flow_type(flow_type.clone()); + } + analyser.report(); error_table(&parser.features); From 1f2062dc33fdaeb991178fbd47405b136b0b704c Mon Sep 17 00:00:00 2001 From: Raphael Date: Sat, 16 Aug 2025 16:05:13 +0200 Subject: [PATCH 06/20] feat: added diagnostics for runtime functions --- cli/src/analyser/diagnostics.rs | 16 +++ cli/src/analyser/mod.rs | 199 +++++++++++++++++++++++++++++++- cli/src/command/report.rs | 4 + 3 files changed, 218 insertions(+), 1 deletion(-) diff --git a/cli/src/analyser/diagnostics.rs b/cli/src/analyser/diagnostics.rs index 8e3efa3..df72de3 100644 --- a/cli/src/analyser/diagnostics.rs +++ b/cli/src/analyser/diagnostics.rs @@ -86,7 +86,11 @@ pub enum DiagnosticKind { DeserializationError { description: String }, DuplicateDataTypeIdentifier { identifier: String }, DuplicateFlowTypeIdentifier { identifier: String }, + DuplicateRuntimeFunctionIdentifier { identifier: String }, + DuplicateRuntimeParameterIdentifier { identifier: String }, UndefinedDataTypeIdentifier { identifier: String }, + EmptyGenericMapper, + GenericKeyNotInMappingTarget {key: String, target: String }, NullField { field_name: String }, ForbiddenVariant, UnusedGenericKey { key: String }, @@ -101,6 +105,10 @@ impl DiagnosticKind { DeserializationError { .. } | DuplicateDataTypeIdentifier { .. } | DuplicateFlowTypeIdentifier { .. } + | DuplicateRuntimeFunctionIdentifier { .. } + | DuplicateRuntimeParameterIdentifier { .. } + | GenericKeyNotInMappingTarget { .. } + | EmptyGenericMapper { .. } | UndefinedDataTypeIdentifier { .. } | NullField { .. } | ForbiddenVariant { .. } @@ -132,12 +140,20 @@ impl Diagnose { use DiagnosticKind::*; match &self.kind { + EmptyGenericMapper => + error(format!("`{}` defined a generic_type but its mapper are empty!`", self.definition_name), &path), DeserializationError { description } => error(format!("A JSON paring error occurred: `{}`", description), &path), + GenericKeyNotInMappingTarget {key, target} => + error(format!("`{}` is mapping the key: {} onto the target: {}. But the target did not define this generic_key!", self.definition_name, key, target), &path), DuplicateDataTypeIdentifier { identifier } => error(format!("The data_type `{}` is already defined resulting in a duplicate!", identifier), &path), DuplicateFlowTypeIdentifier { identifier } => error(format!("The flow_type `{}` is already defined resulting in a duplicate!", identifier), &path), + DuplicateRuntimeFunctionIdentifier { identifier } => + error(format!("The runtime_function `{}` is already defined resulting in a duplicate!", identifier), &path), + DuplicateRuntimeParameterIdentifier { identifier } => + error(format!("The runtime_parameter `{}` is already defined resulting in a duplicate!", identifier), &path), UndefinedDataTypeIdentifier { identifier } => error(format!("`{}` uses an undefined data_type_identifier: `{}`!", self.definition_name, identifier), &path), NullField { field_name } => diff --git a/cli/src/analyser/mod.rs b/cli/src/analyser/mod.rs index 8e203af..effc97f 100644 --- a/cli/src/analyser/mod.rs +++ b/cli/src/analyser/mod.rs @@ -1,12 +1,13 @@ mod diagnostics; +use clap::builder::Str; use tucana::shared::{DataTypeIdentifier, DefinitionDataType, FlowType, RuntimeFunctionDefinition}; use tucana::shared::data_type_identifier::Type; use tucana::shared::definition_data_type_rule::Config; use code0_definition_reader::parser::Parser; use code0_definition_reader::reader::{MetaType, ParsableDefinition, Reader}; use crate::analyser::diagnostics::{Diagnose, DiagnosticKind, Reporter}; -use crate::analyser::diagnostics::DiagnosticKind::{DuplicateDataTypeIdentifier, DuplicateFlowTypeIdentifier, NullField, UndefinedDataTypeIdentifier, UndefinedGenericKey, UndefinedTranslation, UnusedGenericKey}; +use crate::analyser::diagnostics::DiagnosticKind::{DuplicateDataTypeIdentifier, DuplicateFlowTypeIdentifier, DuplicateRuntimeParameterIdentifier, EmptyGenericMapper, GenericKeyNotInMappingTarget, NullField, UndefinedDataTypeIdentifier, UndefinedGenericKey, UndefinedTranslation, UnusedGenericKey}; #[derive(Clone)] pub struct AnalysableDataType { @@ -22,6 +23,7 @@ pub struct AnalysableFlowType { pub id: i16 } +#[derive(Clone)] pub struct AnalysableFunction { pub original_definition: ParsableDefinition, pub function: RuntimeFunctionDefinition, @@ -156,6 +158,14 @@ impl Analyser { )); } + if generic.generic_mappers.is_empty() { + self.reporter.add_report(Diagnose::new( + analysable_data_type.definition_data_type.clone().identifier, + analysable_data_type.original_definition.clone(), + EmptyGenericMapper + )) + } + for mapper in generic.generic_mappers { if data_type.generic_keys.contains(&mapper.target) { result.push(mapper.target.clone()) @@ -397,7 +407,194 @@ impl Analyser { break; } } + } + + pub fn analyse_runtime_function(&mut self, analysable_function: AnalysableFunction) { + let name = analysable_function.function.runtime_name.clone(); + let function = analysable_function.function; + let original = analysable_function.original_definition; + let id = analysable_function.id; + + // Check if at least one Translation is present + if function.name.is_empty() { + self.reporter.add_report(Diagnose::new( + name.clone(), + original.clone(), + UndefinedTranslation { translation_field: String::from("name") } + )); + } + + if function.description.is_empty() { + self.reporter.add_report(Diagnose::new( + name.clone(), + original.clone(), + UndefinedTranslation { translation_field: String::from("description") } + )); + } + + if function.documentation.is_empty() { + self.reporter.add_report(Diagnose::new( + name.clone(), + original.clone(), + UndefinedTranslation { translation_field: String::from("documentation") } + )); + } + + // Check if runtime function already exists + for func in &self.functions { + if func.id == id { + continue + } + + if func.function.runtime_name.to_lowercase() == name.clone().to_lowercase() { + self.reporter.add_report(Diagnose::new( + name.clone(), + original.clone(), + DuplicateFlowTypeIdentifier { identifier: name.clone() } + )); + break; + } + } + + let mut detected_generic_keys: Vec = vec![]; + if let Some(identifier) = function.return_type_identifier { + detected_generic_keys.append(&mut self.handle_function_data_type_identifier(name.clone(), original.clone(), identifier)); + } + + let mut parameter_names: Vec = vec![]; + for parameter in function.runtime_parameter_definitions { + + // Check if at least one Translation is present + if parameter.name.is_empty() { + self.reporter.add_report(Diagnose::new( + name.clone(), + original.clone(), + UndefinedTranslation { translation_field: String::from("name") } + )); + } + + if parameter.description.is_empty() { + self.reporter.add_report(Diagnose::new( + name.clone(), + original.clone(), + UndefinedTranslation { translation_field: String::from("description") } + )); + } + + if parameter.documentation.is_empty() { + self.reporter.add_report(Diagnose::new( + name.clone(), + original.clone(), + UndefinedTranslation { translation_field: String::from("documentation") } + )); + } + + // Check if data_type exists + if let Some(identifier) = parameter.data_type_identifier { + detected_generic_keys.append(&mut self.handle_function_data_type_identifier(name.clone(), original.clone(), identifier)); + } else { + self.reporter.add_report(Diagnose::new( + name.clone(), + original.clone(), + NullField { field_name: String::from("data_type") } + )); + } + + if parameter_names.contains(¶meter.runtime_name) { + self.reporter.add_report(Diagnose::new( + name.clone(), + original.clone(), + DuplicateRuntimeParameterIdentifier { identifier: parameter.runtime_name.clone() } + )); + } + + parameter_names.push(parameter.runtime_name); + } + + let defined_but_unused = function.generic_keys.iter().filter(|key| !detected_generic_keys.contains(key)).collect::>(); + let used_but_undefined = detected_generic_keys.iter().filter(|key| !function.generic_keys.contains(key)).collect::>(); + + for key in defined_but_unused { + self.reporter.add_report(Diagnose::new( + name.clone(), + original.clone(), + UnusedGenericKey { key: key.clone() } + )); + } + + for key in used_but_undefined { + self.reporter.add_report(Diagnose::new( + name.clone(), + original.clone(), + UndefinedGenericKey { key: key.clone() } + )); + } + } + + fn handle_function_data_type_identifier(&mut self, name: String, original: ParsableDefinition, identifier: DataTypeIdentifier) -> Vec { + let mut result: Vec = vec![]; + if let Some(r#type) = identifier.r#type { + match r#type { + Type::DataTypeIdentifier(data_type) => { + if !self.data_type_identifier_exists(data_type.clone(), -1) { + self.reporter.add_report(Diagnose::new( + name.clone(), + original.clone(), + UndefinedDataTypeIdentifier { identifier: data_type.clone() } + )) + }; + }, + Type::GenericType(generic_type) => { + if !self.data_type_identifier_exists(generic_type.data_type_identifier.clone(), -1) { + self.reporter.add_report(Diagnose::new( + name.clone(), + original.clone(), + UndefinedDataTypeIdentifier { identifier: generic_type.data_type_identifier.clone() } + )) + } + + if generic_type.generic_mappers.is_empty() { + self.reporter.add_report(Diagnose::new( + name.clone(), + original.clone(), + EmptyGenericMapper + )) + } + + for mapper in &generic_type.generic_mappers { + for source in mapper.source.clone() { + result.append(&mut self.handle_function_data_type_identifier(name.clone(), original.clone(), source)) + } + + if !self.generic_key_in_target(mapper.target.clone(), generic_type.data_type_identifier.clone()) { + self.reporter.add_report(Diagnose::new( + name.clone(), + original.clone(), + GenericKeyNotInMappingTarget { key: mapper.target.clone(), target: generic_type.data_type_identifier.clone() } + )) + } + } + }, + Type::GenericKey(key) => { + result.push(key.clone()) + }, + } + } + + result + } + fn generic_key_in_target(&mut self, key: String, target: String) -> bool { + let data_types: Vec = self.data_types.iter().map(|d| d.definition_data_type.clone()).collect(); + for data_type in data_types { + if target.to_lowercase() != data_type.identifier.to_lowercase() { + continue; + } + + return data_type.generic_keys.contains(&key); + } + + false } pub fn report(&self) { diff --git a/cli/src/command/report.rs b/cli/src/command/report.rs index 7fbec50..9f6a534 100644 --- a/cli/src/command/report.rs +++ b/cli/src/command/report.rs @@ -22,6 +22,10 @@ pub fn report_errors(path: Option) { analyser.analyse_flow_type(flow_type.clone()); } + for functions in analyser.functions.clone() { + analyser.analyse_runtime_function(functions.clone()); + } + analyser.report(); error_table(&parser.features); From 3dea5f5d32640e44ca59c903283fc34df7298447 Mon Sep 17 00:00:00 2001 From: Raphael Date: Sat, 16 Aug 2025 16:06:11 +0200 Subject: [PATCH 07/20] fix: renamed duplicate function to std::number::sin --- definitions/standard/runtime_definition/primitive/number.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/definitions/standard/runtime_definition/primitive/number.md b/definitions/standard/runtime_definition/primitive/number.md index 9947905..3699e19 100644 --- a/definitions/standard/runtime_definition/primitive/number.md +++ b/definitions/standard/runtime_definition/primitive/number.md @@ -2237,7 +2237,7 @@ Calculates the sine of an angle (in radians). ```json { - "runtime_name": "std::number::random_number", + "runtime_name": "std::number::sin", "runtime_parameter_definitions": [ { "data_type_identifier": { From 8453b7c8f8ab3ff838cb7f9319a6833a0c8a5ad8 Mon Sep 17 00:00:00 2001 From: Raphael Date: Mon, 18 Aug 2025 11:26:48 +0200 Subject: [PATCH 08/20] feat: added object --- definitions/standard/data_type/object.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 definitions/standard/data_type/object.md diff --git a/definitions/standard/data_type/object.md b/definitions/standard/data_type/object.md new file mode 100644 index 0000000..cc0939e --- /dev/null +++ b/definitions/standard/data_type/object.md @@ -0,0 +1,15 @@ + +```json +{ + "variant": 2, + "identifier": "OBJECT", + "name": [ + { + "code": "en-US", + "content": "Object" + } + ], + "rules": [], + "generic_keys": [] +} +``` \ No newline at end of file From 3f4e82e4c1b095ae62d2fe73563af53760aee29c Mon Sep 17 00:00:00 2001 From: Raphael Date: Mon, 18 Aug 2025 11:26:56 +0200 Subject: [PATCH 09/20] docs: added variant shortcut --- variant.txt | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 variant.txt diff --git a/variant.txt b/variant.txt new file mode 100644 index 0000000..c7366a3 --- /dev/null +++ b/variant.txt @@ -0,0 +1,8 @@ +Unknown = 0, +Primitive = 1 +Type = 2 +Object = 3 +Datatype = 4 +Array = 5 +Error = 6 +Node = 7 \ No newline at end of file From 3fe7b854896b0ef9ec3fcbdaa4bee02ee1a7b431 Mon Sep 17 00:00:00 2001 From: Raphael Date: Mon, 18 Aug 2025 11:27:35 +0200 Subject: [PATCH 10/20] feat: started to implement the analyser into every command --- cli/src/analyser/diagnostics.rs | 155 +++++++++---- cli/src/analyser/mod.rs | 386 +++++++++++++++++++++++--------- cli/src/command/definition.rs | 40 ++-- cli/src/command/download.rs | 144 ++---------- cli/src/command/feature.rs | 55 +++-- cli/src/command/report.rs | 32 ++- cli/src/command/watch.rs | 79 +++---- cli/src/formatter.rs | 21 +- cli/src/main.rs | 4 +- cli/src/table.rs | 318 ++++---------------------- reader/rust/src/reader.rs | 13 +- 11 files changed, 567 insertions(+), 680 deletions(-) diff --git a/cli/src/analyser/diagnostics.rs b/cli/src/analyser/diagnostics.rs index df72de3..12b2dc9 100644 --- a/cli/src/analyser/diagnostics.rs +++ b/cli/src/analyser/diagnostics.rs @@ -1,12 +1,12 @@ +use crate::formatter::{error, warning}; +use code0_definition_reader::reader::ParsableDefinition; use std::cmp::PartialEq; use std::path::Path; use std::process::exit; -use code0_definition_reader::reader::ParsableDefinition; -use crate::formatter::{error, warning}; #[derive(Default)] pub struct Reporter { - diagnose: Vec + diagnose: Vec, } impl PartialEq for Severity { @@ -35,13 +35,11 @@ impl PartialEq for Severity { } impl Reporter { - pub fn add_report(&mut self, diagnose: Diagnose) { self.diagnose.push(diagnose); } - pub fn run_report(&self) { - + pub fn run_report(&self, will_exit: bool) { for error in &self.get_errors() { println!("{}", error.print()); } @@ -50,30 +48,37 @@ impl Reporter { println!("{}", warning.print()); } - if !self.get_errors().is_empty() { + if !self.get_errors().is_empty() && will_exit { exit(1) } - } pub fn get_errors(&self) -> Vec<&Diagnose> { - self.diagnose.iter().filter(|p| p.kind.severity() == Severity::Error).collect() + self.diagnose + .iter() + .filter(|p| p.kind.severity() == Severity::Error) + .collect() } pub fn get_warnings(&self) -> Vec<&Diagnose> { - self.diagnose.iter().filter(|p| p.kind.severity() == Severity::Warning).collect() + self.diagnose + .iter() + .filter(|p| p.kind.severity() == Severity::Warning) + .collect() } pub fn get_debug(&self) -> Vec<&Diagnose> { - self.diagnose.iter().filter(|p| p.kind.severity() == Severity::Debug).collect() + self.diagnose + .iter() + .filter(|p| p.kind.severity() == Severity::Debug) + .collect() } - } pub enum Severity { Error, Warning, - Debug + Debug, } pub struct Diagnose { @@ -90,7 +95,7 @@ pub enum DiagnosticKind { DuplicateRuntimeParameterIdentifier { identifier: String }, UndefinedDataTypeIdentifier { identifier: String }, EmptyGenericMapper, - GenericKeyNotInMappingTarget {key: String, target: String }, + GenericKeyNotInMappingTarget { key: String, target: String }, NullField { field_name: String }, ForbiddenVariant, UnusedGenericKey { key: String }, @@ -120,8 +125,11 @@ impl DiagnosticKind { } impl Diagnose { - - pub fn new(definition_name: String, definition: ParsableDefinition, kind: DiagnosticKind) -> Self { + pub fn new( + definition_name: String, + definition: ParsableDefinition, + kind: DiagnosticKind, + ) -> Self { Self { definition_name, definition, @@ -130,7 +138,6 @@ impl Diagnose { } pub fn print(&self) -> String { - let path = format!( "{}:{}:{}", Path::new(&self.definition.path.clone().unwrap_or_default()).display(), @@ -140,32 +147,94 @@ impl Diagnose { use DiagnosticKind::*; match &self.kind { - EmptyGenericMapper => - error(format!("`{}` defined a generic_type but its mapper are empty!`", self.definition_name), &path), - DeserializationError { description } => - error(format!("A JSON paring error occurred: `{}`", description), &path), - GenericKeyNotInMappingTarget {key, target} => - error(format!("`{}` is mapping the key: {} onto the target: {}. But the target did not define this generic_key!", self.definition_name, key, target), &path), - DuplicateDataTypeIdentifier { identifier } => - error(format!("The data_type `{}` is already defined resulting in a duplicate!", identifier), &path), - DuplicateFlowTypeIdentifier { identifier } => - error(format!("The flow_type `{}` is already defined resulting in a duplicate!", identifier), &path), - DuplicateRuntimeFunctionIdentifier { identifier } => - error(format!("The runtime_function `{}` is already defined resulting in a duplicate!", identifier), &path), - DuplicateRuntimeParameterIdentifier { identifier } => - error(format!("The runtime_parameter `{}` is already defined resulting in a duplicate!", identifier), &path), - UndefinedDataTypeIdentifier { identifier } => - error(format!("`{}` uses an undefined data_type_identifier: `{}`!", self.definition_name, identifier), &path), - NullField { field_name } => - error ( format!("`{}` has a field (`{}`) that is null!", self.definition_name, field_name), &path), - ForbiddenVariant => - error(format!("The data_type variant of `{}` is 0 and thus incorrect!", self.definition_name), &path), - UnusedGenericKey { key } => - error(format!("`{}` defined a generic_key (`{}`) that is never used!", self.definition_name, key), &path), - UndefinedGenericKey { key } => - error(format!("`{}` uses a generic_key (`{}`) that's not defined!", self.definition_name, key), &path), - UndefinedTranslation { translation_field } => - warning(format!("`{}` has an empty field (`{}`) of translations!", self.definition_name, translation_field), &path), + EmptyGenericMapper => error( + format!( + "`{}` defined a generic_type but its mapper are empty!`", + self.definition_name + ), + &path, + ), + DeserializationError { description } => error( + format!("A JSON paring error occurred: `{}`", description), + &path, + ), + GenericKeyNotInMappingTarget { key, target } => error( + format!( + "`{}` is mapping the key: {} onto the target: {}. But the target did not define this generic_key!", + self.definition_name, key, target + ), + &path, + ), + DuplicateDataTypeIdentifier { identifier } => error( + format!( + "The data_type `{}` is already defined resulting in a duplicate!", + identifier + ), + &path, + ), + DuplicateFlowTypeIdentifier { identifier } => error( + format!( + "The flow_type `{}` is already defined resulting in a duplicate!", + identifier + ), + &path, + ), + DuplicateRuntimeFunctionIdentifier { identifier } => error( + format!( + "The runtime_function `{}` is already defined resulting in a duplicate!", + identifier + ), + &path, + ), + DuplicateRuntimeParameterIdentifier { identifier } => error( + format!( + "The runtime_parameter `{}` is already defined resulting in a duplicate!", + identifier + ), + &path, + ), + UndefinedDataTypeIdentifier { identifier } => error( + format!( + "`{}` uses an undefined data_type_identifier: `{}`!", + self.definition_name, identifier + ), + &path, + ), + NullField { field_name } => error( + format!( + "`{}` has a field (`{}`) that is null!", + self.definition_name, field_name + ), + &path, + ), + ForbiddenVariant => error( + format!( + "The data_type variant of `{}` is 0 and thus incorrect!", + self.definition_name + ), + &path, + ), + UnusedGenericKey { key } => error( + format!( + "`{}` defined a generic_key (`{}`) that is never used!", + self.definition_name, key + ), + &path, + ), + UndefinedGenericKey { key } => error( + format!( + "`{}` uses a generic_key (`{}`) that's not defined!", + self.definition_name, key + ), + &path, + ), + UndefinedTranslation { translation_field } => warning( + format!( + "`{}` has an empty field (`{}`) of translations!", + self.definition_name, translation_field + ), + &path, + ), } } } diff --git a/cli/src/analyser/mod.rs b/cli/src/analyser/mod.rs index effc97f..12d2b01 100644 --- a/cli/src/analyser/mod.rs +++ b/cli/src/analyser/mod.rs @@ -1,44 +1,46 @@ mod diagnostics; -use clap::builder::Str; -use tucana::shared::{DataTypeIdentifier, DefinitionDataType, FlowType, RuntimeFunctionDefinition}; -use tucana::shared::data_type_identifier::Type; -use tucana::shared::definition_data_type_rule::Config; +use crate::analyser::diagnostics::DiagnosticKind::{ + DuplicateDataTypeIdentifier, DuplicateFlowTypeIdentifier, DuplicateRuntimeParameterIdentifier, + EmptyGenericMapper, GenericKeyNotInMappingTarget, NullField, UndefinedDataTypeIdentifier, + UndefinedGenericKey, UndefinedTranslation, UnusedGenericKey, +}; +use crate::analyser::diagnostics::{Diagnose, DiagnosticKind, Reporter}; use code0_definition_reader::parser::Parser; use code0_definition_reader::reader::{MetaType, ParsableDefinition, Reader}; -use crate::analyser::diagnostics::{Diagnose, DiagnosticKind, Reporter}; -use crate::analyser::diagnostics::DiagnosticKind::{DuplicateDataTypeIdentifier, DuplicateFlowTypeIdentifier, DuplicateRuntimeParameterIdentifier, EmptyGenericMapper, GenericKeyNotInMappingTarget, NullField, UndefinedDataTypeIdentifier, UndefinedGenericKey, UndefinedTranslation, UnusedGenericKey}; +use tucana::shared::data_type_identifier::Type; +use tucana::shared::definition_data_type_rule::Config; +use tucana::shared::{DataTypeIdentifier, DefinitionDataType, FlowType, RuntimeFunctionDefinition}; #[derive(Clone)] pub struct AnalysableDataType { pub original_definition: ParsableDefinition, pub definition_data_type: DefinitionDataType, - pub id: i16 + pub id: i16, } #[derive(Clone)] pub struct AnalysableFlowType { pub original_definition: ParsableDefinition, pub flow_type: FlowType, - pub id: i16 + pub id: i16, } #[derive(Clone)] pub struct AnalysableFunction { pub original_definition: ParsableDefinition, pub function: RuntimeFunctionDefinition, - pub id: i16 + pub id: i16, } pub struct Analyser { reporter: Reporter, pub data_types: Vec, pub flow_types: Vec, - pub functions: Vec + pub functions: Vec, } impl Analyser { - pub fn new(path: &str) -> Analyser { let mut reporter = Reporter::default(); let reader = match Reader::from_path(path) { @@ -58,51 +60,84 @@ impl Analyser { MetaType::FlowType => { for p_flow_type in &features.data { current_index += 1; - match serde_json::from_str::(p_flow_type.definition_string.as_str()) { + match serde_json::from_str::( + p_flow_type.definition_string.as_str(), + ) { Ok(flow_type) => collected_flow_types.push(AnalysableFlowType { original_definition: p_flow_type.clone(), flow_type, id: current_index, }), Err(err) => { - let name = Parser::extract_identifier(p_flow_type.definition_string.as_str(), MetaType::FlowType); - let diagnose = Diagnose::new(name, p_flow_type.clone(), DiagnosticKind::DeserializationError {description: err.to_string()}); + let name = Parser::extract_identifier( + p_flow_type.definition_string.as_str(), + MetaType::FlowType, + ); + let diagnose = Diagnose::new( + name, + p_flow_type.clone(), + DiagnosticKind::DeserializationError { + description: err.to_string(), + }, + ); reporter.add_report(diagnose); - }, + } } } - }, + } MetaType::DataType => { for p_data_type in &features.data { current_index += 1; - match serde_json::from_str::(p_data_type.definition_string.as_str()) { + match serde_json::from_str::( + p_data_type.definition_string.as_str(), + ) { Ok(data_type) => collected_data_types.push(AnalysableDataType { original_definition: p_data_type.clone(), definition_data_type: data_type, id: current_index, }), Err(err) => { - let name = Parser::extract_identifier(p_data_type.definition_string.as_str(), MetaType::DataType); - let diagnose = Diagnose::new(name, p_data_type.clone(), DiagnosticKind::DeserializationError {description: err.to_string()}); - reporter.add_report(diagnose); - }, + let name = Parser::extract_identifier( + p_data_type.definition_string.as_str(), + MetaType::DataType, + ); + let diagnose = Diagnose::new( + name, + p_data_type.clone(), + DiagnosticKind::DeserializationError { + description: err.to_string(), + }, + ); + reporter.add_report(diagnose); + } } } } MetaType::RuntimeFunction => { for p_function in &features.data { current_index += 1; - match serde_json::from_str::(p_function.definition_string.as_str()) { + match serde_json::from_str::( + p_function.definition_string.as_str(), + ) { Ok(function) => collected_functions.push(AnalysableFunction { original_definition: p_function.clone(), function, id: current_index, }), Err(err) => { - let name = Parser::extract_identifier(p_function.definition_string.as_str(), MetaType::RuntimeFunction); - let diagnose = Diagnose::new(name, p_function.clone(), DiagnosticKind::DeserializationError {description: err.to_string()}); - reporter.add_report(diagnose); - }, + let name = Parser::extract_identifier( + p_function.definition_string.as_str(), + MetaType::RuntimeFunction, + ); + let diagnose = Diagnose::new( + name, + p_function.clone(), + DiagnosticKind::DeserializationError { + description: err.to_string(), + }, + ); + reporter.add_report(diagnose); + } } } } @@ -118,13 +153,14 @@ impl Analyser { } pub fn data_type_identifier_exists(&self, identifier: String, id: i16) -> bool { - for data_types in &self.data_types { if id == data_types.id { - continue + continue; } - if data_types.definition_data_type.identifier.to_lowercase() != identifier.to_lowercase() { + if data_types.definition_data_type.identifier.to_lowercase() + != identifier.to_lowercase() + { continue; } return true; @@ -133,7 +169,11 @@ impl Analyser { } /// Checks (recursively) if the defined DataTypes are correct - pub fn handle_data_type(&mut self, analysable_data_type: AnalysableDataType, data_type_identifier: DataTypeIdentifier) -> Vec { + pub fn handle_data_type( + &mut self, + analysable_data_type: AnalysableDataType, + data_type_identifier: DataTypeIdentifier, + ) -> Vec { let data_type = analysable_data_type.definition_data_type.clone(); let id = analysable_data_type.id; let mut result = vec![]; @@ -145,7 +185,7 @@ impl Analyser { self.reporter.add_report(Diagnose::new( analysable_data_type.definition_data_type.identifier, analysable_data_type.original_definition, - UndefinedDataTypeIdentifier { identifier } + UndefinedDataTypeIdentifier { identifier }, )); } } @@ -154,7 +194,9 @@ impl Analyser { self.reporter.add_report(Diagnose::new( analysable_data_type.definition_data_type.clone().identifier, analysable_data_type.original_definition.clone(), - UndefinedDataTypeIdentifier {identifier: generic.data_type_identifier} + UndefinedDataTypeIdentifier { + identifier: generic.data_type_identifier, + }, )); } @@ -162,7 +204,7 @@ impl Analyser { self.reporter.add_report(Diagnose::new( analysable_data_type.definition_data_type.clone().identifier, analysable_data_type.original_definition.clone(), - EmptyGenericMapper + EmptyGenericMapper, )) } @@ -172,26 +214,28 @@ impl Analyser { } for source in mapper.source { - result.append(&mut self.handle_data_type(analysable_data_type.clone(), source)) + result.append( + &mut self.handle_data_type(analysable_data_type.clone(), source), + ) } } } - Type::GenericKey(key) => { - result.push(key.clone()) - } + Type::GenericKey(key) => result.push(key.clone()), } } else { self.reporter.add_report(Diagnose::new( analysable_data_type.definition_data_type.clone().identifier, analysable_data_type.original_definition.clone(), - NullField { field_name: String::from("data_type") } + NullField { + field_name: String::from("data_type"), + }, )); } result } - pub fn analyse_data_type(&mut self, analysable_data_type: AnalysableDataType) { + pub fn analyse_data_type(&mut self, analysable_data_type: AnalysableDataType) { let id = analysable_data_type.id; let data_type = analysable_data_type.definition_data_type.clone(); // Check if Identifier is duplicate @@ -199,7 +243,9 @@ impl Analyser { self.reporter.add_report(Diagnose::new( analysable_data_type.definition_data_type.clone().identifier, analysable_data_type.original_definition.clone(), - DuplicateDataTypeIdentifier { identifier: data_type.identifier.clone() } + DuplicateDataTypeIdentifier { + identifier: data_type.identifier.clone(), + }, )); } @@ -208,7 +254,7 @@ impl Analyser { self.reporter.add_report(Diagnose::new( analysable_data_type.definition_data_type.clone().identifier, analysable_data_type.original_definition.clone(), - DiagnosticKind::ForbiddenVariant + DiagnosticKind::ForbiddenVariant, )); } @@ -221,23 +267,37 @@ impl Analyser { match config { Config::ContainsKey(rule) => { if let Some(data_type_identifier) = rule.data_type_identifier { - detected_generic_keys.append(&mut self.handle_data_type(analysable_data_type.clone(), data_type_identifier)) + detected_generic_keys.append(&mut self.handle_data_type( + analysable_data_type.clone(), + data_type_identifier, + )) } else { self.reporter.add_report(Diagnose::new( analysable_data_type.definition_data_type.clone().identifier, analysable_data_type.original_definition.clone(), - NullField { field_name: String::from("definition_data_type_contains_key_rule") } + NullField { + field_name: String::from( + "definition_data_type_contains_key_rule", + ), + }, )); } } Config::ContainsType(rule) => { if let Some(data_type_identifier) = rule.data_type_identifier { - detected_generic_keys.append(&mut self.handle_data_type(analysable_data_type.clone(), data_type_identifier)) + detected_generic_keys.append(&mut self.handle_data_type( + analysable_data_type.clone(), + data_type_identifier, + )) } else { self.reporter.add_report(Diagnose::new( analysable_data_type.definition_data_type.clone().identifier, analysable_data_type.original_definition.clone(), - NullField { field_name: String::from("definition_data_type_contains_type_rule") } + NullField { + field_name: String::from( + "definition_data_type_contains_type_rule", + ), + }, )); } } @@ -246,7 +306,11 @@ impl Analyser { self.reporter.add_report(Diagnose::new( analysable_data_type.definition_data_type.clone().identifier, analysable_data_type.original_definition.clone(), - NullField { field_name: String::from("definition_data_type_item_of_collection_rule") } + NullField { + field_name: String::from( + "definition_data_type_item_of_collection_rule", + ), + }, )); } } @@ -257,41 +321,68 @@ impl Analyser { self.reporter.add_report(Diagnose::new( analysable_data_type.definition_data_type.clone().identifier, analysable_data_type.original_definition.clone(), - NullField { field_name: String::from("definition_data_type_input_types_rule") } + NullField { + field_name: String::from( + "definition_data_type_input_types_rule", + ), + }, )); } for input_type in &rule.input_types { - if let Some(data_type_identifier) = &input_type.data_type_identifier { - detected_generic_keys.append(&mut self.handle_data_type(analysable_data_type.clone(), data_type_identifier.clone())) + if let Some(data_type_identifier) = &input_type.data_type_identifier + { + detected_generic_keys.append(&mut self.handle_data_type( + analysable_data_type.clone(), + data_type_identifier.clone(), + )) } else { self.reporter.add_report(Diagnose::new( - analysable_data_type.definition_data_type.clone().identifier, + analysable_data_type + .definition_data_type + .clone() + .identifier, analysable_data_type.original_definition.clone(), - UndefinedDataTypeIdentifier { identifier: data_type.identifier.clone() } + UndefinedDataTypeIdentifier { + identifier: data_type.identifier.clone(), + }, )); } } } Config::ReturnType(rule) => { if let Some(data_type_identifier) = &rule.data_type_identifier { - detected_generic_keys.append(&mut self.handle_data_type(analysable_data_type.clone(), data_type_identifier.clone())) + detected_generic_keys.append(&mut self.handle_data_type( + analysable_data_type.clone(), + data_type_identifier.clone(), + )) } else { self.reporter.add_report(Diagnose::new( analysable_data_type.definition_data_type.clone().identifier, analysable_data_type.original_definition.clone(), - NullField { field_name: String::from("definition_data_type_return_type_rule") } + NullField { + field_name: String::from( + "definition_data_type_return_type_rule", + ), + }, )); } } Config::ParentType(rule) => { if let Some(data_type_identifier) = &rule.parent_type { - detected_generic_keys.append(&mut self.handle_data_type(analysable_data_type.clone(), data_type_identifier.clone())) + detected_generic_keys.append(&mut self.handle_data_type( + analysable_data_type.clone(), + data_type_identifier.clone(), + )) } else { self.reporter.add_report(Diagnose::new( analysable_data_type.definition_data_type.clone().identifier, analysable_data_type.original_definition.clone(), - NullField { field_name: String::from("definition_data_type_parent_type_rule") } + NullField { + field_name: String::from( + "definition_data_type_parent_type_rule", + ), + }, )); } } @@ -299,14 +390,21 @@ impl Analyser { } } - let defined_but_unused = data_type.generic_keys.iter().filter(|key| !detected_generic_keys.contains(key)).collect::>(); - let used_but_undefined = detected_generic_keys.iter().filter(|key| !data_type.generic_keys.contains(key)).collect::>(); + let defined_but_unused = data_type + .generic_keys + .iter() + .filter(|key| !detected_generic_keys.contains(key)) + .collect::>(); + let used_but_undefined = detected_generic_keys + .iter() + .filter(|key| !data_type.generic_keys.contains(key)) + .collect::>(); for key in defined_but_unused { self.reporter.add_report(Diagnose::new( analysable_data_type.definition_data_type.clone().identifier, analysable_data_type.original_definition.clone(), - UnusedGenericKey { key: key.clone() } + UnusedGenericKey { key: key.clone() }, )); } @@ -314,7 +412,7 @@ impl Analyser { self.reporter.add_report(Diagnose::new( analysable_data_type.definition_data_type.clone().identifier, analysable_data_type.original_definition.clone(), - UndefinedGenericKey { key: key.clone() } + UndefinedGenericKey { key: key.clone() }, )); } } else { @@ -324,7 +422,9 @@ impl Analyser { self.reporter.add_report(Diagnose::new( analysable_data_type.definition_data_type.clone().identifier, analysable_data_type.original_definition.clone(), - NullField { field_name: String::from("rule") } + NullField { + field_name: String::from("rule"), + }, )); } } @@ -335,13 +435,15 @@ impl Analyser { self.reporter.add_report(Diagnose::new( analysable_data_type.definition_data_type.clone().identifier, analysable_data_type.original_definition.clone(), - UndefinedTranslation { translation_field: String::from("name") } + UndefinedTranslation { + translation_field: String::from("name"), + }, )); } } pub fn analyse_flow_type(&mut self, analysable_flow_type: AnalysableFlowType) { - let flow= analysable_flow_type.flow_type.clone(); + let flow = analysable_flow_type.flow_type.clone(); let original_definition = analysable_flow_type.original_definition; let name = flow.identifier; @@ -350,7 +452,9 @@ impl Analyser { self.reporter.add_report(Diagnose::new( name.clone(), original_definition.clone(), - UndefinedTranslation { translation_field: String::from("name") } + UndefinedTranslation { + translation_field: String::from("name"), + }, )); } @@ -358,7 +462,9 @@ impl Analyser { self.reporter.add_report(Diagnose::new( name.clone(), original_definition.clone(), - UndefinedTranslation { translation_field: String::from("description") } + UndefinedTranslation { + translation_field: String::from("description"), + }, )); } @@ -366,7 +472,9 @@ impl Analyser { self.reporter.add_report(Diagnose::new( name.clone(), original_definition.clone(), - UndefinedTranslation { translation_field: String::from("documentation") } + UndefinedTranslation { + translation_field: String::from("documentation"), + }, )); } @@ -376,7 +484,7 @@ impl Analyser { self.reporter.add_report(Diagnose::new( name.clone(), original_definition.clone(), - UndefinedDataTypeIdentifier {identifier} + UndefinedDataTypeIdentifier { identifier }, )); } } @@ -387,7 +495,7 @@ impl Analyser { self.reporter.add_report(Diagnose::new( name.clone(), original_definition.clone(), - UndefinedDataTypeIdentifier {identifier} + UndefinedDataTypeIdentifier { identifier }, )); } } @@ -395,14 +503,14 @@ impl Analyser { // Check if flow type identifier already exists for flow_type in &self.flow_types { if analysable_flow_type.id == flow_type.id { - continue + continue; } if flow_type.flow_type.identifier.to_lowercase() == name.clone().to_lowercase() { self.reporter.add_report(Diagnose::new( name.clone(), original_definition.clone(), - DuplicateFlowTypeIdentifier { identifier: name } + DuplicateFlowTypeIdentifier { identifier: name }, )); break; } @@ -420,7 +528,9 @@ impl Analyser { self.reporter.add_report(Diagnose::new( name.clone(), original.clone(), - UndefinedTranslation { translation_field: String::from("name") } + UndefinedTranslation { + translation_field: String::from("name"), + }, )); } @@ -428,7 +538,9 @@ impl Analyser { self.reporter.add_report(Diagnose::new( name.clone(), original.clone(), - UndefinedTranslation { translation_field: String::from("description") } + UndefinedTranslation { + translation_field: String::from("description"), + }, )); } @@ -436,21 +548,25 @@ impl Analyser { self.reporter.add_report(Diagnose::new( name.clone(), original.clone(), - UndefinedTranslation { translation_field: String::from("documentation") } + UndefinedTranslation { + translation_field: String::from("documentation"), + }, )); } // Check if runtime function already exists for func in &self.functions { if func.id == id { - continue + continue; } if func.function.runtime_name.to_lowercase() == name.clone().to_lowercase() { self.reporter.add_report(Diagnose::new( name.clone(), original.clone(), - DuplicateFlowTypeIdentifier { identifier: name.clone() } + DuplicateFlowTypeIdentifier { + identifier: name.clone(), + }, )); break; } @@ -458,18 +574,23 @@ impl Analyser { let mut detected_generic_keys: Vec = vec![]; if let Some(identifier) = function.return_type_identifier { - detected_generic_keys.append(&mut self.handle_function_data_type_identifier(name.clone(), original.clone(), identifier)); + detected_generic_keys.append(&mut self.handle_function_data_type_identifier( + name.clone(), + original.clone(), + identifier, + )); } let mut parameter_names: Vec = vec![]; for parameter in function.runtime_parameter_definitions { - // Check if at least one Translation is present if parameter.name.is_empty() { self.reporter.add_report(Diagnose::new( name.clone(), original.clone(), - UndefinedTranslation { translation_field: String::from("name") } + UndefinedTranslation { + translation_field: String::from("name"), + }, )); } @@ -477,7 +598,9 @@ impl Analyser { self.reporter.add_report(Diagnose::new( name.clone(), original.clone(), - UndefinedTranslation { translation_field: String::from("description") } + UndefinedTranslation { + translation_field: String::from("description"), + }, )); } @@ -485,18 +608,26 @@ impl Analyser { self.reporter.add_report(Diagnose::new( name.clone(), original.clone(), - UndefinedTranslation { translation_field: String::from("documentation") } + UndefinedTranslation { + translation_field: String::from("documentation"), + }, )); } // Check if data_type exists if let Some(identifier) = parameter.data_type_identifier { - detected_generic_keys.append(&mut self.handle_function_data_type_identifier(name.clone(), original.clone(), identifier)); - } else { + detected_generic_keys.append(&mut self.handle_function_data_type_identifier( + name.clone(), + original.clone(), + identifier, + )); + } else { self.reporter.add_report(Diagnose::new( name.clone(), original.clone(), - NullField { field_name: String::from("data_type") } + NullField { + field_name: String::from("data_type"), + }, )); } @@ -504,21 +635,30 @@ impl Analyser { self.reporter.add_report(Diagnose::new( name.clone(), original.clone(), - DuplicateRuntimeParameterIdentifier { identifier: parameter.runtime_name.clone() } + DuplicateRuntimeParameterIdentifier { + identifier: parameter.runtime_name.clone(), + }, )); } parameter_names.push(parameter.runtime_name); } - let defined_but_unused = function.generic_keys.iter().filter(|key| !detected_generic_keys.contains(key)).collect::>(); - let used_but_undefined = detected_generic_keys.iter().filter(|key| !function.generic_keys.contains(key)).collect::>(); + let defined_but_unused = function + .generic_keys + .iter() + .filter(|key| !detected_generic_keys.contains(key)) + .collect::>(); + let used_but_undefined = detected_generic_keys + .iter() + .filter(|key| !function.generic_keys.contains(key)) + .collect::>(); for key in defined_but_unused { self.reporter.add_report(Diagnose::new( name.clone(), original.clone(), - UnusedGenericKey { key: key.clone() } + UnusedGenericKey { key: key.clone() }, )); } @@ -526,30 +666,41 @@ impl Analyser { self.reporter.add_report(Diagnose::new( name.clone(), original.clone(), - UndefinedGenericKey { key: key.clone() } + UndefinedGenericKey { key: key.clone() }, )); } } - fn handle_function_data_type_identifier(&mut self, name: String, original: ParsableDefinition, identifier: DataTypeIdentifier) -> Vec { + fn handle_function_data_type_identifier( + &mut self, + name: String, + original: ParsableDefinition, + identifier: DataTypeIdentifier, + ) -> Vec { let mut result: Vec = vec![]; - if let Some(r#type) = identifier.r#type { + if let Some(r#type) = identifier.r#type { match r#type { Type::DataTypeIdentifier(data_type) => { if !self.data_type_identifier_exists(data_type.clone(), -1) { self.reporter.add_report(Diagnose::new( name.clone(), original.clone(), - UndefinedDataTypeIdentifier { identifier: data_type.clone() } + UndefinedDataTypeIdentifier { + identifier: data_type.clone(), + }, )) }; - }, + } Type::GenericType(generic_type) => { - if !self.data_type_identifier_exists(generic_type.data_type_identifier.clone(), -1) { + if !self + .data_type_identifier_exists(generic_type.data_type_identifier.clone(), -1) + { self.reporter.add_report(Diagnose::new( name.clone(), original.clone(), - UndefinedDataTypeIdentifier { identifier: generic_type.data_type_identifier.clone() } + UndefinedDataTypeIdentifier { + identifier: generic_type.data_type_identifier.clone(), + }, )) } @@ -557,27 +708,35 @@ impl Analyser { self.reporter.add_report(Diagnose::new( name.clone(), original.clone(), - EmptyGenericMapper + EmptyGenericMapper, )) } for mapper in &generic_type.generic_mappers { for source in mapper.source.clone() { - result.append(&mut self.handle_function_data_type_identifier(name.clone(), original.clone(), source)) + result.append(&mut self.handle_function_data_type_identifier( + name.clone(), + original.clone(), + source, + )) } - if !self.generic_key_in_target(mapper.target.clone(), generic_type.data_type_identifier.clone()) { + if !self.generic_key_in_target( + mapper.target.clone(), + generic_type.data_type_identifier.clone(), + ) { self.reporter.add_report(Diagnose::new( name.clone(), original.clone(), - GenericKeyNotInMappingTarget { key: mapper.target.clone(), target: generic_type.data_type_identifier.clone() } + GenericKeyNotInMappingTarget { + key: mapper.target.clone(), + target: generic_type.data_type_identifier.clone(), + }, )) } } - }, - Type::GenericKey(key) => { - result.push(key.clone()) - }, + } + Type::GenericKey(key) => result.push(key.clone()), } } @@ -585,8 +744,12 @@ impl Analyser { } fn generic_key_in_target(&mut self, key: String, target: String) -> bool { - let data_types: Vec = self.data_types.iter().map(|d| d.definition_data_type.clone()).collect(); - for data_type in data_types { + let data_types: Vec = self + .data_types + .iter() + .map(|d| d.definition_data_type.clone()) + .collect(); + for data_type in data_types { if target.to_lowercase() != data_type.identifier.to_lowercase() { continue; } @@ -597,7 +760,20 @@ impl Analyser { false } - pub fn report(&self) { - self.reporter.run_report() + pub fn report(&mut self, will_exit: bool) { + + for data_type in self.data_types.clone() { + self.analyse_data_type(data_type.clone()); + } + + for flow_type in self.flow_types.clone() { + self.analyse_flow_type(flow_type.clone()); + } + + for functions in self.functions.clone() { + self.analyse_runtime_function(functions.clone()); + } + + self.reporter.run_report(will_exit); } } diff --git a/cli/src/command/definition.rs b/cli/src/command/definition.rs index e827e21..edfe609 100644 --- a/cli/src/command/definition.rs +++ b/cli/src/command/definition.rs @@ -1,5 +1,6 @@ use code0_definition_reader::parser::Parser; use colored::Colorize; +use crate::formatter::{info, success}; pub fn search_definition(name: String, path: Option) { let dir_path = path.unwrap_or_else(|| "./definitions".to_string()); @@ -17,13 +18,7 @@ pub fn search_definition(name: String, path: Option) { fn search_and_display_definitions(search_name: &str, parser: &Parser) { let mut found_any = false; let mut total_matches = 0; - println!( - "{}", - format!("Searching for definitions matching: '{search_name}'") - .bright_yellow() - .bold() - ); - println!("{}", "─".repeat(60).dimmed()); + info(format!("Searching for '{}'", search_name)); for feature in &parser.features { // Search FlowTypes @@ -34,7 +29,7 @@ fn search_and_display_definitions(search_name: &str, parser: &Parser) { found_any = true; } - println!("\n{}", "FlowType".bright_cyan().bold()); + info(String::from("Found flow_type:\n")); match serde_json::to_string_pretty(flow_type) { Ok(json) => { let mut index = 0; @@ -42,8 +37,8 @@ fn search_and_display_definitions(search_name: &str, parser: &Parser) { index += 1; println!( "{} {}", - format!("{index}:").bright_blue(), - line.bright_green() + format!("{index}:"), + line.bright_cyan() ); } } @@ -60,7 +55,7 @@ fn search_and_display_definitions(search_name: &str, parser: &Parser) { found_any = true; } - println!("\n{}", "DataType".bright_cyan().bold()); + info(String::from("Found data_type:\n")); match serde_json::to_string_pretty(data_type) { Ok(json) => { let mut index = 0; @@ -68,8 +63,8 @@ fn search_and_display_definitions(search_name: &str, parser: &Parser) { index += 1; println!( "{} {}", - format!("{index}:").bright_blue(), - line.bright_green() + format!("{index}:"), + line.bright_cyan() ); } } @@ -86,7 +81,7 @@ fn search_and_display_definitions(search_name: &str, parser: &Parser) { found_any = true; } - println!("\n{}", "RuntimeFunction".bright_cyan().bold()); + info(String::from("Found runtime_function_definition:\n")); match serde_json::to_string_pretty(runtime_func) { Ok(json) => { let mut index = 0; @@ -94,8 +89,8 @@ fn search_and_display_definitions(search_name: &str, parser: &Parser) { index += 1; println!( "{} {}", - format!("{index}:").bright_blue(), - line.bright_green() + format!("{index}:"), + line.bright_cyan() ); } } @@ -106,17 +101,8 @@ fn search_and_display_definitions(search_name: &str, parser: &Parser) { } if !found_any { - println!( - "\n{}", - format!("No definitions found matching '{search_name}'") - .red() - .bold() - ); + println!("{}", format!("\n{}: {}", "error".red(), "Found no matching definition(s)")); } else { - println!("\n{}", "─".repeat(60).dimmed()); - println!( - "{}", - format!("Found {total_matches} matching definition(s)").bright_yellow() - ); + success(format!("Found {total_matches} matching definition(s)")) } } diff --git a/cli/src/command/download.rs b/cli/src/command/download.rs index 70b0f35..a3609c3 100644 --- a/cli/src/command/download.rs +++ b/cli/src/command/download.rs @@ -5,6 +5,7 @@ use serde::Deserialize; use std::fs; use std::fs::File; use zip::ZipArchive; +use crate::formatter::{error_without_trace, info, success}; #[derive(Deserialize, Debug)] struct Release { @@ -20,103 +21,35 @@ struct Asset { } pub async fn handle_download(tag: Option, features: Option>) { - println!( - "{}", - "╔══════════════════════════════════════════════════════════════════════════════╗" - .bright_cyan() - ); - println!( - "{} {} {}", - "║".bright_cyan(), - "DOWNLOADING DEFINITIONS".bright_white().bold().on_blue(), - "║".bright_cyan() - ); - println!( - "{}", - "╚══════════════════════════════════════════════════════════════════════════════╝" - .bright_cyan() - ); - let out_folder_path = "./definitions"; let zip_path = "./definitions.zip"; - // Check if definitions folder already exists - println!( - "\n{} Checking for existing definitions folder...", - "🔍".bright_blue() - ); - if let Ok(true) = fs::exists(out_folder_path) { - println!( - "{} {}", - "❌".red(), - format!("Definitions folder already exists at '{out_folder_path}'") - .red() - .bold() - ); - println!( - "{}", - " To prevent accidental deletion, please remove the existing folder manually." - .yellow() - ); - println!("{}", " Then run the download command again.".yellow()); - return; - } - println!( - "{} {}", - "✅".green(), - "No existing definitions folder found".green() - ); - // Download the definitions - println!("\n{} Starting download process...", "📥".bright_blue()); + info("Starting download process...".to_string()); let bytes = match download_definitions_as_bytes(tag).await { Some(bytes) => { - println!( - "{} {}", - "✅".green(), - format!("Successfully downloaded {} bytes", bytes.len()).green() - ); + success(format!("Successfully downloaded {} bytes", bytes.len())); bytes } None => { - println!("{} {}", "❌".red(), "Download failed".red().bold()); + error_without_trace(String::from("Download failed.")); return; } }; // Extract the zip file - println!("\n{} Extracting definitions...", "📦".bright_blue()); + info("Extracting definitions...".to_string()); convert_bytes_to_folder(bytes, zip_path).await; // Handle feature filtering if specified if let Some(selected_features) = features { - println!("\n{} Filtering features...", "🔧".bright_blue()); - println!( - "{}", - format!("Selected features: {}", selected_features.join(", ")).bright_cyan() - ); - + info(format!("Extracted features: {:?} ", selected_features)); filter_features(selected_features).await; } else { - println!( - "\n{} {}", - "ℹ️".bright_blue(), - "No feature filtering specified - keeping all features".bright_cyan() - ); + info("Extracted all features!".to_string()); } - println!("\n{}", "═".repeat(80).bright_cyan()); - println!( - "{} {}", - "🎉".bright_green(), - "Download completed successfully!".bright_green().bold() - ); - println!( - "{} {}", - "📁".bright_blue(), - format!("Definitions are now available in: {out_folder_path}").bright_cyan() - ); - println!("{}", "═".repeat(80).bright_cyan()); + success(format!("Download was successful. Definitions are now available in {out_folder_path}.")); } async fn download_definitions_as_bytes(tag: Option) -> Option { @@ -124,20 +57,15 @@ async fn download_definitions_as_bytes(tag: Option) -> Option { - println!("Selected the version: {}", t.bright_blue()); + info(format!("Selected the version: {}", t)); format!("https://api.github.com/repos/code0-tech/code0-definition/releases/tags/{t}") } None => { - println!("No version specified, using latest version"); + info("No version specified, using latest version".to_string()); String::from("https://api.github.com/repos/code0-tech/code0-definition/releases/latest") } }; - println!( - "{} Fetching latest release information...", - "🌐".bright_blue() - ); - let release_request = match client .get(url) .header(USER_AGENT, "code0-definition-cli") @@ -147,51 +75,23 @@ async fn download_definitions_as_bytes(tag: Option) -> Option { if response.status().is_success() { - println!( - "{} {}", - "✅".green(), - "Successfully connected to GitHub API".green() - ); response } else { - println!( - "{} {}", - "❌".red(), - format!( - "GitHub API request failed with status: {}", - response.status() - ) - .red() - ); return None; } } Err(e) => { - println!( - "{} {}", - "❌".red(), - format!("Failed to connect to GitHub API: {e}").red() - ); - return None; + panic!("Request failed: {}", e); } }; let release: Release = match release_request.json::().await { Ok(release) => { - println!( - "{} {}", - "✅".green(), - format!("Selected release: {}", release.tag_name).green() - ); + info(format!("Selected release: {}", release.tag_name)); release } Err(e) => { - println!( - "{} {}", - "❌".red(), - format!("Failed to parse release information: {e}").red() - ); - return None; + panic!("Request failed: {}", e); } }; @@ -201,29 +101,13 @@ async fn download_definitions_as_bytes(tag: Option) -> Option { - println!( - "{} {}", - "✅".green(), - format!( - "Found definitions.zip ({:.2} MB)", - asset.size as f64 / 1024.0 / 1024.0 - ) - .green() - ); asset } None => { - println!( - "{} {}", - "❌".red(), - "definitions.zip not found in latest release".red() - ); - return None; + panic!("Definition folder is not called `definitions.zip` and was not inside the asset folder of the GitHub release!"); } }; - println!("{} Downloading definitions.zip...", "⬇️".bright_blue()); - match client .get(&asset.browser_download_url) .header(USER_AGENT, "code0-definition-cli") diff --git a/cli/src/command/feature.rs b/cli/src/command/feature.rs index fe47324..efef6e0 100644 --- a/cli/src/command/feature.rs +++ b/cli/src/command/feature.rs @@ -1,5 +1,7 @@ use crate::table::{feature_table, summary_table}; -use code0_definition_reader::parser::Parser; +use code0_definition_reader::parser::{Feature, Parser}; +use crate::analyser::Analyser; +use crate::formatter::{success, success_table}; pub fn search_feature(name: Option, path: Option) { let dir_path = path.unwrap_or_else(|| "./definitions".to_string()); @@ -11,19 +13,46 @@ pub fn search_feature(name: Option, path: Option) { } }; - if let Some(feature_name) = name { - let mut features_to_report = Vec::new(); - for feature in &parser.features { - if feature.name == feature_name { - feature_table(feature); - features_to_report.push(feature.clone()); - } + let mut analyser = Analyser::new(dir_path.as_str()); + analyser.report(true); + + let features = match name { + None => { + parser.features.clone() } - summary_table(&features_to_report); - } else { - for feature in &parser.features { - feature_table(feature); + Some(feature_name) => { + parser.features.iter().filter(|f| f.name.to_lowercase() == feature_name.to_lowercase()).map(|f| f.clone()).collect::>() + } + }; + + + for feature in &features { + let (flow_type_rows, data_type_rows, function_rows) = feature_table(feature); + + if !flow_type_rows.is_empty() { + success(format!("The feature (`{}`) detected {} flow_types.", feature.name, flow_type_rows.len())); + success_table(flow_type_rows) + } + + if !data_type_rows.is_empty() { + success(format!("The feature (`{}`) detected {} data_types.", feature.name, data_type_rows.len())); + success_table(data_type_rows) + } + + if !function_rows.is_empty() { + success(format!("The feature (`{}`) detected {} runtime_function_definition.", feature.name, function_rows.len())); + success_table(function_rows) } - summary_table(&parser.features); } + + let summary = summary_table(&features); + success_table(summary); + + success( + format!("Defined a total of {} Features with {} FlowTypes {} DataTypes and {} Functions!", + parser.features.iter().len(), + parser.features.iter().map(|f| f.flow_types.len()).sum::(), + parser.features.iter().map(|f| f.data_types.len()).sum::(), + parser.features.iter().map(|f| f.runtime_functions.len()).sum::() + )) } diff --git a/cli/src/command/report.rs b/cli/src/command/report.rs index 9f6a534..873aa38 100644 --- a/cli/src/command/report.rs +++ b/cli/src/command/report.rs @@ -1,6 +1,7 @@ -use crate::table::{error_table, summary_table}; +use crate::analyser::Analyser; +use crate::table::{summary_table}; use code0_definition_reader::parser::Parser; -use crate::analyser::{Analyser}; +use crate::formatter::{success, success_table}; pub fn report_errors(path: Option) { let dir_path = path.unwrap_or_else(|| "./definitions".to_string()); @@ -12,22 +13,17 @@ pub fn report_errors(path: Option) { } }; - let mut analyser = Analyser::new(dir_path.as_str()); + let mut analyser = Analyser::new(dir_path.as_str()); + analyser.report(true); - for data_type in analyser.data_types.clone() { - analyser.analyse_data_type(data_type.clone()); - } + let rows = summary_table(&parser.features); + success_table(rows); - for flow_type in analyser.flow_types.clone() { - analyser.analyse_flow_type(flow_type.clone()); - } - - for functions in analyser.functions.clone() { - analyser.analyse_runtime_function(functions.clone()); - } - - analyser.report(); - - error_table(&parser.features); - summary_table(&parser.features); + success( + format!("Defined a total of {} Features with {} FlowTypes {} DataTypes and {} Functions!", + parser.features.iter().len(), + parser.features.iter().map(|f| f.flow_types.len()).sum::(), + parser.features.iter().map(|f| f.data_types.len()).sum::(), + parser.features.iter().map(|f| f.runtime_functions.len()).sum::() + )) } diff --git a/cli/src/command/watch.rs b/cli/src/command/watch.rs index 49d6491..abdf30d 100644 --- a/cli/src/command/watch.rs +++ b/cli/src/command/watch.rs @@ -1,29 +1,18 @@ -use crate::table::error_table; -use code0_definition_reader::parser::Parser; -use colored::Colorize; use notify::{Event, EventKind, RecursiveMode, Watcher, recommended_watcher}; use std::sync::mpsc::channel; +use std::time::{Duration, Instant}; +use notify::event::ModifyKind; +use crate::analyser::Analyser; +use crate::formatter::{default, info}; pub async fn watch_for_changes(path: Option) { let dir_path = path.unwrap_or_else(|| "./definitions".to_string()); - println!( - "{}", - format!("Watching directory: {dir_path}") - .bright_yellow() - .bold() - ); - println!("{}", "Press Ctrl+C to stop watching...".dimmed()); + info(format!("Watching directory: {dir_path}")); + info(String::from("Press Ctrl+C to stop watching...")); { - let parser = match Parser::from_path(dir_path.as_str()) { - Some(reader) => reader, - None => { - panic!("Error reading definitions"); - } - }; - - error_table(&parser.features); + Analyser::new(dir_path.as_str()).report(false); } // Set up file watcher @@ -33,38 +22,34 @@ pub async fn watch_for_changes(path: Option) { .watch(std::path::Path::new(&dir_path), RecursiveMode::Recursive) .unwrap(); - loop { - match rx.recv() { - Ok(event) => match event { - Ok(Event { - kind: EventKind::Create(_), - .. - }) - | Ok(Event { - kind: EventKind::Modify(_), - .. - }) - | Ok(Event { - kind: EventKind::Remove(_), - .. - }) => { - println!( - "\n{}", - "Change detected! Regenerating report...".bright_yellow() - ); - - let parser = match Parser::from_path(dir_path.as_str()) { - Some(reader) => reader, - None => { - panic!("Error reading definitions"); - } - }; + let mut last_run = Instant::now(); - error_table(&parser.features); + loop { + if let Ok(Ok(event)) = rx.recv() { + match event.kind { + EventKind::Modify(modify) => { + match modify { + ModifyKind::Data(_) => { + if last_run.elapsed() > Duration::from_millis(500) { + default(String::from("\n\n\n--------------------------------------------------------------------------\n\n")); + info(String::from("Change detected! Regenerating report...")); + Analyser::new(dir_path.as_str()).report(false); + last_run = Instant::now(); + } + } + _ => {} + } + } + EventKind::Remove(_) => { + if last_run.elapsed() > Duration::from_millis(500) { + default(String::from("\n\n\n--------------------------------------------------------------------------\n\n")); + info(String::from("Change detected! Regenerating report...")); + Analyser::new(dir_path.as_str()).report(false); + last_run = Instant::now(); + } } _ => {} - }, - Err(e) => println!("Watch error: {e:?}"), + } } } } diff --git a/cli/src/formatter.rs b/cli/src/formatter.rs index 474d2df..f194447 100644 --- a/cli/src/formatter.rs +++ b/cli/src/formatter.rs @@ -18,23 +18,31 @@ pub fn success(string: String) { println!("\n{}: {}", "success".green(), string); } -pub fn success_highlight(highlight: String,string: String) { +pub fn info(string: String) { + println!("\n{}: {}", "info".blue(), string); +} + +pub fn success_highlight(highlight: String, string: String) { println!("{} {}", highlight.green(), string); } pub fn success_table(iter: I) - where +where I: IntoIterator, T: Tabled, { - println!("{}", print_table(iter).green()); + println!("\n{}", print_table(iter).green()); } pub fn error(string: String, path: &String) -> String { format!("\n{}: {} {}", "error".red(), string, print_path(path)) } -pub fn error_highlight(highlight: String,string: String) { +pub fn error_without_trace(string: String) -> String { + format!("\n{}: {}", "error".red(), string) +} + +pub fn error_highlight(highlight: String, string: String) { println!("{} {}", highlight.red(), string); } @@ -50,11 +58,10 @@ pub fn warning(string: String, path: &String) -> String { format!("\n{}: {} {}", "warning".yellow(), string, print_path(&path)) } -pub fn warning_highlight(highlight: String,string: String) { +pub fn warning_highlight(highlight: String, string: String) { println!("{} {}", highlight.yellow(), string); } - pub fn warning_table(iter: I) where I: IntoIterator, @@ -73,4 +80,4 @@ where fn print_path(path: &String) -> String { format!("\n --> {}", &path.underline()).blue().to_string() -} \ No newline at end of file +} diff --git a/cli/src/main.rs b/cli/src/main.rs index 7df8b7b..787d4ae 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -1,9 +1,9 @@ use clap::{Parser as ClapParser, Subcommand}; -mod command; -mod table; mod analyser; +mod command; mod formatter; +mod table; /// Top-level CLI for 'definition' #[derive(ClapParser)] diff --git a/cli/src/table.rs b/cli/src/table.rs index 0852b51..0505702 100644 --- a/cli/src/table.rs +++ b/cli/src/table.rs @@ -5,7 +5,7 @@ use tabled::{Table, Tabled, settings::Style}; use tucana::shared::{DefinitionDataType, FlowType, RuntimeFunctionDefinition}; #[derive(Tabled)] -struct FlowTypeRow { +pub struct FlowTypeRow { #[tabled(rename = "#")] index: usize, #[tabled(rename = "Identifier")] @@ -13,7 +13,7 @@ struct FlowTypeRow { } #[derive(Tabled)] -struct DataTypeRow { +pub struct DataTypeRow { #[tabled(rename = "#")] index: usize, #[tabled(rename = "Identifier")] @@ -21,7 +21,7 @@ struct DataTypeRow { } #[derive(Tabled)] -struct RuntimeFunctionRow { +pub struct RuntimeFunctionRow { #[tabled(rename = "#")] index: usize, #[tabled(rename = "Runtime Name")] @@ -29,7 +29,7 @@ struct RuntimeFunctionRow { } #[derive(Tabled)] -struct ErrorRow { +pub struct ErrorRow { #[tabled(rename = "#")] index: usize, #[tabled(rename = "Type")] @@ -41,13 +41,9 @@ struct ErrorRow { } #[derive(Tabled)] -struct FeatureSummaryRow { +pub struct FeatureSummaryRow { #[tabled(rename = "Feature")] feature_name: String, - #[tabled(rename = "Status")] - status: String, - #[tabled(rename = "Errors")] - error_count: usize, #[tabled(rename = "Flow Types")] flow_types: usize, #[tabled(rename = "Data Types")] @@ -57,7 +53,7 @@ struct FeatureSummaryRow { } #[derive(Tabled)] -struct GeneralErrorRow { +pub struct GeneralErrorRow { #[tabled(rename = "#")] index: usize, #[tabled(rename = "Feature")] @@ -70,291 +66,53 @@ struct GeneralErrorRow { error: String, } -pub fn feature_table(feature: &Feature) { - // Header - println!( - "\n{}", - "╔══════════════════════════════════════════════════════════════════════════════╗" - .bright_cyan() - ); - println!( - "{} {} {}", - "║".bright_cyan(), - format!("FEATURE REPORT: {}", feature.name) - .bright_white() - .bold() - .on_blue(), - "║".bright_cyan() - ); - println!( - "{}", - "╚══════════════════════════════════════════════════════════════════════════════╝" - .bright_cyan() - ); +pub fn feature_table(feature: &Feature) -> (Vec, Vec, Vec) { - // Flow Types Section - println!( - "\n{}", - format!("FLOW TYPES ({} defined)", feature.flow_types.len()) - .bright_blue() - .bold() - ); - if !feature.flow_types.is_empty() { - let flow_type_rows: Vec = feature - .flow_types - .iter() - .enumerate() - .map(|(i, FlowType { identifier, .. })| FlowTypeRow { - index: i + 1, - identifier: identifier.clone(), - }) - .collect(); + let flow_type_rows: Vec = feature + .flow_types + .iter() + .enumerate() + .map(|(i, FlowType { identifier, .. })| FlowTypeRow { + index: i + 1, + identifier: identifier.clone(), + }) + .collect(); - let table = Table::new(flow_type_rows) - .with(Style::rounded()) - .to_string(); - println!("{}", table.bright_green()); - } else { - println!("{}", " No flow types defined.".dimmed()); - } + let data_type_rows: Vec = feature + .data_types + .iter() + .enumerate() + .map(|(i, DefinitionDataType { identifier, .. })| DataTypeRow { + index: i + 1, + identifier: identifier.clone(), + }) + .collect(); - // Data Types Section - println!( - "\n{}", - format!("DATA TYPES ({} defined)", feature.data_types.len()) - .bright_blue() - .bold() - ); - if !feature.data_types.is_empty() { - let data_type_rows: Vec = feature - .data_types - .iter() - .enumerate() - .map(|(i, DefinitionDataType { identifier, .. })| DataTypeRow { + let runtime_function_rows: Vec = feature + .runtime_functions + .iter() + .enumerate() + .map( + |(i, RuntimeFunctionDefinition { runtime_name, .. })| RuntimeFunctionRow { index: i + 1, - identifier: identifier.clone(), - }) - .collect(); - - let table = Table::new(data_type_rows) - .with(Style::rounded()) - .to_string(); - println!("{}", table.bright_green()); - } else { - println!("{}", " No data types defined.".dimmed()); - } - - // Runtime Functions Section - println!( - "\n{}", - format!( - "RUNTIME FUNCTIONS ({} defined)", - feature.runtime_functions.len() - ) - .bright_blue() - .bold() - ); - if !feature.runtime_functions.is_empty() { - let runtime_function_rows: Vec = feature - .runtime_functions - .iter() - .enumerate() - .map( - |(i, RuntimeFunctionDefinition { runtime_name, .. })| RuntimeFunctionRow { - index: i + 1, - runtime_name: runtime_name.clone(), - }, - ) - .collect(); - - let table = Table::new(runtime_function_rows) - .with(Style::rounded()) - .to_string(); - println!("{}", table.bright_green()); - } else { - println!("{}", " No runtime functions defined.".dimmed()); - } - - // Errors Section - println!( - "\n{}", - format!("DEFINITION ERRORS ({} found)", feature.errors.len()) - .bright_red() - .bold() - ); - if !feature.errors.is_empty() { - let error_rows: Vec = feature - .errors - .iter() - .enumerate() - .map( - |( - i, - DefinitionError { - definition, - definition_type, - error, - }, - )| ErrorRow { - index: i + 1, - definition_type: format!("{definition_type}"), - definition: definition.clone(), - error: error.clone(), - }, - ) - .collect(); - - let table = Table::new(error_rows).with(Style::rounded()).to_string(); - println!("{}", table.bright_red()); - } else { - println!("{}", " No errors found!".bright_green()); - } - - println!("\n{}", "═".repeat(80).bright_cyan()); -} - -pub fn error_table(features: &Vec) { - println!( - "\n{}", - "╔══════════════════════════════════════════════════════════════════════════════╗" - .bright_cyan() - ); - println!( - "{} {} {}", - "║".bright_cyan(), - "ERRORS".bright_white().bold().on_blue(), - "║".bright_cyan() - ); - println!( - "{}", - "╚══════════════════════════════════════════════════════════════════════════════╝" - .bright_cyan() - ); - - // Collect all errors from all features - let mut all_errors = Vec::new(); - for feature in features { - for error in &feature.errors { - all_errors.push((feature.name.clone(), error)); - } - } - - // Display all errors table - println!( - "\n{}", - format!( - "ALL DEFINITION ERRORS ({} found across {} features)", - all_errors.len(), - features.len() + runtime_name: runtime_name.clone(), + }, ) - .bright_red() - .bold() - ); - - if !all_errors.is_empty() { - let error_rows: Vec = all_errors - .iter() - .enumerate() - .map(|(i, (feature_name, error))| GeneralErrorRow { - index: i + 1, - feature_name: feature_name.clone(), - definition_type: format!("{}", error.definition_type), - definition: error.definition.clone(), - error: error.error.clone(), - }) - .collect(); - - let table = Table::new(error_rows) - .with(Style::rounded()) - .to_string() - .bright_red(); + .collect(); - println!("{table}"); - } else { - println!( - "{}", - " No errors found across all features!".bright_green() - ); - } + (flow_type_rows,data_type_rows,runtime_function_rows) } -pub fn summary_table(features: &[Feature]) { - println!( - "\n{}", - "╔═══════════════════════════════ CONCLUSION ═══════════════════════════════╗" - .bright_cyan() - ); - - // Create summary table - let summary_rows: Vec = features +pub fn summary_table(features: &Vec) -> Vec { + features .iter() .map(|feature| { - let is_successful = feature.errors.is_empty(); - let status = if is_successful { - "SUCCESS".to_string() - } else { - "FAILED".to_string() - }; - FeatureSummaryRow { feature_name: feature.name.clone(), - status, - error_count: feature.errors.len(), flow_types: feature.flow_types.len(), data_types: feature.data_types.len(), runtime_functions: feature.runtime_functions.len(), } }) - .collect(); - - if !summary_rows.is_empty() { - let table = Table::new(summary_rows).with(Style::rounded()).to_string(); - - println!("{}", table.bright_blue()); - } - - // Overall success assessment - let total_errors: usize = features.iter().map(|f| f.errors.len()).sum(); - let total_features = features.len(); - let successful_features = features.iter().filter(|f| f.errors.is_empty()).count(); - - if total_errors == 0 { - println!( - "{}", - format!( - "[SUCCESSFUL]! All {total_features} feature(s) processed without errors.", - ) - .bright_green() - .bold() - ); - } else { - println!( - "{}", - format!( - "[FAILED]! {total_errors} error(s) found across {total_features} feature(s)." - ) - .bright_red() - .bold() - ); - println!( - " {} {} successful, {} {} failed", - successful_features.to_string().bright_green(), - if successful_features == 1 { - "feature" - } else { - "features" - }, - (total_features - successful_features) - .to_string() - .bright_red(), - if (total_features - successful_features) == 1 { - "feature" - } else { - "features" - } - ); - panic!("Process failed due to errors"); - } - - println!("\n{}", "═".repeat(80).bright_cyan()); + .collect() } diff --git a/reader/rust/src/reader.rs b/reader/rust/src/reader.rs index 0b98faa..1c46556 100644 --- a/reader/rust/src/reader.rs +++ b/reader/rust/src/reader.rs @@ -44,7 +44,6 @@ impl Meta { where P: AsRef, { - let mut current_line = 0; let mut current_starting_line = 0; let mut inside_code = false; @@ -71,13 +70,11 @@ impl Meta { if !inside_code { let code_snippet = current_block.join(" "); - code_snippets.push( - ParsableDefinition { - path: path.clone(), - starting_line: current_starting_line, - definition_string: code_snippet, - } - ); + code_snippets.push(ParsableDefinition { + path: path.clone(), + starting_line: current_starting_line, + definition_string: code_snippet, + }); current_block.clear(); } } From 7f40fd06e37a94a825198b04c6bfc26fef24c6e6 Mon Sep 17 00:00:00 2001 From: Raphael Date: Mon, 18 Aug 2025 11:28:03 +0200 Subject: [PATCH 11/20] fix: added missing generic key 'R' to std::array::min --- definitions/standard/runtime_definition/array/array.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/definitions/standard/runtime_definition/array/array.md b/definitions/standard/runtime_definition/array/array.md index f87594c..994dc40 100644 --- a/definitions/standard/runtime_definition/array/array.md +++ b/definitions/standard/runtime_definition/array/array.md @@ -2334,7 +2334,7 @@ Returns the smallest number in the array ], "deprecation_message": [], "throws_error": false, - "generic_keys": [] + "generic_keys": ["R"] } ``` From 80493884ed708330ca0d22901115e0b85c6ee6dc Mon Sep 17 00:00:00 2001 From: raphael-goetz Date: Mon, 18 Aug 2025 14:14:15 +0200 Subject: [PATCH 12/20] ref: used formating for download command --- cli/src/command/download.rs | 186 +++++++----------------------------- cli/src/formatter.rs | 4 +- 2 files changed, 38 insertions(+), 152 deletions(-) diff --git a/cli/src/command/download.rs b/cli/src/command/download.rs index a3609c3..89ca345 100644 --- a/cli/src/command/download.rs +++ b/cli/src/command/download.rs @@ -4,6 +4,7 @@ use reqwest::header::{ACCEPT, USER_AGENT}; use serde::Deserialize; use std::fs; use std::fs::File; +use std::path::Path; use zip::ZipArchive; use crate::formatter::{error_without_trace, info, success}; @@ -28,7 +29,6 @@ pub async fn handle_download(tag: Option, features: Option>) info("Starting download process...".to_string()); let bytes = match download_definitions_as_bytes(tag).await { Some(bytes) => { - success(format!("Successfully downloaded {} bytes", bytes.len())); bytes } None => { @@ -38,7 +38,6 @@ pub async fn handle_download(tag: Option, features: Option>) }; // Extract the zip file - info("Extracting definitions...".to_string()); convert_bytes_to_folder(bytes, zip_path).await; // Handle feature filtering if specified @@ -49,7 +48,8 @@ pub async fn handle_download(tag: Option, features: Option>) info("Extracted all features!".to_string()); } - success(format!("Download was successful. Definitions are now available in {out_folder_path}.")); + let path = Path::new(out_folder_path); + success(format!("Download was successful. Definitions are now available: {}.", path.display())); } async fn download_definitions_as_bytes(tag: Option) -> Option { @@ -118,105 +118,55 @@ async fn download_definitions_as_bytes(tag: Option) -> Option { - println!( - "{} {}", - "✅".green(), - "Download completed successfully".green() - ); + info("Download completed successfully".to_string()); Some(bytes) } Err(e) => { - println!( - "{} {}", - "❌".red(), - format!("Failed to read download data: {e}").red() - ); + error_without_trace(format!("Failed to read download data: {e}")); None } } } else { - println!( - "{} {}", - "❌".red(), - format!("Download failed with status: {}", response.status()).red() - ); + error_without_trace(format!("Download failed with status: {}", response.status())); None } } Err(e) => { - println!( - "{} {}", - "❌".red(), - format!("Download request failed: {e}").red() - ); - None + panic!("Download request failed: {e}"); } } } async fn convert_bytes_to_folder(bytes: Bytes, zip_path: &str) { - println!("{} Writing zip file to disk...", "💾".bright_blue()); if let Err(e) = fs::write(zip_path, &bytes) { - println!( - "{} {}", - "❌".red(), - format!("Failed to write zip file: {e}").red() - ); - return; + panic!("Failed to write zip file: {e}") } - println!( - "{} {}", - "✅".green(), - "Zip file written successfully".green() - ); - println!("{} Opening zip archive...", "📂".bright_blue()); let zip_file = match File::open(zip_path) { Ok(file) => file, Err(e) => { - println!( - "{} {}", - "❌".red(), - format!("Failed to open zip file: {e}").red() - ); - return; + panic!("Failed to open zip file: {e}"); } }; let mut archive = match ZipArchive::new(zip_file) { Ok(archive) => { - println!( - "{} {}", - "✅".green(), - format!("Successfully opened archive with {} files", archive.len()).green() - ); archive } Err(e) => { - println!( - "{} {}", - "❌".red(), - format!("Failed to read zip archive: {e}").red() - ); - return; + panic!("Failed to read zip archive: {e}"); } }; - println!("{} Extracting files...", "📤".bright_blue()); - let mut extracted_count = 0; + info("Extracting files...".to_string()); let total_files = archive.len(); for i in 0..archive.len() { let mut file = match archive.by_index(i) { Ok(file) => file, Err(e) => { - println!( - "{} {}", - "⚠️".yellow(), - format!("Warning: Failed to read file at index {i}: {e}").yellow() - ); - continue; + panic!("Failed to read file at index {i}: {e}"); } }; @@ -226,33 +176,22 @@ async fn convert_bytes_to_folder(bytes: Bytes, zip_path: &str) { }; if file.name().ends_with('/') { - if let Err(e) = std::fs::create_dir_all(&out_path) { - println!( - "{} {}", - "⚠️".yellow(), - format!( - "Warning: Failed to create directory {}: {}", - out_path.display(), - e - ) - .yellow() + if let Err(e) = fs::create_dir_all(&out_path) { + panic!( + "Failed to create directory {}: {}", + out_path.display(), + e ); } } else { if let Some(p) = out_path.parent() { if !p.exists() { - if let Err(e) = std::fs::create_dir_all(p) { - println!( - "{} {}", - "⚠️".yellow(), - format!( - "Warning: Failed to create parent directory {}: {}", - p.display(), - e - ) - .yellow() + if let Err(e) = fs::create_dir_all(p) { + panic!( + "Warning: Failed to create parent directory {}: {}", + p.display(), + e ); - continue; } } } @@ -260,47 +199,26 @@ async fn convert_bytes_to_folder(bytes: Bytes, zip_path: &str) { match File::create(&out_path) { Ok(mut outfile) => { if let Err(e) = std::io::copy(&mut file, &mut outfile) { - println!( - "{} {}", - "⚠️".yellow(), - format!("Warning: Failed to extract {}: {}", out_path.display(), e) - .yellow() - ); - } else { - extracted_count += 1; + panic!("Warning: Failed to extract {}: {}", out_path.display(), e); } } Err(e) => { - println!( - "{} {}", - "⚠️".yellow(), - format!( - "Warning: Failed to create file {}: {}", - out_path.display(), - e - ) - .yellow() + panic!( + "Failed to create file {}: {}", + out_path.display(), + e ); } } } } - println!( - "{} {}", - "✅".green(), - format!("Successfully extracted {extracted_count}/{total_files} files").green() - ); + info(format!("Successfully extracted {total_files} files")); + info("Cleaning up temporary files...".to_string()); - // Clean up zip file - println!("{} Cleaning up temporary files...", "🧹".bright_blue()); match fs::remove_file(zip_path) { - Ok(_) => println!("{} {}", "✅".green(), "Temporary zip file removed".green()), - Err(e) => println!( - "{} {}", - "⚠️".yellow(), - format!("Warning: Failed to remove temporary zip file: {e}").yellow() - ), + Ok(_) => info("Temporary zip file removed".to_string()), + Err(e) => error_without_trace(format!("Warning: Failed to remove temporary zip file: {e}")) } } @@ -309,62 +227,30 @@ async fn filter_features(selected_features: Vec) { match fs::read_dir(definitions_path) { Ok(entries) => { - let mut removed_count = 0; - let mut kept_count = 0; for entry in entries { let directory = match entry { Ok(directory) => directory, Err(e) => { - println!( - "{} {}", - "⚠️".yellow(), - format!("Warning: Failed to read directory entry: {e}").yellow() - ); - continue; + panic!("{}", format!("Warning: Failed to read directory entry: {e}")); } }; let name = directory.file_name().to_str().unwrap_or("").to_string(); if !selected_features.contains(&name) { - println!(" {} Removing feature: {}", "🗑️".red(), name.red()); match fs::remove_dir_all(directory.path()) { - Ok(_) => { - println!(" {} Successfully removed", "✅".green()); - removed_count += 1; - } + Ok(_) => {} Err(e) => { - println!( - " {} Failed to remove: {}", - "❌".red(), - e.to_string().red() - ); + error_without_trace(format!("Warning: Failed to remove directory: {e}")) } } - } else { - println!(" {} Keeping feature: {}", "📁".green(), name.green()); - kept_count += 1; } } - - println!("\n{} Feature filtering completed:", "📊".bright_blue()); - println!( - " {} Features kept: {}", - "✅".green(), - kept_count.to_string().green().bold() - ); - println!( - " {} Features removed: {}", - "🗑️".red(), - removed_count.to_string().red().bold() - ); } Err(e) => { - println!( - "{} {}", - "❌".red(), - format!("Failed to read definitions directory: {e}").red() + error_without_trace( + format!("Failed to read definitions directory: {e}") ); } } diff --git a/cli/src/formatter.rs b/cli/src/formatter.rs index f194447..e07fe53 100644 --- a/cli/src/formatter.rs +++ b/cli/src/formatter.rs @@ -38,8 +38,8 @@ pub fn error(string: String, path: &String) -> String { format!("\n{}: {} {}", "error".red(), string, print_path(path)) } -pub fn error_without_trace(string: String) -> String { - format!("\n{}: {}", "error".red(), string) +pub fn error_without_trace(string: String) { + println!("\n{}: {}", "error".red(), string) } pub fn error_highlight(highlight: String, string: String) { From 4721541a3f7352a36f93c3455d5a1e768d5367de Mon Sep 17 00:00:00 2001 From: raphael-goetz Date: Mon, 18 Aug 2025 14:50:20 +0200 Subject: [PATCH 13/20] feat: rust reader now only checks json files --- cli/src/analyser/diagnostics.rs | 10 +-- cli/src/analyser/mod.rs | 152 +++++++++++++++----------------- reader/rust/src/parser.rs | 56 ++++++------ reader/rust/src/reader.rs | 68 ++++---------- 4 files changed, 122 insertions(+), 164 deletions(-) diff --git a/cli/src/analyser/diagnostics.rs b/cli/src/analyser/diagnostics.rs index 12b2dc9..d8e010a 100644 --- a/cli/src/analyser/diagnostics.rs +++ b/cli/src/analyser/diagnostics.rs @@ -1,8 +1,8 @@ use crate::formatter::{error, warning}; -use code0_definition_reader::reader::ParsableDefinition; use std::cmp::PartialEq; use std::path::Path; use std::process::exit; +use code0_definition_reader::reader::Meta; #[derive(Default)] pub struct Reporter { @@ -84,7 +84,7 @@ pub enum Severity { pub struct Diagnose { kind: DiagnosticKind, definition_name: String, - definition: ParsableDefinition, + definition: Meta, } pub enum DiagnosticKind { @@ -127,7 +127,7 @@ impl DiagnosticKind { impl Diagnose { pub fn new( definition_name: String, - definition: ParsableDefinition, + definition: Meta, kind: DiagnosticKind, ) -> Self { Self { @@ -140,8 +140,8 @@ impl Diagnose { pub fn print(&self) -> String { let path = format!( "{}:{}:{}", - Path::new(&self.definition.path.clone().unwrap_or_default()).display(), - &self.definition.starting_line, + Path::new(&self.definition.path.clone()).display(), + 1, 1 ); diff --git a/cli/src/analyser/mod.rs b/cli/src/analyser/mod.rs index 12d2b01..9c88d8c 100644 --- a/cli/src/analyser/mod.rs +++ b/cli/src/analyser/mod.rs @@ -7,28 +7,28 @@ use crate::analyser::diagnostics::DiagnosticKind::{ }; use crate::analyser::diagnostics::{Diagnose, DiagnosticKind, Reporter}; use code0_definition_reader::parser::Parser; -use code0_definition_reader::reader::{MetaType, ParsableDefinition, Reader}; +use code0_definition_reader::reader::{Meta, MetaType, Reader}; use tucana::shared::data_type_identifier::Type; use tucana::shared::definition_data_type_rule::Config; use tucana::shared::{DataTypeIdentifier, DefinitionDataType, FlowType, RuntimeFunctionDefinition}; #[derive(Clone)] pub struct AnalysableDataType { - pub original_definition: ParsableDefinition, + pub original_definition: Meta, pub definition_data_type: DefinitionDataType, pub id: i16, } #[derive(Clone)] pub struct AnalysableFlowType { - pub original_definition: ParsableDefinition, + pub original_definition: Meta, pub flow_type: FlowType, pub id: i16, } #[derive(Clone)] pub struct AnalysableFunction { - pub original_definition: ParsableDefinition, + pub original_definition: Meta, pub function: RuntimeFunctionDefinition, pub id: i16, } @@ -55,89 +55,83 @@ impl Analyser { let mut collected_flow_types: Vec = vec![]; let mut collected_functions: Vec = vec![]; - for features in reader.meta { - match features.r#type { + for definition in reader.meta { + match definition.r#type { MetaType::FlowType => { - for p_flow_type in &features.data { - current_index += 1; - match serde_json::from_str::( - p_flow_type.definition_string.as_str(), - ) { - Ok(flow_type) => collected_flow_types.push(AnalysableFlowType { - original_definition: p_flow_type.clone(), - flow_type, - id: current_index, - }), - Err(err) => { - let name = Parser::extract_identifier( - p_flow_type.definition_string.as_str(), - MetaType::FlowType, - ); - let diagnose = Diagnose::new( - name, - p_flow_type.clone(), - DiagnosticKind::DeserializationError { - description: err.to_string(), - }, - ); - reporter.add_report(diagnose); - } + current_index += 1; + match serde_json::from_str::( + definition.definition_string.as_str(), + ) { + Ok(flow_type) => collected_flow_types.push(AnalysableFlowType { + original_definition: definition.clone(), + flow_type, + id: current_index, + }), + Err(err) => { + let name = Parser::extract_identifier( + definition.definition_string.as_str(), + MetaType::FlowType, + ); + let diagnose = Diagnose::new( + name, + definition.clone(), + DiagnosticKind::DeserializationError { + description: err.to_string(), + }, + ); + reporter.add_report(diagnose); } } } MetaType::DataType => { - for p_data_type in &features.data { - current_index += 1; - match serde_json::from_str::( - p_data_type.definition_string.as_str(), - ) { - Ok(data_type) => collected_data_types.push(AnalysableDataType { - original_definition: p_data_type.clone(), - definition_data_type: data_type, - id: current_index, - }), - Err(err) => { - let name = Parser::extract_identifier( - p_data_type.definition_string.as_str(), - MetaType::DataType, - ); - let diagnose = Diagnose::new( - name, - p_data_type.clone(), - DiagnosticKind::DeserializationError { - description: err.to_string(), - }, - ); - reporter.add_report(diagnose); - } + current_index += 1; + match serde_json::from_str::( + definition.definition_string.as_str(), + ) { + Ok(data_type) => collected_data_types.push(AnalysableDataType { + original_definition: definition.clone(), + definition_data_type: data_type, + id: current_index, + }), + Err(err) => { + let name = Parser::extract_identifier( + definition.definition_string.as_str(), + MetaType::DataType, + ); + let diagnose = Diagnose::new( + name, + definition.clone(), + DiagnosticKind::DeserializationError { + description: err.to_string(), + }, + ); + reporter.add_report(diagnose); } } } MetaType::RuntimeFunction => { - for p_function in &features.data { - current_index += 1; - match serde_json::from_str::( - p_function.definition_string.as_str(), - ) { - Ok(function) => collected_functions.push(AnalysableFunction { - original_definition: p_function.clone(), - function, - id: current_index, - }), - Err(err) => { - let name = Parser::extract_identifier( - p_function.definition_string.as_str(), - MetaType::RuntimeFunction, - ); - let diagnose = Diagnose::new( - name, - p_function.clone(), - DiagnosticKind::DeserializationError { - description: err.to_string(), - }, - ); - reporter.add_report(diagnose); - } + current_index += 1; + match serde_json::from_str::( + definition.definition_string.as_str(), + ) { + Ok(function) => collected_functions.push(AnalysableFunction { + original_definition: definition.clone(), + function, + id: current_index, + }), + Err(err) => { + let name = Parser::extract_identifier( + definition.definition_string.as_str(), + MetaType::RuntimeFunction, + ); + let diagnose = Diagnose::new( + name, + definition.clone(), + DiagnosticKind::DeserializationError { + description: err.to_string(), + }, + ); + reporter.add_report(diagnose); } } } @@ -674,7 +668,7 @@ impl Analyser { fn handle_function_data_type_identifier( &mut self, name: String, - original: ParsableDefinition, + original: Meta, identifier: DataTypeIdentifier, ) -> Vec { let mut result: Vec = vec![]; diff --git a/reader/rust/src/parser.rs b/reader/rust/src/parser.rs index 29b1a79..ad5d65b 100644 --- a/reader/rust/src/parser.rs +++ b/reader/rust/src/parser.rs @@ -88,39 +88,37 @@ impl Parser { } fn append_meta(feature: &mut Feature, meta: &crate::reader::Meta) { - for definition in &meta.data { - let definition = definition.definition_string.as_str(); - match meta.r#type { - MetaType::DataType => { - match serde_json::from_str::(definition) { - Ok(data_type) => feature.data_types.push(data_type), - Err(err) => feature.errors.push(DefinitionError { - definition: Parser::extract_identifier(definition, MetaType::DataType), - definition_type: MetaType::DataType, - error: err.to_string(), - }), - } + let definition = meta.definition_string.as_str(); + match meta.r#type { + MetaType::DataType => { + match serde_json::from_str::(definition) { + Ok(data_type) => feature.data_types.push(data_type), + Err(err) => feature.errors.push(DefinitionError { + definition: Parser::extract_identifier(definition, MetaType::DataType), + definition_type: MetaType::DataType, + error: err.to_string(), + }), } - MetaType::FlowType => match serde_json::from_str::(definition) { - Ok(flow_type) => feature.flow_types.push(flow_type), + } + MetaType::FlowType => match serde_json::from_str::(definition) { + Ok(flow_type) => feature.flow_types.push(flow_type), + Err(err) => feature.errors.push(DefinitionError { + definition: Parser::extract_identifier(definition, MetaType::FlowType), + definition_type: MetaType::FlowType, + error: err.to_string(), + }), + }, + MetaType::RuntimeFunction => { + match serde_json::from_str::(definition) { + Ok(func) => feature.runtime_functions.push(func), Err(err) => feature.errors.push(DefinitionError { - definition: Parser::extract_identifier(definition, MetaType::FlowType), - definition_type: MetaType::FlowType, + definition: Parser::extract_identifier( + definition, + MetaType::RuntimeFunction, + ), + definition_type: MetaType::RuntimeFunction, error: err.to_string(), }), - }, - MetaType::RuntimeFunction => { - match serde_json::from_str::(definition) { - Ok(func) => feature.runtime_functions.push(func), - Err(err) => feature.errors.push(DefinitionError { - definition: Parser::extract_identifier( - definition, - MetaType::RuntimeFunction, - ), - definition_type: MetaType::RuntimeFunction, - error: err.to_string(), - }), - } } } } diff --git a/reader/rust/src/reader.rs b/reader/rust/src/reader.rs index 1c46556..c1056ce 100644 --- a/reader/rust/src/reader.rs +++ b/reader/rust/src/reader.rs @@ -4,6 +4,7 @@ use std::{ io::Error, path::Path, }; +use std::io::ErrorKind; #[derive(Serialize, Debug, Clone, Copy)] pub enum MetaType { @@ -27,16 +28,11 @@ pub struct Reader { } #[derive(Clone)] -pub struct ParsableDefinition { - pub path: Option, - pub starting_line: i32, - pub definition_string: String, -} - pub struct Meta { pub name: String, pub r#type: MetaType, - pub data: Vec, + pub definition_string: String, + pub path: String, } impl Meta { @@ -44,16 +40,15 @@ impl Meta { where P: AsRef, { - let mut current_line = 0; - let mut current_starting_line = 0; - let mut inside_code = false; - let mut current_block = vec![]; - let mut code_snippets: Vec = vec![]; - - let path = match file_path.as_ref().to_str() { - Some(str) => Some(str.to_string()), - None => None, - }; + + let path = match file_path.as_ref().to_str() { + Some(path) => path, + None => return Err(Error::new(ErrorKind::InvalidInput, "Invalid path")), + }; + + if !path.ends_with("json") { + return Err(Error::new(ErrorKind::InvalidInput, format!("File {} does not end with .json", file_path.as_ref().display()))); + } let content = match fs::read_to_string(&file_path) { Ok(content) => content, @@ -63,36 +58,11 @@ impl Meta { } }; - for line in content.lines() { - current_line += 1; - if line.contains("```") { - inside_code = !inside_code; - - if !inside_code { - let code_snippet = current_block.join(" "); - code_snippets.push(ParsableDefinition { - path: path.clone(), - starting_line: current_starting_line, - definition_string: code_snippet, - }); - current_block.clear(); - } - } - - if inside_code { - if line.starts_with("```") { - current_starting_line = current_line; - continue; - } - - current_block.push(line.to_string()); - } - } - - Ok(Meta { + Ok(Meta{ name, r#type, - data: code_snippets, + definition_string: content, + path: path.to_string(), }) } } @@ -160,9 +130,7 @@ impl Reader { Ok(meta_result) => { result.push(meta_result); } - Err(err) => { - println!("Error reading meta: {err:?}"); - } + _ => {} } } else { for sub_definition_path in @@ -183,9 +151,7 @@ impl Reader { Ok(meta_result) => { result.push(meta_result); } - Err(err) => { - println!("Error reading meta: {err:?}"); - } + _ => {} } } } From 4701194595a065b8c4a77e6650f70ec76c8a5298 Mon Sep 17 00:00:00 2001 From: raphael-goetz Date: Mon, 18 Aug 2025 14:50:36 +0200 Subject: [PATCH 14/20] drop: old markdown definitions --- definitions/rest/data_type/array.md | 41 - definitions/rest/data_type/object.md | 176 - definitions/rest/data_type/type.md | 56 - definitions/rest/flow_type/flow_type.md | 29 - definitions/standard/data_type/array.md | 29 - definitions/standard/data_type/node.md | 173 - definitions/standard/data_type/object.md | 15 - definitions/standard/data_type/primitive.md | 77 - definitions/standard/data_type/type.md | 28 - .../runtime_definition/array/array.md | 2600 -------------- .../{primitive => boolean}/boolean-audit.md | 0 .../{function => control}/control-audit.md | 0 .../runtime_definition/function/control.md | 93 - .../{primitive => number}/number-audit.md | 0 .../runtime_definition/object/object.md | 337 -- .../runtime_definition/primitive/boolean.md | 437 --- .../runtime_definition/primitive/number.md | 3023 ----------------- .../runtime_definition/primitive/text.md | 2681 --------------- .../{primitive => text}/text-audit.md | 0 19 files changed, 9795 deletions(-) delete mode 100644 definitions/rest/data_type/array.md delete mode 100644 definitions/rest/data_type/object.md delete mode 100644 definitions/rest/data_type/type.md delete mode 100644 definitions/rest/flow_type/flow_type.md delete mode 100644 definitions/standard/data_type/array.md delete mode 100644 definitions/standard/data_type/node.md delete mode 100644 definitions/standard/data_type/object.md delete mode 100644 definitions/standard/data_type/primitive.md delete mode 100644 definitions/standard/data_type/type.md delete mode 100644 definitions/standard/runtime_definition/array/array.md rename definitions/standard/runtime_definition/{primitive => boolean}/boolean-audit.md (100%) rename definitions/standard/runtime_definition/{function => control}/control-audit.md (100%) delete mode 100644 definitions/standard/runtime_definition/function/control.md rename definitions/standard/runtime_definition/{primitive => number}/number-audit.md (100%) delete mode 100644 definitions/standard/runtime_definition/object/object.md delete mode 100644 definitions/standard/runtime_definition/primitive/boolean.md delete mode 100644 definitions/standard/runtime_definition/primitive/number.md delete mode 100644 definitions/standard/runtime_definition/primitive/text.md rename definitions/standard/runtime_definition/{primitive => text}/text-audit.md (100%) diff --git a/definitions/rest/data_type/array.md b/definitions/rest/data_type/array.md deleted file mode 100644 index bb5144e..0000000 --- a/definitions/rest/data_type/array.md +++ /dev/null @@ -1,41 +0,0 @@ -```json -{ - "variant": 5, - "identifier": "HTTP_HEADER_MAP", - "name": [ - { - "code": "en-US", - "content": "HTTP Headers" - } - ], - "rules": [ - { - "config": { - "ParentType": { - "parent_type": { - "type": { - "GenericType": { - "data_type_identifier": "ARRAY", - "generic_mappers": [ - { - "source": [ - { - "type": { - "DataTypeIdentifier": "HTTP_HEADER_ENTRY" - } - } - ], - "target": "T", - "generic_combinations": [] - } - ] - } - } - } - } - } - } - ], - "generic_keys": [] -} -``` diff --git a/definitions/rest/data_type/object.md b/definitions/rest/data_type/object.md deleted file mode 100644 index b3309fc..0000000 --- a/definitions/rest/data_type/object.md +++ /dev/null @@ -1,176 +0,0 @@ -```json -{ - "variant": 3, - "identifier": "HTTP_HEADER_ENTRY", - "name": [ - { - "code": "en-US", - "content": "HTTP Header Entry" - } - ], - "rules": [ - { - "config": { - "ContainsKey": { - "key": "key", - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - } - } - } - }, - { - "config": { - "ContainsKey": { - "key": "value", - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - } - } - } - }, - { - "config": { - "ParentType": { - "parent_type": { - "type": { - "DataTypeIdentifier": "OBJECT" - } - } - } - } - } - ], - "generic_keys": [] -} -``` - -```json -{ - "variant": 3, - "identifier": "HTTP_REQUEST_OBJECT", - "name": [ - { - "code": "en-US", - "content": "HTTP Request" - } - ], - "rules": [ - { - "config": { - "ContainsKey": { - "key": "method", - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "HTTP_METHOD" - } - } - } - } - }, - { - "config": { - "ContainsKey": { - "key": "url", - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "HTTP_URL" - } - } - } - } - }, - { - "config": { - "ContainsKey": { - "key": "body", - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "OBJECT" - } - } - } - } - }, - { - "config": { - "ContainsKey": { - "key": "headers", - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "HTTP_HEADER_MAP" - } - } - } - } - }, - { - "config": { - "ParentType": { - "parent_type": { - "type": { - "DataTypeIdentifier": "OBJECT" - } - } - } - } - } - ], - "generic_keys": [] -} -``` - -```json -{ - "variant": 3, - "identifier": "HTTP_RESPONSE_OBJECT", - "name": [ - { - "code": "en-US", - "content": "HTTP Response" - } - ], - "rules": [ - { - "config": { - "ContainsKey": { - "key": "headers", - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "HTTP_HEADER_MAP" - } - } - } - } - }, - { - "config": { - "ContainsKey": { - "key": "body", - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "OBJECT" - } - } - } - } - }, - { - "config": { - "ParentType": { - "parent_type": { - "type": { - "DataTypeIdentifier": "OBJECT" - } - } - } - } - } - ], - "generic_keys": [] -} -``` diff --git a/definitions/rest/data_type/type.md b/definitions/rest/data_type/type.md deleted file mode 100644 index 4bb42cb..0000000 --- a/definitions/rest/data_type/type.md +++ /dev/null @@ -1,56 +0,0 @@ - -## HTTP Method - Type -```json -{ - "variant": 2, - "identifier": "HTTP_METHOD", - "name": [ - { - "code": "en-US", - "content": "HTTP Method" - } - ], - "rules": [ - { - "config": { - "ItemOfCollection": { - "items": [ - {"kind":{"StringValue":"GET"}}, - {"kind":{"StringValue":"POST"}}, - {"kind":{"StringValue":"PUT"}}, - {"kind":{"StringValue":"DELETE"}}, - {"kind":{"StringValue":"PATCH"}}, - {"kind":{"StringValue":"HEAD"}} - ] - } - } - } - ], - "generic_keys": [] -} -``` - -## HTTP URL - Type - -```json -{ - "variant": 2, - "identifier": "HTTP_URL", - "name": [ - { - "code": "en-US", - "content": "HTTP Route" - } - ], - "rules": [ - { - "config": { - "Regex": { - "pattern": "/^\/\\w+(?:[.:~-]\\w+)*(?:\/\\w+(?:[.:~-]\\w+)*)*$/" - } - } - } - ], - "generic_keys": [] -} -``` diff --git a/definitions/rest/flow_type/flow_type.md b/definitions/rest/flow_type/flow_type.md deleted file mode 100644 index 992057a..0000000 --- a/definitions/rest/flow_type/flow_type.md +++ /dev/null @@ -1,29 +0,0 @@ -# Rest FlowType - -```json -{ - "identifier": "REST", - "name": [ - { - "code": "en-US", - "content": "Rest Endpoint" - } - ], - "description": [ - { - "code": "en-US", - "content": "A REST API is a web service that lets clients interact with data on a server using standard HTTP methods like GET, POST, PUT, and DELETE usually returning results in JSON format." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "A REST API is a web service that lets clients interact with data on a server using standard HTTP methods like GET, POST, PUT, and DELETE usually returning results in JSON format." - } - ], - "settings": [], - "input_type_identifier": "HTTP_REQUEST_OBJECT", - "return_type_identifier": "HTTP_RESPONSE_OBJECT", - "editable": false -} -``` diff --git a/definitions/standard/data_type/array.md b/definitions/standard/data_type/array.md deleted file mode 100644 index 7417ff3..0000000 --- a/definitions/standard/data_type/array.md +++ /dev/null @@ -1,29 +0,0 @@ -# All Data_Types of the Array Variant - -## ARRAY -```json -{ - "variant": 5, - "identifier": "ARRAY", - "name": [ - { - "code": "en-US", - "content": "Generic Array" - } - ], - "rules": [ - { - "config": { - "ContainsType": { - "data_type_identifier": { - "type": { - "GenericKey": "T" - } - } - } - } - } - ], - "generic_keys": ["T"] -} -``` diff --git a/definitions/standard/data_type/node.md b/definitions/standard/data_type/node.md deleted file mode 100644 index 3cd1de9..0000000 --- a/definitions/standard/data_type/node.md +++ /dev/null @@ -1,173 +0,0 @@ -## PREDICATE -```json -{ - "identifier": "PREDICATE", - "variant": 7, - "rules": [ - { - "config": { - "ReturnType": { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "BOOLEAN" - } - } - } - } - }, - { - "config": { - "InputTypes": { - "input_types": [ - { - "data_type_identifier": { - "type": { - "GenericKey": "T" - } - }, - "input_identifier": "predicate" - } - ] - } - } - } - ], - "generic_keys": ["T"], - "name": [ - { - "code": "en-US", - "content": "Predicate" - } - ] -} -``` - -## CONSUMER -```json -{ - "identifier": "CONSUMER", - "variant": 7, - "rules": [ - { - "config": { - "InputTypes": { - "input_types": [ - { - "data_type_identifier": { - "type": { - "GenericKey": "T" - } - }, - "input_identifier": "consumer" - } - ] - } - } - } - ], - "generic_keys": ["T"], - "name": [ - { - "code": "en-US", - "content": "Consumer" - } - ] - -} -``` - -## TRANSFORM -```json -{ - "identifier": "TRANSFORM", - "variant": 7, - "rules": [ - { - "config": { - "ReturnType": { - "data_type_identifier": { - "type": { - "GenericKey": "R" - } - } - } - } - }, - { - "config": { - "InputTypes": { - "input_types": [ - { - "data_type_identifier": { - "type": { - "GenericKey": "I" - } - }, - "input_identifier": "transform" - } - ] - } - } - } - ], - "generic_keys": ["I", "R"], - "name": [ - { - "code": "en-US", - "content": "Transform" - } - ] -} -``` - -## COMPARITOR -```json -{ - "identifier": "COMPARATOR", - "variant": 7, - "rules": [ - { - "config": { - "ReturnType": { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - } - } - } - }, - { - "config": { - "InputTypes": { - "input_types": [ - { - "data_type_identifier": { - "type": { - "GenericKey": "I" - } - }, - "input_identifier": "left" - }, - { - "data_type_identifier": { - "type": { - "GenericKey": "I" - } - }, - "input_identifier": "right" - } - ] - } - } - } - ], - "generic_keys": ["I"], - "name": [ - { - "code": "en-US", - "content": "Comparator" - } - ] -} -``` diff --git a/definitions/standard/data_type/object.md b/definitions/standard/data_type/object.md deleted file mode 100644 index cc0939e..0000000 --- a/definitions/standard/data_type/object.md +++ /dev/null @@ -1,15 +0,0 @@ - -```json -{ - "variant": 2, - "identifier": "OBJECT", - "name": [ - { - "code": "en-US", - "content": "Object" - } - ], - "rules": [], - "generic_keys": [] -} -``` \ No newline at end of file diff --git a/definitions/standard/data_type/primitive.md b/definitions/standard/data_type/primitive.md deleted file mode 100644 index 39bbed9..0000000 --- a/definitions/standard/data_type/primitive.md +++ /dev/null @@ -1,77 +0,0 @@ -# All Data_Types of the Primitive Variant - -## NUMBER - -```json -{ - "variant": 1, - "identifier": "NUMBER", - "name": [ - { - "code": "en-US", - "content": "Number" - } - ], - "rules": [ - { - "config": { - "Regex": { - "pattern": "/^(?:-(?:[1-9](?:\\d{0,2}(?:,\\d{3})+|\\d*))|(?:0|(?:[1-9](?:\\d{0,2}(?:,\\d{3})+|\\d*))))(?:.\\d+|)$/" - } - } - } - ], - "generic_keys": [] -} -``` - - -## TEXT - -```json -{ - "variant": 1, - "identifier": "TEXT", - "name": [ - { - "code": "en-US", - "content": "Text" - } - ], - "rules": [ - { - "config": { - "Regex": { - "pattern": "[\\s\\S]*" - } - } - } - ], - "generic_keys": [] -} -``` - -## BOOLEAN - -```json -{ - "variant": 1, - "identifier": "BOOLEAN", - "name": [ - { - "code": "en-US", - "content": "Boolean" - } - ], - "rules": [ - { - "config": { - "Regex": { - "pattern": "^(true|false)$" - } - } - } - ], - "generic_keys": [] -} -``` diff --git a/definitions/standard/data_type/type.md b/definitions/standard/data_type/type.md deleted file mode 100644 index f5e67bc..0000000 --- a/definitions/standard/data_type/type.md +++ /dev/null @@ -1,28 +0,0 @@ -# All Data_Types of the Variant TYPE - -## NUMBER - -```json -{ - "variant": 2, - "identifier": "TEXT_ENCODING", - "name": [ - { - "code": "en-US", - "content": "Text Encoding" - } - ], - "rules": [ - { - "config": { - "ItemOfCollection": { - "items": [ - {"kind":{"StringValue":"BASE64"}} - ] - } - } - } - ], - "generic_keys": [] -} -``` diff --git a/definitions/standard/runtime_definition/array/array.md b/definitions/standard/runtime_definition/array/array.md deleted file mode 100644 index 994dc40..0000000 --- a/definitions/standard/runtime_definition/array/array.md +++ /dev/null @@ -1,2600 +0,0 @@ -## at -Will return the value at the index of the array. - -```json -{ - "runtime_name": "std::array::at", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "GenericType": { - "data_type_identifier": "ARRAY", - "generic_mappers": [ - { - "source": [ - { - "type": { - "GenericKey": "R" - } - } - ], - "target": "T", - "generic_combinations": [] - } - ] - } - } - }, - "runtime_name": "array", - "name": [ - { - "code": "en-US", - "content": "Input Array" - } - ], - "description": [ - { - "code": "en-US", - "content": "The array from which to retrieve an element." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "An array containing elements of any type. The element at the specified index will be returned." - } - ] - }, - { - "data_type_identifier": { - "data_type_identifier": "NUMBER" - }, - "runtime_name": "index", - "name": [ - { - "code": "en-US", - "content": "Index" - } - ], - "description": [ - { - "code": "en-US", - "content": "The zero-based index of the element to retrieve." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Specifies the position of the element in the array to return. Must be within the bounds of the array." - } - ] - } - ], - "return_type_identifier": { - "generic_key": "R" - }, - "name": [ - { - "code": "en-US", - "content": "Get Array Element" - } - ], - "description": [ - { - "code": "en-US", - "content": "Retrieves the element at a specified index from an array." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Returns the element located at the given zero-based index within the input array." - } - ], - "generic_keys": ["R"], - "deprecation_message": [], - "throws_error": false -} -``` - -## concat -Will merge to arrays together and return a new one. -```json -{ - "runtime_name": "std::array::concat", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "GenericType": { - "data_type_identifier": "ARRAY", - "generic_mappers": [ - { - "source": [ - { - "type": { - "GenericKey": "R" - } - } - ], - "target": "T", - "generic_combinations": [] - } - ] - } - } - }, - "runtime_name": "first", - "name": [ - { - "code": "en-US", - "content": "First Array" - } - ], - "description": [ - { - "code": "en-US", - "content": "The first array to concatenate." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "The first input array whose elements will appear at the beginning of the resulting array." - } - ] - }, - { - "data_type_identifier": { - "type": { - "GenericType": { - "data_type_identifier": "ARRAY", - "generic_mappers": [ - { - "source": [ - { - "type": { - "GenericKey": "R" - } - } - ], - "target": "T", - "generic_combinations": [] - } - ] - } - } - }, - "runtime_name": "second", - "name": [ - { - "code": "en-US", - "content": "Second Array" - } - ], - "description": [ - { - "code": "en-US", - "content": "The second array to concatenate." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "The second input array whose elements will be appended after the elements of the first array." - } - ] - } - ], - "return_type_identifier": { - "type": { - "GenericType": { - "data_type_identifier": "ARRAY", - "generic_mappers": [ - { - "source": [ - { - "type": { - "GenericKey": "R" - } - } - ], - "target": "T", - "generic_combinations": [] - } - ] - } - } - }, - "name": [ - { - "code": "en-US", - "content": "Concatenate Arrays" - } - ], - "description": [ - { - "code": "en-US", - "content": "Concatenates two arrays into a single array." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Returns a new array containing all elements of the first array followed by all elements of the second array." - } - ], - "generic_keys": ["R"], - "deprecation_message": [], - "throws_error": false -} -``` - -## filter -Will filter the array by the given node and return all values, the filter node returned true. - -```json -{ - "runtime_name": "std::array::filter", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "GenericType": { - "data_type_identifier": "ARRAY", - "generic_mappers": [ - { - "source": [ - { - "type": { - "GenericKey": "R" - } - } - ], - "target": "T", - "generic_combinations": [] - } - ] - } - } - }, - "runtime_name": "array", - "name": [ - { - "code": "en-US", - "content": "Input Array" - } - ], - "description": [ - { - "code": "en-US", - "content": "The array to be filtered." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "The original array from which elements will be selected based on the predicate." - } - ] - }, - { - "data_type_identifier": { - "type": { - "GenericType": { - "data_type_identifier": "PREDICATE", - "generic_mappers": [ - { - "source": [ - { - "type": { - "GenericKey": "R" - } - } - ], - "target": "T", - "generic_combinations": [] - } - ] - } - } - }, - "runtime_name": "predicate", - "name": [ - { - "code": "en-US", - "content": "Filter Predicate" - } - ], - "description": [ - { - "code": "en-US", - "content": "A predicate function to test each element for inclusion in the result." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "A function that takes an element of the array and returns a boolean indicating whether the element should be included in the output array." - } - ] - } - ], - "return_type_identifier": { - "type": { - "GenericType": { - "data_type_identifier": "ARRAY", - "generic_mappers": [ - { - "source": [ - { - "type": { - "GenericKey": "R" - } - } - ], - "target": "T", - "generic_combinations": [] - } - ] - } - } - }, - "name": [ - { - "code": "en-US", - "content": "Filter Array" - } - ], - "description": [ - { - "code": "en-US", - "content": "Filters elements of an array based on a predicate." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Returns a new array containing only the elements from the input array for which the predicate returns true." - } - ], - "generic_keys": ["R"], - "deprecation_message": [], - "throws_error": false -} -``` - -## find -Will return the first item of an array that match the predicate. - -```json -{ - "runtime_name": "std::array::find", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "GenericType": { - "data_type_identifier": "ARRAY", - "generic_mappers": [ - { - "source": [ - { - "type": { - "GenericKey": "R" - } - } - ], - "target": "T", - "generic_combinations": [] - } - ] - } - } - }, - "runtime_name": "array", - "name": [ - { - "code": "en-US", - "content": "Input Array" - } - ], - "description": [ - { - "code": "en-US", - "content": "The array to search through." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "The array in which an element satisfying the predicate will be searched." - } - ] - }, - { - "data_type_identifier": { - "type": { - "GenericType": { - "data_type_identifier": "PREDICATE", - "generic_mappers": [ - { - "source": [ - { - "type": { - "GenericKey": "R" - } - } - ], - "target": "T", - "generic_combinations": [] - } - ] - } - } - }, - "runtime_name": "predicate", - "name": [ - { - "code": "en-US", - "content": "Search Predicate" - } - ], - "description": [ - { - "code": "en-US", - "content": "A predicate function used to test each element for a match." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "A function that takes an element of the array and returns a boolean indicating if the element matches the search criteria." - } - ] - } - ], - "generic_keys": ["R"], - "return_type_identifier": { - "type": { - "GenericKey": "R" - } - }, - "name": [ - { - "code": "en-US", - "content": "Find Element in Array" - } - ], - "description": [ - { - "code": "en-US", - "content": "Finds the first element in the array that satisfies the predicate." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Returns the first element from the input array for which the predicate returns true. If no element matches, returns null or equivalent." - } - ], - "deprecation_message": [], - "throws_error": false -} -``` - -## findLast -Will return the last item of an array that matches the predicate. - -```json -{ - "runtime_name": "std::array::find_last", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "GenericType": { - "data_type_identifier": "ARRAY", - "generic_mappers": [ - { - "source": [ - { - "type": { - "GenericKey": "R" - } - } - ], - "target": "T", - "generic_combinations": [] - } - ] - } - } - }, - "runtime_name": "array", - "name": [ - { - "code": "en-US", - "content": "Input Array" - } - ], - "description": [ - { - "code": "en-US", - "content": "The array to search through." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "The array in which an element satisfying the predicate will be searched." - } - ] - }, - { - "data_type_identifier": { - "type": { - "GenericType": { - "data_type_identifier": "PREDICATE", - "generic_mappers": [ - { - "source": [ - { - "type": { - "GenericKey": "R" - } - } - ], - "target": "T", - "generic_combinations": [] - } - ] - } - } - }, - "runtime_name": "predicate", - "name": [ - { - "code": "en-US", - "content": "Search Predicate" - } - ], - "description": [ - { - "code": "en-US", - "content": "A predicate function used to test each element for a match." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "A function that takes an element of the array and returns a boolean indicating if the element matches the search criteria." - } - ] - } - ], - "generic_keys": ["R"], - "return_type_identifier": { - "type": { - "GenericKey": "R" - } - }, - "name": [ - { - "code": "en-US", - "content": "Find Last Element in Array" - } - ], - "description": [ - { - "code": "en-US", - "content": "Finds the last element in the array that satisfies the predicate." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Returns the last element from the input array for which the predicate returns true. If no element matches, returns null or equivalent." - } - ], - "deprecation_message": [], - "throws_error": false -} -``` - -## findIndex -Will return the index of the first item that matches the predicate. - -```json -{ - "runtime_name": "std::array::find_index", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "GenericType": { - "data_type_identifier": "ARRAY", - "generic_mappers": [ - { - "source": [ - { - "type": { - "GenericKey": "R" - } - } - ], - "target": "T", - "generic_combinations": [] - } - ] - } - } - }, - "runtime_name": "array", - "name": [ - { - "code": "en-US", - "content": "Input Array" - } - ], - "description": [ - { - "code": "en-US", - "content": "The array to search through." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "The array in which to find the index of an element that satisfies the predicate." - } - ] - }, - { - "data_type_identifier": { - "type": { - "GenericType": { - "data_type_identifier": "PREDICATE", - "generic_mappers": [ - { - "source": [ - { - "type": { - "GenericKey": "R" - } - } - ], - "target": "T", - "generic_combinations": [] - } - ] - } - } - }, - "runtime_name": "predicate", - "name": [ - { - "code": "en-US", - "content": "Search Predicate" - } - ], - "description": [ - { - "code": "en-US", - "content": "A predicate function used to test each element for a match." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "A function that takes an element of the array and returns a boolean indicating if the element satisfies the search criteria." - } - ] - } - ], - "generic_keys": ["R"], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "name": [ - { - "code": "en-US", - "content": "Find Index in Array" - } - ], - "description": [ - { - "code": "en-US", - "content": "Finds the index of the first element in the array that satisfies the predicate." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Returns the zero-based index of the first element for which the predicate returns true. If no element matches, returns -1." - } - ], - "deprecation_message": [], - "throws_error": false -} -``` - -## first -Will return the first item of the array. - -```json -{ - "runtime_name": "std::array::first", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "GenericType": { - "data_type_identifier": "ARRAY", - "generic_mappers": [ - { - "source": [ - { - "type": { - "GenericKey": "R" - } - } - ], - "target": "T", - "generic_combinations": [] - } - ] - } - } - }, - "runtime_name": "array", - "name": [ - { - "code": "en-US", - "content": "Input Array" - } - ], - "description": [ - { - "code": "en-US", - "content": "The array from which to retrieve the first element." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Returns the first element of the provided array. If the array is empty, behavior depends on the implementation." - } - ] - } - ], - "return_type_identifier": { - "type": { - "GenericKey": "R" - } - }, - "generic_keys": ["R"], - "name": [ - { - "code": "en-US", - "content": "First Element of Array" - } - ], - "description": [ - { - "code": "en-US", - "content": "Retrieves the first element from the array." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "This runtime returns the first element in the given array, if any." - } - ], - "deprecation_message": [], - "throws_error": false -} -``` - -## last -Will return the last item of the array. - -```json -{ - "runtime_name": "std::array::last", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "GenericType": { - "data_type_identifier": "ARRAY", - "generic_mappers": [ - { - "source": [ - { - "type": { - "GenericKey": "R" - } - } - ], - "target": "T", - "generic_combinations": [] - } - ] - } - } - }, - "runtime_name": "array", - "name": [ - { - "code": "en-US", - "content": "Input Array" - } - ], - "description": [ - { - "code": "en-US", - "content": "The array from which to retrieve the last element." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Returns the last element of the provided array. If the array is empty, behavior depends on the implementation." - } - ] - } - ], - "return_type_identifier": { - "type": { - "GenericKey": "R" - } - }, - "generic_keys": ["R"], - "name": [ - { - "code": "en-US", - "content": "Last Element of Array" - } - ], - "description": [ - { - "code": "en-US", - "content": "Retrieves the last element from the array." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "This runtime returns the last element in the given array, if any." - } - ], - "deprecation_message": [], - "throws_error": false -} -``` - -## forEach -Will call a consumer on every item in the array. No return value. - -```json -{ - "runtime_name": "std::array::for_each", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "GenericType": { - "data_type_identifier": "ARRAY", - "generic_mappers": [ - { - "source": [ - { - "type": { - "GenericKey": "R" - } - } - ], - "target": "T", - "generic_combinations": [] - } - ] - } - } - }, - "runtime_name": "array", - "name": [ - { - "code": "en-US", - "content": "Input Array" - } - ], - "description": [ - { - "code": "en-US", - "content": "The array of elements to iterate over." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Each element of this array will be passed to the provided consumer function for processing." - } - ] - }, - { - "data_type_identifier": { - "type": { - "GenericType": { - "data_type_identifier": "CONSUMER", - "generic_mappers": [ - { - "source": [ - { - "type": { - "GenericKey": "R" - } - } - ], - "target": "T", - "generic_combinations": [] - } - ] - } - } - }, - "runtime_name": "consumer", - "name": [ - { - "code": "en-US", - "content": "Consumer Function" - } - ], - "description": [ - { - "code": "en-US", - "content": "A function that consumes each element of the array." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "This function is invoked once for each element in the array. It is not expected to return a value." - } - ] - } - ], - "generic_keys": ["R"], - "name": [ - { - "code": "en-US", - "content": "For Each Element" - } - ], - "description": [ - { - "code": "en-US", - "content": "Executes a consumer function for each element in the array." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "This runtime executes the given consumer function on each item in the array without returning a result." - } - ], - "deprecation_message": [], - "throws_error": false -} -``` - -## map -Will call a node on each value and expect a return value of the node, collect all return values and returns a new array of all collected return values. - -```json -{ - "runtime_name": "std::array::map", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "GenericType": { - "data_type_identifier": "ARRAY", - "generic_mappers": [ - { - "source": [ - { - "type": { - "GenericKey": "IN" - } - } - ], - "target": "T", - "generic_combinations": [] - } - ] - } - } - }, - "runtime_name": "array", - "name": [ - { - "code": "en-US", - "content": "Input Array" - } - ], - "description": [ - { - "code": "en-US", - "content": "The array to be transformed." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Each element of this array will be passed through the transform function." - } - ] - }, - { - "data_type_identifier": { - "type": { - "GenericType": { - "data_type_identifier": "TRANSFORM", - "generic_mappers": [ - { - "source": [ - { - "type": { - "GenericKey": "IN" - } - } - ], - "target": "I", - "generic_combinations": [] - }, - { - "source": [ - { - "type": { - "GenericKey": "OUT" - } - } - ], - "target": "R", - "generic_combinations": [] - } - ] - } - } - }, - "runtime_name": "transform", - "name": [ - { - "code": "en-US", - "content": "Transform Function" - } - ], - "description": [ - { - "code": "en-US", - "content": "A function that transforms each item in the array." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "The transform function is applied to every element of the array to produce a new array." - } - ] - } - ], - "generic_keys": ["IN", "OUT"], - "return_type_identifier": { - "type": { - "GenericType": { - "data_type_identifier": "ARRAY", - "generic_mappers": [ - { - "source": [ - { - "type": { - "GenericKey": "OUT" - } - } - ], - "target": "T", - "generic_combinations": [] - } - ] - } - } - }, - "name": [ - { - "code": "en-US", - "content": "Map Array" - } - ], - "description": [ - { - "code": "en-US", - "content": "Transforms each element in the array using the provided function." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "This runtime applies the transform function to each element in the array, producing a new array of the results." - } - ], - "deprecation_message": [], - "throws_error": false -} -``` - -## push -Will add the given item to the array and returns the new length of the array. - -```json -{ - "runtime_name": "std::array::push", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "GenericType": { - "data_type_identifier": "ARRAY", - "generic_mappers": [ - { - "source": [ - { - "type": { - "GenericKey": "I" - } - } - ], - "target": "T", - "generic_combinations": [] - } - ] - } - } - }, - "runtime_name": "array", - "name": [ - { - "code": "en-US", - "content": "Array" - } - ], - "description": [ - { - "code": "en-US", - "content": "The array to which an item will be added." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "The array that the new item will be appended to." - } - ] - }, - { - "data_type_identifier": { - "type": { - "GenericKey": "I" - } - }, - "runtime_name": "item", - "name": [ - { - "code": "en-US", - "content": "Item" - } - ], - "description": [ - { - "code": "en-US", - "content": "The item to add to the array." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "The value to be added at the end of the array." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "generic_keys": ["I"], - "name": [ - { - "code": "en-US", - "content": "Push to Array" - } - ], - "description": [ - { - "code": "en-US", - "content": "Appends an item to the end of an array." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Adds a new element to the end of the array and returns the new length of the array." - } - ], - "deprecation_message": [], - "throws_error": false -} -``` - -[Ref](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/push) - -## pop -Will remove the last entry of the array and return the item. - -```json -{ - "runtime_name": "std::array::pop", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "GenericType": { - "data_type_identifier": "ARRAY", - "generic_mappers": [ - { - "source": [ - { - "type": { - "GenericKey": "R" - } - } - ], - "target": "T", - "generic_combinations": [] - } - ] - } - } - }, - "runtime_name": "array", - "name": [ - { - "code": "en-US", - "content": "Array" - } - ], - "description": [ - { - "code": "en-US", - "content": "The array to remove the last item from." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "This is the array from which the last element will be removed and returned." - } - ] - } - ], - "return_type_identifier": { - "type": { - "GenericKey": "R" - } - }, - "generic_keys": ["R"], - "name": [ - { - "code": "en-US", - "content": "Pop from Array" - } - ], - "description": [ - { - "code": "en-US", - "content": "Removes and returns the last item from the array." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Removes the last element from the specified array and returns it. The array is modified in place." - } - ], - "deprecation_message": [], - "throws_error": false -} -``` - -[Ref](https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Global_Objects/Array/pop) - -## remove -Will remove the given item of the array and return the array without it. - -```json -{ - "runtime_name": "std::array::remove", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "GenericType": { - "data_type_identifier": "ARRAY", - "generic_mappers": [ - { - "source": [ - { - "type": { - "GenericKey": "R" - } - } - ], - "target": "T", - "generic_combinations": [] - } - ] - } - } - }, - "runtime_name": "array", - "name": [ - { - "code": "en-US", - "content": "Array" - } - ], - "description": [ - { - "code": "en-US", - "content": "The array from which the item will be removed." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "An array to process by removing the first occurrence of the specified item." - } - ] - }, - { - "data_type_identifier": { - "type": { - "GenericKey": "R" - } - }, - "runtime_name": "item", - "name": [ - { - "code": "en-US", - "content": "Item" - } - ], - "description": [ - { - "code": "en-US", - "content": "The item to remove from the array." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "The value to search for and remove from the array. Only the first matching item is removed." - } - ] - } - ], - "generic_keys": ["R"], - "return_type_identifier": { - "type": { - "GenericType": { - "data_type_identifier": "ARRAY", - "generic_mappers": [ - { - "source": [ - { - "type": { - "GenericKey": "R" - } - } - ], - "target": "T", - "generic_combinations": [] - } - ] - } - } - }, - "name": [ - { - "code": "en-US", - "content": "Remove from Array" - } - ], - "description": [ - { - "code": "en-US", - "content": "Removes the first occurrence of the specified item from the array." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Removes the first matching item from the given array and returns the resulting array." - } - ], - "deprecation_message": [], - "throws_error": false -} -``` - -## isEmpty -Will check if the array is empty or not. Will return true if its empty. - -```json -{ - "runtime_name": "std::array::is_empty", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "GenericType": { - "data_type_identifier": "ARRAY", - "generic_mappers": [ - { - "source": [ - { - "type": { - "GenericKey": "R" - } - } - ], - "target": "T", - "generic_combinations": [] - } - ] - } - } - }, - "runtime_name": "array", - "name": [ - { - "code": "en-US", - "content": "Array" - } - ], - "description": [ - { - "code": "en-US", - "content": "The array to check for emptiness." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "The array whose length will be evaluated to determine if it contains any elements." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "BOOLEAN" - } - }, - "generic_keys": ["R"], - "name": [ - { - "code": "en-US", - "content": "Is Array Empty" - } - ], - "description": [ - { - "code": "en-US", - "content": "Checks if the array has no elements." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Returns true if the array contains no elements, otherwise returns false." - } - ], - "deprecation_message": [], - "throws_error": false -} -``` - -## size -Will return the amount of items inside the array. - -```json -{ - "runtime_name": "std::array::size", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "GenericType": { - "data_type_identifier": "ARRAY", - "generic_mappers": [ - { - "source": [ - { - "type": { - "GenericKey": "R" - } - } - ], - "target": "T", - "generic_combinations": [] - } - ] - } - } - }, - "runtime_name": "array", - "name": [ - { - "code": "en-US", - "content": "Array" - } - ], - "description": [ - { - "code": "en-US", - "content": "The array whose number of elements is to be returned." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Specifies the array for which the total number of elements will be calculated and returned." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "generic_keys": ["R"], - "name": [ - { - "code": "en-US", - "content": "Array Size" - } - ], - "description": [ - { - "code": "en-US", - "content": "Returns the number of elements in the array." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "This function returns the count of elements present in the given array." - } - ], - "deprecation_message": [], - "throws_error": false -} -``` - -## indexOf -Will return the index of the given item. - -```json -{ - "runtime_name": "std::array::index_of", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "GenericType": { - "data_type_identifier": "ARRAY", - "generic_mappers": [ - { - "source": [ - { - "type": { - "GenericKey": "R" - } - } - ], - "target": "T", - "generic_combinations": [] - } - ] - } - } - }, - "runtime_name": "array", - "name": [ - { - "code": "en-US", - "content": "Array" - } - ], - "description": [ - { - "code": "en-US", - "content": "The array to search within." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "An array of elements in which the specified item will be searched for to determine its index." - } - ] - }, - { - "data_type_identifier": { - "generic_key": "R" - }, - "runtime_name": "item", - "name": [ - { - "code": "en-US", - "content": "Item" - } - ], - "description": [ - { - "code": "en-US", - "content": "The item whose index is to be found in the array." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "The item for which the function searches in the array and returns the index of its first occurrence." - } - ] - } - ], - "generic_keys": ["R"], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "generic_mappers": [ - { - "parameter_id": "array", - "source": [ - { - "generic_key": "R" - } - ], - "target": "T", - "generic_combinations": [] - } - ], - "name": [ - { - "code": "en-US", - "content": "Index of Item" - } - ], - "description": [ - { - "code": "en-US", - "content": "Finds the index of the first occurrence of the specified item in the array." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Returns the zero-based index of the first occurrence of a given item in the specified array. If the item is not found, it typically returns -1." - } - ], - "deprecation_message": [], - "throws_error": false -} -``` - -## toUnique -Will remove all duplicated items of the array. - -```json -{ - "runtime_name": "std::array::to_unique", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "GenericType": { - "data_type_identifier": "ARRAY", - "generic_mappers": [ - { - "source": [ - { - "type": { - "GenericKey": "R" - } - } - ], - "target": "T", - "generic_combinations": [] - } - ] - } - } - }, - "runtime_name": "array", - "name": [ - { - "code": "en-US", - "content": "Array" - } - ], - "description": [ - { - "code": "en-US", - "content": "The input array from which duplicates will be removed." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "An array of elements that may contain duplicates. This function will remove any duplicate items and return a new array with unique values only." - } - ] - } - ], - "return_type_identifier": { - "type": { - "GenericType": { - "data_type_identifier": "ARRAY", - "generic_mappers": [ - { - "source": [ - { - "type": { - "GenericKey": "R" - } - } - ], - "target": "T", - "generic_combinations": [] - } - ] - } - } - }, - "generic_keys": ["R"], - "name": [ - { - "code": "en-US", - "content": "To Unique" - } - ], - "description": [ - { - "code": "en-US", - "content": "Removes duplicate elements from the input array." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Returns a new array containing only the unique elements from the input array. The original order may or may not be preserved depending on the implementation." - } - ], - "deprecation_message": [], - "throws_error": false -} -``` - -## sort -Will sort the array by the given COMPARATOR. - -```json -{ - "runtime_name": "std::array::sort", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "GenericType": { - "data_type_identifier": "ARRAY", - "generic_mappers": [ - { - "source": [ - { - "type": { - "GenericKey": "R" - } - } - ], - "target": "T", - "generic_combinations": [] - } - ] - } - } - }, - "runtime_name": "array", - "name": [ - { - "code": "en-US", - "content": "Array" - } - ], - "description": [ - { - "code": "en-US", - "content": "The input array to be sorted." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "An array of elements that will be sorted using the provided comparator function." - } - ] - }, - { - "data_type_identifier": { - "type": { - "GenericType": { - "data_type_identifier": "COMPARATOR", - "generic_mappers": [ - { - "source": [ - { - "type": { - "GenericKey": "R" - } - } - ], - "target": "I", - "generic_combinations": [] - } - ] - } - } }, - "runtime_name": "comparator", - "name": [ - { - "code": "en-US", - "content": "Comparator" - } - ], - "description": [ - { - "code": "en-US", - "content": "A comparator function used to determine the sort order of elements." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "A function that takes two elements and returns a negative, zero, or positive number to indicate their ordering." - } - ] - } - ], - "return_type_identifier": { - "type": { - "GenericType": { - "data_type_identifier": "ARRAY", - "generic_mappers": [ - { - "source": [ - { - "type": { - "GenericKey": "R" - } - } - ], - "target": "T", - "generic_combinations": [] - } - ] - } - } - }, - "generic_keys": ["R"], - "name": [ - { - "code": "en-US", - "content": "Sort Array" - } - ], - "description": [ - { - "code": "en-US", - "content": "Sorts the elements of the array using the specified comparator." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Returns a new array with the elements sorted according to the comparator function provided." - } - ], - "deprecation_message": [], - "throws_error": false -} -``` - -## sortReverse - -```json -{ - "runtime_name": "std::array::sort_reverse", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "GenericType": { - "data_type_identifier": "ARRAY", - "generic_mappers": [ - { - "source": [ - { - "type": { - "GenericKey": "R" - } - } - ], - "target": "T", - "generic_combinations": [] - } - ] - } - } - }, - "runtime_name": "array", - "name": [ - { - "code": "en-US", - "content": "Array" - } - ], - "description": [ - { - "code": "en-US", - "content": "The input array to be sorted in reverse order." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "An array of elements that will be sorted in descending order using the provided comparator." - } - ] - }, - { - "data_type_identifier": { - "type": { - "GenericType": { - "data_type_identifier": "COMPARATOR", - "generic_mappers": [ - { - "source": [ - { - "type": { - "GenericKey": "R" - } - } - ], - "target": "I", - "generic_combinations": [] - } - ] - } - } - }, - "runtime_name": "comparator", - "name": [ - { - "code": "en-US", - "content": "Comparator" - } - ], - "description": [ - { - "code": "en-US", - "content": "A comparator function used to determine the sort order of elements." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "A function that takes two elements and returns a negative, zero, or positive number to indicate their ordering." - } - ] - } - ], - "return_type_identifier": { - "data_type_identifier": "ARRAY" - }, - "generic_keys": ["R"], - "name": [ - { - "code": "en-US", - "content": "Sort Array in Reverse" - } - ], - "description": [ - { - "code": "en-US", - "content": "Sorts the elements of the array in reverse order using the specified comparator." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Returns a new array with the elements sorted in descending order according to the comparator function provided." - } - ], - "deprecation_message": [], - "throws_error": false -} -``` - -## reverse - -```json -{ - "runtime_name": "std::array::reverse", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "GenericType": { - "data_type_identifier": "ARRAY", - "generic_mappers": [ - { - "source": [ - { - "type": { - "GenericKey": "R" - } - } - ], - "target": "T", - "generic_combinations": [] - } - ] - } - } - }, - "runtime_name": "array", - "name": [ - { - "code": "en-US", - "content": "Array" - } - ], - "description": [ - { - "code": "en-US", - "content": "The input array to be reversed." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "An array of elements whose order will be reversed." - } - ] - } - ], - "return_type_identifier": { - "type": { - "GenericType": { - "data_type_identifier": "ARRAY", - "generic_mappers": [ - { - "source": [ - { - "type": { - "GenericKey": "R" - } - } - ], - "target": "T", - "generic_combinations": [] - } - ] - } - } - }, - "generic_keys": ["R"], - "name": [ - { - "code": "en-US", - "content": "Reverse Array" - } - ], - "description": [ - { - "code": "en-US", - "content": "Reverses the order of elements in the array." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Returns a new array with the elements of the input array in reverse order." - } - ], - "deprecation_message": [], - "throws_error": false -} -``` - -## flat -Will turn a 2 dimensional array into a one dimensional array. - -Input: -[ [1, 2, 3], [3, 4, 5] ] - -Result: -[ 1, 2, 3, 3, 4, 5 ] - -```json -{ - "runtime_name": "std::array::flat", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "GenericType": { - "data_type_identifier": "ARRAY", - "generic_mappers": [ - { - "source": [ - { - "type": { - "GenericType": { - "data_type_identifier": "ARRAY", - "generic_mappers": [ - { - "source": [ - { - "type": { - "GenericKey": "R" - } - } - ], - "target": "T", - "generic_combinations": [] - } - ] - } - } - } - ], - "target": "T", - "generic_combinations": [] - } - ] - } - } - }, - "runtime_name": "array", - "name": [ - { - "code": "en-US", - "content": "Nested Array" - } - ], - "description": [ - { - "code": "en-US", - "content": "The nested array to be flattened." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "An array containing sub-arrays that will be flattened into a single-level array." - } - ] - } - ], - "return_type_identifier": { - "type": { - "GenericType": { - "data_type_identifier": "ARRAY", - "generic_mappers": [ - { - "source": [ - { - "type": { - "GenericKey": "R" - } - } - ], - "target": "T", - "generic_combinations": [] - } - ] - } - } - }, - "generic_keys": ["R"], - "name": [ - { - "code": "en-US", - "content": "Flatten Array" - } - ], - "description": [ - { - "code": "en-US", - "content": "Flattens a nested array into a single-level array." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Returns a new array by concatenating all sub-arrays of the input nested array into one flat array." - } - ], - "deprecation_message": [], - "throws_error": false -} -``` - -## min -Returns the smallest number in the array - -```json -{ - "runtime_name": "std::array::min", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "GenericType": { - "data_type_identifier": "ARRAY", - "generic_mappers": [ - { - "source": [ - { - "type": { - "GenericKey": "R" - } - } - ], - "target": "T", - "generic_combinations": [] - } - ] - } - } - }, - "runtime_name": "array", - "name": [ - { - "code": "en-US", - "content": "Number Array" - } - ], - "description": [ - { - "code": "en-US", - "content": "An array of numbers to find the minimum value from." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Returns the smallest number in the given array of numbers." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "name": [ - { - "code": "en-US", - "content": "Find Minimum Number" - } - ], - "description": [ - { - "code": "en-US", - "content": "Finds the minimum value in a numeric array." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Returns the smallest number contained in the provided array." - } - ], - "deprecation_message": [], - "throws_error": false, - "generic_keys": ["R"] -} -``` - -## max -Returns the largest number in the array - -```json -{ - "runtime_name": "std::array::max", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "GenericType": { - "data_type_identifier": "ARRAY", - "generic_mappers": [ - { - "source": [ - { - "type": { - "GenericKey": "R" - } - } - ], - "target": "T", - "generic_combinations": [] - } - ] - } - } - }, - "runtime_name": "array", - "name": [ - { - "code": "en-US", - "content": "Number Array" - } - ], - "description": [ - { - "code": "en-US", - "content": "An array of numbers to find the maximum value from." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Returns the largest number in the given array of numbers." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "name": [ - { - "code": "en-US", - "content": "Find Maximum Number" - } - ], - "description": [ - { - "code": "en-US", - "content": "Finds the maximum value in a numeric array." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Returns the largest number contained in the provided array." - } - ], - "deprecation_message": [], - "generic_keys": ["R"], - "throws_error": false -} -``` - - -## sum -Returns the sum of all the numbers in the array - -```json -{ - "runtime_name": "std::array::sum", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "GenericType": { - "data_type_identifier": "ARRAY", - "generic_mappers": [ - { - "source": [ - { - "type": { - "DataTypeIdentifier": "NUMBER" - } - } - ], - "target": "T", - "generic_combinations": [] - } - ] - } - } - }, - "runtime_name": "array", - "name": [ - { - "code": "en-US", - "content": "Number Array" - } - ], - "description": [ - { - "code": "en-US", - "content": "An array of numbers to be summed." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Calculates the sum of all numbers in the given array." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "name": [ - { - "code": "en-US", - "content": "Sum of Numbers" - } - ], - "description": [ - { - "code": "en-US", - "content": "Returns the total sum of the elements in the numeric array." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Adds up all numbers in the input array and returns their sum." - } - ], - "deprecation_message": [], - "generic_keys": [], - "throws_error": false -} -``` - -## join -Will join every item by a given text - -```json -{ - "runtime_name": "std::array::join", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "GenericType": { - "data_type_identifier": "ARRAY", - "generic_mappers": [ - { - "source": [ - { - "type": { - "DataTypeIdentifier": "TEXT" - } - } - ], - "target": "T", - "generic_combinations": [] - } - ] - } - } - }, - "runtime_name": "array", - "name": [ - { - "code": "en-US", - "content": "Text Array" - } - ], - "description": [ - { - "code": "en-US", - "content": "An array of text elements to be filtered." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Input array containing text elements for filtering." - } - ] - }, - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "runtime_name": "join_text", - "name": [ - { - "code": "en-US", - "content": "Join Text" - } - ], - "description": [ - { - "code": "en-US", - "content": "Text to join the filtered elements." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "The delimiter or text that will be used to join the filtered array elements into a single string." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "name": [ - { - "code": "en-US", - "content": "Filter and Join Text Array" - } - ], - "description": [ - { - "code": "en-US", - "content": "Filters the input text array and joins the filtered elements into a single string separated by the specified join text." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Applies a filter operation on the input text array and returns a single concatenated string of filtered elements joined by the provided join text." - } - ], - "deprecation_message": [], - "generic_keys": [], - "throws_error": false -} -``` diff --git a/definitions/standard/runtime_definition/primitive/boolean-audit.md b/definitions/standard/runtime_definition/boolean/boolean-audit.md similarity index 100% rename from definitions/standard/runtime_definition/primitive/boolean-audit.md rename to definitions/standard/runtime_definition/boolean/boolean-audit.md diff --git a/definitions/standard/runtime_definition/function/control-audit.md b/definitions/standard/runtime_definition/control/control-audit.md similarity index 100% rename from definitions/standard/runtime_definition/function/control-audit.md rename to definitions/standard/runtime_definition/control/control-audit.md diff --git a/definitions/standard/runtime_definition/function/control.md b/definitions/standard/runtime_definition/function/control.md deleted file mode 100644 index 9fd6e52..0000000 --- a/definitions/standard/runtime_definition/function/control.md +++ /dev/null @@ -1,93 +0,0 @@ -## return -Will return the given value. - -```json -{ - "runtime_name": "std::control::return", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "GenericKey": "R" - } - }, - "runtime_name": "value", - "name": [ - { - "code": "en-US", - "content": "Return Value" - } - ], - "description": [ - { - "code": "en-US", - "content": "The value to be returned." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "This value will be returned to the upper context." - } - ] - } - ], - "return_type_identifier": { - "type": { - "GenericKey": "R" - } - }, - "name": [ - { - "code": "en-US", - "content": "Return" - } - ], - "description": [ - { - "code": "en-US", - "content": "Returns the specified value to the upper context." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Returns the specified value to the upper context." - } - ], - "generic_keys": ["R"], - "deprecation_message": [], - "throws_error": false -} -``` - -## break -Will break the current loop. - -```json -{ - "runtime_name": "std::control::break", - "name": [ - { - "code": "en-US", - "content": "Break" - } - ], - "description": [ - { - "code": "en-US", - "content": "Breaks the current loop." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Breaks the current loop." - } - ], - "runtime_parameter_definitions": [], - "generic_keys": [], - "deprecation_message": [], - "throws_error": false -} -``` diff --git a/definitions/standard/runtime_definition/primitive/number-audit.md b/definitions/standard/runtime_definition/number/number-audit.md similarity index 100% rename from definitions/standard/runtime_definition/primitive/number-audit.md rename to definitions/standard/runtime_definition/number/number-audit.md diff --git a/definitions/standard/runtime_definition/object/object.md b/definitions/standard/runtime_definition/object/object.md deleted file mode 100644 index 4d5c105..0000000 --- a/definitions/standard/runtime_definition/object/object.md +++ /dev/null @@ -1,337 +0,0 @@ -## containsKey -```json -{ - "runtime_name": "std::object::contains_key", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "OBJECT" - } - }, - "runtime_name": "object", - "name": [ - { - "code": "en-US", - "content": "Object" - } - ], - "description": [ - { - "code": "en-US", - "content": "The object to check for the presence of a key." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "The object within which the existence of the specified key will be checked." - } - ] - }, - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "runtime_name": "key", - "name": [ - { - "code": "en-US", - "content": "Key" - } - ], - "description": [ - { - "code": "en-US", - "content": "The key to check for existence in the object." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "The property key whose presence in the object is being tested." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "BOOLEAN" - } - }, - "name": [ - { - "code": "en-US", - "content": "Contains Key" - } - ], - "description": [ - { - "code": "en-US", - "content": "Checks whether the specified key exists in the object." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Returns true if the given key is a property of the object; otherwise, returns false." - } - ], - "deprecation_message": [], - "generic_keys": [], - "throws_error": false -} -``` - - -## keys -```json -{ - "runtime_name": "std::object::keys", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "OBJECT" - } - }, - "runtime_name": "object", - "name": [ - { - "code": "en-US", - "content": "Object" - } - ], - "description": [ - { - "code": "en-US", - "content": "The object whose keys will be retrieved." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Returns an array of all the keys (property names) of the given object." - } - ] - } - ], - "return_type_identifier": { - "type": { - "GenericType": { - "data_type_identifier": "ARRAY", - "generic_mappers": [ - { - "source": [ - { - "type": { - "DataTypeIdentifier": "TEXT" - } - } - ], - "target": "T", - "generic_combinations": [] - } - ] - } - } - }, - "generic_keys": [], - "name": [ - { - "code": "en-US", - "content": "Get Object Keys" - } - ], - "description": [ - { - "code": "en-US", - "content": "Retrieves all the keys from the given object as an array of text values." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Returns an array containing all enumerable property names (keys) of the specified object." - } - ], - "deprecation_message": [], - "throws_error": false -} -``` - -## size -```json -{ - "runtime_name": "std::object::size", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "OBJECT" - } - }, - "runtime_name": "object", - "name": [ - { - "code": "en-US", - "content": "Object" - } - ], - "description": [ - { - "code": "en-US", - "content": "The object whose size (number of keys) will be calculated." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Returns the number of enumerable keys (properties) present in the given object." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "name": [ - { - "code": "en-US", - "content": "Get Object Size" - } - ], - "description": [ - { - "code": "en-US", - "content": "Calculates the number of keys in the provided object." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Returns an integer count of all enumerable property keys in the specified object." - } - ], - "deprecation_message": [], - "generic_keys": [], - "throws_error": false -} -``` - -## set -```json -{ - "runtime_name": "std::object::set", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "OBJECT" - } - }, - "runtime_name": "object", - "name": [ - { - "code": "en-US", - "content": "Object" - } - ], - "description": [ - { - "code": "en-US", - "content": "The object in which the key-value pair will be set." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "The original object that will be modified with the specified key-value pair." - } - ] - }, - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "runtime_name": "key", - "name": [ - { - "code": "en-US", - "content": "Key" - } - ], - "description": [ - { - "code": "en-US", - "content": "The key to set or update in the object." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "The property name under which the value will be stored in the object." - } - ] - }, - { - "data_type_identifier": { - "type": { - "GenericKey": "I" - } - }, - "runtime_name": "value", - "name": [ - { - "code": "en-US", - "content": "Value" - } - ], - "description": [ - { - "code": "en-US", - "content": "The value to set for the specified key." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "The value to assign to the object property identified by the key." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "OBJECT" - } - }, - "name": [ - { - "code": "en-US", - "content": "Set Object Key" - } - ], - "description": [ - { - "code": "en-US", - "content": "Sets or updates a key-value pair in the given object." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Returns a new object with the specified key set to the given value." - } - ], - "generic_keys": ["I"], - "deprecation_message": [], - "throws_error": false -} -``` diff --git a/definitions/standard/runtime_definition/primitive/boolean.md b/definitions/standard/runtime_definition/primitive/boolean.md deleted file mode 100644 index eee7f0b..0000000 --- a/definitions/standard/runtime_definition/primitive/boolean.md +++ /dev/null @@ -1,437 +0,0 @@ -# std for PRIMITIVE: BOOLEAN - -## asNumber -Will convert the boolean to a number. - -```json -{ - "runtime_name": "std::boolean::as_number", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "BOOLEAN" - } - }, - "runtime_name": "value", - "name": [ - { - "code": "en-US", - "content": "Value" - } - ], - "description": [ - { - "code": "en-US", - "content": "The boolean value to convert." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Converts a boolean value to a number." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "name": [ - { - "code": "en-US", - "content": "As Number" - } - ], - "description": [ - { - "code": "en-US", - "content": "Will convert the boolean to a number." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Converts a boolean value to a number." - } - ], - "deprecation_message": [], - "throws_error": false, - "generic_keys": [] -} -``` - -**Example**: - -false --> 0 - -true --> 1 - -## asText -Will convert the boolean to a string. - -```json -{ - "runtime_name": "std::boolean::as_text", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "BOOLEAN" - } - }, - "runtime_name": "value", - "name": [ - { - "code": "en-US", - "content": "Value" - } - ], - "description": [ - { - "code": "en-US", - "content": "The boolean value to convert." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Converts a boolean value to a text string." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "name": [ - { - "code": "en-US", - "content": "As Text" - } - ], - "description": [ - { - "code": "en-US", - "content": "Will convert the boolean to text." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Converts a boolean value to a text string." - } - ], - "deprecation_message": [], - "throws_error": false, - "generic_keys": [] -} -``` - -**Example**: - -false --> "false" - -true --> "true" - - -## fromNumber -Will convert the number to a boolean. - -```json -{ - "runtime_name": "std::boolean::from_number", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "runtime_name": "value", - "name": [ - { - "code": "en-US", - "content": "Value" - } - ], - "description": [ - { - "code": "en-US", - "content": "The number to convert." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Converts a number to a boolean value." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "BOOLEAN" - } - }, - "name": [ - { - "code": "en-US", - "content": "From Number" - } - ], - "description": [ - { - "code": "en-US", - "content": "Will convert the number to a boolean." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Converts a number to a boolean value. Typically, 0 maps to false and non-zero maps to true." - } - ], - "deprecation_message": [], - "throws_error": false, - "generic_keys": [] -} -``` - -**Example**: - -0 --> false - -1 --> true - - -## fromText -Will convert the string to a boolean. - -```json -{ - "runtime_name": "std::boolean::from_text", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "runtime_name": "value", - "name": [ - { - "code": "en-US", - "content": "Value" - } - ], - "description": [ - { - "code": "en-US", - "content": "The text string to convert." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Converts a text string to a boolean value." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "BOOLEAN" - } - }, - "name": [ - { - "code": "en-US", - "content": "From Text" - } - ], - "description": [ - { - "code": "en-US", - "content": "Will convert the string to a boolean." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Converts a text string to a boolean value. Recognizes 'true' and 'false' (case-insensitive)." - } - ], - "deprecation_message": [], - "throws_error": false, - "generic_keys": [] -} -``` - -**Example**: - -"false" --> false - -"true" --> true - -## negate -Will negate the boolean value. - -```json -{ - "runtime_name": "std::boolean::negate", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "BOOLEAN" - } - }, - "runtime_name": "value", - "name": [ - { - "code": "en-US", - "content": "Value" - } - ], - "description": [ - { - "code": "en-US", - "content": "The boolean value to negate." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Negates a boolean value." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "BOOLEAN" - } - }, - "name": [ - { - "code": "en-US", - "content": "Negate" - } - ], - "description": [ - { - "code": "en-US", - "content": "Negates a boolean value." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Negates a boolean value." - } - ], - "deprecation_message": [], - "throws_error": false, - "generic_keys": [] -} -``` - -## isEqual -Will compare one boolean to another. - -```json -{ - "runtime_name": "std::boolean::is_equal", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "BOOLEAN" - } - }, - "runtime_name": "first", - "name": [ - { - "code": "en-US", - "content": "First" - } - ], - "description": [ - { - "code": "en-US", - "content": "The first boolean value to compare." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "The first input to compare." - } - ] - }, - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "BOOLEAN" - } - }, - "runtime_name": "second", - "name": [ - { - "code": "en-US", - "content": "Second" - } - ], - "description": [ - { - "code": "en-US", - "content": "The second boolean value to compare." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "The second input to compare." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "BOOLEAN" - } - }, - "name": [ - { - "code": "en-US", - "content": "Is Equal" - } - ], - "description": [ - { - "code": "en-US", - "content": "Will check if the two booleans are equal." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Compares two boolean values for equality. Returns true if they are the same, false otherwise." - } - ], - "deprecation_message": [], - "throws_error": false, - "generic_keys": [] -} -``` - -**Example**: - -false, false --> true - -true, false --> false diff --git a/definitions/standard/runtime_definition/primitive/number.md b/definitions/standard/runtime_definition/primitive/number.md deleted file mode 100644 index 3699e19..0000000 --- a/definitions/standard/runtime_definition/primitive/number.md +++ /dev/null @@ -1,3023 +0,0 @@ -# std for PRIMITIVE: NUMBER - -## add -Adds two numbers together. - -```json -{ - "runtime_name": "std::number::add", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "runtime_name": "first", - "name": [ - { - "code": "en-US", - "content": "First Number" - } - ], - "description": [ - { - "code": "en-US", - "content": "The first number to add." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Adds two numbers together." - } - ] - }, - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "runtime_name": "second", - "name": [ - { - "code": "en-US", - "content": "Second Number" - } - ], - "description": [ - { - "code": "en-US", - "content": "The second number to add." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Adds two numbers together." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "name": [ - { - "code": "en-US", - "content": "Adds two numbers together." - } - ], - "description": [ - { - "code": "en-US", - "content": "Adds two numbers together." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Adds two numbers together." - } - ], - "deprecation_message": [], - "throws_error": false, - "generic_keys": [] -} -``` - -**Example**: - -3 + 2 --> 5 - -## multiply -Multiplies two numbers together. - -```json -{ - "runtime_name": "std::number::multiply", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "runtime_name": "first", - "name": [ - { - "code": "en-US", - "content": "First Number" - } - ], - "description": [ - { - "code": "en-US", - "content": "The first number to multiply." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Specifies the first operand in the multiplication operation." - } - ] - }, - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "runtime_name": "second", - "name": [ - { - "code": "en-US", - "content": "Second Number" - } - ], - "description": [ - { - "code": "en-US", - "content": "The second number to multiply." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Specifies the second operand in the multiplication operation." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "throws_error": false, - "name": [ - { - "code": "en-US", - "content": "Multiply" - } - ], - "description": [ - { - "code": "en-US", - "content": "Multiplies two numbers together." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Takes two numeric inputs and returns their product." - } - ], - "deprecation_message": [], - "generic_keys": [] -} -``` - -**Example**: - -3 * 2 --> 6 - -## subtract -Subtracts the second number from the first. - -```json -{ - "runtime_name": "std::number::subtract", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "runtime_name": "first", - "name": [ - { - "code": "en-US", - "content": "Minuend" - } - ], - "description": [ - { - "code": "en-US", - "content": "The number from which another number (the subtrahend) is to be subtracted." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "This is the number that will have the second value subtracted from it." - } - ] - }, - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "runtime_name": "second", - "name": [ - { - "code": "en-US", - "content": "Subtrahend" - } - ], - "description": [ - { - "code": "en-US", - "content": "The number to subtract from the first number (the minuend)." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "This is the value that will be subtracted from the first number." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "throws_error": false, - "name": [ - { - "code": "en-US", - "content": "Subtract" - } - ], - "description": [ - { - "code": "en-US", - "content": "Subtracts the second number from the first number." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Returns the result of subtracting the second numeric input from the first." - } - ], - "deprecation_message": [], - "generic_keys": [] -} -``` - -**Example**: - -5 - 2 --> 3 - -## divide -Divides the first number by the second. - -```json -{ - "runtime_name": "std::number::divide", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "runtime_name": "first", - "name": [ - { - "code": "en-US", - "content": "Dividend" - } - ], - "description": [ - { - "code": "en-US", - "content": "The number to be divided." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "This is the numerator or the number that will be divided by the second value." - } - ] - }, - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "runtime_name": "second", - "name": [ - { - "code": "en-US", - "content": "Divisor" - } - ], - "description": [ - { - "code": "en-US", - "content": "The number by which to divide the first number." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "This is the denominator or the value that divides the first number." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "throws_error": false, - "name": [ - { - "code": "en-US", - "content": "Divide" - } - ], - "description": [ - { - "code": "en-US", - "content": "Divides the first number by the second number." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Returns the result of dividing the first numeric input (dividend) by the second (divisor)." - } - ], - "deprecation_message": [], - "generic_keys": [] -} -``` - -**Example**: - -6 / 2 --> 3 - -## modulo -Returns the remainder after division of the first number by the second. - -```json -{ - "runtime_name": "std::number::modulo", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "runtime_name": "first", - "name": [ - { - "code": "en-US", - "content": "Dividend" - } - ], - "description": [ - { - "code": "en-US", - "content": "The number to be divided to find the remainder." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "This is the number that will be divided by the second value to calculate the remainder." - } - ] - }, - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "runtime_name": "second", - "name": [ - { - "code": "en-US", - "content": "Divisor" - } - ], - "description": [ - { - "code": "en-US", - "content": "The number by which the first number is divided to get the remainder." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "This is the number used to divide the dividend and obtain the remainder." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "throws_error": false, - "name": [ - { - "code": "en-US", - "content": "Modulo" - } - ], - "description": [ - { - "code": "en-US", - "content": "Returns the remainder after dividing the first number by the second." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Computes the modulus (remainder) of dividing the first numeric input by the second." - } - ], - "deprecation_message": [], - "generic_keys": [] -} -``` - -**Example**: - -7 % 3 --> 1 - -## abs -Converts a number to its absolute value. - -```json -{ - "runtime_name": "std::number::abs", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "runtime_name": "value", - "name": [ - { - "code": "en-US", - "content": "Value" - } - ], - "description": [ - { - "code": "en-US", - "content": "The number for which to compute the absolute value." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "This is the numeric input. The result will be its absolute (non-negative) value." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "throws_error": false, - "name": [ - { - "code": "en-US", - "content": "Absolute Value" - } - ], - "description": [ - { - "code": "en-US", - "content": "Returns the absolute value of a number." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Removes the sign from the input number, returning its non-negative value." - } - ], - "deprecation_message": [], - "generic_keys": [] -} -``` - -**Example**: - --5 --> 5 - -## isPositive -Checks if a number is positive. - -```json -{ - "runtime_name": "std::number::is_positive", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "runtime_name": "value", - "name": [ - { - "code": "en-US", - "content": "Value" - } - ], - "description": [ - { - "code": "en-US", - "content": "The number to check for positivity." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "This is the numeric input that will be evaluated to determine whether it is greater than zero." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "BOOLEAN" - } - }, - "throws_error": false, - "name": [ - { - "code": "en-US", - "content": "Is Positive" - } - ], - "description": [ - { - "code": "en-US", - "content": "Checks whether a number is greater than zero." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Evaluates the input number and returns true if it is positive (greater than zero), otherwise false." - } - ], - "deprecation_message": [], - "generic_keys": [] -} -``` - -**Example**: - -5 --> true --2 --> false - -## isGreater -Checks if the first number is greater than the second. - -```json -{ - "runtime_name": "std::number::is_greater", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "runtime_name": "first", - "name": [ - { - "code": "en-US", - "content": "First Number" - } - ], - "description": [ - { - "code": "en-US", - "content": "The number to compare against the second number." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "This is the number that will be evaluated to determine if it is greater than the second number." - } - ] - }, - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "runtime_name": "second", - "name": [ - { - "code": "en-US", - "content": "Second Number" - } - ], - "description": [ - { - "code": "en-US", - "content": "The number to compare with the first number." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "This is the number that the first number will be compared to." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "BOOLEAN" - } - }, - "throws_error": false, - "name": [ - { - "code": "en-US", - "content": "Is Greater" - } - ], - "description": [ - { - "code": "en-US", - "content": "Checks whether the first number is greater than the second number." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Returns true if the first numeric input is greater than the second; otherwise, returns false." - } - ], - "deprecation_message": [], - "generic_keys": [] -} -``` - -**Example**: - -5 > 3 --> true -2 > 4 --> false - -## isLess -Checks if the first number is lower than the second. - -```json -{ - "runtime_name": "std::number::is_less", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "runtime_name": "first", - "name": [ - { - "code": "en-US", - "content": "First Number" - } - ], - "description": [ - { - "code": "en-US", - "content": "The number to compare with the second number." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "This is the number that will be evaluated to determine if it is less than the second number." - } - ] - }, - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "runtime_name": "second", - "name": [ - { - "code": "en-US", - "content": "Second Number" - } - ], - "description": [ - { - "code": "en-US", - "content": "The number to compare against the first number." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "This is the number that the first number will be compared to." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "BOOLEAN" - } - }, - "throws_error": false, - "name": [ - { - "code": "en-US", - "content": "Is Less" - } - ], - "description": [ - { - "code": "en-US", - "content": "Checks whether the first number is less than the second number." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Returns true if the first numeric input is less than the second; otherwise, returns false." - } - ], - "deprecation_message": [], - "generic_keys": [] -} -``` - -**Example**: - -3 < 5 --> true -4 < 2 --> false - -## isZero -Checks if a number is zero. - -```json -{ - "runtime_name": "std::number::is_zero", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "runtime_name": "value", - "name": [ - { - "code": "en-US", - "content": "Value" - } - ], - "description": [ - { - "code": "en-US", - "content": "The number to check if it is zero." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "This is the numeric input evaluated to determine whether it equals zero." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "BOOLEAN" - } - }, - "throws_error": false, - "name": [ - { - "code": "en-US", - "content": "Is Zero" - } - ], - "description": [ - { - "code": "en-US", - "content": "Checks whether the given number is exactly zero." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Returns true if the input number is zero; otherwise, returns false." - } - ], - "deprecation_message": [], - "generic_keys": [] -} -``` - -**Example**: - -0 --> true -5 --> false - -## square -Multiplies a number by itself. - -```json -{ - "runtime_name": "std::number::square", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "runtime_name": "value", - "name": [ - { - "code": "en-US", - "content": "Value" - } - ], - "description": [ - { - "code": "en-US", - "content": "The number to be squared." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "This is the numeric input that will be multiplied by itself." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "throws_error": false, - "name": [ - { - "code": "en-US", - "content": "Square" - } - ], - "description": [ - { - "code": "en-US", - "content": "Returns the square of the given number." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Calculates the value multiplied by itself, effectively raising it to the power of 2." - } - ], - "deprecation_message": [], - "generic_keys": [] -} -``` - -**Example**: - -4 --> 16 - -## exponential -Raises a number to the specified power. - -```json -{ - "runtime_name": "std::number::exponential", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "runtime_name": "base", - "name": [ - { - "code": "en-US", - "content": "Base" - } - ], - "description": [ - { - "code": "en-US", - "content": "The base number to be raised to a power." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "This is the numeric value that will be raised to the power of the exponent." - } - ] - }, - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "runtime_name": "exponent", - "name": [ - { - "code": "en-US", - "content": "Exponent" - } - ], - "description": [ - { - "code": "en-US", - "content": "The exponent to raise the base number by." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "This numeric value indicates the power to which the base is raised." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "throws_error": false, - "name": [ - { - "code": "en-US", - "content": "Exponential" - } - ], - "description": [ - { - "code": "en-US", - "content": "Raises a base number to the power of an exponent." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Computes the result of raising the base to the power specified by the exponent." - } - ], - "deprecation_message": [], - "generic_keys": [] -} -``` - -**Example**: - -2^3 --> 8 - -## PI -Returns the mathematical constant Pi. - -```json -{ - "runtime_name": "std::number::pi", - "runtime_parameter_definitions": [], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "throws_error": false, - "name": [ - { - "code": "en-US", - "content": "Pi" - } - ], - "description": [ - { - "code": "en-US", - "content": "Returns the mathematical constant π (pi)." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Provides the constant value of pi, approximately 3.14159, used in many mathematical calculations." - } - ], - "deprecation_message": [], - "generic_keys": [] -} -``` - -**Example**: - -PI --> 3.14159265359... - -## EULER -Returns the mathematical constant e (Euler's number). - -```json -{ - "runtime_name": "std::number::euler", - "runtime_parameter_definitions": [], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "throws_error": false, - "name": [ - { - "code": "en-US", - "content": "Euler's Number" - } - ], - "description": [ - { - "code": "en-US", - "content": "Returns the mathematical constant e (Euler's number)." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Provides the constant value of Euler's number, approximately 2.71828, which is the base of the natural logarithm." - } - ], - "deprecation_message": [], - "generic_keys": [] -} -``` - -**Example**: - -EULER --> 2.71828182846... - -## INFINITY -Returns the representation of infinity. - -```json -{ - "runtime_name": "std::number::infinity", - "runtime_parameter_definitions": [], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "throws_error": false, - "name": [ - { - "code": "en-US", - "content": "Infinity" - } - ], - "description": [ - { - "code": "en-US", - "content": "Returns the mathematical concept of positive infinity." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Provides the representation of positive infinity, used to represent an unbounded value in computations." - } - ], - "deprecation_message": [], - "generic_keys": [] -} -``` - -**Example**: - -INFINITY --> ∞ - -## roundUp -Rounds a number up to the nearest integer. - -```json -{ - "runtime_name": "std::number::round_up", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "runtime_name": "value", - "name": [ - { - "code": "en-US", - "content": "Value" - } - ], - "description": [ - { - "code": "en-US", - "content": "The number to be rounded up." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "The numeric input that will be rounded upwards." - } - ] - }, - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "runtime_name": "decimals", - "name": [ - { - "code": "en-US", - "content": "Decimal Places" - } - ], - "description": [ - { - "code": "en-US", - "content": "The number of decimal places to round up to." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Specifies how many decimal digits to keep after rounding up." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "throws_error": false, - "name": [ - { - "code": "en-US", - "content": "Round Up" - } - ], - "description": [ - { - "code": "en-US", - "content": "Rounds a number upward to the specified number of decimal places." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Performs rounding on the given value, always rounding up to the nearest value at the given decimal precision." - } - ], - "deprecation_message": [], - "generic_keys": [] -} -``` - -**Example**: - -3.2 (0) --> 4 -3.8 (0) --> 4 -3.008 (3) --> 3.009 -3.008 (1) --> 3.1 - -## roundDown -Rounds a number down to the nearest integer. - -```json -{ - "runtime_name": "std::number::round_down", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "runtime_name": "value", - "name": [ - { - "code": "en-US", - "content": "Value" - } - ], - "description": [ - { - "code": "en-US", - "content": "The number to be rounded down." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "The numeric input that will be rounded downwards." - } - ] - }, - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "runtime_name": "decimals", - "name": [ - { - "code": "en-US", - "content": "Decimal Places" - } - ], - "description": [ - { - "code": "en-US", - "content": "The number of decimal places to round down to." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Specifies how many decimal digits to keep after rounding down." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "throws_error": false, - "name": [ - { - "code": "en-US", - "content": "Round Down" - } - ], - "description": [ - { - "code": "en-US", - "content": "Rounds a number downward to the specified number of decimal places." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Performs rounding on the given value, always rounding down to the nearest value at the given decimal precision." - } - ], - "deprecation_message": [], - "generic_keys": [] -} -``` - -**Example**: - -3.2 (0) --> 3 -3.8 (0) --> 3 - -3.002 (1) --> 3 -3.778 (2) --> 3.7 - -## round -Rounds a number to the nearest integer. - -```json -{ - "runtime_name": "std::number::round", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "runtime_name": "value", - "name": [ - { - "code": "en-US", - "content": "Value" - } - ], - "description": [ - { - "code": "en-US", - "content": "The number to be rounded." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "The numeric input that will be rounded to the nearest value." - } - ] - }, - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "runtime_name": "decimals", - "name": [ - { - "code": "en-US", - "content": "Decimal Places" - } - ], - "description": [ - { - "code": "en-US", - "content": "The number of decimal places to round to." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Specifies how many decimal digits to keep after rounding." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "throws_error": false, - "name": [ - { - "code": "en-US", - "content": "Round" - } - ], - "description": [ - { - "code": "en-US", - "content": "Rounds a number to the nearest value at the specified number of decimal places." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Performs standard rounding on the given value, rounding up or down depending on the fractional component." - } - ], - "deprecation_message": [], - "generic_keys": [] -} -``` - -**Example**: - -3.2 (0) --> 3 -3.8 (0) --> 4 - -3.002 (1) --> 3 -3.778 (2) --> 3.78 - -## squareRoot -Calculates the square root of a number. - -```json -{ - "runtime_name": "std::number::square_root", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "runtime_name": "value", - "name": [ - { - "code": "en-US", - "content": "Value" - } - ], - "description": [ - { - "code": "en-US", - "content": "The number to find the square root of." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "The numeric input for which the square root will be calculated." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "throws_error": false, - "name": [ - { - "code": "en-US", - "content": "Square Root" - } - ], - "description": [ - { - "code": "en-US", - "content": "Returns the square root of the given number." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Calculates the positive square root of the input number." - } - ], - "deprecation_message": [], - "generic_keys": [] -} -``` - -**Example**: - -16 --> 4 - -## root -Calculates the nth root of a number. - -```json -{ - "runtime_name": "std::number::root", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "runtime_name": "value", - "name": [ - { - "code": "en-US", - "content": "Value" - } - ], - "description": [ - { - "code": "en-US", - "content": "The number from which the root will be extracted." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "The numeric input for which the root will be calculated." - } - ] - }, - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "runtime_name": "root_exponent", - "name": [ - { - "code": "en-US", - "content": "Root Exponent" - } - ], - "description": [ - { - "code": "en-US", - "content": "The degree of the root to extract." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Specifies which root to calculate (e.g., 2 for square root, 3 for cube root)." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "throws_error": false, - "name": [ - { - "code": "en-US", - "content": "Root" - } - ], - "description": [ - { - "code": "en-US", - "content": "Returns the root of a number given a root exponent." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Calculates the nth root of the input number, where n is specified by the root exponent." - } - ], - "deprecation_message": [], - "generic_keys": [] -} -``` - -**Example**: - -27, 3 --> 3 (cube root of 27) - -## log -Calculates the logarithm of a number with the specified base. - -```json -{ - "runtime_name": "std::number::log", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "runtime_name": "value", - "name": [ - { - "code": "en-US", - "content": "Value" - } - ], - "description": [ - { - "code": "en-US", - "content": "The number to compute the logarithm for." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "The numeric input whose logarithm is to be calculated." - } - ] - }, - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "runtime_name": "base", - "name": [ - { - "code": "en-US", - "content": "Base" - } - ], - "description": [ - { - "code": "en-US", - "content": "The base of the logarithm." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Specifies the logarithmic base to use (e.g., 10 for common log, e for natural log)." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "throws_error": false, - "name": [ - { - "code": "en-US", - "content": "Logarithm" - } - ], - "description": [ - { - "code": "en-US", - "content": "Calculates the logarithm of a number with respect to a specified base." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Returns the logarithm of the given value using the specified base." - } - ], - "deprecation_message": [], - "generic_keys": [] -} -``` - -**Example**: - -100, 10 --> 2 (log base 10 of 100) - -## ln -Calculates the natural logarithm (base e) of a number. - -```json -{ - "runtime_name": "std::number::ln", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "runtime_name": "value", - "name": [ - { - "code": "en-US", - "content": "Value" - } - ], - "description": [ - { - "code": "en-US", - "content": "The number to compute the natural logarithm for." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "The numeric input whose natural logarithm (log base e) will be calculated." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "throws_error": false, - "name": [ - { - "code": "en-US", - "content": "Natural Logarithm" - } - ], - "description": [ - { - "code": "en-US", - "content": "Calculates the natural logarithm (log base e) of a number." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Returns the natural logarithm of the given value." - } - ], - "deprecation_message": [], - "generic_keys": [] -} -``` - -**Example**: - -2.71828... --> 1 (ln of e) - -## fromText -Converts a string to a number. - -```json -{ - "runtime_name": "std::number::from_text", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "runtime_name": "text", - "name": [ - { - "code": "en-US", - "content": "Text" - } - ], - "description": [ - { - "code": "en-US", - "content": "The text string to convert to a number." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Parses the input text and attempts to convert it to a numeric value." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "throws_error": false, - "name": [ - { - "code": "en-US", - "content": "Number from Text" - } - ], - "description": [ - { - "code": "en-US", - "content": "Converts a text string into a number if possible." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Attempts to parse the provided text input and return its numeric equivalent." - } - ], - "deprecation_message": [], - "generic_keys": [] -} -``` - -**Example**: - -"123" --> 123 -"3.14" --> 3.14 - -## asText -Converts a number to a text. - -```json -{ - "runtime_name": "std::number::as_text", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "runtime_name": "number", - "name": [ - { - "code": "en-US", - "content": "Number" - } - ], - "description": [ - { - "code": "en-US", - "content": "The number to convert to text." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "The numeric input that will be converted to its text representation." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "throws_error": false, - "name": [ - { - "code": "en-US", - "content": "Number as Text" - } - ], - "description": [ - { - "code": "en-US", - "content": "Converts a number into its textual representation." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Transforms the given numeric value into a string format." - } - ], - "deprecation_message": [], - "generic_keys": [] -} -``` - -**Example**: - -123 --> "123" -3.14 --> "3.14" - - -## min -Returns the smaller of two numbers. - -```json -{ - "runtime_name": "std::number::min", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "runtime_name": "first", - "name": [ - { - "code": "en-US", - "content": "First Number" - } - ], - "description": [ - { - "code": "en-US", - "content": "The first number to compare." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "One of the two numbers for which the minimum value will be determined." - } - ] - }, - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "runtime_name": "second", - "name": [ - { - "code": "en-US", - "content": "Second Number" - } - ], - "description": [ - { - "code": "en-US", - "content": "The second number to compare." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "The other number involved in the minimum value comparison." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "throws_error": false, - "name": [ - { - "code": "en-US", - "content": "Minimum" - } - ], - "description": [ - { - "code": "en-US", - "content": "Returns the smaller of two numbers." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Compares two numbers and returns the minimum value." - } - ], - "deprecation_message": [], - "generic_keys": [] -} -``` - -**Example**: - -5, 3 --> 3 --1, 2 --> -1 - -## max -Returns the larger of two numbers. - -```json -{ - "runtime_name": "std::number::max", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "runtime_name": "first", - "name": [ - { - "code": "en-US", - "content": "First Number" - } - ], - "description": [ - { - "code": "en-US", - "content": "The first number to compare." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "One of the two numbers for which the maximum value will be determined." - } - ] - }, - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "runtime_name": "second", - "name": [ - { - "code": "en-US", - "content": "Second Number" - } - ], - "description": [ - { - "code": "en-US", - "content": "The second number to compare." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "The other number involved in the maximum value comparison." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "throws_error": false, - "name": [ - { - "code": "en-US", - "content": "Maximum" - } - ], - "description": [ - { - "code": "en-US", - "content": "Returns the larger of two numbers." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Compares two numbers and returns the maximum value." - } - ], - "deprecation_message": [], - "generic_keys": [] -} -``` - -**Example**: - -5, 3 --> 5 --1, 2 --> 2 - -## negate -Returns the additive inverse of a number. - -```json -{ - "runtime_name": "std::number::negate", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "runtime_name": "value", - "name": [ - { - "code": "en-US", - "content": "Value" - } - ], - "description": [ - { - "code": "en-US", - "content": "The number to negate." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "The numeric input whose sign will be inverted." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "throws_error": false, - "name": [ - { - "code": "en-US", - "content": "Negate" - } - ], - "description": [ - { - "code": "en-US", - "content": "Returns the negation of a number (multiplies by -1)." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Calculates the additive inverse of the given number." - } - ], - "deprecation_message": [], - "generic_keys": [] -} -``` - -**Example**: - -5 --> -5 --3 --> 3 - -## randomNumber -Generates a random number between the specified minimum and maximum values. - -```json -{ - "runtime_name": "std::number::random_number", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "runtime_name": "min", - "name": [ - { - "code": "en-US", - "content": "Minimum" - } - ], - "description": [ - { - "code": "en-US", - "content": "The minimum value in the random number range." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Defines the lower bound (inclusive) for the random number generation." - } - ] - }, - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "runtime_name": "max", - "name": [ - { - "code": "en-US", - "content": "Maximum" - } - ], - "description": [ - { - "code": "en-US", - "content": "The maximum value in the random number range." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Defines the upper bound (inclusive) for the random number generation." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "name": [ - { - "code": "en-US", - "content": "Random Number" - } - ], - "description": [ - { - "code": "en-US", - "content": "Generates a random number between the specified minimum and maximum values." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Returns a randomly generated number within the given range, inclusive of both minimum and maximum." - } - ], - "throws_error": false, - "deprecation_message": [], - "generic_keys": [] -} -``` - -**Example**: - -1, 6 --> 3 (random number between 1 and 6, inclusive) - -## sin -Calculates the sine of an angle (in radians). - -```json -{ - "runtime_name": "std::number::sin", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "runtime_name": "min", - "name": [ - { - "code": "en-US", - "content": "Minimum Value" - } - ], - "description": [ - { - "code": "en-US", - "content": "The lower bound of the random number range." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Defines the minimum value (inclusive) for the random number generation." - } - ] - }, - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "runtime_name": "max", - "name": [ - { - "code": "en-US", - "content": "Maximum Value" - } - ], - "description": [ - { - "code": "en-US", - "content": "The upper bound of the random number range." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Defines the maximum value (inclusive) for the random number generation." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "throws_error": false, - "name": [ - { - "code": "en-US", - "content": "Random Number" - } - ], - "description": [ - { - "code": "en-US", - "content": "Generates a random number within the specified range." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Returns a pseudo-random number between the given minimum and maximum values." - } - ], - "deprecation_message": [], - "generic_keys": [] -} -``` - -**Example**: - -0 --> 0 -1.5708 (π/2) --> 1 - -## cos -Calculates the cosine of an angle (in radians). - -```json -{ - "runtime_name": "std::number::cos", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "runtime_name": "radians", - "name": [ - { - "code": "en-US", - "content": "Radians" - } - ], - "description": [ - { - "code": "en-US", - "content": "The angle in radians to compute the cosine of." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Computes the cosine of the given angle in radians." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "throws_error": false, - "name": [ - { - "code": "en-US", - "content": "Cosine" - } - ], - "description": [ - { - "code": "en-US", - "content": "Returns the cosine of the specified angle in radians." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Calculates the cosine value of the input angle measured in radians." - } - ], - "deprecation_message": [], - "generic_keys": [] -} -``` - -**Example**: - -0 --> 1 -3.14159 (π) --> -1 - -## tan -Calculates the tangent of an angle (in radians). - -```json -{ - "runtime_name": "std::number::tan", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "runtime_name": "radians", - "name": [ - { - "code": "en-US", - "content": "Radians" - } - ], - "description": [ - { - "code": "en-US", - "content": "The angle in radians to compute the tangent of." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Computes the tangent of the given angle in radians." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "throws_error": false, - "name": [ - { - "code": "en-US", - "content": "Tangent" - } - ], - "description": [ - { - "code": "en-US", - "content": "Returns the tangent of the specified angle in radians." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Calculates the tangent value of the input angle measured in radians." - } - ], - "deprecation_message": [], - "generic_keys": [] -} -``` - -**Example**: - -0 --> 0 -0.7854 (π/4) --> 1 - -## arcsin -Calculates the inverse sine (in radians). - -```json -{ - "runtime_name": "std::number::arcsin", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "runtime_name": "value", - "name": [ - { - "code": "en-US", - "content": "Value" - } - ], - "description": [ - { - "code": "en-US", - "content": "The number representing the sine value, must be between -1 and 1." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Calculates the arcsine (inverse sine) of the input value." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "throws_error": false, - "name": [ - { - "code": "en-US", - "content": "Arcsine" - } - ], - "description": [ - { - "code": "en-US", - "content": "Returns the arcsine of a number, in radians." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Computes the angle in radians whose sine is the given number." - } - ], - "deprecation_message": [], - "generic_keys": [] -} -``` - -**Example**: - -0 --> 0 -1 --> 1.5708 (π/2) - -## arccos -Calculates the inverse cosine (in radians). - -```json -{ - "runtime_name": "std::number::arccos", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "runtime_name": "value", - "name": [ - { - "code": "en-US", - "content": "Value" - } - ], - "description": [ - { - "code": "en-US", - "content": "The number representing the cosine value, must be between -1 and 1." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Calculates the arccosine (inverse cosine) of the input value." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "throws_error": false, - "name": [ - { - "code": "en-US", - "content": "Arccosine" - } - ], - "description": [ - { - "code": "en-US", - "content": "Returns the arccosine of a number, in radians." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Computes the angle in radians whose cosine is the given number." - } - ], - "deprecation_message": [], - "generic_keys": [] -} -``` - -**Example**: - -1 --> 0 --1 --> 3.14159 (π) - -## arctan -Calculates the inverse tangent (in radians). - -```json -{ - "runtime_name": "std::number::arctan", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "runtime_name": "value", - "name": [ - { - "code": "en-US", - "content": "Value" - } - ], - "description": [ - { - "code": "en-US", - "content": "The number representing the tangent value." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Calculates the arctangent (inverse tangent) of the input value." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "throws_error": false, - "name": [ - { - "code": "en-US", - "content": "Arctangent" - } - ], - "description": [ - { - "code": "en-US", - "content": "Returns the arctangent of a number, in radians." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Computes the angle in radians whose tangent is the given number." - } - ], - "deprecation_message": [], - "generic_keys": [] -} -``` - -**Example**: - -0 --> 0 -1 --> 0.7854 (π/4) - -## sinh -Calculates the hyperbolic sine of a number. - -```json -{ - "runtime_name": "std::number::sinh", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "runtime_name": "value", - "name": [ - { - "code": "en-US", - "content": "Value" - } - ], - "description": [ - { - "code": "en-US", - "content": "The number for which to calculate the hyperbolic sine." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Computes the hyperbolic sine of the given number." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "throws_error": false, - "name": [ - { - "code": "en-US", - "content": "Hyperbolic Sine" - } - ], - "description": [ - { - "code": "en-US", - "content": "Returns the hyperbolic sine of a number." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Calculates the hyperbolic sine (sinh) of the input value." - } - ], - "deprecation_message": [], - "generic_keys": [] -} -``` - -**Example**: - -0 --> 0 -1 --> 1.1752 - -## cosh -Calculates the hyperbolic cosine of a number. - -```json -{ - "runtime_name": "std::number::cosh", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "runtime_name": "value", - "name": [ - { - "code": "en-US", - "content": "Value" - } - ], - "description": [ - { - "code": "en-US", - "content": "The number for which to calculate the hyperbolic cosine." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Computes the hyperbolic cosine of the given number." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "throws_error": false, - "name": [ - { - "code": "en-US", - "content": "Hyperbolic Cosine" - } - ], - "description": [ - { - "code": "en-US", - "content": "Returns the hyperbolic cosine of a number." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Calculates the hyperbolic cosine (cosh) of the input value." - } - ], - "deprecation_message": [], - "generic_keys": [] -} -``` - -**Example**: - -0 --> 1 -1 --> 1.5431 - -## clamp -Constrains a number to be within a specified range. - -```json -{ - "runtime_name": "std::number::clamp", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "runtime_name": "value", - "name": [ - { - "code": "en-US", - "content": "Value" - } - ], - "description": [ - { - "code": "en-US", - "content": "The number to be clamped within the range." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "The input number that will be limited to the specified range." - } - ] - }, - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "runtime_name": "min", - "name": [ - { - "code": "en-US", - "content": "Minimum" - } - ], - "description": [ - { - "code": "en-US", - "content": "The lower bound of the clamping range." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "The minimum allowed value in the clamping operation." - } - ] - }, - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "runtime_name": "max", - "name": [ - { - "code": "en-US", - "content": "Maximum" - } - ], - "description": [ - { - "code": "en-US", - "content": "The upper bound of the clamping range." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "The maximum allowed value in the clamping operation." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "throws_error": false, - "name": [ - { - "code": "en-US", - "content": "Clamp" - } - ], - "description": [ - { - "code": "en-US", - "content": "Limits a number to be within a specified range." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Returns the given number clamped between the minimum and maximum bounds." - } - ], - "deprecation_message": [], - "generic_keys": [] -} -``` - -**Example**: - -10, 0, 5 --> 5 (clamped to max) --3, 0, 5 --> 0 (clamped to min) -3, 0, 5 --> 3 (within range, unchanged) - -## isEqual -Will compare one boolean to another. - -```json -{ - "runtime_name": "std::number::is_equal", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "runtime_name": "first", - "name": [ - { - "code": "en-US", - "content": "First Number" - } - ], - "description": [ - { - "code": "en-US", - "content": "The first number to compare." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "The first operand in the equality check." - } - ] - }, - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "runtime_name": "second", - "name": [ - { - "code": "en-US", - "content": "Second Number" - } - ], - "description": [ - { - "code": "en-US", - "content": "The second number to compare." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "The second operand in the equality check." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "BOOLEAN" - } - }, - "throws_error": false, - "name": [ - { - "code": "en-US", - "content": "Is Equal" - } - ], - "description": [ - { - "code": "en-US", - "content": "Checks whether two numbers are equal." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Returns true if the first number is equal to the second number, otherwise false." - } - ], - "deprecation_message": [], - "generic_keys": [] -} -``` - -**Example**: - -1, 1 --> true - -1, 2 --> false - -# Additions: -- isGreaterOrEqual -- isLessOrEqual diff --git a/definitions/standard/runtime_definition/primitive/text.md b/definitions/standard/runtime_definition/primitive/text.md deleted file mode 100644 index 6fc1b70..0000000 --- a/definitions/standard/runtime_definition/primitive/text.md +++ /dev/null @@ -1,2681 +0,0 @@ -# std for PRIMITIVE: TEXT - -## asBytes -Converts the text to a number array. - -```json -{ - "runtime_name": "std::text::as_bytes", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "runtime_name": "value", - "name": [ - { - "code": "en-US", - "content": "Text Value" - } - ], - "description": [ - { - "code": "en-US", - "content": "The text to convert into bytes." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Converts the input text string into an array of byte values." - } - ] - } - ], - "return_type_identifier": { - "type": { - "GenericType": { - "data_type_identifier": "ARRAY", - "generic_mappers": [ - { - "source": [ - { - "type": { - "DataTypeIdentifier": "NUMBER" - } - } - ], - "target": "T", - "generic_combinations": [] - } - ] - } - } - }, - "throws_error": false, - "name": [ - { - "code": "en-US", - "content": "As Bytes" - } - ], - "description": [ - { - "code": "en-US", - "content": "Converts a text string into an array of byte values." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Returns an array of bytes representing the UTF-8 encoding of the given text." - } - ], - "deprecation_message": [], - "generic_keys": [] -} -``` - -**Example**: - -"hello" --> [104, 101, 108, 108, 111] - -## byteSize -Returns the size of the text in bytes. - -```json -{ - "runtime_name": "std::text::byte_size", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "runtime_name": "value", - "name": [ - { - "code": "en-US", - "content": "Text Value" - } - ], - "description": [ - { - "code": "en-US", - "content": "The text whose byte size is to be calculated." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Calculates the size in bytes of the given text, typically its UTF-8 encoding length." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "throws_error": false, - "name": [ - { - "code": "en-US", - "content": "Byte Size" - } - ], - "description": [ - { - "code": "en-US", - "content": "Returns the number of bytes required to encode the given text." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Computes the size in bytes of the provided text string, typically by counting UTF-8 encoded bytes." - } - ], - "deprecation_message": [], - "generic_keys": [] -} -``` - -**Example**: - -"hello" --> 5 - -## capitalize -Capitalizes the first character of the text. - -```json -{ - "runtime_name": "std::text::capitalize", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "runtime_name": "value", - "name": [ - { - "code": "en-US", - "content": "Text Value" - } - ], - "description": [ - { - "code": "en-US", - "content": "The text string to capitalize." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Capitalizes the first letter of the input text string." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "throws_error": false, - "name": [ - { - "code": "en-US", - "content": "Capitalize" - } - ], - "description": [ - { - "code": "en-US", - "content": "Converts the first character of the text to uppercase and leaves the rest unchanged." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Returns a new text string with the first letter capitalized." - } - ], - "deprecation_message": [], - "generic_keys": [] -} -``` - -**Example**: - -"hello" --> "Hello" - -"world wide web" --> "World wide web" - -## uppercase -Converts all characters in the text to uppercase. - -```json -{ - "runtime_name": "std::text::uppercase", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "runtime_name": "value", - "name": [ - { - "code": "en-US", - "content": "Text Value" - } - ], - "description": [ - { - "code": "en-US", - "content": "The text string to convert to uppercase." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Converts all characters in the input text string to uppercase." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "throws_error": false, - "name": [ - { - "code": "en-US", - "content": "Uppercase" - } - ], - "description": [ - { - "code": "en-US", - "content": "Transforms all letters in the text to their uppercase equivalents." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Returns a new text string with all characters converted to uppercase." - } - ], - "deprecation_message": [], - "generic_keys": [] -} -``` - -**Example**: - -"hello" --> "HELLO" - -"Hello World" --> "HELLO WORLD" - -## lowercase -Converts all characters in the text to lowercase. - -```json -{ - "runtime_name": "std::text::lowercase", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "runtime_name": "value", - "name": [ - { - "code": "en-US", - "content": "Text Value" - } - ], - "description": [ - { - "code": "en-US", - "content": "The text string to convert to lowercase." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Converts all characters in the input text string to lowercase." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "throws_error": false, - "name": [ - { - "code": "en-US", - "content": "Lowercase" - } - ], - "description": [ - { - "code": "en-US", - "content": "Transforms all letters in the text to their lowercase equivalents." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Returns a new text string with all characters converted to lowercase." - } - ], - "deprecation_message": [], - "generic_keys": [] -} -``` - -**Example**: - -"HELLO" --> "hello" - -"Hello World" --> "hello world" - -## swapcase -Swaps the case of all characters in the text. - -```json -{ - "runtime_name": "std::text::swapcase", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "runtime_name": "value", - "name": [ - { - "code": "en-US", - "content": "Text Value" - } - ], - "description": [ - { - "code": "en-US", - "content": "The text string whose case will be swapped." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Swaps the case of each letter in the input text: uppercase letters become lowercase, and vice versa." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "throws_error": false, - "name": [ - { - "code": "en-US", - "content": "Swap Case" - } - ], - "description": [ - { - "code": "en-US", - "content": "Converts uppercase letters to lowercase and lowercase letters to uppercase in the given text." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Returns a new text string with the case of each character inverted." - } - ], - "deprecation_message": [], - "generic_keys": [] -} -``` - -**Example**: - -"Hello" --> "hELLO" - -"Hello World" --> "hELLO wORLD" - -## chars -Splits the text into an array of characters. - -```json -{ - "runtime_name": "std::text::chars", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "runtime_name": "value", - "name": [ - { - "code": "en-US", - "content": "Text Value" - } - ], - "description": [ - { - "code": "en-US", - "content": "The text string to split into characters." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Splits the input text string into an array of its constituent characters." - } - ] - } - ], - "return_type_identifier": { - "type": { - "GenericType": { - "data_type_identifier": "ARRAY", - "generic_mappers": [ - { - "source": [ - { - "type": { - "DataTypeIdentifier": "TEXT" - } - } - ], - "target": "T", - "generic_combinations": [] - } - ] - } - } - }, - "generic_keys": [], - "name": [ - { - "code": "en-US", - "content": "Characters" - } - ], - "description": [ - { - "code": "en-US", - "content": "Returns an array containing each character from the given text string." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Creates an array where each element is a single character from the original text." - } - ], - "deprecation_message": [], - "throws_error": false -} -``` - -**Example**: - -"hello" --> ["h", "e", "l", "l", "o"] - -## at -Returns the character at the specified index. - -```json -{ - "runtime_name": "std::text::at", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "runtime_name": "value", - "name": [ - { - "code": "en-US", - "content": "Text Value" - } - ], - "description": [ - { - "code": "en-US", - "content": "The text string from which to extract the character." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "The input text from which a character will be retrieved by index." - } - ] - }, - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "runtime_name": "index", - "name": [ - { - "code": "en-US", - "content": "Index" - } - ], - "description": [ - { - "code": "en-US", - "content": "The zero-based position of the character to extract." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Specifies which character to return from the text." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "throws_error": false, - "name": [ - { - "code": "en-US", - "content": "Character at Index" - } - ], - "description": [ - { - "code": "en-US", - "content": "Returns the character at the specified index in the text." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Retrieves a single character from the input text based on the provided zero-based index." - } - ], - "deprecation_message": [], - "generic_keys": [] -} -``` - -**Example**: - -"hello", 1 --> "e" - -"world", 0 --> "w" - -## trim -Removes whitespace from both ends of the text. - -```json -{ - "runtime_name": "std::text::trim", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "runtime_name": "value", - "name": [ - { - "code": "en-US", - "content": "Text Value" - } - ], - "description": [ - { - "code": "en-US", - "content": "The text string to trim whitespace from." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "The input text from which leading and trailing whitespace characters will be removed." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "name": [ - { - "code": "en-US", - "content": "Trim Text" - } - ], - "description": [ - { - "code": "en-US", - "content": "Removes leading and trailing whitespace from the text." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Returns a new string with all leading and trailing whitespace characters removed from the input text." - } - ], - "deprecation_message": [], - "throws_error": false, - "generic_keys": [] -} -``` - -**Example**: - -" hello " --> "hello" - -" hello world " --> "hello world" - -## apped -Concatenates two strings together. - -```json -{ - "runtime_name": "std::text::append", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "runtime_name": "value", - "name": [ - { - "code": "en-US", - "content": "Original Text" - } - ], - "description": [ - { - "code": "en-US", - "content": "The initial text to which the suffix will be appended." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "The base text string that will have another string appended to its end." - } - ] - }, - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "runtime_name": "suffix", - "name": [ - { - "code": "en-US", - "content": "Suffix" - } - ], - "description": [ - { - "code": "en-US", - "content": "The text to append to the original value." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "The text string that will be concatenated to the end of the original text." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "name": [ - { - "code": "en-US", - "content": "Append Text" - } - ], - "description": [ - { - "code": "en-US", - "content": "Concatenates the suffix text to the end of the original text." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Returns a new text string consisting of the original text followed by the specified suffix." - } - ], - "deprecation_message": [], - "throws_error": false, - "generic_keys": [] -} -``` - -**Example**: - -"hello", " world" --> "hello world" - -"abc", "123" --> "abc123" - -## prepend -Adds text to the beginning of the string. - -```json -{ - "runtime_name": "std::text::prepend", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "runtime_name": "value", - "name": [ - { - "code": "en-US", - "content": "Original Text" - } - ], - "description": [ - { - "code": "en-US", - "content": "The initial text to which the prefix will be added." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "The base text string that will have another string prepended to its beginning." - } - ] - }, - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "runtime_name": "prefix", - "name": [ - { - "code": "en-US", - "content": "Prefix" - } - ], - "description": [ - { - "code": "en-US", - "content": "The text to prepend before the original value." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "The text string that will be concatenated to the start of the original text." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "name": [ - { - "code": "en-US", - "content": "Prepend Text" - } - ], - "description": [ - { - "code": "en-US", - "content": "Concatenates the prefix text to the beginning of the original text." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Returns a new text string consisting of the specified prefix followed by the original text." - } - ], - "deprecation_message": [], - "throws_error": false, - "generic_keys": [] -} -``` - -**Example**: - -"world", "hello " --> "hello world" - -"123", "abc" --> "abc123" - -## insert -Inserts text at the specified position. - -```json -{ - "runtime_name": "std::text::insert", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "runtime_name": "value", - "name": [ - { - "code": "en-US", - "content": "Original Text" - } - ], - "description": [ - { - "code": "en-US", - "content": "The original text into which another text will be inserted." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "This is the base string where the insertion happens." - } - ] - }, - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "runtime_name": "position", - "name": [ - { - "code": "en-US", - "content": "Position" - } - ], - "description": [ - { - "code": "en-US", - "content": "The index at which the text will be inserted." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Zero-based index indicating where the new text should be inserted." - } - ] - }, - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "runtime_name": "text", - "name": [ - { - "code": "en-US", - "content": "Text to Insert" - } - ], - "description": [ - { - "code": "en-US", - "content": "The text that will be inserted into the original text." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "The substring to be inserted at the specified position." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "name": [ - { - "code": "en-US", - "content": "Insert Text" - } - ], - "description": [ - { - "code": "en-US", - "content": "Inserts a given text into the original text at the specified position." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Returns a new string where the provided text is inserted at the zero-based position index within the original text." - } - ], - "deprecation_message": [], - "throws_error": false, - "generic_keys": [] -} -``` - -**Example**: - -"helloworld", 5, " " --> "hello world" - -"abcdef", 3, "123" --> "abc123def" - -## length -Returns the length of the text. - -```json -{ - "runtime_name": "std::text::length", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "runtime_name": "value", - "name": [ - { - "code": "en-US", - "content": "Text" - } - ], - "description": [ - { - "code": "en-US", - "content": "The text whose length will be calculated." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Input string to determine the number of characters it contains." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "name": [ - { - "code": "en-US", - "content": "Length" - } - ], - "description": [ - { - "code": "en-US", - "content": "Returns the number of characters in the given text." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Computes the length of the input string in terms of characters." - } - ], - "deprecation_message": [], - "throws_error": false, - "generic_keys": [] -} -``` - -**Example**: - -"hello" --> 5 - -"hello world" --> 11 - -## remove -Removes a portion of text from the specified start index to end index. - -```json -{ - "runtime_name": "std::text::remove", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "runtime_name": "value", - "name": [ - { - "code": "en-US", - "content": "Text" - } - ], - "description": [ - { - "code": "en-US", - "content": "The original text to remove a substring from." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "The input text from which a substring will be removed." - } - ] - }, - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "runtime_name": "start", - "name": [ - { - "code": "en-US", - "content": "Start Index" - } - ], - "description": [ - { - "code": "en-US", - "content": "The zero-based index where removal begins." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "The starting position for removing characters from the text." - } - ] - }, - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "runtime_name": "end", - "name": [ - { - "code": "en-US", - "content": "End Index" - } - ], - "description": [ - { - "code": "en-US", - "content": "The zero-based index where removal ends (exclusive)." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "The position just after the last character to be removed." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "name": [ - { - "code": "en-US", - "content": "Remove Substring" - } - ], - "description": [ - { - "code": "en-US", - "content": "Removes the substring between the specified start and end indices from the input text." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Returns a new string with characters removed from start up to but not including end." - } - ], - "deprecation_message": [], - "throws_error": false, - "generic_keys": [] -} -``` - -**Example**: - -"hello world", 5, 6 --> "helloworld" - -"abcdefg", 2, 5 --> "abfg" - -## replace -Replaces all occurrences of a substring with another string. - -```json -{ - "runtime_name": "std::text::replace", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "runtime_name": "value", - "name": [ - { - "code": "en-US", - "content": "Original Text" - } - ], - "description": [ - { - "code": "en-US", - "content": "The input text where replacements will be made." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "This is the text in which all occurrences of the old substring will be replaced." - } - ] - }, - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "runtime_name": "old", - "name": [ - { - "code": "en-US", - "content": "Old Substring" - } - ], - "description": [ - { - "code": "en-US", - "content": "The substring to be replaced." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "All occurrences of this substring in the original text will be replaced." - } - ] - }, - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "runtime_name": "new", - "name": [ - { - "code": "en-US", - "content": "New Substring" - } - ], - "description": [ - { - "code": "en-US", - "content": "The substring to replace with." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "This substring will replace each occurrence of the old substring." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "name": [ - { - "code": "en-US", - "content": "Replace Substring" - } - ], - "description": [ - { - "code": "en-US", - "content": "Replaces all occurrences of a specified substring with another substring in the input text." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Returns a new string where every instance of the old substring is replaced by the new substring." - } - ], - "deprecation_message": [], - "throws_error": false, - "generic_keys": [] -} -``` - -**Example**: - -"hello world", "world", "universe" --> "hello universe" - -"ababab", "a", "c" --> "cbcbcb" - -## replaceFirst -Replaces the first occurrence of a substring with another string. - -```json -{ - "runtime_name": "std::text::replace_first", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "runtime_name": "value", - "name": [ - { - "code": "en-US", - "content": "Original Text" - } - ], - "description": [ - { - "code": "en-US", - "content": "The input text where the first replacement will be made." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "This text contains the substring that will be replaced only once—the first occurrence." - } - ] - }, - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "runtime_name": "old", - "name": [ - { - "code": "en-US", - "content": "Old Substring" - } - ], - "description": [ - { - "code": "en-US", - "content": "The substring to be replaced." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Only the first occurrence of this substring will be replaced in the original text." - } - ] - }, - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "runtime_name": "new", - "name": [ - { - "code": "en-US", - "content": "New Substring" - } - ], - "description": [ - { - "code": "en-US", - "content": "The substring to replace with." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "This substring will replace only the first occurrence of the old substring." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "name": [ - { - "code": "en-US", - "content": "Replace First Substring" - } - ], - "description": [ - { - "code": "en-US", - "content": "Replaces the first occurrence of a specified substring with another substring in the input text." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Returns a new string where only the first instance of the old substring is replaced by the new substring." - } - ], - "deprecation_message": [], - "throws_error": false, - "generic_keys": [] -} -``` - -**Example**: - -"hello hello", "hello", "hi" --> "hi hello" - -"ababab", "a", "c" --> "cbabab" - -## replaceLast -Replaces the last occurrence of a substring with another string. - -```json -{ - "runtime_name": "std::text::replace_last", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "runtime_name": "value", - "name": [ - { - "code": "en-US", - "content": "Original Text" - } - ], - "description": [ - { - "code": "en-US", - "content": "The input text where the last replacement will be made." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "This text contains the substring that will be replaced only once—the last occurrence." - } - ] - }, - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "runtime_name": "old", - "name": [ - { - "code": "en-US", - "content": "Old Substring" - } - ], - "description": [ - { - "code": "en-US", - "content": "The substring to be replaced." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Only the last occurrence of this substring will be replaced in the original text." - } - ] - }, - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "runtime_name": "new", - "name": [ - { - "code": "en-US", - "content": "New Substring" - } - ], - "description": [ - { - "code": "en-US", - "content": "The substring to replace with." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "This substring will replace only the last occurrence of the old substring." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "name": [ - { - "code": "en-US", - "content": "Replace Last Substring" - } - ], - "description": [ - { - "code": "en-US", - "content": "Replaces the last occurrence of a specified substring with another substring in the input text." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Returns a new string where only the last instance of the old substring is replaced by the new substring." - } - ], - "deprecation_message": [], - "throws_error": false, - "generic_keys": [] -} -``` - -**Example**: - -"hello hello", "hello", "hi" --> "hello hi" - -"ababab", "a", "c" --> "ababcb" - -## hex -Converts the text to a hexadecimal representation. - -```json -{ - "runtime_name": "std::text::hex", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "runtime_name": "value", - "name": [ - { - "code": "en-US", - "content": "Input Text" - } - ], - "description": [ - { - "code": "en-US", - "content": "The text string to be converted to its hexadecimal representation." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "This function converts each character of the input text into its corresponding hexadecimal code, returning the concatenated hex string." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "name": [ - { - "code": "en-US", - "content": "Text to Hexadecimal" - } - ], - "description": [ - { - "code": "en-US", - "content": "Converts a text string into a hexadecimal representation." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Returns a string containing the hexadecimal values corresponding to each character of the input text." - } - ], - "deprecation_message": [], - "throws_error": false, - "generic_keys": [] -} -``` - -**Example**: - -"hello" --> "68656c6c6f" - -"ABC" --> "414243" - -## octal -Converts the text to an octal representation. - -```json -{ - "runtime_name": "std::text::octal", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "runtime_name": "value", - "name": [ - { - "code": "en-US", - "content": "Input Text" - } - ], - "description": [ - { - "code": "en-US", - "content": "The text string to be converted to its octal representation." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "This function converts each character of the input text into its corresponding octal code, returning the concatenated octal string." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "name": [ - { - "code": "en-US", - "content": "Text to Octal" - } - ], - "description": [ - { - "code": "en-US", - "content": "Converts a text string into an octal representation." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Returns a string containing the octal values corresponding to each character of the input text." - } - ], - "deprecation_message": [], - "throws_error": false, - "generic_keys": [] -} -``` - -**Example**: - -"hello" --> "150145154154157" - -"ABC" --> "101102103" - -## indexOf -Returns the index of the first occurrence of a substring, or -1 if not found. - -```json -{ - "runtime_name": "std::text::index_of", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "runtime_name": "value", - "name": [ - { - "code": "en-US", - "content": "Text" - } - ], - "description": [ - { - "code": "en-US", - "content": "The text string to search within." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "The text string to search within." - } - ] - }, - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "runtime_name": "substring", - "name": [ - { - "code": "en-US", - "content": "Substring" - } - ], - "description": [ - { - "code": "en-US", - "content": "The substring to find inside the text." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "The substring to find inside the text." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "NUMBER" - } - }, - "name": [ - { - "code": "en-US", - "content": "Index Of" - } - ], - "description": [ - { - "code": "en-US", - "content": "Finds the first occurrence index of the substring within the text." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Returns the zero-based index of the first occurrence of the substring in the text. Returns -1 if the substring is not found." - } - ], - "deprecation_message": [], - "throws_error": false, - "generic_keys": [] -} -``` - -**Example**: - -"hello world", "world" --> 6 - -"hello world", "not found" --> -1 - -## contains -Checks if the text contains a specified substring. - -```json -{ - "runtime_name": "std::text::contains", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "runtime_name": "value", - "name": [ - { - "code": "en-US", - "content": "Text" - } - ], - "description": [ - { - "code": "en-US", - "content": "The main text to search within." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "The main text to search within." - } - ] - }, - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "runtime_name": "substring", - "name": [ - { - "code": "en-US", - "content": "Substring" - } - ], - "description": [ - { - "code": "en-US", - "content": "The text to search for inside the main text." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "The text to search for inside the main text." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "BOOLEAN" - } - }, - "name": [ - { - "code": "en-US", - "content": "Contains" - } - ], - "description": [ - { - "code": "en-US", - "content": "Checks if the main text contains the specified substring." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Returns true if the substring is found anywhere in the main text; otherwise, returns false." - } - ], - "deprecation_message": [], - "generic_keys": [], - "throws_error": false -} -``` - -**Example**: - -"hello world", "world" --> true - -"hello world", "not found" --> false - -## split -Splits the text into an array of strings based on a delimiter. - -```json -{ - "runtime_name": "std::text::split", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "runtime_name": "value", - "name": [ - { - "code": "en-US", - "content": "Text" - } - ], - "description": [ - { - "code": "en-US", - "content": "The input text to be split." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "The input text to be split." - } - ] - }, - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "runtime_name": "delimiter", - "name": [ - { - "code": "en-US", - "content": "Delimiter" - } - ], - "description": [ - { - "code": "en-US", - "content": "The delimiter string to split the text by." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "The delimiter string to split the text by." - } - ] - } - ], - "return_type_identifier": { - "type": { - "GenericType": { - "data_type_identifier": "ARRAY", - "generic_mappers": [ - { - "source": [ - { - "type": { - "DataTypeIdentifier": "TEXT" - } - } - ], - "target": "T", - "generic_combinations": [] - } - ] - } - } - }, - "generic_keys": [], - "name": [ - { - "code": "en-US", - "content": "Split" - } - ], - "description": [ - { - "code": "en-US", - "content": "Splits the input text into an array of substrings based on the specified delimiter." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Returns an array of substrings obtained by splitting the input text at each occurrence of the delimiter." - } - ], - "deprecation_message": [], - "throws_error": false -} -``` - -**Example**: - -"hello world", " " --> ["hello", "world"] - -"a,b,c", "," --> ["a", "b", "c"] - -## reverse -Reverses the text. - -```json -{ - "runtime_name": "std::text::reverse", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "runtime_name": "value", - "name": [ - { - "code": "en-US", - "content": "Text" - } - ], - "description": [ - { - "code": "en-US", - "content": "The input text to be reversed." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "The input text to be reversed." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "name": [ - { - "code": "en-US", - "content": "Reverse" - } - ], - "description": [ - { - "code": "en-US", - "content": "Reverses the characters in the input text." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Returns a new string with the characters of the input text in reverse order." - } - ], - "deprecation_message": [], - "generic_keys": [], - "throws_error": false -} -``` - -**Example**: - -"hello" --> "olleh" - -"world" --> "dlrow" - -## startWith -Checks if the text starts with a specified prefix. - -```json -{ - "runtime_name": "std::text::start_with", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "runtime_name": "value", - "name": [ - { - "code": "en-US", - "content": "Text" - } - ], - "description": [ - { - "code": "en-US", - "content": "The input text to check." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "The input text to check." - } - ] - }, - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "runtime_name": "prefix", - "name": [ - { - "code": "en-US", - "content": "Prefix" - } - ], - "description": [ - { - "code": "en-US", - "content": "The prefix to test against the input text." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "The prefix to test against the input text." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "BOOLEAN" - } - }, - "name": [ - { - "code": "en-US", - "content": "Starts With" - } - ], - "description": [ - { - "code": "en-US", - "content": "Checks if the input text starts with the specified prefix." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Returns true if the input text begins with the given prefix; otherwise, returns false." - } - ], - "deprecation_message": [], - "throws_error": false, - "generic_keys": [] -} -``` - -**Example**: - -"hello world", "hello" --> true - -"hello world", "world" --> false - -## endsWith -Checks if the text ends with a specified suffix. - -```json -{ - "runtime_name": "std::text::ends_with", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "runtime_name": "value", - "name": [ - { - "code": "en-US", - "content": "Text" - } - ], - "description": [ - { - "code": "en-US", - "content": "The input text to check." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "The input text to check." - } - ] - }, - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "runtime_name": "suffix", - "name": [ - { - "code": "en-US", - "content": "Suffix" - } - ], - "description": [ - { - "code": "en-US", - "content": "The suffix to test against the input text." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "The suffix to test against the input text." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "BOOLEAN" - } - }, - "name": [ - { - "code": "en-US", - "content": "Ends With" - } - ], - "description": [ - { - "code": "en-US", - "content": "Checks if the input text ends with the specified suffix." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Returns true if the input text ends with the given suffix; otherwise, returns false." - } - ], - "deprecation_message": [], - "throws_error": false, - "generic_keys": [] -} -``` - -**Example**: - -"hello world", "world" --> true - -"hello world", "hello" --> false - -## toASCII -Converts each character to its ASCII code as an array of numbers. - -```json -{ - "runtime_name": "std::text::to_ascii", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "runtime_name": "value", - "name": [ - { - "code": "en-US", - "content": "Text" - } - ], - "description": [ - { - "code": "en-US", - "content": "Input text to convert to ASCII codes." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Input text to convert to ASCII codes." - } - ] - } - ], - "return_type_identifier": { - "type": { - "GenericType": { - "data_type_identifier": "ARRAY", - "generic_mappers": [ - { - "source": [ - { - "type": { - "DataTypeIdentifier": "NUMBER" - } - } - ], - "target": "T", - "generic_combinations": [] - } - ] - } - } - }, - "name": [ - { - "code": "en-US", - "content": "To ASCII" - } - ], - "description": [ - { - "code": "en-US", - "content": "Converts each character of the input text into its corresponding ASCII numerical code." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Returns an array of numbers where each number represents the ASCII code of the corresponding character in the input text." - } - ], - "generic_keys": [], - "deprecation_message": [], - "throws_error": false -} -``` - -**Example**: - -"hello" --> [104, 101, 108, 108, 111] - -"ABC" --> [65, 66, 67] - -## fromASCII -Converts an array of ASCII codes to a text string. - -```json -{ - "runtime_name": "std::text::from_ascii", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "GenericType": { - "data_type_identifier": "ARRAY", - "generic_mappers": [ - { - "source": [ - { - "type": { - "DataTypeIdentifier": "NUMBER" - } - } - ], - "target": "T", - "generic_combinations": [] - } - ] - } - } - }, - "runtime_name": "value", - "name": [ - { - "code": "en-US", - "content": "ASCII Codes" - } - ], - "description": [ - { - "code": "en-US", - "content": "Array of ASCII numeric codes representing characters." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Array of ASCII numeric codes representing characters." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "name": [ - { - "code": "en-US", - "content": "From ASCII" - } - ], - "description": [ - { - "code": "en-US", - "content": "Converts an array of ASCII codes back into the corresponding text string." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Takes an array of numbers where each number is an ASCII code, and returns the string they represent." - } - ], - "generic_keys": [], - "deprecation_message": [], - "throws_error": false -} -``` - -**Example**: - -[104, 101, 108, 108, 111] --> "hello" - -[65, 66, 67] --> "ABC" - -## encode -Encodes the text using a specified encoding. - -```json -{ - "runtime_name": "std::text::encode", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "runtime_name": "value", - "name": [ - { - "code": "en-US", - "content": "Text" - } - ], - "description": [ - { - "code": "en-US", - "content": "The text string to encode." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "The text string to encode." - } - ] - }, - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT_ENCODING" - } - }, - "runtime_name": "encoding", - "name": [ - { - "code": "en-US", - "content": "Encoding Type" - } - ], - "description": [ - { - "code": "en-US", - "content": "The encoding scheme to apply (e.g., UTF-8, Base64)." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "The encoding scheme to apply (e.g., UTF-8, Base64)." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "name": [ - { - "code": "en-US", - "content": "Encode Text" - } - ], - "description": [ - { - "code": "en-US", - "content": "Encodes the input text into the specified encoding format." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Transforms the given text string into a representation encoded by the specified encoding scheme." - } - ], - "generic_keys": [], - "throws_error": false, - "deprecation_message": [] -} -``` - -**Example**: - -"hello", "base64" --> "aGVsbG8=" - -## decode -Decodes the text using a specified encoding. - -```json -{ - "runtime_name": "std::text::decode", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "runtime_name": "value", - "name": [ - { - "code": "en-US", - "content": "Text" - } - ], - "description": [ - { - "code": "en-US", - "content": "The text string to decode." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "The text string to decode." - } - ] - }, - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT_ENCODING" - } - }, - "runtime_name": "encoding", - "name": [ - { - "code": "en-US", - "content": "Encoding Type" - } - ], - "description": [ - { - "code": "en-US", - "content": "The decoding scheme to apply (e.g. Base64)." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "The decoding scheme to apply (e.g. Base64)." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "name": [ - { - "code": "en-US", - "content": "Decode Text" - } - ], - "description": [ - { - "code": "en-US", - "content": "Decodes the input text from the specified encoding format." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Decodes the input text from the specified encoding format." - } - ], - "generic_keys": [], - "throws_error": false, - "deprecation_message": [] -} -``` - -**Example**: - -"aGVsbG8=", "base64" --> "hello" - -## isEqual - -```json -{ - "runtime_name": "std::text::is_equal", - "runtime_parameter_definitions": [ - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "runtime_name": "first", - "name": [ - { - "code": "en-US", - "content": "First Text" - } - ], - "description": [ - { - "code": "en-US", - "content": "The first text string to compare." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "The first input text for equality comparison." - } - ] - }, - { - "data_type_identifier": { - "type": { - "DataTypeIdentifier": "TEXT" - } - }, - "runtime_name": "second", - "name": [ - { - "code": "en-US", - "content": "Second Text" - } - ], - "description": [ - { - "code": "en-US", - "content": "The second text string to compare." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "The second input text for equality comparison." - } - ] - } - ], - "return_type_identifier": { - "type": { - "DataTypeIdentifier": "BOOLEAN" - } - }, - "name": [ - { - "code": "en-US", - "content": "Is Equal" - } - ], - "description": [ - { - "code": "en-US", - "content": "Checks whether the two input text strings are equal." - } - ], - "documentation": [ - { - "code": "en-US", - "content": "Determines if the two given text inputs are exactly the same, returning true if equal, false otherwise." - } - ], - "throws_error": false, - "deprecation_message": [], - "generic_keys": [] -} -``` - -**Example**: - -"TEXT", "TEXT" --> true - -"TEXT", "WORD" --> false diff --git a/definitions/standard/runtime_definition/primitive/text-audit.md b/definitions/standard/runtime_definition/text/text-audit.md similarity index 100% rename from definitions/standard/runtime_definition/primitive/text-audit.md rename to definitions/standard/runtime_definition/text/text-audit.md From 72391b21309641e522dd265a0b10aed5b59bb503 Mon Sep 17 00:00:00 2001 From: raphael-goetz Date: Mon, 18 Aug 2025 14:50:50 +0200 Subject: [PATCH 15/20] feat: added json definitions --- .../rest/data_type/array/http_header_map.json | 39 +++++ .../data_type/object/http_header_entry.json | 48 ++++++ .../data_type/object/http_request_object.json | 72 +++++++++ .../object/http_response_object.json | 48 ++++++ .../rest/data_type/type/http_method.json | 51 +++++++ definitions/rest/data_type/type/http_url.json | 20 +++ definitions/rest/flow_type/rest.json | 25 +++ .../standard/data_type/array/array.json | 26 ++++ .../standard/data_type/node/comparator.json | 50 ++++++ .../standard/data_type/node/consumer.json | 31 ++++ .../standard/data_type/node/predicate.json | 42 +++++ .../standard/data_type/node/transform.json | 43 ++++++ .../standard/data_type/object/object.json | 12 ++ .../standard/data_type/primitive/boolean.json | 20 +++ .../standard/data_type/primitive/number.json | 20 +++ .../standard/data_type/primitive/text.json | 20 +++ .../data_type/type/text_encoding.json | 26 ++++ .../array/std_array_at.json | 98 ++++++++++++ .../array/std_array_concat.json | 132 ++++++++++++++++ .../array/std_array_filter.json | 132 ++++++++++++++++ .../array/std_array_find.json | 117 ++++++++++++++ .../array/std_array_find_index.json | 117 ++++++++++++++ .../array/std_array_find_last.json | 117 ++++++++++++++ .../array/std_array_first.json | 75 +++++++++ .../array/std_array_flat.json | 105 +++++++++++++ .../array/std_array_for_each.json | 113 ++++++++++++++ .../array/std_array_index_of.json | 100 ++++++++++++ .../array/std_array_is_empty.json | 75 +++++++++ .../array/std_array_join.json | 100 ++++++++++++ .../array/std_array_last.json | 75 +++++++++ .../array/std_array_map.json | 144 ++++++++++++++++++ .../array/std_array_max.json | 75 +++++++++ .../array/std_array_min.json | 75 +++++++++ .../array/std_array_pop.json | 75 +++++++++ .../array/std_array_push.json | 102 +++++++++++++ .../array/std_array_remove.json | 117 ++++++++++++++ .../array/std_array_reverse.json | 90 +++++++++++ .../array/std_array_size.json | 75 +++++++++ .../array/std_array_sort.json | 132 ++++++++++++++++ .../array/std_array_sort_reverse.json | 115 ++++++++++++++ .../array/std_array_sum.json | 73 +++++++++ .../array/std_array_to_unique.json | 90 +++++++++++ .../boolean/std_boolean_as_number.json | 58 +++++++ .../boolean/std_boolean_as_text.json | 58 +++++++ .../boolean/std_boolean_from_number.json | 58 +++++++ .../boolean/std_boolean_from_text.json | 58 +++++++ .../boolean/std_boolean_is_equal.json | 85 +++++++++++ .../boolean/std_boolean_negate.json | 58 +++++++ .../control/std_control_break.json | 26 ++++ .../control/std_control_return.json | 60 ++++++++ .../number/std_number_abs.json | 58 +++++++ .../number/std_number_add.json | 85 +++++++++++ .../number/std_number_arccos.json | 58 +++++++ .../number/std_number_arcsin.json | 58 +++++++ .../number/std_number_arctan.json | 58 +++++++ .../number/std_number_as_text.json | 58 +++++++ .../number/std_number_clamp.json | 112 ++++++++++++++ .../number/std_number_cos.json | 58 +++++++ .../number/std_number_cosh.json | 58 +++++++ .../number/std_number_divide.json | 85 +++++++++++ .../number/std_number_euler.json | 30 ++++ .../number/std_number_exponential.json | 85 +++++++++++ .../number/std_number_from_text.json | 58 +++++++ .../number/std_number_infinity.json | 30 ++++ .../number/std_number_is_equal.json | 85 +++++++++++ .../number/std_number_is_greater.json | 85 +++++++++++ .../number/std_number_is_less.json | 85 +++++++++++ .../number/std_number_is_positive.json | 58 +++++++ .../number/std_number_is_zero.json | 58 +++++++ .../number/std_number_ln.json | 58 +++++++ .../number/std_number_log.json | 85 +++++++++++ .../number/std_number_max.json | 85 +++++++++++ .../number/std_number_min.json | 85 +++++++++++ .../number/std_number_modulo.json | 85 +++++++++++ .../number/std_number_multiply.json | 85 +++++++++++ .../number/std_number_negate.json | 58 +++++++ .../number/std_number_pi.json | 30 ++++ .../number/std_number_random_number.json | 85 +++++++++++ .../number/std_number_root.json | 85 +++++++++++ .../number/std_number_round.json | 85 +++++++++++ .../number/std_number_round_down.json | 85 +++++++++++ .../number/std_number_round_up.json | 85 +++++++++++ .../number/std_number_sin.json | 85 +++++++++++ .../number/std_number_sinh.json | 58 +++++++ .../number/std_number_square.json | 58 +++++++ .../number/std_number_square_root.json | 58 +++++++ .../number/std_number_subtract.json | 85 +++++++++++ .../number/std_number_tan.json | 58 +++++++ .../object/std_object_contains_key.json | 85 +++++++++++ .../object/std_object_keys.json | 73 +++++++++ .../object/std_object_set.json | 114 ++++++++++++++ .../object/std_object_size.json | 58 +++++++ .../text/std_text_append.json | 85 +++++++++++ .../text/std_text_as_bytes.json | 73 +++++++++ .../runtime_definition/text/std_text_at.json | 85 +++++++++++ .../text/std_text_byte_size.json | 58 +++++++ .../text/std_text_capitalize.json | 58 +++++++ .../text/std_text_chars.json | 73 +++++++++ .../text/std_text_contains.json | 85 +++++++++++ .../text/std_text_decode.json | 85 +++++++++++ .../text/std_text_encode.json | 85 +++++++++++ .../text/std_text_ends_with.json | 85 +++++++++++ .../text/std_text_from_ascii.json | 73 +++++++++ .../runtime_definition/text/std_text_hex.json | 58 +++++++ .../text/std_text_index_of.json | 85 +++++++++++ .../text/std_text_insert.json | 112 ++++++++++++++ .../text/std_text_is_equal.json | 85 +++++++++++ .../text/std_text_length.json | 58 +++++++ .../text/std_text_lowercase.json | 58 +++++++ .../text/std_text_octal.json | 58 +++++++ .../text/std_text_prepend.json | 85 +++++++++++ .../text/std_text_remove.json | 112 ++++++++++++++ .../text/std_text_replace.json | 112 ++++++++++++++ .../text/std_text_replace_first.json | 112 ++++++++++++++ .../text/std_text_replace_last.json | 112 ++++++++++++++ .../text/std_text_reverse.json | 58 +++++++ .../text/std_text_split.json | 100 ++++++++++++ .../text/std_text_start_with.json | 85 +++++++++++ .../text/std_text_swapcase.json | 58 +++++++ .../text/std_text_to_ascii.json | 73 +++++++++ .../text/std_text_trim.json | 58 +++++++ .../text/std_text_uppercase.json | 58 +++++++ 122 files changed, 8945 insertions(+) create mode 100644 definitions/rest/data_type/array/http_header_map.json create mode 100644 definitions/rest/data_type/object/http_header_entry.json create mode 100644 definitions/rest/data_type/object/http_request_object.json create mode 100644 definitions/rest/data_type/object/http_response_object.json create mode 100644 definitions/rest/data_type/type/http_method.json create mode 100644 definitions/rest/data_type/type/http_url.json create mode 100644 definitions/rest/flow_type/rest.json create mode 100644 definitions/standard/data_type/array/array.json create mode 100644 definitions/standard/data_type/node/comparator.json create mode 100644 definitions/standard/data_type/node/consumer.json create mode 100644 definitions/standard/data_type/node/predicate.json create mode 100644 definitions/standard/data_type/node/transform.json create mode 100644 definitions/standard/data_type/object/object.json create mode 100644 definitions/standard/data_type/primitive/boolean.json create mode 100644 definitions/standard/data_type/primitive/number.json create mode 100644 definitions/standard/data_type/primitive/text.json create mode 100644 definitions/standard/data_type/type/text_encoding.json create mode 100644 definitions/standard/runtime_definition/array/std_array_at.json create mode 100644 definitions/standard/runtime_definition/array/std_array_concat.json create mode 100644 definitions/standard/runtime_definition/array/std_array_filter.json create mode 100644 definitions/standard/runtime_definition/array/std_array_find.json create mode 100644 definitions/standard/runtime_definition/array/std_array_find_index.json create mode 100644 definitions/standard/runtime_definition/array/std_array_find_last.json create mode 100644 definitions/standard/runtime_definition/array/std_array_first.json create mode 100644 definitions/standard/runtime_definition/array/std_array_flat.json create mode 100644 definitions/standard/runtime_definition/array/std_array_for_each.json create mode 100644 definitions/standard/runtime_definition/array/std_array_index_of.json create mode 100644 definitions/standard/runtime_definition/array/std_array_is_empty.json create mode 100644 definitions/standard/runtime_definition/array/std_array_join.json create mode 100644 definitions/standard/runtime_definition/array/std_array_last.json create mode 100644 definitions/standard/runtime_definition/array/std_array_map.json create mode 100644 definitions/standard/runtime_definition/array/std_array_max.json create mode 100644 definitions/standard/runtime_definition/array/std_array_min.json create mode 100644 definitions/standard/runtime_definition/array/std_array_pop.json create mode 100644 definitions/standard/runtime_definition/array/std_array_push.json create mode 100644 definitions/standard/runtime_definition/array/std_array_remove.json create mode 100644 definitions/standard/runtime_definition/array/std_array_reverse.json create mode 100644 definitions/standard/runtime_definition/array/std_array_size.json create mode 100644 definitions/standard/runtime_definition/array/std_array_sort.json create mode 100644 definitions/standard/runtime_definition/array/std_array_sort_reverse.json create mode 100644 definitions/standard/runtime_definition/array/std_array_sum.json create mode 100644 definitions/standard/runtime_definition/array/std_array_to_unique.json create mode 100644 definitions/standard/runtime_definition/boolean/std_boolean_as_number.json create mode 100644 definitions/standard/runtime_definition/boolean/std_boolean_as_text.json create mode 100644 definitions/standard/runtime_definition/boolean/std_boolean_from_number.json create mode 100644 definitions/standard/runtime_definition/boolean/std_boolean_from_text.json create mode 100644 definitions/standard/runtime_definition/boolean/std_boolean_is_equal.json create mode 100644 definitions/standard/runtime_definition/boolean/std_boolean_negate.json create mode 100644 definitions/standard/runtime_definition/control/std_control_break.json create mode 100644 definitions/standard/runtime_definition/control/std_control_return.json create mode 100644 definitions/standard/runtime_definition/number/std_number_abs.json create mode 100644 definitions/standard/runtime_definition/number/std_number_add.json create mode 100644 definitions/standard/runtime_definition/number/std_number_arccos.json create mode 100644 definitions/standard/runtime_definition/number/std_number_arcsin.json create mode 100644 definitions/standard/runtime_definition/number/std_number_arctan.json create mode 100644 definitions/standard/runtime_definition/number/std_number_as_text.json create mode 100644 definitions/standard/runtime_definition/number/std_number_clamp.json create mode 100644 definitions/standard/runtime_definition/number/std_number_cos.json create mode 100644 definitions/standard/runtime_definition/number/std_number_cosh.json create mode 100644 definitions/standard/runtime_definition/number/std_number_divide.json create mode 100644 definitions/standard/runtime_definition/number/std_number_euler.json create mode 100644 definitions/standard/runtime_definition/number/std_number_exponential.json create mode 100644 definitions/standard/runtime_definition/number/std_number_from_text.json create mode 100644 definitions/standard/runtime_definition/number/std_number_infinity.json create mode 100644 definitions/standard/runtime_definition/number/std_number_is_equal.json create mode 100644 definitions/standard/runtime_definition/number/std_number_is_greater.json create mode 100644 definitions/standard/runtime_definition/number/std_number_is_less.json create mode 100644 definitions/standard/runtime_definition/number/std_number_is_positive.json create mode 100644 definitions/standard/runtime_definition/number/std_number_is_zero.json create mode 100644 definitions/standard/runtime_definition/number/std_number_ln.json create mode 100644 definitions/standard/runtime_definition/number/std_number_log.json create mode 100644 definitions/standard/runtime_definition/number/std_number_max.json create mode 100644 definitions/standard/runtime_definition/number/std_number_min.json create mode 100644 definitions/standard/runtime_definition/number/std_number_modulo.json create mode 100644 definitions/standard/runtime_definition/number/std_number_multiply.json create mode 100644 definitions/standard/runtime_definition/number/std_number_negate.json create mode 100644 definitions/standard/runtime_definition/number/std_number_pi.json create mode 100644 definitions/standard/runtime_definition/number/std_number_random_number.json create mode 100644 definitions/standard/runtime_definition/number/std_number_root.json create mode 100644 definitions/standard/runtime_definition/number/std_number_round.json create mode 100644 definitions/standard/runtime_definition/number/std_number_round_down.json create mode 100644 definitions/standard/runtime_definition/number/std_number_round_up.json create mode 100644 definitions/standard/runtime_definition/number/std_number_sin.json create mode 100644 definitions/standard/runtime_definition/number/std_number_sinh.json create mode 100644 definitions/standard/runtime_definition/number/std_number_square.json create mode 100644 definitions/standard/runtime_definition/number/std_number_square_root.json create mode 100644 definitions/standard/runtime_definition/number/std_number_subtract.json create mode 100644 definitions/standard/runtime_definition/number/std_number_tan.json create mode 100644 definitions/standard/runtime_definition/object/std_object_contains_key.json create mode 100644 definitions/standard/runtime_definition/object/std_object_keys.json create mode 100644 definitions/standard/runtime_definition/object/std_object_set.json create mode 100644 definitions/standard/runtime_definition/object/std_object_size.json create mode 100644 definitions/standard/runtime_definition/text/std_text_append.json create mode 100644 definitions/standard/runtime_definition/text/std_text_as_bytes.json create mode 100644 definitions/standard/runtime_definition/text/std_text_at.json create mode 100644 definitions/standard/runtime_definition/text/std_text_byte_size.json create mode 100644 definitions/standard/runtime_definition/text/std_text_capitalize.json create mode 100644 definitions/standard/runtime_definition/text/std_text_chars.json create mode 100644 definitions/standard/runtime_definition/text/std_text_contains.json create mode 100644 definitions/standard/runtime_definition/text/std_text_decode.json create mode 100644 definitions/standard/runtime_definition/text/std_text_encode.json create mode 100644 definitions/standard/runtime_definition/text/std_text_ends_with.json create mode 100644 definitions/standard/runtime_definition/text/std_text_from_ascii.json create mode 100644 definitions/standard/runtime_definition/text/std_text_hex.json create mode 100644 definitions/standard/runtime_definition/text/std_text_index_of.json create mode 100644 definitions/standard/runtime_definition/text/std_text_insert.json create mode 100644 definitions/standard/runtime_definition/text/std_text_is_equal.json create mode 100644 definitions/standard/runtime_definition/text/std_text_length.json create mode 100644 definitions/standard/runtime_definition/text/std_text_lowercase.json create mode 100644 definitions/standard/runtime_definition/text/std_text_octal.json create mode 100644 definitions/standard/runtime_definition/text/std_text_prepend.json create mode 100644 definitions/standard/runtime_definition/text/std_text_remove.json create mode 100644 definitions/standard/runtime_definition/text/std_text_replace.json create mode 100644 definitions/standard/runtime_definition/text/std_text_replace_first.json create mode 100644 definitions/standard/runtime_definition/text/std_text_replace_last.json create mode 100644 definitions/standard/runtime_definition/text/std_text_reverse.json create mode 100644 definitions/standard/runtime_definition/text/std_text_split.json create mode 100644 definitions/standard/runtime_definition/text/std_text_start_with.json create mode 100644 definitions/standard/runtime_definition/text/std_text_swapcase.json create mode 100644 definitions/standard/runtime_definition/text/std_text_to_ascii.json create mode 100644 definitions/standard/runtime_definition/text/std_text_trim.json create mode 100644 definitions/standard/runtime_definition/text/std_text_uppercase.json diff --git a/definitions/rest/data_type/array/http_header_map.json b/definitions/rest/data_type/array/http_header_map.json new file mode 100644 index 0000000..caaf030 --- /dev/null +++ b/definitions/rest/data_type/array/http_header_map.json @@ -0,0 +1,39 @@ +{ + "variant": 5, + "identifier": "HTTP_HEADER_MAP", + "name": [ + { + "code": "en-US", + "content": "HTTP Headers" + } + ], + "rules": [ + { + "config": { + "ParentType": { + "parent_type": { + "type": { + "GenericType": { + "data_type_identifier": "ARRAY", + "generic_mappers": [ + { + "source": [ + { + "type": { + "DataTypeIdentifier": "HTTP_HEADER_ENTRY" + } + } + ], + "target": "T", + "generic_combinations": [] + } + ] + } + } + } + } + } + } + ], + "generic_keys": [] +} \ No newline at end of file diff --git a/definitions/rest/data_type/object/http_header_entry.json b/definitions/rest/data_type/object/http_header_entry.json new file mode 100644 index 0000000..48a164d --- /dev/null +++ b/definitions/rest/data_type/object/http_header_entry.json @@ -0,0 +1,48 @@ +{ + "variant": 3, + "identifier": "HTTP_HEADER_ENTRY", + "name": [ + { + "code": "en-US", + "content": "HTTP Header Entry" + } + ], + "rules": [ + { + "config": { + "ContainsKey": { + "key": "key", + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + } + } + } + }, + { + "config": { + "ContainsKey": { + "key": "value", + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + } + } + } + }, + { + "config": { + "ParentType": { + "parent_type": { + "type": { + "DataTypeIdentifier": "OBJECT" + } + } + } + } + } + ], + "generic_keys": [] +} \ No newline at end of file diff --git a/definitions/rest/data_type/object/http_request_object.json b/definitions/rest/data_type/object/http_request_object.json new file mode 100644 index 0000000..7e071f8 --- /dev/null +++ b/definitions/rest/data_type/object/http_request_object.json @@ -0,0 +1,72 @@ +{ + "variant": 3, + "identifier": "HTTP_REQUEST_OBJECT", + "name": [ + { + "code": "en-US", + "content": "HTTP Request" + } + ], + "rules": [ + { + "config": { + "ContainsKey": { + "key": "method", + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "HTTP_METHOD" + } + } + } + } + }, + { + "config": { + "ContainsKey": { + "key": "url", + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "HTTP_URL" + } + } + } + } + }, + { + "config": { + "ContainsKey": { + "key": "body", + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "OBJECT" + } + } + } + } + }, + { + "config": { + "ContainsKey": { + "key": "headers", + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "HTTP_HEADER_MAP" + } + } + } + } + }, + { + "config": { + "ParentType": { + "parent_type": { + "type": { + "DataTypeIdentifier": "OBJECT" + } + } + } + } + } + ], + "generic_keys": [] +} \ No newline at end of file diff --git a/definitions/rest/data_type/object/http_response_object.json b/definitions/rest/data_type/object/http_response_object.json new file mode 100644 index 0000000..28c53a5 --- /dev/null +++ b/definitions/rest/data_type/object/http_response_object.json @@ -0,0 +1,48 @@ +{ + "variant": 3, + "identifier": "HTTP_RESPONSE_OBJECT", + "name": [ + { + "code": "en-US", + "content": "HTTP Response" + } + ], + "rules": [ + { + "config": { + "ContainsKey": { + "key": "headers", + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "HTTP_HEADER_MAP" + } + } + } + } + }, + { + "config": { + "ContainsKey": { + "key": "body", + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "OBJECT" + } + } + } + } + }, + { + "config": { + "ParentType": { + "parent_type": { + "type": { + "DataTypeIdentifier": "OBJECT" + } + } + } + } + } + ], + "generic_keys": [] +} \ No newline at end of file diff --git a/definitions/rest/data_type/type/http_method.json b/definitions/rest/data_type/type/http_method.json new file mode 100644 index 0000000..c300716 --- /dev/null +++ b/definitions/rest/data_type/type/http_method.json @@ -0,0 +1,51 @@ +{ + "variant": 2, + "identifier": "HTTP_METHOD", + "name": [ + { + "code": "en-US", + "content": "HTTP Method" + } + ], + "rules": [ + { + "config": { + "ItemOfCollection": { + "items": [ + { + "kind": { + "StringValue": "GET" + } + }, + { + "kind": { + "StringValue": "POST" + } + }, + { + "kind": { + "StringValue": "PUT" + } + }, + { + "kind": { + "StringValue": "DELETE" + } + }, + { + "kind": { + "StringValue": "PATCH" + } + }, + { + "kind": { + "StringValue": "HEAD" + } + } + ] + } + } + } + ], + "generic_keys": [] +} \ No newline at end of file diff --git a/definitions/rest/data_type/type/http_url.json b/definitions/rest/data_type/type/http_url.json new file mode 100644 index 0000000..9206d18 --- /dev/null +++ b/definitions/rest/data_type/type/http_url.json @@ -0,0 +1,20 @@ +{ + "variant": 2, + "identifier": "HTTP_URL", + "name": [ + { + "code": "en-US", + "content": "HTTP Route" + } + ], + "rules": [ + { + "config": { + "Regex": { + "pattern": "/^/\\w+(?:[.:~-]\\w+)*(?:/\\w+(?:[.:~-]\\w+)*)*$/" + } + } + } + ], + "generic_keys": [] +} \ No newline at end of file diff --git a/definitions/rest/flow_type/rest.json b/definitions/rest/flow_type/rest.json new file mode 100644 index 0000000..1f7383d --- /dev/null +++ b/definitions/rest/flow_type/rest.json @@ -0,0 +1,25 @@ +{ + "identifier": "REST", + "settings": [], + "input_type_identifier": "HTTP_REQUEST_OBJECT", + "return_type_identifier": "HTTP_RESPONSE_OBJECT", + "editable": false, + "name": [ + { + "code": "en-US", + "content": "Rest Endpoint" + } + ], + "description": [ + { + "code": "en-US", + "content": "A REST API is a web service that lets clients interact with data on a server using standard HTTP methods like GET, POST, PUT, and DELETE usually returning results in JSON format." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "A REST API is a web service that lets clients interact with data on a server using standard HTTP methods like GET, POST, PUT, and DELETE usually returning results in JSON format." + } + ] +} \ No newline at end of file diff --git a/definitions/standard/data_type/array/array.json b/definitions/standard/data_type/array/array.json new file mode 100644 index 0000000..d9f3929 --- /dev/null +++ b/definitions/standard/data_type/array/array.json @@ -0,0 +1,26 @@ +{ + "variant": 5, + "identifier": "ARRAY", + "name": [ + { + "code": "en-US", + "content": "Generic Array" + } + ], + "rules": [ + { + "config": { + "ContainsType": { + "data_type_identifier": { + "type": { + "GenericKey": "T" + } + } + } + } + } + ], + "generic_keys": [ + "T" + ] +} \ No newline at end of file diff --git a/definitions/standard/data_type/node/comparator.json b/definitions/standard/data_type/node/comparator.json new file mode 100644 index 0000000..a8bc7bb --- /dev/null +++ b/definitions/standard/data_type/node/comparator.json @@ -0,0 +1,50 @@ +{ + "variant": 7, + "identifier": "COMPARATOR", + "name": [ + { + "code": "en-US", + "content": "Comparator" + } + ], + "rules": [ + { + "config": { + "ReturnType": { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + } + } + } + }, + { + "config": { + "InputTypes": { + "input_types": [ + { + "data_type_identifier": { + "type": { + "GenericKey": "I" + } + }, + "input_identifier": "left" + }, + { + "data_type_identifier": { + "type": { + "GenericKey": "I" + } + }, + "input_identifier": "right" + } + ] + } + } + } + ], + "generic_keys": [ + "I" + ] +} \ No newline at end of file diff --git a/definitions/standard/data_type/node/consumer.json b/definitions/standard/data_type/node/consumer.json new file mode 100644 index 0000000..a8457df --- /dev/null +++ b/definitions/standard/data_type/node/consumer.json @@ -0,0 +1,31 @@ +{ + "variant": 7, + "identifier": "CONSUMER", + "name": [ + { + "code": "en-US", + "content": "Consumer" + } + ], + "rules": [ + { + "config": { + "InputTypes": { + "input_types": [ + { + "data_type_identifier": { + "type": { + "GenericKey": "T" + } + }, + "input_identifier": "consumer" + } + ] + } + } + } + ], + "generic_keys": [ + "T" + ] +} \ No newline at end of file diff --git a/definitions/standard/data_type/node/predicate.json b/definitions/standard/data_type/node/predicate.json new file mode 100644 index 0000000..91e9807 --- /dev/null +++ b/definitions/standard/data_type/node/predicate.json @@ -0,0 +1,42 @@ +{ + "variant": 7, + "identifier": "PREDICATE", + "name": [ + { + "code": "en-US", + "content": "Predicate" + } + ], + "rules": [ + { + "config": { + "ReturnType": { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "BOOLEAN" + } + } + } + } + }, + { + "config": { + "InputTypes": { + "input_types": [ + { + "data_type_identifier": { + "type": { + "GenericKey": "T" + } + }, + "input_identifier": "predicate" + } + ] + } + } + } + ], + "generic_keys": [ + "T" + ] +} \ No newline at end of file diff --git a/definitions/standard/data_type/node/transform.json b/definitions/standard/data_type/node/transform.json new file mode 100644 index 0000000..69e0241 --- /dev/null +++ b/definitions/standard/data_type/node/transform.json @@ -0,0 +1,43 @@ +{ + "variant": 7, + "identifier": "TRANSFORM", + "name": [ + { + "code": "en-US", + "content": "Transform" + } + ], + "rules": [ + { + "config": { + "ReturnType": { + "data_type_identifier": { + "type": { + "GenericKey": "R" + } + } + } + } + }, + { + "config": { + "InputTypes": { + "input_types": [ + { + "data_type_identifier": { + "type": { + "GenericKey": "I" + } + }, + "input_identifier": "transform" + } + ] + } + } + } + ], + "generic_keys": [ + "I", + "R" + ] +} \ No newline at end of file diff --git a/definitions/standard/data_type/object/object.json b/definitions/standard/data_type/object/object.json new file mode 100644 index 0000000..1f27e1f --- /dev/null +++ b/definitions/standard/data_type/object/object.json @@ -0,0 +1,12 @@ +{ + "variant": 2, + "identifier": "OBJECT", + "name": [ + { + "code": "en-US", + "content": "Object" + } + ], + "rules": [], + "generic_keys": [] +} \ No newline at end of file diff --git a/definitions/standard/data_type/primitive/boolean.json b/definitions/standard/data_type/primitive/boolean.json new file mode 100644 index 0000000..6989cad --- /dev/null +++ b/definitions/standard/data_type/primitive/boolean.json @@ -0,0 +1,20 @@ +{ + "variant": 1, + "identifier": "BOOLEAN", + "name": [ + { + "code": "en-US", + "content": "Boolean" + } + ], + "rules": [ + { + "config": { + "Regex": { + "pattern": "^(true|false)$" + } + } + } + ], + "generic_keys": [] +} \ No newline at end of file diff --git a/definitions/standard/data_type/primitive/number.json b/definitions/standard/data_type/primitive/number.json new file mode 100644 index 0000000..6a6b9ac --- /dev/null +++ b/definitions/standard/data_type/primitive/number.json @@ -0,0 +1,20 @@ +{ + "variant": 1, + "identifier": "NUMBER", + "name": [ + { + "code": "en-US", + "content": "Number" + } + ], + "rules": [ + { + "config": { + "Regex": { + "pattern": "/^(?:-(?:[1-9](?:\\d{0,2}(?:,\\d{3})+|\\d*))|(?:0|(?:[1-9](?:\\d{0,2}(?:,\\d{3})+|\\d*))))(?:.\\d+|)$/" + } + } + } + ], + "generic_keys": [] +} \ No newline at end of file diff --git a/definitions/standard/data_type/primitive/text.json b/definitions/standard/data_type/primitive/text.json new file mode 100644 index 0000000..251c69d --- /dev/null +++ b/definitions/standard/data_type/primitive/text.json @@ -0,0 +1,20 @@ +{ + "variant": 1, + "identifier": "TEXT", + "name": [ + { + "code": "en-US", + "content": "Text" + } + ], + "rules": [ + { + "config": { + "Regex": { + "pattern": "[\\s\\S]*" + } + } + } + ], + "generic_keys": [] +} \ No newline at end of file diff --git a/definitions/standard/data_type/type/text_encoding.json b/definitions/standard/data_type/type/text_encoding.json new file mode 100644 index 0000000..14bcb43 --- /dev/null +++ b/definitions/standard/data_type/type/text_encoding.json @@ -0,0 +1,26 @@ +{ + "variant": 2, + "identifier": "TEXT_ENCODING", + "name": [ + { + "code": "en-US", + "content": "Text Encoding" + } + ], + "rules": [ + { + "config": { + "ItemOfCollection": { + "items": [ + { + "kind": { + "StringValue": "BASE64" + } + } + ] + } + } + } + ], + "generic_keys": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/array/std_array_at.json b/definitions/standard/runtime_definition/array/std_array_at.json new file mode 100644 index 0000000..46b50e3 --- /dev/null +++ b/definitions/standard/runtime_definition/array/std_array_at.json @@ -0,0 +1,98 @@ +{ + "runtime_name": "std::array::at", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "GenericType": { + "data_type_identifier": "ARRAY", + "generic_mappers": [ + { + "source": [ + { + "type": { + "GenericKey": "R" + } + } + ], + "target": "T", + "generic_combinations": [] + } + ] + } + } + }, + "runtime_name": "array", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Input Array" + } + ], + "description": [ + { + "code": "en-US", + "content": "The array from which to retrieve an element." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "An array containing elements of any type. The element at the specified index will be returned." + } + ] + }, + { + "data_type_identifier": { + "type": null + }, + "runtime_name": "index", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Index" + } + ], + "description": [ + { + "code": "en-US", + "content": "The zero-based index of the element to retrieve." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Specifies the position of the element in the array to return. Must be within the bounds of the array." + } + ] + } + ], + "return_type_identifier": { + "type": null + }, + "throws_error": false, + "generic_keys": [ + "R" + ], + "name": [ + { + "code": "en-US", + "content": "Get Array Element" + } + ], + "description": [ + { + "code": "en-US", + "content": "Retrieves the element at a specified index from an array." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Returns the element located at the given zero-based index within the input array." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/array/std_array_concat.json b/definitions/standard/runtime_definition/array/std_array_concat.json new file mode 100644 index 0000000..87c378f --- /dev/null +++ b/definitions/standard/runtime_definition/array/std_array_concat.json @@ -0,0 +1,132 @@ +{ + "runtime_name": "std::array::concat", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "GenericType": { + "data_type_identifier": "ARRAY", + "generic_mappers": [ + { + "source": [ + { + "type": { + "GenericKey": "R" + } + } + ], + "target": "T", + "generic_combinations": [] + } + ] + } + } + }, + "runtime_name": "first", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "First Array" + } + ], + "description": [ + { + "code": "en-US", + "content": "The first array to concatenate." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "The first input array whose elements will appear at the beginning of the resulting array." + } + ] + }, + { + "data_type_identifier": { + "type": { + "GenericType": { + "data_type_identifier": "ARRAY", + "generic_mappers": [ + { + "source": [ + { + "type": { + "GenericKey": "R" + } + } + ], + "target": "T", + "generic_combinations": [] + } + ] + } + } + }, + "runtime_name": "second", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Second Array" + } + ], + "description": [ + { + "code": "en-US", + "content": "The second array to concatenate." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "The second input array whose elements will be appended after the elements of the first array." + } + ] + } + ], + "return_type_identifier": { + "type": { + "GenericType": { + "data_type_identifier": "ARRAY", + "generic_mappers": [ + { + "source": [ + { + "type": { + "GenericKey": "R" + } + } + ], + "target": "T", + "generic_combinations": [] + } + ] + } + } + }, + "throws_error": false, + "generic_keys": [ + "R" + ], + "name": [ + { + "code": "en-US", + "content": "Concatenate Arrays" + } + ], + "description": [ + { + "code": "en-US", + "content": "Concatenates two arrays into a single array." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Returns a new array containing all elements of the first array followed by all elements of the second array." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/array/std_array_filter.json b/definitions/standard/runtime_definition/array/std_array_filter.json new file mode 100644 index 0000000..0458aea --- /dev/null +++ b/definitions/standard/runtime_definition/array/std_array_filter.json @@ -0,0 +1,132 @@ +{ + "runtime_name": "std::array::filter", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "GenericType": { + "data_type_identifier": "ARRAY", + "generic_mappers": [ + { + "source": [ + { + "type": { + "GenericKey": "R" + } + } + ], + "target": "T", + "generic_combinations": [] + } + ] + } + } + }, + "runtime_name": "array", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Input Array" + } + ], + "description": [ + { + "code": "en-US", + "content": "The array to be filtered." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "The original array from which elements will be selected based on the predicate." + } + ] + }, + { + "data_type_identifier": { + "type": { + "GenericType": { + "data_type_identifier": "PREDICATE", + "generic_mappers": [ + { + "source": [ + { + "type": { + "GenericKey": "R" + } + } + ], + "target": "T", + "generic_combinations": [] + } + ] + } + } + }, + "runtime_name": "predicate", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Filter Predicate" + } + ], + "description": [ + { + "code": "en-US", + "content": "A predicate function to test each element for inclusion in the result." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "A function that takes an element of the array and returns a boolean indicating whether the element should be included in the output array." + } + ] + } + ], + "return_type_identifier": { + "type": { + "GenericType": { + "data_type_identifier": "ARRAY", + "generic_mappers": [ + { + "source": [ + { + "type": { + "GenericKey": "R" + } + } + ], + "target": "T", + "generic_combinations": [] + } + ] + } + } + }, + "throws_error": false, + "generic_keys": [ + "R" + ], + "name": [ + { + "code": "en-US", + "content": "Filter Array" + } + ], + "description": [ + { + "code": "en-US", + "content": "Filters elements of an array based on a predicate." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Returns a new array containing only the elements from the input array for which the predicate returns true." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/array/std_array_find.json b/definitions/standard/runtime_definition/array/std_array_find.json new file mode 100644 index 0000000..12d0280 --- /dev/null +++ b/definitions/standard/runtime_definition/array/std_array_find.json @@ -0,0 +1,117 @@ +{ + "runtime_name": "std::array::find", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "GenericType": { + "data_type_identifier": "ARRAY", + "generic_mappers": [ + { + "source": [ + { + "type": { + "GenericKey": "R" + } + } + ], + "target": "T", + "generic_combinations": [] + } + ] + } + } + }, + "runtime_name": "array", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Input Array" + } + ], + "description": [ + { + "code": "en-US", + "content": "The array to search through." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "The array in which an element satisfying the predicate will be searched." + } + ] + }, + { + "data_type_identifier": { + "type": { + "GenericType": { + "data_type_identifier": "PREDICATE", + "generic_mappers": [ + { + "source": [ + { + "type": { + "GenericKey": "R" + } + } + ], + "target": "T", + "generic_combinations": [] + } + ] + } + } + }, + "runtime_name": "predicate", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Search Predicate" + } + ], + "description": [ + { + "code": "en-US", + "content": "A predicate function used to test each element for a match." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "A function that takes an element of the array and returns a boolean indicating if the element matches the search criteria." + } + ] + } + ], + "return_type_identifier": { + "type": { + "GenericKey": "R" + } + }, + "throws_error": false, + "generic_keys": [ + "R" + ], + "name": [ + { + "code": "en-US", + "content": "Find Element in Array" + } + ], + "description": [ + { + "code": "en-US", + "content": "Finds the first element in the array that satisfies the predicate." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Returns the first element from the input array for which the predicate returns true. If no element matches, returns null or equivalent." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/array/std_array_find_index.json b/definitions/standard/runtime_definition/array/std_array_find_index.json new file mode 100644 index 0000000..1b1c075 --- /dev/null +++ b/definitions/standard/runtime_definition/array/std_array_find_index.json @@ -0,0 +1,117 @@ +{ + "runtime_name": "std::array::find_index", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "GenericType": { + "data_type_identifier": "ARRAY", + "generic_mappers": [ + { + "source": [ + { + "type": { + "GenericKey": "R" + } + } + ], + "target": "T", + "generic_combinations": [] + } + ] + } + } + }, + "runtime_name": "array", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Input Array" + } + ], + "description": [ + { + "code": "en-US", + "content": "The array to search through." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "The array in which to find the index of an element that satisfies the predicate." + } + ] + }, + { + "data_type_identifier": { + "type": { + "GenericType": { + "data_type_identifier": "PREDICATE", + "generic_mappers": [ + { + "source": [ + { + "type": { + "GenericKey": "R" + } + } + ], + "target": "T", + "generic_combinations": [] + } + ] + } + } + }, + "runtime_name": "predicate", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Search Predicate" + } + ], + "description": [ + { + "code": "en-US", + "content": "A predicate function used to test each element for a match." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "A function that takes an element of the array and returns a boolean indicating if the element satisfies the search criteria." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "throws_error": false, + "generic_keys": [ + "R" + ], + "name": [ + { + "code": "en-US", + "content": "Find Index in Array" + } + ], + "description": [ + { + "code": "en-US", + "content": "Finds the index of the first element in the array that satisfies the predicate." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Returns the zero-based index of the first element for which the predicate returns true. If no element matches, returns -1." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/array/std_array_find_last.json b/definitions/standard/runtime_definition/array/std_array_find_last.json new file mode 100644 index 0000000..bff8d2a --- /dev/null +++ b/definitions/standard/runtime_definition/array/std_array_find_last.json @@ -0,0 +1,117 @@ +{ + "runtime_name": "std::array::find_last", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "GenericType": { + "data_type_identifier": "ARRAY", + "generic_mappers": [ + { + "source": [ + { + "type": { + "GenericKey": "R" + } + } + ], + "target": "T", + "generic_combinations": [] + } + ] + } + } + }, + "runtime_name": "array", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Input Array" + } + ], + "description": [ + { + "code": "en-US", + "content": "The array to search through." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "The array in which an element satisfying the predicate will be searched." + } + ] + }, + { + "data_type_identifier": { + "type": { + "GenericType": { + "data_type_identifier": "PREDICATE", + "generic_mappers": [ + { + "source": [ + { + "type": { + "GenericKey": "R" + } + } + ], + "target": "T", + "generic_combinations": [] + } + ] + } + } + }, + "runtime_name": "predicate", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Search Predicate" + } + ], + "description": [ + { + "code": "en-US", + "content": "A predicate function used to test each element for a match." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "A function that takes an element of the array and returns a boolean indicating if the element matches the search criteria." + } + ] + } + ], + "return_type_identifier": { + "type": { + "GenericKey": "R" + } + }, + "throws_error": false, + "generic_keys": [ + "R" + ], + "name": [ + { + "code": "en-US", + "content": "Find Last Element in Array" + } + ], + "description": [ + { + "code": "en-US", + "content": "Finds the last element in the array that satisfies the predicate." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Returns the last element from the input array for which the predicate returns true. If no element matches, returns null or equivalent." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/array/std_array_first.json b/definitions/standard/runtime_definition/array/std_array_first.json new file mode 100644 index 0000000..7dd9471 --- /dev/null +++ b/definitions/standard/runtime_definition/array/std_array_first.json @@ -0,0 +1,75 @@ +{ + "runtime_name": "std::array::first", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "GenericType": { + "data_type_identifier": "ARRAY", + "generic_mappers": [ + { + "source": [ + { + "type": { + "GenericKey": "R" + } + } + ], + "target": "T", + "generic_combinations": [] + } + ] + } + } + }, + "runtime_name": "array", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Input Array" + } + ], + "description": [ + { + "code": "en-US", + "content": "The array from which to retrieve the first element." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Returns the first element of the provided array. If the array is empty, behavior depends on the implementation." + } + ] + } + ], + "return_type_identifier": { + "type": { + "GenericKey": "R" + } + }, + "throws_error": false, + "generic_keys": [ + "R" + ], + "name": [ + { + "code": "en-US", + "content": "First Element of Array" + } + ], + "description": [ + { + "code": "en-US", + "content": "Retrieves the first element from the array." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "This runtime returns the first element in the given array, if any." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/array/std_array_flat.json b/definitions/standard/runtime_definition/array/std_array_flat.json new file mode 100644 index 0000000..01a344c --- /dev/null +++ b/definitions/standard/runtime_definition/array/std_array_flat.json @@ -0,0 +1,105 @@ +{ + "runtime_name": "std::array::flat", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "GenericType": { + "data_type_identifier": "ARRAY", + "generic_mappers": [ + { + "source": [ + { + "type": { + "GenericType": { + "data_type_identifier": "ARRAY", + "generic_mappers": [ + { + "source": [ + { + "type": { + "GenericKey": "R" + } + } + ], + "target": "T", + "generic_combinations": [] + } + ] + } + } + } + ], + "target": "T", + "generic_combinations": [] + } + ] + } + } + }, + "runtime_name": "array", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Nested Array" + } + ], + "description": [ + { + "code": "en-US", + "content": "The nested array to be flattened." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "An array containing sub-arrays that will be flattened into a single-level array." + } + ] + } + ], + "return_type_identifier": { + "type": { + "GenericType": { + "data_type_identifier": "ARRAY", + "generic_mappers": [ + { + "source": [ + { + "type": { + "GenericKey": "R" + } + } + ], + "target": "T", + "generic_combinations": [] + } + ] + } + } + }, + "throws_error": false, + "generic_keys": [ + "R" + ], + "name": [ + { + "code": "en-US", + "content": "Flatten Array" + } + ], + "description": [ + { + "code": "en-US", + "content": "Flattens a nested array into a single-level array." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Returns a new array by concatenating all sub-arrays of the input nested array into one flat array." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/array/std_array_for_each.json b/definitions/standard/runtime_definition/array/std_array_for_each.json new file mode 100644 index 0000000..cfa726d --- /dev/null +++ b/definitions/standard/runtime_definition/array/std_array_for_each.json @@ -0,0 +1,113 @@ +{ + "runtime_name": "std::array::for_each", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "GenericType": { + "data_type_identifier": "ARRAY", + "generic_mappers": [ + { + "source": [ + { + "type": { + "GenericKey": "R" + } + } + ], + "target": "T", + "generic_combinations": [] + } + ] + } + } + }, + "runtime_name": "array", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Input Array" + } + ], + "description": [ + { + "code": "en-US", + "content": "The array of elements to iterate over." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Each element of this array will be passed to the provided consumer function for processing." + } + ] + }, + { + "data_type_identifier": { + "type": { + "GenericType": { + "data_type_identifier": "CONSUMER", + "generic_mappers": [ + { + "source": [ + { + "type": { + "GenericKey": "R" + } + } + ], + "target": "T", + "generic_combinations": [] + } + ] + } + } + }, + "runtime_name": "consumer", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Consumer Function" + } + ], + "description": [ + { + "code": "en-US", + "content": "A function that consumes each element of the array." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "This function is invoked once for each element in the array. It is not expected to return a value." + } + ] + } + ], + "return_type_identifier": null, + "throws_error": false, + "generic_keys": [ + "R" + ], + "name": [ + { + "code": "en-US", + "content": "For Each Element" + } + ], + "description": [ + { + "code": "en-US", + "content": "Executes a consumer function for each element in the array." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "This runtime executes the given consumer function on each item in the array without returning a result." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/array/std_array_index_of.json b/definitions/standard/runtime_definition/array/std_array_index_of.json new file mode 100644 index 0000000..2518a3e --- /dev/null +++ b/definitions/standard/runtime_definition/array/std_array_index_of.json @@ -0,0 +1,100 @@ +{ + "runtime_name": "std::array::index_of", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "GenericType": { + "data_type_identifier": "ARRAY", + "generic_mappers": [ + { + "source": [ + { + "type": { + "GenericKey": "R" + } + } + ], + "target": "T", + "generic_combinations": [] + } + ] + } + } + }, + "runtime_name": "array", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Array" + } + ], + "description": [ + { + "code": "en-US", + "content": "The array to search within." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "An array of elements in which the specified item will be searched for to determine its index." + } + ] + }, + { + "data_type_identifier": { + "type": null + }, + "runtime_name": "item", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Item" + } + ], + "description": [ + { + "code": "en-US", + "content": "The item whose index is to be found in the array." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "The item for which the function searches in the array and returns the index of its first occurrence." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "throws_error": false, + "generic_keys": [ + "R" + ], + "name": [ + { + "code": "en-US", + "content": "Index of Item" + } + ], + "description": [ + { + "code": "en-US", + "content": "Finds the index of the first occurrence of the specified item in the array." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Returns the zero-based index of the first occurrence of a given item in the specified array. If the item is not found, it typically returns -1." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/array/std_array_is_empty.json b/definitions/standard/runtime_definition/array/std_array_is_empty.json new file mode 100644 index 0000000..ba715be --- /dev/null +++ b/definitions/standard/runtime_definition/array/std_array_is_empty.json @@ -0,0 +1,75 @@ +{ + "runtime_name": "std::array::is_empty", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "GenericType": { + "data_type_identifier": "ARRAY", + "generic_mappers": [ + { + "source": [ + { + "type": { + "GenericKey": "R" + } + } + ], + "target": "T", + "generic_combinations": [] + } + ] + } + } + }, + "runtime_name": "array", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Array" + } + ], + "description": [ + { + "code": "en-US", + "content": "The array to check for emptiness." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "The array whose length will be evaluated to determine if it contains any elements." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "BOOLEAN" + } + }, + "throws_error": false, + "generic_keys": [ + "R" + ], + "name": [ + { + "code": "en-US", + "content": "Is Array Empty" + } + ], + "description": [ + { + "code": "en-US", + "content": "Checks if the array has no elements." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Returns true if the array contains no elements, otherwise returns false." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/array/std_array_join.json b/definitions/standard/runtime_definition/array/std_array_join.json new file mode 100644 index 0000000..701377b --- /dev/null +++ b/definitions/standard/runtime_definition/array/std_array_join.json @@ -0,0 +1,100 @@ +{ + "runtime_name": "std::array::join", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "GenericType": { + "data_type_identifier": "ARRAY", + "generic_mappers": [ + { + "source": [ + { + "type": { + "DataTypeIdentifier": "TEXT" + } + } + ], + "target": "T", + "generic_combinations": [] + } + ] + } + } + }, + "runtime_name": "array", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Text Array" + } + ], + "description": [ + { + "code": "en-US", + "content": "An array of text elements to be filtered." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Input array containing text elements for filtering." + } + ] + }, + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "runtime_name": "join_text", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Join Text" + } + ], + "description": [ + { + "code": "en-US", + "content": "Text to join the filtered elements." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "The delimiter or text that will be used to join the filtered array elements into a single string." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Filter and Join Text Array" + } + ], + "description": [ + { + "code": "en-US", + "content": "Filters the input text array and joins the filtered elements into a single string separated by the specified join text." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Applies a filter operation on the input text array and returns a single concatenated string of filtered elements joined by the provided join text." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/array/std_array_last.json b/definitions/standard/runtime_definition/array/std_array_last.json new file mode 100644 index 0000000..c6839b5 --- /dev/null +++ b/definitions/standard/runtime_definition/array/std_array_last.json @@ -0,0 +1,75 @@ +{ + "runtime_name": "std::array::last", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "GenericType": { + "data_type_identifier": "ARRAY", + "generic_mappers": [ + { + "source": [ + { + "type": { + "GenericKey": "R" + } + } + ], + "target": "T", + "generic_combinations": [] + } + ] + } + } + }, + "runtime_name": "array", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Input Array" + } + ], + "description": [ + { + "code": "en-US", + "content": "The array from which to retrieve the last element." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Returns the last element of the provided array. If the array is empty, behavior depends on the implementation." + } + ] + } + ], + "return_type_identifier": { + "type": { + "GenericKey": "R" + } + }, + "throws_error": false, + "generic_keys": [ + "R" + ], + "name": [ + { + "code": "en-US", + "content": "Last Element of Array" + } + ], + "description": [ + { + "code": "en-US", + "content": "Retrieves the last element from the array." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "This runtime returns the last element in the given array, if any." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/array/std_array_map.json b/definitions/standard/runtime_definition/array/std_array_map.json new file mode 100644 index 0000000..815d158 --- /dev/null +++ b/definitions/standard/runtime_definition/array/std_array_map.json @@ -0,0 +1,144 @@ +{ + "runtime_name": "std::array::map", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "GenericType": { + "data_type_identifier": "ARRAY", + "generic_mappers": [ + { + "source": [ + { + "type": { + "GenericKey": "IN" + } + } + ], + "target": "T", + "generic_combinations": [] + } + ] + } + } + }, + "runtime_name": "array", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Input Array" + } + ], + "description": [ + { + "code": "en-US", + "content": "The array to be transformed." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Each element of this array will be passed through the transform function." + } + ] + }, + { + "data_type_identifier": { + "type": { + "GenericType": { + "data_type_identifier": "TRANSFORM", + "generic_mappers": [ + { + "source": [ + { + "type": { + "GenericKey": "IN" + } + } + ], + "target": "I", + "generic_combinations": [] + }, + { + "source": [ + { + "type": { + "GenericKey": "OUT" + } + } + ], + "target": "R", + "generic_combinations": [] + } + ] + } + } + }, + "runtime_name": "transform", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Transform Function" + } + ], + "description": [ + { + "code": "en-US", + "content": "A function that transforms each item in the array." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "The transform function is applied to every element of the array to produce a new array." + } + ] + } + ], + "return_type_identifier": { + "type": { + "GenericType": { + "data_type_identifier": "ARRAY", + "generic_mappers": [ + { + "source": [ + { + "type": { + "GenericKey": "OUT" + } + } + ], + "target": "T", + "generic_combinations": [] + } + ] + } + } + }, + "throws_error": false, + "generic_keys": [ + "IN", + "OUT" + ], + "name": [ + { + "code": "en-US", + "content": "Map Array" + } + ], + "description": [ + { + "code": "en-US", + "content": "Transforms each element in the array using the provided function." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "This runtime applies the transform function to each element in the array, producing a new array of the results." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/array/std_array_max.json b/definitions/standard/runtime_definition/array/std_array_max.json new file mode 100644 index 0000000..4bc8f34 --- /dev/null +++ b/definitions/standard/runtime_definition/array/std_array_max.json @@ -0,0 +1,75 @@ +{ + "runtime_name": "std::array::max", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "GenericType": { + "data_type_identifier": "ARRAY", + "generic_mappers": [ + { + "source": [ + { + "type": { + "GenericKey": "R" + } + } + ], + "target": "T", + "generic_combinations": [] + } + ] + } + } + }, + "runtime_name": "array", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Number Array" + } + ], + "description": [ + { + "code": "en-US", + "content": "An array of numbers to find the maximum value from." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Returns the largest number in the given array of numbers." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "throws_error": false, + "generic_keys": [ + "R" + ], + "name": [ + { + "code": "en-US", + "content": "Find Maximum Number" + } + ], + "description": [ + { + "code": "en-US", + "content": "Finds the maximum value in a numeric array." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Returns the largest number contained in the provided array." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/array/std_array_min.json b/definitions/standard/runtime_definition/array/std_array_min.json new file mode 100644 index 0000000..a2ee23e --- /dev/null +++ b/definitions/standard/runtime_definition/array/std_array_min.json @@ -0,0 +1,75 @@ +{ + "runtime_name": "std::array::min", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "GenericType": { + "data_type_identifier": "ARRAY", + "generic_mappers": [ + { + "source": [ + { + "type": { + "GenericKey": "R" + } + } + ], + "target": "T", + "generic_combinations": [] + } + ] + } + } + }, + "runtime_name": "array", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Number Array" + } + ], + "description": [ + { + "code": "en-US", + "content": "An array of numbers to find the minimum value from." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Returns the smallest number in the given array of numbers." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "throws_error": false, + "generic_keys": [ + "R" + ], + "name": [ + { + "code": "en-US", + "content": "Find Minimum Number" + } + ], + "description": [ + { + "code": "en-US", + "content": "Finds the minimum value in a numeric array." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Returns the smallest number contained in the provided array." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/array/std_array_pop.json b/definitions/standard/runtime_definition/array/std_array_pop.json new file mode 100644 index 0000000..b3cd950 --- /dev/null +++ b/definitions/standard/runtime_definition/array/std_array_pop.json @@ -0,0 +1,75 @@ +{ + "runtime_name": "std::array::pop", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "GenericType": { + "data_type_identifier": "ARRAY", + "generic_mappers": [ + { + "source": [ + { + "type": { + "GenericKey": "R" + } + } + ], + "target": "T", + "generic_combinations": [] + } + ] + } + } + }, + "runtime_name": "array", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Array" + } + ], + "description": [ + { + "code": "en-US", + "content": "The array to remove the last item from." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "This is the array from which the last element will be removed and returned." + } + ] + } + ], + "return_type_identifier": { + "type": { + "GenericKey": "R" + } + }, + "throws_error": false, + "generic_keys": [ + "R" + ], + "name": [ + { + "code": "en-US", + "content": "Pop from Array" + } + ], + "description": [ + { + "code": "en-US", + "content": "Removes and returns the last item from the array." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Removes the last element from the specified array and returns it. The array is modified in place." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/array/std_array_push.json b/definitions/standard/runtime_definition/array/std_array_push.json new file mode 100644 index 0000000..cf237ef --- /dev/null +++ b/definitions/standard/runtime_definition/array/std_array_push.json @@ -0,0 +1,102 @@ +{ + "runtime_name": "std::array::push", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "GenericType": { + "data_type_identifier": "ARRAY", + "generic_mappers": [ + { + "source": [ + { + "type": { + "GenericKey": "I" + } + } + ], + "target": "T", + "generic_combinations": [] + } + ] + } + } + }, + "runtime_name": "array", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Array" + } + ], + "description": [ + { + "code": "en-US", + "content": "The array to which an item will be added." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "The array that the new item will be appended to." + } + ] + }, + { + "data_type_identifier": { + "type": { + "GenericKey": "I" + } + }, + "runtime_name": "item", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Item" + } + ], + "description": [ + { + "code": "en-US", + "content": "The item to add to the array." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "The value to be added at the end of the array." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "throws_error": false, + "generic_keys": [ + "I" + ], + "name": [ + { + "code": "en-US", + "content": "Push to Array" + } + ], + "description": [ + { + "code": "en-US", + "content": "Appends an item to the end of an array." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Adds a new element to the end of the array and returns the new length of the array." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/array/std_array_remove.json b/definitions/standard/runtime_definition/array/std_array_remove.json new file mode 100644 index 0000000..447d5cd --- /dev/null +++ b/definitions/standard/runtime_definition/array/std_array_remove.json @@ -0,0 +1,117 @@ +{ + "runtime_name": "std::array::remove", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "GenericType": { + "data_type_identifier": "ARRAY", + "generic_mappers": [ + { + "source": [ + { + "type": { + "GenericKey": "R" + } + } + ], + "target": "T", + "generic_combinations": [] + } + ] + } + } + }, + "runtime_name": "array", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Array" + } + ], + "description": [ + { + "code": "en-US", + "content": "The array from which the item will be removed." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "An array to process by removing the first occurrence of the specified item." + } + ] + }, + { + "data_type_identifier": { + "type": { + "GenericKey": "R" + } + }, + "runtime_name": "item", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Item" + } + ], + "description": [ + { + "code": "en-US", + "content": "The item to remove from the array." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "The value to search for and remove from the array. Only the first matching item is removed." + } + ] + } + ], + "return_type_identifier": { + "type": { + "GenericType": { + "data_type_identifier": "ARRAY", + "generic_mappers": [ + { + "source": [ + { + "type": { + "GenericKey": "R" + } + } + ], + "target": "T", + "generic_combinations": [] + } + ] + } + } + }, + "throws_error": false, + "generic_keys": [ + "R" + ], + "name": [ + { + "code": "en-US", + "content": "Remove from Array" + } + ], + "description": [ + { + "code": "en-US", + "content": "Removes the first occurrence of the specified item from the array." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Removes the first matching item from the given array and returns the resulting array." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/array/std_array_reverse.json b/definitions/standard/runtime_definition/array/std_array_reverse.json new file mode 100644 index 0000000..f61b1a5 --- /dev/null +++ b/definitions/standard/runtime_definition/array/std_array_reverse.json @@ -0,0 +1,90 @@ +{ + "runtime_name": "std::array::reverse", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "GenericType": { + "data_type_identifier": "ARRAY", + "generic_mappers": [ + { + "source": [ + { + "type": { + "GenericKey": "R" + } + } + ], + "target": "T", + "generic_combinations": [] + } + ] + } + } + }, + "runtime_name": "array", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Array" + } + ], + "description": [ + { + "code": "en-US", + "content": "The input array to be reversed." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "An array of elements whose order will be reversed." + } + ] + } + ], + "return_type_identifier": { + "type": { + "GenericType": { + "data_type_identifier": "ARRAY", + "generic_mappers": [ + { + "source": [ + { + "type": { + "GenericKey": "R" + } + } + ], + "target": "T", + "generic_combinations": [] + } + ] + } + } + }, + "throws_error": false, + "generic_keys": [ + "R" + ], + "name": [ + { + "code": "en-US", + "content": "Reverse Array" + } + ], + "description": [ + { + "code": "en-US", + "content": "Reverses the order of elements in the array." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Returns a new array with the elements of the input array in reverse order." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/array/std_array_size.json b/definitions/standard/runtime_definition/array/std_array_size.json new file mode 100644 index 0000000..b65c24f --- /dev/null +++ b/definitions/standard/runtime_definition/array/std_array_size.json @@ -0,0 +1,75 @@ +{ + "runtime_name": "std::array::size", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "GenericType": { + "data_type_identifier": "ARRAY", + "generic_mappers": [ + { + "source": [ + { + "type": { + "GenericKey": "R" + } + } + ], + "target": "T", + "generic_combinations": [] + } + ] + } + } + }, + "runtime_name": "array", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Array" + } + ], + "description": [ + { + "code": "en-US", + "content": "The array whose number of elements is to be returned." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Specifies the array for which the total number of elements will be calculated and returned." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "throws_error": false, + "generic_keys": [ + "R" + ], + "name": [ + { + "code": "en-US", + "content": "Array Size" + } + ], + "description": [ + { + "code": "en-US", + "content": "Returns the number of elements in the array." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "This function returns the count of elements present in the given array." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/array/std_array_sort.json b/definitions/standard/runtime_definition/array/std_array_sort.json new file mode 100644 index 0000000..2eca2da --- /dev/null +++ b/definitions/standard/runtime_definition/array/std_array_sort.json @@ -0,0 +1,132 @@ +{ + "runtime_name": "std::array::sort", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "GenericType": { + "data_type_identifier": "ARRAY", + "generic_mappers": [ + { + "source": [ + { + "type": { + "GenericKey": "R" + } + } + ], + "target": "T", + "generic_combinations": [] + } + ] + } + } + }, + "runtime_name": "array", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Array" + } + ], + "description": [ + { + "code": "en-US", + "content": "The input array to be sorted." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "An array of elements that will be sorted using the provided comparator function." + } + ] + }, + { + "data_type_identifier": { + "type": { + "GenericType": { + "data_type_identifier": "COMPARATOR", + "generic_mappers": [ + { + "source": [ + { + "type": { + "GenericKey": "R" + } + } + ], + "target": "I", + "generic_combinations": [] + } + ] + } + } + }, + "runtime_name": "comparator", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Comparator" + } + ], + "description": [ + { + "code": "en-US", + "content": "A comparator function used to determine the sort order of elements." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "A function that takes two elements and returns a negative, zero, or positive number to indicate their ordering." + } + ] + } + ], + "return_type_identifier": { + "type": { + "GenericType": { + "data_type_identifier": "ARRAY", + "generic_mappers": [ + { + "source": [ + { + "type": { + "GenericKey": "R" + } + } + ], + "target": "T", + "generic_combinations": [] + } + ] + } + } + }, + "throws_error": false, + "generic_keys": [ + "R" + ], + "name": [ + { + "code": "en-US", + "content": "Sort Array" + } + ], + "description": [ + { + "code": "en-US", + "content": "Sorts the elements of the array using the specified comparator." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Returns a new array with the elements sorted according to the comparator function provided." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/array/std_array_sort_reverse.json b/definitions/standard/runtime_definition/array/std_array_sort_reverse.json new file mode 100644 index 0000000..48b065f --- /dev/null +++ b/definitions/standard/runtime_definition/array/std_array_sort_reverse.json @@ -0,0 +1,115 @@ +{ + "runtime_name": "std::array::sort_reverse", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "GenericType": { + "data_type_identifier": "ARRAY", + "generic_mappers": [ + { + "source": [ + { + "type": { + "GenericKey": "R" + } + } + ], + "target": "T", + "generic_combinations": [] + } + ] + } + } + }, + "runtime_name": "array", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Array" + } + ], + "description": [ + { + "code": "en-US", + "content": "The input array to be sorted in reverse order." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "An array of elements that will be sorted in descending order using the provided comparator." + } + ] + }, + { + "data_type_identifier": { + "type": { + "GenericType": { + "data_type_identifier": "COMPARATOR", + "generic_mappers": [ + { + "source": [ + { + "type": { + "GenericKey": "R" + } + } + ], + "target": "I", + "generic_combinations": [] + } + ] + } + } + }, + "runtime_name": "comparator", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Comparator" + } + ], + "description": [ + { + "code": "en-US", + "content": "A comparator function used to determine the sort order of elements." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "A function that takes two elements and returns a negative, zero, or positive number to indicate their ordering." + } + ] + } + ], + "return_type_identifier": { + "type": null + }, + "throws_error": false, + "generic_keys": [ + "R" + ], + "name": [ + { + "code": "en-US", + "content": "Sort Array in Reverse" + } + ], + "description": [ + { + "code": "en-US", + "content": "Sorts the elements of the array in reverse order using the specified comparator." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Returns a new array with the elements sorted in descending order according to the comparator function provided." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/array/std_array_sum.json b/definitions/standard/runtime_definition/array/std_array_sum.json new file mode 100644 index 0000000..5fb880b --- /dev/null +++ b/definitions/standard/runtime_definition/array/std_array_sum.json @@ -0,0 +1,73 @@ +{ + "runtime_name": "std::array::sum", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "GenericType": { + "data_type_identifier": "ARRAY", + "generic_mappers": [ + { + "source": [ + { + "type": { + "DataTypeIdentifier": "NUMBER" + } + } + ], + "target": "T", + "generic_combinations": [] + } + ] + } + } + }, + "runtime_name": "array", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Number Array" + } + ], + "description": [ + { + "code": "en-US", + "content": "An array of numbers to be summed." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Calculates the sum of all numbers in the given array." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Sum of Numbers" + } + ], + "description": [ + { + "code": "en-US", + "content": "Returns the total sum of the elements in the numeric array." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Adds up all numbers in the input array and returns their sum." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/array/std_array_to_unique.json b/definitions/standard/runtime_definition/array/std_array_to_unique.json new file mode 100644 index 0000000..e0e5e50 --- /dev/null +++ b/definitions/standard/runtime_definition/array/std_array_to_unique.json @@ -0,0 +1,90 @@ +{ + "runtime_name": "std::array::to_unique", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "GenericType": { + "data_type_identifier": "ARRAY", + "generic_mappers": [ + { + "source": [ + { + "type": { + "GenericKey": "R" + } + } + ], + "target": "T", + "generic_combinations": [] + } + ] + } + } + }, + "runtime_name": "array", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Array" + } + ], + "description": [ + { + "code": "en-US", + "content": "The input array from which duplicates will be removed." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "An array of elements that may contain duplicates. This function will remove any duplicate items and return a new array with unique values only." + } + ] + } + ], + "return_type_identifier": { + "type": { + "GenericType": { + "data_type_identifier": "ARRAY", + "generic_mappers": [ + { + "source": [ + { + "type": { + "GenericKey": "R" + } + } + ], + "target": "T", + "generic_combinations": [] + } + ] + } + } + }, + "throws_error": false, + "generic_keys": [ + "R" + ], + "name": [ + { + "code": "en-US", + "content": "To Unique" + } + ], + "description": [ + { + "code": "en-US", + "content": "Removes duplicate elements from the input array." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Returns a new array containing only the unique elements from the input array. The original order may or may not be preserved depending on the implementation." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/boolean/std_boolean_as_number.json b/definitions/standard/runtime_definition/boolean/std_boolean_as_number.json new file mode 100644 index 0000000..5cbea4e --- /dev/null +++ b/definitions/standard/runtime_definition/boolean/std_boolean_as_number.json @@ -0,0 +1,58 @@ +{ + "runtime_name": "std::boolean::as_number", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "BOOLEAN" + } + }, + "runtime_name": "value", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Value" + } + ], + "description": [ + { + "code": "en-US", + "content": "The boolean value to convert." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Converts a boolean value to a number." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "As Number" + } + ], + "description": [ + { + "code": "en-US", + "content": "Will convert the boolean to a number." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Converts a boolean value to a number." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/boolean/std_boolean_as_text.json b/definitions/standard/runtime_definition/boolean/std_boolean_as_text.json new file mode 100644 index 0000000..0414734 --- /dev/null +++ b/definitions/standard/runtime_definition/boolean/std_boolean_as_text.json @@ -0,0 +1,58 @@ +{ + "runtime_name": "std::boolean::as_text", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "BOOLEAN" + } + }, + "runtime_name": "value", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Value" + } + ], + "description": [ + { + "code": "en-US", + "content": "The boolean value to convert." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Converts a boolean value to a text string." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "As Text" + } + ], + "description": [ + { + "code": "en-US", + "content": "Will convert the boolean to text." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Converts a boolean value to a text string." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/boolean/std_boolean_from_number.json b/definitions/standard/runtime_definition/boolean/std_boolean_from_number.json new file mode 100644 index 0000000..19e6af1 --- /dev/null +++ b/definitions/standard/runtime_definition/boolean/std_boolean_from_number.json @@ -0,0 +1,58 @@ +{ + "runtime_name": "std::boolean::from_number", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "runtime_name": "value", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Value" + } + ], + "description": [ + { + "code": "en-US", + "content": "The number to convert." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Converts a number to a boolean value." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "BOOLEAN" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "From Number" + } + ], + "description": [ + { + "code": "en-US", + "content": "Will convert the number to a boolean." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Converts a number to a boolean value. Typically, 0 maps to false and non-zero maps to true." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/boolean/std_boolean_from_text.json b/definitions/standard/runtime_definition/boolean/std_boolean_from_text.json new file mode 100644 index 0000000..e4b2fc0 --- /dev/null +++ b/definitions/standard/runtime_definition/boolean/std_boolean_from_text.json @@ -0,0 +1,58 @@ +{ + "runtime_name": "std::boolean::from_text", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "runtime_name": "value", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Value" + } + ], + "description": [ + { + "code": "en-US", + "content": "The text string to convert." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Converts a text string to a boolean value." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "BOOLEAN" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "From Text" + } + ], + "description": [ + { + "code": "en-US", + "content": "Will convert the string to a boolean." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Converts a text string to a boolean value. Recognizes 'true' and 'false' (case-insensitive)." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/boolean/std_boolean_is_equal.json b/definitions/standard/runtime_definition/boolean/std_boolean_is_equal.json new file mode 100644 index 0000000..ba8b033 --- /dev/null +++ b/definitions/standard/runtime_definition/boolean/std_boolean_is_equal.json @@ -0,0 +1,85 @@ +{ + "runtime_name": "std::boolean::is_equal", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "BOOLEAN" + } + }, + "runtime_name": "first", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "First" + } + ], + "description": [ + { + "code": "en-US", + "content": "The first boolean value to compare." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "The first input to compare." + } + ] + }, + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "BOOLEAN" + } + }, + "runtime_name": "second", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Second" + } + ], + "description": [ + { + "code": "en-US", + "content": "The second boolean value to compare." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "The second input to compare." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "BOOLEAN" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Is Equal" + } + ], + "description": [ + { + "code": "en-US", + "content": "Will check if the two booleans are equal." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Compares two boolean values for equality. Returns true if they are the same, false otherwise." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/boolean/std_boolean_negate.json b/definitions/standard/runtime_definition/boolean/std_boolean_negate.json new file mode 100644 index 0000000..601b81a --- /dev/null +++ b/definitions/standard/runtime_definition/boolean/std_boolean_negate.json @@ -0,0 +1,58 @@ +{ + "runtime_name": "std::boolean::negate", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "BOOLEAN" + } + }, + "runtime_name": "value", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Value" + } + ], + "description": [ + { + "code": "en-US", + "content": "The boolean value to negate." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Negates a boolean value." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "BOOLEAN" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Negate" + } + ], + "description": [ + { + "code": "en-US", + "content": "Negates a boolean value." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Negates a boolean value." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/control/std_control_break.json b/definitions/standard/runtime_definition/control/std_control_break.json new file mode 100644 index 0000000..e19fdf3 --- /dev/null +++ b/definitions/standard/runtime_definition/control/std_control_break.json @@ -0,0 +1,26 @@ +{ + "runtime_name": "std::control::break", + "runtime_parameter_definitions": [], + "return_type_identifier": null, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Break" + } + ], + "description": [ + { + "code": "en-US", + "content": "Breaks the current loop." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Breaks the current loop." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/control/std_control_return.json b/definitions/standard/runtime_definition/control/std_control_return.json new file mode 100644 index 0000000..ad246cb --- /dev/null +++ b/definitions/standard/runtime_definition/control/std_control_return.json @@ -0,0 +1,60 @@ +{ + "runtime_name": "std::control::return", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "GenericKey": "R" + } + }, + "runtime_name": "value", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Return Value" + } + ], + "description": [ + { + "code": "en-US", + "content": "The value to be returned." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "This value will be returned to the upper context." + } + ] + } + ], + "return_type_identifier": { + "type": { + "GenericKey": "R" + } + }, + "throws_error": false, + "generic_keys": [ + "R" + ], + "name": [ + { + "code": "en-US", + "content": "Return" + } + ], + "description": [ + { + "code": "en-US", + "content": "Returns the specified value to the upper context." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Returns the specified value to the upper context." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/number/std_number_abs.json b/definitions/standard/runtime_definition/number/std_number_abs.json new file mode 100644 index 0000000..0248aff --- /dev/null +++ b/definitions/standard/runtime_definition/number/std_number_abs.json @@ -0,0 +1,58 @@ +{ + "runtime_name": "std::number::abs", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "runtime_name": "value", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Value" + } + ], + "description": [ + { + "code": "en-US", + "content": "The number for which to compute the absolute value." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "This is the numeric input. The result will be its absolute (non-negative) value." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Absolute Value" + } + ], + "description": [ + { + "code": "en-US", + "content": "Returns the absolute value of a number." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Removes the sign from the input number, returning its non-negative value." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/number/std_number_add.json b/definitions/standard/runtime_definition/number/std_number_add.json new file mode 100644 index 0000000..5b00d9e --- /dev/null +++ b/definitions/standard/runtime_definition/number/std_number_add.json @@ -0,0 +1,85 @@ +{ + "runtime_name": "std::number::add", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "runtime_name": "first", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "First Number" + } + ], + "description": [ + { + "code": "en-US", + "content": "The first number to add." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Adds two numbers together." + } + ] + }, + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "runtime_name": "second", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Second Number" + } + ], + "description": [ + { + "code": "en-US", + "content": "The second number to add." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Adds two numbers together." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Adds two numbers together." + } + ], + "description": [ + { + "code": "en-US", + "content": "Adds two numbers together." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Adds two numbers together." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/number/std_number_arccos.json b/definitions/standard/runtime_definition/number/std_number_arccos.json new file mode 100644 index 0000000..d82891d --- /dev/null +++ b/definitions/standard/runtime_definition/number/std_number_arccos.json @@ -0,0 +1,58 @@ +{ + "runtime_name": "std::number::arccos", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "runtime_name": "value", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Value" + } + ], + "description": [ + { + "code": "en-US", + "content": "The number representing the cosine value, must be between -1 and 1." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Calculates the arccosine (inverse cosine) of the input value." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Arccosine" + } + ], + "description": [ + { + "code": "en-US", + "content": "Returns the arccosine of a number, in radians." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Computes the angle in radians whose cosine is the given number." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/number/std_number_arcsin.json b/definitions/standard/runtime_definition/number/std_number_arcsin.json new file mode 100644 index 0000000..3b1a535 --- /dev/null +++ b/definitions/standard/runtime_definition/number/std_number_arcsin.json @@ -0,0 +1,58 @@ +{ + "runtime_name": "std::number::arcsin", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "runtime_name": "value", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Value" + } + ], + "description": [ + { + "code": "en-US", + "content": "The number representing the sine value, must be between -1 and 1." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Calculates the arcsine (inverse sine) of the input value." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Arcsine" + } + ], + "description": [ + { + "code": "en-US", + "content": "Returns the arcsine of a number, in radians." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Computes the angle in radians whose sine is the given number." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/number/std_number_arctan.json b/definitions/standard/runtime_definition/number/std_number_arctan.json new file mode 100644 index 0000000..cd7d2b8 --- /dev/null +++ b/definitions/standard/runtime_definition/number/std_number_arctan.json @@ -0,0 +1,58 @@ +{ + "runtime_name": "std::number::arctan", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "runtime_name": "value", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Value" + } + ], + "description": [ + { + "code": "en-US", + "content": "The number representing the tangent value." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Calculates the arctangent (inverse tangent) of the input value." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Arctangent" + } + ], + "description": [ + { + "code": "en-US", + "content": "Returns the arctangent of a number, in radians." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Computes the angle in radians whose tangent is the given number." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/number/std_number_as_text.json b/definitions/standard/runtime_definition/number/std_number_as_text.json new file mode 100644 index 0000000..9ca2bf7 --- /dev/null +++ b/definitions/standard/runtime_definition/number/std_number_as_text.json @@ -0,0 +1,58 @@ +{ + "runtime_name": "std::number::as_text", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "runtime_name": "number", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Number" + } + ], + "description": [ + { + "code": "en-US", + "content": "The number to convert to text." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "The numeric input that will be converted to its text representation." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Number as Text" + } + ], + "description": [ + { + "code": "en-US", + "content": "Converts a number into its textual representation." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Transforms the given numeric value into a string format." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/number/std_number_clamp.json b/definitions/standard/runtime_definition/number/std_number_clamp.json new file mode 100644 index 0000000..00de2dc --- /dev/null +++ b/definitions/standard/runtime_definition/number/std_number_clamp.json @@ -0,0 +1,112 @@ +{ + "runtime_name": "std::number::clamp", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "runtime_name": "value", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Value" + } + ], + "description": [ + { + "code": "en-US", + "content": "The number to be clamped within the range." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "The input number that will be limited to the specified range." + } + ] + }, + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "runtime_name": "min", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Minimum" + } + ], + "description": [ + { + "code": "en-US", + "content": "The lower bound of the clamping range." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "The minimum allowed value in the clamping operation." + } + ] + }, + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "runtime_name": "max", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Maximum" + } + ], + "description": [ + { + "code": "en-US", + "content": "The upper bound of the clamping range." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "The maximum allowed value in the clamping operation." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Clamp" + } + ], + "description": [ + { + "code": "en-US", + "content": "Limits a number to be within a specified range." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Returns the given number clamped between the minimum and maximum bounds." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/number/std_number_cos.json b/definitions/standard/runtime_definition/number/std_number_cos.json new file mode 100644 index 0000000..8ca27df --- /dev/null +++ b/definitions/standard/runtime_definition/number/std_number_cos.json @@ -0,0 +1,58 @@ +{ + "runtime_name": "std::number::cos", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "runtime_name": "radians", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Radians" + } + ], + "description": [ + { + "code": "en-US", + "content": "The angle in radians to compute the cosine of." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Computes the cosine of the given angle in radians." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Cosine" + } + ], + "description": [ + { + "code": "en-US", + "content": "Returns the cosine of the specified angle in radians." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Calculates the cosine value of the input angle measured in radians." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/number/std_number_cosh.json b/definitions/standard/runtime_definition/number/std_number_cosh.json new file mode 100644 index 0000000..c525f51 --- /dev/null +++ b/definitions/standard/runtime_definition/number/std_number_cosh.json @@ -0,0 +1,58 @@ +{ + "runtime_name": "std::number::cosh", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "runtime_name": "value", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Value" + } + ], + "description": [ + { + "code": "en-US", + "content": "The number for which to calculate the hyperbolic cosine." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Computes the hyperbolic cosine of the given number." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Hyperbolic Cosine" + } + ], + "description": [ + { + "code": "en-US", + "content": "Returns the hyperbolic cosine of a number." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Calculates the hyperbolic cosine (cosh) of the input value." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/number/std_number_divide.json b/definitions/standard/runtime_definition/number/std_number_divide.json new file mode 100644 index 0000000..23413d9 --- /dev/null +++ b/definitions/standard/runtime_definition/number/std_number_divide.json @@ -0,0 +1,85 @@ +{ + "runtime_name": "std::number::divide", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "runtime_name": "first", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Dividend" + } + ], + "description": [ + { + "code": "en-US", + "content": "The number to be divided." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "This is the numerator or the number that will be divided by the second value." + } + ] + }, + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "runtime_name": "second", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Divisor" + } + ], + "description": [ + { + "code": "en-US", + "content": "The number by which to divide the first number." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "This is the denominator or the value that divides the first number." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Divide" + } + ], + "description": [ + { + "code": "en-US", + "content": "Divides the first number by the second number." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Returns the result of dividing the first numeric input (dividend) by the second (divisor)." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/number/std_number_euler.json b/definitions/standard/runtime_definition/number/std_number_euler.json new file mode 100644 index 0000000..41ef4b0 --- /dev/null +++ b/definitions/standard/runtime_definition/number/std_number_euler.json @@ -0,0 +1,30 @@ +{ + "runtime_name": "std::number::euler", + "runtime_parameter_definitions": [], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Euler's Number" + } + ], + "description": [ + { + "code": "en-US", + "content": "Returns the mathematical constant e (Euler's number)." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Provides the constant value of Euler's number, approximately 2.71828, which is the base of the natural logarithm." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/number/std_number_exponential.json b/definitions/standard/runtime_definition/number/std_number_exponential.json new file mode 100644 index 0000000..e773016 --- /dev/null +++ b/definitions/standard/runtime_definition/number/std_number_exponential.json @@ -0,0 +1,85 @@ +{ + "runtime_name": "std::number::exponential", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "runtime_name": "base", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Base" + } + ], + "description": [ + { + "code": "en-US", + "content": "The base number to be raised to a power." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "This is the numeric value that will be raised to the power of the exponent." + } + ] + }, + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "runtime_name": "exponent", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Exponent" + } + ], + "description": [ + { + "code": "en-US", + "content": "The exponent to raise the base number by." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "This numeric value indicates the power to which the base is raised." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Exponential" + } + ], + "description": [ + { + "code": "en-US", + "content": "Raises a base number to the power of an exponent." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Computes the result of raising the base to the power specified by the exponent." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/number/std_number_from_text.json b/definitions/standard/runtime_definition/number/std_number_from_text.json new file mode 100644 index 0000000..7e58c9c --- /dev/null +++ b/definitions/standard/runtime_definition/number/std_number_from_text.json @@ -0,0 +1,58 @@ +{ + "runtime_name": "std::number::from_text", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "runtime_name": "text", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Text" + } + ], + "description": [ + { + "code": "en-US", + "content": "The text string to convert to a number." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Parses the input text and attempts to convert it to a numeric value." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Number from Text" + } + ], + "description": [ + { + "code": "en-US", + "content": "Converts a text string into a number if possible." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Attempts to parse the provided text input and return its numeric equivalent." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/number/std_number_infinity.json b/definitions/standard/runtime_definition/number/std_number_infinity.json new file mode 100644 index 0000000..be393cc --- /dev/null +++ b/definitions/standard/runtime_definition/number/std_number_infinity.json @@ -0,0 +1,30 @@ +{ + "runtime_name": "std::number::infinity", + "runtime_parameter_definitions": [], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Infinity" + } + ], + "description": [ + { + "code": "en-US", + "content": "Returns the mathematical concept of positive infinity." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Provides the representation of positive infinity, used to represent an unbounded value in computations." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/number/std_number_is_equal.json b/definitions/standard/runtime_definition/number/std_number_is_equal.json new file mode 100644 index 0000000..2cc401f --- /dev/null +++ b/definitions/standard/runtime_definition/number/std_number_is_equal.json @@ -0,0 +1,85 @@ +{ + "runtime_name": "std::number::is_equal", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "runtime_name": "first", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "First Number" + } + ], + "description": [ + { + "code": "en-US", + "content": "The first number to compare." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "The first operand in the equality check." + } + ] + }, + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "runtime_name": "second", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Second Number" + } + ], + "description": [ + { + "code": "en-US", + "content": "The second number to compare." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "The second operand in the equality check." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "BOOLEAN" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Is Equal" + } + ], + "description": [ + { + "code": "en-US", + "content": "Checks whether two numbers are equal." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Returns true if the first number is equal to the second number, otherwise false." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/number/std_number_is_greater.json b/definitions/standard/runtime_definition/number/std_number_is_greater.json new file mode 100644 index 0000000..7fad773 --- /dev/null +++ b/definitions/standard/runtime_definition/number/std_number_is_greater.json @@ -0,0 +1,85 @@ +{ + "runtime_name": "std::number::is_greater", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "runtime_name": "first", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "First Number" + } + ], + "description": [ + { + "code": "en-US", + "content": "The number to compare against the second number." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "This is the number that will be evaluated to determine if it is greater than the second number." + } + ] + }, + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "runtime_name": "second", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Second Number" + } + ], + "description": [ + { + "code": "en-US", + "content": "The number to compare with the first number." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "This is the number that the first number will be compared to." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "BOOLEAN" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Is Greater" + } + ], + "description": [ + { + "code": "en-US", + "content": "Checks whether the first number is greater than the second number." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Returns true if the first numeric input is greater than the second; otherwise, returns false." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/number/std_number_is_less.json b/definitions/standard/runtime_definition/number/std_number_is_less.json new file mode 100644 index 0000000..41d8d9d --- /dev/null +++ b/definitions/standard/runtime_definition/number/std_number_is_less.json @@ -0,0 +1,85 @@ +{ + "runtime_name": "std::number::is_less", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "runtime_name": "first", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "First Number" + } + ], + "description": [ + { + "code": "en-US", + "content": "The number to compare with the second number." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "This is the number that will be evaluated to determine if it is less than the second number." + } + ] + }, + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "runtime_name": "second", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Second Number" + } + ], + "description": [ + { + "code": "en-US", + "content": "The number to compare against the first number." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "This is the number that the first number will be compared to." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "BOOLEAN" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Is Less" + } + ], + "description": [ + { + "code": "en-US", + "content": "Checks whether the first number is less than the second number." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Returns true if the first numeric input is less than the second; otherwise, returns false." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/number/std_number_is_positive.json b/definitions/standard/runtime_definition/number/std_number_is_positive.json new file mode 100644 index 0000000..ebe629a --- /dev/null +++ b/definitions/standard/runtime_definition/number/std_number_is_positive.json @@ -0,0 +1,58 @@ +{ + "runtime_name": "std::number::is_positive", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "runtime_name": "value", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Value" + } + ], + "description": [ + { + "code": "en-US", + "content": "The number to check for positivity." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "This is the numeric input that will be evaluated to determine whether it is greater than zero." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "BOOLEAN" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Is Positive" + } + ], + "description": [ + { + "code": "en-US", + "content": "Checks whether a number is greater than zero." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Evaluates the input number and returns true if it is positive (greater than zero), otherwise false." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/number/std_number_is_zero.json b/definitions/standard/runtime_definition/number/std_number_is_zero.json new file mode 100644 index 0000000..7d2606a --- /dev/null +++ b/definitions/standard/runtime_definition/number/std_number_is_zero.json @@ -0,0 +1,58 @@ +{ + "runtime_name": "std::number::is_zero", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "runtime_name": "value", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Value" + } + ], + "description": [ + { + "code": "en-US", + "content": "The number to check if it is zero." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "This is the numeric input evaluated to determine whether it equals zero." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "BOOLEAN" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Is Zero" + } + ], + "description": [ + { + "code": "en-US", + "content": "Checks whether the given number is exactly zero." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Returns true if the input number is zero; otherwise, returns false." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/number/std_number_ln.json b/definitions/standard/runtime_definition/number/std_number_ln.json new file mode 100644 index 0000000..4e71cc4 --- /dev/null +++ b/definitions/standard/runtime_definition/number/std_number_ln.json @@ -0,0 +1,58 @@ +{ + "runtime_name": "std::number::ln", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "runtime_name": "value", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Value" + } + ], + "description": [ + { + "code": "en-US", + "content": "The number to compute the natural logarithm for." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "The numeric input whose natural logarithm (log base e) will be calculated." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Natural Logarithm" + } + ], + "description": [ + { + "code": "en-US", + "content": "Calculates the natural logarithm (log base e) of a number." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Returns the natural logarithm of the given value." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/number/std_number_log.json b/definitions/standard/runtime_definition/number/std_number_log.json new file mode 100644 index 0000000..00bbdd0 --- /dev/null +++ b/definitions/standard/runtime_definition/number/std_number_log.json @@ -0,0 +1,85 @@ +{ + "runtime_name": "std::number::log", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "runtime_name": "value", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Value" + } + ], + "description": [ + { + "code": "en-US", + "content": "The number to compute the logarithm for." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "The numeric input whose logarithm is to be calculated." + } + ] + }, + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "runtime_name": "base", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Base" + } + ], + "description": [ + { + "code": "en-US", + "content": "The base of the logarithm." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Specifies the logarithmic base to use (e.g., 10 for common log, e for natural log)." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Logarithm" + } + ], + "description": [ + { + "code": "en-US", + "content": "Calculates the logarithm of a number with respect to a specified base." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Returns the logarithm of the given value using the specified base." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/number/std_number_max.json b/definitions/standard/runtime_definition/number/std_number_max.json new file mode 100644 index 0000000..44adb24 --- /dev/null +++ b/definitions/standard/runtime_definition/number/std_number_max.json @@ -0,0 +1,85 @@ +{ + "runtime_name": "std::number::max", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "runtime_name": "first", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "First Number" + } + ], + "description": [ + { + "code": "en-US", + "content": "The first number to compare." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "One of the two numbers for which the maximum value will be determined." + } + ] + }, + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "runtime_name": "second", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Second Number" + } + ], + "description": [ + { + "code": "en-US", + "content": "The second number to compare." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "The other number involved in the maximum value comparison." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Maximum" + } + ], + "description": [ + { + "code": "en-US", + "content": "Returns the larger of two numbers." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Compares two numbers and returns the maximum value." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/number/std_number_min.json b/definitions/standard/runtime_definition/number/std_number_min.json new file mode 100644 index 0000000..b307e3f --- /dev/null +++ b/definitions/standard/runtime_definition/number/std_number_min.json @@ -0,0 +1,85 @@ +{ + "runtime_name": "std::number::min", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "runtime_name": "first", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "First Number" + } + ], + "description": [ + { + "code": "en-US", + "content": "The first number to compare." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "One of the two numbers for which the minimum value will be determined." + } + ] + }, + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "runtime_name": "second", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Second Number" + } + ], + "description": [ + { + "code": "en-US", + "content": "The second number to compare." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "The other number involved in the minimum value comparison." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Minimum" + } + ], + "description": [ + { + "code": "en-US", + "content": "Returns the smaller of two numbers." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Compares two numbers and returns the minimum value." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/number/std_number_modulo.json b/definitions/standard/runtime_definition/number/std_number_modulo.json new file mode 100644 index 0000000..149c154 --- /dev/null +++ b/definitions/standard/runtime_definition/number/std_number_modulo.json @@ -0,0 +1,85 @@ +{ + "runtime_name": "std::number::modulo", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "runtime_name": "first", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Dividend" + } + ], + "description": [ + { + "code": "en-US", + "content": "The number to be divided to find the remainder." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "This is the number that will be divided by the second value to calculate the remainder." + } + ] + }, + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "runtime_name": "second", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Divisor" + } + ], + "description": [ + { + "code": "en-US", + "content": "The number by which the first number is divided to get the remainder." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "This is the number used to divide the dividend and obtain the remainder." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Modulo" + } + ], + "description": [ + { + "code": "en-US", + "content": "Returns the remainder after dividing the first number by the second." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Computes the modulus (remainder) of dividing the first numeric input by the second." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/number/std_number_multiply.json b/definitions/standard/runtime_definition/number/std_number_multiply.json new file mode 100644 index 0000000..f4ca864 --- /dev/null +++ b/definitions/standard/runtime_definition/number/std_number_multiply.json @@ -0,0 +1,85 @@ +{ + "runtime_name": "std::number::multiply", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "runtime_name": "first", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "First Number" + } + ], + "description": [ + { + "code": "en-US", + "content": "The first number to multiply." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Specifies the first operand in the multiplication operation." + } + ] + }, + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "runtime_name": "second", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Second Number" + } + ], + "description": [ + { + "code": "en-US", + "content": "The second number to multiply." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Specifies the second operand in the multiplication operation." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Multiply" + } + ], + "description": [ + { + "code": "en-US", + "content": "Multiplies two numbers together." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Takes two numeric inputs and returns their product." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/number/std_number_negate.json b/definitions/standard/runtime_definition/number/std_number_negate.json new file mode 100644 index 0000000..6cb68f8 --- /dev/null +++ b/definitions/standard/runtime_definition/number/std_number_negate.json @@ -0,0 +1,58 @@ +{ + "runtime_name": "std::number::negate", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "runtime_name": "value", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Value" + } + ], + "description": [ + { + "code": "en-US", + "content": "The number to negate." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "The numeric input whose sign will be inverted." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Negate" + } + ], + "description": [ + { + "code": "en-US", + "content": "Returns the negation of a number (multiplies by -1)." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Calculates the additive inverse of the given number." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/number/std_number_pi.json b/definitions/standard/runtime_definition/number/std_number_pi.json new file mode 100644 index 0000000..b2510b8 --- /dev/null +++ b/definitions/standard/runtime_definition/number/std_number_pi.json @@ -0,0 +1,30 @@ +{ + "runtime_name": "std::number::pi", + "runtime_parameter_definitions": [], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Pi" + } + ], + "description": [ + { + "code": "en-US", + "content": "Returns the mathematical constant π (pi)." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Provides the constant value of pi, approximately 3.14159, used in many mathematical calculations." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/number/std_number_random_number.json b/definitions/standard/runtime_definition/number/std_number_random_number.json new file mode 100644 index 0000000..8c835db --- /dev/null +++ b/definitions/standard/runtime_definition/number/std_number_random_number.json @@ -0,0 +1,85 @@ +{ + "runtime_name": "std::number::random_number", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "runtime_name": "min", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Minimum" + } + ], + "description": [ + { + "code": "en-US", + "content": "The minimum value in the random number range." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Defines the lower bound (inclusive) for the random number generation." + } + ] + }, + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "runtime_name": "max", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Maximum" + } + ], + "description": [ + { + "code": "en-US", + "content": "The maximum value in the random number range." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Defines the upper bound (inclusive) for the random number generation." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Random Number" + } + ], + "description": [ + { + "code": "en-US", + "content": "Generates a random number between the specified minimum and maximum values." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Returns a randomly generated number within the given range, inclusive of both minimum and maximum." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/number/std_number_root.json b/definitions/standard/runtime_definition/number/std_number_root.json new file mode 100644 index 0000000..b4fe321 --- /dev/null +++ b/definitions/standard/runtime_definition/number/std_number_root.json @@ -0,0 +1,85 @@ +{ + "runtime_name": "std::number::root", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "runtime_name": "value", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Value" + } + ], + "description": [ + { + "code": "en-US", + "content": "The number from which the root will be extracted." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "The numeric input for which the root will be calculated." + } + ] + }, + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "runtime_name": "root_exponent", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Root Exponent" + } + ], + "description": [ + { + "code": "en-US", + "content": "The degree of the root to extract." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Specifies which root to calculate (e.g., 2 for square root, 3 for cube root)." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Root" + } + ], + "description": [ + { + "code": "en-US", + "content": "Returns the root of a number given a root exponent." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Calculates the nth root of the input number, where n is specified by the root exponent." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/number/std_number_round.json b/definitions/standard/runtime_definition/number/std_number_round.json new file mode 100644 index 0000000..fa4b322 --- /dev/null +++ b/definitions/standard/runtime_definition/number/std_number_round.json @@ -0,0 +1,85 @@ +{ + "runtime_name": "std::number::round", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "runtime_name": "value", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Value" + } + ], + "description": [ + { + "code": "en-US", + "content": "The number to be rounded." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "The numeric input that will be rounded to the nearest value." + } + ] + }, + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "runtime_name": "decimals", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Decimal Places" + } + ], + "description": [ + { + "code": "en-US", + "content": "The number of decimal places to round to." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Specifies how many decimal digits to keep after rounding." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Round" + } + ], + "description": [ + { + "code": "en-US", + "content": "Rounds a number to the nearest value at the specified number of decimal places." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Performs standard rounding on the given value, rounding up or down depending on the fractional component." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/number/std_number_round_down.json b/definitions/standard/runtime_definition/number/std_number_round_down.json new file mode 100644 index 0000000..f7a5c64 --- /dev/null +++ b/definitions/standard/runtime_definition/number/std_number_round_down.json @@ -0,0 +1,85 @@ +{ + "runtime_name": "std::number::round_down", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "runtime_name": "value", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Value" + } + ], + "description": [ + { + "code": "en-US", + "content": "The number to be rounded down." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "The numeric input that will be rounded downwards." + } + ] + }, + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "runtime_name": "decimals", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Decimal Places" + } + ], + "description": [ + { + "code": "en-US", + "content": "The number of decimal places to round down to." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Specifies how many decimal digits to keep after rounding down." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Round Down" + } + ], + "description": [ + { + "code": "en-US", + "content": "Rounds a number downward to the specified number of decimal places." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Performs rounding on the given value, always rounding down to the nearest value at the given decimal precision." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/number/std_number_round_up.json b/definitions/standard/runtime_definition/number/std_number_round_up.json new file mode 100644 index 0000000..3ec8b2e --- /dev/null +++ b/definitions/standard/runtime_definition/number/std_number_round_up.json @@ -0,0 +1,85 @@ +{ + "runtime_name": "std::number::round_up", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "runtime_name": "value", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Value" + } + ], + "description": [ + { + "code": "en-US", + "content": "The number to be rounded up." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "The numeric input that will be rounded upwards." + } + ] + }, + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "runtime_name": "decimals", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Decimal Places" + } + ], + "description": [ + { + "code": "en-US", + "content": "The number of decimal places to round up to." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Specifies how many decimal digits to keep after rounding up." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Round Up" + } + ], + "description": [ + { + "code": "en-US", + "content": "Rounds a number upward to the specified number of decimal places." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Performs rounding on the given value, always rounding up to the nearest value at the given decimal precision." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/number/std_number_sin.json b/definitions/standard/runtime_definition/number/std_number_sin.json new file mode 100644 index 0000000..3153cb4 --- /dev/null +++ b/definitions/standard/runtime_definition/number/std_number_sin.json @@ -0,0 +1,85 @@ +{ + "runtime_name": "std::number::sin", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "runtime_name": "min", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Minimum Value" + } + ], + "description": [ + { + "code": "en-US", + "content": "The lower bound of the random number range." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Defines the minimum value (inclusive) for the random number generation." + } + ] + }, + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "runtime_name": "max", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Maximum Value" + } + ], + "description": [ + { + "code": "en-US", + "content": "The upper bound of the random number range." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Defines the maximum value (inclusive) for the random number generation." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Random Number" + } + ], + "description": [ + { + "code": "en-US", + "content": "Generates a random number within the specified range." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Returns a pseudo-random number between the given minimum and maximum values." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/number/std_number_sinh.json b/definitions/standard/runtime_definition/number/std_number_sinh.json new file mode 100644 index 0000000..4961283 --- /dev/null +++ b/definitions/standard/runtime_definition/number/std_number_sinh.json @@ -0,0 +1,58 @@ +{ + "runtime_name": "std::number::sinh", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "runtime_name": "value", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Value" + } + ], + "description": [ + { + "code": "en-US", + "content": "The number for which to calculate the hyperbolic sine." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Computes the hyperbolic sine of the given number." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Hyperbolic Sine" + } + ], + "description": [ + { + "code": "en-US", + "content": "Returns the hyperbolic sine of a number." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Calculates the hyperbolic sine (sinh) of the input value." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/number/std_number_square.json b/definitions/standard/runtime_definition/number/std_number_square.json new file mode 100644 index 0000000..aa74d2b --- /dev/null +++ b/definitions/standard/runtime_definition/number/std_number_square.json @@ -0,0 +1,58 @@ +{ + "runtime_name": "std::number::square", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "runtime_name": "value", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Value" + } + ], + "description": [ + { + "code": "en-US", + "content": "The number to be squared." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "This is the numeric input that will be multiplied by itself." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Square" + } + ], + "description": [ + { + "code": "en-US", + "content": "Returns the square of the given number." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Calculates the value multiplied by itself, effectively raising it to the power of 2." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/number/std_number_square_root.json b/definitions/standard/runtime_definition/number/std_number_square_root.json new file mode 100644 index 0000000..9602df2 --- /dev/null +++ b/definitions/standard/runtime_definition/number/std_number_square_root.json @@ -0,0 +1,58 @@ +{ + "runtime_name": "std::number::square_root", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "runtime_name": "value", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Value" + } + ], + "description": [ + { + "code": "en-US", + "content": "The number to find the square root of." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "The numeric input for which the square root will be calculated." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Square Root" + } + ], + "description": [ + { + "code": "en-US", + "content": "Returns the square root of the given number." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Calculates the positive square root of the input number." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/number/std_number_subtract.json b/definitions/standard/runtime_definition/number/std_number_subtract.json new file mode 100644 index 0000000..462c3ef --- /dev/null +++ b/definitions/standard/runtime_definition/number/std_number_subtract.json @@ -0,0 +1,85 @@ +{ + "runtime_name": "std::number::subtract", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "runtime_name": "first", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Minuend" + } + ], + "description": [ + { + "code": "en-US", + "content": "The number from which another number (the subtrahend) is to be subtracted." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "This is the number that will have the second value subtracted from it." + } + ] + }, + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "runtime_name": "second", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Subtrahend" + } + ], + "description": [ + { + "code": "en-US", + "content": "The number to subtract from the first number (the minuend)." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "This is the value that will be subtracted from the first number." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Subtract" + } + ], + "description": [ + { + "code": "en-US", + "content": "Subtracts the second number from the first number." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Returns the result of subtracting the second numeric input from the first." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/number/std_number_tan.json b/definitions/standard/runtime_definition/number/std_number_tan.json new file mode 100644 index 0000000..193c317 --- /dev/null +++ b/definitions/standard/runtime_definition/number/std_number_tan.json @@ -0,0 +1,58 @@ +{ + "runtime_name": "std::number::tan", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "runtime_name": "radians", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Radians" + } + ], + "description": [ + { + "code": "en-US", + "content": "The angle in radians to compute the tangent of." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Computes the tangent of the given angle in radians." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Tangent" + } + ], + "description": [ + { + "code": "en-US", + "content": "Returns the tangent of the specified angle in radians." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Calculates the tangent value of the input angle measured in radians." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/object/std_object_contains_key.json b/definitions/standard/runtime_definition/object/std_object_contains_key.json new file mode 100644 index 0000000..052ae0c --- /dev/null +++ b/definitions/standard/runtime_definition/object/std_object_contains_key.json @@ -0,0 +1,85 @@ +{ + "runtime_name": "std::object::contains_key", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "OBJECT" + } + }, + "runtime_name": "object", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Object" + } + ], + "description": [ + { + "code": "en-US", + "content": "The object to check for the presence of a key." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "The object within which the existence of the specified key will be checked." + } + ] + }, + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "runtime_name": "key", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Key" + } + ], + "description": [ + { + "code": "en-US", + "content": "The key to check for existence in the object." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "The property key whose presence in the object is being tested." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "BOOLEAN" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Contains Key" + } + ], + "description": [ + { + "code": "en-US", + "content": "Checks whether the specified key exists in the object." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Returns true if the given key is a property of the object; otherwise, returns false." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/object/std_object_keys.json b/definitions/standard/runtime_definition/object/std_object_keys.json new file mode 100644 index 0000000..f204270 --- /dev/null +++ b/definitions/standard/runtime_definition/object/std_object_keys.json @@ -0,0 +1,73 @@ +{ + "runtime_name": "std::object::keys", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "OBJECT" + } + }, + "runtime_name": "object", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Object" + } + ], + "description": [ + { + "code": "en-US", + "content": "The object whose keys will be retrieved." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Returns an array of all the keys (property names) of the given object." + } + ] + } + ], + "return_type_identifier": { + "type": { + "GenericType": { + "data_type_identifier": "ARRAY", + "generic_mappers": [ + { + "source": [ + { + "type": { + "DataTypeIdentifier": "TEXT" + } + } + ], + "target": "T", + "generic_combinations": [] + } + ] + } + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Get Object Keys" + } + ], + "description": [ + { + "code": "en-US", + "content": "Retrieves all the keys from the given object as an array of text values." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Returns an array containing all enumerable property names (keys) of the specified object." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/object/std_object_set.json b/definitions/standard/runtime_definition/object/std_object_set.json new file mode 100644 index 0000000..268e6e9 --- /dev/null +++ b/definitions/standard/runtime_definition/object/std_object_set.json @@ -0,0 +1,114 @@ +{ + "runtime_name": "std::object::set", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "OBJECT" + } + }, + "runtime_name": "object", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Object" + } + ], + "description": [ + { + "code": "en-US", + "content": "The object in which the key-value pair will be set." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "The original object that will be modified with the specified key-value pair." + } + ] + }, + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "runtime_name": "key", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Key" + } + ], + "description": [ + { + "code": "en-US", + "content": "The key to set or update in the object." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "The property name under which the value will be stored in the object." + } + ] + }, + { + "data_type_identifier": { + "type": { + "GenericKey": "I" + } + }, + "runtime_name": "value", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Value" + } + ], + "description": [ + { + "code": "en-US", + "content": "The value to set for the specified key." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "The value to assign to the object property identified by the key." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "OBJECT" + } + }, + "throws_error": false, + "generic_keys": [ + "I" + ], + "name": [ + { + "code": "en-US", + "content": "Set Object Key" + } + ], + "description": [ + { + "code": "en-US", + "content": "Sets or updates a key-value pair in the given object." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Returns a new object with the specified key set to the given value." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/object/std_object_size.json b/definitions/standard/runtime_definition/object/std_object_size.json new file mode 100644 index 0000000..4da552c --- /dev/null +++ b/definitions/standard/runtime_definition/object/std_object_size.json @@ -0,0 +1,58 @@ +{ + "runtime_name": "std::object::size", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "OBJECT" + } + }, + "runtime_name": "object", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Object" + } + ], + "description": [ + { + "code": "en-US", + "content": "The object whose size (number of keys) will be calculated." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Returns the number of enumerable keys (properties) present in the given object." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Get Object Size" + } + ], + "description": [ + { + "code": "en-US", + "content": "Calculates the number of keys in the provided object." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Returns an integer count of all enumerable property keys in the specified object." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/text/std_text_append.json b/definitions/standard/runtime_definition/text/std_text_append.json new file mode 100644 index 0000000..0daab25 --- /dev/null +++ b/definitions/standard/runtime_definition/text/std_text_append.json @@ -0,0 +1,85 @@ +{ + "runtime_name": "std::text::append", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "runtime_name": "value", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Original Text" + } + ], + "description": [ + { + "code": "en-US", + "content": "The initial text to which the suffix will be appended." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "The base text string that will have another string appended to its end." + } + ] + }, + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "runtime_name": "suffix", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Suffix" + } + ], + "description": [ + { + "code": "en-US", + "content": "The text to append to the original value." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "The text string that will be concatenated to the end of the original text." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Append Text" + } + ], + "description": [ + { + "code": "en-US", + "content": "Concatenates the suffix text to the end of the original text." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Returns a new text string consisting of the original text followed by the specified suffix." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/text/std_text_as_bytes.json b/definitions/standard/runtime_definition/text/std_text_as_bytes.json new file mode 100644 index 0000000..390ab26 --- /dev/null +++ b/definitions/standard/runtime_definition/text/std_text_as_bytes.json @@ -0,0 +1,73 @@ +{ + "runtime_name": "std::text::as_bytes", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "runtime_name": "value", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Text Value" + } + ], + "description": [ + { + "code": "en-US", + "content": "The text to convert into bytes." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Converts the input text string into an array of byte values." + } + ] + } + ], + "return_type_identifier": { + "type": { + "GenericType": { + "data_type_identifier": "ARRAY", + "generic_mappers": [ + { + "source": [ + { + "type": { + "DataTypeIdentifier": "NUMBER" + } + } + ], + "target": "T", + "generic_combinations": [] + } + ] + } + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "As Bytes" + } + ], + "description": [ + { + "code": "en-US", + "content": "Converts a text string into an array of byte values." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Returns an array of bytes representing the UTF-8 encoding of the given text." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/text/std_text_at.json b/definitions/standard/runtime_definition/text/std_text_at.json new file mode 100644 index 0000000..19b43ae --- /dev/null +++ b/definitions/standard/runtime_definition/text/std_text_at.json @@ -0,0 +1,85 @@ +{ + "runtime_name": "std::text::at", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "runtime_name": "value", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Text Value" + } + ], + "description": [ + { + "code": "en-US", + "content": "The text string from which to extract the character." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "The input text from which a character will be retrieved by index." + } + ] + }, + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "runtime_name": "index", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Index" + } + ], + "description": [ + { + "code": "en-US", + "content": "The zero-based position of the character to extract." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Specifies which character to return from the text." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Character at Index" + } + ], + "description": [ + { + "code": "en-US", + "content": "Returns the character at the specified index in the text." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Retrieves a single character from the input text based on the provided zero-based index." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/text/std_text_byte_size.json b/definitions/standard/runtime_definition/text/std_text_byte_size.json new file mode 100644 index 0000000..a57bde5 --- /dev/null +++ b/definitions/standard/runtime_definition/text/std_text_byte_size.json @@ -0,0 +1,58 @@ +{ + "runtime_name": "std::text::byte_size", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "runtime_name": "value", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Text Value" + } + ], + "description": [ + { + "code": "en-US", + "content": "The text whose byte size is to be calculated." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Calculates the size in bytes of the given text, typically its UTF-8 encoding length." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Byte Size" + } + ], + "description": [ + { + "code": "en-US", + "content": "Returns the number of bytes required to encode the given text." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Computes the size in bytes of the provided text string, typically by counting UTF-8 encoded bytes." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/text/std_text_capitalize.json b/definitions/standard/runtime_definition/text/std_text_capitalize.json new file mode 100644 index 0000000..827e5ca --- /dev/null +++ b/definitions/standard/runtime_definition/text/std_text_capitalize.json @@ -0,0 +1,58 @@ +{ + "runtime_name": "std::text::capitalize", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "runtime_name": "value", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Text Value" + } + ], + "description": [ + { + "code": "en-US", + "content": "The text string to capitalize." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Capitalizes the first letter of the input text string." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Capitalize" + } + ], + "description": [ + { + "code": "en-US", + "content": "Converts the first character of the text to uppercase and leaves the rest unchanged." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Returns a new text string with the first letter capitalized." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/text/std_text_chars.json b/definitions/standard/runtime_definition/text/std_text_chars.json new file mode 100644 index 0000000..91076b7 --- /dev/null +++ b/definitions/standard/runtime_definition/text/std_text_chars.json @@ -0,0 +1,73 @@ +{ + "runtime_name": "std::text::chars", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "runtime_name": "value", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Text Value" + } + ], + "description": [ + { + "code": "en-US", + "content": "The text string to split into characters." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Splits the input text string into an array of its constituent characters." + } + ] + } + ], + "return_type_identifier": { + "type": { + "GenericType": { + "data_type_identifier": "ARRAY", + "generic_mappers": [ + { + "source": [ + { + "type": { + "DataTypeIdentifier": "TEXT" + } + } + ], + "target": "T", + "generic_combinations": [] + } + ] + } + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Characters" + } + ], + "description": [ + { + "code": "en-US", + "content": "Returns an array containing each character from the given text string." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Creates an array where each element is a single character from the original text." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/text/std_text_contains.json b/definitions/standard/runtime_definition/text/std_text_contains.json new file mode 100644 index 0000000..4dfc7ec --- /dev/null +++ b/definitions/standard/runtime_definition/text/std_text_contains.json @@ -0,0 +1,85 @@ +{ + "runtime_name": "std::text::contains", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "runtime_name": "value", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Text" + } + ], + "description": [ + { + "code": "en-US", + "content": "The main text to search within." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "The main text to search within." + } + ] + }, + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "runtime_name": "substring", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Substring" + } + ], + "description": [ + { + "code": "en-US", + "content": "The text to search for inside the main text." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "The text to search for inside the main text." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "BOOLEAN" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Contains" + } + ], + "description": [ + { + "code": "en-US", + "content": "Checks if the main text contains the specified substring." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Returns true if the substring is found anywhere in the main text; otherwise, returns false." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/text/std_text_decode.json b/definitions/standard/runtime_definition/text/std_text_decode.json new file mode 100644 index 0000000..0632159 --- /dev/null +++ b/definitions/standard/runtime_definition/text/std_text_decode.json @@ -0,0 +1,85 @@ +{ + "runtime_name": "std::text::decode", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "runtime_name": "value", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Text" + } + ], + "description": [ + { + "code": "en-US", + "content": "The text string to decode." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "The text string to decode." + } + ] + }, + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT_ENCODING" + } + }, + "runtime_name": "encoding", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Encoding Type" + } + ], + "description": [ + { + "code": "en-US", + "content": "The decoding scheme to apply (e.g. Base64)." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "The decoding scheme to apply (e.g. Base64)." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Decode Text" + } + ], + "description": [ + { + "code": "en-US", + "content": "Decodes the input text from the specified encoding format." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Decodes the input text from the specified encoding format." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/text/std_text_encode.json b/definitions/standard/runtime_definition/text/std_text_encode.json new file mode 100644 index 0000000..0a9fc13 --- /dev/null +++ b/definitions/standard/runtime_definition/text/std_text_encode.json @@ -0,0 +1,85 @@ +{ + "runtime_name": "std::text::encode", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "runtime_name": "value", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Text" + } + ], + "description": [ + { + "code": "en-US", + "content": "The text string to encode." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "The text string to encode." + } + ] + }, + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT_ENCODING" + } + }, + "runtime_name": "encoding", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Encoding Type" + } + ], + "description": [ + { + "code": "en-US", + "content": "The encoding scheme to apply (e.g., UTF-8, Base64)." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "The encoding scheme to apply (e.g., UTF-8, Base64)." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Encode Text" + } + ], + "description": [ + { + "code": "en-US", + "content": "Encodes the input text into the specified encoding format." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Transforms the given text string into a representation encoded by the specified encoding scheme." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/text/std_text_ends_with.json b/definitions/standard/runtime_definition/text/std_text_ends_with.json new file mode 100644 index 0000000..2c386ba --- /dev/null +++ b/definitions/standard/runtime_definition/text/std_text_ends_with.json @@ -0,0 +1,85 @@ +{ + "runtime_name": "std::text::ends_with", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "runtime_name": "value", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Text" + } + ], + "description": [ + { + "code": "en-US", + "content": "The input text to check." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "The input text to check." + } + ] + }, + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "runtime_name": "suffix", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Suffix" + } + ], + "description": [ + { + "code": "en-US", + "content": "The suffix to test against the input text." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "The suffix to test against the input text." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "BOOLEAN" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Ends With" + } + ], + "description": [ + { + "code": "en-US", + "content": "Checks if the input text ends with the specified suffix." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Returns true if the input text ends with the given suffix; otherwise, returns false." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/text/std_text_from_ascii.json b/definitions/standard/runtime_definition/text/std_text_from_ascii.json new file mode 100644 index 0000000..0ec5437 --- /dev/null +++ b/definitions/standard/runtime_definition/text/std_text_from_ascii.json @@ -0,0 +1,73 @@ +{ + "runtime_name": "std::text::from_ascii", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "GenericType": { + "data_type_identifier": "ARRAY", + "generic_mappers": [ + { + "source": [ + { + "type": { + "DataTypeIdentifier": "NUMBER" + } + } + ], + "target": "T", + "generic_combinations": [] + } + ] + } + } + }, + "runtime_name": "value", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "ASCII Codes" + } + ], + "description": [ + { + "code": "en-US", + "content": "Array of ASCII numeric codes representing characters." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Array of ASCII numeric codes representing characters." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "From ASCII" + } + ], + "description": [ + { + "code": "en-US", + "content": "Converts an array of ASCII codes back into the corresponding text string." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Takes an array of numbers where each number is an ASCII code, and returns the string they represent." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/text/std_text_hex.json b/definitions/standard/runtime_definition/text/std_text_hex.json new file mode 100644 index 0000000..51b0901 --- /dev/null +++ b/definitions/standard/runtime_definition/text/std_text_hex.json @@ -0,0 +1,58 @@ +{ + "runtime_name": "std::text::hex", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "runtime_name": "value", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Input Text" + } + ], + "description": [ + { + "code": "en-US", + "content": "The text string to be converted to its hexadecimal representation." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "This function converts each character of the input text into its corresponding hexadecimal code, returning the concatenated hex string." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Text to Hexadecimal" + } + ], + "description": [ + { + "code": "en-US", + "content": "Converts a text string into a hexadecimal representation." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Returns a string containing the hexadecimal values corresponding to each character of the input text." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/text/std_text_index_of.json b/definitions/standard/runtime_definition/text/std_text_index_of.json new file mode 100644 index 0000000..8157519 --- /dev/null +++ b/definitions/standard/runtime_definition/text/std_text_index_of.json @@ -0,0 +1,85 @@ +{ + "runtime_name": "std::text::index_of", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "runtime_name": "value", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Text" + } + ], + "description": [ + { + "code": "en-US", + "content": "The text string to search within." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "The text string to search within." + } + ] + }, + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "runtime_name": "substring", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Substring" + } + ], + "description": [ + { + "code": "en-US", + "content": "The substring to find inside the text." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "The substring to find inside the text." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Index Of" + } + ], + "description": [ + { + "code": "en-US", + "content": "Finds the first occurrence index of the substring within the text." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Returns the zero-based index of the first occurrence of the substring in the text. Returns -1 if the substring is not found." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/text/std_text_insert.json b/definitions/standard/runtime_definition/text/std_text_insert.json new file mode 100644 index 0000000..fe51dae --- /dev/null +++ b/definitions/standard/runtime_definition/text/std_text_insert.json @@ -0,0 +1,112 @@ +{ + "runtime_name": "std::text::insert", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "runtime_name": "value", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Original Text" + } + ], + "description": [ + { + "code": "en-US", + "content": "The original text into which another text will be inserted." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "This is the base string where the insertion happens." + } + ] + }, + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "runtime_name": "position", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Position" + } + ], + "description": [ + { + "code": "en-US", + "content": "The index at which the text will be inserted." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Zero-based index indicating where the new text should be inserted." + } + ] + }, + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "runtime_name": "text", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Text to Insert" + } + ], + "description": [ + { + "code": "en-US", + "content": "The text that will be inserted into the original text." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "The substring to be inserted at the specified position." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Insert Text" + } + ], + "description": [ + { + "code": "en-US", + "content": "Inserts a given text into the original text at the specified position." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Returns a new string where the provided text is inserted at the zero-based position index within the original text." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/text/std_text_is_equal.json b/definitions/standard/runtime_definition/text/std_text_is_equal.json new file mode 100644 index 0000000..30fb94c --- /dev/null +++ b/definitions/standard/runtime_definition/text/std_text_is_equal.json @@ -0,0 +1,85 @@ +{ + "runtime_name": "std::text::is_equal", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "runtime_name": "first", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "First Text" + } + ], + "description": [ + { + "code": "en-US", + "content": "The first text string to compare." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "The first input text for equality comparison." + } + ] + }, + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "runtime_name": "second", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Second Text" + } + ], + "description": [ + { + "code": "en-US", + "content": "The second text string to compare." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "The second input text for equality comparison." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "BOOLEAN" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Is Equal" + } + ], + "description": [ + { + "code": "en-US", + "content": "Checks whether the two input text strings are equal." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Determines if the two given text inputs are exactly the same, returning true if equal, false otherwise." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/text/std_text_length.json b/definitions/standard/runtime_definition/text/std_text_length.json new file mode 100644 index 0000000..a92fe6a --- /dev/null +++ b/definitions/standard/runtime_definition/text/std_text_length.json @@ -0,0 +1,58 @@ +{ + "runtime_name": "std::text::length", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "runtime_name": "value", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Text" + } + ], + "description": [ + { + "code": "en-US", + "content": "The text whose length will be calculated." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Input string to determine the number of characters it contains." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Length" + } + ], + "description": [ + { + "code": "en-US", + "content": "Returns the number of characters in the given text." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Computes the length of the input string in terms of characters." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/text/std_text_lowercase.json b/definitions/standard/runtime_definition/text/std_text_lowercase.json new file mode 100644 index 0000000..96707fd --- /dev/null +++ b/definitions/standard/runtime_definition/text/std_text_lowercase.json @@ -0,0 +1,58 @@ +{ + "runtime_name": "std::text::lowercase", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "runtime_name": "value", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Text Value" + } + ], + "description": [ + { + "code": "en-US", + "content": "The text string to convert to lowercase." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Converts all characters in the input text string to lowercase." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Lowercase" + } + ], + "description": [ + { + "code": "en-US", + "content": "Transforms all letters in the text to their lowercase equivalents." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Returns a new text string with all characters converted to lowercase." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/text/std_text_octal.json b/definitions/standard/runtime_definition/text/std_text_octal.json new file mode 100644 index 0000000..333cda8 --- /dev/null +++ b/definitions/standard/runtime_definition/text/std_text_octal.json @@ -0,0 +1,58 @@ +{ + "runtime_name": "std::text::octal", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "runtime_name": "value", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Input Text" + } + ], + "description": [ + { + "code": "en-US", + "content": "The text string to be converted to its octal representation." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "This function converts each character of the input text into its corresponding octal code, returning the concatenated octal string." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Text to Octal" + } + ], + "description": [ + { + "code": "en-US", + "content": "Converts a text string into an octal representation." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Returns a string containing the octal values corresponding to each character of the input text." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/text/std_text_prepend.json b/definitions/standard/runtime_definition/text/std_text_prepend.json new file mode 100644 index 0000000..ace63d7 --- /dev/null +++ b/definitions/standard/runtime_definition/text/std_text_prepend.json @@ -0,0 +1,85 @@ +{ + "runtime_name": "std::text::prepend", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "runtime_name": "value", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Original Text" + } + ], + "description": [ + { + "code": "en-US", + "content": "The initial text to which the prefix will be added." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "The base text string that will have another string prepended to its beginning." + } + ] + }, + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "runtime_name": "prefix", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Prefix" + } + ], + "description": [ + { + "code": "en-US", + "content": "The text to prepend before the original value." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "The text string that will be concatenated to the start of the original text." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Prepend Text" + } + ], + "description": [ + { + "code": "en-US", + "content": "Concatenates the prefix text to the beginning of the original text." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Returns a new text string consisting of the specified prefix followed by the original text." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/text/std_text_remove.json b/definitions/standard/runtime_definition/text/std_text_remove.json new file mode 100644 index 0000000..acc3709 --- /dev/null +++ b/definitions/standard/runtime_definition/text/std_text_remove.json @@ -0,0 +1,112 @@ +{ + "runtime_name": "std::text::remove", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "runtime_name": "value", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Text" + } + ], + "description": [ + { + "code": "en-US", + "content": "The original text to remove a substring from." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "The input text from which a substring will be removed." + } + ] + }, + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "runtime_name": "start", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Start Index" + } + ], + "description": [ + { + "code": "en-US", + "content": "The zero-based index where removal begins." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "The starting position for removing characters from the text." + } + ] + }, + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "NUMBER" + } + }, + "runtime_name": "end", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "End Index" + } + ], + "description": [ + { + "code": "en-US", + "content": "The zero-based index where removal ends (exclusive)." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "The position just after the last character to be removed." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Remove Substring" + } + ], + "description": [ + { + "code": "en-US", + "content": "Removes the substring between the specified start and end indices from the input text." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Returns a new string with characters removed from start up to but not including end." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/text/std_text_replace.json b/definitions/standard/runtime_definition/text/std_text_replace.json new file mode 100644 index 0000000..783e228 --- /dev/null +++ b/definitions/standard/runtime_definition/text/std_text_replace.json @@ -0,0 +1,112 @@ +{ + "runtime_name": "std::text::replace", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "runtime_name": "value", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Original Text" + } + ], + "description": [ + { + "code": "en-US", + "content": "The input text where replacements will be made." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "This is the text in which all occurrences of the old substring will be replaced." + } + ] + }, + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "runtime_name": "old", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Old Substring" + } + ], + "description": [ + { + "code": "en-US", + "content": "The substring to be replaced." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "All occurrences of this substring in the original text will be replaced." + } + ] + }, + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "runtime_name": "new", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "New Substring" + } + ], + "description": [ + { + "code": "en-US", + "content": "The substring to replace with." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "This substring will replace each occurrence of the old substring." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Replace Substring" + } + ], + "description": [ + { + "code": "en-US", + "content": "Replaces all occurrences of a specified substring with another substring in the input text." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Returns a new string where every instance of the old substring is replaced by the new substring." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/text/std_text_replace_first.json b/definitions/standard/runtime_definition/text/std_text_replace_first.json new file mode 100644 index 0000000..b81dbc9 --- /dev/null +++ b/definitions/standard/runtime_definition/text/std_text_replace_first.json @@ -0,0 +1,112 @@ +{ + "runtime_name": "std::text::replace_first", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "runtime_name": "value", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Original Text" + } + ], + "description": [ + { + "code": "en-US", + "content": "The input text where the first replacement will be made." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "This text contains the substring that will be replaced only once—the first occurrence." + } + ] + }, + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "runtime_name": "old", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Old Substring" + } + ], + "description": [ + { + "code": "en-US", + "content": "The substring to be replaced." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Only the first occurrence of this substring will be replaced in the original text." + } + ] + }, + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "runtime_name": "new", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "New Substring" + } + ], + "description": [ + { + "code": "en-US", + "content": "The substring to replace with." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "This substring will replace only the first occurrence of the old substring." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Replace First Substring" + } + ], + "description": [ + { + "code": "en-US", + "content": "Replaces the first occurrence of a specified substring with another substring in the input text." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Returns a new string where only the first instance of the old substring is replaced by the new substring." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/text/std_text_replace_last.json b/definitions/standard/runtime_definition/text/std_text_replace_last.json new file mode 100644 index 0000000..7eba508 --- /dev/null +++ b/definitions/standard/runtime_definition/text/std_text_replace_last.json @@ -0,0 +1,112 @@ +{ + "runtime_name": "std::text::replace_last", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "runtime_name": "value", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Original Text" + } + ], + "description": [ + { + "code": "en-US", + "content": "The input text where the last replacement will be made." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "This text contains the substring that will be replaced only once—the last occurrence." + } + ] + }, + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "runtime_name": "old", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Old Substring" + } + ], + "description": [ + { + "code": "en-US", + "content": "The substring to be replaced." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Only the last occurrence of this substring will be replaced in the original text." + } + ] + }, + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "runtime_name": "new", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "New Substring" + } + ], + "description": [ + { + "code": "en-US", + "content": "The substring to replace with." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "This substring will replace only the last occurrence of the old substring." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Replace Last Substring" + } + ], + "description": [ + { + "code": "en-US", + "content": "Replaces the last occurrence of a specified substring with another substring in the input text." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Returns a new string where only the last instance of the old substring is replaced by the new substring." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/text/std_text_reverse.json b/definitions/standard/runtime_definition/text/std_text_reverse.json new file mode 100644 index 0000000..b17de71 --- /dev/null +++ b/definitions/standard/runtime_definition/text/std_text_reverse.json @@ -0,0 +1,58 @@ +{ + "runtime_name": "std::text::reverse", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "runtime_name": "value", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Text" + } + ], + "description": [ + { + "code": "en-US", + "content": "The input text to be reversed." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "The input text to be reversed." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Reverse" + } + ], + "description": [ + { + "code": "en-US", + "content": "Reverses the characters in the input text." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Returns a new string with the characters of the input text in reverse order." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/text/std_text_split.json b/definitions/standard/runtime_definition/text/std_text_split.json new file mode 100644 index 0000000..2acc224 --- /dev/null +++ b/definitions/standard/runtime_definition/text/std_text_split.json @@ -0,0 +1,100 @@ +{ + "runtime_name": "std::text::split", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "runtime_name": "value", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Text" + } + ], + "description": [ + { + "code": "en-US", + "content": "The input text to be split." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "The input text to be split." + } + ] + }, + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "runtime_name": "delimiter", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Delimiter" + } + ], + "description": [ + { + "code": "en-US", + "content": "The delimiter string to split the text by." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "The delimiter string to split the text by." + } + ] + } + ], + "return_type_identifier": { + "type": { + "GenericType": { + "data_type_identifier": "ARRAY", + "generic_mappers": [ + { + "source": [ + { + "type": { + "DataTypeIdentifier": "TEXT" + } + } + ], + "target": "T", + "generic_combinations": [] + } + ] + } + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Split" + } + ], + "description": [ + { + "code": "en-US", + "content": "Splits the input text into an array of substrings based on the specified delimiter." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Returns an array of substrings obtained by splitting the input text at each occurrence of the delimiter." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/text/std_text_start_with.json b/definitions/standard/runtime_definition/text/std_text_start_with.json new file mode 100644 index 0000000..54d8074 --- /dev/null +++ b/definitions/standard/runtime_definition/text/std_text_start_with.json @@ -0,0 +1,85 @@ +{ + "runtime_name": "std::text::start_with", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "runtime_name": "value", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Text" + } + ], + "description": [ + { + "code": "en-US", + "content": "The input text to check." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "The input text to check." + } + ] + }, + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "runtime_name": "prefix", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Prefix" + } + ], + "description": [ + { + "code": "en-US", + "content": "The prefix to test against the input text." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "The prefix to test against the input text." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "BOOLEAN" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Starts With" + } + ], + "description": [ + { + "code": "en-US", + "content": "Checks if the input text starts with the specified prefix." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Returns true if the input text begins with the given prefix; otherwise, returns false." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/text/std_text_swapcase.json b/definitions/standard/runtime_definition/text/std_text_swapcase.json new file mode 100644 index 0000000..b6be9b0 --- /dev/null +++ b/definitions/standard/runtime_definition/text/std_text_swapcase.json @@ -0,0 +1,58 @@ +{ + "runtime_name": "std::text::swapcase", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "runtime_name": "value", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Text Value" + } + ], + "description": [ + { + "code": "en-US", + "content": "The text string whose case will be swapped." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Swaps the case of each letter in the input text: uppercase letters become lowercase, and vice versa." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Swap Case" + } + ], + "description": [ + { + "code": "en-US", + "content": "Converts uppercase letters to lowercase and lowercase letters to uppercase in the given text." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Returns a new text string with the case of each character inverted." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/text/std_text_to_ascii.json b/definitions/standard/runtime_definition/text/std_text_to_ascii.json new file mode 100644 index 0000000..ec054bb --- /dev/null +++ b/definitions/standard/runtime_definition/text/std_text_to_ascii.json @@ -0,0 +1,73 @@ +{ + "runtime_name": "std::text::to_ascii", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "runtime_name": "value", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Text" + } + ], + "description": [ + { + "code": "en-US", + "content": "Input text to convert to ASCII codes." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Input text to convert to ASCII codes." + } + ] + } + ], + "return_type_identifier": { + "type": { + "GenericType": { + "data_type_identifier": "ARRAY", + "generic_mappers": [ + { + "source": [ + { + "type": { + "DataTypeIdentifier": "NUMBER" + } + } + ], + "target": "T", + "generic_combinations": [] + } + ] + } + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "To ASCII" + } + ], + "description": [ + { + "code": "en-US", + "content": "Converts each character of the input text into its corresponding ASCII numerical code." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Returns an array of numbers where each number represents the ASCII code of the corresponding character in the input text." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/text/std_text_trim.json b/definitions/standard/runtime_definition/text/std_text_trim.json new file mode 100644 index 0000000..d387f0e --- /dev/null +++ b/definitions/standard/runtime_definition/text/std_text_trim.json @@ -0,0 +1,58 @@ +{ + "runtime_name": "std::text::trim", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "runtime_name": "value", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Text Value" + } + ], + "description": [ + { + "code": "en-US", + "content": "The text string to trim whitespace from." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "The input text from which leading and trailing whitespace characters will be removed." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Trim Text" + } + ], + "description": [ + { + "code": "en-US", + "content": "Removes leading and trailing whitespace from the text." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Returns a new string with all leading and trailing whitespace characters removed from the input text." + } + ], + "deprecation_message": [] +} \ No newline at end of file diff --git a/definitions/standard/runtime_definition/text/std_text_uppercase.json b/definitions/standard/runtime_definition/text/std_text_uppercase.json new file mode 100644 index 0000000..dc2a219 --- /dev/null +++ b/definitions/standard/runtime_definition/text/std_text_uppercase.json @@ -0,0 +1,58 @@ +{ + "runtime_name": "std::text::uppercase", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "runtime_name": "value", + "default_value": null, + "name": [ + { + "code": "en-US", + "content": "Text Value" + } + ], + "description": [ + { + "code": "en-US", + "content": "The text string to convert to uppercase." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Converts all characters in the input text string to uppercase." + } + ] + } + ], + "return_type_identifier": { + "type": { + "DataTypeIdentifier": "TEXT" + } + }, + "throws_error": false, + "generic_keys": [], + "name": [ + { + "code": "en-US", + "content": "Uppercase" + } + ], + "description": [ + { + "code": "en-US", + "content": "Transforms all letters in the text to their uppercase equivalents." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Returns a new text string with all characters converted to uppercase." + } + ], + "deprecation_message": [] +} \ No newline at end of file From ff0fff12db0031a2b56f76146ef856b7e8a3cb4e Mon Sep 17 00:00:00 2001 From: raphael-goetz Date: Mon, 18 Aug 2025 15:11:20 +0200 Subject: [PATCH 16/20] ref: correct fmt --- cli/src/analyser/diagnostics.rs | 8 ++--- cli/src/analyser/mod.rs | 5 +-- cli/src/command/definition.rs | 25 +++++-------- cli/src/command/download.rs | 54 ++++++++++++---------------- cli/src/command/feature.rs | 62 +++++++++++++++++++++++---------- cli/src/command/report.rs | 26 ++++++++++---- cli/src/command/watch.rs | 35 +++++++++---------- cli/src/formatter.rs | 2 +- cli/src/table.rs | 25 ++++++------- reader/rust/src/parser.rs | 18 +++++----- reader/rust/src/reader.rs | 35 +++++++++---------- 11 files changed, 150 insertions(+), 145 deletions(-) diff --git a/cli/src/analyser/diagnostics.rs b/cli/src/analyser/diagnostics.rs index d8e010a..dc13654 100644 --- a/cli/src/analyser/diagnostics.rs +++ b/cli/src/analyser/diagnostics.rs @@ -1,8 +1,8 @@ use crate::formatter::{error, warning}; +use code0_definition_reader::reader::Meta; use std::cmp::PartialEq; use std::path::Path; use std::process::exit; -use code0_definition_reader::reader::Meta; #[derive(Default)] pub struct Reporter { @@ -125,11 +125,7 @@ impl DiagnosticKind { } impl Diagnose { - pub fn new( - definition_name: String, - definition: Meta, - kind: DiagnosticKind, - ) -> Self { + pub fn new(definition_name: String, definition: Meta, kind: DiagnosticKind) -> Self { Self { definition_name, definition, diff --git a/cli/src/analyser/mod.rs b/cli/src/analyser/mod.rs index 9c88d8c..7aff08f 100644 --- a/cli/src/analyser/mod.rs +++ b/cli/src/analyser/mod.rs @@ -59,9 +59,7 @@ impl Analyser { match definition.r#type { MetaType::FlowType => { current_index += 1; - match serde_json::from_str::( - definition.definition_string.as_str(), - ) { + match serde_json::from_str::(definition.definition_string.as_str()) { Ok(flow_type) => collected_flow_types.push(AnalysableFlowType { original_definition: definition.clone(), flow_type, @@ -755,7 +753,6 @@ impl Analyser { } pub fn report(&mut self, will_exit: bool) { - for data_type in self.data_types.clone() { self.analyse_data_type(data_type.clone()); } diff --git a/cli/src/command/definition.rs b/cli/src/command/definition.rs index edfe609..b04a8cc 100644 --- a/cli/src/command/definition.rs +++ b/cli/src/command/definition.rs @@ -1,6 +1,6 @@ +use crate::formatter::{info, success}; use code0_definition_reader::parser::Parser; use colored::Colorize; -use crate::formatter::{info, success}; pub fn search_definition(name: String, path: Option) { let dir_path = path.unwrap_or_else(|| "./definitions".to_string()); @@ -35,11 +35,7 @@ fn search_and_display_definitions(search_name: &str, parser: &Parser) { let mut index = 0; for line in json.lines() { index += 1; - println!( - "{} {}", - format!("{index}:"), - line.bright_cyan() - ); + println!("{} {}", format!("{index}:"), line.bright_cyan()); } } Err(_) => println!("{}", "Error serializing FlowType".red()), @@ -61,11 +57,7 @@ fn search_and_display_definitions(search_name: &str, parser: &Parser) { let mut index = 0; for line in json.lines() { index += 1; - println!( - "{} {}", - format!("{index}:"), - line.bright_cyan() - ); + println!("{} {}", format!("{index}:"), line.bright_cyan()); } } Err(_) => println!("{}", "Error serializing DataType".red()), @@ -87,11 +79,7 @@ fn search_and_display_definitions(search_name: &str, parser: &Parser) { let mut index = 0; for line in json.lines() { index += 1; - println!( - "{} {}", - format!("{index}:"), - line.bright_cyan() - ); + println!("{} {}", format!("{index}:"), line.bright_cyan()); } } Err(_) => println!("{}", "Error serializing RuntimeFunction".red()), @@ -101,7 +89,10 @@ fn search_and_display_definitions(search_name: &str, parser: &Parser) { } if !found_any { - println!("{}", format!("\n{}: {}", "error".red(), "Found no matching definition(s)")); + println!( + "{}", + format!("\n{}: {}", "error".red(), "Found no matching definition(s)") + ); } else { success(format!("Found {total_matches} matching definition(s)")) } diff --git a/cli/src/command/download.rs b/cli/src/command/download.rs index 89ca345..62ab46c 100644 --- a/cli/src/command/download.rs +++ b/cli/src/command/download.rs @@ -1,12 +1,11 @@ +use crate::formatter::{error_without_trace, info, success}; use bytes::Bytes; -use colored::*; use reqwest::header::{ACCEPT, USER_AGENT}; use serde::Deserialize; use std::fs; use std::fs::File; use std::path::Path; use zip::ZipArchive; -use crate::formatter::{error_without_trace, info, success}; #[derive(Deserialize, Debug)] struct Release { @@ -28,9 +27,7 @@ pub async fn handle_download(tag: Option, features: Option>) // Download the definitions info("Starting download process...".to_string()); let bytes = match download_definitions_as_bytes(tag).await { - Some(bytes) => { - bytes - } + Some(bytes) => bytes, None => { error_without_trace(String::from("Download failed.")); return; @@ -49,7 +46,10 @@ pub async fn handle_download(tag: Option, features: Option>) } let path = Path::new(out_folder_path); - success(format!("Download was successful. Definitions are now available: {}.", path.display())); + success(format!( + "Download was successful. Definitions are now available: {}.", + path.display() + )); } async fn download_definitions_as_bytes(tag: Option) -> Option { @@ -100,11 +100,11 @@ async fn download_definitions_as_bytes(tag: Option) -> Option { - asset - } + Some(asset) => asset, None => { - panic!("Definition folder is not called `definitions.zip` and was not inside the asset folder of the GitHub release!"); + panic!( + "Definition folder is not called `definitions.zip` and was not inside the asset folder of the GitHub release!" + ); } }; @@ -127,7 +127,10 @@ async fn download_definitions_as_bytes(tag: Option) -> Option) -> Option { - archive - } + Ok(archive) => archive, Err(e) => { panic!("Failed to read zip archive: {e}"); } @@ -177,11 +177,7 @@ async fn convert_bytes_to_folder(bytes: Bytes, zip_path: &str) { if file.name().ends_with('/') { if let Err(e) = fs::create_dir_all(&out_path) { - panic!( - "Failed to create directory {}: {}", - out_path.display(), - e - ); + panic!("Failed to create directory {}: {}", out_path.display(), e); } } else { if let Some(p) = out_path.parent() { @@ -203,11 +199,7 @@ async fn convert_bytes_to_folder(bytes: Bytes, zip_path: &str) { } } Err(e) => { - panic!( - "Failed to create file {}: {}", - out_path.display(), - e - ); + panic!("Failed to create file {}: {}", out_path.display(), e); } } } @@ -218,7 +210,7 @@ async fn convert_bytes_to_folder(bytes: Bytes, zip_path: &str) { match fs::remove_file(zip_path) { Ok(_) => info("Temporary zip file removed".to_string()), - Err(e) => error_without_trace(format!("Warning: Failed to remove temporary zip file: {e}")) + Err(e) => error_without_trace(format!("Warning: Failed to remove temporary zip file: {e}")), } } @@ -227,12 +219,14 @@ async fn filter_features(selected_features: Vec) { match fs::read_dir(definitions_path) { Ok(entries) => { - for entry in entries { let directory = match entry { Ok(directory) => directory, Err(e) => { - panic!("{}", format!("Warning: Failed to read directory entry: {e}")); + panic!( + "{}", + format!("Warning: Failed to read directory entry: {e}") + ); } }; @@ -249,9 +243,7 @@ async fn filter_features(selected_features: Vec) { } } Err(e) => { - error_without_trace( - format!("Failed to read definitions directory: {e}") - ); + error_without_trace(format!("Failed to read definitions directory: {e}")); } } } diff --git a/cli/src/command/feature.rs b/cli/src/command/feature.rs index efef6e0..1c53e99 100644 --- a/cli/src/command/feature.rs +++ b/cli/src/command/feature.rs @@ -1,7 +1,7 @@ -use crate::table::{feature_table, summary_table}; -use code0_definition_reader::parser::{Feature, Parser}; use crate::analyser::Analyser; use crate::formatter::{success, success_table}; +use crate::table::{feature_table, summary_table}; +use code0_definition_reader::parser::{Feature, Parser}; pub fn search_feature(name: Option, path: Option) { let dir_path = path.unwrap_or_else(|| "./definitions".to_string()); @@ -17,30 +17,42 @@ pub fn search_feature(name: Option, path: Option) { analyser.report(true); let features = match name { - None => { - parser.features.clone() - } - Some(feature_name) => { - parser.features.iter().filter(|f| f.name.to_lowercase() == feature_name.to_lowercase()).map(|f| f.clone()).collect::>() - } + None => parser.features.clone(), + Some(feature_name) => parser + .features + .iter() + .filter(|f| f.name.to_lowercase() == feature_name.to_lowercase()) + .map(|f| f.clone()) + .collect::>(), }; - - + for feature in &features { let (flow_type_rows, data_type_rows, function_rows) = feature_table(feature); if !flow_type_rows.is_empty() { - success(format!("The feature (`{}`) detected {} flow_types.", feature.name, flow_type_rows.len())); + success(format!( + "The feature (`{}`) detected {} flow_types.", + feature.name, + flow_type_rows.len() + )); success_table(flow_type_rows) } if !data_type_rows.is_empty() { - success(format!("The feature (`{}`) detected {} data_types.", feature.name, data_type_rows.len())); + success(format!( + "The feature (`{}`) detected {} data_types.", + feature.name, + data_type_rows.len() + )); success_table(data_type_rows) } if !function_rows.is_empty() { - success(format!("The feature (`{}`) detected {} runtime_function_definition.", feature.name, function_rows.len())); + success(format!( + "The feature (`{}`) detected {} runtime_function_definition.", + feature.name, + function_rows.len() + )); success_table(function_rows) } } @@ -48,11 +60,23 @@ pub fn search_feature(name: Option, path: Option) { let summary = summary_table(&features); success_table(summary); - success( - format!("Defined a total of {} Features with {} FlowTypes {} DataTypes and {} Functions!", - parser.features.iter().len(), - parser.features.iter().map(|f| f.flow_types.len()).sum::(), - parser.features.iter().map(|f| f.data_types.len()).sum::(), - parser.features.iter().map(|f| f.runtime_functions.len()).sum::() + success(format!( + "Defined a total of {} Features with {} FlowTypes {} DataTypes and {} Functions!", + parser.features.iter().len(), + parser + .features + .iter() + .map(|f| f.flow_types.len()) + .sum::(), + parser + .features + .iter() + .map(|f| f.data_types.len()) + .sum::(), + parser + .features + .iter() + .map(|f| f.runtime_functions.len()) + .sum::() )) } diff --git a/cli/src/command/report.rs b/cli/src/command/report.rs index 873aa38..88927e9 100644 --- a/cli/src/command/report.rs +++ b/cli/src/command/report.rs @@ -1,7 +1,7 @@ use crate::analyser::Analyser; -use crate::table::{summary_table}; -use code0_definition_reader::parser::Parser; use crate::formatter::{success, success_table}; +use crate::table::summary_table; +use code0_definition_reader::parser::Parser; pub fn report_errors(path: Option) { let dir_path = path.unwrap_or_else(|| "./definitions".to_string()); @@ -19,11 +19,23 @@ pub fn report_errors(path: Option) { let rows = summary_table(&parser.features); success_table(rows); - success( - format!("Defined a total of {} Features with {} FlowTypes {} DataTypes and {} Functions!", + success(format!( + "Defined a total of {} Features with {} FlowTypes {} DataTypes and {} Functions!", parser.features.iter().len(), - parser.features.iter().map(|f| f.flow_types.len()).sum::(), - parser.features.iter().map(|f| f.data_types.len()).sum::(), - parser.features.iter().map(|f| f.runtime_functions.len()).sum::() + parser + .features + .iter() + .map(|f| f.flow_types.len()) + .sum::(), + parser + .features + .iter() + .map(|f| f.data_types.len()) + .sum::(), + parser + .features + .iter() + .map(|f| f.runtime_functions.len()) + .sum::() )) } diff --git a/cli/src/command/watch.rs b/cli/src/command/watch.rs index abdf30d..6defb54 100644 --- a/cli/src/command/watch.rs +++ b/cli/src/command/watch.rs @@ -1,9 +1,9 @@ +use crate::analyser::Analyser; +use crate::formatter::{default, info}; +use notify::event::ModifyKind; use notify::{Event, EventKind, RecursiveMode, Watcher, recommended_watcher}; use std::sync::mpsc::channel; use std::time::{Duration, Instant}; -use notify::event::ModifyKind; -use crate::analyser::Analyser; -use crate::formatter::{default, info}; pub async fn watch_for_changes(path: Option) { let dir_path = path.unwrap_or_else(|| "./definitions".to_string()); @@ -27,22 +27,21 @@ pub async fn watch_for_changes(path: Option) { loop { if let Ok(Ok(event)) = rx.recv() { match event.kind { - EventKind::Modify(modify) => { - match modify { - ModifyKind::Data(_) => { - if last_run.elapsed() > Duration::from_millis(500) { - default(String::from("\n\n\n--------------------------------------------------------------------------\n\n")); - info(String::from("Change detected! Regenerating report...")); - Analyser::new(dir_path.as_str()).report(false); - last_run = Instant::now(); - } - } - _ => {} - } - } - EventKind::Remove(_) => { + EventKind::Modify(modify) => if let ModifyKind::Data(_) = modify { + if last_run.elapsed() > Duration::from_millis(500) { + default(String::from( + "\n\n\n--------------------------------------------------------------------------\n\n", + )); + info(String::from("Change detected! Regenerating report...")); + Analyser::new(dir_path.as_str()).report(false); + last_run = Instant::now(); + } + }, + EventKind::Remove(_) => { if last_run.elapsed() > Duration::from_millis(500) { - default(String::from("\n\n\n--------------------------------------------------------------------------\n\n")); + default(String::from( + "\n\n\n--------------------------------------------------------------------------\n\n", + )); info(String::from("Change detected! Regenerating report...")); Analyser::new(dir_path.as_str()).report(false); last_run = Instant::now(); diff --git a/cli/src/formatter.rs b/cli/src/formatter.rs index e07fe53..8e1ddd9 100644 --- a/cli/src/formatter.rs +++ b/cli/src/formatter.rs @@ -38,7 +38,7 @@ pub fn error(string: String, path: &String) -> String { format!("\n{}: {} {}", "error".red(), string, print_path(path)) } -pub fn error_without_trace(string: String) { +pub fn error_without_trace(string: String) { println!("\n{}: {}", "error".red(), string) } diff --git a/cli/src/table.rs b/cli/src/table.rs index 0505702..6511939 100644 --- a/cli/src/table.rs +++ b/cli/src/table.rs @@ -1,7 +1,5 @@ -use code0_definition_reader::parser::DefinitionError; use code0_definition_reader::parser::Feature; -use colored::*; -use tabled::{Table, Tabled, settings::Style}; +use tabled::{Tabled}; use tucana::shared::{DefinitionDataType, FlowType, RuntimeFunctionDefinition}; #[derive(Tabled)] @@ -66,8 +64,9 @@ pub struct GeneralErrorRow { error: String, } -pub fn feature_table(feature: &Feature) -> (Vec, Vec, Vec) { - +pub fn feature_table( + feature: &Feature, +) -> (Vec, Vec, Vec) { let flow_type_rows: Vec = feature .flow_types .iter() @@ -100,19 +99,17 @@ pub fn feature_table(feature: &Feature) -> (Vec, Vec, ) .collect(); - (flow_type_rows,data_type_rows,runtime_function_rows) + (flow_type_rows, data_type_rows, runtime_function_rows) } pub fn summary_table(features: &Vec) -> Vec { - features + features .iter() - .map(|feature| { - FeatureSummaryRow { - feature_name: feature.name.clone(), - flow_types: feature.flow_types.len(), - data_types: feature.data_types.len(), - runtime_functions: feature.runtime_functions.len(), - } + .map(|feature| FeatureSummaryRow { + feature_name: feature.name.clone(), + flow_types: feature.flow_types.len(), + data_types: feature.data_types.len(), + runtime_functions: feature.runtime_functions.len(), }) .collect() } diff --git a/reader/rust/src/parser.rs b/reader/rust/src/parser.rs index ad5d65b..10f1206 100644 --- a/reader/rust/src/parser.rs +++ b/reader/rust/src/parser.rs @@ -90,16 +90,14 @@ impl Parser { fn append_meta(feature: &mut Feature, meta: &crate::reader::Meta) { let definition = meta.definition_string.as_str(); match meta.r#type { - MetaType::DataType => { - match serde_json::from_str::(definition) { - Ok(data_type) => feature.data_types.push(data_type), - Err(err) => feature.errors.push(DefinitionError { - definition: Parser::extract_identifier(definition, MetaType::DataType), - definition_type: MetaType::DataType, - error: err.to_string(), - }), - } - } + MetaType::DataType => match serde_json::from_str::(definition) { + Ok(data_type) => feature.data_types.push(data_type), + Err(err) => feature.errors.push(DefinitionError { + definition: Parser::extract_identifier(definition, MetaType::DataType), + definition_type: MetaType::DataType, + error: err.to_string(), + }), + }, MetaType::FlowType => match serde_json::from_str::(definition) { Ok(flow_type) => feature.flow_types.push(flow_type), Err(err) => feature.errors.push(DefinitionError { diff --git a/reader/rust/src/reader.rs b/reader/rust/src/reader.rs index c1056ce..a29338f 100644 --- a/reader/rust/src/reader.rs +++ b/reader/rust/src/reader.rs @@ -1,10 +1,10 @@ use serde::Serialize; +use std::io::ErrorKind; use std::{ fs::{self, DirEntry}, io::Error, path::Path, }; -use std::io::ErrorKind; #[derive(Serialize, Debug, Clone, Copy)] pub enum MetaType { @@ -40,14 +40,19 @@ impl Meta { where P: AsRef, { - - let path = match file_path.as_ref().to_str() { - Some(path) => path, - None => return Err(Error::new(ErrorKind::InvalidInput, "Invalid path")), - }; + let path = match file_path.as_ref().to_str() { + Some(path) => path, + None => return Err(Error::new(ErrorKind::InvalidInput, "Invalid path")), + }; if !path.ends_with("json") { - return Err(Error::new(ErrorKind::InvalidInput, format!("File {} does not end with .json", file_path.as_ref().display()))); + return Err(Error::new( + ErrorKind::InvalidInput, + format!( + "File {} does not end with .json", + file_path.as_ref().display() + ), + )); } let content = match fs::read_to_string(&file_path) { @@ -58,7 +63,7 @@ impl Meta { } }; - Ok(Meta{ + Ok(Meta { name, r#type, definition_string: content, @@ -126,11 +131,8 @@ impl Reader { definition_path_result.path(), ); - match meta { - Ok(meta_result) => { - result.push(meta_result); - } - _ => {} + if let Ok(meta_result) = meta { + result.push(meta_result); } } else { for sub_definition_path in @@ -147,11 +149,8 @@ impl Reader { sub_definition_path_result.path(), ); - match meta { - Ok(meta_result) => { - result.push(meta_result); - } - _ => {} + if let Ok(meta_result) = meta { + result.push(meta_result); } } } From b6501abb59f0c8e7cd11d8f17bb40277b763520e Mon Sep 17 00:00:00 2001 From: raphael-goetz Date: Mon, 18 Aug 2025 15:14:55 +0200 Subject: [PATCH 17/20] ref: correct fmt --- cli/src/analyser/diagnostics.rs | 4 ++-- cli/src/analyser/mod.rs | 10 ++++------ cli/src/command/download.rs | 8 +++----- cli/src/command/feature.rs | 3 +-- cli/src/command/watch.rs | 9 ++++----- cli/src/formatter.rs | 2 +- 6 files changed, 15 insertions(+), 21 deletions(-) diff --git a/cli/src/analyser/diagnostics.rs b/cli/src/analyser/diagnostics.rs index dc13654..d5a3508 100644 --- a/cli/src/analyser/diagnostics.rs +++ b/cli/src/analyser/diagnostics.rs @@ -113,10 +113,10 @@ impl DiagnosticKind { | DuplicateRuntimeFunctionIdentifier { .. } | DuplicateRuntimeParameterIdentifier { .. } | GenericKeyNotInMappingTarget { .. } - | EmptyGenericMapper { .. } + | EmptyGenericMapper | UndefinedDataTypeIdentifier { .. } | NullField { .. } - | ForbiddenVariant { .. } + | ForbiddenVariant | UnusedGenericKey { .. } | UndefinedGenericKey { .. } => Severity::Error, UndefinedTranslation { .. } => Severity::Warning, diff --git a/cli/src/analyser/mod.rs b/cli/src/analyser/mod.rs index 7aff08f..7d666aa 100644 --- a/cli/src/analyser/mod.rs +++ b/cli/src/analyser/mod.rs @@ -471,26 +471,24 @@ impl Analyser { } // Check if input identifier exists - if let Some(identifier) = flow.input_type_identifier { - if !self.data_type_identifier_exists(identifier.clone(), -1) { + if let Some(identifier) = flow.input_type_identifier + && !self.data_type_identifier_exists(identifier.clone(), -1) { self.reporter.add_report(Diagnose::new( name.clone(), original_definition.clone(), UndefinedDataTypeIdentifier { identifier }, )); } - } // Check if return identifier exists - if let Some(identifier) = flow.return_type_identifier { - if !self.data_type_identifier_exists(identifier.clone(), -1) { + if let Some(identifier) = flow.return_type_identifier + && !self.data_type_identifier_exists(identifier.clone(), -1) { self.reporter.add_report(Diagnose::new( name.clone(), original_definition.clone(), UndefinedDataTypeIdentifier { identifier }, )); } - } // Check if flow type identifier already exists for flow_type in &self.flow_types { diff --git a/cli/src/command/download.rs b/cli/src/command/download.rs index 62ab46c..9f88334 100644 --- a/cli/src/command/download.rs +++ b/cli/src/command/download.rs @@ -180,17 +180,15 @@ async fn convert_bytes_to_folder(bytes: Bytes, zip_path: &str) { panic!("Failed to create directory {}: {}", out_path.display(), e); } } else { - if let Some(p) = out_path.parent() { - if !p.exists() { - if let Err(e) = fs::create_dir_all(p) { + if let Some(p) = out_path.parent() + && !p.exists() + && let Err(e) = fs::create_dir_all(p) { panic!( "Warning: Failed to create parent directory {}: {}", p.display(), e ); } - } - } match File::create(&out_path) { Ok(mut outfile) => { diff --git a/cli/src/command/feature.rs b/cli/src/command/feature.rs index 1c53e99..13a7e12 100644 --- a/cli/src/command/feature.rs +++ b/cli/src/command/feature.rs @@ -21,8 +21,7 @@ pub fn search_feature(name: Option, path: Option) { Some(feature_name) => parser .features .iter() - .filter(|f| f.name.to_lowercase() == feature_name.to_lowercase()) - .map(|f| f.clone()) + .filter(|f| f.name.to_lowercase() == feature_name.to_lowercase()).cloned() .collect::>(), }; diff --git a/cli/src/command/watch.rs b/cli/src/command/watch.rs index 6defb54..5fca780 100644 --- a/cli/src/command/watch.rs +++ b/cli/src/command/watch.rs @@ -1,7 +1,7 @@ use crate::analyser::Analyser; use crate::formatter::{default, info}; use notify::event::ModifyKind; -use notify::{Event, EventKind, RecursiveMode, Watcher, recommended_watcher}; +use notify::{EventKind, RecursiveMode, Watcher, recommended_watcher}; use std::sync::mpsc::channel; use std::time::{Duration, Instant}; @@ -27,16 +27,15 @@ pub async fn watch_for_changes(path: Option) { loop { if let Ok(Ok(event)) = rx.recv() { match event.kind { - EventKind::Modify(modify) => if let ModifyKind::Data(_) = modify { - if last_run.elapsed() > Duration::from_millis(500) { + EventKind::Modify(modify) => if let ModifyKind::Data(_) = modify + && last_run.elapsed() > Duration::from_millis(500) { default(String::from( "\n\n\n--------------------------------------------------------------------------\n\n", )); info(String::from("Change detected! Regenerating report...")); Analyser::new(dir_path.as_str()).report(false); last_run = Instant::now(); - } - }, + }, EventKind::Remove(_) => { if last_run.elapsed() > Duration::from_millis(500) { default(String::from( diff --git a/cli/src/formatter.rs b/cli/src/formatter.rs index 8e1ddd9..064ad84 100644 --- a/cli/src/formatter.rs +++ b/cli/src/formatter.rs @@ -55,7 +55,7 @@ where } pub fn warning(string: String, path: &String) -> String { - format!("\n{}: {} {}", "warning".yellow(), string, print_path(&path)) + format!("\n{}: {} {}", "warning".yellow(), string, print_path(path)) } pub fn warning_highlight(highlight: String, string: String) { From 7ad683919e86ac35aa8ffbc9ed6c4b7607b4f218 Mon Sep 17 00:00:00 2001 From: raphael-goetz Date: Mon, 18 Aug 2025 15:16:22 +0200 Subject: [PATCH 18/20] ref: correct fmt --- cli/src/analyser/mod.rs | 30 ++++++++++++++++-------------- cli/src/command/download.rs | 15 ++++++++------- cli/src/command/feature.rs | 5 +++-- cli/src/command/watch.rs | 9 ++++++--- cli/src/table.rs | 2 +- 5 files changed, 34 insertions(+), 27 deletions(-) diff --git a/cli/src/analyser/mod.rs b/cli/src/analyser/mod.rs index 7d666aa..52edf30 100644 --- a/cli/src/analyser/mod.rs +++ b/cli/src/analyser/mod.rs @@ -472,23 +472,25 @@ impl Analyser { // Check if input identifier exists if let Some(identifier) = flow.input_type_identifier - && !self.data_type_identifier_exists(identifier.clone(), -1) { - self.reporter.add_report(Diagnose::new( - name.clone(), - original_definition.clone(), - UndefinedDataTypeIdentifier { identifier }, - )); - } + && !self.data_type_identifier_exists(identifier.clone(), -1) + { + self.reporter.add_report(Diagnose::new( + name.clone(), + original_definition.clone(), + UndefinedDataTypeIdentifier { identifier }, + )); + } // Check if return identifier exists if let Some(identifier) = flow.return_type_identifier - && !self.data_type_identifier_exists(identifier.clone(), -1) { - self.reporter.add_report(Diagnose::new( - name.clone(), - original_definition.clone(), - UndefinedDataTypeIdentifier { identifier }, - )); - } + && !self.data_type_identifier_exists(identifier.clone(), -1) + { + self.reporter.add_report(Diagnose::new( + name.clone(), + original_definition.clone(), + UndefinedDataTypeIdentifier { identifier }, + )); + } // Check if flow type identifier already exists for flow_type in &self.flow_types { diff --git a/cli/src/command/download.rs b/cli/src/command/download.rs index 9f88334..93f7295 100644 --- a/cli/src/command/download.rs +++ b/cli/src/command/download.rs @@ -182,13 +182,14 @@ async fn convert_bytes_to_folder(bytes: Bytes, zip_path: &str) { } else { if let Some(p) = out_path.parent() && !p.exists() - && let Err(e) = fs::create_dir_all(p) { - panic!( - "Warning: Failed to create parent directory {}: {}", - p.display(), - e - ); - } + && let Err(e) = fs::create_dir_all(p) + { + panic!( + "Warning: Failed to create parent directory {}: {}", + p.display(), + e + ); + } match File::create(&out_path) { Ok(mut outfile) => { diff --git a/cli/src/command/feature.rs b/cli/src/command/feature.rs index 13a7e12..21b96ad 100644 --- a/cli/src/command/feature.rs +++ b/cli/src/command/feature.rs @@ -21,10 +21,11 @@ pub fn search_feature(name: Option, path: Option) { Some(feature_name) => parser .features .iter() - .filter(|f| f.name.to_lowercase() == feature_name.to_lowercase()).cloned() + .filter(|f| f.name.to_lowercase() == feature_name.to_lowercase()) + .cloned() .collect::>(), }; - + for feature in &features { let (flow_type_rows, data_type_rows, function_rows) = feature_table(feature); diff --git a/cli/src/command/watch.rs b/cli/src/command/watch.rs index 5fca780..af0c166 100644 --- a/cli/src/command/watch.rs +++ b/cli/src/command/watch.rs @@ -27,15 +27,18 @@ pub async fn watch_for_changes(path: Option) { loop { if let Ok(Ok(event)) = rx.recv() { match event.kind { - EventKind::Modify(modify) => if let ModifyKind::Data(_) = modify - && last_run.elapsed() > Duration::from_millis(500) { + EventKind::Modify(modify) => { + if let ModifyKind::Data(_) = modify + && last_run.elapsed() > Duration::from_millis(500) + { default(String::from( "\n\n\n--------------------------------------------------------------------------\n\n", )); info(String::from("Change detected! Regenerating report...")); Analyser::new(dir_path.as_str()).report(false); last_run = Instant::now(); - }, + } + } EventKind::Remove(_) => { if last_run.elapsed() > Duration::from_millis(500) { default(String::from( diff --git a/cli/src/table.rs b/cli/src/table.rs index 6511939..1bdb278 100644 --- a/cli/src/table.rs +++ b/cli/src/table.rs @@ -1,5 +1,5 @@ use code0_definition_reader::parser::Feature; -use tabled::{Tabled}; +use tabled::Tabled; use tucana::shared::{DefinitionDataType, FlowType, RuntimeFunctionDefinition}; #[derive(Tabled)] From 3f33481f0c27887ea512e702554f4ffe8144809b Mon Sep 17 00:00:00 2001 From: raphael-goetz Date: Mon, 18 Aug 2025 17:28:19 +0200 Subject: [PATCH 19/20] feat: reworked ts package --- .gitignore | 3 +- reader/ts/index.js | 3 - reader/ts/index.ts | 2 + reader/ts/package.json | 15 ++-- reader/ts/src/parser.ts | 43 +++++---- reader/ts/src/reader.ts | 61 +++++-------- reader/ts/{index.d.ts => src/types.ts} | 2 +- reader/ts/tsconfig.json | 120 +++---------------------- 8 files changed, 66 insertions(+), 183 deletions(-) delete mode 100644 reader/ts/index.js create mode 100644 reader/ts/index.ts rename reader/ts/{index.d.ts => src/types.ts} (95%) diff --git a/.gitignore b/.gitignore index 7ef232d..23de227 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ *.DS_Store **/node_modules .idea -reader/ts/src/*.js \ No newline at end of file +reader/ts/src/*.js +reader/ts/build \ No newline at end of file diff --git a/reader/ts/index.js b/reader/ts/index.js deleted file mode 100644 index 4123093..0000000 --- a/reader/ts/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import {Definition} from './src/parser'; - -export {Definition}; \ No newline at end of file diff --git a/reader/ts/index.ts b/reader/ts/index.ts new file mode 100644 index 0000000..89a7fe1 --- /dev/null +++ b/reader/ts/index.ts @@ -0,0 +1,2 @@ +export { Definition } from './src/parser.js'; +export type { Feature, MetaType, Meta } from './src/types.js'; \ No newline at end of file diff --git a/reader/ts/package.json b/reader/ts/package.json index 383d8e8..be7d638 100644 --- a/reader/ts/package.json +++ b/reader/ts/package.json @@ -2,8 +2,14 @@ "name": "@code0-tech/definition-reader", "version": "0.0.0", "description": "Reader for Code0-Definitions", - "main": "index.js", - "types": "index.d.ts", + "main": "./build/index.js", + "types": "./build/index.d.ts", + "exports": { + ".": { + "import": "./build/index.js", + "types": "./build/index.d.ts" + } + }, "type": "module", "scripts": { "build": "tsc" @@ -20,10 +26,7 @@ "url": "git+https://github.com/code0-tech/code0-definitions.git" }, "files": [ - "src", - "index.d.ts", - "index.js", - "package.json" + "build" ], "publishConfig": { "access": "public" diff --git a/reader/ts/src/parser.ts b/reader/ts/src/parser.ts index e3c130d..91c87a4 100644 --- a/reader/ts/src/parser.ts +++ b/reader/ts/src/parser.ts @@ -1,6 +1,6 @@ -import {Reader} from './reader'; +import {Reader} from './reader.js'; import {DataType, FlowType, RuntimeFunctionDefinition} from "@code0-tech/sagittarius-graphql-types"; -import {Feature, Meta, MetaType} from "../index"; +import {Feature, Meta, MetaType} from "./types.js"; export const Definition = (rootPath: string): Feature[] => { const meta = Reader(rootPath); @@ -28,27 +28,26 @@ export const Definition = (rootPath: string): Feature[] => { } function appendMeta(feature: Feature, meta: Meta): void { - for (const definition of meta.data) { - try { - switch (meta.type) { - case MetaType.DataType: { - const parsed = JSON.parse(definition) as DataType; - feature.dataTypes.push(parsed); - break; - } - case MetaType.FlowType: { - const parsed = JSON.parse(definition) as FlowType; - feature.flowTypes.push(parsed); - break; - } - case MetaType.RuntimeFunction: { - const parsed = JSON.parse(definition) as RuntimeFunctionDefinition; - feature.runtimeFunctions.push(parsed); - break; - } + const definition = meta.data; + try { + switch (meta.type) { + case MetaType.DataType: { + const parsed = JSON.parse(definition) as DataType; + feature.dataTypes.push(parsed); + break; + } + case MetaType.FlowType: { + const parsed = JSON.parse(definition) as FlowType; + feature.flowTypes.push(parsed); + break; + } + case MetaType.RuntimeFunction: { + const parsed = JSON.parse(definition) as RuntimeFunctionDefinition; + feature.runtimeFunctions.push(parsed); + break; } - } catch (err: any) { - console.error(`Error parsing ${meta.type} ${meta.name}:`, err); } + } catch (err: any) { + console.error(`Error parsing ${meta.type} ${meta.name} ${definition}:`, err); } } \ No newline at end of file diff --git a/reader/ts/src/reader.ts b/reader/ts/src/reader.ts index 1f4377f..fe321ae 100644 --- a/reader/ts/src/reader.ts +++ b/reader/ts/src/reader.ts @@ -1,6 +1,6 @@ import * as fs from 'fs'; import * as path from 'path'; -import {Meta, MetaType} from "../index"; +import {Meta, MetaType} from "./types.js"; export const Reader = (rootPath: string): Meta[] => { const result: Meta[] = []; @@ -29,17 +29,30 @@ export const Reader = (rootPath: string): Meta[] => { const defPath = path.join(typePath, def.name); if (def.isFile()) { - const meta = MetaReader(featureName, metaType, defPath); - if (meta) result.push(meta); + if (!defPath.endsWith('.json')) continue; + try { + const content = fs.readFileSync(defPath, 'utf-8'); + const meta: Meta = {name: featureName, type: metaType, data: content}; + result.push(meta); + } catch (err) { + console.error(`Error reading file: ${defPath}`, err); + } } else if (def.isDirectory()) { - const subDefinitions = fs.readdirSync(defPath, { withFileTypes: true }); + const subDefinitions = fs.readdirSync(defPath, { withFileTypes: true }); for (const subDef of subDefinitions) { const subPath = path.join(defPath, subDef.name); - if (!subDef.isFile()) continue; - const meta = MetaReader(featureName, metaType, subPath); - if (meta) result.push(meta); + if (!subPath.endsWith('.json')) continue; + if (!subDef.isFile()) continue; + + try { + const content = fs.readFileSync(subPath, 'utf-8'); + const meta: Meta = {name: featureName, type: metaType, data: content}; + result.push(meta); + } catch (err) { + console.error(`Error reading file: ${subPath}`, err); + } } } } @@ -53,40 +66,6 @@ export const Reader = (rootPath: string): Meta[] => { } } -const MetaReader = (name: string, type: MetaType, filePath: string): Meta | null => { - let content: string; - - try { - content = fs.readFileSync(filePath, 'utf-8'); - } catch (err) { - console.error(`Error reading file: ${filePath}`, err); - return null; - } - - const lines = content.split('\n'); - let insideCode = false; - const currentBlock: string[] = []; - const codeSnippets: string[] = []; - - for (const line of lines) { - if (line.includes('```')) { - insideCode = !insideCode; - - if (!insideCode) { - codeSnippets.push(currentBlock.join(' ')); - currentBlock.length = 0; - } - continue; - } - - if (insideCode) { - currentBlock.push(line); - } - } - - return { name, type, data: codeSnippets }; -} - function matchMetaType(name: string): MetaType | null { switch (name) { case 'flow_type': diff --git a/reader/ts/index.d.ts b/reader/ts/src/types.ts similarity index 95% rename from reader/ts/index.d.ts rename to reader/ts/src/types.ts index d5aa101..a9bbc31 100644 --- a/reader/ts/index.d.ts +++ b/reader/ts/src/types.ts @@ -9,7 +9,7 @@ export enum MetaType { export interface Meta { name: string; type: MetaType; - data: string[]; + data: string; } export interface Feature { diff --git a/reader/ts/tsconfig.json b/reader/ts/tsconfig.json index 904d43f..e2c781f 100644 --- a/reader/ts/tsconfig.json +++ b/reader/ts/tsconfig.json @@ -1,113 +1,15 @@ { + "exclude": ["node_modules", "build"], "compilerOptions": { - /* Visit https://aka.ms/tsconfig to read more about this file */ - - /* Projects */ - // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */ - // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ - // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */ - // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */ - // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ - // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ - - /* Language and Environment */ - "target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ - // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ - // "jsx": "preserve", /* Specify what JSX code is generated. */ - // "libReplacement": true, /* Enable lib replacement. */ - // "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */ - // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ - // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */ - // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ - // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */ - // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */ - // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ - // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ - // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ - - /* Modules */ - "module": "commonjs", /* Specify what module code is generated. */ - // "rootDir": "./", /* Specify the root folder within your source files. */ - // "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */ - // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ - // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ - // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ - // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */ - // "types": [], /* Specify type package names to be included without being referenced in a source file. */ - // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ - // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */ - // "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */ - // "rewriteRelativeImportExtensions": true, /* Rewrite '.ts', '.tsx', '.mts', and '.cts' file extensions in relative import paths to their JavaScript equivalent in output files. */ - // "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */ - // "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */ - // "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */ - // "noUncheckedSideEffectImports": true, /* Check side effect imports. */ - // "resolveJsonModule": true, /* Enable importing .json files. */ - // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */ - // "noResolve": true, /* Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. */ - - /* JavaScript Support */ - // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ - // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ - // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ - - /* Emit */ - // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ - // "declarationMap": true, /* Create sourcemaps for d.ts files. */ - // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ - // "sourceMap": true, /* Create source map files for emitted JavaScript files. */ - // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ - // "noEmit": true, /* Disable emitting files from a compilation. */ - // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */ - // "outDir": "./", /* Specify an output folder for all emitted files. */ - // "removeComments": true, /* Disable emitting comments. */ - // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ - // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ - // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ - // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ - // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ - // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ - // "newLine": "crlf", /* Set the newline character for emitting files. */ - // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */ - // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */ - // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ - // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */ - // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ - - /* Interop Constraints */ - // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ - // "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */ - // "isolatedDeclarations": true, /* Require sufficient annotation on exports so other tools can trivially generate declaration files. */ - // "erasableSyntaxOnly": true, /* Do not allow runtime constructs that are not part of ECMAScript. */ - // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ - "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */ - // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ - "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ - - /* Type Checking */ - "strict": true, /* Enable all strict type-checking options. */ - // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ - // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */ - // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ - // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */ - // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ - // "strictBuiltinIteratorReturn": true, /* Built-in iterators are instantiated with a 'TReturn' type of 'undefined' instead of 'any'. */ - // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */ - // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */ - // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ - // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */ - // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */ - // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ - // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ - // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ - // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */ - // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ - // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */ - // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ - // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ - - /* Completeness */ - // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ - "skipLibCheck": true /* Skip type checking all .d.ts files. */ + "lib": ["ESNext"], + "module": "NodeNext", + "target": "ESNext", + "moduleDetection": "force", + "outDir": "build", + "skipLibCheck": true, + "strict": true, + "moduleResolution": "nodenext", + "declaration": true, + "emitDeclarationOnly": false } } From 9cd1b7ce121f59c2098a670fec6d695bdc1c032f Mon Sep 17 00:00:00 2001 From: raphael-goetz Date: Mon, 18 Aug 2025 17:35:33 +0200 Subject: [PATCH 20/20] drop: removed primitive.md --- definitions/standard/data_type/primitive.md | 77 --------------------- 1 file changed, 77 deletions(-) delete mode 100644 definitions/standard/data_type/primitive.md diff --git a/definitions/standard/data_type/primitive.md b/definitions/standard/data_type/primitive.md deleted file mode 100644 index 39bbed9..0000000 --- a/definitions/standard/data_type/primitive.md +++ /dev/null @@ -1,77 +0,0 @@ -# All Data_Types of the Primitive Variant - -## NUMBER - -```json -{ - "variant": 1, - "identifier": "NUMBER", - "name": [ - { - "code": "en-US", - "content": "Number" - } - ], - "rules": [ - { - "config": { - "Regex": { - "pattern": "/^(?:-(?:[1-9](?:\\d{0,2}(?:,\\d{3})+|\\d*))|(?:0|(?:[1-9](?:\\d{0,2}(?:,\\d{3})+|\\d*))))(?:.\\d+|)$/" - } - } - } - ], - "generic_keys": [] -} -``` - - -## TEXT - -```json -{ - "variant": 1, - "identifier": "TEXT", - "name": [ - { - "code": "en-US", - "content": "Text" - } - ], - "rules": [ - { - "config": { - "Regex": { - "pattern": "[\\s\\S]*" - } - } - } - ], - "generic_keys": [] -} -``` - -## BOOLEAN - -```json -{ - "variant": 1, - "identifier": "BOOLEAN", - "name": [ - { - "code": "en-US", - "content": "Boolean" - } - ], - "rules": [ - { - "config": { - "Regex": { - "pattern": "^(true|false)$" - } - } - } - ], - "generic_keys": [] -} -```