Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 041192a

Browse files
authoredNov 27, 2024··
feat: make endpoint report the upstream status code (#5510)
* feat(http): make `endpoint()` functions report what status code the upstream Adds column `_status` to the `endpoint()` function in the following: * http * discord * opsgenie * telegraf * teams * webexteams * bigpanda * zenoss * servicenow * victorops * alerta Note: pagerduty already has this column
1 parent 4f84744 commit 041192a

File tree

14 files changed

+155
-205
lines changed

14 files changed

+155
-205
lines changed
 

‎libflux/go/libflux/buildinfo.gen.go

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -80,27 +80,27 @@ var sourceHashes = map[string]string{
8080
"stdlib/contrib/anaisdg/anomalydetection/mad_test.flux": "ef886757f79114d8b6785f5a3ef718c83cfd020946b10e4ec0c351cdf4153293",
8181
"stdlib/contrib/anaisdg/statsmodels/linearreg.flux": "1e2f62eedbf59b5b66bf3e79f85e86b5f3448b042a3bc2bb0441b327ff5b179a",
8282
"stdlib/contrib/anaisdg/statsmodels/linearreg_test.flux": "205a5cb33a5d30d524b4e64374e1c7d5fc711a174a7fd5fee82c331acfd5dbb3",
83-
"stdlib/contrib/bonitoo-io/alerta/alerta.flux": "a3fe3d4bc1bddf92e1b3e3a1e9e013ea035a1c32d0f27facad2d9f8f93b6a891",
83+
"stdlib/contrib/bonitoo-io/alerta/alerta.flux": "fc56e7119786d4ee83e6a7e1750ff21eaeca2a68ef64f6086e917ba6c890e2c4",
8484
"stdlib/contrib/bonitoo-io/hex/hex.flux": "91b6bfacef57d976b869b523a3290037d7593a60fba8280d10440e2d979ca0fd",
85-
"stdlib/contrib/bonitoo-io/servicenow/servicenow.flux": "4102a2b4bc93113f86ccfa2e1615edd14c26fcc557f60c2c5c881cf67fc1f187",
85+
"stdlib/contrib/bonitoo-io/servicenow/servicenow.flux": "5c296c443415fe34d9c20cd217ee631774150181ff9ed012e45aad778b7d2297",
8686
"stdlib/contrib/bonitoo-io/tickscript/alert_test.flux": "15998cce72093e6a58a23ca2194275c693ddbb832e10a0cdcfbdf49d492723ab",
8787
"stdlib/contrib/bonitoo-io/tickscript/alert_with_topic_test.flux": "947e56b091c7f2cfce493025c005770827395985edd34546d6d1846db9dcdde0",
8888
"stdlib/contrib/bonitoo-io/tickscript/deadman_empty_test.flux": "4f4f015ec515f5f335d14e2a136d422c9e6cd343b01a22bb1e0ed69ae5a840b4",
8989
"stdlib/contrib/bonitoo-io/tickscript/deadman_threshold_test.flux": "a0f378277b02d8d3bc4c5a4ff27290c21cef433573598c2382faf0ee5b8e5b97",
9090
"stdlib/contrib/bonitoo-io/tickscript/tickscript.flux": "ca93b020441699fcf74102a024a9bf31603ee67dd9cf01730b18f199beff5ab4",
91-
"stdlib/contrib/bonitoo-io/victorops/victorops.flux": "44d6674a86ceff7995153deca38db142fc0422b5a3526f5d0263a761d222269f",
92-
"stdlib/contrib/bonitoo-io/zenoss/zenoss.flux": "8f6de802b3176bf2524018e32ec5dc4eddd66db86abdeec837e9ca65ad7cc863",
93-
"stdlib/contrib/chobbs/discord/discord.flux": "339d0d91ab323265fe5cbbf63b7278375992fefe46fbe6c9a302c5b37f36e8ec",
91+
"stdlib/contrib/bonitoo-io/victorops/victorops.flux": "c98fcd6ec34aedbaa1ce9b2cfcc84aebb78239399c4ff59dfe92fde4cc13de7b",
92+
"stdlib/contrib/bonitoo-io/zenoss/zenoss.flux": "d77550c76070481453d74c7cf5d091a5029f9c75632add62f1cc281cc1b1fb6a",
93+
"stdlib/contrib/chobbs/discord/discord.flux": "52d3980adc42eeff68e84a89bc80fd4e558797b421197c87d145b092e2320064",
9494
"stdlib/contrib/jsternberg/influxdb/influxdb.flux": "afc52f2e31d5e063e318b752d077c58189317c373494563ea0895cdcdea49074",
9595
"stdlib/contrib/qxip/clickhouse/clickhouse.flux": "8ad86d9c3c7a4271178d5e2fa9bb850856363cf470d92c3f5010b6de9e770db1",
9696
"stdlib/contrib/qxip/hash/hash.flux": "496d0ae212408a44f442bb5093fa92691d3f72927618ee1e841b52646db126c4",
9797
"stdlib/contrib/qxip/logql/logql.flux": "f855e5a58efd4332c63bbdbb41efc9522c97722c44202f4b26c5226c89e7a646",
98-
"stdlib/contrib/rhajek/bigpanda/bigpanda.flux": "0f4d43a7ae08f0ce5e00a746082dbdae06008bcd69cb00b52f0b4f1bb10b7323",
99-
"stdlib/contrib/sranka/opsgenie/opsgenie.flux": "5313b78a30ffb01c606397c9bea954bdd4ca06c44663268bab1e0f706fc6d2c5",
98+
"stdlib/contrib/rhajek/bigpanda/bigpanda.flux": "8cf2760346884a949962fb5d1f89cb16f0ef127e245f6e492f6a2a71630efc64",
99+
"stdlib/contrib/sranka/opsgenie/opsgenie.flux": "bd16a94df7c9e005b0cfe78ab9eb03d7b8777458415b87ac3b64f3a3594fed4c",
100100
"stdlib/contrib/sranka/sensu/sensu.flux": "c3aff3caa234f7f1991f0d37cc40abaee7ad493fbcd7914a0009ac7d66ce0325",
101-
"stdlib/contrib/sranka/teams/teams.flux": "954fb12da5de2bde81ecd047a2c1b3bf05256360cd3515dc7522ca89876996bd",
102-
"stdlib/contrib/sranka/telegram/telegram.flux": "0affc082fbcba7aef7b9ef9a2549812419d922231c0d6524bbfed6e451d05516",
103-
"stdlib/contrib/sranka/webexteams/webexteams.flux": "7f406dc24a30b217555967db42543ba4a36ec54972420cda575349063d38e3a4",
101+
"stdlib/contrib/sranka/teams/teams.flux": "d0ea70602caa643baeb2ea12a8b51d0e2bd2d3c16ac21eaf812eefe97928b65a",
102+
"stdlib/contrib/sranka/telegram/telegram.flux": "d0797f2e243a3c7922adb4484ee0e3bdade966963de4fded0e04178336d32801",
103+
"stdlib/contrib/sranka/webexteams/webexteams.flux": "800c1f82c890d3e9c4356188c4170f018611aa194d4d0f06efe1ed706371d5f4",
104104
"stdlib/contrib/tomhollingworth/events/duration.flux": "611336375816b73cdb7c9c711501c9dbd2e653720b7725f6e658974e3bd6181c",
105105
"stdlib/contrib/tomhollingworth/events/duration_test.flux": "41500a9a391b5e6aa3fb7aa4db6db5e414947be5251736d91ae498d06d1f851e",
106106
"stdlib/contrib/tomhollingworth/events/duration_with_stop_test.flux": "dbecebfe7aaeb988efad6d2160e8f5df28f6816ec6d61d1ccbe9bee99af2f144",
@@ -232,7 +232,7 @@ var sourceHashes = map[string]string{
232232
"stdlib/experimental/window_test.flux": "d5370d2dad30ab536db0584516a46df668eadd59d19bc95885d8a4a0b720bb16",
233233
"stdlib/generate/from_test.flux": "f4b773acadddf8318f1e6c0cc961ca36e22a4016378219e71d58f58fd2264c88",
234234
"stdlib/generate/generate.flux": "2f705b8e44f0b8c64478ad59ccfab09d05c04666b1ab7279629afe1c35c75002",
235-
"stdlib/http/http.flux": "b1e02153693002f80134f6bd76108afa11f7a0c4ee041bcfc17c373c1a6c1338",
235+
"stdlib/http/http.flux": "f1482afe4e9bd1deca2a5fd3f2e68ce84379029003870db552ea44c78b236113",
236236
"stdlib/http/http_path_encode_endpoint_test.flux": "cb1e075f9d0f5d2a2d46b6cec6a8e34eb932f3d31b5494f48a3135c9503d4038",
237237
"stdlib/http/requests/requests.flux": "f88df79b7918f5ab92860197118070bc05f9bbbd9a7261462cecd367dfeeb704",
238238
"stdlib/influxdata/influxdb/influxdb.flux": "e6b28fcea063420a83cdbcb54e4c40d28d28aa27c4b59b012eed7ac8ea6896a4",
@@ -334,13 +334,13 @@ var sourceHashes = map[string]string{
334334
"stdlib/planner/window_sum_eval_test.flux": "460d45de75419da033d9bdf0b9a8c0d1bbdb57ed0d02f44d5f55d4d4b45086f1",
335335
"stdlib/planner/window_sum_push_test.flux": "7ae2d85c889e95134d3976daf01bccacef9b350ef7657400c2c70213fe0c419f",
336336
"stdlib/profiler/profiler.flux": "8e5c0ca87f0c5207c05fa1d0748f008767cf2e7e5451f6bd34a4eb3432573f7a",
337-
"stdlib/pushbullet/pushbullet.flux": "beaca345921767bcdba03d27dab706fe3cb5d69c6d774f50a71e3ab84a2b4f55",
337+
"stdlib/pushbullet/pushbullet.flux": "d6af5b945c03a93492b563fc8374afddc4ac2d966f33882ea9ec350befa67850",
338338
"stdlib/regexp/regexp.flux": "5d9d67f486f4496bc367a0d64fe5e2f96d760f039a7c22b5da9cb9186f58c188",
339339
"stdlib/regexp/replaceAllString_test.flux": "27fedcb986eed1e2de04c78520c7193c67a2bc9dae8b867401dde3c5d40b6b9a",
340340
"stdlib/runtime/runtime.flux": "335db8189403e4ddc9b2cbfddc6a8ddfacd0b15bde3e00725b7aef8be0991d63",
341341
"stdlib/sampledata/sampledata.flux": "57aba09baae57dd99d853b047df2d3047fbf47ea69de4869ef7eac3ad8a6e8ed",
342342
"stdlib/sampledata/sampledata_test.flux": "70ba091a51d036a8cc25931808a39d81cf5d6dd17c2c7a5a081eb83fcfe5dd20",
343-
"stdlib/slack/slack.flux": "395d96eed6a8f8f6b275e8cc2f46f20326b92eff3cbb6a6583f216f146296d55",
343+
"stdlib/slack/slack.flux": "71563bf90727c1cfeeed0701b5b17d2a941a0abb951846a53271e54f8363074a",
344344
"stdlib/socket/socket.flux": "89b9c350c5cf8df5056a45623309be681c5472eadb9088ff5ee59a8c50b879b2",
345345
"stdlib/sql/sql.flux": "5b8a6176c2775e09abccdbef24cd2db68e60c34d493b451a217100b1e84cac0e",
346346
"stdlib/sql/sql_test.flux": "69b61fc1208bb986c14f2e50b004c5bf5004f9cdcfefad0313b5d3981184e1a3",

‎stdlib/contrib/bonitoo-io/alerta/alerta.flux

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -195,28 +195,25 @@ endpoint = (url, apiKey, environment="", origin="") =>
195195
|> map(
196196
fn: (r) => {
197197
obj = mapFn(r: r)
198+
resp =
199+
alert(
200+
url: url,
201+
apiKey: apiKey,
202+
resource: obj.resource,
203+
event: obj.event,
204+
environment: environment,
205+
severity: obj.severity,
206+
service: obj.service,
207+
group: obj.group,
208+
value: obj.value,
209+
text: obj.text,
210+
tags: obj.tags,
211+
attributes: obj.attributes,
212+
origin: origin,
213+
type: obj.type,
214+
timestamp: obj.timestamp,
215+
)
198216

199-
return {r with _sent:
200-
string(
201-
v:
202-
2 == alert(
203-
url: url,
204-
apiKey: apiKey,
205-
resource: obj.resource,
206-
event: obj.event,
207-
environment: environment,
208-
severity: obj.severity,
209-
service: obj.service,
210-
group: obj.group,
211-
value: obj.value,
212-
text: obj.text,
213-
tags: obj.tags,
214-
attributes: obj.attributes,
215-
origin: origin,
216-
type: obj.type,
217-
timestamp: obj.timestamp,
218-
) / 100,
219-
),
220-
}
217+
return {r with _status: string(v: resp), _sent: string(v: 2 == resp / 100)}
221218
},
222219
)

‎stdlib/contrib/bonitoo-io/servicenow/servicenow.flux

Lines changed: 17 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -207,30 +207,23 @@ endpoint = (url, username, password, source="Flux") =>
207207
|> map(
208208
fn: (r) => {
209209
obj = mapFn(r: r)
210+
resp =
211+
event(
212+
url: url,
213+
username: username,
214+
password: password,
215+
source: source,
216+
node: obj.node,
217+
metricType: obj.metricType,
218+
resource: obj.resource,
219+
metricName: obj.metricName,
220+
messageKey: obj.messageKey,
221+
description: obj.description,
222+
severity: obj.severity,
223+
additionalInfo:
224+
record.get(r: obj, key: "additionalInfo", default: record.any),
225+
)
210226

211-
return {r with _sent:
212-
string(
213-
v:
214-
2 == event(
215-
url: url,
216-
username: username,
217-
password: password,
218-
source: source,
219-
node: obj.node,
220-
metricType: obj.metricType,
221-
resource: obj.resource,
222-
metricName: obj.metricName,
223-
messageKey: obj.messageKey,
224-
description: obj.description,
225-
severity: obj.severity,
226-
additionalInfo:
227-
record.get(
228-
r: obj,
229-
key: "additionalInfo",
230-
default: record.any,
231-
),
232-
) / 100,
233-
),
234-
}
227+
return {r with _status: string(v: resp), _sent: string(v: 2 == resp / 100)}
235228
},
236229
)

‎stdlib/contrib/bonitoo-io/victorops/victorops.flux

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -167,20 +167,17 @@ endpoint = (url, monitoringTool="InfluxDB") =>
167167
|> map(
168168
fn: (r) => {
169169
obj = mapFn(r: r)
170+
resp =
171+
alert(
172+
url: url,
173+
messageType: obj.messageType,
174+
entityID: obj.entityID,
175+
entityDisplayName: obj.entityDisplayName,
176+
stateMessage: obj.stateMessage,
177+
timestamp: obj.timestamp,
178+
monitoringTool: monitoringTool,
179+
)
170180

171-
return {r with _sent:
172-
string(
173-
v:
174-
2 == alert(
175-
url: url,
176-
messageType: obj.messageType,
177-
entityID: obj.entityID,
178-
entityDisplayName: obj.entityDisplayName,
179-
stateMessage: obj.stateMessage,
180-
timestamp: obj.timestamp,
181-
monitoringTool: monitoringTool,
182-
) / 100,
183-
),
184-
}
181+
return {r with _status: string(v: resp), _sent: string(v: 2 == resp / 100)}
185182
},
186183
)

‎stdlib/contrib/bonitoo-io/zenoss/zenoss.flux

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -232,29 +232,26 @@ endpoint = (
232232
|> map(
233233
fn: (r) => {
234234
obj = mapFn(r: r)
235+
resp =
236+
event(
237+
url: url,
238+
username: username,
239+
password: password,
240+
apiKey: apiKey,
241+
action: action,
242+
method: method,
243+
type: type,
244+
tid: tid,
245+
summary: obj.summary,
246+
device: obj.device,
247+
component: obj.component,
248+
severity: obj.severity,
249+
eventClass: obj.eventClass,
250+
eventClassKey: obj.eventClassKey,
251+
collector: obj.collector,
252+
message: obj.message,
253+
)
235254

236-
return {r with _sent:
237-
string(
238-
v:
239-
2 == event(
240-
url: url,
241-
username: username,
242-
password: password,
243-
apiKey: apiKey,
244-
action: action,
245-
method: method,
246-
type: type,
247-
tid: tid,
248-
summary: obj.summary,
249-
device: obj.device,
250-
component: obj.component,
251-
severity: obj.severity,
252-
eventClass: obj.eventClass,
253-
eventClassKey: obj.eventClassKey,
254-
collector: obj.collector,
255-
message: obj.message,
256-
) / 100,
257-
),
258-
}
255+
return {r with _status: string(v: resp), _sent: string(v: 2 == resp / 100)}
259256
},
260257
)

‎stdlib/contrib/chobbs/discord/discord.flux

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -129,18 +129,15 @@ endpoint = (webhookToken, webhookID, username, avatar_url="") =>
129129
|> map(
130130
fn: (r) => {
131131
obj = mapFn(r: r)
132+
resp =
133+
send(
134+
webhookToken: webhookToken,
135+
webhookID: webhookID,
136+
username: username,
137+
avatar_url: avatar_url,
138+
content: obj.content,
139+
)
132140

133-
return {r with _sent:
134-
string(
135-
v:
136-
2 == send(
137-
webhookToken: webhookToken,
138-
webhookID: webhookID,
139-
username: username,
140-
avatar_url: avatar_url,
141-
content: obj.content,
142-
) / 100,
143-
),
144-
}
141+
return {r with _status: string(v: resp), _sent: string(v: 2 == resp / 100)}
145142
},
146143
)

‎stdlib/contrib/rhajek/bigpanda/bigpanda.flux

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -218,18 +218,15 @@ endpoint = (url=defaultUrl, token, appKey) =>
218218
|> map(
219219
fn: (r) => {
220220
obj = mapFn(r: r)
221+
resp =
222+
sendAlert(
223+
url: url,
224+
appKey: appKey,
225+
token: token,
226+
status: obj.status,
227+
rec: obj,
228+
)
221229

222-
return {r with _sent:
223-
string(
224-
v:
225-
2 == sendAlert(
226-
url: url,
227-
appKey: appKey,
228-
token: token,
229-
status: obj.status,
230-
rec: obj,
231-
) / 100,
232-
),
233-
}
230+
return {r with _status: string(v: resp), _sent: string(v: 2 == resp / 100)}
234231
},
235232
)

‎stdlib/contrib/sranka/opsgenie/opsgenie.flux

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -185,25 +185,22 @@ endpoint = (url="https://api.opsgenie.com/v2/alerts", apiKey, entity="") =>
185185
|> map(
186186
fn: (r) => {
187187
obj = mapFn(r: r)
188+
resp =
189+
sendAlert(
190+
url: url,
191+
apiKey: apiKey,
192+
entity: entity,
193+
message: obj.message,
194+
alias: obj.alias,
195+
description: obj.description,
196+
priority: obj.priority,
197+
responders: obj.responders,
198+
tags: obj.tags,
199+
actions: obj.actions,
200+
visibleTo: obj.visibleTo,
201+
details: obj.details,
202+
)
188203

189-
return {r with _sent:
190-
string(
191-
v:
192-
2 == sendAlert(
193-
url: url,
194-
apiKey: apiKey,
195-
entity: entity,
196-
message: obj.message,
197-
alias: obj.alias,
198-
description: obj.description,
199-
priority: obj.priority,
200-
responders: obj.responders,
201-
tags: obj.tags,
202-
actions: obj.actions,
203-
visibleTo: obj.visibleTo,
204-
details: obj.details,
205-
) / 100,
206-
),
207-
}
204+
return {r with _status: string(v: resp), _sent: string(v: 2 == resp / 100)}
208205
},
209206
)

‎stdlib/contrib/sranka/teams/teams.flux

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -132,18 +132,14 @@ endpoint = (url) =>
132132
|> map(
133133
fn: (r) => {
134134
obj = mapFn(r: r)
135+
resp =
136+
message(
137+
url: url,
138+
title: obj.title,
139+
text: obj.text,
140+
summary: if exists obj.summary then obj.summary else "",
141+
)
135142

136-
return {r with _sent:
137-
string(
138-
v:
139-
2 == message(
140-
url: url,
141-
title: obj.title,
142-
text: obj.text,
143-
summary:
144-
if exists obj.summary then obj.summary else "",
145-
) / 100,
146-
),
147-
}
143+
return {r with _status: string(v: resp), _sent: string(v: 2 == resp / 100)}
148144
},
149145
)

‎stdlib/contrib/sranka/telegram/telegram.flux

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -177,20 +177,17 @@ endpoint = (
177177
|> map(
178178
fn: (r) => {
179179
obj = mapFn(r: r)
180+
resp =
181+
message(
182+
url: url,
183+
token: token,
184+
channel: obj.channel,
185+
text: obj.text,
186+
parseMode: parseMode,
187+
disableWebPagePreview: disableWebPagePreview,
188+
silent: obj.silent,
189+
)
180190

181-
return {r with _sent:
182-
string(
183-
v:
184-
2 == message(
185-
url: url,
186-
token: token,
187-
channel: obj.channel,
188-
text: obj.text,
189-
parseMode: parseMode,
190-
disableWebPagePreview: disableWebPagePreview,
191-
silent: obj.silent,
192-
) / 100,
193-
),
194-
}
191+
return {r with _status: string(v: resp), _sent: string(v: 2 == resp / 100)}
195192
},
196193
)

‎stdlib/contrib/sranka/webexteams/webexteams.flux

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -121,18 +121,15 @@ endpoint = (url="https://webexapis.com", token) =>
121121
|> map(
122122
fn: (r) => {
123123
obj = mapFn(r: r)
124+
resp =
125+
message(
126+
url: url,
127+
token: token,
128+
roomId: obj.roomId,
129+
text: obj.text,
130+
markdown: obj.markdown,
131+
)
124132

125-
return {r with _sent:
126-
string(
127-
v:
128-
2 == message(
129-
url: url,
130-
token: token,
131-
roomId: obj.roomId,
132-
text: obj.text,
133-
markdown: obj.markdown,
134-
) / 100,
135-
),
136-
}
133+
return {r with _status: string(v: resp), _sent: string(v: 2 == resp / 100)}
137134
},
138135
)

‎stdlib/http/http.flux

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -159,12 +159,9 @@ endpoint = (url) =>
159159
|> map(
160160
fn: (r) => {
161161
obj = mapFn(r: r)
162+
resp = post(url: url, headers: obj.headers, data: obj.data)
162163

163-
return {r with _sent:
164-
string(
165-
v: 200 == post(url: url, headers: obj.headers, data: obj.data),
166-
),
167-
}
164+
return {r with _status: string(v: resp), _sent: string(v: 200 == resp)}
168165
},
169166
)
170167
|> experimental.group(mode: "extend", columns: ["_sent"])

‎stdlib/pushbullet/pushbullet.flux

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -115,17 +115,8 @@ endpoint = (url=defaultURL, token="") =>
115115
|> map(
116116
fn: (r) => {
117117
obj = mapFn(r: r)
118+
resp = pushNote(url: url, token: token, title: obj.title, text: obj.text)
118119

119-
return {r with _sent:
120-
string(
121-
v:
122-
2 == pushNote(
123-
url: url,
124-
token: token,
125-
title: obj.title,
126-
text: obj.text,
127-
) / 100,
128-
),
129-
}
120+
return {r with _status: string(v: resp), _sent: string(v: 2 == resp / 100)}
130121
},
131122
)

‎stdlib/slack/slack.flux

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -156,18 +156,15 @@ endpoint = (url=defaultURL, token="") =>
156156
|> map(
157157
fn: (r) => {
158158
obj = mapFn(r: r)
159+
resp =
160+
message(
161+
url: url,
162+
token: token,
163+
channel: obj.channel,
164+
text: obj.text,
165+
color: obj.color,
166+
)
159167

160-
return {r with _sent:
161-
string(
162-
v:
163-
2 == message(
164-
url: url,
165-
token: token,
166-
channel: obj.channel,
167-
text: obj.text,
168-
color: obj.color,
169-
) / 100,
170-
),
171-
}
168+
return {r with _status: string(v: resp), _sent: string(v: 2 == resp / 100)}
172169
},
173170
)

0 commit comments

Comments
 (0)
Please sign in to comment.