Merge branch 'develop' of https://github.com/Superalgos/Superalgos into develop

This commit is contained in:
Julian Molina committed 2021-05-31 21:48:18 +02:00
commit cf7c1652f8
28 files changed
+306 -50

No files matched your search

@@ -30,7 +30,7 @@
"config": true
},
"initialValues": {
"config": "{\"nodePath\": \"apiDataObject.data\"}"
"config": "{\"nodePath\": \"apiResponseReceivedObject.data\"}"
},
"addLeftIcons": true,
"level": 4,
@@ -30,7 +30,7 @@
"name": "pluginFilePosition",
"type": "node",
"childType": "Plugin File Position",
"autoAdd": false
"autoAdd": true
}
]
}
@@ -0,0 +1,78 @@
{
"type": "replaceBy Config Property",
"definition": {
"text": "This property allows you to instruct the API Fetcher Bot to set a value to this parameter based on contextual information that can not be defined at the Data Mine or the API Map. This contextual information can be for example the current Base Asset or the current time.",
"updated": 1622476480596
},
"paragraphs": [
{
"style": "Block",
"text": "How To Use It",
"updated": 1622477226772
},
{
"style": "Subtitle",
"text": "replaceBy Config Property Usage"
},
{
"style": "Text",
"text": "This property is optional, meaning that the Bot will use the default value when it is not present. The default value for an API Query Parameter is the value configu property, while the default for an API Path Parameter is the codeName config property."
},
{
"style": "Text",
"text": "The possible values for this property are:"
},
{
"style": "List",
"text": "@BaseAsset: This will force the Bot to use the current Base Asset."
},
{
"style": "Javascript",
"text": "parameterValue = TS.projects.superalgos.globals.taskConstants.TASK_NODE\n.parentNode.parentNode.parentNode.referenceParent.baseAsset.referenceParent.config.codeName",
"updated": 1622476773559
},
{
"style": "List",
"text": "@QuotedAsset: This will force the Bot to use the current Quoted Asset.",
"updated": 1622476819686
},
{
"style": "Javascript",
"text": "parameterValue = TS.projects.superalgos.globals.taskConstants.TASK_NODE\n.parentNode.parentNode.parentNode.referenceParent.quotedAsset.referenceParent.config.codeName",
"updated": 1622476849667
},
{
"style": "List",
"text": "@BeginCurrentMinute: This will instruct the Bot to use a timestamp at the begining of the current minute.",
"updated": 1622476907142
},
{
"style": "Javascript",
"text": "parameterValue = \nMath.trunc((new Date()).valueOf() / \nTS.projects.superalgos.globals.timeConstants.ONE_MIN_IN_MILISECONDS) * \nTS.projects.superalgos.globals.timeConstants.ONE_MIN_IN_MILISECONDS",
"updated": 1622477009814
},
{
"style": "List",
"text": "@EndCurrentMinute: This will instruct the Bot to use a timestamp at the ending of the current minute.",
"updated": 1622476926765
},
{
"style": "Javascript",
"text": "parameterValue = Math.trunc((new Date()).valueOf() / \nTS.projects.superalgos.globals.timeConstants.ONE_MIN_IN_MILISECONDS) * \nTS.projects.superalgos.globals.timeConstants.ONE_MIN_IN_MILISECONDS + \nTS.projects.superalgos.globals.timeConstants.ONE_MIN_IN_MILISECONDS - 1",
"updated": 1622477088684
},
{
"style": "Note",
"text": "If users assing a value that is not listed above, the property will be ingnored and the default value will be used.",
"updated": 1622477178155
},
{
"style": "Text",
"text": ""
},
{
"style": "Text",
"text": ""
}
]
}
@@ -6,8 +6,9 @@
},
"paragraphs": [
{
"style": "Text",
"text": "Right click and select the pencil button to enter edit mode."
"style": "Important",
"text": "For this node to be correctly installed and a reference stablished to the API Data Mine by the Install New Market procedure, both the Data Mine and the API Data Map needs to have exactly the same config property codeName, otherwise, this node will be created but you will have to stablish the reference manually.",
"updated": 1622472653778
}
]
}
@@ -36,6 +36,11 @@
"style": "Title",
"text": "Configuration"
},
{
"style": "List",
"text": "codeName: this must be the same codeName as the Data Mine codeName in order for the Install New Market procedure to link them properly at the API Map Reference node.",
"updated": 1622472871204
},
{
"style": "List",
"text": "protocol: the protocol to be used to access the API. For now either http or https."
@@ -21,11 +21,13 @@
},
{
"style": "List",
"text": "replaceBy: this property allows you to instruct the API Fetcher Bot to set a value to this parameter. The possible values are: @BaseAsset and @QuotedAsset"
"text": "replaceBy: this property allows you to instruct the API Fetcher Bot to set a value to this parameter replacing the current default and using contextual information available only at runtime. ",
"updated": 1622477486319
},
{
"style": "Important",
"text": "The replacedBy property is the way users have to send some contextual values to the API Server like for example the Base Asset or Quoted Asset of the Defautl Market."
"style": "Include",
"text": "Superalgos->Concept->replaceBy Config Property->How To Use It",
"updated": 1622477440806
}
]
}
@@ -1,8 +1,8 @@
{
"type": "API Path Parameters",
"definition": {
"text": "Path parameters are the type of parameters that are embedded as part of an URL path. They could be fixed string of texts or they could be a parameter that is replaced by the API Fetcher Bot for some value at runtime.",
"updated": 1621018106262
"text": "Path parameters are the type of parameters that are embedded as part of an URL path. They could be a fixed string of texts or they could be a parameter that is replaced by the API Fetcher Bot for some value at runtime.",
"updated": 1622336383876
},
"paragraphs": [
{
@@ -18,6 +18,15 @@
"style": "List",
"text": "value: It is the value to be used at this parameter. The API Map can define the value, that would be considered a default value. The same parameter defined at the Data Mine will have the actual value to be used replacing the default. If you are defining a API Map to be shared as a Plugin, you can avoid setting this property at the API Map level, and let the users set it at their Data Mine when they use your API Map. For completness, this parameter should be included at the the API Map even if the value property is not there.",
"updated": 1622160191941
},
{
"style": "List",
"text": "replaceBy: this property allows you to instruct the API Fetcher Bot to set a value to this parameter replacing the current default and using contextual information available only at runtime. ",
"updated": 1622477507235
},
{
"style": "Include",
"text": "Superalgos->Concept->replaceBy Config Property->How To Use It"
}
]
}
@@ -1,8 +1,8 @@
{
"type": "API Query Responses",
"definition": {
"text": "API calls producee responses. Under this section they are defined.",
"updated": 1621020920908
"text": "API calls produce responses. Under this section they are defined.",
"updated": 1622295146024
},
"paragraphs": [
{
@@ -33,8 +33,8 @@
},
{
"style": "Text",
"text": "In order to extract individual values for each Record Property, the API Data Fetcher Bot needs to dynamically discover the nodePath for each Record Propety at the response data structure and can do it as long as the API Response Field referenced is under the Data Root. To autodiscover the nodePath it uses the API Response Schame nodePath to locate the Data Root, and then it follows the reference from the API Response Field Reference node to the API Response Field and climb upwards until it reach the API Response Schema. While climbing upwards it discovers the nodePath that it needs to grabb the value from the response data structure. That is how it works.",
"updated": 1621972472491
"text": "In order to extract individual values for each Record Property, the API Data Fetcher Bot needs to dynamically discover the nodePath for each Record Propety at the response data structure and can do it as long as the API Response Field referenced is under the Data Root. To autodiscover the nodePath it uses the API Response Schema nodePath to locate the Data Root, and then it follows the reference from the API Response Field Reference node to the API Response Field and climbs upwards until it reach the API Response Schema. While climbing upwards it discovers the nodePath that it needs to grab the value from the response data structure. That is how it works.",
"updated": 1622372741883
},
{
"style": "Text",
@@ -17,8 +17,8 @@
},
{
"style": "List",
"text": "fieldType: This property declares if the data is number, a string an object or an array, those are the 4 possible values.",
"updated": 1621022104672
"text": "fieldType: This property declares if the data is number, a string, an object, or an array, those are the 4 possible values.",
"updated": 1622315306276
},
{
"style": "List",
@@ -7,8 +7,8 @@
"paragraphs": [
{
"style": "Text",
"text": "The API Map assumes the API Server will respond with string formatted in JSON. This means that the response will be a data structure of nestled objects and arrays. Users will need to map the response format into a API Response Schema by adding children to this node and to this node's children. All these descendants are of the same Node Type API Response Field. ",
"updated": 1621952655717
"text": "The API Map assumes the API Server will respond with string formatted in JSON. This means that the response will be a data structure of nestled objects and arrays. Users will need to map the response format into an API Response Schema by adding children to this node and to this node's children. All these descendants are of the same Node Type API Response Field.",
"updated": 1622312357188
},
{
"style": "Title",
@@ -7,8 +7,8 @@
"paragraphs": [
{
"style": "Note",
"text": "We expect every API to have at leat one version.",
"updated": 1621951647515
"text": "We expect every API to have at least one version.",
"updated": 1622291417472
},
{
"style": "Include",
@@ -60,7 +60,7 @@
{
"style": "Include",
"text": "Superalgos->Topic->Data Mining - Fetching Data From APIs->Data Aggregation",
"updated": 1621974902589
"updated": 1622336877604
}
]
}
@@ -61,10 +61,14 @@
"text": "There is a Workspace called API Data Fetcher Bot Demo with a simple working example of the previous steps you can use as a reference.",
"updated": 1622230619069
},
{
"style": "Block",
"text": "Data Aggregation",
"updated": 1622336997587
},
{
"style": "Title",
"text": "How Does Data Aggregation Work?",
"updated": 1622230634850
"text": "How Does Data Aggregation Work?"
},
{
"style": "Text",
@@ -106,10 +110,14 @@
"style": "List",
"text": "Avg: This means that the average of all values found in the time range will be used as the value for the Record Proeprty."
},
{
"style": "Block",
"text": "Step By Step",
"updated": 1622372437520
},
{
"style": "Title",
"text": "Step by Step Guide to Fetch Data from an API",
"updated": 1622231458352
"text": "Step by Step Guide to Fetch Data from an API"
},
{
"style": "Text",
@@ -133,8 +141,8 @@
},
{
"style": "List",
"text": "Step #4: Read the API's documentation, indentify the endpoints, what parameters they require and what data they will provide you.",
"updated": 1621976675920
"text": "Step #4: Read the API's documentation, indentify the endpoints, what parameters they require and what data they will provide you. Another helpful way to see how the api responds is by typing the api endpoint into your browser and looking at the raw output.",
"updated": 1622469791527
},
{
"style": "List",
@@ -143,8 +151,8 @@
},
{
"style": "List",
"text": "Step #6: Create an API Map node, and start mapping the documented API by adding children to it.",
"updated": 1621976688595
"text": "Step #6: Create an API Map node, and start mapping the documented API by adding children to it. Especially pay attention to unnamed arrays and objects that may wrap the data.",
"updated": 1622470221717
},
{
"style": "List",
@@ -196,8 +204,13 @@
},
{
"style": "List",
"text": "Step #17: Pay attention to the special case of the required timeStamp Record Property. Specifically because it might be pointing to the header of the API response. Read the docs of the API Response Field Reference node to set up the nodePath property if necessary.",
"updated": 1622232714229
"text": "Step #17: The timestamp record property is the only required property. It helps keep the records you save organized. Addtionally, the timestamp may live in the header of the API responce. Read the docs of the API Response Field Reference node to set up the nodePath property if necessary.",
"updated": 1622475120505
},
{
"style": "Note",
"text": "It is a good idea to make sure you get the api fetcher bot running and debugged before moving on to the next step.",
"updated": 1622475171484
},
{
"style": "List",
@@ -3,7 +3,7 @@
"pageNumber": "3",
"type": "Create the Plugins-Docs Branch in Old Forks",
"definition": {
"text": "If your Superalgos fork is older than April 6, 2021, you must create the plugin-docs branch before you may switch to that branch! Newer forks already have the branch, so you don't need to follow this guide in that case!",
"text": "If your Superalgos fork is older than April 6, 2021, you must create the plugins-docs branch before you may switch to that branch! Newer forks already have the branch, so you don't need to follow this guide in that case!",
"updated": 1618155549345
},
"paragraphs": [
@@ -0,0 +1,15 @@
{
"topic": "Repository Branches",
"pageNumber": "1",
"type": "Introduction",
"definition": {
"text": "The Superalgos Repository has 4 main branches, each one with it's own purpose: Master, Develop, Plugins-Docs and Next-Version.",
"updated": 1622467436519
},
"paragraphs": [
{
"style": "Text",
"text": "Right click and Edit to enter edit mode and change this text. ENTER to write new paragraphs. ESC to exit edit mode. Then you can use docs.save to save your changes and app.contribute to send it to the main repository."
}
]
}
@@ -0,0 +1,34 @@
{
"topic": "Repository Branches",
"pageNumber": "2",
"type": "Master",
"definition": {
"text": "The Master branch is where the stable code or current version is located at. This is the branch where the software is installed from by default. ",
"updated": 1622467520315
},
"paragraphs": [
{
"style": "Text",
"text": "Users of Superalgos running the stable version at Master discuss several topics here:",
"updated": 1622468372179
},
{
"style": "Link",
"text": "Telegram Community Group->t.me/superalgoscommunity",
"updated": 1622468544375
},
{
"style": "Text",
"text": "When they have issues with the stable version at Master, they ask for help here:"
},
{
"style": "Link",
"text": "Telegram Technical Support Group->t.me/superalgossupport",
"updated": 1622468555501
},
{
"style": "Text",
"text": ""
}
]
}
@@ -0,0 +1,21 @@
{
"topic": "Repository Branches",
"pageNumber": "3",
"type": "Develop",
"definition": {
"text": "The Develop branch is the branch that is being used by developers involved in contributing to Superalgos. All the changes at this branch are sent to the Master branch everytime there is a new release. The Develop branch purpose is for accumulating changes at the codebase untiil the release date when all these changes are moved into the Master branch.",
"updated": 1622467883706
},
"paragraphs": [
{
"style": "Text",
"text": "Contributors working at this branch coordinate their here:",
"updated": 1622468223194
},
{
"style": "Link",
"text": "Telegram Developers Group->t.me/superalgosdevelop",
"updated": 1622468567484
}
]
}
@@ -0,0 +1,21 @@
{
"topic": "Repository Branches",
"pageNumber": "4",
"type": "Plugins-Docs",
"definition": {
"text": "The branch Plugins-Docs is used by contributors of Plugins, documentations or tutorials. This branch in syncronized with Develop and Master everytime a new version is released, and it's purpose is to allow the flow of docs pages, plugins and tutorials into the master branch at a higher rate than changes at the codebase done at the Develop branch. This means that the Master branch might have many updates in between releases.",
"updated": 1622467789596
},
"paragraphs": [
{
"style": "Text",
"text": "Contributors working at this branch coordinate their here:",
"updated": 1622468204165
},
{
"style": "Link",
"text": "Telegram Docs Group->t.me/superalgosdocs",
"updated": 1622468607270
}
]
}
@@ -0,0 +1,21 @@
{
"topic": "Repository Branches",
"pageNumber": "5",
"type": "Next-Version",
"definition": {
"text": "The Next-Version branch is where developers work when they are working on features that will not be part of the next release, but the release following that one. After a release, this branch is merged into Develop and devs continue working there. ",
"updated": 1622468029634
},
"paragraphs": [
{
"style": "Text",
"text": "Contributors working at this branch coordinate their here:",
"updated": 1622468300604
},
{
"style": "Link",
"text": "Telegram Developers Group->t.me/superalgosdevelop",
"updated": 1622468627270
}
]
}
@@ -52,7 +52,7 @@
"translations": [
{
"language": "IT",
"text": "Scorri la pagina dei Docs fino al footer e selezione Plugins/Docs come Contributions Branch! È l'opzione sulla destra, non al centro!",
"text": "Scorri la pagina dei Docs fino al footer e selezione Plugins-Docs come Contributions Branch! È l'opzione sulla destra, non al centro!",
"updated": 1619633667745,
"style": "Callout"
}
@@ -39,7 +39,7 @@
"translations": [
{
"language": "IT",
"text": "Torna al footer e seleziona Plugins/Docs come tuo Current Branch.",
"text": "Torna al footer e seleziona Plugins-Docs come tuo Current Branch.",
"updated": 1619634755120,
"style": "List"
}
@@ -55,11 +55,11 @@
},
{
"style": "List",
"text": "Plugins/Docs Branch: Features the version in the master branch plus the latest changes in the Docs and Plugins. Submit contributions of translations, improvements in the Docs, tutorials, and plugins such as data mines, trading systems, and so on!",
"text": "Plugins-Docs Branch: Features the version in the master branch plus the latest changes in the Docs and Plugins. Submit contributions of translations, improvements in the Docs, tutorials, and plugins such as data mines, trading systems, and so on!",
"translations": [
{
"language": "IT",
"text": "Plugins/Docs Branch: contiene la versione del master branch più le ultime modifiche a Docs e Plugins. Presenta qui i contributi a Docs, tutorial e plugins, come Data Mines, Trading Systems e così via!",
"text": "Plugins-Docs Branch: contiene la versione del master branch più le ultime modifiche a Docs e Plugins. Presenta qui i contributi a Docs, tutorial e plugins, come Data Mines, Trading Systems e così via!",
"updated": 1619633285534
}
]
@@ -346,9 +346,19 @@ exports.newSuperalgosBotModulesFetchingProcess = function (processIndex) {
if (apiQueryParameter.config.isPageNumber === true) {
pageNumberParameter = apiQueryParameter
} else {
/*
Whatever is in Value is the default value.
*/
if (apiQueryParameter.config.codeName !== undefined && apiQueryParameter.config.value !== undefined) {
parametersMap.set(apiQueryParameter.config.codeName, apiQueryParameter.config.value)
}
/*
If there is a replace action to be made, then that could replace the default value.
*/
let replaceValue = checkReplaceBy(apiQueryParameter)
if (replaceValue !== undefined) {
parametersMap.set(apiQueryParameter.config.codeName, replaceValue)
}
}
}
}
@@ -393,23 +403,42 @@ exports.newSuperalgosBotModulesFetchingProcess = function (processIndex) {
if (pathString === "") { pathString = '/' }
let apiPathParameter = value
let parameterValue = key // This is the default value
if (apiPathParameter.config.replaceBy !== undefined) {
switch (apiPathParameter.config.replaceBy) {
case '@BaseAsset': {
parameterValue = TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.baseAsset.referenceParent.config.codeName
break
}
case '@QuotedAsset': {
parameterValue = TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.quotedAsset.referenceParent.config.codeName
break
}
}
let replaceValue = checkReplaceBy(apiPathParameter)
if (replaceValue !== undefined) {
parameterValue = replaceValue
}
pathString = pathString + separator + parameterValue
separator = "/"
}
}
function checkReplaceBy(apiParameter) {
let parameterValue
if (apiParameter.config.replaceBy !== undefined) {
switch (apiParameter.config.replaceBy) {
case '@BaseAsset': {
parameterValue = TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.baseAsset.referenceParent.config.codeName
break
}
case '@QuotedAsset': {
parameterValue = TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.quotedAsset.referenceParent.config.codeName
break
}
case '@BeginCurrentMinute': {
parameterValue = Math.trunc((new Date()).valueOf() / TS.projects.superalgos.globals.timeConstants.ONE_MIN_IN_MILISECONDS) * TS.projects.superalgos.globals.timeConstants.ONE_MIN_IN_MILISECONDS
break
}
case '@EndCurrentMinute': {
parameterValue = Math.trunc((new Date()).valueOf() / TS.projects.superalgos.globals.timeConstants.ONE_MIN_IN_MILISECONDS) * TS.projects.superalgos.globals.timeConstants.ONE_MIN_IN_MILISECONDS + TS.projects.superalgos.globals.timeConstants.ONE_MIN_IN_MILISECONDS - 1
break
}
}
}
return parameterValue
}
async function fetchAllPages() {
if (pageNumberParameter === undefined) {
@@ -653,7 +682,7 @@ exports.newSuperalgosBotModulesFetchingProcess = function (processIndex) {
resolve('NO_MORE_PAGES')
} else {
resolve('PAGE_FETCHED')
}
}
/*
If we received an errror code, we abort the processing at this point.
*/
@@ -166,6 +166,7 @@ function newSuperalgosDocsFooter() {
HTML = HTML + '<li><a href="#" onClick="UI.projects.superalgos.spaces.docsSpace.changeCurrentBranch(\'master\')">Master</a></li>'
HTML = HTML + '<li><a href="#" onClick="UI.projects.superalgos.spaces.docsSpace.changeCurrentBranch(\'develop\')">Develop</a></li>'
HTML = HTML + '<li><a href="#" onClick="UI.projects.superalgos.spaces.docsSpace.changeCurrentBranch(\'plugins-docs\')">Plugins-Docs</a></li>'
HTML = HTML + '<li><a href="#" onClick="UI.projects.superalgos.spaces.docsSpace.changeCurrentBranch(\'next-version\')">Next-Version</a></li>'
HTML = HTML + '</ul>'
HTML = HTML + '</div>'
@@ -176,6 +177,8 @@ function newSuperalgosDocsFooter() {
HTML = HTML + '<li><a href="#" onClick="UI.projects.superalgos.spaces.docsSpace.changeContributionsBranch(\'master\')">Master</code></li>'
HTML = HTML + '<li><a href="#" onClick="UI.projects.superalgos.spaces.docsSpace.changeContributionsBranch(\'develop\')">Develop</a></li>'
HTML = HTML + '<li><a href="#" onClick="UI.projects.superalgos.spaces.docsSpace.changeContributionsBranch(\'plugins-docs\')">Plugins-Docs</a></li>'
HTML = HTML + '<li><a href="#" onClick="UI.projects.superalgos.spaces.docsSpace.changeContributionsBranch(\'next-version\')">Next-Version</a></li>'
HTML = HTML + '</ul>'
HTML = HTML + '</ul>'
HTML = HTML + '</div>'
@@ -1178,13 +1178,13 @@ function newSuperalgosTutorialSpace() {
return
}
let schemaDocument = SCHEMAS_BY_PROJECT.get(project).map.docsTutorialSchema.get(nodeConfig.docs.type)
let schemaDocument = SCHEMAS_BY_PROJECT.get(nodeConfig.docs.project).map.docsTutorialSchema.get(nodeConfig.docs.type)
if (schemaDocument === undefined) {
schemaDocument = {
type: 'Tutorial',
definition: {
text: "If you are a new user then please refresh the UI with F5. This is a nasty bug we could not reproduce and fix yet."
text: "If you are a new user then please refresh the UI with F5."
},
icon: {
project: "Superalgos",
@@ -17,7 +17,11 @@ function newSuperalgosUtilitiesGitBranches() {
break
}
case 'plugins-docs': {
branchLabel = 'Plugins/Docs'
branchLabel = 'Plugins-Docs'
break
}
case 'next-version': {
branchLabel = 'Next-Version'
break
}
}