geekdada / yasd

Surge Web Dashboard
https://yasd.royli.dev
MIT License
275 stars 15 forks source link

[Feature Request] 调试脚本支持传入 `argument` #24

Open xream opened 2 days ago

xream commented 2 days ago

Surge 的 HTTP-API 运行脚本支持传入 argument 字段了

curl 'http://127.0.0.1:6171/v1/scripting/evaluate' \
      --data '{
      "script_text": "console.log($argument)\n$done();",
      "mock_type": "cron",
      "argument": "this is it",
      "timeout": 5
  }'

{"result":null,"output":"22:16:33.482967 this is it\n22:16:33.483433 [Script Completed]\n----------------------------\n"}
geekdada commented 22 hours ago

我会在近期增加支持