Skip to content

Commit d919784

Browse files
committed
Small api fixes for shuffle tools/ai
1 parent 9247bab commit d919784

File tree

3 files changed

+48
-48
lines changed

3 files changed

+48
-48
lines changed

shuffle-ai/1.0.0/src/app.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,8 @@ def run_schemaless(self, category, action, app_name="", fields=""):
243243
if app_name:
244244
data["app_name"] = app_name
245245

246+
self.logger.info(f"\n\nFIELDS MAPPED\n\n: {fields}")
247+
246248
if fields:
247249
if isinstance(fields, list):
248250
data["fields"] = fields
@@ -291,7 +293,6 @@ def run_schemaless(self, category, action, app_name="", fields=""):
291293
)
292294

293295
try:
294-
self.logger.info("Starting url checker")
295296
if "parameters" in self.action:
296297
response_headers = request.headers
297298
for key, value in response_headers.items():
@@ -303,11 +304,9 @@ def run_schemaless(self, category, action, app_name="", fields=""):
303304
"value": value,
304305
})
305306

306-
self.logger.info("[DEBUG] Response header: %s: %s" % (key, value))
307-
else:
308-
self.logger.info("[DEBUG] No parameters in action. Can't append url headers.")
307+
#self.logger.info("[DEBUG] Response header: %s: %s" % (key, value))
309308
except Exception as e:
310-
self.logger.info("[ERROR] Failed to get response headers: %s" % e)
309+
self.logger.info("[ERROR] Failed to get response headers (category action url debug mapping): %s" % e)
311310

312311
try:
313312
return request.json()

shuffle-tools/1.2.0/api.yaml

+41-41
Original file line numberDiff line numberDiff line change
@@ -184,47 +184,47 @@ actions:
184184
returns:
185185
schema:
186186
type: string
187-
- name: send_email_shuffle
188-
description: Send an email from Shuffle
189-
parameters:
190-
- name: apikey
191-
description: Your https://shuffler.io organization apikey
192-
multiline: false
193-
example: "https://shuffler.io apikey"
194-
required: true
195-
schema:
196-
type: string
197-
- name: recipients
198-
description: The recipients of the email
199-
multiline: false
200-
201-
required: true
202-
schema:
203-
type: string
204-
- name: subject
205-
description: The subject to use
206-
multiline: false
207-
example: "SOS this is an alert :o"
208-
required: true
209-
schema:
210-
type: string
211-
- name: body
212-
description: The body to add to the email
213-
multiline: true
214-
example: "This is an email alert from Shuffler.io :)"
215-
required: true
216-
schema:
217-
type: string
218-
- name: attachments
219-
description: The ID of files in Shuffle to add as attachments
220-
multiline: false
221-
example: "file_id1,file_id2,file_id3"
222-
required: false
223-
schema:
224-
type: string
225-
returns:
226-
schema:
227-
type: string
187+
#- name: send_email_shuffle
188+
# description: Send an email from Shuffle
189+
# parameters:
190+
# - name: apikey
191+
# description: Your https://shuffler.io organization apikey
192+
# multiline: false
193+
# example: "https://shuffler.io apikey"
194+
# required: true
195+
# schema:
196+
# type: string
197+
# - name: recipients
198+
# description: The recipients of the email
199+
# multiline: false
200+
201+
# required: true
202+
# schema:
203+
# type: string
204+
# - name: subject
205+
# description: The subject to use
206+
# multiline: false
207+
# example: "SOS this is an alert :o"
208+
# required: true
209+
# schema:
210+
# type: string
211+
# - name: body
212+
# description: The body to add to the email
213+
# multiline: true
214+
# example: "This is an email alert from Shuffler.io :)"
215+
# required: true
216+
# schema:
217+
# type: string
218+
# - name: attachments
219+
# description: The ID of files in Shuffle to add as attachments
220+
# multiline: false
221+
# example: "file_id1,file_id2,file_id3"
222+
# required: false
223+
# schema:
224+
# type: string
225+
# returns:
226+
# schema:
227+
# type: string
228228
- name: filter_list
229229
description: Takes a list and filters based on your data
230230
skip_multicheck: true

shuffle-tools/1.2.0/src/app.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ def send_email_shuffle(self, apikey, recipients, subject, body, attachments=""):
198198
"subject": subject,
199199
"body": body,
200200
"type": "alert",
201+
"email_app": True,
201202
}
202203

203204
# Read the attachments
@@ -214,9 +215,9 @@ def send_email_shuffle(self, apikey, recipients, subject, body, attachments=""):
214215
pass
215216

216217

217-
url = "https://shuffler.io/api/v1/functions/sendmail"
218+
url = "https://shuffler.io/functions/sendmail"
218219
headers = {"Authorization": "Bearer %s" % apikey}
219-
return requests.post(url, headers=headers, json=data, verify=False).text
220+
return requests.post(url, headers=headers, json=data).text
220221

221222
def repeat_back_to_me(self, call):
222223
return call

0 commit comments

Comments
 (0)