Detalhes do pacote

airdcpp-runscript-extension

zersetz-end74MIT1.2.13

Execute scripts on airdcpp-api events/hooks or cron schedule.

airdcpp, airdcpp-extensions, airdcpp-extensions-public

readme (leia-me)

airdcpp-runscript-extension Travis npm package

Extension to execute scripts (JavaScript) on certain events/hooks provided by the AirDC++ Web Client or controlled by cron statement.

Configuration

The configuration consists of 3 sections for events, hooks and schedules. Executions for the same event/hook are executed asynchronously, so the scripts should never build on one another.

Settings

Script execution

Scripts are currently executed by wrapping them in a AsyncFunction object.

Parameter

The following parameters are defined:

Name Type Description
socket object The Api socket
require function Module.require(id) function to load additional modules in the script
extension object The Extension entry structure
message object (Hook and event only) Received message
accept function (Hook only) Function to accept the validation (documentation)
reject function (Hook only) Function to reject the validation (documentation)

Resulting method signatures for each execution type:

async cron(socket, require, extension){
    // your script code
}

async event(socket, require, extension, message){
    // your script code
}

async hook(socket, require, extension, message, accept, reject){
    // your script code
}

Resources

changelog (log de mudanças)

[v1.8.1] - 2020-01-19

  • Revert TS definition defaulting to DefinitelyTyped definitions.

[v1.8.0] - 2020-01-19

  • GH-454 - Range upper limit should default to highest value when step is provided by Noah May noahmouse2011@gmail.com in d36dc9581f9f68580a2016b368f8002a9f1e357d

[v1.7.1] - 2019-04-26

  • GH-416 - Fix issue where next execution time is incorrect in some cases in Naoya Inada naoina@kuune.org in c08522ff80b3987843e9930c307b76d5fe38b5dc

[v1.7.0] - 2019-03-19

  • GH-408 - DST issue by Shua Talansky shua@bitbean.com in 1e971fd6dfa6ba4b0469d99dd64e6c31189d17d3 and 849a2467d16216a9dfa818c57cc26be6b6d0899b

[v1.6.0] - 2018-11-15

  • GH-393, GH-394 - Remove hard limit on max iters in favor of a timeout by Nick Campbell nicholas.j.campbell@gmail.com in 57632b0c06c56e82f40b740b8d7986be43842735
  • GH-390 - better handling of real dates which are in the past by Nick Campbell nicholas.j.campbell@gmail.com in 7cbcc984aea6ec063e38829f68eb9bc0dfb1c775