diff --git a/docs/concepts/SLON.md b/docs/concepts/SLON.md new file mode 100644 index 0000000..030acb4 --- /dev/null +++ b/docs/concepts/SLON.md @@ -0,0 +1,34 @@ +--- +layout: default +title: SLON format +parent: Concepts +nav_order: 99 +--- + +# SLON format + +[SLON](https://github.com/nmaguiar/slon) (Single Line Object Notation) is a lightweight data serialization format designed to +compress JSON-like structures into a concise, human-readable syntax. It keeps the familiar concepts of maps and arrays while +trimming unnecessary characters, making it easier to scan large payloads in logs or share configuration snippets inline. + +## Why SLON? + +* **Compact syntax** – Braces and commas are optional when the structure is unambiguous, allowing records to fit on a single + line without sacrificing readability. +* **JSON-compatible** – Every SLON document can be converted to JSON and vice versa, enabling quick interchange between + OpenAF helpers that expect JSON and those that accept SLON. +* **Human-friendly defaults** – Strings can be quoted only when needed, and key-value pairs rely on `:` separators, so editing + data by hand is straightforward. + +## Working with SLON in OpenAF + +OpenAF includes multiple helpers to convert data back and forth between JSON and SLON: + +* `AF.toSLON()` / `AF.toCSLON()` – render maps or arrays to SLON (optionally with ANSI colors for terminals). +* `AF.fromSLON()` / `AF.fromJSSLON()` – parse SLON strings back into OpenAF objects. +* `$toSLON`, `$cslon`, `$oafp` – templating helpers that emit or parse SLON documents inline. + +Because SLON is interchangeable with JSON, documentation frequently mentions parameters that accept "JSON/SLON" values. You can +freely decide which notation is more convenient for you, and OpenAF will transparently parse the data. + +For complete syntax details and reference implementations, visit the [SLON GitHub repository](https://github.com/nmaguiar/slon). diff --git a/docs/concepts/index.md b/docs/concepts/index.md index 0339e92..db73308 100644 --- a/docs/concepts/index.md +++ b/docs/concepts/index.md @@ -20,8 +20,9 @@ Main concepts * __[$from](OpenAF-nLinq.md)__ * __[oJob.io](oJobIO.md)__ * __[oafp](oafp.md)__ +* __[SLON format](SLON.md)__ * __[Shebang](shebang.md)__ * __[Java Support](java.md)__ * __[$path](OpenAF-path.md)__ * __[Static installation](static-installation.md)__ -* __[Container images](container-images.md)__ \ No newline at end of file +* __[Container images](container-images.md)__ diff --git a/docs/concepts/llm.md b/docs/concepts/llm.md index 3b3c1f3..055d65c 100644 --- a/docs/concepts/llm.md +++ b/docs/concepts/llm.md @@ -13,15 +13,15 @@ OpenAF provides first-class support for Local Language Model (LLM) prompts via t ### OAF_MODEL -Used by the `$llm` function and OpenAF JavaScript APIs to select and configure a GPT model. If no explicit model is passed to `$llm()`, OpenAF will look at `OAF_MODEL` as a JSON or SLON string. +Used by the `$llm` function and OpenAF JavaScript APIs to select and configure a GPT model. If no explicit model is passed to `$llm()`, OpenAF will look at `OAF_MODEL` as a JSON or [SLON](https://github.com/nmaguiar/slon) string. -- Type: string (JSON/SLON) or simple `` name +- Type: string (JSON/[SLON](https://github.com/nmaguiar/slon)) or simple `` name - Default key: `OAF_MODEL` Examples: ```bash -# Full JSON configuration (SLON is also supported) +# Full JSON configuration ([SLON](https://github.com/nmaguiar/slon) is also supported) export OAF_MODEL='{ \ type: "openai", \ key: "YOUR_OPENAI_API_KEY", @@ -76,7 +76,7 @@ TOPIC=love && printf "Write a poem about ${TOPIC}" | oafp in=llm ## Tips - **Environment isolation**: Set these variables in your CI/CD or container environment to avoid hard-coding secrets. -- **SLON support**: OpenAF will parse SLON (Single Line Object Notation) if you prefer a more compact syntax. +- **[SLON](https://github.com/nmaguiar/slon) support**: OpenAF will parse [SLON](https://github.com/nmaguiar/slon) (Single Line Object Notation) if you prefer a more compact syntax. - **Multiple providers**: You can switch providers by changing `type` (e.g. `openai`, `gemini`, `ollama`, `anthropic`). ## Reference Table: OAF_MODEL / OAFP_MODEL Fields diff --git a/docs/guides/oafp/oafp-filters.md b/docs/guides/oafp/oafp-filters.md index 98dd9c5..26d6b1f 100644 --- a/docs/guides/oafp/oafp-filters.md +++ b/docs/guides/oafp/oafp-filters.md @@ -73,7 +73,7 @@ Using the same unix “pipe” mechanism it’s possible to apply different cate | avg(arrayNumber) | base | The average value of an array of numeric fields | avg([].y) | | at(idx) | 20241205 | Returns the array index entry | [].at(5) | | ceil(number) | base | Returns the smallest integer that is equal or less than a specific numeric field value | [].ceil(y) | -| ch(name, op, arg1, args2) | 20240801 | Wrapper for OpenAF's channel functions over a 'name' channel, an 'op' operation between get, set, unset, size, getAll, getKeys, unsetAll; depending on the 'op', 'arg1' and 'arg2' can be provided with values as objects or JSON/SLON | ch('a', 'set', 'a', 'abc').ch('a', 'get', 'a', __) | +| ch(name, op, arg1, args2) | 20240801 | Wrapper for OpenAF's channel functions over a 'name' channel, an 'op' operation between get, set, unset, size, getAll, getKeys, unsetAll; depending on the 'op', 'arg1' and 'arg2' can be provided with values as objects or JSON/[SLON](https://github.com/nmaguiar/slon) | ch('a', 'set', 'a', 'abc').ch('a', 'get', 'a', __) | | concat(x, y) | 20240209 | Concats arrays or strings | concat('abc', '123') | | contains(string/array, any) | base | Returns true of false if a string field contains a specific value | files[?contains(filename, 'openaf.jar') == `true` | | count_by(arr, 'field') | all | Returns a count by array with the '_count' per value of the provided 'field' | count_by([], 'isFile') | @@ -92,7 +92,7 @@ Using the same unix “pipe” mechanism it’s possible to apply different cate | from_csv(str, options) | 20240801 | Given a string CSV representation tries to parse to an array | from_csv(@, '(withDelimiter:\"|\",withHeader:false)') | | from_datef(date, 'format') | 20240228 | Converts a date type into a string given a 'format' (equivalent to OpenAF's ow.format.fromDate) | from_datef(to_datef('20240202', 'yyyyMMdd'), 'yyyy') | | from_json(str) | 20240215 | Converts a json string representation into an object | from_json('{a:123}')" | -| from_ms(x, 'format') | 20240209 | Shortcut for OpenAF's ow.format.elapsedTime4ms function. The format is represented as a SLON/JSON string | from_ms(`12000`,'(abrev:true)') | +| from_ms(x, 'format') | 20240209 | Shortcut for OpenAF's ow.format.elapsedTime4ms function. The format is represented as a [SLON](https://github.com/nmaguiar/slon)/JSON string | from_ms(`12000`,'(abrev:true)') | | from_numSpace(str, sep) | 20241207 | Tries to convert a string number with thousands separators back to a number | from_numSpace('123 456', ' ') | | from_siAbbr(x) | 20240209 | Given a string with SI numeric abbreviation will convert it to the absolute value | from_siAbbr('100m') | | from_slon(obj) | 20240215 | Converts a slon string representation into an object | from_slon('(abc: 123)') | @@ -127,7 +127,7 @@ Using the same unix “pipe” mechanism it’s possible to apply different cate | not_null(any) | base | Returns the non-null value between the provided fields | [].not_null(a,b) | | now(diff) | 20240302 | Returns the current unix timestamp number with a negative diff (or positive for dates in the future) | | nvl(field, value) | 20240216 | Returns the provided value in case a field value is undefined or null | nvl(nullField, 'n/a') | -| oafp(str) | 20240812 | Executes an oafp (inception) with the provided map in JSON or SLON string format | oafp('(file:data.json)') | +| oafp(str) | 20240812 | Executes an oafp (inception) with the provided map in JSON or [SLON](https://github.com/nmaguiar/slon) string format | oafp('(file:data.json)') | | ojob(file, jsslon) | 20241116 | Executes a 'file' oJob, with 'jsslon' as args, returning the output (if ow.ojob.output is used) | ojob('ojob.io/echo', obj) | | opath(str) | 20240801 | Inception function to go over other path filters in 'str' applied over the original object before current transformations | files[].{ name: filename, path: opath('originalPath') } | | path(obj, str) | 20240801 | Inception function to have other path filters in 'str' applied over 'obj' | path(@, 'filename') | @@ -176,7 +176,7 @@ Using the same unix “pipe” mechanism it’s possible to apply different cate | to_numAbbr(num) | 20240209 | Given an absolute number will return a string with SI abbreviation | to_numAbbr(`12345678`) | | to_number(any) | base | Transforms any input into a number | to_number(`123`) | | to_numSpace(num, space) | 20241207 | Transforms a number input to a string with thousands separator 'space' | to_numSpace(123456, ',') | -| to_slon(obj) | 20240215 | Given an object will return the SLON representation of it. | to_slon(@) | +| to_slon(obj) | 20240215 | Given an object will return the [SLON](https://github.com/nmaguiar/slon) representation of it. | to_slon(@) | | to_string(any) | base | Transforms any input into a string | to_string(`123`) | | to_toml(obj) | 20240502 | Given an object outputs a TOML format string if possible | to_toml(@) | | trim(str) | 20240209 | Given a string will return a trimmed version of it | trim(@) | diff --git a/docs/guides/oafp/oafp-template.md b/docs/guides/oafp/oafp-template.md index e8d45b3..00a79cb 100644 --- a/docs/guides/oafp/oafp-template.md +++ b/docs/guides/oafp/oafp-template.md @@ -28,7 +28,7 @@ Here are some of the available helpers: | $ft | uses the $ft format function | | $path | uses the $path function to query objects | | $from | uses the $from & fromNLinq to query objects | -| $oafp | uses the oafp function (inception) to parse the provided JSON/SLON string and return the results (tip: use with the #with helper) | +| $oafp | uses the oafp function (inception) to parse the provided JSON/[SLON](https://github.com/nmaguiar/slon) string and return the results (tip: use with the #with helper) | | $toSLON | shows the ow.format.toSLON version of an object | | $get | shows the corresponding value for a key on $get | | $getObj | equivalent to $get with the extra parameter for $$.get path | @@ -43,7 +43,7 @@ Here are some of the available helpers: | $pchart | shows an ansi ascii line chart with an object and a format string: "unit path:color:legend... [-min:0] [-max:100] [-hsize:40] [-vsize:10]" | | $output | shows an $output representation of an object (aObj as 1st arg and options in slon as 2nd arg) | | $cjson | shows an ansi ascii colority representation fo an object | -| $cslon | shows an ansi ascii colored SLON representation of an object | +| $cslon | shows an ansi ascii colored [SLON](https://github.com/nmaguiar/slon) representation of an object | | $pmap | shows an ansi ascii printMap representation of an object | | $jsmap | shows a HTML representation of an object | | $t | given a template and an object instance, as arguments, will process and return the template | diff --git a/docs/guides/oafp/oafp-usage.md b/docs/guides/oafp/oafp-usage.md index bd4d906..836ea6e 100644 --- a/docs/guides/oafp/oafp-usage.md +++ b/docs/guides/oafp/oafp-usage.md @@ -28,7 +28,7 @@ Takes an input, usually a data structure such as json, and transforms it to an e | from | An OpenAF nLinq path expression to filter output | | sql | A SQL expression to filter output | | sqlfilter | Enables the forcing of the sql filter parser (values: auto, simple, advanced) | -| sqlfiltertables | A JSON/SLON array composed of 'table' name and 'path' to each table's data to be used with the sqlfilter | +| sqlfiltertables | A JSON/[SLON](https://github.com/nmaguiar/slon) array composed of 'table' name and 'path' to each table's data to be used with the sqlfilter | | path | A JMESPath expression to filter output | | csv | If type=csv, the CSV options to use | | outkey | If defined the map/list output will be prefix with the provided key | @@ -38,14 +38,14 @@ Takes an input, usually a data structure such as json, and transforms it to an e | color | If 'true' will force colored output if available | | url | Retrieves data from the provided URL | | urlmethod | If 'url' is provided defines the http method to use if different from GET | -| urlparams | If 'url' is provided extra parameters (equivalent to OpenAF's $rest) can be provided in JSON/SLON | -| urldata | If 'url' is provided a JSON/SLON/text data can be provided | -| chs | A JSON/SLON map or array composed of an OpenAF channel 'name', 'type' and optional 'options' | +| urlparams | If 'url' is provided extra parameters (equivalent to OpenAF's $rest) can be provided in JSON/[SLON](https://github.com/nmaguiar/slon) | +| urldata | If 'url' is provided a JSON/[SLON](https://github.com/nmaguiar/slon)/text data can be provided | +| chs | A JSON/[SLON](https://github.com/nmaguiar/slon) map or array composed of an OpenAF channel 'name', 'type' and optional 'options' | | loop | If defined will loop the processing by the number of seconds provided | | loopcls | If 'true' and loop is defined it will clear the screen (or file) on each loop cycle | | libs | Comma delimited list of installed OpenAF's oPacks to consider to extend oafp's inputs, transformations and outputs | -| pipe | A JSON/SLON/YAML map for recursive call of oafp similar to using unix pipes (useful with -f) | -| -f | Enables to provide a JSON/SLON/YAML file with all the oafp parameters as a map | +| pipe | A JSON/[SLON](https://github.com/nmaguiar/slon)/YAML map for recursive call of oafp similar to using unix pipes (useful with -f) | +| -f | Enables to provide a JSON/[SLON](https://github.com/nmaguiar/slon)/YAML file with all the oafp parameters as a map | | -examples | Will access an internet based list of oafp examples and list them | | examples | Will search the provided keyword or 'category::subcategory' in the internet based list of oafp examples | | version | Alternative way to change the input to a map with the tool's version | @@ -71,7 +71,7 @@ List of data input types that can be auto-detected (through the file extension o | Input type | Description | |------------|-------------| -| ask | Interactively asks questions to an user (using JSON/SLON for OpenAF's askStruct) | +| ask | Interactively asks questions to an user (using JSON/[SLON](https://github.com/nmaguiar/slon) for OpenAF's askStruct) | | base64 | A base64 text format | | ch | An OpenAF channel format | | csv | A CSV format (auto-detected) | @@ -94,15 +94,15 @@ List of data input types that can be auto-detected (through the file extension o | md | A Markdown format | | mdtable | A Markdown table format | | ndjson | A NDJSON (new-line delimited JSON) format | -| ndslon | A NDSLON (new-line delimited SLON) format | +| ndslon | A NDSLON (new-line delimited [SLON](https://github.com/nmaguiar/slon)) format | | oaf | Takes an OpenAF scripting code to execute and use the result as input | -| oafp | Takes a JSON/SLON/YAML map input as parameters for calling a sub oafp process (arrays will call multiple oafp processes; inoafpseq=true will process sequentially) | -| ojob | Takes a JSON/SLON/YAML map input with a 'ojob' string and a 'args' map parameter | +| oafp | Takes a JSON/[SLON](https://github.com/nmaguiar/slon)/YAML map input as parameters for calling a sub oafp process (arrays will call multiple oafp processes; inoafpseq=true will process sequentially) | +| ojob | Takes a JSON/[SLON](https://github.com/nmaguiar/slon)/YAML map input with a 'ojob' string and a 'args' map parameter | | openmetrics | An OpenMetrics/Prometheus compatible format | | raw | Passes the input directly to transforms and output | | rawhex | Tries to read the input char by char converting into lines with the hexadecimal representation | | sh | Executes a shell command returning stdout, stderr and exitcode as a map | -| slon | A SLON format (auto-detected) | +| slon | A [SLON](https://github.com/nmaguiar/slon) format (auto-detected) | | snmp | A SNMP device source | | sql | One or more SQLs statements to AST (Abstract Syntax Tree) or beautified SQL | | toml | TOML format | @@ -123,12 +123,12 @@ These options will change the parsed input data included any filters provided. | arraytomapkey | String | For arraytomap=true defines the name of the map property that will be each element key (see arraytomapkeepkey) | | cmlt | Boolean | If true will accumulate the input values into an output array (useful with loop) | | correcttypes | Boolean | If true will try to convert alpha-numeric field values with just numbers to number fields, string date fields to dates and boolean fields | -| denormalize | String | Reverses 'normalize' given a JSON/SLON map with a normalize schema (see OpenAF's ow.ai.normalize.withSchema) | -| diff | String | A JSON/SLON map with a 'a' path and a 'b' path to compare and provide diff data | +| denormalize | String | Reverses 'normalize' given a JSON/[SLON](https://github.com/nmaguiar/slon) map with a normalize schema (see OpenAF's ow.ai.normalize.withSchema) | +| diff | String | A JSON/[SLON](https://github.com/nmaguiar/slon) map with a 'a' path and a 'b' path to compare and provide diff data | | field2byte | String | A comma delimited list of fields whose value should be converted to a byte abbreviation | | field2date | String | A comma delimited list of fields whose value should be converted to date values | | field2si | String | A comma delimited list of fields whose value should be converted to a SI abbreviation | -| field4map | Boolean | A comma delimited list of fields whose value should be converted from JSON/SLON string representation to a map | +| field4map | Boolean | A comma delimited list of fields whose value should be converted from JSON/[SLON](https://github.com/nmaguiar/slon) string representation to a map | | flatmap | Boolean | If true a map structure will be flat to just one level (optionally flatmapsep=[char] to use a different separator that '.') | | getlist | Number | If true will try to find the first array on the input value (if number will stop only after the number of checks) | | forcearray | Boolean | If true and if the input is map it will force it to be an array with that map as the only element | @@ -141,7 +141,7 @@ These options will change the parsed input data included any filters provided. | maptoarray | Boolean | If true will try to convert the input map to an array (see maptoarraykey) | | maptoarraykey | String | If maptoarray=true defines the name of the map property that will hold the key for each map in the new array | | merge | Boolean | If input is a list/array of maps will merge each element into one map | -| normalize | String | A JSON/SLON map with a normalize schema (see OpenAF's ow.ai.normalize.withSchema) | +| normalize | String | A JSON/[SLON](https://github.com/nmaguiar/slon) map with a normalize schema (see OpenAF's ow.ai.normalize.withSchema) | | numformat | String | For all number values applies a java.util.Formatter format (e.g. %,d) | | regression | String | Performs a regression (linear, log, exp, poly or power) over a provided list/array of numeric values | | removedups | Boolean | If true will try to remove duplicates from an array | @@ -149,7 +149,7 @@ These options will change the parsed input data included any filters provided. | removenulls | Boolean | If true will try to remove nulls and undefined values from a map or array | | searchkeys | String | Will return a map with only keys that match the provided string | | searchvalues | String | Will return am map with only values that match the provided string | -| set | String | Performs set operations (intersection by default) over an 'a' and 'b' path to an array defined in a JSON/SLON map | +| set | String | Performs set operations (intersection by default) over an 'a' and 'b' path to an array defined in a JSON/[SLON](https://github.com/nmaguiar/slon) map | | sortmapkeys | Boolean | If true the resulting map keys will be sorted | | spacekeys | String | Replaces spaces in keys with the provided string (for example, helpful to xml output) | | trim | Boolean | If true all the strings of the result map/list will be trimmed | @@ -174,7 +174,7 @@ List of available formats to use with the _output_ option: | chart | A line-chart like chart (usefull together with 'loop') | | cjson | A JSON forcely colored format | | cmd | Executes a command for each input data entry | -| cslon | A SLON format forcely colored | +| cslon | A [SLON](https://github.com/nmaguiar/slon) format forcely colored | | csv | A CSV format (only for list outputs) | | ctable | A table-like forcely colored format (only for list outputs) | | ctree | A tree-like forcely colored format | @@ -195,7 +195,7 @@ List of available formats to use with the _output_ option: | mdtable | A Markdown table format (only for list outputs) | | mdyaml | A multi document YAML format (only for list outputs) | | ndjson | A NDJSON (new-line delimited JSON) format | -| ndslon | A NDSLON (new-line delimited SLON) format | +| ndslon | A NDSLON (new-line delimited [SLON](https://github.com/nmaguiar/slon)) format | | openmetrics | Converts a map or list to OpenMetrics/Prometheus compatible format | | pjson | A JSON format with spacing (equivalent to prettyjson) | | prettyjson | A JSON format with spacing | @@ -203,7 +203,7 @@ List of available formats to use with the _output_ option: | raw | Tries to output the internal representation (string or json) of the input transformed data | | res | Outputs data to an OpenAF global 'res' (used in oJobs) | | schart | A static line-chart like chart (for a fixed list/array of values) | -| slon | A SLON format | +| slon | A [SLON](https://github.com/nmaguiar/slon) format | | sql | Outputs a series of SQL statements for an input list/array data | | stable | A table-like format with separation (only for list outputs) | | table | A table-like format without size constraints (only for list outputs) | @@ -217,7 +217,7 @@ List of available formats to use with the _output_ option: > For 'template' check https://docs.openaf.io/docs/guides/oafp/oafp-template.html -> For 'log' you can use 'logtheme' or the environment variable 'OAFP_LOGTHEME' with a JSON/SLON map with the colors to use '(errorLevel: red, warnLevel: yellow, timestamp: bold)' +> For 'log' you can use 'logtheme' or the environment variable 'OAFP_LOGTHEME' with a JSON/[SLON](https://github.com/nmaguiar/slon) map with the colors to use '(errorLevel: red, warnLevel: yellow, timestamp: bold)' --- @@ -231,13 +231,13 @@ List of options to use when _in=ch_: | Option | Type | Description | |--------|------|-------------| -| inch | String | A JSON/SLON configuration string with type and options/url | +| inch | String | A JSON/[SLON](https://github.com/nmaguiar/slon) configuration string with type and options/url | | inchall | Boolean | A boolean flag to determine if the input map will be used for a getAll query | > Example of options provided in JSON: inch="{type:'mvs',options:{file:'data.db'}}" -> Example of options provided in SLON: inch="(type: remote, url: 'http://some.host:1234/chname')" +> Example of options provided in [SLON](https://github.com/nmaguiar/slon): inch="(type: remote, url: 'http://some.host:1234/chname')" -The input data can be JSON/SLON/YAML and will be used for the 'get' or 'getAll' query. +The input data can be JSON/[SLON](https://github.com/nmaguiar/slon)/YAML and will be used for the 'get' or 'getAll' query. > You can use sBuckets variables (e.g. secKey, secRepo, secBucket, secPass, secMainPass, secFile) on the 'options' map to fill it. @@ -422,7 +422,7 @@ List of options to use when _in=sh_: |--------|------|-------------| | inshformat | String | The format to parse stdout and stderr between raw, yaml or json (default) | -The input data JSON/SLON/YAML map can be composed of: +The input data JSON/[SLON](https://github.com/nmaguiar/slon)/YAML map can be composed of: * cmd (mandatory string/array) - the command to execute * envs (map) - a series of environment variables to use @@ -443,16 +443,16 @@ List of options to use when _in=snmp_: | insnmptimeout | Number | The timeout to wait for a reply | | insnmpretries | Number | Number of retries in case of failure | | insnmpversion | Number | Version of the SNMP server (e.g. 2, 3) | -| insnmpsec | String | A JSON/SLON representation of security attributes (see below) | +| insnmpsec | String | A JSON/[SLON](https://github.com/nmaguiar/slon) representation of security attributes (see below) | The input data can be either: * A single string with an OID * Multiple lines each with just an OID - * A JSON/SLON/YAML array of OID strings - * A JSON/SLON/YAML map with OID string values + * A JSON/[SLON](https://github.com/nmaguiar/slon)/YAML array of OID strings + * A JSON/[SLON](https://github.com/nmaguiar/slon)/YAML map with OID string values -The 'insnmpsec' (in case of version 3 or newer) entry should be a JSON/SLON map with: +The 'insnmpsec' (in case of version 3 or newer) entry should be a JSON/[SLON](https://github.com/nmaguiar/slon) map with: | Entry | Description | |-------|-------------| @@ -472,7 +472,7 @@ List of options to use when _in=sql_: | Option | Type | Description | |--------|------|-------------| | sqlparse | Boolean | If true instead of returning a SQL AST representation it will beautify the SQL statement(s) | -| sqloptions | String | A JSON/SLON map with options for sqlparse=true | +| sqloptions | String | A JSON/[SLON](https://github.com/nmaguiar/slon) map with options for sqlparse=true | SQL options available: @@ -525,7 +525,7 @@ List of options to use when _in=base64_ or _out=base64_: ### 🧾 CSV input/output options -List of options to use with the _inputcsv_ input option (when input type=csv) and/or the _csv_ output option (when output=csv). Both expect the corresponding options to be provided in single JSON or SLON value (see below for example): +List of options to use with the _inputcsv_ input option (when input type=csv) and/or the _csv_ output option (when output=csv). Both expect the corresponding options to be provided in single JSON or [SLON](https://github.com/nmaguiar/slon) value (see below for example): | Option | Type | Description | |--------|------|-------------| @@ -538,7 +538,7 @@ List of options to use with the _inputcsv_ input option (when input type=csv) an | withNullString | String | String to use as representation of null values | > Example of options provided in JSON: csv="{withHeader:false,withDelimiter:'|'}" -> Example of options provided in SLON: inputcsv="(withHeader: false, quoteMode: ALL)" +> Example of options provided in [SLON](https://github.com/nmaguiar/slon): inputcsv="(withHeader: false, quoteMode: ALL)" > You can also use _incsv_ as a shortcut for _inputcsv_ @@ -554,7 +554,7 @@ List of options to use when _cmlt=true_: | Option | Type | Description | |--------|------|-------------| -| cmltch | String | A JSON/SLON OpenAF channel configuration string with type and options/url (defaults to simple) | +| cmltch | String | A JSON/[SLON](https://github.com/nmaguiar/slon) OpenAF channel configuration string with type and options/url (defaults to simple) | | cmltsize | Number | The number of input data values to keep (default 100). If -1 it will keep without a limit | --- @@ -565,7 +565,7 @@ List of options to use when _diff=..._: | Option | Type | Description | |--------|------|-------------| -| difftheme | String | A JSON/SLON map with the colors to use if color = true | +| difftheme | String | A JSON/[SLON](https://github.com/nmaguiar/slon) map with the colors to use if color = true | | diffnlines | Boolean | If true will append each line with a line number of the final result of the differences between 'a' and 'b' (just for rough reference) | | diffwords | Boolean | If true and the input is text based will perform the diff at the word level | | diffwordswithspace | Boolean | If true and the input is text based will perform the diff at the word + spaces level | @@ -590,7 +590,7 @@ List of options to use when _in=llm_ or _llmprompt=..._: | Option | Type | Description | |--------|------|-------------| | llmenv | String | The environment variable containing the value of 'llmoptions' (defaults to OAFP_MODEL) | -| llmoptions | String | A JSON or SLON string with OpenAF's LLM 'type' (e.g. openai/ollama), 'model' name, 'timeout' in ms for answers, 'url' for the ollama type or 'key' for openai type | +| llmoptions | String | A JSON or [SLON](https://github.com/nmaguiar/slon) string with OpenAF's LLM 'type' (e.g. openai/ollama), 'model' name, 'timeout' in ms for answers, 'url' for the ollama type or 'key' for openai type | | llmconversation | String | File to keep the LLM conversation | | llmimage | String | For visual models you can provide a base64 image or an image file path or an URL of an image | @@ -608,7 +608,7 @@ List of options to use when _regression=..._: |--------|------|-------------| | regressionpath | String | The path to the array of y values for the regression formulas | | regressionx | String | Optional path to the array of x values for the regression formulas (defaults to 1, 2, 3, ...) | -| regressionoptions | String | A JSON/SLON configuration with order (defaults to 2) and/or precision (defaults to 5) | +| regressionoptions | String | A JSON/[SLON](https://github.com/nmaguiar/slon) configuration with order (defaults to 2) and/or precision (defaults to 5) | | regressionforecast | String | Optional path to an array of x values for which to forecast the corresponding y | > Example: ```oafp data="[1,2,3]" regression=linear regressionforecast="from_slon('[4|5]')" out=ctable``` @@ -638,12 +638,12 @@ List of options to use when _out=ch_: | Option | Type | Description | |--------|------|-------------| -| ch | String | A JSON/SLON configuration string with type and options/url | +| ch | String | A JSON/[SLON](https://github.com/nmaguiar/slon) configuration string with type and options/url | | chkey | String | A comma delimited list of map keys to build a key from each array value | | chunset | Boolean | If true the input data will be used to unset data on the output channel instead of set | > Example of options provided in JSON: ch="{type:'mvs',options:{file:'data.db'}}" -> Example of optiosn provided in SLON: ch="(type: remote, url: 'http://some.host:1234/chname')" +> Example of optiosn provided in [SLON](https://github.com/nmaguiar/slon): ch="(type: remote, url: 'http://some.host:1234/chname')" > You can use sBuckets variables (e.g. secKey, secRepo, secBucket, secPass, secMainPass, secFile) on the 'options' map to fill it. @@ -757,7 +757,7 @@ List of options to use when _out=grid_: | Option | Type | Description | |--------|------|-------------| -| grid | String | A JSON/SLON configuration composed of an array with another array per grid line. Each line array should have a map per column (see below for the map options) | +| grid | String | A JSON/[SLON](https://github.com/nmaguiar/slon) configuration composed of an array with another array per grid line. Each line array should have a map per column (see below for the map options) | Each map should be composed of a: @@ -870,7 +870,7 @@ List of options to use when _out=xls_: |--------|------|-------------| | xlsfile | String | The output filename (if not defined a temporary file will be used to open with the OS's Excel-compatible application) | | xlssheet | String | The name of sheet to use (default to 'data') | -| xlsformat | String | A SLON or JSON string with the formatting of the output file (e.g. (bold: true, borderBottom: "medium", borderBottomColor: "red")) | +| xlsformat | String | A [SLON](https://github.com/nmaguiar/slon) or JSON string with the formatting of the output file (e.g. (bold: true, borderBottom: "medium", borderBottomColor: "red")) | | xlsopen | Boolean | If false it won't try to open the OS's Excel-compatible application (defaults to true) | | xlsopenwait | Number | The amount of time, in ms, to keep the temporary file for the OS's Excel-compatible application to start and open the file | diff --git a/docs/guides/ojob/oafp-shortcut.md b/docs/guides/ojob/oafp-shortcut.md index 4bf3c5a..fdd4da3 100644 --- a/docs/guides/ojob/oafp-shortcut.md +++ b/docs/guides/ojob/oafp-shortcut.md @@ -9,7 +9,7 @@ grand_parent: Guides Using the oJob's oafp shortcut it's possible to build oJobs that use oafp functionality to process input data into output data. -In this example a SLON string is parsed by oafp and set to the 'test' key. Then the data is retrieved from the 'test' key and each element is incremented setting the result back to the 'test' key. Then, finally, it outputs the 'test' key in a _ctree_ format: +In this example a [SLON](https://github.com/nmaguiar/slon) string is parsed by oafp and set to the 'test' key. Then the data is retrieved from the 'test' key and each element is incremented setting the result back to the 'test' key. Then, finally, it outputs the 'test' key in a _ctree_ format: ```yaml todo: @@ -43,4 +43,4 @@ Executing this oJob you should be able to see a similar result to: ╭ a: 2 ├ b: 3 ╰ c: 4 -``` \ No newline at end of file +``` diff --git a/docs/guides/ojobio/use-ojob-io-mcps-with-vscode.md b/docs/guides/ojobio/use-ojob-io-mcps-with-vscode.md index ff3f64d..1c57aca 100644 --- a/docs/guides/ojobio/use-ojob-io-mcps-with-vscode.md +++ b/docs/guides/ojobio/use-ojob-io-mcps-with-vscode.md @@ -42,7 +42,7 @@ docker run -i --pull always \ -e chs="(_name: mydata, _type: file, _rw: true, file: /data/data.json)" \ openaf/ojobc:edge-t8 ``` -- `chs`: describe one or more channels (file, simple, mvs, …) with SLON/JSON. +- `chs`: describe one or more channels (file, simple, mvs, …) with [SLON](https://github.com/nmaguiar/slon)/JSON. - `libs`: preload comma-separated libraries or `@oPack/library.js`. - `onport`: expose an HTTP `/mcp` endpoint while keeping STDIO available. @@ -117,7 +117,7 @@ docker run -i --pull always \ openaf/ojobc:edge-t8 ``` - `libs`: preload comma-separated oPacks (`minia`, `ojob`, …). -- `params`: SLON map with default arguments for repeated runs. +- `params`: [SLON](https://github.com/nmaguiar/slon) map with default arguments for repeated runs. - `onport`: publish the HTTP `/mcp` endpoint. ### mcp-random — deterministic-friendly random data helpers diff --git a/docs/reference/ow_ai.md b/docs/reference/ow_ai.md index d798c05..ca6423e 100644 --- a/docs/reference/ow_ai.md +++ b/docs/reference/ow_ai.md @@ -26,7 +26,7 @@ aModel can be a map with the following properties: - headers: a map with the headers to use in the requests (e.g. { "Content-Type": "application/json" }) - params: a map with the parameters to use in the requests (e.g. { "max_tokens": 1000, "top_p": 1, "frequency_penalty": 0, "presence_penalty": 0 }) -If aModel is not provided, it will try to get the model from the environment variable "OAF_MODEL" with the map in JSON or SLON format. +If aModel is not provided, it will try to get the model from the environment variable "OAF_MODEL" with the map in JSON or [SLON](https://github.com/nmaguiar/slon) format. ```` ### $gpt.close diff --git a/docs/reference/ow_template.md b/docs/reference/ow_template.md index 94b54fe..458197f 100644 --- a/docs/reference/ow_template.md +++ b/docs/reference/ow_template.md @@ -63,7 +63,7 @@ Adds custom helpers: - $ft -- uses the $ft format function - $path -- uses the $path function to query objects - $from -- uses the $from & fromNLinq to query objects - - $oafp -- uses the oafp function to parse the provided JSON/SLON string and return the results + - $oafp -- uses the oafp function to parse the provided JSON/[SLON](https://github.com/nmaguiar/slon) string and return the results - $toSLON -- returns the ow.format.toSLON version of an object - $get -- returns the corresponding value for a key on $get - $getObj -- equivalent to $get with the extra parameter for $$.get path @@ -78,7 +78,7 @@ Adds custom helpers: - $pbars -- returns an ansi ascii tree of progress bars with a format string: "unit path:color:legend... [-min:0] [-max:100] [-hsize:40]" - $output -- returns an $output representation of an object (aObj as 1st arg and options in slon as 2nd arg) - $cjson -- returns an ansi ascii colority representation fo an object - - $cslon -- returns an ansi ascii colored SLON representation of an object + - $cslon -- returns an ansi ascii colored [SLON](https://github.com/nmaguiar/slon) representation of an object - $pmap -- returns an ansi ascii printMap representation of an object - $jsmap -- returns a HTML representation of an object - $t -- given a template and an object instance, as arguments, will process and return the template diff --git a/docs/reference/scope.md b/docs/reference/scope.md index f6bf11c..3b93fbe 100644 --- a/docs/reference/scope.md +++ b/docs/reference/scope.md @@ -1307,7 +1307,7 @@ Tries to convert aJavaArray into a native an array. __AF.fromJSSLON(aString) : Object__ ```` -Tries to convert the provided aString into an object. The string might be JSON or SLON. +Tries to convert the provided aString into an object. The string might be JSON or [SLON](https://github.com/nmaguiar/slon). ```` ### AF.fromNLinq @@ -1328,7 +1328,7 @@ Tries to convert aMap into a similiar XML strucuture returned as string. Note th __AF.fromSLON(aString) : Map__ ```` -Converts a SLON (https://github.com/nmaguiar/slon) string representation into the original map. +Converts a [SLON](https://github.com/nmaguiar/slon) string representation into the original map. ```` ### AF.fromSQL @@ -1426,14 +1426,14 @@ Swaps the elements at anIndex1 and anIndex2 in anArray. Returns the new array wi __AF.toCSLON(aObject, aTheme) : String__ ```` -Converts aObject map/array into SLON representation with ansi colors (see more in help for ow.format.toCSLON) +Converts aObject map/array into [SLON](https://github.com/nmaguiar/slon) representation with ansi colors (see more in help for ow.format.toCSLON) ```` ### AF.toSLON __AF.toSLON(aObject, aTheme) : String__ ```` -Converts aObject map/array into SLON representation (see more in help for ow.format.toSLON) +Converts aObject map/array into [SLON](https://github.com/nmaguiar/slon) representation (see more in help for ow.format.toSLON) ```` ### af.toTOML @@ -1843,7 +1843,7 @@ Returns a map of key and values with the operating system environment variables. __getEnvsDef(aEnv, aVar, aDefault, isJson) : Object__ ```` -Given an environment variable aEnv name will check if a value is provided and return it if so. Otherwise it will check the value of aVar and return it if defined. If aVar is also not defined it will return aDefault. Optionally if isJson=true the value of the provided aEnv will be parsed from JSON or SLON. +Given an environment variable aEnv name will check if a value is provided and return it if so. Otherwise it will check the value of aVar and return it if defined. If aVar is also not defined it will return aDefault. Optionally if isJson=true the value of the provided aEnv will be parsed from JSON or [SLON](https://github.com/nmaguiar/slon). ```` ### getFromZip