@northflank/cli 0.9.26 → 0.10.1

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.
@@ -1 +1 @@
1
- 'use strict';const a0T2=a0v;function a0T(){const TN=['addons','templates','replicas','versions','nextPageCursor','addonDependencies','internalId','credentials','__esModule','secret','249325WSiinc','storage','default','next','regions','version','deploymentPlan','region','source','services','434599rmhRdn','list','value','get','pagination','keys','projects','addonTypes','logSink','templateId','backups','plans','100788gNEuaY','addonId','2524011ZTNybC','options','length','10951216ZnLSNl','cursor','No\x20available\x20versions\x20to\x20upgrade\x20to.','190eWfmOa','projectId','includes','owningObject','warning','updateaddonversion','2285772kxKWXz','__awaiter','data','15147eeyQuh','latest','defineProperty','then','keyName','join','fetchResourceList','serviceId','map','resources','backupId','addon','type'];a0T=function(){return TN;};return a0T();}(function(T,v){const T1=a0v,W=T();while(!![]){try{const l=parseInt(T1(0xf6))/0x1+parseInt(T1(0x10a))/0x2*(parseInt(T1(0x113))/0x3)+parseInt(T1(0x102))/0x4+-parseInt(T1(0x12a))/0x5+parseInt(T1(0x110))/0x6+parseInt(T1(0x104))/0x7+-parseInt(T1(0x107))/0x8;if(l===v)break;else W['push'](W['shift']());}catch(N){W['push'](W['shift']());}}}(a0T,0x4004b));function a0v(T,v){const W=a0T();return a0v=function(l,N){l=l-0xf1;let y=W[l];return y;},a0v(T,v);}var __awaiter=this&&this[a0T2(0x111)]||function(T,v,W,l){function N(y){return y instanceof W?y:new W(function(D){D(y);});}return new(W||(W=Promise))(function(y,D){const T5=a0v;function w(U){const T3=a0v;try{I(l[T3(0x12d)](U));}catch(k){D(k);}}function e(U){try{I(l['throw'](U));}catch(k){D(k);}}function I(U){const T4=a0v;U['done']?y(U[T4(0xf8)]):N(U[T4(0xf8)])[T4(0x116)](w,e);}I((l=l['apply'](T,v||[]))[T5(0x12d)]());});};Object[a0T2(0x115)](exports,a0T2(0x128),{'value':!![]}),exports[a0T2(0x119)]=void 0x0;const utils_1=require('./utils'),defaultPaginationPageSize=0x64,getProjects=T=>v=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const T6=a0T2;var W;const l=yield T[T6(0xf7)][T6(0xfc)]({'options':{'per_page':defaultPaginationPageSize,'cursor':v===null||v===void 0x0?void 0x0:v[T6(0x124)]}});return{'elements':l[T6(0x112)]['projects'][T6(0x11b)](N=>N['id']),'nextPageCursor':(W=l['pagination'])===null||W===void 0x0?void 0x0:W['cursor']};}),getServices=(T,v)=>W=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const T7=a0T2;var l;const N=yield T[T7(0xf7)]['services']({'parameters':{'projectId':v},'options':{'per_page':defaultPaginationPageSize,'cursor':W===null||W===void 0x0?void 0x0:W[T7(0x124)]}});return{'elements':N[T7(0x112)][T7(0xf5)]['map'](y=>y['id']),'nextPageCursor':(l=N[T7(0xfa)])===null||l===void 0x0?void 0x0:l[T7(0x108)]};}),getAddons=(T,v)=>W=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const T8=a0T2;var l;const N=yield T[T8(0xf7)]['addons']({'parameters':{'projectId':v},'options':{'per_page':defaultPaginationPageSize,'cursor':W===null||W===void 0x0?void 0x0:W['nextPageCursor']}});return{'elements':N[T8(0x112)][T8(0x120)][T8(0x11b)](y=>y['id']),'nextPageCursor':(l=N[T8(0xfa)])===null||l===void 0x0?void 0x0:l[T8(0x108)]};}),getAddonBackups=(T,v,W)=>l=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const T9=a0T2;var N;const y=yield T[T9(0xf9)]['addon'][T9(0x100)]({'parameters':{'projectId':v,'addonId':W},'options':{'per_page':defaultPaginationPageSize,'cursor':l===null||l===void 0x0?void 0x0:l[T9(0x124)]}});return{'elements':y[T9(0x112)][T9(0x100)]['map'](D=>D['id']),'nextPageCursor':(N=y['pagination'])===null||N===void 0x0?void 0x0:N[T9(0x108)]};});function fetchResourceList(T,v,W,l,N,y){var D,w,e,I,U,k,x,B,o,s,Y,a;return __awaiter(this,void 0x0,void 0x0,function*(){const TT=a0v,G=undefined;try{if(T===TT(0xf2)){const F=yield v[TT(0xf7)]['plans']({}),K=F[TT(0x112)][TT(0x101)][TT(0x11b)](t=>{const Tv=TT;var C;return(C=t===null||t===void 0x0?void 0x0:t[Tv(0x126)])!==null&&C!==void 0x0?C:t===null||t===void 0x0?void 0x0:t['id'];});return{'choices':K,'defaultValue':G};}if(T===TT(0xf3)&&!(W===null||W===void 0x0?void 0x0:W['includes'](TT(0xfe)))){const t=yield v[TT(0xf7)][TT(0x12e)]({}),C=t[TT(0x112)][TT(0x12e)][TT(0x11b)](b=>{const TW=TT;var P;return(P=b===null||b===void 0x0?void 0x0:b[TW(0x126)])!==null&&P!==void 0x0?P:b===null||b===void 0x0?void 0x0:b['id'];});return{'choices':C,'defaultValue':G};}if(T===TT(0x10b)){const b=yield getProjects(v),{elements:P,nextPageCursor:z}=yield b();return{'choices':P,'defaultValue':G,'pagination':{'nextPageCursor':z,'loadMore':b}};}if(T===TT(0x127)){const c=yield v[TT(0xf7)]['registryCredentials']({}),O=c[TT(0x112)][TT(0x127)][TT(0x11b)](J=>J['id']);return{'choices':O,'defaultValue':G};}const H=N===null||N===void 0x0?void 0x0:N[TT(0x10b)],A=T===TT(0x11a)||T==='id'&&(y===null||y===void 0x0?void 0x0:y[TT(0x10c)](TT(0x10d)));if(H!==undefined&&A){const J=yield getServices(v,H),{elements:S,nextPageCursor:d}=yield J();return{'choices':S,'defaultValue':G,'pagination':{'nextPageCursor':d,'loadMore':J}};}const m=W===null||W===void 0x0?void 0x0:W[TT(0x10c)](TT(0x11e));if(m){const h=E=>__awaiter(this,void 0x0,void 0x0,function*(){const Tl=TT;var i;const M=yield v[Tl(0xf9)]['addon']['types']({});return(i=M[Tl(0x112)][Tl(0xfd)])===null||i===void 0x0?void 0x0:i[Tl(0x11b)](p=>p['type'])['find'](p=>p[Tl(0x11f)]===E);});if(T===TT(0x11f)){const E=yield v[TT(0xf9)]['addon']['types']({}),i=(D=E[TT(0x112)][TT(0xfd)])===null||D===void 0x0?void 0x0:D[TT(0x11b)](M=>M['type']);return{'choices':i,'defaultValue':G};}if(T===TT(0xf1)&&(l===null||l===void 0x0?void 0x0:l[TT(0x11f)])!==undefined){const M=(w=yield h(l['type']))===null||w===void 0x0?void 0x0:w[TT(0x123)],p=M!==undefined?[TT(0x114),...M]:undefined;return{'choices':p,'defaultValue':G};}if(T===TT(0x12b)&&(l===null||l===void 0x0?void 0x0:l[TT(0x11f)])!==undefined){const Z=(I=(e=yield h(l[TT(0x11f)]))===null||e===void 0x0?void 0x0:e[TT(0x11c)])===null||I===void 0x0?void 0x0:I[TT(0x12b)];return{'choices':Z===null||Z===void 0x0?void 0x0:Z[TT(0x105)],'defaultValue':Z===null||Z===void 0x0?void 0x0:Z[TT(0x12c)]};}if(T===TT(0x122)&&(l===null||l===void 0x0?void 0x0:l[TT(0x11f)])!==undefined){const r=(k=(U=yield h(l[TT(0x11f)]))===null||U===void 0x0?void 0x0:U[TT(0x11c)])===null||k===void 0x0?void 0x0:k[TT(0x122)];return{'choices':r===null||r===void 0x0?void 0x0:r[TT(0x105)],'defaultValue':r===null||r===void 0x0?void 0x0:r['default']};}}if(T===TT(0x103)&&(N===null||N===void 0x0?void 0x0:N[TT(0x10b)])!==undefined){const R=yield getAddons(v,N===null||N===void 0x0?void 0x0:N[TT(0x10b)]),{elements:f,nextPageCursor:X}=yield R();return{'choices':f,'defaultValue':G,'pagination':{'nextPageCursor':X,'loadMore':R}};}if(T===TT(0x11d)&&(N===null||N===void 0x0?void 0x0:N['projectId'])!==undefined&&((x=l===null||l===void 0x0?void 0x0:l[TT(0xf4)])===null||x===void 0x0?void 0x0:x[TT(0x103)])!==undefined){const V=yield getAddonBackups(v,N===null||N===void 0x0?void 0x0:N[TT(0x10b)],(B=l===null||l===void 0x0?void 0x0:l[TT(0xf4)])===null||B===void 0x0?void 0x0:B['addonId']),{elements:n,nextPageCursor:Q}=yield V();return{'choices':n,'defaultValue':G,'pagination':{'nextPageCursor':Q,'loadMore':V}};}const g=(o=N===null||N===void 0x0?void 0x0:N[TT(0x103)])!==null&&o!==void 0x0?o:(s=l===null||l===void 0x0?void 0x0:l[TT(0x125)])===null||s===void 0x0?void 0x0:s[TT(0x103)];if((W===null||W===void 0x0?void 0x0:W[TT(0x118)](''))===TT(0x10f)&&T===TT(0xf1)&&(N===null||N===void 0x0?void 0x0:N[TT(0x10b)])!==undefined&&g!==undefined){const {upgradeTo:j}=(yield v[TT(0xf9)][TT(0x11e)][TT(0xf1)]({'parameters':{'addonId':g,'projectId':N===null||N===void 0x0?void 0x0:N[TT(0x10b)]}}))[TT(0x112)];if(j===undefined||j[TT(0x106)]<=0x0){(0x0,utils_1[TT(0x10e)])(TT(0x109));throw new Error();}return{'choices':j[TT(0x11b)](q=>q[TT(0xf1)]),'defaultValue':G};}if(T===TT(0xff)){const u=yield v[TT(0xf7)][TT(0x121)]({}),q=u[TT(0x112)][TT(0x121)][TT(0x11b)](L=>L===null||L===void 0x0?void 0x0:L['id']);return{'choices':q,'defaultValue':G};}if(((W===null||W===void 0x0?void 0x0:W['includes']('secretLink'))||(W===null||W===void 0x0?void 0x0:W[TT(0x10c)](TT(0x129))))&&T===TT(0x117)&&g!==undefined&&(N===null||N===void 0x0?void 0x0:N[TT(0x10b)])!==undefined){const L=(yield v[TT(0xf9)][TT(0x11e)][TT(0x127)]({'parameters':{'addonId':g,'projectId':N===null||N===void 0x0?void 0x0:N['projectId']}}))[TT(0x112)];return{'choices':[...(Y=Object[TT(0xfb)](L===null||L===void 0x0?void 0x0:L['envs']))!==null&&Y!==void 0x0?Y:[],...(a=Object['keys'](L===null||L===void 0x0?void 0x0:L['secrets']))!==null&&a!==void 0x0?a:[]]};}}catch(T0){}return{'choices':undefined,'defaultValue':G};});}exports[a0T2(0x119)]=fetchResourceList;
1
+ 'use strict';const a0c7=a0E;function a0c(){const cR=['393002JUjLWY','1399746NFUmSH','length','addons','map','28HhjxuA','versions','plans','value','addonTypes','templates','serviceId','list','__esModule','deploymentPlan','26018927kBYFSq','data','registryCredentials','services','pagination','includes','10ebdNao','resources','join','warning','default','types','cursor','storage','./utils','backupId','options','next','done','386560TxbIpa','version','regions','internalId','projectId','addon','addonId','logSink','replicas','type','throw','find','get','46134jkLyaI','3504635cCxKfK','region','credentials','64MDlDxX','defineProperty','source','nextPageCursor','3jqqUGq','secret','1195372kquOEB','then','addonDependencies','keys'];a0c=function(){return cR;};return a0c();}(function(c,E){const c2=a0E,S=c();while(!![]){try{const X=-parseInt(c2(0xa6))/0x1+-parseInt(c2(0x84))/0x2+-parseInt(c2(0x7e))/0x3*(-parseInt(c2(0x80))/0x4)+-parseInt(c2(0xb4))/0x5+parseInt(c2(0x85))/0x6*(-parseInt(c2(0x89))/0x7)+parseInt(c2(0xb7))/0x8*(parseInt(c2(0xb3))/0x9)+-parseInt(c2(0x99))/0xa*(-parseInt(c2(0x93))/0xb);if(X===E)break;else S['push'](S['shift']());}catch(u){S['push'](S['shift']());}}}(a0c,0x77278));var __awaiter=this&&this['__awaiter']||function(c,E,S,X){function u(Y){return Y instanceof S?Y:new S(function(R){R(Y);});}return new(S||(S=Promise))(function(Y,R){const c6=a0E;function d(p){const c3=a0E;try{U(X[c3(0xa4)](p));}catch(q){R(q);}}function w(p){const c4=a0E;try{U(X[c4(0xb0)](p));}catch(q){R(q);}}function U(p){const c5=a0E;p[c5(0xa5)]?Y(p[c5(0x8c)]):u(p['value'])[c5(0x81)](d,w);}U((X=X['apply'](c,E||[]))[c6(0xa4)]());});};function a0E(c,E){const S=a0c();return a0E=function(X,u){X=X-0x7e;let Y=S[X];return Y;},a0E(c,E);}Object[a0c7(0xb8)](exports,a0c7(0x91),{'value':!![]}),exports['fetchResourceList']=void 0x0;const utils_1=require(a0c7(0xa1)),defaultPaginationPageSize=0x64,getProjects=c=>E=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const c8=a0c7;var S;const X=yield c[c8(0x90)]['projects']({'options':{'per_page':defaultPaginationPageSize,'cursor':E===null||E===void 0x0?void 0x0:E[c8(0xba)]}});return{'elements':X[c8(0x94)]['projects'][c8(0x88)](u=>u['id']),'nextPageCursor':(S=X[c8(0x97)])===null||S===void 0x0?void 0x0:S['cursor']};}),getServices=(c,E)=>S=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const c9=a0c7;var X;const u=yield c[c9(0x90)][c9(0x96)]({'parameters':{'projectId':E},'options':{'per_page':defaultPaginationPageSize,'cursor':S===null||S===void 0x0?void 0x0:S[c9(0xba)]}});return{'elements':u[c9(0x94)][c9(0x96)][c9(0x88)](Y=>Y['id']),'nextPageCursor':(X=u[c9(0x97)])===null||X===void 0x0?void 0x0:X[c9(0x9f)]};}),getAddons=(c,E)=>S=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const cc=a0c7;var X;const u=yield c[cc(0x90)][cc(0x87)]({'parameters':{'projectId':E},'options':{'per_page':defaultPaginationPageSize,'cursor':S===null||S===void 0x0?void 0x0:S['nextPageCursor']}});return{'elements':u[cc(0x94)][cc(0x87)][cc(0x88)](Y=>Y['id']),'nextPageCursor':(X=u[cc(0x97)])===null||X===void 0x0?void 0x0:X[cc(0x9f)]};}),getAddonBackups=(c,E,S)=>X=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const cE=a0c7;var u;const Y=yield c[cE(0xb2)]['addon']['backups']({'parameters':{'projectId':E,'addonId':S},'options':{'per_page':defaultPaginationPageSize,'cursor':X===null||X===void 0x0?void 0x0:X[cE(0xba)]}});return{'elements':Y[cE(0x94)]['backups'][cE(0x88)](R=>R['id']),'nextPageCursor':(u=Y['pagination'])===null||u===void 0x0?void 0x0:u['cursor']};});function fetchResourceList(c,E,S,X,u,Y){var R,d,w,P,U,p,q,B,V,g,r,H;return __awaiter(this,void 0x0,void 0x0,function*(){const cS=a0E,f=undefined;try{if(c===cS(0x92)){const b=yield E[cS(0x90)][cS(0x8b)]({}),l=b['data']['plans'][cS(0x88)](A=>{const cX=cS;var I;return(I=A===null||A===void 0x0?void 0x0:A[cX(0xa9)])!==null&&I!==void 0x0?I:A===null||A===void 0x0?void 0x0:A['id'];});return{'choices':l,'defaultValue':f};}if(c===cS(0xb5)&&!(S===null||S===void 0x0?void 0x0:S['includes'](cS(0xad)))){const A=yield E[cS(0x90)][cS(0xa8)]({}),I=A[cS(0x94)][cS(0xa8)][cS(0x88)](T=>{const cu=cS;var M;return(M=T===null||T===void 0x0?void 0x0:T[cu(0xa9)])!==null&&M!==void 0x0?M:T===null||T===void 0x0?void 0x0:T['id'];});return{'choices':I,'defaultValue':f};}if(c===cS(0xaa)){const T=yield getProjects(E),{elements:M,nextPageCursor:m}=yield T();return{'choices':M,'defaultValue':f,'pagination':{'nextPageCursor':m,'loadMore':T}};}if(c===cS(0xb6)){const N=yield E['list'][cS(0x95)]({}),z=N[cS(0x94)][cS(0xb6)]['map'](J=>J['id']);return{'choices':z,'defaultValue':f};}const Z=u===null||u===void 0x0?void 0x0:u[cS(0xaa)],K=c===cS(0x8f)||c==='id'&&(Y===null||Y===void 0x0?void 0x0:Y[cS(0x98)]('owningObject'));if(Z!==undefined&&K){const J=yield getServices(E,Z),{elements:O,nextPageCursor:C}=yield J();return{'choices':O,'defaultValue':f,'pagination':{'nextPageCursor':C,'loadMore':J}};}const t=S===null||S===void 0x0?void 0x0:S[cS(0x98)](cS(0xab));if(t){const k=o=>__awaiter(this,void 0x0,void 0x0,function*(){const cY=cS;var y;const D=yield E[cY(0xb2)][cY(0xab)][cY(0x9e)]({});return(y=D[cY(0x94)][cY(0x8d)])===null||y===void 0x0?void 0x0:y['map'](x=>x[cY(0xaf)])[cY(0xb1)](x=>x[cY(0xaf)]===o);});if(c===cS(0xaf)){const o=yield E[cS(0xb2)]['addon'][cS(0x9e)]({}),y=(R=o[cS(0x94)][cS(0x8d)])===null||R===void 0x0?void 0x0:R['map'](D=>D[cS(0xaf)]);return{'choices':y,'defaultValue':f};}if(c==='version'&&(X===null||X===void 0x0?void 0x0:X['type'])!==undefined){const D=(d=yield k(X[cS(0xaf)]))===null||d===void 0x0?void 0x0:d[cS(0x8a)],x=D!==undefined?['latest',...D]:undefined;return{'choices':x,'defaultValue':f};}if(c===cS(0xa0)&&(X===null||X===void 0x0?void 0x0:X[cS(0xaf)])!==undefined){const h=(P=(w=yield k(X[cS(0xaf)]))===null||w===void 0x0?void 0x0:w[cS(0x9a)])===null||P===void 0x0?void 0x0:P[cS(0xa0)];return{'choices':h===null||h===void 0x0?void 0x0:h[cS(0xa3)],'defaultValue':h===null||h===void 0x0?void 0x0:h[cS(0x9d)]};}if(c===cS(0xae)&&(X===null||X===void 0x0?void 0x0:X[cS(0xaf)])!==undefined){const n=(p=(U=yield k(X[cS(0xaf)]))===null||U===void 0x0?void 0x0:U[cS(0x9a)])===null||p===void 0x0?void 0x0:p[cS(0xae)];return{'choices':n===null||n===void 0x0?void 0x0:n[cS(0xa3)],'defaultValue':n===null||n===void 0x0?void 0x0:n[cS(0x9d)]};}}if(c===cS(0xac)&&(u===null||u===void 0x0?void 0x0:u[cS(0xaa)])!==undefined){const s=yield getAddons(E,u===null||u===void 0x0?void 0x0:u['projectId']),{elements:j,nextPageCursor:a}=yield s();return{'choices':j,'defaultValue':f,'pagination':{'nextPageCursor':a,'loadMore':s}};}if(c===cS(0xa2)&&(u===null||u===void 0x0?void 0x0:u['projectId'])!==undefined&&((q=X===null||X===void 0x0?void 0x0:X['source'])===null||q===void 0x0?void 0x0:q[cS(0xac)])!==undefined){const Q=yield getAddonBackups(E,u===null||u===void 0x0?void 0x0:u[cS(0xaa)],(B=X===null||X===void 0x0?void 0x0:X[cS(0xb9)])===null||B===void 0x0?void 0x0:B[cS(0xac)]),{elements:L,nextPageCursor:W}=yield Q();return{'choices':L,'defaultValue':f,'pagination':{'nextPageCursor':W,'loadMore':Q}};}const G=(V=u===null||u===void 0x0?void 0x0:u[cS(0xac)])!==null&&V!==void 0x0?V:(g=X===null||X===void 0x0?void 0x0:X[cS(0x82)])===null||g===void 0x0?void 0x0:g['addonId'];if((S===null||S===void 0x0?void 0x0:S[cS(0x9b)](''))==='updateaddonversion'&&c===cS(0xa7)&&(u===null||u===void 0x0?void 0x0:u[cS(0xaa)])!==undefined&&G!==undefined){const {upgradeTo:F}=(yield E[cS(0xb2)][cS(0xab)]['version']({'parameters':{'addonId':G,'projectId':u===null||u===void 0x0?void 0x0:u[cS(0xaa)]}}))[cS(0x94)];if(F===undefined||F[cS(0x86)]<=0x0){(0x0,utils_1[cS(0x9c)])('No\x20available\x20versions\x20to\x20upgrade\x20to.');throw new Error();}return{'choices':F[cS(0x88)](i=>i[cS(0xa7)]),'defaultValue':f};}if(c==='templateId'){const i=yield E[cS(0x90)][cS(0x8e)]({}),v=i[cS(0x94)][cS(0x8e)][cS(0x88)](c0=>c0===null||c0===void 0x0?void 0x0:c0['id']);return{'choices':v,'defaultValue':f};}if(((S===null||S===void 0x0?void 0x0:S[cS(0x98)]('secretLink'))||(S===null||S===void 0x0?void 0x0:S['includes'](cS(0x7f))))&&c==='keyName'&&G!==undefined&&(u===null||u===void 0x0?void 0x0:u[cS(0xaa)])!==undefined){const c0=(yield E[cS(0xb2)][cS(0xab)]['credentials']({'parameters':{'addonId':G,'projectId':u===null||u===void 0x0?void 0x0:u[cS(0xaa)]}}))[cS(0x94)];return{'choices':[...(r=Object['keys'](c0===null||c0===void 0x0?void 0x0:c0['envs']))!==null&&r!==void 0x0?r:[],...(H=Object[cS(0x83)](c0===null||c0===void 0x0?void 0x0:c0['secrets']))!==null&&H!==void 0x0?H:[]]};}}catch(c1){}return{'choices':undefined,'defaultValue':f};});}exports['fetchResourceList']=fetchResourceList;
package/dist/cli.js CHANGED
@@ -1,2 +1,2 @@
1
- #!/usr/bin/env node
2
- 'use strict';const a1Tx=a1v;function a1T(){const TR=['addHelpCommand','getNextPage','done','clusterId','secretId','all','toLowerCase','8337744xKllXm','subdomain','skipValidation','buildId','askForTag','InquirerHelper','moveCursor','askForTemplateRun','./formatting/command-overview','backup','askForBuild','askForService','warning','Failed\x20to\x20validate\x20input\x20(incorrect\x20format):\x20','log','argv','enablePositionalOptions','OPTIONAL:\x20','askForJob','there\x20are\x20more\x20rows,\x20load?','host','repo','jobs','/docs/v1/api/','backup-destinations','secrets','tpl','VERBOSE:\x20Using\x20endpoint\x20->\x20','apply','cred','restores','green','volumes','boolean','\x0a>\x20Token\x20permissions\x20required:\x20','templateRunId','askForVolume','secret','safeLoad','endsWith','askForSubdomain','map','isString','volumeId','file','assign','VERBOSE:\x20Request\x20body\x20->\x20','tag','invoice','askForSubdomainPath','assertContextExisting','Command','getLogsCommand','portFwdCmd','northflank','__importDefault','__setModuleDefault','--verbose','plan','contextProvider','lodash','action','next','branches','logs','Get\x20information\x20about\x20Northflank\x20','tags','yml','path','serviceId','getOwnPropertyNames','description','getCurrentContext','domain','pipelineId','CliExec','stdout','deleteWarningPrompt','askForJobRun','GetApiEndpointPaginated','configurable','defaults','toUpperCase','jobId','dmn','statusText','then','split','commands','Manage\x20your\x20Northflank\x20resources\x20from\x20the\x20command\x20line','entries','logSinkId','defineProperty','../package.json','contexts','backupDestinationId','opts','docsTagsPath','1128663vNhCkP','quiet','addonId','./context/contextCommands','inv','hasNextPage','setPathVars','bind','method','force','output','throw','\x20properties','resourceTagId','default','nonInteractiveEndpoint','./formatting/console-format-helpers','templateId','has','call','askForAddon','set','Options\x20\x27loadAll\x27\x20can\x20not\x20be\x20combined\x20with\x20\x27page\x27\x20or\x20\x27cursor\x27','includes','parse','getCurrentProjectName','verbose','existsSync','addHelpText','required','printAsTable','join','getOwnPropertyDescriptor','keys','omit','stringify',',\x20-','find','Unknown\x20input\x20file\x20type:\x20','askForAddonBackup','requiredPermissions',',\x20NF\x20error\x20id:\x20','scrt','72lILmka','list','Unknown\x20input\x20format.\x20Not\x20valid\x20json\x20and\x20not\x20valid\x20yaml.','ApiClientFileContextProvider','paginationArgs','svc','project','CliMetrics','subdomainPath','./metrics','projectId','@northflank/js-client','isPaginatedEndpoint','adn','./logs','./utils','url','agent','volume','custom-columns=','asyncSequential','JSON-formatted\x20resource\x20definition,\x20takes\x20precedence\x20over\x20\x22--file\x22','isEqual','./defaults','pagination','runId','backupId','getProgram','opt','Resource\x20was\x20not\x20deleted.','__awaiter','(HTTP\x20status\x20code:\x20','\x20Northflank\x20resources','-v,\x20--version','js-yaml','prototype','askConfirm','type','CliContext','invoices','cursor','filter','File\x20does\x20not\x20exist:\x20','__esModule','credential','sort','ApiClient','askForTemplate','toString','services','askForPipeline','after','request','job','name','get','pop','addons','Update\x20Northflank\x20','283556FpmaOT','\x20--','replace','-f,\x20--file\x20<file-path>','getMetricsCommand','getCommand','isArray','alias','CliPortForward','create','getCurrentServiceName','templates','subdomainId','Error\x20occured\x20while\x20trying\x20to\x20run\x20command,\x20error:\x20','handleYamlOutput','length','forEach','chalk','page','version','option','credentialId','retrievePayloadViaInteractiveCli','template','message','delete','data','concat','count','askForCredentials','startsWith','4226450wwtvxs','rawResponse','\x0a\x09details\x20:','Northflank\x20cli\x20version:\x20','body','Documentation:\x20','2235358WzuqCL','query','loadAll','clearLine','plans','upperFirst','underline','askForLogSink','prj','./inquirer-helper','kebabCase','backups','813275MnViLJ','domainId','yaml','error','__importStar','service','.yaml','Expecting\x20resource\x20input\x20with\x20\x27--input\x27\x20or\x20\x27--file\x27\x20argument','brn','addon','6enIFsA','region','addCommand','2255252lykblL','API\x20request\x20failed\x0a\x09Message:\x20','resource','hasOwnProperty','__createBinding'];a1T=function(){return TR;};return a1T();}(function(T,v){const Tk=a1v,W=T();while(!![]){try{const l=-parseInt(Tk(0x16a))/0x1+parseInt(Tk(0x15e))/0x2+parseInt(Tk(0x174))/0x3*(-parseInt(Tk(0x177))/0x4)+-parseInt(Tk(0x158))/0x5+parseInt(Tk(0x71))/0x6+-parseInt(Tk(0x139))/0x7+-parseInt(Tk(0xfe))/0x8*(-parseInt(Tk(0xd3))/0x9);if(l===v)break;else W['push'](W['shift']());}catch(N){W['push'](W['shift']());}}}(a1T,0xc5933));var __createBinding=this&&this[a1Tx(0x17b)]||(Object[a1Tx(0x142)]?function(T,v,W,l){const TB=a1Tx;if(l===undefined)l=W;var N=Object[TB(0xf3)](v,W);(!N||(TB(0x135)in N?!v[TB(0x129)]:N['writable']||N[TB(0xc1)]))&&(N={'enumerable':!![],'get':function(){return v[W];}}),Object[TB(0xcd)](T,l,N);}:function(T,v,W,l){if(l===undefined)l=W;T[l]=v[W];}),__setModuleDefault=this&&this[a1Tx(0xa9)]||(Object[a1Tx(0x142)]?function(T,W){const To=a1Tx;Object['defineProperty'](T,To(0xe1),{'enumerable':!![],'value':W});}:function(T,W){const Ts=a1Tx;T[Ts(0xe1)]=W;}),__importStar=this&&this[a1Tx(0x16e)]||function(T){const TY=a1Tx;if(T&&T[TY(0x129)])return T;var v={};if(T!=null){for(var W in T)if(W!==TY(0xe1)&&Object[TY(0x121)][TY(0x17a)][TY(0xe6)](T,W))__createBinding(v,T,W);}return __setModuleDefault(v,T),v;},__awaiter=this&&this[a1Tx(0x11c)]||function(T,v,W,l){function N(y){return y instanceof W?y:new W(function(D){D(y);});}return new(W||(W=Promise))(function(y,D){const TA=a1v;function w(U){const Ta=a1v;try{I(l[Ta(0xaf)](U));}catch(k){D(k);}}function e(U){const TG=a1v;try{I(l[TG(0xde)](U));}catch(k){D(k);}}function I(U){const TH=a1v;U[TH(0x6c)]?y(U['value']):N(U['value'])[TH(0xc7)](w,e);}I((l=l[TA(0x8d)](T,v||[]))[TA(0xaf)]());});},__importDefault=this&&this[a1Tx(0xa8)]||function(T){const Tm=a1Tx;return T&&T[Tm(0x129)]?T:{'default':T};};Object[a1Tx(0xcd)](exports,a1Tx(0x129),{'value':!![]}),exports[a1Tx(0x119)]=void 0x0;const js_client_1=require(a1Tx(0x109)),commander_1=__importDefault(require('commander')),fs_1=__importDefault(require('fs')),chalk_1=__importDefault(require(a1Tx(0x14a))),_=__importStar(require(a1Tx(0xad))),contextCommands_1=require(a1Tx(0xd6)),utils_1=require(a1Tx(0x10d)),defaults=__importStar(require(a1Tx(0x115))),inquirer_helper_1=require(a1Tx(0x167)),console_format_helpers_1=require(a1Tx(0xe3)),command_overview_1=require(a1Tx(0x79)),port_forward_1=require('./port-forward'),exec_1=require('./exec'),logs_1=require(a1Tx(0x10c)),metrics_1=require(a1Tx(0x107)),yaml=require(a1Tx(0x120)),pgk=require(a1Tx(0xce)),getProgram=T=>{const Tg=a1Tx,v=new commander_1[(Tg(0xe1))][(Tg(0xa4))](Tg(0xa7));v['description'](Tg(0xca)),v[Tg(0x81)](!![]),v[Tg(0x14c)](Tg(0x15b)+chalk_1['default'][Tg(0x164)](pgk[Tg(0x14c)]),Tg(0x11f),'Print\x20the\x20current\x20version\x20of\x20the\x20Northflank\x20cli');const W=new js_client_1[(Tg(0x12c))](T,{'throwErrorOnHttpErrorCode':![],'customUserAgent':utils_1['customUserAgent'],'agent':utils_1[Tg(0x10f)]}),l=new contextCommands_1[(Tg(0x124))](W),N=new port_forward_1[(Tg(0x141))](T),y=new exec_1[(Tg(0xbc))](T),D=new logs_1['CliLogs'](T),w=new metrics_1[(Tg(0x105))](T);return v[Tg(0x176)](N[Tg(0xa6)]),v['addCommand'](y['execCmd']),v['addCommand'](l['login']),v[Tg(0x176)](l[Tg(0xcf)]),generateCommands(W,W['endpoints'],v,D,w),v['addCommand']((0x0,command_overview_1['getCommandOverview'])(v)),v[Tg(0x6a)](!![],'Display\x20help\x20for\x20command'),v['helpOption'](undefined,'Display\x20help\x20for\x20command'),v;};exports['getProgram']=getProgram,((()=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const TF=a1Tx;try{const T=new js_client_1[(TF(0x101))]();yield(0x0,utils_1['checkUpdate'])(T);const v=(0x0,exports[TF(0x119)])(T);yield v['parseAsync'](process[TF(0x80)]);}catch(W){(0x0,utils_1[TF(0x16d)])(TF(0x146)+W[TF(0x151)]),process[TF(0x80)]['find'](l=>l===TF(0xaa))&&console['log'](W),process['exitCode']=0x1;}}))());function isListCommand(T){const TK=a1Tx,v=[[TK(0x135),'addon',TK(0x169)],[TK(0x135),'job','runs']];return T[TK(0xf8)](W=>W===TK(0xff))||v['some'](W=>_['isEqual'](T,W));}function generateCommands(T,v,W,l,N,y=defaults[a1Tx(0xc2)],D=[]){const Tt=a1Tx,w=new inquirer_helper_1[(Tt(0x76))](new js_client_1[(Tt(0x12c))](T['contextProvider'],{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1['customUserAgent'],'agent':utils_1[Tt(0x10f)]}));function e(x,B){const TC=Tt;return x[TC(0xf0)]!==![]&&B===undefined;}function I(x,B){const Tb=Tt,{opt:o,name:s}=x,Y=o['default'],a=e(o,Y),G=K=>K[Tb(0x148)]>0x1?'--'+K:'-'+K,H=o===null||o===void 0x0?void 0x0:o[Tb(0x140)],A=H?_[Tb(0x13f)](H)?'-'+(H===null||H===void 0x0?void 0x0:H[Tb(0x9a)](K=>G(K))[Tb(0xf2)](Tb(0xf7)))+',':''+G(H):'',m=a?'':Tb(0x82),g=typeof o['type']===Tb(0x92)||o[Tb(0x123)]==='boolean'?A+Tb(0x13a)+s:A+'\x20--'+s+'\x20<'+s[Tb(0xc3)]()+'>',F=m+o['description'];B['option'](g,F,Y);}function U(x,B){const TP=Tt;if(B[TP(0xc9)]['some'](o=>o[TP(0x134)]()===TP(0xb1)))return;_[TP(0x114)](x,[TP(0x135),TP(0x16f)])&&(B[TP(0x176)](l[TP(0xa5)]('service')),B[TP(0x176)](N[TP(0x13d)]('service')),B[TP(0x176)](l['getLogsCommand'](TP(0x16f),!![])),B[TP(0x176)](N['getMetricsCommand'](TP(0x16f),!![]))),_[TP(0x114)](x,[TP(0x135),TP(0x133)])&&(B[TP(0x176)](l['getLogsCommand']('job')),B[TP(0x176)](N['getMetricsCommand']('job')),B[TP(0x176)](l[TP(0xa5)]('job',!![])),B[TP(0x176)](N[TP(0x13d)](TP(0x133),!![]))),_[TP(0x114)](x,[TP(0x135),TP(0x173)])&&(B['addCommand'](l[TP(0xa5)](TP(0x173))),B[TP(0x176)](N[TP(0x13d)](TP(0x173)))),_['isEqual'](x,[TP(0x135),TP(0x173),TP(0x7a)])&&B[TP(0x176)](l['getLogsCommand']('addon',![],!![])),_[TP(0x114)](x,[TP(0x135),'addon',TP(0x8f)])&&B['addCommand'](l[TP(0xa5)](TP(0x173),![],!![],!![]));}return Object['getOwnPropertyNames'](y)[Tt(0x149)](x=>{const Tz=Tt,B=v[x],o=y[x],s=D[Tz(0x154)]([x]);function Y(C,b){const Tc=Tz,P=Object[Tc(0xb7)](C||{});P[Tc(0x9a)](z=>{return{'name':z,'opt':C[z]};})[Tc(0x12b)]((z,c)=>!e(z[Tc(0x11a)])?!e(c[Tc(0x11a)])?0x0:0x1:-0x1)[Tc(0x149)](z=>{I(z,b);});}function a(C,b){const TO=Tz,P=[[TO(0x104),'projects',TO(0x166)],[TO(0x16f),TO(0x12f),TO(0x103)],['credentials',TO(0x12a),TO(0x8e)],[TO(0x173),TO(0x137),TO(0x10b)],[TO(0x133),TO(0x87)],[TO(0xab),TO(0x162),'pln'],[TO(0x175),'regions','rgn'],['domain','domains',TO(0xc5)],[TO(0x96),TO(0x8a),TO(0xfd)],[TO(0x91),TO(0x110),'vol'],[TO(0xb0),'branch',TO(0x172)],[TO(0xa1),TO(0x125),TO(0xd7)],[TO(0x150),TO(0x144),TO(0x8b)],['repos','repository','repositories',TO(0x86)],['backup-destination',TO(0x89)],[TO(0xa0),TO(0xb3)]],z=P[TO(0xf8)](c=>c['includes'](b));if(z!==undefined)C['aliases'](z[TO(0x127)](c=>c!==b));}function G(C){var b,P;return __awaiter(this,void 0x0,void 0x0,function*(){const TJ=a1v,z={},{contextProvider:c}=T,O=s[TJ(0xea)](TJ(0x152)),J=C['noDefaults']===!![];function S(d,h,E){var i,M;return __awaiter(this,void 0x0,void 0x0,function*(){const TS=a1v;if(_[TS(0xe5)]((M=(i=o[TS(0x11a)])===null||i===void 0x0?void 0x0:i[TS(0xb5)])!==null&&M!==void 0x0?M:{},d)){const p=!J&&!O&&E?E():undefined,Z=C[d]||p||(yield h());_[TS(0xe8)](z,d,Z);}});}return yield(0x0,utils_1[TJ(0x112)])(Object[TJ(0xcb)]((P=(b=o[TJ(0x11a)])===null||b===void 0x0?void 0x0:b[TJ(0xb5)])!==null&&P!==void 0x0?P:{}),([d,h])=>__awaiter(this,void 0x0,void 0x0,function*(){const Td=TJ;var E;const i=z===null||z===void 0x0?void 0x0:z[Td(0x108)],M=z===null||z===void 0x0?void 0x0:z['templateId'];switch(d){case'projectId':return yield S(Td(0x108),w['askForProject'][Td(0xda)](w),c[Td(0xec)][Td(0xda)](c));case Td(0xb6):return yield S(Td(0xb6),w[Td(0x7c)](i)[Td(0xda)](w),c[Td(0x143)]['bind'](c));case Td(0xd5):return yield S(Td(0xd5),w[Td(0xe7)](i)[Td(0xda)](w));case'jobId':return yield S('jobId',w[Td(0x83)](i)[Td(0xda)](w),c['getCurrentJobName'][Td(0xda)](c));case Td(0x117):return yield S(Td(0x117),w[Td(0xbf)](z[Td(0xc4)],i,![])['bind'](w));case Td(0x6e):return yield S(Td(0x6e),w['askForSecret'](i)[Td(0xda)](w));case Td(0xba):case Td(0x16b):return yield S(Td(0xba),w['askForDomain'][Td(0xda)](w));case'credentialId':return yield S(Td(0x14e),w[Td(0x156)]['bind'](w));case Td(0x9c):return yield S(Td(0x9c),w[Td(0x95)](i)[Td(0xda)](w));case Td(0x72):return yield S(Td(0x72),w[Td(0x99)](z[Td(0xba)])[Td(0xda)](w));case'subdomainId':return yield S(Td(0x145),w['askForSubdomain'](z[Td(0x16b)])[Td(0xda)](w));case'subdomainPath':return yield S(Td(0x106),w[Td(0xa2)](z[Td(0xba)],(E=z['subdomain'])!==null&&E!==void 0x0?E:z[Td(0x145)])[Td(0xda)](w));case Td(0x118):return yield S('backupId',w[Td(0xfa)](i,z[Td(0xd5)])['bind'](w));case'buildId':return yield S(Td(0x74),w[Td(0x7b)](i,z[Td(0xb6)],z[Td(0xc4)])[Td(0xda)](w));case Td(0xe4):return yield S(Td(0xe4),w[Td(0x12d)]()[Td(0xda)](w));case'templateRunId':return yield S(Td(0x94),w[Td(0x78)](M)[Td(0xda)](w));case Td(0xcc):return yield S('logSinkId',w[Td(0x165)]()['bind'](w));case Td(0xbb):return yield S(Td(0xbb),w[Td(0x130)](i)[Td(0xda)](w));case Td(0xe0):return yield S(Td(0xe0),w[Td(0x75)]()[Td(0xda)](w));case Td(0xd0):return yield S(Td(0xd0),w['askForBackupDestination']()[Td(0xda)](w));case'clusterId':return yield S(Td(0x6d),w['askForClusterId']()[Td(0xda)](w));default:return yield S(d,w['askGeneric'](d,h===null||h===void 0x0?void 0x0:h['description'])[Td(0xda)](w));}})),z;});}function H(C){var b,P,z;return __awaiter(this,void 0x0,void 0x0,function*(){const Th=a1v,c={},O=((b=o[Th(0x11a)])===null||b===void 0x0?void 0x0:b[Th(0x10a)])?defaults['paginationArgs']:{},J=Object[Th(0x9e)](Object[Th(0x9e)]({},(z=(P=o[Th(0x11a)])===null||P===void 0x0?void 0x0:P['query'])!==null&&z!==void 0x0?z:{}),O),S=Object[Th(0xf4)](J)[Th(0x127)](d=>d!=='loadAll');return yield(0x0,utils_1[Th(0x112)])(S,d=>__awaiter(this,void 0x0,void 0x0,function*(){const TE=Th;if(C[d]!==undefined)return _[TE(0xe8)](c,d,C[d]);})),c;});}function A(){const Ti=Tz;switch(s[0x0]){case Ti(0x135):return Ti(0xb2)+(s[0x1]||Ti(0x179))+'s';case'update':return Ti(0x138)+(s[0x1]||Ti(0x179))+Ti(0xdf);default:return _[Ti(0x163)](x)+Ti(0x11e);}}function m(C,b){const TM=Tz;var P,z,c,O,J,S,d,h;if(!b){const X=(0x0,utils_1[TM(0x13e)])()[TM(0x134)](_['kebabCase'](x))[TM(0xb8)](A());return a(X,x),X;}const E=(C===null||C===void 0x0?void 0x0:C[TM(0xfb)])?chalk_1[TM(0xe1)]['grey'](TM(0x93)+C[TM(0xfb)]):'',i=T[TM(0xac)][TM(0xb9)](),M=i!==undefined&&((P=o===null||o===void 0x0?void 0x0:o[TM(0x11a)])===null||P===void 0x0?void 0x0:P[TM(0xd2)])!==undefined,p=i===null||i===void 0x0?void 0x0:i[TM(0x85)][TM(0x13b)]('api.',''),Z=M?TM(0x15d)+p+TM(0x88)+((z=o===null||o===void 0x0?void 0x0:o[TM(0x11a)])===null||z===void 0x0?void 0x0:z[TM(0xd2)]):'',r=(C===null||C===void 0x0?void 0x0:C['description'])||'',R=(0x0,utils_1[TM(0x13e)])(!![])[TM(0x134)](_[TM(0x168)](x))[TM(0xb8)](r)[TM(0xef)](TM(0x131),[E,Z][TM(0xf2)]('\x0a'));a(R,x);(((c=o[TM(0x11a)])===null||c===void 0x0?void 0x0:c[TM(0x15c)])||((O=o['opt'])===null||O===void 0x0?void 0x0:O[TM(0xe2)]))&&(R[TM(0x14d)](TM(0x13c),'File\x20to\x20load\x20resource\x20json\x20from'),R['option']('-i,\x20--input\x20<resource-def>',TM(0x113)));Y((J=o[TM(0x11a)])===null||J===void 0x0?void 0x0:J[TM(0xb5)],R),Y((S=o[TM(0x11a)])===null||S===void 0x0?void 0x0:S[TM(0x15f)],R);const f=(d=o[TM(0x11a)])===null||d===void 0x0?void 0x0:d[TM(0x10a)];return f&&Y(defaults[TM(0x102)],R),Y((h=o['opt'])===null||h===void 0x0?void 0x0:h['base'],R),R[TM(0xae)](()=>__awaiter(this,void 0x0,void 0x0,function*(){const Tp=TM;var V,n,Q,j,u,q;(0x0,utils_1[Tp(0xa3)])(T);const L=R[Tp(0xd1)](),T0=L[Tp(0x14b)]!==undefined||L[Tp(0x126)]!==undefined;if(L[Tp(0x160)]===!![]&&T0)throw new Error(Tp(0xe9));const T1=L===null||L===void 0x0?void 0x0:L[Tp(0xdd)],T2=T1==='json',T3=T1===Tp(0x16c)||T1==='yml',T4=yield G(L);w[Tp(0xd9)](T4);const T5=yield H(L),T6=Object[Tp(0xf4)]((n=(V=o[Tp(0x11a)])===null||V===void 0x0?void 0x0:V[Tp(0xb5)])!==null&&n!==void 0x0?n:{})[Tp(0x9a)](Tv=>Tv+'='+chalk_1[Tp(0xe1)][Tp(0x90)](T4[Tv]))['join'](',\x20');if(T6['length']>0x0&&!T2&&!T3){const Tv='=>\x20running\x20command\x20with:\x20'+T6;console['log'](Tv);}const T7=((Q=o[Tp(0x11a)])===null||Q===void 0x0?void 0x0:Q['body'])||((j=o[Tp(0x11a)])===null||j===void 0x0?void 0x0:j['nonInteractiveEndpoint'])?yield k(L,o,s):undefined;if(!L[Tp(0xdc)]&&s['includes'](Tp(0x152))&&!(yield w[Tp(0xbe)]())){(0x0,utils_1[Tp(0x7d)])(Tp(0x11b));return;}const T8=f&&(L['loadAll']||(L[Tp(0xdd)]==='json'||L[Tp(0xdd)]===Tp(0x16c))&&!T0);let T9=T8&&B instanceof js_client_1[Tp(0xc0)]?yield B[Tp(0x6f)]({'parameters':T4,'options':T5,'data':T7}):yield B[Tp(0xe6)]({'parameters':T4,'options':Object[Tp(0x9e)]({},T5),'data':T7});if(L===null||L===void 0x0?void 0x0:L[Tp(0xed)]){const TW=T9[Tp(0x132)];console[Tp(0x7f)](Tp(0x8c)+TW[Tp(0xdb)][Tp(0xc3)]()+':'+TW[Tp(0x10e)]);if(T7!==undefined)console[Tp(0x7f)](Tp(0x9f)+T7);}if(T9['error']){const {details:Tl,id:TN,message:Ty,status:TD}=T9[Tp(0x16d)],Tw=Tl?Tp(0x15a)+JSON[Tp(0xf6)](Tl):'',Te=TN?Tp(0xfc)+TN:'',TI=Tp(0x11d)+TD+Te+')';throw new Error(Tp(0x178)+Ty+'\x20'+TI+Tw);}let TT=0x0;printCallResult(L,T2,T9[Tp(0x153)],T3,s,T1,![],TT,T9[Tp(0x159)][Tp(0xc6)]);if(!L[Tp(0xd4)]&&!T8&&!T0&&((u=T9[Tp(0x116)])===null||u===void 0x0?void 0x0:u[Tp(0xd8)]))while((q=T9[Tp(0x116)])===null||q===void 0x0?void 0x0:q[Tp(0xd8)]){const TU=yield w[Tp(0x122)](Tp(0x84));if(TU)process['stdout'][Tp(0x77)](0x0,-0x1),process[Tp(0xbd)][Tp(0x161)](0x1),TT+=T9[Tp(0x116)][Tp(0x155)],T9=yield T9['pagination'][Tp(0x6b)](),printCallResult(L,T2,T9['data'],T3,s,T1,!![],TT,T9[Tp(0x159)][Tp(0xc6)]);else return;}})),R;}const g=_[Tz(0xe5)](o,Tz(0x11a)),F=B,K=m(F,g);U(s,K),W[Tz(0x176)](K);const t=_[Tz(0xf5)](o,Tz(0x11a));Object[Tz(0xf4)](t)[Tz(0x148)]>0x0&&generateCommands(T,B,K,l,N,t,s);});function k(x,B,o){var s;return __awaiter(this,void 0x0,void 0x0,function*(){const TZ=a1v,{input:Y,file:a}=x;if(Y!==undefined)try{return JSON[TZ(0xeb)](Y);}catch(G){try{return yaml[TZ(0x97)](Y);}catch(H){throw new Error(TZ(0x100));}}if(a!==undefined){if(!fs_1[TZ(0xe1)][TZ(0xee)](a))throw new Error(TZ(0x128)+a);const A=fs_1['default']['readFileSync'](a)[TZ(0x12e)]();let m;try{if(_[TZ(0x9b)](A)){if(x[TZ(0x9d)][TZ(0x98)]('.json'))m=JSON[TZ(0xeb)](A);else{if(x['file'][TZ(0x98)](TZ(0x170))||x[TZ(0x9d)][TZ(0x98)](TZ(0xb4)))m=yaml['safeLoad'](A);else throw new Error(TZ(0xf9)+x[TZ(0x9d)][TZ(0xc8)]('.')[TZ(0x136)]());}}else m=A;return m;}catch(g){throw new Error(TZ(0x7e)+g['message']);}}if((s=B===null||B===void 0x0?void 0x0:B['opt'])===null||s===void 0x0?void 0x0:s[TZ(0xe2)])throw new Error(TZ(0x171));return yield w[TZ(0x14f)](B,{'cmdPath':o,'skipValidation':x[TZ(0x73)]});});}}function a1v(T,v){const W=a1T();return a1v=function(l,N){l=l-0x6a;let y=W[l];return y;},a1v(T,v);}const printCallResult=(T,v,W,l,N,y,D,w,e)=>{const Tr=a1Tx;if(!(T===null||T===void 0x0?void 0x0:T[Tr(0xd4)])){if(v)(0x0,console_format_helpers_1['handleJsonOutput'])(T===null||T===void 0x0?void 0x0:T['output'],W);else{if(l)(0x0,console_format_helpers_1[Tr(0x147)])(T===null||T===void 0x0?void 0x0:T[Tr(0xdd)],W);else{if(isListCommand(N)){const I=(y===null||y===void 0x0?void 0x0:y[Tr(0x157)](Tr(0x111)))?y['replace'](Tr(0x111),'')[Tr(0xc8)](',')[Tr(0x9a)](o=>o[Tr(0x70)]()):undefined,U=N[N[Tr(0x148)]-0x1],k=''+U+(U['endsWith']('s')?'':'s'),x=_[Tr(0x163)](k),B=_['has'](W,k)?W[k]:W;(0x0,console_format_helpers_1[Tr(0xf1)])(B,x,I,D,w);}else console[Tr(0x7f)]((0x0,console_format_helpers_1['consoleFormat'])(W,e));}}}};
1
+ #!/usr/bin/env node --no-deprecation
2
+ 'use strict';const a1cq=a1E;(function(c,E){const cp=a1E,S=c();while(!![]){try{const X=-parseInt(cp(0x1f8))/0x1+-parseInt(cp(0x279))/0x2+-parseInt(cp(0x252))/0x3+-parseInt(cp(0x27b))/0x4*(-parseInt(cp(0x278))/0x5)+parseInt(cp(0x1f6))/0x6+-parseInt(cp(0x1f7))/0x7*(parseInt(cp(0x27c))/0x8)+parseInt(cp(0x2cf))/0x9;if(X===E)break;else S['push'](S['shift']());}catch(u){S['push'](S['shift']());}}}(a1c,0xf0e3f));var __createBinding=this&&this[a1cq(0x1f5)]||(Object[a1cq(0x2ca)]?function(c,E,S,X){const cB=a1cq;if(X===undefined)X=S;var u=Object[cB(0x25b)](E,S);(!u||('get'in u?!E[cB(0x20c)]:u[cB(0x2e1)]||u[cB(0x2cc)]))&&(u={'enumerable':!![],'get':function(){return E[S];}}),Object[cB(0x2c1)](c,X,u);}:function(c,E,S,X){if(X===undefined)X=S;c[X]=E[S];}),__setModuleDefault=this&&this[a1cq(0x1ef)]||(Object['create']?function(c,E){const cV=a1cq;Object[cV(0x2c1)](c,cV(0x2bf),{'enumerable':!![],'value':E});}:function(c,E){const cg=a1cq;c[cg(0x2bf)]=E;}),__importStar=this&&this[a1cq(0x2df)]||function(c){const cr=a1cq;if(c&&c[cr(0x20c)])return c;var E={};if(c!=null){for(var S in c)if(S!==cr(0x2bf)&&Object[cr(0x26e)][cr(0x28a)]['call'](c,S))__createBinding(E,c,S);}return __setModuleDefault(E,c),E;},__awaiter=this&&this[a1cq(0x2ac)]||function(c,E,S,X){function u(Y){return Y instanceof S?Y:new S(function(R){R(Y);});}return new(S||(S=Promise))(function(Y,R){const cK=a1E;function d(p){const cH=a1E;try{U(X[cH(0x274)](p));}catch(q){R(q);}}function w(p){const cf=a1E;try{U(X[cf(0x288)](p));}catch(q){R(q);}}function U(p){const cZ=a1E;p[cZ(0x243)]?Y(p['value']):u(p['value'])[cZ(0x250)](d,w);}U((X=X[cK(0x2c5)](c,E||[]))[cK(0x274)]());});},__importDefault=this&&this[a1cq(0x2bc)]||function(c){const ct=a1cq;return c&&c[ct(0x20c)]?c:{'default':c};};Object[a1cq(0x2c1)](exports,a1cq(0x20c),{'value':!![]}),exports[a1cq(0x207)]=void 0x0;const js_client_1=require(a1cq(0x2dd)),commander_1=__importDefault(require(a1cq(0x2af))),fs_1=__importDefault(require('fs')),chalk_1=__importDefault(require(a1cq(0x237))),_=__importStar(require(a1cq(0x1da))),contextCommands_1=require(a1cq(0x2d6)),utils_1=require(a1cq(0x26c)),defaults=__importStar(require(a1cq(0x2a1))),inquirer_helper_1=require('./inquirer-helper'),console_format_helpers_1=require(a1cq(0x275)),command_overview_1=require('./formatting/command-overview'),port_forward_1=require(a1cq(0x2e4)),exec_1=require('./exec'),logs_1=require(a1cq(0x2a6)),metrics_1=require(a1cq(0x21d)),copy_1=require(a1cq(0x25f)),yaml=require('js-yaml'),pgk=require('../package.json'),getProgram=c=>{const cG=a1cq,E=new commander_1['default'][(cG(0x221))](cG(0x1ea));E['description'](cG(0x1e3)),E[cG(0x2e5)](!![]),E[cG(0x2c7)]('Northflank\x20cli\x20version:\x20'+chalk_1[cG(0x2bf)][cG(0x29d)](pgk[cG(0x2c7)]),cG(0x1e9),cG(0x223));const S=new js_client_1[(cG(0x271))](c,{'throwErrorOnHttpErrorCode':![],'customUserAgent':utils_1[cG(0x213)],'agent':utils_1[cG(0x25d)]}),X=new contextCommands_1[(cG(0x1db))](S,utils_1[cG(0x25d)]),u=new port_forward_1[(cG(0x20d))](c,utils_1[cG(0x25d)]),Y=new exec_1[(cG(0x26b))](c,utils_1[cG(0x25d)]),R=new copy_1[(cG(0x268))](c,utils_1[cG(0x25d)]),d=new logs_1['CliLogs'](c,utils_1[cG(0x25d)]),w=new metrics_1[(cG(0x24f))](c,utils_1[cG(0x25d)]);return E[cG(0x2b5)](u[cG(0x276)]),E[cG(0x2b5)](Y[cG(0x209)]),E[cG(0x2b5)](R[cG(0x222)]),E[cG(0x2b5)](R[cG(0x293)]),E['addCommand'](X[cG(0x245)]),E[cG(0x2b5)](X[cG(0x22c)]),generateCommands(S,S[cG(0x2d7)],E,d,w),E[cG(0x2b5)]((0x0,command_overview_1['getCommandOverview'])(E)),E[cG(0x24c)](!![],'Display\x20help\x20for\x20command'),E[cG(0x1f9)](undefined,cG(0x258)),E;};function a1E(c,E){const S=a1c();return a1E=function(X,u){X=X-0x1d4;let Y=S[X];return Y;},a1E(c,E);}exports[a1cq(0x207)]=getProgram,((()=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const cb=a1cq;try{const c=new js_client_1[(cb(0x226))]();yield(0x0,utils_1[cb(0x2bd)])(c);const E=(0x0,exports[cb(0x207)])(c);yield E[cb(0x1ff)](process[cb(0x1ed)]);}catch(S){(0x0,utils_1[cb(0x2e6)])(cb(0x2b0)+S[cb(0x2a4)]),process[cb(0x1ed)][cb(0x295)](X=>X===cb(0x20e))&&console[cb(0x23a)](S),process[cb(0x2b1)]=0x1;}}))());function isListCommand(c){const cl=a1cq,E=[[cl(0x219),cl(0x1e8),'backups'],[cl(0x219),'job','runs']];return c[cl(0x295)](S=>S===cl(0x2e7))||E[cl(0x273)](S=>_[cl(0x2da)](c,S));}function a1c(){const cn=['pln','askForAddon','chalk','backup','InquirerHelper','log','resource','jobs','update','tpl','projectId','repository','-f,\x20--file\x20<file-path>','skipValidation','done','backupId','login','file','Update\x20Northflank\x20','askForBackupDestination','inv','isPaginatedEndpoint','force','addHelpCommand','askForJobRun','parse','CliMetrics','then','printAsTable','5225646iyWfKn','assertContextExisting','adn','delete','askForDomain','askGeneric','Display\x20help\x20for\x20command','askForBuild','page','getOwnPropertyDescriptor','pipelineId','agent','pagination','./copy','query','askForProject','Expecting\x20resource\x20input\x20with\x20\x27--input\x27\x20or\x20\x27--file\x27\x20argument','noDefaults','forEach','-i,\x20--input\x20<resource-def>','omit','branches','CliFileCopy','project','handleYamlOutput','CliExec','./utils','subdomainId','prototype','scrt','job','ApiClient','OPTIONAL:\x20','some','next','./formatting/console-format-helpers','portFwdCmd','defaults','95IBlzrO','471508iddPjI','invoice','349796ddrWZJ','1304nwboPR','handleJsonOutput','logSinkId','addons','templateRunId','VERBOSE:\x20Using\x20endpoint\x20->\x20','warning','volumes','VERBOSE:\x20Request\x20body\x20->\x20','invoices','consoleFormat','output','throw','bind','hasOwnProperty','has','quiet','Unknown\x20input\x20format.\x20Not\x20valid\x20json\x20and\x20not\x20valid\x20yaml.','stdout','entries','File\x20to\x20load\x20resource\x20json\x20from','opt','toLowerCase','uploadCmd','readFileSync','find','yaml','credential','services','backupDestinationId','restores','repos','getMetricsCommand','underline','api.','count','JSON-formatted\x20resource\x20definition,\x20takes\x20precedence\x20over\x20\x22--file\x22','./defaults','volumeId','getLogsCommand','message','askForSecret','./logs','askForClusterId','.yaml','grey','/docs/v1/api/','map','__awaiter','\x20Northflank\x20resources','asyncSequential','commander','Error\x20occured\x20while\x20trying\x20to\x20run\x20command,\x20error:\x20','exitCode','jobId','description','isArray','addCommand','safeLoad','templateId','concat','commands','isString','secretId','__importDefault','checkUpdate','credentials','default','custom-columns=','defineProperty','hasNextPage','prj','assign','apply','askForLogSink','version','name','subdomainPath','create','askForSubdomain','configurable','join','domainId','30035331GwiTNb','askForVolume','option','clusterId','askForJob',',\x20NF\x20error\x20id:\x20','Failed\x20to\x20validate\x20input\x20(incorrect\x20format):\x20','./context/contextCommands','endpoints','base','logs','isEqual','setPathVars','Get\x20information\x20about\x20Northflank\x20','@northflank/js-client','host','__importStar','keys','writable','length','startsWith','./port-forward','enablePositionalOptions','error','list','replace','proxyEnvsSet','kebabCase','paginationArgs','docsTagsPath','requiredPermissions','sort','(HTTP\x20status\x20code:\x20','lodash','CliContext','repositories','body','data','addonId','getCommand','tags','alias','Manage\x20your\x20Northflank\x20resources\x20from\x20the\x20command\x20line','getCurrentServiceName','rawResponse','repo','required','addon','-v,\x20--version','northflank','projects','resourceTagId','argv','addHelpText','__setModuleDefault','green','domains','template',',\x20-','endsWith','__createBinding','564750vKLzxn','75047NpDTTt','381069zBLCEF','helpOption','service','there\x20are\x20more\x20rows,\x20load?','serviceId','branch','includes','parseAsync','request','set','subdomain','call','Options\x20\x27loadAll\x27\x20can\x20not\x20be\x20combined\x20with\x20\x27page\x27\x20or\x20\x27cursor\x27','plans','volume','getProgram','contextProvider','execCmd','\x0a>\x20Token\x20permissions\x20required:\x20','API\x20request\x20failed\x0a\x09Message:\x20','__esModule','CliPortForward','--verbose','boolean','statusText','type','templates','customUserAgent','askForSubdomainPath','buildId','plan','loadAll','Resource\x20was\x20not\x20deleted.','get','after','pop','deleteWarningPrompt','./metrics','credentialId','cred','nonInteractiveEndpoint','Command','downloadCmd','Print\x20the\x20current\x20version\x20of\x20the\x20Northflank\x20cli','region','regions','ApiClientFileContextProvider','split','\x20properties','askForAddonBackup','yml','retrievePayloadViaInteractiveCli','contexts','toString','url','upperFirst','domain','getOwnPropertyNames','\x20--','moveCursor','path'];a1c=function(){return cn;};return a1c();}function generateCommands(c,E,S,X,u,Y=defaults[a1cq(0x277)],R=[]){const cA=a1cq,d=new inquirer_helper_1[(cA(0x239))](new js_client_1['ApiClient'](c[cA(0x208)],{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1['customUserAgent'],'agent':utils_1[cA(0x25d)]}));function w(q,B){const cI=cA;return q[cI(0x1e7)]!==![]&&B===undefined;}function P(q,B){const cT=cA,{opt:V,name:g}=q,r=V[cT(0x2bf)],H=w(V,r),f=l=>l[cT(0x2e2)]>0x1?'--'+l:'-'+l,Z=V===null||V===void 0x0?void 0x0:V[cT(0x1e2)],K=Z?_[cT(0x2b4)](Z)?'-'+(Z===null||Z===void 0x0?void 0x0:Z[cT(0x2ab)](l=>f(l))[cT(0x2cd)](cT(0x1f3)))+',':''+f(Z):'',t=H?'':cT(0x272),G=typeof V[cT(0x211)]===cT(0x20f)||V['type']===cT(0x20f)?K+cT(0x232)+g:K+cT(0x232)+g+'\x20<'+g['toUpperCase']()+'>',b=t+V[cT(0x2b3)];B[cT(0x2d1)](G,b,r);}function U(q,B){const cM=cA;if(B[cM(0x2b9)][cM(0x273)](V=>V[cM(0x2c8)]()===cM(0x2d9)))return;_[cM(0x2da)](q,['get',cM(0x1fa)])&&(B['addCommand'](X[cM(0x2a3)](cM(0x1fa))),B[cM(0x2b5)](u[cM(0x29c)](cM(0x1fa))),B[cM(0x2b5)](X[cM(0x2a3)](cM(0x1fa),!![])),B['addCommand'](u['getMetricsCommand']('service',!![]))),_[cM(0x2da)](q,['get','job'])&&(B[cM(0x2b5)](X[cM(0x2a3)](cM(0x270))),B['addCommand'](u['getMetricsCommand'](cM(0x270))),B['addCommand'](X['getLogsCommand']('job',!![])),B[cM(0x2b5)](u['getMetricsCommand'](cM(0x270),!![]))),_[cM(0x2da)](q,[cM(0x219),cM(0x1e8)])&&(B[cM(0x2b5)](X[cM(0x2a3)](cM(0x1e8))),B[cM(0x2b5)](u[cM(0x29c)]('addon'))),_[cM(0x2da)](q,[cM(0x219),cM(0x1e8),cM(0x238)])&&B[cM(0x2b5)](X['getLogsCommand'](cM(0x1e8),![],!![])),_[cM(0x2da)](q,[cM(0x219),cM(0x1e8),cM(0x29a)])&&B[cM(0x2b5)](X['getLogsCommand'](cM(0x1e8),![],!![],!![]));}return Object[cA(0x231)](Y)[cA(0x264)](q=>{const cm=cA,B=E[q],V=Y[q],g=R[cm(0x2b8)]([q]);function r(I,T){const cN=cm,M=Object['getOwnPropertyNames'](I||{});M[cN(0x2ab)](m=>{return{'name':m,'opt':I[m]};})[cN(0x1d8)]((m,N)=>!w(m[cN(0x291)])?!w(N[cN(0x291)])?0x0:0x1:-0x1)[cN(0x264)](m=>{P(m,T);});}function H(I,T){const cz=cm,M=[[cz(0x269),cz(0x1eb),cz(0x2c3)],[cz(0x1fa),cz(0x298),'svc'],[cz(0x2be),cz(0x297),cz(0x21f)],[cz(0x1e8),cz(0x27f),cz(0x254)],[cz(0x270),cz(0x23c)],[cz(0x216),cz(0x205),cz(0x235)],[cz(0x224),cz(0x225),'rgn'],[cz(0x230),cz(0x1f1),'dmn'],['secret','secrets',cz(0x26f)],[cz(0x283),cz(0x206),'vol'],[cz(0x267),cz(0x1fd),'brn'],[cz(0x27a),cz(0x285),cz(0x249)],[cz(0x1f2),cz(0x212),cz(0x23e)],[cz(0x29b),cz(0x240),cz(0x1dc),cz(0x1e6)],['backup-destination','backup-destinations'],['tag',cz(0x1e1)]],m=M[cz(0x295)](N=>N[cz(0x1fe)](T));if(m!==undefined)I['aliases'](m['filter'](N=>N!==T));}function f(I){var T,M;return __awaiter(this,void 0x0,void 0x0,function*(){const cJ=a1E,m={},{contextProvider:N}=c,z=g[cJ(0x1fe)]('delete'),J=I[cJ(0x263)]===!![];function O(C,k,o){var y,e;return __awaiter(this,void 0x0,void 0x0,function*(){const cO=a1E;if(_[cO(0x28b)]((e=(y=V['opt'])===null||y===void 0x0?void 0x0:y['path'])!==null&&e!==void 0x0?e:{},C)){const D=!J&&!z&&o?o():undefined,x=I[C]||D||(yield k());_[cO(0x201)](m,C,x);}});}return yield(0x0,utils_1['asyncSequential'])(Object[cJ(0x28f)]((M=(T=V[cJ(0x291)])===null||T===void 0x0?void 0x0:T[cJ(0x234)])!==null&&M!==void 0x0?M:{}),([C,k])=>__awaiter(this,void 0x0,void 0x0,function*(){const cC=cJ;var o;const y=m===null||m===void 0x0?void 0x0:m['projectId'],e=m===null||m===void 0x0?void 0x0:m[cC(0x2b7)];switch(C){case cC(0x23f):return yield O('projectId',d[cC(0x261)][cC(0x289)](d),N['getCurrentProjectName'][cC(0x289)](N));case'serviceId':return yield O(cC(0x1fc),d['askForService'](y)[cC(0x289)](d),N[cC(0x1e4)][cC(0x289)](N));case cC(0x1df):return yield O(cC(0x1df),d[cC(0x236)](y)['bind'](d));case cC(0x2b2):return yield O(cC(0x2b2),d[cC(0x2d3)](y)[cC(0x289)](d),N['getCurrentJobName'][cC(0x289)](N));case'runId':return yield O('runId',d[cC(0x24d)](m[cC(0x2b2)],y,![])['bind'](d));case cC(0x2bb):return yield O('secretId',d[cC(0x2a5)](y)[cC(0x289)](d));case cC(0x230):case'domainId':return yield O('domain',d[cC(0x256)]['bind'](d));case cC(0x21e):return yield O(cC(0x21e),d['askForCredentials'][cC(0x289)](d));case'volumeId':return yield O(cC(0x2a2),d[cC(0x2d0)](y)[cC(0x289)](d));case cC(0x202):return yield O(cC(0x202),d[cC(0x2cb)](m['domain'])['bind'](d));case cC(0x26d):return yield O(cC(0x26d),d['askForSubdomain'](m[cC(0x2ce)])['bind'](d));case'subdomainPath':return yield O(cC(0x2c9),d[cC(0x214)](m[cC(0x230)],(o=m[cC(0x202)])!==null&&o!==void 0x0?o:m[cC(0x26d)])[cC(0x289)](d));case cC(0x244):return yield O(cC(0x244),d[cC(0x229)](y,m[cC(0x1df)])[cC(0x289)](d));case cC(0x215):return yield O(cC(0x215),d[cC(0x259)](y,m[cC(0x1fc)],m['jobId'])[cC(0x289)](d));case cC(0x2b7):return yield O(cC(0x2b7),d['askForTemplate']()[cC(0x289)](d));case'templateRunId':return yield O(cC(0x280),d['askForTemplateRun'](e)[cC(0x289)](d));case'logSinkId':return yield O(cC(0x27e),d[cC(0x2c6)]()[cC(0x289)](d));case'pipelineId':return yield O(cC(0x25c),d['askForPipeline'](y)['bind'](d));case cC(0x1ec):return yield O(cC(0x1ec),d['askForTag']()['bind'](d));case cC(0x299):return yield O(cC(0x299),d[cC(0x248)]()[cC(0x289)](d));case cC(0x2d2):return yield O(cC(0x2d2),d[cC(0x2a7)]()[cC(0x289)](d));default:return yield O(C,d[cC(0x257)](C,k===null||k===void 0x0?void 0x0:k['description'])[cC(0x289)](d));}})),m;});}function Z(I){var T,M,m;return __awaiter(this,void 0x0,void 0x0,function*(){const ck=a1E,N={},z=((T=V[ck(0x291)])===null||T===void 0x0?void 0x0:T[ck(0x24a)])?defaults['paginationArgs']:{},J=Object[ck(0x2c4)](Object[ck(0x2c4)]({},(m=(M=V[ck(0x291)])===null||M===void 0x0?void 0x0:M[ck(0x260)])!==null&&m!==void 0x0?m:{}),z),O=Object[ck(0x2e0)](J)['filter'](C=>C!==ck(0x217));return yield(0x0,utils_1[ck(0x2ae)])(O,C=>__awaiter(this,void 0x0,void 0x0,function*(){const co=ck;if(I[C]!==undefined)return _[co(0x201)](N,C,I[C]);})),N;});}function K(){const cy=cm;switch(g[0x0]){case cy(0x219):return cy(0x2dc)+(g[0x1]||cy(0x23b))+'s';case cy(0x23d):return cy(0x247)+(g[0x1]||cy(0x23b))+cy(0x228);default:return _[cy(0x22f)](q)+cy(0x2ad);}}function t(I,T){const ce=cm;var M,m,N,z,J,O,C,k;if(!T){const j=(0x0,utils_1[ce(0x1e0)])()[ce(0x2c8)](_['kebabCase'](q))['description'](K());return H(j,q),j;}const o=(I===null||I===void 0x0?void 0x0:I[ce(0x1d7)])?chalk_1[ce(0x2bf)][ce(0x2a9)](ce(0x20a)+I[ce(0x1d7)]):'',y=c[ce(0x208)]['getCurrentContext'](),e=y!==undefined&&((M=V===null||V===void 0x0?void 0x0:V[ce(0x291)])===null||M===void 0x0?void 0x0:M['docsTagsPath'])!==undefined,D=y===null||y===void 0x0?void 0x0:y[ce(0x2de)][ce(0x2e8)](ce(0x29e),''),x=e?'Documentation:\x20'+D+ce(0x2aa)+((m=V===null||V===void 0x0?void 0x0:V[ce(0x291)])===null||m===void 0x0?void 0x0:m[ce(0x1d6)]):'',h=(I===null||I===void 0x0?void 0x0:I[ce(0x2b3)])||'',n=(0x0,utils_1[ce(0x1e0)])(!![])[ce(0x2c8)](_[ce(0x1d4)](q))[ce(0x2b3)](h)[ce(0x1ee)](ce(0x21a),[o,x][ce(0x2cd)]('\x0a'));H(n,q);(((N=V[ce(0x291)])===null||N===void 0x0?void 0x0:N[ce(0x1dd)])||((z=V['opt'])===null||z===void 0x0?void 0x0:z['nonInteractiveEndpoint']))&&(n[ce(0x2d1)](ce(0x241),ce(0x290)),n[ce(0x2d1)](ce(0x265),ce(0x2a0)));r((J=V[ce(0x291)])===null||J===void 0x0?void 0x0:J[ce(0x234)],n),r((O=V['opt'])===null||O===void 0x0?void 0x0:O['query'],n);const s=(C=V[ce(0x291)])===null||C===void 0x0?void 0x0:C['isPaginatedEndpoint'];return s&&r(defaults[ce(0x1d5)],n),r((k=V[ce(0x291)])===null||k===void 0x0?void 0x0:k[ce(0x2d8)],n),n['action'](()=>__awaiter(this,void 0x0,void 0x0,function*(){const cD=ce;var a,Q,L,W,F,i;(0x0,utils_1[cD(0x253)])(c);const v=n['opts']();(v===null||v===void 0x0?void 0x0:v['verbose'])&&utils_1[cD(0x2e9)]&&(0x0,utils_1[cD(0x282)])('VERBOSE:\x20HTTP_PROXY\x20or\x20HTTPS_PROXY\x20environment\x20variable\x20set:\x20tunnelling\x20traffic\x20through\x20HTTP\x20proxy.');const c0=v[cD(0x25a)]!==undefined||v['cursor']!==undefined;if(v[cD(0x217)]===!![]&&c0)throw new Error(cD(0x204));const c1=v===null||v===void 0x0?void 0x0:v[cD(0x287)],c2=c1==='json',c3=c1==='yaml'||c1===cD(0x22a),c4=yield f(v);d[cD(0x2db)](c4);const c5=yield Z(v),c6=Object['keys']((Q=(a=V[cD(0x291)])===null||a===void 0x0?void 0x0:a[cD(0x234)])!==null&&Q!==void 0x0?Q:{})[cD(0x2ab)](cE=>cE+'='+chalk_1[cD(0x2bf)][cD(0x1f0)](c4[cE]))[cD(0x2cd)](',\x20');if(c6[cD(0x2e2)]>0x0&&!c2&&!c3){const cE='=>\x20running\x20command\x20with:\x20'+c6;console[cD(0x23a)](cE);}const c7=((L=V[cD(0x291)])===null||L===void 0x0?void 0x0:L[cD(0x1dd)])||((W=V[cD(0x291)])===null||W===void 0x0?void 0x0:W[cD(0x220)])?yield p(v,V,g):undefined;if(!v[cD(0x24b)]&&g['includes'](cD(0x255))&&!(yield d[cD(0x21c)]())){(0x0,utils_1[cD(0x282)])(cD(0x218));return;}const c8=s&&(v[cD(0x217)]||(v[cD(0x287)]==='json'||v[cD(0x287)]===cD(0x296))&&!c0);let c9=c8&&B instanceof js_client_1['GetApiEndpointPaginated']?yield B['all']({'parameters':c4,'options':c5,'data':c7}):yield B[cD(0x203)]({'parameters':c4,'options':Object[cD(0x2c4)]({},c5),'data':c7});if(v===null||v===void 0x0?void 0x0:v['verbose']){const cS=c9[cD(0x200)];console[cD(0x23a)](cD(0x281)+cS['method']['toUpperCase']()+':'+cS[cD(0x22e)]);if(c7!==undefined)console[cD(0x23a)](cD(0x284)+c7);}if(c9['error']){const {details:cX,id:cu,message:cY,status:cR}=c9['error'],cd=cX?'\x0a\x09details\x20:'+JSON['stringify'](cX):'',cw=cu?cD(0x2d4)+cu:'',cP=cD(0x1d9)+cR+cw+')';throw new Error(cD(0x20b)+cY+'\x20'+cP+cd);}let cc=0x0;printCallResult(v,c2,c9[cD(0x1de)],c3,g,c1,![],cc,c9['rawResponse'][cD(0x210)]);if(!v[cD(0x28c)]&&!c8&&!c0&&((F=c9[cD(0x25e)])===null||F===void 0x0?void 0x0:F[cD(0x2c2)]))while((i=c9[cD(0x25e)])===null||i===void 0x0?void 0x0:i[cD(0x2c2)]){const cU=yield d['askConfirm'](cD(0x1fb));if(cU)process[cD(0x28e)][cD(0x233)](0x0,-0x1),process[cD(0x28e)]['clearLine'](0x1),cc+=c9[cD(0x25e)][cD(0x29f)],c9=yield c9[cD(0x25e)]['getNextPage'](),printCallResult(v,c2,c9['data'],c3,g,c1,!![],cc,c9[cD(0x1e5)]['statusText']);else return;}})),n;}const G=_[cm(0x28b)](V,cm(0x291)),b=B,l=t(b,G);U(g,l),S[cm(0x2b5)](l);const A=_[cm(0x266)](V,cm(0x291));Object['keys'](A)[cm(0x2e2)]>0x0&&generateCommands(c,B,l,X,u,A,g);});function p(q,B,V){var g;return __awaiter(this,void 0x0,void 0x0,function*(){const cx=a1E,{input:r,file:H}=q;if(r!==undefined)try{return JSON[cx(0x24e)](r);}catch(f){try{return yaml[cx(0x2b6)](r);}catch(Z){throw new Error(cx(0x28d));}}if(H!==undefined){if(!fs_1[cx(0x2bf)]['existsSync'](H))throw new Error('File\x20does\x20not\x20exist:\x20'+H);const K=fs_1[cx(0x2bf)][cx(0x294)](H)[cx(0x22d)]();let t;try{if(_[cx(0x2ba)](K)){if(q[cx(0x246)]['endsWith']('.json'))t=JSON[cx(0x24e)](K);else{if(q['file'][cx(0x1f4)](cx(0x2a8))||q[cx(0x246)][cx(0x1f4)]('yml'))t=yaml['safeLoad'](K);else throw new Error('Unknown\x20input\x20file\x20type:\x20'+q['file'][cx(0x227)]('.')[cx(0x21b)]());}}else t=K;return t;}catch(G){throw new Error(cx(0x2d5)+G[cx(0x2a4)]);}}if((g=B===null||B===void 0x0?void 0x0:B[cx(0x291)])===null||g===void 0x0?void 0x0:g[cx(0x220)])throw new Error(cx(0x262));return yield d[cx(0x22b)](B,{'cmdPath':V,'skipValidation':q[cx(0x242)]});});}}const printCallResult=(c,E,S,X,u,Y,R,d,w)=>{const ch=a1cq;if(!(c===null||c===void 0x0?void 0x0:c[ch(0x28c)])){if(E)(0x0,console_format_helpers_1[ch(0x27d)])(c===null||c===void 0x0?void 0x0:c['output'],S);else{if(X)(0x0,console_format_helpers_1[ch(0x26a)])(c===null||c===void 0x0?void 0x0:c[ch(0x287)],S);else{if(isListCommand(u)){const P=(Y===null||Y===void 0x0?void 0x0:Y[ch(0x2e3)](ch(0x2c0)))?Y['replace'](ch(0x2c0),'')[ch(0x227)](',')[ch(0x2ab)](V=>V[ch(0x292)]()):undefined,U=u[u['length']-0x1],p=''+U+(U['endsWith']('s')?'':'s'),q=_[ch(0x22f)](p),B=_['has'](S,p)?S[p]:S;(0x0,console_format_helpers_1[ch(0x251)])(B,q,P,R,d);}else console[ch(0x23a)]((0x0,console_format_helpers_1[ch(0x286)])(S,w));}}}};
@@ -1 +1 @@
1
- 'use strict';const a2m=a2v;(function(T,v){const A=a2v,W=T();while(!![]){try{const l=-parseInt(A(0xb6))/0x1+-parseInt(A(0xd0))/0x2*(-parseInt(A(0xbb))/0x3)+-parseInt(A(0xd3))/0x4+-parseInt(A(0xc6))/0x5+parseInt(A(0x107))/0x6*(-parseInt(A(0xe2))/0x7)+parseInt(A(0x111))/0x8+parseInt(A(0x10e))/0x9*(parseInt(A(0xc0))/0xa);if(l===v)break;else W['push'](W['shift']());}catch(N){W['push'](W['shift']());}}}(a2T,0xba0d7));function a2v(T,v){const W=a2T();return a2v=function(l,N){l=l-0x84;let y=W[l];return y;},a2v(T,v);}function a2T(){const T0=['chalk','apply','job','https://api.northflank.com','Display\x20full\x20URL\x20to\x20allow\x20opening\x20the\x20link\x20manually','askForContext','16062gczLKp','host\x20url\x20for\x20this\x20context','stdout','Change\x20the\x20default\x20job\x20in\x20the\x20current\x20local\x20context','service','https://','useServiceId','27pgDELw','message','__esModule','9828176bafZet','/v1/login','alias','useContext','login','Use\x20browser\x20login\x20but\x20only\x20print\x20URL\x20which\x20can\x20be\x20used\x20to\x20login','autologin-','all','defineProperty','contexts','getProjectName','next','ProxyAgent','get','contextProvider','option','\x20(current)','sessionToken=********','.\x20Using\x20fallback.','Use\x20service\x20with\x20id:','printAsTable','__importDefault','catch','getCurrentProjectName','Name\x20for\x20login\x20context','throw','defaultBaseUrl','Local\x20context\x20name\x20to\x20remove.','--host\x20[HOST]','getCurrentContext','getCommand','getCurrentName','lodash','--do-not-open-browser','valueOf','__createBinding','retry','use','inquirer','clearLine','description','removeContext','done','Choose\x20the\x20context\x20to\x20','browser\x20login','Token\x20for\x20this\x20context','Failed\x20to\x20login\x20with\x20the\x20provided\x20token,\x20make\x20sure\x20to\x20use\x20a\x20valid\x20token\x20and\x20host.','\x20(api\x20host:\x20','value','-n,\x20--name\x20[NAME]','project','__setModuleDefault','getOwnPropertyDescriptor','length','\x27\x20successfully\x20updated.','useProjectId','No\x20project\x20in\x20current\x20context.\x20Please\x20set\x20project\x20before\x20setting\x20a\x20project-scoped\x20resource','fullUrl','No\x20context\x20available.\x20Use\x20\x27northflank\x20login\x27\x20to\x20create\x20context.','Change\x20current\x20context\x20to\x20context\x20identified\x20by\x20this\x20name','tokenLogin','\x0aSuccessfully\x20logged\x20in\x20using\x20','InquirerHelper','loginPrompt','startLogin','Changed\x20current\x20context\x20to\x20','List\x20all\x20available\x20contexts','1425374TknCBm','Token\x20for\x20current\x20context\x20\x27','__awaiter','remove','\x27\x20successfully\x20removed.','3zGhuCo','-t,\x20--token\x20[TOKEN]','update-token','log','context','6404590YcVYZo','Override\x20existing\x20contexts\x20(this\x20will\x20remove\x20project\x20and\x20service\x20context)','Shows\x20full\x20context\x20information\x20(including\x20tokens)','create','Open\x20this\x20URL\x20in\x20your\x20browser\x20and\x20follow\x20the\x20steps:\x0a\x09','getCurrentToken','2166525gMnLOy',',\x20added\x20context\x20with\x20name\x20','list','-i,\x20--id\x20[ID]','configurable','Connect\x20the\x20CLI\x20to\x20your\x20Northflank\x20account.','name','override','tokenPrompt','italic','2028524kcgZze','--override','close','2993368mcWTyL','call','sort','CliContext','getCurrentBaseUrl','NorthflankApiBrowserLogin','apiTokenLogin','success','Local\x20context\x20\x27','sanitiseHostname','../utils','Token\x20for\x20this\x20context.\x20When\x20set,\x20browser\x20login\x20is\x20not\x20used','getInfo','Update\x20token\x20for\x20current\x20context','test','2079IpJsci','error','host','proxy-agent','then','hasOwnProperty','useJobId','addContext','Contexts','addCommand','--token-login','browserLogin','ctx','Failed\x20to\x20login\x20with\x20the\x20provided\x20token.\x20Token\x20was\x20not\x20changed','action','contextAvailable','search-list','default','verifyToken','token','map','../inquirer-helper','set-token','prototype','Use\x20job\x20with\x20id:','Change\x20the\x20default\x20project\x20in\x20the\x20current\x20local\x20context','prompt','loadContextWrapper','use\x20from\x20now\x20on','apiClient','dir'];a2T=function(){return T0;};return a2T();}var __createBinding=this&&this[a2m(0x96)]||(Object[a2m(0xc3)]?function(T,v,W,l){const g=a2m;if(l===undefined)l=W;var N=Object[g(0xa7)](v,W);(!N||(g(0x11e)in N?!v[g(0x110)]:N['writable']||N[g(0xca)]))&&(N={'enumerable':!![],'get':function(){return v[W];}}),Object[g(0x119)](T,l,N);}:function(T,v,W,l){if(l===undefined)l=W;T[l]=v[W];}),__setModuleDefault=this&&this[a2m(0xa6)]||(Object[a2m(0xc3)]?function(T,W){const F=a2m;Object[F(0x119)](T,F(0xf3),{'enumerable':!![],'value':W});}:function(T,W){const K=a2m;T[K(0xf3)]=W;}),__importStar=this&&this['__importStar']||function(T){const t=a2m;if(T&&T['__esModule'])return T;var v={};if(T!=null){for(var W in T)if(W!==t(0xf3)&&Object[t(0xf9)][t(0xe7)][t(0xd4)](T,W))__createBinding(v,T,W);}return __setModuleDefault(v,T),v;},__awaiter=this&&this[a2m(0xb8)]||function(T,v,W,l){function N(y){return y instanceof W?y:new W(function(D){D(y);});}return new(W||(W=Promise))(function(y,D){const z=a2v;function w(U){const C=a2v;try{I(l[C(0x11c)](U));}catch(k){D(k);}}function e(U){const b=a2v;try{I(l[b(0x8c)](U));}catch(k){D(k);}}function I(U){const P=a2v;U[P(0x9d)]?y(U['value']):N(U[P(0xa3)])[P(0xe6)](w,e);}I((l=l[z(0x102)](T,v||[]))['next']());});},__importDefault=this&&this[a2m(0x88)]||function(T){const c=a2m;return T&&T[c(0x110)]?T:{'default':T};};Object['defineProperty'](exports,a2m(0x110),{'value':!![]}),exports[a2m(0xd6)]=void 0x0;const _=__importStar(require(a2m(0x93))),proxy_agent_1=require(a2m(0xe5)),chalk_1=__importDefault(require(a2m(0x101))),utils_1=require(a2m(0xdd)),inquirer_helper_1=require(a2m(0xf7)),console_format_helpers_1=require('../formatting/console-format-helpers'),browser_login_1=require('../login/browser-login'),inquirer=require(a2m(0x99));class CliContext{constructor(T,v=a2m(0x104)){const O=a2m;this['defaultBaseUrl']=v,this[O(0xdc)]=k=>{const J=O;let x=k;return!/^https?:\/\//i[J(0xe1)](x)&&(x=J(0x10c)+x),x=x['replace'](/\/+$/,''),x;},this[O(0xff)]=T;const W=new inquirer_helper_1[(O(0xb1))](T);this['login']=(0x0,utils_1[O(0x91)])()[O(0xcc)](O(0x115))[O(0x9b)](O(0xcb))[O(0x120)](O(0xec),'Use\x20manual\x20login\x20with\x20API\x20token',![])[O(0x120)](O(0x94),O(0x116),![])[O(0x120)](O(0xa4),O(0x8b))[O(0x120)](O(0xbc),O(0xde))[O(0x120)](O(0x8f),O(0x108),this[O(0x8d)])['option'](O(0xd1),O(0xc1),![])[O(0xf0)](k=>__awaiter(this,void 0x0,void 0x0,function*(){const S=O;_['set'](k,'host',this['sanitiseHostname'](k[S(0xe4)]));const x=k[S(0xaf)]||k[S(0xf5)]!==undefined,{name:B,host:o,token:s,override:Y}=x?yield this[S(0xd9)](k,W):yield this['browserLogin'](k,W);try{yield this[S(0xff)][S(0x11f)][S(0xe9)]({'name':B,'host':o,'token':s},Y);}catch(a){(0x0,utils_1[S(0xe3)])(a['message']);return;}if(!(yield this['verifyToken']()))(0x0,utils_1['error'])(S(0xa1)),yield this[S(0xff)]['contextProvider']['removeContext'](B);else{const G=x?'token\x20login':S(0x9f),H=S(0xb0)+G+S(0xc7)+chalk_1['default'][S(0xcf)](B)+S(0xa2)+o+')';(0x0,utils_1['success'])(H);}})),this[O(0x11a)]=(0x0,utils_1[O(0x91)])()[O(0xcc)](O(0xbf))[O(0x9b)]('Retrieve\x20and\x20update\x20local\x20context\x20settings.')[O(0x113)](O(0x11a))[O(0x113)](O(0xee));const l=(0x0,utils_1['getCommand'])()[O(0xcc)](O(0xc8))[O(0xcc)]('ls')[O(0x9b)](O(0xb5))[O(0x120)]('--all',O(0xc2))[O(0xf0)](k=>__awaiter(this,void 0x0,void 0x0,function*(){const d=O;console[d(0xbe)](T[d(0x11f)][d(0xdf)]());const x=T[d(0x11f)][d(0xfd)]();if(k[d(0x118)]===!![]){console[d(0x100)](x);return;}const B=x['current'],o=x[d(0x11a)][d(0xd5)]((s,Y)=>s[d(0xcc)]===B?-0x1:Y['name']===B?0x1:0x0)[d(0xf6)](s=>{const h=d,Y=B===s[h(0xcc)]?h(0x121):'';return{'Name':''+s['name']+Y,'Host':s[h(0xe4)],'Default\x20Project':s[h(0xa5)]||'-','Default\x20Service':s[h(0x10b)]||'-'};});(0x0,console_format_helpers_1[d(0x87)])(o,d(0xea));})),N=(0x0,utils_1[O(0x91)])();N[O(0xcc)](O(0x98))['description']('Switch\x20between\x20your\x20local\x20contexts')[O(0x120)](O(0xa4),O(0xae))[O(0xf0)](k=>__awaiter(this,void 0x0,void 0x0,function*(){const E=O,x=(k===null||k===void 0x0?void 0x0:k[E(0xcc)])||(yield this[E(0x106)](E(0x98)));yield this[E(0xff)][E(0x11f)]['useContext'](x),(0x0,utils_1[E(0xda)])(E(0xb4)+x);}));const y=O(0xc9),D=(0x0,utils_1[O(0x91)])()[O(0xcc)](O(0xa5))[O(0x9b)](O(0xfb))['option'](y,'Project\x20name\x20(internal\x20id)\x20to\x20use\x20as\x20default\x20in\x20context')[O(0xf0)](k=>__awaiter(this,void 0x0,void 0x0,function*(){const i=O,x=(k===null||k===void 0x0?void 0x0:k['id'])||(yield W['askForProject']());yield this['apiClient'][i(0x11f)][i(0xaa)](x),console[i(0xbe)]('Use\x20project\x20with\x20id:',x);})),w=(0x0,utils_1['getCommand'])()[O(0xcc)](O(0x10b))[O(0x9b)]('Change\x20the\x20default\x20service\x20in\x20the\x20current\x20local\x20context')[O(0x120)](y,'Service\x20name\x20(internal\x20id)\x20to\x20use\x20as\x20default\x20in\x20context')[O(0xf0)](k=>__awaiter(this,void 0x0,void 0x0,function*(){const M=O,x=(k===null||k===void 0x0?void 0x0:k['id'])||(yield W['askForService'](this[M(0x11b)]())());console[M(0xbe)](M(0x86),x),yield this[M(0xff)][M(0x11f)][M(0x10d)](x);})),e=(0x0,utils_1[O(0x91)])()[O(0xcc)](O(0x103))[O(0x9b)](O(0x10a))[O(0x120)](y,'Job\x20name\x20(internal\x20id)\x20to\x20use\x20as\x20default\x20in\x20context')['action'](k=>__awaiter(this,void 0x0,void 0x0,function*(){const p=O,x=(k===null||k===void 0x0?void 0x0:k['id'])||(yield W['askForJob'](this[p(0x11b)]())());console[p(0xbe)](p(0xfa),x),yield this['apiClient'][p(0x11f)][p(0xe8)](x);}));N[O(0xeb)](D),N['addCommand'](e),N[O(0xeb)](w);const I=(0x0,utils_1['getCommand'])()[O(0xcc)]('remove')['alias']('delete')[O(0x113)]('rm')[O(0x9b)]('Remove\x20a\x20context')[O(0x120)](y,O(0x8e))[O(0xf0)](k=>__awaiter(this,void 0x0,void 0x0,function*(){const Z=O;var x;const B=(k===null||k===void 0x0?void 0x0:k['id'])||(yield this[Z(0x106)](Z(0xb9))),o=(x=this[Z(0xff)][Z(0x11f)][Z(0x90)]())===null||x===void 0x0?void 0x0:x[Z(0xcc)];yield this['apiClient'][Z(0x11f)][Z(0x9c)](B),(0x0,utils_1[Z(0xda)])(Z(0xdb)+B+Z(0xba));if(!this[Z(0xf1)]()){(0x0,utils_1['warning'])(Z(0xad));return;}if(o===B){const s=(k===null||k===void 0x0?void 0x0:k[Z(0xcc)])||(yield this[Z(0x106)](Z(0xfe)));yield this[Z(0xff)][Z(0x11f)][Z(0x114)](s),(0x0,utils_1[Z(0xda)])(Z(0xb4)+s);}})),U=(0x0,utils_1[O(0x91)])()[O(0xcc)](O(0xbd))[O(0x113)](O(0xf8))[O(0x9b)](O(0xe0))[O(0x120)]('-t,\x20--token\x20[TOKEN]',O(0xa0))[O(0xf0)](k=>__awaiter(this,void 0x0,void 0x0,function*(){const r=O,{contextProvider:x}=this['apiClient'],B=(k===null||k===void 0x0?void 0x0:k[r(0xf5)])||(yield W[r(0xce)]()),o=x['getCurrentToken']();yield x['updateToken'](B);if(yield this['verifyToken']())(0x0,utils_1[r(0xda)])(r(0xb7)+x[r(0x92)]()+r(0xa9));else{if(o)yield x['updateToken'](o);(0x0,utils_1[r(0xe3)])(r(0xef));}}));this[O(0x11a)]['addCommand'](l),this[O(0x11a)][O(0xeb)](N),this[O(0x11a)][O(0xeb)](I),this[O(0x11a)][O(0xeb)](U);}[a2m(0xed)](T,v){var W,l,N,y;return __awaiter(this,void 0x0,void 0x0,function*(){const R=a2v,D=!T['doNotOpenBrowser'],w=(W=T[R(0xe4)])!==null&&W!==void 0x0?W:this['defaultBaseUrl'],e=new browser_login_1[(R(0xd8))](w,D);let I;e['on']('browser-opened',({url:B})=>{const f=R;if(D){const o=B['replace'](/sessionToken=.*/,f(0x84));console[f(0xbe)]('Follow\x20the\x20steps\x20displayed\x20on\x20the\x20page\x20opened\x20in\x20the\x20browser\x20(URL\x20opened:\x20'+o+')'),I=inquirer[f(0xfc)]([{'type':'confirm','name':f(0xac),'message':f(0x105),'default':![]}]),I[f(0xe6)](s=>{const X=f;process[X(0x109)]['moveCursor'](0x0,-0x1),process[X(0x109)][X(0x9a)](0x1),s['fullUrl']&&console[X(0xbe)](X(0xc4)+B+'\x20');});}else console['log'](f(0xc4)+B+'\x20');});const {token:U,contextName:k}=yield e[R(0xb3)]()[R(0x89)](B=>__awaiter(this,void 0x0,void 0x0,function*(){const V=R;(0x0,utils_1[V(0xe3)])('Error\x20occured\x20during\x20browser\x20login:\x20'+B[V(0x10f)]+V(0x85));const o=yield this[V(0xd9)](T,v);return{'token':o[V(0xf5)],'contextName':o[V(0xcc)]};}))['finally'](()=>{const n=R;if(I)I['ui'][n(0xd2)]();}),x=(N=(l=T[R(0xcc)])!==null&&l!==void 0x0?l:k)!==null&&N!==void 0x0?N:R(0x117)+new Date()[R(0x95)]();return{'name':x,'token':U,'host':w,'override':(y=T[R(0xcd)])!==null&&y!==void 0x0?y:![]};});}[a2m(0xd9)](T,v){return __awaiter(this,void 0x0,void 0x0,function*(){const Q=a2v,W=this[Q(0xff)][Q(0x11f)][Q(0xfd)]()[Q(0x11a)],{name:l,token:N,host:y,override:D}=yield v[Q(0xb2)](T,W);return{'name':l,'token':N,'host':y,'override':D};});}['getProjectName'](){const j=a2m,T=this[j(0xff)][j(0x11f)][j(0x8a)]();if(T===undefined)throw new Error(j(0xab));return T;}[a2m(0x106)](T){return __awaiter(this,void 0x0,void 0x0,function*(){const u=a2v;if(!this[u(0xf1)]())throw new Error('No\x20context\x20available.\x20Please\x20use\x20\x27northflank\x20login\x27\x20to\x20create\x20context.');const v=this[u(0xff)][u(0x11f)]['loadContextWrapper']()[u(0x11a)][u(0xf6)](l=>l['name']),W=v['length']>0x4?u(0xf2):u(0xc8);return(yield inquirer['prompt']([{'type':W,'name':u(0xcc),'message':u(0x9e)+T+':','choices':v}]))[u(0xcc)];});}[a2m(0xf1)](){const q=a2m;return this['apiClient'][q(0x11f)][q(0xfd)]()[q(0x11a)][q(0xa8)]>0x0;}[a2m(0xf4)](){return __awaiter(this,void 0x0,void 0x0,function*(){const L=a2v;try{const T=this[L(0xff)][L(0x11f)][L(0xd7)](),v=this[L(0xff)][L(0x11f)][L(0xc5)](),W=T+L(0x112),l={'Authorization':'Bearer\x20'+v},N=new proxy_agent_1[(L(0x11d))](),y=yield(0x0,utils_1[L(0x97)])(0x3)(()=>__awaiter(this,void 0x0,void 0x0,function*(){return(0x0,utils_1['fetch'])(W,{'method':'GET','signal':AbortSignal['timeout'](0xbb8),'headers':l,'agent':N});}));if(y['ok'])return!![];return![];}catch(D){return![];}});}}exports[a2m(0xd6)]=CliContext;
1
+ 'use strict';function a2c(){const c0=['\x27\x20successfully\x20updated.','clearLine','host\x20url\x20for\x20this\x20context','../inquirer-helper','Use\x20manual\x20login\x20with\x20API\x20token','remove','7zwyNXd','1JYfyjB','getCommand','token\x20login','override','call','prompt','set-token','browser\x20login','get','No\x20project\x20in\x20current\x20context.\x20Please\x20set\x20project\x20before\x20setting\x20a\x20project-scoped\x20resource','host','Contexts','use\x20from\x20now\x20on','loginPrompt','error','description','NorthflankApiBrowserLogin','defaultBaseUrl','use','default','171004yJVxFb','contextAvailable','__createBinding','apply','stdout','startLogin','set','Name\x20for\x20login\x20context','updateToken','Change\x20the\x20default\x20project\x20in\x20the\x20current\x20local\x20context','action','/v1/login','4548112dttvrU','\x20(api\x20host:\x20','22074237KLJJwd','Local\x20context\x20\x27','getCurrentBaseUrl','italic','fullUrl','../utils','Error\x20occured\x20during\x20browser\x20login:\x20','valueOf','map','Failed\x20to\x20login\x20with\x20the\x20provided\x20token.\x20Token\x20was\x20not\x20changed','askForContext','context','https://','done','verifyToken','delete','--override','-i,\x20--id\x20[ID]','6348240opfBGv','hasOwnProperty','sessionToken=********','chalk','warning','useJobId','success','tokenLogin','next','getOwnPropertyDescriptor','\x0aSuccessfully\x20logged\x20in\x20using\x20','getCurrentName','printAsTable','replace','agent','Change\x20current\x20context\x20to\x20context\x20identified\x20by\x20this\x20name','token','list','addContext','getCurrentContext','2581050DFvlnU','Failed\x20to\x20login\x20with\x20the\x20provided\x20token,\x20make\x20sure\x20to\x20use\x20a\x20valid\x20token\x20and\x20host.','apiTokenLogin','Use\x20browser\x20login\x20but\x20only\x20print\x20URL\x20which\x20can\x20be\x20used\x20to\x20login','defineProperty','job','-n,\x20--name\x20[NAME]','then','catch','update-token','Follow\x20the\x20steps\x20displayed\x20on\x20the\x20page\x20opened\x20in\x20the\x20browser\x20(URL\x20opened:\x20','Use\x20service\x20with\x20id:','tokenPrompt','Change\x20the\x20default\x20service\x20in\x20the\x20current\x20local\x20context','getCurrentToken','sanitiseHostname','__importStar','proxy-agent','addCommand','project','askForService','log','apiClient','retry','Change\x20the\x20default\x20job\x20in\x20the\x20current\x20local\x20context','../formatting/console-format-helpers','getProjectName','getInfo','prototype','Project\x20name\x20(internal\x20id)\x20to\x20use\x20as\x20default\x20in\x20context','--token-login','List\x20all\x20available\x20contexts','configurable','Switch\x20between\x20your\x20local\x20contexts','3012948XwKHUP','__esModule','ProxyAgent','create','length','\x27\x20successfully\x20removed.','GET','Update\x20token\x20for\x20current\x20context','autologin-','__importDefault','Use\x20job\x20with\x20id:','useContext','message','browserLogin','alias','option','loadContextWrapper','login','lodash','Token\x20for\x20current\x20context\x20\x27','dir','useProjectId','value','CliContext','\x20(current)','Retrieve\x20and\x20update\x20local\x20context\x20settings.','contextProvider','askForJob','Display\x20full\x20URL\x20to\x20allow\x20opening\x20the\x20link\x20manually','Changed\x20current\x20context\x20to\x20','.\x20Using\x20fallback.','removeContext','name','contexts','close','Open\x20this\x20URL\x20in\x20your\x20browser\x20and\x20follow\x20the\x20steps:\x0a\x09','current','test','Connect\x20the\x20CLI\x20to\x20your\x20Northflank\x20account.','browser-opened','1796244VxxepM','--host\x20[HOST]','Token\x20for\x20this\x20context','Bearer\x20','__awaiter','moveCursor','finally','No\x20context\x20available.\x20Use\x20\x27northflank\x20login\x27\x20to\x20create\x20context.','useServiceId','-t,\x20--token\x20[TOKEN]','service'];a2c=function(){return c0;};return a2c();}const a2G=a2E;(function(c,E){const t=a2E,S=c();while(!![]){try{const X=parseInt(t(0x1d8))/0x1*(parseInt(t(0x1ec))/0x2)+-parseInt(t(0x1c6))/0x3+-parseInt(t(0x1f8))/0x4+-parseInt(t(0x220))/0x5+-parseInt(t(0x19e))/0x6+-parseInt(t(0x1d7))/0x7*(-parseInt(t(0x20c))/0x8)+parseInt(t(0x1fa))/0x9;if(X===E)break;else S['push'](S['shift']());}catch(u){S['push'](S['shift']());}}}(a2c,0x8d02d));function a2E(c,E){const S=a2c();return a2E=function(X,u){X=X-0x19a;let Y=S[X];return Y;},a2E(c,E);}var __createBinding=this&&this[a2G(0x1ee)]||(Object[a2G(0x1a1)]?function(c,E,S,X){const b=a2G;if(X===undefined)X=S;var u=Object[b(0x215)](E,S);(!u||(b(0x1e0)in u?!E[b(0x19f)]:u['writable']||u[b(0x19c)]))&&(u={'enumerable':!![],'get':function(){return E[S];}}),Object['defineProperty'](c,X,u);}:function(c,E,S,X){if(X===undefined)X=S;c[X]=E[S];}),__setModuleDefault=this&&this['__setModuleDefault']||(Object[a2G(0x1a1)]?function(c,E){Object['defineProperty'](c,'default',{'enumerable':!![],'value':E});}:function(c,E){const l=a2G;c[l(0x1eb)]=E;}),__importStar=this&&this[a2G(0x230)]||function(c){const A=a2G;if(c&&c[A(0x19f)])return c;var E={};if(c!=null){for(var S in c)if(S!==A(0x1eb)&&Object[A(0x23c)][A(0x20d)][A(0x1dc)](c,S))__createBinding(E,c,S);}return __setModuleDefault(E,c),E;},__awaiter=this&&this[a2G(0x1ca)]||function(c,E,S,X){function u(Y){return Y instanceof S?Y:new S(function(R){R(Y);});}return new(S||(S=Promise))(function(Y,R){const M=a2E;function d(p){const I=a2E;try{U(X[I(0x214)](p));}catch(q){R(q);}}function w(p){try{U(X['throw'](p));}catch(q){R(q);}}function U(p){const T=a2E;p[T(0x207)]?Y(p[T(0x1b4)]):u(p[T(0x1b4)])[T(0x227)](d,w);}U((X=X[M(0x1ef)](c,E||[]))[M(0x214)]());});},__importDefault=this&&this[a2G(0x1a7)]||function(c){const m=a2G;return c&&c[m(0x19f)]?c:{'default':c};};Object[a2G(0x224)](exports,'__esModule',{'value':!![]}),exports['CliContext']=void 0x0;const _=__importStar(require(a2G(0x1b0))),proxy_agent_1=require(a2G(0x231)),chalk_1=__importDefault(require(a2G(0x20f))),utils_1=require(a2G(0x1ff)),inquirer_helper_1=require(a2G(0x1d4)),console_format_helpers_1=require(a2G(0x239)),browser_login_1=require('../login/browser-login'),node_fetch_1=__importDefault(require('node-fetch')),inquirer=require('inquirer');class CliContext{constructor(c,E=undefined,S='https://api.northflank.com'){const N=a2G;this[N(0x21a)]=E,this[N(0x1e9)]=S,this[N(0x22f)]=q=>{const z=N;let B=q;return!/^https?:\/\//i[z(0x1c3)](B)&&(B=z(0x206)+B),B=B[z(0x219)](/\/+$/,''),B;},this[N(0x236)]=c;const X=new inquirer_helper_1['InquirerHelper'](c);this[N(0x1af)]=(0x0,utils_1[N(0x1d9)])()['name'](N(0x1af))[N(0x1e7)](N(0x1c4))[N(0x1ad)](N(0x19a),N(0x1d5),![])[N(0x1ad)]('--do-not-open-browser',N(0x223),![])[N(0x1ad)](N(0x226),N(0x1f3))[N(0x1ad)](N(0x1cf),'Token\x20for\x20this\x20context.\x20When\x20set,\x20browser\x20login\x20is\x20not\x20used')[N(0x1ad)](N(0x1c7),N(0x1d3),this['defaultBaseUrl'])[N(0x1ad)](N(0x20a),'Override\x20existing\x20contexts\x20(this\x20will\x20remove\x20project\x20and\x20service\x20context)',![])[N(0x1f6)](q=>__awaiter(this,void 0x0,void 0x0,function*(){const J=N;_[J(0x1f2)](q,J(0x1e2),this[J(0x22f)](q[J(0x1e2)]));const B=q[J(0x213)]||q[J(0x21c)]!==undefined,{name:V,host:g,token:r,override:H}=B?yield this[J(0x222)](q,X):yield this['browserLogin'](q,X);try{yield this[J(0x236)][J(0x1b8)][J(0x21e)]({'name':V,'host':g,'token':r},H);}catch(f){(0x0,utils_1[J(0x1e6)])(f[J(0x1aa)]);return;}if(!(yield this[J(0x208)]()))(0x0,utils_1[J(0x1e6)])(J(0x221)),yield this[J(0x236)][J(0x1b8)][J(0x1bd)](V);else{const Z=B?J(0x1da):J(0x1df),K=J(0x216)+Z+',\x20added\x20context\x20with\x20name\x20'+chalk_1[J(0x1eb)][J(0x1fd)](V)+J(0x1f9)+g+')';(0x0,utils_1[J(0x212)])(K);}})),this[N(0x1bf)]=(0x0,utils_1['getCommand'])()['name'](N(0x205))[N(0x1e7)](N(0x1b7))[N(0x1ac)](N(0x1bf))[N(0x1ac)]('ctx');const u=(0x0,utils_1[N(0x1d9)])()[N(0x1be)](N(0x21d))[N(0x1be)]('ls')[N(0x1e7)](N(0x19b))['option']('--all','Shows\x20full\x20context\x20information\x20(including\x20tokens)')['action'](q=>__awaiter(this,void 0x0,void 0x0,function*(){const O=N;console[O(0x235)](c[O(0x1b8)][O(0x23b)]());const B=c[O(0x1b8)][O(0x1ae)]();if(q['all']===!![]){console[O(0x1b2)](B);return;}const V=B[O(0x1c2)],g=B['contexts']['sort']((r,H)=>r[O(0x1be)]===V?-0x1:H[O(0x1be)]===V?0x1:0x0)[O(0x202)](r=>{const C=O,H=V===r[C(0x1be)]?C(0x1b6):'';return{'Name':''+r[C(0x1be)]+H,'Host':r[C(0x1e2)],'Default\x20Project':r[C(0x233)]||'-','Default\x20Service':r[C(0x1d0)]||'-'};});(0x0,console_format_helpers_1[O(0x218)])(g,O(0x1e3));})),Y=(0x0,utils_1[N(0x1d9)])();Y[N(0x1be)](N(0x1ea))[N(0x1e7)](N(0x19d))[N(0x1ad)]('-n,\x20--name\x20[NAME]',N(0x21b))[N(0x1f6)](q=>__awaiter(this,void 0x0,void 0x0,function*(){const k=N,B=(q===null||q===void 0x0?void 0x0:q[k(0x1be)])||(yield this[k(0x204)](k(0x1ea)));yield this[k(0x236)]['contextProvider'][k(0x1a9)](B),(0x0,utils_1[k(0x212)])(k(0x1bb)+B);}));const R=N(0x20b),d=(0x0,utils_1[N(0x1d9)])()[N(0x1be)](N(0x233))[N(0x1e7)](N(0x1f5))[N(0x1ad)](R,N(0x23d))[N(0x1f6)](q=>__awaiter(this,void 0x0,void 0x0,function*(){const o=N,B=(q===null||q===void 0x0?void 0x0:q['id'])||(yield X['askForProject']());yield this[o(0x236)][o(0x1b8)][o(0x1b3)](B),console['log']('Use\x20project\x20with\x20id:',B);})),w=(0x0,utils_1[N(0x1d9)])()[N(0x1be)](N(0x1d0))['description'](N(0x22d))[N(0x1ad)](R,'Service\x20name\x20(internal\x20id)\x20to\x20use\x20as\x20default\x20in\x20context')[N(0x1f6)](q=>__awaiter(this,void 0x0,void 0x0,function*(){const y=N,B=(q===null||q===void 0x0?void 0x0:q['id'])||(yield X[y(0x234)](this['getProjectName']())());console['log'](y(0x22b),B),yield this[y(0x236)][y(0x1b8)][y(0x1ce)](B);})),P=(0x0,utils_1[N(0x1d9)])()[N(0x1be)](N(0x225))[N(0x1e7)](N(0x238))[N(0x1ad)](R,'Job\x20name\x20(internal\x20id)\x20to\x20use\x20as\x20default\x20in\x20context')[N(0x1f6)](q=>__awaiter(this,void 0x0,void 0x0,function*(){const e=N,B=(q===null||q===void 0x0?void 0x0:q['id'])||(yield X[e(0x1b9)](this['getProjectName']())());console[e(0x235)](e(0x1a8),B),yield this[e(0x236)][e(0x1b8)][e(0x211)](B);}));Y[N(0x232)](d),Y[N(0x232)](P),Y[N(0x232)](w);const U=(0x0,utils_1[N(0x1d9)])()['name'](N(0x1d6))['alias'](N(0x209))[N(0x1ac)]('rm')[N(0x1e7)]('Remove\x20a\x20context')[N(0x1ad)](R,'Local\x20context\x20name\x20to\x20remove.')[N(0x1f6)](q=>__awaiter(this,void 0x0,void 0x0,function*(){const D=N;var B;const V=(q===null||q===void 0x0?void 0x0:q['id'])||(yield this[D(0x204)](D(0x1d6))),g=(B=this[D(0x236)]['contextProvider'][D(0x21f)]())===null||B===void 0x0?void 0x0:B[D(0x1be)];yield this['apiClient']['contextProvider'][D(0x1bd)](V),(0x0,utils_1['success'])(D(0x1fb)+V+D(0x1a3));if(!this[D(0x1ed)]()){(0x0,utils_1[D(0x210)])(D(0x1cd));return;}if(g===V){const r=(q===null||q===void 0x0?void 0x0:q['name'])||(yield this['askForContext'](D(0x1e4)));yield this[D(0x236)]['contextProvider']['useContext'](r),(0x0,utils_1[D(0x212)])('Changed\x20current\x20context\x20to\x20'+r);}})),p=(0x0,utils_1['getCommand'])()[N(0x1be)](N(0x229))['alias'](N(0x1de))[N(0x1e7)](N(0x1a5))[N(0x1ad)](N(0x1cf),N(0x1c8))['action'](q=>__awaiter(this,void 0x0,void 0x0,function*(){const x=N,{contextProvider:B}=this[x(0x236)],V=(q===null||q===void 0x0?void 0x0:q[x(0x21c)])||(yield X[x(0x22c)]()),g=B[x(0x22e)]();yield B[x(0x1f4)](V);if(yield this['verifyToken']())(0x0,utils_1[x(0x212)])(x(0x1b1)+B[x(0x217)]()+x(0x1d1));else{if(g)yield B[x(0x1f4)](g);(0x0,utils_1['error'])(x(0x203));}}));this[N(0x1bf)][N(0x232)](u),this[N(0x1bf)]['addCommand'](Y),this[N(0x1bf)][N(0x232)](U),this[N(0x1bf)][N(0x232)](p);}[a2G(0x1ab)](c,E){var S,X,u,Y;return __awaiter(this,void 0x0,void 0x0,function*(){const h=a2E,R=!c['doNotOpenBrowser'],d=(S=c['host'])!==null&&S!==void 0x0?S:this['defaultBaseUrl'],w=new browser_login_1[(h(0x1e8))](d,R,this[h(0x21a)]);let P;w['on'](h(0x1c5),({url:B})=>{const n=h;if(R){const V=B[n(0x219)](/sessionToken=.*/,n(0x20e));console[n(0x235)](n(0x22a)+V+')'),P=inquirer[n(0x1dd)]([{'type':'confirm','name':n(0x1fe),'message':n(0x1ba),'default':![]}]),P['then'](g=>{const s=n;process[s(0x1f0)][s(0x1cb)](0x0,-0x1),process[s(0x1f0)][s(0x1d2)](0x1),g['fullUrl']&&console[s(0x235)](s(0x1c1)+B+'\x20');});}else console[n(0x235)]('Open\x20this\x20URL\x20in\x20your\x20browser\x20and\x20follow\x20the\x20steps:\x0a\x09'+B+'\x20');});const {token:U,contextName:p}=yield w[h(0x1f1)]()[h(0x228)](B=>__awaiter(this,void 0x0,void 0x0,function*(){const j=h;(0x0,utils_1[j(0x1e6)])(j(0x200)+B['message']+j(0x1bc));const V=yield this['apiTokenLogin'](c,E);return{'token':V[j(0x21c)],'contextName':V['name']};}))[h(0x1cc)](()=>{const a=h;if(P)P['ui'][a(0x1c0)]();}),q=(u=(X=c[h(0x1be)])!==null&&X!==void 0x0?X:p)!==null&&u!==void 0x0?u:h(0x1a6)+new Date()[h(0x201)]();return{'name':q,'token':U,'host':d,'override':(Y=c[h(0x1db)])!==null&&Y!==void 0x0?Y:![]};});}[a2G(0x222)](c,E){return __awaiter(this,void 0x0,void 0x0,function*(){const Q=a2E,S=this[Q(0x236)][Q(0x1b8)][Q(0x1ae)]()[Q(0x1bf)],{name:X,token:u,host:Y,override:R}=yield E[Q(0x1e5)](c,S);return{'name':X,'token':u,'host':Y,'override':R};});}[a2G(0x23a)](){const L=a2G,c=this[L(0x236)][L(0x1b8)]['getCurrentProjectName']();if(c===undefined)throw new Error(L(0x1e1));return c;}[a2G(0x204)](c){return __awaiter(this,void 0x0,void 0x0,function*(){const W=a2E;if(!this[W(0x1ed)]())throw new Error('No\x20context\x20available.\x20Please\x20use\x20\x27northflank\x20login\x27\x20to\x20create\x20context.');const E=this[W(0x236)][W(0x1b8)]['loadContextWrapper']()['contexts'][W(0x202)](X=>X[W(0x1be)]),S=E[W(0x1a2)]>0x4?'search-list':W(0x21d);return(yield inquirer[W(0x1dd)]([{'type':S,'name':W(0x1be),'message':'Choose\x20the\x20context\x20to\x20'+c+':','choices':E}]))[W(0x1be)];});}['contextAvailable'](){const F=a2G;return this[F(0x236)][F(0x1b8)]['loadContextWrapper']()[F(0x1bf)][F(0x1a2)]>0x0;}[a2G(0x208)](){return __awaiter(this,void 0x0,void 0x0,function*(){const i=a2E;try{const c=this[i(0x236)][i(0x1b8)][i(0x1fc)](),E=this[i(0x236)][i(0x1b8)][i(0x22e)](),S=c+i(0x1f7),X={'Authorization':i(0x1c9)+E},u=new proxy_agent_1[(i(0x1a0))](),Y=yield(0x0,utils_1[i(0x237)])(0x3)(()=>__awaiter(this,void 0x0,void 0x0,function*(){const v=i;return(0x0,node_fetch_1['default'])(S,{'method':v(0x1a4),'signal':AbortSignal['timeout'](0xbb8),'headers':X,'agent':u});}));if(Y['ok'])return!![];return![];}catch(R){return![];}});}}exports[a2G(0x1b5)]=CliContext;
@@ -0,0 +1 @@
1
+ 'use strict';function a3E(c,E){const S=a3c();return a3E=function(X,u){X=X-0xa3;let Y=S[X];return Y;},a3E(c,E);}function a3c(){const D=['from','FILE_UPLOAD','Container\x20used\x20to\x20','throw','Downloaded\x20all\x20directory\x20contents\x20from\x20\x27','success','Don\x27t\x20use\x20context\x20default\x20values,\x20explicitly\x20use\x20options\x20or\x20ask.','alias','logCopyResult','name','type','localPath','current\x20working','capitalize','7454514eLGIfg','toUpperCase','lodash','inquirer','CopyType','user\x20home','File\x20and\x20directory\x20download\x20for\x20Northflank\x20job.','--container\x20--containerId\x20[NAME]','1407266qETrxY','Downloaded\x20file\x20\x27','slice','getCommand','File\x20and\x20directory\x20upload\x20for\x20Northflank\x20job.','\x27\x20to\x20\x27','1067731SbVDmx','getCurrentProjectName','Path\x20is\x20not\x20specified,\x20the\x20','DIRECTORY_DOWNLOAD','__esModule','description','--remote\x20--remotePath\x20[REMOTEPATH]','apiClient','Local\x20file\x20or\x20directory','\x20files','\x20files\x20','\x27localPath\x27','819916jUEzLC','File\x20and\x20directory\x20upload\x20for\x20Northflank\x20services\x20and\x20jobs.','24voCmbJ','upload','files','download','--local\x20--localPath\x20[LOCALPATH]','ensureRelevantPathIsSet','local','\x27\x20to\x20local\x20directory\x20\x27','customUserAgent','askForService','s.\x20Please\x20enter\x20a\x20path:','1927182iUqvoJ','getCurrentServiceName','assertContextExisting','14246253oLMmAA','askForPath','3374420GoqQHc','\x20to\x20','service','job','downloadCmd','getStandardCopyCommand','\x20--localPath\x20my_directory\x20--remotePath\x20/home/','option','\x20single\x20file:\x20\x20\x20northflank\x20','uploadCmd','Uploaded\x20all\x20directory\x20contents\x20from\x20\x27','\x20the\x20specified\x20','DIRECTORY_UPLOAD','File\x20and\x20directory\x20download\x20for\x20Northflank\x20service.','\x20is\x20required\x20for\x20','file','--noDefaults','CliFileCopy','prompt','input','--project\x20--projectId\x20[NAME]','\x20directory\x20is\x20used.\x20If\x20the\x20directory\x20for\x20','askForProject','value','File\x20and\x20directory\x20download\x20for\x20Northflank\x20services\x20and\x20jobs.','apply','askForJob','../utils','Path\x20does\x20not\x20exist,\x20it\x20will\x20be\x20created.\x0aExamples:\x0a\x20\x20','@northflank/js-client','FILE_DOWNLOAD','.\x20If\x20the\x20','File\x20and\x20directory\x20upload\x20for\x20Northflank\x20service.','action','ed-file.txt\x0a\x20\x20','then','remotePath','\x27\x20to\x20container\x20directory\x20\x27','addCommand','21eNxSLx','InquirerHelper','next','\x20--localPath\x20my_directory/my-file.txt\x20--remotePath\x20/home/my-','done'];a3c=function(){return D;};return a3c();}const a3m=a3E;(function(c,E){const l=a3E,S=c();while(!![]){try{const X=-parseInt(l(0x102))/0x1+parseInt(l(0xbb))/0x2+parseInt(l(0xe7))/0x3*(-parseInt(l(0xae))/0x4)+-parseInt(l(0xc0))/0x5+parseInt(l(0xfa))/0x6+-parseInt(l(0x108))/0x7*(-parseInt(l(0xb0))/0x8)+parseInt(l(0xbe))/0x9;if(X===E)break;else S['push'](S['shift']());}catch(u){S['push'](S['shift']());}}}(a3c,0xb21b3));var __awaiter=this&&this['__awaiter']||function(c,E,S,X){function u(Y){return Y instanceof S?Y:new S(function(R){R(Y);});}return new(S||(S=Promise))(function(Y,R){const M=a3E;function d(p){const A=a3E;try{U(X[A(0xe9)](p));}catch(q){R(q);}}function w(p){const I=a3E;try{U(X[I(0xef)](p));}catch(q){R(q);}}function U(p){const T=a3E;p[T(0xeb)]?Y(p[T(0xd7)]):u(p[T(0xd7)])[T(0xe3)](d,w);}U((X=X[M(0xd9)](c,E||[]))[M(0xe9)]());});};Object['defineProperty'](exports,a3m(0xa6),{'value':!![]}),exports[a3m(0xd1)]=void 0x0;const js_client_1=require(a3m(0xdd)),utils_1=require(a3m(0xdb)),inquirer_helper_1=require('../inquirer-helper'),lodash_1=require(a3m(0xfc)),inquirer=require(a3m(0xfd));class CliFileCopy{constructor(c,E){const N=a3m;this[N(0xc5)]=(P,U)=>{const z=N,p=(0x0,lodash_1[z(0xf9)])(U),q=U==='upload'?'remote':z(0xb6),B=U===z(0xb1)?z(0xff):z(0xf8),V=U===z(0xb1)?'to':z(0xec);return(0x0,utils_1[z(0x105)])(!![])[z(0xf5)](z(0xcf))['description'](p+z(0xac)+V+z(0xcb)+P+z(0xdf)+q+z(0xa4)+B+z(0xd5)+q+z(0xdc)+p+z(0xc8)+U+'\x20'+P+z(0xea)+U+z(0xe2)+p+'\x20directory:\x20\x20\x20\x20\x20northflank\x20'+U+'\x20'+P+z(0xc6)+U+'-dir')[z(0xc7)](z(0xd4),'Project\x20for\x20'+U)[z(0xc7)]('--'+P+'\x20--'+P+'Id\x20[NAME]',P['charAt'](0x0)[z(0xfb)]()+P[z(0x104)](0x1)+z(0xc1)+U+z(0xab))['option'](z(0x101),z(0xee)+U+'\x20(random\x20container\x20will\x20be\x20chosen\x20if\x20not\x20specified)')[z(0xc7)](z(0xb4),z(0xaa))[z(0xc7)](z(0xa8),'Remote\x20file\x20or\x20directory')[z(0xc7)](z(0xd0),z(0xf2),![]);},this['logCopyResult']=(P,U)=>{const J=N;if(U)return;const {sourceDirectory:p,targetDirectory:q,sourceFile:B,targetFile:V}=P;switch(P[J(0xf6)]){case js_client_1[J(0xfe)][J(0xa5)]:{(0x0,utils_1[J(0xf1)])(J(0xf0)+p+J(0xb7)+q+'\x27');break;}case js_client_1[J(0xfe)][J(0xde)]:{(0x0,utils_1['success'])(J(0x103)+p+'/'+B+'\x27\x20to\x20\x27'+q+'/'+V+'\x27');break;}case js_client_1['CopyType'][J(0xcc)]:{(0x0,utils_1[J(0xf1)])(J(0xca)+p+J(0xe5)+q+'\x27');break;}case js_client_1[J(0xfe)][J(0xed)]:{(0x0,utils_1[J(0xf1)])('Uploaded\x20file\x20from\x20\x27'+p+'/'+B+J(0x107)+q+'/'+V+'\x27');break;}}},this[N(0xb5)]=(P,U)=>__awaiter(this,void 0x0,void 0x0,function*(){const O=N,p=P===O(0xb3)&&U[O(0xe4)]===undefined?yield this['askForPath']('\x27remotePath\x27',O(0xb3)):U['remotePath'],q=P===O(0xb1)&&U[O(0xf7)]===undefined?yield this[O(0xbf)](O(0xad),O(0xb1)):U[O(0xf7)];return{'localPath':q,'remotePath':p};}),this[N(0xbf)]=(P,U)=>__awaiter(this,void 0x0,void 0x0,function*(){const C=N,p=P+C(0xce)+U+C(0xba);return(yield inquirer[C(0xd2)]([{'type':C(0xd3),'name':C(0xf5),'message':p}]))[C(0xf5)];}),this[N(0xa9)]=new js_client_1['ApiClient'](c,{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1[N(0xb8)],'agent':E});const S=new inquirer_helper_1[(N(0xe8))](this[N(0xa9)]);this['downloadCmd']=(0x0,utils_1['getCommand'])()[N(0xf5)](N(0xb3))['alias']('dl')['description'](N(0xd8)),this['uploadCmd']=(0x0,utils_1[N(0x105)])()['name'](N(0xb1))[N(0xf3)]('ul')['description'](N(0xaf));const X=(0x0,utils_1[N(0x105)])()[N(0xf5)](N(0xc2))[N(0xa7)](N(0xcd)),u=(0x0,utils_1[N(0x105)])()[N(0xf5)](N(0xc2))[N(0xa7)](N(0xe0)),Y=(0x0,utils_1[N(0x105)])()['name'](N(0xc3))[N(0xa7)](N(0x100)),R=(0x0,utils_1['getCommand'])()[N(0xf5)](N(0xc3))[N(0xa7)](N(0x106)),d=P=>{const k=N;return this[k(0xc5)](k(0xc2),P)[k(0xe1)](U=>__awaiter(this,void 0x0,void 0x0,function*(){const o=k,{projectId:p,serviceId:q,containerId:B,noDefaults:V,quiet:g}=U;(0x0,utils_1[o(0xbd)])(this[o(0xa9)]);const r=V?undefined:c[o(0xa3)](),H=p||r||(yield S[o(0xd6)]()),f=V?undefined:c[o(0xbc)](),Z=q||f||(yield S[o(0xb9)](H)()),{remotePath:K,localPath:t}=yield this[o(0xb5)](P,U),G={'projectId':H,'serviceId':Z},b=yield this[o(0xa9)][P]['service'][o(0xb2)](G,{'containerName':B,'localPath':t,'remotePath':K});this[o(0xf4)](b,g);}));},w=P=>{const y=N;return this[y(0xc5)](y(0xc3),P)[y(0xe1)](U=>__awaiter(this,void 0x0,void 0x0,function*(){const e=y,{projectId:p,jobId:q,containerId:B,noDefaults:V,quiet:g}=U;(0x0,utils_1[e(0xbd)])(this['apiClient']);const r=V?undefined:c[e(0xa3)](),H=p||r||(yield S['askForProject']()),f=q||(yield S[e(0xda)](H)()),{remotePath:Z,localPath:K}=yield this['ensureRelevantPathIsSet'](P,U),t={'projectId':H,'jobId':f},G=yield this['apiClient'][P][e(0xc3)][e(0xb2)](t,{'containerName':B,'localPath':K,'remotePath':Z});this['logCopyResult'](G,g);}));};X[N(0xe6)](d(N(0xb3))),Y['addCommand'](w('download')),u[N(0xe6)](d(N(0xb1))),R[N(0xe6)](w(N(0xb1))),this[N(0xc4)][N(0xe6)](X),this['downloadCmd'][N(0xe6)](Y),this[N(0xc9)][N(0xe6)](u),this[N(0xc9)][N(0xe6)](R);}}exports[a3m(0xd1)]=CliFileCopy;