-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathem.js
33 lines (26 loc) · 1.56 KB
/
em.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
'use strict'
var EmApi = require('./utils/emapi');
var EmApiHelper = require('./utils/emapihelper');
async function doCli(){
// console.log('process', process);
if(process.argv[2] === 'help'){
console.log('-- options:');
console.log('node em.js UserQuery SEPAABBCCDDEE (find out what user is logged in on this device)');
console.log('node em.js DeviceQuery jdoe (find out on what device this user is logged in)');
console.log('node em.js DeviceProfileQuery jdoe (find out what profiles this user has)');
console.log('node em.js Login SEPAABBCCDDEE jdoe (login this user on this device with default profile)');
console.log('node em.js Login SEPAABBCCDDEE jdoe udp_jdoe (login this user on this device with named profile)');
console.log('node em.js Logout SEPAABBCCDDEE (logout user from this device)');
}else if(process.argv[2] === 'UserQuery'){
const res = await EmApi.doRequest(EmApiHelper.getUserQuery(process.argv[3]));
}else if(process.argv[2] === 'DeviceQuery'){
const res = await EmApi.doRequest(EmApiHelper.getDeviceQuery(process.argv[3]));
}else if(process.argv[2] === 'DeviceProfileQuery'){
const res = await EmApi.doRequest(EmApiHelper.getDeviceProfileQuery(process.argv[3]));
}else if(process.argv[2] === 'Login'){
const res = await EmApi.doRequest(EmApiHelper.getLogin(process.argv[3], process.argv[4], process.argv[5]));
}else if(process.argv[2] === 'Logout'){
const res = await EmApi.doRequest(EmApiHelper.getLogout(process.argv[3]));
}
}
doCli();