@northflank/cli 0.10.2 → 0.10.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
#!/usr/bin/env node --no-deprecation
|
|
1
|
+
#!/usr/bin/env -S node --no-deprecation
|
|
2
2
|
'use strict';const a1UO=a1K;(function(U,K){const Up=a1K,q=U();while(!![]){try{const X=-parseInt(Up(0x1e4))/0x1+-parseInt(Up(0x179))/0x2*(parseInt(Up(0x1c8))/0x3)+-parseInt(Up(0x190))/0x4+-parseInt(Up(0x1ba))/0x5*(parseInt(Up(0x220))/0x6)+parseInt(Up(0x1e0))/0x7+parseInt(Up(0x1c5))/0x8*(parseInt(Up(0x1eb))/0x9)+parseInt(Up(0x12c))/0xa*(parseInt(Up(0x1e6))/0xb);if(X===K)break;else q['push'](q['shift']());}catch(J){q['push'](q['shift']());}}}(a1U,0xa4cfa));var __createBinding=this&&this[a1UO(0x1cd)]||(Object['create']?function(U,K,q,X){const UF=a1UO;if(X===undefined)X=q;var J=Object[UF(0x182)](K,q);(!J||(UF(0x1d0)in J?!K[UF(0x119)]:J[UF(0x152)]||J[UF(0x20c)]))&&(J={'enumerable':!![],'get':function(){return K[q];}}),Object['defineProperty'](U,X,J);}:function(U,K,q,X){if(X===undefined)X=q;U[X]=K[q];}),__setModuleDefault=this&&this[a1UO(0x18d)]||(Object['create']?function(U,K){const Uo=a1UO;Object[Uo(0x183)](U,'default',{'enumerable':!![],'value':K});}:function(U,K){const UQ=a1UO;U[UQ(0x1b1)]=K;}),__importStar=this&&this[a1UO(0x1d5)]||function(U){const Uw=a1UO;if(U&&U['__esModule'])return U;var K={};if(U!=null){for(var q in U)if(q!==Uw(0x1b1)&&Object['prototype']['hasOwnProperty'][Uw(0x130)](U,q))__createBinding(K,U,q);}return __setModuleDefault(K,U),K;},__awaiter=this&&this[a1UO(0x204)]||function(U,K,q,X){function J(v){return v instanceof q?v:new q(function(f){f(v);});}return new(q||(q=Promise))(function(v,f){const UW=a1K;function L(z){try{E(X['next'](z));}catch(p){f(p);}}function M(z){try{E(X['throw'](z));}catch(p){f(p);}}function E(z){const UR=a1K;z['done']?v(z[UR(0x196)]):J(z[UR(0x196)])[UR(0x224)](L,M);}E((X=X['apply'](U,K||[]))[UW(0x213)]());});},__importDefault=this&&this[a1UO(0x176)]||function(U){return U&&U['__esModule']?U:{'default':U};};Object[a1UO(0x183)](exports,a1UO(0x119),{'value':!![]}),exports['getProgram']=void 0x0;function a1K(U,K){const q=a1U();return a1K=function(X,J){X=X-0x111;let v=q[X];return v;},a1K(U,K);}function a1U(){const Un=['assertContextExisting','./metrics','value','askForAddon','hasNextPage','=>\x20running\x20command\x20with:\x20','portFwdCmd','assign','addonId','./defaults','docsTagsPath','--verbose','resourceTagId','./copy','invoice','CliContext','.yaml','addon','handleYamlOutput','statusText','backupDestinationId','askForAddonBackup','job','branch','./utils','templateId','bind','opts','clearLine','default','service','downloadCmd','Display\x20help\x20for\x20command','skipValidation','vol','askForBuild','printAsTable','Get\x20information\x20about\x20Northflank\x20','60iLPJEL','scrt','length','askForJobRun','query','output','svc','runs','entries','grey','getCommandOverview','1214936CaZRcq','error','rawResponse','3273QiyWBv','kebabCase','OPTIONAL:\x20','resource','required','__createBinding','cursor','isArray','get','delete','consoleFormat','./port-forward','templates','__importStar','VERBOSE:\x20Using\x20endpoint\x20->\x20','InquirerHelper','stringify','clusterId','CliLogs','brn','template','set','toLowerCase','repository','6727483dYIkxm','askForSecret','-v,\x20--version','askForJob','1003857oDtweL','\x0a>\x20Token\x20permissions\x20required:\x20','26622926IEVGyI','askForVolume','Expecting\x20resource\x20input\x20with\x20\x27--input\x27\x20or\x20\x27--file\x27\x20argument','path','getCurrentJobName','18XNiQGC','isString','subdomainId','addHelpText','body','agent','./formatting/command-overview','askForProject','enablePositionalOptions','execCmd','askForService','askForTemplateRun','plan','domains','rgn','credentialId','getLogsCommand','retrievePayloadViaInteractiveCli','adn','./logs','omit','pipelineId','askForLogSink','verbose','commander','__awaiter','customUserAgent','has','parseAsync','asyncSequential','askForSubdomain','cred','replace','configurable','dmn','existsSync','map','branches','login','page','next','secret','stdout','File\x20does\x20not\x20exist:\x20','/docs/v1/api/','domainId','aliases','after','pop','safeLoad','subdomain','opt','tag','658248vrgOwk','getOwnPropertyNames','js-yaml','project','then','join','url','some','type','templateRunId','backup-destination','VERBOSE:\x20Request\x20body\x20->\x20','checkUpdate','repositories','Resource\x20was\x20not\x20deleted.','green','jobId','./formatting/console-format-helpers','__esModule','volumes','toUpperCase','secretId',',\x20NF\x20error\x20id:\x20','credential','getProgram','there\x20are\x20more\x20rows,\x20load?','commands','all','restores','backupId','projects','description','pagination','underline','secrets','keys','Print\x20the\x20current\x20version\x20of\x20the\x20Northflank\x20cli','10GtqDIv','action','split','subdomainPath','call','startsWith','update','buildId','Northflank\x20cli\x20version:\x20','askForSubdomainPath','askForPipeline','requiredPermissions','api.','getMetricsCommand','\x20--','filter','paginationArgs','uploadCmd','repos','addHelpCommand','Update\x20Northflank\x20','inv','json','setPathVars','moveCursor','regions','list','toString','yml','force','helpOption','JSON-formatted\x20resource\x20definition,\x20takes\x20precedence\x20over\x20\x22--file\x22','addCommand','Unknown\x20input\x20file\x20type:\x20','loadAll','yaml','Failed\x20to\x20validate\x20input\x20(incorrect\x20format):\x20','./exec','writable','askForBackupDestination','./context/contextCommands','quiet','base','./inquirer-helper','volumeId','.json','count','defaults','file','find','getCurrentProjectName','plans','backup','region','credentials','domain','logs','includes','endpoints','askForCredentials','chalk','upperFirst','concat','option','host','Error\x20occured\x20while\x20trying\x20to\x20run\x20command,\x20error:\x20','isPaginatedEndpoint','lodash','pln','ApiClient','Documentation:\x20','parse','-f,\x20--file\x20<file-path>','isEqual','__importDefault','argv','version','110dsTtcq','CliExec','../package.json','contexts','repo','log','exitCode','projectId','serviceId','getOwnPropertyDescriptor','defineProperty','data','endsWith','-i,\x20--input\x20<resource-def>','custom-columns=','jobs','boolean','backups','CliFileCopy','tpl','__setModuleDefault','invoices','message','2518580xRMIal','askForClusterId','nonInteractiveEndpoint','forEach'];a1U=function(){return Un;};return a1U();}const js_client_1=require('@northflank/js-client'),commander_1=__importDefault(require(a1UO(0x203))),fs_1=__importDefault(require('fs')),chalk_1=__importDefault(require(a1UO(0x168))),_=__importStar(require(a1UO(0x16f))),contextCommands_1=require(a1UO(0x154)),utils_1=require(a1UO(0x1ac)),defaults=__importStar(require(a1UO(0x19d))),inquirer_helper_1=require(a1UO(0x157)),console_format_helpers_1=require(a1UO(0x118)),command_overview_1=require(a1UO(0x1f1)),port_forward_1=require(a1UO(0x1d3)),exec_1=require(a1UO(0x151)),logs_1=require(a1UO(0x1fe)),metrics_1=require(a1UO(0x195)),copy_1=require(a1UO(0x1a1)),yaml=require(a1UO(0x222)),pgk=require(a1UO(0x17b)),getProgram=U=>{const UV=a1UO,K=new commander_1[(UV(0x1b1))]['Command']('northflank');K['description']('Manage\x20your\x20Northflank\x20resources\x20from\x20the\x20command\x20line'),K[UV(0x1f3)](!![]),K[UV(0x178)](UV(0x134)+chalk_1['default'][UV(0x128)](pgk[UV(0x178)]),UV(0x1e2),UV(0x12b));const q=new js_client_1[(UV(0x171))](U,{'throwErrorOnHttpErrorCode':![],'customUserAgent':utils_1[UV(0x205)],'agent':utils_1[UV(0x1f0)]}),X=new contextCommands_1[(UV(0x1a3))](q,utils_1[UV(0x1f0)]),J=new port_forward_1['CliPortForward'](U,utils_1[UV(0x1f0)]),v=new exec_1[(UV(0x17a))](U,utils_1['agent']),f=new copy_1[(UV(0x18b))](U,utils_1[UV(0x1f0)]),L=new logs_1[(UV(0x1da))](U,utils_1[UV(0x1f0)]),M=new metrics_1['CliMetrics'](U,utils_1[UV(0x1f0)]);return K['addCommand'](J[UV(0x19a)]),K[UV(0x14c)](v[UV(0x1f4)]),K[UV(0x14c)](f[UV(0x1b3)]),K[UV(0x14c)](f[UV(0x13d)]),K[UV(0x14c)](X[UV(0x211)]),K[UV(0x14c)](X[UV(0x17c)]),generateCommands(q,q[UV(0x166)],K,L,M),K[UV(0x14c)]((0x0,command_overview_1[UV(0x1c4)])(K)),K[UV(0x13f)](!![],'Display\x20help\x20for\x20command'),K[UV(0x14a)](undefined,UV(0x1b4)),K;};exports[a1UO(0x11f)]=getProgram,((()=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const Ub=a1UO;try{const U=new js_client_1['ApiClientFileContextProvider']();yield(0x0,utils_1[Ub(0x113)])(U);const K=(0x0,exports[Ub(0x11f)])(U);yield K[Ub(0x207)](process[Ub(0x177)]);}catch(q){(0x0,utils_1[Ub(0x1c6)])(Ub(0x16d)+q[Ub(0x18f)]),process[Ub(0x177)][Ub(0x15d)](X=>X===Ub(0x19f))&&console[Ub(0x17e)](q),process[Ub(0x17f)]=0x1;}}))());function isListCommand(U){const UB=a1UO,K=[[UB(0x1d0),'addon',UB(0x18a)],[UB(0x1d0),UB(0x1aa),UB(0x1c1)]];return U[UB(0x15d)](q=>q===UB(0x146))||K[UB(0x227)](q=>_[UB(0x175)](U,q));}function generateCommands(U,K,q,X,J,v=defaults[a1UO(0x15b)],f=[]){const Uy=a1UO,L=new inquirer_helper_1[(Uy(0x1d7))](new js_client_1[(Uy(0x171))](U['contextProvider'],{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1['customUserAgent'],'agent':utils_1[Uy(0x1f0)]}));function M(O,F){const Ux=Uy;return O[Ux(0x1cc)]!==![]&&F===undefined;}function E(O,F){const Ua=Uy,{opt:o,name:Q}=O,w=o['default'],R=M(o,w),W=a=>a[Ua(0x1bc)]>0x1?'--'+a:'-'+a,V=o===null||o===void 0x0?void 0x0:o['alias'],b=V?_[Ua(0x1cf)](V)?'-'+(V===null||V===void 0x0?void 0x0:V['map'](m=>W(m))[Ua(0x225)](',\x20-'))+',':''+W(V):'',B=R?'':Ua(0x1ca),y=typeof o[Ua(0x228)]===Ua(0x189)||o[Ua(0x228)]===Ua(0x189)?b+Ua(0x13a)+Q:b+Ua(0x13a)+Q+'\x20<'+Q[Ua(0x11b)]()+'>',x=B+o['description'];F[Ua(0x16b)](y,x,w);}function z(O,F){const Um=Uy;if(F[Um(0x121)][Um(0x227)](o=>o['name']()===Um(0x164)))return;_[Um(0x175)](O,[Um(0x1d0),'service'])&&(F['addCommand'](X['getLogsCommand']('service')),F[Um(0x14c)](J['getMetricsCommand'](Um(0x1b2))),F[Um(0x14c)](X[Um(0x1fb)]('service',!![])),F[Um(0x14c)](J[Um(0x139)](Um(0x1b2),!![]))),_[Um(0x175)](O,[Um(0x1d0),'job'])&&(F['addCommand'](X[Um(0x1fb)](Um(0x1aa))),F[Um(0x14c)](J[Um(0x139)]('job')),F['addCommand'](X['getLogsCommand'](Um(0x1aa),!![])),F['addCommand'](J[Um(0x139)](Um(0x1aa),!![]))),_[Um(0x175)](O,[Um(0x1d0),Um(0x1a5)])&&(F[Um(0x14c)](X['getLogsCommand'](Um(0x1a5))),F[Um(0x14c)](J['getMetricsCommand'](Um(0x1a5)))),_['isEqual'](O,[Um(0x1d0),Um(0x1a5),Um(0x160)])&&F[Um(0x14c)](X[Um(0x1fb)]('addon',![],!![])),_['isEqual'](O,[Um(0x1d0),'addon',Um(0x123)])&&F[Um(0x14c)](X[Um(0x1fb)](Um(0x1a5),![],!![],!![]));}return Object['getOwnPropertyNames'](v)[Uy(0x193)](O=>{const Ui=Uy,F=K[O],o=v[O],Q=f[Ui(0x16a)]([O]);function w(i,G){const UG=Ui,A=Object[UG(0x221)](i||{});A[UG(0x20f)](s=>{return{'name':s,'opt':i[s]};})['sort']((s,D)=>!M(s[UG(0x21e)])?!M(D[UG(0x21e)])?0x0:0x1:-0x1)[UG(0x193)](s=>{E(s,G);});}function R(i,G){const UA=Ui,A=[[UA(0x223),UA(0x125),'prj'],[UA(0x1b2),'services',UA(0x1c0)],[UA(0x162),UA(0x11e),UA(0x20a)],[UA(0x1a5),'addons',UA(0x1fd)],[UA(0x1aa),UA(0x188)],[UA(0x1f7),UA(0x15f),UA(0x170)],[UA(0x161),UA(0x145),UA(0x1f9)],['domain',UA(0x1f8),UA(0x20d)],[UA(0x214),UA(0x129),UA(0x1bb)],[UA(0x11a),'volume',UA(0x1b6)],[UA(0x210),UA(0x1ab),UA(0x1db)],[UA(0x1a2),UA(0x18e),UA(0x141)],[UA(0x1dc),UA(0x1d4),UA(0x18c)],[UA(0x13e),UA(0x1df),UA(0x114),UA(0x17d)],[UA(0x111),'backup-destinations'],[UA(0x21f),'tags']],s=A[UA(0x15d)](D=>D[UA(0x165)](G));if(s!==undefined)i[UA(0x219)](s[UA(0x13b)](D=>D!==G));}function W(i){var G,A;return __awaiter(this,void 0x0,void 0x0,function*(){const Us=a1K,s={},{contextProvider:D}=U,H=Q[Us(0x165)](Us(0x1d1)),g=i['noDefaults']===!![];function S(C,N,Z){var e,n;return __awaiter(this,void 0x0,void 0x0,function*(){const UD=a1K;if(_['has']((n=(e=o['opt'])===null||e===void 0x0?void 0x0:e[UD(0x1e9)])!==null&&n!==void 0x0?n:{},C)){const t=!g&&!H&&Z?Z():undefined,Y=i[C]||t||(yield N());_[UD(0x1dd)](s,C,Y);}});}return yield(0x0,utils_1['asyncSequential'])(Object[Us(0x1c2)]((A=(G=o[Us(0x21e)])===null||G===void 0x0?void 0x0:G['path'])!==null&&A!==void 0x0?A:{}),([C,N])=>__awaiter(this,void 0x0,void 0x0,function*(){const UH=Us;var Z;const e=s===null||s===void 0x0?void 0x0:s[UH(0x180)],n=s===null||s===void 0x0?void 0x0:s[UH(0x1ad)];switch(C){case UH(0x180):return yield S(UH(0x180),L[UH(0x1f2)]['bind'](L),D[UH(0x15e)][UH(0x1ae)](D));case UH(0x181):return yield S(UH(0x181),L[UH(0x1f5)](e)[UH(0x1ae)](L),D['getCurrentServiceName'][UH(0x1ae)](D));case UH(0x19c):return yield S(UH(0x19c),L[UH(0x197)](e)[UH(0x1ae)](L));case UH(0x117):return yield S(UH(0x117),L[UH(0x1e3)](e)[UH(0x1ae)](L),D[UH(0x1ea)]['bind'](D));case'runId':return yield S('runId',L[UH(0x1bd)](s[UH(0x117)],e,![])[UH(0x1ae)](L));case UH(0x11c):return yield S('secretId',L[UH(0x1e1)](e)[UH(0x1ae)](L));case UH(0x163):case UH(0x218):return yield S(UH(0x163),L['askForDomain'][UH(0x1ae)](L));case UH(0x1fa):return yield S('credentialId',L[UH(0x167)]['bind'](L));case UH(0x158):return yield S(UH(0x158),L[UH(0x1e7)](e)[UH(0x1ae)](L));case UH(0x21d):return yield S('subdomain',L[UH(0x209)](s[UH(0x163)])[UH(0x1ae)](L));case'subdomainId':return yield S(UH(0x1ed),L[UH(0x209)](s['domainId'])[UH(0x1ae)](L));case'subdomainPath':return yield S(UH(0x12f),L[UH(0x135)](s[UH(0x163)],(Z=s['subdomain'])!==null&&Z!==void 0x0?Z:s[UH(0x1ed)])['bind'](L));case'backupId':return yield S(UH(0x124),L[UH(0x1a9)](e,s[UH(0x19c)])[UH(0x1ae)](L));case UH(0x133):return yield S('buildId',L[UH(0x1b7)](e,s[UH(0x181)],s[UH(0x117)])[UH(0x1ae)](L));case UH(0x1ad):return yield S(UH(0x1ad),L['askForTemplate']()[UH(0x1ae)](L));case UH(0x229):return yield S('templateRunId',L[UH(0x1f6)](n)[UH(0x1ae)](L));case'logSinkId':return yield S('logSinkId',L[UH(0x201)]()[UH(0x1ae)](L));case UH(0x200):return yield S(UH(0x200),L[UH(0x136)](e)[UH(0x1ae)](L));case UH(0x1a0):return yield S(UH(0x1a0),L['askForTag']()[UH(0x1ae)](L));case UH(0x1a8):return yield S(UH(0x1a8),L[UH(0x153)]()['bind'](L));case UH(0x1d9):return yield S(UH(0x1d9),L[UH(0x191)]()[UH(0x1ae)](L));default:return yield S(C,L['askGeneric'](C,N===null||N===void 0x0?void 0x0:N['description'])[UH(0x1ae)](L));}})),s;});}function V(i){var G,A,s;return __awaiter(this,void 0x0,void 0x0,function*(){const Ug=a1K,D={},H=((G=o[Ug(0x21e)])===null||G===void 0x0?void 0x0:G[Ug(0x16e)])?defaults[Ug(0x13c)]:{},g=Object[Ug(0x19b)](Object[Ug(0x19b)]({},(s=(A=o['opt'])===null||A===void 0x0?void 0x0:A[Ug(0x1be)])!==null&&s!==void 0x0?s:{}),H),S=Object['keys'](g)[Ug(0x13b)](C=>C!=='loadAll');return yield(0x0,utils_1[Ug(0x208)])(S,C=>__awaiter(this,void 0x0,void 0x0,function*(){if(i[C]!==undefined)return _['set'](D,C,i[C]);})),D;});}function b(){const US=Ui;switch(Q[0x0]){case'get':return US(0x1b9)+(Q[0x1]||US(0x1cb))+'s';case US(0x132):return US(0x140)+(Q[0x1]||US(0x1cb))+'\x20properties';default:return _[US(0x169)](O)+'\x20Northflank\x20resources';}}function B(i,G){const UC=Ui;var A,s,D,H,g,S,C,N;if(!G){const c=(0x0,utils_1['getCommand'])()['name'](_[UC(0x1c9)](O))[UC(0x126)](b());return R(c,O),c;}const Z=(i===null||i===void 0x0?void 0x0:i[UC(0x137)])?chalk_1[UC(0x1b1)][UC(0x1c3)](UC(0x1e5)+i[UC(0x137)]):'',e=U['contextProvider']['getCurrentContext'](),n=e!==undefined&&((A=o===null||o===void 0x0?void 0x0:o[UC(0x21e)])===null||A===void 0x0?void 0x0:A['docsTagsPath'])!==undefined,t=e===null||e===void 0x0?void 0x0:e[UC(0x16c)]['replace'](UC(0x138),''),Y=n?UC(0x172)+t+UC(0x217)+((s=o===null||o===void 0x0?void 0x0:o[UC(0x21e)])===null||s===void 0x0?void 0x0:s[UC(0x19e)]):'',l=(i===null||i===void 0x0?void 0x0:i[UC(0x126)])||'',T=(0x0,utils_1['getCommand'])(!![])['name'](_[UC(0x1c9)](O))[UC(0x126)](l)[UC(0x1ee)](UC(0x21a),[Z,Y]['join']('\x0a'));R(T,O);(((D=o['opt'])===null||D===void 0x0?void 0x0:D[UC(0x1ef)])||((H=o[UC(0x21e)])===null||H===void 0x0?void 0x0:H[UC(0x192)]))&&(T[UC(0x16b)](UC(0x174),'File\x20to\x20load\x20resource\x20json\x20from'),T[UC(0x16b)](UC(0x186),UC(0x14b)));w((g=o[UC(0x21e)])===null||g===void 0x0?void 0x0:g[UC(0x1e9)],T),w((S=o['opt'])===null||S===void 0x0?void 0x0:S['query'],T);const I=(C=o['opt'])===null||C===void 0x0?void 0x0:C['isPaginatedEndpoint'];return I&&w(defaults[UC(0x13c)],T),w((N=o[UC(0x21e)])===null||N===void 0x0?void 0x0:N[UC(0x156)],T),T[UC(0x12d)](()=>__awaiter(this,void 0x0,void 0x0,function*(){const UN=UC;var h,P,k,u,d,r;(0x0,utils_1[UN(0x194)])(U);const j=T[UN(0x1af)]();(j===null||j===void 0x0?void 0x0:j[UN(0x202)])&&utils_1['proxyEnvsSet']&&(0x0,utils_1['warning'])('VERBOSE:\x20HTTP_PROXY\x20or\x20HTTPS_PROXY\x20environment\x20variable\x20set:\x20tunnelling\x20traffic\x20through\x20HTTP\x20proxy.');const U0=j[UN(0x212)]!==undefined||j[UN(0x1ce)]!==undefined;if(j[UN(0x14e)]===!![]&&U0)throw new Error('Options\x20\x27loadAll\x27\x20can\x20not\x20be\x20combined\x20with\x20\x27page\x27\x20or\x20\x27cursor\x27');const U1=j===null||j===void 0x0?void 0x0:j[UN(0x1bf)],U2=U1===UN(0x142),U3=U1===UN(0x14f)||U1===UN(0x148),U4=yield W(j);L[UN(0x143)](U4);const U5=yield V(j),U6=Object[UN(0x12a)]((P=(h=o[UN(0x21e)])===null||h===void 0x0?void 0x0:h['path'])!==null&&P!==void 0x0?P:{})[UN(0x20f)](UK=>UK+'='+chalk_1[UN(0x1b1)][UN(0x116)](U4[UK]))[UN(0x225)](',\x20');if(U6['length']>0x0&&!U2&&!U3){const UK=UN(0x199)+U6;console[UN(0x17e)](UK);}const U7=((k=o['opt'])===null||k===void 0x0?void 0x0:k[UN(0x1ef)])||((u=o[UN(0x21e)])===null||u===void 0x0?void 0x0:u[UN(0x192)])?yield p(j,o,Q):undefined;if(!j[UN(0x149)]&&Q['includes'](UN(0x1d1))&&!(yield L['deleteWarningPrompt']())){(0x0,utils_1['warning'])(UN(0x115));return;}const U8=I&&(j['loadAll']||(j[UN(0x1bf)]===UN(0x142)||j[UN(0x1bf)]===UN(0x14f))&&!U0);let U9=U8&&F instanceof js_client_1['GetApiEndpointPaginated']?yield F[UN(0x122)]({'parameters':U4,'options':U5,'data':U7}):yield F[UN(0x130)]({'parameters':U4,'options':Object[UN(0x19b)]({},U5),'data':U7});if(j===null||j===void 0x0?void 0x0:j[UN(0x202)]){const Uq=U9['request'];console[UN(0x17e)](UN(0x1d6)+Uq['method'][UN(0x11b)]()+':'+Uq[UN(0x226)]);if(U7!==undefined)console[UN(0x17e)](UN(0x112)+U7);}if(U9[UN(0x1c6)]){const {details:UX,id:UJ,message:Uv,status:Uf}=U9[UN(0x1c6)],UL=UX?'\x0a\x09details\x20:'+JSON[UN(0x1d8)](UX):'',UM=UJ?UN(0x11d)+UJ:'',UE='(HTTP\x20status\x20code:\x20'+Uf+UM+')';throw new Error('API\x20request\x20failed\x0a\x09Message:\x20'+Uv+'\x20'+UE+UL);}let UU=0x0;printCallResult(j,U2,U9[UN(0x184)],U3,Q,U1,![],UU,U9[UN(0x1c7)][UN(0x1a7)]);if(!j[UN(0x155)]&&!U8&&!U0&&((d=U9['pagination'])===null||d===void 0x0?void 0x0:d[UN(0x198)]))while((r=U9[UN(0x127)])===null||r===void 0x0?void 0x0:r[UN(0x198)]){const Uz=yield L['askConfirm'](UN(0x120));if(Uz)process[UN(0x215)][UN(0x144)](0x0,-0x1),process[UN(0x215)][UN(0x1b0)](0x1),UU+=U9['pagination'][UN(0x15a)],U9=yield U9[UN(0x127)]['getNextPage'](),printCallResult(j,U2,U9['data'],U3,Q,U1,!![],UU,U9['rawResponse'][UN(0x1a7)]);else return;}})),T;}const y=_[Ui(0x206)](o,Ui(0x21e)),x=F,a=B(x,y);z(Q,a),q[Ui(0x14c)](a);const m=_[Ui(0x1ff)](o,Ui(0x21e));Object[Ui(0x12a)](m)[Ui(0x1bc)]>0x0&&generateCommands(U,F,a,X,J,m,Q);});function p(O,F,o){var Q;return __awaiter(this,void 0x0,void 0x0,function*(){const UZ=a1K,{input:w,file:R}=O;if(w!==undefined)try{return JSON[UZ(0x173)](w);}catch(W){try{return yaml[UZ(0x21c)](w);}catch(V){throw new Error('Unknown\x20input\x20format.\x20Not\x20valid\x20json\x20and\x20not\x20valid\x20yaml.');}}if(R!==undefined){if(!fs_1['default'][UZ(0x20e)](R))throw new Error(UZ(0x216)+R);const b=fs_1[UZ(0x1b1)]['readFileSync'](R)[UZ(0x147)]();let B;try{if(_[UZ(0x1ec)](b)){if(O[UZ(0x15c)]['endsWith'](UZ(0x159)))B=JSON[UZ(0x173)](b);else{if(O['file'][UZ(0x185)](UZ(0x1a4))||O[UZ(0x15c)]['endsWith'](UZ(0x148)))B=yaml[UZ(0x21c)](b);else throw new Error(UZ(0x14d)+O[UZ(0x15c)]['split']('.')[UZ(0x21b)]());}}else B=b;return B;}catch(y){throw new Error(UZ(0x150)+y[UZ(0x18f)]);}}if((Q=F===null||F===void 0x0?void 0x0:F['opt'])===null||Q===void 0x0?void 0x0:Q[UZ(0x192)])throw new Error(UZ(0x1e8));return yield L[UZ(0x1fc)](F,{'cmdPath':o,'skipValidation':O[UZ(0x1b5)]});});}}const printCallResult=(U,K,q,X,J,v,f,L,M)=>{const Ue=a1UO;if(!(U===null||U===void 0x0?void 0x0:U[Ue(0x155)])){if(K)(0x0,console_format_helpers_1['handleJsonOutput'])(U===null||U===void 0x0?void 0x0:U[Ue(0x1bf)],q);else{if(X)(0x0,console_format_helpers_1[Ue(0x1a6)])(U===null||U===void 0x0?void 0x0:U[Ue(0x1bf)],q);else{if(isListCommand(J)){const E=(v===null||v===void 0x0?void 0x0:v[Ue(0x131)](Ue(0x187)))?v[Ue(0x20b)]('custom-columns=','')[Ue(0x12e)](',')[Ue(0x20f)](o=>o[Ue(0x1de)]()):undefined,z=J[J[Ue(0x1bc)]-0x1],p=''+z+(z['endsWith']('s')?'':'s'),O=_['upperFirst'](p),F=_[Ue(0x206)](q,p)?q[p]:q;(0x0,console_format_helpers_1[Ue(0x1b8)])(F,O,E,f,L);}else console[Ue(0x17e)]((0x0,console_format_helpers_1[Ue(0x1d2)])(q,M));}}}};
|