Successfully built RMASS message push module, sender id resolver from DM room and included processing for 204 HTTP response with no content when handling incoming JSON
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,70 @@
|
||||
name = "RMASS Message Push"
|
||||
|
||||
kind = "action"
|
||||
|
||||
showstatus = True
|
||||
|
||||
#recursive = {
|
||||
# "source": "events",
|
||||
# "reverse": False,
|
||||
# "label": "outmessageitem",
|
||||
#}
|
||||
|
||||
#Resolve sources its data from outputs. Ensure keys are in outputs
|
||||
resolve = {
|
||||
"get": {
|
||||
"sender": ["room_name"],
|
||||
"event_id": ["outmessageitem", "event_id"],
|
||||
"message_body": ["outmessageitem", "content", "body"],
|
||||
#"room_id": ["outmessageitem", "room_id"],
|
||||
"timestamp": ["outmessageitem", "origin_server_ts"],
|
||||
},
|
||||
# "construct": {
|
||||
# "matrixuser": [
|
||||
# "@rmass_",
|
||||
# {"resolved": "sender"},
|
||||
# ":loxthelion.com",
|
||||
# ],
|
||||
# },
|
||||
# "transform": {
|
||||
# "matrixuser": {
|
||||
# "@lyncoln:loxthelion.com": "@rmass_238302:loxthelion.com",
|
||||
# },
|
||||
# },
|
||||
"deconstruct": {
|
||||
"sender" : [
|
||||
"#rmass_dm_",
|
||||
":loxthelion.com",
|
||||
],
|
||||
},
|
||||
}
|
||||
|
||||
keys = [
|
||||
{
|
||||
"keytitle": "message",
|
||||
"keyvalue": {
|
||||
"resolved": "message_body",
|
||||
},
|
||||
},
|
||||
{
|
||||
"keytitle": "profileId",
|
||||
"keyvalue": {
|
||||
"resolved": "sender",
|
||||
},
|
||||
},
|
||||
]
|
||||
|
||||
method = "POST"
|
||||
|
||||
path = [
|
||||
"https://rentmasseur.com/api/v1/mailbox",
|
||||
]
|
||||
|
||||
headers = {
|
||||
"Authorization": {
|
||||
"output": "access_token",
|
||||
"prefix": "Bearer ",
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
name = "Get Synapse Room Alias"
|
||||
|
||||
kind = "action"
|
||||
|
||||
showstatus = True
|
||||
|
||||
#recursive = {
|
||||
# "source": "getmessage",
|
||||
# "reverse": True,
|
||||
# "label": "messageitem",
|
||||
#}
|
||||
|
||||
resolve = {
|
||||
"get": {
|
||||
#"sender": ["messageitem", "senderId"],
|
||||
#"event_id": ["messageitem", "id"],
|
||||
#"message_body": ["events", 0, "content", "body"],
|
||||
"room_id": ["outmessageitem", "room_id"],
|
||||
#"timestamp": ["events", 0, "original_server_ts"],
|
||||
},
|
||||
# "construct": {
|
||||
# "matrixuser": [
|
||||
# "@rmass_",
|
||||
# {"resolved": "sender"},
|
||||
# ":loxthelion.com",
|
||||
# ],
|
||||
# },
|
||||
# "transform": {
|
||||
# "matrixuser": {
|
||||
# "@lyncoln:loxthelion.com": "@rmass_238302:loxthelion.com",
|
||||
# },
|
||||
# },
|
||||
}
|
||||
|
||||
|
||||
method = "GET"
|
||||
|
||||
path = [
|
||||
"https://loxthelion.com/_matrix/client/v3/rooms/",
|
||||
{"resolved": "room_id"},
|
||||
"/state/m.room.canonical_alias",
|
||||
]
|
||||
|
||||
headers = {
|
||||
"Authorization": {
|
||||
"os": "ADMIN_TOKEN",
|
||||
"prefix": "Bearer ",
|
||||
},
|
||||
"Content-Type": "application/json",
|
||||
}
|
||||
|
||||
outputs = {
|
||||
"room_name": "alias"
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import os
|
||||
#import os
|
||||
|
||||
name = "Synapse Message Push"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user