Improve Script.add signature and docs (#24)

This commit is contained in:
Mike Voronov 2022-04-25 16:07:22 +03:00 committed by GitHub
parent 1e892f4ac1
commit 69dbb49db6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 7 deletions

View File

@ -243,10 +243,14 @@ service Script("script"):
-- Adds the given script to a node -- Adds the given script to a node
-- Arguments: -- Arguments:
-- air_script - raw AIR script without any undefined variables -- air_script - raw AIR script without any undefined variables
-- interval - if not set, script will be ran only once -- interval - time to next run of the script in seconds
-- if set, script will be ran once in the interval -- - if set, script will be ran once in the interval
-- (NOTE: actual interval may vary by up to 3 seconds) -- - if not set, script will be ran only once
add(air_script: string, interval: ?u64) -> string -- (NOTE: an actual interval may vary by up to 3 seconds)
-- delay - delay script run time in seconds
-- - if set, script will be delayed on the delay time
-- - if not set, script will be delayed on a random value in [0, interval]
add(air_script: string, interval: ?u64, delay: ?u64) -> string
-- Removes recurring script from a node. Only a creator of the script can delete it -- Removes recurring script from a node. Only a creator of the script can delete it
remove(script_id: string) -> bool remove(script_id: string) -> bool

12
package-lock.json generated
View File

@ -1,5 +1,13 @@
{ {
"name": "@fluencelabs/aqua-lib", "name": "@fluencelabs/aqua-lib",
"version": "0.1.0", "version": "0.2.0",
"lockfileVersion": 1 "lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@fluencelabs/aqua-lib",
"version": "0.2.0",
"license": "MIT"
}
}
} }

View File

@ -1,6 +1,6 @@
{ {
"name": "@fluencelabs/aqua-lib", "name": "@fluencelabs/aqua-lib",
"version": "0.1.1", "version": "0.2.0",
"description": "Aqua standard library", "description": "Aqua standard library",
"files": [ "files": [
"builtin.aqua", "builtin.aqua",