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

Method runScript

sendNotify.js:2857–2879  ·  view source on GitHub ↗
(t, s)

Source from the content-addressed store, hash-verified

2855 });
2856 }
2857 runScript(t, s) {
2858 return new Promise((e) => {
2859 let i = this.getdata('@chavy_boxjs_userCfgs.httpapi');
2860 i = i ? i.replace(/\n/g, '').trim() : i;
2861 let o = this.getdata('@chavy_boxjs_userCfgs.httpapi_timeout');
2862 (o = o ? 1 * o : 20),
2863 (o = s && s.timeout ? s.timeout : o);
2864 const[h, a] = i.split('@'),
2865 r = {
2866 url: `http://${a}/v1/scripting/evaluate`,
2867 body: {
2868 script_text: t,
2869 mock_type: 'cron',
2870 timeout: o
2871 },
2872 headers: {
2873 'X-Key': h,
2874 Accept: '*/*'
2875 },
2876 };
2877 $.post(r, (t, s, i) => e(i));
2878 }).catch((t) => this.logErr(t));
2879 }
2880 loaddata() {
2881 if (!this.isNode())
2882 return {}; {

Callers

nothing calls this directly

Calls 4

eFunction · 0.70
getdataMethod · 0.45
postMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected