@northflank/cli 0.10.6 → 0.10.7

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 a0O2=a0g;(function(O,g){const O1=a0g,R=O();while(!![]){try{const Y=-parseInt(O1(0x17d))/0x1+parseInt(O1(0x1a3))/0x2+-parseInt(O1(0x193))/0x3*(parseInt(O1(0x19c))/0x4)+-parseInt(O1(0x1a8))/0x5+-parseInt(O1(0x1a0))/0x6+-parseInt(O1(0x1af))/0x7+parseInt(O1(0x18b))/0x8;if(Y===g)break;else R['push'](R['shift']());}catch(y){R['push'](R['shift']());}}}(a0O,0xd3815));var __awaiter=this&&this[a0O2(0x1a1)]||function(O,g,R,Y){function y(n){return n instanceof R?n:new R(function(G){G(n);});}return new(R||(R=Promise))(function(n,G){const O5=a0g;function S(L){const O3=a0g;try{V(Y[O3(0x19b)](L));}catch(N){G(N);}}function q(L){try{V(Y['throw'](L));}catch(N){G(N);}}function V(e){const O4=a0g;e[O4(0x188)]?n(e[O4(0x195)]):y(e['value'])[O4(0x19e)](S,q);}V((Y=Y[O5(0x197)](O,g||[]))[O5(0x19b)]());});};Object['defineProperty'](exports,a0O2(0x1a9),{'value':!![]}),exports[a0O2(0x185)]=void 0x0;const utils_1=require(a0O2(0x17c)),defaultPaginationPageSize=0x64,getProjects=O=>g=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const O6=a0O2;var R;const Y=yield O[O6(0x199)]['projects']({'options':{'per_page':defaultPaginationPageSize,'cursor':g===null||g===void 0x0?void 0x0:g[O6(0x194)]}});return{'elements':Y[O6(0x178)]['projects']['map'](y=>y['id']),'nextPageCursor':(R=Y['pagination'])===null||R===void 0x0?void 0x0:R[O6(0x187)]};}),getServices=(O,g)=>R=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const O7=a0O2;var Y;const y=yield O[O7(0x199)][O7(0x175)]({'parameters':{'projectId':g},'options':{'per_page':defaultPaginationPageSize,'cursor':R===null||R===void 0x0?void 0x0:R['nextPageCursor']}});return{'elements':y['data'][O7(0x175)]['map'](n=>n['id']),'nextPageCursor':(Y=y[O7(0x180)])===null||Y===void 0x0?void 0x0:Y['cursor']};}),getAddons=(O,g)=>R=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const O8=a0O2;var Y;const y=yield O[O8(0x199)][O8(0x179)]({'parameters':{'projectId':g},'options':{'per_page':defaultPaginationPageSize,'cursor':R===null||R===void 0x0?void 0x0:R[O8(0x194)]}});return{'elements':y[O8(0x178)][O8(0x179)][O8(0x189)](n=>n['id']),'nextPageCursor':(Y=y[O8(0x180)])===null||Y===void 0x0?void 0x0:Y['cursor']};}),getAddonBackups=(O,g,R)=>Y=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const O9=a0O2;var y;const n=yield O[O9(0x18e)][O9(0x1ae)][O9(0x18f)]({'parameters':{'projectId':g,'addonId':R},'options':{'per_page':defaultPaginationPageSize,'cursor':Y===null||Y===void 0x0?void 0x0:Y['nextPageCursor']}});return{'elements':n[O9(0x178)][O9(0x18f)][O9(0x189)](G=>G['id']),'nextPageCursor':(y=n[O9(0x180)])===null||y===void 0x0?void 0x0:y['cursor']};});function a0g(O,g){const R=a0O();return a0g=function(Y,y){Y=Y-0x174;let n=R[Y];return n;},a0g(O,g);}function a0O(){const Oy=['__esModule','join','latest','updateaddonversion','keyName','addon','2605533mgLpCG','internalId','secretLink','resources','services','owningObject','types','data','addons','No\x20available\x20versions\x20to\x20upgrade\x20to.','keys','./utils','692115ScexMo','version','secrets','pagination','replicas','regions','addonTypes','warning','fetchResourceList','templateId','cursor','done','map','addonId','26807504zwvQGz','registryCredentials','projectId','get','backups','length','storage','credentials','12oCpHKU','nextPageCursor','value','deploymentPlan','apply','type','list','backupId','next','1660552nESalS','envs','then','region','7533234FlJYkV','__awaiter','plans','3331664EzmdNf','includes','templates','default','find','850100LvzdRx'];a0O=function(){return Oy;};return a0O();}function fetchResourceList(O,g,R,Y,y,n){var G,S,q,V,e,L,N,b,E,p,F,m;return __awaiter(this,void 0x0,void 0x0,function*(){const OO=a0g,o=undefined;try{if(O===OO(0x196)){const X=yield g[OO(0x199)][OO(0x1a2)]({}),M=X[OO(0x178)]['plans']['map'](l=>{const Og=OO;var C;return(C=l===null||l===void 0x0?void 0x0:l[Og(0x1b0)])!==null&&C!==void 0x0?C:l===null||l===void 0x0?void 0x0:l['id'];});return{'choices':M,'defaultValue':o};}if(O===OO(0x19f)&&!(R===null||R===void 0x0?void 0x0:R['includes']('logSink'))){const l=yield g[OO(0x199)][OO(0x182)]({}),C=l[OO(0x178)][OO(0x182)][OO(0x189)](K=>{const OR=OO;var H;return(H=K===null||K===void 0x0?void 0x0:K[OR(0x1b0)])!==null&&H!==void 0x0?H:K===null||K===void 0x0?void 0x0:K['id'];});return{'choices':C,'defaultValue':o};}if(O===OO(0x18d)){const K=yield getProjects(g),{elements:H,nextPageCursor:f}=yield K();return{'choices':H,'defaultValue':o,'pagination':{'nextPageCursor':f,'loadMore':K}};}if(O===OO(0x192)){const i=yield g['list'][OO(0x18c)]({}),A=i[OO(0x178)][OO(0x192)]['map'](Z=>Z['id']);return{'choices':A,'defaultValue':o};}const v=y===null||y===void 0x0?void 0x0:y[OO(0x18d)],a=O==='serviceId'||O==='id'&&(n===null||n===void 0x0?void 0x0:n['includes'](OO(0x176)));if(v!==undefined&&a){const Z=yield getServices(g,v),{elements:c,nextPageCursor:U}=yield Z();return{'choices':c,'defaultValue':o,'pagination':{'nextPageCursor':U,'loadMore':Z}};}const z=R===null||R===void 0x0?void 0x0:R[OO(0x1a4)](OO(0x1ae));if(z){const d=r=>__awaiter(this,void 0x0,void 0x0,function*(){const OY=OO;var j;const t=yield g[OY(0x18e)]['addon'][OY(0x177)]({});return(j=t[OY(0x178)]['addonTypes'])===null||j===void 0x0?void 0x0:j[OY(0x189)](Q=>Q['type'])[OY(0x1a7)](Q=>Q[OY(0x198)]===r);});if(O==='type'){const r=yield g['get'][OO(0x1ae)][OO(0x177)]({}),j=(G=r[OO(0x178)][OO(0x183)])===null||G===void 0x0?void 0x0:G['map'](t=>t[OO(0x198)]);return{'choices':j,'defaultValue':o};}if(O===OO(0x17e)&&(Y===null||Y===void 0x0?void 0x0:Y[OO(0x198)])!==undefined){const t=(S=yield d(Y[OO(0x198)]))===null||S===void 0x0?void 0x0:S['versions'],Q=t!==undefined?[OO(0x1ab),...t]:undefined;return{'choices':Q,'defaultValue':o};}if(O===OO(0x191)&&(Y===null||Y===void 0x0?void 0x0:Y[OO(0x198)])!==undefined){const T=(V=(q=yield d(Y[OO(0x198)]))===null||q===void 0x0?void 0x0:q[OO(0x174)])===null||V===void 0x0?void 0x0:V[OO(0x191)];return{'choices':T===null||T===void 0x0?void 0x0:T['options'],'defaultValue':T===null||T===void 0x0?void 0x0:T['default']};}if(O==='replicas'&&(Y===null||Y===void 0x0?void 0x0:Y[OO(0x198)])!==undefined){const u=(L=(e=yield d(Y['type']))===null||e===void 0x0?void 0x0:e[OO(0x174)])===null||L===void 0x0?void 0x0:L[OO(0x181)];return{'choices':u===null||u===void 0x0?void 0x0:u['options'],'defaultValue':u===null||u===void 0x0?void 0x0:u[OO(0x1a6)]};}}if(O===OO(0x18a)&&(y===null||y===void 0x0?void 0x0:y[OO(0x18d)])!==undefined){const I=yield getAddons(g,y===null||y===void 0x0?void 0x0:y[OO(0x18d)]),{elements:x,nextPageCursor:k}=yield I();return{'choices':x,'defaultValue':o,'pagination':{'nextPageCursor':k,'loadMore':I}};}if(O===OO(0x19a)&&(y===null||y===void 0x0?void 0x0:y[OO(0x18d)])!==undefined&&((N=Y===null||Y===void 0x0?void 0x0:Y['source'])===null||N===void 0x0?void 0x0:N[OO(0x18a)])!==undefined){const s=yield getAddonBackups(g,y===null||y===void 0x0?void 0x0:y[OO(0x18d)],(b=Y===null||Y===void 0x0?void 0x0:Y['source'])===null||b===void 0x0?void 0x0:b['addonId']),{elements:P,nextPageCursor:B}=yield s();return{'choices':P,'defaultValue':o,'pagination':{'nextPageCursor':B,'loadMore':s}};}const W=(E=y===null||y===void 0x0?void 0x0:y[OO(0x18a)])!==null&&E!==void 0x0?E:(p=Y===null||Y===void 0x0?void 0x0:Y['addonDependencies'])===null||p===void 0x0?void 0x0:p[OO(0x18a)];if((R===null||R===void 0x0?void 0x0:R[OO(0x1aa)](''))===OO(0x1ac)&&O===OO(0x17e)&&(y===null||y===void 0x0?void 0x0:y[OO(0x18d)])!==undefined&&W!==undefined){const {upgradeTo:w}=(yield g[OO(0x18e)][OO(0x1ae)][OO(0x17e)]({'parameters':{'addonId':W,'projectId':y===null||y===void 0x0?void 0x0:y[OO(0x18d)]}}))[OO(0x178)];if(w===undefined||w[OO(0x190)]<=0x0){(0x0,utils_1[OO(0x184)])(OO(0x17a));throw new Error();}return{'choices':w[OO(0x189)](J=>J[OO(0x17e)]),'defaultValue':o};}if(O===OO(0x186)){const J=yield g[OO(0x199)][OO(0x1a5)]({}),h=J[OO(0x178)][OO(0x1a5)][OO(0x189)](D=>D===null||D===void 0x0?void 0x0:D['id']);return{'choices':h,'defaultValue':o};}if(((R===null||R===void 0x0?void 0x0:R[OO(0x1a4)](OO(0x1b1)))||(R===null||R===void 0x0?void 0x0:R[OO(0x1a4)]('secret')))&&O===OO(0x1ad)&&W!==undefined&&(y===null||y===void 0x0?void 0x0:y[OO(0x18d)])!==undefined){const D=(yield g['get'][OO(0x1ae)][OO(0x192)]({'parameters':{'addonId':W,'projectId':y===null||y===void 0x0?void 0x0:y[OO(0x18d)]}}))[OO(0x178)];return{'choices':[...(F=Object[OO(0x17b)](D===null||D===void 0x0?void 0x0:D[OO(0x19d)]))!==null&&F!==void 0x0?F:[],...(m=Object[OO(0x17b)](D===null||D===void 0x0?void 0x0:D[OO(0x17f)]))!==null&&m!==void 0x0?m:[]]};}}catch(O0){}return{'choices':undefined,'defaultValue':o};});}exports[a0O2(0x185)]=fetchResourceList;
1
+ 'use strict';function a0h(j,h){const N=a0j();return a0h=function(F,K){F=F-0xa0;let G=N[F];return G;},a0h(j,h);}function a0j(){const jK=['136YnDJhx','storage','value','options','types','find','nextPageCursor','secrets','keys','throw','1944704gLdRlC','backupId','336223wkzgxT','default','backups','logSink','addons','22866YiXCWJ','resources','list','region','No\x20available\x20versions\x20to\x20upgrade\x20to.','owningObject','updateaddonversion','version','secretLink','length','projects','defineProperty','map','internalId','get','1778373FxxdkW','data','addonTypes','registryCredentials','templates','addonDependencies','835OnEhFh','includes','972944HvhyWM','1000768dZLsId','type','./utils','__awaiter','addonId','next','replicas','secret','then','services','pagination','envs','cursor','source','projectId','done','addon','587052Ljmhwd','warning','regions','keyName','deploymentPlan','join','plans','versions','fetchResourceList'];a0j=function(){return jK;};return a0j();}const a0j2=a0h;(function(j,h){const j1=a0h,N=j();while(!![]){try{const F=parseInt(j1(0xc1))/0x1+parseInt(j1(0xde))/0x2+parseInt(j1(0xd5))/0x3+-parseInt(j1(0xbf))/0x4+-parseInt(j1(0xdb))/0x5*(-parseInt(j1(0xc6))/0x6)+-parseInt(j1(0xdd))/0x7+-parseInt(j1(0xb5))/0x8*(parseInt(j1(0xac))/0x9);if(F===h)break;else N['push'](N['shift']());}catch(K){N['push'](N['shift']());}}}(a0j,0x5100f));var __awaiter=this&&this[a0j2(0xe1)]||function(j,h,N,F){function K(G){return G instanceof N?G:new N(function(d){d(G);});}return new(N||(N=Promise))(function(G,d){function x(I){const j3=a0h;try{e(F[j3(0xa0)](I));}catch(X){d(X);}}function m(I){const j4=a0h;try{e(F[j4(0xbe)](I));}catch(X){d(X);}}function e(I){const j5=a0h;I[j5(0xaa)]?G(I[j5(0xb7)]):K(I[j5(0xb7)])[j5(0xa3)](x,m);}e((F=F['apply'](j,h||[]))['next']());});};Object[a0j2(0xd1)](exports,'__esModule',{'value':!![]}),exports[a0j2(0xb4)]=void 0x0;const utils_1=require(a0j2(0xe0)),defaultPaginationPageSize=0x64,getProjects=j=>h=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const j6=a0j2;var N;const F=yield j[j6(0xc8)][j6(0xd0)]({'options':{'per_page':defaultPaginationPageSize,'cursor':h===null||h===void 0x0?void 0x0:h[j6(0xbb)]}});return{'elements':F[j6(0xd6)][j6(0xd0)][j6(0xd2)](K=>K['id']),'nextPageCursor':(N=F['pagination'])===null||N===void 0x0?void 0x0:N['cursor']};}),getServices=(j,h)=>N=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const j7=a0j2;var F;const K=yield j[j7(0xc8)][j7(0xa4)]({'parameters':{'projectId':h},'options':{'per_page':defaultPaginationPageSize,'cursor':N===null||N===void 0x0?void 0x0:N[j7(0xbb)]}});return{'elements':K[j7(0xd6)]['services'][j7(0xd2)](G=>G['id']),'nextPageCursor':(F=K[j7(0xa5)])===null||F===void 0x0?void 0x0:F[j7(0xa7)]};}),getAddons=(j,h)=>N=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const j8=a0j2;var F;const K=yield j[j8(0xc8)]['addons']({'parameters':{'projectId':h},'options':{'per_page':defaultPaginationPageSize,'cursor':N===null||N===void 0x0?void 0x0:N[j8(0xbb)]}});return{'elements':K[j8(0xd6)][j8(0xc5)][j8(0xd2)](G=>G['id']),'nextPageCursor':(F=K[j8(0xa5)])===null||F===void 0x0?void 0x0:F[j8(0xa7)]};}),getAddonBackups=(j,h,N)=>F=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const j9=a0j2;var K;const G=yield j[j9(0xd4)][j9(0xab)][j9(0xc3)]({'parameters':{'projectId':h,'addonId':N},'options':{'per_page':defaultPaginationPageSize,'cursor':F===null||F===void 0x0?void 0x0:F[j9(0xbb)]}});return{'elements':G[j9(0xd6)][j9(0xc3)]['map'](d=>d['id']),'nextPageCursor':(K=G[j9(0xa5)])===null||K===void 0x0?void 0x0:K[j9(0xa7)]};});function fetchResourceList(j,h,N,F,K,G){var d,x,m,P,e,I,X,l,p,J,Q,y;return __awaiter(this,void 0x0,void 0x0,function*(){const jj=a0h,D=undefined;try{if(j===jj(0xb0)){const H=yield h[jj(0xc8)]['plans']({}),a=H['data'][jj(0xb2)]['map'](q=>{const jh=jj;var R;return(R=q===null||q===void 0x0?void 0x0:q[jh(0xd3)])!==null&&R!==void 0x0?R:q===null||q===void 0x0?void 0x0:q['id'];});return{'choices':a,'defaultValue':D};}if(j===jj(0xc9)&&!(N===null||N===void 0x0?void 0x0:N[jj(0xdc)](jj(0xc4)))){const q=yield h[jj(0xc8)][jj(0xae)]({}),R=q[jj(0xd6)][jj(0xae)]['map'](n=>{const jN=jj;var k;return(k=n===null||n===void 0x0?void 0x0:n[jN(0xd3)])!==null&&k!==void 0x0?k:n===null||n===void 0x0?void 0x0:n['id'];});return{'choices':R,'defaultValue':D};}if(j==='projectId'){const n=yield getProjects(h),{elements:k,nextPageCursor:L}=yield n();return{'choices':k,'defaultValue':D,'pagination':{'nextPageCursor':L,'loadMore':n}};}if(j==='credentials'){const A=yield h['list'][jj(0xd8)]({}),v=A['data']['credentials']['map'](s=>s['id']);return{'choices':v,'defaultValue':D};}const i=K===null||K===void 0x0?void 0x0:K[jj(0xa9)],W=j==='serviceId'||j==='id'&&(G===null||G===void 0x0?void 0x0:G['includes'](jj(0xcb)));if(i!==undefined&&W){const s=yield getServices(h,i),{elements:U,nextPageCursor:r}=yield s();return{'choices':U,'defaultValue':D,'pagination':{'nextPageCursor':r,'loadMore':s}};}const E=N===null||N===void 0x0?void 0x0:N[jj(0xdc)](jj(0xab));if(E){const V=f=>__awaiter(this,void 0x0,void 0x0,function*(){const jF=jj;var O;const z=yield h[jF(0xd4)][jF(0xab)][jF(0xb9)]({});return(O=z[jF(0xd6)][jF(0xd7)])===null||O===void 0x0?void 0x0:O[jF(0xd2)](b=>b['type'])[jF(0xba)](b=>b['type']===f);});if(j===jj(0xdf)){const f=yield h[jj(0xd4)][jj(0xab)][jj(0xb9)]({}),O=(d=f[jj(0xd6)][jj(0xd7)])===null||d===void 0x0?void 0x0:d[jj(0xd2)](z=>z['type']);return{'choices':O,'defaultValue':D};}if(j===jj(0xcd)&&(F===null||F===void 0x0?void 0x0:F[jj(0xdf)])!==undefined){const z=(x=yield V(F[jj(0xdf)]))===null||x===void 0x0?void 0x0:x[jj(0xb3)],b=z!==undefined?['latest',...z]:undefined;return{'choices':b,'defaultValue':D};}if(j===jj(0xb6)&&(F===null||F===void 0x0?void 0x0:F[jj(0xdf)])!==undefined){const T=(P=(m=yield V(F[jj(0xdf)]))===null||m===void 0x0?void 0x0:m[jj(0xc7)])===null||P===void 0x0?void 0x0:P['storage'];return{'choices':T===null||T===void 0x0?void 0x0:T[jj(0xb8)],'defaultValue':T===null||T===void 0x0?void 0x0:T[jj(0xc2)]};}if(j===jj(0xa1)&&(F===null||F===void 0x0?void 0x0:F[jj(0xdf)])!==undefined){const u=(I=(e=yield V(F['type']))===null||e===void 0x0?void 0x0:e[jj(0xc7)])===null||I===void 0x0?void 0x0:I[jj(0xa1)];return{'choices':u===null||u===void 0x0?void 0x0:u['options'],'defaultValue':u===null||u===void 0x0?void 0x0:u[jj(0xc2)]};}}if(j===jj(0xe2)&&(K===null||K===void 0x0?void 0x0:K['projectId'])!==undefined){const Z=yield getAddons(h,K===null||K===void 0x0?void 0x0:K['projectId']),{elements:S,nextPageCursor:Y}=yield Z();return{'choices':S,'defaultValue':D,'pagination':{'nextPageCursor':Y,'loadMore':Z}};}if(j===jj(0xc0)&&(K===null||K===void 0x0?void 0x0:K[jj(0xa9)])!==undefined&&((X=F===null||F===void 0x0?void 0x0:F['source'])===null||X===void 0x0?void 0x0:X[jj(0xe2)])!==undefined){const M=yield getAddonBackups(h,K===null||K===void 0x0?void 0x0:K['projectId'],(l=F===null||F===void 0x0?void 0x0:F[jj(0xa8)])===null||l===void 0x0?void 0x0:l[jj(0xe2)]),{elements:w,nextPageCursor:C}=yield M();return{'choices':w,'defaultValue':D,'pagination':{'nextPageCursor':C,'loadMore':M}};}const t=(p=K===null||K===void 0x0?void 0x0:K[jj(0xe2)])!==null&&p!==void 0x0?p:(J=F===null||F===void 0x0?void 0x0:F[jj(0xda)])===null||J===void 0x0?void 0x0:J[jj(0xe2)];if((N===null||N===void 0x0?void 0x0:N[jj(0xb1)](''))===jj(0xcc)&&j==='version'&&(K===null||K===void 0x0?void 0x0:K[jj(0xa9)])!==undefined&&t!==undefined){const {upgradeTo:o}=(yield h['get'][jj(0xab)][jj(0xcd)]({'parameters':{'addonId':t,'projectId':K===null||K===void 0x0?void 0x0:K[jj(0xa9)]}}))[jj(0xd6)];if(o===undefined||o[jj(0xcf)]<=0x0){(0x0,utils_1[jj(0xad)])(jj(0xca));throw new Error();}return{'choices':o['map'](g=>g[jj(0xcd)]),'defaultValue':D};}if(j==='templateId'){const g=yield h[jj(0xc8)][jj(0xd9)]({}),c=g[jj(0xd6)][jj(0xd9)][jj(0xd2)](B=>B===null||B===void 0x0?void 0x0:B['id']);return{'choices':c,'defaultValue':D};}if(((N===null||N===void 0x0?void 0x0:N[jj(0xdc)](jj(0xce)))||(N===null||N===void 0x0?void 0x0:N[jj(0xdc)](jj(0xa2))))&&j===jj(0xaf)&&t!==undefined&&(K===null||K===void 0x0?void 0x0:K[jj(0xa9)])!==undefined){const B=(yield h['get'][jj(0xab)]['credentials']({'parameters':{'addonId':t,'projectId':K===null||K===void 0x0?void 0x0:K[jj(0xa9)]}}))[jj(0xd6)];return{'choices':[...(Q=Object[jj(0xbd)](B===null||B===void 0x0?void 0x0:B[jj(0xa6)]))!==null&&Q!==void 0x0?Q:[],...(y=Object['keys'](B===null||B===void 0x0?void 0x0:B[jj(0xbc)]))!==null&&y!==void 0x0?y:[]]};}}catch(j0){}return{'choices':undefined,'defaultValue':D};});}exports[a0j2(0xb4)]=fetchResourceList;
package/dist/cli.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env -S node --no-deprecation
2
- 'use strict';const a1ON=a1g;(function(O,g){const OL=a1g,R=O();while(!![]){try{const Y=-parseInt(OL(0x120))/0x1*(parseInt(OL(0xfa))/0x2)+-parseInt(OL(0x154))/0x3+-parseInt(OL(0x1df))/0x4+parseInt(OL(0x11f))/0x5*(parseInt(OL(0x13a))/0x6)+-parseInt(OL(0x1c6))/0x7*(-parseInt(OL(0x19c))/0x8)+-parseInt(OL(0x153))/0x9*(parseInt(OL(0x1a5))/0xa)+-parseInt(OL(0x1e9))/0xb*(-parseInt(OL(0x171))/0xc);if(Y===g)break;else R['push'](R['shift']());}catch(y){R['push'](R['shift']());}}}(a1O,0x78678));function a1g(O,g){const R=a1O();return a1g=function(Y,y){Y=Y-0xd0;let n=R[Y];return n;},a1g(O,g);}var __createBinding=this&&this['__createBinding']||(Object[a1ON(0x177)]?function(O,g,R,Y){const Ob=a1ON;if(Y===undefined)Y=R;var y=Object[Ob(0x165)](g,R);(!y||(Ob(0x16d)in y?!g[Ob(0x1e6)]:y['writable']||y[Ob(0x1ca)]))&&(y={'enumerable':!![],'get':function(){return g[R];}}),Object[Ob(0x1a0)](O,Y,y);}:function(O,g,R,Y){if(Y===undefined)Y=R;O[Y]=g[R];}),__setModuleDefault=this&&this[a1ON(0x14d)]||(Object[a1ON(0x177)]?function(O,g){const OE=a1ON;Object[OE(0x1a0)](O,'default',{'enumerable':!![],'value':g});}:function(O,g){const Op=a1ON;O[Op(0x136)]=g;}),__importStar=this&&this[a1ON(0x1e1)]||function(O){const OF=a1ON;if(O&&O[OF(0x1e6)])return O;var g={};if(O!=null){for(var R in O)if(R!==OF(0x136)&&Object[OF(0x110)][OF(0x133)][OF(0x1c9)](O,R))__createBinding(g,O,R);}return __setModuleDefault(g,O),g;},__awaiter=this&&this['__awaiter']||function(O,g,R,Y){function y(n){return n instanceof R?n:new R(function(G){G(n);});}return new(R||(R=Promise))(function(n,G){const Ov=a1g;function S(L){try{V(Y['next'](L));}catch(N){G(N);}}function q(L){const Om=a1g;try{V(Y[Om(0xe0)](L));}catch(N){G(N);}}function V(e){const Oo=a1g;e['done']?n(e[Oo(0x121)]):y(e[Oo(0x121)])[Oo(0x124)](S,q);}V((Y=Y[Ov(0xee)](O,g||[]))['next']());});},__importDefault=this&&this[a1ON(0x1e2)]||function(O){const Oa=a1ON;return O&&O[Oa(0x1e6)]?O:{'default':O};};function a1O(){const Ou=['backups','login','enablePositionalOptions','__esModule','jobId','assertContextExisting','1034UhNGmh','secrets','runId','verbose','agent','OPTIONAL:\x20','loadAll','invoices','asyncSequential','find','prj','CliFileCopy','ApiClientFileContextProvider','askForBuild','VERBOSE:\x20Request\x20body\x20->\x20','pipelineId','services',',\x20NF\x20error\x20id:\x20','askForTag','base','isArray','throw','host','method','askForService','startsWith','./defaults','Documentation:\x20','askForSubdomain','list','Update\x20Northflank\x20','template','Get\x20information\x20about\x20Northflank\x20','getCommandOverview','retrievePayloadViaInteractiveCli','apply','getLogsCommand','paginationArgs','skipValidation','boolean','backup-destination','green','.yaml','includes','defaults','-f,\x20--file\x20<file-path>','isPaginatedEndpoint','2QRvECD','plan','api.','VERBOSE:\x20HTTP_PROXY\x20or\x20HTTPS_PROXY\x20environment\x20variable\x20set:\x20tunnelling\x20traffic\x20through\x20HTTP\x20proxy.','askForJob','lodash','uploadCmd','helpOption','portFwdCmd','tags','grey','Northflank\x20cli\x20version:\x20','force','(HTTP\x20status\x20code:\x20','logSinkId','askForDomain','service','printAsTable','askForClusterId','\x0a\x09details\x20:','bind','option','prototype','regions','kebabCase','volume','all','secret','aliases','nonInteractiveEndpoint','getCurrentProjectName','description','backup','rgn','-i,\x20--input\x20<resource-def>','runs','subdomainPath','25zztwLw','381607VScmNF','value','type','assign','then','Command','keys','log','askForBackupDestination','yml','getCommand','yaml','backupDestinationId','@northflank/js-client','upperFirst','askForCredentials','\x20properties','execCmd','askForSecret','hasOwnProperty','templateRunId','filter','default','repositories','pagination','readFileSync','558270iyBZHj','backupId','downloadCmd','domainId','exitCode','askForAddonBackup','opts','/docs/v1/api/','pln','serviceId','delete','./copy','count','askForVolume','getCurrentJobName','./context/contextCommands','sort','-v,\x20--version','../package.json','__setModuleDefault','File\x20does\x20not\x20exist:\x20','secretId','noDefaults','subdomainId','required','5400333ofMMEV','1876296xReeot','./formatting/console-format-helpers','clearLine','adn','VERBOSE:\x20Using\x20endpoint\x20->\x20','docsTagsPath','error','Display\x20help\x20for\x20command','branches','askForProject','Failed\x20to\x20validate\x20input\x20(incorrect\x20format):\x20','\x0a>\x20Token\x20permissions\x20required:\x20','output','parse','subdomain','resource','dmn','getOwnPropertyDescriptor','forEach','pop','stringify','addCommand','addon','resourceTagId','\x20--','get','has','projects','length','263964srRRCk','omit','domain','getProgram','scrt','InquirerHelper','create','map','repo','clusterId','askConfirm','file','askGeneric','inv','jobs','deleteWarningPrompt','branch','brn','url','project','there\x20are\x20more\x20rows,\x20load?','contexts','API\x20request\x20failed\x0a\x09Message:\x20','body','askForTemplate',',\x20-','set','parseAsync','GetApiEndpointPaginated','moveCursor','job','path','join','addons','getOwnPropertyNames','toUpperCase','CliMetrics','name','custom-columns=','stdout','getMetricsCommand','statusText','credentialId','172336ZcLiEp','addHelpCommand','isString','toString','defineProperty','safeLoad','getCurrentServiceName','askForSubdomainPath','query','10wmLHyd','opt','concat','isEqual','credential','request','handleJsonOutput','entries','chalk','vol','repos','underline','askForJobRun','File\x20to\x20load\x20resource\x20json\x20from','./inquirer-helper','=>\x20running\x20command\x20with:\x20','version','customUserAgent','existsSync','./metrics','Expecting\x20resource\x20input\x20with\x20\x27--input\x27\x20or\x20\x27--file\x27\x20argument','JSON-formatted\x20resource\x20definition,\x20takes\x20precedence\x20over\x20\x22--file\x22','warning','proxyEnvsSet','some','getCurrentContext','projectId','cred','hasNextPage','getNextPage','split','tpl','plans','56YfabdL','rawResponse','requiredPermissions','call','configurable','askForLogSink','buildId','Manage\x20your\x20Northflank\x20resources\x20from\x20the\x20command\x20line','Unknown\x20input\x20file\x20type:\x20','toLowerCase','northflank','templateId','ApiClient','cursor','--verbose','\x20Northflank\x20resources','volumeId','addonId','data','logs','message','argv','quiet','Error\x20occured\x20while\x20trying\x20to\x20run\x20command,\x20error:\x20','endsWith','2420108EiETtQ','./utils','__importStar','__importDefault'];a1O=function(){return Ou;};return a1O();}Object[a1ON(0x1a0)](exports,a1ON(0x1e6),{'value':!![]}),exports[a1ON(0x174)]=void 0x0;const js_client_1=require(a1ON(0x12d)),commander_1=__importDefault(require('commander')),fs_1=__importDefault(require('fs')),chalk_1=__importDefault(require(a1ON(0x1ad))),_=__importStar(require(a1ON(0xff))),contextCommands_1=require(a1ON(0x149)),utils_1=require(a1ON(0x1e0)),defaults=__importStar(require(a1ON(0xe5))),inquirer_helper_1=require(a1ON(0x1b3)),console_format_helpers_1=require(a1ON(0x155)),command_overview_1=require('./formatting/command-overview'),port_forward_1=require('./port-forward'),exec_1=require('./exec'),logs_1=require('./logs'),metrics_1=require(a1ON(0x1b8)),copy_1=require(a1ON(0x145)),yaml=require('js-yaml'),pgk=require(a1ON(0x14c)),getProgram=O=>{const Oz=a1ON,g=new commander_1[(Oz(0x136))][(Oz(0x125))](Oz(0x1d0));g[Oz(0x119)](Oz(0x1cd)),g[Oz(0x1e5)](!![]),g[Oz(0x1b5)](Oz(0x105)+chalk_1['default'][Oz(0x1b0)](pgk['version']),Oz(0x14b),'Print\x20the\x20current\x20version\x20of\x20the\x20Northflank\x20cli');const R=new js_client_1[(Oz(0x1d2))](O,{'throwErrorOnHttpErrorCode':![],'customUserAgent':utils_1[Oz(0x1b6)],'agent':utils_1['agent']}),Y=new contextCommands_1['CliContext'](R,utils_1[Oz(0x1ed)]),y=new port_forward_1['CliPortForward'](O,utils_1[Oz(0x1ed)]),n=new exec_1['CliExec'](O,utils_1[Oz(0x1ed)]),G=new copy_1[(Oz(0xd6))](O,utils_1[Oz(0x1ed)]),S=new logs_1['CliLogs'](O,utils_1['agent']),q=new metrics_1[(Oz(0x195))](O,utils_1[Oz(0x1ed)]);return g[Oz(0x169)](y[Oz(0x102)]),g['addCommand'](n[Oz(0x131)]),g['addCommand'](G[Oz(0x13c)]),g[Oz(0x169)](G[Oz(0x100)]),g[Oz(0x169)](Y[Oz(0x1e4)]),g[Oz(0x169)](Y[Oz(0x186)]),generateCommands(R,R['endpoints'],g,S,q),g['addCommand']((0x0,command_overview_1[Oz(0xec)])(g)),g[Oz(0x19d)](!![],Oz(0x15b)),g[Oz(0x101)](undefined,'Display\x20help\x20for\x20command'),g;};exports[a1ON(0x174)]=getProgram,((()=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const OW=a1ON;try{const O=new js_client_1[(OW(0xd7))]();yield(0x0,utils_1['checkUpdate'])(O);const g=(0x0,exports[OW(0x174)])(O);yield g[OW(0x18c)](process[OW(0x1db)]);}catch(R){(0x0,utils_1[OW(0x15a)])(OW(0x1dd)+R[OW(0x1da)]),process[OW(0x1db)][OW(0xd4)](Y=>Y===OW(0x1d4))&&console[OW(0x127)](R),process[OW(0x13e)]=0x1;}}))());function isListCommand(O){const OX=a1ON,g=[[OX(0x16d),OX(0x16a),OX(0x1e3)],[OX(0x16d),'job',OX(0x11d)]];return O[OX(0xd4)](R=>R===OX(0xe8))||g[OX(0x1bd)](R=>_[OX(0x1a8)](O,R));}function generateCommands(O,g,R,Y,y,n=defaults[a1ON(0xf7)],G=[]){const OM=a1ON,S=new inquirer_helper_1[(OM(0x176))](new js_client_1[(OM(0x1d2))](O['contextProvider'],{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1[OM(0x1b6)],'agent':utils_1['agent']}));function q(N,b){const Ol=OM;return N[Ol(0x152)]!==![]&&b===undefined;}function V(N,b){const OC=OM,{opt:E,name:p}=N,F=E['default'],m=q(E,F),o=M=>M['length']>0x1?'--'+M:'-'+M,v=E===null||E===void 0x0?void 0x0:E['alias'],a=v?_[OC(0xdf)](v)?'-'+(v===null||v===void 0x0?void 0x0:v[OC(0x178)](M=>o(M))[OC(0x191)](OC(0x18a)))+',':''+o(v):'',z=m?'':OC(0xd0),W=typeof E[OC(0x122)]==='boolean'||E[OC(0x122)]===OC(0xf2)?a+OC(0x16c)+p:a+'\x20--'+p+'\x20<'+p[OC(0x194)]()+'>',X=z+E['description'];b[OC(0x10f)](W,X,F);}function e(N,b){const OK=OM;if(b['commands'][OK(0x1bd)](E=>E[OK(0x196)]()===OK(0x1d9)))return;_['isEqual'](N,[OK(0x16d),OK(0x10a)])&&(b[OK(0x169)](Y[OK(0xef)]('service')),b[OK(0x169)](y[OK(0x199)]('service')),b[OK(0x169)](Y[OK(0xef)](OK(0x10a),!![])),b[OK(0x169)](y[OK(0x199)]('service',!![]))),_[OK(0x1a8)](N,[OK(0x16d),'job'])&&(b[OK(0x169)](Y['getLogsCommand'](OK(0x18f))),b[OK(0x169)](y[OK(0x199)](OK(0x18f))),b['addCommand'](Y['getLogsCommand'](OK(0x18f),!![])),b['addCommand'](y[OK(0x199)](OK(0x18f),!![]))),_['isEqual'](N,[OK(0x16d),OK(0x16a)])&&(b[OK(0x169)](Y[OK(0xef)]('addon')),b[OK(0x169)](y[OK(0x199)]('addon'))),_['isEqual'](N,[OK(0x16d),OK(0x16a),OK(0x11a)])&&b['addCommand'](Y[OK(0xef)](OK(0x16a),![],!![])),_[OK(0x1a8)](N,[OK(0x16d),'addon','restores'])&&b['addCommand'](Y[OK(0xef)](OK(0x16a),![],!![],!![]));}return Object[OM(0x193)](n)[OM(0x166)](N=>{const OH=OM,b=g[N],E=n[N],p=G[OH(0x1a7)]([N]);function F(C,K){const Of=OH,H=Object[Of(0x193)](C||{});H[Of(0x178)](f=>{return{'name':f,'opt':C[f]};})[Of(0x14a)]((f,i)=>!q(f['opt'])?!q(i[Of(0x1a6)])?0x0:0x1:-0x1)['forEach'](f=>{V(f,K);});}function m(C,K){const Oi=OH,H=[[Oi(0x184),Oi(0x16f),Oi(0xd5)],[Oi(0x10a),Oi(0xdb),'svc'],['credentials',Oi(0x1a9),Oi(0x1c0)],['addon',Oi(0x192),Oi(0x157)],[Oi(0x18f),Oi(0x17f)],[Oi(0xfb),Oi(0x1c5),Oi(0x142)],['region',Oi(0x111),Oi(0x11b)],['domain','domains',Oi(0x164)],[Oi(0x115),Oi(0x1ea),Oi(0x175)],['volumes',Oi(0x113),Oi(0x1ae)],[Oi(0x15c),Oi(0x181),Oi(0x182)],['invoice',Oi(0xd2),Oi(0x17e)],[Oi(0xea),'templates',Oi(0x1c4)],[Oi(0x1af),'repository',Oi(0x137),Oi(0x179)],[Oi(0xf3),'backup-destinations'],['tag',Oi(0x103)]],f=H[Oi(0xd4)](i=>i[Oi(0xf6)](K));if(f!==undefined)C[Oi(0x116)](f[Oi(0x135)](i=>i!==K));}function o(C){var K,H;return __awaiter(this,void 0x0,void 0x0,function*(){const OA=a1g,f={},{contextProvider:i}=O,A=p[OA(0xf6)](OA(0x144)),Z=C[OA(0x150)]===!![];function c(U,d,r){var j,t;return __awaiter(this,void 0x0,void 0x0,function*(){const OZ=a1g;if(_[OZ(0x16e)]((t=(j=E[OZ(0x1a6)])===null||j===void 0x0?void 0x0:j[OZ(0x190)])!==null&&t!==void 0x0?t:{},U)){const Q=!Z&&!A&&r?r():undefined,T=C[U]||Q||(yield d());_[OZ(0x18b)](f,U,T);}});}return yield(0x0,utils_1[OA(0xd3)])(Object[OA(0x1ac)]((H=(K=E['opt'])===null||K===void 0x0?void 0x0:K[OA(0x190)])!==null&&H!==void 0x0?H:{}),([U,d])=>__awaiter(this,void 0x0,void 0x0,function*(){const Oc=OA;var r;const j=f===null||f===void 0x0?void 0x0:f['projectId'],t=f===null||f===void 0x0?void 0x0:f[Oc(0x1d1)];switch(U){case Oc(0x1bf):return yield c('projectId',S[Oc(0x15d)][Oc(0x10e)](S),i[Oc(0x118)]['bind'](i));case Oc(0x143):return yield c(Oc(0x143),S[Oc(0xe3)](j)[Oc(0x10e)](S),i[Oc(0x1a2)][Oc(0x10e)](i));case Oc(0x1d7):return yield c(Oc(0x1d7),S['askForAddon'](j)[Oc(0x10e)](S));case Oc(0x1e7):return yield c(Oc(0x1e7),S[Oc(0xfe)](j)['bind'](S),i[Oc(0x148)]['bind'](i));case Oc(0x1eb):return yield c(Oc(0x1eb),S[Oc(0x1b1)](f[Oc(0x1e7)],j,![])[Oc(0x10e)](S));case Oc(0x14f):return yield c(Oc(0x14f),S[Oc(0x132)](j)[Oc(0x10e)](S));case Oc(0x173):case Oc(0x13d):return yield c(Oc(0x173),S[Oc(0x109)][Oc(0x10e)](S));case Oc(0x19b):return yield c(Oc(0x19b),S[Oc(0x12f)]['bind'](S));case Oc(0x1d6):return yield c(Oc(0x1d6),S[Oc(0x147)](j)[Oc(0x10e)](S));case Oc(0x162):return yield c(Oc(0x162),S[Oc(0xe7)](f[Oc(0x173)])[Oc(0x10e)](S));case Oc(0x151):return yield c(Oc(0x151),S[Oc(0xe7)](f['domainId'])[Oc(0x10e)](S));case Oc(0x11e):return yield c(Oc(0x11e),S[Oc(0x1a3)](f[Oc(0x173)],(r=f[Oc(0x162)])!==null&&r!==void 0x0?r:f[Oc(0x151)])[Oc(0x10e)](S));case Oc(0x13b):return yield c(Oc(0x13b),S[Oc(0x13f)](j,f[Oc(0x1d7)])['bind'](S));case Oc(0x1cc):return yield c(Oc(0x1cc),S[Oc(0xd8)](j,f[Oc(0x143)],f[Oc(0x1e7)])['bind'](S));case Oc(0x1d1):return yield c(Oc(0x1d1),S[Oc(0x189)]()[Oc(0x10e)](S));case Oc(0x134):return yield c(Oc(0x134),S['askForTemplateRun'](t)[Oc(0x10e)](S));case Oc(0x108):return yield c('logSinkId',S[Oc(0x1cb)]()[Oc(0x10e)](S));case'pipelineId':return yield c(Oc(0xda),S['askForPipeline'](j)[Oc(0x10e)](S));case Oc(0x16b):return yield c(Oc(0x16b),S[Oc(0xdd)]()['bind'](S));case Oc(0x12c):return yield c(Oc(0x12c),S[Oc(0x128)]()['bind'](S));case Oc(0x17a):return yield c(Oc(0x17a),S[Oc(0x10c)]()[Oc(0x10e)](S));default:return yield c(U,S[Oc(0x17d)](U,d===null||d===void 0x0?void 0x0:d[Oc(0x119)])['bind'](S));}})),f;});}function v(C){var K,H,f;return __awaiter(this,void 0x0,void 0x0,function*(){const OU=a1g,i={},A=((K=E[OU(0x1a6)])===null||K===void 0x0?void 0x0:K[OU(0xf9)])?defaults['paginationArgs']:{},Z=Object['assign'](Object[OU(0x123)]({},(f=(H=E[OU(0x1a6)])===null||H===void 0x0?void 0x0:H[OU(0x1a4)])!==null&&f!==void 0x0?f:{}),A),c=Object[OU(0x126)](Z)[OU(0x135)](U=>U!==OU(0xd1));return yield(0x0,utils_1['asyncSequential'])(c,U=>__awaiter(this,void 0x0,void 0x0,function*(){const Od=OU;if(C[U]!==undefined)return _[Od(0x18b)](i,U,C[U]);})),i;});}function a(){const Or=OH;switch(p[0x0]){case Or(0x16d):return Or(0xeb)+(p[0x1]||Or(0x163))+'s';case'update':return Or(0xe9)+(p[0x1]||Or(0x163))+Or(0x130);default:return _[Or(0x12e)](N)+Or(0x1d5);}}function z(C,K){const Oj=OH;var H,f,i,A,Z,c,U,d;if(!K){const k=(0x0,utils_1[Oj(0x12a)])()[Oj(0x196)](_[Oj(0x112)](N))[Oj(0x119)](a());return m(k,N),k;}const r=(C===null||C===void 0x0?void 0x0:C[Oj(0x1c8)])?chalk_1[Oj(0x136)][Oj(0x104)](Oj(0x15f)+C['requiredPermissions']):'',j=O['contextProvider'][Oj(0x1be)](),t=j!==undefined&&((H=E===null||E===void 0x0?void 0x0:E['opt'])===null||H===void 0x0?void 0x0:H[Oj(0x159)])!==undefined,Q=j===null||j===void 0x0?void 0x0:j[Oj(0xe1)]['replace'](Oj(0xfc),''),T=t?Oj(0xe6)+Q+Oj(0x141)+((f=E===null||E===void 0x0?void 0x0:E[Oj(0x1a6)])===null||f===void 0x0?void 0x0:f[Oj(0x159)]):'',u=(C===null||C===void 0x0?void 0x0:C[Oj(0x119)])||'',I=(0x0,utils_1[Oj(0x12a)])(!![])['name'](_[Oj(0x112)](N))['description'](u)['addHelpText']('after',[r,T]['join']('\x0a'));m(I,N);(((i=E['opt'])===null||i===void 0x0?void 0x0:i['body'])||((A=E['opt'])===null||A===void 0x0?void 0x0:A[Oj(0x117)]))&&(I[Oj(0x10f)](Oj(0xf8),Oj(0x1b2)),I[Oj(0x10f)](Oj(0x11c),Oj(0x1ba)));F((Z=E[Oj(0x1a6)])===null||Z===void 0x0?void 0x0:Z['path'],I),F((c=E[Oj(0x1a6)])===null||c===void 0x0?void 0x0:c[Oj(0x1a4)],I);const x=(U=E[Oj(0x1a6)])===null||U===void 0x0?void 0x0:U[Oj(0xf9)];return x&&F(defaults[Oj(0xf0)],I),F((d=E['opt'])===null||d===void 0x0?void 0x0:d[Oj(0xde)],I),I['action'](()=>__awaiter(this,void 0x0,void 0x0,function*(){const Ot=Oj;var s,P,B,w,J,h;(0x0,utils_1[Ot(0x1e8)])(O);const D=I[Ot(0x140)]();(D===null||D===void 0x0?void 0x0:D[Ot(0x1ec)])&&utils_1[Ot(0x1bc)]&&(0x0,utils_1[Ot(0x1bb)])(Ot(0xfd));const O0=D['page']!==undefined||D[Ot(0x1d3)]!==undefined;if(D[Ot(0xd1)]===!![]&&O0)throw new Error('Options\x20\x27loadAll\x27\x20can\x20not\x20be\x20combined\x20with\x20\x27page\x27\x20or\x20\x27cursor\x27');const O1=D===null||D===void 0x0?void 0x0:D[Ot(0x160)],O2=O1==='json',O3=O1===Ot(0x12b)||O1===Ot(0x129),O4=yield o(D);S['setPathVars'](O4);const O5=yield v(D),O6=Object[Ot(0x126)]((P=(s=E[Ot(0x1a6)])===null||s===void 0x0?void 0x0:s[Ot(0x190)])!==null&&P!==void 0x0?P:{})[Ot(0x178)](Og=>Og+'='+chalk_1['default'][Ot(0xf4)](O4[Og]))[Ot(0x191)](',\x20');if(O6['length']>0x0&&!O2&&!O3){const Og=Ot(0x1b4)+O6;console['log'](Og);}const O7=((B=E[Ot(0x1a6)])===null||B===void 0x0?void 0x0:B[Ot(0x188)])||((w=E[Ot(0x1a6)])===null||w===void 0x0?void 0x0:w[Ot(0x117)])?yield L(D,E,p):undefined;if(!D[Ot(0x106)]&&p['includes'](Ot(0x144))&&!(yield S[Ot(0x180)]())){(0x0,utils_1[Ot(0x1bb)])('Resource\x20was\x20not\x20deleted.');return;}const O8=x&&(D['loadAll']||(D[Ot(0x160)]==='json'||D['output']===Ot(0x12b))&&!O0);let O9=O8&&b instanceof js_client_1[Ot(0x18d)]?yield b[Ot(0x114)]({'parameters':O4,'options':O5,'data':O7}):yield b['call']({'parameters':O4,'options':Object[Ot(0x123)]({},O5),'data':O7});if(D===null||D===void 0x0?void 0x0:D['verbose']){const OR=O9[Ot(0x1aa)];console[Ot(0x127)](Ot(0x158)+OR[Ot(0xe2)][Ot(0x194)]()+':'+OR[Ot(0x183)]);if(O7!==undefined)console[Ot(0x127)](Ot(0xd9)+O7);}if(O9['error']){const {details:OY,id:Oy,message:On,status:OG}=O9[Ot(0x15a)],OS=OY?Ot(0x10d)+JSON[Ot(0x168)](OY):'',Oq=Oy?Ot(0xdc)+Oy:'',OV=Ot(0x107)+OG+Oq+')';throw new Error(Ot(0x187)+On+'\x20'+OV+OS);}let OO=0x0;printCallResult(D,O2,O9[Ot(0x1d8)],O3,p,O1,![],OO,O9[Ot(0x1c7)][Ot(0x19a)]);if(!D[Ot(0x1dc)]&&!O8&&!O0&&((J=O9[Ot(0x138)])===null||J===void 0x0?void 0x0:J[Ot(0x1c1)]))while((h=O9[Ot(0x138)])===null||h===void 0x0?void 0x0:h[Ot(0x1c1)]){const Oe=yield S[Ot(0x17b)](Ot(0x185));if(Oe)process[Ot(0x198)][Ot(0x18e)](0x0,-0x1),process['stdout'][Ot(0x156)](0x1),OO+=O9['pagination'][Ot(0x146)],O9=yield O9[Ot(0x138)][Ot(0x1c2)](),printCallResult(D,O2,O9[Ot(0x1d8)],O3,p,O1,!![],OO,O9['rawResponse']['statusText']);else return;}})),I;}const W=_[OH(0x16e)](E,'opt'),X=b,M=z(X,W);e(p,M),R['addCommand'](M);const l=_[OH(0x172)](E,OH(0x1a6));Object[OH(0x126)](l)[OH(0x170)]>0x0&&generateCommands(O,b,M,Y,y,l,p);});function L(N,b,E){var p;return __awaiter(this,void 0x0,void 0x0,function*(){const OQ=a1g,{input:F,file:m}=N;if(F!==undefined)try{return JSON[OQ(0x161)](F);}catch(o){try{return yaml['safeLoad'](F);}catch(v){throw new Error('Unknown\x20input\x20format.\x20Not\x20valid\x20json\x20and\x20not\x20valid\x20yaml.');}}if(m!==undefined){if(!fs_1['default'][OQ(0x1b7)](m))throw new Error(OQ(0x14e)+m);const a=fs_1['default'][OQ(0x139)](m)[OQ(0x19f)]();let z;try{if(_[OQ(0x19e)](a)){if(N[OQ(0x17c)][OQ(0x1de)]('.json'))z=JSON[OQ(0x161)](a);else{if(N['file']['endsWith'](OQ(0xf5))||N[OQ(0x17c)][OQ(0x1de)](OQ(0x129)))z=yaml[OQ(0x1a1)](a);else throw new Error(OQ(0x1ce)+N[OQ(0x17c)][OQ(0x1c3)]('.')[OQ(0x167)]());}}else z=a;return z;}catch(W){throw new Error(OQ(0x15e)+W[OQ(0x1da)]);}}if((p=b===null||b===void 0x0?void 0x0:b['opt'])===null||p===void 0x0?void 0x0:p[OQ(0x117)])throw new Error(OQ(0x1b9));return yield S[OQ(0xed)](b,{'cmdPath':E,'skipValidation':N[OQ(0xf1)]});});}}const printCallResult=(O,g,R,Y,y,n,G,S,q)=>{const OT=a1ON;if(!(O===null||O===void 0x0?void 0x0:O[OT(0x1dc)])){if(g)(0x0,console_format_helpers_1[OT(0x1ab)])(O===null||O===void 0x0?void 0x0:O[OT(0x160)],R);else{if(Y)(0x0,console_format_helpers_1['handleYamlOutput'])(O===null||O===void 0x0?void 0x0:O['output'],R);else{if(isListCommand(y)){const V=(n===null||n===void 0x0?void 0x0:n[OT(0xe4)](OT(0x197)))?n['replace'](OT(0x197),'')['split'](',')[OT(0x178)](E=>E[OT(0x1cf)]()):undefined,e=y[y[OT(0x170)]-0x1],L=''+e+(e[OT(0x1de)]('s')?'':'s'),N=_[OT(0x12e)](L),b=_['has'](R,L)?R[L]:R;(0x0,console_format_helpers_1[OT(0x10b)])(b,N,V,G,S);}else console[OT(0x127)]((0x0,console_format_helpers_1['consoleFormat'])(R,q));}}}};
2
+ 'use strict';const a1jX=a1h;function a1h(j,h){const N=a1j();return a1h=function(F,K){F=F-0xc7;let G=N[F];return G;},a1h(j,h);}(function(j,h){const jI=a1h,N=j();while(!![]){try{const F=-parseInt(jI(0x1ae))/0x1*(-parseInt(jI(0x13e))/0x2)+-parseInt(jI(0x109))/0x3+parseInt(jI(0x170))/0x4*(parseInt(jI(0xd4))/0x5)+parseInt(jI(0x157))/0x6*(parseInt(jI(0x1d3))/0x7)+-parseInt(jI(0x184))/0x8+parseInt(jI(0xeb))/0x9*(parseInt(jI(0xfb))/0xa)+parseInt(jI(0x1af))/0xb*(-parseInt(jI(0x198))/0xc);if(F===h)break;else N['push'](N['shift']());}catch(K){N['push'](N['shift']());}}}(a1j,0xc1f6e));function a1j(){const jT=['12rXiWKt','runId','resourceTagId','replace','File\x20to\x20load\x20resource\x20json\x20from','getCurrentProjectName','pop','requiredPermissions','getCommand','services','done','buildId','Resource\x20was\x20not\x20deleted.','getNextPage','asyncSequential','Error\x20occured\x20while\x20trying\x20to\x20run\x20command,\x20error:\x20','askForJobRun','request','call','split','then','some','printAsTable','ApiClient','path','5520aHOJLa','proxyEnvsSet','type','jobs','repository','paginationArgs','defineProperty','templateId','aliases','askForTemplateRun','domainId','CliContext','Update\x20Northflank\x20','Display\x20help\x20for\x20command','forEach','askForPipeline','yml','checkUpdate','customUserAgent','value','12340760xtQTiD','subdomainId','safeLoad','Northflank\x20cli\x20version:\x20','helpOption','backup-destination','getCommandOverview','pipelineId','.yaml','__createBinding','invoice','getMetricsCommand','askForJob','noDefaults',',\x20-','repos','next','-f,\x20--file\x20<file-path>','cursor','rgn','1527528veLvNA','update','repo','CliLogs','getLogsCommand','omit','delete','bind','askForSubdomain','argv','error','branches','verbose','API\x20request\x20failed\x0a\x09Message:\x20','clusterId','chalk','jobId','nonInteractiveEndpoint','setPathVars','askForBuild','getOwnPropertyNames','-v,\x20--version','30662NyMMdi','66PzRwVx','./metrics','Expecting\x20resource\x20input\x20with\x20\x27--input\x27\x20or\x20\x27--file\x27\x20argument','File\x20does\x20not\x20exist:\x20','stdout','scrt','docsTagsPath','\x20--','warning','tags','commander','Manage\x20your\x20Northflank\x20resources\x20from\x20the\x20command\x20line','exitCode','login','__esModule','subdomain','tag','regions','toString','projects','./defaults','Unknown\x20input\x20file\x20type:\x20','CliPortForward','file','restores','addonId','./exec','upperFirst','version','getCurrentJobName','parse','Get\x20information\x20about\x20Northflank\x20','json',',\x20NF\x20error\x20id:\x20','alias','CliFileCopy','3489017mwQENg','agent','kebabCase','underline','keys','projectId','-i,\x20--input\x20<resource-def>','create','volumeId','isEqual','toUpperCase','getProgram','volumes','name','GetApiEndpointPaginated','all','getCurrentContext','adn','cred','deleteWarningPrompt','\x20properties','includes','CliMetrics','3180bEXepZ','log','hasOwnProperty','hasNextPage','askForLogSink','volume','length','/docs/v1/api/','domain','prototype','ApiClientFileContextProvider','rawResponse','join','credentials','consoleFormat','__awaiter','addHelpCommand','askForTag','northflank','js-yaml','(HTTP\x20status\x20code:\x20','VERBOSE:\x20Using\x20endpoint\x20->\x20','isPaginatedEndpoint','5363721odCqMh','../package.json','askConfirm','sort','askForCredentials','existsSync','addons','opt','./utils','api.','boolean','opts','custom-columns=','svc','./formatting/command-overview','service','20uSllix','askForService','askForDomain','contextProvider','invoices','writable','pagination','message','secrets','Failed\x20to\x20validate\x20input\x20(incorrect\x20format):\x20','Options\x20\x27loadAll\x27\x20can\x20not\x20be\x20combined\x20with\x20\x27page\x27\x20or\x20\x27cursor\x27','assign','get','body','1184733ZkYPiF','contexts','statusText','grey','default','option','startsWith','has','map','getCurrentServiceName','prj','askForProject','askForAddonBackup','apply','askForBackupDestination','addHelpText','configurable','serviceId','clearLine','template','repositories','find','job','quiet','Print\x20the\x20current\x20version\x20of\x20the\x20Northflank\x20cli','resource','stringify','JSON-formatted\x20resource\x20definition,\x20takes\x20precedence\x20over\x20\x22--file\x22','.json','assertContextExisting','entries','count','branch','output','skipValidation','Unknown\x20input\x20format.\x20Not\x20valid\x20json\x20and\x20not\x20valid\x20yaml.','secretId','there\x20are\x20more\x20rows,\x20load?','subdomainPath','yaml','page','endsWith','askForTemplate','toLowerCase','addCommand','askForSubdomainPath','brn','askForAddon','method','backupDestinationId','loadAll','pln','domains','28Riyeom','set','backup','--verbose','handleYamlOutput','region','VERBOSE:\x20Request\x20body\x20->\x20','logs','isString','dmn','Documentation:\x20','Command','downloadCmd','query','\x20Northflank\x20resources','./port-forward','addon','./context/contextCommands','commands','required','handleJsonOutput','description','plan','enablePositionalOptions','credentialId'];a1j=function(){return jT;};return a1j();}var __createBinding=this&&this[a1jX(0x18d)]||(Object[a1jX(0x1da)]?function(j,h,N,F){const jl=a1jX;if(F===undefined)F=N;var K=Object['getOwnPropertyDescriptor'](h,N);(!K||(jl(0x107)in K?!h[jl(0x1bd)]:K[jl(0x100)]||K[jl(0x119)]))&&(K={'enumerable':!![],'get':function(){return h[N];}}),Object[jl(0x176)](j,F,K);}:function(j,h,N,F){if(F===undefined)F=N;j[F]=h[N];}),__setModuleDefault=this&&this['__setModuleDefault']||(Object['create']?function(j,h){const jp=a1jX;Object[jp(0x176)](j,jp(0x10d),{'enumerable':!![],'value':h});}:function(j,h){j['default']=h;}),__importStar=this&&this['__importStar']||function(j){const jJ=a1jX;if(j&&j[jJ(0x1bd)])return j;var h={};if(j!=null){for(var N in j)if(N!==jJ(0x10d)&&Object[jJ(0xdd)][jJ(0xd6)][jJ(0x169)](j,N))__createBinding(h,j,N);}return __setModuleDefault(h,j),h;},__awaiter=this&&this[a1jX(0xe3)]||function(j,h,N,F){function K(G){return G instanceof N?G:new N(function(d){d(G);});}return new(N||(N=Promise))(function(G,d){const jD=a1h;function x(I){const jQ=a1h;try{e(F[jQ(0x194)](I));}catch(X){d(X);}}function m(I){try{e(F['throw'](I));}catch(X){d(X);}}function e(I){const jy=a1h;I[jy(0x161)]?G(I[jy(0x183)]):K(I[jy(0x183)])[jy(0x16b)](x,m);}e((F=F[jD(0x116)](j,h||[]))[jD(0x194)]());});},__importDefault=this&&this['__importDefault']||function(j){const ji=a1jX;return j&&j[ji(0x1bd)]?j:{'default':j};};Object[a1jX(0x176)](exports,a1jX(0x1bd),{'value':!![]}),exports[a1jX(0xc8)]=void 0x0;const js_client_1=require('@northflank/js-client'),commander_1=__importDefault(require(a1jX(0x1b9))),fs_1=__importDefault(require('fs')),chalk_1=__importDefault(require(a1jX(0x1a7))),_=__importStar(require('lodash')),contextCommands_1=require(a1jX(0x14f)),utils_1=require(a1jX(0xf3)),defaults=__importStar(require(a1jX(0x1c3))),inquirer_helper_1=require('./inquirer-helper'),console_format_helpers_1=require('./formatting/console-format-helpers'),command_overview_1=require(a1jX(0xf9)),port_forward_1=require(a1jX(0x14d)),exec_1=require(a1jX(0x1c9)),logs_1=require('./logs'),metrics_1=require(a1jX(0x1b0)),copy_1=require('./copy'),yaml=require(a1jX(0xe7)),pgk=require(a1jX(0xec)),getProgram=j=>{const jW=a1jX,h=new commander_1[(jW(0x10d))][(jW(0x149))](jW(0xe6));h[jW(0x153)](jW(0x1ba)),h[jW(0x155)](!![]),h[jW(0x1cb)](jW(0x187)+chalk_1[jW(0x10d)][jW(0x1d6)](pgk[jW(0x1cb)]),jW(0x1ad),jW(0x121));const N=new js_client_1[(jW(0x16e))](j,{'throwErrorOnHttpErrorCode':![],'customUserAgent':utils_1[jW(0x182)],'agent':utils_1[jW(0x1d4)]}),F=new contextCommands_1[(jW(0x17b))](N,utils_1[jW(0x1d4)]),K=new port_forward_1[(jW(0x1c5))](j,utils_1[jW(0x1d4)]),G=new exec_1['CliExec'](j,utils_1[jW(0x1d4)]),d=new copy_1[(jW(0x1d2))](j,utils_1[jW(0x1d4)]),x=new logs_1[(jW(0x19b))](j,utils_1[jW(0x1d4)]),m=new metrics_1[(jW(0xd3))](j,utils_1[jW(0x1d4)]);return h[jW(0x135)](K['portFwdCmd']),h['addCommand'](G['execCmd']),h[jW(0x135)](d[jW(0x14a)]),h['addCommand'](d['uploadCmd']),h['addCommand'](F[jW(0x1bc)]),h[jW(0x135)](F[jW(0x10a)]),generateCommands(N,N['endpoints'],h,x,m),h[jW(0x135)]((0x0,command_overview_1[jW(0x18a)])(h)),h[jW(0xe4)](!![],jW(0x17d)),h[jW(0x188)](undefined,jW(0x17d)),h;};exports[a1jX(0xc8)]=getProgram,((()=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const jE=a1jX;try{const j=new js_client_1[(jE(0xde))]();yield(0x0,utils_1[jE(0x181)])(j);const h=(0x0,exports[jE(0xc8)])(j);yield h['parseAsync'](process[jE(0x1a1)]);}catch(N){(0x0,utils_1[jE(0x1a2)])(jE(0x166)+N[jE(0x102)]),process[jE(0x1a1)][jE(0x11e)](F=>F===jE(0x141))&&console[jE(0xd5)](N),process[jE(0x1bb)]=0x1;}}))());function isListCommand(j){const jt=a1jX,h=[[jt(0x107),jt(0x14e),'backups'],[jt(0x107),jt(0x11f),'runs']];return j[jt(0x11e)](N=>N==='list')||h[jt(0x16c)](N=>_[jt(0x1dc)](j,N));}function generateCommands(j,h,N,F,K,G=defaults['defaults'],d=[]){const jH=a1jX,x=new inquirer_helper_1['InquirerHelper'](new js_client_1[(jH(0x16e))](j[jH(0xfe)],{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1[jH(0x182)],'agent':utils_1[jH(0x1d4)]}));function m(X,l){const ja=jH;return X[ja(0x151)]!==![]&&l===undefined;}function P(X,l){const jq=jH,{opt:p,name:J}=X,Q=p[jq(0x10d)],y=m(p,Q),D=a=>a['length']>0x1?'--'+a:'-'+a,i=p===null||p===void 0x0?void 0x0:p[jq(0x1d1)],W=i?_['isArray'](i)?'-'+(i===null||i===void 0x0?void 0x0:i[jq(0x111)](q=>D(q))[jq(0xe0)](jq(0x192)))+',':''+D(i):'',E=y?'':'OPTIONAL:\x20',t=typeof p[jq(0x172)]===jq(0xf5)||p[jq(0x172)]===jq(0xf5)?W+jq(0x1b6)+J:W+'\x20--'+J+'\x20<'+J[jq(0xc7)]()+'>',H=E+p[jq(0x153)];l[jq(0x10e)](t,H,Q);}function e(X,l){const jR=jH;if(l[jR(0x150)][jR(0x16c)](p=>p['name']()===jR(0x145)))return;_[jR(0x1dc)](X,[jR(0x107),jR(0xfa)])&&(l['addCommand'](F[jR(0x19c)](jR(0xfa))),l[jR(0x135)](K['getMetricsCommand'](jR(0xfa))),l[jR(0x135)](F[jR(0x19c)](jR(0xfa),!![])),l[jR(0x135)](K[jR(0x18f)]('service',!![]))),_['isEqual'](X,[jR(0x107),jR(0x11f)])&&(l['addCommand'](F['getLogsCommand']('job')),l['addCommand'](K[jR(0x18f)](jR(0x11f))),l['addCommand'](F[jR(0x19c)]('job',!![])),l[jR(0x135)](K[jR(0x18f)](jR(0x11f),!![]))),_[jR(0x1dc)](X,['get','addon'])&&(l[jR(0x135)](F[jR(0x19c)](jR(0x14e))),l[jR(0x135)](K[jR(0x18f)](jR(0x14e)))),_[jR(0x1dc)](X,[jR(0x107),'addon',jR(0x140)])&&l[jR(0x135)](F[jR(0x19c)]('addon',![],!![])),_[jR(0x1dc)](X,[jR(0x107),jR(0x14e),jR(0x1c7)])&&l[jR(0x135)](F[jR(0x19c)](jR(0x14e),![],!![],!![]));}return Object[jH(0x1ac)](G)[jH(0x17e)](X=>{const jO=jH,l=h[X],p=G[X],J=d['concat']([X]);function Q(R,n){const jn=a1h,k=Object[jn(0x1ac)](R||{});k[jn(0x111)](L=>{return{'name':L,'opt':R[L]};})[jn(0xee)]((L,A)=>!m(L[jn(0xf2)])?!m(A['opt'])?0x0:0x1:-0x1)[jn(0x17e)](L=>{P(L,n);});}function y(R,n){const jk=a1h,k=[['project',jk(0x1c2),jk(0x113)],[jk(0xfa),jk(0x160),jk(0xf8)],[jk(0xe1),'credential',jk(0xcf)],[jk(0x14e),jk(0xf1),jk(0xce)],['job',jk(0x173)],[jk(0x154),'plans',jk(0x13c)],[jk(0x143),jk(0x1c0),jk(0x197)],['domain',jk(0x13d),jk(0x147)],['secret',jk(0x103),jk(0x1b4)],[jk(0xc9),jk(0xd9),'vol'],[jk(0x1a3),jk(0x129),jk(0x137)],[jk(0x18e),jk(0xff),'inv'],[jk(0x11c),'templates','tpl'],[jk(0x193),jk(0x174),jk(0x11d),jk(0x19a)],[jk(0x189),'backup-destinations'],[jk(0x1bf),jk(0x1b8)]],L=k['find'](A=>A[jk(0xd2)](n));if(L!==undefined)R[jk(0x178)](L['filter'](A=>A!==n));}function D(R){var n,k;return __awaiter(this,void 0x0,void 0x0,function*(){const jL=a1h,L={},{contextProvider:A}=j,v=J[jL(0xd2)](jL(0x19e)),s=R[jL(0x191)]===!![];function U(r,V,f){var O,z;return __awaiter(this,void 0x0,void 0x0,function*(){const jA=a1h;if(_[jA(0x110)]((z=(O=p['opt'])===null||O===void 0x0?void 0x0:O[jA(0x16f)])!==null&&z!==void 0x0?z:{},r)){const b=!s&&!v&&f?f():undefined,T=R[r]||b||(yield V());_[jA(0x13f)](L,r,T);}});}return yield(0x0,utils_1[jL(0x165)])(Object[jL(0x127)]((k=(n=p[jL(0xf2)])===null||n===void 0x0?void 0x0:n['path'])!==null&&k!==void 0x0?k:{}),([r,V])=>__awaiter(this,void 0x0,void 0x0,function*(){const jv=jL;var f;const O=L===null||L===void 0x0?void 0x0:L[jv(0x1d8)],z=L===null||L===void 0x0?void 0x0:L[jv(0x177)];switch(r){case'projectId':return yield U(jv(0x1d8),x[jv(0x114)][jv(0x19f)](x),A[jv(0x15c)]['bind'](A));case'serviceId':return yield U(jv(0x11a),x[jv(0xfc)](O)[jv(0x19f)](x),A[jv(0x112)]['bind'](A));case jv(0x1c8):return yield U(jv(0x1c8),x[jv(0x138)](O)[jv(0x19f)](x));case jv(0x1a8):return yield U('jobId',x[jv(0x190)](O)[jv(0x19f)](x),A[jv(0x1cc)][jv(0x19f)](A));case'runId':return yield U(jv(0x158),x[jv(0x167)](L[jv(0x1a8)],O,![])['bind'](x));case jv(0x12d):return yield U(jv(0x12d),x['askForSecret'](O)['bind'](x));case jv(0xdc):case jv(0x17a):return yield U(jv(0xdc),x[jv(0xfd)][jv(0x19f)](x));case'credentialId':return yield U(jv(0x156),x[jv(0xef)][jv(0x19f)](x));case jv(0x1db):return yield U(jv(0x1db),x['askForVolume'](O)['bind'](x));case jv(0x1be):return yield U(jv(0x1be),x[jv(0x1a0)](L[jv(0xdc)])[jv(0x19f)](x));case jv(0x185):return yield U(jv(0x185),x[jv(0x1a0)](L[jv(0x17a)])[jv(0x19f)](x));case jv(0x12f):return yield U(jv(0x12f),x[jv(0x136)](L[jv(0xdc)],(f=L[jv(0x1be)])!==null&&f!==void 0x0?f:L['subdomainId'])['bind'](x));case'backupId':return yield U('backupId',x[jv(0x115)](O,L[jv(0x1c8)])[jv(0x19f)](x));case jv(0x162):return yield U(jv(0x162),x[jv(0x1ab)](O,L[jv(0x11a)],L[jv(0x1a8)])['bind'](x));case jv(0x177):return yield U(jv(0x177),x[jv(0x133)]()[jv(0x19f)](x));case'templateRunId':return yield U('templateRunId',x[jv(0x179)](z)[jv(0x19f)](x));case'logSinkId':return yield U('logSinkId',x[jv(0xd8)]()[jv(0x19f)](x));case'pipelineId':return yield U(jv(0x18b),x[jv(0x17f)](O)['bind'](x));case jv(0x159):return yield U(jv(0x159),x[jv(0xe5)]()[jv(0x19f)](x));case'backupDestinationId':return yield U(jv(0x13a),x[jv(0x117)]()[jv(0x19f)](x));case jv(0x1a6):return yield U(jv(0x1a6),x['askForClusterId']()[jv(0x19f)](x));default:return yield U(r,x['askGeneric'](r,V===null||V===void 0x0?void 0x0:V[jv(0x153)])['bind'](x));}})),L;});}function i(R){var n,k,L;return __awaiter(this,void 0x0,void 0x0,function*(){const js=a1h,A={},v=((n=p[js(0xf2)])===null||n===void 0x0?void 0x0:n[js(0xea)])?defaults[js(0x175)]:{},s=Object[js(0x106)](Object[js(0x106)]({},(L=(k=p[js(0xf2)])===null||k===void 0x0?void 0x0:k['query'])!==null&&L!==void 0x0?L:{}),v),U=Object[js(0x1d7)](s)['filter'](r=>r!==js(0x13b));return yield(0x0,utils_1[js(0x165)])(U,r=>__awaiter(this,void 0x0,void 0x0,function*(){const jU=js;if(R[r]!==undefined)return _[jU(0x13f)](A,r,R[r]);})),A;});}function W(){const jr=a1h;switch(J[0x0]){case jr(0x107):return jr(0x1ce)+(J[0x1]||jr(0x122))+'s';case jr(0x199):return jr(0x17c)+(J[0x1]||jr(0x122))+jr(0xd1);default:return _[jr(0x1ca)](X)+jr(0x14c);}}function E(R,n){const jV=a1h;var k,L,A,v,s,U,r,V;if(!n){const Y=(0x0,utils_1[jV(0x15f)])()[jV(0xca)](_[jV(0x1d5)](X))[jV(0x153)](W());return y(Y,X),Y;}const f=(R===null||R===void 0x0?void 0x0:R['requiredPermissions'])?chalk_1[jV(0x10d)][jV(0x10c)]('\x0a>\x20Token\x20permissions\x20required:\x20'+R[jV(0x15e)]):'',O=j[jV(0xfe)][jV(0xcd)](),z=O!==undefined&&((k=p===null||p===void 0x0?void 0x0:p[jV(0xf2)])===null||k===void 0x0?void 0x0:k[jV(0x1b5)])!==undefined,b=O===null||O===void 0x0?void 0x0:O['host'][jV(0x15a)](jV(0xf4),''),T=z?jV(0x148)+b+jV(0xdb)+((L=p===null||p===void 0x0?void 0x0:p[jV(0xf2)])===null||L===void 0x0?void 0x0:L['docsTagsPath']):'',u=(R===null||R===void 0x0?void 0x0:R[jV(0x153)])||'',Z=(0x0,utils_1[jV(0x15f)])(!![])[jV(0xca)](_['kebabCase'](X))[jV(0x153)](u)[jV(0x118)]('after',[f,T][jV(0xe0)]('\x0a'));y(Z,X);(((A=p[jV(0xf2)])===null||A===void 0x0?void 0x0:A[jV(0x108)])||((v=p[jV(0xf2)])===null||v===void 0x0?void 0x0:v['nonInteractiveEndpoint']))&&(Z[jV(0x10e)](jV(0x195),jV(0x15b)),Z[jV(0x10e)](jV(0x1d9),jV(0x124)));Q((s=p[jV(0xf2)])===null||s===void 0x0?void 0x0:s[jV(0x16f)],Z),Q((U=p['opt'])===null||U===void 0x0?void 0x0:U[jV(0x14b)],Z);const S=(r=p[jV(0xf2)])===null||r===void 0x0?void 0x0:r[jV(0xea)];return S&&Q(defaults[jV(0x175)],Z),Q((V=p[jV(0xf2)])===null||V===void 0x0?void 0x0:V['base'],Z),Z['action'](()=>__awaiter(this,void 0x0,void 0x0,function*(){const jf=jV;var M,w,C,o,g,c;(0x0,utils_1[jf(0x126)])(j);const B=Z[jf(0xf6)]();(B===null||B===void 0x0?void 0x0:B[jf(0x1a4)])&&utils_1[jf(0x171)]&&(0x0,utils_1[jf(0x1b7)])('VERBOSE:\x20HTTP_PROXY\x20or\x20HTTPS_PROXY\x20environment\x20variable\x20set:\x20tunnelling\x20traffic\x20through\x20HTTP\x20proxy.');const j0=B[jf(0x131)]!==undefined||B[jf(0x196)]!==undefined;if(B[jf(0x13b)]===!![]&&j0)throw new Error(jf(0x105));const j1=B===null||B===void 0x0?void 0x0:B['output'],j2=j1==='json',j3=j1==='yaml'||j1===jf(0x180),j4=yield D(B);x[jf(0x1aa)](j4);const j5=yield i(B),j6=Object[jf(0x1d7)]((w=(M=p[jf(0xf2)])===null||M===void 0x0?void 0x0:M['path'])!==null&&w!==void 0x0?w:{})[jf(0x111)](jh=>jh+'='+chalk_1[jf(0x10d)]['green'](j4[jh]))[jf(0xe0)](',\x20');if(j6[jf(0xda)]>0x0&&!j2&&!j3){const jh='=>\x20running\x20command\x20with:\x20'+j6;console[jf(0xd5)](jh);}const j7=((C=p[jf(0xf2)])===null||C===void 0x0?void 0x0:C['body'])||((o=p[jf(0xf2)])===null||o===void 0x0?void 0x0:o[jf(0x1a9)])?yield I(B,p,J):undefined;if(!B['force']&&J['includes'](jf(0x19e))&&!(yield x[jf(0xd0)]())){(0x0,utils_1['warning'])(jf(0x163));return;}const j8=S&&(B['loadAll']||(B[jf(0x12a)]===jf(0x1cf)||B[jf(0x12a)]===jf(0x130))&&!j0);let j9=j8&&l instanceof js_client_1[jf(0xcb)]?yield l[jf(0xcc)]({'parameters':j4,'options':j5,'data':j7}):yield l[jf(0x169)]({'parameters':j4,'options':Object[jf(0x106)]({},j5),'data':j7});if(B===null||B===void 0x0?void 0x0:B[jf(0x1a4)]){const jN=j9[jf(0x168)];console[jf(0xd5)](jf(0xe9)+jN[jf(0x139)][jf(0xc7)]()+':'+jN['url']);if(j7!==undefined)console[jf(0xd5)](jf(0x144)+j7);}if(j9['error']){const {details:jF,id:jK,message:jG,status:jd}=j9[jf(0x1a2)],jx=jF?'\x0a\x09details\x20:'+JSON[jf(0x123)](jF):'',jm=jK?jf(0x1d0)+jK:'',jP=jf(0xe8)+jd+jm+')';throw new Error(jf(0x1a5)+jG+'\x20'+jP+jx);}let jj=0x0;printCallResult(B,j2,j9['data'],j3,J,j1,![],jj,j9[jf(0xdf)]['statusText']);if(!B['quiet']&&!j8&&!j0&&((g=j9[jf(0x101)])===null||g===void 0x0?void 0x0:g[jf(0xd7)]))while((c=j9[jf(0x101)])===null||c===void 0x0?void 0x0:c[jf(0xd7)]){const je=yield x[jf(0xed)](jf(0x12e));if(je)process['stdout']['moveCursor'](0x0,-0x1),process[jf(0x1b3)][jf(0x11b)](0x1),jj+=j9[jf(0x101)][jf(0x128)],j9=yield j9['pagination'][jf(0x164)](),printCallResult(B,j2,j9['data'],j3,J,j1,!![],jj,j9[jf(0xdf)][jf(0x10b)]);else return;}})),Z;}const t=_['has'](p,jO(0xf2)),H=l,a=E(H,t);e(J,a),N['addCommand'](a);const q=_[jO(0x19d)](p,jO(0xf2));Object[jO(0x1d7)](q)['length']>0x0&&generateCommands(j,l,a,F,K,q,J);});function I(X,l,p){var J;return __awaiter(this,void 0x0,void 0x0,function*(){const jz=a1h,{input:Q,file:y}=X;if(Q!==undefined)try{return JSON[jz(0x1cd)](Q);}catch(D){try{return yaml[jz(0x186)](Q);}catch(i){throw new Error(jz(0x12c));}}if(y!==undefined){if(!fs_1[jz(0x10d)][jz(0xf0)](y))throw new Error(jz(0x1b2)+y);const W=fs_1[jz(0x10d)]['readFileSync'](y)[jz(0x1c1)]();let E;try{if(_[jz(0x146)](W)){if(X[jz(0x1c6)][jz(0x132)](jz(0x125)))E=JSON[jz(0x1cd)](W);else{if(X[jz(0x1c6)]['endsWith'](jz(0x18c))||X[jz(0x1c6)]['endsWith'](jz(0x180)))E=yaml[jz(0x186)](W);else throw new Error(jz(0x1c4)+X[jz(0x1c6)][jz(0x16a)]('.')[jz(0x15d)]());}}else E=W;return E;}catch(t){throw new Error(jz(0x104)+t['message']);}}if((J=l===null||l===void 0x0?void 0x0:l[jz(0xf2)])===null||J===void 0x0?void 0x0:J[jz(0x1a9)])throw new Error(jz(0x1b1));return yield x['retrievePayloadViaInteractiveCli'](l,{'cmdPath':p,'skipValidation':X[jz(0x12b)]});});}}const printCallResult=(j,h,N,F,K,G,d,x,m)=>{const jb=a1jX;if(!(j===null||j===void 0x0?void 0x0:j[jb(0x120)])){if(h)(0x0,console_format_helpers_1[jb(0x152)])(j===null||j===void 0x0?void 0x0:j[jb(0x12a)],N);else{if(F)(0x0,console_format_helpers_1[jb(0x142)])(j===null||j===void 0x0?void 0x0:j[jb(0x12a)],N);else{if(isListCommand(K)){const P=(G===null||G===void 0x0?void 0x0:G[jb(0x10f)]('custom-columns='))?G[jb(0x15a)](jb(0xf7),'')[jb(0x16a)](',')[jb(0x111)](p=>p[jb(0x134)]()):undefined,e=K[K['length']-0x1],I=''+e+(e[jb(0x132)]('s')?'':'s'),X=_['upperFirst'](I),l=_[jb(0x110)](N,I)?N[I]:N;(0x0,console_format_helpers_1[jb(0x16d)])(l,X,P,d,x);}else console[jb(0xd5)]((0x0,console_format_helpers_1[jb(0xe2)])(N,m));}}}};
@@ -1 +1 @@
1
- 'use strict';const a2W=a2g;(function(O,g){const z=a2g,R=O();while(!![]){try{const Y=-parseInt(z(0x9d))/0x1*(parseInt(z(0x101))/0x2)+-parseInt(z(0xa9))/0x3*(parseInt(z(0x6e))/0x4)+parseInt(z(0x71))/0x5*(parseInt(z(0xdc))/0x6)+-parseInt(z(0xb7))/0x7+-parseInt(z(0xe1))/0x8+-parseInt(z(0x89))/0x9*(-parseInt(z(0x95))/0xa)+-parseInt(z(0x83))/0xb*(-parseInt(z(0x72))/0xc);if(Y===g)break;else R['push'](R['shift']());}catch(y){R['push'](R['shift']());}}}(a2O,0xbe7a3));var __createBinding=this&&this['__createBinding']||(Object[a2W(0x6f)]?function(O,g,R,Y){const X=a2W;if(Y===undefined)Y=R;var y=Object[X(0xfd)](g,R);(!y||(X(0xec)in y?!g[X(0xd7)]:y['writable']||y[X(0xa8)]))&&(y={'enumerable':!![],'get':function(){return g[R];}}),Object[X(0xa0)](O,Y,y);}:function(O,g,R,Y){if(Y===undefined)Y=R;O[Y]=g[R];}),__setModuleDefault=this&&this[a2W(0xe6)]||(Object[a2W(0x6f)]?function(O,g){const M=a2W;Object[M(0xa0)](O,M(0x99),{'enumerable':!![],'value':g});}:function(O,g){O['default']=g;}),__importStar=this&&this[a2W(0xe4)]||function(O){const l=a2W;if(O&&O[l(0xd7)])return O;var g={};if(O!=null){for(var R in O)if(R!==l(0x99)&&Object['prototype'][l(0xed)][l(0xa5)](O,R))__createBinding(g,O,R);}return __setModuleDefault(g,O),g;},__awaiter=this&&this['__awaiter']||function(O,g,R,Y){function y(n){return n instanceof R?n:new R(function(G){G(n);});}return new(R||(R=Promise))(function(n,G){const f=a2g;function S(L){const C=a2g;try{V(Y[C(0x88)](L));}catch(N){G(N);}}function q(L){const K=a2g;try{V(Y[K(0xfb)](L));}catch(N){G(N);}}function V(e){const H=a2g;e[H(0x7a)]?n(e[H(0x9c)]):y(e['value'])[H(0x100)](S,q);}V((Y=Y[f(0x82)](O,g||[]))[f(0x88)]());});},__importDefault=this&&this['__importDefault']||function(O){return O&&O['__esModule']?O:{'default':O};};Object[a2W(0xa0)](exports,a2W(0xd7),{'value':!![]}),exports[a2W(0xc8)]=void 0x0;function a2g(O,g){const R=a2O();return a2g=function(Y,y){Y=Y-0x66;let n=R[Y];return n;},a2g(O,g);}const _=__importStar(require('lodash')),proxy_agent_1=require('proxy-agent'),chalk_1=__importDefault(require(a2W(0x67))),utils_1=require(a2W(0xf5)),inquirer_helper_1=require(a2W(0x9b)),console_format_helpers_1=require(a2W(0x8d)),browser_login_1=require('../login/browser-login'),node_fetch_1=__importDefault(require(a2W(0x70))),inquirer=require(a2W(0x76));function a2O(){const O0=['--do-not-open-browser','token','Job\x20name\x20(internal\x20id)\x20to\x20use\x20as\x20default\x20in\x20context','tokenLogin','browserLogin','Local\x20context\x20\x27','finally','CliContext','verifyToken','remove','Local\x20context\x20name\x20to\x20remove.','contexts','addCommand','project','ctx','token\x20login','agent','test','InquirerHelper','Use\x20project\x20with\x20id:','NorthflankApiBrowserLogin','ProxyAgent','__esModule','Change\x20the\x20default\x20project\x20in\x20the\x20current\x20local\x20context','warning','option','Shows\x20full\x20context\x20information\x20(including\x20tokens)','6VGIToC','-n,\x20--name\x20[NAME]','error','italic','description','10339328QhDfsD','list','Update\x20token\x20for\x20current\x20context','__importStar','getCurrentContext','__setModuleDefault','Failed\x20to\x20login\x20with\x20the\x20provided\x20token,\x20make\x20sure\x20to\x20use\x20a\x20valid\x20token\x20and\x20host.','moveCursor','clearLine','askForProject','success','get','hasOwnProperty','retry','host\x20url\x20for\x20this\x20context','apiTokenLogin','Contexts','GET','map','addContext','../utils','job','getInfo','Error\x20occured\x20during\x20browser\x20login:\x20','dir','Token\x20for\x20this\x20context.\x20When\x20set,\x20browser\x20login\x20is\x20not\x20used','throw','-t,\x20--token\x20[TOKEN]','getOwnPropertyDescriptor','Override\x20existing\x20contexts\x20(this\x20will\x20remove\x20project\x20and\x20service\x20context)','replace','then','596lVDyby','--all','tokenPrompt','useContext','\x0aSuccessfully\x20logged\x20in\x20using\x20','chalk','No\x20context\x20available.\x20Use\x20\x27northflank\x20login\x27\x20to\x20create\x20context.','Change\x20current\x20context\x20to\x20context\x20identified\x20by\x20this\x20name','Failed\x20to\x20login\x20with\x20the\x20provided\x20token.\x20Token\x20was\x20not\x20changed','\x20(api\x20host:\x20','set','context','4804CDhlbF','create','node-fetch','5029065nsdRar','1212996mOoxee','host','doNotOpenBrowser','Retrieve\x20and\x20update\x20local\x20context\x20settings.','inquirer','Token\x20for\x20current\x20context\x20\x27','-i,\x20--id\x20[ID]','message','done','Use\x20browser\x20login\x20but\x20only\x20print\x20URL\x20which\x20can\x20be\x20used\x20to\x20login','removeContext','Switch\x20between\x20your\x20local\x20contexts','useProjectId','askForJob','apiClient','use\x20from\x20now\x20on','apply','297fSnBgp','login','--host\x20[HOST]','.\x20Using\x20fallback.','getCurrentName','next','930438jleUWc','Project\x20name\x20(internal\x20id)\x20to\x20use\x20as\x20default\x20in\x20context','Open\x20this\x20URL\x20in\x20your\x20browser\x20and\x20follow\x20the\x20steps:\x0a\x09','contextProvider','../formatting/console-format-helpers','search-list','List\x20all\x20available\x20contexts','contextAvailable','getCurrentBaseUrl','length','close','log','110KsJIRC','Bearer\x20','Use\x20job\x20with\x20id:','fullUrl','default','Changed\x20current\x20context\x20to\x20','../inquirer-helper','value','4493FQUSQH','--token-login','startLogin','defineProperty','getCurrentToken','getCommand','--override','defaultBaseUrl','call','name','prompt','configurable','2319tTBGpr','updateToken','No\x20project\x20in\x20current\x20context.\x20Please\x20set\x20project\x20before\x20setting\x20a\x20project-scoped\x20resource','browser-opened','Remove\x20a\x20context','Follow\x20the\x20steps\x20displayed\x20on\x20the\x20page\x20opened\x20in\x20the\x20browser\x20(URL\x20opened:\x20','valueOf','\x27\x20successfully\x20removed.','askForService','sort','alias','/v1/login','use','update-token','3726506xSgdvm','Token\x20for\x20this\x20context','loadContextWrapper','browser\x20login','loginPrompt','askForContext','stdout','getProjectName','action','sessionToken=********'];a2O=function(){return O0;};return a2O();}class CliContext{constructor(O,g=undefined,R='https://api.northflank.com'){const i=a2W;this[i(0xd1)]=g,this[i(0xa4)]=R,this['sanitiseHostname']=N=>{const A=i;let b=N;return!/^https?:\/\//i[A(0xd2)](b)&&(b='https://'+b),b=b[A(0xff)](/\/+$/,''),b;},this['apiClient']=O;const Y=new inquirer_helper_1[(i(0xd3))](O);this[i(0x84)]=(0x0,utils_1[i(0xa2)])()[i(0xa6)](i(0x84))[i(0xe0)]('Connect\x20the\x20CLI\x20to\x20your\x20Northflank\x20account.')[i(0xda)](i(0x9e),'Use\x20manual\x20login\x20with\x20API\x20token',![])[i(0xda)](i(0xc1),i(0x7b),![])[i(0xda)](i(0xdd),'Name\x20for\x20login\x20context')[i(0xda)](i(0xfc),i(0xfa))[i(0xda)](i(0x85),i(0xef),this['defaultBaseUrl'])[i(0xda)](i(0xa3),i(0xfe),![])['action'](N=>__awaiter(this,void 0x0,void 0x0,function*(){const Z=i;_[Z(0x6c)](N,'host',this['sanitiseHostname'](N[Z(0x73)]));const b=N[Z(0xc4)]||N[Z(0xc2)]!==undefined,{name:E,host:p,token:F,override:m}=b?yield this[Z(0xf0)](N,Y):yield this[Z(0xc5)](N,Y);try{yield this[Z(0x80)]['contextProvider'][Z(0xf4)]({'name':E,'host':p,'token':F},m);}catch(o){(0x0,utils_1['error'])(o[Z(0x79)]);return;}if(!(yield this[Z(0xc9)]()))(0x0,utils_1[Z(0xde)])(Z(0xe7)),yield this[Z(0x80)][Z(0x8c)]['removeContext'](E);else{const v=b?Z(0xd0):Z(0xba),a=Z(0x66)+v+',\x20added\x20context\x20with\x20name\x20'+chalk_1['default'][Z(0xdf)](E)+Z(0x6b)+p+')';(0x0,utils_1['success'])(a);}})),this[i(0xcc)]=(0x0,utils_1[i(0xa2)])()[i(0xa6)](i(0x6d))[i(0xe0)](i(0x75))[i(0xb3)]('contexts')['alias'](i(0xcf));const y=(0x0,utils_1['getCommand'])()[i(0xa6)]('list')[i(0xa6)]('ls')[i(0xe0)](i(0x8f))[i(0xda)](i(0x102),i(0xdb))[i(0xbf)](N=>__awaiter(this,void 0x0,void 0x0,function*(){const c=i;console[c(0x94)](O[c(0x8c)][c(0xf7)]());const b=O[c(0x8c)][c(0xb9)]();if(N['all']===!![]){console[c(0xf9)](b);return;}const E=b['current'],p=b[c(0xcc)][c(0xb2)]((F,m)=>F[c(0xa6)]===E?-0x1:m['name']===E?0x1:0x0)['map'](F=>{const U=c,m=E===F['name']?'\x20(current)':'';return{'Name':''+F['name']+m,'Host':F[U(0x73)],'Default\x20Project':F[U(0xce)]||'-','Default\x20Service':F['service']||'-'};});(0x0,console_format_helpers_1['printAsTable'])(p,c(0xf1));})),n=(0x0,utils_1[i(0xa2)])();n[i(0xa6)]('use')[i(0xe0)](i(0x7d))['option'](i(0xdd),i(0x69))['action'](N=>__awaiter(this,void 0x0,void 0x0,function*(){const d=i,b=(N===null||N===void 0x0?void 0x0:N[d(0xa6)])||(yield this[d(0xbc)](d(0xb5)));yield this[d(0x80)][d(0x8c)][d(0x104)](b),(0x0,utils_1[d(0xeb)])(d(0x9a)+b);}));const G=i(0x78),S=(0x0,utils_1[i(0xa2)])()[i(0xa6)](i(0xce))[i(0xe0)](i(0xd8))['option'](G,i(0x8a))['action'](N=>__awaiter(this,void 0x0,void 0x0,function*(){const r=i,b=(N===null||N===void 0x0?void 0x0:N['id'])||(yield Y[r(0xea)]());yield this[r(0x80)]['contextProvider'][r(0x7e)](b),console[r(0x94)](r(0xd4),b);})),q=(0x0,utils_1['getCommand'])()[i(0xa6)]('service')[i(0xe0)]('Change\x20the\x20default\x20service\x20in\x20the\x20current\x20local\x20context')[i(0xda)](G,'Service\x20name\x20(internal\x20id)\x20to\x20use\x20as\x20default\x20in\x20context')[i(0xbf)](N=>__awaiter(this,void 0x0,void 0x0,function*(){const j=i,b=(N===null||N===void 0x0?void 0x0:N['id'])||(yield Y[j(0xb1)](this[j(0xbe)]())());console[j(0x94)]('Use\x20service\x20with\x20id:',b),yield this[j(0x80)]['contextProvider']['useServiceId'](b);})),V=(0x0,utils_1[i(0xa2)])()[i(0xa6)](i(0xf6))['description']('Change\x20the\x20default\x20job\x20in\x20the\x20current\x20local\x20context')[i(0xda)](G,i(0xc3))[i(0xbf)](N=>__awaiter(this,void 0x0,void 0x0,function*(){const t=i,b=(N===null||N===void 0x0?void 0x0:N['id'])||(yield Y[t(0x7f)](this['getProjectName']())());console['log'](t(0x97),b),yield this[t(0x80)][t(0x8c)]['useJobId'](b);}));n[i(0xcd)](S),n[i(0xcd)](V),n[i(0xcd)](q);const e=(0x0,utils_1[i(0xa2)])()[i(0xa6)](i(0xca))[i(0xb3)]('delete')[i(0xb3)]('rm')['description'](i(0xad))[i(0xda)](G,i(0xcb))[i(0xbf)](N=>__awaiter(this,void 0x0,void 0x0,function*(){const Q=i;var b;const E=(N===null||N===void 0x0?void 0x0:N['id'])||(yield this[Q(0xbc)](Q(0xca))),p=(b=this[Q(0x80)]['contextProvider'][Q(0xe5)]())===null||b===void 0x0?void 0x0:b['name'];yield this[Q(0x80)][Q(0x8c)][Q(0x7c)](E),(0x0,utils_1[Q(0xeb)])(Q(0xc6)+E+Q(0xb0));if(!this[Q(0x90)]()){(0x0,utils_1[Q(0xd9)])(Q(0x68));return;}if(p===E){const F=(N===null||N===void 0x0?void 0x0:N['name'])||(yield this[Q(0xbc)](Q(0x81)));yield this[Q(0x80)][Q(0x8c)]['useContext'](F),(0x0,utils_1[Q(0xeb)])('Changed\x20current\x20context\x20to\x20'+F);}})),L=(0x0,utils_1[i(0xa2)])()['name'](i(0xb6))[i(0xb3)]('set-token')[i(0xe0)](i(0xe3))['option'](i(0xfc),i(0xb8))[i(0xbf)](N=>__awaiter(this,void 0x0,void 0x0,function*(){const T=i,{contextProvider:b}=this['apiClient'],E=(N===null||N===void 0x0?void 0x0:N[T(0xc2)])||(yield Y[T(0x103)]()),p=b['getCurrentToken']();yield b[T(0xaa)](E);if(yield this[T(0xc9)]())(0x0,utils_1[T(0xeb)])(T(0x77)+b[T(0x87)]()+'\x27\x20successfully\x20updated.');else{if(p)yield b[T(0xaa)](p);(0x0,utils_1[T(0xde)])(T(0x6a));}}));this['contexts'][i(0xcd)](y),this[i(0xcc)][i(0xcd)](n),this['contexts'][i(0xcd)](e),this[i(0xcc)][i(0xcd)](L);}[a2W(0xc5)](O,g){var R,Y,y,n;return __awaiter(this,void 0x0,void 0x0,function*(){const u=a2g,G=!O[u(0x74)],S=(R=O[u(0x73)])!==null&&R!==void 0x0?R:this[u(0xa4)],q=new browser_login_1[(u(0xd5))](S,G,this[u(0xd1)]);let V;q['on'](u(0xac),({url:b})=>{const I=u;if(G){const E=b[I(0xff)](/sessionToken=.*/,I(0xc0));console[I(0x94)](I(0xae)+E+')'),V=inquirer[I(0xa7)]([{'type':'confirm','name':I(0x98),'message':'Display\x20full\x20URL\x20to\x20allow\x20opening\x20the\x20link\x20manually','default':![]}]),V[I(0x100)](p=>{const x=I;process[x(0xbd)][x(0xe8)](0x0,-0x1),process[x(0xbd)][x(0xe9)](0x1),p[x(0x98)]&&console['log'](x(0x8b)+b+'\x20');});}else console['log']('Open\x20this\x20URL\x20in\x20your\x20browser\x20and\x20follow\x20the\x20steps:\x0a\x09'+b+'\x20');});const {token:e,contextName:L}=yield q[u(0x9f)]()['catch'](b=>__awaiter(this,void 0x0,void 0x0,function*(){const k=u;(0x0,utils_1[k(0xde)])(k(0xf8)+b[k(0x79)]+k(0x86));const E=yield this['apiTokenLogin'](O,g);return{'token':E['token'],'contextName':E['name']};}))[u(0xc7)](()=>{const s=u;if(V)V['ui'][s(0x93)]();}),N=(y=(Y=O[u(0xa6)])!==null&&Y!==void 0x0?Y:L)!==null&&y!==void 0x0?y:'autologin-'+new Date()[u(0xaf)]();return{'name':N,'token':e,'host':S,'override':(n=O['override'])!==null&&n!==void 0x0?n:![]};});}[a2W(0xf0)](O,g){return __awaiter(this,void 0x0,void 0x0,function*(){const P=a2g,R=this['apiClient'][P(0x8c)][P(0xb9)]()[P(0xcc)],{name:Y,token:y,host:n,override:G}=yield g[P(0xbb)](O,R);return{'name':Y,'token':y,'host':n,'override':G};});}['getProjectName'](){const B=a2W,O=this[B(0x80)][B(0x8c)]['getCurrentProjectName']();if(O===undefined)throw new Error(B(0xab));return O;}[a2W(0xbc)](O){return __awaiter(this,void 0x0,void 0x0,function*(){const w=a2g;if(!this['contextAvailable']())throw new Error('No\x20context\x20available.\x20Please\x20use\x20\x27northflank\x20login\x27\x20to\x20create\x20context.');const g=this[w(0x80)][w(0x8c)]['loadContextWrapper']()['contexts'][w(0xf3)](Y=>Y[w(0xa6)]),R=g[w(0x92)]>0x4?w(0x8e):w(0xe2);return(yield inquirer[w(0xa7)]([{'type':R,'name':w(0xa6),'message':'Choose\x20the\x20context\x20to\x20'+O+':','choices':g}]))[w(0xa6)];});}[a2W(0x90)](){const J=a2W;return this['apiClient'][J(0x8c)][J(0xb9)]()[J(0xcc)][J(0x92)]>0x0;}[a2W(0xc9)](){return __awaiter(this,void 0x0,void 0x0,function*(){const h=a2g;try{const O=this['apiClient'][h(0x8c)][h(0x91)](),g=this[h(0x80)][h(0x8c)][h(0xa1)](),R=O+h(0xb4),Y={'Authorization':h(0x96)+g},y=new proxy_agent_1[(h(0xd6))](),n=yield(0x0,utils_1[h(0xee)])(0x3)(()=>__awaiter(this,void 0x0,void 0x0,function*(){const D=h;return(0x0,node_fetch_1['default'])(R,{'method':D(0xf2),'signal':AbortSignal['timeout'](0xbb8),'headers':Y,'agent':y});}));if(n['ok'])return!![];return![];}catch(G){return![];}});}}exports[a2W(0xc8)]=CliContext;
1
+ 'use strict';const a2t=a2h;(function(j,h){const E=a2h,N=j();while(!![]){try{const F=parseInt(E(0x197))/0x1+-parseInt(E(0x167))/0x2+parseInt(E(0x1c9))/0x3+-parseInt(E(0x1a9))/0x4+parseInt(E(0x1fc))/0x5+-parseInt(E(0x1be))/0x6+parseInt(E(0x176))/0x7*(parseInt(E(0x1b5))/0x8);if(F===h)break;else N['push'](N['shift']());}catch(K){N['push'](N['shift']());}}}(a2j,0x4d494));function a2h(j,h){const N=a2j();return a2h=function(F,K){F=F-0x164;let G=N[F];return G;},a2h(j,h);}var __createBinding=this&&this[a2t(0x1f2)]||(Object[a2t(0x199)]?function(j,h,N,F){const H=a2t;if(F===undefined)F=N;var K=Object[H(0x1d6)](h,N);(!K||(H(0x18c)in K?!h[H(0x1cd)]:K['writable']||K['configurable']))&&(K={'enumerable':!![],'get':function(){return h[N];}}),Object[H(0x1f9)](j,F,K);}:function(j,h,N,F){if(F===undefined)F=N;j[F]=h[N];}),__setModuleDefault=this&&this[a2t(0x180)]||(Object[a2t(0x199)]?function(j,h){const a=a2t;Object[a(0x1f9)](j,'default',{'enumerable':!![],'value':h});}:function(j,h){const q=a2t;j[q(0x16d)]=h;}),__importStar=this&&this[a2t(0x1a6)]||function(j){const R=a2t;if(j&&j[R(0x1cd)])return j;var h={};if(j!=null){for(var N in j)if(N!=='default'&&Object[R(0x190)][R(0x17a)][R(0x1c0)](j,N))__createBinding(h,j,N);}return __setModuleDefault(h,j),h;},__awaiter=this&&this['__awaiter']||function(j,h,N,F){function K(G){return G instanceof N?G:new N(function(d){d(G);});}return new(N||(N=Promise))(function(G,d){const L=a2h;function x(I){try{e(F['next'](I));}catch(X){d(X);}}function m(I){const n=a2h;try{e(F[n(0x1ee)](I));}catch(X){d(X);}}function e(I){const k=a2h;I[k(0x1a1)]?G(I[k(0x1bd)]):K(I[k(0x1bd)])['then'](x,m);}e((F=F[L(0x1b4)](j,h||[]))[L(0x1a7)]());});},__importDefault=this&&this[a2t(0x166)]||function(j){const A=a2t;return j&&j[A(0x1cd)]?j:{'default':j};};Object[a2t(0x1f9)](exports,'__esModule',{'value':!![]}),exports['CliContext']=void 0x0;const _=__importStar(require('lodash')),proxy_agent_1=require(a2t(0x179)),chalk_1=__importDefault(require(a2t(0x181))),utils_1=require('../utils'),inquirer_helper_1=require(a2t(0x164)),console_format_helpers_1=require(a2t(0x1a3)),browser_login_1=require('../login/browser-login'),node_fetch_1=__importDefault(require(a2t(0x1c5))),inquirer=require(a2t(0x1c3));class CliContext{constructor(j,h=undefined,N=a2t(0x169)){const v=a2t;this[v(0x1d0)]=h,this[v(0x18f)]=N,this[v(0x1b0)]=X=>{const s=v;let l=X;return!/^https?:\/\//i[s(0x1e6)](l)&&(l=s(0x1fb)+l),l=l['replace'](/\/+$/,''),l;},this[v(0x18d)]=j;const F=new inquirer_helper_1['InquirerHelper'](j);this[v(0x16e)]=(0x0,utils_1[v(0x16f)])()[v(0x188)](v(0x16e))[v(0x17b)](v(0x192))[v(0x184)](v(0x1d5),v(0x175),![])[v(0x184)]('--do-not-open-browser',v(0x1e5),![])['option'](v(0x1ef),v(0x1ca))[v(0x184)](v(0x1f3),v(0x1ad))[v(0x184)](v(0x198),v(0x1f0),this['defaultBaseUrl'])['option'](v(0x1ff),v(0x1b8),![])[v(0x1c2)](X=>__awaiter(this,void 0x0,void 0x0,function*(){const U=v;_[U(0x1c8)](X,U(0x1fe),this[U(0x1b0)](X[U(0x1fe)]));const l=X['tokenLogin']||X[U(0x1d9)]!==undefined,{name:p,host:J,token:Q,override:y}=l?yield this['apiTokenLogin'](X,F):yield this['browserLogin'](X,F);try{yield this[U(0x18d)]['contextProvider'][U(0x16a)]({'name':p,'host':J,'token':Q},y);}catch(D){(0x0,utils_1['error'])(D[U(0x1f6)]);return;}if(!(yield this[U(0x19b)]()))(0x0,utils_1[U(0x18a)])(U(0x1dc)),yield this[U(0x18d)][U(0x1d4)][U(0x201)](p);else{const i=l?U(0x1fa):U(0x165),W=U(0x178)+i+',\x20added\x20context\x20with\x20name\x20'+chalk_1[U(0x16d)][U(0x1f5)](p)+'\x20(api\x20host:\x20'+J+')';(0x0,utils_1['success'])(W);}})),this[v(0x1e8)]=(0x0,utils_1[v(0x16f)])()[v(0x188)]('context')[v(0x17b)](v(0x1e1))['alias'](v(0x1e8))[v(0x200)]('ctx');const K=(0x0,utils_1[v(0x16f)])()[v(0x188)](v(0x170))[v(0x188)]('ls')[v(0x17b)](v(0x17c))[v(0x184)]('--all','Shows\x20full\x20context\x20information\x20(including\x20tokens)')['action'](X=>__awaiter(this,void 0x0,void 0x0,function*(){const r=v;console['log'](j[r(0x1d4)]['getInfo']());const l=j[r(0x1d4)][r(0x1a2)]();if(X['all']===!![]){console[r(0x1ae)](l);return;}const p=l['current'],J=l[r(0x1e8)][r(0x19c)]((Q,y)=>Q[r(0x188)]===p?-0x1:y[r(0x188)]===p?0x1:0x0)['map'](Q=>{const V=r,y=p===Q['name']?V(0x1f7):'';return{'Name':''+Q[V(0x188)]+y,'Host':Q[V(0x1fe)],'Default\x20Project':Q[V(0x19f)]||'-','Default\x20Service':Q[V(0x1d7)]||'-'};});(0x0,console_format_helpers_1[r(0x195)])(J,r(0x1dd));})),G=(0x0,utils_1[v(0x16f)])();G[v(0x188)]('use')[v(0x17b)](v(0x196))['option'](v(0x1ef),v(0x1e7))[v(0x1c2)](X=>__awaiter(this,void 0x0,void 0x0,function*(){const f=v,l=(X===null||X===void 0x0?void 0x0:X[f(0x188)])||(yield this[f(0x1f4)](f(0x16c)));yield this['apiClient'][f(0x1d4)][f(0x1ec)](l),(0x0,utils_1['success'])('Changed\x20current\x20context\x20to\x20'+l);}));const d='-i,\x20--id\x20[ID]',x=(0x0,utils_1[v(0x16f)])()[v(0x188)](v(0x19f))[v(0x17b)]('Change\x20the\x20default\x20project\x20in\x20the\x20current\x20local\x20context')[v(0x184)](d,v(0x1ba))[v(0x1c2)](X=>__awaiter(this,void 0x0,void 0x0,function*(){const O=v,l=(X===null||X===void 0x0?void 0x0:X['id'])||(yield F[O(0x1b1)]());yield this[O(0x18d)][O(0x1d4)][O(0x1f1)](l),console[O(0x1c7)](O(0x194),l);})),m=(0x0,utils_1['getCommand'])()['name'](v(0x1d7))[v(0x17b)](v(0x183))[v(0x184)](d,v(0x182))['action'](X=>__awaiter(this,void 0x0,void 0x0,function*(){const z=v,l=(X===null||X===void 0x0?void 0x0:X['id'])||(yield F[z(0x18b)](this[z(0x1df)]())());console[z(0x1c7)](z(0x19e),l),yield this[z(0x18d)][z(0x1d4)][z(0x1c4)](l);})),P=(0x0,utils_1[v(0x16f)])()[v(0x188)](v(0x185))[v(0x17b)](v(0x1bb))[v(0x184)](d,'Job\x20name\x20(internal\x20id)\x20to\x20use\x20as\x20default\x20in\x20context')['action'](X=>__awaiter(this,void 0x0,void 0x0,function*(){const b=v,l=(X===null||X===void 0x0?void 0x0:X['id'])||(yield F[b(0x1eb)](this[b(0x1df)]())());console[b(0x1c7)](b(0x1b7),l),yield this[b(0x18d)]['contextProvider'][b(0x1a4)](l);}));G[v(0x193)](x),G[v(0x193)](P),G[v(0x193)](m);const e=(0x0,utils_1[v(0x16f)])()[v(0x188)]('remove')[v(0x200)](v(0x1b3))[v(0x200)]('rm')[v(0x17b)](v(0x1e9))[v(0x184)](d,v(0x1e0))[v(0x1c2)](X=>__awaiter(this,void 0x0,void 0x0,function*(){const T=v;var l;const p=(X===null||X===void 0x0?void 0x0:X['id'])||(yield this[T(0x1f4)]('remove')),J=(l=this['apiClient'][T(0x1d4)][T(0x17e)]())===null||l===void 0x0?void 0x0:l[T(0x188)];yield this[T(0x18d)][T(0x1d4)]['removeContext'](p),(0x0,utils_1[T(0x186)])(T(0x172)+p+T(0x1c6));if(!this[T(0x1d2)]()){(0x0,utils_1[T(0x187)])(T(0x1f8));return;}if(J===p){const Q=(X===null||X===void 0x0?void 0x0:X[T(0x188)])||(yield this[T(0x1f4)](T(0x19a)));yield this[T(0x18d)][T(0x1d4)][T(0x1ec)](Q),(0x0,utils_1[T(0x186)])(T(0x16b)+Q);}})),I=(0x0,utils_1[v(0x16f)])()[v(0x188)](v(0x1a0))[v(0x200)](v(0x1b6))[v(0x17b)](v(0x173))['option'](v(0x1f3),v(0x1cc))[v(0x1c2)](X=>__awaiter(this,void 0x0,void 0x0,function*(){const u=v,{contextProvider:l}=this[u(0x18d)],p=(X===null||X===void 0x0?void 0x0:X['token'])||(yield F[u(0x1aa)]()),J=l[u(0x191)]();yield l[u(0x1e3)](p);if(yield this['verifyToken']())(0x0,utils_1['success'])('Token\x20for\x20current\x20context\x20\x27'+l['getCurrentName']()+u(0x1b2));else{if(J)yield l[u(0x1e3)](J);(0x0,utils_1[u(0x18a)])(u(0x1db));}}));this['contexts'][v(0x193)](K),this[v(0x1e8)][v(0x193)](G),this[v(0x1e8)][v(0x193)](e),this[v(0x1e8)]['addCommand'](I);}['browserLogin'](j,h){var N,F,K,G;return __awaiter(this,void 0x0,void 0x0,function*(){const Z=a2h,d=!j[Z(0x1d1)],x=(N=j[Z(0x1fe)])!==null&&N!==void 0x0?N:this[Z(0x18f)],m=new browser_login_1[(Z(0x1ac))](x,d,this[Z(0x1d0)]);let P;m['on']('browser-opened',({url:l})=>{const S=Z;if(d){const p=l[S(0x1cf)](/sessionToken=.*/,'sessionToken=********');console[S(0x1c7)](S(0x1ea)+p+')'),P=inquirer[S(0x1a5)]([{'type':'confirm','name':S(0x1d8),'message':S(0x1a8),'default':![]}]),P[S(0x1ed)](J=>{const Y=S;process[Y(0x1b9)]['moveCursor'](0x0,-0x1),process['stdout'][Y(0x1de)](0x1),J[Y(0x1d8)]&&console[Y(0x1c7)]('Open\x20this\x20URL\x20in\x20your\x20browser\x20and\x20follow\x20the\x20steps:\x0a\x09'+l+'\x20');});}else console[S(0x1c7)](S(0x174)+l+'\x20');});const {token:e,contextName:I}=yield m[Z(0x1d3)]()[Z(0x1c1)](l=>__awaiter(this,void 0x0,void 0x0,function*(){const M=Z;(0x0,utils_1[M(0x18a)])(M(0x19d)+l[M(0x1f6)]+M(0x177));const p=yield this['apiTokenLogin'](j,h);return{'token':p[M(0x1d9)],'contextName':p[M(0x188)]};}))[Z(0x168)](()=>{if(P)P['ui']['close']();}),X=(K=(F=j['name'])!==null&&F!==void 0x0?F:I)!==null&&K!==void 0x0?K:Z(0x171)+new Date()[Z(0x1e2)]();return{'name':X,'token':e,'host':x,'override':(G=j['override'])!==null&&G!==void 0x0?G:![]};});}[a2t(0x17f)](j,h){return __awaiter(this,void 0x0,void 0x0,function*(){const w=a2h,N=this[w(0x18d)][w(0x1d4)][w(0x1a2)]()[w(0x1e8)],{name:F,token:K,host:G,override:d}=yield h[w(0x18e)](j,N);return{'name':F,'token':K,'host':G,'override':d};});}[a2t(0x1df)](){const C=a2t,j=this[C(0x18d)][C(0x1d4)][C(0x1af)]();if(j===undefined)throw new Error(C(0x1e4));return j;}['askForContext'](j){return __awaiter(this,void 0x0,void 0x0,function*(){const o=a2h;if(!this['contextAvailable']())throw new Error('No\x20context\x20available.\x20Please\x20use\x20\x27northflank\x20login\x27\x20to\x20create\x20context.');const h=this[o(0x18d)][o(0x1d4)]['loadContextWrapper']()[o(0x1e8)][o(0x1da)](F=>F[o(0x188)]),N=h['length']>0x4?o(0x1ab):o(0x170);return(yield inquirer[o(0x1a5)]([{'type':N,'name':'name','message':o(0x1bf)+j+':','choices':h}]))[o(0x188)];});}['contextAvailable'](){const g=a2t;return this[g(0x18d)]['contextProvider'][g(0x1a2)]()['contexts']['length']>0x0;}[a2t(0x19b)](){return __awaiter(this,void 0x0,void 0x0,function*(){const c=a2h;try{const j=this[c(0x18d)]['contextProvider'][c(0x1cb)](),h=this[c(0x18d)][c(0x1d4)][c(0x191)](),N=j+'/v1/login',F={'Authorization':c(0x1ce)+h},K=new proxy_agent_1[(c(0x189))](),G=yield(0x0,utils_1['retry'])(0x3)(()=>__awaiter(this,void 0x0,void 0x0,function*(){const B=c;return(0x0,node_fetch_1[B(0x16d)])(N,{'method':B(0x1bc),'signal':AbortSignal[B(0x1fd)](0xbb8),'headers':F,'agent':K});}));if(G['ok'])return!![];return![];}catch(d){return![];}});}}exports[a2t(0x17d)]=CliContext;function a2j(){const j0=['addContext','Changed\x20current\x20context\x20to\x20','use','default','login','getCommand','list','autologin-','Local\x20context\x20\x27','Update\x20token\x20for\x20current\x20context','Open\x20this\x20URL\x20in\x20your\x20browser\x20and\x20follow\x20the\x20steps:\x0a\x09','Use\x20manual\x20login\x20with\x20API\x20token','6818VpKrSM','.\x20Using\x20fallback.','\x0aSuccessfully\x20logged\x20in\x20using\x20','proxy-agent','hasOwnProperty','description','List\x20all\x20available\x20contexts','CliContext','getCurrentContext','apiTokenLogin','__setModuleDefault','chalk','Service\x20name\x20(internal\x20id)\x20to\x20use\x20as\x20default\x20in\x20context','Change\x20the\x20default\x20service\x20in\x20the\x20current\x20local\x20context','option','job','success','warning','name','ProxyAgent','error','askForService','get','apiClient','loginPrompt','defaultBaseUrl','prototype','getCurrentToken','Connect\x20the\x20CLI\x20to\x20your\x20Northflank\x20account.','addCommand','Use\x20project\x20with\x20id:','printAsTable','Switch\x20between\x20your\x20local\x20contexts','323380VNhDXD','--host\x20[HOST]','create','use\x20from\x20now\x20on','verifyToken','sort','Error\x20occured\x20during\x20browser\x20login:\x20','Use\x20service\x20with\x20id:','project','update-token','done','loadContextWrapper','../formatting/console-format-helpers','useJobId','prompt','__importStar','next','Display\x20full\x20URL\x20to\x20allow\x20opening\x20the\x20link\x20manually','395808hlCspM','tokenPrompt','search-list','NorthflankApiBrowserLogin','Token\x20for\x20this\x20context.\x20When\x20set,\x20browser\x20login\x20is\x20not\x20used','dir','getCurrentProjectName','sanitiseHostname','askForProject','\x27\x20successfully\x20updated.','delete','apply','1992aKzpvo','set-token','Use\x20job\x20with\x20id:','Override\x20existing\x20contexts\x20(this\x20will\x20remove\x20project\x20and\x20service\x20context)','stdout','Project\x20name\x20(internal\x20id)\x20to\x20use\x20as\x20default\x20in\x20context','Change\x20the\x20default\x20job\x20in\x20the\x20current\x20local\x20context','GET','value','2460732qbxfHN','Choose\x20the\x20context\x20to\x20','call','catch','action','inquirer','useServiceId','node-fetch','\x27\x20successfully\x20removed.','log','set','1255707qeBoQL','Name\x20for\x20login\x20context','getCurrentBaseUrl','Token\x20for\x20this\x20context','__esModule','Bearer\x20','replace','agent','doNotOpenBrowser','contextAvailable','startLogin','contextProvider','--token-login','getOwnPropertyDescriptor','service','fullUrl','token','map','Failed\x20to\x20login\x20with\x20the\x20provided\x20token.\x20Token\x20was\x20not\x20changed','Failed\x20to\x20login\x20with\x20the\x20provided\x20token,\x20make\x20sure\x20to\x20use\x20a\x20valid\x20token\x20and\x20host.','Contexts','clearLine','getProjectName','Local\x20context\x20name\x20to\x20remove.','Retrieve\x20and\x20update\x20local\x20context\x20settings.','valueOf','updateToken','No\x20project\x20in\x20current\x20context.\x20Please\x20set\x20project\x20before\x20setting\x20a\x20project-scoped\x20resource','Use\x20browser\x20login\x20but\x20only\x20print\x20URL\x20which\x20can\x20be\x20used\x20to\x20login','test','Change\x20current\x20context\x20to\x20context\x20identified\x20by\x20this\x20name','contexts','Remove\x20a\x20context','Follow\x20the\x20steps\x20displayed\x20on\x20the\x20page\x20opened\x20in\x20the\x20browser\x20(URL\x20opened:\x20','askForJob','useContext','then','throw','-n,\x20--name\x20[NAME]','host\x20url\x20for\x20this\x20context','useProjectId','__createBinding','-t,\x20--token\x20[TOKEN]','askForContext','italic','message','\x20(current)','No\x20context\x20available.\x20Use\x20\x27northflank\x20login\x27\x20to\x20create\x20context.','defineProperty','token\x20login','https://','1573510YifVno','timeout','host','--override','alias','removeContext','../inquirer-helper','browser\x20login','__importDefault','947078RxInpO','finally','https://api.northflank.com'];a2j=function(){return j0;};return a2j();}
@@ -1 +1 @@
1
- 'use strict';function a3O(){const Q=['alias','getCurrentProjectName','File\x20and\x20directory\x20download\x20for\x20Northflank\x20service.','CliFileCopy','ed-file.txt\x0a\x20\x20','Downloaded\x20all\x20directory\x20contents\x20from\x20\x27','\x27\x20to\x20\x27','\x20file\x20--localPath\x20my_directory\x20--remotePath\x20/home/','downloadCmd','\x20file\x20--localPath\x20my_directory/my-file.txt\x20--remotePath\x20/home/my-','\x27\x20to\x20local\x20directory\x20\x27','askForPath','\x20is\x20required\x20for\x20','addCommand','getCommand','-dir','../inquirer-helper','current\x20working','Container\x20used\x20to\x20','191970fqlTtd','DIRECTORY_DOWNLOAD','logCopyResult','Local\x20file\x20or\x20directory','\x20files','value','\x20files\x20','upload','lodash','local','\x27remotePath\x27','ApiClient','Downloaded\x20file\x20\x27','name','\x20--','remotePath','@northflank/js-client','action','download','askForJob','option','job','--project\x20--projectId\x20[NAME]','DIRECTORY_UPLOAD','user\x20home','InquirerHelper','42357110vUBiZS','687112ORKGRI','--remote\x20--remotePath\x20[REMOTEPATH]','then','6218744mabszr','toUpperCase','\x20directory:\x20\x20\x20\x20\x20northflank\x20','inquirer','Uploaded\x20all\x20directory\x20contents\x20from\x20\x27','success','99grcRyL','description','getStandardCopyCommand','uploadCmd','apply','Path\x20is\x20not\x20specified,\x20the\x20','2546FcNuuF','6878634gAMuJY','--local\x20--localPath\x20[LOCALPATH]','remote','prompt','next','ensureRelevantPathIsSet','service','Path\x20does\x20not\x20exist,\x20it\x20will\x20be\x20created.\x0aExamples:\x0a\x20\x20','\x20to\x20','CopyType','438VTIQlv','File\x20and\x20directory\x20upload\x20for\x20Northflank\x20services\x20and\x20jobs.','Remote\x20file\x20or\x20directory','throw','done','apiClient','capitalize','Don\x27t\x20use\x20context\x20default\x20values,\x20explicitly\x20use\x20options\x20or\x20ask.','charAt','File\x20and\x20directory\x20upload\x20for\x20Northflank\x20job.','s.\x20Please\x20enter\x20a\x20path:','Id\x20[NAME]','370jhwYsw','assertContextExisting','\x20the\x20specified\x20','FILE_DOWNLOAD','file','\x27\x20to\x20container\x20directory\x20\x27','slice','../utils','FILE_UPLOAD','__awaiter','localPath','files','\x20(random\x20container\x20will\x20be\x20chosen\x20if\x20not\x20specified)','268GCjkiz','getCurrentServiceName'];a3O=function(){return Q;};return a3O();}const a3l=a3g;(function(O,g){const M=a3g,R=O();while(!![]){try{const Y=-parseInt(M(0x162))/0x1*(parseInt(M(0x179))/0x2)+parseInt(M(0x16d))/0x3*(parseInt(M(0x186))/0x4)+-parseInt(M(0x19b))/0x5+-parseInt(M(0x163))/0x6+-parseInt(M(0x156))/0x7+-parseInt(M(0x153))/0x8*(parseInt(M(0x15c))/0x9)+parseInt(M(0x152))/0xa;if(Y===g)break;else R['push'](R['shift']());}catch(y){R['push'](R['shift']());}}}(a3O,0xb8aff));var __awaiter=this&&this[a3l(0x182)]||function(O,g,R,Y){function y(n){return n instanceof R?n:new R(function(G){G(n);});}return new(R||(R=Promise))(function(n,G){const f=a3g;function S(L){const C=a3g;try{V(Y[C(0x167)](L));}catch(N){G(N);}}function q(L){const K=a3g;try{V(Y[K(0x170)](L));}catch(N){G(N);}}function V(e){const H=a3g;e[H(0x171)]?n(e[H(0x1a0)]):y(e[H(0x1a0)])[H(0x155)](S,q);}V((Y=Y[f(0x160)](O,g||[]))[f(0x167)]());});};Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports[a3l(0x18b)]=void 0x0;function a3g(O,g){const R=a3O();return a3g=function(Y,y){Y=Y-0x150;let n=R[Y];return n;},a3g(O,g);}const js_client_1=require(a3l(0x1ab)),utils_1=require(a3l(0x180)),inquirer_helper_1=require(a3l(0x198)),lodash_1=require(a3l(0x1a3)),inquirer=require(a3l(0x159));class CliFileCopy{constructor(O,g){const A=a3l;this['getStandardCopyCommand']=(V,e)=>{const i=a3g,L=(0x0,lodash_1[i(0x173)])(e),N=e==='upload'?i(0x165):i(0x1a4),b=e===i(0x1a2)?i(0x150):i(0x199),E=e===i(0x1a2)?'to':'from';return(0x0,utils_1[i(0x196)])(!![])[i(0x1a8)](i(0x17d))[i(0x15d)](L+i(0x1a1)+E+i(0x17b)+V+'.\x20If\x20the\x20'+N+i(0x161)+b+'\x20directory\x20is\x20used.\x20If\x20the\x20directory\x20for\x20'+N+i(0x16a)+L+'\x20single\x20file:\x20\x20\x20northflank\x20'+e+'\x20'+V+i(0x191)+e+i(0x18c)+L+i(0x158)+e+'\x20'+V+i(0x18f)+e+i(0x197))[i(0x1af)](i(0x1b1),'Project\x20for\x20'+e)[i(0x1af)]('--'+V+i(0x1a9)+V+i(0x178),V[i(0x175)](0x0)[i(0x157)]()+V[i(0x17f)](0x1)+i(0x16b)+e+i(0x19f))[i(0x1af)]('--container\x20--containerId\x20[NAME]',i(0x19a)+e+i(0x185))[i(0x1af)](i(0x164),i(0x19e))[i(0x1af)](i(0x154),i(0x16f))[i(0x1af)]('--noDefaults',i(0x174),![]);},this[A(0x19d)]=(V,e)=>{const Z=A;if(e)return;const {sourceDirectory:L,targetDirectory:N,sourceFile:b,targetFile:E}=V;switch(V['type']){case js_client_1[Z(0x16c)][Z(0x19c)]:{(0x0,utils_1[Z(0x15b)])(Z(0x18d)+L+Z(0x192)+N+'\x27');break;}case js_client_1[Z(0x16c)][Z(0x17c)]:{(0x0,utils_1[Z(0x15b)])(Z(0x1a7)+L+'/'+b+Z(0x18e)+N+'/'+E+'\x27');break;}case js_client_1['CopyType'][Z(0x1b2)]:{(0x0,utils_1[Z(0x15b)])(Z(0x15a)+L+Z(0x17e)+N+'\x27');break;}case js_client_1[Z(0x16c)][Z(0x181)]:{(0x0,utils_1['success'])('Uploaded\x20file\x20from\x20\x27'+L+'/'+b+Z(0x18e)+N+'/'+E+'\x27');break;}}},this[A(0x168)]=(V,e)=>__awaiter(this,void 0x0,void 0x0,function*(){const c=A,L=V===c(0x1ad)&&e[c(0x1aa)]===undefined?yield this[c(0x193)](c(0x1a5),'download'):e[c(0x1aa)],N=V===c(0x1a2)&&e[c(0x183)]===undefined?yield this[c(0x193)]('\x27localPath\x27',c(0x1a2)):e[c(0x183)];return{'localPath':N,'remotePath':L};}),this['askForPath']=(V,e)=>__awaiter(this,void 0x0,void 0x0,function*(){const U=A,L=V+U(0x194)+e+U(0x177);return(yield inquirer[U(0x166)]([{'type':'input','name':'name','message':L}]))[U(0x1a8)];}),this[A(0x172)]=new js_client_1[(A(0x1a6))](O,{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1['customUserAgent'],'agent':g});const R=new inquirer_helper_1[(A(0x151))](this[A(0x172)]);this[A(0x190)]=(0x0,utils_1[A(0x196)])()[A(0x1a8)](A(0x1ad))[A(0x188)]('dl')['description']('File\x20and\x20directory\x20download\x20for\x20Northflank\x20services\x20and\x20jobs.'),this[A(0x15f)]=(0x0,utils_1[A(0x196)])()[A(0x1a8)](A(0x1a2))[A(0x188)]('ul')['description'](A(0x16e));const Y=(0x0,utils_1[A(0x196)])()[A(0x1a8)](A(0x169))[A(0x15d)](A(0x18a)),y=(0x0,utils_1['getCommand'])()['name'](A(0x169))[A(0x15d)]('File\x20and\x20directory\x20upload\x20for\x20Northflank\x20service.'),n=(0x0,utils_1[A(0x196)])()['name'](A(0x1b0))[A(0x15d)]('File\x20and\x20directory\x20download\x20for\x20Northflank\x20job.'),G=(0x0,utils_1[A(0x196)])()[A(0x1a8)](A(0x1b0))['description'](A(0x176)),S=V=>{const d=A;return this[d(0x15e)](d(0x169),V)[d(0x1ac)](e=>__awaiter(this,void 0x0,void 0x0,function*(){const r=d,{projectId:L,serviceId:N,containerId:b,noDefaults:E,quiet:p}=e;(0x0,utils_1[r(0x17a)])(this[r(0x172)]);const F=E?undefined:O[r(0x189)](),m=L||F||(yield R['askForProject']()),o=E?undefined:O[r(0x187)](),v=N||o||(yield R['askForService'](m)()),{remotePath:a,localPath:z}=yield this[r(0x168)](V,e),W={'projectId':m,'serviceId':v},X=yield this[r(0x172)][V]['service'][r(0x184)](W,{'containerName':b,'localPath':z,'remotePath':a});this[r(0x19d)](X,p);}));},q=V=>{const j=A;return this[j(0x15e)](j(0x1b0),V)[j(0x1ac)](e=>__awaiter(this,void 0x0,void 0x0,function*(){const t=j,{projectId:L,jobId:N,containerId:b,noDefaults:E,quiet:p}=e;(0x0,utils_1['assertContextExisting'])(this[t(0x172)]);const F=E?undefined:O[t(0x189)](),m=L||F||(yield R['askForProject']()),o=N||(yield R[t(0x1ae)](m)()),{remotePath:v,localPath:a}=yield this[t(0x168)](V,e),z={'projectId':m,'jobId':o},W=yield this[t(0x172)][V][t(0x1b0)][t(0x184)](z,{'containerName':b,'localPath':a,'remotePath':v});this[t(0x19d)](W,p);}));};Y['addCommand'](S('download')),n['addCommand'](q(A(0x1ad))),y[A(0x195)](S(A(0x1a2))),G[A(0x195)](q('upload')),this['downloadCmd'][A(0x195)](Y),this[A(0x190)]['addCommand'](n),this['uploadCmd']['addCommand'](y),this[A(0x15f)][A(0x195)](G);}}exports[a3l(0x18b)]=CliFileCopy;
1
+ 'use strict';const a3q=a3h;(function(j,h){const a=a3h,N=j();while(!![]){try{const F=-parseInt(a(0xb9))/0x1+parseInt(a(0xfd))/0x2+-parseInt(a(0x101))/0x3*(-parseInt(a(0xc8))/0x4)+parseInt(a(0xe8))/0x5+parseInt(a(0xf7))/0x6*(parseInt(a(0xf6))/0x7)+-parseInt(a(0x109))/0x8+parseInt(a(0xb2))/0x9;if(F===h)break;else N['push'](N['shift']());}catch(K){N['push'](N['shift']());}}}(a3j,0x510d6));function a3j(){const b=['__awaiter','name','current\x20working','then','askForPath','File\x20and\x20directory\x20download\x20for\x20Northflank\x20job.','CliFileCopy','Path\x20does\x20not\x20exist,\x20it\x20will\x20be\x20created.\x0aExamples:\x0a\x20\x20','assertContextExisting','--container\x20--containerId\x20[NAME]','-dir','apiClient','../inquirer-helper','Uploaded\x20all\x20directory\x20contents\x20from\x20\x27','getCommand','\x27\x20to\x20\x27','localPath','File\x20and\x20directory\x20upload\x20for\x20Northflank\x20job.','getStandardCopyCommand','883785xvjCVB','remote','success','Downloaded\x20file\x20\x27','lodash','.\x20If\x20the\x20','type','\x27localPath\x27','ensureRelevantPathIsSet','DIRECTORY_DOWNLOAD','Local\x20file\x20or\x20directory','getCurrentProjectName','\x20files','\x20--','259BJviXv','46758WwrkNa','input','description','action','service','throw','730372sJJqQN','\x20directory:\x20\x20\x20\x20\x20northflank\x20','Id\x20[NAME]','file','726RHPxlC','askForService','capitalize','CopyType','next','job','\x20the\x20specified\x20','\x27\x20to\x20local\x20directory\x20\x27','4447200RWlHzH','addCommand','upload','Remote\x20file\x20or\x20directory','Project\x20for\x20','\x20directory\x20is\x20used.\x20If\x20the\x20directory\x20for\x20','--remote\x20--remotePath\x20[REMOTEPATH]','\x20to\x20','prompt','toUpperCase','Path\x20is\x20not\x20specified,\x20the\x20','877266ViAyDM','charAt','logCopyResult','uploadCmd','InquirerHelper','files','inquirer','535726KWwTAM','download','from','--local\x20--localPath\x20[LOCALPATH]','ed-file.txt\x0a\x20\x20','defineProperty','__esModule','done','@northflank/js-client','askForJob','File\x20and\x20directory\x20upload\x20for\x20Northflank\x20services\x20and\x20jobs.','apply','FILE_DOWNLOAD','File\x20and\x20directory\x20download\x20for\x20Northflank\x20services\x20and\x20jobs.','--noDefaults','8196BILidq','\x20is\x20required\x20for\x20','--project\x20--projectId\x20[NAME]','user\x20home','remotePath','alias','customUserAgent','\x20(random\x20container\x20will\x20be\x20chosen\x20if\x20not\x20specified)','option','downloadCmd','Don\x27t\x20use\x20context\x20default\x20values,\x20explicitly\x20use\x20options\x20or\x20ask.','FILE_UPLOAD','value'];a3j=function(){return b;};return a3j();}function a3h(j,h){const N=a3j();return a3h=function(F,K){F=F-0xad;let G=N[F];return G;},a3h(j,h);}var __awaiter=this&&this[a3q(0xd5)]||function(j,h,N,F){function K(G){return G instanceof N?G:new N(function(d){d(G);});}return new(N||(N=Promise))(function(G,d){const L=a3h;function x(I){const R=a3h;try{e(F[R(0x105)](I));}catch(X){d(X);}}function m(I){const n=a3h;try{e(F[n(0xfc)](I));}catch(X){d(X);}}function e(I){const k=a3h;I[k(0xc0)]?G(I[k(0xd4)]):K(I['value'])[k(0xd8)](x,m);}e((F=F[L(0xc4)](j,h||[]))['next']());});};Object[a3q(0xbe)](exports,a3q(0xbf),{'value':!![]}),exports[a3q(0xdb)]=void 0x0;const js_client_1=require(a3q(0xc1)),utils_1=require('../utils'),inquirer_helper_1=require(a3q(0xe1)),lodash_1=require(a3q(0xec)),inquirer=require(a3q(0xb8));class CliFileCopy{constructor(j,h){const A=a3q;this[A(0xe7)]=(P,e)=>{const v=A,I=(0x0,lodash_1[v(0x103)])(e),X=e==='upload'?v(0xe9):'local',l=e==='upload'?v(0xcb):v(0xd7),p=e===v(0x10b)?'to':v(0xbb);return(0x0,utils_1[v(0xe3)])(!![])['name'](v(0x100))[v(0xf9)](I+'\x20files\x20'+p+v(0x107)+P+v(0xed)+X+v(0xb1)+l+v(0x10e)+X+v(0xdc)+I+'\x20single\x20file:\x20\x20\x20northflank\x20'+e+'\x20'+P+'\x20file\x20--localPath\x20my_directory/my-file.txt\x20--remotePath\x20/home/my-'+e+v(0xbd)+I+v(0xfe)+e+'\x20'+P+'\x20file\x20--localPath\x20my_directory\x20--remotePath\x20/home/'+e+v(0xdf))[v(0xd0)](v(0xca),v(0x10d)+e)[v(0xd0)]('--'+P+v(0xf5)+P+v(0xff),P[v(0xb3)](0x0)[v(0xb0)]()+P['slice'](0x1)+v(0xae)+e+v(0xf4))['option'](v(0xde),'Container\x20used\x20to\x20'+e+v(0xcf))[v(0xd0)](v(0xbc),v(0xf2))[v(0xd0)](v(0xad),v(0x10c))[v(0xd0)](v(0xc7),v(0xd2),![]);},this[A(0xb4)]=(P,e)=>{const s=A;if(e)return;const {sourceDirectory:I,targetDirectory:X,sourceFile:l,targetFile:p}=P;switch(P[s(0xee)]){case js_client_1['CopyType'][s(0xf1)]:{(0x0,utils_1[s(0xea)])('Downloaded\x20all\x20directory\x20contents\x20from\x20\x27'+I+s(0x108)+X+'\x27');break;}case js_client_1[s(0x104)][s(0xc5)]:{(0x0,utils_1[s(0xea)])(s(0xeb)+I+'/'+l+s(0xe4)+X+'/'+p+'\x27');break;}case js_client_1[s(0x104)]['DIRECTORY_UPLOAD']:{(0x0,utils_1['success'])(s(0xe2)+I+'\x27\x20to\x20container\x20directory\x20\x27'+X+'\x27');break;}case js_client_1[s(0x104)][s(0xd3)]:{(0x0,utils_1[s(0xea)])('Uploaded\x20file\x20from\x20\x27'+I+'/'+l+'\x27\x20to\x20\x27'+X+'/'+p+'\x27');break;}}},this['ensureRelevantPathIsSet']=(P,e)=>__awaiter(this,void 0x0,void 0x0,function*(){const U=A,I=P===U(0xba)&&e['remotePath']===undefined?yield this[U(0xd9)]('\x27remotePath\x27','download'):e[U(0xcc)],X=P==='upload'&&e['localPath']===undefined?yield this['askForPath'](U(0xef),'upload'):e[U(0xe5)];return{'localPath':X,'remotePath':I};}),this[A(0xd9)]=(P,e)=>__awaiter(this,void 0x0,void 0x0,function*(){const r=A,I=P+r(0xc9)+e+'s.\x20Please\x20enter\x20a\x20path:';return(yield inquirer[r(0xaf)]([{'type':r(0xf8),'name':'name','message':I}]))['name'];}),this['apiClient']=new js_client_1['ApiClient'](j,{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1[A(0xce)],'agent':h});const N=new inquirer_helper_1[(A(0xb6))](this[A(0xe0)]);this[A(0xd1)]=(0x0,utils_1['getCommand'])()['name']('download')['alias']('dl')[A(0xf9)](A(0xc6)),this[A(0xb5)]=(0x0,utils_1[A(0xe3)])()[A(0xd6)](A(0x10b))[A(0xcd)]('ul')[A(0xf9)](A(0xc3));const F=(0x0,utils_1['getCommand'])()[A(0xd6)](A(0xfb))['description']('File\x20and\x20directory\x20download\x20for\x20Northflank\x20service.'),K=(0x0,utils_1[A(0xe3)])()[A(0xd6)](A(0xfb))[A(0xf9)]('File\x20and\x20directory\x20upload\x20for\x20Northflank\x20service.'),G=(0x0,utils_1[A(0xe3)])()[A(0xd6)](A(0x106))[A(0xf9)](A(0xda)),d=(0x0,utils_1[A(0xe3)])()[A(0xd6)](A(0x106))[A(0xf9)](A(0xe6)),x=P=>{const V=A;return this[V(0xe7)]('service',P)[V(0xfa)](e=>__awaiter(this,void 0x0,void 0x0,function*(){const f=V,{projectId:I,serviceId:X,containerId:l,noDefaults:p,quiet:J}=e;(0x0,utils_1['assertContextExisting'])(this[f(0xe0)]);const Q=p?undefined:j[f(0xf3)](),y=I||Q||(yield N['askForProject']()),D=p?undefined:j['getCurrentServiceName'](),i=X||D||(yield N[f(0x102)](y)()),{remotePath:W,localPath:E}=yield this[f(0xf0)](P,e),t={'projectId':y,'serviceId':i},H=yield this['apiClient'][P][f(0xfb)][f(0xb7)](t,{'containerName':l,'localPath':E,'remotePath':W});this['logCopyResult'](H,J);}));},m=P=>{const O=A;return this[O(0xe7)](O(0x106),P)['action'](e=>__awaiter(this,void 0x0,void 0x0,function*(){const z=O,{projectId:I,jobId:X,containerId:l,noDefaults:p,quiet:J}=e;(0x0,utils_1[z(0xdd)])(this[z(0xe0)]);const Q=p?undefined:j['getCurrentProjectName'](),y=I||Q||(yield N['askForProject']()),D=X||(yield N[z(0xc2)](y)()),{remotePath:i,localPath:W}=yield this[z(0xf0)](P,e),E={'projectId':y,'jobId':D},t=yield this[z(0xe0)][P]['job'][z(0xb7)](E,{'containerName':l,'localPath':W,'remotePath':i});this['logCopyResult'](t,J);}));};F[A(0x10a)](x('download')),G[A(0x10a)](m(A(0xba))),K[A(0x10a)](x(A(0x10b))),d[A(0x10a)](m(A(0x10b))),this['downloadCmd'][A(0x10a)](F),this[A(0xd1)][A(0x10a)](G),this['uploadCmd']['addCommand'](K),this[A(0xb5)][A(0x10a)](d);}}exports[a3q(0xdb)]=CliFileCopy;