diff --git a/ET4 b/ET4 deleted file mode 100644 index e69de29..0000000 diff --git a/core/apirequest/__pycache__/execute.cpython-314.pyc b/core/apirequest/__pycache__/execute.cpython-314.pyc index 8ce0bd0..1bb3756 100644 Binary files a/core/apirequest/__pycache__/execute.cpython-314.pyc and b/core/apirequest/__pycache__/execute.cpython-314.pyc differ diff --git a/core/apirequest/__pycache__/key.cpython-314.pyc b/core/apirequest/__pycache__/key.cpython-314.pyc index e234161..2127da9 100644 Binary files a/core/apirequest/__pycache__/key.cpython-314.pyc and b/core/apirequest/__pycache__/key.cpython-314.pyc differ diff --git a/core/apirequest/__pycache__/object.cpython-314.pyc b/core/apirequest/__pycache__/object.cpython-314.pyc index 8718eeb..ac093be 100644 Binary files a/core/apirequest/__pycache__/object.cpython-314.pyc and b/core/apirequest/__pycache__/object.cpython-314.pyc differ diff --git a/core/apirequest/__pycache__/path.cpython-314.pyc b/core/apirequest/__pycache__/path.cpython-314.pyc index 41c46db..dbaccb6 100644 Binary files a/core/apirequest/__pycache__/path.cpython-314.pyc and b/core/apirequest/__pycache__/path.cpython-314.pyc differ diff --git a/core/apirequest/__pycache__/request.cpython-314.pyc b/core/apirequest/__pycache__/request.cpython-314.pyc index 66e2605..70112e4 100644 Binary files a/core/apirequest/__pycache__/request.cpython-314.pyc and b/core/apirequest/__pycache__/request.cpython-314.pyc differ diff --git a/core/apirequest/execute.py b/core/apirequest/execute.py index 539b024..90fb841 100644 --- a/core/apirequest/execute.py +++ b/core/apirequest/execute.py @@ -22,5 +22,7 @@ def executeRequest(action, outputs, resolved): # session.cookies.set( # sessioncookies[cookie_name] = response[cookie_key], - + print(request) + #print(response.status_code) + #print(response.text) return response, outputs diff --git a/core/apirequest/key.py b/core/apirequest/key.py index 0f87297..cb150ab 100644 --- a/core/apirequest/key.py +++ b/core/apirequest/key.py @@ -1,8 +1,15 @@ def buildKey(key, outputs, resolved): value = key["keyvalue"] - if isinstance(value, dict) and "output" in value: - value = outputs[value["output"]] + if isinstance(value, dict): + if "output" in value: + value = outputs[value["output"]] + + elif "resolved" in value: + value = resolved[value["resolved"]] + + if "prefix" in key["keyvalue"]: + value = key["keyvalue"]["prefix"] + str(value) return { key["keytitle"]: value, diff --git a/core/apirequest/object.py b/core/apirequest/object.py index ff5596a..ce8b38d 100644 --- a/core/apirequest/object.py +++ b/core/apirequest/object.py @@ -7,5 +7,5 @@ def buildObject(keys, outputs, resolved): object.update( buildKey(key, outputs, resolved), ) - + return object diff --git a/core/apirequest/path.py b/core/apirequest/path.py index 1dad092..ca7fc19 100644 --- a/core/apirequest/path.py +++ b/core/apirequest/path.py @@ -1,4 +1,22 @@ def buildPath(path, outputs, resolved): + result = "" + + for part in path: + if isinstance(part, dict): + if "resolved" in part: + value = resolved[part["resolved"]] + elif "output" in part: + value = outputs[part["output"]] + else: + raise ValueError(f"Unsupported path component: {part}") + + result += str(value) + else: + result += str(part) + + return result + +def buildPath3(path, outputs, resolved): if isinstance(path, str): return path @@ -6,18 +24,24 @@ def buildPath(path, outputs, resolved): for part in path: if isinstance(part, dict): + if "resolved" in part: #for key, val in part.items(): #value = outputs[part["output"]][part["keys"]] - value = resolved["path"] + value = resolved[part["resolved"]] #print("DEBUG path", value) - + #for key in part.get("keys", []): #value = value[key] + if "suffix" in part: + suffix = part["suffix"] - result += str(value) - else: - result += part - #print(result) + if value != None: + result += str(value) + if suffix != None: + result += str(suffix) + else: + result += part + print(result) return result def buildPath2(path, outputs, resolved): diff --git a/core/apirequest/request.py b/core/apirequest/request.py index 02ac94f..eaaa6e4 100644 --- a/core/apirequest/request.py +++ b/core/apirequest/request.py @@ -1,5 +1,6 @@ from .object import buildObject from .path import buildPath +import os def buildRequest(definition, outputs, resolved): path = buildPath(definition.path, outputs, resolved) @@ -20,6 +21,9 @@ def buildRequest(definition, outputs, resolved): if isinstance(value, dict) and "output" in header_value: value = outputs[value["output"]] + if isinstance(value, dict) and "os" in header_value: + #value = os.environ[definition.headers[header_name]["os"]] + value = os.environ["AS_TOKEN"] if isinstance(header_value, dict) and "prefix" in header_value: value = header_value["prefix"] + value diff --git a/core/execution/operation/__pycache__/operation.cpython-314.pyc b/core/execution/operation/__pycache__/operation.cpython-314.pyc index 431281a..d5c874a 100644 Binary files a/core/execution/operation/__pycache__/operation.cpython-314.pyc and b/core/execution/operation/__pycache__/operation.cpython-314.pyc differ diff --git a/core/execution/operation/operation.py b/core/execution/operation/operation.py index 5f27d31..fed0a94 100644 --- a/core/execution/operation/operation.py +++ b/core/execution/operation/operation.py @@ -23,5 +23,5 @@ def buildOperation(definition): #except Exception as error: #outputs = manageFailure(error, action, outputs) - + #print(outputs) return outputs diff --git a/core/execution/operation/skipstep.py b/core/execution/operation/skipstep.py deleted file mode 100644 index ce205d2..0000000 --- a/core/execution/operation/skipstep.py +++ /dev/null @@ -1,20 +0,0 @@ -def skipStep(definition, action, outputs): - try: - if action in definition.skipstep: - condition = definition.skipstep[action] - - #if outputs.get([condition["output"]]) is None: - #return False - #current_value = 1 - #else: - current_value = outputs[condition["output"]] - #current_value = 1 - - if condition["operator"] == ">=": - if current_value >= condition["value"]: - print(f"Skipping {action.name}") - return True - - except KeyError: - #outputs = manageFailure(error) - return False diff --git a/core/runtime/__pycache__/logs.cpython-314.pyc b/core/runtime/__pycache__/logs.cpython-314.pyc index afb5407..f8ee91a 100644 Binary files a/core/runtime/__pycache__/logs.cpython-314.pyc and b/core/runtime/__pycache__/logs.cpython-314.pyc differ diff --git a/core/runtime/__pycache__/outputs.cpython-314.pyc b/core/runtime/__pycache__/outputs.cpython-314.pyc index d64e438..f64d619 100644 Binary files a/core/runtime/__pycache__/outputs.cpython-314.pyc and b/core/runtime/__pycache__/outputs.cpython-314.pyc differ diff --git a/core/runtime/__pycache__/recursiveactions.cpython-314.pyc b/core/runtime/__pycache__/recursiveactions.cpython-314.pyc index 3322afc..1f6f99a 100644 Binary files a/core/runtime/__pycache__/recursiveactions.cpython-314.pyc and b/core/runtime/__pycache__/recursiveactions.cpython-314.pyc differ diff --git a/core/runtime/__pycache__/resolver.cpython-314.pyc b/core/runtime/__pycache__/resolver.cpython-314.pyc index 176edca..835627a 100644 Binary files a/core/runtime/__pycache__/resolver.cpython-314.pyc and b/core/runtime/__pycache__/resolver.cpython-314.pyc differ diff --git a/core/runtime/__pycache__/select.cpython-314.pyc b/core/runtime/__pycache__/select.cpython-314.pyc index 4d60694..dee5707 100644 Binary files a/core/runtime/__pycache__/select.cpython-314.pyc and b/core/runtime/__pycache__/select.cpython-314.pyc differ diff --git a/core/runtime/logs.py b/core/runtime/logs.py index 2a91521..81e593e 100644 --- a/core/runtime/logs.py +++ b/core/runtime/logs.py @@ -15,6 +15,7 @@ def buildLog (action, outputs, response): print(f"{action.name} successful") elif action.showstatus is True and response.status_code != 200: - print(f"{action.name} failed") + print(f"{action.name} failed with status code {response.status_code}") + print(f"Response: {response.json()["error"]}") return diff --git a/core/runtime/outputs.py b/core/runtime/outputs.py index d927de7..01ffe66 100644 --- a/core/runtime/outputs.py +++ b/core/runtime/outputs.py @@ -1,4 +1,4 @@ -def buildOutput(response, action, outputs):#, select_data): +def buildOutput(response, action, outputs): #if select_data != "not applied": #response_data = select_data #else: diff --git a/core/runtime/recursiveactions.py b/core/runtime/recursiveactions.py index 7d47cc8..7b8a7b5 100644 --- a/core/runtime/recursiveactions.py +++ b/core/runtime/recursiveactions.py @@ -8,26 +8,8 @@ def recursiveAction(definition, outputs): for job in recursiveset: outputs, response = buildAction(job, outputs) - #outputs[action.recursive["target"]] = item print(outputs["profile"]) print(outputs["messages"]) return outputs -def recursiveActionStale(action, outputs): - #if hasattr(action, "recursive"): - #outputs[action.recursive["target"]] = {} - for item in outputs[action.recursive["source"]]: - #resolved = resolveItem(action, item)#, outputs)#, resolved) - #print("DEBUG Resolved value:", resolved) - #outputs[action.recursive["target"]] = outputs[action.recursive["source"]][][action.recursive["target"]] - #print(outputs[action.recursive["target"]]) - - #Target may be phased out here. its not quite necessary after resolve - outputs[action.recursive["target"]] = item - - #print(outputs[action.recursive["target"]]) - #target = outputs[action.recursive["source"]["target"] - outputs, response = buildAction(action, outputs)#, resolved) - #print(outputs) - return outputs diff --git a/core/runtime/resolver.py b/core/runtime/resolver.py index 7798198..9f23721 100644 --- a/core/runtime/resolver.py +++ b/core/runtime/resolver.py @@ -1,75 +1,11 @@ def resolveItem(action, item): resolved = {} if hasattr(action, "resolve"): - #label = action.resolve["label"] - #targetkeys = action.resolve["targetkeys"] - #print(item) - #target = item - - #for key in targetkeys: - # target = target[key] - - #resolved[label] = target - for label, keys in action.resolve.items(): target = item - #print(item) - #print(target) + for key in keys: target = target[key] resolved[label] = target - #print(resolved[label]) - - return resolved - -def resolveItem2(action, item, outputs): - #resolved = {} - label = action.resolve["label"] - targetkeys = action.resolve["targetkeys"] - #print(item) - 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]) - - outputs[label] = target - #print("Resolver DEBUG", target, outputs[label]) - return outputs - -def resolveItemBackup(action, item): - resolved = {} - if hasattr(action, "resolve"): - #label = action.resolve["label"] - #targetkeys = action.resolve["targetkeys"] - #print(item) - #target = item - - #for key in targetkeys: - # target = target[key] - - #resolved[label] = target - - for label, keys in action.resolve.items(): - target = item - #print(item) - #print(target) - for key in keys: - target = target[key] - - resolved[label] = target - print(resolved[label]) - return resolved diff --git a/core/runtime/select.py b/core/runtime/select.py index 1913619..1132efa 100644 --- a/core/runtime/select.py +++ b/core/runtime/select.py @@ -28,7 +28,7 @@ def buildSelect(action, outputs): #print(select_data) return select_data, action, outputs - except (KeyError, TypeError): - select_data = ["no selection"] + except: (KeyError, TypeError) + #select_data = ["no selection"] return select_data, action, outputs diff --git a/plugins/rmass/actions/__pycache__/getmessage.cpython-314.pyc b/plugins/rmass/actions/__pycache__/getmessage.cpython-314.pyc index 2bc6948..aa24498 100644 Binary files a/plugins/rmass/actions/__pycache__/getmessage.cpython-314.pyc and b/plugins/rmass/actions/__pycache__/getmessage.cpython-314.pyc differ diff --git a/plugins/rmass/actions/__pycache__/pullmessagelist.cpython-314.pyc b/plugins/rmass/actions/__pycache__/pullmessagelist.cpython-314.pyc index 2097e39..e9fe07d 100644 Binary files a/plugins/rmass/actions/__pycache__/pullmessagelist.cpython-314.pyc and b/plugins/rmass/actions/__pycache__/pullmessagelist.cpython-314.pyc differ diff --git a/plugins/rmass/actions/__pycache__/synapseassignusername.cpython-314.pyc b/plugins/rmass/actions/__pycache__/synapseassignusername.cpython-314.pyc new file mode 100644 index 0000000..910c14b Binary files /dev/null and b/plugins/rmass/actions/__pycache__/synapseassignusername.cpython-314.pyc differ diff --git a/plugins/rmass/actions/__pycache__/synapsecreatedmroom.cpython-314.pyc b/plugins/rmass/actions/__pycache__/synapsecreatedmroom.cpython-314.pyc new file mode 100644 index 0000000..d5313b1 Binary files /dev/null and b/plugins/rmass/actions/__pycache__/synapsecreatedmroom.cpython-314.pyc differ diff --git a/plugins/rmass/actions/__pycache__/synapsegetroomid.cpython-314.pyc b/plugins/rmass/actions/__pycache__/synapsegetroomid.cpython-314.pyc new file mode 100644 index 0000000..4e0c534 Binary files /dev/null and b/plugins/rmass/actions/__pycache__/synapsegetroomid.cpython-314.pyc differ diff --git a/plugins/rmass/actions/__pycache__/synapsepush.cpython-314.pyc b/plugins/rmass/actions/__pycache__/synapsepush.cpython-314.pyc new file mode 100644 index 0000000..7fa62de Binary files /dev/null and b/plugins/rmass/actions/__pycache__/synapsepush.cpython-314.pyc differ diff --git a/plugins/rmass/actions/__pycache__/synapsepushmessages.cpython-314.pyc b/plugins/rmass/actions/__pycache__/synapsepushmessages.cpython-314.pyc new file mode 100644 index 0000000..56607c9 Binary files /dev/null and b/plugins/rmass/actions/__pycache__/synapsepushmessages.cpython-314.pyc differ diff --git a/plugins/rmass/actions/__pycache__/synapseregister.cpython-314.pyc b/plugins/rmass/actions/__pycache__/synapseregister.cpython-314.pyc new file mode 100644 index 0000000..9f06ac3 Binary files /dev/null and b/plugins/rmass/actions/__pycache__/synapseregister.cpython-314.pyc differ diff --git a/plugins/rmass/actions/getmessage.py b/plugins/rmass/actions/getmessage.py index a0f7dcc..821855c 100644 --- a/plugins/rmass/actions/getmessage.py +++ b/plugins/rmass/actions/getmessage.py @@ -1,6 +1,3 @@ -import os - - name = "Get messages" kind = "action" @@ -9,11 +6,12 @@ showstatus = True method = "GET" +#Used to resolve path for recursive handling. Path location must match the location of the recursiveset data from pullmessage operation resolve = { "path": ["messageheaders", "id"], - #"label": "path", } +#To add resolution suffix, second item must be a dictionary. References the "path" library under resolved path = [ "https://rentmasseur.com/api/v1/mailbox/", {"resolved": "path"}, @@ -24,8 +22,6 @@ path = [ #} ] -#path = os.path.join(baseurl.messageid) - headers = { "Authorization": { "output": "access_token", diff --git a/plugins/rmass/actions/pullmessagelist.py b/plugins/rmass/actions/pullmessagelist.py index eb5a888..b7d5591 100644 --- a/plugins/rmass/actions/pullmessagelist.py +++ b/plugins/rmass/actions/pullmessagelist.py @@ -2,43 +2,12 @@ name = "Get message list" kind = "action" -id = "getmessagelist" - showstatus = True -#skipstep = { -# "checkavailable": "validTo >= 3600" -#} - -#availabletime = int(os.environ.get("AVAILABLE_DURATION",3)) - -#duration = availabletime - 1 - -#keys = [ -# { -# "keytitle": "option", -# "keyvalue": 1, -# }, -# { -# "keytitle": "duration", -# "keyvalue": duration, -# }, -#] - method = "GET" -#path = "https://rentmasseur.com/api/v1/mailbox?page=1&folder=1&sort=1" path = "https://rentmasseur.com/api/v1/mailbox" - -#path = [ -# "https://rentmasseur.com/api/v1/mailbox/", -# { -# "output": "emails", -# "keys": [0, "id"] -# } -#] - headers = { "Authorization": { "output": "access_token", @@ -46,13 +15,6 @@ headers = { }, } -#select = { -# "source": "emails", -# "selectmethod": "exclude", -# "key": "unread", -# "value": 0, -#} - select = { "source": "emails", "include": { @@ -69,6 +31,3 @@ outputs = { "emails": "emails" } -#prints = { -# "messageid": "id" -#} diff --git a/plugins/rmass/actions/synapseassignusername.py b/plugins/rmass/actions/synapseassignusername.py new file mode 100644 index 0000000..51ef75a --- /dev/null +++ b/plugins/rmass/actions/synapseassignusername.py @@ -0,0 +1,55 @@ +import os + +name = "Synapse Assign Username" + +kind = "action" + +showstatus = True + +astoken = os.environ["AS_TOKEN"] + +resolve = { + "sender": ["messages", 0, "senderId"], + #"messageid": ["message", "id"], + "username": ["profile", "username"], + #"location": ["profile", "location"], +} +keys = [ + #{ + # "keytitle": "type", + # "keyvalue": "m.login.application_service", + #}, + { + "keytitle": "displayname", + "keyvalue": { + "resolved": "username", + }, + }, +] + +method = "PUT" + +#path = [ +# "https://loxthelion.com/_matrix/client/v3/profile/rmass_", +# {"resolved": "sender"}, +# {"suffix": "/displayname"}, +#] +path = [ + "https://loxthelion.com/_matrix/client/v3/profile/@rmass_", + {"resolved": "sender"}, + ":loxthelion.com/displayname?user_id=@rmass_", + {"resolved": "sender"}, + ":loxthelion.com" +] + +headers = { + "Authorization": { + "os": "AS_TOKEN", + "prefix": "Bearer ", + }, + "Content-Type": "application/json", +} + +#outputs = { +# "user_id": "user_id", +#} diff --git a/plugins/rmass/actions/synapsecreatedmroom.py b/plugins/rmass/actions/synapsecreatedmroom.py new file mode 100644 index 0000000..0a5e1d7 --- /dev/null +++ b/plugins/rmass/actions/synapsecreatedmroom.py @@ -0,0 +1,76 @@ +import os + +name = "Synapse Create DM Room" + +kind = "action" + +showstatus = True + +astoken = os.environ["AS_TOKEN"] + +resolve = { + "sender": ["messages", 0, "senderId"], + #"messageid": ["message", "id"], + "username": ["profile", "username"], + #"location": ["profile", "location"], +} +keys = [ + { + "keytitle": "name", + "keyvalue": { + "resolved": "username", + }, + }, + { + "keytitle": "room_alias_name", + "keyvalue": { + "resolved": "sender", + "prefix": "rmass_dmtest_", + }, + }, + { + "keytitle": "visibility", + "keyvalue": "private", + }, + { + "keytitle": "preset", + "keyvalue": "private_chat", + }, + { + "keytitle": "is_direct", + "keyvalue": True, + }, + { + "keytitle": "invite", + "keyvalue": ["@lyncoln:loxthelion.com"], + }, + #{ + #"keytitle": "power_level_content_override", + #"keyvalue": { + #"users": { + #"@lyncoln:loxthelion.com": 100, + #"@rmass_:loxthelion.com": 100, + #}, + #}, + #} +] + +method = "POST" + +path = [ + "https://loxthelion.com/_matrix/client/v3/createRoom?user_id=@rmass_", + {"resolved": "sender"}, + ":loxthelion.com", +] + +headers = { + "Authorization": { + "os": "AS_TOKEN", + "prefix": "Bearer ", + }, + "Content-Type": "application/json", +} + +outputs = { + "room_id": "room_id", +} diff --git a/plugins/rmass/actions/synapsegetroomid.py b/plugins/rmass/actions/synapsegetroomid.py new file mode 100644 index 0000000..77f1e07 --- /dev/null +++ b/plugins/rmass/actions/synapsegetroomid.py @@ -0,0 +1,38 @@ +import os + +name = "Synapse Get Room ID" + +kind = "action" + +showstatus = True + +#astoken = os.environ["AS_TOKEN"] + +resolve = { + "sender": ["messages", 0, "senderId"], + #"message_id": ["messages", 0, "id"], + #"username": ["profile", "username"], + #"message_body": ["messages", 0, "text"], + #"room_id": ["room_id"], + #"location": ["profile", "location"], +} + +method = "GET" + +path = [ + "https://loxthelion.com/_matrix/client/v3/directory/room/%23rmass_dmtest_", + {"resolved": "sender"}, + "%3Aloxthelion.com", +] + +headers = { + "Authorization": { + "os": "AS_TOKEN", + "prefix": "Bearer ", + }, + "Content-Type": "application/json", +} + +outputs = { + "room_id": "room_id", +} diff --git a/plugins/rmass/actions/synapsepush.py b/plugins/rmass/actions/synapsepush.py deleted file mode 100644 index 3f62dee..0000000 --- a/plugins/rmass/actions/synapsepush.py +++ /dev/null @@ -1,52 +0,0 @@ -import os - -name = "Synapse Message Push" - -kind = "action" - -showstatus = True - -astoken = os.environ["AS_TOKEN"] - -resolve = { - "sender": ["message", "senderId"], - #"messageid": ["message", "id"], - "username": ["profile", "username"], - "location": ["profile", "location"], -} -keys = [ - { - "keytitle": "type", - "keyvalue": , - }, - { - "keytitle": "username", - "keyvalue": {outputs: senderId}, - }, - { - "keytitle": "csrf", - "keyvalue": { - "outputs": "csrf_token", - }, - }, - { - "keytitle": "remember", - "keyvalue": 1, - }, -] - -method = "POST" - -path = "https://rentmasseur.com/api/v1/login" - -outputs = { - "access_token": "accessToken", - "refresh_token": "refreshToken", -} - -savedata = [ - "access_token", - "refresh_token", -] - -savepath = os.environ["TOKEN_STORE"] diff --git a/plugins/rmass/actions/synapsepushmessages.py b/plugins/rmass/actions/synapsepushmessages.py new file mode 100644 index 0000000..9d077b9 --- /dev/null +++ b/plugins/rmass/actions/synapsepushmessages.py @@ -0,0 +1,54 @@ +import os + +name = "Synapse Message Push" + +kind = "action" + +showstatus = True + +#astoken = os.environ["AS_TOKEN"] + +resolve = { + "sender": ["messages", 0, "senderId"], + "message_id": ["messages", 0, "id"], + #"username": ["profile", "username"], + "message_body": ["messages", 0, "text"], + "room_id": ["room_id"], + #"location": ["profile", "location"], +} +keys = [ + { + "keytitle": "msgtype", + "keyvalue": "m.text", + }, + { + "keytitle": "body", + "keyvalue": { + "resolved": "message_body", + }, + }, +] + +method = "PUT" + +path = [ + "https://loxthelion.com/_matrix/client/v3/rooms/", + {"resolved": "room_id"}, + "/send/m.room.message/", + {"resolved": "message_id"}, + "?user_id=@rmass_", + {"resolved": "sender"}, + ":loxthelion.com", +] + +headers = { + "Authorization": { + "os": "AS_TOKEN", + "prefix": "Bearer ", + }, + "Content-Type": "application/json", +} + +#outputs = { +# "room_id": "room_id", +#} diff --git a/plugins/rmass/actions/synapseregister.py b/plugins/rmass/actions/synapseregister.py new file mode 100644 index 0000000..18f6316 --- /dev/null +++ b/plugins/rmass/actions/synapseregister.py @@ -0,0 +1,49 @@ +import os + +name = "Synapse User Registration" + +kind = "action" + +showstatus = True + +astoken = os.environ["AS_TOKEN"] + +resolve = { + "sender": ["messages", 0, "senderId"], + #"messageid": ["message", "id"], + "username": ["profile", "username"], + #"location": ["profile", "location"], +} +keys = [ + { + "keytitle": "type", + "keyvalue": "m.login.application_service", + }, + { + "keytitle": "username", + "keyvalue": { + "resolved": "sender", + "prefix": "rmass_" + }, + }, + { + "keytitle": "inhibitlogin", + "keyvalue": True, + }, +] + +method = "POST" + +path = "https://loxthelion.com/_matrix/client/v3/register" + +headers = { + "Authorization": { + "os": "AS_TOKEN", + "prefix": "Bearer ", + }, + "Content-Type": "application/json", +} + +outputs = { + "user_id": "user_id", +} diff --git a/plugins/rmass/operations/__pycache__/pullmessagelist.cpython-314.pyc b/plugins/rmass/operations/__pycache__/pullmessagelist.cpython-314.pyc index 3b85622..2e7780a 100644 Binary files a/plugins/rmass/operations/__pycache__/pullmessagelist.cpython-314.pyc and b/plugins/rmass/operations/__pycache__/pullmessagelist.cpython-314.pyc differ diff --git a/plugins/rmass/operations/pullmessagelist.py b/plugins/rmass/operations/pullmessagelist.py index b99e0aa..a0ba417 100644 --- a/plugins/rmass/operations/pullmessagelist.py +++ b/plugins/rmass/operations/pullmessagelist.py @@ -1,4 +1,4 @@ -from plugins.rmass.actions import pullmessagelist, refresh_tokens, getmessage, checkavailable +from plugins.rmass.actions import pullmessagelist, refresh_tokens, getmessage, checkavailable, synapseregister, synapseassignusername, synapsecreatedmroom, synapsegetroomid, synapsepushmessages name = "Get Message List" @@ -7,13 +7,13 @@ kind = "operation" actions = [ refresh_tokens, pullmessagelist, + #Recursiveset is used to reference a nested operation inside an operation whose actions are listed in the recursiveset action list "recursiveset", - #setavailable, ] recursiveset = { "source": "emails", "outputlabel": "messageheaders", - "actions": [getmessage], + "actions": [getmessage, synapseregister, synapseassignusername, synapsecreatedmroom, synapsegetroomid, synapsepushmessages], } diff --git a/pullmessagelist (Copy).py b/pullmessagelist (Copy).py deleted file mode 100644 index 07a469e..0000000 --- a/pullmessagelist (Copy).py +++ /dev/null @@ -1,28 +0,0 @@ -import time -from plugins import rmass -from core.execution.operation import buildOperation - -outputs = buildOperation(rmass.operations.pullmessagelist) - -#print(outputs) -user_list = [] -for item in outputs["message_list"]: - sender = item["userCard"] - user_list.append(sender["id"]) -print(user_list) - -conversations = [] -for item in outputs["message_list"]: - conversation = item["id"] - conversations.append(conversation) - -print(conversations) -#for messageid in user_list - #outputs = buildOperation(rmass.operations.getmessage) -#id_list = [] -#for user in user_list -# id_list.append -# print - - -#ime.sleep(rmass.operations.setavailable.sleeptime) diff --git a/pullmessagelist.py b/pullmessagelist.py index 3049ae7..f4775ff 100644 --- a/pullmessagelist.py +++ b/pullmessagelist.py @@ -1,8 +1,7 @@ -import time from plugins import rmass from core.execution.operation import buildOperation -from core.execution.action import buildAction -#from plugins.rmass.actions.getmessage import getmessageaction + + outputs = buildOperation(rmass.operations.pullmessagelist) diff --git a/tokens.json b/tokens.json index 66dfd11..039c316 100644 --- a/tokens.json +++ b/tokens.json @@ -1 +1 @@ -{"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJleHAiOjE3OTE5NTY3NTUsIm5iZiI6MTc5MTk1NjU3NSwic3ViIjoiMjM4MzAyIiwidXNlcm5hbWUiOiJYeHhvdGlxIiwidXNlclR5cGUiOjEsInN0YWdlTmFtZSI6Ilh4eG90aXEiLCJhcHByb3ZlZCI6MSwibG9jYXRpb25JZCI6NDcyLCJzZWFyY2hDaXR5IjoiYXRsYW50YSIsImNvdW50cnlTaG9ydCI6IlVTIiwic2Vzc2lvbkNvdW50cnlDb250aW5lbnQiOiJOQSIsImlzRnJvemVuIjowLCJsb2NhdGlvbkxhYmVsIjoiQXRsYW50YSwgR0EiLCJpc3MiOiJodHRwczovL3JlbnRtYXNzZXVyLmNvbSIsImlhdCI6MTc5MTk1NjYzNX0.G1vCD8bSnaobc71onjgABLIlyoG1LOez4PRbdVSzcSe4aP-HefaU97gky9df18j-msaruFdFpuqWHozsZezspw", "refresh_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJleHAiOjE3OTQ1NDg2MzUsIm5iZiI6MTc5MTk1NjU3NSwianRpIjoiVGFUalhWcm5oUDY5bEdIYzR4OGdKemU1TFpBR2FwMUU3Uk5UMitGY2Rzbz0iLCJpc3MiOiJodHRwczovL3JlbnRtYXNzZXVyLmNvbSIsImlhdCI6MTc5MTk1NjYzNSwic3ViIjoiMjM4MzAyIn0.vZUZ0XqogvKCm8LPnoaPC-zNBwdafJCiSyPM6mv0L2FsM6NhOv4a2mVpHHifSa2ZIafse1MMlwSpMzJl1q7a5A"} \ No newline at end of file +{"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJleHAiOjE3OTIwMDY2MTgsIm5iZiI6MTc5MjAwNjQzOCwic3ViIjoiMjM4MzAyIiwidXNlcm5hbWUiOiJYeHhvdGlxIiwidXNlclR5cGUiOjEsInN0YWdlTmFtZSI6Ilh4eG90aXEiLCJhcHByb3ZlZCI6MSwibG9jYXRpb25JZCI6NDcyLCJzZWFyY2hDaXR5IjoiYXRsYW50YSIsImNvdW50cnlTaG9ydCI6IlVTIiwic2Vzc2lvbkNvdW50cnlDb250aW5lbnQiOiJOQSIsImlzRnJvemVuIjowLCJsb2NhdGlvbkxhYmVsIjoiQXRsYW50YSwgR0EiLCJpc3MiOiJodHRwczovL3JlbnRtYXNzZXVyLmNvbSIsImlhdCI6MTc5MjAwNjQ5OH0.yqVHEvRGiv4-ex2YocTLpZi9MMvdEUn8gDjIUEFgFI7aN1xTUxsaFUwU2trlyyMxvWsGrItmL2R5WNUEtETMlQ", "refresh_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJleHAiOjE3OTQ1OTg0OTgsIm5iZiI6MTc5MjAwNjQzOCwianRpIjoiRVdqOUllLzFJS0d0Q2h0RmRqdlJidnM4empNamFCTnVLdVVTbnFJSndrOD0iLCJpc3MiOiJodHRwczovL3JlbnRtYXNzZXVyLmNvbSIsImlhdCI6MTc5MjAwNjQ5OCwic3ViIjoiMjM4MzAyIn0.X43vHLDs-n7Wf9NURurGHYf_8X6zsrYLX2AmwgZIZ7y_X6tZ4vE7NmywN6jZ_i_L3A-58KF3wOquG22yS9t0Ow"} \ No newline at end of file