MCPcopy Create free account
hub / github.com/Semporia/Scripts / runScript

Method runScript

jd_redPacket.js:1654–1663  ·  view source on GitHub ↗
(t, e)

Source from the content-addressed store, hash-verified

1652 }
1653
1654 runScript(t, e) {
1655 return new Promise(s => {
1656 let i = this.getdata("@chavy_boxjs_userCfgs.httpapi");
1657 i = i ? i.replace(/\n/g, "").trim() : i;
1658 let r = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");
1659 r = r ? 1 * r : 20, r = e && e.timeout ? e.timeout : r;
1660 const [o, h] = i.split("@"), n = {url: `http://${h}/v1/scripting/evaluate`, body: {script_text: t, mock_type: "cron", timeout: r}, headers: {"X-Key": o, Accept: "*/*"}};
1661 this.post(n, (t, e, i) => s(i))
1662 }).catch(t => this.logErr(t))
1663 }
1664
1665 loaddata() {
1666 if (!this.isNode()) return {};

Callers

nothing calls this directly

Calls 4

sFunction · 0.70
getdataMethod · 0.45
postMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected