API Maps now can be Plugins

This commit is contained in:
Luis Fernando Molina committed 2021-05-28 04:01:04 +02:00
1 parent dfff4b387d
commit 2a16d70393
7 files changed
+84 -1

No files matched your search

@@ -0,0 +1 @@
{"type":"API Map","name":"Messari","config":"{\n \"codeName\": \"Messari\",\n \"protocol\": \"https\",\n \"hostName\": \"data.messari.io\",\n \"portNumber\": \"\",\n \"path\": \"api\",\n \"millisecondsBetweenCalls\": 4000\n}","project":"Superalgos","apiVersions":[{"type":"API Version","name":"Version 1","config":"{\n \"codeName\": \"v1\"\n}","project":"Superalgos","apiEndpoints":[{"type":"API Endpoint","name":"Get All News","config":"{\n \"codeName\": \"news\"\n}","project":"Superalgos","apiQueryParameters":{"type":"API Query Parameters","name":"New API Query Parameters","config":"{\n \"codeName\": \"\"\n}","project":"Superalgos","apiQueryParameters":[{"type":"API Query Parameter","name":"Page","config":"{\n \"codeName\": \"page\",\n \"isString\": false,\n \"isOptional\": false,\n \"description\": \"Page number, starts at 1. Increment to paginate through results (until result is empty array)\",\n \"isPageNumber\": true\n}","project":"Superalgos","id":"754e2724-36bc-4e4e-94cf-bfba88dadd3b","savedPayload":{"position":{"x":14018.222252113279,"y":10179.489044198583},"targetPosition":{"x":14308,"y":10257.134757729338},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},{"type":"API Query Parameter","name":"Fields","config":"{\n \"codeName\": \"fields\",\n \"isString\": true,\n \"isOptional\": true,\n \"description\": \"pare down the returned fields (comma , separated, drill down with a slash /)\"\n}","project":"Superalgos","id":"3199c37c-5ecc-47fd-8868-eddaa15fdc59","savedPayload":{"position":{"x":14158,"y":9997.327136594007},"targetPosition":{"x":14308,"y":10257.134757729338},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},{"type":"API Query Parameter","name":"As Markdown","config":"{\n \"codeName\": \"as-markdown\",\n \"isString\": false,\n \"isOptional\": true,\n \"description\": \"formatting (other than HTML links) is hidden. Use this query param to return content with markdown syntax\"\n}","project":"Superalgos","id":"fa87b1ad-2d0f-4462-85fb-524630e9db7a","savedPayload":{"position":{"x":14385.645713530756,"y":9967.357009842617},"targetPosition":{"x":14308,"y":10257.134757729338},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}}],"id":"03f8b00d-10cf-423d-a654-d8db598c76a9","savedPayload":{"position":{"x":14308,"y":10257.134757729338},"targetPosition":{"x":14458,"y":10516.942378864669},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"apiQueryResponses":{"type":"API Query Responses","name":"New API Query Responses","config":"{\n \"codeName\": \"\"\n}","project":"Superalgos","apiQueryResponses":[{"type":"API Query Response","name":"200 Successful","config":"{\n \"codeName\": \"200\"\n}","project":"Superalgos","apiResponseSchema":{"type":"API Response Schema","name":"New API Response Schema","config":"{\n \"nodePath\": \"apiResponseReceivedObject.data\"\n}","project":"Superalgos","apiResponseFields":{"type":"API Response Field","name":"Root Object","config":"{\n \"codeName\": \"Root-Object\",\n \"fieldType\": \"object\",\n \"descrption\": \"This is the root object of the API response.\"\n}","project":"Superalgos","apiResponseFields":[{"type":"API Response Field","name":"Status","config":"{\n \"codeName\": \"status\",\n \"fieldType\": \"object\",\n \"descrption\": \"object (ApiStatus)\"\n}","project":"Superalgos","apiResponseFields":[{"type":"API Response Field","name":"Enlapsed","config":"{\n \"codeName\": \"enlapsed\",\n \"fieldType\": \"number\",\n \"descrption\": \"\"\n}","project":"Superalgos","apiResponseFields":[],"id":"9c472348-ac24-4567-a36f-8600a1fac914","savedPayload":{"position":{"x":14957.080319710783,"y":9159.037626303341},"targetPosition":{"x":15126.07633712987,"y":9406.90925859814},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"API Response Field","name":"Timestamp","config":"{\n \"codeName\": \"timestamp\",\n \"fieldType\": \"date\",\n \"descrption\": \"\"\n}","project":"Superalgos","apiResponseFields":[],"id":"12b796fd-85eb-49b2-a88e-b400f52cc5e9","savedPayload":{"position":{"x":15256.241458865137,"y":9136.618598227415},"targetPosition":{"x":15126.07633712987,"y":9406.90925859814},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"5d45e7d6-8964-449e-8f34-c7f5f4839d54","savedPayload":{"position":{"x":15126.07633712987,"y":9406.9092585Line truncated
@@ -0,0 +1,37 @@
{
"type": "Plugin API Maps",
"menuItems": [
{
"action": "Add Missing Plugin API Maps",
"label": "Add Missing API Maps",
"askConfirmation": true,
"confirmationLabel": "Confirm to Proceed",
"workDoneLabel": "Done",
"relatedUiObject": "API Map",
"actionFunction": "payload.executeAction"
},
{
"action": "Delete UI Object",
"askConfirmation": true,
"confirmationLabel": "Confirm to Delete",
"label": "Delete",
"iconPathOn": "delete-entity",
"iconPathOff": "delete-entity",
"actionFunction": "payload.executeAction"
}
],
"addLeftIcons": true,
"level": 1,
"propertyNameAtParent": "pluginApiMaps",
"attachingRules": {
"compatibleTypes": "->Plugin Project->"
},
"childrenNodesProperties": [
{
"name": "pluginFiles",
"type": "array",
"childType": "Plugin File",
"autoAdd": false
}
]
}
@@ -84,6 +84,12 @@
"type": "node",
"childType": "Plugin Tutorials",
"autoAdd": false
},
{
"name": "pluginApiMaps",
"type": "node",
"childType": "Plugin API Maps",
"autoAdd": false
}
],
"alternativeIcons": [
@@ -0,0 +1,13 @@
{
"type": "Plugin API Maps",
"definition": {
"text": "The plugin API Maps node features the definitions of tutorials to be included as plugins in the current workspace.",
"updated": 1622165615601
},
"paragraphs": [
{
"style": "Text",
"text": "Right click and select the pencil button to enter edit mode."
}
]
}
@@ -683,6 +683,11 @@ function newSuperalgosActionSwitch() {
UI.projects.superalgos.functionLibraries.pluginsFunctions.pluginMissingTutorials(action.node, action.rootNodes)
}
break
case 'Add Missing Plugin API Maps':
{
UI.projects.superalgos.functionLibraries.pluginsFunctions.pluginMissingApiMaps(action.node, action.rootNodes)
}
break
case 'Add Missing Workspace Projects':
{
UI.projects.superalgos.functionLibraries.workspaceFunctions.addMissingWorkspaceProjects(action.node, action.rootNodes)
@@ -8,7 +8,8 @@ function newSuperalgosFunctionLibraryPluginsFunctions() {
pluginMissingLearningMines: pluginMissingLearningMines,
pluginMissingLearningSystems: pluginMissingLearningSystems,
pluginMissingLearningEngines: pluginMissingLearningEngines,
pluginMissingTutorials: pluginMissingTutorials
pluginMissingTutorials: pluginMissingTutorials,
pluginMissingApiMaps: pluginMissingApiMaps
}
return thisObject
@@ -197,4 +198,20 @@ function newSuperalgosFunctionLibraryPluginsFunctions() {
addPluginFileIfNeeded(node, fileNames)
}
}
function pluginMissingApiMaps(node, rootNodes) {
let projectName = getProjectName(node)
if (projectName === "" || projectName === undefined) {
if (node.payload.parentNode !== undefined) {
node.payload.parentNode.payload.uiObject.setErrorMessage("Config codeName must have the name of the project.")
return
}
}
getPluginFileNames(projectName, 'API-Maps', onNamesArrived)
function onNamesArrived(fileNames) {
addPluginFileIfNeeded(node, fileNames)
}
}
}
@@ -94,6 +94,10 @@ function newSuperalgosFunctionLibraryUiObjectsFromNodes() {
totalPlugin = totalPlugin + project.pluginTutorials.pluginFiles.length
pluginAllTheseFiles(project.pluginTutorials.pluginFiles, 'Tutorials')
}
if (project.pluginApiMaps !== undefined) {
totalPlugin = totalPlugin + project.pluginApiMaps.pluginFiles.length
pluginAllTheseFiles(project.pluginApiMaps.pluginFiles, 'API-Maps')
}
}
}
}