-
-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathscripts.examples.js
52 lines (44 loc) · 1.43 KB
/
scripts.examples.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
'use strict';
const { log } = require('./services');
//#run-script-example
const runScript = client =>
client
.run('Heroes', { name: 'FMS Triggered Script', param: { name: 'Han' } })
.then(result => log('run-script-example', result));
//#
//#run-script-string-example
const runScriptsString = client =>
client
.run('Heroes', 'FMS Triggered Script')
.then(result => log('run-script-string-example', result));
//#
//#run-script-string-with-parameters-example
const runScriptsStringWithParameters = client =>
client
.run('Heroes', 'FMS Triggered Script', { name: 'Han' })
.then(result => log('run-script-with-parameters-example', result));
//#
//#run-scripts-example
const runMultipleScripts = client =>
client
.run('Heroes', [
{ name: 'FMS Triggered Script', param: { name: 'Han' } },
{ name: 'FMS Triggered Script', phase: 'presort', param: { name: 'Han' } }
])
.then(result => log('run-scripts-example', result));
//#
//#run-single-script-example
const runSingleScript = client =>
client
.run('Heroes', [{ name: 'FMS Triggered Script', param: { name: 'Han' } }])
.then(result => log('run-single-script-example', result));
//#
const scripts = client =>
Promise.all([
runScript(client),
runSingleScript(client),
runMultipleScripts(client),
runScriptsString(client),
runScriptsStringWithParameters(client)
]).then(responses => client);
module.exports = { scripts };