From 0758b8a0c2037444f27d73e5b279251ee1ddeb50 Mon Sep 17 00:00:00 2001 From: Raphael Date: Sat, 10 May 2025 13:44:47 +0200 Subject: [PATCH 01/17] dependencies: updated all --- Cargo.lock | 28 ++++++++++++++-------------- Cargo.toml | 1 - 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fd57148..9b3ef0b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -39,9 +39,9 @@ dependencies = [ [[package]] name = "amq-protocol" -version = "7.2.2" +version = "7.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3a41c091e49edfcc098b4f90d4d7706a8cf9158034e84ebfee7ff346092f67c" +checksum = "587d313f3a8b4a40f866cc84b6059fe83133bf172165ac3b583129dd211d8e1c" dependencies = [ "amq-protocol-tcp", "amq-protocol-types", @@ -53,9 +53,9 @@ dependencies = [ [[package]] name = "amq-protocol-tcp" -version = "7.2.2" +version = "7.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ed7a4a662472f88823ed2fc81babb0b00562f2c54284e3e7bffc02b6df649bf" +checksum = "dc707ab9aa964a85d9fc25908a3fdc486d2e619406883b3105b48bf304a8d606" dependencies = [ "amq-protocol-uri", "tcp-stream", @@ -64,9 +64,9 @@ dependencies = [ [[package]] name = "amq-protocol-types" -version = "7.2.2" +version = "7.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd6484fdc918c1b6e2ae8eda2914d19a5873e1975f93ad8d33d6a24d1d98df05" +checksum = "bf99351d92a161c61ec6ecb213bc7057f5b837dd4e64ba6cb6491358efd770c4" dependencies = [ "cookie-factory", "nom", @@ -76,9 +76,9 @@ dependencies = [ [[package]] name = "amq-protocol-uri" -version = "7.2.2" +version = "7.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f7f2da69e0e1182765bf33407cd8a843f20791b5af2b57a2645818c4776c56c" +checksum = "f89f8273826a676282208e5af38461a07fe939def57396af6ad5997fcf56577d" dependencies = [ "amq-protocol-types", "percent-encoding", @@ -477,9 +477,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.21" +version = "1.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8691782945451c1c383942c4874dbe63814f61cb57ef773cda2972682b7bb3c0" +checksum = "32db95edf998450acc7881c932f94cd9b05c87b4b2599e8bab064753da4acfd1" dependencies = [ "shlex", ] @@ -2027,9 +2027,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.103.2" +version = "0.103.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7149975849f1abb3832b246010ef62ccc80d3a76169517ada7188252b9cfb437" +checksum = "e4a72fe2bcf7a6ac6fd7d0b9e5cb68aeb7d4c0a0271730218b3e92d43b4eb435" dependencies = [ "ring", "rustls-pki-types", @@ -2922,9 +2922,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.7.7" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6cb8234a863ea0e8cd7284fcdd4f145233eb00fee02bbdd9861aec44e6477bc5" +checksum = "c06928c8748d81b05c9be96aad92e1b6ff01833332f281e8cfca3be4b35fc9ec" dependencies = [ "memchr", ] diff --git a/Cargo.toml b/Cargo.toml index 7cea124..8b63616 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,6 @@ lapin = "2.5.3" serde = "1.0.219" serde_json = "1.0.140" tokio = { version = "1.44.1", features = ["rt-multi-thread"] } -tucana = "0.0.20" toml = "0.8.0" [dev-dependencies] From c70479be414eccdf086c7e9ce772a2fe4ba1d5d1 Mon Sep 17 00:00:00 2001 From: Raphael Date: Mon, 12 May 2025 19:41:13 +0200 Subject: [PATCH 02/17] feat: added first set of test functions --- src/implementation/mod.rs | 214 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 214 insertions(+) create mode 100644 src/implementation/mod.rs diff --git a/src/implementation/mod.rs b/src/implementation/mod.rs new file mode 100644 index 0000000..7973624 --- /dev/null +++ b/src/implementation/mod.rs @@ -0,0 +1,214 @@ +use tucana::shared::{value::Kind, Value}; + +use crate::{context::Context, error::RuntimeError, registry::HandlerFn}; + +pub fn collect() -> Vec<(&'static str, HandlerFn)> { + vec![ + ("std::number::add", add), + ("std::number::multiply", multiply), + ("std::number::substract", substract), + ("std::number::devide", devide), + ("std::number::modulo", modulo), + ("std::number::abs", abs), + ("std::number::is_positive", is_positive), + ("std::number::is_greater", is_greater), + ("std::number::is_less", is_less), + ("std::number::is_zero", is_zero), + ("std::number::from_text", from_text), + ("std::number::as_text", as_text), + ] +} + +fn add(values: &[Value], _ctx: &mut Context) -> Result { + let [Value { + kind: Some(Kind::NumberValue(lhs)), + .. + }, Value { + kind: Some(Kind::NumberValue(rhs)), + .. + }] = values + else { + return Err(RuntimeError::default()); + }; + + Ok(Value { + kind: Some(Kind::NumberValue(lhs + rhs)), + }) +} + +fn multiply(values: &[Value], _ctx: &mut Context) -> Result { + let [Value { + kind: Some(Kind::NumberValue(lhs)), + .. + }, Value { + kind: Some(Kind::NumberValue(rhs)), + .. + }] = values + else { + return Err(RuntimeError::default()); + }; + + Ok(Value { + kind: Some(Kind::NumberValue(lhs * rhs)), + }) +} + +fn substract(values: &[Value], _ctx: &mut Context) -> Result { + let [Value { + kind: Some(Kind::NumberValue(lhs)), + .. + }, Value { + kind: Some(Kind::NumberValue(rhs)), + .. + }] = values + else { + return Err(RuntimeError::default()); + }; + + Ok(Value { + kind: Some(Kind::NumberValue(lhs - rhs)), + }) +} + +fn devide(values: &[Value], _ctx: &mut Context) -> Result { + let [Value { + kind: Some(Kind::NumberValue(lhs)), + .. + }, Value { + kind: Some(Kind::NumberValue(rhs)), + .. + }] = values + else { + return Err(RuntimeError::default()); + }; + + Ok(Value { + kind: Some(Kind::NumberValue(lhs / rhs)), + }) +} + +fn modulo(values: &[Value], _ctx: &mut Context) -> Result { + let [Value { + kind: Some(Kind::NumberValue(lhs)), + .. + }, Value { + kind: Some(Kind::NumberValue(rhs)), + .. + }] = values + else { + return Err(RuntimeError::default()); + }; + + Ok(Value { + kind: Some(Kind::NumberValue(lhs % rhs)), + }) +} + +fn abs(values: &[Value], _ctx: &mut Context) -> Result { + let [Value { + kind: Some(Kind::NumberValue(value)), + .. + }] = values + else { + return Err(RuntimeError::default()); + }; + + Ok(Value { + kind: Some(Kind::NumberValue(value.abs())), + }) +} + +fn is_positive(values: &[Value], _ctx: &mut Context) -> Result { + let [Value { + kind: Some(Kind::NumberValue(value)), + .. + }] = values + else { + return Err(RuntimeError::default()); + }; + + Ok(Value { + kind: Some(Kind::BoolValue(!value.is_sign_negative())), + }) +} + +fn is_greater(values: &[Value], _ctx: &mut Context) -> Result { + let [Value { + kind: Some(Kind::NumberValue(lhs)), + .. + }, Value { + kind: Some(Kind::NumberValue(rhs)), + .. + }] = values + else { + return Err(RuntimeError::default()); + }; + + Ok(Value { + kind: Some(Kind::BoolValue(lhs > rhs)), + }) +} + +fn is_less(values: &[Value], _ctx: &mut Context) -> Result { + let [Value { + kind: Some(Kind::NumberValue(lhs)), + .. + }, Value { + kind: Some(Kind::NumberValue(rhs)), + .. + }] = values + else { + return Err(RuntimeError::default()); + }; + + Ok(Value { + kind: Some(Kind::BoolValue(lhs < rhs)), + }) +} + +fn is_zero(values: &[Value], _ctx: &mut Context) -> Result { + let [Value { + kind: Some(Kind::NumberValue(value)), + .. + }] = values + else { + return Err(RuntimeError::default()); + }; + + Ok(Value { + kind: Some(Kind::BoolValue(value == &0.0)), + }) +} + +fn from_text(values: &[Value], _ctx: &mut Context) -> Result { + let [Value { + kind: Some(Kind::StringValue(string_value)), + .. + }] = values + else { + return Err(RuntimeError::default()); + }; + + let value: f64 = match string_value.parse() { + Ok(result) => result, + Err(_) => return Err(RuntimeError::default()), + }; + + Ok(Value { + kind: Some(Kind::NumberValue(value)), + }) +} + +fn as_text(values: &[Value], _ctx: &mut Context) -> Result { + let [Value { + kind: Some(Kind::NumberValue(value)), + .. + }] = values + else { + return Err(RuntimeError::default()); + }; + + Ok(Value { + kind: Some(Kind::StringValue(value.to_string())), + }) +} From 130230f5f8d43c5c2cd9f0d0b8f9bad266e50ed5 Mon Sep 17 00:00:00 2001 From: Raphael Date: Mon, 12 May 2025 19:41:24 +0200 Subject: [PATCH 03/17] dependencies: added futures-lite & log --- Cargo.lock | 2 ++ Cargo.toml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index 9b3ef0b..6af292f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2280,7 +2280,9 @@ name = "taurus" version = "0.1.0" dependencies = [ "code0-flow", + "futures-lite 2.6.0", "lapin", + "log", "serde", "serde_json", "tempfile", diff --git a/Cargo.toml b/Cargo.toml index 8b63616..7b77201 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,6 +11,8 @@ serde = "1.0.219" serde_json = "1.0.140" tokio = { version = "1.44.1", features = ["rt-multi-thread"] } toml = "0.8.0" +log = "0.4.27" +futures-lite = "2.6.0" [dev-dependencies] tempfile = "3.19.1" From 14d5f781cf09eb09df7b2f2aa9a1eab3ae2ca6bc Mon Sep 17 00:00:00 2001 From: Raphael Date: Mon, 12 May 2025 19:41:39 +0200 Subject: [PATCH 04/17] feat: first node handling functionality --- src/context/mod.rs | 5 + src/error/mod.rs | 2 +- src/main.rs | 219 ++++++++++++++++++++++++++++++++++++++++++-- src/registry/mod.rs | 2 +- 4 files changed, 216 insertions(+), 12 deletions(-) diff --git a/src/context/mod.rs b/src/context/mod.rs index 87b9157..9bb6bb0 100644 --- a/src/context/mod.rs +++ b/src/context/mod.rs @@ -12,6 +12,11 @@ pub struct ContextReference { pub tertiary_level: Option, } +pub struct ContextLayer { + is_finished: bool, + result: Option>, +} + #[derive(Debug)] pub struct Context { /// A stack of environments: layer 0 is the outermost. diff --git a/src/error/mod.rs b/src/error/mod.rs index e3f0593..5148886 100644 --- a/src/error/mod.rs +++ b/src/error/mod.rs @@ -3,7 +3,7 @@ use std::{ fmt::{Display, Formatter}, }; -#[derive(Debug)] +#[derive(Debug, Default)] pub struct RuntimeError {} impl Error for RuntimeError {} diff --git a/src/main.rs b/src/main.rs index 61614b6..d1334f7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,13 +1,139 @@ -pub mod locale; pub mod context; pub mod error; +pub mod implementation; +pub mod locale; pub mod registry; +use std::sync::Arc; + use code0_flow::flow_queue::service::{Message, RabbitmqClient}; +use context::Context; +use error::RuntimeError; +use futures_lite::StreamExt; +use lapin::{options::BasicConsumeOptions, types::FieldTable}; use locale::locale::Locale; -use std::sync::Arc; +use registry::FunctionStore; +use tucana::shared::{Flow, NodeFunction, Value}; + +fn handle_node_function( + function: NodeFunction, + store: &FunctionStore, + context: &mut Context, +) -> Result { + if let Some(definition) = function.definition { + let runtime_function = match store.get(definition.runtime_function_id.as_str()) { + Some(fc) => fc, + None => todo!("Retrun if no funtion is present"), + }; + + let mut parameter_collection: Vec = vec![]; + + for parameter in function.parameters { + if let Some(value) = parameter.value { + match value { + // Its just a normal value, directly a paramter + tucana::shared::node_parameter::Value::LiteralValue(v) => { + parameter_collection.push(v) + } + + // Its a reference to an already executed function that returns value is the parameter of this function + tucana::shared::node_parameter::Value::ReferenceValue(reference) => { + let optional_value = context.get(&reference); + + // Look if its even present + let context_result = match optional_value { + Some(context_result) => context_result, + None => { + todo!("Required function that holds the parameter wasnt executed") + } + }; + + match context_result { + Ok(v) => { + parameter_collection.push(v.clone()); + } + Err(_) => { + todo!( + "Reqired function that holds the paramter failed in execution" + ) + } + } + } + + // Its another function, that result is a direct parameter to this function + tucana::shared::node_parameter::Value::FunctionValue(another_node_function) => { + let function_result = + handle_node_function(another_node_function, &store, context); + + match function_result { + Ok(v) => { + parameter_collection.push(v.clone()); + } + Err(_) => { + todo!( + "Reqired function that holds the paramter failed in execution" + ) + } + } + } + } + } + } + + let result = runtime_function(¶meter_collection, context); + + if let Some(ref next_node) = function.next_node { + let next: NodeFunction = (**next_node).clone(); + let _ = handle_node_function(next, store, context); + todo!() + }; + + return result; + }; + + Err(RuntimeError::default()) +} + +fn handle_message( + message: Message, + store: &FunctionStore, + context: &mut Context, +) -> Result { + let flow: Flow = match serde_json::from_str(&message.body) { + Ok(flow) => flow, + Err(_) => { + todo!() + } + }; + + if let Some(node) = flow.starting_node { + match handle_node_function(node, store, context) { + Ok(result) => match serde_json::to_string(&result) { + Ok(res) => { + return Ok(Message { + message_id: message.message_id, + message_type: message.message_type, + timestamp: message.timestamp, + sender: message.sender, + body: res, + }) + } + Err(_) => { + todo!("") + } + }, + Err(runtime_error) => { + return Ok(Message { + message_id: message.message_id, + message_type: message.message_type, + timestamp: message.timestamp, + sender: message.sender, + body: runtime_error.to_string(), + }) + } + } + }; -fn handle_message(message: Message) -> Result { Ok(Message { message_id: message.message_id, message_type: message.message_type, @@ -19,14 +145,87 @@ fn handle_message(message: Message) -> Result { #[tokio::main] async fn main() { - let locale = Locale::default(); + let _locale = Locale::default(); + let store = FunctionStore::new(); + let mut context = Context::new(); + let rabbitmq_client = Arc::new(RabbitmqClient::new("amqp://localhost:5672").await); - // Receive messages from the send_queue - if let Err(e) = rabbitmq_client - .receive_messages("send_queue", handle_message) - .await - { - eprintln!("Failed to receive messages: {}", e); + let mut consumer = { + let channel = rabbitmq_client.channel.lock().await; + + let consumer_res = channel + .basic_consume( + "send_queue", + "consumer", + BasicConsumeOptions::default(), + FieldTable::default(), + ) + .await; + + match consumer_res { + Ok(consumer) => consumer, + Err(err) => panic!("Cannot consume messages: {}", err), + } + }; + + log::debug!("Starting to consume from send_queue"); + + while let Some(delivery) = consumer.next().await { + let delivery = match delivery { + Ok(del) => del, + Err(err) => { + log::error!("Error receiving message: {}", err); + return; + } + }; + + let data = &delivery.data; + let message_str = match std::str::from_utf8(&data) { + Ok(str) => { + log::info!("Received message: {}", str); + str + } + Err(err) => { + log::error!("Error decoding message: {}", err); + return; + } + }; + // Parse the messagey + let inc_message = match serde_json::from_str::(message_str) { + Ok(mess) => mess, + Err(err) => { + log::error!("Error parsing message: {}", err); + return; + } + }; + + let message = match handle_message(inc_message, &store, &mut context) { + Ok(mess) => mess, + Err(err) => { + log::error!("Error handling message: {}", err); + return; + } + }; + + let message_json = match serde_json::to_string(&message) { + Ok(json) => json, + Err(err) => { + log::error!("Error serializing message: {}", err); + return; + } + }; + + { + let _ = rabbitmq_client + .send_message(message_json, "recieve_queue") + .await; + } + + // Acknowledge the message + delivery + .ack(lapin::options::BasicAckOptions::default()) + .await + .expect("Failed to acknowledge message"); } } diff --git a/src/registry/mod.rs b/src/registry/mod.rs index 7fea4b6..973f524 100644 --- a/src/registry/mod.rs +++ b/src/registry/mod.rs @@ -23,7 +23,7 @@ impl FunctionStore { } /// Execute all the registration closures to populate the map. - fn populate(&mut self, regs: Vec<(&'static str, HandlerFn)>) { + pub fn populate(&mut self, regs: Vec<(&'static str, HandlerFn)>) { for (id, func) in regs { self.functions.insert(id.to_string(), func); } From e5c0c857856a04422fb725a92c3574ce30998274 Mon Sep 17 00:00:00 2001 From: Raphael Date: Tue, 13 May 2025 17:28:33 +0200 Subject: [PATCH 05/17] feat: added context navigation --- src/context/mod.rs | 77 +++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 70 insertions(+), 7 deletions(-) diff --git a/src/context/mod.rs b/src/context/mod.rs index 9bb6bb0..b9faf4b 100644 --- a/src/context/mod.rs +++ b/src/context/mod.rs @@ -1,24 +1,19 @@ /// A simple context that holds variable bindings in nested layers. -/// Each layer is a map from String identifiers to Values. use std::collections::HashMap; use tucana::shared::{ReferenceValue, Value}; use crate::error::RuntimeError; -#[derive(Debug)] +#[derive(Debug, PartialEq, Eq, Hash, Clone)] pub struct ContextReference { pub primary_level: i32, pub secondary_level: i32, pub tertiary_level: Option, } -pub struct ContextLayer { - is_finished: bool, - result: Option>, -} - #[derive(Debug)] pub struct Context { + current_context_level: ContextReference, /// A stack of environments: layer 0 is the outermost. layers: HashMap>, } @@ -27,10 +22,78 @@ impl Context { /// Create a new, empty context. pub fn new() -> Self { Context { + current_context_level: ContextReference { + primary_level: 0, + secondary_level: 0, + tertiary_level: None, + }, layers: HashMap::new(), } } + pub fn write_to_context( + &mut self, + reference: ContextReference, + result: Result, + ) { + self.layers.insert(reference, result); + } + + pub fn write_to_current_context(&mut self, result: Result) { + self.write_to_context(self.current_context_level.clone(), result); + } + + pub fn set_current_context( + &mut self, + primary_level: i32, + seconday_level: i32, + tertiary_level: Option, + ) { + self.current_context_level.primary_level = primary_level; + self.current_context_level.secondary_level = seconday_level; + self.current_context_level.tertiary_level = tertiary_level; + } + + pub fn increment_first_level(&mut self) { + self.current_context_level.primary_level += 1; + self.current_context_level.secondary_level = 0; + self.current_context_level.tertiary_level = None + } + + pub fn increment_second_level(&mut self) { + self.current_context_level.secondary_level += 1; + self.current_context_level.tertiary_level = None + } + + pub fn increment_third_level(&mut self) { + match self.current_context_level.tertiary_level { + Some(v) => { + self.current_context_level.tertiary_level = Some(v + 1); + } + None => self.current_context_level.tertiary_level = Some(0), + }; + } + + // Looks up the current Context + pub fn get_current_context(&self) -> Option<&Result> { + for (context, value) in self.layers.iter() { + if context.primary_level != self.current_context_level.primary_level { + continue; + } + + if context.secondary_level != self.current_context_level.secondary_level { + continue; + } + + if context.tertiary_level != self.current_context_level.tertiary_level { + continue; + } + + return Some(value); + } + None + } + /// Look up a name, searching from innermost outward. pub fn get(&self, reference: &ReferenceValue) -> Option<&Result> { for (context, value) in self.layers.iter() { From 71291e9a27cc4988b6330cce225834eb152ed4ca Mon Sep 17 00:00:00 2001 From: Raphael Date: Wed, 14 May 2025 16:22:43 +0200 Subject: [PATCH 06/17] feat: implemented context switching --- src/context/mod.rs | 105 ++++++++++++++++++++++++++++++--------------- src/error/mod.rs | 2 +- 2 files changed, 72 insertions(+), 35 deletions(-) diff --git a/src/context/mod.rs b/src/context/mod.rs index b9faf4b..21c9554 100644 --- a/src/context/mod.rs +++ b/src/context/mod.rs @@ -1,21 +1,45 @@ -/// A simple context that holds variable bindings in nested layers. -use std::collections::HashMap; +use crate::error::RuntimeError; +use std::{ + collections::{HashMap, VecDeque}, + ops::Index, +}; use tucana::shared::{ReferenceValue, Value}; -use crate::error::RuntimeError; +type NodeResult = Option>; + +enum ContextResult { + // Will return the value / error if present of an executed node + NodeResult(NodeResult), + + // Will return the parameter of the node (indexed by the context) + ParameterResult(Value), +} + +#[derive(Default, Clone)] +pub struct ContextEntry { + was_executed: bool, + result: NodeResult, + parameter: Vec, +} #[derive(Debug, PartialEq, Eq, Hash, Clone)] pub struct ContextReference { + // Level referencing the context depth (if a node will execute nodes in itself, e.g. foreach, map...) pub primary_level: i32, + + // Level of depth in the current context level (node after node starting_node -> next_node --> next_node --> ending_node) pub secondary_level: i32, + + // Index of parameters as input parameter of a node pub tertiary_level: Option, } -#[derive(Debug)] pub struct Context { current_context_level: ContextReference, /// A stack of environments: layer 0 is the outermost. - layers: HashMap>, + layers: HashMap, + /// Context Snapshot of Past Context + context_history: VecDeque<(i32, i32)>, } impl Context { @@ -28,19 +52,16 @@ impl Context { tertiary_level: None, }, layers: HashMap::new(), + context_history: VecDeque::new(), } } - pub fn write_to_context( - &mut self, - reference: ContextReference, - result: Result, - ) { - self.layers.insert(reference, result); + pub fn write_to_context(&mut self, reference: ContextReference, entry: ContextEntry) { + self.layers.insert(reference, entry); } - pub fn write_to_current_context(&mut self, result: Result) { - self.write_to_context(self.current_context_level.clone(), result); + pub fn write_to_current_context(&mut self, entry: ContextEntry) { + self.write_to_context(self.current_context_level.clone(), entry); } pub fn set_current_context( @@ -54,28 +75,36 @@ impl Context { self.current_context_level.tertiary_level = tertiary_level; } - pub fn increment_first_level(&mut self) { + /// Will indent the context and save the past context + pub fn next_context(&mut self) { + let context_snapshot = ( + self.current_context_level.primary_level, + self.current_context_level.secondary_level, + ); + + self.context_history.push_back(context_snapshot); + self.current_context_level.primary_level += 1; self.current_context_level.secondary_level = 0; - self.current_context_level.tertiary_level = None } - pub fn increment_second_level(&mut self) { - self.current_context_level.secondary_level += 1; - self.current_context_level.tertiary_level = None + /// Will return to the parent context and increment the seconday level + pub fn leave_context(&mut self) { + let last_snapshot = match self.context_history.pop_back() { + Some(pair) => pair, + None => return, + }; + + self.current_context_level.primary_level = last_snapshot.0; + self.current_context_level.secondary_level = last_snapshot.1 + 1; } - pub fn increment_third_level(&mut self) { - match self.current_context_level.tertiary_level { - Some(v) => { - self.current_context_level.tertiary_level = Some(v + 1); - } - None => self.current_context_level.tertiary_level = Some(0), - }; + pub fn next_node(&mut self) { + self.current_context_level.secondary_level += 1; } // Looks up the current Context - pub fn get_current_context(&self) -> Option<&Result> { + pub fn get_current_context(&self) -> Option { for (context, value) in self.layers.iter() { if context.primary_level != self.current_context_level.primary_level { continue; @@ -85,17 +114,21 @@ impl Context { continue; } - if context.tertiary_level != self.current_context_level.tertiary_level { - continue; + if let Some(index) = self.current_context_level.tertiary_level { + let params = &value.parameter; + + let real_index = index as usize; + let value = params.index(real_index); + return Some(ContextResult::ParameterResult(value.clone())); } - return Some(value); + return Some(ContextResult::NodeResult(value.result.clone())); } None } - /// Look up a name, searching from innermost outward. - pub fn get(&self, reference: &ReferenceValue) -> Option<&Result> { + /// Looks up the context of a reference + pub fn get(&self, reference: &ReferenceValue) -> Option { for (context, value) in self.layers.iter() { if context.primary_level != reference.primary_level { continue; @@ -105,11 +138,15 @@ impl Context { continue; } - if context.tertiary_level != reference.tertiary_level { - continue; + if let Some(index) = reference.tertiary_level { + let params = &value.parameter; + + let real_index = index as usize; + let value = params.index(real_index); + return Some(ContextResult::ParameterResult(value.clone())); } - return Some(value); + return Some(ContextResult::NodeResult(value.result.clone())); } None } diff --git a/src/error/mod.rs b/src/error/mod.rs index 5148886..8c5936f 100644 --- a/src/error/mod.rs +++ b/src/error/mod.rs @@ -3,7 +3,7 @@ use std::{ fmt::{Display, Formatter}, }; -#[derive(Debug, Default)] +#[derive(Debug, Default, Clone)] pub struct RuntimeError {} impl Error for RuntimeError {} From d3db1331c8f9a845989ac6f9bb2cf9c376794183 Mon Sep 17 00:00:00 2001 From: Raphael Date: Wed, 14 May 2025 16:56:52 +0200 Subject: [PATCH 07/17] feat: implemented context swtiches on execution --- src/context/mod.rs | 28 +++++++++++++------ src/main.rs | 69 +++++++++++++++++++++++++++++++--------------- 2 files changed, 67 insertions(+), 30 deletions(-) diff --git a/src/context/mod.rs b/src/context/mod.rs index 21c9554..e858586 100644 --- a/src/context/mod.rs +++ b/src/context/mod.rs @@ -5,23 +5,31 @@ use std::{ }; use tucana::shared::{ReferenceValue, Value}; -type NodeResult = Option>; +type NodeResult = Result; -enum ContextResult { +pub enum ContextResult { // Will return the value / error if present of an executed node - NodeResult(NodeResult), + NodeExecutionResult(NodeResult), // Will return the parameter of the node (indexed by the context) ParameterResult(Value), } -#[derive(Default, Clone)] +#[derive(Clone)] pub struct ContextEntry { - was_executed: bool, - result: NodeResult, + result: Result, parameter: Vec, } +impl ContextEntry { + pub fn new(result: NodeResult, parameter: Vec) -> Self { + ContextEntry { + result: result, + parameter: parameter, + } + } +} + #[derive(Debug, PartialEq, Eq, Hash, Clone)] pub struct ContextReference { // Level referencing the context depth (if a node will execute nodes in itself, e.g. foreach, map...) @@ -122,7 +130,7 @@ impl Context { return Some(ContextResult::ParameterResult(value.clone())); } - return Some(ContextResult::NodeResult(value.result.clone())); + return Some(ContextResult::NodeExecutionResult(value.result.clone())); } None } @@ -146,8 +154,12 @@ impl Context { return Some(ContextResult::ParameterResult(value.clone())); } - return Some(ContextResult::NodeResult(value.result.clone())); + return Some(ContextResult::NodeExecutionResult(value.result.clone())); } None } + + pub fn is_end(&self) -> bool { + self.current_context_level.primary_level == 0 + } } diff --git a/src/main.rs b/src/main.rs index d1334f7..d870a8a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -7,7 +7,7 @@ pub mod registry; use std::sync::Arc; use code0_flow::flow_queue::service::{Message, RabbitmqClient}; -use context::Context; +use context::{Context, ContextEntry, ContextResult}; use error::RuntimeError; use futures_lite::StreamExt; use lapin::{options::BasicConsumeOptions, types::FieldTable}; @@ -48,25 +48,38 @@ fn handle_node_function( } }; + // A reference is present. Look up the real value match context_result { - Ok(v) => { - parameter_collection.push(v.clone()); - } - Err(_) => { - todo!( - "Reqired function that holds the paramter failed in execution" - ) + // The reference is a exeuction result of a node + ContextResult::NodeExecutionResult(node_result) => match node_result { + Ok(value) => { + parameter_collection.push(value.clone()); + } + Err(err) => return Err(err), + }, + // The reference is a parameter of a node + ContextResult::ParameterResult(parameter_result) => { + parameter_collection.push(parameter_result.clone()); } } } // Its another function, that result is a direct parameter to this function tucana::shared::node_parameter::Value::FunctionValue(another_node_function) => { + // As this is another new indent, a new context will be opened + context.next_context(); let function_result = handle_node_function(another_node_function, &store, context); + let entry = ContextEntry::new( + function_result.clone(), + parameter_collection.clone(), + ); + context.write_to_current_context(entry); + match function_result { Ok(v) => { + // Add the value back to the main parameter parameter_collection.push(v.clone()); } Err(_) => { @@ -82,23 +95,36 @@ fn handle_node_function( let result = runtime_function(¶meter_collection, context); - if let Some(ref next_node) = function.next_node { - let next: NodeFunction = (**next_node).clone(); - let _ = handle_node_function(next, store, context); - todo!() - }; + // Result will be added to the current context + let entry = ContextEntry::new(result.clone(), parameter_collection.clone()); + context.write_to_current_context(entry); + + // Check if there is a next node, if not then this was the last one + match function.next_node { + Some(ref next_node_function) => { + let next = (**next_node_function).clone(); - return result; + // Increment the context node! + context.next_node(); + + return handle_node_function(next, store, context); + } + None => { + if context.is_end() { + return result; + } + + context.leave_context(); + } + } }; Err(RuntimeError::default()) } -fn handle_message( - message: Message, - store: &FunctionStore, - context: &mut Context, -) -> Result { +fn handle_message(message: Message, store: &FunctionStore) -> Result { + let mut context = Context::new(); + let flow: Flow = match serde_json::from_str(&message.body) { Ok(flow) => flow, Err(_) => { @@ -107,7 +133,7 @@ fn handle_message( }; if let Some(node) = flow.starting_node { - match handle_node_function(node, store, context) { + match handle_node_function(node, store, &mut context) { Ok(result) => match serde_json::to_string(&result) { Ok(res) => { return Ok(Message { @@ -147,7 +173,6 @@ fn handle_message( async fn main() { let _locale = Locale::default(); let store = FunctionStore::new(); - let mut context = Context::new(); let rabbitmq_client = Arc::new(RabbitmqClient::new("amqp://localhost:5672").await); @@ -200,7 +225,7 @@ async fn main() { } }; - let message = match handle_message(inc_message, &store, &mut context) { + let message = match handle_message(inc_message, &store) { Ok(mess) => mess, Err(err) => { log::error!("Error handling message: {}", err); From 0767f22d8a066a05d5d5570b7b216d38b661f4a9 Mon Sep 17 00:00:00 2001 From: Raphael Date: Fri, 23 May 2025 22:14:49 +0200 Subject: [PATCH 08/17] feat: added all missing array definitions --- .gitignore | 4 +- definitions/data_types/array.md | 7 +- definitions/data_types/node.md | 100 ++- definitions/functions/array/array-audit.md | 12 + definitions/functions/array/array.md | 678 ++++++++++++++++++- definitions/functions/object/object-audit.md | 0 definitions/functions/object/object.md | 27 + 7 files changed, 764 insertions(+), 64 deletions(-) create mode 100644 definitions/functions/array/array-audit.md create mode 100644 definitions/functions/object/object-audit.md create mode 100644 definitions/functions/object/object.md diff --git a/.gitignore b/.gitignore index 5bd05d6..8f58a06 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ target -.idea \ No newline at end of file +.idea + +.DS_Store diff --git a/definitions/data_types/array.md b/definitions/data_types/array.md index a64af33..4ef0814 100644 --- a/definitions/data_types/array.md +++ b/definitions/data_types/array.md @@ -14,14 +14,17 @@ "rules": [ { "contains_type": { - "data_type_identifier": "GENERIC" + "data_type_identifier": { + "generic_key": "T" + } } } ], + "generic_keys": ["T"], "parent_type_identifier": null } - ``` + ## NUMBER_ARRAY ```json diff --git a/definitions/data_types/node.md b/definitions/data_types/node.md index 3da1d87..eeb19be 100644 --- a/definitions/data_types/node.md +++ b/definitions/data_types/node.md @@ -1,52 +1,104 @@ -## Input Node - ```json { + "identifier": "PREDICATE", "variant": "NODE", - "identifier": "FILTER_GENERIC_INPUT_NODE", - "name": [ - { - "code": "en-US", - "content": "Input" - } - ], "rules": [ { - "input_type": { - "identifier": "GENERIC" + "return_type": { + "data_type_identifier": "BOOLEAN" } }, { - "return_type": { - "identifier": "BOOLEAN" - } + "input_type": [ + { + "data_type_identifier": { + "generic_key": "T" + }, + "input_identifier": "predicate" + } + ] } - ] + ], + "generic_keys": ["T"] } ``` -## Input Node ```json { + "identifier": "CONSUMER", "variant": "NODE", - "identifier": "MAP_GENERIC_INPUT_NODE", - "name": [ + "rules": [ { - "code": "en-US", - "content": "Input" + "input_type": [ + { + "data_type_identifier": { + "generic_key": "T" + }, + "input_identifier": "consumer" + } + ] } ], + "generic_keys": ["T"] +} +``` + +```json +{ + "identifier": "TRANSFORM", + "variant": "NODE", "rules": [ { - "input_type": { - "identifier": "A_GENERIC" + "return_type": { + "data_type_identifier": { + "generic_key": "R" + } } }, + { + "input_type": [ + { + "data_type_identifier": { + "generic_key": "I" + }, + "input_identifier": "transform" + } + ] + } + ], + "generic_keys": ["I", "R"] +} +``` + +```json +{ + "identifier": "COMPARITOR", + "variant": "NODE", + "rules": [ { "return_type": { - "identifier": "B_GENERIC" + "data_type_identifier": { + "data_type_identifier": "NUMBER" + } } + }, + { + "input_type": [ + { + "data_type_identifier": { + "generic_key": "I" + }, + "input_identifier": "left" + }, + { + "data_type_identifier": { + "generic_key": "I" + }, + "input_identifier": "right" + } + ] } - ] + ], + "generic_keys": ["I"] } ``` diff --git a/definitions/functions/array/array-audit.md b/definitions/functions/array/array-audit.md new file mode 100644 index 0000000..a218ca4 --- /dev/null +++ b/definitions/functions/array/array-audit.md @@ -0,0 +1,12 @@ +23.05.2025 + +Added +- find last + +Removed +- sortASC +- clear (Doesnt make sense because taurus works with immutable variables) +- replace (Doesnt make sense because taurus works with immutable variables) + +Renamed: +- sortDEC --> sortReverse diff --git a/definitions/functions/array/array.md b/definitions/functions/array/array.md index 355b1be..cc37951 100644 --- a/definitions/functions/array/array.md +++ b/definitions/functions/array/array.md @@ -5,37 +5,76 @@ Will return the value at the index of the array. { "runtime_name": "std::array::at", "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "data_type_identifier": "ARRAY" + }, + "runtime_name": "array" + }, { "data_type_identifier": "NUMBER", "runtime_name": "index" } ], - "return_type_identifier": "GENERIC" + "return_type_identifier": { + "generic_key": "R" + }, + "generic_keys": ["R"], + "generic_mapper": [ + { + "parameter_id": "array", + "soruce": "R", + "target": "T" + } + ] } ``` ## concat -Will merge to arrays together and return a new one +Will merge to arrays together and return a new one. ```json { "runtime_name": "std::array::concat", "runtime_parameter_definitions": [ { - "data_type_identifier": "ARRAY", + "data_type_identifier": { + "data_type_identifier": "ARRAY" + }, "runtime_name": "first" }, { - "data_type_identifier": "ARRAY", + "data_type_identifier": { + "data_type_identifier": "ARRAY" + }, "runtime_name": "second" } ], - "return_type_identifier": "ARRAY" + "data_type_identifier": { + "data_type_identifier": "ARRAY" + }, + "generic_keys": ["R"], + "generic_mappers": [ + { + "parameter_id": "first", + "soruce": "R", + "target": "T" + }, + { + "parameter_id": "second", + "soruce": "R", + "target": "T" + }, + { + "soruce": "R", + "target": "T" + } + ] } ``` ## filter -Will filter the function by the given function +Will filter the array by the given node and return all values, the filter node returned true. ```json { @@ -46,68 +85,294 @@ Will filter the function by the given function "runtime_name": "array" }, { - "data_type_identifier": "FILTER_INPUT_GENERIC_NODE", - "runtime_name": "fitler" + "data_type_identifier": "PREDICATE", + "runtime_name": "predicate" } ], - "return_type_identifier": "ARRAY" + "return_type_identifier": "ARRAY", + "generic_keys": ["R"], + "generic_mappers": [ + { + "parameter_id": "array", + "source": "R", + "target": "T" + }, + { + "parameter_id": "predicate", + "source": "R", + "target": "T" + }, + { + "source": "R", + "target": "T" + } + ] } ``` ## find -idk how to do functions +Will return the first item of an array that match the predicate. -some node with a boolean as return type??? +```json +{ + "runtime_name": "std::array::find", + "runtime_parameter_definitions": [ + { + "data_type_identifier": "ARRAY", + "runtime_name": "array" + }, + { + "data_type_identifier": "PREDICATE", + "runtime_name": "predicate" + } + ], + "generic_keys": ["R"], + "return_type_identifier": { + "generic_key": "R" + }, + "generic_mappers": [ + { + "parameter_id": "array", + "source": "R", + "target": "T" + }, + { + "parameter_id": "predicate", + "source": "R", + "target": "T" + }, + ] +} +``` + +## findLast +Will return the last item of an array that match the predicate. + +```json +{ + "runtime_name": "std::array::find_last", + "runtime_parameter_definitions": [ + { + "data_type_identifier": "ARRAY", + "runtime_name": "array" + }, + { + "data_type_identifier": "PREDICATE", + "runtime_name": "predicate" + } + ], + "generic_keys": ["R"], + "return_type_identifier": { + "generic_key": "R" + }, + "generic_mappers": [ + { + "parameter_id": "array", + "source": "R", + "target": "T" + }, + { + "parameter_id": "predicate", + "source": "R", + "target": "T" + }, + ] +} +``` ## findIndex -idk how to do functions +Will return the index of the first item that matches the predicate. -some node with a boolean as return type??? +```json +{ + "runtime_name": "std::array::find_index", + "runtime_parameter_definitions": [ + { + "data_type_identifier": "ARRAY", + "runtime_name": "array" + }, + { + "data_type_identifier": "PREDICATE", + "runtime_name": "predicate" + } + ], + "generic_keys": ["R"], + "return_type_identifier": { + "data_type_identifier": "NUMBER" + }, + "generic_mappers": [ + { + "parameter_id": "array", + "source": "R", + "target": "T" + }, + { + "parameter_id": "predicate", + "source": "R", + "target": "T" + }, + ] +} +``` ## first -idk how to do functions +Will return the first item of the array. -some node with a boolean as return type??? +```json +{ + "runtime_name": "std::array::first", + "runtime_parameter_definitions": [ + { + "data_type_identifier": "ARRAY", + "runtime_name": "array" + { + ], + "return_type_identifier": { + "generic_key": "R" + }, + "generic_keys": ["R"], + "generic_mappers": [ + { + "soruce": "R", + "target": "T" + } + ] +} +``` ## last -idk how to do functions +Will return the last item of the array. -some node with a boolean as return type??? +```json +{ + "runtime_name": "std::array::last", + "runtime_parameter_definitions": [ + { + "data_type_identifier": "ARRAY", + "runtime_name": "array" + } + ], + "return_type_identifier": { + "generic_key": "R" + }, + "generic_keys": ["R"], + "generic_mappers": [ + { + "soruce": "R", + "target": "T" + } + ] +} +``` ## forEach -idk how to do functions +Will call a consumer on every item in the array. No return value. -some node with a boolean as return type??? +```json +{ + "runtime_name": "std::array::for_each", + "runtime_parameter_definitions": [ + { + "data_type_identifier": "ARRAY", + "runtime_name": "array" + }, + { + "data_type_identifier": "CONSUMER", + "runtime_name": "consumer" + } + ], + "generic_keys": ["R"], + "generic_mappers": [ + { + "parameter_id": "array", + "source": "R", + "target": "T" + }, + { + "parameter_id": "consumer", + "source": "R", + "target": "T" + }, + ] +} +``` ## map -idk how to do functions +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. -some node with a boolean as return type??? +```json +{ + "runtime_name": "std::array::map", + "runtime_parameter_definitions": [ + { + "data_type_identifier": "ARRAY", + "runtime_name": "array" + }, + { + "data_type_identifier": "TRANSFORM", + "runtime_name": "transform" + } + ], + "generic_keys": ["IN", "OUT"], + "return_type_identifier": "ARRAY", + "generic_mappers": [ + { + "parameter_id": "array", + "soruce": "IN", + "target": "T" + }, + { + "parameter_id": "transform", + "source": "IN", // <-- Same type as item of array + "target": "I" // <-- input type of transform node + }, + { + "parameter_id": "transform", + "soruce": "OUT", // <-- Return type of node + "target": "R" // <-- Return type of transform node + }, + { + "soruce": "OUT", + "target": "T" + } + ] +} +``` ## push -Will add the given entry to the array and returns the new length of the array +Will add the given item to the array and returns the new length of the array. ```json { - "runtime_name": "std::array::filter", + "runtime_name": "std::array::push", "runtime_parameter_definitions": [ { "data_type_identifier": "ARRAY", "runtime_name": "array" }, { - "data_type_identifier": "", - "runtime_name": "value" + "data_type_identifier": { + "generic_key": "I" + }, + "runtime_name": "item" } ], - "return_type_identifier": "NUMBER" + "return_type_identifier": "NUMBER", + "generic_keys": ["I"], + "generic_mapper": [ + { + "parameter_id": "array", + "source": "T", + "target": "I" + } + ] } ``` [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 it +Will remove the last entry of the array and return the item. ```json { @@ -118,44 +383,383 @@ Will remove the last entry of the array and return it "runtime_name": "array" } ], - "return_type_identifier": "GENERIC" + "generic_keys": ["R"], + "return_type_identifier": { + "generic_key": "R" + }, + "generic_mapper": [ + { + "parameter_id": "array", + "source": "R", + "target": "T" + } + ] } ``` [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": "ARRAY", + "runtime_name": "array" + }, + { + "data_type_identifier": { + "generic_key": "R" + }, + "runtime_name": "item" + } + ], + "generic_keys": ["R"], + "return_type_identifier": "ARRAY", + "generic_mapper": [ + { + "parameter_id": "array", + "source": "R", + "target": "T" + } + ] +} +``` ## 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": "ARRAY", + "runtime_name": "array" + } + ], + "return_type_identifier": "BOOLEAN", + "generic_keys": ["R"], + "generic_mappers": [ + { + "parameter_id": "array", + "source": "R", + "target": "T" + } + ] +} +``` ## size +Will return the amount of items inside the array. + +```json +{ + "runtime_name": "std::array::size", + "runtime_parameter_definitions": [ + { + "data_type_identifier": "ARRAY", + "runtime_name": "array" + } + ], + "return_type_identifier": "NUMBER", + "generic_keys": ["R"], + "generic_mappers": [ + { + "parameter_id": "array", + "source": "R", + "target": "T" + } + ] +} +``` ## indexOf +Will return the index of the given item. + +```json +{ + "runtime_name": "std::array::index_of", + "runtime_parameter_definitions": [ + { + "data_type_identifier": "ARRAY", + "runtime_name": "array" + }, + { + "data_type_identifier": { + "generic_key": "R" + }, + "runtime_name": "item" + } + ], + "generic_keys": ["R"], + "return_type_identifier": "NUMBER", + "generic_mapper": [ + { + "parameter_id": "array", + "source": "R", + "target": "T" + } + ] +} +``` ## toUnique +Will remove all duplicated items of the array. + +```json +{ + "runtime_name": "std::array::to_unique", + "runtime_parameter_definitions": [ + { + "data_type_identifier": "ARRAY", + "runtime_name": "array" + } + ], + "return_type_identifier": { + "data_type_identifier": "ARRAY" + }, + "generic_keys": ["R"], + "generic_mappers": [ + { + "parameter_id": "array", + "soruce": "R", + "target": "T" + }, + { + "soruce": "R", + "target": "T" + } + ] +} +``` ## sort +Will sort the array by the given COMPARATOR. + +```json +{ + "runtime_name": "std::array::sort", + "runtime_parameter_definitions": [ + { + "data_type_identifier": "ARRAY", + "runtime_name": "array" + } + { + "data_type_identifier": "COMPARATOR", + "runtime_name": "COMPARATOR" + } + ], + "return_type_identifier": "ARRAY", + "generic_keys": "R", + "generic_mappers": [ + { + "parameter_id": "array", + "source": "R", + "target": "T" + }, + { + "parameter_id": "COMPARATOR", + "source": "R", + "target": "I" + } + ] +} +``` -## sortASC +## sortReverse -## sortDESC +```json +{ + "runtime_name": "std::array::sort_reverse", + "runtime_parameter_definitions": [ + { + "data_type_identifier": "ARRAY", + "runtime_name": "array" + } + { + "data_type_identifier": "COMPARATOR", + "runtime_name": "comparator" + } + ], + "return_type_identifier": "ARRAY", + "generic_keys": "R", + "generic_mappers": [ + { + "parameter_id": "array", + "source": "R", + "target": "T" + }, + { + "parameter_id": "comparator", + "source": "R", + "target": "I" + } + ] +} +``` ## reverse +```json +{ + "runtime_name": "std::array::reverse", + "runtime_parameter_definitions": [ + { + "data_type_identifier": "ARRAY", + "runtime_name": "array" + } + ], + "return_type_identifier": "ARRAY", + "generic_keys": ["R"], + "generic_mappers": [ + { + "parameter_id": "array", + "source": "R", + "target": "T" + } + ] +} +``` + ## flat +Will turn a 2 dimensional array into a one dimensional array. -## clear +Input: +[ [1, 2, 3], [3, 4, 5] ] -## replace +Result: +[ 1, 2, 3, 3, 4, 5 ] -move to number_arry +```json +{ + "runtime_name": "std::array::flat", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "generic_type": { + "data_type_identifier": "ARRAY", + "generic_mapper": { + "data_type_identifier": "ARRAY", + "target": "T" + } + } + }, + "runtime_name": "array" + } + ], + "return_type_identifier": "ARRAY", + "generic_keys": ["R"], + "generic_mappers": [ + { + "parameter_id": "filter", + "target": "R", + "soruce": "T" + } + ] +} +``` +## min +Returns the smallest number in the array -min +```json +{ + "runtime_name": "std::array::min", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "generic_type": { + "data_type_identifier": "ARRAY", + "generic_mapper": { + "data_type_identifier": "NUMBER", + "target": "T" + } + } + }, + "runtime_name": "array" + } + ], + "return_type_identifier": "NUMBER" +} +``` -max +## max +Returns the largest number in the array -sum +```json +{ + "runtime_name": "std::array::max", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "generic_type": { + "data_type_identifier": "ARRAY", + "generic_mapper": { + "data_type_identifier": "NUMBER", + "target": "T" + } + } + }, + "runtime_name": "array" + } + ], + "return_type_identifier": "NUMBER" +} +``` + + +## sum +Returns the sum of all the numbers in the array + +```json +{ + "runtime_name": "std::array::sum", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "generic_type": { + "data_type_identifier": "ARRAY", + "generic_mapper": { + "data_type_identifier": "NUMBER", + "target": "T" + } + } + }, + "runtime_name": "array" + } + ], + "return_type_identifier": "NUMBER" +} +``` ## join -will join every entry by a given text +Will join every item by a given text + +```json +{ + "runtime_name": "std::array::filter", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "generic_type": { + "data_type_identifier": "ARRAY", + "generic_mapper": { + "data_type_identifier": "TEXT", + "target": "T" + } + } + }, + "runtime_name": "array" + }, + { + "data_type_identifier": "TEXT", + "runtime_name": "join_text" + } + ], + "return_type_identifier": "TEXT" +} +``` diff --git a/definitions/functions/object/object-audit.md b/definitions/functions/object/object-audit.md new file mode 100644 index 0000000..e69de29 diff --git a/definitions/functions/object/object.md b/definitions/functions/object/object.md new file mode 100644 index 0000000..ebffd48 --- /dev/null +++ b/definitions/functions/object/object.md @@ -0,0 +1,27 @@ +## at + +## concat + +## entries + +## any + +## remove + +## forEach + +## containsKey + +## containsValue + +## keys + +## values + +## size + +## filter + +## replace + +## put From de5e7289f14936b5f9f04bbd0534f662019ac735 Mon Sep 17 00:00:00 2001 From: Raphael Date: Sat, 24 May 2025 11:07:43 +0200 Subject: [PATCH 09/17] ref: renamed folder to match runtime_function --- definitions/functions/primitive/boolean.md | 118 ------- .../array/array-audit.md | 0 .../array/array.md | 0 .../object/object-audit.md | 0 .../object/object.md | 0 .../primitive/boolean-audit.md | 0 .../runtime_functions/primitive/boolean.md | 326 ++++++++++++++++++ .../primitive/number-audit.md | 0 .../primitive/number.md | 0 .../primitive/text-audit.md | 0 .../primitive/text.md | 0 11 files changed, 326 insertions(+), 118 deletions(-) delete mode 100644 definitions/functions/primitive/boolean.md rename definitions/{functions => runtime_functions}/array/array-audit.md (100%) rename definitions/{functions => runtime_functions}/array/array.md (100%) rename definitions/{functions => runtime_functions}/object/object-audit.md (100%) rename definitions/{functions => runtime_functions}/object/object.md (100%) rename definitions/{functions => runtime_functions}/primitive/boolean-audit.md (100%) create mode 100644 definitions/runtime_functions/primitive/boolean.md rename definitions/{functions => runtime_functions}/primitive/number-audit.md (100%) rename definitions/{functions => runtime_functions}/primitive/number.md (100%) rename definitions/{functions => runtime_functions}/primitive/text-audit.md (100%) rename definitions/{functions => runtime_functions}/primitive/text.md (100%) diff --git a/definitions/functions/primitive/boolean.md b/definitions/functions/primitive/boolean.md deleted file mode 100644 index 5cbb25f..0000000 --- a/definitions/functions/primitive/boolean.md +++ /dev/null @@ -1,118 +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": "BOOLEAN", - "runtime_name": "value" - } - ], - "return_type_identifier": "NUMBER" -} -``` - -**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": "BOOLEAN", - "runtime_name": "value" - } - ], - "return_type_identifier": "TEXT" -} -``` - -**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": "NUMBER", - "runtime_name": "value" - } - ], - "return_type_identifier": "BOOLEAN" -} -``` - -**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": "TEXT", - "runtime_name": "value" - } - ], - "return_type_identifier": "BOOLEAN" -} -``` - -**Example**: - -"false" --> false - -"true" --> true - - -## isEqual -Will compare one boolean to another. - -```json -{ - "runtime_name": "std::boolean::isEqual", - "runtime_parameter_definitions": [ - { - "data_type_identifier": "BOOLEAN", - "runtime_name": "first" - }, - { - "data_type_identifier": "BOOLEAN", - "runtime_name": "second" - } - ], - "return_type_identifier": "BOOLEAN" -} -``` - -**Example**: - -false, false --> true - -true, false --> false diff --git a/definitions/functions/array/array-audit.md b/definitions/runtime_functions/array/array-audit.md similarity index 100% rename from definitions/functions/array/array-audit.md rename to definitions/runtime_functions/array/array-audit.md diff --git a/definitions/functions/array/array.md b/definitions/runtime_functions/array/array.md similarity index 100% rename from definitions/functions/array/array.md rename to definitions/runtime_functions/array/array.md diff --git a/definitions/functions/object/object-audit.md b/definitions/runtime_functions/object/object-audit.md similarity index 100% rename from definitions/functions/object/object-audit.md rename to definitions/runtime_functions/object/object-audit.md diff --git a/definitions/functions/object/object.md b/definitions/runtime_functions/object/object.md similarity index 100% rename from definitions/functions/object/object.md rename to definitions/runtime_functions/object/object.md diff --git a/definitions/functions/primitive/boolean-audit.md b/definitions/runtime_functions/primitive/boolean-audit.md similarity index 100% rename from definitions/functions/primitive/boolean-audit.md rename to definitions/runtime_functions/primitive/boolean-audit.md diff --git a/definitions/runtime_functions/primitive/boolean.md b/definitions/runtime_functions/primitive/boolean.md new file mode 100644 index 0000000..360833d --- /dev/null +++ b/definitions/runtime_functions/primitive/boolean.md @@ -0,0 +1,326 @@ +# 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": "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": "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": [], + "error_type_identifiers": [] +} +``` + +**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": "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": "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": [], + "error_type_identifiers": [] +} +``` + +**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": "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": "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": [], + "error_type_identifiers": [] +} +``` + +**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": "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": "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": [], + "error_type_identifiers": [] +} +``` + +**Example**: + +"false" --> false + +"true" --> true + + +## isEqual +Will compare one boolean to another. + +```json +{ + "runtime_name": "std::boolean::isEqual", + "runtime_parameter_definitions": [ + { + "data_type_identifier": "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": "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": "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": [], + "error_type_identifiers": [] +} +``` + +**Example**: + +false, false --> true + +true, false --> false diff --git a/definitions/functions/primitive/number-audit.md b/definitions/runtime_functions/primitive/number-audit.md similarity index 100% rename from definitions/functions/primitive/number-audit.md rename to definitions/runtime_functions/primitive/number-audit.md diff --git a/definitions/functions/primitive/number.md b/definitions/runtime_functions/primitive/number.md similarity index 100% rename from definitions/functions/primitive/number.md rename to definitions/runtime_functions/primitive/number.md diff --git a/definitions/functions/primitive/text-audit.md b/definitions/runtime_functions/primitive/text-audit.md similarity index 100% rename from definitions/functions/primitive/text-audit.md rename to definitions/runtime_functions/primitive/text-audit.md diff --git a/definitions/functions/primitive/text.md b/definitions/runtime_functions/primitive/text.md similarity index 100% rename from definitions/functions/primitive/text.md rename to definitions/runtime_functions/primitive/text.md From e2b0e8e28cef585555f5e3e0918b241a9c3c1487 Mon Sep 17 00:00:00 2001 From: Raphael Date: Sun, 25 May 2025 14:26:08 +0200 Subject: [PATCH 10/17] feat: started to work on code generation from json doucmentation --- build.rs | 228 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 228 insertions(+) create mode 100644 build.rs diff --git a/build.rs b/build.rs new file mode 100644 index 0000000..feff6ed --- /dev/null +++ b/build.rs @@ -0,0 +1,228 @@ +use proc_macro2::TokenStream; +use quote::{quote, ToTokens}; +use std::fs::{read_to_string, File}; +use std::io::Write; +use std::process::Command; +use tucana::shared::value::Kind; + +use tucana::shared::{RuntimeFunctionDefinition, RuntimeParameterDefinition, Translation, Value}; + +macro_rules! print_on_build { + ($($tokens: tt)*) => { + println!("cargo::warning={}", format!($($tokens)*)) + } +} + +/// Given an actual `Value`, emit the tokens to *reconstruct* it in code. +pub fn value_to_tokens(value: Value) -> TokenStream { + todo!("correct struct imports & strings"); + match &value.kind { + Some(Kind::BoolValue(b)) => { + quote! { + Value { + kind: Some(Kind::BoolValue(#b)) + } + } + } + Some(Kind::NumberValue(n)) => { + quote! { + Value { + kind: Some(Kind::NumberValue(#n)) + } + } + } + Some(Kind::StringValue(s)) => { + quote! { + Value { kind: Some(Kind::StringValue(#s.to_string())) } + } + } + Some(Kind::StructValue(str)) => { + let list_item_tokens: Vec = str + .fields + .iter() + .map(|(k, v)| { + let v_ts = value_to_tokens(v.clone()); + quote! { + (#k.to_string(), #v_ts) + } + }) + .collect(); + + quote! { + Value { + kind: Some(ValueKind::ListValue(Struct { + fields: { + ::std::collections::HashMap::from_iter(vec![ #(#list_item_tokens),* ]) + } + })) + } + } + } + Some(Kind::ListValue(lv)) => { + // embed each item of the real list + let item_tokens: Vec<_> = lv + .values + .iter() + .map(|f| value_to_tokens(f.clone())) + .collect(); + quote! { + Value { + kind: Some(ValueKind::ListValue(vec![ + #(#item_tokens),* + ])) + } + } + } + Some(Kind::NullValue(_)) | None => { + quote! { + Value { kind: Some(ValueKind::NullValue(NullValue::NullValue as i32)) } + } + } + } +} + +fn translation_to_token(translations: Vec) -> Vec { + let mut result: Vec = Vec::new(); + + for trans in translations { + let code = trans.code; + let content = trans.content; + + let token = quote! { + tucana::shared::Translation { + code: String::from(#code), + content: String::from(#content), + } + }; + + result.push(token); + } + result +} + +fn runtime_function_parameter_to_token( + paramter: Vec, +) -> Vec { + let mut result: Vec = Vec::new(); + + for param in paramter { + let runtime_name = param.runtime_name; + let data_type_identifier = param.data_type_identifier; + let default_value = match param.default_value { + Some(value) => value_to_tokens(value), + None => quote! { None }, + }; + let name = translation_to_token(param.name); + let description = translation_to_token(param.description); + let documentation = translation_to_token(param.documentation); + + let quote = quote! { + tucana::shared::RuntimeParameterDefinition { + runtime_name: String::from(#runtime_name), + data_type_identifier: String::from(#data_type_identifier), + default_value: #default_value, + name: vec![#(#name),*], + description: vec![#(#description),*], + documentation: vec![#(#documentation),*] + } + }; + + result.push(quote); + } + result +} + +fn runtime_function_definition_to_token(definition: RuntimeFunctionDefinition) -> TokenStream { + let runtime_name = definition.runtime_name; + let runtime_parameter_definitions = + runtime_function_parameter_to_token(definition.runtime_parameter_definitions); + + let return_type_identifier = definition.return_type_identifier.into_token_stream(); + + let error_type_identifiers = definition + .error_type_identifiers + .into_iter() + .map(|f| { + quote! { + #f + } + }) + .into_iter() + .collect::>(); + + let name = translation_to_token(definition.name); + let description = translation_to_token(definition.description); + let documentation = translation_to_token(definition.documentation); + let deprecation_message = translation_to_token(definition.deprecation_message); + + quote! { + tucana::shared::RuntimeFunctionDefinition { + runtime_name: String::from(#runtime_name), + runtime_parameter_definitions: vec![#(#runtime_parameter_definitions),*], + return_type_identifier: Option::Some(String::from(#return_type_identifier)), + error_type_identifiers: vec![#(#error_type_identifiers),*], + name: vec![#(#name),*], + description: vec![#(#description),*], + documentation: vec![#(#documentation),*], + deprecation_message: vec![#(#deprecation_message),*], + } + } +} +fn main() { + let mut file = File::create("./out/output.rs").expect("msg"); + + let path = "./definitions/runtime_functions/primitive/boolean.md"; + let file_content = read_to_string(path).unwrap(); + let mut lines = file_content.split("\n"); + let mut inside_code_block = false; + let mut code_blocks: Vec = Vec::new(); + let mut current_code_block: String = String::from(""); + + while let Some(line) = lines.next() { + if line.contains("```") { + if inside_code_block { + code_blocks.push(current_code_block.clone()); + } else { + current_code_block = String::from("") + } + + inside_code_block = !inside_code_block; + } + + if inside_code_block { + if line.starts_with("```") { + continue; + } + + current_code_block.push_str(line); + } + } + + let results = code_blocks + .iter() + .map(|f| serde_json::from_str::(f)); + write!( + file, + "pub mod output {{ fn getDefinitions() -> Vec {{ vec![" + ) + .expect("Cannot write to file"); + + for res in results { + match res { + Ok(def) => { + let quote = runtime_function_definition_to_token(def); + write!(file, "{},", quote).expect("Cannot write to file"); + } + Err(err) => { + print_on_build!("Error parsing JSON: {}", err); + } + } + } + + write!(file, "] }} }}").expect("Cannot write to file"); + + Command::new("rustfmt") + .arg("out/output.rs") + .arg("--edition") + .arg("2024"); +} From 7b4a6d4241b6b7c1e80464fe09a2e36e4db2fb45 Mon Sep 17 00:00:00 2001 From: Raphael Date: Sun, 25 May 2025 14:26:26 +0200 Subject: [PATCH 11/17] depdendencies: added build configuration --- Cargo.lock | 2 ++ Cargo.toml | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index 6af292f..bf1e57c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2283,6 +2283,8 @@ dependencies = [ "futures-lite 2.6.0", "lapin", "log", + "proc-macro2", + "quote", "serde", "serde_json", "tempfile", diff --git a/Cargo.toml b/Cargo.toml index 7b77201..694741a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,3 +16,10 @@ futures-lite = "2.6.0" [dev-dependencies] tempfile = "3.19.1" + +[build-dependencies] +serde = "1.0.219" +serde_json = "1.0.140" +tucana = { version = "0.0.24" } +quote = "1.0" +proc-macro2 = "1.0" From 826f72a215ff5e7c2fec5c8739cf316d89364c5e Mon Sep 17 00:00:00 2001 From: Raphael Date: Sun, 25 May 2025 14:26:37 +0200 Subject: [PATCH 12/17] ref: formatting the project --- src/implementation/mod.rs | 171 ++++++++++++++++++++++---------------- src/locale/locale.rs | 4 +- src/main.rs | 4 +- 3 files changed, 105 insertions(+), 74 deletions(-) diff --git a/src/implementation/mod.rs b/src/implementation/mod.rs index 7973624..ccf41ce 100644 --- a/src/implementation/mod.rs +++ b/src/implementation/mod.rs @@ -1,4 +1,4 @@ -use tucana::shared::{value::Kind, Value}; +use tucana::shared::{Value, value::Kind}; use crate::{context::Context, error::RuntimeError, registry::HandlerFn}; @@ -20,13 +20,16 @@ pub fn collect() -> Vec<(&'static str, HandlerFn)> { } fn add(values: &[Value], _ctx: &mut Context) -> Result { - let [Value { - kind: Some(Kind::NumberValue(lhs)), - .. - }, Value { - kind: Some(Kind::NumberValue(rhs)), - .. - }] = values + let [ + Value { + kind: Some(Kind::NumberValue(lhs)), + .. + }, + Value { + kind: Some(Kind::NumberValue(rhs)), + .. + }, + ] = values else { return Err(RuntimeError::default()); }; @@ -37,13 +40,16 @@ fn add(values: &[Value], _ctx: &mut Context) -> Result { } fn multiply(values: &[Value], _ctx: &mut Context) -> Result { - let [Value { - kind: Some(Kind::NumberValue(lhs)), - .. - }, Value { - kind: Some(Kind::NumberValue(rhs)), - .. - }] = values + let [ + Value { + kind: Some(Kind::NumberValue(lhs)), + .. + }, + Value { + kind: Some(Kind::NumberValue(rhs)), + .. + }, + ] = values else { return Err(RuntimeError::default()); }; @@ -54,13 +60,16 @@ fn multiply(values: &[Value], _ctx: &mut Context) -> Result } fn substract(values: &[Value], _ctx: &mut Context) -> Result { - let [Value { - kind: Some(Kind::NumberValue(lhs)), - .. - }, Value { - kind: Some(Kind::NumberValue(rhs)), - .. - }] = values + let [ + Value { + kind: Some(Kind::NumberValue(lhs)), + .. + }, + Value { + kind: Some(Kind::NumberValue(rhs)), + .. + }, + ] = values else { return Err(RuntimeError::default()); }; @@ -71,13 +80,16 @@ fn substract(values: &[Value], _ctx: &mut Context) -> Result Result { - let [Value { - kind: Some(Kind::NumberValue(lhs)), - .. - }, Value { - kind: Some(Kind::NumberValue(rhs)), - .. - }] = values + let [ + Value { + kind: Some(Kind::NumberValue(lhs)), + .. + }, + Value { + kind: Some(Kind::NumberValue(rhs)), + .. + }, + ] = values else { return Err(RuntimeError::default()); }; @@ -88,13 +100,16 @@ fn devide(values: &[Value], _ctx: &mut Context) -> Result { } fn modulo(values: &[Value], _ctx: &mut Context) -> Result { - let [Value { - kind: Some(Kind::NumberValue(lhs)), - .. - }, Value { - kind: Some(Kind::NumberValue(rhs)), - .. - }] = values + let [ + Value { + kind: Some(Kind::NumberValue(lhs)), + .. + }, + Value { + kind: Some(Kind::NumberValue(rhs)), + .. + }, + ] = values else { return Err(RuntimeError::default()); }; @@ -105,10 +120,12 @@ fn modulo(values: &[Value], _ctx: &mut Context) -> Result { } fn abs(values: &[Value], _ctx: &mut Context) -> Result { - let [Value { - kind: Some(Kind::NumberValue(value)), - .. - }] = values + let [ + Value { + kind: Some(Kind::NumberValue(value)), + .. + }, + ] = values else { return Err(RuntimeError::default()); }; @@ -119,10 +136,12 @@ fn abs(values: &[Value], _ctx: &mut Context) -> Result { } fn is_positive(values: &[Value], _ctx: &mut Context) -> Result { - let [Value { - kind: Some(Kind::NumberValue(value)), - .. - }] = values + let [ + Value { + kind: Some(Kind::NumberValue(value)), + .. + }, + ] = values else { return Err(RuntimeError::default()); }; @@ -133,13 +152,16 @@ fn is_positive(values: &[Value], _ctx: &mut Context) -> Result Result { - let [Value { - kind: Some(Kind::NumberValue(lhs)), - .. - }, Value { - kind: Some(Kind::NumberValue(rhs)), - .. - }] = values + let [ + Value { + kind: Some(Kind::NumberValue(lhs)), + .. + }, + Value { + kind: Some(Kind::NumberValue(rhs)), + .. + }, + ] = values else { return Err(RuntimeError::default()); }; @@ -150,13 +172,16 @@ fn is_greater(values: &[Value], _ctx: &mut Context) -> Result Result { - let [Value { - kind: Some(Kind::NumberValue(lhs)), - .. - }, Value { - kind: Some(Kind::NumberValue(rhs)), - .. - }] = values + let [ + Value { + kind: Some(Kind::NumberValue(lhs)), + .. + }, + Value { + kind: Some(Kind::NumberValue(rhs)), + .. + }, + ] = values else { return Err(RuntimeError::default()); }; @@ -167,10 +192,12 @@ fn is_less(values: &[Value], _ctx: &mut Context) -> Result } fn is_zero(values: &[Value], _ctx: &mut Context) -> Result { - let [Value { - kind: Some(Kind::NumberValue(value)), - .. - }] = values + let [ + Value { + kind: Some(Kind::NumberValue(value)), + .. + }, + ] = values else { return Err(RuntimeError::default()); }; @@ -181,10 +208,12 @@ fn is_zero(values: &[Value], _ctx: &mut Context) -> Result } fn from_text(values: &[Value], _ctx: &mut Context) -> Result { - let [Value { - kind: Some(Kind::StringValue(string_value)), - .. - }] = values + let [ + Value { + kind: Some(Kind::StringValue(string_value)), + .. + }, + ] = values else { return Err(RuntimeError::default()); }; @@ -200,10 +229,12 @@ fn from_text(values: &[Value], _ctx: &mut Context) -> Result Result { - let [Value { - kind: Some(Kind::NumberValue(value)), - .. - }] = values + let [ + Value { + kind: Some(Kind::NumberValue(value)), + .. + }, + ] = values else { return Err(RuntimeError::default()); }; diff --git a/src/locale/locale.rs b/src/locale/locale.rs index 468ed41..ad3a6ee 100644 --- a/src/locale/locale.rs +++ b/src/locale/locale.rs @@ -1,12 +1,12 @@ use std::{ collections::HashMap, - fs::{self, read_dir, DirEntry}, + fs::{self, DirEntry, read_dir}, }; use serde::Deserialize; use tucana::shared::Translation; -use super::code::{code_from_file_name, CountryCode}; +use super::code::{CountryCode, code_from_file_name}; #[derive(Debug)] pub struct Locale { diff --git a/src/main.rs b/src/main.rs index d870a8a..3f06053 100644 --- a/src/main.rs +++ b/src/main.rs @@ -142,7 +142,7 @@ fn handle_message(message: Message, store: &FunctionStore) -> Result { todo!("") @@ -155,7 +155,7 @@ fn handle_message(message: Message, store: &FunctionStore) -> Result Date: Tue, 27 May 2025 18:33:04 +0200 Subject: [PATCH 13/17] feat: finished definitions --- definitions/data_types/array.md | 69 --------- definitions/data_types/node.md | 4 + .../runtime_functions/array/array-audit.md | 8 +- definitions/runtime_functions/array/array.md | 1 - .../runtime_functions/object/object-audit.md | 19 +++ .../runtime_functions/object/object.md | 131 +++++++++++++++--- .../runtime_functions/primitive/text.md | 54 +++++++- 7 files changed, 188 insertions(+), 98 deletions(-) diff --git a/definitions/data_types/array.md b/definitions/data_types/array.md index 4ef0814..bda5a65 100644 --- a/definitions/data_types/array.md +++ b/definitions/data_types/array.md @@ -24,72 +24,3 @@ "parent_type_identifier": null } ``` - -## NUMBER_ARRAY - -```json -{ - "variant": "ARRAY", - "identifier": "NUMBER_ARRAY", - "name": [ - { - "code": "en-US", - "content": "Number Array" - } - ], - "rules": [ - { - "contains_type": { - "data_type_identifier": "NUMBER" - } - } - ], - "parent_type_identifier": "ARRAY" -} -``` - -## TEXT_ARRAY - -```json -{ - "variant": "ARRAY", - "identifier": "TEXT_ARRAY", - "name": [ - { - "code": "en-US", - "content": "Text Array" - } - ], - "rules": [ - { - "contains_type": { - "data_type_identifier": "TEXT" - } - } - ], - "parent_type_identifier": "ARRAY" -} -``` - -## BOOLEAN_ARRAY - -```json -{ - "variant": "ARRAY", - "identifier": "BOOLEAN_ARRAY", - "name": [ - { - "code": "en-US", - "content": "Boolean Array" - } - ], - "rules": [ - { - "contains_type": { - "data_type_identifier": "BOOLEAN" - } - } - ], - "parent_type_identifier": "ARRAY" -} -``` diff --git a/definitions/data_types/node.md b/definitions/data_types/node.md index eeb19be..4deb65b 100644 --- a/definitions/data_types/node.md +++ b/definitions/data_types/node.md @@ -1,3 +1,4 @@ +## PREDICATE ```json { "identifier": "PREDICATE", @@ -23,6 +24,7 @@ } ``` +## CONSUMER ```json { "identifier": "CONSUMER", @@ -43,6 +45,7 @@ } ``` +## TRANSFORM ```json { "identifier": "TRANSFORM", @@ -70,6 +73,7 @@ } ``` +## COMPARITOR ```json { "identifier": "COMPARITOR", diff --git a/definitions/runtime_functions/array/array-audit.md b/definitions/runtime_functions/array/array-audit.md index a218ca4..201f448 100644 --- a/definitions/runtime_functions/array/array-audit.md +++ b/definitions/runtime_functions/array/array-audit.md @@ -1,12 +1,12 @@ -23.05.2025 +# 23.05.2025 -Added +## Added - find last -Removed +## Removed - sortASC - clear (Doesnt make sense because taurus works with immutable variables) - replace (Doesnt make sense because taurus works with immutable variables) -Renamed: +## Renamed: - sortDEC --> sortReverse diff --git a/definitions/runtime_functions/array/array.md b/definitions/runtime_functions/array/array.md index cc37951..baf6a7b 100644 --- a/definitions/runtime_functions/array/array.md +++ b/definitions/runtime_functions/array/array.md @@ -32,7 +32,6 @@ Will return the value at the index of the array. ## concat Will merge to arrays together and return a new one. - ```json { "runtime_name": "std::array::concat", diff --git a/definitions/runtime_functions/object/object-audit.md b/definitions/runtime_functions/object/object-audit.md index e69de29..29ea06e 100644 --- a/definitions/runtime_functions/object/object-audit.md +++ b/definitions/runtime_functions/object/object-audit.md @@ -0,0 +1,19 @@ +# 26.05.2024 - First Iteration + +## Removed: + - concat + - entries + - any + - forEach + - containsValue + - values + - flter + +# 27.05.2024 + +## Removed: + - at + - replace + +## Renamed: + - put -> set diff --git a/definitions/runtime_functions/object/object.md b/definitions/runtime_functions/object/object.md index ebffd48..5ab6880 100644 --- a/definitions/runtime_functions/object/object.md +++ b/definitions/runtime_functions/object/object.md @@ -1,27 +1,122 @@ -## at - -## concat - -## entries - -## any - ## remove - -## forEach +```json +{ + "runtime_name": "std::object::remove", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "data_type_identifier": "OBJECT" + }, + "runtime_name": "object" + }, + { + "data_type_identifier": "TEXT", + "runtime_name": "key" + } + ], + "return_type_identifier": { + "data_type_identifier": "OBJECT" + } +} +``` ## containsKey +```json +{ + "runtime_name": "std::object::contains_key", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "data_type_identifier": "OBJECT" + }, + "runtime_name": "object" + }, + { + "data_type_identifier": "TEXT", + "runtime_name": "key" + } + ], + "return_type_identifier": { + "data_type_identifier": "BOOLEAN" + } +} +``` -## containsValue ## keys - -## values +```json +{ + "runtime_name": "std::object::keys", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "data_type_identifier": "OBJECT" + }, + "runtime_name": "object" + } + ], + "return_type_identifier": { + "data_type_identifier": "ARRAY" + }, + "generic_mappers": [ + { + "source": "TEXT", + "target": "T" + } + ] +} +``` ## size +```json +{ + "runtime_name": "std::object::size", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "data_type_identifier": "OBJECT" + }, + "runtime_name": "object" + } + ], + "return_type_identifier": { + "data_type_identifier": "NUMBER" + } +} +``` -## filter - -## replace - -## put +## set +```json +{ + "runtime_name": "std::object::set", + "runtime_parameter_definitions": [ + { + "data_type_identifier": { + "data_type_identifier": "OBJECT" + }, + "runtime_name": "object" + }, + { + "data_type_identifier": "TEXT", + "runtime_name": "key" + }, + { + "data_type_identifier": { + "generic_key": "I" + }, + "runtime_name": "value" + } + ], + "return_type_identifier": { + "data_type_identifier": "OBJECT" + }, + "generic_keys": ["I"], + "generic_mappers": [ + { + "paramter_id": "value" + "source": "I", + "target": "I" + } + ] +} +``` diff --git a/definitions/runtime_functions/primitive/text.md b/definitions/runtime_functions/primitive/text.md index 345e03e..40d061d 100644 --- a/definitions/runtime_functions/primitive/text.md +++ b/definitions/runtime_functions/primitive/text.md @@ -12,7 +12,15 @@ Converts the text to a number array. "runtime_name": "value" } ], - "return_type_identifier": "NUMBER_ARRAY" + "return_type_identifier": { + "data_type_identifier": "ARRAY" + }, + "generic_mappers": [ + { + "source": "NUMBER", + "target": "T" + } + ] } ``` @@ -140,7 +148,16 @@ Splits the text into an array of characters. "runtime_name": "value" } ], - "return_type_identifier": "TEXT_ARRAY" + "return_type_identifier": { + "data_type_identifier": "ARRAY" + }, + "generic_keys": ["R"], + "generic_mappers": [ + { + "source": "TEXT", + "target": "R" + } + ] } ``` @@ -532,7 +549,16 @@ Splits the text into an array of strings based on a delimiter. "runtime_name": "delimiter" } ], - "return_type_identifier": "TEXT_ARRAY" + "return_type_identifier": { + "data_type_identifier": "ARRAY" + }, + "generic_keys": ["R"], + "generic_mappers": [ + { + "source": "TEXT", + "target": "R" + } + ] } ``` @@ -628,7 +654,16 @@ Converts each character to its ASCII code as an array of numbers. "runtime_name": "value" } ], - "return_type_identifier": "NUMBER_ARRAY" + "return_type_identifier": { + "data_type_identifier": "ARRAY" + }, + "generic_keys": ["R"], + "generic_mappers": [ + { + "source": "NUMBER", + "target": "R" + } + ] } ``` @@ -646,11 +681,18 @@ Converts an array of ASCII codes to a text string. "runtime_name": "std::text::from_ascii", "runtime_parameter_definitions": [ { - "data_type_identifier": "NUMBER_ARRAY", + "data_type_identifier": "ARRAY", "runtime_name": "value" } ], - "return_type_identifier": "TEXT" + "return_type_identifier": "TEXT", + "generic_mappers": [ + { + "parameter_id": "value", + "source": "NUMBER", + "target": "T" + } + ] } ``` From beff3495f4e0281c92015287c65caf8bc699e71f Mon Sep 17 00:00:00 2001 From: Raphael Date: Tue, 27 May 2025 18:33:32 +0200 Subject: [PATCH 14/17] feat: adjusted build.rs --- .gitignore | 2 ++ build.rs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 8f58a06..9fb6367 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,5 @@ target .idea .DS_Store +./out +out diff --git a/build.rs b/build.rs index feff6ed..48821ab 100644 --- a/build.rs +++ b/build.rs @@ -222,7 +222,7 @@ fn main() { write!(file, "] }} }}").expect("Cannot write to file"); Command::new("rustfmt") - .arg("out/output.rs") + .arg("./out/output.rs") .arg("--edition") .arg("2024"); } From 2e2127a1f6e71242f0952c186603f6eac952a4bc Mon Sep 17 00:00:00 2001 From: Raphael Date: Wed, 28 May 2025 22:11:46 +0200 Subject: [PATCH 15/17] dependencies: updated tucana --- Cargo.lock | 19 ++++++------------- Cargo.toml | 6 +++--- 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bf1e57c..601cc13 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -91,12 +91,6 @@ version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487" -[[package]] -name = "arc-swap" -version = "1.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69f7f8c3906b62b754cd5326047894316021dcfe5a194c8ea52bdd94934a3457" - [[package]] name = "asn1-rs" version = "0.7.1" @@ -514,9 +508,9 @@ dependencies = [ [[package]] name = "code0-flow" -version = "0.0.10" +version = "0.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b691df7fa5e48beb1e4de29bf5928a286a5bfe4f1bb6ae6b13804d257197e0c7" +checksum = "7cf7a86a2ba2b0428289b0dc14b6a78d60ff94f84b80eb970e64382acac70319" dependencies = [ "async-trait", "futures-lite 2.6.0", @@ -1836,11 +1830,10 @@ dependencies = [ [[package]] name = "redis" -version = "0.30.0" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "438a4e5f8e9aa246d6f3666d6978441bf1b37d5f417b50c4dd220be09f5fcc17" +checksum = "0bc1ea653e0b2e097db3ebb5b7f678be339620b8041f66b30a308c1d45d36a7f" dependencies = [ - "arc-swap", "async-std", "bytes", "cfg-if", @@ -2584,9 +2577,9 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "tucana" -version = "0.0.24" +version = "0.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cb09367cc920fc735409a26a9f7494df3c6aaa5681d6a5e06424413071c759a" +checksum = "db7694d43cff47f6464cf502b67f7f5c6da1b1e05f0693dda755e5eff8deeeaa" dependencies = [ "prost", "prost-types", diff --git a/Cargo.toml b/Cargo.toml index 694741a..a87ebfc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,8 +4,8 @@ version = "0.1.0" edition = "2021" [dependencies] -code0-flow = { version = "0.0.10", features = ["all"] } -tucana = { version = "0.0.24", features = ["aquila"] } +code0-flow = { version = "0.0.12", features = ["all"] } +tucana = { version = "0.0.28", features = ["aquila"] } lapin = "2.5.3" serde = "1.0.219" serde_json = "1.0.140" @@ -20,6 +20,6 @@ tempfile = "3.19.1" [build-dependencies] serde = "1.0.219" serde_json = "1.0.140" -tucana = { version = "0.0.24" } +tucana = { version = "0.0.28" } quote = "1.0" proc-macro2 = "1.0" From 7bccbe8ac9f148c05b2736fd9260830bd82c4d6a Mon Sep 17 00:00:00 2001 From: Raphael Date: Wed, 28 May 2025 22:12:11 +0200 Subject: [PATCH 16/17] fix: adjusted to match correct data structure --- build.rs | 28 +- .../runtime_functions/object/object.md | 329 ++- .../runtime_functions/primitive/boolean.md | 64 +- .../runtime_functions/primitive/number.md | 2310 +++++++++++++++-- .../runtime_functions/primitive/text.md | 1938 +++++++++++++- src/main.rs | 114 +- 6 files changed, 4394 insertions(+), 389 deletions(-) diff --git a/build.rs b/build.rs index 48821ab..72c03ba 100644 --- a/build.rs +++ b/build.rs @@ -117,6 +117,7 @@ fn runtime_function_parameter_to_token( let documentation = translation_to_token(param.documentation); let quote = quote! { + /* tucana::shared::RuntimeParameterDefinition { runtime_name: String::from(#runtime_name), data_type_identifier: String::from(#data_type_identifier), @@ -125,6 +126,7 @@ fn runtime_function_parameter_to_token( description: vec![#(#description),*], documentation: vec![#(#documentation),*] } + */ }; result.push(quote); @@ -137,7 +139,7 @@ fn runtime_function_definition_to_token(definition: RuntimeFunctionDefinition) - let runtime_parameter_definitions = runtime_function_parameter_to_token(definition.runtime_parameter_definitions); - let return_type_identifier = definition.return_type_identifier.into_token_stream(); + // let return_type_identifier = definition.return_type_identifier.into_token_stream(); let error_type_identifiers = definition .error_type_identifiers @@ -159,7 +161,7 @@ fn runtime_function_definition_to_token(definition: RuntimeFunctionDefinition) - tucana::shared::RuntimeFunctionDefinition { runtime_name: String::from(#runtime_name), runtime_parameter_definitions: vec![#(#runtime_parameter_definitions),*], - return_type_identifier: Option::Some(String::from(#return_type_identifier)), + // return_type_identifier: Option::Some(String::from(#return_type_identifier)), error_type_identifiers: vec![#(#error_type_identifiers),*], name: vec![#(#name),*], description: vec![#(#description),*], @@ -169,9 +171,9 @@ fn runtime_function_definition_to_token(definition: RuntimeFunctionDefinition) - } } fn main() { - let mut file = File::create("./out/output.rs").expect("msg"); + // let mut file = File::create("./out/output.rs").expect("msg"); - let path = "./definitions/runtime_functions/primitive/boolean.md"; + let path = "./definitions/runtime_functions/array/array.md"; let file_content = read_to_string(path).unwrap(); let mut lines = file_content.split("\n"); let mut inside_code_block = false; @@ -198,9 +200,20 @@ fn main() { } } - let results = code_blocks - .iter() - .map(|f| serde_json::from_str::(f)); + for code in code_blocks { + match serde_json::from_str::(&code) { + Ok(def) => { + // let quote = runtime_function_definition_to_token(def); + // write!(file, "{},", quote).expect("Cannot write to file"); + } + Err(err) => { + print_on_build!("Error parsing JSON: {:?}", err); + print_on_build!("JSON: {:?}", code); + } + } + } + + /* write!( file, "pub mod output {{ fn getDefinitions() -> Vec {{ vec![" @@ -225,4 +238,5 @@ fn main() { .arg("./out/output.rs") .arg("--edition") .arg("2024"); + */ } diff --git a/definitions/runtime_functions/object/object.md b/definitions/runtime_functions/object/object.md index 5ab6880..39b793f 100644 --- a/definitions/runtime_functions/object/object.md +++ b/definitions/runtime_functions/object/object.md @@ -5,18 +5,78 @@ "runtime_parameter_definitions": [ { "data_type_identifier": { - "data_type_identifier": "OBJECT" + "data_type_identifier": "OBJECT" }, - "runtime_name": "object" + "runtime_name": "object", + "name": [ + { + "code": "en-US", + "content": "Original Object" + } + ], + "description": [ + { + "code": "en-US", + "content": "The original object from which a key-value pair will be removed." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "The object to be modified by removing the specified key." + } + ] }, { - "data_type_identifier": "TEXT", - "runtime_name": "key" + "data_type_identifier": { + "data_type_identifier": "TEXT" + }, + "runtime_name": "key", + "name": [ + { + "code": "en-US", + "content": "Key" + } + ], + "description": [ + { + "code": "en-US", + "content": "The key identifying the property to remove from the object." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "The property key that will be removed from the original object." + } + ] } ], "return_type_identifier": { "data_type_identifier": "OBJECT" - } + }, + "name": [ + { + "code": "en-US", + "content": "Remove Key from Object" + } + ], + "description": [ + { + "code": "en-US", + "content": "Removes a property identified by the specified key from the given object." + } + ], + "documentation": [ + { + "code": "en-US", + "content": "Returns a new object that contains all properties from the original object except the one specified by the key." + } + ], + "deprecation_message": [], + "generic_keys": [], + "generic_mappers": [], + "error_type_identifiers": [] } ``` @@ -27,18 +87,78 @@ "runtime_parameter_definitions": [ { "data_type_identifier": { - "data_type_identifier": "OBJECT" + "data_type_identifier": "OBJECT" }, - "runtime_name": "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": "TEXT", - "runtime_name": "key" + "data_type_identifier": { + "data_type_identifier": "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": { "data_type_identifier": "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": [], + "generic_mappers": [], + "error_type_identifiers": [] } ``` @@ -50,20 +170,61 @@ "runtime_parameter_definitions": [ { "data_type_identifier": { - "data_type_identifier": "OBJECT" + "data_type_identifier": "OBJECT" }, - "runtime_name": "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": { "data_type_identifier": "ARRAY" }, + "generic_keys": ["T"], "generic_mappers": [ { - "source": "TEXT", + "source": { + "data_type_identifier": "TEXT" + }, "target": "T" } - ] + ], + "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": [], + "error_type_identifiers": [] } ``` @@ -74,14 +235,54 @@ "runtime_parameter_definitions": [ { "data_type_identifier": { - "data_type_identifier": "OBJECT" + "data_type_identifier": "OBJECT" }, - "runtime_name": "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": { "data_type_identifier": "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": [], + "generic_mappers": [], + "error_type_identifiers": [] } ``` @@ -92,31 +293,109 @@ "runtime_parameter_definitions": [ { "data_type_identifier": { - "data_type_identifier": "OBJECT" + "data_type_identifier": "OBJECT" }, - "runtime_name": "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": "TEXT", - "runtime_name": "key" + "data_type_identifier": { + "data_type_identifier": "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": { "generic_key": "I" }, - "runtime_name": "value" + "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": { "data_type_identifier": "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"], "generic_mappers": [ { - "paramter_id": "value" - "source": "I", + "parameter_id": "value", + "source": { + "generic_key": "I" + }, "target": "I" } - ] + ], + "deprecation_message": [], + "error_type_identifiers": [] } ``` diff --git a/definitions/runtime_functions/primitive/boolean.md b/definitions/runtime_functions/primitive/boolean.md index 360833d..3722197 100644 --- a/definitions/runtime_functions/primitive/boolean.md +++ b/definitions/runtime_functions/primitive/boolean.md @@ -8,7 +8,9 @@ Will convert the boolean to a number. "runtime_name": "std::boolean::as_number", "runtime_parameter_definitions": [ { - "data_type_identifier": "BOOLEAN", + "data_type_identifier": { + "data_type_identifier": "BOOLEAN" + }, "runtime_name": "value", "name": [ { @@ -30,7 +32,9 @@ Will convert the boolean to a number. ] } ], - "return_type_identifier": "NUMBER", + "return_type_identifier": { + "data_type_identifier": "NUMBER" + }, "name": [ { "code": "en-US", @@ -50,7 +54,9 @@ Will convert the boolean to a number. } ], "deprecation_message": [], - "error_type_identifiers": [] + "error_type_identifiers": [], + "generic_keys": [], + "generic_mappers": [] } ``` @@ -68,7 +74,9 @@ Will convert the boolean to a string. "runtime_name": "std::boolean::as_text", "runtime_parameter_definitions": [ { - "data_type_identifier": "BOOLEAN", + "data_type_identifier": { + "data_type_identifier": "BOOLEAN" + }, "runtime_name": "value", "name": [ { @@ -90,7 +98,9 @@ Will convert the boolean to a string. ] } ], - "return_type_identifier": "TEXT", + "return_type_identifier": { + "data_type_identifier": "TEXT" + }, "name": [ { "code": "en-US", @@ -110,7 +120,9 @@ Will convert the boolean to a string. } ], "deprecation_message": [], - "error_type_identifiers": [] + "error_type_identifiers": [], + "generic_keys": [], + "generic_mappers": [] } ``` @@ -129,7 +141,9 @@ Will convert the number to a boolean. "runtime_name": "std::boolean::from_number", "runtime_parameter_definitions": [ { - "data_type_identifier": "NUMBER", + "data_type_identifier": { + "data_type_identifier": "NUMBER" + }, "runtime_name": "value", "name": [ { @@ -151,7 +165,9 @@ Will convert the number to a boolean. ] } ], - "return_type_identifier": "BOOLEAN", + "return_type_identifier": { + "data_type_identifier": "BOOLEAN" + }, "name": [ { "code": "en-US", @@ -171,7 +187,9 @@ Will convert the number to a boolean. } ], "deprecation_message": [], - "error_type_identifiers": [] + "error_type_identifiers": [], + "generic_keys": [], + "generic_mappers": [] } ``` @@ -190,7 +208,9 @@ Will convert the string to a boolean. "runtime_name": "std::boolean::from_text", "runtime_parameter_definitions": [ { - "data_type_identifier": "TEXT", + "data_type_identifier": { + "data_type_identifier": "TEXT" + }, "runtime_name": "value", "name": [ { @@ -212,7 +232,9 @@ Will convert the string to a boolean. ] } ], - "return_type_identifier": "BOOLEAN", + "return_type_identifier": { + "data_type_identifier": "BOOLEAN" + }, "name": [ { "code": "en-US", @@ -232,7 +254,9 @@ Will convert the string to a boolean. } ], "deprecation_message": [], - "error_type_identifiers": [] + "error_type_identifiers": [], + "generic_keys": [], + "generic_mappers": [] } ``` @@ -251,7 +275,9 @@ Will compare one boolean to another. "runtime_name": "std::boolean::isEqual", "runtime_parameter_definitions": [ { - "data_type_identifier": "BOOLEAN", + "data_type_identifier": { + "data_type_identifier": "BOOLEAN" + }, "runtime_name": "first", "name": [ { @@ -273,7 +299,9 @@ Will compare one boolean to another. ] }, { - "data_type_identifier": "BOOLEAN", + "data_type_identifier": { + "data_type_identifier": "BOOLEAN" + }, "runtime_name": "second", "name": [ { @@ -295,7 +323,9 @@ Will compare one boolean to another. ] } ], - "return_type_identifier": "BOOLEAN", + "return_type_identifier": { + "data_type_identifier": "BOOLEAN" + }, "name": [ { "code": "en-US", @@ -315,7 +345,9 @@ Will compare one boolean to another. } ], "deprecation_message": [], - "error_type_identifiers": [] + "error_type_identifiers": [], + "generic_keys": [], + "generic_mappers": [] } ``` diff --git a/definitions/runtime_functions/primitive/number.md b/definitions/runtime_functions/primitive/number.md index 6e89afb..c56bf1f 100644 --- a/definitions/runtime_functions/primitive/number.md +++ b/definitions/runtime_functions/primitive/number.md @@ -8,15 +8,79 @@ Adds two numbers together. "runtime_name": "std::number::add", "runtime_parameter_definitions": [ { - "data_type_identifier": "NUMBER", - "runtime_name": "first" + "data_type_identifier": { + "data_type_identifier": "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": "NUMBER", - "runtime_name": "second" + "data_type_identifier": { + "data_type_identifier": "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": "NUMBER" + "return_type_identifier": { + "data_type_identifier": "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": [], + "error_type_identifiers": [], + "generic_keys": [], + "generic_mappers": [] } ``` @@ -32,15 +96,79 @@ Multiplies two numbers together. "runtime_name": "std::number::multiply", "runtime_parameter_definitions": [ { - "data_type_identifier": "NUMBER", - "runtime_name": "first" + "data_type_identifier": { + "data_type_identifier": "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": "NUMBER", - "runtime_name": "second" + "data_type_identifier": { + "data_type_identifier": "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": { + "data_type_identifier": "NUMBER" + }, + "error_type_identifiers": [], + "name": [ + { + "code": "en-US", + "content": "Multiply" + } + ], + "description": [ + { + "code": "en-US", + "content": "Multiplies two numbers together." } ], - "return_type_identifier": "NUMBER" + "documentation": [ + { + "code": "en-US", + "content": "Takes two numeric inputs and returns their product." + } + ], + "deprecation_message": [], + "generic_keys": [], + "generic_mappers": [] } ``` @@ -56,15 +184,79 @@ Subtracts the second number from the first. "runtime_name": "std::number::subtract", "runtime_parameter_definitions": [ { - "data_type_identifier": "NUMBER", - "runtime_name": "first" + "data_type_identifier": { + "data_type_identifier": "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": "NUMBER", - "runtime_name": "second" + "data_type_identifier": { + "data_type_identifier": "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": { + "data_type_identifier": "NUMBER" + }, + "error_type_identifiers": [], + "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." } ], - "return_type_identifier": "NUMBER" + "deprecation_message": [], + "generic_keys": [], + "generic_mappers": [] } ``` @@ -80,15 +272,79 @@ Divides the first number by the second. "runtime_name": "std::number::divide", "runtime_parameter_definitions": [ { - "data_type_identifier": "NUMBER", - "runtime_name": "first" + "data_type_identifier": { + "data_type_identifier": "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": "NUMBER", - "runtime_name": "second" + "data_type_identifier": { + "data_type_identifier": "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": { + "data_type_identifier": "NUMBER" + }, + "error_type_identifiers": [], + "name": [ + { + "code": "en-US", + "content": "Divide" + } + ], + "description": [ + { + "code": "en-US", + "content": "Divides the first number by the second number." } ], - "return_type_identifier": "NUMBER" + "documentation": [ + { + "code": "en-US", + "content": "Returns the result of dividing the first numeric input (dividend) by the second (divisor)." + } + ], + "deprecation_message": [], + "generic_keys": [], + "generic_mappers": [] } ``` @@ -104,15 +360,79 @@ Returns the remainder after division of the first number by the second. "runtime_name": "std::number::modulo", "runtime_parameter_definitions": [ { - "data_type_identifier": "NUMBER", - "runtime_name": "first" + "data_type_identifier": { + "data_type_identifier": "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": "NUMBER", - "runtime_name": "second" + "data_type_identifier": { + "data_type_identifier": "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": { + "data_type_identifier": "NUMBER" + }, + "error_type_identifiers": [], + "name": [ + { + "code": "en-US", + "content": "Modulo" } ], - "return_type_identifier": "NUMBER" + "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": [], + "generic_mappers": [] } ``` @@ -128,11 +448,55 @@ Converts a number to its absolute value. "runtime_name": "std::number::abs", "runtime_parameter_definitions": [ { - "data_type_identifier": "NUMBER", - "runtime_name": "value" + "data_type_identifier": { + "data_type_identifier": "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": { + "data_type_identifier": "NUMBER" + }, + "error_type_identifiers": [], + "name": [ + { + "code": "en-US", + "content": "Absolute Value" } ], - "return_type_identifier": "NUMBER" + "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": [], + "generic_mappers": [] } ``` @@ -148,11 +512,55 @@ Checks if a number is positive. "runtime_name": "std::number::is_positive", "runtime_parameter_definitions": [ { - "data_type_identifier": "NUMBER", - "runtime_name": "value" + "data_type_identifier": { + "data_type_identifier": "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": { + "data_type_identifier": "BOOLEAN" + }, + "error_type_identifiers": [], + "name": [ + { + "code": "en-US", + "content": "Is Positive" + } + ], + "description": [ + { + "code": "en-US", + "content": "Checks whether a number is greater than zero." } ], - "return_type_identifier": "BOOLEAN" + "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": [], + "generic_mappers": [] } ``` @@ -169,15 +577,79 @@ Checks if the first number is greater than the second. "runtime_name": "std::number::is_greater", "runtime_parameter_definitions": [ { - "data_type_identifier": "NUMBER", - "runtime_name": "first" + "data_type_identifier": { + "data_type_identifier": "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": "NUMBER", - "runtime_name": "second" + "data_type_identifier": { + "data_type_identifier": "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": { + "data_type_identifier": "BOOLEAN" + }, + "error_type_identifiers": [], + "name": [ + { + "code": "en-US", + "content": "Is Greater" } ], - "return_type_identifier": "BOOLEAN" + "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": [], + "generic_mappers": [] } ``` @@ -194,15 +666,79 @@ Checks if the first number is less than the second. "runtime_name": "std::number::is_less", "runtime_parameter_definitions": [ { - "data_type_identifier": "NUMBER", - "runtime_name": "first" + "data_type_identifier": { + "data_type_identifier": "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": "NUMBER", - "runtime_name": "second" + "data_type_identifier": { + "data_type_identifier": "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": "BOOLEAN" + "return_type_identifier": { + "data_type_identifier": "BOOLEAN" + }, + "error_type_identifiers": [], + "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": [], + "generic_mappers": [] } ``` @@ -219,11 +755,55 @@ Checks if a number is zero. "runtime_name": "std::number::is_zero", "runtime_parameter_definitions": [ { - "data_type_identifier": "NUMBER", - "runtime_name": "value" + "data_type_identifier": { + "data_type_identifier": "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": { + "data_type_identifier": "BOOLEAN" + }, + "error_type_identifiers": [], + "name": [ + { + "code": "en-US", + "content": "Is Zero" + } + ], + "description": [ + { + "code": "en-US", + "content": "Checks whether the given number is exactly zero." } ], - "return_type_identifier": "BOOLEAN" + "documentation": [ + { + "code": "en-US", + "content": "Returns true if the input number is zero; otherwise, returns false." + } + ], + "deprecation_message": [], + "generic_keys": [], + "generic_mappers": [] } ``` @@ -240,11 +820,55 @@ Multiplies a number by itself. "runtime_name": "std::number::square", "runtime_parameter_definitions": [ { - "data_type_identifier": "NUMBER", - "runtime_name": "value" + "data_type_identifier": { + "data_type_identifier": "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": { + "data_type_identifier": "NUMBER" + }, + "error_type_identifiers": [], + "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." } ], - "return_type_identifier": "NUMBER" + "deprecation_message": [], + "generic_keys": [], + "generic_mappers": [] } ``` @@ -260,15 +884,79 @@ Raises a number to the specified power. "runtime_name": "std::number::exponential", "runtime_parameter_definitions": [ { - "data_type_identifier": "NUMBER", - "runtime_name": "base" + "data_type_identifier": { + "data_type_identifier": "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": "NUMBER", - "runtime_name": "exponent" + "data_type_identifier": { + "data_type_identifier": "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": { + "data_type_identifier": "NUMBER" + }, + "error_type_identifiers": [], + "name": [ + { + "code": "en-US", + "content": "Exponential" } ], - "return_type_identifier": "NUMBER" + "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": [], + "generic_mappers": [] } ``` @@ -283,7 +971,31 @@ Returns the mathematical constant Pi. { "runtime_name": "std::number::pi", "runtime_parameter_definitions": [], - "return_type_identifier": "NUMBER" + "return_type_identifier": { + "data_type_identifier": "NUMBER" + }, + "error_type_identifiers": [], + "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": [], + "generic_mappers": [] } ``` @@ -298,7 +1010,31 @@ Returns the mathematical constant e (Euler's number). { "runtime_name": "std::number::euler", "runtime_parameter_definitions": [], - "return_type_identifier": "NUMBER" + "return_type_identifier": { + "data_type_identifier": "NUMBER" + }, + "error_type_identifiers": [], + "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": [], + "generic_mappers": [] } ``` @@ -313,7 +1049,31 @@ Returns the representation of infinity. { "runtime_name": "std::number::infinity", "runtime_parameter_definitions": [], - "return_type_identifier": "NUMBER" + "return_type_identifier": { + "data_type_identifier": "NUMBER" + }, + "error_type_identifiers": [], + "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": [], + "generic_mappers": [] } ``` @@ -329,15 +1089,79 @@ Rounds a number up to the nearest integer. "runtime_name": "std::number::round_up", "runtime_parameter_definitions": [ { - "data_type_identifier": "NUMBER", - "runtime_name": "value" + "data_type_identifier": { + "data_type_identifier": "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": "NUMBER", - "runtime_name": "decimals" + "data_type_identifier": { + "data_type_identifier": "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": { + "data_type_identifier": "NUMBER" + }, + "error_type_identifiers": [], + "name": [ + { + "code": "en-US", + "content": "Round Up" + } + ], + "description": [ + { + "code": "en-US", + "content": "Rounds a number upward to the specified number of decimal places." } ], - "return_type_identifier": "NUMBER" + "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": [], + "generic_mappers": [] } ``` @@ -356,15 +1180,79 @@ Rounds a number down to the nearest integer. "runtime_name": "std::number::round_down", "runtime_parameter_definitions": [ { - "data_type_identifier": "NUMBER", - "runtime_name": "value" + "data_type_identifier": { + "data_type_identifier": "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": "NUMBER", - "runtime_name": "decimals" + "data_type_identifier": { + "data_type_identifier": "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": { + "data_type_identifier": "NUMBER" + }, + "error_type_identifiers": [], + "name": [ + { + "code": "en-US", + "content": "Round Down" } ], - "return_type_identifier": "NUMBER" + "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": [], + "generic_mappers": [] } ``` @@ -384,15 +1272,79 @@ Rounds a number to the nearest integer. "runtime_name": "std::number::round", "runtime_parameter_definitions": [ { - "data_type_identifier": "NUMBER", - "runtime_name": "value" + "data_type_identifier": { + "data_type_identifier": "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": "NUMBER", - "runtime_name": "decimals" + "data_type_identifier": { + "data_type_identifier": "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": { + "data_type_identifier": "NUMBER" + }, + "error_type_identifiers": [], + "name": [ + { + "code": "en-US", + "content": "Round" } ], - "return_type_identifier": "NUMBER" + "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": [], + "generic_mappers": [] } ``` @@ -412,11 +1364,55 @@ Calculates the square root of a number. "runtime_name": "std::number::square_root", "runtime_parameter_definitions": [ { - "data_type_identifier": "NUMBER", - "runtime_name": "value" + "data_type_identifier": { + "data_type_identifier": "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": "NUMBER" + "return_type_identifier": { + "data_type_identifier": "NUMBER" + }, + "error_type_identifiers": [], + "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": [], + "generic_mappers": [] } ``` @@ -432,15 +1428,79 @@ Calculates the nth root of a number. "runtime_name": "std::number::root", "runtime_parameter_definitions": [ { - "data_type_identifier": "NUMBER", - "runtime_name": "value" + "data_type_identifier": { + "data_type_identifier": "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": "NUMBER", - "runtime_name": "root_exponent" + "data_type_identifier": { + "data_type_identifier": "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": "NUMBER" + "return_type_identifier": { + "data_type_identifier": "NUMBER" + }, + "error_type_identifiers": [], + "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": [], + "generic_mappers": [] } ``` @@ -456,15 +1516,79 @@ Calculates the logarithm of a number with the specified base. "runtime_name": "std::number::log", "runtime_parameter_definitions": [ { - "data_type_identifier": "NUMBER", - "runtime_name": "value" + "data_type_identifier": { + "data_type_identifier": "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": "NUMBER", - "runtime_name": "base" + "data_type_identifier": { + "data_type_identifier": "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": { + "data_type_identifier": "NUMBER" + }, + "error_type_identifiers": [], + "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." } ], - "return_type_identifier": "NUMBER" + "deprecation_message": [], + "generic_keys": [], + "generic_mappers": [] } ``` @@ -480,11 +1604,55 @@ Calculates the natural logarithm (base e) of a number. "runtime_name": "std::number::ln", "runtime_parameter_definitions": [ { - "data_type_identifier": "NUMBER", - "runtime_name": "value" + "data_type_identifier": { + "data_type_identifier": "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": { + "data_type_identifier": "NUMBER" + }, + "error_type_identifiers": [], + "name": [ + { + "code": "en-US", + "content": "Natural Logarithm" + } + ], + "description": [ + { + "code": "en-US", + "content": "Calculates the natural logarithm (log base e) of a number." } ], - "return_type_identifier": "NUMBER" + "documentation": [ + { + "code": "en-US", + "content": "Returns the natural logarithm of the given value." + } + ], + "deprecation_message": [], + "generic_keys": [], + "generic_mappers": [] } ``` @@ -500,11 +1668,55 @@ Converts a string to a number. "runtime_name": "std::number::from_text", "runtime_parameter_definitions": [ { - "data_type_identifier": "TEXT", - "runtime_name": "text" + "data_type_identifier": { + "data_type_identifier": "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": { + "data_type_identifier": "NUMBER" + }, + "error_type_identifiers": [], + "name": [ + { + "code": "en-US", + "content": "Number from Text" } ], - "return_type_identifier": "NUMBER" + "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": [], + "generic_mappers": [] } ``` @@ -521,11 +1733,55 @@ Converts a number to a text. "runtime_name": "std::number::as_text", "runtime_parameter_definitions": [ { - "data_type_identifier": "NUMBER", - "runtime_name": "number" + "data_type_identifier": { + "data_type_identifier": "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": { + "data_type_identifier": "TEXT" + }, + "error_type_identifiers": [], + "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." } ], - "return_type_identifier": "TEXT" + "deprecation_message": [], + "generic_keys": [], + "generic_mappers": [] } ``` @@ -543,15 +1799,79 @@ Returns the smaller of two numbers. "runtime_name": "std::number::min", "runtime_parameter_definitions": [ { - "data_type_identifier": "NUMBER", - "runtime_name": "first" + "data_type_identifier": { + "data_type_identifier": "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": "NUMBER", - "runtime_name": "second" + "data_type_identifier": { + "data_type_identifier": "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": "NUMBER" + "return_type_identifier": { + "data_type_identifier": "NUMBER" + }, + "error_type_identifiers": [], + "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": [], + "generic_mappers": [] } ``` @@ -568,15 +1888,79 @@ Returns the larger of two numbers. "runtime_name": "std::number::max", "runtime_parameter_definitions": [ { - "data_type_identifier": "NUMBER", - "runtime_name": "first" + "data_type_identifier": { + "data_type_identifier": "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": "NUMBER", - "runtime_name": "second" + "data_type_identifier": { + "data_type_identifier": "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": { + "data_type_identifier": "NUMBER" + }, + "error_type_identifiers": [], + "name": [ + { + "code": "en-US", + "content": "Maximum" + } + ], + "description": [ + { + "code": "en-US", + "content": "Returns the larger of two numbers." } ], - "return_type_identifier": "NUMBER" + "documentation": [ + { + "code": "en-US", + "content": "Compares two numbers and returns the maximum value." + } + ], + "deprecation_message": [], + "generic_keys": [], + "generic_mappers": [] } ``` @@ -593,11 +1977,55 @@ Returns the additive inverse of a number. "runtime_name": "std::number::negate", "runtime_parameter_definitions": [ { - "data_type_identifier": "NUMBER", - "runtime_name": "value" + "data_type_identifier": { + "data_type_identifier": "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": "NUMBER" + "return_type_identifier": { + "data_type_identifier": "NUMBER" + }, + "error_type_identifiers": [], + "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": [], + "generic_mappers": [] } ``` @@ -614,15 +2042,79 @@ Generates a random number between the specified minimum and maximum values. "runtime_name": "std::number::random_number", "runtime_parameter_definitions": [ { - "data_type_identifier": "NUMBER", - "runtime_name": "min" + "data_type_identifier": { + "data_type_identifier": "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": "NUMBER", - "runtime_name": "max" + "data_type_identifier": { + "data_type_identifier": "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": { + "data_type_identifier": "NUMBER" + }, + "name": [ + { + "code": "en-US", + "content": "Random Number" + } + ], + "description": [ + { + "code": "en-US", + "content": "Generates a random number between the specified minimum and maximum values." } ], - "return_type_identifier": "NUMBER" + "documentation": [ + { + "code": "en-US", + "content": "Returns a randomly generated number within the given range, inclusive of both minimum and maximum." + } + ], + "error_type_identifiers": [], + "deprecation_message": [], + "generic_keys": [], + "generic_mappers": [] } ``` @@ -635,14 +2127,82 @@ Calculates the sine of an angle (in radians). ```json { - "runtime_name": "std::number::sin", + "runtime_name": "std::number::random_number", "runtime_parameter_definitions": [ { - "data_type_identifier": "NUMBER", - "runtime_name": "radians" + "data_type_identifier": { + "data_type_identifier": "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": { + "data_type_identifier": "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": { + "data_type_identifier": "NUMBER" + }, + "error_type_identifiers": [], + "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." } ], - "return_type_identifier": "NUMBER" + "deprecation_message": [], + "generic_keys": [], + "generic_mappers": [] } ``` @@ -659,11 +2219,55 @@ Calculates the cosine of an angle (in radians). "runtime_name": "std::number::cos", "runtime_parameter_definitions": [ { - "data_type_identifier": "NUMBER", - "runtime_name": "radians" + "data_type_identifier": { + "data_type_identifier": "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": { + "data_type_identifier": "NUMBER" + }, + "error_type_identifiers": [], + "name": [ + { + "code": "en-US", + "content": "Cosine" + } + ], + "description": [ + { + "code": "en-US", + "content": "Returns the cosine of the specified angle in radians." } ], - "return_type_identifier": "NUMBER" + "documentation": [ + { + "code": "en-US", + "content": "Calculates the cosine value of the input angle measured in radians." + } + ], + "deprecation_message": [], + "generic_keys": [], + "generic_mappers": [] } ``` @@ -680,11 +2284,55 @@ Calculates the tangent of an angle (in radians). "runtime_name": "std::number::tan", "runtime_parameter_definitions": [ { - "data_type_identifier": "NUMBER", - "runtime_name": "radians" + "data_type_identifier": { + "data_type_identifier": "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": { + "data_type_identifier": "NUMBER" + }, + "error_type_identifiers": [], + "name": [ + { + "code": "en-US", + "content": "Tangent" } ], - "return_type_identifier": "NUMBER" + "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": [], + "generic_mappers": [] } ``` @@ -701,11 +2349,55 @@ Calculates the inverse sine (in radians). "runtime_name": "std::number::arcsin", "runtime_parameter_definitions": [ { - "data_type_identifier": "NUMBER", - "runtime_name": "value" + "data_type_identifier": { + "data_type_identifier": "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": { + "data_type_identifier": "NUMBER" + }, + "error_type_identifiers": [], + "name": [ + { + "code": "en-US", + "content": "Arcsine" } ], - "return_type_identifier": "NUMBER" + "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": [], + "generic_mappers": [] } ``` @@ -722,11 +2414,55 @@ Calculates the inverse cosine (in radians). "runtime_name": "std::number::arccos", "runtime_parameter_definitions": [ { - "data_type_identifier": "NUMBER", - "runtime_name": "value" + "data_type_identifier": { + "data_type_identifier": "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": "NUMBER" + "return_type_identifier": { + "data_type_identifier": "NUMBER" + }, + "error_type_identifiers": [], + "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": [], + "generic_mappers": [] } ``` @@ -743,11 +2479,55 @@ Calculates the inverse tangent (in radians). "runtime_name": "std::number::arctan", "runtime_parameter_definitions": [ { - "data_type_identifier": "NUMBER", - "runtime_name": "value" + "data_type_identifier": { + "data_type_identifier": "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": { + "data_type_identifier": "NUMBER" + }, + "error_type_identifiers": [], + "name": [ + { + "code": "en-US", + "content": "Arctangent" + } + ], + "description": [ + { + "code": "en-US", + "content": "Returns the arctangent of a number, in radians." } ], - "return_type_identifier": "NUMBER" + "documentation": [ + { + "code": "en-US", + "content": "Computes the angle in radians whose tangent is the given number." + } + ], + "deprecation_message": [], + "generic_keys": [], + "generic_mappers": [] } ``` @@ -764,11 +2544,55 @@ Calculates the hyperbolic sine of a number. "runtime_name": "std::number::sinh", "runtime_parameter_definitions": [ { - "data_type_identifier": "NUMBER", - "runtime_name": "value" + "data_type_identifier": { + "data_type_identifier": "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": { + "data_type_identifier": "NUMBER" + }, + "error_type_identifiers": [], + "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." } ], - "return_type_identifier": "NUMBER" + "deprecation_message": [], + "generic_keys": [], + "generic_mappers": [] } ``` @@ -785,11 +2609,55 @@ Calculates the hyperbolic cosine of a number. "runtime_name": "std::number::cosh", "runtime_parameter_definitions": [ { - "data_type_identifier": "NUMBER", - "runtime_name": "value" + "data_type_identifier": { + "data_type_identifier": "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": { + "data_type_identifier": "NUMBER" + }, + "error_type_identifiers": [], + "name": [ + { + "code": "en-US", + "content": "Hyperbolic Cosine" + } + ], + "description": [ + { + "code": "en-US", + "content": "Returns the hyperbolic cosine of a number." } ], - "return_type_identifier": "NUMBER" + "documentation": [ + { + "code": "en-US", + "content": "Calculates the hyperbolic cosine (cosh) of the input value." + } + ], + "deprecation_message": [], + "generic_keys": [], + "generic_mappers": [] } ``` @@ -806,19 +2674,103 @@ Constrains a number to be within a specified range. "runtime_name": "std::number::clamp", "runtime_parameter_definitions": [ { - "data_type_identifier": "NUMBER", - "runtime_name": "value" + "data_type_identifier": { + "data_type_identifier": "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": "NUMBER", - "runtime_name": "min" + "data_type_identifier": { + "data_type_identifier": "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": "NUMBER", - "runtime_name": "max" + "data_type_identifier": { + "data_type_identifier": "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": { + "data_type_identifier": "NUMBER" + }, + "error_type_identifiers": [], + "name": [ + { + "code": "en-US", + "content": "Clamp" } ], - "return_type_identifier": "NUMBER" + "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": [], + "generic_mappers": [] } ``` @@ -836,15 +2788,79 @@ Will compare one boolean to another. "runtime_name": "std::number::isEqual", "runtime_parameter_definitions": [ { - "data_type_identifier": "NUMBER", - "runtime_name": "first" + "data_type_identifier": { + "data_type_identifier": "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": "NUMBER", - "runtime_name": "second" + "data_type_identifier": { + "data_type_identifier": "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": { + "data_type_identifier": "BOOLEAN" + }, + "error_type_identifiers": [], + "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." } ], - "return_type_identifier": "BOOLEAN" + "deprecation_message": [], + "generic_keys": [], + "generic_mappers": [] } ``` diff --git a/definitions/runtime_functions/primitive/text.md b/definitions/runtime_functions/primitive/text.md index 40d061d..7290f1b 100644 --- a/definitions/runtime_functions/primitive/text.md +++ b/definitions/runtime_functions/primitive/text.md @@ -8,8 +8,28 @@ Converts the text to a number array. "runtime_name": "std::text::as_bytes", "runtime_parameter_definitions": [ { - "data_type_identifier": "TEXT", - "runtime_name": "value" + "data_type_identifier": { + "data_type_identifier": "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": { @@ -17,10 +37,33 @@ Converts the text to a number array. }, "generic_mappers": [ { - "source": "NUMBER", + "source": { + "data_type_identifier": "NUMBER" + }, "target": "T" } - ] + ], + "error_type_identifiers": [], + "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": [] } ``` @@ -36,11 +79,55 @@ Returns the size of the text in bytes. "runtime_name": "std::text::byte_size", "runtime_parameter_definitions": [ { - "data_type_identifier": "TEXT", - "runtime_name": "value" + "data_type_identifier": { + "data_type_identifier": "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": { + "data_type_identifier": "NUMBER" + }, + "error_type_identifiers": [], + "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." } ], - "return_type_identifier": "NUMBER" + "deprecation_message": [], + "generic_keys": [], + "generic_mappers": [] } ``` @@ -56,11 +143,55 @@ Capitalizes the first character of the text. "runtime_name": "std::text::capitalize", "runtime_parameter_definitions": [ { - "data_type_identifier": "TEXT", - "runtime_name": "value" + "data_type_identifier": { + "data_type_identifier": "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": { + "data_type_identifier": "TEXT" + }, + "error_type_identifiers": [], + "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." } ], - "return_type_identifier": "TEXT" + "deprecation_message": [], + "generic_keys": [], + "generic_mappers": [] } ``` @@ -78,11 +209,55 @@ Converts all characters in the text to uppercase. "runtime_name": "std::text::uppercase", "runtime_parameter_definitions": [ { - "data_type_identifier": "TEXT", - "runtime_name": "value" + "data_type_identifier": { + "data_type_identifier": "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": { + "data_type_identifier": "TEXT" + }, + "error_type_identifiers": [], + "name": [ + { + "code": "en-US", + "content": "Uppercase" + } + ], + "description": [ + { + "code": "en-US", + "content": "Transforms all letters in the text to their uppercase equivalents." } ], - "return_type_identifier": "TEXT" + "documentation": [ + { + "code": "en-US", + "content": "Returns a new text string with all characters converted to uppercase." + } + ], + "deprecation_message": [], + "generic_keys": [], + "generic_mappers": [] } ``` @@ -100,11 +275,55 @@ Converts all characters in the text to lowercase. "runtime_name": "std::text::lowercase", "runtime_parameter_definitions": [ { - "data_type_identifier": "TEXT", - "runtime_name": "value" + "data_type_identifier": { + "data_type_identifier": "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": { + "data_type_identifier": "TEXT" + }, + "error_type_identifiers": [], + "name": [ + { + "code": "en-US", + "content": "Lowercase" + } + ], + "description": [ + { + "code": "en-US", + "content": "Transforms all letters in the text to their lowercase equivalents." } ], - "return_type_identifier": "TEXT" + "documentation": [ + { + "code": "en-US", + "content": "Returns a new text string with all characters converted to lowercase." + } + ], + "deprecation_message": [], + "generic_keys": [], + "generic_mappers": [] } ``` @@ -122,11 +341,55 @@ Swaps the case of all characters in the text. "runtime_name": "std::text::swapcase", "runtime_parameter_definitions": [ { - "data_type_identifier": "TEXT", - "runtime_name": "value" + "data_type_identifier": { + "data_type_identifier": "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": { + "data_type_identifier": "TEXT" + }, + "error_type_identifiers": [], + "name": [ + { + "code": "en-US", + "content": "Swap Case" } ], - "return_type_identifier": "TEXT" + "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": [], + "generic_mappers": [] } ``` @@ -144,8 +407,28 @@ Splits the text into an array of characters. "runtime_name": "std::text::chars", "runtime_parameter_definitions": [ { - "data_type_identifier": "TEXT", - "runtime_name": "value" + "data_type_identifier": { + "data_type_identifier": "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": { @@ -154,10 +437,32 @@ Splits the text into an array of characters. "generic_keys": ["R"], "generic_mappers": [ { - "source": "TEXT", + "source": { + "data_type_identifier": "TEXT" + }, "target": "R" } - ] + ], + "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": [], + "error_type_identifiers": [] } ``` @@ -173,15 +478,79 @@ Returns the character at the specified index. "runtime_name": "std::text::at", "runtime_parameter_definitions": [ { - "data_type_identifier": "TEXT", - "runtime_name": "value" + "data_type_identifier": { + "data_type_identifier": "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": "NUMBER", - "runtime_name": "index" + "data_type_identifier": { + "data_type_identifier": "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": { + "data_type_identifier": "TEXT" + }, + "error_type_identifiers": [], + "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." } ], - "return_type_identifier": "TEXT" + "deprecation_message": [], + "generic_keys": [], + "generic_mappers": [] } ``` @@ -199,11 +568,55 @@ Removes whitespace from both ends of the text. "runtime_name": "std::text::trim", "runtime_parameter_definitions": [ { - "data_type_identifier": "TEXT", - "runtime_name": "value" + "data_type_identifier": { + "data_type_identifier": "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": { + "data_type_identifier": "TEXT" + }, + "name": [ + { + "code": "en-US", + "content": "Trim Text" + } + ], + "description": [ + { + "code": "en-US", + "content": "Removes leading and trailing whitespace from the text." } ], - "return_type_identifier": "TEXT" + "documentation": [ + { + "code": "en-US", + "content": "Returns a new string with all leading and trailing whitespace characters removed from the input text." + } + ], + "deprecation_message": [], + "error_type_identifiers": [], + "generic_keys": [], + "generic_mappers": [] } ``` @@ -221,15 +634,79 @@ Concatenates two strings together. "runtime_name": "std::text::append", "runtime_parameter_definitions": [ { - "data_type_identifier": "TEXT", - "runtime_name": "value" + "data_type_identifier": { + "data_type_identifier": "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": "TEXT", - "runtime_name": "suffix" + "data_type_identifier": { + "data_type_identifier": "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": { + "data_type_identifier": "TEXT" + }, + "name": [ + { + "code": "en-US", + "content": "Append Text" + } + ], + "description": [ + { + "code": "en-US", + "content": "Concatenates the suffix text to the end of the original text." } ], - "return_type_identifier": "TEXT" + "documentation": [ + { + "code": "en-US", + "content": "Returns a new text string consisting of the original text followed by the specified suffix." + } + ], + "deprecation_message": [], + "error_type_identifiers": [], + "generic_keys": [], + "generic_mappers": [] } ``` @@ -247,15 +724,79 @@ Adds text to the beginning of the string. "runtime_name": "std::text::prepend", "runtime_parameter_definitions": [ { - "data_type_identifier": "TEXT", - "runtime_name": "value" + "data_type_identifier": { + "data_type_identifier": "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": "TEXT", - "runtime_name": "prefix" + "data_type_identifier": { + "data_type_identifier": "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": { + "data_type_identifier": "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." } ], - "return_type_identifier": "TEXT" + "deprecation_message": [], + "error_type_identifiers": [], + "generic_keys": [], + "generic_mappers": [] } ``` @@ -273,19 +814,103 @@ Inserts text at the specified position. "runtime_name": "std::text::insert", "runtime_parameter_definitions": [ { - "data_type_identifier": "TEXT", - "runtime_name": "value" + "data_type_identifier": { + "data_type_identifier": "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": "NUMBER", - "runtime_name": "position" + "data_type_identifier": { + "data_type_identifier": "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": "TEXT", - "runtime_name": "text" + "data_type_identifier": { + "data_type_identifier": "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": "TEXT" + "return_type_identifier": { + "data_type_identifier": "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": [], + "error_type_identifiers": [], + "generic_keys": [], + "generic_mappers": [] } ``` @@ -303,11 +928,55 @@ Returns the length of the text. "runtime_name": "std::text::length", "runtime_parameter_definitions": [ { - "data_type_identifier": "TEXT", - "runtime_name": "value" + "data_type_identifier": { + "data_type_identifier": "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": { + "data_type_identifier": "NUMBER" + }, + "name": [ + { + "code": "en-US", + "content": "Length" } ], - "return_type_identifier": "NUMBER" + "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": [], + "error_type_identifiers": [], + "generic_keys": [], + "generic_mappers": [] } ``` @@ -325,19 +994,103 @@ Removes a portion of text from the specified start index to end index. "runtime_name": "std::text::remove", "runtime_parameter_definitions": [ { - "data_type_identifier": "TEXT", - "runtime_name": "value" + "data_type_identifier": { + "data_type_identifier": "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": "NUMBER", - "runtime_name": "start" + "data_type_identifier": { + "data_type_identifier": "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": "NUMBER", - "runtime_name": "end" + "data_type_identifier": { + "data_type_identifier": "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": { + "data_type_identifier": "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." } ], - "return_type_identifier": "TEXT" + "documentation": [ + { + "code": "en-US", + "content": "Returns a new string with characters removed from start up to but not including end." + } + ], + "deprecation_message": [], + "error_type_identifiers": [], + "generic_keys": [], + "generic_mappers": [] } ``` @@ -355,19 +1108,103 @@ Replaces all occurrences of a substring with another string. "runtime_name": "std::text::replace", "runtime_parameter_definitions": [ { - "data_type_identifier": "TEXT", - "runtime_name": "value" + "data_type_identifier": { + "data_type_identifier": "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": "TEXT", - "runtime_name": "old" + "data_type_identifier": { + "data_type_identifier": "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": "TEXT", - "runtime_name": "new" + "data_type_identifier": { + "data_type_identifier": "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": { + "data_type_identifier": "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." } ], - "return_type_identifier": "TEXT" + "deprecation_message": [], + "error_type_identifiers": [], + "generic_keys": [], + "generic_mappers": [] } ``` @@ -385,19 +1222,103 @@ Replaces the first occurrence of a substring with another string. "runtime_name": "std::text::replace_first", "runtime_parameter_definitions": [ { - "data_type_identifier": "TEXT", - "runtime_name": "value" + "data_type_identifier": { + "data_type_identifier": "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": "TEXT", - "runtime_name": "old" + "data_type_identifier": { + "data_type_identifier": "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": "TEXT", - "runtime_name": "new" + "data_type_identifier": { + "data_type_identifier": "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": { + "data_type_identifier": "TEXT" + }, + "name": [ + { + "code": "en-US", + "content": "Replace First Substring" } ], - "return_type_identifier": "TEXT" + "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": [], + "error_type_identifiers": [], + "generic_keys": [], + "generic_mappers": [] } ``` @@ -415,19 +1336,103 @@ Replaces the last occurrence of a substring with another string. "runtime_name": "std::text::replace_last", "runtime_parameter_definitions": [ { - "data_type_identifier": "TEXT", - "runtime_name": "value" + "data_type_identifier": { + "data_type_identifier": "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": "TEXT", - "runtime_name": "old" + "data_type_identifier": { + "data_type_identifier": "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": "TEXT", - "runtime_name": "new" + "data_type_identifier": { + "data_type_identifier": "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": { + "data_type_identifier": "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." } ], - "return_type_identifier": "TEXT" + "deprecation_message": [], + "error_type_identifiers": [], + "generic_keys": [], + "generic_mappers": [] } ``` @@ -445,11 +1450,55 @@ Converts the text to a hexadecimal representation. "runtime_name": "std::text::hex", "runtime_parameter_definitions": [ { - "data_type_identifier": "TEXT", - "runtime_name": "value" + "data_type_identifier": { + "data_type_identifier": "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": { + "data_type_identifier": "TEXT" + }, + "name": [ + { + "code": "en-US", + "content": "Text to Hexadecimal" + } + ], + "description": [ + { + "code": "en-US", + "content": "Converts a text string into a hexadecimal representation." } ], - "return_type_identifier": "TEXT" + "documentation": [ + { + "code": "en-US", + "content": "Returns a string containing the hexadecimal values corresponding to each character of the input text." + } + ], + "deprecation_message": [], + "error_type_identifiers": [], + "generic_keys": [], + "generic_mappers": [] } ``` @@ -467,11 +1516,55 @@ Converts the text to an octal representation. "runtime_name": "std::text::octal", "runtime_parameter_definitions": [ { - "data_type_identifier": "TEXT", - "runtime_name": "value" + "data_type_identifier": { + "data_type_identifier": "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": "TEXT" + "return_type_identifier": { + "data_type_identifier": "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": [], + "error_type_identifiers": [], + "generic_keys": [], + "generic_mappers": [] } ``` @@ -489,15 +1582,79 @@ Returns the index of the first occurrence of a substring, or -1 if not found. "runtime_name": "std::text::index_of", "runtime_parameter_definitions": [ { - "data_type_identifier": "TEXT", - "runtime_name": "value" + "data_type_identifier": { + "data_type_identifier": "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": "TEXT", - "runtime_name": "substring" + "data_type_identifier": { + "data_type_identifier": "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": { + "data_type_identifier": "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." } ], - "return_type_identifier": "NUMBER" + "deprecation_message": [], + "error_type_identifiers": [], + "generic_keys": [], + "generic_mappers": [] } ``` @@ -515,15 +1672,79 @@ Checks if the text contains a specified substring. "runtime_name": "std::text::contains", "runtime_parameter_definitions": [ { - "data_type_identifier": "TEXT", - "runtime_name": "value" + "data_type_identifier": { + "data_type_identifier": "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": "TEXT", - "runtime_name": "substring" + "data_type_identifier": { + "data_type_identifier": "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": "BOOLEAN" + "return_type_identifier": { + "data_type_identifier": "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": [], + "error_type_identifiers": [], + "generic_mappers": [] } ``` @@ -541,12 +1762,52 @@ Splits the text into an array of strings based on a delimiter. "runtime_name": "std::text::split", "runtime_parameter_definitions": [ { - "data_type_identifier": "TEXT", - "runtime_name": "value" + "data_type_identifier": { + "data_type_identifier": "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": "TEXT", - "runtime_name": "delimiter" + "data_type_identifier": { + "data_type_identifier": "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": { @@ -555,10 +1816,32 @@ Splits the text into an array of strings based on a delimiter. "generic_keys": ["R"], "generic_mappers": [ { - "source": "TEXT", + "source": { + "data_type_identifier": "TEXT" + }, "target": "R" } - ] + ], + "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": [], + "error_type_identifiers": [] } ``` @@ -576,11 +1859,55 @@ Reverses the text. "runtime_name": "std::text::reverse", "runtime_parameter_definitions": [ { - "data_type_identifier": "TEXT", - "runtime_name": "value" + "data_type_identifier": { + "data_type_identifier": "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": { + "data_type_identifier": "TEXT" + }, + "name": [ + { + "code": "en-US", + "content": "Reverse" + } + ], + "description": [ + { + "code": "en-US", + "content": "Reverses the characters in the input text." } ], - "return_type_identifier": "TEXT" + "documentation": [ + { + "code": "en-US", + "content": "Returns a new string with the characters of the input text in reverse order." + } + ], + "deprecation_message": [], + "generic_keys": [], + "generic_mappers": [], + "error_type_identifiers": [] } ``` @@ -598,15 +1925,79 @@ Checks if the text starts with a specified prefix. "runtime_name": "std::text::start_with", "runtime_parameter_definitions": [ { - "data_type_identifier": "TEXT", - "runtime_name": "value" + "data_type_identifier": { + "data_type_identifier": "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": "TEXT", - "runtime_name": "prefix" + "data_type_identifier": { + "data_type_identifier": "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": { + "data_type_identifier": "BOOLEAN" + }, + "name": [ + { + "code": "en-US", + "content": "Starts With" + } + ], + "description": [ + { + "code": "en-US", + "content": "Checks if the input text starts with the specified prefix." } ], - "return_type_identifier": "BOOLEAN" + "documentation": [ + { + "code": "en-US", + "content": "Returns true if the input text begins with the given prefix; otherwise, returns false." + } + ], + "deprecation_message": [], + "error_type_identifiers": [], + "generic_keys": [], + "generic_mappers": [] } ``` @@ -624,15 +2015,79 @@ Checks if the text ends with a specified suffix. "runtime_name": "std::text::ends_with", "runtime_parameter_definitions": [ { - "data_type_identifier": "TEXT", - "runtime_name": "value" + "data_type_identifier": { + "data_type_identifier": "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": "TEXT", - "runtime_name": "suffix" + "data_type_identifier": { + "data_type_identifier": "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": { + "data_type_identifier": "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." } ], - "return_type_identifier": "BOOLEAN" + "deprecation_message": [], + "error_type_identifiers": [], + "generic_keys": [], + "generic_mappers": [] } ``` @@ -650,20 +2105,62 @@ Converts each character to its ASCII code as an array of numbers. "runtime_name": "std::text::to_ascii", "runtime_parameter_definitions": [ { - "data_type_identifier": "TEXT", - "runtime_name": "value" + "data_type_identifier": { + "data_type_identifier": "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": { "data_type_identifier": "ARRAY" }, + "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": ["R"], "generic_mappers": [ { - "source": "NUMBER", + "source": { + "data_type_identifier": "NUMBER" + }, "target": "R" } - ] + ], + "deprecation_message": [], + "error_type_identifiers": [] } ``` @@ -681,18 +2178,63 @@ Converts an array of ASCII codes to a text string. "runtime_name": "std::text::from_ascii", "runtime_parameter_definitions": [ { - "data_type_identifier": "ARRAY", - "runtime_name": "value" + "data_type_identifier": { + "data_type_identifier": "ARRAY" + }, + "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": { + "data_type_identifier": "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." } ], - "return_type_identifier": "TEXT", "generic_mappers": [ { "parameter_id": "value", - "source": "NUMBER", + "source": { + "data_type_identifier": "NUMBER" + }, "target": "T" } - ] + ], + "generic_keys": [], + "deprecation_message": [], + "error_type_identifiers": [] } ``` @@ -710,15 +2252,79 @@ Encodes the text using a specified encoding. "runtime_name": "std::text::encode", "runtime_parameter_definitions": [ { - "data_type_identifier": "TEXT", - "runtime_name": "value" + "data_type_identifier": { + "data_type_identifier": "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": "TEXT_ENCODING", - "runtime_name": "encoding" + "data_type_identifier": { + "data_type_identifier": "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": "TEXT" + "return_type_identifier": { + "data_type_identifier": "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": [], + "generic_mappers": [], + "error_type_identifiers": [], + "deprecation_message": [] } ``` @@ -730,18 +2336,82 @@ Encodes the text using a specified encoding. ```json { - "runtime_name": "std::text::isEqual", + "runtime_name": "std::text::is_equal", "runtime_parameter_definitions": [ { - "data_type_identifier": "TEXT", - "runtime_name": "first" + "data_type_identifier": { + "data_type_identifier": "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": "TEXT", - "runtime_name": "second" + "data_type_identifier": { + "data_type_identifier": "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": { + "data_type_identifier": "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." } ], - "return_type_identifier": "BOOLEAN" + "error_type_identifiers": [], + "deprecation_message": [], + "generic_keys": [], + "generic_mappers": [] } ``` diff --git a/src/main.rs b/src/main.rs index 3f06053..f7c78b2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -20,73 +20,67 @@ fn handle_node_function( store: &FunctionStore, context: &mut Context, ) -> Result { - if let Some(definition) = function.definition { - let runtime_function = match store.get(definition.runtime_function_id.as_str()) { - Some(fc) => fc, - None => todo!("Retrun if no funtion is present"), - }; + let runtime_function = match store.get(function.runtime_function_id.as_str()) { + Some(fc) => fc, + None => todo!("Retrun if no funtion is present"), + }; - let mut parameter_collection: Vec = vec![]; + let mut parameter_collection: Vec = vec![]; - for parameter in function.parameters { - if let Some(value) = parameter.value { - match value { - // Its just a normal value, directly a paramter - tucana::shared::node_parameter::Value::LiteralValue(v) => { - parameter_collection.push(v) - } + for parameter in function.parameters { + if let Some(value) = parameter.value { + match value { + // Its just a normal value, directly a paramter + tucana::shared::node_parameter::Value::LiteralValue(v) => { + parameter_collection.push(v) + } - // Its a reference to an already executed function that returns value is the parameter of this function - tucana::shared::node_parameter::Value::ReferenceValue(reference) => { - let optional_value = context.get(&reference); + // Its a reference to an already executed function that returns value is the parameter of this function + tucana::shared::node_parameter::Value::ReferenceValue(reference) => { + let optional_value = context.get(&reference); - // Look if its even present - let context_result = match optional_value { - Some(context_result) => context_result, - None => { - todo!("Required function that holds the parameter wasnt executed") - } - }; - - // A reference is present. Look up the real value - match context_result { - // The reference is a exeuction result of a node - ContextResult::NodeExecutionResult(node_result) => match node_result { - Ok(value) => { - parameter_collection.push(value.clone()); - } - Err(err) => return Err(err), - }, - // The reference is a parameter of a node - ContextResult::ParameterResult(parameter_result) => { - parameter_collection.push(parameter_result.clone()); + // Look if its even present + let context_result = match optional_value { + Some(context_result) => context_result, + None => { + todo!("Required function that holds the parameter wasnt executed") + } + }; + + // A reference is present. Look up the real value + match context_result { + // The reference is a exeuction result of a node + ContextResult::NodeExecutionResult(node_result) => match node_result { + Ok(value) => { + parameter_collection.push(value.clone()); } + Err(err) => return Err(err), + }, + // The reference is a parameter of a node + ContextResult::ParameterResult(parameter_result) => { + parameter_collection.push(parameter_result.clone()); } } + } - // Its another function, that result is a direct parameter to this function - tucana::shared::node_parameter::Value::FunctionValue(another_node_function) => { - // As this is another new indent, a new context will be opened - context.next_context(); - let function_result = - handle_node_function(another_node_function, &store, context); - - let entry = ContextEntry::new( - function_result.clone(), - parameter_collection.clone(), - ); - context.write_to_current_context(entry); - - match function_result { - Ok(v) => { - // Add the value back to the main parameter - parameter_collection.push(v.clone()); - } - Err(_) => { - todo!( - "Reqired function that holds the paramter failed in execution" - ) - } + // Its another function, that result is a direct parameter to this function + tucana::shared::node_parameter::Value::FunctionValue(another_node_function) => { + // As this is another new indent, a new context will be opened + context.next_context(); + let function_result = + handle_node_function(another_node_function, &store, context); + + let entry = + ContextEntry::new(function_result.clone(), parameter_collection.clone()); + context.write_to_current_context(entry); + + match function_result { + Ok(v) => { + // Add the value back to the main parameter + parameter_collection.push(v.clone()); + } + Err(_) => { + todo!("Reqired function that holds the paramter failed in execution") } } } @@ -117,7 +111,7 @@ fn handle_node_function( context.leave_context(); } } - }; + } Err(RuntimeError::default()) } From bbbd708019f9338849b0830d46750731825474d9 Mon Sep 17 00:00:00 2001 From: Raphael Date: Wed, 28 May 2025 22:51:30 +0200 Subject: [PATCH 17/17] fix: adjusted array and data types --- definitions/data_types/array.md | 2 +- definitions/data_types/node.md | 42 +- definitions/data_types/primitive.md | 15 +- definitions/data_types/type.md | 5 +- definitions/runtime_functions/array/array.md | 1760 ++++++++++++++++-- 5 files changed, 1616 insertions(+), 208 deletions(-) diff --git a/definitions/data_types/array.md b/definitions/data_types/array.md index bda5a65..84f2e14 100644 --- a/definitions/data_types/array.md +++ b/definitions/data_types/array.md @@ -3,7 +3,7 @@ ## ARRAY ```json { - "variant": "ARRAY", + "variant": 5, "identifier": "ARRAY", "name": [ { diff --git a/definitions/data_types/node.md b/definitions/data_types/node.md index 4deb65b..5e5d03c 100644 --- a/definitions/data_types/node.md +++ b/definitions/data_types/node.md @@ -2,7 +2,7 @@ ```json { "identifier": "PREDICATE", - "variant": "NODE", + "variant": 7, "rules": [ { "return_type": { @@ -20,7 +20,13 @@ ] } ], - "generic_keys": ["T"] + "generic_keys": ["T"], + "name": [ + { + "code": "en-US", + "content": "Predicate" + } + ] } ``` @@ -28,7 +34,7 @@ ```json { "identifier": "CONSUMER", - "variant": "NODE", + "variant": 7, "rules": [ { "input_type": [ @@ -41,7 +47,14 @@ ] } ], - "generic_keys": ["T"] + "generic_keys": ["T"], + "name": [ + { + "code": "en-US", + "content": "Consumer" + } + ] + } ``` @@ -49,7 +62,7 @@ ```json { "identifier": "TRANSFORM", - "variant": "NODE", + "variant": 7, "rules": [ { "return_type": { @@ -69,7 +82,14 @@ ] } ], - "generic_keys": ["I", "R"] + "generic_keys": ["I", "R"], + "name": [ + { + "code": "en-US", + "content": "Transform" + } + ] + } ``` @@ -77,7 +97,7 @@ ```json { "identifier": "COMPARITOR", - "variant": "NODE", + "variant": 7, "rules": [ { "return_type": { @@ -103,6 +123,12 @@ ] } ], - "generic_keys": ["I"] + "generic_keys": ["I"], + "name": [ + { + "code": "en-US", + "content": "Comparitor" + } + ] } ``` diff --git a/definitions/data_types/primitive.md b/definitions/data_types/primitive.md index 1e7420f..5366129 100644 --- a/definitions/data_types/primitive.md +++ b/definitions/data_types/primitive.md @@ -4,7 +4,7 @@ ```json { - "variant": "PRIMITIVE", + "variant": 1, "identifier": "NUMBER", "name": [ { @@ -18,7 +18,8 @@ "pattern": "/^(?:-(?:[1-9](?:\d{0,2}(?:,\d{3})+|\d*))|(?:0|(?:[1-9](?:\d{0,2}(?:,\d{3})+|\d*))))(?:.\d+|)$/" } } - ] + ], + "generic_keys": [] } ``` @@ -27,7 +28,7 @@ ```json { - "variant": "PRIMITIVE", + "variant": 1, "identifier": "TEXT", "name": [ { @@ -41,7 +42,8 @@ "pattern": "[\s\S]*" } } - ] + ], + "generic_keys": [] } ``` @@ -49,7 +51,7 @@ ```json { - "variant": "PRIMITIVE", + "variant": 1, "identifier": "BOOLEAN", "name": [ { @@ -63,6 +65,7 @@ "pattern": "^(true|false)$" } } - ] + ], + "generic_keys": [] } ``` diff --git a/definitions/data_types/type.md b/definitions/data_types/type.md index 73dc2b3..feda618 100644 --- a/definitions/data_types/type.md +++ b/definitions/data_types/type.md @@ -4,7 +4,7 @@ ```json { - "variant": "Type", + "variant": 2, "identifier": "TEXT_ENCODING", "name": [ { @@ -23,6 +23,7 @@ ] } } - ] + ], + "generic_keys": [] } ``` diff --git a/definitions/runtime_functions/array/array.md b/definitions/runtime_functions/array/array.md index baf6a7b..ab6fc37 100644 --- a/definitions/runtime_functions/array/array.md +++ b/definitions/runtime_functions/array/array.md @@ -7,26 +7,86 @@ Will return the value at the index of the array. "runtime_parameter_definitions": [ { "data_type_identifier": { - "data_type_identifier": "ARRAY" + "data_type_identifier": "ARRAY" }, - "runtime_name": "array" + "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": "NUMBER", - "runtime_name": "index" + "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"], - "generic_mapper": [ + "generic_mappers": [ { "parameter_id": "array", - "soruce": "R", + "source": { + "generic_key": "R" + }, "target": "T" } - ] + ], + "deprecation_message": [], + "error_type_identifiers": [] } ``` @@ -40,35 +100,97 @@ Will merge to arrays together and return a new one. "data_type_identifier": { "data_type_identifier": "ARRAY" }, - "runtime_name": "first" + "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": { "data_type_identifier": "ARRAY" }, - "runtime_name": "second" + "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." + } + ] } ], - "data_type_identifier": { + "return_type_identifier": { "data_type_identifier": "ARRAY" }, + "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"], "generic_mappers": [ { "parameter_id": "first", - "soruce": "R", + "source": { + "generic_key": "R" + }, "target": "T" }, { "parameter_id": "second", - "soruce": "R", + "source": { + "generic_key": "R" + }, "target": "T" }, { - "soruce": "R", + "source": { + "generic_key": "R" + }, "target": "T" } - ] + ], + "deprecation_message": [], + "error_type_identifiers": [] } ``` @@ -80,32 +202,100 @@ Will filter the array by the given node and return all values, the filter node r "runtime_name": "std::array::filter", "runtime_parameter_definitions": [ { - "data_type_identifier": "ARRAY", - "runtime_name": "array" + "data_type_identifier": { + "data_type_identifier": "ARRAY" + }, + "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": "PREDICATE", - "runtime_name": "predicate" + "data_type_identifier": { + "data_type_identifier": "PREDICATE" + }, + "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": { + "data_type_identifier": "ARRAY" + }, + "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." } ], - "return_type_identifier": "ARRAY", "generic_keys": ["R"], "generic_mappers": [ { "parameter_id": "array", - "source": "R", + "source": { + "generic_key": "R" + }, "target": "T" }, { "parameter_id": "predicate", - "source": "R", + "source": { + "generic_key": "R" + }, "target": "T" }, { - "source": "R", + "source": { + "generic_key": "R" + }, "target": "T" } - ] + ], + "deprecation_message": [], + "error_type_identifiers": [] } ``` @@ -117,12 +307,52 @@ Will return the first item of an array that match the predicate. "runtime_name": "std::array::find", "runtime_parameter_definitions": [ { - "data_type_identifier": "ARRAY", - "runtime_name": "array" + "data_type_identifier": { + "data_type_identifier": "ARRAY" + }, + "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": "PREDICATE", - "runtime_name": "predicate" + "data_type_identifier": { + "data_type_identifier": "PREDICATE" + }, + "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"], @@ -132,15 +362,39 @@ Will return the first item of an array that match the predicate. "generic_mappers": [ { "parameter_id": "array", - "source": "R", + "source": { + "generic_key": "R" + }, "target": "T" }, { "parameter_id": "predicate", - "source": "R", + "source": { + "generic_key": "R" + }, "target": "T" - }, - ] + } + ], + "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": [], + "error_type_identifiers": [] } ``` @@ -152,12 +406,52 @@ Will return the last item of an array that match the predicate. "runtime_name": "std::array::find_last", "runtime_parameter_definitions": [ { - "data_type_identifier": "ARRAY", - "runtime_name": "array" + "data_type_identifier": { + "data_type_identifier": "ARRAY" + }, + "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": "PREDICATE", - "runtime_name": "predicate" + "data_type_identifier": { + "data_type_identifier": "PREDICATE" + }, + "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"], @@ -167,15 +461,39 @@ Will return the last item of an array that match the predicate. "generic_mappers": [ { "parameter_id": "array", - "source": "R", + "source": { + "generic_key": "R" + }, "target": "T" }, { "parameter_id": "predicate", - "source": "R", + "source": { + "generic_key": "R" + }, "target": "T" - }, - ] + } + ], + "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": [], + "error_type_identifiers": [] } ``` @@ -187,12 +505,52 @@ Will return the index of the first item that matches the predicate. "runtime_name": "std::array::find_index", "runtime_parameter_definitions": [ { - "data_type_identifier": "ARRAY", - "runtime_name": "array" + "data_type_identifier": { + "data_type_identifier": "ARRAY" + }, + "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": "PREDICATE", - "runtime_name": "predicate" + "data_type_identifier": { + "data_type_identifier": "PREDICATE" + }, + "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"], @@ -202,15 +560,39 @@ Will return the index of the first item that matches the predicate. "generic_mappers": [ { "parameter_id": "array", - "source": "R", + "source": { + "generic_key": "R" + }, "target": "T" }, { "parameter_id": "predicate", - "source": "R", + "source": { + "generic_key": "R" + }, "target": "T" - }, - ] + } + ], + "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": [], + "error_type_identifiers": [] } ``` @@ -222,9 +604,29 @@ Will return the first item of the array. "runtime_name": "std::array::first", "runtime_parameter_definitions": [ { - "data_type_identifier": "ARRAY", - "runtime_name": "array" - { + "data_type_identifier": { + "data_type_identifier": "ARRAY" + }, + "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": { "generic_key": "R" @@ -232,10 +634,33 @@ Will return the first item of the array. "generic_keys": ["R"], "generic_mappers": [ { - "soruce": "R", + "parameter_id": "array", + "source": { + "generic_key": "R" + }, "target": "T" } - ] + ], + "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": [], + "error_type_identifiers": [] } ``` @@ -247,8 +672,28 @@ Will return the last item of the array. "runtime_name": "std::array::last", "runtime_parameter_definitions": [ { - "data_type_identifier": "ARRAY", - "runtime_name": "array" + "data_type_identifier": { + "data_type_identifier": "ARRAY" + }, + "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": { @@ -257,10 +702,33 @@ Will return the last item of the array. "generic_keys": ["R"], "generic_mappers": [ { - "soruce": "R", + "parameter_id": "array", + "source": { + "generic_key": "R" + }, "target": "T" } - ] + ], + "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": [], + "error_type_identifiers": [] } ``` @@ -272,27 +740,91 @@ Will call a consumer on every item in the array. No return value. "runtime_name": "std::array::for_each", "runtime_parameter_definitions": [ { - "data_type_identifier": "ARRAY", - "runtime_name": "array" + "data_type_identifier": { + "data_type_identifier": "ARRAY" + }, + "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": "CONSUMER", - "runtime_name": "consumer" + "data_type_identifier": { + "data_type_identifier": "CONSUMER" + }, + "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"], "generic_mappers": [ { "parameter_id": "array", - "source": "R", + "source": { + "generic_key": "R" + }, "target": "T" }, { "parameter_id": "consumer", - "source": "R", + "source": { + "generic_key": "R" + }, "target": "T" - }, - ] + } + ], + "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": [], + "error_type_identifiers": [] } ``` @@ -304,39 +836,109 @@ Will call a node on each value and expect a return value of the node, collect al "runtime_name": "std::array::map", "runtime_parameter_definitions": [ { - "data_type_identifier": "ARRAY", - "runtime_name": "array" + "data_type_identifier": { + "data_type_identifier": "ARRAY" + }, + "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": "TRANSFORM", - "runtime_name": "transform" + "data_type_identifier": { + "data_type_identifier": "TRANSFORM" + }, + "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": "ARRAY", + "return_type_identifier": { + "data_type_identifier": "ARRAY" + }, "generic_mappers": [ { "parameter_id": "array", - "soruce": "IN", + "source": { + "generic_key": "IN" + }, "target": "T" }, { "parameter_id": "transform", - "source": "IN", // <-- Same type as item of array - "target": "I" // <-- input type of transform node + "source": { + "generic_key": "IN" + }, + "target": "I" }, { "parameter_id": "transform", - "soruce": "OUT", // <-- Return type of node - "target": "R" // <-- Return type of transform node + "source": { + "generic_key": "OUT" + }, + "target": "R" }, { - "soruce": "OUT", + "source": { + "generic_key": "OUT" + }, "target": "T" } - ] -} -``` + ], + "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": [], + "error_type_identifiers": [] +} +``` ## push Will add the given item to the array and returns the new length of the array. @@ -346,25 +948,87 @@ Will add the given item to the array and returns the new length of the array. "runtime_name": "std::array::push", "runtime_parameter_definitions": [ { - "data_type_identifier": "ARRAY", - "runtime_name": "array" + "data_type_identifier": { + "data_type_identifier": "ARRAY" + }, + "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": { "generic_key": "I" }, - "runtime_name": "item" + "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": "NUMBER", + "return_type_identifier": { + "data_type_identifier": "NUMBER" + }, "generic_keys": ["I"], - "generic_mapper": [ + "generic_mappers": [ { "parameter_id": "array", - "source": "T", + "source": { + "generic_key": "T" + }, "target": "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": [], + "error_type_identifiers": [] } ``` @@ -378,21 +1042,63 @@ Will remove the last entry of the array and return the item. "runtime_name": "std::array::pop", "runtime_parameter_definitions": [ { - "data_type_identifier": "ARRAY", - "runtime_name": "array" + "data_type_identifier": { + "data_type_identifier": "ARRAY" + }, + "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." + } + ] } ], - "generic_keys": ["R"], "return_type_identifier": { "generic_key": "R" }, - "generic_mapper": [ + "generic_keys": ["R"], + "generic_mappers": [ { "parameter_id": "array", - "source": "R", + "source": { + "generic_key": "R" + }, "target": "T" } - ] + ], + "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": [], + "error_type_identifiers": [] } ``` @@ -406,25 +1112,87 @@ Will remove the given item of the array and return the array without it. "runtime_name": "std::array::remove", "runtime_parameter_definitions": [ { - "data_type_identifier": "ARRAY", - "runtime_name": "array" + "data_type_identifier": { + "data_type_identifier": "ARRAY" + }, + "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": { "generic_key": "R" }, - "runtime_name": "item" + "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": "ARRAY", - "generic_mapper": [ + "return_type_identifier": { + "data_type_identifier": "ARRAY" + }, + "generic_mappers": [ { "parameter_id": "array", - "source": "R", + "source": { + "generic_key": "R" + }, "target": "T" } - ] + ], + "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": [], + "error_type_identifiers": [] } ``` @@ -436,19 +1204,63 @@ Will check if the array is empty or not. Will return true if its empty. "runtime_name": "std::array::is_empty", "runtime_parameter_definitions": [ { - "data_type_identifier": "ARRAY", - "runtime_name": "array" + "data_type_identifier": { + "data_type_identifier": "ARRAY" + }, + "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": "BOOLEAN", + "return_type_identifier": { + "data_type_identifier": "BOOLEAN" + }, "generic_keys": ["R"], "generic_mappers": [ { "parameter_id": "array", - "source": "R", + "source": { + "generic_key": "R" + }, "target": "T" } - ] + ], + "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": [], + "error_type_identifiers": [] } ``` @@ -460,19 +1272,63 @@ Will return the amount of items inside the array. "runtime_name": "std::array::size", "runtime_parameter_definitions": [ { - "data_type_identifier": "ARRAY", - "runtime_name": "array" + "data_type_identifier": { + "data_type_identifier": "ARRAY" + }, + "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": "NUMBER", + "return_type_identifier": { + "data_type_identifier": "NUMBER" + }, "generic_keys": ["R"], "generic_mappers": [ { "parameter_id": "array", - "source": "R", + "source": { + "generic_key": "R" + }, "target": "T" } - ] + ], + "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": [], + "error_type_identifiers": [] } ``` @@ -484,25 +1340,88 @@ Will return the index of the given item. "runtime_name": "std::array::index_of", "runtime_parameter_definitions": [ { - "data_type_identifier": "ARRAY", - "runtime_name": "array" + "data_type_identifier": { + "data_type_identifier": "ARRAY" + }, + "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" + "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": "NUMBER", + "return_type_identifier": { + "data_type_identifier": "NUMBER" + }, "generic_mapper": [ { "parameter_id": "array", - "source": "R", + "source": { + "generic_key": "R" + }, "target": "T" } - ] + ], + "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": [], + "error_type_identifiers": [], + "generic_mappers": [] } ``` @@ -514,8 +1433,28 @@ Will remove all duplicated items of the array. "runtime_name": "std::array::to_unique", "runtime_parameter_definitions": [ { - "data_type_identifier": "ARRAY", - "runtime_name": "array" + "data_type_identifier": { + "data_type_identifier": "ARRAY" + }, + "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": { @@ -525,14 +1464,38 @@ Will remove all duplicated items of the array. "generic_mappers": [ { "parameter_id": "array", - "soruce": "R", + "source": { + "generic_key": "R" + }, "target": "T" }, { - "soruce": "R", + "source": { + "generic_key": "R" + }, "target": "T" } - ] + ], + "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": [], + "error_type_identifiers": [] } ``` @@ -544,28 +1507,94 @@ Will sort the array by the given COMPARATOR. "runtime_name": "std::array::sort", "runtime_parameter_definitions": [ { - "data_type_identifier": "ARRAY", - "runtime_name": "array" - } + "data_type_identifier": { + "data_type_identifier": "ARRAY" + }, + "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": "COMPARATOR", - "runtime_name": "COMPARATOR" + "data_type_identifier": { + "data_type_identifier": "COMPARATOR" + }, + "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": "ARRAY", - "generic_keys": "R", + "return_type_identifier": { + "data_type_identifier": "ARRAY" + }, + "generic_keys": ["R"], "generic_mappers": [ { "parameter_id": "array", - "source": "R", + "source": { + "generic_key": "R" + }, "target": "T" }, { - "parameter_id": "COMPARATOR", - "source": "R", + "parameter_id": "comparator", + "source": { + "generic_key": "R" + }, "target": "I" } - ] + ], + "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": [], + "error_type_identifiers": [] } ``` @@ -576,28 +1605,94 @@ Will sort the array by the given COMPARATOR. "runtime_name": "std::array::sort_reverse", "runtime_parameter_definitions": [ { - "data_type_identifier": "ARRAY", - "runtime_name": "array" - } + "data_type_identifier": { + "data_type_identifier": "ARRAY" + }, + "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": "COMPARATOR", - "runtime_name": "comparator" + "data_type_identifier": { + "data_type_identifier": "COMPARATOR" + }, + "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": "ARRAY", - "generic_keys": "R", + "return_type_identifier": { + "data_type_identifier": "ARRAY" + }, + "generic_keys": ["R"], "generic_mappers": [ { "parameter_id": "array", - "source": "R", + "source": { + "generic_key": "R" + }, "target": "T" }, { "parameter_id": "comparator", - "source": "R", + "source": { + "generic_key": "R" + }, "target": "I" } - ] + ], + "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": [], + "error_type_identifiers": [] } ``` @@ -608,19 +1703,63 @@ Will sort the array by the given COMPARATOR. "runtime_name": "std::array::reverse", "runtime_parameter_definitions": [ { - "data_type_identifier": "ARRAY", - "runtime_name": "array" + "data_type_identifier": { + "data_type_identifier": "ARRAY" + }, + "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": "ARRAY", + "return_type_identifier": { + "data_type_identifier": "ARRAY" + }, "generic_keys": ["R"], "generic_mappers": [ { "parameter_id": "array", - "source": "R", + "source": { + "generic_key": "R" + }, "target": "T" } - ] + ], + "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": [], + "error_type_identifiers": [] } ``` @@ -639,26 +1778,67 @@ Result: "runtime_parameter_definitions": [ { "data_type_identifier": { - "generic_type": { - "data_type_identifier": "ARRAY", - "generic_mapper": { - "data_type_identifier": "ARRAY", - "target": "T" - } - } + "data_type_identifier": "ARRAY" }, - "runtime_name": "array" + "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": "ARRAY", + "return_type_identifier": { + "data_type_identifier": "ARRAY" + }, "generic_keys": ["R"], "generic_mappers": [ { "parameter_id": "filter", "target": "R", "soruce": "T" + }, + { + "parameter_id": "array", + "source": { + "data_type_identifier": "ARRAY" + }, + "target": "T" } - ] + ], + "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": [], + "error_type_identifiers": [] } ``` @@ -671,18 +1851,62 @@ Returns the smallest number in the array "runtime_parameter_definitions": [ { "data_type_identifier": { - "generic_type": { - "data_type_identifier": "ARRAY", - "generic_mapper": { - "data_type_identifier": "NUMBER", - "target": "T" - } - } + "data_type_identifier": "ARRAY" }, - "runtime_name": "array" + "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": { + "data_type_identifier": "NUMBER" + }, + "name": [ + { + "code": "en-US", + "content": "Find Minimum Number" } ], - "return_type_identifier": "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": [], + "error_type_identifiers": [], + "generic_keys": [], + "generic_mappers": [ + { + "parameter_id": "array", + "source": { + "data_type_identifier": "NUMBER" + }, + "target": "T" + } + ] } ``` @@ -695,18 +1919,62 @@ Returns the largest number in the array "runtime_parameter_definitions": [ { "data_type_identifier": { - "generic_type": { - "data_type_identifier": "ARRAY", - "generic_mapper": { - "data_type_identifier": "NUMBER", - "target": "T" - } + "data_type_identifier": "ARRAY" + }, + "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": { + "data_type_identifier": "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_mappers": [ + { + "parameter_id": "array", + "source": { + "data_type_identifier": "NUMBER" }, - "runtime_name": "array" + "target": "T" } ], - "return_type_identifier": "NUMBER" + "generic_keys": [], + "error_type_identifiers": [] } ``` @@ -720,18 +1988,62 @@ Returns the sum of all the numbers in the array "runtime_parameter_definitions": [ { "data_type_identifier": { - "generic_type": { - "data_type_identifier": "ARRAY", - "generic_mapper": { - "data_type_identifier": "NUMBER", - "target": "T" - } - } + "data_type_identifier": "ARRAY" }, - "runtime_name": "array" + "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": { + "data_type_identifier": "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." } ], - "return_type_identifier": "NUMBER" + "deprecation_message": [], + "generic_keys": [], + "error_type_identifiers": [], + "generic_mappers": [ + { + "parameter_id": "array", + "source": { + "data_type_identifier": "NUMBER" + }, + "target": "T" + } + ] } ``` @@ -740,25 +2052,91 @@ Will join every item by a given text ```json { - "runtime_name": "std::array::filter", + "runtime_name": "std::array::join", "runtime_parameter_definitions": [ { "data_type_identifier": { - "generic_type": { - "data_type_identifier": "ARRAY", - "generic_mapper": { - "data_type_identifier": "TEXT", + "data_type_identifier": { + "data_type_identifier": "ARRAY" + }, + "generic_mappers": [ + { + "source": { + "data_type_identifier": "TEXT" + }, "target": "T" } - } + ] }, - "runtime_name": "array" + "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": "TEXT", - "runtime_name": "join_text" + "data_type_identifier": { + "data_type_identifier": "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": { + "data_type_identifier": "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." } ], - "return_type_identifier": "TEXT" + "deprecation_message": [], + "generic_keys": [], + "generic_mappers": [], + "error_type_identifiers": [] } ```