v1 server and lifecycle manager working. execution contract added
This commit is contained in:
@@ -0,0 +1 @@
|
||||
from . import login, getcsrf, refresh_tokens, checkavailable, setavailable, setunavailable, setnotset
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,30 @@
|
||||
name = "Availability check"
|
||||
|
||||
kind = "action"
|
||||
|
||||
showstatus = False
|
||||
|
||||
method = "GET"
|
||||
|
||||
path = "https://rentmasseur.com/api/v1/account/keeponline"
|
||||
|
||||
outputs = {
|
||||
"message": "message",
|
||||
"validTo": "validTo",
|
||||
}
|
||||
|
||||
headers = {
|
||||
"Authorization": {
|
||||
"output": "access_token",
|
||||
"prefix": "Bearer ",
|
||||
},
|
||||
}
|
||||
|
||||
prints = {
|
||||
"Status": "message",
|
||||
"Time Remaining": "validTo",
|
||||
}
|
||||
|
||||
recoverPolicy = {
|
||||
KeyError: []
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
name = "Get CSRF token"
|
||||
|
||||
kind = "action"
|
||||
|
||||
showstatus = True
|
||||
|
||||
method = "GET"
|
||||
|
||||
path = "https://rentmasseur.com/api/v1/login"
|
||||
|
||||
outputs = {
|
||||
"csrf_token": "csrf"
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
import os
|
||||
|
||||
name = "Login"
|
||||
|
||||
kind = "action"
|
||||
|
||||
showstatus = True
|
||||
|
||||
username = os.environ["RM_USER"]
|
||||
password = os.environ["RM_PASS"]
|
||||
|
||||
keys = [
|
||||
{
|
||||
"keytitle": "email",
|
||||
"keyvalue": username,
|
||||
},
|
||||
{
|
||||
"keytitle": "password",
|
||||
"keyvalue": password,
|
||||
},
|
||||
{
|
||||
"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 = "/home/david/tokens.json"
|
||||
@@ -0,0 +1,51 @@
|
||||
from . import getcsrf, login
|
||||
|
||||
name = "Token refresh"
|
||||
|
||||
showstatus = True
|
||||
|
||||
method = "GET"
|
||||
|
||||
path = "https://rentmasseur.com/api/v1/refresh/tokens"
|
||||
|
||||
headers = {
|
||||
"Authorization": {
|
||||
"output": "refresh_token",
|
||||
"prefix": "Bearer ",
|
||||
},
|
||||
}
|
||||
|
||||
domainname="rentmasseur.com"
|
||||
|
||||
cookies = {
|
||||
"accessToken": {
|
||||
"output": "access_token",
|
||||
},
|
||||
"refeshToken": {
|
||||
"output": "refresh_token",
|
||||
},
|
||||
}
|
||||
|
||||
loaddata = [
|
||||
"access_token",
|
||||
"refresh_token",
|
||||
]
|
||||
|
||||
savedata = [
|
||||
"access_token",
|
||||
"refresh_token",
|
||||
]
|
||||
|
||||
savepath = "/home/david/tokens.json"
|
||||
|
||||
outputs = {
|
||||
"access_token": "accessToken",
|
||||
"refresh_token": "refreshToken",
|
||||
}
|
||||
|
||||
recoverPolicy = {
|
||||
FileNotFoundError: [
|
||||
getcsrf,
|
||||
login,
|
||||
],
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
import os
|
||||
|
||||
name = "Set availability"
|
||||
|
||||
kind = "action"
|
||||
|
||||
id = "setavailable"
|
||||
|
||||
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 = "PUT"
|
||||
|
||||
path = "https://rentmasseur.com/api/v1/account/dashboard/availability"
|
||||
|
||||
headers = {
|
||||
"Authorization": {
|
||||
"output": "access_token",
|
||||
"prefix": "Bearer ",
|
||||
},
|
||||
}
|
||||
|
||||
outputs = {
|
||||
"available_until": "validTo"
|
||||
}
|
||||
|
||||
prints = {
|
||||
"Available until": "available_until"
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
import os
|
||||
|
||||
name = "Unset Availability"
|
||||
|
||||
kind = "action"
|
||||
|
||||
availabletime = int(os.environ.get("AVAILABLE_DURATION",3))
|
||||
|
||||
duration = availabletime - 5
|
||||
|
||||
|
||||
|
||||
keys = [
|
||||
{
|
||||
"keytitle": "online",
|
||||
"keyvalue": 0,
|
||||
},
|
||||
]
|
||||
|
||||
method = "PUT"
|
||||
|
||||
path = "https://rentmasseur.com/api/v1/account/dashboard/availability"
|
||||
|
||||
#headers = "Authorization:" f"Bearer {access_token}"
|
||||
@@ -0,0 +1,26 @@
|
||||
import os
|
||||
|
||||
unavailabletime = int(os.environ.get("AVAILABLE_DURATION",3))
|
||||
|
||||
duration = unavailabletime - 1
|
||||
|
||||
name = "Set Unavailable"
|
||||
|
||||
kind = "action"
|
||||
|
||||
keys = [
|
||||
{
|
||||
"keytitle": "online",
|
||||
"keyvalue": 2,
|
||||
},
|
||||
{
|
||||
"keytitle": "duration",
|
||||
"keytitle": duration,
|
||||
},
|
||||
]
|
||||
|
||||
method = "PUT"
|
||||
|
||||
path = "https://rentmasseur.com/api/v1/account/dashboard/availability"
|
||||
|
||||
#headers = "Authorization:" f"Bearer {access_token}"
|
||||
Reference in New Issue
Block a user