MCPcopy Create free account
hub / github.com/6dylan6/jdpro / runScript

Method runScript

function/sendNotify.js:2308–2330  ·  view source on GitHub ↗
(t, s)

Source from the content-addressed store, hash-verified

2306 });
2307 }
2308 runScript(t, s) {
2309 return new Promise((e) => {
2310 let i = this.getdata('@chavy_boxjs_userCfgs.httpapi');
2311 i = i ? i.replace(/\n/g, '').trim() : i;
2312 let o = this.getdata('@chavy_boxjs_userCfgs.httpapi_timeout');
2313 (o = o ? 1 * o : 20),
2314 (o = s && s.timeout ? s.timeout : o);
2315 const[h, a] = i.split('@'),
2316 r = {
2317 url: `http://${a}/v1/scripting/evaluate`,
2318 body: {
2319 script_text: t,
2320 mock_type: 'cron',
2321 timeout: o
2322 },
2323 headers: {
2324 'X-Key': h,
2325 Accept: '*/*'
2326 },
2327 };
2328 $.post(r, (t, s, i) => e(i));
2329 }).catch((t) => this.logErr(t));
2330 }
2331 loaddata() {
2332 if (!this.isNode())
2333 return {}; {

Callers

nothing calls this directly

Calls 4

eFunction · 0.50
getdataMethod · 0.45
postMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected