Working resolver tool

This commit is contained in:
Lyncoln
2026-10-13 11:13:13 -04:00
parent 587954cd75
commit db26a74754
10 changed files with 50 additions and 20 deletions
Binary file not shown.
+5 -3
View File
@@ -6,10 +6,12 @@ def buildPath(path, outputs):
for part in path:
if isinstance(part, dict):
value = outputs[part["output"]]
value = outputs[part["output"]][part["keys"]]
for key in part.get("keys", []):
value = value[key]
#for key in part.get("keys", []):
#value = value[key]
result += str(value)
else:
+12 -3
View File
@@ -6,6 +6,7 @@ from core.runtime.outputs import buildOutput
from core.runtime.managefailure import manageFailure
from core.execution.action.action import buildAction
from .skipstep import skipStep
from core.runtime.resolver import resolveItem
def buildOperation(definition):
actions = definition.actions
@@ -20,15 +21,23 @@ def buildOperation(definition):
continue
if hasattr(action, "recursive"):
outputs[action.recursive["target"]] = {}
for item in outputs[action.recursive["source"]]:
resolved = resolveItem(action, item)
print("Resolved value:", resolved)
#outputs[action.recursive["target"]] = outputs[action.recursive["source"]][][action.recursive["target"]]
#print(outputs[action.recursive["target"]])
outputs[action.recursive["target"]] = item
print(outputs[action.recursive["target"]])
#target = outputs[action.recursive["source"]["target"]
outputs, response = buildAction(action, outputs)
#print(outputs["message"])
return outputs
#print(item)
#return outputs
else:
outputs, response = buildAction(action, outputs)
responses.append(response)
#except Exception as error:
#outputs = manageFailure(error, action, outputs)
#print(outputs["message"])
print(outputs["message"])
return outputs
Binary file not shown.
Binary file not shown.
+22
View File
@@ -0,0 +1,22 @@
def resolveItem(action, item):
resolved = {}
label = action.resolve["label"]
targetkeys = action.resolve["targetkeys"]
target = item
for key in targetkeys:
target = target[key]
resolved[label] = target
#for label, keys in action.resolve.items():
#target = item
#print(target)
#for key in keys:
#target = target[key]
#resolved[label] = target
#print(resolved[label])
return resolved
+8 -11
View File
@@ -18,11 +18,17 @@ method = "GET"
# {"output": "[messageid][0].id"}
#]
resolve = {
"targetkeys": ["id"],
"label": "path",
}
path = [
"https://rentmasseur.com/api/v1/mailbox/",
{
"output": "emails",
"keys": [0, "id"]
"output": "id",
#"keys": [0, "id"]
"keys": "id"
}
]
@@ -45,15 +51,6 @@ outputs = {
"message": "messages"
}
#select = {
# "source": "message",
# "selectmethod": "include",
#"key": "id",
# "key": "seen",
#"value": {"emails": [0, "id"]},
# "value": "false",
#}
select = {
"source": "message",
"include": {
+1 -1
View File
@@ -1 +1 @@
{"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJleHAiOjE3OTE4NTc3MTgsIm5iZiI6MTc5MTg1NzUzOCwic3ViIjoiMjM4MzAyIiwidXNlcm5hbWUiOiJYeHhvdGlxIiwidXNlclR5cGUiOjEsInN0YWdlTmFtZSI6Ilh4eG90aXEiLCJhcHByb3ZlZCI6MSwibG9jYXRpb25JZCI6NDcyLCJzZWFyY2hDaXR5IjoiYXRsYW50YSIsImNvdW50cnlTaG9ydCI6IlVTIiwic2Vzc2lvbkNvdW50cnlDb250aW5lbnQiOiJOQSIsImlzRnJvemVuIjowLCJsb2NhdGlvbkxhYmVsIjoiQXRsYW50YSwgR0EiLCJpc3MiOiJodHRwczovL3JlbnRtYXNzZXVyLmNvbSIsImlhdCI6MTc5MTg1NzU5OH0.3TLzOxoQQtnfOuPsLzRjueSDLxQ6w1xSTBdJLfUnVacq6qVEVxj51WfedKO7TXhNyPWtI7WP0e8B1PkGjJsSjA", "refresh_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJleHAiOjE3OTQ0NDk1OTgsIm5iZiI6MTc5MTg1NzUzOCwianRpIjoiZmJ6YnNxSlY2RUcrTGc4UGVyZzN5WDdPMWhvaXdGZ25NVkFuU0ZYdFJ6cz0iLCJpc3MiOiJodHRwczovL3JlbnRtYXNzZXVyLmNvbSIsImlhdCI6MTc5MTg1NzU5OCwic3ViIjoiMjM4MzAyIn0.GRlPPC4Ifv-XIrqUNsrBPst5_tW5UIbapGVZOzXroVJDW3F2FMolDNg-0CM_Vrz_uwlyPpnc1aUoAOIIhl2V0w"}
{"access_token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