UNPKG

@ks-opdev/cli

Version:

ksodev: A CLI based on the WPS Open Platform

1 lines 5.39 kB
const a4_0x84992=a4_0x3d6b;(function(_0x1b2054,_0xba0d59){const _0x551423=a4_0x3d6b,_0x5518ca=_0x1b2054();while(!![]){try{const _0xede016=parseInt(_0x551423(0x1a2))/0x1+-parseInt(_0x551423(0x1b0))/0x2*(parseInt(_0x551423(0x1bb))/0x3)+parseInt(_0x551423(0x1b5))/0x4*(-parseInt(_0x551423(0x1bc))/0x5)+-parseInt(_0x551423(0x19c))/0x6*(parseInt(_0x551423(0x1b9))/0x7)+parseInt(_0x551423(0x18e))/0x8+parseInt(_0x551423(0x1a9))/0x9*(-parseInt(_0x551423(0x18a))/0xa)+-parseInt(_0x551423(0x18b))/0xb*(-parseInt(_0x551423(0x189))/0xc);if(_0xede016===_0xba0d59)break;else _0x5518ca['push'](_0x5518ca['shift']());}catch(_0x520be7){_0x5518ca['push'](_0x5518ca['shift']());}}}(a4_0x1cb2,0xbe88e));import{ux}from'@oclif/core';function a4_0x1cb2(){const _0x37115e=['No\x20current\x20cluster\x20found','Logged\x20In','Show\x20current\x20user\x20and\x20cluster\x20information','isLoggedIn','action','yellow','log','\x20Not\x20logged\x20in\x20to\x20any\x20cluster','6906lEoNwK','\x20Cluster\x20URL:\x20','\x20total','\x20Username:\x20','length','\x20Status:\x20','1050805KOYTdx','cluster','stop','Failed\x20to\x20get\x20current\x20user\x20information:\x20','getCurrentCluster','\x20(current)','🏷️','3447XiqHdv','getCurrentContext','\x20Cluster\x20Name:\x20','\x20Roles:\x20','getDisplayName','✅\x20Information\x20gathered','getCurrentUserInfo','2TWXaAd','red','join','green','forEach','228AVwxkT','blue','email','📊\x20Gathering\x20user\x20information','2023ZpUtGA','extractUsername','3991077XsncGX','58005jbvUng','createSeparator','colorize','❌\x20Not\x20logged\x20in','7714524XiuFXu','370RTyKmw','22LFcbBy','\x20Available\x20Clusters:\x20','❌\x20Failed','6258376RkEXZY','listClusters','\x20Current\x20Login\x20Information','start','name','error'];a4_0x1cb2=function(){return _0x37115e;};return a4_0x1cb2();}import{ConfigManager}from'../lib/utils/config.js';function a4_0x3d6b(_0x30b86b,_0xa31692){const _0x1cb28b=a4_0x1cb2();return a4_0x3d6b=function(_0x3d6bd9,_0xfbbe72){_0x3d6bd9=_0x3d6bd9-0x188;let _0x2f2a66=_0x1cb28b[_0x3d6bd9];return _0x2f2a66;},a4_0x3d6b(_0x30b86b,_0xa31692);}import{UserUtils}from'../lib/utils/user.js';import a4_0x265b3d from'../lib/extends/command.js';export default class ClusterWhoami extends a4_0x265b3d{static ['description']=a4_0x84992(0x196);async['run'](){const _0x3c431a=a4_0x84992;try{ux[_0x3c431a(0x198)][_0x3c431a(0x191)](_0x3c431a(0x1b8));if(!ConfigManager[_0x3c431a(0x197)]()){ux[_0x3c431a(0x198)][_0x3c431a(0x1a4)](_0x3c431a(0x188)),this[_0x3c431a(0x19a)](this['colorize']('❌',_0x3c431a(0x1b1))+_0x3c431a(0x19b)),this['log'](this[_0x3c431a(0x1be)]('💡','blue')+'\x20Use\x20\x27cluster\x20login\x20[cluster_url]\x27\x20to\x20login');return;}const _0x14f71e=ConfigManager[_0x3c431a(0x1a6)](),_0x19c981=ConfigManager[_0x3c431a(0x1aa)]();!_0x14f71e&&this['error'](_0x3c431a(0x194));const _0x85d541=ConfigManager[_0x3c431a(0x1af)]();ux['action']['stop'](_0x3c431a(0x1ae)),this[_0x3c431a(0x19a)](this[_0x3c431a(0x1be)]('👤',_0x3c431a(0x1b6))+_0x3c431a(0x190)),this[_0x3c431a(0x19a)](this[_0x3c431a(0x1bd)]()),this[_0x3c431a(0x19a)](this[_0x3c431a(0x1be)]('🌐',_0x3c431a(0x1b6))+_0x3c431a(0x19d)+this['colorize'](_0x14f71e[_0x3c431a(0x1a3)],_0x3c431a(0x1b3))),this[_0x3c431a(0x19a)](this[_0x3c431a(0x1be)](_0x3c431a(0x1a8),_0x3c431a(0x1b6))+_0x3c431a(0x1ab)+this[_0x3c431a(0x1be)](_0x14f71e[_0x3c431a(0x192)],_0x3c431a(0x1b3)));_0x19c981&&this[_0x3c431a(0x19a)](this[_0x3c431a(0x1be)]('📋',_0x3c431a(0x1b6))+'\x20Context:\x20'+this[_0x3c431a(0x1be)](_0x19c981[_0x3c431a(0x192)],_0x3c431a(0x1b3)));if(_0x85d541){const _0x3d0c85=UserUtils[_0x3c431a(0x1ba)](_0x85d541);this[_0x3c431a(0x19a)](this['colorize']('👤',_0x3c431a(0x1b6))+'\x20Username:\x20'+this[_0x3c431a(0x1be)](_0x3d0c85,_0x3c431a(0x1b3)));_0x85d541[_0x3c431a(0x1b7)]&&this[_0x3c431a(0x19a)](this[_0x3c431a(0x1be)]('📧',_0x3c431a(0x1b6))+'\x20Email:\x20'+this[_0x3c431a(0x1be)](_0x85d541[_0x3c431a(0x1b7)],_0x3c431a(0x1b3)));const _0x5319d1=UserUtils[_0x3c431a(0x1ad)](_0x85d541);_0x5319d1&&this[_0x3c431a(0x19a)](this[_0x3c431a(0x1be)]('📝',_0x3c431a(0x1b6))+'\x20Display\x20Name:\x20'+this[_0x3c431a(0x1be)](_0x5319d1,_0x3c431a(0x1b3)));const _0x232193=UserUtils['getUserRoles'](_0x85d541);_0x232193['length']>0x0&&this[_0x3c431a(0x19a)](this['colorize']('🔐',_0x3c431a(0x1b6))+_0x3c431a(0x1ac)+this[_0x3c431a(0x1be)](_0x232193[_0x3c431a(0x1b2)](',\x20'),'green'));}else this[_0x3c431a(0x19a)](this[_0x3c431a(0x1be)]('👤','blue')+_0x3c431a(0x19f)+this[_0x3c431a(0x1be)]('Unknown','green'));this[_0x3c431a(0x19a)](this[_0x3c431a(0x1be)]('✅','green')+_0x3c431a(0x1a1)+this[_0x3c431a(0x1be)](_0x3c431a(0x195),_0x3c431a(0x1b3)));const _0x11b5e9=ConfigManager[_0x3c431a(0x18f)]();_0x11b5e9[_0x3c431a(0x1a0)]>0x1&&(this[_0x3c431a(0x19a)](''),this[_0x3c431a(0x19a)](this[_0x3c431a(0x1be)]('📊',_0x3c431a(0x1b6))+_0x3c431a(0x18c)+_0x11b5e9[_0x3c431a(0x1a0)]+_0x3c431a(0x19e)),_0x11b5e9[_0x3c431a(0x1b4)]((_0x1915a4,_0x3cfc11)=>{const _0x27d525=_0x3c431a,_0x4d9d9c=_0x1915a4[_0x27d525(0x192)]===_0x14f71e['name'],_0x428153=_0x4d9d9c?'▶\x20':'\x20\x20',_0x5d1344=_0x4d9d9c?_0x27d525(0x1b3):_0x27d525(0x199);this[_0x27d525(0x19a)](''+_0x428153+(_0x3cfc11+0x1)+'.\x20'+this[_0x27d525(0x1be)](_0x1915a4[_0x27d525(0x1a3)],_0x5d1344)+(_0x4d9d9c?_0x27d525(0x1a7):''));}));}catch(_0xcf2999){ux[_0x3c431a(0x198)]['stop'](_0x3c431a(0x18d)),this[_0x3c431a(0x193)](_0x3c431a(0x1a5)+_0xcf2999);}}}