| 163 | }); |
| 164 | } |
| 165 | runScript(t, s) { |
| 166 | return new Promise((e) => { |
| 167 | let i = this.getdata("@chavy_boxjs_userCfgs.httpapi"); |
| 168 | i = i ? i.replace(/\n/g, "").trim() : i; |
| 169 | let o = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout"); |
| 170 | (o = o ? 1 * o : 20), (o = s && s.timeout ? s.timeout : o); |
| 171 | const [h, a] = i.split("@"), |
| 172 | r = { |
| 173 | url: `http://${a}/v1/scripting/evaluate`, |
| 174 | body: { script_text: t, mock_type: "cron", timeout: o }, |
| 175 | headers: { "X-Key": h, Accept: "*/*" }, |
| 176 | }; |
| 177 | this.post(r, (t, s, i) => e(i)); |
| 178 | }).catch((t) => this.logErr(t)); |
| 179 | } |
| 180 | loaddata() { |
| 181 | if (!this.isNode()) return {}; |
| 182 | { |