forked from jsa2/CloudShellAadApps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmainExtended.js
37 lines (29 loc) · 1018 Bytes
/
mainExtended.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
const { decode } = require("jsonwebtoken");
const { main } = require("./Client2");
const getToken = require("./src/getToken");
const { runner } = require("./src/pluginRunner");
const fs = require('fs');
const { exec } = require("child_process");
const wexc = require('util').promisify(exec)
run()
async function run () {
var token = await getToken()
var tEnc = decode(token)
fs.writeFileSync('kql/tid.txt',tEnc.tid)
await main({
access_token:token,
resource:"https://graph.microsoft.com"
})
try {
await wexc('node nodeparse.js').catch((error) => {
console.log(error)
})
await wexc('node nodeparse2.js')
//await wexc('node dynamicSend.js')
console.log('creating query')
await wexc('node schemaForExternalDataExtended.js')
console.log('open kql/runtime.kql')
} catch (error) {
console.log('faield', error)
}
}