-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathexample.js
35 lines (23 loc) · 906 Bytes
/
example.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
const wayscript = require("wayscript");
// Set up http trigger with js
let data = {"hello": "world"};
let headers = {"x-my-custom-header": "hello"};
let status_code = 200;
let response = wayscript.http_trigger.sendResponse(data, headers, status_code);
console.log(response)
// Get wayscript context with js
let event = wayscript.context.getEvent();
console.log(event);
let process = wayscript.context.getProcess();
console.log(process);
let processDetail = wayscript.context.getProcessDetailExpandedData();
console.log(processDetail);
let lairTrigger = wayscript.context.getLairTrigger();
console.log(lairTrigger);
let lair = wayscript.context.getLair();
console.log(lair);
let workspace = wayscript.context.getWorkspace();
console.log(workspace);
let applicationKey = wayscript.utils.getApplicationKey()
let user = wayscript.context.getUserByApplicationKey(applicationKey);
console.log(user)