1 files added
1 files modified
| New file |
| | |
| | | const db = require("../lib/db") |
| | | const yargs = require("yargs") |
| | | const libIlias = require("../lib/libIlias") |
| | | |
| | | ///////////////////////////////////////////////////////////////////////// |
| | | |
| | | const argv = yargs |
| | | .usage("$0", "ping ilias php",) |
| | | .strict() |
| | | .parse() |
| | | |
| | | |
| | | run(argv) |
| | | .then(console.log) |
| | | .catch(console.error) |
| | | .finally(process.exit) |
| | | |
| | | async function run ({}) { |
| | | return libIlias.ping() |
| | | } |
| | | |
| | |
| | | ///////////////////////////////////////////////////////////////////////// |
| | | |
| | | module.exports = { |
| | | ping, |
| | | |
| | | getUser, |
| | | |
| | | importIliasUser, |
| | |
| | | |
| | | ///////////////////////////////////////////////////////////////////////// |
| | | |
| | | async function ping() { |
| | | const sp = new URLSearchParams({ |
| | | command: "ping", |
| | | token: iliastoken, |
| | | }) |
| | | let url2 = `${url}?${sp.toString()}` |
| | | const res = await fetch(url2, {method: "GET"}) |
| | | return await res.json() // |
| | | } |
| | | |
| | | /////// GET USER //////////////////////////////////////////////////////////////// |
| | | async function getUser (usr_id) { |
| | | const sp = new URLSearchParams({ |