MCPcopy Create free account
hub / github.com/smallfawn/QLScriptPublic / runScript

Method runScript

wxapp/miaoyouHome.js:165–179  ·  view source on GitHub ↗
(t, s)

Source from the content-addressed store, hash-verified

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 {

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