@northflank/cli 0.9.3 → 0.9.5
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/api-helpers.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/command-overview.js +1 -1
- package/dist/console-format-helpers.js +1 -1
- package/dist/context/contextCommands.js +1 -1
- package/dist/defaults.js +1 -1
- package/dist/exec/index.js +1 -1
- package/dist/inquirer-helper.js +1 -1
- package/dist/login/browser-login.js +1 -1
- package/dist/pagination/inquirer-pagination-prompt.js +1 -1
- package/dist/port-forward/index.js +1 -1
- package/dist/utils.js +1 -1
- package/package.json +2 -2
package/dist/api-helpers.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';function a0f(H,f){const l=a0H();return a0f=function(t,b){t=t-0x183;let i=l[t];return i;},a0f(H,f);}const a0H2=a0f;(function(H,f){const H1=a0f,l=H();while(!![]){try{const t=parseInt(H1(0x1b6))/0x1*(parseInt(H1(0x1c6))/0x2)+parseInt(H1(0x1a5))/0x3*(-parseInt(H1(0x1b7))/0x4)+parseInt(H1(0x1b1))/0x5+-parseInt(H1(0x189))/0x6*(-parseInt(H1(0x192))/0x7)+parseInt(H1(0x190))/0x8+-parseInt(H1(0x1a2))/0x9*(parseInt(H1(0x1a1))/0xa)+parseInt(H1(0x199))/0xb;if(t===f)break;else l['push'](l['shift']());}catch(b){l['push'](l['shift']());}}}(a0H,0xd44ef));var __awaiter=this&&this[a0H2(0x1b4)]||function(H,f,l,t){function b(i){return i instanceof l?i:new l(function(n){n(i);});}return new(l||(l=Promise))(function(i,n){const H6=a0f;function r(Y){const H3=a0f;try{w(t[H3(0x1b5)](Y));}catch(x){n(x);}}function q(Y){const H4=a0f;try{w(t[H4(0x1ab)](Y));}catch(x){n(x);}}function w(Y){const H5=a0f;Y[H5(0x1bb)]?i(Y[H5(0x1b2)]):b(Y[H5(0x1b2)])[H5(0x1ad)](r,q);}w((t=t[H6(0x1b3)](H,f||[]))[H6(0x1b5)]());});};Object[a0H2(0x1a8)](exports,a0H2(0x1a9),{'value':!![]}),exports['fetchResourceList']=void 0x0;const utils_1=require(a0H2(0x195)),defaultPaginationPageSize=0x32,getProjects=H=>f=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const H7=a0H2;var l;const t=yield H['list']['projects']({'options':{'per_page':defaultPaginationPageSize,'cursor':f===null||f===void 0x0?void 0x0:f[H7(0x183)]}});return{'elements':t[H7(0x1af)][H7(0x1c1)]['map'](b=>b['id']),'nextPageCursor':(l=t[H7(0x1be)])===null||l===void 0x0?void 0x0:l[H7(0x1c4)]};}),getServices=(H,f)=>l=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const H8=a0H2;var t;const b=yield H[H8(0x1a0)][H8(0x18f)]({'parameters':{'projectId':f},'options':{'per_page':defaultPaginationPageSize,'cursor':l===null||l===void 0x0?void 0x0:l[H8(0x183)]}});return{'elements':b[H8(0x1af)][H8(0x18f)]['map'](i=>i['id']),'nextPageCursor':(t=b[H8(0x1be)])===null||t===void 0x0?void 0x0:t[H8(0x1c4)]};}),getAddons=(H,f)=>l=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const H9=a0H2;var t;const b=yield H[H9(0x1a0)]['addons']({'parameters':{'projectId':f},'options':{'per_page':defaultPaginationPageSize,'cursor':l===null||l===void 0x0?void 0x0:l[H9(0x183)]}});return{'elements':b['data'][H9(0x188)][H9(0x187)](i=>i['id']),'nextPageCursor':(t=b[H9(0x1be)])===null||t===void 0x0?void 0x0:t[H9(0x1c4)]};}),getAddonBackups=(H,f,l)=>t=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const HH=a0H2;var b;const i=yield H[HH(0x1c3)][HH(0x1aa)][HH(0x18b)]({'parameters':{'projectId':f,'addonId':l},'options':{'per_page':defaultPaginationPageSize,'cursor':t===null||t===void 0x0?void 0x0:t['nextPageCursor']}});return{'elements':i[HH(0x1af)]['backups'][HH(0x187)](n=>n['id']),'nextPageCursor':(b=i[HH(0x1be)])===null||b===void 0x0?void 0x0:b[HH(0x1c4)]};});function fetchResourceList(H,f,l,t,b,i){var n,r,q,w,Y,x,U,m,Q,L,B,T;return __awaiter(this,void 0x0,void 0x0,function*(){const Hf=a0f,X=undefined;try{if(H===Hf(0x1bf)){const V=yield f[Hf(0x1a0)][Hf(0x1a4)]({}),O=V[Hf(0x1af)][Hf(0x1a4)][Hf(0x187)](E=>{const Hl=Hf;var S;return(S=E===null||E===void 0x0?void 0x0:E[Hl(0x185)])!==null&&S!==void 0x0?S:E===null||E===void 0x0?void 0x0:E['id'];});return{'choices':O,'defaultValue':X};}if(H===Hf(0x193)&&!(l===null||l===void 0x0?void 0x0:l[Hf(0x1b0)]('logSink'))){const E=yield f['list']['regions']({}),S=E['data'][Hf(0x1c5)][Hf(0x187)](A=>{const Ht=Hf;var k;return(k=A===null||A===void 0x0?void 0x0:A[Ht(0x185)])!==null&&k!==void 0x0?k:A===null||A===void 0x0?void 0x0:A['id'];});return{'choices':S,'defaultValue':X};}if(H==='projectId'){const A=yield getProjects(f),{elements:k,nextPageCursor:h}=yield A();return{'choices':k,'defaultValue':X,'pagination':{'nextPageCursor':h,'loadMore':A}};}if(H===Hf(0x19e)){const K=yield f[Hf(0x1a0)][Hf(0x18e)]({}),I=K[Hf(0x1af)][Hf(0x19e)][Hf(0x187)](P=>P['id']);return{'choices':I,'defaultValue':X};}const C=b===null||b===void 0x0?void 0x0:b[Hf(0x1a6)],j=H==='serviceId'||H==='id'&&(i===null||i===void 0x0?void 0x0:i['includes'](Hf(0x1c0)));if(C!==undefined&&j){const P=yield getServices(f,C),{elements:Z,nextPageCursor:W}=yield P();return{'choices':Z,'defaultValue':X,'pagination':{'nextPageCursor':W,'loadMore':P}};}const c=l===null||l===void 0x0?void 0x0:l[Hf(0x1b0)]('addon');if(c){const u=g=>__awaiter(this,void 0x0,void 0x0,function*(){const Hb=Hf;var d;const F=yield f[Hb(0x1c3)][Hb(0x1aa)]['types']({});return(d=F[Hb(0x1af)][Hb(0x1c2)])===null||d===void 0x0?void 0x0:d['find'](p=>p[Hb(0x1bd)]===g);});if(H===Hf(0x1bd)){const g=yield f[Hf(0x1c3)][Hf(0x1aa)][Hf(0x194)]({}),d=(n=g[Hf(0x1af)][Hf(0x1c2)])===null||n===void 0x0?void 0x0:n[Hf(0x187)](F=>F[Hf(0x1bd)]);return{'choices':d,'defaultValue':X};}if(H===Hf(0x1ae)&&(t===null||t===void 0x0?void 0x0:t[Hf(0x1bd)])!==undefined){const F=(r=yield u(t[Hf(0x1bd)]))===null||r===void 0x0?void 0x0:r[Hf(0x1ba)];return{'choices':F,'defaultValue':X};}if(H===Hf(0x19d)&&(t===null||t===void 0x0?void 0x0:t['type'])!==undefined){const p=(w=(q=yield u(t[Hf(0x1bd)]))===null||q===void 0x0?void 0x0:q[Hf(0x191)])===null||w===void 0x0?void 0x0:w[Hf(0x19d)];return{'choices':p===null||p===void 0x0?void 0x0:p['options'],'defaultValue':p===null||p===void 0x0?void 0x0:p[Hf(0x1bc)]};}if(H===Hf(0x1c7)&&(t===null||t===void 0x0?void 0x0:t['type'])!==undefined){const a=(x=(Y=yield u(t['type']))===null||Y===void 0x0?void 0x0:Y['resources'])===null||x===void 0x0?void 0x0:x[Hf(0x1c7)];return{'choices':a===null||a===void 0x0?void 0x0:a[Hf(0x1a7)],'defaultValue':a===null||a===void 0x0?void 0x0:a[Hf(0x1bc)]};}}if(H===Hf(0x18c)&&(b===null||b===void 0x0?void 0x0:b[Hf(0x1a6)])!==undefined){const J=yield getAddons(f,b===null||b===void 0x0?void 0x0:b[Hf(0x1a6)]),{elements:o,nextPageCursor:M}=yield J();return{'choices':o,'defaultValue':X,'pagination':{'nextPageCursor':M,'loadMore':J}};}if(H==='backupId'&&(b===null||b===void 0x0?void 0x0:b[Hf(0x1a6)])!==undefined&&((U=t===null||t===void 0x0?void 0x0:t['source'])===null||U===void 0x0?void 0x0:U[Hf(0x18c)])!==undefined){const G=yield getAddonBackups(f,b===null||b===void 0x0?void 0x0:b['projectId'],(m=t===null||t===void 0x0?void 0x0:t[Hf(0x19b)])===null||m===void 0x0?void 0x0:m[Hf(0x18c)]),{elements:N,nextPageCursor:z}=yield G();return{'choices':N,'defaultValue':X,'pagination':{'nextPageCursor':z,'loadMore':G}};}const D=(Q=b===null||b===void 0x0?void 0x0:b['addonId'])!==null&&Q!==void 0x0?Q:(L=t===null||t===void 0x0?void 0x0:t[Hf(0x18a)])===null||L===void 0x0?void 0x0:L[Hf(0x18c)];if((l===null||l===void 0x0?void 0x0:l[Hf(0x18d)](''))===Hf(0x1ac)&&H===Hf(0x1ae)&&(b===null||b===void 0x0?void 0x0:b[Hf(0x1a6)])!==undefined&&D!==undefined){const {upgradeTo:v}=(yield f['get'][Hf(0x1aa)][Hf(0x1ae)]({'parameters':{'addonId':D,'projectId':b===null||b===void 0x0?void 0x0:b[Hf(0x1a6)]}}))[Hf(0x1af)];if(v===undefined||v[Hf(0x1a3)]<=0x0){(0x0,utils_1[Hf(0x1b8)])(Hf(0x19a));throw new Error();}return{'choices':v[Hf(0x187)](R=>R[Hf(0x1ae)]),'defaultValue':X};}if(H===Hf(0x1b9)){const R=yield f[Hf(0x1a0)][Hf(0x19c)]({}),s=R[Hf(0x1af)][Hf(0x19c)]['map'](y=>y===null||y===void 0x0?void 0x0:y['id']);return{'choices':s,'defaultValue':X};}if(((l===null||l===void 0x0?void 0x0:l[Hf(0x1b0)](Hf(0x184)))||(l===null||l===void 0x0?void 0x0:l[Hf(0x1b0)](Hf(0x197))))&&H===Hf(0x198)&&D!==undefined&&(b===null||b===void 0x0?void 0x0:b['projectId'])!==undefined){const y=(yield f[Hf(0x1c3)][Hf(0x1aa)][Hf(0x19e)]({'parameters':{'addonId':D,'projectId':b===null||b===void 0x0?void 0x0:b['projectId']}}))[Hf(0x1af)];return{'choices':[...(B=Object[Hf(0x19f)](y===null||y===void 0x0?void 0x0:y['envs']))!==null&&B!==void 0x0?B:[],...(T=Object['keys'](y===null||y===void 0x0?void 0x0:y[Hf(0x196)]))!==null&&T!==void 0x0?T:[]]};}}catch(H0){}return{'choices':undefined,'defaultValue':X};});}exports[a0H2(0x186)]=fetchResourceList;function a0H(){const Hi=['version','data','includes','1057220VcNqYL','value','apply','__awaiter','next','71MODZkX','628vusGnD','warning','templateId','versions','done','default','type','pagination','deploymentPlan','owningObject','projects','addonTypes','get','cursor','regions','20082hseUMV','replicas','nextPageCursor','secretLink','internalId','fetchResourceList','map','addons','56778sPEfHm','addonDependencies','backups','addonId','join','registries','services','9621112LHyghx','resources','56FNWqKC','region','types','./utils','secrets','secret','keyName','4211911eoaMBO','No\x20available\x20versions\x20to\x20upgrade\x20to.','source','templates','storage','credentials','keys','list','6950260VKfZxu','18FsFXCM','length','plans','6228WuHGSk','projectId','options','defineProperty','__esModule','addon','throw','updateaddonversion','then'];a0H=function(){return Hi;};return a0H();}
|
package/dist/cli.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
'use strict';const a1nM=a1C;function a1n(){const nx=['boolean','required','Documentation:\x20','configurable','askForLogSink','./defaults','Get\x20information\x20about\x20Northflank\x20','serviceId','./console-format-helpers','__importDefault','template','secret','getCurrentJobName','getCurrentServiceName','domain','Command','isEqual','customUserAgent','getProgram','addCommand','credentialId','askForVolume','askForJob','CliContext','call','templates','CliExec','value','rgn','addonId','scrt','apply','isArray','errors','create','argv','subdomainId','output','Unknown\x20input\x20file\x20type:\x20','80cZwUFx','startsWith','jobId','plan','./exec','replace','getCurrentContext','validate','askForJobRun','runId','svc','301086roqVLs','\x20Northflank\x20resources','forEach','__esModule','volumeId','/docs/v1/api/','dmn','api.','logSinkId','opts','log','checkUpdate','safeDump','File\x20to\x20load\x20resource\x20json\x20from','askForTemplateRun','quiet','runs','exitCode','yaml','VERBOSE:\x20Using\x20endpoint\x20->\x20','count',',\x20-','endsWith','requiredPermissions','stdout','Failed\x20to\x20validate\x20input\x20(schema\x20mismatch):\x0a','askForDomain','Error\x20occured\x20while\x20trying\x20to\x20run\x20command,\x20error:\x20','invoices','default','\x0a>\x20Token\x20permissions\x20required:\x20','there\x20are\x20more\x20rows,\x20load?','docsTagsPath','after','login','askForTemplate','30672950VDyaBt','throw','@northflank/js-client','details','writable','Unknown\x20input\x20format.\x20Not\x20valid\x20json\x20and\x20not\x20valid\x20yaml.','volume','endpoints','query','getOwnPropertyNames','templateRunId','url','askForSubdomain','adn','parseAsync','__awaiter','Update\x20Northflank\x20','cred','consoleFormat','cursor','project','-v,\x20--version','pln','API\x20request\x20failed\x0a\x09Message:\x20','prj','runtimeFiles/additionalProperties','2984492cXDNKb','CliPortForward','repositories','3KWkNYX','Failed\x20to\x20validate\x20input\x20(incorrect\x20format):\x20','resource','length','-f,\x20--file\x20<file-path>','includes','printAsTable','file','delete','projectId','hasOwnProperty','match\x20exactly\x20one\x20schema\x20in\x20oneOf','../package.json','asyncSequential','948535pXRJmk','prototype','get','credential','brn','repo','projects','__setModuleDefault','chalk','services','message','set','example','commander','some','askForProject','__importStar','assign','entries','--verbose','type','askConfirm','buildId','./port-forward','existsSync','retrievePayloadViaInteractiveCli','templateId','force','upperFirst','secretId','vol','option','askGeneric','askForAddonBackup','OPTIONAL:\x20','branch','body','northflank','toLowerCase','invoice','readFileSync','File\x20does\x20not\x20exist:\x20','9410748keFopA','lodash','Manage\x20your\x20Northflank\x20resources\x20from\x20the\x20command\x20line','setPathVars','region','error','askForAddon','askForCredentials','inv','volumes','has','clearLine','concat','\x20properties','filter','find','kebabCase','1076510KsNFqd','job','description','join','custom-columns=','Resource\x20was\x20not\x20deleted.',',\x20NF\x20error\x20id:\x20','.yaml','=>\x20running\x20command\x20with:\x20','version','portFwdCmd','keys','split','subdomain','-i,\x20--input\x20<resource-def>','contextProvider','path','defineProperty','getCommandOverview','safeLoad','ajv','1896546BODNOh','getCommand','addon','./utils','backupId','\x20--','assertContextExisting','pop','execCmd','7SsCWeD','plans','ApiClient','name','sort','domains','grey','underline','method','.json','map','Print\x20the\x20current\x20version\x20of\x20the\x20Northflank\x20cli','noDefaults','stringify','next','bind','./command-overview','domainId','action','base','warning','askForBuild','opt','list','parse','addHelpText','credentials'];a1n=function(){return nx;};return a1n();}(function(n,C){const nr=a1C,k=n();while(!![]){try{const H=-parseInt(nr(0x191))/0x1+-parseInt(nr(0x1e1))/0x2+parseInt(nr(0x183))/0x3*(parseInt(nr(0x180))/0x4)+parseInt(nr(0x1cc))/0x5+-parseInt(nr(0x1bb))/0x6*(parseInt(nr(0x1ea))/0x7)+-parseInt(nr(0x137))/0x8*(-parseInt(nr(0x142))/0x9)+parseInt(nr(0x166))/0xa;if(H===C)break;else k['push'](k['shift']());}catch(R){k['push'](k['shift']());}}}(a1n,0xdb3ca));var __createBinding=this&&this['__createBinding']||(Object[a1nM(0x132)]?function(n,C,H,R){const ny=a1nM;if(R===undefined)R=H;var W=Object['getOwnPropertyDescriptor'](C,H);(!W||(ny(0x193)in W?!C[ny(0x145)]:W[ny(0x16a)]||W[ny(0x113)]))&&(W={'enumerable':!![],'get':function(){return C[H];}}),Object['defineProperty'](n,R,W);}:function(n,C,H,R){if(R===undefined)R=H;n[R]=C[H];}),__setModuleDefault=this&&this[a1nM(0x198)]||(Object['create']?function(n,C){const nT=a1nM;Object['defineProperty'](n,nT(0x15f),{'enumerable':!![],'value':C});}:function(n,C){const nV=a1nM;n[nV(0x15f)]=C;}),__importStar=this&&this[a1nM(0x1a1)]||function(n){const nj=a1nM;if(n&&n[nj(0x145)])return n;var C={};if(n!=null){for(var H in n)if(H!==nj(0x15f)&&Object[nj(0x192)][nj(0x18d)][nj(0x128)](n,H))__createBinding(C,n,H);}return __setModuleDefault(C,n),C;},__awaiter=this&&this[a1nM(0x175)]||function(n,C,k,H){function R(W){return W instanceof k?W:new k(function(i){i(W);});}return new(k||(k=Promise))(function(W,i){const nA=a1C;function t(y){const nU=a1C;try{M(H[nU(0x1f8)](y));}catch(T){i(T);}}function r(y){const nh=a1C;try{M(H[nh(0x167)](y));}catch(T){i(T);}}function M(y){const no=a1C;y['done']?W(y[no(0x12b)]):R(y['value'])['then'](t,r);}M((H=H[nA(0x12f)](n,C||[]))[nA(0x1f8)]());});},__importDefault=this&&this[a1nM(0x119)]||function(n){const nd=a1nM;return n&&n[nd(0x145)]?n:{'default':n};};Object[a1nM(0x1dd)](exports,a1nM(0x145),{'value':!![]}),exports[a1nM(0x122)]=void 0x0;const js_client_1=require(a1nM(0x168)),commander_1=__importDefault(require(a1nM(0x19e))),fs_1=__importDefault(require('fs')),ajv_1=__importDefault(require(a1nM(0x1e0))),chalk_1=__importDefault(require(a1nM(0x199))),_=__importStar(require(a1nM(0x1bc))),contextCommands_1=require('./context/contextCommands'),utils_1=require(a1nM(0x1e4)),defaults=__importStar(require(a1nM(0x115))),inquirer_helper_1=require('./inquirer-helper'),console_format_helpers_1=require(a1nM(0x118)),command_overview_1=require(a1nM(0x1fa)),port_forward_1=require(a1nM(0x1a8)),exec_1=require(a1nM(0x13b)),yaml=require('js-yaml'),pgk=require(a1nM(0x18f)),getProgram=n=>{const nQ=a1nM,C=new commander_1[(nQ(0x15f))][(nQ(0x11f))](nQ(0x1b6));C['description'](nQ(0x1bd)),C['enablePositionalOptions'](!![]),C['version']('Northflank\x20cli\x20version:\x20'+chalk_1[nQ(0x15f)][nQ(0x1f1)](pgk[nQ(0x1d5)]),nQ(0x17b),nQ(0x1f5));const k=new js_client_1[(nQ(0x1ec))](n,{'throwErrorOnHttpErrorCode':![],'customUserAgent':utils_1[nQ(0x121)]}),H=new contextCommands_1[(nQ(0x127))](k),R=new port_forward_1[(nQ(0x181))](n),W=new exec_1[(nQ(0x12a))](n);return C[nQ(0x123)](R[nQ(0x1d6)]),C[nQ(0x123)](W[nQ(0x1e9)]),C[nQ(0x123)](H[nQ(0x164)]),C[nQ(0x123)](H['contexts']),generateCommands(k,k[nQ(0x16d)],C),C[nQ(0x123)]((0x0,command_overview_1[nQ(0x1de)])(C)),C;};exports[a1nM(0x122)]=getProgram,((()=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const nl=a1nM;try{const n=new js_client_1['ApiClientFileContextProvider']();yield(0x0,utils_1[nl(0x14d)])(n);const C=(0x0,exports[nl(0x122)])(n);yield C[nl(0x174)](process[nl(0x133)]);}catch(k){(0x0,utils_1[nl(0x1c0)])(nl(0x15d)+k['message']),process['argv'][nl(0x1ca)](H=>H===nl(0x1a4))&&console['log'](k),process[nl(0x153)]=0x1;}}))());function isListCommand(n){const nK=a1nM,C=[[nK(0x193),'addon','backups'],[nK(0x193),nK(0x1cd),nK(0x152)]];return n[nK(0x1ca)](k=>k===nK(0x201))||C[nK(0x19f)](k=>_[nK(0x120)](n,k));}function a1C(n,C){const k=a1n();return a1C=function(H,R){H=H-0x112;let W=k[H];return W;},a1C(n,C);}function generateCommands(n,C,k,H=defaults['defaults'],R=[]){const nm=a1nM,W=new inquirer_helper_1['InquirerHelper'](new js_client_1[(nm(0x1ec))](n[nm(0x1db)],{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1[nm(0x121)]}));function i(y,T){const na=nm;return y[na(0x206)]!==![]&&T===undefined;}function t(y,T){const nN=nm,{opt:V,name:j}=y,U=V[nN(0x15f)],h=i(V,U),o=m=>m[nN(0x186)]>0x1?'--'+m:'-'+m,A=V===null||V===void 0x0?void 0x0:V['alias'],d=A?_[nN(0x130)](A)?'-'+(A===null||A===void 0x0?void 0x0:A[nN(0x1f4)](m=>o(m))[nN(0x1cf)](nN(0x157)))+',':''+o(A):'',Q=h?'':nN(0x1b3),l=typeof V[nN(0x1a5)]===nN(0x205)?d+nN(0x1e6)+j:d+nN(0x1e6)+j+'\x20<'+j['toUpperCase']()+'>',K=Q+V['description'];T[nN(0x1b0)](l,K,U);}return Object['getOwnPropertyNames'](H)[nm(0x144)](y=>{const nX=nm,T=C[y],V=H[y],j=R[nX(0x1c7)]([y]);function U(N,X){const nE=nX,E=Object[nE(0x16f)](N||{});E[nE(0x1f4)](g=>{return{'name':g,'opt':N[g]};})[nE(0x1ee)]((g,c)=>!i(g[nE(0x200)])?!i(c[nE(0x200)])?0x0:0x1:-0x1)[nE(0x144)](g=>{t(g,X);});}function h(N,X){const ng=nX,E=[[ng(0x17a),ng(0x197),ng(0x17e)],['service',ng(0x19a),ng(0x141)],[ng(0x204),ng(0x194),ng(0x177)],[ng(0x1e3),'addons',ng(0x173)],[ng(0x1cd),'jobs'],[ng(0x13a),ng(0x1eb),ng(0x17c)],[ng(0x1bf),'regions',ng(0x12c)],[ng(0x11e),ng(0x1ef),ng(0x148)],[ng(0x11b),'secrets',ng(0x12e)],[ng(0x1c4),ng(0x16c),ng(0x1af)],['branches',ng(0x1b4),ng(0x195)],[ng(0x1b8),ng(0x15e),ng(0x1c3)],[ng(0x11a),ng(0x129),'tpl'],['repos','repository',ng(0x182),ng(0x196)]],g=E[ng(0x1ca)](c=>c['includes'](X));if(g!==undefined)N['aliases'](g[ng(0x1c9)](c=>c!==X));}function o(N){var X,E;return __awaiter(this,void 0x0,void 0x0,function*(){const nc=a1C,g={},{contextProvider:c}=n,b=j[nc(0x188)](nc(0x18b)),L=N[nc(0x1f6)]===!![];function G(Z,q,w){var O,F;return __awaiter(this,void 0x0,void 0x0,function*(){const nb=a1C;if(_[nb(0x1c5)]((F=(O=V[nb(0x200)])===null||O===void 0x0?void 0x0:O['path'])!==null&&F!==void 0x0?F:{},Z)){const D=!L&&!b&&w?w():undefined,Y=N[Z]||D||(yield q());_[nb(0x19c)](g,Z,Y);}});}return yield(0x0,utils_1[nc(0x190)])(Object[nc(0x1a3)]((E=(X=V[nc(0x200)])===null||X===void 0x0?void 0x0:X['path'])!==null&&E!==void 0x0?E:{}),([Z,q])=>__awaiter(this,void 0x0,void 0x0,function*(){const nL=nc,w=g===null||g===void 0x0?void 0x0:g[nL(0x18c)],O=g===null||g===void 0x0?void 0x0:g['templateId'];switch(Z){case nL(0x18c):return yield G(nL(0x18c),W[nL(0x1a0)][nL(0x1f9)](W),c['getCurrentProjectName'][nL(0x1f9)](c));case'serviceId':return yield G(nL(0x117),W['askForService'](w)[nL(0x1f9)](W),c[nL(0x11d)][nL(0x1f9)](c));case nL(0x12d):return yield G('addonId',W[nL(0x1c1)](w)[nL(0x1f9)](W));case nL(0x139):return yield G(nL(0x139),W[nL(0x126)](w)[nL(0x1f9)](W),c[nL(0x11c)]['bind'](c));case nL(0x140):return yield G(nL(0x140),W[nL(0x13f)](g['jobId'],w)[nL(0x1f9)](W));case nL(0x1ae):return yield G(nL(0x1ae),W['askForSecret'](w)['bind'](W));case nL(0x11e):case nL(0x1fb):return yield G(nL(0x11e),W[nL(0x15c)][nL(0x1f9)](W));case nL(0x124):return yield G('credentialId',W[nL(0x1c2)]['bind'](W));case nL(0x146):return yield G(nL(0x146),W[nL(0x125)](w)[nL(0x1f9)](W));case nL(0x1d9):return yield G(nL(0x1d9),W[nL(0x172)](g[nL(0x11e)])[nL(0x1f9)](W));case nL(0x134):return yield G(nL(0x134),W['askForSubdomain'](g[nL(0x1fb)])[nL(0x1f9)](W));case nL(0x1e5):return yield G(nL(0x1e5),W[nL(0x1b2)](w,g[nL(0x12d)])[nL(0x1f9)](W));case'buildId':return yield G(nL(0x1a7),W[nL(0x1ff)](w,g[nL(0x117)],g[nL(0x139)])[nL(0x1f9)](W));case nL(0x1ab):return yield G(nL(0x1ab),W[nL(0x165)]()[nL(0x1f9)](W));case nL(0x170):return yield G('templateRunId',W[nL(0x150)](O)['bind'](W));case nL(0x14a):return yield G(nL(0x14a),W[nL(0x114)]()[nL(0x1f9)](W));default:return yield G(Z,W[nL(0x1b1)](Z,q===null||q===void 0x0?void 0x0:q[nL(0x1ce)])[nL(0x1f9)](W));}})),g;});}function A(N){var X,E;return __awaiter(this,void 0x0,void 0x0,function*(){const nG=a1C,g={},c=Object[nG(0x1d7)]((E=(X=V['opt'])===null||X===void 0x0?void 0x0:X['query'])!==null&&E!==void 0x0?E:{});return yield(0x0,utils_1[nG(0x190)])(c,b=>__awaiter(this,void 0x0,void 0x0,function*(){const nZ=nG,L={},{required:G,schema:Z}=V[nZ(0x200)][nZ(0x16e)][b];return yield W['propToType']([''+b],Z,L,G),L[b]!==undefined&&_[nZ(0x19c)](g,b,L[b]),L;})),g;});}function d(){const nq=nX;switch(j[0x0]){case nq(0x193):return nq(0x116)+(j[0x1]||'resource')+'s';case'update':return nq(0x176)+(j[0x1]||nq(0x185))+nq(0x1c8);default:return _['upperFirst'](y)+nq(0x143);}}function Q(N,X){const nw=nX;var E,g,c,b,L,G;if(!X){const S=(0x0,utils_1[nw(0x1e2)])()[nw(0x1ed)](_['kebabCase'](y))[nw(0x1ce)](d());return h(S,y),S;}const Z=(N===null||N===void 0x0?void 0x0:N['requiredPermissions'])?chalk_1['default'][nw(0x1f0)](nw(0x160)+N[nw(0x159)]):'',q=n[nw(0x1db)][nw(0x13d)](),w=q!==undefined&&((E=V===null||V===void 0x0?void 0x0:V[nw(0x200)])===null||E===void 0x0?void 0x0:E[nw(0x162)])!==undefined,O=q===null||q===void 0x0?void 0x0:q['host'][nw(0x13c)](nw(0x149),''),F=w?nw(0x112)+O+nw(0x147)+((g=V===null||V===void 0x0?void 0x0:V[nw(0x200)])===null||g===void 0x0?void 0x0:g[nw(0x162)]):'',D=(N===null||N===void 0x0?void 0x0:N[nw(0x1ce)])||'',Y=(0x0,utils_1[nw(0x1e2)])(!![])[nw(0x1ed)](_[nw(0x1cb)](y))[nw(0x1ce)](D)[nw(0x203)](nw(0x163),[Z,F][nw(0x1cf)]('\x0a'));return h(Y,y),((c=V[nw(0x200)])===null||c===void 0x0?void 0x0:c[nw(0x1b5)])&&(Y[nw(0x1b0)](nw(0x187),nw(0x14f)),Y[nw(0x1b0)](nw(0x1da),'JSON-formatted\x20resource\x20definition,\x20takes\x20precedence\x20over\x20\x22--file\x22')),U((b=V[nw(0x200)])===null||b===void 0x0?void 0x0:b[nw(0x1dc)],Y),U((L=V['opt'])===null||L===void 0x0?void 0x0:L[nw(0x16e)],Y),U((G=V[nw(0x200)])===null||G===void 0x0?void 0x0:G[nw(0x1fd)],Y),Y[nw(0x1fc)](()=>__awaiter(this,void 0x0,void 0x0,function*(){const nO=nw;var x,J,z,u;(0x0,utils_1[nO(0x1e7)])(n);const f=Y[nO(0x14b)](),B=yield o(f);W[nO(0x1be)](B);const e=yield A(f),v=Object[nO(0x1d7)]((J=(x=V[nO(0x200)])===null||x===void 0x0?void 0x0:x['path'])!==null&&J!==void 0x0?J:{})[nO(0x1f4)](n0=>n0+'='+chalk_1['default']['green'](B[n0]))[nO(0x1cf)](',\x20');if(v[nO(0x186)]>0x0){const n0=nO(0x1d4)+v;console[nO(0x14c)](n0);}const P=((z=V[nO(0x200)])===null||z===void 0x0?void 0x0:z[nO(0x1b5)])?yield M(f,V,j):undefined;if(!f[nO(0x1ac)]&&j['includes'](nO(0x18b))&&!(yield W['deleteWarningPrompt']())){(0x0,utils_1[nO(0x1fe)])(nO(0x1d1));return;}function I(n1,n2=![],n3=0x0){return __awaiter(this,void 0x0,void 0x0,function*(){const nF=a1C,{data:n4,request:n5,error:n6,pagination:n7}=yield T[nF(0x128)]({'parameters':B,'options':Object[nF(0x1a2)](Object[nF(0x1a2)]({},e),{'cursor':n1}),'data':P});(f===null||f===void 0x0?void 0x0:f['verbose'])&&(console[nF(0x14c)](nF(0x155)+n5[nF(0x1f2)]+':'+n5[nF(0x171)]),console['log']('VERBOSE:\x20Request\x20body\x20->\x20'+n5[nF(0x1b5)]));if(n6){const n8=n6[nF(0x169)]?'\x0a\x09details\x20:'+JSON[nF(0x1f7)](n6['details']):'',n9=(n6===null||n6===void 0x0?void 0x0:n6['id'])?nF(0x1d2)+n6['id']:'',nn='(HTTP\x20status\x20code:\x20'+n6['status']+n9+')';throw new Error(nF(0x17d)+n6[nF(0x19b)]+'\x20'+nn+n8);}if(!(f===null||f===void 0x0?void 0x0:f['quiet'])){const nC=f===null||f===void 0x0?void 0x0:f[nF(0x135)];if(nC==='json')console[nF(0x14c)]((0x0,console_format_helpers_1[nF(0x178)])(n4));else{if(nC===nF(0x154)||nC==='yml')console[nF(0x14c)](yaml[nF(0x14e)](n4));else{if(isListCommand(j)){const nk=(nC===null||nC===void 0x0?void 0x0:nC[nF(0x138)](nF(0x1d0)))?nC['replace'](nF(0x1d0),'')['split'](',')['map'](nt=>nt[nF(0x1b7)]()):undefined,nH=j[j[nF(0x186)]-0x1],nR=''+nH+(nH['endsWith']('s')?'':'s'),nW=_[nF(0x1ad)](nR),ni=_[nF(0x1c5)](n4,nR)?n4[nR]:n4;(0x0,console_format_helpers_1[nF(0x189)])(ni,nW,nk,n2,n3);}else console['log']((0x0,console_format_helpers_1[nF(0x178)])(n4));}}}return n7;});}let s=yield I(),p=0x0;if(!f[nO(0x151)]&&(s===null||s===void 0x0?void 0x0:s[nO(0x179)]))while(s['cursor']){const n1=yield W[nO(0x1a6)](nO(0x161));n1&&(process[nO(0x15a)]['moveCursor'](0x0,-0x1),process['stdout'][nO(0x1c6)](0x1),p+=(u=s[nO(0x156)])!==null&&u!==void 0x0?u:0x0,s=yield I(s[nO(0x179)],!![],p));}})),Y;}const l=_[nX(0x1c5)](V,nX(0x200)),K=T,m=Q(K,l);k[nX(0x123)](m);const a=_['omit'](V,nX(0x200));Object[nX(0x1d7)](a)['length']>0x0&&generateCommands(n,T,m,a,j);});function r(y,T,V){return __awaiter(this,void 0x0,void 0x0,function*(){const nD=a1C,{input:j,file:U}=y;if(j!==undefined)try{return JSON['parse'](j);}catch(h){try{return yaml[nD(0x1df)](j);}catch(o){throw new Error(nD(0x16b));}}if(U!==undefined){if(!fs_1[nD(0x15f)][nD(0x1a9)](U))throw new Error(nD(0x1ba)+U);const A=fs_1['default'][nD(0x1b9)](U)['toString']();let Q;try{if(_['isString'](A)){if(y[nD(0x18a)][nD(0x158)](nD(0x1f3)))Q=JSON[nD(0x202)](A);else{if(y[nD(0x18a)][nD(0x158)](nD(0x1d3))||y[nD(0x18a)][nD(0x158)]('yml'))Q=yaml[nD(0x1df)](A);else throw new Error(nD(0x136)+y['file'][nD(0x1d8)]('.')[nD(0x1e8)]());}}else Q=A;return Q;}catch(l){throw new Error(nD(0x184)+l[nD(0x19b)]);}}return yield W[nD(0x1aa)](T,{'cmdPath':V});});}function M(y,T,V){var j;return __awaiter(this,void 0x0,void 0x0,function*(){const nY=a1C,U=yield r(y,T,V),h=new ajv_1['default']({'allErrors':!![],'keywords':[nY(0x19d)],'validateFormats':![],'strict':![],'unicodeRegExp':![]});let o=![];try{o=h[nY(0x13e)](T['opt']['body'],U);}catch(d){if(d[nY(0x19b)][nY(0x188)](nY(0x17f)))o=!![];else throw d;}const A=(j=h===null||h===void 0x0?void 0x0:h[nY(0x131)])===null||j===void 0x0?void 0x0:j['filter'](Q=>{const nS=nY;var l;return!((l=Q===null||Q===void 0x0?void 0x0:Q[nS(0x19b)])===null||l===void 0x0?void 0x0:l[nS(0x188)](nS(0x18e)));});if(!o&&A!==undefined&&(A===null||A===void 0x0?void 0x0:A[nY(0x186)])>0x0)throw new Error(nY(0x15b)+JSON[nY(0x1f7)](h[nY(0x131)],null,'\x20'));return U;});}}
|
|
2
|
+
'use strict';const a1Hx=a1f;(function(H,f){const HY=a1f,l=H();while(!![]){try{const t=parseInt(HY(0x12f))/0x1+-parseInt(HY(0x15d))/0x2*(-parseInt(HY(0x11f))/0x3)+-parseInt(HY(0x14b))/0x4*(parseInt(HY(0x12b))/0x5)+-parseInt(HY(0x95))/0x6+parseInt(HY(0x120))/0x7+parseInt(HY(0x16d))/0x8+parseInt(HY(0xf1))/0x9*(parseInt(HY(0x104))/0xa);if(t===f)break;else l['push'](l['shift']());}catch(b){l['push'](l['shift']());}}}(a1H,0x3133d));var __createBinding=this&&this['__createBinding']||(Object[a1Hx(0x186)]?function(H,f,l,t){const HU=a1Hx;if(t===undefined)t=l;var b=Object[HU(0xad)](f,l);(!b||('get'in b?!f[HU(0x9a)]:b[HU(0x147)]||b[HU(0xa7)]))&&(b={'enumerable':!![],'get':function(){return f[l];}}),Object[HU(0x148)](H,t,b);}:function(H,f,l,t){if(t===undefined)t=l;H[t]=f[l];}),__setModuleDefault=this&&this[a1Hx(0x17f)]||(Object[a1Hx(0x186)]?function(H,f){const Hm=a1Hx;Object[Hm(0x148)](H,Hm(0x15a),{'enumerable':!![],'value':f});}:function(H,f){const HQ=a1Hx;H[HQ(0x15a)]=f;}),__importStar=this&&this[a1Hx(0x123)]||function(H){const HL=a1Hx;if(H&&H['__esModule'])return H;var f={};if(H!=null){for(var l in H)if(l!=='default'&&Object[HL(0xcf)][HL(0x172)]['call'](H,l))__createBinding(f,H,l);}return __setModuleDefault(f,H),f;},__awaiter=this&&this[a1Hx(0x124)]||function(H,f,l,t){function b(i){return i instanceof l?i:new l(function(n){n(i);});}return new(l||(l=Promise))(function(i,n){const HT=a1f;function r(Y){try{w(t['next'](Y));}catch(x){n(x);}}function q(Y){try{w(t['throw'](Y));}catch(x){n(x);}}function w(Y){const HB=a1f;Y[HB(0x135)]?i(Y[HB(0xc4)]):b(Y[HB(0xc4)])[HB(0x139)](r,q);}w((t=t[HT(0x109)](H,f||[]))[HT(0xbb)]());});},__importDefault=this&&this[a1Hx(0x13b)]||function(H){const HX=a1Hx;return H&&H[HX(0x9a)]?H:{'default':H};};Object['defineProperty'](exports,a1Hx(0x9a),{'value':!![]}),exports[a1Hx(0xe2)]=void 0x0;function a1f(H,f){const l=a1H();return a1f=function(t,b){t=t-0x92;let i=l[t];return i;},a1f(H,f);}const js_client_1=require(a1Hx(0x17e)),commander_1=__importDefault(require(a1Hx(0x102))),fs_1=__importDefault(require('fs')),ajv_1=__importDefault(require(a1Hx(0x175))),chalk_1=__importDefault(require(a1Hx(0x9f))),_=__importStar(require(a1Hx(0xf6))),contextCommands_1=require('./context/contextCommands'),utils_1=require('./utils'),defaults=__importStar(require(a1Hx(0xeb))),inquirer_helper_1=require(a1Hx(0xb2)),console_format_helpers_1=require(a1Hx(0xe4)),command_overview_1=require(a1Hx(0xee)),port_forward_1=require(a1Hx(0x132)),exec_1=require(a1Hx(0x162)),yaml=require(a1Hx(0xa5)),pgk=require(a1Hx(0x12e)),getProgram=H=>{const HC=a1Hx,f=new commander_1[(HC(0x15a))]['Command'](HC(0x17b));f[HC(0x106)](HC(0x140)),f[HC(0xaf)](!![]),f['version'](HC(0xa6)+chalk_1[HC(0x15a)][HC(0xe7)](pgk[HC(0x117)]),HC(0xc1),HC(0x15f));const l=new js_client_1[(HC(0x16f))](H,{'throwErrorOnHttpErrorCode':![],'customUserAgent':utils_1[HC(0x168)]}),t=new contextCommands_1[(HC(0x178))](l),b=new port_forward_1[(HC(0x15b))](H),i=new exec_1[(HC(0xd8))](H);return f['addCommand'](b[HC(0x16b)]),f[HC(0xda)](i[HC(0xd5)]),f[HC(0xda)](t['login']),f[HC(0xda)](t[HC(0x163)]),generateCommands(l,l['endpoints'],f),f[HC(0xda)]((0x0,command_overview_1[HC(0x107)])(f)),f;};function a1H(){const HF=['readFileSync','VERBOSE:\x20Using\x20endpoint\x20->\x20','askForJobRun','projectId','commander','domain','236960LfnMPu','argv','description','getCommandOverview','type','apply','alias','dmn','assign','errors','credential','subdomainId','length','find','log','validate','askForAddon','\x20properties','asyncSequential','version','consoleFormat','askForSubdomain','exitCode','domains','/docs/v1/api/','action','resource','6qgoZJC','750323SfWwiP','isString','set','__importStar','__awaiter','OPTIONAL:\x20','propToType','=>\x20running\x20command\x20with:\x20','Get\x20information\x20about\x20Northflank\x20','cred','askGeneric','1313805HVsdgY','message','serviceId','../package.json','163108LUyykZ','inv','svc','./port-forward','getCurrentServiceName','askForCredentials','done','getCommand','--verbose','invoices','then','sort','__importDefault','has','error','runId','join','Manage\x20your\x20Northflank\x20resources\x20from\x20the\x20command\x20line','map','repositories','askForLogSink','service','kebabCase','base','writable','defineProperty','opts','(HTTP\x20status\x20code:\x20','4ISTkdm','path','secret','defaults','job','plan','prj','parse','backupId','askForProject','count','parseAsync','bind','repo','volumes','default','CliPortForward','askForPipeline','818AiGbFC','projects','Print\x20the\x20current\x20version\x20of\x20the\x20Northflank\x20cli','aliases','addon','./exec','contexts','jobId','toString','split','filter','customUserAgent','includes','delete','portFwdCmd','backups','2986368gKsIMl','project','ApiClient','buildId','jobs','hasOwnProperty','cursor','existsSync','ajv','replace','.json','CliContext','contextProvider','addHelpText','northflank','startsWith','Failed\x20to\x20validate\x20input\x20(schema\x20mismatch):\x0a','@northflank/js-client','__setModuleDefault','domainId','askForSecret','getCurrentProjectName','secretId','templateRunId','InquirerHelper','create','templateId','region','after','1649406KZWxES','secrets','addonId','pipelineId',',\x20NF\x20error\x20id:\x20','__esModule','runs','api.','toUpperCase','upperFirst','chalk','stdout','addons','pop','query','call','js-yaml','Northflank\x20cli\x20version:\x20','configurable','runtimeFiles/additionalProperties','credentialId','file','opt','stringify','getOwnPropertyDescriptor','some','enablePositionalOptions','clearLine','get','./inquirer-helper','isEqual','templates','tpl','requiredPermissions','assertContextExisting','url','json','entries','next','askConfirm','option','getOwnPropertyNames','details','printAsTable','-v,\x20--version','volumeId','logSinkId','value','askForBuild','scrt','-i,\x20--input\x20<resource-def>','JSON-formatted\x20resource\x20definition,\x20takes\x20precedence\x20over\x20\x22--file\x22','API\x20request\x20failed\x0a\x09Message:\x20','askForTemplate','keys','Resource\x20was\x20not\x20deleted.','plans','yml','prototype','-f,\x20--file\x20<file-path>','warning',',\x20-','green','repos','execCmd','askForAddonBackup','boolean','CliExec','volume','addCommand','deleteWarningPrompt','File\x20does\x20not\x20exist:\x20','subdomain','concat','askForVolume','safeLoad','endsWith','getProgram','\x20--','./console-format-helpers','quiet','askForDomain','underline','isArray','method','.yaml','./defaults','host','verbose','./command-overview','forEach','name','36ZxaZFZ','setPathVars','omit','File\x20to\x20load\x20resource\x20json\x20from','credentials','lodash','body','branches','services','force','list','invoice','\x0a\x09details\x20:'];a1H=function(){return HF;};return a1H();}exports[a1Hx(0xe2)]=getProgram,((()=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const Hj=a1Hx;try{const H=new js_client_1['ApiClientFileContextProvider']();yield(0x0,utils_1['checkUpdate'])(H);const f=(0x0,exports[Hj(0xe2)])(H);yield f[Hj(0x156)](process[Hj(0x105)]);}catch(l){(0x0,utils_1[Hj(0x13d)])('Error\x20occured\x20while\x20trying\x20to\x20run\x20command,\x20error:\x20'+l[Hj(0x12c)]),process['argv'][Hj(0x111)](t=>t===Hj(0x137))&&console[Hj(0x112)](l),process[Hj(0x11a)]=0x1;}}))());function isListCommand(H){const Hc=a1Hx,f=[[Hc(0xb1),'addon',Hc(0x16c)],[Hc(0xb1),Hc(0x14f),Hc(0x9b)]];return H[Hc(0x111)](l=>l===Hc(0xfb))||f[Hc(0xae)](l=>_[Hc(0xb3)](H,l));}function generateCommands(H,f,l,t=defaults[a1Hx(0x14e)],b=[]){const HD=a1Hx,i=new inquirer_helper_1[(HD(0x185))](new js_client_1['ApiClient'](H[HD(0x179)],{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1[HD(0x168)]}));function n(Y,x){return Y['required']!==![]&&x===undefined;}function r(Y,x){const HV=HD,{opt:U,name:m}=Y,Q=U['default'],L=n(U,Q),B=D=>D[HV(0x110)]>0x1?'--'+D:'-'+D,T=U===null||U===void 0x0?void 0x0:U[HV(0x10a)],X=T?_[HV(0xe8)](T)?'-'+(T===null||T===void 0x0?void 0x0:T[HV(0x141)](D=>B(D))['join'](HV(0xd2)))+',':''+B(T):'',C=L?'':HV(0x125),j=typeof U[HV(0x108)]===HV(0xd7)?X+HV(0xe3)+m:X+HV(0xe3)+m+'\x20<'+m[HV(0x9d)]()+'>',c=C+U[HV(0x106)];x[HV(0xbd)](j,c,Q);}return Object[HD(0xbe)](t)[HD(0xef)](Y=>{const He=HD,x=f[Y],U=t[Y],m=b[He(0xde)]([Y]);function Q(e,O){const HO=He,E=Object[HO(0xbe)](e||{});E[HO(0x141)](S=>{return{'name':S,'opt':e[S]};})[HO(0x13a)]((S,A)=>!n(S['opt'])?!n(A[HO(0xab)])?0x0:0x1:-0x1)[HO(0xef)](S=>{r(S,O);});}function L(e,O){const HE=He,E=[[HE(0x16e),HE(0x15e),HE(0x151)],[HE(0x144),HE(0xf9),HE(0x131)],[HE(0xf5),HE(0x10e),HE(0x129)],[HE(0x161),HE(0xa1),'adn'],['job',HE(0x171)],[HE(0x150),HE(0xcd),'pln'],[HE(0x93),'regions','rgn'],[HE(0x103),HE(0x11b),HE(0x10b)],[HE(0x14d),HE(0x96),HE(0xc6)],[HE(0x159),HE(0xd9),'vol'],[HE(0xf8),'branch','brn'],[HE(0xfc),HE(0x138),HE(0x130)],['template',HE(0xb4),HE(0xb5)],[HE(0xd4),'repository',HE(0x142),HE(0x158)]],S=E[HE(0x111)](A=>A[HE(0x169)](O));if(S!==undefined)e[HE(0x160)](S[HE(0x167)](A=>A!==O));}function B(e){var O,E;return __awaiter(this,void 0x0,void 0x0,function*(){const HA=a1f,S={},{contextProvider:A}=H,k=m['includes']('delete'),h=e['noDefaults']===!![];function K(I,P,Z){var W,u;return __awaiter(this,void 0x0,void 0x0,function*(){const HS=a1f;if(_[HS(0x13c)]((u=(W=U[HS(0xab)])===null||W===void 0x0?void 0x0:W['path'])!==null&&u!==void 0x0?u:{},I)){const g=!h&&!k&&Z?Z():undefined,d=e[I]||g||(yield P());_[HS(0x122)](S,I,d);}});}return yield(0x0,utils_1[HA(0x116)])(Object[HA(0xba)]((E=(O=U[HA(0xab)])===null||O===void 0x0?void 0x0:O[HA(0x14c)])!==null&&E!==void 0x0?E:{}),([I,P])=>__awaiter(this,void 0x0,void 0x0,function*(){const Hk=HA,Z=S===null||S===void 0x0?void 0x0:S[Hk(0x101)],W=S===null||S===void 0x0?void 0x0:S[Hk(0x92)];switch(I){case'projectId':return yield K('projectId',i[Hk(0x154)][Hk(0x157)](i),A[Hk(0x182)][Hk(0x157)](A));case Hk(0x12d):return yield K('serviceId',i['askForService'](Z)[Hk(0x157)](i),A[Hk(0x133)][Hk(0x157)](A));case Hk(0x97):return yield K('addonId',i[Hk(0x114)](Z)['bind'](i));case Hk(0x164):return yield K(Hk(0x164),i['askForJob'](Z)['bind'](i),A['getCurrentJobName'][Hk(0x157)](A));case Hk(0x13e):return yield K('runId',i[Hk(0x100)](S[Hk(0x164)],Z)[Hk(0x157)](i));case Hk(0x183):return yield K(Hk(0x183),i[Hk(0x181)](Z)[Hk(0x157)](i));case Hk(0x103):case Hk(0x180):return yield K(Hk(0x103),i[Hk(0xe6)][Hk(0x157)](i));case'credentialId':return yield K(Hk(0xa9),i[Hk(0x134)][Hk(0x157)](i));case Hk(0xc2):return yield K(Hk(0xc2),i[Hk(0xdf)](Z)['bind'](i));case Hk(0xdd):return yield K('subdomain',i[Hk(0x119)](S[Hk(0x103)])[Hk(0x157)](i));case Hk(0x10f):return yield K(Hk(0x10f),i[Hk(0x119)](S['domainId'])['bind'](i));case Hk(0x153):return yield K(Hk(0x153),i[Hk(0xd6)](Z,S[Hk(0x97)])[Hk(0x157)](i));case Hk(0x170):return yield K(Hk(0x170),i[Hk(0xc5)](Z,S[Hk(0x12d)],S[Hk(0x164)])['bind'](i));case Hk(0x92):return yield K('templateId',i[Hk(0xca)]()[Hk(0x157)](i));case Hk(0x184):return yield K(Hk(0x184),i['askForTemplateRun'](W)[Hk(0x157)](i));case Hk(0xc3):return yield K(Hk(0xc3),i[Hk(0x143)]()[Hk(0x157)](i));case'pipelineId':return yield K(Hk(0x98),i[Hk(0x15c)](Z)['bind'](i));default:return yield K(I,i[Hk(0x12a)](I,P===null||P===void 0x0?void 0x0:P[Hk(0x106)])[Hk(0x157)](i));}})),S;});}function T(e){var O,E;return __awaiter(this,void 0x0,void 0x0,function*(){const Hh=a1f,S={},A=Object[Hh(0xcb)]((E=(O=U[Hh(0xab)])===null||O===void 0x0?void 0x0:O[Hh(0xa3)])!==null&&E!==void 0x0?E:{});return yield(0x0,utils_1[Hh(0x116)])(A,k=>__awaiter(this,void 0x0,void 0x0,function*(){const HK=Hh,h={},{required:K,schema:I}=U[HK(0xab)][HK(0xa3)][k];return yield i[HK(0x126)]([''+k],I,h,K),h[k]!==undefined&&_['set'](S,k,h[k]),h;})),S;});}function X(){const HI=He;switch(m[0x0]){case HI(0xb1):return HI(0x128)+(m[0x1]||HI(0x11e))+'s';case'update':return'Update\x20Northflank\x20'+(m[0x1]||'resource')+HI(0x115);default:return _[HI(0x9e)](Y)+'\x20Northflank\x20resources';}}function C(e,O){const HP=He;var E,S,A,k,h,K;if(!O){const F=(0x0,utils_1['getCommand'])()[HP(0xf0)](_[HP(0x145)](Y))[HP(0x106)](X());return L(F,Y),F;}const I=(e===null||e===void 0x0?void 0x0:e[HP(0xb6)])?chalk_1[HP(0x15a)]['grey']('\x0a>\x20Token\x20permissions\x20required:\x20'+e[HP(0xb6)]):'',P=H[HP(0x179)]['getCurrentContext'](),Z=P!==undefined&&((E=U===null||U===void 0x0?void 0x0:U[HP(0xab)])===null||E===void 0x0?void 0x0:E['docsTagsPath'])!==undefined,W=P===null||P===void 0x0?void 0x0:P[HP(0xec)][HP(0x176)](HP(0x9c),''),u=Z?'Documentation:\x20'+W+HP(0x11c)+((S=U===null||U===void 0x0?void 0x0:U['opt'])===null||S===void 0x0?void 0x0:S['docsTagsPath']):'',g=(e===null||e===void 0x0?void 0x0:e[HP(0x106)])||'',d=(0x0,utils_1[HP(0x136)])(!![])['name'](_[HP(0x145)](Y))[HP(0x106)](g)[HP(0x17a)](HP(0x94),[I,u][HP(0x13f)]('\x0a'));return L(d,Y),((A=U['opt'])===null||A===void 0x0?void 0x0:A['body'])&&(d[HP(0xbd)](HP(0xd0),HP(0xf4)),d['option'](HP(0xc7),HP(0xc8))),Q((k=U[HP(0xab)])===null||k===void 0x0?void 0x0:k[HP(0x14c)],d),Q((h=U['opt'])===null||h===void 0x0?void 0x0:h['query'],d),Q((K=U[HP(0xab)])===null||K===void 0x0?void 0x0:K[HP(0x146)],d),d[HP(0x11d)](()=>__awaiter(this,void 0x0,void 0x0,function*(){const HZ=HP;var p,a,J,o;(0x0,utils_1[HZ(0xb7)])(H);const M=d[HZ(0x149)](),G=M===null||M===void 0x0?void 0x0:M['output'],N=G===HZ(0xb9),z=G==='yaml'||G===HZ(0xce),v=yield B(M);i[HZ(0xf2)](v);const R=yield T(M),s=Object['keys']((a=(p=U[HZ(0xab)])===null||p===void 0x0?void 0x0:p['path'])!==null&&a!==void 0x0?a:{})[HZ(0x141)](H3=>H3+'='+chalk_1['default'][HZ(0xd3)](v[H3]))['join'](',\x20');if(s[HZ(0x110)]>0x0&&!N&&!z){const H3=HZ(0x127)+s;console[HZ(0x112)](H3);}const y=((J=U['opt'])===null||J===void 0x0?void 0x0:J[HZ(0xf7)])?yield w(M,U,m):undefined;if(!M[HZ(0xfa)]&&m[HZ(0x169)](HZ(0x16a))&&!(yield i[HZ(0xdb)]())){(0x0,utils_1[HZ(0xd1)])(HZ(0xcc));return;}function H0(H4,H5=![],H6=0x0){return __awaiter(this,void 0x0,void 0x0,function*(){const HW=a1f,{data:H7,request:H8,error:H9,pagination:HH}=yield x[HW(0xa4)]({'parameters':v,'options':Object[HW(0x10c)](Object[HW(0x10c)]({},R),{'cursor':H4}),'data':y});(M===null||M===void 0x0?void 0x0:M[HW(0xed)])&&(console[HW(0x112)](HW(0xff)+H8[HW(0xe9)]+':'+H8[HW(0xb8)]),console[HW(0x112)]('VERBOSE:\x20Request\x20body\x20->\x20'+H8['body']));if(H9){const Hf=H9[HW(0xbf)]?HW(0xfd)+JSON['stringify'](H9[HW(0xbf)]):'',Hl=(H9===null||H9===void 0x0?void 0x0:H9['id'])?HW(0x99)+H9['id']:'',Ht=HW(0x14a)+H9['status']+Hl+')';throw new Error(HW(0xc9)+H9[HW(0x12c)]+'\x20'+Ht+Hf);}if(!(M===null||M===void 0x0?void 0x0:M['quiet'])){if(N)console[HW(0x112)](JSON[HW(0xac)](H7,null,'\x20'));else{if(z)console['log'](yaml['safeDump'](H7));else{if(isListCommand(m)){const Hb=(G===null||G===void 0x0?void 0x0:G[HW(0x17c)]('custom-columns='))?G['replace']('custom-columns=','')[HW(0x166)](',')[HW(0x141)](Hw=>Hw['toLowerCase']()):undefined,Hi=m[m[HW(0x110)]-0x1],Hn=''+Hi+(Hi[HW(0xe1)]('s')?'':'s'),Hr=_[HW(0x9e)](Hn),Hq=_[HW(0x13c)](H7,Hn)?H7[Hn]:H7;(0x0,console_format_helpers_1[HW(0xc0)])(Hq,Hr,Hb,H5,H6);}else console[HW(0x112)]((0x0,console_format_helpers_1[HW(0x118)])(H7));}}}return HH;});}let H1=yield H0(),H2=0x0;if(!M[HZ(0xe5)]&&(H1===null||H1===void 0x0?void 0x0:H1['cursor']))while(H1[HZ(0x173)]){const H4=yield i[HZ(0xbc)]('there\x20are\x20more\x20rows,\x20load?');H4&&(process[HZ(0xa0)]['moveCursor'](0x0,-0x1),process['stdout'][HZ(0xb0)](0x1),H2+=(o=H1[HZ(0x155)])!==null&&o!==void 0x0?o:0x0,H1=yield H0(H1[HZ(0x173)],!![],H2));}})),d;}const j=_[He(0x13c)](U,He(0xab)),c=x,D=C(c,j);l[He(0xda)](D);const V=_[He(0xf3)](U,'opt');Object[He(0xcb)](V)['length']>0x0&&generateCommands(H,x,D,V,m);});function q(Y,x,U){return __awaiter(this,void 0x0,void 0x0,function*(){const Hu=a1f,{input:m,file:Q}=Y;if(m!==undefined)try{return JSON['parse'](m);}catch(L){try{return yaml[Hu(0xe0)](m);}catch(B){throw new Error('Unknown\x20input\x20format.\x20Not\x20valid\x20json\x20and\x20not\x20valid\x20yaml.');}}if(Q!==undefined){if(!fs_1[Hu(0x15a)][Hu(0x174)](Q))throw new Error(Hu(0xdc)+Q);const T=fs_1['default'][Hu(0xfe)](Q)[Hu(0x165)]();let X;try{if(_[Hu(0x121)](T)){if(Y['file'][Hu(0xe1)](Hu(0x177)))X=JSON[Hu(0x152)](T);else{if(Y['file'][Hu(0xe1)](Hu(0xea))||Y[Hu(0xaa)][Hu(0xe1)](Hu(0xce)))X=yaml[Hu(0xe0)](T);else throw new Error('Unknown\x20input\x20file\x20type:\x20'+Y[Hu(0xaa)][Hu(0x166)]('.')[Hu(0xa2)]());}}else X=T;return X;}catch(C){throw new Error('Failed\x20to\x20validate\x20input\x20(incorrect\x20format):\x20'+C[Hu(0x12c)]);}}return yield i['retrievePayloadViaInteractiveCli'](x,{'cmdPath':U});});}function w(Y,x,U){var m;return __awaiter(this,void 0x0,void 0x0,function*(){const Hg=a1f,Q=yield q(Y,x,U),L=new ajv_1[(Hg(0x15a))]({'allErrors':!![],'keywords':['example'],'validateFormats':![],'strict':![],'unicodeRegExp':![]});let B=![];try{B=L[Hg(0x113)](x['opt'][Hg(0xf7)],Q);}catch(X){if(X[Hg(0x12c)][Hg(0x169)](Hg(0xa8)))B=!![];else throw X;}const T=(m=L===null||L===void 0x0?void 0x0:L[Hg(0x10d)])===null||m===void 0x0?void 0x0:m['filter'](C=>{const Hd=Hg;var j;return!((j=C===null||C===void 0x0?void 0x0:C[Hd(0x12c)])===null||j===void 0x0?void 0x0:j['includes']('match\x20exactly\x20one\x20schema\x20in\x20oneOf'));});if(!B&&T!==undefined&&(T===null||T===void 0x0?void 0x0:T['length'])>0x0)throw new Error(Hg(0x17d)+JSON[Hg(0xac)](L['errors'],null,'\x20'));return Q;});}}
|
package/dist/command-overview.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a2D=a2f;(function(H,f){const c=a2f,l=H();while(!![]){try{const t=parseInt(c(0xad))/0x1*(parseInt(c(0x95))/0x2)+parseInt(c(0xa5))/0x3*(-parseInt(c(0xa4))/0x4)+-parseInt(c(0x9c))/0x5+-parseInt(c(0x9f))/0x6+-parseInt(c(0x8a))/0x7+parseInt(c(0x88))/0x8*(-parseInt(c(0x9b))/0x9)+parseInt(c(0xac))/0xa;if(t===f)break;else l['push'](l['shift']());}catch(b){l['push'](l['shift']());}}}(a2H,0x3651f));var __awaiter=this&&this[a2D(0x8e)]||function(H,f,l,t){function b(i){return i instanceof l?i:new l(function(n){n(i);});}return new(l||(l=Promise))(function(i,n){const E=a2f;function r(Y){const V=a2f;try{w(t[V(0x91)](Y));}catch(x){n(x);}}function q(Y){const e=a2f;try{w(t[e(0xa8)](Y));}catch(x){n(x);}}function w(Y){const O=a2f;Y[O(0x93)]?i(Y['value']):b(Y['value'])[O(0x8f)](r,q);}w((t=t[E(0x97)](H,f||[]))['next']());});},__importDefault=this&&this[a2D(0x90)]||function(H){return H&&H['__esModule']?H:{'default':H};};function a2f(H,f){const l=a2H();return a2f=function(t,b){t=t-0x88;let i=l[t];return i;},a2f(H,f);}Object[a2D(0xa3)](exports,a2D(0x96),{'value':!![]}),exports[a2D(0xa2)]=void 0x0;const chalk_1=__importDefault(require(a2D(0x9a))),utils_1=require(a2D(0x99));function a2H(){const k=['126CYoxZc','537300tJZyBd','keys','every','2434134NmrUlT','join','map','getCommandOverview','defineProperty','84UfIShL','11157CBkJRJ','description','bold','throw','length','commands','name','8479090KppsVT','1aEPZpn','slice','13104xYOIAB','--verbose','826259taAWIO','Print\x20command\x20descriptions','option','Prints\x20a\x20tree\x20view\x20of\x20all\x20available\x20commands','__awaiter','then','__importDefault','next','log','done','action','213606cygavn','__esModule','apply','getCommand','./utils','chalk'];a2H=function(){return k;};return a2H();}function getCommandOverview(H){const S=a2D;return(0x0,utils_1[S(0x98)])()[S(0xab)]('command-overview')[S(0xa6)](S(0x8d))[S(0x8c)](S(0x89),S(0x8b))[S(0x94)](f=>__awaiter(this,void 0x0,void 0x0,function*(){const {verbose:l}=f;function t(b,i){const A=a2f;var n;const r=(X,C=!![])=>C?chalk_1['default'][A(0xa7)]['green'](X['name']()):X[A(0xab)](),q=i[A(0xa9)]===0x0,w=b[A(0xaa)];let Y='';const x=w[A(0xa9)]===0x0,U=x||((n=Object[A(0x9d)](b===null||b===void 0x0?void 0x0:b['opts']()))===null||n===void 0x0?void 0x0:n[A(0xa9)])>0x0;!q&&(Y=w&&!x?'┬\x20':'─\x20');const m=l&&U&&b[A(0xa6)]()?':\x20'+b[A(0xa6)]():'';console[A(0x92)](''+i+Y+r(b,U)+m);let Q=i;if(!q){const X=i[A(0xae)](-0x2)==='└─';Q=i['slice'](0x0,-0x2)+(X?'\x20\x20':'│\x20');}const L=Q+'├─',B=Q+'└─',T=w[A(0x9e)](C=>C[A(0xaa)][A(0xa9)]===0x0);T&&!x&&!l?console[A(0x92)](B+'\x20'+w[A(0xa1)](C=>r(C))[A(0xa0)](',\x20')):w['forEach']((C,j)=>{t(C,w['length']-0x1===j?B:L);});}t(H,'');}));}exports[a2D(0xa2)]=getCommandOverview;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a3L=a3f;(function(H,f){const Q=a3f,l=H();while(!![]){try{const t=parseInt(Q(0x16a))/0x1+parseInt(Q(0x184))/0x2*(parseInt(Q(0x185))/0x3)+parseInt(Q(0x180))/0x4+-parseInt(Q(0x18d))/0x5*(parseInt(Q(0x199))/0x6)+-parseInt(Q(0x171))/0x7*(parseInt(Q(0x195))/0x8)+-parseInt(Q(0x18f))/0x9+parseInt(Q(0x17b))/0xa*(parseInt(Q(0x174))/0xb);if(t===f)break;else l['push'](l['shift']());}catch(b){l['push'](l['shift']());}}}(a3H,0xa81a8));var __createBinding=this&&this[a3L(0x19a)]||(Object['create']?function(H,f,l,t){const B=a3L;if(t===undefined)t=l;var b=Object[B(0x177)](f,l);(!b||('get'in b?!f[B(0x167)]:b[B(0x193)]||b[B(0x198)]))&&(b={'enumerable':!![],'get':function(){return f[l];}}),Object['defineProperty'](H,t,b);}:function(H,f,l,t){if(t===undefined)t=l;H[t]=f[l];}),__setModuleDefault=this&&this[a3L(0x16d)]||(Object['create']?function(H,f){const T=a3L;Object[T(0x183)](H,'default',{'enumerable':!![],'value':f});}:function(H,f){H['default']=f;}),__importStar=this&&this['__importStar']||function(H){const X=a3L;if(H&&H[X(0x167)])return H;var f={};if(H!=null){for(var l in H)if(l!==X(0x169)&&Object[X(0x16e)][X(0x17d)]['call'](H,l))__createBinding(f,H,l);}return __setModuleDefault(f,H),f;},__importDefault=this&&this[a3L(0x187)]||function(H){const C=a3L;return H&&H[C(0x167)]?H:{'default':H};};Object[a3L(0x183)](exports,a3L(0x167),{'value':!![]}),exports['consoleFormat']=exports['printAsTable']=void 0x0;const chalk_1=__importDefault(require('chalk')),_=__importStar(require(a3L(0x17a))),util=__importStar(require('util')),columnify=require(a3L(0x189));function printAsTable(H,f,l,t=![],b=0x0){const j=a3L;!t&&console[j(0x18c)](''+chalk_1['default'][j(0x170)](f));function i(r){const c=j;return r===c(0x190)?r:r['replace']('disabled','');}function n(r,q){const V=j;function w(x){const D=a3f,U=new Date(x);return U[D(0x175)]()+'/'+U['getMonth']()+'/'+U[D(0x182)]()+'\x0a'+U[D(0x191)]()+':'+U[D(0x17f)]()+':'+U[D(0x18e)]();}const Y=[V(0x173),V(0x166)];if(Y['includes'](q[V(0x196)]())&&_[V(0x194)](r)&&r[V(0x197)]()[V(0x179)]===0xd)return w(Number(r));if(_[V(0x16c)](r)){if(q!==V(0x190)&&q[V(0x181)](V(0x190)))return r?'x':'✔';return r?'✔':'x';}if(_[V(0x168)](r))return util[V(0x16f)](r,{'showHidden':![],'depth':null,'colors':!![],'compact':!![]});return r;}if(_[j(0x18a)](H)){H[j(0x179)]===0x0&&console[j(0x18c)](j(0x16b)+f[j(0x196)]()+j(0x17e));const r=H['map']((Y,x)=>{const e=j,U={'i':x+b};return Object[e(0x176)](Y)[e(0x178)](m=>{const O=e;(_[O(0x192)](l)||l['includes'](m[O(0x196)]()))&&_[O(0x17c)](U,i(m),n(Y[m],m));}),U;}),q=_[j(0x186)](Object[j(0x176)]((r===null||r===void 0x0?void 0x0:r[0x0])||[]))[j(0x165)]((Y,x)=>{const E=j,U=m=>m!=='i'?m!==E(0x188)?0x0:0x1:0x2;return U(x)-U(Y);}),w={'maxWidth':0x1e,'preserveNewLines':!![],'showHeaders':!t,'config':{'_id':{'maxWidth':0x5,'truncate':!![]},'i':{'showHeaders':![]}},'columns':q};console[j(0x18c)](columnify(r,w));}else console[j(0x18c)](H);}exports[a3L(0x172)]=printAsTable;function consoleFormat(H){const S=a3L;if(!_['isObjectLike'](H))return H===null||H===void 0x0?void 0x0:H[S(0x197)]();return util[S(0x16f)](H,{'showHidden':![],'depth':null,'colors':!![],'compact':!![]});}function a3f(H,f){const l=a3H();return a3f=function(t,b){t=t-0x165;let i=l[t];return i;},a3f(H,f);}function a3H(){const A=['15CTNhSU','getSeconds','6625476wfChkL','disabled','getHours','isUndefined','writable','isFinite','24unwvcr','toLowerCase','toString','configurable','2137284TqOekk','__createBinding','sort','updatedat','__esModule','isObjectLike','default','1011891sfcOyu','No\x20','isBoolean','__setModuleDefault','prototype','inspect','bold','2497621jjMQVP','printAsTable','createdat','44MjaYZY','getDate','keys','getOwnPropertyDescriptor','forEach','length','lodash','3583390YEtoRW','set','hasOwnProperty','\x20found','getMinutes','1232464YjmRVE','includes','getFullYear','defineProperty','28VIfbwj','173658LcYGOR','clone','__importDefault','internalId','columnify','isArrayLike','consoleFormat','log'];a3H=function(){return A;};return a3H();}exports[a3L(0x18b)]=consoleFormat;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const a4d=a4C;function a4C(n,C){const k=a4n();return a4C=function(H,R){H=H-0xa2;let W=k[H];return W;},a4C(n,C);}(function(n,C){const A=a4C,k=n();while(!![]){try{const H=-parseInt(A(0x10b))/0x1*(parseInt(A(0x143))/0x2)+parseInt(A(0xee))/0x3*(-parseInt(A(0xde))/0x4)+-parseInt(A(0xe2))/0x5*(parseInt(A(0x13c))/0x6)+-parseInt(A(0xa6))/0x7+parseInt(A(0xd8))/0x8+-parseInt(A(0xa7))/0x9+-parseInt(A(0x120))/0xa*(-parseInt(A(0x13f))/0xb);if(H===C)break;else k['push'](k['shift']());}catch(R){k['push'](k['shift']());}}}(a4n,0x99a95));var __createBinding=this&&this[a4d(0xc9)]||(Object[a4d(0xbf)]?function(n,C,H,R){const Q=a4d;if(R===undefined)R=H;var W=Object[Q(0xeb)](C,H);(!W||(Q(0xcb)in W?!C[Q(0xdd)]:W[Q(0xfc)]||W['configurable']))&&(W={'enumerable':!![],'get':function(){return C[H];}}),Object[Q(0xcd)](n,R,W);}:function(n,C,H,R){if(R===undefined)R=H;n[R]=C[H];}),__setModuleDefault=this&&this[a4d(0x12a)]||(Object[a4d(0xbf)]?function(n,C){const l=a4d;Object['defineProperty'](n,l(0x10f),{'enumerable':!![],'value':C});}:function(n,C){const K=a4d;n[K(0x10f)]=C;}),__importStar=this&&this[a4d(0x113)]||function(n){const m=a4d;if(n&&n[m(0xdd)])return n;var C={};if(n!=null){for(var H in n)if(H!==m(0x10f)&&Object[m(0x132)]['hasOwnProperty'][m(0xb3)](n,H))__createBinding(C,n,H);}return __setModuleDefault(C,n),C;},__awaiter=this&&this[a4d(0xc1)]||function(n,C,k,H){function R(W){return W instanceof k?W:new k(function(i){i(W);});}return new(k||(k=Promise))(function(W,i){const E=a4C;function t(y){const a=a4C;try{M(H[a(0x13b)](y));}catch(T){i(T);}}function r(y){const N=a4C;try{M(H[N(0xe7)](y));}catch(T){i(T);}}function M(y){const X=a4C;y['done']?W(y[X(0x144)]):R(y['value'])[X(0xd9)](t,r);}M((H=H[E(0xcf)](n,C||[]))[E(0x13b)]());});},__importDefault=this&&this[a4d(0x12f)]||function(n){const g=a4d;return n&&n[g(0xdd)]?n:{'default':n};};function a4n(){const s=['Token\x20for\x20this\x20context.\x20When\x20set,\x20browser\x20login\x20is\x20not\x20used','__importDefault','stdout','getCurrentToken','prototype','finally','--all','getCurrentBaseUrl','apiTokenLogin','map','autologin-','replace','getCommand','next','6XZshOM','action','prompt','3499177tGAECx','name','Bearer\x20','job','2xnDzdu','value','updateToken','login','Connect\x20the\x20CLI\x20to\x20your\x20Northflank\x20account.','context','1280657WQYmAq','2061693FXdKua','host\x20url\x20for\x20this\x20context','chalk','askForService','--do-not-open-browser','log','loadContextWrapper','alias','sessionToken=********','Update\x20token\x20for\x20current\x20context','\x27\x20successfully\x20removed.','Token\x20for\x20current\x20context\x20\x27','call','--override','catch','sort','host','Shows\x20full\x20context\x20information\x20(including\x20tokens)','error','Use\x20job\x20with\x20id:','askForContext','Follow\x20the\x20steps\x20displayed\x20on\x20the\x20page\x20opened\x20in\x20the\x20browser\x20(URL\x20opened:\x20','Failed\x20to\x20login\x20with\x20the\x20provided\x20token.\x20Token\x20was\x20not\x20changed','description','create','warning','__awaiter','delete','.\x20Using\x20fallback.','InquirerHelper','Token\x20for\x20this\x20context','Change\x20the\x20default\x20job\x20in\x20the\x20current\x20local\x20context','https://','NorthflankApiBrowserLogin','__createBinding','useJobId','get','../inquirer-helper','defineProperty','tokenPrompt','apply','use','getCurrentContext','addContext','Changed\x20current\x20context\x20to\x20','confirm','browserLogin','Contexts','Use\x20service\x20with\x20id:','8413400TpTqLW','then','startLogin','moveCursor','project','__esModule','796pdDLSH','inquirer','addCommand','lodash','3934035XzzYFF','useProjectId','../login/browser-login','update-token','use\x20from\x20now\x20on','throw','getInfo','contextAvailable','-h,\x20--host\x20[HOST]','getOwnPropertyDescriptor','useServiceId','askForJob','1338Goqbhf','Job\x20name\x20(internal\x20id)\x20to\x20use\x20as\x20default\x20in\x20context','Local\x20context\x20\x27','current','No\x20project\x20in\x20current\x20context.\x20Please\x20set\x20project\x20before\x20setting\x20a\x20project-scoped\x20resource','defaultBaseUrl','removeContext','retry','Use\x20browser\x20login\x20but\x20only\x20print\x20URL\x20which\x20can\x20be\x20used\x20to\x20login','No\x20context\x20available.\x20Use\x20\x27northflank\x20login\x27\x20to\x20create\x20context.','\x0aSuccessfully\x20logged\x20in\x20using\x20browser\x20login,\x20added\x20context\x20with\x20name\x20','No\x20context\x20available.\x20Please\x20use\x20\x27northflank\x20login\x27\x20to\x20create\x20context.','Name\x20for\x20login\x20context','close','writable','-n,\x20--name\x20[NAME]','useContext','contextProvider','search-list','\x20(current)','doNotOpenBrowser','Project\x20name\x20(internal\x20id)\x20to\x20use\x20as\x20default\x20in\x20context','remove','Switch\x20between\x20your\x20local\x20contexts','Service\x20name\x20(internal\x20id)\x20to\x20use\x20as\x20default\x20in\x20context','getProjectName','list','success','Error\x20occured\x20during\x20browser\x20login:\x20','407117LsVCbp','Choose\x20the\x20context\x20to\x20','Open\x20this\x20URL\x20in\x20your\x20browser\x20and\x20follow\x20the\x20steps:\x0a\x09','service','default','Remove\x20a\x20context','CliContext','Override\x20existing\x20contexts\x20(this\x20will\x20remove\x20project\x20and\x20service\x20context)','__importStar','sanitiseHostname','apiClient','Failed\x20to\x20login\x20with\x20the\x20provided\x20token,\x20make\x20sure\x20to\x20use\x20a\x20valid\x20token\x20and\x20host.','Display\x20full\x20URL\x20to\x20allow\x20opening\x20the\x20link\x20manually','-t,\x20--token\x20[TOKEN]','browser-opened','Use\x20manual\x20login\x20with\x20API\x20token','Local\x20context\x20name\x20to\x20remove.','message','List\x20all\x20available\x20contexts','test','option','40RscswP','set-token','getCurrentName','Change\x20current\x20context\x20to\x20context\x20identified\x20by\x20this\x20name','fullUrl','verifyToken','getCurrentProjectName','../utils','\x27\x20successfully\x20updated.','Change\x20the\x20default\x20service\x20in\x20the\x20current\x20local\x20context','__setModuleDefault','Retrieve\x20and\x20update\x20local\x20context\x20settings.','contexts','../console-format-helpers'];a4n=function(){return s;};return a4n();}Object[a4d(0xcd)](exports,a4d(0xdd),{'value':!![]}),exports[a4d(0x111)]=void 0x0;const _=__importStar(require(a4d(0xe1))),node_fetch_1=__importDefault(require('node-fetch')),chalk_1=__importDefault(require(a4d(0xa9))),utils_1=require(a4d(0x127)),inquirer_helper_1=require(a4d(0xcc)),console_format_helpers_1=require(a4d(0x12d)),browser_login_1=require(a4d(0xe4)),inquirer=require(a4d(0xdf));class CliContext{constructor(n,C='https://api.northflank.com'){const c=a4d;this[c(0xf3)]=C,this[c(0x114)]=T=>{const b=c;let V=T;return!/^https?:\/\//i[b(0x11e)](V)&&(V=b(0xc7)+V),V=V['replace'](/\/+$/,''),V;},this[c(0x115)]=n;const k=new inquirer_helper_1[(c(0xc4))](n);this['login']=(0x0,utils_1['getCommand'])()[c(0x140)](c(0xa3))[c(0xbe)](c(0xa4))[c(0x11f)]('--token-login',c(0x11a),![])[c(0x11f)](c(0xab),c(0xf6),![])[c(0x11f)](c(0xfd),c(0xfa))[c(0x11f)](c(0x118),c(0x12e))[c(0x11f)](c(0xea),c(0xa8),this[c(0xf3)])[c(0x11f)](c(0xb4),c(0x112),![])[c(0x13d)](T=>__awaiter(this,void 0x0,void 0x0,function*(){const L=c;_['set'](T,L(0xb7),this[L(0x114)](T[L(0xb7)]));const {name:V,host:j,token:U,override:h}=T['tokenLogin']||T['token']!==undefined?yield this[L(0x136)](T,k):yield this[L(0xd5)](T,k);try{yield this['apiClient'][L(0xff)][L(0xd2)]({'name':V,'host':j,'token':U},h);}catch(o){(0x0,utils_1[L(0xb9)])(o[L(0x11c)]);return;}!(yield this[L(0x125)]())?((0x0,utils_1[L(0xb9)])(L(0x116)),yield this[L(0x115)][L(0xff)][L(0xf4)](V)):(0x0,utils_1[L(0x109)])('Login\x20to\x20'+j+'\x20successful');})),this['contexts']=(0x0,utils_1[c(0x13a)])()[c(0x140)](c(0xa5))[c(0xbe)](c(0x12b))[c(0xae)]('contexts')[c(0xae)]('ctx');const H=(0x0,utils_1[c(0x13a)])()[c(0x140)](c(0x108))[c(0x140)]('ls')[c(0xbe)](c(0x11d))[c(0x11f)](c(0x134),c(0xb8))[c(0x13d)](T=>__awaiter(this,void 0x0,void 0x0,function*(){const G=c;console[G(0xac)](n['contextProvider'][G(0xe8)]());const V=n[G(0xff)]['loadContextWrapper']();if(T['all']===!![]){console['dir'](V);return;}const j=V[G(0xf1)],U=V[G(0x12c)][G(0xb6)]((h,o)=>h[G(0x140)]===j?-0x1:o[G(0x140)]===j?0x1:0x0)['map'](h=>{const Z=G,o=j===h[Z(0x140)]?Z(0x101):'';return{'Name':''+h[Z(0x140)]+o,'Host':h[Z(0xb7)],'Default\x20Project':h['project']||'-','Default\x20Service':h[Z(0x10e)]||'-'};});(0x0,console_format_helpers_1['printAsTable'])(U,G(0xd6));})),R=(0x0,utils_1[c(0x13a)])();R['name'](c(0xd0))[c(0xbe)](c(0x105))[c(0x11f)](c(0xfd),c(0x123))[c(0x13d)](T=>__awaiter(this,void 0x0,void 0x0,function*(){const q=c,V=(T===null||T===void 0x0?void 0x0:T[q(0x140)])||(yield this[q(0xbb)](q(0xd0)));yield this[q(0x115)][q(0xff)][q(0xfe)](V),(0x0,utils_1[q(0x109)])(q(0xd3)+V);}));const W='-i,\x20--id\x20[ID]',i=(0x0,utils_1[c(0x13a)])()[c(0x140)](c(0xdc))['description']('Change\x20the\x20default\x20project\x20in\x20the\x20current\x20local\x20context')[c(0x11f)](W,c(0x103))['action'](T=>__awaiter(this,void 0x0,void 0x0,function*(){const w=c,V=(T===null||T===void 0x0?void 0x0:T['id'])||(yield k['askForProject']());yield this['apiClient'][w(0xff)][w(0xe3)](V),console['log']('Use\x20project\x20with\x20id:',V);})),t=(0x0,utils_1[c(0x13a)])()[c(0x140)](c(0x10e))[c(0xbe)](c(0x129))[c(0x11f)](W,c(0x106))[c(0x13d)](T=>__awaiter(this,void 0x0,void 0x0,function*(){const O=c,V=(T===null||T===void 0x0?void 0x0:T['id'])||(yield k[O(0xaa)](this[O(0x107)]())());console['log'](O(0xd7),V),yield this[O(0x115)][O(0xff)][O(0xec)](V);})),r=(0x0,utils_1[c(0x13a)])()[c(0x140)](c(0x142))['description'](c(0xc6))[c(0x11f)](W,c(0xef))['action'](T=>__awaiter(this,void 0x0,void 0x0,function*(){const F=c,V=(T===null||T===void 0x0?void 0x0:T['id'])||(yield k[F(0xed)](this['getProjectName']())());console[F(0xac)](F(0xba),V),yield this[F(0x115)][F(0xff)][F(0xca)](V);}));R[c(0xe0)](i),R[c(0xe0)](r),R['addCommand'](t);const M=(0x0,utils_1[c(0x13a)])()[c(0x140)](c(0x104))['alias'](c(0xc2))[c(0xae)]('rm')['description'](c(0x110))[c(0x11f)](W,c(0x11b))['action'](T=>__awaiter(this,void 0x0,void 0x0,function*(){const D=c;var V;const j=(T===null||T===void 0x0?void 0x0:T['id'])||(yield this['askForContext'](D(0x104))),U=(V=this[D(0x115)][D(0xff)][D(0xd1)]())===null||V===void 0x0?void 0x0:V[D(0x140)];yield this['apiClient'][D(0xff)][D(0xf4)](j),(0x0,utils_1[D(0x109)])(D(0xf0)+j+D(0xb1));if(!this[D(0xe9)]()){(0x0,utils_1[D(0xc0)])(D(0xf7));return;}if(U===j){const h=(T===null||T===void 0x0?void 0x0:T['name'])||(yield this[D(0xbb)](D(0xe6)));yield this[D(0x115)][D(0xff)]['useContext'](h),(0x0,utils_1[D(0x109)])(D(0xd3)+h);}})),y=(0x0,utils_1[c(0x13a)])()['name'](c(0xe5))[c(0xae)](c(0x121))[c(0xbe)](c(0xb0))[c(0x11f)](c(0x118),c(0xc5))['action'](T=>__awaiter(this,void 0x0,void 0x0,function*(){const Y=c,{contextProvider:V}=this[Y(0x115)],j=(T===null||T===void 0x0?void 0x0:T['token'])||(yield k[Y(0xce)]()),U=V[Y(0x131)]();yield V[Y(0xa2)](j);if(yield this[Y(0x125)]())(0x0,utils_1['success'])(Y(0xb2)+V[Y(0x122)]()+Y(0x128));else{if(U)yield V[Y(0xa2)](U);(0x0,utils_1[Y(0xb9)])(Y(0xbd));}}));this['contexts'][c(0xe0)](H),this[c(0x12c)][c(0xe0)](R),this[c(0x12c)][c(0xe0)](M),this[c(0x12c)][c(0xe0)](y);}[a4d(0xd5)](n,C){var k,H,R,W;return __awaiter(this,void 0x0,void 0x0,function*(){const S=a4C,i=!n[S(0x102)],t=(k=n[S(0xb7)])!==null&&k!==void 0x0?k:this['defaultBaseUrl'],r=new browser_login_1[(S(0xc8))](t,i);let M;r['on'](S(0x119),({url:j})=>{const x=S;if(i){const U=j[x(0x139)](/sessionToken=.*/,x(0xaf));console[x(0xac)](x(0xbc)+U+')'),M=inquirer[x(0x13e)]([{'type':x(0xd4),'name':x(0x124),'message':x(0x117),'default':![]}]),M['then'](h=>{const J=x;process[J(0x130)][J(0xdb)](0x0,-0x1),process['stdout']['clearLine'](0x1),h[J(0x124)]&&console[J(0xac)](J(0x10d)+j+'\x20');});}else console[x(0xac)](x(0x10d)+j+'\x20');});const {token:y,contextName:T}=yield r[S(0xda)]()[S(0xb5)](j=>__awaiter(this,void 0x0,void 0x0,function*(){const z=S;(0x0,utils_1[z(0xb9)])(z(0x10a)+j[z(0x11c)]+z(0xc3));const U=yield this[z(0x136)](n,C);return{'token':U['token'],'contextName':U['name']};}))[S(0x133)](()=>{const u=S;if(M)M['ui'][u(0xfb)]();}),V=(R=(H=n[S(0x140)])!==null&&H!==void 0x0?H:T)!==null&&R!==void 0x0?R:S(0x138)+new Date()['valueOf']();return(0x0,utils_1['success'])(S(0xf8)+chalk_1['default']['italic'](V)),{'name':V,'token':y,'host':t,'override':(W=n['override'])!==null&&W!==void 0x0?W:![]};});}[a4d(0x136)](n,C){return __awaiter(this,void 0x0,void 0x0,function*(){const f=a4C,k=this['apiClient']['contextProvider'][f(0xad)]()[f(0x12c)],{name:H,token:R,host:W,override:i}=yield C['loginPrompt'](n,k);return{'name':H,'token':R,'host':W,'override':i};});}[a4d(0x107)](){const B=a4d,n=this[B(0x115)][B(0xff)][B(0x126)]();if(n===undefined)throw new Error(B(0xf2));return n;}[a4d(0xbb)](n){return __awaiter(this,void 0x0,void 0x0,function*(){const e=a4C;if(!this[e(0xe9)]())throw new Error(e(0xf9));const C=this['apiClient'][e(0xff)][e(0xad)]()['contexts'][e(0x137)](H=>H['name']),k=C['length']>0x4?e(0x100):e(0x108);return(yield inquirer[e(0x13e)]([{'type':k,'name':e(0x140),'message':e(0x10c)+n+':','choices':C}]))[e(0x140)];});}[a4d(0xe9)](){const v=a4d;return this[v(0x115)][v(0xff)][v(0xad)]()[v(0x12c)]['length']>0x0;}[a4d(0x125)](){return __awaiter(this,void 0x0,void 0x0,function*(){const P=a4C;try{const n=this[P(0x115)][P(0xff)][P(0x135)](),C=this['apiClient'][P(0xff)][P(0x131)](),k=n+'/v1/login',H={'Authorization':P(0x141)+C},R=yield(0x0,utils_1[P(0xf5)])(0x3)(()=>__awaiter(this,void 0x0,void 0x0,function*(){const I=P;return(0x0,node_fetch_1[I(0x10f)])(k,{'method':'GET','timeout':0xbb8,'headers':H});}));if(R['ok'])return!![];return![];}catch(W){return![];}});}}exports[a4d(0x111)]=CliContext;
|
|
1
|
+
'use strict';const a4X=a4f;(function(H,f){const T=a4f,l=H();while(!![]){try{const t=parseInt(T(0x1a4))/0x1*(parseInt(T(0x21d))/0x2)+-parseInt(T(0x1d7))/0x3*(-parseInt(T(0x203))/0x4)+-parseInt(T(0x1e0))/0x5+-parseInt(T(0x1ca))/0x6+-parseInt(T(0x1d3))/0x7*(parseInt(T(0x1c1))/0x8)+parseInt(T(0x1f6))/0x9*(parseInt(T(0x200))/0xa)+parseInt(T(0x1d8))/0xb*(parseInt(T(0x1a9))/0xc);if(t===f)break;else l['push'](l['shift']());}catch(b){l['push'](l['shift']());}}}(a4H,0xe8174));var __createBinding=this&&this['__createBinding']||(Object[a4X(0x21e)]?function(H,f,l,t){const C=a4X;if(t===undefined)t=l;var b=Object['getOwnPropertyDescriptor'](f,l);(!b||(C(0x208)in b?!f[C(0x19c)]:b[C(0x20e)]||b[C(0x219)]))&&(b={'enumerable':!![],'get':function(){return f[l];}}),Object[C(0x1be)](H,t,b);}:function(H,f,l,t){if(t===undefined)t=l;H[t]=f[l];}),__setModuleDefault=this&&this['__setModuleDefault']||(Object[a4X(0x21e)]?function(H,f){const j=a4X;Object[j(0x1be)](H,j(0x1f3),{'enumerable':!![],'value':f});}:function(H,f){const c=a4X;H[c(0x1f3)]=f;}),__importStar=this&&this['__importStar']||function(H){const D=a4X;if(H&&H[D(0x19c)])return H;var f={};if(H!=null){for(var l in H)if(l!==D(0x1f3)&&Object[D(0x1f2)][D(0x1d5)][D(0x214)](H,l))__createBinding(f,H,l);}return __setModuleDefault(f,H),f;},__awaiter=this&&this[a4X(0x204)]||function(H,f,l,t){function b(i){return i instanceof l?i:new l(function(n){n(i);});}return new(l||(l=Promise))(function(i,n){const E=a4f;function r(Y){const V=a4f;try{w(t[V(0x19d)](Y));}catch(x){n(x);}}function q(Y){const e=a4f;try{w(t[e(0x21b)](Y));}catch(x){n(x);}}function w(Y){const O=a4f;Y[O(0x20c)]?i(Y[O(0x198)]):b(Y[O(0x198)])[O(0x1ff)](r,q);}w((t=t[E(0x1a7)](H,f||[]))[E(0x19d)]());});},__importDefault=this&&this[a4X(0x217)]||function(H){const S=a4X;return H&&H[S(0x19c)]?H:{'default':H};};Object[a4X(0x1be)](exports,a4X(0x19c),{'value':!![]}),exports[a4X(0x1db)]=void 0x0;const _=__importStar(require(a4X(0x221))),node_fetch_1=__importDefault(require(a4X(0x1c5))),chalk_1=__importDefault(require('chalk')),utils_1=require(a4X(0x202)),inquirer_helper_1=require('../inquirer-helper'),console_format_helpers_1=require(a4X(0x1ce)),browser_login_1=require('../login/browser-login'),inquirer=require(a4X(0x1c7));class CliContext{constructor(H,f='https://api.northflank.com'){const A=a4X;this['defaultBaseUrl']=f,this[A(0x211)]=x=>{const k=A;let U=x;return!/^https?:\/\//i['test'](U)&&(U=k(0x1fd)+U),U=U['replace'](/\/+$/,''),U;},this[A(0x1a0)]=H;const l=new inquirer_helper_1[(A(0x1b1))](H);this[A(0x1fa)]=(0x0,utils_1['getCommand'])()[A(0x1c8)]('login')[A(0x18f)](A(0x1e6))[A(0x191)]('--token-login',A(0x195),![])['option'](A(0x197),A(0x1ee),![])['option'](A(0x1dc),A(0x206))[A(0x191)](A(0x20d),A(0x1d9))[A(0x191)](A(0x1f8),A(0x1cf),this['defaultBaseUrl'])['option']('--override','Override\x20existing\x20contexts\x20(this\x20will\x20remove\x20project\x20and\x20service\x20context)',![])[A(0x210)](x=>__awaiter(this,void 0x0,void 0x0,function*(){const h=A;_[h(0x1c4)](x,'host',this[h(0x211)](x[h(0x1cb)]));const {name:U,host:m,token:Q,override:L}=x[h(0x1ea)]||x[h(0x1ed)]!==undefined?yield this[h(0x223)](x,l):yield this[h(0x1da)](x,l);try{yield this['apiClient'][h(0x199)]['addContext']({'name':U,'host':m,'token':Q},L);}catch(B){(0x0,utils_1[h(0x1a6)])(B[h(0x1d6)]);return;}!(yield this['verifyToken']())?((0x0,utils_1[h(0x1a6)])(h(0x1bf)),yield this[h(0x1a0)][h(0x199)]['removeContext'](U)):(0x0,utils_1['success'])(h(0x207)+m+h(0x20b));})),this[A(0x212)]=(0x0,utils_1['getCommand'])()[A(0x1c8)](A(0x21c))[A(0x18f)](A(0x1f4))[A(0x1c6)](A(0x212))[A(0x1c6)](A(0x215));const t=(0x0,utils_1[A(0x1ad)])()['name'](A(0x21f))[A(0x1c8)]('ls')['description'](A(0x1bc))['option'](A(0x1b8),'Shows\x20full\x20context\x20information\x20(including\x20tokens)')[A(0x210)](x=>__awaiter(this,void 0x0,void 0x0,function*(){const K=A;console['log'](H['contextProvider']['getInfo']());const U=H[K(0x199)][K(0x1d1)]();if(x[K(0x21a)]===!![]){console[K(0x1f1)](U);return;}const m=U[K(0x1f5)],Q=U['contexts'][K(0x20a)]((L,B)=>L[K(0x1c8)]===m?-0x1:B['name']===m?0x1:0x0)[K(0x1df)](L=>{const I=K,B=m===L[I(0x1c8)]?'\x20(current)':'';return{'Name':''+L[I(0x1c8)]+B,'Host':L['host'],'Default\x20Project':L['project']||'-','Default\x20Service':L[I(0x196)]||'-'};});(0x0,console_format_helpers_1[K(0x1a3)])(Q,K(0x1ae));})),b=(0x0,utils_1[A(0x1ad)])();b[A(0x1c8)](A(0x1e9))[A(0x18f)](A(0x193))[A(0x191)](A(0x1dc),A(0x1e4))[A(0x210)](x=>__awaiter(this,void 0x0,void 0x0,function*(){const P=A,U=(x===null||x===void 0x0?void 0x0:x[P(0x1c8)])||(yield this[P(0x19f)]('use'));yield this[P(0x1a0)][P(0x199)][P(0x1af)](U),(0x0,utils_1['success'])('Changed\x20current\x20context\x20to\x20'+U);}));const i=A(0x18e),n=(0x0,utils_1['getCommand'])()[A(0x1c8)](A(0x220))[A(0x18f)](A(0x1eb))[A(0x191)](i,A(0x1b9))[A(0x210)](x=>__awaiter(this,void 0x0,void 0x0,function*(){const Z=A,U=(x===null||x===void 0x0?void 0x0:x['id'])||(yield l[Z(0x201)]());yield this[Z(0x1a0)][Z(0x199)][Z(0x1b5)](U),console['log'](Z(0x1b0),U);})),r=(0x0,utils_1[A(0x1ad)])()['name']('service')[A(0x18f)](A(0x1ac))[A(0x191)](i,'Service\x20name\x20(internal\x20id)\x20to\x20use\x20as\x20default\x20in\x20context')[A(0x210)](x=>__awaiter(this,void 0x0,void 0x0,function*(){const W=A,U=(x===null||x===void 0x0?void 0x0:x['id'])||(yield l['askForService'](this[W(0x1c0)]())());console[W(0x20f)]('Use\x20service\x20with\x20id:',U),yield this[W(0x1a0)][W(0x199)][W(0x209)](U);})),q=(0x0,utils_1[A(0x1ad)])()[A(0x1c8)]('job')[A(0x18f)](A(0x1b2))[A(0x191)](i,A(0x1e2))['action'](x=>__awaiter(this,void 0x0,void 0x0,function*(){const u=A,U=(x===null||x===void 0x0?void 0x0:x['id'])||(yield l['askForJob'](this[u(0x1c0)]())());console[u(0x20f)](u(0x1fb),U),yield this['apiClient']['contextProvider']['useJobId'](U);}));b[A(0x213)](n),b['addCommand'](q),b[A(0x213)](r);const w=(0x0,utils_1[A(0x1ad)])()[A(0x1c8)](A(0x1ef))[A(0x1c6)]('delete')[A(0x1c6)]('rm')[A(0x18f)](A(0x1b4))['option'](i,A(0x1f7))['action'](x=>__awaiter(this,void 0x0,void 0x0,function*(){const g=A;var U;const m=(x===null||x===void 0x0?void 0x0:x['id'])||(yield this['askForContext'](g(0x1ef))),Q=(U=this['apiClient']['contextProvider']['getCurrentContext']())===null||U===void 0x0?void 0x0:U['name'];yield this[g(0x1a0)][g(0x199)][g(0x1bd)](m),(0x0,utils_1[g(0x1aa)])(g(0x19e)+m+g(0x1cc));if(!this[g(0x218)]()){(0x0,utils_1[g(0x1e8)])(g(0x1bb));return;}if(Q===m){const L=(x===null||x===void 0x0?void 0x0:x['name'])||(yield this[g(0x19f)](g(0x1cd)));yield this[g(0x1a0)][g(0x199)]['useContext'](L),(0x0,utils_1[g(0x1aa)])(g(0x1b6)+L);}})),Y=(0x0,utils_1[A(0x1ad)])()[A(0x1c8)](A(0x1de))[A(0x1c6)]('set-token')[A(0x18f)]('Update\x20token\x20for\x20current\x20context')[A(0x191)]('-t,\x20--token\x20[TOKEN]',A(0x216))[A(0x210)](x=>__awaiter(this,void 0x0,void 0x0,function*(){const d=A,{contextProvider:U}=this['apiClient'],m=(x===null||x===void 0x0?void 0x0:x[d(0x1ed)])||(yield l[d(0x1e3)]()),Q=U[d(0x1fc)]();yield U[d(0x1fe)](m);if(yield this['verifyToken']())(0x0,utils_1['success'])(d(0x1a2)+U[d(0x1e5)]()+'\x27\x20successfully\x20updated.');else{if(Q)yield U[d(0x1fe)](Q);(0x0,utils_1[d(0x1a6)])('Failed\x20to\x20login\x20with\x20the\x20provided\x20token.\x20Token\x20was\x20not\x20changed');}}));this[A(0x212)]['addCommand'](t),this[A(0x212)]['addCommand'](b),this['contexts'][A(0x213)](w),this[A(0x212)][A(0x213)](Y);}['browserLogin'](H,f){var l,t,b,i;return __awaiter(this,void 0x0,void 0x0,function*(){const F=a4f,n=!H[F(0x190)],r=(l=H[F(0x1cb)])!==null&&l!==void 0x0?l:this[F(0x1dd)],q=new browser_login_1['NorthflankApiBrowserLogin'](r,n);let w;q['on']('browser-opened',({url:m})=>{const p=F;if(n){const Q=m['replace'](/sessionToken=.*/,p(0x1b7));console[p(0x20f)]('Follow\x20the\x20steps\x20displayed\x20on\x20the\x20page\x20opened\x20in\x20the\x20browser\x20(URL\x20opened:\x20'+Q+')'),w=inquirer[p(0x19a)]([{'type':p(0x1c3),'name':p(0x1ec),'message':p(0x1c2),'default':![]}]),w[p(0x1ff)](L=>{const a=p;process[a(0x192)]['moveCursor'](0x0,-0x1),process[a(0x192)][a(0x1ab)](0x1),L[a(0x1ec)]&&console['log'](a(0x1a8)+m+'\x20');});}else console['log']('Open\x20this\x20URL\x20in\x20your\x20browser\x20and\x20follow\x20the\x20steps:\x0a\x09'+m+'\x20');});const {token:Y,contextName:x}=yield q[F(0x1d2)]()[F(0x1f9)](m=>__awaiter(this,void 0x0,void 0x0,function*(){const J=F;(0x0,utils_1['error'])(J(0x205)+m[J(0x1d6)]+J(0x222));const Q=yield this['apiTokenLogin'](H,f);return{'token':Q[J(0x1ed)],'contextName':Q[J(0x1c8)]};}))[F(0x1d0)](()=>{const o=F;if(w)w['ui'][o(0x1d4)]();}),U=(b=(t=H['name'])!==null&&t!==void 0x0?t:x)!==null&&b!==void 0x0?b:F(0x1f0)+new Date()['valueOf']();return(0x0,utils_1[F(0x1aa)])('\x0aSuccessfully\x20logged\x20in\x20using\x20browser\x20login,\x20added\x20context\x20with\x20name\x20'+chalk_1[F(0x1f3)][F(0x1b3)](U)),{'name':U,'token':Y,'host':r,'override':(i=H[F(0x1e1)])!==null&&i!==void 0x0?i:![]};});}['apiTokenLogin'](H,f){return __awaiter(this,void 0x0,void 0x0,function*(){const M=a4f,l=this[M(0x1a0)][M(0x199)][M(0x1d1)]()[M(0x212)],{name:t,token:b,host:i,override:n}=yield f[M(0x1ba)](H,l);return{'name':t,'token':b,'host':i,'override':n};});}['getProjectName'](){const G=a4X,H=this[G(0x1a0)][G(0x199)][G(0x1e7)]();if(H===undefined)throw new Error(G(0x1a5));return H;}['askForContext'](H){return __awaiter(this,void 0x0,void 0x0,function*(){const N=a4f;if(!this[N(0x218)]())throw new Error(N(0x19b));const f=this[N(0x1a0)][N(0x199)][N(0x1d1)]()[N(0x212)][N(0x1df)](t=>t[N(0x1c8)]),l=f[N(0x194)]>0x4?'search-list':N(0x21f);return(yield inquirer[N(0x19a)]([{'type':l,'name':N(0x1c8),'message':N(0x1a1)+H+':','choices':f}]))['name'];});}[a4X(0x218)](){const z=a4X;return this[z(0x1a0)][z(0x199)][z(0x1d1)]()['contexts']['length']>0x0;}[a4X(0x1c9)](){return __awaiter(this,void 0x0,void 0x0,function*(){const v=a4f;try{const H=this[v(0x1a0)][v(0x199)]['getCurrentBaseUrl'](),f=this[v(0x1a0)][v(0x199)][v(0x1fc)](),l=H+'/v1/login',t={'Authorization':'Bearer\x20'+f},b=yield(0x0,utils_1['retry'])(0x3)(()=>__awaiter(this,void 0x0,void 0x0,function*(){const R=v;return(0x0,node_fetch_1[R(0x1f3)])(l,{'method':'GET','timeout':0xbb8,'headers':t});}));if(b['ok'])return!![];return![];}catch(i){return![];}});}}function a4f(H,f){const l=a4H();return a4f=function(t,b){t=t-0x18e;let i=l[t];return i;},a4f(H,f);}exports[a4X(0x1db)]=CliContext;function a4H(){const s=['No\x20context\x20available.\x20Use\x20\x27northflank\x20login\x27\x20to\x20create\x20context.','List\x20all\x20available\x20contexts','removeContext','defineProperty','Failed\x20to\x20login\x20with\x20the\x20provided\x20token,\x20make\x20sure\x20to\x20use\x20a\x20valid\x20token\x20and\x20host.','getProjectName','640ncHQEZ','Display\x20full\x20URL\x20to\x20allow\x20opening\x20the\x20link\x20manually','confirm','set','node-fetch','alias','inquirer','name','verifyToken','6411060NFukDx','host','\x27\x20successfully\x20removed.','use\x20from\x20now\x20on','../console-format-helpers','host\x20url\x20for\x20this\x20context','finally','loadContextWrapper','startLogin','130886jqZbwA','close','hasOwnProperty','message','6IImTDJ','128491mJpgNB','Token\x20for\x20this\x20context.\x20When\x20set,\x20browser\x20login\x20is\x20not\x20used','browserLogin','CliContext','-n,\x20--name\x20[NAME]','defaultBaseUrl','update-token','map','5605120NdIhIt','override','Job\x20name\x20(internal\x20id)\x20to\x20use\x20as\x20default\x20in\x20context','tokenPrompt','Change\x20current\x20context\x20to\x20context\x20identified\x20by\x20this\x20name','getCurrentName','Connect\x20the\x20CLI\x20to\x20your\x20Northflank\x20account.','getCurrentProjectName','warning','use','tokenLogin','Change\x20the\x20default\x20project\x20in\x20the\x20current\x20local\x20context','fullUrl','token','Use\x20browser\x20login\x20but\x20only\x20print\x20URL\x20which\x20can\x20be\x20used\x20to\x20login','remove','autologin-','dir','prototype','default','Retrieve\x20and\x20update\x20local\x20context\x20settings.','current','10677375nkyIww','Local\x20context\x20name\x20to\x20remove.','-h,\x20--host\x20[HOST]','catch','login','Use\x20job\x20with\x20id:','getCurrentToken','https://','updateToken','then','10WDvYeo','askForProject','../utils','1696736NPUTta','__awaiter','Error\x20occured\x20during\x20browser\x20login:\x20','Name\x20for\x20login\x20context','Login\x20to\x20','get','useServiceId','sort','\x20successful','done','-t,\x20--token\x20[TOKEN]','writable','log','action','sanitiseHostname','contexts','addCommand','call','ctx','Token\x20for\x20this\x20context','__importDefault','contextAvailable','configurable','all','throw','context','31618QMrExl','create','list','project','lodash','.\x20Using\x20fallback.','apiTokenLogin','-i,\x20--id\x20[ID]','description','doNotOpenBrowser','option','stdout','Switch\x20between\x20your\x20local\x20contexts','length','Use\x20manual\x20login\x20with\x20API\x20token','service','--do-not-open-browser','value','contextProvider','prompt','No\x20context\x20available.\x20Please\x20use\x20\x27northflank\x20login\x27\x20to\x20create\x20context.','__esModule','next','Local\x20context\x20\x27','askForContext','apiClient','Choose\x20the\x20context\x20to\x20','Token\x20for\x20current\x20context\x20\x27','printAsTable','101xnqEuw','No\x20project\x20in\x20current\x20context.\x20Please\x20set\x20project\x20before\x20setting\x20a\x20project-scoped\x20resource','error','apply','Open\x20this\x20URL\x20in\x20your\x20browser\x20and\x20follow\x20the\x20steps:\x0a\x09','1032yPsnqB','success','clearLine','Change\x20the\x20default\x20service\x20in\x20the\x20current\x20local\x20context','getCommand','Contexts','useContext','Use\x20project\x20with\x20id:','InquirerHelper','Change\x20the\x20default\x20job\x20in\x20the\x20current\x20local\x20context','italic','Remove\x20a\x20context','useProjectId','Changed\x20current\x20context\x20to\x20','sessionToken=********','--all','Project\x20name\x20(internal\x20id)\x20to\x20use\x20as\x20default\x20in\x20context','loginPrompt'];a4H=function(){return s;};return a4H();}
|