mirror of
https://github.com/vvsviridov/enm-cli.git
synced 2025-10-23 08:22:21 +00:00
23 lines
674 B
JavaScript
23 lines
674 B
JavaScript
const colors = require('colors')
|
|
const requestWrapper = require('../../util/requestWrapper')
|
|
|
|
|
|
async function initialPrompt() {
|
|
const axiosConfig = {
|
|
method: 'get',
|
|
url: `${this.objectUrl}network/-1?relativeDepth=0:-2&childDepth=1`
|
|
}
|
|
const response = await requestWrapper(axiosConfig, 'Starting Topology Browser...')
|
|
if (!response.data.treeNodes) {
|
|
console.log('Nothing in initial promt!'.red)
|
|
return
|
|
}
|
|
const { moType, moName, poId } = response.data.treeNodes[0]
|
|
this.currentPoId = poId
|
|
this.nextPoId = poId
|
|
this.nextVariants = async (input) => await this.nextObjects(input)
|
|
return `${moType}=${moName}`
|
|
}
|
|
|
|
|
|
module.exports = initialPrompt |