@northflank/cli 0.9.27 → 0.10.2

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 a0Y2=a0k;(function(Y,k){const Y1=a0k,X=Y();while(!![]){try{const B=-parseInt(Y1(0x148))/0x1*(parseInt(Y1(0x14b))/0x2)+-parseInt(Y1(0x126))/0x3*(parseInt(Y1(0x15f))/0x4)+parseInt(Y1(0x152))/0x5+-parseInt(Y1(0x160))/0x6*(-parseInt(Y1(0x123))/0x7)+parseInt(Y1(0x162))/0x8*(-parseInt(Y1(0x140))/0x9)+parseInt(Y1(0x157))/0xa+-parseInt(Y1(0x13d))/0xb*(-parseInt(Y1(0x13a))/0xc);if(B===k)break;else X['push'](X['shift']());}catch(l){X['push'](X['shift']());}}}(a0Y,0x9c834));var __awaiter=this&&this[a0Y2(0x13b)]||function(Y,k,X,B){function l(S){return S instanceof X?S:new X(function(C){C(S);});}return new(X||(X=Promise))(function(S,C){const Y5=a0k;function j(O){const Y3=a0k;try{e(B[Y3(0x158)](O));}catch(T){C(T);}}function o(O){try{e(B['throw'](O));}catch(T){C(T);}}function e(O){const Y4=a0k;O[Y4(0x15e)]?S(O[Y4(0x149)]):l(O[Y4(0x149)])[Y4(0x150)](j,o);}e((B=B[Y5(0x159)](Y,k||[]))['next']());});};Object[a0Y2(0x13f)](exports,'__esModule',{'value':!![]}),exports[a0Y2(0x146)]=void 0x0;const utils_1=require(a0Y2(0x142)),defaultPaginationPageSize=0x64,getProjects=Y=>k=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const Y6=a0Y2;var X;const B=yield Y[Y6(0x156)]['projects']({'options':{'per_page':defaultPaginationPageSize,'cursor':k===null||k===void 0x0?void 0x0:k[Y6(0x14f)]}});return{'elements':B[Y6(0x129)][Y6(0x131)][Y6(0x154)](l=>l['id']),'nextPageCursor':(X=B[Y6(0x125)])===null||X===void 0x0?void 0x0:X['cursor']};}),getServices=(Y,k)=>X=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const Y7=a0Y2;var B;const l=yield Y[Y7(0x156)][Y7(0x15c)]({'parameters':{'projectId':k},'options':{'per_page':defaultPaginationPageSize,'cursor':X===null||X===void 0x0?void 0x0:X[Y7(0x14f)]}});return{'elements':l[Y7(0x129)][Y7(0x15c)][Y7(0x154)](S=>S['id']),'nextPageCursor':(B=l[Y7(0x125)])===null||B===void 0x0?void 0x0:B[Y7(0x139)]};}),getAddons=(Y,k)=>X=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const Y8=a0Y2;var B;const l=yield Y[Y8(0x156)]['addons']({'parameters':{'projectId':k},'options':{'per_page':defaultPaginationPageSize,'cursor':X===null||X===void 0x0?void 0x0:X[Y8(0x14f)]}});return{'elements':l[Y8(0x129)][Y8(0x12b)][Y8(0x154)](S=>S['id']),'nextPageCursor':(B=l[Y8(0x125)])===null||B===void 0x0?void 0x0:B['cursor']};}),getAddonBackups=(Y,k,X)=>B=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const Y9=a0Y2;var l;const S=yield Y[Y9(0x120)]['addon'][Y9(0x12e)]({'parameters':{'projectId':k,'addonId':X},'options':{'per_page':defaultPaginationPageSize,'cursor':B===null||B===void 0x0?void 0x0:B['nextPageCursor']}});return{'elements':S['data'][Y9(0x12e)][Y9(0x154)](C=>C['id']),'nextPageCursor':(l=S[Y9(0x125)])===null||l===void 0x0?void 0x0:l[Y9(0x139)]};});function fetchResourceList(Y,k,X,B,l,S){var C,j,o,e,O,T,v,F,x,t,Q,n;return __awaiter(this,void 0x0,void 0x0,function*(){const YY=a0k,M=undefined;try{if(Y===YY(0x144)){const N=yield k[YY(0x156)][YY(0x153)]({}),K=N['data']['plans'][YY(0x154)](r=>{const Yk=YY;var w;return(w=r===null||r===void 0x0?void 0x0:r[Yk(0x147)])!==null&&w!==void 0x0?w:r===null||r===void 0x0?void 0x0:r['id'];});return{'choices':K,'defaultValue':M};}if(Y===YY(0x13e)&&!(X===null||X===void 0x0?void 0x0:X['includes'](YY(0x138)))){const r=yield k['list'][YY(0x12c)]({}),w=r[YY(0x129)][YY(0x12c)][YY(0x154)](h=>{const YX=YY;var g;return(g=h===null||h===void 0x0?void 0x0:h[YX(0x147)])!==null&&g!==void 0x0?g:h===null||h===void 0x0?void 0x0:h['id'];});return{'choices':w,'defaultValue':M};}if(Y==='projectId'){const h=yield getProjects(k),{elements:g,nextPageCursor:y}=yield h();return{'choices':g,'defaultValue':M,'pagination':{'nextPageCursor':y,'loadMore':h}};}if(Y===YY(0x14a)){const R=yield k['list'][YY(0x132)]({}),q=R[YY(0x129)][YY(0x14a)][YY(0x154)](U=>U['id']);return{'choices':q,'defaultValue':M};}const p=l===null||l===void 0x0?void 0x0:l['projectId'],d=Y==='serviceId'||Y==='id'&&(S===null||S===void 0x0?void 0x0:S[YY(0x14c)]('owningObject'));if(p!==undefined&&d){const U=yield getServices(k,p),{elements:L,nextPageCursor:z}=yield U();return{'choices':L,'defaultValue':M,'pagination':{'nextPageCursor':z,'loadMore':U}};}const P=X===null||X===void 0x0?void 0x0:X['includes'](YY(0x121));if(P){const A=D=>__awaiter(this,void 0x0,void 0x0,function*(){const YB=YY;var E;const b=yield k[YB(0x120)][YB(0x121)][YB(0x124)]({});return(E=b['data'][YB(0x133)])===null||E===void 0x0?void 0x0:E[YB(0x154)](a=>a[YB(0x128)])[YB(0x13c)](a=>a[YB(0x128)]===D);});if(Y===YY(0x128)){const D=yield k[YY(0x120)][YY(0x121)][YY(0x124)]({}),E=(C=D[YY(0x129)][YY(0x133)])===null||C===void 0x0?void 0x0:C[YY(0x154)](b=>b[YY(0x128)]);return{'choices':E,'defaultValue':M};}if(Y===YY(0x12d)&&(B===null||B===void 0x0?void 0x0:B[YY(0x128)])!==undefined){const b=(j=yield A(B[YY(0x128)]))===null||j===void 0x0?void 0x0:j['versions'],a=b!==undefined?[YY(0x12a),...b]:undefined;return{'choices':a,'defaultValue':M};}if(Y==='storage'&&(B===null||B===void 0x0?void 0x0:B[YY(0x128)])!==undefined){const Z=(e=(o=yield A(B[YY(0x128)]))===null||o===void 0x0?void 0x0:o[YY(0x137)])===null||e===void 0x0?void 0x0:e[YY(0x134)];return{'choices':Z===null||Z===void 0x0?void 0x0:Z[YY(0x127)],'defaultValue':Z===null||Z===void 0x0?void 0x0:Z['default']};}if(Y===YY(0x122)&&(B===null||B===void 0x0?void 0x0:B[YY(0x128)])!==undefined){const c=(T=(O=yield A(B['type']))===null||O===void 0x0?void 0x0:O['resources'])===null||T===void 0x0?void 0x0:T[YY(0x122)];return{'choices':c===null||c===void 0x0?void 0x0:c[YY(0x127)],'defaultValue':c===null||c===void 0x0?void 0x0:c[YY(0x141)]};}}if(Y===YY(0x14e)&&(l===null||l===void 0x0?void 0x0:l[YY(0x163)])!==undefined){const V=yield getAddons(k,l===null||l===void 0x0?void 0x0:l[YY(0x163)]),{elements:m,nextPageCursor:J}=yield V();return{'choices':m,'defaultValue':M,'pagination':{'nextPageCursor':J,'loadMore':V}};}if(Y===YY(0x15a)&&(l===null||l===void 0x0?void 0x0:l['projectId'])!==undefined&&((v=B===null||B===void 0x0?void 0x0:B[YY(0x15b)])===null||v===void 0x0?void 0x0:v[YY(0x14e)])!==undefined){const H=yield getAddonBackups(k,l===null||l===void 0x0?void 0x0:l['projectId'],(F=B===null||B===void 0x0?void 0x0:B[YY(0x15b)])===null||F===void 0x0?void 0x0:F[YY(0x14e)]),{elements:G,nextPageCursor:s}=yield H();return{'choices':G,'defaultValue':M,'pagination':{'nextPageCursor':s,'loadMore':H}};}const f=(x=l===null||l===void 0x0?void 0x0:l['addonId'])!==null&&x!==void 0x0?x:(t=B===null||B===void 0x0?void 0x0:B[YY(0x151)])===null||t===void 0x0?void 0x0:t['addonId'];if((X===null||X===void 0x0?void 0x0:X[YY(0x15d)](''))==='updateaddonversion'&&Y===YY(0x12d)&&(l===null||l===void 0x0?void 0x0:l[YY(0x163)])!==undefined&&f!==undefined){const {upgradeTo:I}=(yield k[YY(0x120)][YY(0x121)][YY(0x12d)]({'parameters':{'addonId':f,'projectId':l===null||l===void 0x0?void 0x0:l[YY(0x163)]}}))['data'];if(I===undefined||I[YY(0x136)]<=0x0){(0x0,utils_1[YY(0x12f)])(YY(0x14d));throw new Error();}return{'choices':I[YY(0x154)](i=>i[YY(0x12d)]),'defaultValue':M};}if(Y===YY(0x155)){const u=yield k[YY(0x156)]['templates']({}),i=u[YY(0x129)]['templates'][YY(0x154)](W=>W===null||W===void 0x0?void 0x0:W['id']);return{'choices':i,'defaultValue':M};}if(((X===null||X===void 0x0?void 0x0:X[YY(0x14c)](YY(0x161)))||(X===null||X===void 0x0?void 0x0:X[YY(0x14c)](YY(0x135))))&&Y===YY(0x145)&&f!==undefined&&(l===null||l===void 0x0?void 0x0:l['projectId'])!==undefined){const W=(yield k['get'][YY(0x121)][YY(0x14a)]({'parameters':{'addonId':f,'projectId':l===null||l===void 0x0?void 0x0:l[YY(0x163)]}}))[YY(0x129)];return{'choices':[...(Q=Object['keys'](W===null||W===void 0x0?void 0x0:W[YY(0x130)]))!==null&&Q!==void 0x0?Q:[],...(n=Object[YY(0x143)](W===null||W===void 0x0?void 0x0:W['secrets']))!==null&&n!==void 0x0?n:[]]};}}catch(Y0){}return{'choices':undefined,'defaultValue':M};});}function a0Y(){const Yl=['services','join','done','5020vkZRCa','1609998amAvKE','secretLink','10229624FttLWb','projectId','get','addon','replicas','7xdPlXW','types','pagination','948xOppWG','options','type','data','latest','addons','regions','version','backups','warning','envs','projects','registryCredentials','addonTypes','storage','secret','length','resources','logSink','cursor','12DXOyQj','__awaiter','find','18894491nGLGoD','region','defineProperty','9eURoPZ','default','./utils','keys','deploymentPlan','keyName','fetchResourceList','internalId','1bXjnBW','value','credentials','1168718bGjcHm','includes','No\x20available\x20versions\x20to\x20upgrade\x20to.','addonId','nextPageCursor','then','addonDependencies','4346240oRpFZh','plans','map','templateId','list','454560KrgaZz','next','apply','backupId','source'];a0Y=function(){return Yl;};return a0Y();}function a0k(Y,k){const X=a0Y();return a0k=function(B,l){B=B-0x120;let S=X[B];return S;},a0k(Y,k);}exports['fetchResourceList']=fetchResourceList;
1
+ 'use strict';function a0U(){const Uv=['source','addonTypes','586760hBlaqu','./utils','secretLink','addon','22TjlMbp','value','secrets','storage','type','credentials','secret','4ZzdRgA','addonId','internalId','templates','find','throw','keys','addons','version','4528pltHQq','region','projectId','versions','2563981nxGBib','addonDependencies','deploymentPlan','backupId','pagination','projects','get','includes','updateaddonversion','__awaiter','length','nextPageCursor','defineProperty','warning','__esModule','resources','next','3424356nQqgFz','1468580YBKGKt','default','backups','regions','owningObject','services','894WyvKXm','4995VjjpQW','plans','map','registryCredentials','latest','types','cursor','data','1335507cLLDAe','options','list','replicas'];a0U=function(){return Uv;};return a0U();}const a0U3=a0K;(function(U,K){const U2=a0K,q=U();while(!![]){try{const X=parseInt(U2(0x206))/0x1*(parseInt(U2(0x216))/0x2)+parseInt(U2(0x1fc))/0x3*(-parseInt(U2(0x20d))/0x4)+-parseInt(U2(0x1f4))/0x5*(-parseInt(U2(0x1f3))/0x6)+parseInt(U2(0x21a))/0x7+-parseInt(U2(0x202))/0x8+parseInt(U2(0x22b))/0x9+-parseInt(U2(0x22c))/0xa;if(X===K)break;else q['push'](q['shift']());}catch(J){q['push'](q['shift']());}}}(a0U,0x445f6));var __awaiter=this&&this[a0U3(0x223)]||function(U,K,q,X){function J(v){return v instanceof q?v:new q(function(f){f(v);});}return new(q||(q=Promise))(function(v,f){const U7=a0K;function L(z){const U4=a0K;try{E(X[U4(0x22a)](z));}catch(p){f(p);}}function M(z){const U5=a0K;try{E(X[U5(0x212)](z));}catch(p){f(p);}}function E(z){const U6=a0K;z['done']?v(z['value']):J(z[U6(0x207)])['then'](L,M);}E((X=X['apply'](U,K||[]))[U7(0x22a)]());});};function a0K(U,K){const q=a0U();return a0K=function(X,J){X=X-0x1f2;let v=q[X];return v;},a0K(U,K);}Object[a0U3(0x226)](exports,a0U3(0x228),{'value':!![]}),exports['fetchResourceList']=void 0x0;const utils_1=require(a0U3(0x203)),defaultPaginationPageSize=0x64,getProjects=U=>K=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const U8=a0U3;var q;const X=yield U[U8(0x1fe)][U8(0x21f)]({'options':{'per_page':defaultPaginationPageSize,'cursor':K===null||K===void 0x0?void 0x0:K[U8(0x225)]}});return{'elements':X['data'][U8(0x21f)][U8(0x1f6)](J=>J['id']),'nextPageCursor':(q=X[U8(0x21e)])===null||q===void 0x0?void 0x0:q['cursor']};}),getServices=(U,K)=>q=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const U9=a0U3;var X;const J=yield U[U9(0x1fe)][U9(0x1f2)]({'parameters':{'projectId':K},'options':{'per_page':defaultPaginationPageSize,'cursor':q===null||q===void 0x0?void 0x0:q[U9(0x225)]}});return{'elements':J[U9(0x1fb)][U9(0x1f2)][U9(0x1f6)](v=>v['id']),'nextPageCursor':(X=J[U9(0x21e)])===null||X===void 0x0?void 0x0:X[U9(0x1fa)]};}),getAddons=(U,K)=>q=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const UU=a0U3;var X;const J=yield U[UU(0x1fe)][UU(0x214)]({'parameters':{'projectId':K},'options':{'per_page':defaultPaginationPageSize,'cursor':q===null||q===void 0x0?void 0x0:q[UU(0x225)]}});return{'elements':J['data'][UU(0x214)][UU(0x1f6)](v=>v['id']),'nextPageCursor':(X=J[UU(0x21e)])===null||X===void 0x0?void 0x0:X['cursor']};}),getAddonBackups=(U,K,q)=>X=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const UK=a0U3;var J;const v=yield U[UK(0x220)][UK(0x205)][UK(0x22e)]({'parameters':{'projectId':K,'addonId':q},'options':{'per_page':defaultPaginationPageSize,'cursor':X===null||X===void 0x0?void 0x0:X['nextPageCursor']}});return{'elements':v[UK(0x1fb)]['backups']['map'](f=>f['id']),'nextPageCursor':(J=v[UK(0x21e)])===null||J===void 0x0?void 0x0:J[UK(0x1fa)]};});function fetchResourceList(U,K,q,X,J,v){var f,L,M,E,z,p,O,F,o,Q,w,R;return __awaiter(this,void 0x0,void 0x0,function*(){const Uq=a0K,W=undefined;try{if(U===Uq(0x21c)){const x=yield K[Uq(0x1fe)][Uq(0x1f5)]({}),a=x[Uq(0x1fb)]['plans'][Uq(0x1f6)](m=>{var i;return(i=m===null||m===void 0x0?void 0x0:m['internalId'])!==null&&i!==void 0x0?i:m===null||m===void 0x0?void 0x0:m['id'];});return{'choices':a,'defaultValue':W};}if(U===Uq(0x217)&&!(q===null||q===void 0x0?void 0x0:q[Uq(0x221)]('logSink'))){const m=yield K['list'][Uq(0x22f)]({}),i=m[Uq(0x1fb)][Uq(0x22f)][Uq(0x1f6)](G=>{const UX=Uq;var A;return(A=G===null||G===void 0x0?void 0x0:G[UX(0x20f)])!==null&&A!==void 0x0?A:G===null||G===void 0x0?void 0x0:G['id'];});return{'choices':i,'defaultValue':W};}if(U===Uq(0x218)){const G=yield getProjects(K),{elements:A,nextPageCursor:s}=yield G();return{'choices':A,'defaultValue':W,'pagination':{'nextPageCursor':s,'loadMore':G}};}if(U===Uq(0x20b)){const D=yield K[Uq(0x1fe)][Uq(0x1f7)]({}),H=D[Uq(0x1fb)]['credentials'][Uq(0x1f6)](g=>g['id']);return{'choices':H,'defaultValue':W};}const V=J===null||J===void 0x0?void 0x0:J[Uq(0x218)],b=U==='serviceId'||U==='id'&&(v===null||v===void 0x0?void 0x0:v['includes'](Uq(0x230)));if(V!==undefined&&b){const g=yield getServices(K,V),{elements:S,nextPageCursor:C}=yield g();return{'choices':S,'defaultValue':W,'pagination':{'nextPageCursor':C,'loadMore':g}};}const B=q===null||q===void 0x0?void 0x0:q[Uq(0x221)](Uq(0x205));if(B){const N=Z=>__awaiter(this,void 0x0,void 0x0,function*(){const UJ=Uq;var n;const t=yield K[UJ(0x220)][UJ(0x205)][UJ(0x1f9)]({});return(n=t['data'][UJ(0x201)])===null||n===void 0x0?void 0x0:n[UJ(0x1f6)](Y=>Y[UJ(0x20a)])[UJ(0x211)](Y=>Y['type']===Z);});if(U===Uq(0x20a)){const Z=yield K['get'][Uq(0x205)]['types']({}),n=(f=Z[Uq(0x1fb)][Uq(0x201)])===null||f===void 0x0?void 0x0:f[Uq(0x1f6)](t=>t[Uq(0x20a)]);return{'choices':n,'defaultValue':W};}if(U===Uq(0x215)&&(X===null||X===void 0x0?void 0x0:X[Uq(0x20a)])!==undefined){const t=(L=yield N(X['type']))===null||L===void 0x0?void 0x0:L[Uq(0x219)],Y=t!==undefined?[Uq(0x1f8),...t]:undefined;return{'choices':Y,'defaultValue':W};}if(U===Uq(0x209)&&(X===null||X===void 0x0?void 0x0:X[Uq(0x20a)])!==undefined){const l=(E=(M=yield N(X['type']))===null||M===void 0x0?void 0x0:M[Uq(0x229)])===null||E===void 0x0?void 0x0:E[Uq(0x209)];return{'choices':l===null||l===void 0x0?void 0x0:l[Uq(0x1fd)],'defaultValue':l===null||l===void 0x0?void 0x0:l[Uq(0x22d)]};}if(U===Uq(0x1ff)&&(X===null||X===void 0x0?void 0x0:X[Uq(0x20a)])!==undefined){const T=(p=(z=yield N(X[Uq(0x20a)]))===null||z===void 0x0?void 0x0:z[Uq(0x229)])===null||p===void 0x0?void 0x0:p['replicas'];return{'choices':T===null||T===void 0x0?void 0x0:T['options'],'defaultValue':T===null||T===void 0x0?void 0x0:T[Uq(0x22d)]};}}if(U===Uq(0x20e)&&(J===null||J===void 0x0?void 0x0:J[Uq(0x218)])!==undefined){const I=yield getAddons(K,J===null||J===void 0x0?void 0x0:J['projectId']),{elements:c,nextPageCursor:h}=yield I();return{'choices':c,'defaultValue':W,'pagination':{'nextPageCursor':h,'loadMore':I}};}if(U===Uq(0x21d)&&(J===null||J===void 0x0?void 0x0:J['projectId'])!==undefined&&((O=X===null||X===void 0x0?void 0x0:X[Uq(0x200)])===null||O===void 0x0?void 0x0:O[Uq(0x20e)])!==undefined){const P=yield getAddonBackups(K,J===null||J===void 0x0?void 0x0:J['projectId'],(F=X===null||X===void 0x0?void 0x0:X[Uq(0x200)])===null||F===void 0x0?void 0x0:F[Uq(0x20e)]),{elements:k,nextPageCursor:u}=yield P();return{'choices':k,'defaultValue':W,'pagination':{'nextPageCursor':u,'loadMore':P}};}const y=(o=J===null||J===void 0x0?void 0x0:J[Uq(0x20e)])!==null&&o!==void 0x0?o:(Q=X===null||X===void 0x0?void 0x0:X[Uq(0x21b)])===null||Q===void 0x0?void 0x0:Q[Uq(0x20e)];if((q===null||q===void 0x0?void 0x0:q['join'](''))===Uq(0x222)&&U===Uq(0x215)&&(J===null||J===void 0x0?void 0x0:J[Uq(0x218)])!==undefined&&y!==undefined){const {upgradeTo:d}=(yield K[Uq(0x220)]['addon']['version']({'parameters':{'addonId':y,'projectId':J===null||J===void 0x0?void 0x0:J[Uq(0x218)]}}))[Uq(0x1fb)];if(d===undefined||d[Uq(0x224)]<=0x0){(0x0,utils_1[Uq(0x227)])('No\x20available\x20versions\x20to\x20upgrade\x20to.');throw new Error();}return{'choices':d[Uq(0x1f6)](r=>r[Uq(0x215)]),'defaultValue':W};}if(U==='templateId'){const r=yield K[Uq(0x1fe)][Uq(0x210)]({}),j=r[Uq(0x1fb)][Uq(0x210)][Uq(0x1f6)](U0=>U0===null||U0===void 0x0?void 0x0:U0['id']);return{'choices':j,'defaultValue':W};}if(((q===null||q===void 0x0?void 0x0:q[Uq(0x221)](Uq(0x204)))||(q===null||q===void 0x0?void 0x0:q[Uq(0x221)](Uq(0x20c))))&&U==='keyName'&&y!==undefined&&(J===null||J===void 0x0?void 0x0:J['projectId'])!==undefined){const U0=(yield K[Uq(0x220)][Uq(0x205)][Uq(0x20b)]({'parameters':{'addonId':y,'projectId':J===null||J===void 0x0?void 0x0:J['projectId']}}))[Uq(0x1fb)];return{'choices':[...(w=Object[Uq(0x213)](U0===null||U0===void 0x0?void 0x0:U0['envs']))!==null&&w!==void 0x0?w:[],...(R=Object[Uq(0x213)](U0===null||U0===void 0x0?void 0x0:U0[Uq(0x208)]))!==null&&R!==void 0x0?R:[]]};}}catch(U1){}return{'choices':undefined,'defaultValue':W};});}exports['fetchResourceList']=fetchResourceList;
package/dist/cli.js CHANGED
@@ -1,2 +1,2 @@
1
- #!/usr/bin/env node
2
- 'use strict';function a1k(Y,k){const X=a1Y();return a1k=function(B,l){B=B-0x145;let S=X[B];return S;},a1k(Y,k);}const a1Yv=a1k;(function(Y,k){const YT=a1k,X=Y();while(!![]){try{const B=-parseInt(YT(0x151))/0x1*(parseInt(YT(0x189))/0x2)+parseInt(YT(0x1b8))/0x3+-parseInt(YT(0x170))/0x4*(parseInt(YT(0x1c1))/0x5)+-parseInt(YT(0x178))/0x6+-parseInt(YT(0x156))/0x7+parseInt(YT(0x200))/0x8*(parseInt(YT(0x15f))/0x9)+parseInt(YT(0x1c9))/0xa;if(B===k)break;else X['push'](X['shift']());}catch(l){X['push'](X['shift']());}}}(a1Y,0x2e3b7));var __createBinding=this&&this[a1Yv(0x1ce)]||(Object[a1Yv(0x208)]?function(Y,X,B,l){const YF=a1Yv;if(l===undefined)l=B;var S=Object[YF(0x22b)](X,B);(!S||(YF(0x1b1)in S?!X[YF(0x17b)]:S[YF(0x1b2)]||S[YF(0x1dd)]))&&(S={'enumerable':!![],'get':function(){return X[B];}}),Object['defineProperty'](Y,l,S);}:function(Y,X,B,l){if(l===undefined)l=B;Y[l]=X[B];}),__setModuleDefault=this&&this[a1Yv(0x1f3)]||(Object[a1Yv(0x208)]?function(Y,k){const Yx=a1Yv;Object['defineProperty'](Y,Yx(0x1f2),{'enumerable':!![],'value':k});}:function(Y,k){const Yt=a1Yv;Y[Yt(0x1f2)]=k;}),__importStar=this&&this[a1Yv(0x1d5)]||function(Y){const YQ=a1Yv;if(Y&&Y[YQ(0x17b)])return Y;var X={};if(Y!=null){for(var B in Y)if(B!==YQ(0x1f2)&&Object[YQ(0x152)][YQ(0x210)][YQ(0x19b)](Y,B))__createBinding(X,Y,B);}return __setModuleDefault(X,Y),X;},__awaiter=this&&this['__awaiter']||function(Y,k,X,B){function l(S){return S instanceof X?S:new X(function(C){C(S);});}return new(X||(X=Promise))(function(S,C){const Yp=a1k;function j(O){const Yn=a1k;try{e(B[Yn(0x14d)](O));}catch(T){C(T);}}function o(O){try{e(B['throw'](O));}catch(T){C(T);}}function e(O){const YM=a1k;O[YM(0x21c)]?S(O['value']):l(O['value'])[YM(0x171)](j,o);}e((B=B['apply'](Y,k||[]))[Yp(0x14d)]());});},__importDefault=this&&this[a1Yv(0x229)]||function(Y){const Yd=a1Yv;return Y&&Y[Yd(0x17b)]?Y:{'default':Y};};Object['defineProperty'](exports,a1Yv(0x17b),{'value':!![]}),exports[a1Yv(0x1fd)]=void 0x0;const js_client_1=require(a1Yv(0x179)),commander_1=__importDefault(require('commander')),fs_1=__importDefault(require('fs')),chalk_1=__importDefault(require(a1Yv(0x1ad))),_=__importStar(require(a1Yv(0x17a))),contextCommands_1=require(a1Yv(0x1d9)),utils_1=require(a1Yv(0x209)),defaults=__importStar(require(a1Yv(0x1a8))),inquirer_helper_1=require(a1Yv(0x21d)),console_format_helpers_1=require(a1Yv(0x14b)),command_overview_1=require(a1Yv(0x15d)),port_forward_1=require(a1Yv(0x176)),exec_1=require(a1Yv(0x146)),logs_1=require(a1Yv(0x242)),metrics_1=require(a1Yv(0x16b)),yaml=require(a1Yv(0x1b0)),pgk=require('../package.json'),getProgram=Y=>{const YP=a1Yv,k=new commander_1[(YP(0x1f2))]['Command'](YP(0x1ef));k[YP(0x23e)](YP(0x1b4)),k['enablePositionalOptions'](!![]),k['version']('Northflank\x20cli\x20version:\x20'+chalk_1[YP(0x1f2)][YP(0x211)](pgk['version']),YP(0x233),YP(0x184));const X=new js_client_1['ApiClient'](Y,{'throwErrorOnHttpErrorCode':![],'customUserAgent':utils_1[YP(0x217)],'agent':utils_1[YP(0x1d1)]}),B=new contextCommands_1[(YP(0x155))](X,utils_1[YP(0x1d1)]),l=new port_forward_1[(YP(0x202))](Y,utils_1[YP(0x1d1)]),S=new exec_1[(YP(0x15b))](Y,utils_1['agent']),C=new logs_1['CliLogs'](Y,utils_1['agent']),j=new metrics_1[(YP(0x1f6))](Y,utils_1[YP(0x1d1)]);return k[YP(0x212)](l[YP(0x1d6)]),k[YP(0x212)](S[YP(0x1af)]),k[YP(0x212)](B[YP(0x1fe)]),k['addCommand'](B['contexts']),generateCommands(X,X[YP(0x150)],k,C,j),k[YP(0x212)]((0x0,command_overview_1[YP(0x19c)])(k)),k[YP(0x1ff)](!![],YP(0x17f)),k['helpOption'](undefined,YP(0x17f)),k;};function a1Y(){const Yc=['action','subdomainPath','template','Print\x20the\x20current\x20version\x20of\x20the\x20Northflank\x20cli','warning','url','repositories','stringify','104QWCbUh','getCurrentContext','upperFirst','method','tag','addHelpText','runId','toString','adn','askForAddon','OPTIONAL:\x20','paginationArgs','runs','verbose','resource','buildId','askForVolume','Options\x20\x27loadAll\x27\x20can\x20not\x20be\x20combined\x20with\x20\x27page\x27\x20or\x20\x27cursor\x27','call','getCommandOverview','volumeId','.json','name','backupDestinationId','pipelineId','askForBuild','logs','asyncSequential','boolean','isPaginatedEndpoint','job','./defaults','commands','-f,\x20--file\x20<file-path>','services',',\x20NF\x20error\x20id:\x20','chalk','InquirerHelper','execCmd','js-yaml','get','writable','templateId','Manage\x20your\x20Northflank\x20resources\x20from\x20the\x20command\x20line','argv','subdomainId','concat','444738nFfmsO','isEqual','isString','(HTTP\x20status\x20code:\x20','request','quiet','opt','log','invoice','50NnMhuy','askForClusterId','backups','delete','vol','error','credentialId','pagination','4993800TJtLMy','Unknown\x20input\x20format.\x20Not\x20valid\x20json\x20and\x20not\x20valid\x20yaml.','askForPipeline','output','required','__createBinding','Update\x20Northflank\x20','readFileSync','agent','nonInteractiveEndpoint','there\x20are\x20more\x20rows,\x20load?','all','__importStar','portFwdCmd','getLogsCommand','parseAsync','./context/contextCommands','join','handleJsonOutput','contextProvider','configurable','opts','jobId','toLowerCase','prj','host','alias','data','Expecting\x20resource\x20input\x20with\x20\x27--input\x27\x20or\x20\x27--file\x27\x20argument','statusText','branches','svc','map','page','aliases','logSinkId','exitCode','plan','northflank','API\x20request\x20failed\x0a\x09Message:\x20','api.','default','__setModuleDefault','secrets','getCurrentProjectName','CliMetrics','askForTemplate','--verbose','\x20--','rawResponse','cursor','printAsTable','getProgram','login','addHelpCommand','56ZfeyqP','File\x20does\x20not\x20exist:\x20','CliPortForward','VERBOSE:\x20Request\x20body\x20->\x20','filter','loadAll','query','askForSecret','create','./utils','JSON-formatted\x20resource\x20definition,\x20takes\x20precedence\x20over\x20\x22--file\x22','includes','plans','repository','backup-destinations','length','hasOwnProperty','underline','addCommand','after','.yaml','askForLogSink','consoleFormat','customUserAgent','assign','replace','askConfirm','count','done','./inquirer-helper','setPathVars','backupId','bind','file','volumes','kebabCase','subdomain','askForTemplateRun','forEach','addon','\x0a\x09details\x20:','__importDefault','yml','getOwnPropertyDescriptor','addons','clearLine','regions','repos','endsWith','addonId','project','-v,\x20--version','body','some','noDefaults','has','hasNextPage','templates','askForAddonBackup','askForSubdomain','brn','getCommand','description','getOwnPropertyNames','path','Failed\x20to\x20validate\x20input\x20(incorrect\x20format):\x20','./logs','branch','ApiClientFileContextProvider','domainId','askForJob','assertContextExisting','backup','docsTagsPath','force','projectId','./exec','serviceId','\x20properties','invoices','askForBackupDestination','./formatting/console-format-helpers','requiredPermissions','next','pop','isArray','endpoints','785gIvYlU','prototype','-i,\x20--input\x20<resource-def>','resourceTagId','CliContext','2315397WgCkuT','region','set','type','askForSubdomainPath','CliExec','omit','./formatting/command-overview','split','448047UdNuKv','yaml','askForTag','toUpperCase','restores','json','askForDomain','entries','secretId','domains','askGeneric','tpl','./metrics','secret','keys','volume','stdout','37716NlrRxz','then','VERBOSE:\x20Using\x20endpoint\x20->\x20','domain','find','parse','./port-forward','getMetricsCommand','2045154eRVtXI','@northflank/js-client','lodash','__esModule','custom-columns=','projects','option','Display\x20help\x20for\x20command','service'];a1Y=function(){return Yc;};return a1Y();}exports['getProgram']=getProgram,((()=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const Yf=a1Yv;try{const Y=new js_client_1[(Yf(0x244))]();yield(0x0,utils_1['checkUpdate'])(Y);const k=(0x0,exports['getProgram'])(Y);yield k[Yf(0x1d8)](process['argv']);}catch(X){(0x0,utils_1[Yf(0x1c6)])('Error\x20occured\x20while\x20trying\x20to\x20run\x20command,\x20error:\x20'+X['message']),process[Yf(0x1b5)]['find'](B=>B===Yf(0x1f8))&&console[Yf(0x1bf)](X),process[Yf(0x1ed)]=0x1;}}))());function isListCommand(Y){const YN=a1Yv,k=[['get',YN(0x227),YN(0x1c3)],[YN(0x1b1),'job',YN(0x195)]];return Y['find'](X=>X==='list')||k[YN(0x235)](X=>_[YN(0x1b9)](Y,X));}function generateCommands(Y,k,X,B,l,S=defaults['defaults'],C=[]){const YK=a1Yv,j=new inquirer_helper_1[(YK(0x1ae))](new js_client_1['ApiClient'](Y[YK(0x1dc)],{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1[YK(0x217)],'agent':utils_1[YK(0x1d1)]}));function o(v,F){const Yr=YK;return v[Yr(0x1cd)]!==![]&&F===undefined;}function e(v,F){const Yw=YK,{opt:x,name:t}=v,Q=x[Yw(0x1f2)],n=o(x,Q),M=K=>K[Yw(0x20f)]>0x1?'--'+K:'-'+K,p=x===null||x===void 0x0?void 0x0:x[Yw(0x1e3)],d=p?_[Yw(0x14f)](p)?'-'+(p===null||p===void 0x0?void 0x0:p[Yw(0x1e9)](K=>M(K))[Yw(0x1da)](',\x20-'))+',':''+M(p):'',P=n?'':Yw(0x193),f=typeof x[Yw(0x159)]===Yw(0x1a5)||x[Yw(0x159)]===Yw(0x1a5)?d+Yw(0x1f9)+t:d+Yw(0x1f9)+t+'\x20<'+t[Yw(0x162)]()+'>',N=P+x[Yw(0x23e)];F[Yw(0x17e)](f,N,Q);}function O(v,F){const Yh=YK;if(F[Yh(0x1a9)][Yh(0x235)](x=>x[Yh(0x19f)]()===Yh(0x1a3)))return;_[Yh(0x1b9)](v,[Yh(0x1b1),'service'])&&(F[Yh(0x212)](B[Yh(0x1d7)]('service')),F['addCommand'](l[Yh(0x177)](Yh(0x180))),F[Yh(0x212)](B[Yh(0x1d7)]('service',!![])),F['addCommand'](l[Yh(0x177)](Yh(0x180),!![]))),_[Yh(0x1b9)](v,[Yh(0x1b1),Yh(0x1a7)])&&(F[Yh(0x212)](B[Yh(0x1d7)]('job')),F[Yh(0x212)](l[Yh(0x177)](Yh(0x1a7))),F[Yh(0x212)](B[Yh(0x1d7)](Yh(0x1a7),!![])),F[Yh(0x212)](l[Yh(0x177)]('job',!![]))),_[Yh(0x1b9)](v,[Yh(0x1b1),Yh(0x227)])&&(F[Yh(0x212)](B['getLogsCommand']('addon')),F['addCommand'](l['getMetricsCommand'](Yh(0x227)))),_[Yh(0x1b9)](v,[Yh(0x1b1),Yh(0x227),Yh(0x248)])&&F[Yh(0x212)](B[Yh(0x1d7)]('addon',![],!![])),_[Yh(0x1b9)](v,[Yh(0x1b1),Yh(0x227),Yh(0x163)])&&F[Yh(0x212)](B[Yh(0x1d7)](Yh(0x227),![],!![],!![]));}return Object[YK(0x23f)](S)[YK(0x226)](v=>{const Yg=YK,F=k[v],x=S[v],t=C[Yg(0x1b7)]([v]);function Q(w,h){const Yy=Yg,g=Object[Yy(0x23f)](w||{});g['map'](y=>{return{'name':y,'opt':w[y]};})['sort']((y,R)=>!o(y['opt'])?!o(R[Yy(0x1be)])?0x0:0x1:-0x1)[Yy(0x226)](y=>{e(y,h);});}function n(w,h){const YR=Yg,g=[[YR(0x232),YR(0x17d),YR(0x1e1)],[YR(0x180),YR(0x1ab),YR(0x1e8)],['credentials','credential','cred'],[YR(0x227),YR(0x22c),YR(0x191)],['job','jobs'],[YR(0x1ee),YR(0x20c),'pln'],[YR(0x157),YR(0x22e),'rgn'],[YR(0x173),YR(0x168),'dmn'],[YR(0x16c),YR(0x1f4),'scrt'],[YR(0x222),YR(0x16e),YR(0x1c5)],[YR(0x1e7),YR(0x243),YR(0x23c)],[YR(0x1c0),YR(0x149),'inv'],[YR(0x183),YR(0x239),YR(0x16a)],[YR(0x22f),YR(0x20d),YR(0x187),'repo'],['backup-destination',YR(0x20e)],[YR(0x18d),'tags']],y=g[YR(0x174)](R=>R[YR(0x20b)](h));if(y!==undefined)w[YR(0x1eb)](y['filter'](R=>R!==h));}function M(w){var h,g;return __awaiter(this,void 0x0,void 0x0,function*(){const Yq=a1k,y={},{contextProvider:R}=Y,q=t[Yq(0x20b)](Yq(0x1c4)),U=w[Yq(0x236)]===!![];function L(z,A,D){var E,b;return __awaiter(this,void 0x0,void 0x0,function*(){const YU=a1k;if(_[YU(0x237)]((b=(E=x[YU(0x1be)])===null||E===void 0x0?void 0x0:E[YU(0x240)])!==null&&b!==void 0x0?b:{},z)){const a=!U&&!q&&D?D():undefined,Z=w[z]||a||(yield A());_[YU(0x158)](y,z,Z);}});}return yield(0x0,utils_1[Yq(0x1a4)])(Object[Yq(0x166)]((g=(h=x[Yq(0x1be)])===null||h===void 0x0?void 0x0:h[Yq(0x240)])!==null&&g!==void 0x0?g:{}),([z,A])=>__awaiter(this,void 0x0,void 0x0,function*(){const YL=Yq;var D;const E=y===null||y===void 0x0?void 0x0:y['projectId'],b=y===null||y===void 0x0?void 0x0:y['templateId'];switch(z){case YL(0x145):return yield L(YL(0x145),j['askForProject'][YL(0x220)](j),R[YL(0x1f5)][YL(0x220)](R));case YL(0x147):return yield L('serviceId',j['askForService'](E)[YL(0x220)](j),R['getCurrentServiceName'][YL(0x220)](R));case YL(0x231):return yield L(YL(0x231),j[YL(0x192)](E)['bind'](j));case YL(0x1df):return yield L(YL(0x1df),j[YL(0x246)](E)['bind'](j),R['getCurrentJobName'][YL(0x220)](R));case YL(0x18f):return yield L(YL(0x18f),j['askForJobRun'](y[YL(0x1df)],E,![])[YL(0x220)](j));case YL(0x167):return yield L(YL(0x167),j[YL(0x207)](E)['bind'](j));case YL(0x173):case YL(0x245):return yield L('domain',j[YL(0x165)][YL(0x220)](j));case YL(0x1c7):return yield L(YL(0x1c7),j['askForCredentials']['bind'](j));case'volumeId':return yield L(YL(0x19d),j[YL(0x199)](E)[YL(0x220)](j));case'subdomain':return yield L(YL(0x224),j[YL(0x23b)](y[YL(0x173)])[YL(0x220)](j));case'subdomainId':return yield L('subdomainId',j['askForSubdomain'](y[YL(0x245)])[YL(0x220)](j));case YL(0x182):return yield L('subdomainPath',j[YL(0x15a)](y[YL(0x173)],(D=y[YL(0x224)])!==null&&D!==void 0x0?D:y[YL(0x1b6)])[YL(0x220)](j));case YL(0x21f):return yield L('backupId',j[YL(0x23a)](E,y[YL(0x231)])['bind'](j));case'buildId':return yield L(YL(0x198),j[YL(0x1a2)](E,y['serviceId'],y[YL(0x1df)])[YL(0x220)](j));case YL(0x1b3):return yield L(YL(0x1b3),j[YL(0x1f7)]()[YL(0x220)](j));case'templateRunId':return yield L('templateRunId',j[YL(0x225)](b)[YL(0x220)](j));case YL(0x1ec):return yield L(YL(0x1ec),j[YL(0x215)]()[YL(0x220)](j));case YL(0x1a1):return yield L(YL(0x1a1),j[YL(0x1cb)](E)[YL(0x220)](j));case'resourceTagId':return yield L(YL(0x154),j[YL(0x161)]()['bind'](j));case'backupDestinationId':return yield L(YL(0x1a0),j[YL(0x14a)]()['bind'](j));case'clusterId':return yield L('clusterId',j[YL(0x1c2)]()['bind'](j));default:return yield L(z,j[YL(0x169)](z,A===null||A===void 0x0?void 0x0:A[YL(0x23e)])[YL(0x220)](j));}})),y;});}function p(w){var h,g,y;return __awaiter(this,void 0x0,void 0x0,function*(){const Yz=a1k,R={},q=((h=x['opt'])===null||h===void 0x0?void 0x0:h[Yz(0x1a6)])?defaults[Yz(0x194)]:{},U=Object[Yz(0x218)](Object[Yz(0x218)]({},(y=(g=x['opt'])===null||g===void 0x0?void 0x0:g[Yz(0x206)])!==null&&y!==void 0x0?y:{}),q),L=Object[Yz(0x16d)](U)[Yz(0x204)](z=>z!==Yz(0x205));return yield(0x0,utils_1[Yz(0x1a4)])(L,z=>__awaiter(this,void 0x0,void 0x0,function*(){const YA=Yz;if(w[z]!==undefined)return _[YA(0x158)](R,z,w[z]);})),R;});}function d(){const YD=Yg;switch(t[0x0]){case YD(0x1b1):return'Get\x20information\x20about\x20Northflank\x20'+(t[0x1]||YD(0x197))+'s';case'update':return YD(0x1cf)+(t[0x1]||'resource')+YD(0x148);default:return _[YD(0x18b)](v)+'\x20Northflank\x20resources';}}function P(w,h){const YE=Yg;var g,y,R,q,U,L,z,A;if(!h){const J=(0x0,utils_1[YE(0x23d)])()['name'](_[YE(0x223)](v))[YE(0x23e)](d());return n(J,v),J;}const D=(w===null||w===void 0x0?void 0x0:w[YE(0x14c)])?chalk_1[YE(0x1f2)]['grey']('\x0a>\x20Token\x20permissions\x20required:\x20'+w[YE(0x14c)]):'',E=Y[YE(0x1dc)][YE(0x18a)](),b=E!==undefined&&((g=x===null||x===void 0x0?void 0x0:x[YE(0x1be)])===null||g===void 0x0?void 0x0:g[YE(0x249)])!==undefined,a=E===null||E===void 0x0?void 0x0:E[YE(0x1e2)]['replace'](YE(0x1f1),''),Z=b?'Documentation:\x20'+a+'/docs/v1/api/'+((y=x===null||x===void 0x0?void 0x0:x[YE(0x1be)])===null||y===void 0x0?void 0x0:y[YE(0x249)]):'',c=(w===null||w===void 0x0?void 0x0:w['description'])||'',V=(0x0,utils_1[YE(0x23d)])(!![])['name'](_[YE(0x223)](v))[YE(0x23e)](c)[YE(0x18e)](YE(0x213),[D,Z][YE(0x1da)]('\x0a'));n(V,v);(((R=x['opt'])===null||R===void 0x0?void 0x0:R['body'])||((q=x[YE(0x1be)])===null||q===void 0x0?void 0x0:q[YE(0x1d2)]))&&(V[YE(0x17e)](YE(0x1aa),'File\x20to\x20load\x20resource\x20json\x20from'),V['option'](YE(0x153),YE(0x20a)));Q((U=x[YE(0x1be)])===null||U===void 0x0?void 0x0:U[YE(0x240)],V),Q((L=x['opt'])===null||L===void 0x0?void 0x0:L['query'],V);const m=(z=x[YE(0x1be)])===null||z===void 0x0?void 0x0:z[YE(0x1a6)];return m&&Q(defaults[YE(0x194)],V),Q((A=x[YE(0x1be)])===null||A===void 0x0?void 0x0:A['base'],V),V[YE(0x181)](()=>__awaiter(this,void 0x0,void 0x0,function*(){const Yb=YE;var H,G,s,I,u,i;(0x0,utils_1[Yb(0x247)])(Y);const W=V[Yb(0x1de)](),Y0=W[Yb(0x1ea)]!==undefined||W[Yb(0x1fb)]!==undefined;if(W[Yb(0x205)]===!![]&&Y0)throw new Error(Yb(0x19a));const Y1=W===null||W===void 0x0?void 0x0:W['output'],Y2=Y1===Yb(0x164),Y3=Y1==='yaml'||Y1===Yb(0x22a),Y4=yield M(W);j[Yb(0x21e)](Y4);const Y5=yield p(W),Y6=Object['keys']((G=(H=x[Yb(0x1be)])===null||H===void 0x0?void 0x0:H[Yb(0x240)])!==null&&G!==void 0x0?G:{})[Yb(0x1e9)](Yk=>Yk+'='+chalk_1[Yb(0x1f2)]['green'](Y4[Yk]))['join'](',\x20');if(Y6[Yb(0x20f)]>0x0&&!Y2&&!Y3){const Yk='=>\x20running\x20command\x20with:\x20'+Y6;console[Yb(0x1bf)](Yk);}const Y7=((s=x['opt'])===null||s===void 0x0?void 0x0:s[Yb(0x234)])||((I=x[Yb(0x1be)])===null||I===void 0x0?void 0x0:I[Yb(0x1d2)])?yield T(W,x,t):undefined;if(!W[Yb(0x24a)]&&t[Yb(0x20b)](Yb(0x1c4))&&!(yield j['deleteWarningPrompt']())){(0x0,utils_1[Yb(0x185)])('Resource\x20was\x20not\x20deleted.');return;}const Y8=m&&(W[Yb(0x205)]||(W[Yb(0x1cc)]===Yb(0x164)||W['output']===Yb(0x160))&&!Y0);let Y9=Y8&&F instanceof js_client_1['GetApiEndpointPaginated']?yield F[Yb(0x1d4)]({'parameters':Y4,'options':Y5,'data':Y7}):yield F[Yb(0x19b)]({'parameters':Y4,'options':Object[Yb(0x218)]({},Y5),'data':Y7});if(W===null||W===void 0x0?void 0x0:W[Yb(0x196)]){const YX=Y9[Yb(0x1bc)];console[Yb(0x1bf)](Yb(0x172)+YX[Yb(0x18c)][Yb(0x162)]()+':'+YX[Yb(0x186)]);if(Y7!==undefined)console['log'](Yb(0x203)+Y7);}if(Y9[Yb(0x1c6)]){const {details:YB,id:Yl,message:YS,status:YC}=Y9[Yb(0x1c6)],Yj=YB?Yb(0x228)+JSON[Yb(0x188)](YB):'',Yo=Yl?Yb(0x1ac)+Yl:'',Ye=Yb(0x1bb)+YC+Yo+')';throw new Error(Yb(0x1f0)+YS+'\x20'+Ye+Yj);}let YY=0x0;printCallResult(W,Y2,Y9[Yb(0x1e4)],Y3,t,Y1,![],YY,Y9['rawResponse'][Yb(0x1e6)]);if(!W[Yb(0x1bd)]&&!Y8&&!Y0&&((u=Y9[Yb(0x1c8)])===null||u===void 0x0?void 0x0:u[Yb(0x238)]))while((i=Y9[Yb(0x1c8)])===null||i===void 0x0?void 0x0:i[Yb(0x238)]){const YO=yield j[Yb(0x21a)](Yb(0x1d3));if(YO)process[Yb(0x16f)]['moveCursor'](0x0,-0x1),process[Yb(0x16f)][Yb(0x22d)](0x1),YY+=Y9[Yb(0x1c8)][Yb(0x21b)],Y9=yield Y9[Yb(0x1c8)]['getNextPage'](),printCallResult(W,Y2,Y9[Yb(0x1e4)],Y3,t,Y1,!![],YY,Y9[Yb(0x1fa)][Yb(0x1e6)]);else return;}})),V;}const f=_[Yg(0x237)](x,'opt'),N=F,K=P(N,f);O(t,K),X[Yg(0x212)](K);const r=_[Yg(0x15c)](x,Yg(0x1be));Object[Yg(0x16d)](r)[Yg(0x20f)]>0x0&&generateCommands(Y,F,K,B,l,r,t);});function T(v,F,x){var t;return __awaiter(this,void 0x0,void 0x0,function*(){const Ya=a1k,{input:Q,file:n}=v;if(Q!==undefined)try{return JSON[Ya(0x175)](Q);}catch(M){try{return yaml['safeLoad'](Q);}catch(p){throw new Error(Ya(0x1ca));}}if(n!==undefined){if(!fs_1[Ya(0x1f2)]['existsSync'](n))throw new Error(Ya(0x201)+n);const P=fs_1['default'][Ya(0x1d0)](n)[Ya(0x190)]();let f;try{if(_[Ya(0x1ba)](P)){if(v[Ya(0x221)][Ya(0x230)](Ya(0x19e)))f=JSON[Ya(0x175)](P);else{if(v['file'][Ya(0x230)](Ya(0x214))||v[Ya(0x221)][Ya(0x230)](Ya(0x22a)))f=yaml['safeLoad'](P);else throw new Error('Unknown\x20input\x20file\x20type:\x20'+v['file'][Ya(0x15e)]('.')[Ya(0x14e)]());}}else f=P;return f;}catch(N){throw new Error(Ya(0x241)+N['message']);}}if((t=F===null||F===void 0x0?void 0x0:F['opt'])===null||t===void 0x0?void 0x0:t[Ya(0x1d2)])throw new Error(Ya(0x1e5));return yield j['retrievePayloadViaInteractiveCli'](F,{'cmdPath':x,'skipValidation':v['skipValidation']});});}}const printCallResult=(Y,k,X,B,l,S,C,j,o)=>{const YZ=a1Yv;if(!(Y===null||Y===void 0x0?void 0x0:Y['quiet'])){if(k)(0x0,console_format_helpers_1[YZ(0x1db)])(Y===null||Y===void 0x0?void 0x0:Y['output'],X);else{if(B)(0x0,console_format_helpers_1['handleYamlOutput'])(Y===null||Y===void 0x0?void 0x0:Y[YZ(0x1cc)],X);else{if(isListCommand(l)){const e=(S===null||S===void 0x0?void 0x0:S['startsWith'](YZ(0x17c)))?S[YZ(0x219)](YZ(0x17c),'')[YZ(0x15e)](',')[YZ(0x1e9)](x=>x[YZ(0x1e0)]()):undefined,O=l[l['length']-0x1],T=''+O+(O[YZ(0x230)]('s')?'':'s'),v=_[YZ(0x18b)](T),F=_[YZ(0x237)](X,T)?X[T]:X;(0x0,console_format_helpers_1[YZ(0x1fc)])(F,v,e,C,j);}else console[YZ(0x1bf)]((0x0,console_format_helpers_1[YZ(0x216)])(X,o));}}}};
1
+ #!/usr/bin/env node --no-deprecation
2
+ 'use strict';const a1UO=a1K;(function(U,K){const Up=a1K,q=U();while(!![]){try{const X=-parseInt(Up(0x1e4))/0x1+-parseInt(Up(0x179))/0x2*(parseInt(Up(0x1c8))/0x3)+-parseInt(Up(0x190))/0x4+-parseInt(Up(0x1ba))/0x5*(parseInt(Up(0x220))/0x6)+parseInt(Up(0x1e0))/0x7+parseInt(Up(0x1c5))/0x8*(parseInt(Up(0x1eb))/0x9)+parseInt(Up(0x12c))/0xa*(parseInt(Up(0x1e6))/0xb);if(X===K)break;else q['push'](q['shift']());}catch(J){q['push'](q['shift']());}}}(a1U,0xa4cfa));var __createBinding=this&&this[a1UO(0x1cd)]||(Object['create']?function(U,K,q,X){const UF=a1UO;if(X===undefined)X=q;var J=Object[UF(0x182)](K,q);(!J||(UF(0x1d0)in J?!K[UF(0x119)]:J[UF(0x152)]||J[UF(0x20c)]))&&(J={'enumerable':!![],'get':function(){return K[q];}}),Object['defineProperty'](U,X,J);}:function(U,K,q,X){if(X===undefined)X=q;U[X]=K[q];}),__setModuleDefault=this&&this[a1UO(0x18d)]||(Object['create']?function(U,K){const Uo=a1UO;Object[Uo(0x183)](U,'default',{'enumerable':!![],'value':K});}:function(U,K){const UQ=a1UO;U[UQ(0x1b1)]=K;}),__importStar=this&&this[a1UO(0x1d5)]||function(U){const Uw=a1UO;if(U&&U['__esModule'])return U;var K={};if(U!=null){for(var q in U)if(q!==Uw(0x1b1)&&Object['prototype']['hasOwnProperty'][Uw(0x130)](U,q))__createBinding(K,U,q);}return __setModuleDefault(K,U),K;},__awaiter=this&&this[a1UO(0x204)]||function(U,K,q,X){function J(v){return v instanceof q?v:new q(function(f){f(v);});}return new(q||(q=Promise))(function(v,f){const UW=a1K;function L(z){try{E(X['next'](z));}catch(p){f(p);}}function M(z){try{E(X['throw'](z));}catch(p){f(p);}}function E(z){const UR=a1K;z['done']?v(z[UR(0x196)]):J(z[UR(0x196)])[UR(0x224)](L,M);}E((X=X['apply'](U,K||[]))[UW(0x213)]());});},__importDefault=this&&this[a1UO(0x176)]||function(U){return U&&U['__esModule']?U:{'default':U};};Object[a1UO(0x183)](exports,a1UO(0x119),{'value':!![]}),exports['getProgram']=void 0x0;function a1K(U,K){const q=a1U();return a1K=function(X,J){X=X-0x111;let v=q[X];return v;},a1K(U,K);}function a1U(){const Un=['assertContextExisting','./metrics','value','askForAddon','hasNextPage','=>\x20running\x20command\x20with:\x20','portFwdCmd','assign','addonId','./defaults','docsTagsPath','--verbose','resourceTagId','./copy','invoice','CliContext','.yaml','addon','handleYamlOutput','statusText','backupDestinationId','askForAddonBackup','job','branch','./utils','templateId','bind','opts','clearLine','default','service','downloadCmd','Display\x20help\x20for\x20command','skipValidation','vol','askForBuild','printAsTable','Get\x20information\x20about\x20Northflank\x20','60iLPJEL','scrt','length','askForJobRun','query','output','svc','runs','entries','grey','getCommandOverview','1214936CaZRcq','error','rawResponse','3273QiyWBv','kebabCase','OPTIONAL:\x20','resource','required','__createBinding','cursor','isArray','get','delete','consoleFormat','./port-forward','templates','__importStar','VERBOSE:\x20Using\x20endpoint\x20->\x20','InquirerHelper','stringify','clusterId','CliLogs','brn','template','set','toLowerCase','repository','6727483dYIkxm','askForSecret','-v,\x20--version','askForJob','1003857oDtweL','\x0a>\x20Token\x20permissions\x20required:\x20','26622926IEVGyI','askForVolume','Expecting\x20resource\x20input\x20with\x20\x27--input\x27\x20or\x20\x27--file\x27\x20argument','path','getCurrentJobName','18XNiQGC','isString','subdomainId','addHelpText','body','agent','./formatting/command-overview','askForProject','enablePositionalOptions','execCmd','askForService','askForTemplateRun','plan','domains','rgn','credentialId','getLogsCommand','retrievePayloadViaInteractiveCli','adn','./logs','omit','pipelineId','askForLogSink','verbose','commander','__awaiter','customUserAgent','has','parseAsync','asyncSequential','askForSubdomain','cred','replace','configurable','dmn','existsSync','map','branches','login','page','next','secret','stdout','File\x20does\x20not\x20exist:\x20','/docs/v1/api/','domainId','aliases','after','pop','safeLoad','subdomain','opt','tag','658248vrgOwk','getOwnPropertyNames','js-yaml','project','then','join','url','some','type','templateRunId','backup-destination','VERBOSE:\x20Request\x20body\x20->\x20','checkUpdate','repositories','Resource\x20was\x20not\x20deleted.','green','jobId','./formatting/console-format-helpers','__esModule','volumes','toUpperCase','secretId',',\x20NF\x20error\x20id:\x20','credential','getProgram','there\x20are\x20more\x20rows,\x20load?','commands','all','restores','backupId','projects','description','pagination','underline','secrets','keys','Print\x20the\x20current\x20version\x20of\x20the\x20Northflank\x20cli','10GtqDIv','action','split','subdomainPath','call','startsWith','update','buildId','Northflank\x20cli\x20version:\x20','askForSubdomainPath','askForPipeline','requiredPermissions','api.','getMetricsCommand','\x20--','filter','paginationArgs','uploadCmd','repos','addHelpCommand','Update\x20Northflank\x20','inv','json','setPathVars','moveCursor','regions','list','toString','yml','force','helpOption','JSON-formatted\x20resource\x20definition,\x20takes\x20precedence\x20over\x20\x22--file\x22','addCommand','Unknown\x20input\x20file\x20type:\x20','loadAll','yaml','Failed\x20to\x20validate\x20input\x20(incorrect\x20format):\x20','./exec','writable','askForBackupDestination','./context/contextCommands','quiet','base','./inquirer-helper','volumeId','.json','count','defaults','file','find','getCurrentProjectName','plans','backup','region','credentials','domain','logs','includes','endpoints','askForCredentials','chalk','upperFirst','concat','option','host','Error\x20occured\x20while\x20trying\x20to\x20run\x20command,\x20error:\x20','isPaginatedEndpoint','lodash','pln','ApiClient','Documentation:\x20','parse','-f,\x20--file\x20<file-path>','isEqual','__importDefault','argv','version','110dsTtcq','CliExec','../package.json','contexts','repo','log','exitCode','projectId','serviceId','getOwnPropertyDescriptor','defineProperty','data','endsWith','-i,\x20--input\x20<resource-def>','custom-columns=','jobs','boolean','backups','CliFileCopy','tpl','__setModuleDefault','invoices','message','2518580xRMIal','askForClusterId','nonInteractiveEndpoint','forEach'];a1U=function(){return Un;};return a1U();}const js_client_1=require('@northflank/js-client'),commander_1=__importDefault(require(a1UO(0x203))),fs_1=__importDefault(require('fs')),chalk_1=__importDefault(require(a1UO(0x168))),_=__importStar(require(a1UO(0x16f))),contextCommands_1=require(a1UO(0x154)),utils_1=require(a1UO(0x1ac)),defaults=__importStar(require(a1UO(0x19d))),inquirer_helper_1=require(a1UO(0x157)),console_format_helpers_1=require(a1UO(0x118)),command_overview_1=require(a1UO(0x1f1)),port_forward_1=require(a1UO(0x1d3)),exec_1=require(a1UO(0x151)),logs_1=require(a1UO(0x1fe)),metrics_1=require(a1UO(0x195)),copy_1=require(a1UO(0x1a1)),yaml=require(a1UO(0x222)),pgk=require(a1UO(0x17b)),getProgram=U=>{const UV=a1UO,K=new commander_1[(UV(0x1b1))]['Command']('northflank');K['description']('Manage\x20your\x20Northflank\x20resources\x20from\x20the\x20command\x20line'),K[UV(0x1f3)](!![]),K[UV(0x178)](UV(0x134)+chalk_1['default'][UV(0x128)](pgk[UV(0x178)]),UV(0x1e2),UV(0x12b));const q=new js_client_1[(UV(0x171))](U,{'throwErrorOnHttpErrorCode':![],'customUserAgent':utils_1[UV(0x205)],'agent':utils_1[UV(0x1f0)]}),X=new contextCommands_1[(UV(0x1a3))](q,utils_1[UV(0x1f0)]),J=new port_forward_1['CliPortForward'](U,utils_1[UV(0x1f0)]),v=new exec_1[(UV(0x17a))](U,utils_1['agent']),f=new copy_1[(UV(0x18b))](U,utils_1[UV(0x1f0)]),L=new logs_1[(UV(0x1da))](U,utils_1[UV(0x1f0)]),M=new metrics_1['CliMetrics'](U,utils_1[UV(0x1f0)]);return K['addCommand'](J[UV(0x19a)]),K[UV(0x14c)](v[UV(0x1f4)]),K[UV(0x14c)](f[UV(0x1b3)]),K[UV(0x14c)](f[UV(0x13d)]),K[UV(0x14c)](X[UV(0x211)]),K[UV(0x14c)](X[UV(0x17c)]),generateCommands(q,q[UV(0x166)],K,L,M),K[UV(0x14c)]((0x0,command_overview_1[UV(0x1c4)])(K)),K[UV(0x13f)](!![],'Display\x20help\x20for\x20command'),K[UV(0x14a)](undefined,UV(0x1b4)),K;};exports[a1UO(0x11f)]=getProgram,((()=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const Ub=a1UO;try{const U=new js_client_1['ApiClientFileContextProvider']();yield(0x0,utils_1[Ub(0x113)])(U);const K=(0x0,exports[Ub(0x11f)])(U);yield K[Ub(0x207)](process[Ub(0x177)]);}catch(q){(0x0,utils_1[Ub(0x1c6)])(Ub(0x16d)+q[Ub(0x18f)]),process[Ub(0x177)][Ub(0x15d)](X=>X===Ub(0x19f))&&console[Ub(0x17e)](q),process[Ub(0x17f)]=0x1;}}))());function isListCommand(U){const UB=a1UO,K=[[UB(0x1d0),'addon',UB(0x18a)],[UB(0x1d0),UB(0x1aa),UB(0x1c1)]];return U[UB(0x15d)](q=>q===UB(0x146))||K[UB(0x227)](q=>_[UB(0x175)](U,q));}function generateCommands(U,K,q,X,J,v=defaults[a1UO(0x15b)],f=[]){const Uy=a1UO,L=new inquirer_helper_1[(Uy(0x1d7))](new js_client_1[(Uy(0x171))](U['contextProvider'],{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1['customUserAgent'],'agent':utils_1[Uy(0x1f0)]}));function M(O,F){const Ux=Uy;return O[Ux(0x1cc)]!==![]&&F===undefined;}function E(O,F){const Ua=Uy,{opt:o,name:Q}=O,w=o['default'],R=M(o,w),W=a=>a[Ua(0x1bc)]>0x1?'--'+a:'-'+a,V=o===null||o===void 0x0?void 0x0:o['alias'],b=V?_[Ua(0x1cf)](V)?'-'+(V===null||V===void 0x0?void 0x0:V['map'](m=>W(m))[Ua(0x225)](',\x20-'))+',':''+W(V):'',B=R?'':Ua(0x1ca),y=typeof o[Ua(0x228)]===Ua(0x189)||o[Ua(0x228)]===Ua(0x189)?b+Ua(0x13a)+Q:b+Ua(0x13a)+Q+'\x20<'+Q[Ua(0x11b)]()+'>',x=B+o['description'];F[Ua(0x16b)](y,x,w);}function z(O,F){const Um=Uy;if(F[Um(0x121)][Um(0x227)](o=>o['name']()===Um(0x164)))return;_[Um(0x175)](O,[Um(0x1d0),'service'])&&(F['addCommand'](X['getLogsCommand']('service')),F[Um(0x14c)](J['getMetricsCommand'](Um(0x1b2))),F[Um(0x14c)](X[Um(0x1fb)]('service',!![])),F[Um(0x14c)](J[Um(0x139)](Um(0x1b2),!![]))),_[Um(0x175)](O,[Um(0x1d0),'job'])&&(F['addCommand'](X[Um(0x1fb)](Um(0x1aa))),F[Um(0x14c)](J[Um(0x139)]('job')),F['addCommand'](X['getLogsCommand'](Um(0x1aa),!![])),F['addCommand'](J[Um(0x139)](Um(0x1aa),!![]))),_[Um(0x175)](O,[Um(0x1d0),Um(0x1a5)])&&(F[Um(0x14c)](X['getLogsCommand'](Um(0x1a5))),F[Um(0x14c)](J['getMetricsCommand'](Um(0x1a5)))),_['isEqual'](O,[Um(0x1d0),Um(0x1a5),Um(0x160)])&&F[Um(0x14c)](X[Um(0x1fb)]('addon',![],!![])),_['isEqual'](O,[Um(0x1d0),'addon',Um(0x123)])&&F[Um(0x14c)](X[Um(0x1fb)](Um(0x1a5),![],!![],!![]));}return Object['getOwnPropertyNames'](v)[Uy(0x193)](O=>{const Ui=Uy,F=K[O],o=v[O],Q=f[Ui(0x16a)]([O]);function w(i,G){const UG=Ui,A=Object[UG(0x221)](i||{});A[UG(0x20f)](s=>{return{'name':s,'opt':i[s]};})['sort']((s,D)=>!M(s[UG(0x21e)])?!M(D[UG(0x21e)])?0x0:0x1:-0x1)[UG(0x193)](s=>{E(s,G);});}function R(i,G){const UA=Ui,A=[[UA(0x223),UA(0x125),'prj'],[UA(0x1b2),'services',UA(0x1c0)],[UA(0x162),UA(0x11e),UA(0x20a)],[UA(0x1a5),'addons',UA(0x1fd)],[UA(0x1aa),UA(0x188)],[UA(0x1f7),UA(0x15f),UA(0x170)],[UA(0x161),UA(0x145),UA(0x1f9)],['domain',UA(0x1f8),UA(0x20d)],[UA(0x214),UA(0x129),UA(0x1bb)],[UA(0x11a),'volume',UA(0x1b6)],[UA(0x210),UA(0x1ab),UA(0x1db)],[UA(0x1a2),UA(0x18e),UA(0x141)],[UA(0x1dc),UA(0x1d4),UA(0x18c)],[UA(0x13e),UA(0x1df),UA(0x114),UA(0x17d)],[UA(0x111),'backup-destinations'],[UA(0x21f),'tags']],s=A[UA(0x15d)](D=>D[UA(0x165)](G));if(s!==undefined)i[UA(0x219)](s[UA(0x13b)](D=>D!==G));}function W(i){var G,A;return __awaiter(this,void 0x0,void 0x0,function*(){const Us=a1K,s={},{contextProvider:D}=U,H=Q[Us(0x165)](Us(0x1d1)),g=i['noDefaults']===!![];function S(C,N,Z){var e,n;return __awaiter(this,void 0x0,void 0x0,function*(){const UD=a1K;if(_['has']((n=(e=o['opt'])===null||e===void 0x0?void 0x0:e[UD(0x1e9)])!==null&&n!==void 0x0?n:{},C)){const t=!g&&!H&&Z?Z():undefined,Y=i[C]||t||(yield N());_[UD(0x1dd)](s,C,Y);}});}return yield(0x0,utils_1['asyncSequential'])(Object[Us(0x1c2)]((A=(G=o[Us(0x21e)])===null||G===void 0x0?void 0x0:G['path'])!==null&&A!==void 0x0?A:{}),([C,N])=>__awaiter(this,void 0x0,void 0x0,function*(){const UH=Us;var Z;const e=s===null||s===void 0x0?void 0x0:s[UH(0x180)],n=s===null||s===void 0x0?void 0x0:s[UH(0x1ad)];switch(C){case UH(0x180):return yield S(UH(0x180),L[UH(0x1f2)]['bind'](L),D[UH(0x15e)][UH(0x1ae)](D));case UH(0x181):return yield S(UH(0x181),L[UH(0x1f5)](e)[UH(0x1ae)](L),D['getCurrentServiceName'][UH(0x1ae)](D));case UH(0x19c):return yield S(UH(0x19c),L[UH(0x197)](e)[UH(0x1ae)](L));case UH(0x117):return yield S(UH(0x117),L[UH(0x1e3)](e)[UH(0x1ae)](L),D[UH(0x1ea)]['bind'](D));case'runId':return yield S('runId',L[UH(0x1bd)](s[UH(0x117)],e,![])[UH(0x1ae)](L));case UH(0x11c):return yield S('secretId',L[UH(0x1e1)](e)[UH(0x1ae)](L));case UH(0x163):case UH(0x218):return yield S(UH(0x163),L['askForDomain'][UH(0x1ae)](L));case UH(0x1fa):return yield S('credentialId',L[UH(0x167)]['bind'](L));case UH(0x158):return yield S(UH(0x158),L[UH(0x1e7)](e)[UH(0x1ae)](L));case UH(0x21d):return yield S('subdomain',L[UH(0x209)](s[UH(0x163)])[UH(0x1ae)](L));case'subdomainId':return yield S(UH(0x1ed),L[UH(0x209)](s['domainId'])[UH(0x1ae)](L));case'subdomainPath':return yield S(UH(0x12f),L[UH(0x135)](s[UH(0x163)],(Z=s['subdomain'])!==null&&Z!==void 0x0?Z:s[UH(0x1ed)])['bind'](L));case'backupId':return yield S(UH(0x124),L[UH(0x1a9)](e,s[UH(0x19c)])[UH(0x1ae)](L));case UH(0x133):return yield S('buildId',L[UH(0x1b7)](e,s[UH(0x181)],s[UH(0x117)])[UH(0x1ae)](L));case UH(0x1ad):return yield S(UH(0x1ad),L['askForTemplate']()[UH(0x1ae)](L));case UH(0x229):return yield S('templateRunId',L[UH(0x1f6)](n)[UH(0x1ae)](L));case'logSinkId':return yield S('logSinkId',L[UH(0x201)]()[UH(0x1ae)](L));case UH(0x200):return yield S(UH(0x200),L[UH(0x136)](e)[UH(0x1ae)](L));case UH(0x1a0):return yield S(UH(0x1a0),L['askForTag']()[UH(0x1ae)](L));case UH(0x1a8):return yield S(UH(0x1a8),L[UH(0x153)]()['bind'](L));case UH(0x1d9):return yield S(UH(0x1d9),L[UH(0x191)]()[UH(0x1ae)](L));default:return yield S(C,L['askGeneric'](C,N===null||N===void 0x0?void 0x0:N['description'])[UH(0x1ae)](L));}})),s;});}function V(i){var G,A,s;return __awaiter(this,void 0x0,void 0x0,function*(){const Ug=a1K,D={},H=((G=o[Ug(0x21e)])===null||G===void 0x0?void 0x0:G[Ug(0x16e)])?defaults[Ug(0x13c)]:{},g=Object[Ug(0x19b)](Object[Ug(0x19b)]({},(s=(A=o['opt'])===null||A===void 0x0?void 0x0:A[Ug(0x1be)])!==null&&s!==void 0x0?s:{}),H),S=Object['keys'](g)[Ug(0x13b)](C=>C!=='loadAll');return yield(0x0,utils_1[Ug(0x208)])(S,C=>__awaiter(this,void 0x0,void 0x0,function*(){if(i[C]!==undefined)return _['set'](D,C,i[C]);})),D;});}function b(){const US=Ui;switch(Q[0x0]){case'get':return US(0x1b9)+(Q[0x1]||US(0x1cb))+'s';case US(0x132):return US(0x140)+(Q[0x1]||US(0x1cb))+'\x20properties';default:return _[US(0x169)](O)+'\x20Northflank\x20resources';}}function B(i,G){const UC=Ui;var A,s,D,H,g,S,C,N;if(!G){const c=(0x0,utils_1['getCommand'])()['name'](_[UC(0x1c9)](O))[UC(0x126)](b());return R(c,O),c;}const Z=(i===null||i===void 0x0?void 0x0:i[UC(0x137)])?chalk_1[UC(0x1b1)][UC(0x1c3)](UC(0x1e5)+i[UC(0x137)]):'',e=U['contextProvider']['getCurrentContext'](),n=e!==undefined&&((A=o===null||o===void 0x0?void 0x0:o[UC(0x21e)])===null||A===void 0x0?void 0x0:A['docsTagsPath'])!==undefined,t=e===null||e===void 0x0?void 0x0:e[UC(0x16c)]['replace'](UC(0x138),''),Y=n?UC(0x172)+t+UC(0x217)+((s=o===null||o===void 0x0?void 0x0:o[UC(0x21e)])===null||s===void 0x0?void 0x0:s[UC(0x19e)]):'',l=(i===null||i===void 0x0?void 0x0:i[UC(0x126)])||'',T=(0x0,utils_1['getCommand'])(!![])['name'](_[UC(0x1c9)](O))[UC(0x126)](l)[UC(0x1ee)](UC(0x21a),[Z,Y]['join']('\x0a'));R(T,O);(((D=o['opt'])===null||D===void 0x0?void 0x0:D[UC(0x1ef)])||((H=o[UC(0x21e)])===null||H===void 0x0?void 0x0:H[UC(0x192)]))&&(T[UC(0x16b)](UC(0x174),'File\x20to\x20load\x20resource\x20json\x20from'),T[UC(0x16b)](UC(0x186),UC(0x14b)));w((g=o[UC(0x21e)])===null||g===void 0x0?void 0x0:g[UC(0x1e9)],T),w((S=o['opt'])===null||S===void 0x0?void 0x0:S['query'],T);const I=(C=o['opt'])===null||C===void 0x0?void 0x0:C['isPaginatedEndpoint'];return I&&w(defaults[UC(0x13c)],T),w((N=o[UC(0x21e)])===null||N===void 0x0?void 0x0:N[UC(0x156)],T),T[UC(0x12d)](()=>__awaiter(this,void 0x0,void 0x0,function*(){const UN=UC;var h,P,k,u,d,r;(0x0,utils_1[UN(0x194)])(U);const j=T[UN(0x1af)]();(j===null||j===void 0x0?void 0x0:j[UN(0x202)])&&utils_1['proxyEnvsSet']&&(0x0,utils_1['warning'])('VERBOSE:\x20HTTP_PROXY\x20or\x20HTTPS_PROXY\x20environment\x20variable\x20set:\x20tunnelling\x20traffic\x20through\x20HTTP\x20proxy.');const U0=j[UN(0x212)]!==undefined||j[UN(0x1ce)]!==undefined;if(j[UN(0x14e)]===!![]&&U0)throw new Error('Options\x20\x27loadAll\x27\x20can\x20not\x20be\x20combined\x20with\x20\x27page\x27\x20or\x20\x27cursor\x27');const U1=j===null||j===void 0x0?void 0x0:j[UN(0x1bf)],U2=U1===UN(0x142),U3=U1===UN(0x14f)||U1===UN(0x148),U4=yield W(j);L[UN(0x143)](U4);const U5=yield V(j),U6=Object[UN(0x12a)]((P=(h=o[UN(0x21e)])===null||h===void 0x0?void 0x0:h['path'])!==null&&P!==void 0x0?P:{})[UN(0x20f)](UK=>UK+'='+chalk_1[UN(0x1b1)][UN(0x116)](U4[UK]))[UN(0x225)](',\x20');if(U6['length']>0x0&&!U2&&!U3){const UK=UN(0x199)+U6;console[UN(0x17e)](UK);}const U7=((k=o['opt'])===null||k===void 0x0?void 0x0:k[UN(0x1ef)])||((u=o[UN(0x21e)])===null||u===void 0x0?void 0x0:u[UN(0x192)])?yield p(j,o,Q):undefined;if(!j[UN(0x149)]&&Q['includes'](UN(0x1d1))&&!(yield L['deleteWarningPrompt']())){(0x0,utils_1['warning'])(UN(0x115));return;}const U8=I&&(j['loadAll']||(j[UN(0x1bf)]===UN(0x142)||j[UN(0x1bf)]===UN(0x14f))&&!U0);let U9=U8&&F instanceof js_client_1['GetApiEndpointPaginated']?yield F[UN(0x122)]({'parameters':U4,'options':U5,'data':U7}):yield F[UN(0x130)]({'parameters':U4,'options':Object[UN(0x19b)]({},U5),'data':U7});if(j===null||j===void 0x0?void 0x0:j[UN(0x202)]){const Uq=U9['request'];console[UN(0x17e)](UN(0x1d6)+Uq['method'][UN(0x11b)]()+':'+Uq[UN(0x226)]);if(U7!==undefined)console[UN(0x17e)](UN(0x112)+U7);}if(U9[UN(0x1c6)]){const {details:UX,id:UJ,message:Uv,status:Uf}=U9[UN(0x1c6)],UL=UX?'\x0a\x09details\x20:'+JSON[UN(0x1d8)](UX):'',UM=UJ?UN(0x11d)+UJ:'',UE='(HTTP\x20status\x20code:\x20'+Uf+UM+')';throw new Error('API\x20request\x20failed\x0a\x09Message:\x20'+Uv+'\x20'+UE+UL);}let UU=0x0;printCallResult(j,U2,U9[UN(0x184)],U3,Q,U1,![],UU,U9[UN(0x1c7)][UN(0x1a7)]);if(!j[UN(0x155)]&&!U8&&!U0&&((d=U9['pagination'])===null||d===void 0x0?void 0x0:d[UN(0x198)]))while((r=U9[UN(0x127)])===null||r===void 0x0?void 0x0:r[UN(0x198)]){const Uz=yield L['askConfirm'](UN(0x120));if(Uz)process[UN(0x215)][UN(0x144)](0x0,-0x1),process[UN(0x215)][UN(0x1b0)](0x1),UU+=U9['pagination'][UN(0x15a)],U9=yield U9[UN(0x127)]['getNextPage'](),printCallResult(j,U2,U9['data'],U3,Q,U1,!![],UU,U9['rawResponse'][UN(0x1a7)]);else return;}})),T;}const y=_[Ui(0x206)](o,Ui(0x21e)),x=F,a=B(x,y);z(Q,a),q[Ui(0x14c)](a);const m=_[Ui(0x1ff)](o,Ui(0x21e));Object[Ui(0x12a)](m)[Ui(0x1bc)]>0x0&&generateCommands(U,F,a,X,J,m,Q);});function p(O,F,o){var Q;return __awaiter(this,void 0x0,void 0x0,function*(){const UZ=a1K,{input:w,file:R}=O;if(w!==undefined)try{return JSON[UZ(0x173)](w);}catch(W){try{return yaml[UZ(0x21c)](w);}catch(V){throw new Error('Unknown\x20input\x20format.\x20Not\x20valid\x20json\x20and\x20not\x20valid\x20yaml.');}}if(R!==undefined){if(!fs_1['default'][UZ(0x20e)](R))throw new Error(UZ(0x216)+R);const b=fs_1[UZ(0x1b1)]['readFileSync'](R)[UZ(0x147)]();let B;try{if(_[UZ(0x1ec)](b)){if(O[UZ(0x15c)]['endsWith'](UZ(0x159)))B=JSON[UZ(0x173)](b);else{if(O['file'][UZ(0x185)](UZ(0x1a4))||O[UZ(0x15c)]['endsWith'](UZ(0x148)))B=yaml[UZ(0x21c)](b);else throw new Error(UZ(0x14d)+O[UZ(0x15c)]['split']('.')[UZ(0x21b)]());}}else B=b;return B;}catch(y){throw new Error(UZ(0x150)+y[UZ(0x18f)]);}}if((Q=F===null||F===void 0x0?void 0x0:F['opt'])===null||Q===void 0x0?void 0x0:Q[UZ(0x192)])throw new Error(UZ(0x1e8));return yield L[UZ(0x1fc)](F,{'cmdPath':o,'skipValidation':O[UZ(0x1b5)]});});}}const printCallResult=(U,K,q,X,J,v,f,L,M)=>{const Ue=a1UO;if(!(U===null||U===void 0x0?void 0x0:U[Ue(0x155)])){if(K)(0x0,console_format_helpers_1['handleJsonOutput'])(U===null||U===void 0x0?void 0x0:U[Ue(0x1bf)],q);else{if(X)(0x0,console_format_helpers_1[Ue(0x1a6)])(U===null||U===void 0x0?void 0x0:U[Ue(0x1bf)],q);else{if(isListCommand(J)){const E=(v===null||v===void 0x0?void 0x0:v[Ue(0x131)](Ue(0x187)))?v[Ue(0x20b)]('custom-columns=','')[Ue(0x12e)](',')[Ue(0x20f)](o=>o[Ue(0x1de)]()):undefined,z=J[J[Ue(0x1bc)]-0x1],p=''+z+(z['endsWith']('s')?'':'s'),O=_['upperFirst'](p),F=_[Ue(0x206)](q,p)?q[p]:q;(0x0,console_format_helpers_1[Ue(0x1b8)])(F,O,E,f,L);}else console[Ue(0x17e)]((0x0,console_format_helpers_1[Ue(0x1d2)])(q,M));}}}};
@@ -1 +1 @@
1
- 'use strict';const a2f=a2k;(function(Y,k){const P=a2k,X=Y();while(!![]){try{const B=parseInt(P(0x15f))/0x1+parseInt(P(0xfb))/0x2*(-parseInt(P(0x13c))/0x3)+-parseInt(P(0x119))/0x4*(parseInt(P(0x142))/0x5)+-parseInt(P(0x134))/0x6+-parseInt(P(0x17b))/0x7+-parseInt(P(0x17f))/0x8*(-parseInt(P(0x10f))/0x9)+-parseInt(P(0x180))/0xa*(-parseInt(P(0x109))/0xb);if(B===k)break;else X['push'](X['shift']());}catch(l){X['push'](X['shift']());}}}(a2Y,0x6a42e));function a2Y(){const Y2=['__setModuleDefault','\x27\x20successfully\x20updated.','-n,\x20--name\x20[NAME]','Token\x20for\x20this\x20context.\x20When\x20set,\x20browser\x20login\x20is\x20not\x20used','3iJuAnk','agent','defaultBaseUrl','../utils','CliContext','retry','1560exhTdH','tokenPrompt','use\x20from\x20now\x20on','--do-not-open-browser','--override','--all','Contexts','message','ProxyAgent','Follow\x20the\x20steps\x20displayed\x20on\x20the\x20page\x20opened\x20in\x20the\x20browser\x20(URL\x20opened:\x20','askForService','Display\x20full\x20URL\x20to\x20allow\x20opening\x20the\x20link\x20manually','context','defineProperty','finally','removeContext','delete','apiTokenLogin','browserLogin','Failed\x20to\x20login\x20with\x20the\x20provided\x20token.\x20Token\x20was\x20not\x20changed','host','prompt','--host\x20[HOST]','next','sanitiseHostname','/v1/login','timeout','call','\x20(api\x20host:\x20','380800RgxYvK','\x0aSuccessfully\x20logged\x20in\x20using\x20','Open\x20this\x20URL\x20in\x20your\x20browser\x20and\x20follow\x20the\x20steps:\x0a\x09','Use\x20service\x20with\x20id:','Use\x20browser\x20login\x20but\x20only\x20print\x20URL\x20which\x20can\x20be\x20used\x20to\x20login','useJobId','No\x20context\x20available.\x20Use\x20\x27northflank\x20login\x27\x20to\x20create\x20context.','Remove\x20a\x20context','No\x20context\x20available.\x20Please\x20use\x20\x27northflank\x20login\x27\x20to\x20create\x20context.','__createBinding','set-token','service','stdout','addCommand','value','length','name','Switch\x20between\x20your\x20local\x20contexts','startLogin','NorthflankApiBrowserLogin','override','Change\x20current\x20context\x20to\x20context\x20identified\x20by\x20this\x20name','clearLine','Token\x20for\x20current\x20context\x20\x27','Use\x20job\x20with\x20id:','prototype','updateToken','getCurrentName','934689YoLFHV','useProjectId','fullUrl','addContext','27760lVJxQR','490CQIKrD','List\x20all\x20available\x20contexts','alias','browser\x20login','\x27\x20successfully\x20removed.','close','token','-i,\x20--id\x20[ID]','InquirerHelper','default','hasOwnProperty','done','Name\x20for\x20login\x20context','ctx','verifyToken','search-list','Update\x20token\x20for\x20current\x20context','throw','project','sessionToken=********','host\x20url\x20for\x20this\x20context','Local\x20context\x20\x27','apply','contextProvider','__importStar','get','map','update-token','__awaiter','Job\x20name\x20(internal\x20id)\x20to\x20use\x20as\x20default\x20in\x20context','__importDefault','getCommand','1017064gGvkHK','lodash','error','Change\x20the\x20default\x20job\x20in\x20the\x20current\x20local\x20context','apiClient','Use\x20manual\x20login\x20with\x20API\x20token','Connect\x20the\x20CLI\x20to\x20your\x20Northflank\x20account.','-t,\x20--token\x20[TOKEN]','option','description',',\x20added\x20context\x20with\x20name\x20','tokenLogin','Service\x20name\x20(internal\x20id)\x20to\x20use\x20as\x20default\x20in\x20context','../login/browser-login','183403TyImUG','doNotOpenBrowser','sort','contextAvailable','log','askForJob','333ymoKRn','getCurrentContext','Changed\x20current\x20context\x20to\x20','Error\x20occured\x20during\x20browser\x20login:\x20','writable','replace','action','success','Project\x20name\x20(internal\x20id)\x20to\x20use\x20as\x20default\x20in\x20context','contexts','216iNkYve','Token\x20for\x20this\x20context','--token-login','https://','job','Use\x20project\x20with\x20id:','__esModule','\x20(current)','current','list','Change\x20the\x20default\x20project\x20in\x20the\x20current\x20local\x20context','warning','loadContextWrapper','all','useContext','../inquirer-helper','fetch','Retrieve\x20and\x20update\x20local\x20context\x20settings.','No\x20project\x20in\x20current\x20context.\x20Please\x20set\x20project\x20before\x20setting\x20a\x20project-scoped\x20resource','Local\x20context\x20name\x20to\x20remove.','autologin-','https://api.northflank.com','Bearer\x20','Shows\x20full\x20context\x20information\x20(including\x20tokens)','catch','getCurrentBaseUrl','italic','1392084Evtevu','set','askForProject','askForContext'];a2Y=function(){return Y2;};return a2Y();}function a2k(Y,k){const X=a2Y();return a2k=function(B,l){B=B-0xdd;let S=X[B];return S;},a2k(Y,k);}var __createBinding=this&&this[a2f(0x168)]||(Object['create']?function(Y,X,B,l){const N=a2f;if(l===undefined)l=B;var S=Object['getOwnPropertyDescriptor'](X,B);(!S||(N(0xf4)in S?!X[N(0x11f)]:S[N(0x113)]||S['configurable']))&&(S={'enumerable':!![],'get':function(){return X[B];}}),Object[N(0x14f)](Y,l,S);}:function(Y,X,B,l){if(l===undefined)l=B;Y[l]=X[B];}),__setModuleDefault=this&&this[a2f(0x138)]||(Object['create']?function(Y,k){const K=a2f;Object[K(0x14f)](Y,K(0xe4),{'enumerable':!![],'value':k});}:function(Y,k){const r=a2f;Y[r(0xe4)]=k;}),__importStar=this&&this[a2f(0xf3)]||function(Y){const w=a2f;if(Y&&Y[w(0x11f)])return Y;var X={};if(Y!=null){for(var B in Y)if(B!==w(0xe4)&&Object[w(0x178)][w(0xe5)][w(0x15d)](Y,B))__createBinding(X,Y,B);}return __setModuleDefault(X,Y),X;},__awaiter=this&&this[a2f(0xf7)]||function(Y,k,X,B){function l(S){return S instanceof X?S:new X(function(C){C(S);});}return new(X||(X=Promise))(function(S,C){const R=a2k;function j(O){const h=a2k;try{e(B[h(0x159)](O));}catch(T){C(T);}}function o(O){const g=a2k;try{e(B[g(0xec)](O));}catch(T){C(T);}}function e(O){const y=a2k;O[y(0xe6)]?S(O[y(0x16d)]):l(O[y(0x16d)])['then'](j,o);}e((B=B[R(0xf1)](Y,k||[]))[R(0x159)]());});},__importDefault=this&&this[a2f(0xf9)]||function(Y){const q=a2f;return Y&&Y[q(0x11f)]?Y:{'default':Y};};Object[a2f(0x14f)](exports,'__esModule',{'value':!![]}),exports[a2f(0x140)]=void 0x0;const _=__importStar(require(a2f(0xfc))),proxy_agent_1=require('proxy-agent'),chalk_1=__importDefault(require('chalk')),utils_1=require(a2f(0x13f)),inquirer_helper_1=require(a2f(0x128)),console_format_helpers_1=require('../formatting/console-format-helpers'),browser_login_1=require(a2f(0x108)),inquirer=require('inquirer');class CliContext{constructor(Y,k=undefined,X=a2f(0x12e)){const U=a2f;this['agent']=k,this[U(0x13e)]=X,this['sanitiseHostname']=v=>{const L=U;let F=v;return!/^https?:\/\//i['test'](F)&&(F=L(0x11c)+F),F=F[L(0x114)](/\/+$/,''),F;},this[U(0xff)]=Y;const B=new inquirer_helper_1[(U(0xe3))](Y);this['login']=(0x0,utils_1[U(0xfa)])()[U(0x16f)]('login')[U(0x104)](U(0x101))['option'](U(0x11b),U(0x100),![])['option'](U(0x145),U(0x163),![])[U(0x103)](U(0x13a),U(0xe7))[U(0x103)]('-t,\x20--token\x20[TOKEN]',U(0x13b))[U(0x103)](U(0x158),U(0xef),this['defaultBaseUrl'])[U(0x103)](U(0x146),'Override\x20existing\x20contexts\x20(this\x20will\x20remove\x20project\x20and\x20service\x20context)',![])['action'](v=>__awaiter(this,void 0x0,void 0x0,function*(){const z=U;_[z(0x135)](v,z(0x156),this[z(0x15a)](v['host']));const F=v[z(0x106)]||v['token']!==undefined,{name:x,host:t,token:Q,override:n}=F?yield this[z(0x153)](v,B):yield this[z(0x154)](v,B);try{yield this['apiClient'][z(0xf2)][z(0x17e)]({'name':x,'host':t,'token':Q},n);}catch(M){(0x0,utils_1[z(0xfd)])(M[z(0x149)]);return;}if(!(yield this['verifyToken']()))(0x0,utils_1['error'])('Failed\x20to\x20login\x20with\x20the\x20provided\x20token,\x20make\x20sure\x20to\x20use\x20a\x20valid\x20token\x20and\x20host.'),yield this[z(0xff)][z(0xf2)][z(0x151)](x);else{const p=F?'token\x20login':z(0xde),d=z(0x160)+p+z(0x105)+chalk_1[z(0xe4)][z(0x133)](x)+z(0x15e)+t+')';(0x0,utils_1[z(0x116)])(d);}})),this['contexts']=(0x0,utils_1[U(0xfa)])()[U(0x16f)](U(0x14e))[U(0x104)](U(0x12a))[U(0xdd)](U(0x118))[U(0xdd)](U(0xe8));const l=(0x0,utils_1[U(0xfa)])()['name'](U(0x122))[U(0x16f)]('ls')['description'](U(0x181))[U(0x103)](U(0x147),U(0x130))['action'](v=>__awaiter(this,void 0x0,void 0x0,function*(){const A=U;console[A(0x10d)](Y[A(0xf2)]['getInfo']());const F=Y[A(0xf2)][A(0x125)]();if(v[A(0x126)]===!![]){console['dir'](F);return;}const x=F[A(0x121)],t=F[A(0x118)][A(0x10b)]((Q,n)=>Q[A(0x16f)]===x?-0x1:n[A(0x16f)]===x?0x1:0x0)[A(0xf5)](Q=>{const D=A,n=x===Q[D(0x16f)]?D(0x120):'';return{'Name':''+Q['name']+n,'Host':Q[D(0x156)],'Default\x20Project':Q[D(0xed)]||'-','Default\x20Service':Q[D(0x16a)]||'-'};});(0x0,console_format_helpers_1['printAsTable'])(t,A(0x148));})),S=(0x0,utils_1[U(0xfa)])();S[U(0x16f)]('use')[U(0x104)](U(0x170))[U(0x103)](U(0x13a),U(0x174))['action'](v=>__awaiter(this,void 0x0,void 0x0,function*(){const E=U,F=(v===null||v===void 0x0?void 0x0:v[E(0x16f)])||(yield this['askForContext']('use'));yield this['apiClient'][E(0xf2)][E(0x127)](F),(0x0,utils_1[E(0x116)])(E(0x111)+F);}));const C=U(0xe2),j=(0x0,utils_1['getCommand'])()[U(0x16f)](U(0xed))[U(0x104)](U(0x123))['option'](C,U(0x117))[U(0x115)](v=>__awaiter(this,void 0x0,void 0x0,function*(){const b=U,F=(v===null||v===void 0x0?void 0x0:v['id'])||(yield B[b(0x136)]());yield this[b(0xff)][b(0xf2)][b(0x17c)](F),console[b(0x10d)](b(0x11e),F);})),o=(0x0,utils_1[U(0xfa)])()[U(0x16f)](U(0x16a))[U(0x104)]('Change\x20the\x20default\x20service\x20in\x20the\x20current\x20local\x20context')[U(0x103)](C,U(0x107))[U(0x115)](v=>__awaiter(this,void 0x0,void 0x0,function*(){const a=U,F=(v===null||v===void 0x0?void 0x0:v['id'])||(yield B[a(0x14c)](this['getProjectName']())());console[a(0x10d)](a(0x162),F),yield this[a(0xff)][a(0xf2)]['useServiceId'](F);})),e=(0x0,utils_1['getCommand'])()[U(0x16f)](U(0x11d))[U(0x104)](U(0xfe))[U(0x103)](C,U(0xf8))[U(0x115)](v=>__awaiter(this,void 0x0,void 0x0,function*(){const Z=U,F=(v===null||v===void 0x0?void 0x0:v['id'])||(yield B[Z(0x10e)](this['getProjectName']())());console[Z(0x10d)](Z(0x177),F),yield this[Z(0xff)]['contextProvider'][Z(0x164)](F);}));S[U(0x16c)](j),S[U(0x16c)](e),S['addCommand'](o);const O=(0x0,utils_1[U(0xfa)])()[U(0x16f)]('remove')['alias'](U(0x152))['alias']('rm')[U(0x104)](U(0x166))[U(0x103)](C,U(0x12c))[U(0x115)](v=>__awaiter(this,void 0x0,void 0x0,function*(){const c=U;var F;const x=(v===null||v===void 0x0?void 0x0:v['id'])||(yield this[c(0x137)]('remove')),t=(F=this[c(0xff)][c(0xf2)][c(0x110)]())===null||F===void 0x0?void 0x0:F[c(0x16f)];yield this[c(0xff)][c(0xf2)]['removeContext'](x),(0x0,utils_1['success'])(c(0xf0)+x+c(0xdf));if(!this[c(0x10c)]()){(0x0,utils_1[c(0x124)])(c(0x165));return;}if(t===x){const Q=(v===null||v===void 0x0?void 0x0:v[c(0x16f)])||(yield this[c(0x137)](c(0x144)));yield this[c(0xff)][c(0xf2)][c(0x127)](Q),(0x0,utils_1['success'])(c(0x111)+Q);}})),T=(0x0,utils_1[U(0xfa)])()[U(0x16f)](U(0xf6))[U(0xdd)](U(0x169))['description'](U(0xeb))[U(0x103)](U(0x102),U(0x11a))['action'](v=>__awaiter(this,void 0x0,void 0x0,function*(){const V=U,{contextProvider:F}=this[V(0xff)],x=(v===null||v===void 0x0?void 0x0:v['token'])||(yield B[V(0x143)]()),t=F['getCurrentToken']();yield F[V(0x179)](x);if(yield this[V(0xe9)]())(0x0,utils_1[V(0x116)])(V(0x176)+F[V(0x17a)]()+V(0x139));else{if(t)yield F[V(0x179)](t);(0x0,utils_1[V(0xfd)])(V(0x155));}}));this[U(0x118)]['addCommand'](l),this[U(0x118)]['addCommand'](S),this['contexts']['addCommand'](O),this[U(0x118)][U(0x16c)](T);}[a2f(0x154)](Y,k){var X,B,l,S;return __awaiter(this,void 0x0,void 0x0,function*(){const m=a2k,C=!Y[m(0x10a)],j=(X=Y[m(0x156)])!==null&&X!==void 0x0?X:this['defaultBaseUrl'],o=new browser_login_1[(m(0x172))](j,C,this[m(0x13d)]);let e;o['on']('browser-opened',({url:F})=>{const J=m;if(C){const x=F['replace'](/sessionToken=.*/,J(0xee));console[J(0x10d)](J(0x14b)+x+')'),e=inquirer['prompt']([{'type':'confirm','name':J(0x17d),'message':J(0x14d),'default':![]}]),e['then'](t=>{const H=J;process[H(0x16b)]['moveCursor'](0x0,-0x1),process[H(0x16b)][H(0x175)](0x1),t['fullUrl']&&console[H(0x10d)](H(0x161)+F+'\x20');});}else console[J(0x10d)](J(0x161)+F+'\x20');});const {token:O,contextName:T}=yield o[m(0x171)]()[m(0x131)](F=>__awaiter(this,void 0x0,void 0x0,function*(){const G=m;(0x0,utils_1['error'])(G(0x112)+F[G(0x149)]+'.\x20Using\x20fallback.');const x=yield this[G(0x153)](Y,k);return{'token':x[G(0xe1)],'contextName':x[G(0x16f)]};}))[m(0x150)](()=>{const s=m;if(e)e['ui'][s(0xe0)]();}),v=(l=(B=Y[m(0x16f)])!==null&&B!==void 0x0?B:T)!==null&&l!==void 0x0?l:m(0x12d)+new Date()['valueOf']();return{'name':v,'token':O,'host':j,'override':(S=Y[m(0x173)])!==null&&S!==void 0x0?S:![]};});}['apiTokenLogin'](Y,k){return __awaiter(this,void 0x0,void 0x0,function*(){const I=a2k,X=this[I(0xff)]['contextProvider']['loadContextWrapper']()[I(0x118)],{name:B,token:l,host:S,override:C}=yield k['loginPrompt'](Y,X);return{'name':B,'token':l,'host':S,'override':C};});}['getProjectName'](){const u=a2f,Y=this['apiClient'][u(0xf2)]['getCurrentProjectName']();if(Y===undefined)throw new Error(u(0x12b));return Y;}[a2f(0x137)](Y){return __awaiter(this,void 0x0,void 0x0,function*(){const i=a2k;if(!this[i(0x10c)]())throw new Error(i(0x167));const k=this[i(0xff)][i(0xf2)]['loadContextWrapper']()['contexts']['map'](B=>B['name']),X=k[i(0x16e)]>0x4?i(0xea):i(0x122);return(yield inquirer[i(0x157)]([{'type':X,'name':i(0x16f),'message':'Choose\x20the\x20context\x20to\x20'+Y+':','choices':k}]))[i(0x16f)];});}['contextAvailable'](){const W=a2f;return this[W(0xff)][W(0xf2)][W(0x125)]()[W(0x118)][W(0x16e)]>0x0;}[a2f(0xe9)](){return __awaiter(this,void 0x0,void 0x0,function*(){const Y0=a2k;try{const Y=this[Y0(0xff)]['contextProvider'][Y0(0x132)](),k=this[Y0(0xff)][Y0(0xf2)]['getCurrentToken'](),X=Y+Y0(0x15b),B={'Authorization':Y0(0x12f)+k},l=new proxy_agent_1[(Y0(0x14a))](),S=yield(0x0,utils_1[Y0(0x141)])(0x3)(()=>__awaiter(this,void 0x0,void 0x0,function*(){const Y1=Y0;return(0x0,utils_1[Y1(0x129)])(X,{'method':'GET','signal':AbortSignal[Y1(0x15c)](0xbb8),'headers':B,'agent':l});}));if(S['ok'])return!![];return![];}catch(C){return![];}});}}exports[a2f(0x140)]=CliContext;
1
+ 'use strict';const a2y=a2K;(function(U,K){const B=a2K,q=U();while(!![]){try{const X=parseInt(B(0x15a))/0x1+-parseInt(B(0x179))/0x2*(parseInt(B(0x178))/0x3)+parseInt(B(0x197))/0x4*(parseInt(B(0x14a))/0x5)+parseInt(B(0x13d))/0x6+parseInt(B(0x1b5))/0x7+-parseInt(B(0x1a0))/0x8*(parseInt(B(0x14c))/0x9)+parseInt(B(0x19b))/0xa;if(X===K)break;else q['push'](q['shift']());}catch(J){q['push'](q['shift']());}}}(a2U,0x67dff));var __createBinding=this&&this[a2y(0x193)]||(Object[a2y(0x172)]?function(U,K,q,X){const x=a2y;if(X===undefined)X=q;var J=Object['getOwnPropertyDescriptor'](K,q);(!J||(x(0x125)in J?!K['__esModule']:J[x(0x142)]||J['configurable']))&&(J={'enumerable':!![],'get':function(){return K[q];}}),Object[x(0x199)](U,X,J);}:function(U,K,q,X){if(X===undefined)X=q;U[X]=K[q];}),__setModuleDefault=this&&this['__setModuleDefault']||(Object[a2y(0x172)]?function(U,K){Object['defineProperty'](U,'default',{'enumerable':!![],'value':K});}:function(U,K){const a=a2y;U[a(0x15c)]=K;}),__importStar=this&&this[a2y(0x13b)]||function(U){const m=a2y;if(U&&U[m(0x12a)])return U;var K={};if(U!=null){for(var q in U)if(q!=='default'&&Object[m(0x141)][m(0x133)]['call'](U,q))__createBinding(K,U,q);}return __setModuleDefault(K,U),K;},__awaiter=this&&this[a2y(0x1ac)]||function(U,K,q,X){function J(v){return v instanceof q?v:new q(function(f){f(v);});}return new(q||(q=Promise))(function(v,f){const s=a2K;function L(z){const i=a2K;try{E(X[i(0x17e)](z));}catch(p){f(p);}}function M(z){const G=a2K;try{E(X[G(0x16c)](z));}catch(p){f(p);}}function E(z){const A=a2K;z[A(0x155)]?v(z[A(0x14f)]):J(z['value'])['then'](L,M);}E((X=X[s(0x162)](U,K||[]))[s(0x17e)]());});},__importDefault=this&&this['__importDefault']||function(U){const D=a2y;return U&&U[D(0x12a)]?U:{'default':U};};function a2U(){const U1=['getCurrentContext','warning','__importStar','catch','298884PflXku','log','Change\x20current\x20context\x20to\x20context\x20identified\x20by\x20this\x20name','action','prototype','writable','finally','\x27\x20successfully\x20updated.','token\x20login','browserLogin','Contexts','getCommand','host','55OrUhLR','clearLine','1243332wpWlNo','autologin-','replace','value','startLogin','useProjectId','-n,\x20--name\x20[NAME]','askForService','list','done','askForProject','Use\x20browser\x20login\x20but\x20only\x20print\x20URL\x20which\x20can\x20be\x20used\x20to\x20login','contextProvider','../formatting/console-format-helpers','633745wwLuwK','getCurrentName','default','doNotOpenBrowser','login','chalk','contextAvailable','set','apply','Shows\x20full\x20context\x20information\x20(including\x20tokens)','host\x20url\x20for\x20this\x20context','update-token','all','\x0aSuccessfully\x20logged\x20in\x20using\x20','--all','No\x20project\x20in\x20current\x20context.\x20Please\x20set\x20project\x20before\x20setting\x20a\x20project-scoped\x20resource','agent','CliContext','throw','../inquirer-helper','getCurrentToken','Error\x20occured\x20during\x20browser\x20login:\x20','map','-t,\x20--token\x20[TOKEN]','create','Token\x20for\x20this\x20context','tokenLogin','Name\x20for\x20login\x20context','updateToken','search-list','3MjpbfC','1656366gBJlef','use','Project\x20name\x20(internal\x20id)\x20to\x20use\x20as\x20default\x20in\x20context','No\x20context\x20available.\x20Use\x20\x27northflank\x20login\x27\x20to\x20create\x20context.','message','next','project','Job\x20name\x20(internal\x20id)\x20to\x20use\x20as\x20default\x20in\x20context','Change\x20the\x20default\x20job\x20in\x20the\x20current\x20local\x20context','Use\x20job\x20with\x20id:','description','success','remove',',\x20added\x20context\x20with\x20name\x20','italic','Use\x20service\x20with\x20id:','Token\x20for\x20current\x20context\x20\x27','loadContextWrapper','current','confirm','close','useJobId','../utils','Choose\x20the\x20context\x20to\x20','Change\x20the\x20default\x20service\x20in\x20the\x20current\x20local\x20context','node-fetch','__createBinding','addCommand','getProjectName','List\x20all\x20available\x20contexts','64164GbrgrX','override','defineProperty','Changed\x20current\x20context\x20to\x20','8036460llSaep','then','name','Override\x20existing\x20contexts\x20(this\x20will\x20remove\x20project\x20and\x20service\x20context)','job','24cZzBny','--token-login','Failed\x20to\x20login\x20with\x20the\x20provided\x20token,\x20make\x20sure\x20to\x20use\x20a\x20valid\x20token\x20and\x20host.','\x20(current)','askForContext','set-token','--host\x20[HOST]','useContext','verifyToken','proxy-agent','\x20(api\x20host:\x20','Open\x20this\x20URL\x20in\x20your\x20browser\x20and\x20follow\x20the\x20steps:\x0a\x09','__awaiter','option','moveCursor','defaultBaseUrl','printAsTable','NorthflankApiBrowserLogin','askForJob','delete','error','31094ByPJRb','useServiceId','.\x20Using\x20fallback.','alias','stdout','--do-not-open-browser','token','No\x20context\x20available.\x20Please\x20use\x20\x27northflank\x20login\x27\x20to\x20create\x20context.','get','tokenPrompt','Remove\x20a\x20context','service','sanitiseHostname','__esModule','retry','prompt','apiTokenLogin','\x27\x20successfully\x20removed.','ctx','Bearer\x20','contexts','Switch\x20between\x20your\x20local\x20contexts','hasOwnProperty','apiClient','Update\x20token\x20for\x20current\x20context','browser\x20login','context','addContext'];a2U=function(){return U1;};return a2U();}function a2K(U,K){const q=a2U();return a2K=function(X,J){X=X-0x11e;let v=q[X];return v;},a2K(U,K);}Object[a2y(0x199)](exports,a2y(0x12a),{'value':!![]}),exports['CliContext']=void 0x0;const _=__importStar(require('lodash')),proxy_agent_1=require(a2y(0x1a9)),chalk_1=__importDefault(require(a2y(0x15f))),utils_1=require(a2y(0x18f)),inquirer_helper_1=require(a2y(0x16d)),console_format_helpers_1=require(a2y(0x159)),browser_login_1=require('../login/browser-login'),node_fetch_1=__importDefault(require(a2y(0x192))),inquirer=require('inquirer');class CliContext{constructor(U,K=undefined,q='https://api.northflank.com'){const H=a2y;this[H(0x16a)]=K,this[H(0x1af)]=q,this[H(0x129)]=O=>{const g=H;let F=O;return!/^https?:\/\//i['test'](F)&&(F='https://'+F),F=F[g(0x14e)](/\/+$/,''),F;},this[H(0x134)]=U;const X=new inquirer_helper_1['InquirerHelper'](U);this[H(0x15e)]=(0x0,utils_1['getCommand'])()[H(0x19d)](H(0x15e))[H(0x183)]('Connect\x20the\x20CLI\x20to\x20your\x20Northflank\x20account.')[H(0x1ad)](H(0x1a1),'Use\x20manual\x20login\x20with\x20API\x20token',![])[H(0x1ad)](H(0x122),H(0x157),![])[H(0x1ad)](H(0x152),H(0x175))[H(0x1ad)]('-t,\x20--token\x20[TOKEN]','Token\x20for\x20this\x20context.\x20When\x20set,\x20browser\x20login\x20is\x20not\x20used')[H(0x1ad)](H(0x1a6),H(0x164),this[H(0x1af)])['option']('--override',H(0x19e),![])[H(0x140)](O=>__awaiter(this,void 0x0,void 0x0,function*(){const S=H;_[S(0x161)](O,'host',this['sanitiseHostname'](O[S(0x149)]));const F=O[S(0x174)]||O[S(0x123)]!==undefined,{name:o,host:Q,token:w,override:R}=F?yield this['apiTokenLogin'](O,X):yield this[S(0x146)](O,X);try{yield this[S(0x134)][S(0x158)][S(0x138)]({'name':o,'host':Q,'token':w},R);}catch(W){(0x0,utils_1[S(0x1b4)])(W[S(0x17d)]);return;}if(!(yield this[S(0x1a8)]()))(0x0,utils_1['error'])(S(0x1a2)),yield this[S(0x134)][S(0x158)]['removeContext'](o);else{const V=F?S(0x145):S(0x136),b=S(0x167)+V+S(0x186)+chalk_1[S(0x15c)][S(0x187)](o)+S(0x1aa)+Q+')';(0x0,utils_1[S(0x184)])(b);}})),this['contexts']=(0x0,utils_1['getCommand'])()[H(0x19d)](H(0x137))[H(0x183)]('Retrieve\x20and\x20update\x20local\x20context\x20settings.')[H(0x120)]('contexts')['alias'](H(0x12f));const J=(0x0,utils_1[H(0x148)])()['name'](H(0x154))[H(0x19d)]('ls')[H(0x183)](H(0x196))[H(0x1ad)](H(0x168),H(0x163))[H(0x140)](O=>__awaiter(this,void 0x0,void 0x0,function*(){const C=H;console[C(0x13e)](U[C(0x158)]['getInfo']());const F=U['contextProvider'][C(0x18a)]();if(O[C(0x166)]===!![]){console['dir'](F);return;}const o=F[C(0x18b)],Q=F[C(0x131)]['sort']((w,R)=>w[C(0x19d)]===o?-0x1:R['name']===o?0x1:0x0)[C(0x170)](w=>{const N=C,R=o===w[N(0x19d)]?N(0x1a3):'';return{'Name':''+w[N(0x19d)]+R,'Host':w[N(0x149)],'Default\x20Project':w[N(0x17f)]||'-','Default\x20Service':w[N(0x128)]||'-'};});(0x0,console_format_helpers_1[C(0x1b0)])(Q,C(0x147));})),v=(0x0,utils_1[H(0x148)])();v[H(0x19d)](H(0x17a))[H(0x183)](H(0x132))[H(0x1ad)]('-n,\x20--name\x20[NAME]',H(0x13f))['action'](O=>__awaiter(this,void 0x0,void 0x0,function*(){const Z=H,F=(O===null||O===void 0x0?void 0x0:O[Z(0x19d)])||(yield this['askForContext']('use'));yield this['apiClient'][Z(0x158)][Z(0x1a7)](F),(0x0,utils_1[Z(0x184)])('Changed\x20current\x20context\x20to\x20'+F);}));const f='-i,\x20--id\x20[ID]',L=(0x0,utils_1[H(0x148)])()[H(0x19d)](H(0x17f))['description']('Change\x20the\x20default\x20project\x20in\x20the\x20current\x20local\x20context')[H(0x1ad)](f,H(0x17b))[H(0x140)](O=>__awaiter(this,void 0x0,void 0x0,function*(){const e=H,F=(O===null||O===void 0x0?void 0x0:O['id'])||(yield X[e(0x156)]());yield this[e(0x134)][e(0x158)][e(0x151)](F),console[e(0x13e)]('Use\x20project\x20with\x20id:',F);})),M=(0x0,utils_1[H(0x148)])()[H(0x19d)](H(0x128))[H(0x183)](H(0x191))[H(0x1ad)](f,'Service\x20name\x20(internal\x20id)\x20to\x20use\x20as\x20default\x20in\x20context')['action'](O=>__awaiter(this,void 0x0,void 0x0,function*(){const n=H,F=(O===null||O===void 0x0?void 0x0:O['id'])||(yield X[n(0x153)](this[n(0x195)]())());console['log'](n(0x188),F),yield this['apiClient'][n(0x158)][n(0x11e)](F);})),E=(0x0,utils_1[H(0x148)])()[H(0x19d)](H(0x19f))[H(0x183)](H(0x181))[H(0x1ad)](f,H(0x180))[H(0x140)](O=>__awaiter(this,void 0x0,void 0x0,function*(){const t=H,F=(O===null||O===void 0x0?void 0x0:O['id'])||(yield X[t(0x1b2)](this['getProjectName']())());console[t(0x13e)](t(0x182),F),yield this['apiClient'][t(0x158)][t(0x18e)](F);}));v[H(0x194)](L),v['addCommand'](E),v['addCommand'](M);const z=(0x0,utils_1[H(0x148)])()[H(0x19d)](H(0x185))[H(0x120)](H(0x1b3))['alias']('rm')[H(0x183)](H(0x127))[H(0x1ad)](f,'Local\x20context\x20name\x20to\x20remove.')['action'](O=>__awaiter(this,void 0x0,void 0x0,function*(){const Y=H;var F;const o=(O===null||O===void 0x0?void 0x0:O['id'])||(yield this['askForContext']('remove')),Q=(F=this['apiClient'][Y(0x158)][Y(0x139)]())===null||F===void 0x0?void 0x0:F[Y(0x19d)];yield this[Y(0x134)][Y(0x158)]['removeContext'](o),(0x0,utils_1[Y(0x184)])('Local\x20context\x20\x27'+o+Y(0x12e));if(!this[Y(0x160)]()){(0x0,utils_1[Y(0x13a)])(Y(0x17c));return;}if(Q===o){const w=(O===null||O===void 0x0?void 0x0:O[Y(0x19d)])||(yield this[Y(0x1a4)]('use\x20from\x20now\x20on'));yield this[Y(0x134)][Y(0x158)][Y(0x1a7)](w),(0x0,utils_1[Y(0x184)])(Y(0x19a)+w);}})),p=(0x0,utils_1[H(0x148)])()[H(0x19d)](H(0x165))[H(0x120)](H(0x1a5))[H(0x183)](H(0x135))['option'](H(0x171),H(0x173))[H(0x140)](O=>__awaiter(this,void 0x0,void 0x0,function*(){const l=H,{contextProvider:F}=this[l(0x134)],o=(O===null||O===void 0x0?void 0x0:O['token'])||(yield X[l(0x126)]()),Q=F[l(0x16e)]();yield F['updateToken'](o);if(yield this[l(0x1a8)]())(0x0,utils_1['success'])(l(0x189)+F[l(0x15b)]()+l(0x144));else{if(Q)yield F[l(0x176)](Q);(0x0,utils_1[l(0x1b4)])('Failed\x20to\x20login\x20with\x20the\x20provided\x20token.\x20Token\x20was\x20not\x20changed');}}));this[H(0x131)]['addCommand'](J),this[H(0x131)][H(0x194)](v),this[H(0x131)][H(0x194)](z),this[H(0x131)]['addCommand'](p);}[a2y(0x146)](U,K){var q,X,J,v;return __awaiter(this,void 0x0,void 0x0,function*(){const T=a2K,f=!U[T(0x15d)],L=(q=U[T(0x149)])!==null&&q!==void 0x0?q:this[T(0x1af)],M=new browser_login_1[(T(0x1b1))](L,f,this[T(0x16a)]);let E;M['on']('browser-opened',({url:F})=>{const I=T;if(f){const o=F[I(0x14e)](/sessionToken=.*/,'sessionToken=********');console[I(0x13e)]('Follow\x20the\x20steps\x20displayed\x20on\x20the\x20page\x20opened\x20in\x20the\x20browser\x20(URL\x20opened:\x20'+o+')'),E=inquirer[I(0x12c)]([{'type':I(0x18c),'name':'fullUrl','message':'Display\x20full\x20URL\x20to\x20allow\x20opening\x20the\x20link\x20manually','default':![]}]),E[I(0x19c)](Q=>{const c=I;process[c(0x121)][c(0x1ae)](0x0,-0x1),process[c(0x121)][c(0x14b)](0x1),Q['fullUrl']&&console[c(0x13e)](c(0x1ab)+F+'\x20');});}else console[I(0x13e)](I(0x1ab)+F+'\x20');});const {token:z,contextName:p}=yield M[T(0x150)]()[T(0x13c)](F=>__awaiter(this,void 0x0,void 0x0,function*(){const h=T;(0x0,utils_1[h(0x1b4)])(h(0x16f)+F[h(0x17d)]+h(0x11f));const o=yield this['apiTokenLogin'](U,K);return{'token':o['token'],'contextName':o[h(0x19d)]};}))[T(0x143)](()=>{const P=T;if(E)E['ui'][P(0x18d)]();}),O=(J=(X=U[T(0x19d)])!==null&&X!==void 0x0?X:p)!==null&&J!==void 0x0?J:T(0x14d)+new Date()['valueOf']();return{'name':O,'token':z,'host':L,'override':(v=U[T(0x198)])!==null&&v!==void 0x0?v:![]};});}[a2y(0x12d)](U,K){return __awaiter(this,void 0x0,void 0x0,function*(){const k=a2K,q=this[k(0x134)]['contextProvider'][k(0x18a)]()[k(0x131)],{name:X,token:J,host:v,override:f}=yield K['loginPrompt'](U,q);return{'name':X,'token':J,'host':v,'override':f};});}['getProjectName'](){const u=a2y,U=this[u(0x134)]['contextProvider']['getCurrentProjectName']();if(U===undefined)throw new Error(u(0x169));return U;}[a2y(0x1a4)](U){return __awaiter(this,void 0x0,void 0x0,function*(){const d=a2K;if(!this[d(0x160)]())throw new Error(d(0x124));const K=this[d(0x134)][d(0x158)][d(0x18a)]()['contexts'][d(0x170)](X=>X[d(0x19d)]),q=K['length']>0x4?d(0x177):'list';return(yield inquirer[d(0x12c)]([{'type':q,'name':d(0x19d),'message':d(0x190)+U+':','choices':K}]))['name'];});}['contextAvailable'](){const r=a2y;return this['apiClient'][r(0x158)]['loadContextWrapper']()[r(0x131)]['length']>0x0;}[a2y(0x1a8)](){return __awaiter(this,void 0x0,void 0x0,function*(){const j=a2K;try{const U=this[j(0x134)][j(0x158)]['getCurrentBaseUrl'](),K=this[j(0x134)][j(0x158)][j(0x16e)](),q=U+'/v1/login',X={'Authorization':j(0x130)+K},J=new proxy_agent_1['ProxyAgent'](),v=yield(0x0,utils_1[j(0x12b)])(0x3)(()=>__awaiter(this,void 0x0,void 0x0,function*(){const U0=j;return(0x0,node_fetch_1[U0(0x15c)])(q,{'method':'GET','signal':AbortSignal['timeout'](0xbb8),'headers':X,'agent':J});}));if(v['ok'])return!![];return![];}catch(f){return![];}});}}exports[a2y(0x16b)]=CliContext;
@@ -0,0 +1 @@
1
+ 'use strict';function a3U(){const n=['--container\x20--containerId\x20[NAME]','ed-file.txt\x0a\x20\x20','\x27\x20to\x20\x27','uploadCmd','apiClient','CopyType','local','Uploaded\x20file\x20from\x20\x27','getCommand','from','option','@northflank/js-client','success','Don\x27t\x20use\x20context\x20default\x20values,\x20explicitly\x20use\x20options\x20or\x20ask.','\x27remotePath\x27','Id\x20[NAME]','InquirerHelper','localPath','inquirer','askForProject','File\x20and\x20directory\x20upload\x20for\x20Northflank\x20services\x20and\x20jobs.','remotePath','file','File\x20and\x20directory\x20download\x20for\x20Northflank\x20job.','logCopyResult','throw','../utils','File\x20and\x20directory\x20upload\x20for\x20Northflank\x20service.','DIRECTORY_UPLOAD','remote','116ddLvUY','input','done','File\x20and\x20directory\x20download\x20for\x20Northflank\x20services\x20and\x20jobs.','ensureRelevantPathIsSet','--noDefaults','588124PQpuNr','FILE_UPLOAD','getCurrentProjectName','Container\x20used\x20to\x20','.\x20If\x20the\x20','then','upload','54VSIume','\x20directory:\x20\x20\x20\x20\x20northflank\x20','action','-dir','\x20directory\x20is\x20used.\x20If\x20the\x20directory\x20for\x20','--remote\x20--remotePath\x20[REMOTEPATH]','Remote\x20file\x20or\x20directory','alias','3952KHKrmw','1077387JtCIQv','ApiClient','\x20to\x20','\x20single\x20file:\x20\x20\x20northflank\x20','--local\x20--localPath\x20[LOCALPATH]','getCurrentServiceName','Project\x20for\x20','askForJob','\x27\x20to\x20local\x20directory\x20\x27','slice','474ipCKOY','\x20file\x20--localPath\x20my_directory/my-file.txt\x20--remotePath\x20/home/my-','addCommand','\x20(random\x20container\x20will\x20be\x20chosen\x20if\x20not\x20specified)','\x20is\x20required\x20for\x20','current\x20working','assertContextExisting','askForPath','3202860SIQVfo','Uploaded\x20all\x20directory\x20contents\x20from\x20\x27','service','charAt','1195TVUqOl','name','defineProperty','lodash','s.\x20Please\x20enter\x20a\x20path:','File\x20and\x20directory\x20upload\x20for\x20Northflank\x20job.','Path\x20is\x20not\x20specified,\x20the\x20','files','\x20files','getStandardCopyCommand','--project\x20--projectId\x20[NAME]','332291nmCLHv','next','../inquirer-helper','value','\x20--','Path\x20does\x20not\x20exist,\x20it\x20will\x20be\x20created.\x0aExamples:\x0a\x20\x20','downloadCmd','10997uPTVAx','\x20files\x20','download','description'];a3U=function(){return n;};return a3U();}const a3A=a3K;function a3K(U,K){const q=a3U();return a3K=function(X,J){X=X-0x187;let v=q[X];return v;},a3K(U,K);}(function(U,K){const a=a3K,q=U();while(!![]){try{const X=parseInt(a(0x1bf))/0x1+-parseInt(a(0x18e))/0x2+parseInt(a(0x19e))/0x3+-parseInt(a(0x188))/0x4*(parseInt(a(0x1b4))/0x5)+-parseInt(a(0x1a8))/0x6*(-parseInt(a(0x1c6))/0x7)+-parseInt(a(0x19d))/0x8*(-parseInt(a(0x195))/0x9)+-parseInt(a(0x1b0))/0xa;if(X===K)break;else q['push'](q['shift']());}catch(J){q['push'](q['shift']());}}}(a3U,0x3025e));var __awaiter=this&&this['__awaiter']||function(U,K,q,X){function J(v){return v instanceof q?v:new q(function(f){f(v);});}return new(q||(q=Promise))(function(v,f){const G=a3K;function L(z){try{E(X['next'](z));}catch(p){f(p);}}function M(z){const m=a3K;try{E(X[m(0x1e3)](z));}catch(p){f(p);}}function E(z){const i=a3K;z[i(0x18a)]?v(z[i(0x1c2)]):J(z['value'])[i(0x193)](L,M);}E((X=X['apply'](U,K||[]))[G(0x1c0)]());});};Object[a3A(0x1b6)](exports,'__esModule',{'value':!![]}),exports['CliFileCopy']=void 0x0;const js_client_1=require(a3A(0x1d5)),utils_1=require(a3A(0x1e4)),inquirer_helper_1=require(a3A(0x1c1)),lodash_1=require(a3A(0x1b7)),inquirer=require(a3A(0x1dc));class CliFileCopy{constructor(U,K){const s=a3A;this[s(0x1bd)]=(E,z)=>{const D=s,p=(0x0,lodash_1['capitalize'])(z),O=z===D(0x194)?D(0x187):D(0x1d0),F=z===D(0x194)?'user\x20home':D(0x1ad),o=z===D(0x194)?'to':D(0x1d3);return(0x0,utils_1[D(0x1d2)])(!![])[D(0x1b5)](D(0x1e0))[D(0x1c9)](p+D(0x1c7)+o+'\x20the\x20specified\x20'+E+D(0x192)+O+D(0x1ba)+F+D(0x199)+O+D(0x1c4)+p+D(0x1a1)+z+'\x20'+E+D(0x1a9)+z+D(0x1cb)+p+D(0x196)+z+'\x20'+E+'\x20file\x20--localPath\x20my_directory\x20--remotePath\x20/home/'+z+D(0x198))['option'](D(0x1be),D(0x1a4)+z)[D(0x1d4)]('--'+E+D(0x1c3)+E+D(0x1d9),E[D(0x1b3)](0x0)['toUpperCase']()+E[D(0x1a7)](0x1)+D(0x1a0)+z+D(0x1bc))[D(0x1d4)](D(0x1ca),D(0x191)+z+D(0x1ab))[D(0x1d4)](D(0x1a2),'Local\x20file\x20or\x20directory')[D(0x1d4)](D(0x19a),D(0x19b))[D(0x1d4)](D(0x18d),D(0x1d7),![]);},this['logCopyResult']=(E,z)=>{const H=s;if(z)return;const {sourceDirectory:p,targetDirectory:O,sourceFile:F,targetFile:o}=E;switch(E['type']){case js_client_1[H(0x1cf)]['DIRECTORY_DOWNLOAD']:{(0x0,utils_1[H(0x1d6)])('Downloaded\x20all\x20directory\x20contents\x20from\x20\x27'+p+H(0x1a6)+O+'\x27');break;}case js_client_1[H(0x1cf)]['FILE_DOWNLOAD']:{(0x0,utils_1[H(0x1d6)])('Downloaded\x20file\x20\x27'+p+'/'+F+H(0x1cc)+O+'/'+o+'\x27');break;}case js_client_1[H(0x1cf)][H(0x1e6)]:{(0x0,utils_1[H(0x1d6)])(H(0x1b1)+p+'\x27\x20to\x20container\x20directory\x20\x27'+O+'\x27');break;}case js_client_1[H(0x1cf)][H(0x18f)]:{(0x0,utils_1[H(0x1d6)])(H(0x1d1)+p+'/'+F+H(0x1cc)+O+'/'+o+'\x27');break;}}},this[s(0x18c)]=(E,z)=>__awaiter(this,void 0x0,void 0x0,function*(){const g=s,p=E==='download'&&z['remotePath']===undefined?yield this['askForPath'](g(0x1d8),g(0x1c8)):z[g(0x1df)],O=E===g(0x194)&&z[g(0x1db)]===undefined?yield this[g(0x1af)]('\x27localPath\x27',g(0x194)):z['localPath'];return{'localPath':O,'remotePath':p};}),this[s(0x1af)]=(E,z)=>__awaiter(this,void 0x0,void 0x0,function*(){const S=s,p=E+S(0x1ac)+z+S(0x1b8);return(yield inquirer['prompt']([{'type':S(0x189),'name':'name','message':p}]))[S(0x1b5)];}),this['apiClient']=new js_client_1[(s(0x19f))](U,{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1['customUserAgent'],'agent':K});const q=new inquirer_helper_1[(s(0x1da))](this[s(0x1ce)]);this[s(0x1c5)]=(0x0,utils_1[s(0x1d2)])()[s(0x1b5)](s(0x1c8))[s(0x19c)]('dl')[s(0x1c9)](s(0x18b)),this[s(0x1cd)]=(0x0,utils_1[s(0x1d2)])()[s(0x1b5)](s(0x194))['alias']('ul')[s(0x1c9)](s(0x1de));const X=(0x0,utils_1[s(0x1d2)])()[s(0x1b5)](s(0x1b2))['description']('File\x20and\x20directory\x20download\x20for\x20Northflank\x20service.'),J=(0x0,utils_1[s(0x1d2)])()['name'](s(0x1b2))['description'](s(0x1e5)),v=(0x0,utils_1[s(0x1d2)])()[s(0x1b5)]('job')[s(0x1c9)](s(0x1e1)),f=(0x0,utils_1['getCommand'])()[s(0x1b5)]('job')[s(0x1c9)](s(0x1b9)),L=E=>{const C=s;return this[C(0x1bd)]('service',E)[C(0x197)](z=>__awaiter(this,void 0x0,void 0x0,function*(){const N=C,{projectId:p,serviceId:O,containerId:F,noDefaults:o,quiet:Q}=z;(0x0,utils_1['assertContextExisting'])(this[N(0x1ce)]);const w=o?undefined:U[N(0x190)](),R=p||w||(yield q[N(0x1dd)]()),W=o?undefined:U[N(0x1a3)](),V=O||W||(yield q['askForService'](R)()),{remotePath:b,localPath:B}=yield this[N(0x18c)](E,z),y={'projectId':R,'serviceId':V},x=yield this['apiClient'][E][N(0x1b2)][N(0x1bb)](y,{'containerName':F,'localPath':B,'remotePath':b});this[N(0x1e2)](x,Q);}));},M=E=>{const Z=s;return this['getStandardCopyCommand']('job',E)[Z(0x197)](z=>__awaiter(this,void 0x0,void 0x0,function*(){const e=Z,{projectId:p,jobId:O,containerId:F,noDefaults:o,quiet:Q}=z;(0x0,utils_1[e(0x1ae)])(this[e(0x1ce)]);const w=o?undefined:U[e(0x190)](),R=p||w||(yield q[e(0x1dd)]()),W=O||(yield q[e(0x1a5)](R)()),{remotePath:V,localPath:b}=yield this[e(0x18c)](E,z),B={'projectId':R,'jobId':W},y=yield this[e(0x1ce)][E]['job'][e(0x1bb)](B,{'containerName':F,'localPath':b,'remotePath':V});this[e(0x1e2)](y,Q);}));};X[s(0x1aa)](L(s(0x1c8))),v['addCommand'](M('download')),J['addCommand'](L(s(0x194))),f['addCommand'](M(s(0x194))),this['downloadCmd'][s(0x1aa)](X),this[s(0x1c5)][s(0x1aa)](v),this[s(0x1cd)][s(0x1aa)](J),this['uploadCmd'][s(0x1aa)](f);}}exports['CliFileCopy']=CliFileCopy;