1.2.13 • Published 3 years ago

airdcpp-runscript-extension v1.2.13

Weekly downloads
26
License
MIT
Repository
github
Last release
3 years ago

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:

NameTypeDescription
socketobjectThe Api socket
requirefunctionModule.require(id) function to load additional modules in the script
extensionobjectThe Extension entry structure
messageobject(Hook and event only) Received message
acceptfunction(Hook only) Function to accept the validation (documentation)
rejectfunction(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

1.2.13

3 years ago

1.2.12

3 years ago

1.2.11

3 years ago

1.2.8

3 years ago

1.2.9

3 years ago

1.2.10

3 years ago

1.2.6

3 years ago

1.2.5

3 years ago

1.2.4

3 years ago

1.2.3

3 years ago

1.2.2

3 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.0

6 years ago

1.0.0

6 years ago

0.4.0

6 years ago

0.3.0

6 years ago

0.2.0

7 years ago

0.1.6

7 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago