@northflank/cli 0.10.6 → 0.10.8

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