Introduction
Welcome to the IdeasCloud Setup Documentation. Here you will find usefull assets to create any type of project.
Concepts:
- Setup: Project setup structured and defined using JSON format.
- Compiler: Tool to apply context information to a RAW JSON specification.
- Action: Step of a backend flow (pipeline) that executes an specific job, for example, register an element into a database model.
- Pipeline: Set of actions to be executed sequentially, used in back-end components.
Compiler
# RAW JSON
{
"|&|email": "&.clientParams.email",
"|$|fullname": {
"fnKey": "concatText",
"params": {
"joinKey": ", ",
"items": [
{
"|&|text": "&.clientParams.lastname"
},
{
"|&|text": "&.clientParams.firstname"
}
]
}
}
}
# Compiled JSON
{
"email": "demo@email.com",
"fullname": "Smith, John"
}
Injects context information into a RAW JSON specification.
To use a context variable append |&|
before the attribute name and the compiler will replace the value of the attribute with the specified context variable.
To use a function append |$|
before the attribute name and the compiler will replace the value of the attribute with the function output. In this case two attributes are required, the function name (fnKey
) and the function params (params
).
Setup Structure
{
"globalVariables": {},
"models": [],
"services": [],
"functions": [],
"daemons": [],
"webapps": [],
"mobileapps": []
}
Setup components:
globalVariables
: Stores global variables, accesible in back or front end contextmodels
: Database models definitionsservices
: HTTP Endpointsfunctions
: Stored pipelines, useful to avoid DRYdaemons
: Scheduled pipelines executionswebapps
: Web applications definitionsmobileapps
: Mobile applications definitions
Models
{
"key": "user",
"name": "user",
"schema": {
"properties": {
"name": { "type": "string" },
"email": { "type": "string" },
"phone": { "type": "string" }
},
"required": ["name", "email"]
}
}
Representation of a specific type of information in the database.
Structure:
key
: Model identifier (camelCase)name
: Model nameschema
: Schema of the model, uses JSON Schema engine
Functions
{
"key": "myFunction",
"paramsSchema": {
"properties": {
"details": { "type": "string" }
},
"required": ["details"]
},
"pipeline": [
{
"action": "registerElement",
"params": {
"modelKey": "log",
"mappingSetup": {
"|&|details": "&.functionParams.details"
}
}
}
]
}
Stored pipeline, can be executed from any pipeline.
Structure:
key
: Function identifier (camelCase)paramsSchema
: Schema of the function parameters, uses JSON Schema enginepipeline
: List of actions to execute.
Services
{
"key": "user",
"schema": {
"properties": {
"name": { "type": "string" },
"email": { "type": "string" },
"phone": { "type": "string" }
},
"required": ["name", "email"]
},
"pipeline": [
{
"action": "registerElement",
"params": {
"modelKey": "user",
"mappingSetup": {
"|&|name": "&.clientParams.name",
"|&|email": "&.clientParams.email",
"|&|phone": "&.clientParams.phone"
}
}
}
]
}
Endpoint to access your project using HTTP
Structure:
key
: Service identifier (camelCase)schema
: Schema of the sevice parameters, uses JSON Schema enginepipeline
: List of actions to execute.
Daemons
{
"key": "myDaemon",
"trigger": {
"weekDays": "0123456",
"at": 1050
},
"enableMultipliers": false,
"executionPipeline": [
{
"action": "resolveActionParams",
"params": {
"|&|item": "&.multiplierItem"
}
}
]
}
Pipleline scheduled to execute in specified intervals.
Structure:
key
: Daemon identifier (camelCase)trigger
: Condition to trigger daemonenableMultipliers
: Enabled when multiple items will be executed.executionPipeline
: List of actions to execute (per multiplir if enabled).
Web Apps
{
"key": "othe-test-web-app",
"middlewaresPipeline": [],
"default": false,
"plugins": [],
"template": "",
"params": {}
}
Web application.
Structure:
key
: Web app identifier (camelCase)middlewaresPipeline
: List of actions to execute before resolving the web app (useful for authentication).default
: Enabled if is the default web app.template
: (Required is using template) Template keyparams
: (Required is using template) Template params, each template provides documentation to set this attributecustomWebappId
: (Required is using custom webapps) Custom webapp id
Compiler functions
generateRandomString
# Input
{
"fnKey": "generateRandomString",
"params": {
"abc": "abcdefghijklmnopqrstuvwxyz0123456789",
"size": 6
}
}
# Output
"a59x0T"
Available in: General
Generates a random string only with the characters indicated in abc
:
Params:
abc
: String with valid characters.size
: Size of the resulting string.
arrayMap#
#Input
{
"fnKey": "arrayMap#",
"params": {
"array": [
{
"x": 1
},
{
"x": 2
},
{
"x": 3
}
],
"mapping": [
{ "key": "x" }
]
}
}
#Output
[1,2,3]
Function in experimental development Available in: General
Solve an array with the specified structure resulting in a new array.
Params:
array
: The list to be mapped.mapping
key
: Selected key.
arrayRootMap
#Input
{
"fnKey": "arrayRootMap",
"params": {
"array": [
{
"x": 1
},
{
"x": 2
},
{
"x": 3
}
],
"mappingSetup": {
"|&|rootValue": "&.item.x"
}
}
}
#Output
[1,2,3]
Available in: General
Solve an array with the specified structure resulting in a new array.
Params:
array
: The list to be mapped.mappingSetup
rootValue
: The value chosen for each object in the list.
arrayMapToAttribute
#Input
{
"fnKey": "arrayMapToAttribute",
"params": {
"attributePath": "lastname"
"array": [
{
"x": 1,
"lastname": "García"
},
{
"x": 2,
"lastname": "Perez"
},
{
"x": 3,
"lastname": "Soto"
}
],
}
}
#Output
["Garcia", "Perez", "Soto"]
Function in experimental development Available in: General
Solve an array with the specified structure resulting in a new array.
Params:
array
: The list to be mapped.attributePath
: Name of the attribute to search.
conditionalExecution
#Input
{
"fnKey": "conditionalExecution",
"params": {
"condition": true,
"onConditionMet": {
"fnKey": "consoleLog",
"params": {
"message": "Condition met"
}
},
"onConditionNotMet": {
"fnKey": "consoleLog",
"params": {
"message": "Condition not met"
}
}
}
}
#Output
{
"fnKey": "consoleLog",
"params": {
"message": "Condition met"
}
},
Available in: General
Executes the specified function depending on the condition (if is met or not)
Params:
condition
: true or false.onConditionMet
: Function to execute if the condition is met.onConditionNotMet
: Function to execute if the condition is not met.
randomResolve
#Input
{
"fnKey": "randomResolve",
"params": {
"items": [
{
"value": 1
},
{
"value": 2
},
{
"value": 3
}
]
}
}
#Output
3
Available in: General
Resolves a random item from the given array
Params:
items
: The list to be evaluated.
resolveSwitchCase
#Input
{
"fnKey": "resolveSwitchCase",
"params": {
"defaultValue": "Invalid option",
"value": 1,
"cases": [
{
"condition": 1,
"value": "Option 1"
},
{
"condition": 2,
"value": "Option 2"
}
]
}
}
#Output
"Option 1"
Available in: General
Resolves value when case condition is met
Params:
defaultValue
: Answer if no condition is met.value
: Value to evaluate.cases
: A list with the conditions.condition
: Value to compare.value
: Response.
generateObjectFromArrayWithConditional
#Input
{
"fnKey": "generateObjectFromArrayWithConditionalAttributes",
"params": {
"array": [
{
"condition": true,
"value": "Tim",
"key": "name"
},
{
"condition": false,
"value": "Roberto",
"key": "name"
}
]
}
}
#Output
{
"name": "Tim"
}
Available in: General
Resolves an object with the keys that mets condition (if condition exists)
Params:
array
: The list to be evaluated.condition
: If it is true the object related to this condition will be returned.value
: The value that will be returned.key
: The object key with which the object will be returned.
generateRandomColor
# Input
{
"fnKey": "generateRandomColor",
"params": {
"representation": "rgb"
}
}
# Output
"rgb( 59, 93, 13 )"
Available in: General
Generates a random color
Params:
representation
?: (Optional)rgb
(Default) orhsl
generateRandomColorsArray
# Input
{
"fnKey": "generateRandomColorsArray",
"params": {
"itemsNumber": 3,
"representation": "rgb"
}
}
# Output
[
"rgb( 59, 93, 13 )",
"rgb( 23, 43, 14 )",
"rgb( 24, 12, 67 )"
]
Available in: General
Generates a random color
Params:
representation
?: (Optional)rgb
(Default) orhsl
conditionalResolve
#Input
{
"fnKey": "conditionalResolve",
"params": {
"condition": true,
"valueOnConditionMet": "Condition met",
"valueOnConditionNotMet": "Condition not met"
}
}
#Output
"Condition met"
Available in: General
Resolves the value depending on the condition status (if is met or not)
Params:
condition
: Condition to be evaluated.valueOnConditionMet
: Response ifcondition
is true.valueOnConditionNotMet
: Response ifcondition
is false.
consoleLog
{
"fnKey": "consoleLog",
"params": {
"asd": 123
}
}
Available in: Front-End
Logs parameters (parsed and raw)
Params:
asd
: Value to be displayed.
httpStatusCodeIsError
#Input
{
"fnKey": "httpStatusCodeIsError",
"params": {
"statusCode": 201
}
}
#Output
false
Available in: Back-End
Resolves true when the passed status value is an error
Params:
statusCode
: A number that represents the code of the http response.
default
#Input
{
"fnKey": "default",
"params": {
"value": "testing"
"defaultValue": "mydefault"
}
}
#Output
"testing"
Available in: General
Resolves the value passed, if value is not available resolves the default value.
Params:
value
: The value to display, if it is null, false or undefined,defaultValue
will be displayed.defaultValue
: Default displayed value.
mathFloor
# Input
{
"fnKey": "mathFloor",
"params": {
"value": 12.99
}
}
# Output
12
Available in: General
Applies the math floor operation to the given value
Params:
value
: The value to evaluate.
mathCeil
# Input
{
"fnKey": "mathCeil",
"params": {
"value": 12.1
}
}
# Output
13
Available in: General
Applies the math ceil operation to the given value
Params:
value
: The value to evaluate.
mathRound
# Input
{
"fnKey": "mathRound",
"params": {
"value": 12.1
}
}
# Output
12
Available in: General
Applies the math ceil operation to the given value
Params:
value
: The value to evaluate.
mathOperation
#Input
{
"fnKey": "mathOperation",
"params": {
"operation": "*",
"items": [
{ "value": 5 },
{ "value": 3 },
{ "value": 2 }
]
}
}
#Output
30
Available in: General
Resolves the math operation with the given values
Params:
operation
: The operation can be*
,+
,/
orpow
.items
: List of values to be evaluated.
resolveItem#
#Input
{
"fnKey": "resolveItem#",
"params": {
"context": "Context",
}
}
#Output
Function in experimental development Available in: General
changeCase
#Input
{
"fnKey": "changeCase",
"params": {
"text": "I am the best",
"case": "upperCase"
}
}
#Output
"I AM THE BEST"
Available in: General
Changes the case of the text
Params:
text
: Text to evaluate.case
:upperCase
orlowerCase
jsonStringify
#Input
{
"fnKey": "jsonStringify",
"params": {
"data": { "example": "This Will be parsed" },
"indentation": 2
}
}
#Output
"
{
\"example\": \"This Will be parsed\"
}
"
Available in: General
Converts an object to a JSON text string.
Params:
data
: Object to be processed.indentation
?: Text to evaluate.
breakDownObjectByAttributes
#Input
{
"fnKey": "breakDownObjectByAttributes",
"params": {
"object": {
"a": "test",
"b": "test",
"c": "test",
"d": "test"
},
"skipEmpty": true
}
}
#Output
[
{
"key": "a",
"value": "test"
},
{
"key": "b",
"value": "test"
},
{
"key": "c",
"value": "test"
},
{
"key": "d",
"value": "test"
}
]
Available in: General
Transform the object to an array with value and key.
Params:
object
: Input object.skipEntry
: .
getBaseTextSelector
#Input
{
"fnKey": "getBaseTextSelector",
"params": {
"text": "This is an example text?. & I am very happy."
}
}
#Output
"this is an example text i am very happy"
Available in: General
Remove selectors in input text.
Params:
text
: Input text.
jsonParse
#Input
{
"fnKey": "jsonParse",
"params": {
"data": "{ \"example\": \"This Will be parsed\" }"
}
}
#Output
{
"example": "This Will be parsed"
}
Available in: General
Parses the passed string
Params:
data
: Object to be processed.
arrayEvery
# Input
{
"fnKey": "arrayEvery",
"params": {
"array": [
{
"condition": true
},
{
"condition": false
}
]
}
}
# Output
false
Available in: General
Determines if all elements in the array satisfy a condition.
Params:
array
: List of elements to be processed.condition
: Condition to be evaluated.
arraySome
# Input
{
"fnKey": "arrayEvery",
"params": {
"array": [
{
"condition": true
},
{
"condition": false
}
]
}
}
# Output
true
Available in: General
Return true if some conditions are met.
Params:
array
: List of elements to be processed.condition
: Condition to be evaluated.
arrayReverse
# Input
{
"fnKey": "arrayReverse",
"params": {
"array": [1,2,3,4,5,6,7]
}
}
# Output
[7,6,5,4,3,2,1]
Available in: General
Returns the given array with reverse
Params:
array
: List of elements to be processed.
splitText
# Input
{
"fnKey": "splitText",
"params": {
"splitKey": ".",
"splitRegExp": "",
"splitRegExpFlags": "",
"text": "This is a example Text. Thanks for supporting our community"
}
}
# Output
[
"This is a example Text",
" Thanks for supporting our community"
]
Available in: General
Splits the given text
Params:
text
: Text to be processed.splitKey
: (Or splitRegExp)Separator.splitRegExp
?: (Or splitKey) RegExp separator.splitRegExpFlags
?: (Optional) RegExp flags.
toDateObject
# Input
{
"fnKey": "toDateObject",
"params": {
"date": 12212434123
}
}
# Output
"1970-05-22T08:20:34.123Z"
Available in: General
Returns a Date type with the given date
Params:
date
: Entry date.
textMatchesExpression
# Input
{
"fnKey": "textMatchesExpression",
"params": {
"text": "This is a example Text. Thanks for supporting our community",
"matchKey": "T",
"matchRegExp": "",
"matchRegExpFlags": ""
}
}
# Output
false
Available in: General
Returns true if text matches the expression
Params:
text
: Entry text.matchKey
?: (Or matchRegExp) String to be searched for in the text.matchRegExp
?: (Or matchKey) RegExp to be searched for in the text.matchRegExpFlags
?: (Optional) RegExp flags.
multipleActions
# Input
{
"fnKey": "multipleActions",
"params": {
"actions": [
{
"action": {
"fnKey": "arrayReverse",
"params": {
"array": [1,2,3,4]
}
}
},
{
"action": {
"fnKey": "not",
"params": {
"value": false
}
}
}
]
}
}
# Output
null
Available in: General
Execute multiple actions
Params:
actions
: List of actions.action
: Object containing a function.
assignItemInArrayPosition
# Input
{
"fnKey": "assignItemInArrayPosition",
"params": {
"array": [1,2,3,4,5,6,7],
"index": 3,
"item": 999
}
}
# Output
[
1,
2,
3,
999,
5,
6,
7
]
Available in: General
Assign a value in the given array position
Params:
array
: The list that will be analyzed.index
: Position of the item to be replaced.item
: New value in array.
removeItemInArrayPosition
# Input
{
"fnKey": "removeItemInArrayPosition",
"params": {
"array": [1,2,3,4,5,6,7],
"index": 3
}
}
# Output
[
1,
2,
3,
5,
6,
7
]
Available in: General
Removes the item in the given array position
Params:
array
: The list that will be analyzed.index
: Position of the item to be deleted.
pushItemInArray
# Input
{
"fnKey": "pushItemInArray",
"params": {
"array": [1,2,3,4],
"item": 5
}
}
# Output
[1,2,3,4,5]
false
Available in: General
Pushes an item to the given array and returns it
Params:
array
: The list that will be analyzed.item
: New value in array.
assignItemInObject
# Input
{
"fnKey": "assignItemInObject",
"params": {
"object": { "name": "John" },
"key": "lastname",
"item": "Doe"
}
}
# Output
{
"name": "John",
"lastname": "Doe"
}
Available in: General
Assigns an item in key
Params:
object
: The object that will be analyzed.key
: Name of the property that will be added to the object.item
: Value of the new property.
generateDateFromMSDifferenceFromNow
# Input
{
"fnKey": "generateDateFromMSDifferenceFromNow",
"params": {
"msDifference": 3600
}
}
# Output
"2021-04-20T00:35:51.360Z"
Available in: General
Generates a date applying the timestamp difference from current timestamp
Params:
msDifference
: Timestamp.
getArrayItemAtIndex
# Input
{
"fnKey": "getArrayItemAtIndex",
"params": {
"array": ["Hello","Do","You","Have","Some","Money"],
"index": 2
}
}
# Output
"You"
false
Available in: General
Resolves the item in the given index of the array
Params:
array
: Array to be evaluate.index
: Postion of the element.
concatArray
# Input
{
"fnKey": "concatArray",
"params": {
"items": [
{ "array": [1,2,3,4,5] },
{ "array": [6,7,8,9,10] }
]
}
}
# Output
[1,2,3,4,5,6,7,8,9,10]
Available in: General
Concats given arrays
Params:
items
: List to be evaluated.array
: Array to be concatenated.
toDateString
# Input
{
"fnKey": "toDateString",
"params": {
"date": 9999912399
}
}
# Output
"Sun Apr 26 1970"
Available in: General
Returns a string from the given date
Params:
date
: The date that will be analyzed.
toTimeString
# Input
{
"fnKey": "toTimeString",
"params": {
"time": 3600
}
}
# Output
"60:00 hrs"
Available in: General
Resolves the time of the given time
Params:
time
: The time in minutes.
getMsFromDate
# Input
{
"fnKey": "getMsFromDate",
"params": {
"date": "Sun Apr 26 1970"
}
}
# Output
9936000000
Available in: General
Resolves the milliseconds from the given date.
Params:
date
: The date that will be analyzed.
setUTCTimeForDate
# Input
{
"fnKey": "setUTCTimeForDate",
"params": {
"date": "Sun Apr 26 1970",
"time": {
"hours": 1,
"minutes": 10,
"seconds": 30
}
}
}
# Output
9940230000
Available in: General
Returns the UTC value from the given date
Params:
date
: The date that will be analyzed.time
: The time that will be analyzed.hours
minutes
seconds
fillWithLeftZerosWhenRequired
# Input
{
"fnKey": "fillWithLeftZerosWhenRequired",
"params": {
"value": 12.2,
"size": 10
}
}
# Output
"00000012.2"
Available in: General
Returns a string with the given number with 0's if missing
Params:
value
: The number that will be analyzed.size
: The size of the new number.
conditional
# Input
{
"fnKey": "conditional",
"params": {
"operator": "eq",
"items": [
{ "value": 1 },
{ "value": 4 }
]
}
}
# Output
false
Available in: General
Resolves the result of the conditional operation
Params:
operator
: This can beand
,or
,eq
,neq
,gt
,gte
,lt
,lte
items
: The list that will be analized.
not
# Input
{
"fnKey": "not",
"params": {
"value": true
}
}
# Output
false
Available in: General
Takes truth to falsity and vice versa.
Params:
value
: The value that will be analyzed.
concatText
# Input
{
"fnKey": "concatText",
"params": {
"joinKey": ", ",
"items": [
{
"|&|text": "&.clientParams.lastname"
},
{
"|&|text": "&.clientParams.firstname"
}
]
}
}
# Output
"Smith, John"
Available in: General
Join all the elements of items
into a string and return this string
Params:
joinKey
: It is a string used to separate each of the elements.items
: It is the list that contains all the elements that will be concatenated.
openLink
# Input
{
"fnKey": "openLink",
"params": {
"url": "https://ideascloud.io",
"externalTab": true
}
}
# Output
null
Available in: Front-end
Opens a url in the current tab or a new one if specified
Params:
url
: Url that will be processed.externalTab
: Conditional that evaluates whether the URL is opened in the current tab or a new tab.
showPrompt
# Input
{
"fnKey": "showPrompt",
"params": {
"message": "Insert a value example",
"value": "default value"
}
}
# Output
null
Available in: Front-end
Show a prompt
on the web page
Params:
message
: Prompt message.value
: default value if there is no response at the prompt.
showConfirm
# Input
{
"fnKey": "showConfirm",
"params": {
"message": "Are you sure ?",
}
}
# Output
null
Available in: Front-end
Displays a dialog box with a specified message, along with an OK and a Cancel button
Params:
message
: Prompt message.
showAlert
# Input
{
"fnKey": "showAlert",
"params": {
"message": "The email is invalid.",
}
}
# Output
null
Available in: Front-end
Displays a dialog box with a specified message, along with an OK button
Params:
message
: Prompt message.
decodeURIComponent
# Input
{
"fnKey": "decodeURIComponent",
"params": {
"text": "https%3A%2F%2Fw3schools.com%2Fmy%20test.asp%3Fname%3Dst%C3%A5le%26car%3Dsaab"
}
}
# Output
"https://w3schools.com/my test.asp?name=ståle&car=saab"
Available in: Front-end
Decodes a URI component.
Params:
text
: The encoded Uri.
encodeURIComponent
# Input
{
"fnKey": "encodeURIComponent",
"params": {
"text": "https://w3schools.com/my test.asp?name=ståle&car=saab"
}
}
# Output
"https%3A%2F%2Fw3schools.com%2Fmy%20test.asp%3Fname%3Dst%C3%A5le%26car%3Dsaab"
Available in: Front-end
Decodes a URI component.
Params:
text
: The encoded Uri.
translate
# Input
{
"fnKey": "translate",
"params": {}
}
# Output
"es"
Available in: Front-end
Returns the current language of the system.
storeInContextGlobalSessionVars
# Input
{
"fnKey": "storeInContextGlobalSessionVars",
"params": {
"key": "isLoggedIn",
"value": false
}
}
# Output
null
Available in: Front-end
Save a new parameter in globalSessionVars.
Params:
key
value
redirect
# Input
{
"fnKey": "redirect",
"params": {
"url": "www.google.com",
}
}
# Output
null
Available in: Front-end
Redirect to a new page.
Params:
url
getLastWeekDaysArray
# Input
{
"fnKey": "getLastWeekDaysArray",
"params": {}
}
# Output
[
{
"date": "2021-04-14T21:09:26.761Z",
"label": "Miercoles",
"index": 3
},
{
"date": "2021-04-15T21:09:26.761Z",
"label": "Jueves",
"index": 4
},
{
"date": "2021-04-16T21:09:26.761Z",
"label": "Viernes",
"index": 5
},
{
"date": "2021-04-17T21:09:26.761Z",
"label": "Sabado",
"index": 6
},
{
"date": "2021-04-18T21:09:26.761Z",
"label": "Domingo",
"index": 0
},
{
"date": "2021-04-19T21:09:26.761Z",
"label": "Lunes",
"index": 1
},
{
"date": "2021-04-20T21:09:26.761Z",
"label": "Martes",
"index": 2
}
]
Available in: Front-end
Returns information of the last 7 days elapsed
playNotificationSound
# Input
{
"fnKey": "playNotificationSound",
"params": {
"sound": "https://test.com/miau.mp3
}
}
# Output
null
Available in: Front-end
Play the default sound or a custom sound.
Params:
sound
?: (Optional)sound url.
playSound
# Input
{
"fnKey": "playSound",
"params": {
"sound": "https://test.com/miau.mp3
}
}
# Output
null
Available in: Front-end
Play a custom sound.
Params:
sound
: Sound url.
setupSocketChannel
# Input
{
"fnKey": "setupSocketChannel",
"params": {
"channelKey": "socketkey",
"onData": {}
}
}
# Output
null
Available in: Front-end
Set socket channel.
Params:
channelKey
: Channel identifier.onData
:
removeSocketChannel
# Input
{
"fnKey": "removeSocketChannel",
"params": {
"channelKey": "socketkey"
}
}
# Output
null
Available in: Front-end
Remove socket channel.
Params:
channelKey
: Channel identifier.
createPushNotification
# Input
{
"fnKey": "createPushNotification",
"params": {
"title": "Lorem",
"body": "Lorem ipsum",
"icon": "www.test.com/icon.png",
"timeout": 3600,
"onClick": {}
}
}
# Output
null
Create a push notification.
Params:
title
: Notification title.body
: Notification body.icon
: Notification icon url.timeout
: Notification timeout.onClick
: Handler on click event.
downloadFromJSONToExcel
# Input
{
"fnKey": "downloadFromJSONToExcel",
"params": {
"data": [],
"options": {},
}
}
# Output
null
Available in: Front-End
Convert a JSON object list to an Excel file.
Params:
data
: Data list.options
: Aditional Options
callService
# Input
{
"fnKey": "callService",
"params": {
"serviceName": "deleteTodo",
"serviceParams": {
"|&|id": "&.item.id"
},
"onError": {
"fnKey": "consoleLog",
"params": {
"message": "onError"
}
},
"onSuccess" {
"fnKey": "consoleLog",
"params": {
"message": "onSuccess"
}
}
}
}
# Output
null
Available in: Front-End
Invoke a service.
Params:
serviceName
: Identifier of the service to be invoked.serviceParams
: Parameters of the invoked function.onError
: Function to execute if there is an error.onSuccess
: Function to execute if the process is successful.
callHTTPService
# Input
{
"fnKey": "callHTTPService",
"params": {
"method": "POST",
"url": "www.pokemonapi/postPokemon",
"body": { "name": "Charmander" } ,
"onError": {
"fnKey": "consoleLog",
"params": {
"message": "onError"
}
},
"onSuccess" {
"fnKey": "consoleLog",
"params": {
"message": "onSuccess"
}
}
}
}
# Output
null
Available in: Front-End
Invoke a service.
Params:
serviceName
: Identifier of the service to be invoked.serviceParams
: Parameters of the invoked function.onError
: Function to execute if there is an error.onSuccess
: Function to execute if the process is successful.
parseData
# Input
{
"fnKey": "parseData",
"params": {
"type" : "objectid",
"data": "123451234512345123451234"
}
}
# Output
ObjectId("123451234512345123451234")
Available in: Back-end
Parses the passed data attribute to the specified type, available types: objectid, number, date
Params:
type
: The type of data you want as a result.data
: The data that will be parsed.
Pipeline Actions
registerElement
{
"action": "registerElement",
"params": {
"modelKey": "user",
"mappingSetup": {
"|&|name": "&.clientParams.name",
"|&|email": "&.clientParams.email",
"|&|phone": "&.clientParams.phone"
}
}
}
Available in: General
Registers an element into the database
redirectWhenMatch
{
"action": "redirectWhenMatch",
"params": {
"|&|match": "&.clientParams.data",
"targetWhenMatch": "/url-to-redirect"
}
}
Available in: Web app middlewares, services, functions
Redirects to a specified route when match value is true
updateElementById
{
"action": "updateElementById",
"params": {
"modelKey": "user",
"itemId": "&.clientParams.userId",
"updateData": {
"phone": "&.clientParams.phone"
}
}
}
Available in: Web app middlewares, services, functions
Updates a database element by id
Params:
modelKey
: Model identifier.itemId
: Identifier of the item to be updated.updateData
: Object data to be updated.
updateElement
{
"action": "updateElement",
"params": {
"modelKey": "user",
"updateData": {
"phone": "&.clientParams.phone"
},
"updateCriteria": {
"email": null
},
"updateOptions": {
"multi": true
}
}
}
Available in: Web app middlewares, services, functions
Updates item that matches passed criteria (if multi option passed updates multiple elements)
Params:
modelKey
: Model identifier.updateData
: Object data to be updated.updateCriteria
: Criteria for selecting the records to update.updateOptions
: Update options supported by mongodb.
removeElementById
{
"action": "removeElementById",
"params": {
"modelKey": "user",
"itemId": "&.clientParams.userId"
}
}
Available in: Web app middlewares, services, functions
Removes an element by id
Params:
modelKey
: Model identifier.itemId
: Identifier of the item to be updated.
findOneElement
{
"action": "findOneElement",
"params": {
"modelKey": "user",
"mappingSetup": {
"|&|email": "&.clientParams.email"
}
}
}
Available in: Web app middlewares, services, functions
Find the element that matches criteria
Params:
modelKey
: Model identifier.mappingSetup
: An object that has the criteria for the search.
elementsAggregation
{
"action": "elementsAggregation",
"params": {
"modelKey": "user",
"aggregationPipeline": [
{
"$match": {
"|&|email": "&.clientParams.email"
}
},
{
"$lookup": {
"from": "session",
"localField": "_id",
"foreignField": "userId",
"as": "session"
}
}
]
}
}
Available in: Web app middlewares, services, functions
Resolves the specified aggregation (executes a mongodb aggregation to the specified model)
Params:
modelKey
: Model identifier.aggregationPipeline
: A list with the aggregation criteria.
resolveFirstElementOfOutputArray
{
"action": "resolveFirstElementOfOutputArray",
"params": {}
}
Available in: Web app middlewares, services, functions
Resolves the first element of the pevious action output
Params:
randomizeOutputArray
{
"action": "randomizeOutputArray",
"params": {}
}
Available in: Web app middlewares, services, functions
Resolves a randomized list of the previous action output
Params:
stopIfDoesntMatch
{
"action": "stopIfDoesntMatch",
"params": {
"|&|match": "&.outputsMap.foundUser",
"onError": {
"status": 401,
"details": "Invalid session"
}
}
}
Available in: Web app middlewares, services, functions
Stops the pipeline execution if the condition is not met.
Params:
match
: Search criteria.onError
: Response if there is error.status
: Response code.details
: Response message.
resolveActionParams
#Input
{
"action": "resolveActionParams",
"params": {
"|&|clientParams": "&.clientParams.title"
}
}
#Output
{
"clientParams": "The title!"
}
Available in: Web app middlewares, services, functions
Resolves parsed action params, useful for mapping pipeline outputs.
Params: Parameters are dynamic
replaceRoot
{
"action": "replaceRoot",
"params": {
"newRoot": "&.outputsMap.foundUser"
}
}
Available in: Web app middlewares, services, functions
Resolves the newRoot attribute, useful for mapping
Params:
newRoot
: Here you specify the new root of the object.
sendRAWEmail
{
"action": "sendRAWEmail",
"params": {
"emailTransporterSetup": {
"host": "..",
"port": "465",
"secure": true,
"auth": {
"email": "myemail@domain.com",
"passwoord": "password"
}
},
"emailSetup": {
"subject": "Hello!",
"|&|to": "&.clientParams.email",
"html": "<h1>Welcome!</h1>"
}
}
}
Available in: Web app middlewares, services, functions
Sends an email with HTML content, uses Nodemailer module
Params:
emailTransporterSetup
host
port
secure
auth
email
password
emailSetup
subject
to
html
sendSlackMessage
{
"action": "sendSlackMessage",
"params": {
"webhookUrl": "SLACK_WEBHOOK",
"message": {
"title": "Title",
"text": "Hello!",
"smallText": "Hello!",
"color": "#555555"
}
}
}
Available in: Web app middlewares, services, functions
Sends a Slack message.
Params:
webhookUrl
message
title
text
smallText
color
sshExecution
{
"action": "sshExecution",
"params": {}
}
Available in: web app middlewares, services, functions.
executes an ssh command to the specified connection.
httpRequest
{
"action": "httpRequest",
"params": {
"url": "https://mydomain.com/api",
"method": "POST",
"headers": {
"Content-Type": "application/json"
},
"body": {
"content": "Hello World"
}
}
}
Available in: web app middlewares, services, functions.
Makes and resolves an HTTP Call.
Params:
url
method
headers
body
content
conditionalPipelineExecution
{
"action": "conditionalPipelineExecution",
"params": {
"defaultPipeline": [
{
"action": "resolveActionParams",
"params": {
"text": "Ops, try again"
}
}
],
"pipelines": [
{
"|$|condition": {
"fnKey": "conditional",
"params": {
"operator": "eq",
"items": [
{
"|&|value": "&.clientParams.selectedOption"
},
{
"value": "a"
}
]
}
},
"pipeline": [
{
"action": "resolveActionParams",
"params": {
"text": "You selected option a"
}
}
]
},
{
"|$|condition": {
"fnKey": "conditional",
"params": {
"operator": "eq",
"items": [
{
"|&|value": "&.clientParams.selectedOption"
},
{
"value": "b"
}
]
}
},
"pipeline": [
{
"action": "resolveActionParams",
"params": {
"text": "You selected option b"
}
}
]
}
]
}
}
Available in: web app middlewares, services, functions.
Executes an specific pipeline when the condition is met.
Params:
defaultPipeline
: list of actions that will be executed by default if the condition is not met.pipelines
condition
: Condition to evaluate to run the pipe.pipeline
: List of actions to execute.
executeFunction
{
"action": "executeFunction",
"params": {
"functionKey": "functionKey",
"params": {
"text": "Test"
}
}
}
Available in: web app middlewares, services, functions.
Execute a stored function.
Params:
functionKey
: Function identifier.params
: Parameters
setCookiesWhenRequired
{
"action": "setCookiesWhenRequired",
"params": {
"mappingSetup": {
"|&|sessionKey": "&.outputsMap.newSession.key"
}
}
}
Available in: web app middlewares, services, functions.
Sets cookies when client has enabled it.
Params:
mappingSetup
: Cookie map.