Skip to content

Commit 58b069b

Browse files
committed
Fixed user input multi region url problem
1 parent 63990e2 commit 58b069b

File tree

4 files changed

+16
-7
lines changed

4 files changed

+16
-7
lines changed

http/1.0.0/requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
uncurl==0.0.10
2-
requests==2.32.2
2+
requests==2.32.2
3+
shuffle-sdk==0.0.26

http/1.0.0/src/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import requests
99
import subprocess
1010

11-
from walkoff_app_sdk.app_base import AppBase
11+
from shuffle_sdk import AppBase
1212

1313
class HTTP(AppBase):
1414
__version__ = "1.0.0"

shuffle-ai/1.0.0/src/app.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -456,8 +456,6 @@ def run_schemaless(self, category, action, app_name="", fields=""):
456456
if app_name:
457457
data["app_name"] = app_name
458458

459-
self.logger.info(f"\n\nFIELDS MAPPED\n\n: {fields}")
460-
461459
if fields:
462460
if isinstance(fields, list):
463461
data["fields"] = fields
@@ -522,7 +520,12 @@ def run_schemaless(self, category, action, app_name="", fields=""):
522520
self.logger.info("[ERROR] Failed to get response headers (category action url debug mapping): %s" % e)
523521

524522
try:
525-
return request.json()
523+
data = request.json()
524+
525+
#if "success" in data and "result" in data and "errors" in data:
526+
# return data["result"]
527+
528+
return data
526529
except:
527530
return request.text
528531

shuffle-subflow/1.1.0/src/app.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,16 @@ def run_userinput(self, user_apikey, sms="", email="", subflow="", information="
6868
if "shuffle-backend" in frontend_url:
6969
frontend_url = ""
7070

71+
api_continue_url = "%s/api/v1/workflows/%s/execute?authorization=%s&reference_execution=%s&answer=true&source_node=%s" % (frontend_url, self.full_execution["workflow"]["id"], self.full_execution["authorization"], self.full_execution["execution_id"], source_node)
72+
api_abort_url = "%s/api/v1/workflows/%s/execute?authorization=%s&reference_execution=%s&answer=false&source_node=%s" % (frontend_url, self.full_execution["workflow"]["id"], self.full_execution["authorization"], self.full_execution["execution_id"], source_node)
73+
74+
# Remove subdomain before .shuffler.io so that https://*.shuffler.io -> https://shuffler.io
75+
if ".shuffler.io" in frontend_url:
76+
frontend_url = "https://shuffler.io"
77+
7178
explore_path = "%s/forms/%s?authorization=%s&reference_execution=%s&source_node=%s" % (frontend_url, self.full_execution["workflow"]["id"], self.full_execution["authorization"], self.full_execution["execution_id"], source_node)
7279
frontend_continue_url = "%s/forms/%s?authorization=%s&reference_execution=%s&answer=true&source_node=%s" % (frontend_url, self.full_execution["workflow"]["id"], self.full_execution["authorization"], self.full_execution["execution_id"], source_node)
7380
frontend_abort_url = "%s/forms/%s?authorization=%s&reference_execution=%s&answer=false&source_node=%s" % (frontend_url, self.full_execution["workflow"]["id"], self.full_execution["authorization"], self.full_execution["execution_id"], source_node)
74-
api_continue_url = "%s/api/v1/workflows/%s/execute?authorization=%s&reference_execution=%s&answer=true&source_node=%s" % (frontend_url, self.full_execution["workflow"]["id"], self.full_execution["authorization"], self.full_execution["execution_id"], source_node)
75-
api_abort_url = "%s/api/v1/workflows/%s/execute?authorization=%s&reference_execution=%s&answer=false&source_node=%s" % (frontend_url, self.full_execution["workflow"]["id"], self.full_execution["authorization"], self.full_execution["execution_id"], source_node)
7681

7782
result["links"]["frontend_no_answer"] = explore_path
7883
result["links"]["frontend_continue"] = frontend_continue_url

0 commit comments

Comments
 (0)